aws-runtime-bridge 1.7.49 → 1.7.50
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/dist/adapter/AcodeSdkAdapter.d.ts +77 -0
- package/dist/adapter/AcodeSdkAdapter.d.ts.map +1 -0
- package/dist/adapter/AcodeSdkAdapter.js +322 -0
- package/dist/adapter/AcodeSdkAdapter.test.d.ts +2 -0
- package/dist/adapter/AcodeSdkAdapter.test.d.ts.map +1 -0
- package/dist/adapter/AcodeSdkAdapter.test.js +273 -0
- package/dist/adapter/AdapterRegistry.d.ts +1 -1
- package/dist/adapter/AdapterRegistry.d.ts.map +1 -1
- package/dist/adapter/AdapterRegistry.js +2 -0
- package/dist/adapter/AdapterRegistry.test.js +10 -1
- package/dist/adapter/SdkProviderSpi.d.ts.map +1 -1
- package/dist/adapter/SdkProviderSpi.js +10 -1
- package/dist/adapter/index.d.ts +1 -0
- package/dist/adapter/index.d.ts.map +1 -1
- package/dist/adapter/index.js +1 -0
- package/dist/adapters/cc-switch/index.d.ts +2 -0
- package/dist/adapters/cc-switch/index.d.ts.map +1 -1
- package/dist/adapters/cc-switch/index.js +6 -0
- package/dist/adapters/cc-switch/mcp-acode.d.ts +17 -0
- package/dist/adapters/cc-switch/mcp-acode.d.ts.map +1 -0
- package/dist/adapters/cc-switch/mcp-acode.js +71 -0
- package/dist/adapters/cc-switch/mcp-acode.test.d.ts +2 -0
- package/dist/adapters/cc-switch/mcp-acode.test.d.ts.map +1 -0
- package/dist/adapters/cc-switch/mcp-acode.test.js +80 -0
- package/dist/adapters/cc-switch/mcp-claude.d.ts.map +1 -1
- package/dist/adapters/cc-switch/mcp-claude.js +1 -0
- package/dist/adapters/cc-switch/mcp-claudecode.d.ts.map +1 -1
- package/dist/adapters/cc-switch/mcp-claudecode.js +1 -0
- package/dist/adapters/cc-switch/mcp-claudecode.test.js +1 -0
- package/dist/adapters/cc-switch/mcp-codex.d.ts.map +1 -1
- package/dist/adapters/cc-switch/mcp-codex.js +1 -0
- package/dist/adapters/cc-switch/mcp-codex.test.js +1 -0
- package/dist/adapters/cc-switch/mcp-opencode.d.ts.map +1 -1
- package/dist/adapters/cc-switch/mcp-opencode.js +1 -0
- package/dist/adapters/cc-switch/mcp-opencode.test.js +1 -0
- package/dist/adapters/cc-switch/skill-acode.d.ts +11 -0
- package/dist/adapters/cc-switch/skill-acode.d.ts.map +1 -0
- package/dist/adapters/cc-switch/skill-acode.js +12 -0
- package/dist/adapters/cc-switch/skill-directory.test.js +1 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -0
- package/dist/index.js +2 -0
- package/dist/routes/ai-sources.js +3 -2
- package/dist/routes/instance.js +1 -1
- package/dist/routes/instance.test.js +2 -1
- package/dist/routes/mcp.js +2 -2
- package/dist/routes/mcp.test.js +2 -1
- package/dist/routes/runtime-binding.d.ts +3 -2
- package/dist/routes/runtime-binding.d.ts.map +1 -1
- package/dist/routes/runtime-binding.js +9 -56
- package/dist/routes/runtime-binding.test.js +4 -80
- package/dist/routes/sessions.d.ts +5 -0
- package/dist/routes/sessions.d.ts.map +1 -1
- package/dist/routes/sessions.js +36 -16
- package/dist/routes/sessions.test.js +13 -0
- package/dist/routes/skills.js +2 -2
- package/dist/routes/skills.test.js +2 -1
- package/dist/routes/terminal.d.ts +9 -4
- package/dist/routes/terminal.d.ts.map +1 -1
- package/dist/routes/terminal.js +26 -8
- package/dist/routes/terminal.test.js +24 -8
- package/dist/services/acode-package.d.ts +8 -0
- package/dist/services/acode-package.d.ts.map +1 -0
- package/dist/services/acode-package.js +82 -0
- package/dist/services/ai-source-apply.d.ts +4 -0
- package/dist/services/ai-source-apply.d.ts.map +1 -1
- package/dist/services/ai-source-apply.js +8 -0
- package/dist/services/ai-source-apply.test.js +8 -1
- package/dist/services/cc-switch-sdk.d.ts.map +1 -1
- package/dist/services/cc-switch-sdk.js +9 -1
- package/dist/services/instance-init-service.d.ts.map +1 -1
- package/dist/services/instance-init-service.js +3 -2
- package/dist/services/instance-init-service.test.js +6 -5
- package/dist/services/instance-service.d.ts.map +1 -1
- package/dist/services/instance-service.js +1 -0
- package/dist/services/instance-state.js +1 -1
- package/dist/services/instance-state.test.js +4 -4
- package/dist/services/tool-installer.d.ts.map +1 -1
- package/dist/services/tool-installer.js +10 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/file-utils.d.ts.map +1 -1
- package/dist/utils/file-utils.js +1 -0
- package/dist/utils/mcp-utils.d.ts.map +1 -1
- package/dist/utils/mcp-utils.js +4 -1
- package/dist/utils/validation.js +1 -1
- package/node_modules/@cc-switch/sdk/dist/constants.d.ts.map +1 -1
- package/node_modules/@cc-switch/sdk/dist/constants.js +7 -0
- package/node_modules/@cc-switch/sdk/dist/schemas.d.ts.map +1 -1
- package/node_modules/@cc-switch/sdk/dist/schemas.js +1 -0
- package/node_modules/@cc-switch/sdk/dist/sdk.d.ts.map +1 -1
- package/node_modules/@cc-switch/sdk/dist/sdk.js +7 -3
- package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.d.ts +6 -0
- package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.d.ts.map +1 -1
- package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.js +27 -1
- package/node_modules/@cc-switch/sdk/dist/types.d.ts +4 -1
- package/node_modules/@cc-switch/sdk/dist/types.d.ts.map +1 -1
- package/package/acode/README.md +88 -0
- package/package/acode/dist/built-in-file-tools.d.ts +16 -0
- package/package/acode/dist/built-in-file-tools.d.ts.map +1 -0
- package/package/acode/dist/built-in-file-tools.js +231 -0
- package/package/acode/dist/cli.d.ts +3 -0
- package/package/acode/dist/cli.d.ts.map +1 -0
- package/package/acode/dist/cli.js +37 -0
- package/package/acode/dist/commands/commandLoader.d.ts +7 -0
- package/package/acode/dist/commands/commandLoader.d.ts.map +1 -0
- package/package/acode/dist/commands/commandLoader.js +33 -0
- package/package/acode/dist/commands/commandParser.d.ts +7 -0
- package/package/acode/dist/commands/commandParser.d.ts.map +1 -0
- package/package/acode/dist/commands/commandParser.js +77 -0
- package/package/acode/dist/commands/commandRegistry.d.ts +13 -0
- package/package/acode/dist/commands/commandRegistry.d.ts.map +1 -0
- package/package/acode/dist/commands/commandRegistry.js +30 -0
- package/package/acode/dist/config.d.ts +4 -0
- package/package/acode/dist/config.d.ts.map +1 -0
- package/package/acode/dist/config.js +80 -0
- package/package/acode/dist/hooks/hookBus.d.ts +19 -0
- package/package/acode/dist/hooks/hookBus.d.ts.map +1 -0
- package/package/acode/dist/hooks/hookBus.js +40 -0
- package/package/acode/dist/index.d.ts +8 -0
- package/package/acode/dist/index.d.ts.map +1 -0
- package/package/acode/dist/index.js +7 -0
- package/package/acode/dist/runtime.d.ts +34 -0
- package/package/acode/dist/runtime.d.ts.map +1 -0
- package/package/acode/dist/runtime.js +571 -0
- package/package/acode/dist/types.d.ts +99 -0
- package/package/acode/dist/types.d.ts.map +1 -0
- package/package/acode/dist/types.js +1 -0
- package/package/acode/package.json +24 -0
- package/package/aws-client-agent-mcp/dist/agent-client.d.ts +4 -4
- package/package/aws-client-agent-mcp/dist/agent-client.d.ts.map +1 -1
- package/package/aws-client-agent-mcp/dist/agent-client.js +9 -6
- package/package/aws-client-agent-mcp/dist/agent-client.js.map +1 -1
- package/package/aws-client-agent-mcp/dist/agent-client.test.js +21 -0
- package/package/aws-client-agent-mcp/dist/agent-client.test.js.map +1 -1
- package/package/aws-client-agent-mcp/dist/http-client.d.ts +1 -17
- package/package/aws-client-agent-mcp/dist/http-client.d.ts.map +1 -1
- package/package/aws-client-agent-mcp/dist/http-client.js +7 -113
- package/package/aws-client-agent-mcp/dist/http-client.js.map +1 -1
- package/package/aws-client-agent-mcp/dist/http-client.test.js +22 -2
- package/package/aws-client-agent-mcp/dist/http-client.test.js.map +1 -1
- package/package/aws-client-agent-mcp/dist/mcp-server.d.ts +0 -5
- package/package/aws-client-agent-mcp/dist/mcp-server.d.ts.map +1 -1
- package/package/aws-client-agent-mcp/dist/mcp-server.js +1 -23
- package/package/aws-client-agent-mcp/dist/mcp-server.js.map +1 -1
- package/package/aws-client-agent-mcp/dist/mcp-server.test.js +89 -6
- package/package/aws-client-agent-mcp/dist/mcp-server.test.js.map +1 -1
- package/package/aws-client-agent-mcp/dist/types.d.ts +3 -0
- package/package/aws-client-agent-mcp/dist/types.d.ts.map +1 -1
- package/package/aws-client-agent-mcp/dist/websocket-client.d.ts +0 -13
- package/package/aws-client-agent-mcp/dist/websocket-client.d.ts.map +1 -1
- package/package/aws-client-agent-mcp/dist/websocket-client.js +3 -100
- package/package/aws-client-agent-mcp/dist/websocket-client.js.map +1 -1
- package/package/cc-switch-sdk/dist/constants.d.ts.map +1 -1
- package/package/cc-switch-sdk/dist/constants.js +7 -0
- package/package/cc-switch-sdk/dist/schemas.d.ts.map +1 -1
- package/package/cc-switch-sdk/dist/schemas.js +1 -0
- package/package/cc-switch-sdk/dist/sdk.d.ts.map +1 -1
- package/package/cc-switch-sdk/dist/sdk.js +7 -3
- package/package/cc-switch-sdk/dist/services/ai-config-service.d.ts +6 -0
- package/package/cc-switch-sdk/dist/services/ai-config-service.d.ts.map +1 -1
- package/package/cc-switch-sdk/dist/services/ai-config-service.js +27 -1
- package/package/cc-switch-sdk/dist/types.d.ts +4 -1
- package/package/cc-switch-sdk/dist/types.d.ts.map +1 -1
- package/package.json +8 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
export const ALL_APPS = [
|
|
4
|
+
"acode",
|
|
4
5
|
"claude",
|
|
5
6
|
"claudecode",
|
|
6
7
|
"codex",
|
|
@@ -9,6 +10,7 @@ export const ALL_APPS = [
|
|
|
9
10
|
"openclaw",
|
|
10
11
|
];
|
|
11
12
|
export const DEFAULT_APP_FLAGS = {
|
|
13
|
+
acode: false,
|
|
12
14
|
claude: false,
|
|
13
15
|
claudecode: false,
|
|
14
16
|
codex: false,
|
|
@@ -18,6 +20,7 @@ export const DEFAULT_APP_FLAGS = {
|
|
|
18
20
|
};
|
|
19
21
|
export function normalizeAppFlags(flags) {
|
|
20
22
|
return {
|
|
23
|
+
acode: Boolean(flags?.acode),
|
|
21
24
|
claude: false,
|
|
22
25
|
claudecode: Boolean(flags?.claudecode) || Boolean(flags?.claude),
|
|
23
26
|
codex: Boolean(flags?.codex),
|
|
@@ -43,6 +46,10 @@ export function resolvePaths(options = {}) {
|
|
|
43
46
|
path.join(os.homedir(), ".codex", "config.toml"),
|
|
44
47
|
codexSkillsDir: options.paths?.codexSkillsDir ??
|
|
45
48
|
path.join(os.homedir(), ".codex", "skills"),
|
|
49
|
+
acodeConfigFile: options.paths?.acodeConfigFile ??
|
|
50
|
+
path.join(os.homedir(), ".acode", "config.json"),
|
|
51
|
+
acodeSkillsDir: options.paths?.acodeSkillsDir ??
|
|
52
|
+
path.join(os.homedir(), ".acode", "skills"),
|
|
46
53
|
opencodeConfigFile: options.paths?.opencodeConfigFile ??
|
|
47
54
|
path.join(os.homedir(), ".opencode", "config.json"),
|
|
48
55
|
opencodeSkillsDir: options.paths?.opencodeSkillsDir ??
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,SAAS,EACT,aAAa,EACb,QAAQ,EACT,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,SAAS,EACT,aAAa,EACb,QAAQ,EACT,MA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B"}
|
|
@@ -95,7 +95,7 @@ export class CcSwitchSdk {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
async backupBeforeMcpSyncByApps(apps) {
|
|
98
|
-
const targets = ["opencode", "claudecode", "codex"];
|
|
98
|
+
const targets = ["acode", "opencode", "claudecode", "codex"];
|
|
99
99
|
for (const appId of targets) {
|
|
100
100
|
if (apps[appId]) {
|
|
101
101
|
await this.backupAiConfigIfNeeded(appId);
|
|
@@ -105,7 +105,7 @@ export class CcSwitchSdk {
|
|
|
105
105
|
async backupBeforeMcpSync(server) {
|
|
106
106
|
await this.backupBeforeMcpSyncByApps(server.apps);
|
|
107
107
|
}
|
|
108
|
-
async backupAiConfigs(appIds = ["opencode", "claudecode", "codex"]) {
|
|
108
|
+
async backupAiConfigs(appIds = ["acode", "opencode", "claudecode", "codex"]) {
|
|
109
109
|
for (const appId of appIds) {
|
|
110
110
|
await this.backupAiConfigIfNeeded(appId);
|
|
111
111
|
}
|
|
@@ -122,7 +122,7 @@ export class CcSwitchSdk {
|
|
|
122
122
|
await copyFile(backupPath, configPath);
|
|
123
123
|
return true;
|
|
124
124
|
}
|
|
125
|
-
async restoreAiConfigs(appIds = ["opencode", "claudecode", "codex"]) {
|
|
125
|
+
async restoreAiConfigs(appIds = ["acode", "opencode", "claudecode", "codex"]) {
|
|
126
126
|
const result = {};
|
|
127
127
|
for (const appId of appIds) {
|
|
128
128
|
result[appId] = await this.restoreAiConfig(appId);
|
|
@@ -169,6 +169,7 @@ export class CcSwitchSdk {
|
|
|
169
169
|
...server,
|
|
170
170
|
apps: {
|
|
171
171
|
claude: false,
|
|
172
|
+
acode: false,
|
|
172
173
|
claudecode: false,
|
|
173
174
|
codex: false,
|
|
174
175
|
gemini: false,
|
|
@@ -264,6 +265,7 @@ export class CcSwitchSdk {
|
|
|
264
265
|
return {
|
|
265
266
|
...imp,
|
|
266
267
|
apps: {
|
|
268
|
+
acode: false,
|
|
267
269
|
claude: false,
|
|
268
270
|
claudecode: false,
|
|
269
271
|
codex: false,
|
|
@@ -315,6 +317,7 @@ export class CcSwitchSdk {
|
|
|
315
317
|
const disabled = {
|
|
316
318
|
...skill,
|
|
317
319
|
apps: {
|
|
320
|
+
acode: false,
|
|
318
321
|
claude: false,
|
|
319
322
|
claudecode: false,
|
|
320
323
|
codex: false,
|
|
@@ -449,6 +452,7 @@ export class CcSwitchSdk {
|
|
|
449
452
|
directory: imp.directory,
|
|
450
453
|
description: imp.description,
|
|
451
454
|
apps: {
|
|
455
|
+
acode: false,
|
|
452
456
|
claude: false,
|
|
453
457
|
claudecode: false,
|
|
454
458
|
codex: false,
|
|
@@ -46,11 +46,13 @@ export interface CodexConfig {
|
|
|
46
46
|
model_providers?: Record<string, CodexModelProviderConfig>;
|
|
47
47
|
}
|
|
48
48
|
export interface AiConfigPaths {
|
|
49
|
+
acodeConfigFile: string;
|
|
49
50
|
claudecodeConfigFile: string;
|
|
50
51
|
codexConfigFile: string;
|
|
51
52
|
opencodeConfigFile: string;
|
|
52
53
|
}
|
|
53
54
|
export declare function buildToolSpecificAiConfig(template: AiConfigTemplate): {
|
|
55
|
+
acode: OpenCodeConfig;
|
|
54
56
|
claudecode: ClaudeCodeConfig;
|
|
55
57
|
codex: CodexConfig;
|
|
56
58
|
opencode: OpenCodeConfig;
|
|
@@ -59,15 +61,19 @@ export declare class AiConfigService {
|
|
|
59
61
|
private readonly paths;
|
|
60
62
|
constructor(paths: AiConfigPaths);
|
|
61
63
|
readClaudeCodeConfig(): Promise<ClaudeCodeConfig>;
|
|
64
|
+
readAcodeConfig(): Promise<OpenCodeConfig>;
|
|
62
65
|
readOpenCodeConfig(): Promise<OpenCodeConfig>;
|
|
63
66
|
readCodexConfig(): Promise<CodexConfig>;
|
|
64
67
|
writeClaudeCodeConfig(config: ClaudeCodeConfig): Promise<void>;
|
|
68
|
+
writeAcodeConfig(config: OpenCodeConfig): Promise<void>;
|
|
65
69
|
writeOpenCodeConfig(config: OpenCodeConfig): Promise<void>;
|
|
66
70
|
writeCodexConfig(config: CodexConfig): Promise<void>;
|
|
67
71
|
applyClaudeCodeConfig(patch: ClaudeCodeConfig): Promise<ClaudeCodeConfig>;
|
|
68
72
|
applyOpenCodeConfig(patch: OpenCodeConfig): Promise<OpenCodeConfig>;
|
|
73
|
+
applyAcodeConfig(patch: OpenCodeConfig): Promise<OpenCodeConfig>;
|
|
69
74
|
applyCodexConfig(patch: CodexConfig): Promise<CodexConfig>;
|
|
70
75
|
applyAiConfigTemplate(template: AiConfigTemplate): Promise<{
|
|
76
|
+
acode: OpenCodeConfig;
|
|
71
77
|
claudecode: ClaudeCodeConfig;
|
|
72
78
|
codex: CodexConfig;
|
|
73
79
|
opencode: OpenCodeConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-config-service.d.ts","sourceRoot":"","sources":["../../src/services/ai-config-service.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE;QACJ,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE;YACX,KAAK,EAAE,MAAM,EAAE,C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QACtB,UAAU,EAAE,gBAAgB,CAAC;QAC7B,KAAK,EAAE,WAAW,CAAC;QACnB,QAAQ,EAAE,cAAc,CAAC;KAC1B,GAAG,IAAI,CAAC;CAaV"}
|
|
@@ -175,6 +175,19 @@ export function buildToolSpecificAiConfig(template) {
|
|
|
175
175
|
},
|
|
176
176
|
}]));
|
|
177
177
|
return {
|
|
178
|
+
acode: {
|
|
179
|
+
provider: {
|
|
180
|
+
default: {
|
|
181
|
+
npm: "@ai-sdk/openai-compatible",
|
|
182
|
+
model,
|
|
183
|
+
options: {
|
|
184
|
+
baseURL: openCodeBaseUrl,
|
|
185
|
+
apiKey,
|
|
186
|
+
},
|
|
187
|
+
models: opencodeModels,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
178
191
|
claudecode: {
|
|
179
192
|
env: {
|
|
180
193
|
ANTHROPIC_BASE_URL: baseUrl,
|
|
@@ -227,6 +240,9 @@ export class AiConfigService {
|
|
|
227
240
|
async readClaudeCodeConfig() {
|
|
228
241
|
return readJsonFile(this.paths.claudecodeConfigFile, {});
|
|
229
242
|
}
|
|
243
|
+
async readAcodeConfig() {
|
|
244
|
+
return readJsonFile(this.paths.acodeConfigFile, {});
|
|
245
|
+
}
|
|
230
246
|
async readOpenCodeConfig() {
|
|
231
247
|
return readJsonFile(this.paths.opencodeConfigFile, {});
|
|
232
248
|
}
|
|
@@ -242,6 +258,9 @@ export class AiConfigService {
|
|
|
242
258
|
async writeClaudeCodeConfig(config) {
|
|
243
259
|
await writeJsonFile(this.paths.claudecodeConfigFile, config);
|
|
244
260
|
}
|
|
261
|
+
async writeAcodeConfig(config) {
|
|
262
|
+
await writeJsonFile(this.paths.acodeConfigFile, config);
|
|
263
|
+
}
|
|
245
264
|
async writeOpenCodeConfig(config) {
|
|
246
265
|
await writeJsonFile(this.paths.opencodeConfigFile, config);
|
|
247
266
|
}
|
|
@@ -262,6 +281,12 @@ export class AiConfigService {
|
|
|
262
281
|
await this.writeOpenCodeConfig(merged);
|
|
263
282
|
return merged;
|
|
264
283
|
}
|
|
284
|
+
async applyAcodeConfig(patch) {
|
|
285
|
+
const current = await this.readAcodeConfig();
|
|
286
|
+
const merged = deepMergeConfig(current, patch);
|
|
287
|
+
await this.writeAcodeConfig(merged);
|
|
288
|
+
return merged;
|
|
289
|
+
}
|
|
265
290
|
async applyCodexConfig(patch) {
|
|
266
291
|
const current = await this.readCodexConfig();
|
|
267
292
|
const merged = deepMergeConfig(current, patch);
|
|
@@ -273,9 +298,10 @@ export class AiConfigService {
|
|
|
273
298
|
if (!configs) {
|
|
274
299
|
return null;
|
|
275
300
|
}
|
|
301
|
+
const acode = await this.applyAcodeConfig(configs.acode);
|
|
276
302
|
const claudecode = await this.applyClaudeCodeConfig(configs.claudecode);
|
|
277
303
|
const codex = await this.applyCodexConfig(configs.codex);
|
|
278
304
|
const opencode = await this.applyOpenCodeConfig(configs.opencode);
|
|
279
|
-
return { claudecode, codex, opencode };
|
|
305
|
+
return { acode, claudecode, codex, opencode };
|
|
280
306
|
}
|
|
281
307
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AppId = "claude" | "claudecode" | "codex" | "gemini" | "opencode" | "openclaw";
|
|
1
|
+
export type AppId = "acode" | "claude" | "claudecode" | "codex" | "gemini" | "opencode" | "openclaw";
|
|
2
2
|
export type McpServerType = "stdio" | "sse" | "http";
|
|
3
3
|
export interface McpServerSpec {
|
|
4
4
|
type?: McpServerType;
|
|
@@ -11,6 +11,7 @@ export interface McpServerSpec {
|
|
|
11
11
|
[key: string]: unknown;
|
|
12
12
|
}
|
|
13
13
|
export interface AppFlags {
|
|
14
|
+
acode: boolean;
|
|
14
15
|
claude: boolean;
|
|
15
16
|
claudecode: boolean;
|
|
16
17
|
codex: boolean;
|
|
@@ -47,6 +48,8 @@ export interface SdkPaths {
|
|
|
47
48
|
claudecodeSkillsDir: string;
|
|
48
49
|
codexConfigFile: string;
|
|
49
50
|
codexSkillsDir: string;
|
|
51
|
+
acodeConfigFile: string;
|
|
52
|
+
acodeSkillsDir: string;
|
|
50
53
|
opencodeConfigFile: string;
|
|
51
54
|
opencodeSkillsDir: string;
|
|
52
55
|
ssotSkillsDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAErG,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,W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CAAC;CAC/C;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,aAAa,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACtC,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,YAAY,IAAI,OAAO,CACrB,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,CAAC,CACzE,CAAC;IACF,SAAS,CACP,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# ACode
|
|
2
|
+
|
|
3
|
+
ACode is the built-in headless AI agent runtime bundled with `aws-runtime-bridge`.
|
|
4
|
+
It is not installed or uninstalled as an external tool. Runtime configuration and
|
|
5
|
+
MCP/Skill synchronization are stored under the bridge runtime home in `.acode/`.
|
|
6
|
+
|
|
7
|
+
Current scope:
|
|
8
|
+
|
|
9
|
+
- non-TUI runtime session loop
|
|
10
|
+
- structured JSONL events for bridge adapters
|
|
11
|
+
- MCP configuration discovery from `.acode/config.json`
|
|
12
|
+
- Skill discovery from `.acode/skills/*/SKILL.md`
|
|
13
|
+
- Markdown slash command discovery from configured command directories
|
|
14
|
+
- Claude Code-inspired tool permission rules and slash-command tool allowlists
|
|
15
|
+
- Minimal HookBus lifecycle for runtime extensions and tool-use guards
|
|
16
|
+
|
|
17
|
+
## Slash commands
|
|
18
|
+
|
|
19
|
+
ACode can load Markdown slash commands from directories configured in
|
|
20
|
+
`.acode/config.json` or passed by the runtime bridge:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"commandDirs": ["/absolute/path/to/commands"],
|
|
25
|
+
"commands": {
|
|
26
|
+
"directories": ["/another/commands/path"]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Each command is a `.md` file. The command name defaults to the file name, or can
|
|
32
|
+
be supplied through frontmatter. The Markdown body is used as a prompt template;
|
|
33
|
+
`$ARGUMENTS` is replaced with the text that follows the slash command.
|
|
34
|
+
|
|
35
|
+
```md
|
|
36
|
+
---
|
|
37
|
+
name: review
|
|
38
|
+
description: Review current changes
|
|
39
|
+
allowed-tools: [read_file, edit_file]
|
|
40
|
+
argument-hint: <scope>
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
Review $ARGUMENTS and report risks.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The current parser intentionally supports only simple scalar frontmatter fields
|
|
47
|
+
and comma-separated list values. It does not implement full YAML parsing,
|
|
48
|
+
nested objects, or multiline frontmatter values. `allowed-tools` is enforced for
|
|
49
|
+
the expanded command turn, so a command can narrow which built-in or MCP tools
|
|
50
|
+
the model may call while handling that command.
|
|
51
|
+
|
|
52
|
+
## Tool permissions
|
|
53
|
+
|
|
54
|
+
ACode can load Claude Code-style tool permission rules from `.acode/config.json`
|
|
55
|
+
or from `ACodeRuntimeConfig.permissions`:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"permissions": {
|
|
60
|
+
"mode": "default",
|
|
61
|
+
"allow": ["read_file", "aws-mcp.*"],
|
|
62
|
+
"deny": ["write_file"]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Denied rules win before allowed rules. If `allow` is non-empty, every tool call
|
|
68
|
+
must match at least one allowed rule. Rules match exposed tool names such as
|
|
69
|
+
`write_file`, built-in source names such as `builtin.write_file`, MCP source
|
|
70
|
+
names such as `aws-mcp.poll_message`, and simple trailing-wildcard patterns.
|
|
71
|
+
Set `mode` to `bypassPermissions` only for trusted non-interactive automation.
|
|
72
|
+
|
|
73
|
+
## HookBus lifecycle
|
|
74
|
+
|
|
75
|
+
Runtime integrations can pass hook handlers through `ACodeRuntimeConfig.hooks`.
|
|
76
|
+
ACode dispatches these lifecycle events:
|
|
77
|
+
|
|
78
|
+
- `SessionStart` after config, skills, commands, MCP servers, and built-in tools are loaded
|
|
79
|
+
- `UserPromptSubmit` before a user prompt or slash command is submitted
|
|
80
|
+
- `PreToolUse` before a built-in or MCP tool call
|
|
81
|
+
- `PostToolUse` after a built-in or MCP tool call completes
|
|
82
|
+
- `Stop` during runtime shutdown
|
|
83
|
+
|
|
84
|
+
Hook handlers may return `{ "decision": "deny", "message": "..." }` to block a
|
|
85
|
+
prompt or tool call. Hook errors are reported as runtime `error` events and are
|
|
86
|
+
otherwise fail-open so extension failures do not crash the session. The
|
|
87
|
+
`modify` decision value is reserved for a future prompt/tool-argument mutation
|
|
88
|
+
API and is not applied by the current runtime.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
2
|
+
[key: string]: JsonValue;
|
|
3
|
+
};
|
|
4
|
+
export type JsonObject = {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
export interface ACodeBuiltInTool {
|
|
8
|
+
kind: 'builtin';
|
|
9
|
+
toolName: string;
|
|
10
|
+
exposedName: string;
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: JsonObject;
|
|
13
|
+
execute(args: JsonObject): Promise<unknown>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createBuiltInFileTools(workingDirectory: string): ACodeBuiltInTool[];
|
|
16
|
+
//# sourceMappingURL=built-in-file-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"built-in-file-tools.d.ts","sourceRoot":"","sources":["../src/built-in-file-tools.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AACtG,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C;AAwPD,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAEnF"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { promises as fs } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
function toDisplayPath(targetPath) {
|
|
5
|
+
return targetPath.replace(/\\/g, '/');
|
|
6
|
+
}
|
|
7
|
+
async function pathExists(targetPath) {
|
|
8
|
+
try {
|
|
9
|
+
await fs.access(targetPath);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function countOccurrences(content, search) {
|
|
17
|
+
if (!search) {
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
let count = 0;
|
|
21
|
+
let index = content.indexOf(search);
|
|
22
|
+
while (index >= 0) {
|
|
23
|
+
count += 1;
|
|
24
|
+
index = content.indexOf(search, index + search.length);
|
|
25
|
+
}
|
|
26
|
+
return count;
|
|
27
|
+
}
|
|
28
|
+
function readStringArg(args, names, label) {
|
|
29
|
+
for (const name of names) {
|
|
30
|
+
const value = args[name];
|
|
31
|
+
if (typeof value === 'string') {
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`${label} is required`);
|
|
36
|
+
}
|
|
37
|
+
function ensureInsideWorkspace(workspaceRoot, targetPath) {
|
|
38
|
+
const resolvedTargetPath = path.resolve(targetPath);
|
|
39
|
+
const relativePath = path.relative(workspaceRoot, resolvedTargetPath);
|
|
40
|
+
if (relativePath.startsWith('..') || path.isAbsolute(relativePath)) {
|
|
41
|
+
throw new Error(`Target path is outside workspace: ${resolvedTargetPath}`);
|
|
42
|
+
}
|
|
43
|
+
return resolvedTargetPath;
|
|
44
|
+
}
|
|
45
|
+
async function ensureWritableTarget(workspaceRoot, targetPath) {
|
|
46
|
+
const realParentPath = await fs.realpath(path.dirname(targetPath));
|
|
47
|
+
ensureInsideWorkspace(workspaceRoot, realParentPath);
|
|
48
|
+
try {
|
|
49
|
+
const targetLinkStat = await fs.lstat(targetPath);
|
|
50
|
+
if (targetLinkStat.isSymbolicLink()) {
|
|
51
|
+
throw new Error(`Refusing to write through symbolic link: ${targetPath}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
const errorCode = typeof error === 'object' && error !== null ? Reflect.get(error, 'code') : undefined;
|
|
56
|
+
if (errorCode !== 'ENOENT') {
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 解析内置文件工具目标路径。
|
|
63
|
+
* 主流程:同时校验请求路径与 realpath 工作区边界,防止绝对路径、`..` 与符号链接目录穿透。
|
|
64
|
+
*/
|
|
65
|
+
async function resolveWorkspaceTarget(workingDirectory, rawFilePath) {
|
|
66
|
+
const requestedRoot = path.resolve(String(workingDirectory || '').trim());
|
|
67
|
+
const workspaceRoot = await fs.realpath(requestedRoot);
|
|
68
|
+
const workspaceStat = await fs.stat(workspaceRoot);
|
|
69
|
+
if (!workspaceStat.isDirectory()) {
|
|
70
|
+
throw new Error(`Workspace path is not a directory: ${requestedRoot}`);
|
|
71
|
+
}
|
|
72
|
+
const normalizedFilePath = rawFilePath.trim();
|
|
73
|
+
if (!normalizedFilePath) {
|
|
74
|
+
throw new Error('file_path is required');
|
|
75
|
+
}
|
|
76
|
+
const requestedPath = path.isAbsolute(normalizedFilePath)
|
|
77
|
+
? path.resolve(normalizedFilePath)
|
|
78
|
+
: path.resolve(requestedRoot, normalizedFilePath);
|
|
79
|
+
const requestedRelativePath = path.relative(requestedRoot, requestedPath);
|
|
80
|
+
if (requestedRelativePath.startsWith('..') || path.isAbsolute(requestedRelativePath)) {
|
|
81
|
+
throw new Error(`Target path is outside workspace: ${requestedPath}`);
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
workspaceRoot,
|
|
85
|
+
requestedPath,
|
|
86
|
+
targetPath: ensureInsideWorkspace(workspaceRoot, path.join(workspaceRoot, requestedRelativePath)),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 原子写入完整文件内容。
|
|
91
|
+
* 主流程:创建父目录 -> 校验 realpath 边界和符号链接 -> 写同目录临时文件 -> rename 覆盖目标。
|
|
92
|
+
*/
|
|
93
|
+
async function writeFileAtomically(workingDirectory, filePath, content) {
|
|
94
|
+
const target = await resolveWorkspaceTarget(workingDirectory, filePath);
|
|
95
|
+
const parentPath = path.dirname(target.targetPath);
|
|
96
|
+
const createdParentDirectory = !(await pathExists(parentPath));
|
|
97
|
+
await fs.mkdir(parentPath, { recursive: true });
|
|
98
|
+
await ensureWritableTarget(target.workspaceRoot, target.targetPath);
|
|
99
|
+
const temporaryPath = path.join(parentPath, `.${path.basename(target.targetPath)}.${process.pid}.${randomUUID()}.tmp`);
|
|
100
|
+
try {
|
|
101
|
+
await fs.writeFile(temporaryPath, content, 'utf-8');
|
|
102
|
+
await fs.rename(temporaryPath, target.targetPath);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
await fs.rm(temporaryPath, { force: true });
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
workspaceRoot: target.workspaceRoot,
|
|
110
|
+
targetPath: target.targetPath,
|
|
111
|
+
bytes: Buffer.byteLength(content, 'utf-8'),
|
|
112
|
+
createdParentDirectory,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
async function readFileInsideWorkspace(workingDirectory, filePath) {
|
|
116
|
+
const target = await resolveWorkspaceTarget(workingDirectory, filePath);
|
|
117
|
+
const realTargetPath = ensureInsideWorkspace(target.workspaceRoot, await fs.realpath(target.targetPath));
|
|
118
|
+
const stat = await fs.stat(realTargetPath);
|
|
119
|
+
if (!stat.isFile()) {
|
|
120
|
+
throw new Error(`Path is not a file: ${realTargetPath}`);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
workspaceRoot: target.workspaceRoot,
|
|
124
|
+
targetPath: realTargetPath,
|
|
125
|
+
content: await fs.readFile(realTargetPath, 'utf-8'),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function writeFileTool(workingDirectory) {
|
|
129
|
+
return {
|
|
130
|
+
kind: 'builtin',
|
|
131
|
+
toolName: 'write_file',
|
|
132
|
+
exposedName: 'write_file',
|
|
133
|
+
description: 'Create or overwrite a UTF-8 text file inside the current workspace. Parent directories are created automatically.',
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: 'object',
|
|
136
|
+
properties: {
|
|
137
|
+
file_path: { type: 'string', description: 'Workspace-relative file path to write.' },
|
|
138
|
+
content: { type: 'string', description: 'Complete UTF-8 file content.' },
|
|
139
|
+
},
|
|
140
|
+
required: ['file_path', 'content'],
|
|
141
|
+
additionalProperties: false,
|
|
142
|
+
},
|
|
143
|
+
async execute(args) {
|
|
144
|
+
const filePath = readStringArg(args, ['file_path', 'filePath'], 'file_path');
|
|
145
|
+
const content = readStringArg(args, ['content'], 'content');
|
|
146
|
+
const result = await writeFileAtomically(workingDirectory, filePath, content);
|
|
147
|
+
return {
|
|
148
|
+
ok: true,
|
|
149
|
+
tool: 'write_file',
|
|
150
|
+
workspacePath: toDisplayPath(result.workspaceRoot),
|
|
151
|
+
filePath: toDisplayPath(result.targetPath),
|
|
152
|
+
bytes: result.bytes,
|
|
153
|
+
createdParentDirectory: result.createdParentDirectory,
|
|
154
|
+
};
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function editFileTool(workingDirectory) {
|
|
159
|
+
return {
|
|
160
|
+
kind: 'builtin',
|
|
161
|
+
toolName: 'edit_file',
|
|
162
|
+
exposedName: 'edit_file',
|
|
163
|
+
description: 'Replace exactly one occurrence of old_string with new_string in a UTF-8 workspace text file.',
|
|
164
|
+
inputSchema: {
|
|
165
|
+
type: 'object',
|
|
166
|
+
properties: {
|
|
167
|
+
file_path: { type: 'string', description: 'Workspace-relative file path to edit.' },
|
|
168
|
+
old_string: { type: 'string', description: 'Existing text to replace. Must occur exactly once.' },
|
|
169
|
+
new_string: { type: 'string', description: 'Replacement text.' },
|
|
170
|
+
},
|
|
171
|
+
required: ['file_path', 'old_string', 'new_string'],
|
|
172
|
+
additionalProperties: false,
|
|
173
|
+
},
|
|
174
|
+
async execute(args) {
|
|
175
|
+
const filePath = readStringArg(args, ['file_path', 'filePath'], 'file_path');
|
|
176
|
+
const oldString = readStringArg(args, ['old_string', 'oldString'], 'old_string');
|
|
177
|
+
const newString = readStringArg(args, ['new_string', 'newString'], 'new_string');
|
|
178
|
+
if (!oldString) {
|
|
179
|
+
throw new Error('old_string must not be empty');
|
|
180
|
+
}
|
|
181
|
+
const current = await readFileInsideWorkspace(workingDirectory, filePath);
|
|
182
|
+
const occurrences = countOccurrences(current.content, oldString);
|
|
183
|
+
if (occurrences === 0) {
|
|
184
|
+
throw new Error('old_string was not found in file');
|
|
185
|
+
}
|
|
186
|
+
if (occurrences > 1) {
|
|
187
|
+
throw new Error(`old_string occurs ${occurrences} times; provide a unique match`);
|
|
188
|
+
}
|
|
189
|
+
const updatedContent = current.content.replace(oldString, newString);
|
|
190
|
+
const result = await writeFileAtomically(workingDirectory, filePath, updatedContent);
|
|
191
|
+
return {
|
|
192
|
+
ok: true,
|
|
193
|
+
tool: 'edit_file',
|
|
194
|
+
workspacePath: toDisplayPath(result.workspaceRoot),
|
|
195
|
+
filePath: toDisplayPath(result.targetPath),
|
|
196
|
+
replacements: 1,
|
|
197
|
+
bytes: result.bytes,
|
|
198
|
+
};
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function readFileTool(workingDirectory) {
|
|
203
|
+
return {
|
|
204
|
+
kind: 'builtin',
|
|
205
|
+
toolName: 'read_file',
|
|
206
|
+
exposedName: 'read_file',
|
|
207
|
+
description: 'Read a UTF-8 text file inside the current workspace.',
|
|
208
|
+
inputSchema: {
|
|
209
|
+
type: 'object',
|
|
210
|
+
properties: {
|
|
211
|
+
file_path: { type: 'string', description: 'Workspace-relative file path to read.' },
|
|
212
|
+
},
|
|
213
|
+
required: ['file_path'],
|
|
214
|
+
additionalProperties: false,
|
|
215
|
+
},
|
|
216
|
+
async execute(args) {
|
|
217
|
+
const filePath = readStringArg(args, ['file_path', 'filePath'], 'file_path');
|
|
218
|
+
const result = await readFileInsideWorkspace(workingDirectory, filePath);
|
|
219
|
+
return {
|
|
220
|
+
ok: true,
|
|
221
|
+
tool: 'read_file',
|
|
222
|
+
workspacePath: toDisplayPath(result.workspaceRoot),
|
|
223
|
+
filePath: toDisplayPath(result.targetPath),
|
|
224
|
+
content: result.content,
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
export function createBuiltInFileTools(workingDirectory) {
|
|
230
|
+
return [readFileTool(workingDirectory), writeFileTool(workingDirectory), editFileTool(workingDirectory)];
|
|
231
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { ACodeRuntime } from './runtime.js';
|
|
5
|
+
function getFlagValue(args, name) {
|
|
6
|
+
const index = args.indexOf(name);
|
|
7
|
+
if (index >= 0) {
|
|
8
|
+
return args[index + 1];
|
|
9
|
+
}
|
|
10
|
+
const prefixed = args.find((arg) => arg.startsWith(`${name}=`));
|
|
11
|
+
return prefixed ? prefixed.slice(name.length + 1) : undefined;
|
|
12
|
+
}
|
|
13
|
+
async function main() {
|
|
14
|
+
const args = process.argv.slice(2);
|
|
15
|
+
const cwd = path.resolve(getFlagValue(args, '--cwd') || process.cwd());
|
|
16
|
+
const configPath = getFlagValue(args, '--config');
|
|
17
|
+
const skillsDir = getFlagValue(args, '--skills-dir');
|
|
18
|
+
const prompt = getFlagValue(args, '--prompt') || args.filter((arg) => !arg.startsWith('--')).join(' ');
|
|
19
|
+
const runtime = new ACodeRuntime({
|
|
20
|
+
sessionId: getFlagValue(args, '--session-id') || randomUUID(),
|
|
21
|
+
workingDirectory: cwd,
|
|
22
|
+
configPath,
|
|
23
|
+
skillsDir,
|
|
24
|
+
initialPrompt: prompt,
|
|
25
|
+
model: getFlagValue(args, '--model'),
|
|
26
|
+
});
|
|
27
|
+
runtime.on('event', (event) => {
|
|
28
|
+
process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
29
|
+
});
|
|
30
|
+
await runtime.start();
|
|
31
|
+
await runtime.stop();
|
|
32
|
+
}
|
|
33
|
+
main().catch((error) => {
|
|
34
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
35
|
+
process.stderr.write(`[acode] ${message}\n`);
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ACodeCommandSpec } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 从命令目录加载 Markdown slash commands。
|
|
4
|
+
* 主流程:跳过不存在目录与隐藏文件 -> 解析 `.md` 文件 -> 按文件名稳定排序。
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadAcodeCommands(commandDirs: readonly string[]): Promise<ACodeCommandSpec[]>;
|
|
7
|
+
//# sourceMappingURL=commandLoader.d.ts.map
|