@travisennis/acai 0.0.10 → 0.0.12
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 +7 -4
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +29 -27
- package/dist/cli/stdin.d.ts +2 -1
- package/dist/cli/stdin.d.ts.map +1 -1
- package/dist/commands/generate-rules/service.d.ts +3 -2
- package/dist/commands/generate-rules/service.d.ts.map +1 -1
- package/dist/commands/health/utils.d.ts +3 -2
- package/dist/commands/health/utils.d.ts.map +1 -1
- package/dist/commands/init-project/utils.d.ts +2 -1
- package/dist/commands/init-project/utils.d.ts.map +1 -1
- package/dist/commands/init-project/utils.js +0 -11
- package/dist/commands/manager.d.ts.map +1 -1
- package/dist/commands/manager.js +6 -1
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +4 -1
- package/dist/commands/review/utils.d.ts +6 -1
- package/dist/commands/review/utils.d.ts.map +1 -1
- package/dist/commands/session/index.d.ts.map +1 -1
- package/dist/commands/session/index.js +6 -0
- package/dist/commands/session/types.d.ts +1 -0
- package/dist/commands/session/types.d.ts.map +1 -1
- package/dist/commands/tools/index.d.ts +3 -0
- package/dist/commands/tools/index.d.ts.map +1 -0
- package/dist/commands/tools/index.js +190 -0
- package/dist/commands/tools/templates.d.ts +6 -0
- package/dist/commands/tools/templates.d.ts.map +1 -0
- package/dist/commands/tools/templates.js +97 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +41 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/models/anthropic-provider.d.ts +1 -1
- package/dist/models/deepseek-provider.d.ts +3 -3
- package/dist/models/deepseek-provider.js +17 -17
- package/dist/models/google-provider.d.ts +2 -4
- package/dist/models/google-provider.d.ts.map +1 -1
- package/dist/models/google-provider.js +2 -17
- package/dist/models/groq-provider.d.ts +2 -4
- package/dist/models/groq-provider.d.ts.map +1 -1
- package/dist/models/groq-provider.js +3 -21
- package/dist/models/opencode-go-provider.d.ts +35 -0
- package/dist/models/opencode-go-provider.d.ts.map +1 -0
- package/dist/models/opencode-go-provider.js +214 -0
- package/dist/models/opencode-zen-provider.d.ts +5 -5
- package/dist/models/opencode-zen-provider.d.ts.map +1 -1
- package/dist/models/opencode-zen-provider.js +41 -47
- package/dist/models/openrouter-provider.d.ts +5 -13
- package/dist/models/openrouter-provider.d.ts.map +1 -1
- package/dist/models/openrouter-provider.js +34 -138
- package/dist/models/providers.d.ts +3 -3
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/models/providers.js +6 -0
- package/dist/models/xai-provider.d.ts +1 -2
- package/dist/models/xai-provider.d.ts.map +1 -1
- package/dist/models/xai-provider.js +0 -13
- package/dist/prompts/manager.d.ts.map +1 -1
- package/dist/prompts/manager.js +5 -1
- package/dist/prompts/mentions.d.ts.map +1 -1
- package/dist/prompts/mentions.js +35 -6
- package/dist/prompts/system-prompt.d.ts +1 -0
- package/dist/prompts/system-prompt.d.ts.map +1 -1
- package/dist/prompts/system-prompt.js +20 -5
- package/dist/repl/index.d.ts +1 -2
- package/dist/repl/index.d.ts.map +1 -1
- package/dist/repl/index.js +14 -53
- package/dist/sessions/manager.d.ts +3 -3
- package/dist/sessions/manager.d.ts.map +1 -1
- package/dist/sessions/manager.js +1 -1
- package/dist/skills/activated-tracker.d.ts +11 -0
- package/dist/skills/activated-tracker.d.ts.map +1 -0
- package/dist/skills/activated-tracker.js +16 -0
- package/dist/skills/index.d.ts +3 -2
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +7 -1
- package/dist/subagents/index.d.ts +2 -1
- package/dist/subagents/index.d.ts.map +1 -1
- package/dist/terminal/table/utils.d.ts +1 -1
- package/dist/terminal/table/utils.d.ts.map +1 -1
- package/dist/terminal/wrap-ansi.js +2 -2
- package/dist/tools/agent.js +1 -1
- package/dist/tools/apply-patch.d.ts +62 -0
- package/dist/tools/apply-patch.d.ts.map +1 -0
- package/dist/tools/apply-patch.js +377 -0
- package/dist/tools/bash.d.ts +4 -4
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +40 -8
- package/dist/tools/directory-tree.d.ts +4 -4
- package/dist/tools/directory-tree.d.ts.map +1 -1
- package/dist/tools/directory-tree.js +3 -1
- package/dist/tools/dynamic-tool-loader.d.ts +12 -3
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-loader.js +299 -39
- package/dist/tools/edit-file.d.ts +2 -2
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +188 -79
- package/dist/tools/glob.d.ts +16 -16
- package/dist/tools/glob.d.ts.map +1 -1
- package/dist/tools/glob.js +30 -15
- package/dist/tools/grep.d.ts +14 -14
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +50 -29
- package/dist/tools/index.d.ts +57 -84
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +20 -5
- package/dist/tools/ls.d.ts +2 -2
- package/dist/tools/ls.d.ts.map +1 -1
- package/dist/tools/ls.js +2 -1
- package/dist/tools/read-file.d.ts +9 -11
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +21 -16
- package/dist/tools/save-file.d.ts +4 -4
- package/dist/tools/save-file.d.ts.map +1 -1
- package/dist/tools/save-file.js +26 -21
- package/dist/tools/skill.d.ts +2 -1
- package/dist/tools/skill.d.ts.map +1 -1
- package/dist/tools/skill.js +55 -12
- package/dist/tools/types.d.ts +8 -2
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/web-fetch.d.ts +6 -18
- package/dist/tools/web-fetch.d.ts.map +1 -1
- package/dist/tools/web-fetch.js +45 -9
- package/dist/tools/web-search.d.ts +4 -22
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +1 -1
- package/dist/tui/autocomplete/file-search-provider.js +1 -1
- package/dist/tui/autocomplete/utils.d.ts +2 -1
- package/dist/tui/autocomplete/utils.d.ts.map +1 -1
- package/dist/tui/autocomplete/utils.js +25 -23
- package/dist/tui/components/editor.d.ts +2 -1
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +1 -1
- package/dist/tui/components/footer.d.ts +0 -2
- package/dist/tui/components/footer.d.ts.map +1 -1
- package/dist/tui/components/footer.js +1 -17
- package/dist/tui/components/markdown.d.ts +2 -2
- package/dist/tui/components/markdown.d.ts.map +1 -1
- package/dist/tui/components/welcome.d.ts +2 -1
- package/dist/tui/components/welcome.d.ts.map +1 -1
- package/dist/tui/editor-launcher.d.ts +3 -2
- package/dist/tui/editor-launcher.d.ts.map +1 -1
- package/dist/tui/index.d.ts +0 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/tui.d.ts +1 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +9 -0
- package/dist/tui/utils.d.ts +1 -5
- package/dist/tui/utils.d.ts.map +1 -1
- package/dist/tui/utils.js +271 -44
- package/dist/utils/binary-output.d.ts +32 -0
- package/dist/utils/binary-output.d.ts.map +1 -0
- package/dist/utils/binary-output.js +127 -0
- package/dist/utils/command-protection.d.ts.map +1 -1
- package/dist/utils/command-protection.js +92 -9
- package/dist/utils/parsing.d.ts +1 -1
- package/dist/utils/parsing.d.ts.map +1 -1
- package/package.json +28 -26
- package/dist/commands/add-directory/types.d.ts +0 -6
- package/dist/commands/add-directory/types.d.ts.map +0 -1
- package/dist/commands/add-directory/types.js +0 -1
- package/dist/commands/copy/types.d.ts +0 -3
- package/dist/commands/copy/types.d.ts.map +0 -1
- package/dist/commands/copy/types.js +0 -1
- package/dist/commands/review/types.d.ts +0 -12
- package/dist/commands/review/types.d.ts.map +0 -1
- package/dist/commands/review/types.js +0 -1
- package/dist/modes/manager.d.ts +0 -23
- package/dist/modes/manager.d.ts.map +0 -1
- package/dist/modes/manager.js +0 -77
- package/dist/modes/prompts.d.ts +0 -2
- package/dist/modes/prompts.d.ts.map +0 -1
- package/dist/modes/prompts.js +0 -143
- package/dist/tools/code-search.d.ts +0 -41
- package/dist/tools/code-search.d.ts.map +0 -1
- package/dist/tools/code-search.js +0 -195
- package/dist/utils/iterables.d.ts +0 -2
- package/dist/utils/iterables.d.ts.map +0 -1
- package/dist/utils/iterables.js +0 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# acai
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
@@ -12,7 +12,7 @@ Acai is an AI-driven command-line tool that assists software developers with cod
|
|
|
12
12
|
- **Interactive AI Assistant:** Conversational REPL and TUI with modal dialogs, autocomplete, and rich text formatting.
|
|
13
13
|
- **Codebase Interaction:** Read, edit, search, and navigate files with context-aware AI assistance.
|
|
14
14
|
- **Git Integration:** Generate conventional commits, review pull requests, and manage local changes.
|
|
15
|
-
- **Multi-Model Support:** Switch between OpenAI, Anthropic, Google, DeepSeek, Groq, X.AI, OpenRouter, and OpenCode
|
|
15
|
+
- **Multi-Model Support:** Switch between OpenAI, Anthropic, Google, DeepSeek, Groq, X.AI, OpenRouter, OpenCode Zen, and OpenCode Go.
|
|
16
16
|
- **Piped Input:** Pipe text via stdin for REPL mode or as context with the `-p` flag.
|
|
17
17
|
- **Skills System:** Discover and load specialized instruction files for specific tasks.
|
|
18
18
|
- **Multi-workspace Support:** Work across multiple project directories simultaneously.
|
|
@@ -87,7 +87,6 @@ Reference files directly with `@filename`, directories with `@dirname`, or run s
|
|
|
87
87
|
│ ├── execution/ # Command execution utilities
|
|
88
88
|
│ ├── middleware/ # AI request/response middleware
|
|
89
89
|
│ ├── models/ # AI model providers and management
|
|
90
|
-
│ ├── modes/ # Agent mode management
|
|
91
90
|
│ ├── prompts/ # Prompt generation and management
|
|
92
91
|
│ ├── repl/ # REPL utilities
|
|
93
92
|
│ ├── sessions/ # Session persistence and management
|
|
@@ -108,10 +107,14 @@ Reference files directly with `@filename`, directories with `@dirname`, or run s
|
|
|
108
107
|
- [Usage Guide](docs/usage.md) - Commands, keyboard shortcuts, piped input, and prompt syntax
|
|
109
108
|
- [Configuration](docs/configuration.md) - Environment variables, project and global settings
|
|
110
109
|
- [Skills System](docs/skills.md) - Creating and using specialized instruction files
|
|
111
|
-
- [Dynamic Tools](docs/dynamic-tools.md) - Creating custom tools to extend acai
|
|
110
|
+
- [Dynamic Tools](docs/dynamic-tools.md) - Creating custom tools to extend acai (supports bash, python, and other languages; Amp-compatible text schema format; `/tools make` scaffolding command)
|
|
112
111
|
- [Architecture](ARCHITECTURE.md) - Internal architecture and flow diagrams
|
|
113
112
|
- [Contributing](CONTRIBUTING.md) - Development setup, scripts, and code style
|
|
114
113
|
|
|
114
|
+
## Acknowledgments
|
|
115
|
+
|
|
116
|
+
Special thanks to [OpenCode](https://opencode.ai) for providing access to their AI model aggregation service, which enables seamless integration with multiple state-of-the-art models through a unified API.
|
|
117
|
+
|
|
115
118
|
## License
|
|
116
119
|
|
|
117
120
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/agent/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAEhB,MAAM,mBAAmB,CAAC;AAI3B,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE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AAA;SAAE,CAAC,CAAC;QACzC,SAAS,EAAE,KAAK,CAAC;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACxC,EAAE,CAAC;IACJ,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAEF,qBAAa,KAAK;IAChB,OAAO,CAAC,IAAI,CAAe;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,eAAe,CAAkB;gBAE7B,IAAI,EAAE,YAAY;IAO9B,SAAS,CAAC,MAAM,EAAE,MAAM;IAIxB,IAAI,KAAK,eAER;IAED,IAAI,WAAW,gBAEd;IAGM,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC;IAyQxD,KAAK;IAML,UAAU;IAmDV,OAAO,CAAC,iBAAiB;IA+FzB,OAAO,CAAC,gBAAgB;IA8CxB,OAAO,CAAC,gBAAgB;YA0BV,sBAAsB;IA4EpC,OAAO,CAAC,kBAAkB;YAuCZ,iBAAiB;IAoG/B,OAAO,CAAC,iBAAiB;CA6B1B"}
|
package/dist/agent/index.js
CHANGED
|
@@ -364,39 +364,41 @@ export class Agent {
|
|
|
364
364
|
return null;
|
|
365
365
|
}
|
|
366
366
|
updateUsageStats(stepUsage, sessionManager) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
this._state.usage.
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
this._state.
|
|
378
|
-
this._state.
|
|
379
|
-
this._state.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
this._state.totalUsage.
|
|
383
|
-
|
|
384
|
-
this._state.totalUsage.
|
|
385
|
-
|
|
367
|
+
// Extract values with null coalescing once
|
|
368
|
+
const inputTokens = stepUsage.inputTokens ?? 0;
|
|
369
|
+
const outputTokens = stepUsage.outputTokens ?? 0;
|
|
370
|
+
const totalTokens = stepUsage.totalTokens ?? 0;
|
|
371
|
+
const cacheReadTokens = stepUsage.inputTokenDetails.cacheReadTokens ?? 0;
|
|
372
|
+
const reasoningTokens = stepUsage.outputTokenDetails.reasoningTokens ?? 0;
|
|
373
|
+
// Update step usage
|
|
374
|
+
this._state.usage.inputTokens = inputTokens;
|
|
375
|
+
this._state.usage.outputTokens = outputTokens;
|
|
376
|
+
this._state.usage.totalTokens = totalTokens;
|
|
377
|
+
this._state.usage.cachedInputTokens = cacheReadTokens;
|
|
378
|
+
this._state.usage.inputTokenDetails.cacheReadTokens = cacheReadTokens;
|
|
379
|
+
this._state.usage.reasoningTokens = reasoningTokens;
|
|
380
|
+
sessionManager.setContextWindow(totalTokens);
|
|
381
|
+
// Update total usage (accumulate)
|
|
382
|
+
this._state.totalUsage.inputTokens += inputTokens;
|
|
383
|
+
this._state.totalUsage.outputTokens += outputTokens;
|
|
384
|
+
this._state.totalUsage.totalTokens += totalTokens;
|
|
385
|
+
this._state.totalUsage.cachedInputTokens += cacheReadTokens;
|
|
386
|
+
this._state.totalUsage.inputTokenDetails.cacheReadTokens += cacheReadTokens;
|
|
387
|
+
this._state.totalUsage.reasoningTokens += reasoningTokens;
|
|
386
388
|
sessionManager.recordTurnUsage({
|
|
387
|
-
inputTokens
|
|
388
|
-
outputTokens
|
|
389
|
-
totalTokens
|
|
390
|
-
cachedInputTokens:
|
|
391
|
-
reasoningTokens
|
|
389
|
+
inputTokens,
|
|
390
|
+
outputTokens,
|
|
391
|
+
totalTokens,
|
|
392
|
+
cachedInputTokens: cacheReadTokens,
|
|
393
|
+
reasoningTokens,
|
|
392
394
|
inputTokenDetails: {
|
|
393
395
|
noCacheTokens: stepUsage.inputTokenDetails.noCacheTokens ?? 0,
|
|
394
|
-
cacheReadTokens
|
|
396
|
+
cacheReadTokens,
|
|
395
397
|
cacheWriteTokens: stepUsage.inputTokenDetails.cacheWriteTokens ?? 0,
|
|
396
398
|
},
|
|
397
399
|
outputTokenDetails: {
|
|
398
400
|
textTokens: stepUsage.outputTokenDetails.textTokens ?? 0,
|
|
399
|
-
reasoningTokens
|
|
401
|
+
reasoningTokens,
|
|
400
402
|
},
|
|
401
403
|
});
|
|
402
404
|
}
|
|
@@ -508,7 +510,6 @@ export class Agent {
|
|
|
508
510
|
const { call, toolName, iTool } = pending;
|
|
509
511
|
// Track in step stats
|
|
510
512
|
stepToolCalls.push({ toolName });
|
|
511
|
-
stepToolResults.push({ toolName });
|
|
512
513
|
if (!iTool) {
|
|
513
514
|
const errorMsg = `No executor for tool ${toolName}`;
|
|
514
515
|
const event = this.processToolEvent(toolsCalled, {
|
|
@@ -543,6 +544,7 @@ export class Agent {
|
|
|
543
544
|
args: call.input,
|
|
544
545
|
});
|
|
545
546
|
collectedEvents.push(event);
|
|
547
|
+
stepToolResults.push({ toolName });
|
|
546
548
|
results[index] = {
|
|
547
549
|
toolCallId: call.toolCallId,
|
|
548
550
|
toolName,
|
package/dist/cli/stdin.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export declare const STDIN_SOFT_LIMIT: number;
|
|
2
2
|
export declare const STDIN_HARD_LIMIT: number;
|
|
3
|
-
|
|
3
|
+
interface StdinResult {
|
|
4
4
|
content: string | null;
|
|
5
5
|
sizeBytes: number;
|
|
6
6
|
wasPiped: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare function readStdinWithLimits(): Promise<StdinResult>;
|
|
9
|
+
export {};
|
|
9
10
|
//# sourceMappingURL=stdin.d.ts.map
|
package/dist/cli/stdin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdin.d.ts","sourceRoot":"","sources":["../../source/cli/stdin.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,QAAY,CAAC;AAC1C,eAAO,MAAM,gBAAgB,QAAa,CAAC;AAE3C,
|
|
1
|
+
{"version":3,"file":"stdin.d.ts","sourceRoot":"","sources":["../../source/cli/stdin.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,QAAY,CAAC;AAC1C,eAAO,MAAM,gBAAgB,QAAa,CAAC;AAE3C,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,WAAW,CAAC,CA2ChE"}
|
|
@@ -3,14 +3,14 @@ import type { ConfigManager } from "../../config/index.ts";
|
|
|
3
3
|
import type { WorkspaceContext } from "../../index.ts";
|
|
4
4
|
import type { ModelManager } from "../../models/manager.ts";
|
|
5
5
|
import type { TokenTracker } from "../../tokens/tracker.ts";
|
|
6
|
-
|
|
6
|
+
interface GenerateRulesOptions {
|
|
7
7
|
modelManager: ModelManager;
|
|
8
8
|
messages: ModelMessage[];
|
|
9
9
|
tokenTracker: TokenTracker;
|
|
10
10
|
config: ConfigManager;
|
|
11
11
|
workspace: WorkspaceContext;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
interface GenerateRulesResult {
|
|
14
14
|
rules: string[];
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
@@ -18,4 +18,5 @@ export interface GenerateRulesResult {
|
|
|
18
18
|
* Returns the list of generated rules.
|
|
19
19
|
*/
|
|
20
20
|
export declare function generateRulesFromSession(options: GenerateRulesOptions): Promise<GenerateRulesResult>;
|
|
21
|
+
export {};
|
|
21
22
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../source/commands/generate-rules/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,IAAI,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../source/commands/generate-rules/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,IAAI,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,UAAU,oBAAoB;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA6D9B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
interface EnvVarInfo {
|
|
2
2
|
name: string;
|
|
3
3
|
description: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
interface ToolInfo {
|
|
6
6
|
name: string;
|
|
7
7
|
command: string;
|
|
8
8
|
}
|
|
@@ -12,4 +12,5 @@ export declare function checkEnvironmentVariables(): (string | number)[][];
|
|
|
12
12
|
export declare function checkTools(execFn?: (command: string, options: object) => void): string[][];
|
|
13
13
|
export declare function formatEnvStatus(status: (string | number)[][]): (string | number)[][];
|
|
14
14
|
export declare function formatToolStatus(status: string[][]): string[][];
|
|
15
|
+
export {};
|
|
15
16
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/health/utils.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/health/utils.ts"],"names":[],"mappings":"AAEA,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,qBAAqB,EAAE,UAAU,EAmB7C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,QAAQ,EAShC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,CASjE;AAED,wBAAgB,UAAU,CACxB,MAAM,GAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAe,GAC5D,MAAM,EAAE,EAAE,CAWZ;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,GAC5B,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,CAEvB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAE/D"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export declare const DEVELOPMENT_DIRECTORY = "/Users/travisennis/Github/acai-ts";
|
|
2
|
-
|
|
2
|
+
interface InitializationResult {
|
|
3
3
|
created: string[];
|
|
4
4
|
existing: string[];
|
|
5
5
|
}
|
|
6
6
|
export declare function ensureProjectDirectory(projectDir: string): InitializationResult;
|
|
7
7
|
export declare function ensureConfigFile(projectDir: string): InitializationResult;
|
|
8
8
|
export declare function isDevelopmentDirectory(dir: string): boolean;
|
|
9
|
+
export {};
|
|
9
10
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/init-project/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,sCAAsC,CAAC;AAEzE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/init-project/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,sCAAsC,CAAC;AAEzE,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,GACjB,oBAAoB,CAwBtB;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,oBAAoB,CAazE;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -12,17 +12,6 @@ export function ensureProjectDirectory(projectDir) {
|
|
|
12
12
|
else {
|
|
13
13
|
existing.push(".acai/");
|
|
14
14
|
}
|
|
15
|
-
const subdirs = ["rules"];
|
|
16
|
-
for (const subdir of subdirs) {
|
|
17
|
-
const dirPath = path.join(projectDir, subdir);
|
|
18
|
-
if (!existsSync(dirPath)) {
|
|
19
|
-
mkdirSync(dirPath, { recursive: true });
|
|
20
|
-
created.push(`.acai/${subdir}/`);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
existing.push(`.acai/${subdir}/`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
15
|
const agentsSkillsDir = path.join(path.dirname(projectDir), ".agents", "skills");
|
|
27
16
|
if (!existsSync(agentsSkillsDir)) {
|
|
28
17
|
mkdirSync(agentsSkillsDir, { recursive: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/commands/manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/commands/manager.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAEV,SAAS,EACT,MAAM,EACN,YAAY,EACZ,GAAG,EACJ,MAAM,iBAAiB,CAAC;AA4BzB,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,YAAY,CAAC;AAE9D,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,WAAW,CAAU;gBAEjB,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,aAAa,EACb,SAAS,GACV,EAAE,cAAc;IAaX,mBAAmB;YA2DX,qBAAqB;IA4EnC,OAAO,CAAC,iBAAiB;IAQnB,cAAc,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAuB/C,WAAW;IAKL,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAKlD,MAAM,CACV,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,EACpC,OAAO,EAAE;QACP,GAAG,EAAE,GAAG,CAAC;QACT,SAAS,EAAE,SAAS,CAAC;QACrB,cAAc,EAAE,SAAS,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC;KAChB;;;CAsBJ"}
|
package/dist/commands/manager.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { parseSkillsPath } from "../config/index.js";
|
|
2
3
|
import { processPrompt } from "../prompts/mentions.js";
|
|
3
4
|
import { loadSkills } from "../skills/index.js";
|
|
4
5
|
import style from "../terminal/style.js";
|
|
@@ -27,6 +28,7 @@ import { reviewCommand } from "./review/index.js";
|
|
|
27
28
|
import { sessionCommand } from "./session/index.js";
|
|
28
29
|
import { shareCommand } from "./share/index.js";
|
|
29
30
|
import { shellCommand } from "./shell/index.js";
|
|
31
|
+
import { toolsCommand } from "./tools/index.js";
|
|
30
32
|
export class CommandManager {
|
|
31
33
|
commands;
|
|
32
34
|
promptManager;
|
|
@@ -87,6 +89,7 @@ export class CommandManager {
|
|
|
87
89
|
resourcesCommand(options),
|
|
88
90
|
shareCommand(options),
|
|
89
91
|
shellCommand(options),
|
|
92
|
+
toolsCommand(options),
|
|
90
93
|
];
|
|
91
94
|
// Add help command with access to all commands
|
|
92
95
|
const helpCmd = helpCommand(options, this.commands);
|
|
@@ -103,7 +106,9 @@ export class CommandManager {
|
|
|
103
106
|
this.initialized = true;
|
|
104
107
|
}
|
|
105
108
|
async registerSkillCommands(options) {
|
|
106
|
-
const
|
|
109
|
+
const appConfig = await this.config.getConfig();
|
|
110
|
+
const skillPaths = parseSkillsPath(appConfig.skills.path);
|
|
111
|
+
const skills = await loadSkills(skillPaths);
|
|
107
112
|
const userInvocableSkills = skills.getUserInvocable();
|
|
108
113
|
for (const skill of userInvocableSkills) {
|
|
109
114
|
const commandName = `/${skill.name}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/resources/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/resources/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkC/D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,WAAW,CAqErE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseSkillsPath } from "../../config/index.js";
|
|
1
2
|
import { loadSkills } from "../../skills/index.js";
|
|
2
3
|
import style from "../../terminal/style.js";
|
|
3
4
|
import { Modal, Container as ModalContainer, ModalText, } from "../../tui/index.js";
|
|
@@ -30,7 +31,9 @@ export function resourcesCommand(options) {
|
|
|
30
31
|
getSubCommands: async () => [],
|
|
31
32
|
async handle(_args, { tui, editor }) {
|
|
32
33
|
try {
|
|
33
|
-
const
|
|
34
|
+
const appConfig = await options.config.getConfig();
|
|
35
|
+
const skillPaths = parseSkillsPath(appConfig.skills.path);
|
|
36
|
+
const skills = await loadSkills(skillPaths);
|
|
34
37
|
const allSkills = skills.getAll();
|
|
35
38
|
const agentsFiles = await options.config.readAgentsFiles();
|
|
36
39
|
const projectSkills = allSkills.filter((s) => s.source === "project");
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Terminal } from "../../tui/terminal.ts";
|
|
2
|
-
|
|
2
|
+
interface FileChange {
|
|
3
|
+
fileName: string;
|
|
4
|
+
diff: string;
|
|
5
|
+
stats: string;
|
|
6
|
+
}
|
|
3
7
|
export declare function parseGitDiffFiles(diffOutput: string): FileChange[];
|
|
4
8
|
export declare function formatFileDiffForDisplay(fileName: string, diff: string): string;
|
|
5
9
|
export declare function getUntrackedFiles(untrackedOutput: string, cwd: string): Promise<FileChange[]>;
|
|
@@ -10,4 +14,5 @@ export declare function openFileInEditor(filePath: string, terminal: Terminal):
|
|
|
10
14
|
success: boolean;
|
|
11
15
|
error?: string;
|
|
12
16
|
};
|
|
17
|
+
export {};
|
|
13
18
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/review/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/review/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AA6CD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,EAAE,CAwBlE;AAgBD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,CAaR;AAED,wBAAsB,iBAAiB,CACrC,eAAe,EAAE,MAAM,EACvB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,UAAU,EAAE,CAAC,CAsCvB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GACjB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAyBtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/session/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/session/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyH/D,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,SAAS,EACT,YAAY,GACb,EAAE,cAAc,GAAG,WAAW,CAiK9B"}
|
|
@@ -44,6 +44,11 @@ function buildContextTable(breakdown, window) {
|
|
|
44
44
|
formatNumber(breakdown.systemPromptBreakdown.userAgentsMd),
|
|
45
45
|
formatPercentage(breakdown.systemPromptBreakdown.userAgentsMd, window),
|
|
46
46
|
],
|
|
47
|
+
[
|
|
48
|
+
" ~/.config/AGENTS.md",
|
|
49
|
+
formatNumber(breakdown.systemPromptBreakdown.configAgentsMd),
|
|
50
|
+
formatPercentage(breakdown.systemPromptBreakdown.configAgentsMd, window),
|
|
51
|
+
],
|
|
47
52
|
[
|
|
48
53
|
" ./AGENTS.md",
|
|
49
54
|
formatNumber(breakdown.systemPromptBreakdown.cwdAgentsMd),
|
|
@@ -126,6 +131,7 @@ export function sessionCommand({ config, tokenCounter, modelManager, sessionMana
|
|
|
126
131
|
const systemPromptBreakdown = {
|
|
127
132
|
core: tokenCounter.count(sysResult.components.core),
|
|
128
133
|
userAgentsMd: tokenCounter.count(sysResult.components.userAgentsMd),
|
|
134
|
+
configAgentsMd: tokenCounter.count(sysResult.components.configAgentsMd),
|
|
129
135
|
cwdAgentsMd: tokenCounter.count(sysResult.components.cwdAgentsMd),
|
|
130
136
|
learnedRules: tokenCounter.count(sysResult.components.learnedRules),
|
|
131
137
|
skills: tokenCounter.count(sysResult.components.skills),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../source/commands/session/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAEvC,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,EAAE,EACxB,OAAO,EAAE;IAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CAAE,GACxC,MAAM,CAOR"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../source/commands/session/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAEvC,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,EAAE,EACxB,OAAO,EAAE;IAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CAAE,GACxC,MAAM,CAOR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/tools/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAa/D,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,WAAW,CA6CjE"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import style from "../../terminal/style.js";
|
|
4
|
+
import { Text } from "../../tui/index.js";
|
|
5
|
+
import { bashTemplate, nodeTemplate, textCompanionTemplate, textSchemaTemplate, zshTemplate, } from "./templates.js";
|
|
6
|
+
const TOOL_NAME_REGEX = /^[a-zA-Z_][a-zA-Z0-9_-]*$/;
|
|
7
|
+
export function toolsCommand(options) {
|
|
8
|
+
return {
|
|
9
|
+
command: "/tools",
|
|
10
|
+
description: "Manage dynamic tools (make, list)",
|
|
11
|
+
aliases: [],
|
|
12
|
+
getSubCommands: async () => ["make", "list"],
|
|
13
|
+
async handle(args, { tui, container, editor, }) {
|
|
14
|
+
const subCommand = args[0];
|
|
15
|
+
if (subCommand === "make") {
|
|
16
|
+
return handleToolMake(args.slice(1), options, container, editor, tui);
|
|
17
|
+
}
|
|
18
|
+
if (subCommand === "list") {
|
|
19
|
+
return handleToolList(options, container, editor, tui);
|
|
20
|
+
}
|
|
21
|
+
// Default: show help
|
|
22
|
+
container.addChild(new Text(style.dim("Usage: /tools make <name> [--bash|--zsh|--node|--text] [--description <desc>] [--dir <path>]"), 0, 1));
|
|
23
|
+
container.addChild(new Text(style.dim(" /tools list"), 0, 1));
|
|
24
|
+
return "continue";
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function writeToolFile(filePath, content, makeExecutable) {
|
|
29
|
+
const files = [];
|
|
30
|
+
fs.writeFileSync(filePath, content, "utf8");
|
|
31
|
+
if (makeExecutable) {
|
|
32
|
+
fs.chmodSync(filePath, 0o755);
|
|
33
|
+
}
|
|
34
|
+
files.push(filePath);
|
|
35
|
+
return files;
|
|
36
|
+
}
|
|
37
|
+
function createToolFiles(toolName, description, toolType, outputDir) {
|
|
38
|
+
const files = [];
|
|
39
|
+
const typeConfig = {
|
|
40
|
+
node: {
|
|
41
|
+
ext: ".mjs",
|
|
42
|
+
template: () => nodeTemplate(toolName, description),
|
|
43
|
+
executable: true,
|
|
44
|
+
},
|
|
45
|
+
bash: {
|
|
46
|
+
ext: ".sh",
|
|
47
|
+
template: () => bashTemplate(toolName, description),
|
|
48
|
+
executable: true,
|
|
49
|
+
},
|
|
50
|
+
zsh: {
|
|
51
|
+
ext: ".zsh",
|
|
52
|
+
template: () => zshTemplate(toolName, description),
|
|
53
|
+
executable: true,
|
|
54
|
+
},
|
|
55
|
+
text: { ext: ".sh", template: () => "", executable: true }, // handled separately
|
|
56
|
+
};
|
|
57
|
+
if (toolType === "text") {
|
|
58
|
+
const toolFilePath = path.join(outputDir, `${toolName}.tool`);
|
|
59
|
+
const companionFilePath = path.join(outputDir, `${toolName}.sh`);
|
|
60
|
+
if (fs.existsSync(toolFilePath))
|
|
61
|
+
return toolFilePath;
|
|
62
|
+
if (fs.existsSync(companionFilePath))
|
|
63
|
+
return companionFilePath;
|
|
64
|
+
files.push(...writeToolFile(toolFilePath, textSchemaTemplate(toolName, description), false));
|
|
65
|
+
files.push(...writeToolFile(companionFilePath, textCompanionTemplate(toolName), true));
|
|
66
|
+
return files;
|
|
67
|
+
}
|
|
68
|
+
const config = typeConfig[toolType];
|
|
69
|
+
const filePath = path.join(outputDir, `${toolName}${config.ext}`);
|
|
70
|
+
if (fs.existsSync(filePath))
|
|
71
|
+
return filePath;
|
|
72
|
+
files.push(...writeToolFile(filePath, config.template(), config.executable));
|
|
73
|
+
return files;
|
|
74
|
+
}
|
|
75
|
+
function handleToolMake(args, options, container, editor, tui) {
|
|
76
|
+
// Parse arguments
|
|
77
|
+
let toolName = "";
|
|
78
|
+
let toolType = "bash";
|
|
79
|
+
let description = "";
|
|
80
|
+
let customDir = "";
|
|
81
|
+
for (let i = 0; i < args.length; i++) {
|
|
82
|
+
const arg = args[i];
|
|
83
|
+
if (arg === "--bash") {
|
|
84
|
+
toolType = "bash";
|
|
85
|
+
}
|
|
86
|
+
else if (arg === "--zsh") {
|
|
87
|
+
toolType = "zsh";
|
|
88
|
+
}
|
|
89
|
+
else if (arg === "--node") {
|
|
90
|
+
toolType = "node";
|
|
91
|
+
}
|
|
92
|
+
else if (arg === "--text") {
|
|
93
|
+
toolType = "text";
|
|
94
|
+
}
|
|
95
|
+
else if (arg === "--description" || arg === "-d") {
|
|
96
|
+
description = args[++i] || "";
|
|
97
|
+
}
|
|
98
|
+
else if (arg === "--dir") {
|
|
99
|
+
customDir = args[++i] || "";
|
|
100
|
+
}
|
|
101
|
+
else if (!arg.startsWith("-")) {
|
|
102
|
+
toolName = arg;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (!toolName) {
|
|
106
|
+
container.addChild(new Text(style.red("Error: Tool name is required"), 0, 1));
|
|
107
|
+
container.addChild(new Text(style.dim("Usage: /tools make <name> [--bash|--zsh|--node|--text] [--description <desc>] [--dir <path>]"), 0, 1));
|
|
108
|
+
tui.requestRender();
|
|
109
|
+
editor.setText("");
|
|
110
|
+
return "continue";
|
|
111
|
+
}
|
|
112
|
+
if (!TOOL_NAME_REGEX.test(toolName)) {
|
|
113
|
+
container.addChild(new Text(style.red(`Error: Tool name must match ${TOOL_NAME_REGEX.source}`), 0, 1));
|
|
114
|
+
tui.requestRender();
|
|
115
|
+
editor.setText("");
|
|
116
|
+
return "continue";
|
|
117
|
+
}
|
|
118
|
+
if (!description) {
|
|
119
|
+
description = `Dynamic tool: ${toolName}`;
|
|
120
|
+
}
|
|
121
|
+
// Determine output directory
|
|
122
|
+
const outputDir = customDir || path.join(options.workspace.primaryDir, ".acai", "tools");
|
|
123
|
+
// Create directory if it doesn't exist
|
|
124
|
+
if (!fs.existsSync(outputDir)) {
|
|
125
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
const result = createToolFiles(toolName, description, toolType, outputDir);
|
|
129
|
+
if (typeof result === "string") {
|
|
130
|
+
// A file already exists
|
|
131
|
+
container.addChild(new Text(style.red(`Error: File already exists: ${result}`), 0, 1));
|
|
132
|
+
tui.requestRender();
|
|
133
|
+
editor.setText("");
|
|
134
|
+
return "continue";
|
|
135
|
+
}
|
|
136
|
+
container.addChild(new Text(style.green(`Created tool: ${toolName}`), 0, 1));
|
|
137
|
+
for (const filePath of result) {
|
|
138
|
+
container.addChild(new Text(style.dim(` ${filePath}`), 0, 1));
|
|
139
|
+
}
|
|
140
|
+
container.addChild(new Text(style.dim("Restart acai or reload tools to use the new tool."), 0, 1));
|
|
141
|
+
}
|
|
142
|
+
catch (e) {
|
|
143
|
+
container.addChild(new Text(style.red(`Error creating tool: ${e.message}`), 0, 1));
|
|
144
|
+
}
|
|
145
|
+
tui.requestRender();
|
|
146
|
+
editor.setText("");
|
|
147
|
+
return "continue";
|
|
148
|
+
}
|
|
149
|
+
async function handleToolList(options, container, editor, tui) {
|
|
150
|
+
const projectDir = path.join(options.workspace.primaryDir, ".acai", "tools");
|
|
151
|
+
const userDir = path.join(process.env["HOME"] || process.env["USERPROFILE"] || "", ".acai", "tools");
|
|
152
|
+
const dirs = [
|
|
153
|
+
{ label: "User tools", dirPath: userDir },
|
|
154
|
+
{ label: "Project tools", dirPath: projectDir },
|
|
155
|
+
];
|
|
156
|
+
let foundAny = false;
|
|
157
|
+
for (const dir of dirs) {
|
|
158
|
+
if (!fs.existsSync(dir.dirPath)) {
|
|
159
|
+
container.addChild(new Text(style.dim(`${dir.label}: directory not found (${dir.dirPath})`), 0, 1));
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const files = fs.readdirSync(dir.dirPath);
|
|
163
|
+
const toolFiles = files.filter((f) => f.endsWith(".js") ||
|
|
164
|
+
f.endsWith(".mjs") ||
|
|
165
|
+
f.endsWith(".cjs") ||
|
|
166
|
+
f.endsWith(".sh") ||
|
|
167
|
+
f.endsWith(".bash") ||
|
|
168
|
+
f.endsWith(".zsh") ||
|
|
169
|
+
f.endsWith(".py") ||
|
|
170
|
+
f.endsWith(".rb") ||
|
|
171
|
+
f.endsWith(".tool") ||
|
|
172
|
+
(!path.extname(f) &&
|
|
173
|
+
fs.statSync(path.join(dir.dirPath, f)).mode & 0o111));
|
|
174
|
+
if (toolFiles.length === 0) {
|
|
175
|
+
container.addChild(new Text(style.dim(`${dir.label}: no tools found`), 0, 1));
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
foundAny = true;
|
|
179
|
+
container.addChild(new Text(style.bold(dir.label), 0, 1));
|
|
180
|
+
for (const file of toolFiles) {
|
|
181
|
+
container.addChild(new Text(style.dim(` ${file}`), 0, 1));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (!foundAny) {
|
|
185
|
+
container.addChild(new Text(style.dim("No dynamic tools found."), 0, 1));
|
|
186
|
+
}
|
|
187
|
+
tui.requestRender();
|
|
188
|
+
editor.setText("");
|
|
189
|
+
return "continue";
|
|
190
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function nodeTemplate(name: string, description: string): string;
|
|
2
|
+
export declare function bashTemplate(name: string, description: string): string;
|
|
3
|
+
export declare function zshTemplate(name: string, description: string): string;
|
|
4
|
+
export declare function textSchemaTemplate(name: string, description: string): string;
|
|
5
|
+
export declare function textCompanionTemplate(name: string): string;
|
|
6
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../source/commands/tools/templates.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CA2BtE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAuBtE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAuBrE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAI5E;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAe1D"}
|