@travisennis/acai 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +225 -6
- package/dist/api/exa/index.d.ts +177 -0
- package/dist/api/exa/index.d.ts.map +1 -0
- package/dist/api/exa/index.js +439 -0
- package/dist/cli.d.ts +3 -2
- package/dist/cli.d.ts.map +1 -0
- package/dist/commands/application-log-command.d.ts +1 -0
- package/dist/commands/application-log-command.d.ts.map +1 -0
- package/dist/commands/application-log-command.js +5 -3
- package/dist/commands/clear-command.d.ts +1 -0
- package/dist/commands/clear-command.d.ts.map +1 -0
- package/dist/commands/clear-command.js +2 -3
- package/dist/commands/compact-command.d.ts +1 -0
- package/dist/commands/compact-command.d.ts.map +1 -0
- package/dist/commands/compact-command.js +1 -1
- package/dist/commands/copy-command.d.ts +1 -0
- package/dist/commands/copy-command.d.ts.map +1 -0
- package/dist/commands/copy-command.js +3 -2
- package/dist/commands/edit-command.d.ts +1 -0
- package/dist/commands/edit-command.d.ts.map +1 -0
- package/dist/commands/edit-command.js +7 -5
- package/dist/commands/edit-prompt-command.d.ts +2 -1
- package/dist/commands/edit-prompt-command.d.ts.map +1 -0
- package/dist/commands/edit-prompt-command.js +15 -7
- package/dist/commands/exit-command.d.ts +13 -2
- package/dist/commands/exit-command.d.ts.map +1 -0
- package/dist/commands/exit-command.js +14 -2
- package/dist/commands/files-command.d.ts +1 -0
- package/dist/commands/files-command.d.ts.map +1 -0
- package/dist/commands/files-command.js +9 -8
- package/dist/commands/generate-rules-command.d.ts +1 -0
- package/dist/commands/generate-rules-command.d.ts.map +1 -0
- package/dist/commands/generate-rules-command.js +4 -3
- package/dist/commands/health-command.d.ts +3 -1
- package/dist/commands/health-command.d.ts.map +1 -0
- package/dist/commands/health-command.js +42 -5
- package/dist/commands/help-command.d.ts +1 -0
- package/dist/commands/help-command.d.ts.map +1 -0
- package/dist/commands/help-command.js +2 -3
- package/dist/commands/init-command.d.ts +1 -0
- package/dist/commands/init-command.d.ts.map +1 -0
- package/dist/commands/init-command.js +1 -2
- package/dist/commands/last-log-command.d.ts +1 -0
- package/dist/commands/last-log-command.d.ts.map +1 -0
- package/dist/commands/last-log-command.js +12 -17
- package/dist/commands/list-tools-command.d.ts +3 -0
- package/dist/commands/list-tools-command.d.ts.map +1 -0
- package/dist/commands/list-tools-command.js +61 -0
- package/dist/commands/manager.d.ts +7 -2
- package/dist/commands/manager.d.ts.map +1 -0
- package/dist/commands/manager.js +43 -6
- package/dist/commands/model-command.d.ts +1 -0
- package/dist/commands/model-command.d.ts.map +1 -0
- package/dist/commands/model-command.js +5 -5
- package/dist/commands/paste-command.d.ts +1 -0
- package/dist/commands/paste-command.d.ts.map +1 -0
- package/dist/commands/paste-command.js +6 -5
- package/dist/commands/prompt-command.d.ts +2 -1
- package/dist/commands/prompt-command.d.ts.map +1 -0
- package/dist/commands/prompt-command.js +62 -8
- package/dist/commands/reset-command.d.ts +1 -0
- package/dist/commands/reset-command.d.ts.map +1 -0
- package/dist/commands/reset-command.js +1 -1
- package/dist/commands/rules-command.d.ts +1 -0
- package/dist/commands/rules-command.d.ts.map +1 -0
- package/dist/commands/rules-command.js +5 -3
- package/dist/commands/save-command.d.ts +1 -0
- package/dist/commands/save-command.d.ts.map +1 -0
- package/dist/commands/save-command.js +1 -1
- package/dist/commands/shell-command.d.ts +3 -0
- package/dist/commands/shell-command.d.ts.map +1 -0
- package/dist/commands/shell-command.js +60 -0
- package/dist/commands/types.d.ts +9 -6
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/usage-command.d.ts +1 -0
- package/dist/commands/usage-command.d.ts.map +1 -0
- package/dist/commands/usage-command.js +2 -3
- package/dist/config.d.ts +22 -34
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +61 -15
- package/dist/conversation-analyzer.d.ts +2 -1
- package/dist/conversation-analyzer.d.ts.map +1 -0
- package/dist/dedent.d.ts +1 -0
- package/dist/dedent.d.ts.map +1 -0
- package/dist/execution/index.d.ts +112 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +432 -0
- package/dist/formatting.d.ts +2 -13
- package/dist/formatting.d.ts.map +1 -0
- package/dist/formatting.js +5 -64
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -4
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/mentions.d.ts +4 -0
- package/dist/mentions.d.ts.map +1 -0
- package/dist/mentions.js +42 -10
- package/dist/messages.d.ts +8 -20
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +33 -53
- package/dist/middleware/audit-message.d.ts +1 -0
- package/dist/middleware/audit-message.d.ts.map +1 -0
- package/dist/middleware/index.d.ts +1 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/rate-limit.d.ts +1 -0
- package/dist/middleware/rate-limit.d.ts.map +1 -0
- package/dist/models/ai-config.d.ts +1 -0
- package/dist/models/ai-config.d.ts.map +1 -0
- package/dist/models/anthropic-provider.d.ts +1 -0
- package/dist/models/anthropic-provider.d.ts.map +1 -0
- package/dist/models/deepseek-provider.d.ts +1 -0
- package/dist/models/deepseek-provider.d.ts.map +1 -0
- package/dist/models/google-provider.d.ts +1 -0
- package/dist/models/google-provider.d.ts.map +1 -0
- package/dist/models/groq-provider.d.ts +20 -0
- package/dist/models/groq-provider.d.ts.map +1 -0
- package/dist/models/groq-provider.js +31 -0
- package/dist/models/manager.d.ts +1 -0
- package/dist/models/manager.d.ts.map +1 -0
- package/dist/models/openai-provider.d.ts +2 -1
- package/dist/models/openai-provider.d.ts.map +1 -0
- package/dist/models/openrouter-provider.d.ts +31 -22
- package/dist/models/openrouter-provider.d.ts.map +1 -0
- package/dist/models/openrouter-provider.js +115 -1
- package/dist/models/providers.d.ts +4 -5
- package/dist/models/providers.d.ts.map +1 -0
- package/dist/models/providers.js +7 -3
- package/dist/models/xai-provider.d.ts +1 -0
- package/dist/models/xai-provider.d.ts.map +1 -0
- package/dist/parsing.d.ts +2 -1
- package/dist/parsing.d.ts.map +1 -0
- package/dist/prompts/manager.d.ts +14 -2
- package/dist/prompts/manager.d.ts.map +1 -0
- package/dist/prompts.d.ts +1 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +15 -11
- package/dist/repl/display-tool-messages.d.ts +4 -0
- package/dist/repl/display-tool-messages.d.ts.map +1 -0
- package/dist/repl/display-tool-messages.js +55 -0
- package/dist/repl/display-tool-use.d.ts +14 -0
- package/dist/repl/display-tool-use.d.ts.map +1 -0
- package/dist/repl/display-tool-use.js +63 -0
- package/dist/repl/get-prompt-header.d.ts +8 -0
- package/dist/repl/get-prompt-header.d.ts.map +1 -0
- package/dist/repl/get-prompt-header.js +38 -0
- package/dist/repl/tool-call-repair.d.ts +4 -0
- package/dist/repl/tool-call-repair.d.ts.map +1 -0
- package/dist/repl/tool-call-repair.js +50 -0
- package/dist/repl-prompt.d.ts +1 -0
- package/dist/repl-prompt.d.ts.map +1 -0
- package/dist/repl.d.ts +8 -4
- package/dist/repl.d.ts.map +1 -0
- package/dist/repl.js +108 -252
- package/dist/terminal/ansi-styles.d.ts +77 -0
- package/dist/terminal/ansi-styles.d.ts.map +1 -0
- package/dist/terminal/ansi-styles.js +215 -0
- package/dist/terminal/checkbox-prompt.d.ts +36 -0
- package/dist/terminal/checkbox-prompt.d.ts.map +1 -0
- package/dist/terminal/checkbox-prompt.js +362 -0
- package/dist/terminal/default-theme.d.ts +6 -0
- package/dist/terminal/default-theme.d.ts.map +1 -0
- package/dist/terminal/default-theme.js +182 -0
- package/dist/terminal/east-asian-width.d.ts +8 -0
- package/dist/terminal/east-asian-width.d.ts.map +1 -0
- package/dist/terminal/east-asian-width.js +409 -0
- package/dist/terminal/editor-prompt.d.ts +10 -0
- package/dist/terminal/editor-prompt.d.ts.map +1 -0
- package/dist/terminal/editor-prompt.js +61 -0
- package/dist/terminal/errors.d.ts +19 -0
- package/dist/terminal/errors.d.ts.map +1 -0
- package/dist/terminal/errors.js +37 -0
- package/dist/terminal/formatting.d.ts +1 -11
- package/dist/terminal/formatting.d.ts.map +1 -0
- package/dist/terminal/formatting.js +4 -20
- package/dist/terminal/highlight/index.d.ts +53 -0
- package/dist/terminal/highlight/index.d.ts.map +1 -0
- package/dist/terminal/highlight/index.js +90 -0
- package/dist/terminal/highlight/theme.d.ts +233 -0
- package/dist/terminal/highlight/theme.d.ts.map +1 -0
- package/dist/terminal/highlight/theme.js +83 -0
- package/dist/terminal/index.d.ts +16 -9
- package/dist/terminal/index.d.ts.map +1 -0
- package/dist/terminal/index.js +42 -126
- package/dist/terminal/input-prompt.d.ts +16 -0
- package/dist/terminal/input-prompt.d.ts.map +1 -0
- package/dist/terminal/input-prompt.js +181 -0
- package/dist/terminal/markdown-utils.d.ts +1 -0
- package/dist/terminal/markdown-utils.d.ts.map +1 -0
- package/dist/terminal/markdown.d.ts +1 -0
- package/dist/terminal/markdown.d.ts.map +1 -0
- package/dist/terminal/markdown.js +17 -12
- package/dist/terminal/search-prompt.d.ts +20 -0
- package/dist/terminal/search-prompt.d.ts.map +1 -0
- package/dist/terminal/search-prompt.js +279 -0
- package/dist/terminal/select-prompt.d.ts +26 -0
- package/dist/terminal/select-prompt.d.ts.map +1 -0
- package/dist/terminal/select-prompt.js +298 -0
- package/dist/terminal/string-width.d.ts +7 -0
- package/dist/terminal/string-width.d.ts.map +1 -0
- package/dist/terminal/string-width.js +61 -0
- package/dist/terminal/strip-ansi.d.ts +2 -0
- package/dist/terminal/strip-ansi.d.ts.map +1 -0
- package/dist/terminal/strip-ansi.js +20 -0
- package/dist/terminal/style.d.ts +191 -0
- package/dist/terminal/style.d.ts.map +1 -0
- package/dist/terminal/style.js +259 -0
- package/dist/terminal/supports-color.d.ts +1 -0
- package/dist/terminal/supports-color.d.ts.map +1 -0
- package/dist/terminal/supports-hyperlinks.d.ts +1 -3
- package/dist/terminal/supports-hyperlinks.d.ts.map +1 -0
- package/dist/terminal/supports-hyperlinks.js +1 -1
- package/dist/terminal/types.d.ts +1 -37
- package/dist/terminal/types.d.ts.map +1 -0
- package/dist/terminal/wrap-ansi.d.ts +8 -0
- package/dist/terminal/wrap-ansi.d.ts.map +1 -0
- package/dist/terminal/wrap-ansi.js +190 -0
- package/dist/{token-utils.d.ts → tokens/counter.d.ts} +1 -0
- package/dist/tokens/counter.d.ts.map +1 -0
- package/dist/{token-utils.js → tokens/counter.js} +1 -1
- package/dist/tokens/manage-output.d.ts +34 -0
- package/dist/tokens/manage-output.d.ts.map +1 -0
- package/dist/tokens/manage-output.js +44 -0
- package/dist/{token-tracker.d.ts → tokens/tracker.d.ts} +1 -0
- package/dist/tokens/tracker.d.ts.map +1 -0
- package/dist/tool-executor.d.ts +28 -0
- package/dist/tool-executor.d.ts.map +1 -0
- package/dist/tool-executor.js +74 -0
- package/dist/tools/agent.d.ts +3 -2
- package/dist/tools/agent.d.ts.map +1 -0
- package/dist/tools/agent.js +7 -4
- package/dist/tools/bash-utils.d.ts +7 -0
- package/dist/tools/bash-utils.d.ts.map +1 -0
- package/dist/tools/bash-utils.js +212 -0
- package/dist/tools/bash.d.ts +9 -7
- package/dist/tools/bash.d.ts.map +1 -0
- package/dist/tools/bash.js +95 -212
- package/dist/tools/code-interpreter.d.ts +1 -1
- package/dist/tools/code-interpreter.d.ts.map +1 -0
- package/dist/tools/code-interpreter.js +31 -96
- package/dist/tools/delete-file.d.ts +5 -3
- package/dist/tools/delete-file.d.ts.map +1 -0
- package/dist/tools/delete-file.js +47 -33
- package/dist/tools/directory-tree.d.ts +10 -1
- package/dist/tools/directory-tree.d.ts.map +1 -0
- package/dist/tools/directory-tree.js +91 -8
- package/dist/tools/dynamic-tool-loader.d.ts +12 -0
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -0
- package/dist/tools/dynamic-tool-loader.js +280 -0
- package/dist/tools/dynamic-tool-parser.d.ts +20 -0
- package/dist/tools/dynamic-tool-parser.d.ts.map +1 -0
- package/dist/tools/dynamic-tool-parser.js +21 -0
- package/dist/tools/edit-file.d.ts +10 -2
- package/dist/tools/edit-file.d.ts.map +1 -0
- package/dist/tools/edit-file.js +117 -40
- package/dist/tools/file-editing-utils.d.ts +2 -0
- package/dist/tools/file-editing-utils.d.ts.map +1 -0
- package/dist/tools/file-editing-utils.js +135 -0
- package/dist/tools/filesystem-utils.d.ts +6 -21
- package/dist/tools/filesystem-utils.d.ts.map +1 -0
- package/dist/tools/filesystem-utils.js +96 -148
- package/dist/tools/git-utils.d.ts +1 -0
- package/dist/tools/git-utils.d.ts.map +1 -0
- package/dist/tools/grep.d.ts +5 -3
- package/dist/tools/grep.d.ts.map +1 -0
- package/dist/tools/grep.js +67 -27
- package/dist/tools/index.d.ts +10 -16
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +33 -22
- package/dist/tools/move-file.d.ts +1 -0
- package/dist/tools/move-file.d.ts.map +1 -0
- package/dist/tools/move-file.js +12 -5
- package/dist/tools/read-file.d.ts +2 -1
- package/dist/tools/read-file.d.ts.map +1 -0
- package/dist/tools/read-file.js +13 -6
- package/dist/tools/read-multiple-files.d.ts +2 -1
- package/dist/tools/read-multiple-files.d.ts.map +1 -0
- package/dist/tools/read-multiple-files.js +90 -9
- package/dist/tools/save-file.d.ts +5 -3
- package/dist/tools/save-file.d.ts.map +1 -0
- package/dist/tools/save-file.js +64 -36
- package/dist/tools/think.d.ts +1 -0
- package/dist/tools/think.d.ts.map +1 -0
- package/dist/tools/think.js +5 -1
- package/dist/tools/types.d.ts +14 -1
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/web-fetch.d.ts +4 -2
- package/dist/tools/web-fetch.d.ts.map +1 -0
- package/dist/tools/web-fetch.js +2 -2
- package/dist/tools/web-search.d.ts +2 -1
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/tools/web-search.js +46 -11
- package/dist/utils/filesystem.d.ts +23 -0
- package/dist/utils/filesystem.d.ts.map +1 -0
- package/dist/utils/filesystem.js +140 -0
- package/dist/utils/filetype-detection.d.ts +3 -0
- package/dist/utils/filetype-detection.d.ts.map +1 -0
- package/dist/utils/filetype-detection.js +112 -0
- package/dist/utils/glob.d.ts +52 -0
- package/dist/utils/glob.d.ts.map +1 -0
- package/dist/utils/glob.js +376 -0
- package/dist/utils/ignore.d.ts +104 -0
- package/dist/utils/ignore.d.ts.map +1 -0
- package/dist/utils/ignore.js +649 -0
- package/dist/utils/process.d.ts +3 -2
- package/dist/utils/process.d.ts.map +1 -0
- package/dist/utils/process.js +17 -2
- package/dist/utils/zod-utils.d.ts +4 -0
- package/dist/utils/zod-utils.d.ts.map +1 -0
- package/dist/utils/zod-utils.js +7 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +32 -30
- package/dist/tools/command-validation.d.ts +0 -11
- package/dist/tools/command-validation.js +0 -45
- /package/dist/{token-tracker.js → tokens/tracker.js} +0 -0
package/dist/utils/process.js
CHANGED
|
@@ -117,6 +117,16 @@ export function executeCommand(command, options) {
|
|
|
117
117
|
? Promise.reject(new Error("Missing command"))
|
|
118
118
|
: Promise.resolve(result);
|
|
119
119
|
}
|
|
120
|
+
if (abortSignal?.aborted) {
|
|
121
|
+
const result = {
|
|
122
|
+
stdout: "",
|
|
123
|
+
stderr: "Command execution aborted",
|
|
124
|
+
code: 130,
|
|
125
|
+
};
|
|
126
|
+
return throwOnError
|
|
127
|
+
? Promise.reject(new Error("Command execution aborted"))
|
|
128
|
+
: Promise.resolve(result);
|
|
129
|
+
}
|
|
120
130
|
return new Promise((resolve, reject) => {
|
|
121
131
|
try {
|
|
122
132
|
execFile(cmd, args, {
|
|
@@ -127,12 +137,17 @@ export function executeCommand(command, options) {
|
|
|
127
137
|
maxBuffer,
|
|
128
138
|
}, (error, stdout, stderr) => {
|
|
129
139
|
if (error) {
|
|
130
|
-
|
|
140
|
+
let errorCode = typeof error.code === "number" ? error.code : 1;
|
|
141
|
+
let errorSignal = error.signal ?? undefined;
|
|
142
|
+
if (error.name === "AbortError") {
|
|
143
|
+
errorCode = 130;
|
|
144
|
+
errorSignal = "SIGINT";
|
|
145
|
+
}
|
|
131
146
|
const result = {
|
|
132
147
|
stdout: preserveOutputOnError ? stdout : "",
|
|
133
148
|
stderr: preserveOutputOnError ? stderr : "",
|
|
134
149
|
code: errorCode,
|
|
135
|
-
signal:
|
|
150
|
+
signal: errorSignal,
|
|
136
151
|
};
|
|
137
152
|
if (throwOnError) {
|
|
138
153
|
reject(Object.assign(error, { result }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-utils.d.ts","sourceRoot":"","sources":["../../source/utils/zod-utils.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEjC,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAEjE;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB"}
|
package/dist/version.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../source/version.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAAC,QAAQ,SAAgB,GAAG,MAAM,CAiBlE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travisennis/acai",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "An AI assistant for developing software.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsc --pretty -p tsconfig.build.json",
|
|
28
|
-
"clean": "rm -rf ./dist/ ./tsconfig.build.tsbuildinfo",
|
|
28
|
+
"clean": "rm -rf ./dist/ ./coverage/ ./tsconfig.build.tsbuildinfo",
|
|
29
29
|
"compile": "tsc --pretty -p tsconfig.json",
|
|
30
30
|
"lint": "biome lint",
|
|
31
31
|
"lint:fix": "biome lint --unsafe --write",
|
|
@@ -33,56 +33,58 @@
|
|
|
33
33
|
"format:staged": "biome check --staged --formatter-enabled=true --linter-enabled=false --no-errors-on-unmatched",
|
|
34
34
|
"prepack": "npm run clean && npm run build",
|
|
35
35
|
"prepare": "husky",
|
|
36
|
-
"test": "
|
|
37
|
-
"
|
|
36
|
+
"test": "node --no-warnings --test test/**/*.test.ts",
|
|
37
|
+
"test:minimal": "node --no-warnings --test --test-reporter=dot test/**/*.test.ts",
|
|
38
|
+
"test:coverage": "c8 node --no-warnings --test test/**/*.test.ts",
|
|
39
|
+
"test:full-coverage": "c8 --all node --no-warnings --test test/**/*.test.ts",
|
|
40
|
+
"pretest": "npm run typecheck",
|
|
38
41
|
"format": "biome check --formatter-enabled=true --linter-enabled=false --write ./ && biome format --write",
|
|
39
42
|
"dev": "node --no-warnings --env-file=.env ./source/index.ts",
|
|
40
43
|
"oxlint": "npx oxlint@latest --ignore-path .gitignore --deny correctness --deny suspicous --deny pedantic --deny style --node-plugin",
|
|
41
44
|
"knip": "npx knip",
|
|
42
45
|
"check": "npx npm-check-updates --interactive --format group",
|
|
43
46
|
"cpd": "npx jscpd ./source",
|
|
44
|
-
"typecheck
|
|
47
|
+
"typecheck": "tsc --noEmit --pretty -p tsconfig.json",
|
|
48
|
+
"typecheck:staged": "npm run typecheck"
|
|
45
49
|
},
|
|
46
50
|
"dependencies": {
|
|
47
|
-
"@ai-sdk/anthropic": "^2.0.
|
|
48
|
-
"@ai-sdk/deepseek": "^1.0.
|
|
49
|
-
"@ai-sdk/google": "^2.0.
|
|
50
|
-
"@ai-sdk/
|
|
51
|
-
"@ai-sdk/openai
|
|
51
|
+
"@ai-sdk/anthropic": "^2.0.25",
|
|
52
|
+
"@ai-sdk/deepseek": "^1.0.21",
|
|
53
|
+
"@ai-sdk/google": "^2.0.18",
|
|
54
|
+
"@ai-sdk/groq": "^2.0.23",
|
|
55
|
+
"@ai-sdk/openai": "^2.0.46",
|
|
56
|
+
"@ai-sdk/openai-compatible": "^1.0.20",
|
|
52
57
|
"@crosscopy/clipboard": "^0.2.8",
|
|
53
|
-
"@
|
|
58
|
+
"@openrouter/ai-sdk-provider": "^1.2.0",
|
|
54
59
|
"@travisennis/stdlib": "^0.0.14",
|
|
55
|
-
"ai": "^5.0.
|
|
56
|
-
"chalk": "^5.6.0",
|
|
60
|
+
"ai": "^5.0.64",
|
|
57
61
|
"cheerio": "^1.1.2",
|
|
58
|
-
"cli-highlight": "^2.1.11",
|
|
59
62
|
"cli-table3": "^0.6.5",
|
|
60
63
|
"diff": "^8.0.2",
|
|
61
64
|
"duck-duck-scrape": "^2.2.7",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"marked": "16.2.1",
|
|
67
|
-
"ora": "^8.2.0",
|
|
65
|
+
"fast-glob": "^3.3.3",
|
|
66
|
+
"highlight.js": "^11.11.1",
|
|
67
|
+
"jsonrepair": "^3.13.1",
|
|
68
|
+
"marked": "16.4.0",
|
|
68
69
|
"p-throttle": "^8.0.0",
|
|
69
|
-
"
|
|
70
|
+
"parse5": "^8.0.0",
|
|
71
|
+
"parse5-htmlparser2-tree-adapter": "^8.0.0",
|
|
72
|
+
"pino": "^10.0.0",
|
|
70
73
|
"pino-pretty": "^13.1.1",
|
|
71
|
-
"pino-roll": "^
|
|
74
|
+
"pino-roll": "^4.0.0",
|
|
72
75
|
"tiktoken": "^1.0.22",
|
|
73
|
-
"
|
|
74
|
-
"zod": "^3.25.75"
|
|
76
|
+
"zod": "^4.1.12"
|
|
75
77
|
},
|
|
76
78
|
"devDependencies": {
|
|
77
79
|
"@ai-sdk/provider": "^2.0.0",
|
|
78
|
-
"@biomejs/biome": "2.2.
|
|
79
|
-
"@commitlint/config-conventional": "^
|
|
80
|
-
"@types/node": "^24.
|
|
81
|
-
"@types/node-notifier": "^8.0.5",
|
|
80
|
+
"@biomejs/biome": "2.2.5",
|
|
81
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
82
|
+
"@types/node": "^24.7.1",
|
|
82
83
|
"c8": "^10.1.3",
|
|
83
|
-
"commitlint": "^
|
|
84
|
+
"commitlint": "^20.1.0",
|
|
85
|
+
"domhandler": "^5.0.3",
|
|
84
86
|
"husky": "^9.1.7",
|
|
85
|
-
"typescript": "^5.9.
|
|
87
|
+
"typescript": "^5.9.3"
|
|
86
88
|
},
|
|
87
89
|
"engines": {
|
|
88
90
|
"node": ">=20"
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare class CommandValidation {
|
|
2
|
-
private readonly allowedCommands;
|
|
3
|
-
private readonly dangerousPatterns;
|
|
4
|
-
constructor(allowedCommands: string[]);
|
|
5
|
-
private isCommandAllowed;
|
|
6
|
-
private hasDangerousPatterns;
|
|
7
|
-
isValid(command: string): {
|
|
8
|
-
isValid: boolean;
|
|
9
|
-
error?: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export class CommandValidation {
|
|
2
|
-
allowedCommands;
|
|
3
|
-
dangerousPatterns;
|
|
4
|
-
constructor(allowedCommands) {
|
|
5
|
-
this.allowedCommands = allowedCommands;
|
|
6
|
-
// Block shell operators and substitutions outright
|
|
7
|
-
this.dangerousPatterns = [
|
|
8
|
-
/`/, // backticks (command substitution)
|
|
9
|
-
/\$\(/, // $() command substitution
|
|
10
|
-
/\|/, // pipes
|
|
11
|
-
/>|>>|<|<</, // redirects
|
|
12
|
-
/;|&&|\|\||&/, // chaining and backgrounding
|
|
13
|
-
/[\r\n]/, // newlines
|
|
14
|
-
];
|
|
15
|
-
}
|
|
16
|
-
isCommandAllowed(command) {
|
|
17
|
-
const baseCommand = command.split(" ")[0] || "";
|
|
18
|
-
return this.allowedCommands.includes(baseCommand);
|
|
19
|
-
}
|
|
20
|
-
hasDangerousPatterns(command) {
|
|
21
|
-
// Do not strip quotes; reject if any dangerous pattern appears anywhere
|
|
22
|
-
return this.dangerousPatterns.some((re) => re.test(command));
|
|
23
|
-
}
|
|
24
|
-
isValid(command) {
|
|
25
|
-
if (!command.trim()) {
|
|
26
|
-
return { isValid: false, error: "Command cannot be empty" };
|
|
27
|
-
}
|
|
28
|
-
if (this.hasDangerousPatterns(command)) {
|
|
29
|
-
return {
|
|
30
|
-
isValid: false,
|
|
31
|
-
error: "Pipes, redirects, command substitution, chaining, and newlines are disabled for security.",
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
// No pipes to split now; validate the single command only
|
|
35
|
-
const trimmed = command.trim();
|
|
36
|
-
if (!this.isCommandAllowed(trimmed)) {
|
|
37
|
-
const baseCmd = trimmed.split(" ")[0] || "";
|
|
38
|
-
return {
|
|
39
|
-
isValid: false,
|
|
40
|
-
error: `Command '${baseCmd}' is not allowed. Allowed commands: ${this.allowedCommands.join(", ")}`,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return { isValid: true };
|
|
44
|
-
}
|
|
45
|
-
}
|
|
File without changes
|