lcagent-cli 0.1.6 → 0.1.7
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 +132 -1
- package/dist/app/bootstrap.d.ts +4 -1
- package/dist/app/bootstrap.js +2 -2
- package/dist/bin/cli.js +81 -8
- package/dist/config/schema.d.ts +2 -0
- package/dist/config/schema.js +2 -0
- package/dist/core/engine.d.ts +3 -2
- package/dist/core/engine.js +100 -10
- package/dist/core/loop.d.ts +7 -2
- package/dist/core/loop.js +9 -2
- package/dist/core/message.d.ts +9 -0
- package/dist/core/message.js +9 -0
- package/dist/tools/editFile.d.ts +8 -0
- package/dist/tools/editFile.js +262 -15
- package/dist/tools/editUtils.d.ts +15 -0
- package/dist/tools/editUtils.js +142 -0
- package/dist/tools/execute.js +56 -7
- package/dist/tools/permissions.d.ts +12 -0
- package/dist/tools/permissions.js +105 -0
- package/dist/tools/runShell.js +0 -6
- package/dist/tools/types.d.ts +28 -0
- package/package.json +3 -1
package/dist/tools/runShell.js
CHANGED
|
@@ -23,12 +23,6 @@ export const runShellTool = {
|
|
|
23
23
|
},
|
|
24
24
|
isReadOnly: false,
|
|
25
25
|
async execute(input, context) {
|
|
26
|
-
if (context.approvalMode === 'manual') {
|
|
27
|
-
return {
|
|
28
|
-
isError: true,
|
|
29
|
-
content: 'run_shell is blocked in manual approval mode. Switch config approvalMode to auto to enable shell execution.',
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
26
|
try {
|
|
33
27
|
const command = input.command ?? input.cmd;
|
|
34
28
|
if (!command) {
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -2,10 +2,38 @@ import type { z } from 'zod';
|
|
|
2
2
|
export type ToolExecutionResult = {
|
|
3
3
|
content: string;
|
|
4
4
|
isError?: boolean;
|
|
5
|
+
meta?: ToolExecutionMeta;
|
|
6
|
+
};
|
|
7
|
+
export type ToolFailureStage = 'lookup' | 'validation' | 'approval' | 'execution';
|
|
8
|
+
export type ToolApprovalRequest = {
|
|
9
|
+
toolName: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
reason: string;
|
|
12
|
+
targets: string[];
|
|
13
|
+
risk: 'low' | 'medium' | 'high';
|
|
14
|
+
input: unknown;
|
|
15
|
+
};
|
|
16
|
+
export type ToolApprovalResponse = {
|
|
17
|
+
approved: boolean;
|
|
18
|
+
reason?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ToolApprovalMeta = {
|
|
21
|
+
mode: 'auto' | 'manual';
|
|
22
|
+
required: boolean;
|
|
23
|
+
approved?: boolean;
|
|
24
|
+
risk?: 'low' | 'medium' | 'high';
|
|
25
|
+
targets?: string[];
|
|
26
|
+
};
|
|
27
|
+
export type ToolExecutionMeta = {
|
|
28
|
+
cwd: string;
|
|
29
|
+
durationMs: number;
|
|
30
|
+
approval: ToolApprovalMeta;
|
|
31
|
+
failureStage?: ToolFailureStage;
|
|
5
32
|
};
|
|
6
33
|
export type ToolContext = {
|
|
7
34
|
cwd: string;
|
|
8
35
|
approvalMode: 'auto' | 'manual';
|
|
36
|
+
requestApproval?: (request: ToolApprovalRequest) => Promise<ToolApprovalResponse>;
|
|
9
37
|
};
|
|
10
38
|
export type AnthropicToolDefinition = {
|
|
11
39
|
name: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lcagent-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "A minimal coding agent CLI for terminal-based coding workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"dev": "tsx src/bin/cli.ts",
|
|
19
19
|
"build": "tsc -p tsconfig.json",
|
|
20
20
|
"check": "tsc -p tsconfig.json --noEmit",
|
|
21
|
+
"smoke": "npm run build && node ./scripts/smoke.mjs",
|
|
21
22
|
"start": "node dist/bin/cli.js",
|
|
22
23
|
"prepublishOnly": "npm run build"
|
|
23
24
|
},
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
],
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"commander": "^11.1.0",
|
|
36
|
+
"diff": "^8.0.4",
|
|
35
37
|
"undici": "^5.28.5",
|
|
36
38
|
"zod": "^4.1.5"
|
|
37
39
|
},
|