@cortexkit/aft-opencode 0.10.1 → 0.11.0
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/config.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25395 -345
- package/dist/pool.d.ts +1 -1
- package/dist/pool.d.ts.map +1 -1
- package/dist/shared/tui-config.d.ts.map +1 -1
- package/dist/shared/url-fetch.d.ts +11 -0
- package/dist/shared/url-fetch.d.ts.map +1 -0
- package/dist/tools/reading.d.ts.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/shared/tui-config.ts +3 -100
- package/src/shared/url-fetch.ts +237 -0
- package/dist/bridge.js +0 -325
- package/dist/bridge.js.map +0 -1
- package/dist/config.js +0 -304
- package/dist/config.js.map +0 -1
- package/dist/downloader.js +0 -198
- package/dist/downloader.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/logger.js +0 -78
- package/dist/logger.js.map +0 -1
- package/dist/lsp.js +0 -79
- package/dist/lsp.js.map +0 -1
- package/dist/metadata-store.js +0 -53
- package/dist/metadata-store.js.map +0 -1
- package/dist/normalize-schemas.js +0 -45
- package/dist/normalize-schemas.js.map +0 -1
- package/dist/notifications.js +0 -307
- package/dist/notifications.js.map +0 -1
- package/dist/onnx-runtime.js +0 -203
- package/dist/onnx-runtime.js.map +0 -1
- package/dist/patch-parser.js +0 -247
- package/dist/patch-parser.js.map +0 -1
- package/dist/platform.js +0 -31
- package/dist/platform.js.map +0 -1
- package/dist/pool.js +0 -130
- package/dist/pool.js.map +0 -1
- package/dist/resolver.js +0 -179
- package/dist/resolver.js.map +0 -1
- package/dist/shared/opencode-config-dir.js +0 -26
- package/dist/shared/opencode-config-dir.js.map +0 -1
- package/dist/shared/rpc-client.js +0 -108
- package/dist/shared/rpc-client.js.map +0 -1
- package/dist/shared/rpc-server.js +0 -120
- package/dist/shared/rpc-server.js.map +0 -1
- package/dist/shared/rpc-utils.js +0 -20
- package/dist/shared/rpc-utils.js.map +0 -1
- package/dist/shared/runtime.js +0 -14
- package/dist/shared/runtime.js.map +0 -1
- package/dist/shared/status.js +0 -135
- package/dist/shared/status.js.map +0 -1
- package/dist/shared/tui-config.js +0 -134
- package/dist/shared/tui-config.js.map +0 -1
- package/dist/tools/ast.js +0 -200
- package/dist/tools/ast.js.map +0 -1
- package/dist/tools/conflicts.js +0 -20
- package/dist/tools/conflicts.js.map +0 -1
- package/dist/tools/hoisted.js +0 -870
- package/dist/tools/hoisted.js.map +0 -1
- package/dist/tools/imports.js +0 -90
- package/dist/tools/imports.js.map +0 -1
- package/dist/tools/lsp.js +0 -58
- package/dist/tools/lsp.js.map +0 -1
- package/dist/tools/navigation.js +0 -58
- package/dist/tools/navigation.js.map +0 -1
- package/dist/tools/permissions.js +0 -50
- package/dist/tools/permissions.js.map +0 -1
- package/dist/tools/reading.js +0 -229
- package/dist/tools/reading.js.map +0 -1
- package/dist/tools/refactoring.js +0 -129
- package/dist/tools/refactoring.js.map +0 -1
- package/dist/tools/safety.js +0 -83
- package/dist/tools/safety.js.map +0 -1
- package/dist/tools/search.js +0 -108
- package/dist/tools/search.js.map +0 -1
- package/dist/tools/semantic.js +0 -35
- package/dist/tools/semantic.js.map +0 -1
- package/dist/tools/structure.js +0 -157
- package/dist/tools/structure.js.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { tool } from "@opencode-ai/plugin";
|
|
2
|
-
import { queryLspHints } from "../lsp.js";
|
|
3
|
-
import { askEditPermission, permissionDeniedResponse, resolveAbsolutePath, resolveRelativePattern, resolveRelativePatterns, workspacePattern, } from "./permissions.js";
|
|
4
|
-
const z = tool.schema;
|
|
5
|
-
/**
|
|
6
|
-
* Tool definitions for refactoring commands: move_symbol, extract_function, inline_symbol.
|
|
7
|
-
*/
|
|
8
|
-
export function refactoringTools(ctx) {
|
|
9
|
-
return {
|
|
10
|
-
aft_refactor: {
|
|
11
|
-
description: "Workspace-wide refactoring operations that update imports and references across files.\n\n" +
|
|
12
|
-
"Ops:\n" +
|
|
13
|
-
"- 'move': Move a top-level symbol to another file, updating all imports workspace-wide. Requires 'symbol', 'destination'. Creates a checkpoint before mutating. Only works on top-level exports (not nested functions or class methods).\n" +
|
|
14
|
-
" Note: This moves code symbols between files. To rename/move an entire file, use aft_move instead.\n" +
|
|
15
|
-
"- 'extract': Extract a line range into a new function with auto-detected parameters. Requires 'name', 'startLine', 'endLine' (1-based, both inclusive). Supports TS/JS/TSX and Python.\n" +
|
|
16
|
-
"- 'inline': Replace a function call with the function's body, substituting args for params. Requires 'symbol', 'callSiteLine' (1-based). Validates single-return constraint.\n\n" +
|
|
17
|
-
"Each op requires specific parameters — see parameter descriptions for requirements.\n\n" +
|
|
18
|
-
"All ops need 'filePath'. Use dryRun to preview before applying.\n\n" +
|
|
19
|
-
"Returns: move dry-run { ok, dry_run, diffs }; move apply { ok, files_modified, consumers_updated, checkpoint_name, results }. extract returns { file, name, parameters, return_type, syntax_valid, formatted, ... }. inline returns { file, symbol, call_context, substitutions, conflicts, syntax_valid, formatted, ... }.",
|
|
20
|
-
// Parameters are Zod-optional because different ops need different subsets.
|
|
21
|
-
// Runtime guards below validate per-op requirements and give clear errors.
|
|
22
|
-
args: {
|
|
23
|
-
op: z.enum(["move", "extract", "inline"]).describe("Refactoring operation"),
|
|
24
|
-
filePath: z
|
|
25
|
-
.string()
|
|
26
|
-
.describe("Path to the source file (absolute or relative to project root)"),
|
|
27
|
-
symbol: z
|
|
28
|
-
.string()
|
|
29
|
-
.optional()
|
|
30
|
-
.describe("Symbol name — required for 'move' and 'inline' ops"),
|
|
31
|
-
// move
|
|
32
|
-
destination: z.string().optional().describe("Target file path — required for 'move' op"),
|
|
33
|
-
// scope disambiguates overloaded top-level names, NOT nested symbols.
|
|
34
|
-
// "Only works on top-level exports" in the description is correct — scope selects
|
|
35
|
-
// among multiple top-level symbols that share a name, not class methods.
|
|
36
|
-
scope: z
|
|
37
|
-
.string()
|
|
38
|
-
.optional()
|
|
39
|
-
.describe("Disambiguation scope for 'move' op — when multiple top-level symbols share the same name, specify the containing scope to disambiguate (e.g. 'MyClass'). Does NOT enable access to nested symbols or class methods."),
|
|
40
|
-
// extract
|
|
41
|
-
name: z.string().optional().describe("New function name — required for 'extract' op"),
|
|
42
|
-
startLine: z.number().optional().describe("1-based start line — required for 'extract' op"),
|
|
43
|
-
// endLine is inclusive from the agent's perspective; the execute function adds +1
|
|
44
|
-
// because the Rust backend expects exclusive end. This is intentional — do not document.
|
|
45
|
-
endLine: z
|
|
46
|
-
.number()
|
|
47
|
-
.optional()
|
|
48
|
-
.describe("1-based end line (inclusive) — required for 'extract' op"),
|
|
49
|
-
// inline
|
|
50
|
-
callSiteLine: z
|
|
51
|
-
.number()
|
|
52
|
-
.optional()
|
|
53
|
-
.describe("1-based call site line — required for 'inline' op"),
|
|
54
|
-
// common
|
|
55
|
-
dryRun: z
|
|
56
|
-
.boolean()
|
|
57
|
-
.optional()
|
|
58
|
-
.describe("Preview changes as diff without modifying files (default: false)"),
|
|
59
|
-
},
|
|
60
|
-
execute: async (args, context) => {
|
|
61
|
-
const bridge = ctx.pool.getBridge(context.directory, context.sessionID);
|
|
62
|
-
const op = args.op;
|
|
63
|
-
if ((op === "move" || op === "inline") && typeof args.symbol !== "string") {
|
|
64
|
-
throw new Error(`'symbol' is required for '${op}' op`);
|
|
65
|
-
}
|
|
66
|
-
if (op === "move" && typeof args.destination !== "string") {
|
|
67
|
-
throw new Error("'destination' is required for 'move' op");
|
|
68
|
-
}
|
|
69
|
-
if (op === "extract") {
|
|
70
|
-
if (typeof args.name !== "string")
|
|
71
|
-
throw new Error("'name' is required for 'extract' op");
|
|
72
|
-
if (args.startLine === undefined)
|
|
73
|
-
throw new Error("'startLine' is required for 'extract' op");
|
|
74
|
-
if (args.endLine === undefined)
|
|
75
|
-
throw new Error("'endLine' is required for 'extract' op");
|
|
76
|
-
}
|
|
77
|
-
if (op === "inline" && args.callSiteLine === undefined) {
|
|
78
|
-
throw new Error("'callSiteLine' is required for 'inline' op");
|
|
79
|
-
}
|
|
80
|
-
const filePath = resolveAbsolutePath(context, args.filePath);
|
|
81
|
-
const patterns = op === "move"
|
|
82
|
-
? resolveRelativePatterns(context, [
|
|
83
|
-
workspacePattern(context),
|
|
84
|
-
args.filePath,
|
|
85
|
-
...(typeof args.destination === "string" ? [args.destination] : []),
|
|
86
|
-
])
|
|
87
|
-
: [resolveRelativePattern(context, args.filePath)];
|
|
88
|
-
const metadata = patterns.length === 1 ? { filepath: filePath } : {};
|
|
89
|
-
const permissionError = await askEditPermission(context, patterns, metadata);
|
|
90
|
-
if (permissionError)
|
|
91
|
-
return permissionDeniedResponse(permissionError);
|
|
92
|
-
const commandMap = {
|
|
93
|
-
move: "move_symbol",
|
|
94
|
-
extract: "extract_function",
|
|
95
|
-
inline: "inline_symbol",
|
|
96
|
-
};
|
|
97
|
-
const params = { file: args.filePath };
|
|
98
|
-
if (args.dryRun !== undefined)
|
|
99
|
-
params.dry_run = args.dryRun;
|
|
100
|
-
switch (op) {
|
|
101
|
-
case "move":
|
|
102
|
-
params.symbol = args.symbol;
|
|
103
|
-
params.destination = args.destination;
|
|
104
|
-
if (args.scope !== undefined)
|
|
105
|
-
params.scope = args.scope;
|
|
106
|
-
break;
|
|
107
|
-
case "extract":
|
|
108
|
-
params.name = args.name;
|
|
109
|
-
params.start_line = Number(args.startLine);
|
|
110
|
-
params.end_line = Number(args.endLine) + 1; // Agent uses inclusive, Rust expects exclusive
|
|
111
|
-
break;
|
|
112
|
-
case "inline":
|
|
113
|
-
params.symbol = args.symbol;
|
|
114
|
-
params.call_site_line = Number(args.callSiteLine);
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
const hints = await queryLspHints(ctx.client, (args.symbol ?? args.name));
|
|
118
|
-
if (hints)
|
|
119
|
-
params.lsp_hints = hints;
|
|
120
|
-
const response = await bridge.send(commandMap[op], params);
|
|
121
|
-
if (response.success === false) {
|
|
122
|
-
throw new Error(response.message || `${op} failed`);
|
|
123
|
-
}
|
|
124
|
-
return JSON.stringify(response);
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=refactoring.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refactoring.js","sourceRoot":"","sources":["../../src/tools/refactoring.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AAEtB;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAkB;IACjD,OAAO;QACL,YAAY,EAAE;YACZ,WAAW,EACT,4FAA4F;gBAC5F,QAAQ;gBACR,4OAA4O;gBAC5O,wGAAwG;gBACxG,0LAA0L;gBAC1L,kLAAkL;gBAClL,yFAAyF;gBACzF,qEAAqE;gBACrE,6TAA6T;YAC/T,4EAA4E;YAC5E,2EAA2E;YAC3E,IAAI,EAAE;gBACJ,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;gBAC3E,QAAQ,EAAE,CAAC;qBACR,MAAM,EAAE;qBACR,QAAQ,CAAC,gEAAgE,CAAC;gBAC7E,MAAM,EAAE,CAAC;qBACN,MAAM,EAAE;qBACR,QAAQ,EAAE;qBACV,QAAQ,CAAC,oDAAoD,CAAC;gBACjE,OAAO;gBACP,WAAW,EAAE,CAAC,CAAC,MAA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,IAAI,IAAI,CAAC,IAAI,CAAW,CAAC,CAAC;gBACpF,IAAI,KAAK;oBAAE,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC;gBAEpC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;gBAC3D,IAAI,QAAQ,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;oBAC/B,MAAM,IAAI,KAAK,CAAE,QAAQ,CAAC,OAAkB,IAAI,GAAG,EAAE,SAAS,CAAC,CAAC;gBAClE,CAAC;gBACD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/safety.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { tool } from "@opencode-ai/plugin";
|
|
2
|
-
import { askEditPermission, permissionDeniedResponse, resolveAbsolutePath, resolveRelativePattern, workspacePattern, } from "./permissions.js";
|
|
3
|
-
const z = tool.schema;
|
|
4
|
-
/**
|
|
5
|
-
* Tool definitions for safety & recovery commands: undo, edit_history,
|
|
6
|
-
* checkpoint, restore_checkpoint, list_checkpoints.
|
|
7
|
-
*/
|
|
8
|
-
export function safetyTools(ctx) {
|
|
9
|
-
return {
|
|
10
|
-
aft_safety: {
|
|
11
|
-
description: "File safety and recovery operations.\n\n" +
|
|
12
|
-
"Per-file undo stack is capped at 20 entries (oldest evicted).\n\n" +
|
|
13
|
-
"Ops:\n" +
|
|
14
|
-
"- 'undo': Undo the last edit to a file. Requires 'filePath'. Note: pops from the undo stack (irreversible, no redo). Use 'history' to inspect before undoing.\n" +
|
|
15
|
-
"- 'history': List all edit snapshots for a file. Requires 'filePath'.\n" +
|
|
16
|
-
"- 'checkpoint': Save a named snapshot of tracked files. Requires 'name'. Optional 'files' to snapshot specific files only.\n" +
|
|
17
|
-
"- 'restore': Restore files to a previously saved checkpoint. Requires 'name'.\n" +
|
|
18
|
-
"- 'list': List all available named checkpoints. No extra params needed.\n\n" +
|
|
19
|
-
"Each op requires specific parameters — see parameter descriptions for requirements.\n\n" +
|
|
20
|
-
"Use checkpoint before risky multi-file changes. Use undo for quick single-file rollback.\n\n" +
|
|
21
|
-
"Returns: undo { path, backup_id }. history { file, entries }. checkpoint { ok, name }. restore { ok, name }. list { checkpoints }.",
|
|
22
|
-
// Parameters are Zod-optional because different ops need different subsets.
|
|
23
|
-
// Runtime guards below validate per-op requirements and give clear errors.
|
|
24
|
-
args: {
|
|
25
|
-
op: z
|
|
26
|
-
.enum(["undo", "history", "checkpoint", "restore", "list"])
|
|
27
|
-
.describe("Safety operation"),
|
|
28
|
-
filePath: z
|
|
29
|
-
.string()
|
|
30
|
-
.optional()
|
|
31
|
-
.describe("File path (required for undo, history). Absolute or relative to project root"),
|
|
32
|
-
name: z.string().optional().describe("Checkpoint name (required for checkpoint, restore)"),
|
|
33
|
-
files: z
|
|
34
|
-
.array(z.string())
|
|
35
|
-
.optional()
|
|
36
|
-
.describe("Specific files to include in checkpoint (optional, defaults to all tracked files)"),
|
|
37
|
-
},
|
|
38
|
-
execute: async (args, context) => {
|
|
39
|
-
const bridge = ctx.pool.getBridge(context.directory, context.sessionID);
|
|
40
|
-
const op = args.op;
|
|
41
|
-
if ((op === "undo" || op === "history") && typeof args.filePath !== "string") {
|
|
42
|
-
throw new Error(`'filePath' is required for '${op}' op`);
|
|
43
|
-
}
|
|
44
|
-
if ((op === "checkpoint" || op === "restore") && typeof args.name !== "string") {
|
|
45
|
-
throw new Error(`'name' is required for '${op}' op`);
|
|
46
|
-
}
|
|
47
|
-
if (op === "undo" && typeof args.filePath === "string") {
|
|
48
|
-
const filePath = resolveAbsolutePath(context, args.filePath);
|
|
49
|
-
const permissionError = await askEditPermission(context, [resolveRelativePattern(context, args.filePath)], { filepath: filePath });
|
|
50
|
-
if (permissionError)
|
|
51
|
-
return permissionDeniedResponse(permissionError);
|
|
52
|
-
}
|
|
53
|
-
if (op === "restore") {
|
|
54
|
-
const permissionError = await askEditPermission(context, [workspacePattern(context)], {
|
|
55
|
-
checkpoint: args.name,
|
|
56
|
-
});
|
|
57
|
-
if (permissionError)
|
|
58
|
-
return permissionDeniedResponse(permissionError);
|
|
59
|
-
}
|
|
60
|
-
const commandMap = {
|
|
61
|
-
undo: "undo",
|
|
62
|
-
history: "edit_history",
|
|
63
|
-
checkpoint: "checkpoint",
|
|
64
|
-
restore: "restore_checkpoint",
|
|
65
|
-
list: "list_checkpoints",
|
|
66
|
-
};
|
|
67
|
-
const params = {};
|
|
68
|
-
if (args.filePath !== undefined)
|
|
69
|
-
params.file = args.filePath;
|
|
70
|
-
if (args.name !== undefined)
|
|
71
|
-
params.name = args.name;
|
|
72
|
-
if (args.files !== undefined)
|
|
73
|
-
params.files = args.files;
|
|
74
|
-
const response = await bridge.send(commandMap[op], params);
|
|
75
|
-
if (response.success === false) {
|
|
76
|
-
throw new Error(response.message || `${op} failed`);
|
|
77
|
-
}
|
|
78
|
-
return JSON.stringify(response);
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=safety.js.map
|
package/dist/tools/safety.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"safety.js","sourceRoot":"","sources":["../../src/tools/safety.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AAEtB;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,GAAkB;IAC5C,OAAO;QACL,UAAU,EAAE;YACV,WAAW,EACT,0CAA0C;gBAC1C,mEAAmE;gBACnE,QAAQ;gBACR,iKAAiK;gBACjK,yEA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CAAC;gBACxD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;gBAC3D,IAAI,QAAQ,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;oBAC/B,MAAM,IAAI,KAAK,CAAE,QAAQ,CAAC,OAAkB,IAAI,GAAG,EAAE,SAAS,CAAC,CAAC;gBAClE,CAAC;gBACD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/search.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
function arg(schema) {
|
|
3
|
-
return schema;
|
|
4
|
-
}
|
|
5
|
-
function formatGrepOutput(response) {
|
|
6
|
-
if (typeof response.text === "string") {
|
|
7
|
-
return response.text;
|
|
8
|
-
}
|
|
9
|
-
const matches = Array.isArray(response.matches) ? response.matches : [];
|
|
10
|
-
const totalMatches = response.total_matches ?? matches.length;
|
|
11
|
-
const filesWithMatches = response.files_with_matches ?? new Set(matches.map((m) => m.file)).size;
|
|
12
|
-
if (matches.length === 0) {
|
|
13
|
-
return `Found ${totalMatches} match(es) in ${filesWithMatches} file(s).`;
|
|
14
|
-
}
|
|
15
|
-
const body = matches
|
|
16
|
-
.map((match) => {
|
|
17
|
-
const file = match.file ?? "unknown";
|
|
18
|
-
const line = match.line ?? 0;
|
|
19
|
-
const text = match.line_text ?? match.text ?? "";
|
|
20
|
-
return `${file}:${line}: ${text}`;
|
|
21
|
-
})
|
|
22
|
-
.join("\n");
|
|
23
|
-
return `${body}\n\nFound ${totalMatches} match(es) in ${filesWithMatches} file(s).`;
|
|
24
|
-
}
|
|
25
|
-
/** Ensure glob patterns match files in subdirectories — prefix with **\/ if no path separator. */
|
|
26
|
-
function normalizeGlob(pattern) {
|
|
27
|
-
if (!pattern.includes("/") && !pattern.startsWith("**/")) {
|
|
28
|
-
return `**/${pattern}`;
|
|
29
|
-
}
|
|
30
|
-
return pattern;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Tool definitions for indexed search-backed grep and glob.
|
|
34
|
-
*/
|
|
35
|
-
export function searchTools(ctx) {
|
|
36
|
-
const grepTool = {
|
|
37
|
-
description: "Search file contents using regular expressions. Returns matching lines with file paths, line numbers, and context.",
|
|
38
|
-
args: {
|
|
39
|
-
pattern: arg(z.string().describe("Regular expression pattern to search for")),
|
|
40
|
-
include: arg(z.string().optional().describe("File pattern to include (e.g. '*.ts', '*.{ts,tsx}')")),
|
|
41
|
-
path: arg(z.string().optional().describe("Directory to search in, relative to project root")),
|
|
42
|
-
},
|
|
43
|
-
execute: async (args, context) => {
|
|
44
|
-
const bridge = ctx.pool.getBridge(context.directory, context.sessionID);
|
|
45
|
-
const response = await bridge.send("grep", {
|
|
46
|
-
pattern: args.pattern,
|
|
47
|
-
case_sensitive: true,
|
|
48
|
-
include: args.include
|
|
49
|
-
? String(args.include)
|
|
50
|
-
.split(",")
|
|
51
|
-
.map((s) => normalizeGlob(s.trim()))
|
|
52
|
-
.filter(Boolean)
|
|
53
|
-
: undefined,
|
|
54
|
-
path: args.path,
|
|
55
|
-
max_results: 100,
|
|
56
|
-
});
|
|
57
|
-
if (response.success === false) {
|
|
58
|
-
throw new Error(response.message || "grep failed");
|
|
59
|
-
}
|
|
60
|
-
return formatGrepOutput(response);
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
const globTool = {
|
|
64
|
-
description: "Find files matching a glob pattern. Returns matching file paths sorted by modification time.",
|
|
65
|
-
args: {
|
|
66
|
-
pattern: arg(z.string().describe("Glob pattern to match (e.g. '**/*.ts', 'src/**/*.test.*')")),
|
|
67
|
-
path: arg(z.string().optional().describe("Directory to search in, relative to project root")),
|
|
68
|
-
},
|
|
69
|
-
execute: async (args, context) => {
|
|
70
|
-
const bridge = ctx.pool.getBridge(context.directory, context.sessionID);
|
|
71
|
-
// Handle absolute paths embedded in the pattern (e.g. "/abs/path/src/**/*.ts")
|
|
72
|
-
// Split into path (directory prefix) and pattern (glob suffix)
|
|
73
|
-
let globPattern = String(args.pattern);
|
|
74
|
-
let globPath = args.path ? String(args.path) : undefined;
|
|
75
|
-
if (!globPath && globPattern.startsWith("/")) {
|
|
76
|
-
// Find the last directory component before any glob metacharacters
|
|
77
|
-
const metaIdx = globPattern.search(/[*?{}[\]]/);
|
|
78
|
-
if (metaIdx > 0) {
|
|
79
|
-
const lastSlash = globPattern.lastIndexOf("/", metaIdx);
|
|
80
|
-
if (lastSlash > 0) {
|
|
81
|
-
globPath = globPattern.slice(0, lastSlash);
|
|
82
|
-
globPattern = `**/${globPattern.slice(lastSlash + 1)}`;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
const response = await bridge.send("glob", {
|
|
87
|
-
pattern: globPattern,
|
|
88
|
-
path: globPath,
|
|
89
|
-
});
|
|
90
|
-
if (response.success === false) {
|
|
91
|
-
throw new Error(response.message || "glob failed");
|
|
92
|
-
}
|
|
93
|
-
if (typeof response.text === "string") {
|
|
94
|
-
return response.text;
|
|
95
|
-
}
|
|
96
|
-
if (Array.isArray(response.files)) {
|
|
97
|
-
return response.files.join("\n");
|
|
98
|
-
}
|
|
99
|
-
return response.text || JSON.stringify(response);
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
const hoisting = ctx.config.hoist_builtin_tools !== false;
|
|
103
|
-
return {
|
|
104
|
-
[hoisting ? "grep" : "aft_grep"]: grepTool,
|
|
105
|
-
[hoisting ? "glob" : "aft_glob"]: globTool,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=search.js.map
|
package/dist/tools/search.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CA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ED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
function arg(schema) {
|
|
3
|
-
return schema;
|
|
4
|
-
}
|
|
5
|
-
export function semanticTools(ctx) {
|
|
6
|
-
const searchTool = {
|
|
7
|
-
description: "Search code by meaning using semantic similarity. Use when you don't know the exact name or text — describe what you're looking for in natural language and get the most relevant symbols, functions, and types.",
|
|
8
|
-
args: {
|
|
9
|
-
query: arg(z.string().describe("Natural language search query")),
|
|
10
|
-
topK: arg(z.number().optional().describe("Number of results (default: 10)")),
|
|
11
|
-
},
|
|
12
|
-
execute: async (args, context) => {
|
|
13
|
-
const bridge = ctx.pool.getBridge(context.directory, context.sessionID);
|
|
14
|
-
const response = await bridge.send("semantic_search", {
|
|
15
|
-
query: args.query,
|
|
16
|
-
top_k: args.topK ?? 10,
|
|
17
|
-
});
|
|
18
|
-
if (response.success === false) {
|
|
19
|
-
if (response.code === "semantic_search_unavailable" &&
|
|
20
|
-
typeof response.message === "string") {
|
|
21
|
-
return response.message;
|
|
22
|
-
}
|
|
23
|
-
throw new Error(response.message || "semantic_search failed");
|
|
24
|
-
}
|
|
25
|
-
if (typeof response.text === "string") {
|
|
26
|
-
return response.text;
|
|
27
|
-
}
|
|
28
|
-
return JSON.stringify(response);
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
return {
|
|
32
|
-
aft_search: searchTool,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=semantic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.js","sourceRoot":"","sources":["../../src/tools/semantic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,SAAS,GAAG,CAAC,MAAe;IAC1B,OAAO,MAAiB,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAkB;IAC9C,MAAM,UAAU,GAAmB;QACjC,WAAW,EACT,kNAA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-
import { askEditPermission, permissionDeniedResponse, resolveAbsolutePath, resolveRelativePattern, } from "./permissions.js";
|
|
3
|
-
const z = tool.schema;
|
|
4
|
-
/**
|
|
5
|
-
* Tool definitions for scope-aware structure commands:
|
|
6
|
-
* add_member, add_derive, wrap_try_catch, add_decorator, add_struct_tags.
|
|
7
|
-
*/
|
|
8
|
-
export function structureTools(ctx) {
|
|
9
|
-
return {
|
|
10
|
-
aft_transform: {
|
|
11
|
-
description: "Scope-aware structural code transformations with correct indentation.\n\n" +
|
|
12
|
-
"Language-specific: add_derive (Rust), add_struct_tags (Go), add_decorator (Python), wrap_try_catch (TS/JS), add_member (any language).\n\n" +
|
|
13
|
-
"Ops:\n" +
|
|
14
|
-
"- 'add_member': Insert method/field into class, struct, or impl block. Requires 'container' (container name) and 'code'. Optional 'position'.\n" +
|
|
15
|
-
"- 'add_derive': Add Rust derive macros to a struct/enum. Requires 'target' and 'derives' array. Deduplicates existing derives.\n" +
|
|
16
|
-
"- 'wrap_try_catch': Wrap a TS/JS function body in try/catch. Requires 'target' (function name). Optional 'catchBody'.\n" +
|
|
17
|
-
"- 'add_decorator': Add Python decorator to function/class. Requires 'target' and 'decorator' (without @). Optional 'position'.\n" +
|
|
18
|
-
"- 'add_struct_tags': Add/update Go struct field tags. Requires 'target' (struct name), 'field', 'tag', 'value'.\n\n" +
|
|
19
|
-
"Each op requires specific parameters — see parameter descriptions for requirements.\n\n" +
|
|
20
|
-
"Returns:\n" +
|
|
21
|
-
"- Dry run (any op): { ok, dry_run, diff, syntax_valid? }\n" +
|
|
22
|
-
"- add_member: { file, scope, position, formatted, syntax_valid?, format_skipped_reason?, validation_errors?, validate_skipped_reason?, backup_id?, lsp_diagnostics? }\n" +
|
|
23
|
-
"- add_derive: { file, target, derives, formatted, syntax_valid?, format_skipped_reason?, validation_errors?, validate_skipped_reason?, backup_id?, lsp_diagnostics? }\n" +
|
|
24
|
-
"- wrap_try_catch: { file, target, formatted, syntax_valid?, format_skipped_reason?, validation_errors?, validate_skipped_reason?, backup_id?, lsp_diagnostics? }\n" +
|
|
25
|
-
"- add_decorator: { file, target, decorator, formatted, syntax_valid?, format_skipped_reason?, validation_errors?, validate_skipped_reason?, backup_id?, lsp_diagnostics? }\n" +
|
|
26
|
-
"- add_struct_tags: { file, target, field, tag_string, formatted, syntax_valid?, format_skipped_reason?, validation_errors?, validate_skipped_reason?, backup_id?, lsp_diagnostics? }",
|
|
27
|
-
// Parameters are Zod-optional because different ops need different subsets.
|
|
28
|
-
// Runtime guards below validate per-op requirements and give clear errors.
|
|
29
|
-
args: {
|
|
30
|
-
op: z
|
|
31
|
-
.enum(["add_member", "add_derive", "wrap_try_catch", "add_decorator", "add_struct_tags"])
|
|
32
|
-
.describe("Transformation operation"),
|
|
33
|
-
filePath: z
|
|
34
|
-
.string()
|
|
35
|
-
.describe("Path to the source file (absolute or relative to project root)"),
|
|
36
|
-
// add_member
|
|
37
|
-
container: z
|
|
38
|
-
.string()
|
|
39
|
-
.optional()
|
|
40
|
-
.describe("Container name for add_member — the class, struct, or impl block to insert into. Appears as 'scope' in the response."),
|
|
41
|
-
code: z.string().optional().describe("Member code to insert (add_member)"),
|
|
42
|
-
position: z
|
|
43
|
-
.string()
|
|
44
|
-
.optional()
|
|
45
|
-
.describe("For add_member: 'first', 'last' (default), 'before:name', 'after:name'. For add_decorator: 'first' (default) or 'last' only."),
|
|
46
|
-
// add_derive, wrap_try_catch, add_decorator, add_struct_tags
|
|
47
|
-
target: z
|
|
48
|
-
.string()
|
|
49
|
-
.optional()
|
|
50
|
-
.describe("Target symbol name (add_derive: struct/enum, wrap_try_catch: function, add_decorator: function/class, add_struct_tags: struct)"),
|
|
51
|
-
derives: z
|
|
52
|
-
.array(z.string())
|
|
53
|
-
.optional()
|
|
54
|
-
.describe("Derive macro names (add_derive — e.g. ['Clone', 'Debug'])"),
|
|
55
|
-
catchBody: z
|
|
56
|
-
.string()
|
|
57
|
-
.optional()
|
|
58
|
-
.describe("Catch block body (wrap_try_catch — default: 'throw error;')"),
|
|
59
|
-
decorator: z
|
|
60
|
-
.string()
|
|
61
|
-
.optional()
|
|
62
|
-
.describe("Decorator text without @ (add_decorator — e.g. 'staticmethod')"),
|
|
63
|
-
// add_struct_tags
|
|
64
|
-
field: z.string().optional().describe("Struct field name (add_struct_tags)"),
|
|
65
|
-
tag: z.string().optional().describe("Tag key (add_struct_tags — e.g. 'json')"),
|
|
66
|
-
value: z
|
|
67
|
-
.string()
|
|
68
|
-
.optional()
|
|
69
|
-
.describe("Tag value (add_struct_tags — e.g. 'user_name,omitempty')"),
|
|
70
|
-
// common
|
|
71
|
-
validate: z
|
|
72
|
-
.enum(["syntax", "full"])
|
|
73
|
-
.optional()
|
|
74
|
-
.describe("Validation level: 'syntax' (default) or 'full'. Syntax = tree-sitter parse check only. Full = also runs LSP type-checking (slower, catches more errors)"),
|
|
75
|
-
dryRun: z
|
|
76
|
-
.boolean()
|
|
77
|
-
.optional()
|
|
78
|
-
.describe("Preview without modifying the file (default: false)"),
|
|
79
|
-
},
|
|
80
|
-
execute: async (args, context) => {
|
|
81
|
-
const bridge = ctx.pool.getBridge(context.directory, context.sessionID);
|
|
82
|
-
const op = args.op;
|
|
83
|
-
if (op === "add_member") {
|
|
84
|
-
if (typeof args.container !== "string")
|
|
85
|
-
throw new Error("'container' is required for 'add_member' op");
|
|
86
|
-
if (typeof args.code !== "string")
|
|
87
|
-
throw new Error("'code' is required for 'add_member' op");
|
|
88
|
-
}
|
|
89
|
-
if (op === "add_derive" ||
|
|
90
|
-
op === "wrap_try_catch" ||
|
|
91
|
-
op === "add_decorator" ||
|
|
92
|
-
op === "add_struct_tags") {
|
|
93
|
-
if (typeof args.target !== "string")
|
|
94
|
-
throw new Error(`'target' is required for '${op}' op`);
|
|
95
|
-
}
|
|
96
|
-
if (op === "add_derive" && !Array.isArray(args.derives)) {
|
|
97
|
-
throw new Error("'derives' array is required for 'add_derive' op");
|
|
98
|
-
}
|
|
99
|
-
if (op === "add_decorator" && typeof args.decorator !== "string") {
|
|
100
|
-
throw new Error("'decorator' is required for 'add_decorator' op");
|
|
101
|
-
}
|
|
102
|
-
if (op === "add_struct_tags") {
|
|
103
|
-
if (typeof args.field !== "string")
|
|
104
|
-
throw new Error("'field' is required for 'add_struct_tags' op");
|
|
105
|
-
if (typeof args.tag !== "string")
|
|
106
|
-
throw new Error("'tag' is required for 'add_struct_tags' op");
|
|
107
|
-
if (typeof args.value !== "string")
|
|
108
|
-
throw new Error("'value' is required for 'add_struct_tags' op");
|
|
109
|
-
}
|
|
110
|
-
const filePath = resolveAbsolutePath(context, args.filePath);
|
|
111
|
-
const permissionError = await askEditPermission(context, [resolveRelativePattern(context, args.filePath)], { filepath: filePath });
|
|
112
|
-
if (permissionError)
|
|
113
|
-
return permissionDeniedResponse(permissionError);
|
|
114
|
-
const params = { file: args.filePath };
|
|
115
|
-
if (args.validate !== undefined)
|
|
116
|
-
params.validate = args.validate;
|
|
117
|
-
if (args.dryRun !== undefined)
|
|
118
|
-
params.dry_run = args.dryRun;
|
|
119
|
-
switch (op) {
|
|
120
|
-
case "add_member":
|
|
121
|
-
params.scope = args.container;
|
|
122
|
-
params.code = args.code;
|
|
123
|
-
if (args.position !== undefined)
|
|
124
|
-
params.position = args.position;
|
|
125
|
-
break;
|
|
126
|
-
case "add_derive":
|
|
127
|
-
params.target = args.target;
|
|
128
|
-
params.derives = args.derives;
|
|
129
|
-
break;
|
|
130
|
-
case "wrap_try_catch":
|
|
131
|
-
params.target = args.target;
|
|
132
|
-
if (args.catchBody !== undefined)
|
|
133
|
-
params.catch_body = args.catchBody;
|
|
134
|
-
break;
|
|
135
|
-
case "add_decorator":
|
|
136
|
-
params.target = args.target;
|
|
137
|
-
params.decorator = args.decorator;
|
|
138
|
-
if (args.position !== undefined)
|
|
139
|
-
params.position = args.position;
|
|
140
|
-
break;
|
|
141
|
-
case "add_struct_tags":
|
|
142
|
-
params.target = args.target;
|
|
143
|
-
params.field = args.field;
|
|
144
|
-
params.tag = args.tag;
|
|
145
|
-
params.value = args.value;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
const response = await bridge.send(op, params);
|
|
149
|
-
if (response.success === false) {
|
|
150
|
-
throw new Error(response.message || `${op} failed`);
|
|
151
|
-
}
|
|
152
|
-
return JSON.stringify(response);
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
//# sourceMappingURL=structure.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"structure.js","sourceRoot":"","sources":["../../src/tools/structure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;AAEtB;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,GAAkB;IAC/C,OAAO;QACL,aAAa,EAAE;YACb,WAAW,EACT,2EAA2E;gBAC3E,4IAA4I;gBAC5I,QAAQ;gBACR,iJAAiJ;gBACjJ,kIAAkI;gBAClI,yHAAyH;gBACzH,kIAAkI;gBAClI,qHAAqH;gBACrH,yFAAyF;gBACzF,YAAY;gBACZ,4DAA4D;gBAC5D,yKAAyK;gBACzK,yKAAyK;gBACzK,oKAAoK;gBACpK,8KAA8K;gBAC9K,sLAAsL;YACxL,4EAA4E;YAC5E,2EAA2E;YAC3E,IAAI,EAAE;gBACJ,EAAE,EAAE,CAAC;qBACF,IAAI,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,CAAC,CAAC;qBACxF,QAAQ,CAAC,0BAA0B,CAAC;gBACvC,QAAQ,EAAE,CAAC;qBACR,MAAM,EAAE;qBACR,QAAQ,CAAC,gEAAgE,CAAC;gBAC7E,aAAa;gBACb,SAAS,EAAE,CAAC;qB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