Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
// Fallback descriptions for commands that don't return proper help information
const
:
<
string
,
>
=
{
'['
:
{
:
'Test if a statement is true'
,
:
'Evaluate an expression and return a status of true (0) or false (non-zero). Unlike the `test` command, the `[` command requires a closing `]`.'
,
:
'EXPRESSION ]'
}
,
'break'
:
{
:
'Exit the current loop'
,
:
'Terminate the execution of the nearest enclosing `while` or `for` loop and proceed with the next command after the loop.'
,
:
undefined
}
,
'breakpoint'
:
{
:
'Launch debug mode'
,
:
'Pause execution and launch an interactive debug prompt. This is useful for inspecting the state of a script at a specific point.'
,
:
undefined
}
,
'case'
:
{
:
'Match a value against patterns'
,
:
'Within a `switch` block, the `case` command specifies patterns to match against the given value, executing the associated block if a match is found.'
,
:
'PATTERN...'
}
,
'continue'
:
{
:
'Skip to the next iteration of a loop'
,
:
'Within a `while` or `for` loop, `continue` skips the remaining commands in the current iteration and proceeds to the next iteration of the loop.'
,
:
undefined
}
,
'else'
:
{
:
'Execute commands if the previous condition was false'
,
:
'In an `if` block, the `else` section contains commands that execute if none of the preceding `if` or `else if` conditions were true.'
,
:
undefined
}
,
'end'
:
{
:
'Terminate a block of code'
,
:
'Conclude a block of code initiated by constructs like `if`, `switch`, `while`, `for`, or `function`.'
,
:
undefined
}
,
'eval'
:
{
:
'Execute arguments as a command'
,
:
'Concatenate all arguments into a single command and execute it. This allows for dynamic construction and execution of commands.'
,
:
'COMMAND...'
}
,
'false'
:
{
:
'Return an unsuccessful result'
,
:
'A command that returns a non-zero exit status, indicating failure. It is often used in scripts to represent a false condition.'
,
:
undefined
}
,
'realpath'
:
{
:
'Resolve and print the absolute path'
,
:
'Convert each provided path to its absolute, canonical form by resolving symbolic links and relative path components.'
,
:
'PATH...'
}
,
':'
:
{
:
'No operation command'
,
:
'The `:` command is a no-op (no operation) command that returns a successful (zero) exit status. It can be used as a placeholder in scripts where a command is syntactically required but no action is desired.'
,
:
undefined
}
,
'test'
:
{
:
'Evaluate conditional expressions'
,
:
'The `test` command evaluates conditional expressions and sets the exit status to 0 if the expression is true, and 1 if it is false. It supports various operators to evaluate expressions related to strings, numbers, and file attributes.'
,
:
'EXPRESSION'
}
,
'true'
:
{
:
'Return a successful result'
,
:
'The `true` command always returns a successful (zero) exit status. It is often used in scripts and conditional statements where an unconditional success result is needed.'
,
:
undefined
}
,
'printf'
:
{
:
'Display formatted text'
,
:
'The `printf` command formats and prints text according to a specified format string. Unlike `echo`, `printf` does not append a newline unless explicitly included in the format.'
,
:
'FORMAT [ARGUMENT...]'
}
}
;
async
function
createCommandDescriptionsCache
(
)
:
Promise
<
void
>
{
const
:
<
string
,
{
?
:
string
;
:
string
;
:
string
|
undefined
}
>
=
new
Map
(
)
;
try
{
// Get list of all builtins
const
=
await
execAsync
(
'fish -c "builtin -n"'
)
.
then
(
=>
.
.
trim
(
)
)
;
const
=
.
split
(
'\n'
)
;
console
.
log
(
`Found ${builtins.length} Fish builtin commands`
)
;
for
(
const
of
)
{
try
{
// Get help info for each builtin
const
=
await
execAsync
(
`fish -c "${cmd} --help 2>&1"`
)
.
then
(
=>
.
)
;
let
=
false
;
if
(
&&
!
.
includes
(
'No help for function'
)
&&
!
.
includes
(
'See the web documentation'
)
)
{
const
=
cleanupText
(
)
;
// Split the text into lines to process
const
=
.
split
(
'\n'
)
;
// Extract the short description, args, and full description
const
{
,
,
}
=
extractHelpContent
(
,
)
;
.
set
(
,
{
,
,
}
)
;
=
!==
''
;
}
if
(
!
)
{
// Use fallback descriptions for commands that don't return proper help
if
(
[
]
)
{
console
.
info
(
`Using fallback description for ${cmd}`
)
;
.
set
(
,
[
]
)
;
}
else
{
console
.
info
(
`No fallback description exists for ${cmd}`
)
;
}
}
}
catch
{
// Use fallback descriptions for commands that throw an error
if
(
[
]
)
{
console
.
info
(
'Using fallback description for'
,
)
;
.
set
(
,
[
]
)
;
}
else
{
console
.
info
(
`Error getting help for ${cmd}`
)
;
}
}
}
}
catch
(
)
{
console
.
error
(
'Error creating Fish builtins cache:'
,
)
;
.
exit
(
1
)
;
}
=
;
}
/**
* Extracts short description, args, and full description from help text lines
*/
function
extractHelpContent
(
:
string
,
:
string
[
]
)
:
{
:
string
;
:
string
|
undefined
;
:
string
}
{
let
=
''
;
let
:
string
|
undefined
;
let
=
''
;
// Skip the first line (usually just command name and basic usage)
let
=
1
;
// Skip any leading empty lines
while
(
<
.
&&
[
]
.
trim
(
)
.
===
0
)
{
++
;
}
// The next non-empty line after the command name is typically
// either the short description or additional usage info
const
=
;
// Find where the short description starts
if
(
<
.
)
{
// First, check if the line has a command prefix and remove it
let
=
[
]
.
trim
(
)
;
const
=
new
RegExp
(
`^${cmd}\\s*-\\s*`
,
'i'
)
;
=
.
replace
(
,
''
)
;
// First non-empty line is the short description
=
;
++
;
// Next non-empty line (after short description) is typically args
while
(
<
.
&&
[
]
.
trim
(
)
.
===
0
)
{
++
;
}
if
(
<
.
)
{
// Found a line after the short description - that's our args
=
[
]
.
trim
(
)
;
++
;
}
}
// Find the DESCRIPTION marker which marks the end of args section
let
=
-
1
;
for
(
let
=
;
<
.
;
++
)
{
if
(
[
]
.
trim
(
)
===
'DESCRIPTION'
)
{
=
;
break
;
}
}
// If DESCRIPTION marker is found, consider everything between i and descriptionIndex as part of args
if
(
>
)
{
// Combine lines from i up to (but not including) descriptionIndex
const
=
.
slice
(
,
)
.
join
(
'\n'
)
.
trim
(
)
;
if
(
)
{
=
?
`${args}\n${additionalArgs}`
:
;
}
=
+
1
;
// Move past the DESCRIPTION line
}
// The rest is the full description (skipping any empty lines after args)
while
(
<
.
&&
[
]
.
trim
(
)
.
===
0
)
{
++
;
}
// Combine the remaining lines into the full description
=
.
slice
(
.
max
(
,
)
)
.
join
(
'\n'
)
.
trim
(
)
;
// If description is empty, use the short description
if
(
!
&&
)
{
=
;
}
// Extract just the first sentence for short description
const
=
.
indexOf
(
'.'
)
;
if
(
>
0
)
{
=
.
substring
(
0
,
+
1
)
.
trim
(
)
;
}
else
if
(
.
>
100
)
{
=
.
substring
(
0
,
100
)
+
'...'
;
}
return
{
,
,
}
;
}
const
main
=
async
(
)
=>
{
try
{
await
createCommandDescriptionsCache
(
)
;
console
.
log
(
'Created Fish command descriptions cache with'
,
.
,
'entries'
)
;
// Save the cache to a TypeScript file
const
=
.
join
(
,
'../src/shell/fishBuiltinsCache.ts'
)
;
const
=
.
fromEntries
(
)
;
const
=
`${copyright}\n\nexport const fishBuiltinsCommandDescriptionsCache = ${JSON.stringify(cacheObject,null,2)} as const;`
;
await
.
writeFile
(
,
,
'utf8'
)
;
console
.
log
(
'Saved Fish command descriptions cache to fishBuiltinsCache.ts with'