@cortexkit/aft-opencode 0.24.0 → 0.25.1
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/index.d.ts.map +1 -1
- package/dist/index.js +22 -21
- package/dist/tools/hoisted.d.ts.map +1 -1
- package/dist/tools/safety.d.ts.map +1 -1
- package/dist/tui.js +7 -7
- package/package.json +7 -7
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA8JlD;;;;;;;;;;;;;;;;;;GAkBG;AAQH,QAAA,MAAM,MAAM,EAAE,MAA6D,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA8JlD;;;;;;;;;;;;;;;;;;GAkBG;AAQH,QAAA,MAAM,MAAM,EAAE,MAA6D,CAAC;AA4vB5E,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -29479,19 +29479,23 @@ ${fileList}`;
|
|
|
29479
29479
|
}
|
|
29480
29480
|
};
|
|
29481
29481
|
}
|
|
29482
|
-
var DELETE_DESCRIPTION = `Delete one or more files with backup.
|
|
29482
|
+
var DELETE_DESCRIPTION = `Delete one or more files (or directories) with backup.
|
|
29483
29483
|
|
|
29484
|
-
` +
|
|
29484
|
+
` + "Each file is backed up before deletion \u2014 use aft_safety undo to recover any of them. " + `For directories, every file inside is individually backed up before the tree is removed.
|
|
29485
29485
|
|
|
29486
|
-
|
|
29486
|
+
Directory deletion requires recursive: true. Without it, passing a directory returns an error.
|
|
29487
|
+
|
|
29488
|
+
Returns: { success, complete, deleted: [paths], skipped_files: [{file, reason}] }. Partial success is allowed: files that can be deleted are deleted; files that fail (missing, permission denied, etc.) are reported in skipped_files. \`complete: false\` indicates at least one file was skipped.`;
|
|
29487
29489
|
function createDeleteTool(ctx) {
|
|
29488
29490
|
return {
|
|
29489
29491
|
description: DELETE_DESCRIPTION,
|
|
29490
29492
|
args: {
|
|
29491
|
-
files: z4.array(z4.string()).min(1).describe("Paths to delete (one or more).
|
|
29493
|
+
files: z4.array(z4.string()).min(1).describe("Paths to delete (one or more). May include directories when recursive=true."),
|
|
29494
|
+
recursive: z4.boolean().optional().describe("Required to delete a directory and its contents. Defaults to false; passing a directory without this returns an error.")
|
|
29492
29495
|
},
|
|
29493
29496
|
execute: async (args, context) => {
|
|
29494
29497
|
const inputs = args.files;
|
|
29498
|
+
const recursive = args.recursive === true;
|
|
29495
29499
|
const absolutePaths = inputs.map((f) => path4.isAbsolute(f) ? f : path4.resolve(context.directory, f));
|
|
29496
29500
|
{
|
|
29497
29501
|
const asked = new Set;
|
|
@@ -29510,19 +29514,13 @@ function createDeleteTool(ctx) {
|
|
|
29510
29514
|
always: ["*"],
|
|
29511
29515
|
metadata: { action: "delete", count: absolutePaths.length }
|
|
29512
29516
|
}));
|
|
29513
|
-
const
|
|
29514
|
-
|
|
29515
|
-
|
|
29516
|
-
|
|
29517
|
-
|
|
29518
|
-
|
|
29519
|
-
|
|
29520
|
-
reason: result.message || result.code || "delete failed"
|
|
29521
|
-
});
|
|
29522
|
-
} else {
|
|
29523
|
-
deleted.push(filePath);
|
|
29524
|
-
}
|
|
29525
|
-
}
|
|
29517
|
+
const response = await callBridge(ctx, context, "delete_file", {
|
|
29518
|
+
files: absolutePaths,
|
|
29519
|
+
recursive
|
|
29520
|
+
});
|
|
29521
|
+
const deletedEntries = response.deleted ?? [];
|
|
29522
|
+
const skipped = response.skipped_files ?? [];
|
|
29523
|
+
const deleted = deletedEntries.map((entry) => entry.file);
|
|
29526
29524
|
if (deleted.length === 0 && skipped.length > 0) {
|
|
29527
29525
|
throw new Error(`delete failed for all ${skipped.length} file(s):
|
|
29528
29526
|
` + skipped.map((entry) => ` ${entry.file}: ${entry.reason}`).join(`
|
|
@@ -30148,7 +30146,7 @@ function safetyTools(ctx) {
|
|
|
30148
30146
|
` + `Per-file undo stack is capped at 20 entries (oldest evicted).
|
|
30149
30147
|
|
|
30150
30148
|
` + `Ops:
|
|
30151
|
-
` + `- 'undo': Undo the last edit to
|
|
30149
|
+
` + `- 'undo': Undo the entire last tool call when 'filePath' is omitted (typical), or undo the last edit to one file when 'filePath' is provided. Note: pops from the undo stack (irreversible, no redo). Use 'history' to inspect per-file history before undoing.
|
|
30152
30150
|
` + `- 'history': List all edit snapshots for a file. Requires 'filePath'.
|
|
30153
30151
|
` + `- 'checkpoint': Save a named snapshot of tracked files. Requires 'name'. Optional 'files' to snapshot specific files only.
|
|
30154
30152
|
` + `- 'restore': Restore files to a previously saved checkpoint. Requires 'name'.
|
|
@@ -30161,13 +30159,13 @@ function safetyTools(ctx) {
|
|
|
30161
30159
|
` + "Returns: undo { path, backup_id }. history { file, entries }. checkpoint { ok, name }. restore { ok, name }. list { checkpoints }.",
|
|
30162
30160
|
args: {
|
|
30163
30161
|
op: z10.enum(["undo", "history", "checkpoint", "restore", "list"]).describe("Safety operation"),
|
|
30164
|
-
filePath: z10.string().optional().describe("File path (required for
|
|
30162
|
+
filePath: z10.string().optional().describe("File path (required for history, optional for undo). Absolute or relative to project root"),
|
|
30165
30163
|
name: z10.string().optional().describe("Checkpoint name (required for checkpoint, restore)"),
|
|
30166
30164
|
files: z10.array(z10.string()).optional().describe("Specific files to include in checkpoint (optional, defaults to all tracked files)")
|
|
30167
30165
|
},
|
|
30168
30166
|
execute: async (args, context) => {
|
|
30169
30167
|
const op = args.op;
|
|
30170
|
-
if (
|
|
30168
|
+
if (op === "history" && typeof args.filePath !== "string") {
|
|
30171
30169
|
throw new Error(`'filePath' is required for '${op}' op`);
|
|
30172
30170
|
}
|
|
30173
30171
|
if ((op === "checkpoint" || op === "restore") && typeof args.name !== "string") {
|
|
@@ -30902,7 +30900,10 @@ ${lines}
|
|
|
30902
30900
|
]);
|
|
30903
30901
|
}
|
|
30904
30902
|
const bridge = pool.getBridge(input.directory);
|
|
30905
|
-
await bridge.send("status", {}, { configureWarningClient: input.client });
|
|
30903
|
+
const response = await bridge.send("status", {}, { configureWarningClient: input.client });
|
|
30904
|
+
if (response.success !== false) {
|
|
30905
|
+
bridge.cacheStatusSnapshot(response);
|
|
30906
|
+
}
|
|
30906
30907
|
} catch (err) {
|
|
30907
30908
|
log2(`eager configure failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
30908
30909
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuEjD,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAChD,CAAC;AAqRtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA+JjE;
|
|
1
|
+
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuEjD,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAChD,CAAC;AAqRtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA+JjE;AAukCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAwB/E;AAMD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA6EnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/tools/safety.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/tools/safety.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAsH9E"}
|
package/dist/tui.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createMemo as createMemo2, createSignal as createSignal2, onCleanup as
|
|
|
4
4
|
// package.json
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "@cortexkit/aft-opencode",
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.25.1",
|
|
8
8
|
type: "module",
|
|
9
9
|
description: "OpenCode plugin for Agent File Tools (AFT) \u2014 tree-sitter and lsp powered code analysis",
|
|
10
10
|
main: "dist/index.js",
|
|
@@ -32,7 +32,7 @@ var package_default = {
|
|
|
32
32
|
},
|
|
33
33
|
dependencies: {
|
|
34
34
|
"@clack/prompts": "^1.2.0",
|
|
35
|
-
"@cortexkit/aft-bridge": "0.
|
|
35
|
+
"@cortexkit/aft-bridge": "0.25.1",
|
|
36
36
|
"@opencode-ai/plugin": "^1.14.39",
|
|
37
37
|
"@opencode-ai/sdk": "^1.14.39",
|
|
38
38
|
"comment-json": "^4.6.2",
|
|
@@ -40,11 +40,11 @@ var package_default = {
|
|
|
40
40
|
zod: "^4.1.8"
|
|
41
41
|
},
|
|
42
42
|
optionalDependencies: {
|
|
43
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
44
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
45
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
46
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
47
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
43
|
+
"@cortexkit/aft-darwin-arm64": "0.25.1",
|
|
44
|
+
"@cortexkit/aft-darwin-x64": "0.25.1",
|
|
45
|
+
"@cortexkit/aft-linux-arm64": "0.25.1",
|
|
46
|
+
"@cortexkit/aft-linux-x64": "0.25.1",
|
|
47
|
+
"@cortexkit/aft-win32-x64": "0.25.1"
|
|
48
48
|
},
|
|
49
49
|
devDependencies: {
|
|
50
50
|
"@types/node": "^22.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Agent File Tools (AFT) — tree-sitter and lsp powered code analysis",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@clack/prompts": "^1.2.0",
|
|
31
|
-
"@cortexkit/aft-bridge": "0.
|
|
31
|
+
"@cortexkit/aft-bridge": "0.25.1",
|
|
32
32
|
"@opencode-ai/plugin": "^1.14.39",
|
|
33
33
|
"@opencode-ai/sdk": "^1.14.39",
|
|
34
34
|
"comment-json": "^4.6.2",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"zod": "^4.1.8"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
40
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
41
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
42
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
43
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
39
|
+
"@cortexkit/aft-darwin-arm64": "0.25.1",
|
|
40
|
+
"@cortexkit/aft-darwin-x64": "0.25.1",
|
|
41
|
+
"@cortexkit/aft-linux-arm64": "0.25.1",
|
|
42
|
+
"@cortexkit/aft-linux-x64": "0.25.1",
|
|
43
|
+
"@cortexkit/aft-win32-x64": "0.25.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^22.0.0",
|