@cortexkit/aft-pi 0.30.0 → 0.30.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.js +201 -190
- package/dist/tools/_shared.d.ts +3 -0
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/bash.d.ts +2 -2
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/hoisted.d.ts.map +1 -1
- package/dist/tools/navigate.d.ts +1 -1
- package/dist/tools/navigate.d.ts.map +1 -1
- package/dist/tools/refactor.d.ts +3 -3
- package/dist/tools/refactor.d.ts.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -36941,7 +36941,7 @@ import {
|
|
|
36941
36941
|
// package.json
|
|
36942
36942
|
var package_default = {
|
|
36943
36943
|
name: "@cortexkit/aft-pi",
|
|
36944
|
-
version: "0.30.
|
|
36944
|
+
version: "0.30.1",
|
|
36945
36945
|
type: "module",
|
|
36946
36946
|
description: "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
|
|
36947
36947
|
main: "dist/index.js",
|
|
@@ -36963,7 +36963,7 @@ var package_default = {
|
|
|
36963
36963
|
prepublishOnly: "bun run build"
|
|
36964
36964
|
},
|
|
36965
36965
|
dependencies: {
|
|
36966
|
-
"@cortexkit/aft-bridge": "0.30.
|
|
36966
|
+
"@cortexkit/aft-bridge": "0.30.1",
|
|
36967
36967
|
"@xterm/headless": "^5.5.0",
|
|
36968
36968
|
"comment-json": "^5.0.0",
|
|
36969
36969
|
diff: "^8.0.4",
|
|
@@ -36971,12 +36971,12 @@ var package_default = {
|
|
|
36971
36971
|
zod: "^4.1.8"
|
|
36972
36972
|
},
|
|
36973
36973
|
optionalDependencies: {
|
|
36974
|
-
"@cortexkit/aft-darwin-arm64": "0.30.
|
|
36975
|
-
"@cortexkit/aft-darwin-x64": "0.30.
|
|
36976
|
-
"@cortexkit/aft-linux-arm64": "0.30.
|
|
36977
|
-
"@cortexkit/aft-linux-x64": "0.30.
|
|
36978
|
-
"@cortexkit/aft-win32-arm64": "0.30.
|
|
36979
|
-
"@cortexkit/aft-win32-x64": "0.30.
|
|
36974
|
+
"@cortexkit/aft-darwin-arm64": "0.30.1",
|
|
36975
|
+
"@cortexkit/aft-darwin-x64": "0.30.1",
|
|
36976
|
+
"@cortexkit/aft-linux-arm64": "0.30.1",
|
|
36977
|
+
"@cortexkit/aft-linux-x64": "0.30.1",
|
|
36978
|
+
"@cortexkit/aft-win32-arm64": "0.30.1",
|
|
36979
|
+
"@cortexkit/aft-win32-x64": "0.30.1"
|
|
36980
36980
|
},
|
|
36981
36981
|
devDependencies: {
|
|
36982
36982
|
"@earendil-works/pi-coding-agent": "*",
|
|
@@ -37170,6 +37170,22 @@ function formatStatusDialogMessage(status) {
|
|
|
37170
37170
|
}
|
|
37171
37171
|
|
|
37172
37172
|
// src/tools/_shared.ts
|
|
37173
|
+
import { Type } from "typebox";
|
|
37174
|
+
var optionalInt = (_min, _max) => Type.Optional(Type.Any({ description: "(integer)" }));
|
|
37175
|
+
function coerceOptionalInt(v, paramName, min, max) {
|
|
37176
|
+
if (v === undefined || v === null || v === "")
|
|
37177
|
+
return;
|
|
37178
|
+
if (typeof v === "number" && (v === 0 || !Number.isFinite(v)))
|
|
37179
|
+
return;
|
|
37180
|
+
const n = typeof v === "string" ? Number(v) : v;
|
|
37181
|
+
if (typeof n !== "number" || !Number.isInteger(n)) {
|
|
37182
|
+
throw new Error(`${paramName} must be an integer between ${min} and ${max}`);
|
|
37183
|
+
}
|
|
37184
|
+
if (n < min || n > max) {
|
|
37185
|
+
throw new Error(`${paramName} must be between ${min} and ${max}`);
|
|
37186
|
+
}
|
|
37187
|
+
return n;
|
|
37188
|
+
}
|
|
37173
37189
|
var LONG_RUNNING_COMMAND_TIMEOUT_MS = {
|
|
37174
37190
|
callers: 60000,
|
|
37175
37191
|
trace_to: 60000,
|
|
@@ -53515,7 +53531,7 @@ function registerShutdownCleanup(fn) {
|
|
|
53515
53531
|
|
|
53516
53532
|
// src/tools/ast.ts
|
|
53517
53533
|
import { StringEnum } from "@earendil-works/pi-ai";
|
|
53518
|
-
import { Type } from "typebox";
|
|
53534
|
+
import { Type as Type2 } from "typebox";
|
|
53519
53535
|
|
|
53520
53536
|
// src/tools/render-helpers.ts
|
|
53521
53537
|
import { homedir as homedir8 } from "node:os";
|
|
@@ -53710,22 +53726,22 @@ function renderUnifiedDiff(unifiedDiff) {
|
|
|
53710
53726
|
var AstLang = StringEnum(["typescript", "tsx", "javascript", "python", "rust", "go"], {
|
|
53711
53727
|
description: "Target language"
|
|
53712
53728
|
});
|
|
53713
|
-
var SearchParams =
|
|
53714
|
-
pattern:
|
|
53729
|
+
var SearchParams = Type2.Object({
|
|
53730
|
+
pattern: Type2.String({
|
|
53715
53731
|
description: "AST pattern with meta-variables (`$VAR` matches one node, `$$$` matches many). Must be a complete AST node."
|
|
53716
53732
|
}),
|
|
53717
53733
|
lang: AstLang,
|
|
53718
|
-
paths:
|
|
53719
|
-
globs:
|
|
53720
|
-
contextLines:
|
|
53734
|
+
paths: Type2.Optional(Type2.Array(Type2.String(), { description: "Paths to search (default: ['.'])" })),
|
|
53735
|
+
globs: Type2.Optional(Type2.Array(Type2.String(), { description: "Include/exclude globs (prefix `!` to exclude)" })),
|
|
53736
|
+
contextLines: Type2.Optional(Type2.Number({ description: "Number of context lines around each match" }))
|
|
53721
53737
|
});
|
|
53722
|
-
var ReplaceParams =
|
|
53723
|
-
pattern:
|
|
53724
|
-
rewrite:
|
|
53738
|
+
var ReplaceParams = Type2.Object({
|
|
53739
|
+
pattern: Type2.String({ description: "AST pattern with meta-variables" }),
|
|
53740
|
+
rewrite: Type2.String({ description: "Replacement pattern, can reference $VAR from pattern" }),
|
|
53725
53741
|
lang: AstLang,
|
|
53726
|
-
paths:
|
|
53727
|
-
globs:
|
|
53728
|
-
dryRun:
|
|
53742
|
+
paths: Type2.Optional(Type2.Array(Type2.String(), { description: "Paths (default: ['.'])" })),
|
|
53743
|
+
globs: Type2.Optional(Type2.Array(Type2.String(), { description: "Include/exclude globs" })),
|
|
53744
|
+
dryRun: Type2.Optional(Type2.Boolean({ description: "Preview without applying (default: false)" }))
|
|
53729
53745
|
});
|
|
53730
53746
|
function appendHintSection(response, sections, theme) {
|
|
53731
53747
|
const hint = asString(response.hint);
|
|
@@ -53916,79 +53932,68 @@ function registerAstTools(pi, ctx, surface) {
|
|
|
53916
53932
|
// src/tools/bash.ts
|
|
53917
53933
|
import * as fs3 from "node:fs/promises";
|
|
53918
53934
|
import { Container as Container2, Spacer as Spacer2, Text as Text2 } from "@earendil-works/pi-tui";
|
|
53919
|
-
import { Type as
|
|
53935
|
+
import { Type as Type3 } from "typebox";
|
|
53920
53936
|
var FOREGROUND_WAIT_WINDOW_MS = 5000;
|
|
53921
53937
|
var FOREGROUND_POLL_INTERVAL_MS = 100;
|
|
53922
53938
|
var BASH_WAIT_POLL_INTERVAL_MS = 100;
|
|
53923
53939
|
var DEFAULT_BASH_STATUS_WAIT_TIMEOUT_MS = 30000;
|
|
53924
53940
|
var MAX_BASH_STATUS_WAIT_TIMEOUT_MS = 300000;
|
|
53925
53941
|
var BASH_TRANSPORT_TIMEOUT_MS = 30000;
|
|
53926
|
-
var BashParams =
|
|
53927
|
-
command:
|
|
53942
|
+
var BashParams = Type3.Object({
|
|
53943
|
+
command: Type3.String({
|
|
53928
53944
|
description: "Shell command to execute. Supports pipes, redirections, and shell syntax."
|
|
53929
53945
|
}),
|
|
53930
|
-
timeout:
|
|
53931
|
-
|
|
53932
|
-
description: "Hard kill cap in milliseconds (positive integer). When omitted, the task can run up to 30 minutes. Foreground bash returns inline if the command finishes within ~5s; otherwise it's automatically promoted to background and a completion reminder is delivered when the task actually finishes."
|
|
53933
|
-
})),
|
|
53934
|
-
workdir: Type2.Optional(Type2.String({
|
|
53946
|
+
timeout: optionalInt(1, Number.MAX_SAFE_INTEGER),
|
|
53947
|
+
workdir: Type3.Optional(Type3.String({
|
|
53935
53948
|
description: "Working directory for command execution. Relative paths resolve against the project root. Defaults to the current session's working directory."
|
|
53936
53949
|
})),
|
|
53937
|
-
description:
|
|
53950
|
+
description: Type3.Optional(Type3.String({
|
|
53938
53951
|
description: "Human-readable description shown in UI logs. Helps users understand what the command does without reading shell syntax."
|
|
53939
53952
|
})),
|
|
53940
|
-
background:
|
|
53953
|
+
background: Type3.Optional(Type3.Boolean({
|
|
53941
53954
|
description: "Spawn command in background and return immediately with a task_id. Use bash_status to poll completion and bash_kill to terminate. Ideal for long-running tasks like builds or dev servers."
|
|
53942
53955
|
})),
|
|
53943
|
-
compressed:
|
|
53956
|
+
compressed: Type3.Optional(Type3.Boolean({
|
|
53944
53957
|
description: "Compress output by removing ANSI codes, carriage returns, and excessive blank lines. Default: true. Set to false for raw terminal output including color codes."
|
|
53945
53958
|
})),
|
|
53946
|
-
pty:
|
|
53947
|
-
description: 'Spawn the command in a real PTY for interactive programs.
|
|
53948
|
-
})),
|
|
53949
|
-
ptyRows: Type2.Optional(Type2.Integer({
|
|
53950
|
-
minimum: 1,
|
|
53951
|
-
maximum: 60,
|
|
53952
|
-
description: "PTY terminal height in rows. Applies only when pty: true; defaults to 24. Minimum 1, maximum 60."
|
|
53959
|
+
pty: Type3.Optional(Type3.Boolean({
|
|
53960
|
+
description: 'Spawn the command in a real PTY for interactive programs. Implies background: true automatically. Inspect with bash_status({ task_id, output_mode: "screen" }) and send input with bash_write.'
|
|
53953
53961
|
})),
|
|
53954
|
-
|
|
53955
|
-
|
|
53956
|
-
maximum: 140,
|
|
53957
|
-
description: "PTY terminal width in columns. Applies only when pty: true; defaults to 80. Minimum 1, maximum 140."
|
|
53958
|
-
}))
|
|
53962
|
+
ptyRows: optionalInt(1, 60),
|
|
53963
|
+
ptyCols: optionalInt(1, 140)
|
|
53959
53964
|
});
|
|
53960
|
-
var BashTaskParams =
|
|
53961
|
-
task_id:
|
|
53965
|
+
var BashTaskParams = Type3.Object({
|
|
53966
|
+
task_id: Type3.String({
|
|
53962
53967
|
description: "Background bash task id returned by bash({ background: true })."
|
|
53963
53968
|
})
|
|
53964
53969
|
});
|
|
53965
|
-
var BashStatusParams =
|
|
53966
|
-
task_id:
|
|
53970
|
+
var BashStatusParams = Type3.Object({
|
|
53971
|
+
task_id: Type3.String({
|
|
53967
53972
|
description: "Background bash task id returned by bash({ background: true })."
|
|
53968
53973
|
}),
|
|
53969
|
-
output_mode:
|
|
53974
|
+
output_mode: Type3.Optional(Type3.Union([Type3.Literal("screen"), Type3.Literal("raw"), Type3.Literal("both")], {
|
|
53970
53975
|
description: "PTY output rendering mode. Defaults to screen for PTY tasks and preserves existing behavior for piped tasks when omitted."
|
|
53971
53976
|
}))
|
|
53972
53977
|
});
|
|
53973
|
-
var BashWatchParams =
|
|
53974
|
-
task_id:
|
|
53978
|
+
var BashWatchParams = Type3.Object({
|
|
53979
|
+
task_id: Type3.String({
|
|
53975
53980
|
description: "Background bash task id returned by bash({ background: true })."
|
|
53976
53981
|
}),
|
|
53977
|
-
pattern:
|
|
53978
|
-
background:
|
|
53979
|
-
timeout_ms:
|
|
53980
|
-
once:
|
|
53982
|
+
pattern: Type3.Optional(Type3.Union([Type3.String(), Type3.Object({ regex: Type3.String() })])),
|
|
53983
|
+
background: Type3.Optional(Type3.Boolean()),
|
|
53984
|
+
timeout_ms: optionalInt(1, MAX_BASH_STATUS_WAIT_TIMEOUT_MS),
|
|
53985
|
+
once: Type3.Optional(Type3.Boolean())
|
|
53981
53986
|
});
|
|
53982
|
-
var BashWriteParams =
|
|
53983
|
-
task_id:
|
|
53987
|
+
var BashWriteParams = Type3.Object({
|
|
53988
|
+
task_id: Type3.String({
|
|
53984
53989
|
description: "Background PTY task id returned by bash({ pty: true, background: true })."
|
|
53985
53990
|
}),
|
|
53986
|
-
input:
|
|
53987
|
-
|
|
53988
|
-
|
|
53989
|
-
|
|
53990
|
-
|
|
53991
|
-
key:
|
|
53991
|
+
input: Type3.Union([
|
|
53992
|
+
Type3.String(),
|
|
53993
|
+
Type3.Array(Type3.Union([
|
|
53994
|
+
Type3.String(),
|
|
53995
|
+
Type3.Object({
|
|
53996
|
+
key: Type3.String({
|
|
53992
53997
|
description: "Named control key, e.g. 'esc', 'enter', 'up', 'ctrl-c'. Case-insensitive."
|
|
53993
53998
|
})
|
|
53994
53999
|
})
|
|
@@ -54032,12 +54037,10 @@ function registerBashTool(pi, ctx) {
|
|
|
54032
54037
|
parameters: BashParams,
|
|
54033
54038
|
async execute(_toolCallId, params, _signal, onUpdate, extCtx) {
|
|
54034
54039
|
const bridge = bridgeFor(ctx, extCtx.cwd);
|
|
54035
|
-
|
|
54036
|
-
|
|
54037
|
-
|
|
54038
|
-
|
|
54039
|
-
throw new Error("PTY mode requires background: true");
|
|
54040
|
-
}
|
|
54040
|
+
const timeout = coerceOptionalInt(params.timeout, "timeout", 1, Number.MAX_SAFE_INTEGER);
|
|
54041
|
+
const ptyRows = coerceOptionalInt(params.ptyRows, "ptyRows", 1, 60);
|
|
54042
|
+
const ptyCols = coerceOptionalInt(params.ptyCols, "ptyCols", 1, 140);
|
|
54043
|
+
const effectiveBackground = params.background === true || params.pty === true;
|
|
54041
54044
|
let spawnContext = {
|
|
54042
54045
|
command: params.command,
|
|
54043
54046
|
cwd: params.workdir
|
|
@@ -54052,16 +54055,16 @@ function registerBashTool(pi, ctx) {
|
|
|
54052
54055
|
let streamed = "";
|
|
54053
54056
|
const response = await callBridge(bridge, "bash", {
|
|
54054
54057
|
command: spawnContext.command,
|
|
54055
|
-
timeout
|
|
54058
|
+
timeout,
|
|
54056
54059
|
workdir: spawnContext.cwd ?? params.workdir,
|
|
54057
54060
|
env: spawnContext.env,
|
|
54058
54061
|
description: params.description,
|
|
54059
|
-
background:
|
|
54060
|
-
notify_on_completion:
|
|
54062
|
+
background: effectiveBackground,
|
|
54063
|
+
notify_on_completion: effectiveBackground,
|
|
54061
54064
|
compressed: params.compressed,
|
|
54062
54065
|
pty: params.pty,
|
|
54063
|
-
pty_rows:
|
|
54064
|
-
pty_cols:
|
|
54066
|
+
pty_rows: ptyRows,
|
|
54067
|
+
pty_cols: ptyCols
|
|
54065
54068
|
}, extCtx, {
|
|
54066
54069
|
transportTimeoutMs: BASH_TRANSPORT_TIMEOUT_MS,
|
|
54067
54070
|
keepBridgeOnTimeout: true,
|
|
@@ -54081,13 +54084,13 @@ function registerBashTool(pi, ctx) {
|
|
|
54081
54084
|
}
|
|
54082
54085
|
const taskId = response.task_id;
|
|
54083
54086
|
if (response.status === "running" && taskId) {
|
|
54084
|
-
if (
|
|
54087
|
+
if (effectiveBackground) {
|
|
54085
54088
|
trackBgTask(resolveSessionId(extCtx), taskId);
|
|
54086
54089
|
return bashResult(formatBackgroundLaunch(taskId, params.pty === true), {
|
|
54087
54090
|
task_id: taskId
|
|
54088
54091
|
});
|
|
54089
54092
|
}
|
|
54090
|
-
const waitTimeoutMs =
|
|
54093
|
+
const waitTimeoutMs = timeout !== undefined ? Math.min(timeout, FOREGROUND_WAIT_WINDOW_MS) : FOREGROUND_WAIT_WINDOW_MS;
|
|
54091
54094
|
const startedAt = Date.now();
|
|
54092
54095
|
while (true) {
|
|
54093
54096
|
const status = await callBridge(bridge, "bash_status", { task_id: taskId }, extCtx);
|
|
@@ -54228,7 +54231,7 @@ function createBashWatchTool(ctx) {
|
|
|
54228
54231
|
return textResult(`Watch registered: ${registered.watch_id} on task ${params.task_id}
|
|
54229
54232
|
A notification will fire when the pattern matches or the task exits.`, watchDetails);
|
|
54230
54233
|
}
|
|
54231
|
-
const data = await waitForBashStatus(ctx, bridge, extCtx, params.task_id, undefined, waitFor, true, Math.min(params.timeout_ms ?? DEFAULT_BASH_STATUS_WAIT_TIMEOUT_MS, MAX_BASH_STATUS_WAIT_TIMEOUT_MS));
|
|
54234
|
+
const data = await waitForBashStatus(ctx, bridge, extCtx, params.task_id, undefined, waitFor, true, Math.min(coerceOptionalInt(params.timeout_ms, "timeout_ms", 1, MAX_BASH_STATUS_WAIT_TIMEOUT_MS) ?? DEFAULT_BASH_STATUS_WAIT_TIMEOUT_MS, MAX_BASH_STATUS_WAIT_TIMEOUT_MS));
|
|
54232
54235
|
const text = await formatBashStatus(extCtx, params.task_id, data, undefined);
|
|
54233
54236
|
return textResult(text, data);
|
|
54234
54237
|
}
|
|
@@ -54546,8 +54549,8 @@ function shortenCommand(command) {
|
|
|
54546
54549
|
}
|
|
54547
54550
|
|
|
54548
54551
|
// src/tools/conflicts.ts
|
|
54549
|
-
import { Type as
|
|
54550
|
-
var ConflictsParams =
|
|
54552
|
+
import { Type as Type4 } from "typebox";
|
|
54553
|
+
var ConflictsParams = Type4.Object({});
|
|
54551
54554
|
function renderConflictCall(theme, context) {
|
|
54552
54555
|
return renderToolCall("conflicts", undefined, theme, context);
|
|
54553
54556
|
}
|
|
@@ -54595,19 +54598,19 @@ function registerConflictsTool(pi, ctx) {
|
|
|
54595
54598
|
}
|
|
54596
54599
|
|
|
54597
54600
|
// src/tools/fs.ts
|
|
54598
|
-
import { Type as
|
|
54599
|
-
var DeleteParams =
|
|
54600
|
-
files:
|
|
54601
|
+
import { Type as Type5 } from "typebox";
|
|
54602
|
+
var DeleteParams = Type5.Object({
|
|
54603
|
+
files: Type5.Array(Type5.String(), {
|
|
54601
54604
|
description: "Paths to delete (one or more). May include directories when recursive=true.",
|
|
54602
54605
|
minItems: 1
|
|
54603
54606
|
}),
|
|
54604
|
-
recursive:
|
|
54607
|
+
recursive: Type5.Optional(Type5.Boolean({
|
|
54605
54608
|
description: "Required to delete a directory and its contents. Defaults to false; passing a directory without this returns an error."
|
|
54606
54609
|
}))
|
|
54607
54610
|
});
|
|
54608
|
-
var MoveParams =
|
|
54609
|
-
filePath:
|
|
54610
|
-
destination:
|
|
54611
|
+
var MoveParams = Type5.Object({
|
|
54612
|
+
filePath: Type5.String({ description: "Source file path to move" }),
|
|
54613
|
+
destination: Type5.String({ description: "Destination file path" })
|
|
54611
54614
|
});
|
|
54612
54615
|
function renderFsCall(toolName, args, theme, context) {
|
|
54613
54616
|
if (toolName === "aft_delete") {
|
|
@@ -54715,7 +54718,7 @@ import {
|
|
|
54715
54718
|
renderDiff as renderDiff2
|
|
54716
54719
|
} from "@earendil-works/pi-coding-agent";
|
|
54717
54720
|
import { Container as Container3, Spacer as Spacer3, Text as Text3 } from "@earendil-works/pi-tui";
|
|
54718
|
-
import { Type as
|
|
54721
|
+
import { Type as Type6 } from "typebox";
|
|
54719
54722
|
|
|
54720
54723
|
// src/tools/diff-format.ts
|
|
54721
54724
|
import { diffLines } from "diff";
|
|
@@ -54835,33 +54838,33 @@ async function assertExternalDirectoryPermission(extCtx, target, action = "modif
|
|
|
54835
54838
|
return;
|
|
54836
54839
|
throw new Error("Permission denied: external directory access was cancelled.");
|
|
54837
54840
|
}
|
|
54838
|
-
var ReadParams =
|
|
54839
|
-
path:
|
|
54840
|
-
offset:
|
|
54841
|
-
limit:
|
|
54841
|
+
var ReadParams = Type6.Object({
|
|
54842
|
+
path: Type6.String({ description: "Path to the file to read (relative or absolute)" }),
|
|
54843
|
+
offset: optionalInt(1, Number.MAX_SAFE_INTEGER),
|
|
54844
|
+
limit: optionalInt(1, Number.MAX_SAFE_INTEGER)
|
|
54842
54845
|
});
|
|
54843
|
-
var WriteParams =
|
|
54844
|
-
filePath:
|
|
54846
|
+
var WriteParams = Type6.Object({
|
|
54847
|
+
filePath: Type6.String({
|
|
54845
54848
|
description: "Path to the file to write (absolute or project-relative)"
|
|
54846
54849
|
}),
|
|
54847
|
-
content:
|
|
54848
|
-
});
|
|
54849
|
-
var EditParams =
|
|
54850
|
-
filePath:
|
|
54851
|
-
oldString:
|
|
54852
|
-
newString:
|
|
54853
|
-
replaceAll:
|
|
54854
|
-
occurrence:
|
|
54855
|
-
appendContent:
|
|
54850
|
+
content: Type6.String({ description: "Full file contents to write" })
|
|
54851
|
+
});
|
|
54852
|
+
var EditParams = Type6.Object({
|
|
54853
|
+
filePath: Type6.String({ description: "Path to the file to edit" }),
|
|
54854
|
+
oldString: Type6.Optional(Type6.String({ description: "Text to find (exact match, fuzzy fallback)" })),
|
|
54855
|
+
newString: Type6.Optional(Type6.String({ description: "Replacement text (omit to delete match)" })),
|
|
54856
|
+
replaceAll: Type6.Optional(Type6.Boolean({ description: "Replace every occurrence" })),
|
|
54857
|
+
occurrence: optionalInt(0, Number.MAX_SAFE_INTEGER),
|
|
54858
|
+
appendContent: Type6.Optional(Type6.String({
|
|
54856
54859
|
description: "Append text to the end of the file (creates the file if missing, parent dirs auto-created). When set, oldString/newString are ignored."
|
|
54857
54860
|
}))
|
|
54858
54861
|
});
|
|
54859
|
-
var GrepParams =
|
|
54860
|
-
pattern:
|
|
54861
|
-
path:
|
|
54862
|
-
include:
|
|
54863
|
-
caseSensitive:
|
|
54864
|
-
contextLines:
|
|
54862
|
+
var GrepParams = Type6.Object({
|
|
54863
|
+
pattern: Type6.String({ description: "Regex pattern to search for" }),
|
|
54864
|
+
path: Type6.Optional(Type6.String({ description: "Path scope (file or directory)" })),
|
|
54865
|
+
include: Type6.Optional(Type6.String({ description: "Glob filter for included files (e.g. '*.ts,*.tsx')" })),
|
|
54866
|
+
caseSensitive: Type6.Optional(Type6.Boolean({ description: "Case-sensitive matching" })),
|
|
54867
|
+
contextLines: optionalInt(1, Number.MAX_SAFE_INTEGER)
|
|
54865
54868
|
});
|
|
54866
54869
|
function registerHoistedTools(pi, ctx, surface) {
|
|
54867
54870
|
if (surface.hoistRead) {
|
|
@@ -54874,14 +54877,16 @@ function registerHoistedTools(pi, ctx, surface) {
|
|
|
54874
54877
|
parameters: ReadParams,
|
|
54875
54878
|
async execute(_toolCallId, params, _signal, _onUpdate, extCtx) {
|
|
54876
54879
|
const bridge = bridgeFor(ctx, extCtx.cwd);
|
|
54880
|
+
const offset = coerceOptionalInt(params.offset, "offset", 1, Number.MAX_SAFE_INTEGER);
|
|
54881
|
+
const limit = coerceOptionalInt(params.limit, "limit", 1, Number.MAX_SAFE_INTEGER);
|
|
54877
54882
|
const req = { file: params.path };
|
|
54878
|
-
if (
|
|
54879
|
-
req.start_line =
|
|
54880
|
-
if (
|
|
54881
|
-
req.end_line =
|
|
54883
|
+
if (offset !== undefined) {
|
|
54884
|
+
req.start_line = offset;
|
|
54885
|
+
if (limit !== undefined) {
|
|
54886
|
+
req.end_line = offset + limit - 1;
|
|
54882
54887
|
}
|
|
54883
|
-
} else if (
|
|
54884
|
-
req.end_line =
|
|
54888
|
+
} else if (limit !== undefined) {
|
|
54889
|
+
req.end_line = limit;
|
|
54885
54890
|
}
|
|
54886
54891
|
const response = await callBridge(bridge, "read", req, extCtx);
|
|
54887
54892
|
if (Array.isArray(response.entries)) {
|
|
@@ -54889,7 +54894,7 @@ function registerHoistedTools(pi, ctx, surface) {
|
|
|
54889
54894
|
`));
|
|
54890
54895
|
}
|
|
54891
54896
|
let text = response.content ?? "";
|
|
54892
|
-
const agentSpecifiedRange =
|
|
54897
|
+
const agentSpecifiedRange = offset !== undefined || limit !== undefined;
|
|
54893
54898
|
const footer = formatReadFooter(agentSpecifiedRange, response);
|
|
54894
54899
|
if (footer)
|
|
54895
54900
|
text += footer;
|
|
@@ -54959,8 +54964,9 @@ function registerHoistedTools(pi, ctx, surface) {
|
|
|
54959
54964
|
};
|
|
54960
54965
|
if (params.replaceAll === true)
|
|
54961
54966
|
req.replace_all = true;
|
|
54962
|
-
|
|
54963
|
-
|
|
54967
|
+
const occurrence = coerceOptionalInt(params.occurrence, "occurrence", 0, Number.MAX_SAFE_INTEGER);
|
|
54968
|
+
if (occurrence !== undefined)
|
|
54969
|
+
req.occurrence = occurrence;
|
|
54964
54970
|
const response = await callBridge(bridge, "edit_match", req, extCtx);
|
|
54965
54971
|
return buildMutationResult(params.filePath, response);
|
|
54966
54972
|
},
|
|
@@ -54991,8 +54997,9 @@ function registerHoistedTools(pi, ctx, surface) {
|
|
|
54991
54997
|
req.include = splitIncludeGlobs(params.include);
|
|
54992
54998
|
if (params.caseSensitive !== undefined)
|
|
54993
54999
|
req.case_sensitive = params.caseSensitive;
|
|
54994
|
-
|
|
54995
|
-
|
|
55000
|
+
const contextLines = coerceOptionalInt(params.contextLines, "contextLines", 1, Number.MAX_SAFE_INTEGER);
|
|
55001
|
+
if (contextLines !== undefined)
|
|
55002
|
+
req.context_lines = contextLines;
|
|
54996
55003
|
const response = await callBridge(bridge, "grep", req, extCtx);
|
|
54997
55004
|
const text = response.text ?? "";
|
|
54998
55005
|
return textResult(text);
|
|
@@ -55211,16 +55218,16 @@ function formatReadFooter(agentSpecifiedRange, data) {
|
|
|
55211
55218
|
|
|
55212
55219
|
// src/tools/imports.ts
|
|
55213
55220
|
import { StringEnum as StringEnum2 } from "@earendil-works/pi-ai";
|
|
55214
|
-
import { Type as
|
|
55215
|
-
var ImportParams =
|
|
55221
|
+
import { Type as Type7 } from "typebox";
|
|
55222
|
+
var ImportParams = Type7.Object({
|
|
55216
55223
|
op: StringEnum2(["add", "remove", "organize"], { description: "Import operation" }),
|
|
55217
|
-
filePath:
|
|
55218
|
-
module:
|
|
55219
|
-
names:
|
|
55220
|
-
defaultImport:
|
|
55221
|
-
removeName:
|
|
55222
|
-
typeOnly:
|
|
55223
|
-
validate:
|
|
55224
|
+
filePath: Type7.String({ description: "Path to the file" }),
|
|
55225
|
+
module: Type7.Optional(Type7.String({ description: "Module path (required for add/remove), e.g. 'react', './utils'" })),
|
|
55226
|
+
names: Type7.Optional(Type7.Array(Type7.String(), { description: "Named imports to add, e.g. ['useState']" })),
|
|
55227
|
+
defaultImport: Type7.Optional(Type7.String({ description: "Default import name (e.g. 'React')" })),
|
|
55228
|
+
removeName: Type7.Optional(Type7.String({ description: "Named import to remove; omit to remove entire import" })),
|
|
55229
|
+
typeOnly: Type7.Optional(Type7.Boolean({ description: "Type-only import (TS only)" })),
|
|
55230
|
+
validate: Type7.Optional(StringEnum2(["syntax", "full"], {
|
|
55224
55231
|
description: "Post-edit validation level (default: syntax)"
|
|
55225
55232
|
}))
|
|
55226
55233
|
});
|
|
@@ -55309,16 +55316,16 @@ function registerImportTools(pi, ctx) {
|
|
|
55309
55316
|
|
|
55310
55317
|
// src/tools/lsp.ts
|
|
55311
55318
|
import { StringEnum as StringEnum3 } from "@earendil-works/pi-ai";
|
|
55312
|
-
import { Type as
|
|
55313
|
-
var LspDiagnosticsParams =
|
|
55314
|
-
filePath:
|
|
55315
|
-
directory:
|
|
55319
|
+
import { Type as Type8 } from "typebox";
|
|
55320
|
+
var LspDiagnosticsParams = Type8.Object({
|
|
55321
|
+
filePath: Type8.Optional(Type8.String({ description: "File to get diagnostics for (mutually exclusive with directory)" })),
|
|
55322
|
+
directory: Type8.Optional(Type8.String({
|
|
55316
55323
|
description: "Directory to get diagnostics for (mutually exclusive with filePath)"
|
|
55317
55324
|
})),
|
|
55318
|
-
severity:
|
|
55325
|
+
severity: Type8.Optional(StringEnum3(["error", "warning", "information", "hint", "all"], {
|
|
55319
55326
|
description: "Filter by severity (default: all)"
|
|
55320
55327
|
})),
|
|
55321
|
-
waitMs:
|
|
55328
|
+
waitMs: Type8.Optional(Type8.Number({
|
|
55322
55329
|
description: "Wait N ms for fresh diagnostics (max 10000, default: 0)"
|
|
55323
55330
|
}))
|
|
55324
55331
|
});
|
|
@@ -55403,16 +55410,16 @@ function registerLspTools(pi, ctx) {
|
|
|
55403
55410
|
|
|
55404
55411
|
// src/tools/navigate.ts
|
|
55405
55412
|
import { StringEnum as StringEnum4 } from "@earendil-works/pi-ai";
|
|
55406
|
-
import { Type as
|
|
55413
|
+
import { Type as Type9 } from "typebox";
|
|
55407
55414
|
function navigateParamsSchema() {
|
|
55408
|
-
return
|
|
55415
|
+
return Type9.Object({
|
|
55409
55416
|
op: StringEnum4(["call_tree", "callers", "trace_to", "impact", "trace_data"], {
|
|
55410
55417
|
description: "Navigation operation"
|
|
55411
55418
|
}),
|
|
55412
|
-
filePath:
|
|
55413
|
-
symbol:
|
|
55414
|
-
depth:
|
|
55415
|
-
expression:
|
|
55419
|
+
filePath: Type9.String({ description: "Source file containing the symbol" }),
|
|
55420
|
+
symbol: Type9.String({ description: "Name of the symbol to analyze" }),
|
|
55421
|
+
depth: optionalInt(1, Number.MAX_SAFE_INTEGER),
|
|
55422
|
+
expression: Type9.Optional(Type9.String({ description: "Expression to track (required for trace_data)" }))
|
|
55416
55423
|
});
|
|
55417
55424
|
}
|
|
55418
55425
|
function treeLine(depth, text) {
|
|
@@ -55546,8 +55553,9 @@ function registerNavigateTool(pi, ctx) {
|
|
|
55546
55553
|
file: params.filePath,
|
|
55547
55554
|
symbol: params.symbol
|
|
55548
55555
|
};
|
|
55549
|
-
|
|
55550
|
-
|
|
55556
|
+
const depth = coerceOptionalInt(params.depth, "depth", 1, Number.MAX_SAFE_INTEGER);
|
|
55557
|
+
if (depth !== undefined)
|
|
55558
|
+
req.depth = depth;
|
|
55551
55559
|
if (params.expression !== undefined)
|
|
55552
55560
|
req.expression = params.expression;
|
|
55553
55561
|
const response = await callBridge(bridge, params.op, req, extCtx);
|
|
@@ -55565,20 +55573,20 @@ function registerNavigateTool(pi, ctx) {
|
|
|
55565
55573
|
// src/tools/reading.ts
|
|
55566
55574
|
import { stat as stat2 } from "node:fs/promises";
|
|
55567
55575
|
import { resolve as resolve4 } from "node:path";
|
|
55568
|
-
import { Type as
|
|
55569
|
-
var OutlineParams =
|
|
55570
|
-
target:
|
|
55576
|
+
import { Type as Type10 } from "typebox";
|
|
55577
|
+
var OutlineParams = Type10.Object({
|
|
55578
|
+
target: Type10.Union([Type10.String(), Type10.Array(Type10.String())], {
|
|
55571
55579
|
description: "What to outline: a file path, directory path, URL (http:// or https://), or array of file paths. The mode is auto-detected: URLs by `http://`/`https://` prefix, directories by stat, arrays as multi-file. Directory walks cap at 200 files."
|
|
55572
55580
|
})
|
|
55573
55581
|
});
|
|
55574
|
-
var ZoomParams =
|
|
55575
|
-
filePath:
|
|
55576
|
-
url:
|
|
55582
|
+
var ZoomParams = Type10.Object({
|
|
55583
|
+
filePath: Type10.Optional(Type10.String({ description: "Path to file (absolute or project-relative)" })),
|
|
55584
|
+
url: Type10.Optional(Type10.String({
|
|
55577
55585
|
description: "HTTP/HTTPS URL of an HTML or Markdown document to fetch and zoom into"
|
|
55578
55586
|
})),
|
|
55579
|
-
symbol:
|
|
55580
|
-
symbols:
|
|
55581
|
-
contextLines:
|
|
55587
|
+
symbol: Type10.Optional(Type10.String({ description: "Symbol name (function/class/type) or Markdown heading" })),
|
|
55588
|
+
symbols: Type10.Optional(Type10.Array(Type10.String(), { description: "Multiple symbols — returns array of matches" })),
|
|
55589
|
+
contextLines: Type10.Optional(Type10.Number({ description: "Lines of context before/after (default: 3)" }))
|
|
55582
55590
|
});
|
|
55583
55591
|
function isUrl(s) {
|
|
55584
55592
|
return s.startsWith("http://") || s.startsWith("https://");
|
|
@@ -55826,17 +55834,17 @@ ${lines}`;
|
|
|
55826
55834
|
|
|
55827
55835
|
// src/tools/refactor.ts
|
|
55828
55836
|
import { StringEnum as StringEnum5 } from "@earendil-works/pi-ai";
|
|
55829
|
-
import { Type as
|
|
55830
|
-
var RefactorParams =
|
|
55837
|
+
import { Type as Type11 } from "typebox";
|
|
55838
|
+
var RefactorParams = Type11.Object({
|
|
55831
55839
|
op: StringEnum5(["move", "extract", "inline"], { description: "Refactoring operation" }),
|
|
55832
|
-
filePath:
|
|
55833
|
-
symbol:
|
|
55834
|
-
destination:
|
|
55835
|
-
scope:
|
|
55836
|
-
name:
|
|
55837
|
-
startLine:
|
|
55838
|
-
endLine:
|
|
55839
|
-
callSiteLine:
|
|
55840
|
+
filePath: Type11.String({ description: "Source file" }),
|
|
55841
|
+
symbol: Type11.Optional(Type11.String({ description: "Symbol name (for move, inline)" })),
|
|
55842
|
+
destination: Type11.Optional(Type11.String({ description: "Target file (for move)" })),
|
|
55843
|
+
scope: Type11.Optional(Type11.String({ description: "Disambiguation scope for move op" })),
|
|
55844
|
+
name: Type11.Optional(Type11.String({ description: "New function name (for extract)" })),
|
|
55845
|
+
startLine: optionalInt(1, Number.MAX_SAFE_INTEGER),
|
|
55846
|
+
endLine: optionalInt(1, Number.MAX_SAFE_INTEGER),
|
|
55847
|
+
callSiteLine: optionalInt(1, Number.MAX_SAFE_INTEGER)
|
|
55840
55848
|
});
|
|
55841
55849
|
function buildRefactorSections(args, payload, theme) {
|
|
55842
55850
|
const response = asRecord2(payload);
|
|
@@ -55902,13 +55910,16 @@ function registerRefactorTool(pi, ctx) {
|
|
|
55902
55910
|
req.scope = params.scope;
|
|
55903
55911
|
if (params.name !== undefined)
|
|
55904
55912
|
req.name = params.name;
|
|
55905
|
-
|
|
55906
|
-
|
|
55907
|
-
|
|
55908
|
-
|
|
55909
|
-
|
|
55910
|
-
if (
|
|
55911
|
-
req.
|
|
55913
|
+
const startLine = coerceOptionalInt(params.startLine, "startLine", 1, Number.MAX_SAFE_INTEGER);
|
|
55914
|
+
const endLine = coerceOptionalInt(params.endLine, "endLine", 1, Number.MAX_SAFE_INTEGER);
|
|
55915
|
+
const callSiteLine = coerceOptionalInt(params.callSiteLine, "callSiteLine", 1, Number.MAX_SAFE_INTEGER);
|
|
55916
|
+
if (startLine !== undefined)
|
|
55917
|
+
req.start_line = startLine;
|
|
55918
|
+
if (endLine !== undefined) {
|
|
55919
|
+
req.end_line = params.op === "extract" ? endLine + 1 : endLine;
|
|
55920
|
+
}
|
|
55921
|
+
if (callSiteLine !== undefined)
|
|
55922
|
+
req.call_site_line = callSiteLine;
|
|
55912
55923
|
const response = await callBridge(bridge, commandMap[params.op], req, extCtx);
|
|
55913
55924
|
return textResult(JSON.stringify(response, null, 2));
|
|
55914
55925
|
},
|
|
@@ -55923,14 +55934,14 @@ function registerRefactorTool(pi, ctx) {
|
|
|
55923
55934
|
|
|
55924
55935
|
// src/tools/safety.ts
|
|
55925
55936
|
import { StringEnum as StringEnum6 } from "@earendil-works/pi-ai";
|
|
55926
|
-
import { Type as
|
|
55927
|
-
var SafetyParams =
|
|
55937
|
+
import { Type as Type12 } from "typebox";
|
|
55938
|
+
var SafetyParams = Type12.Object({
|
|
55928
55939
|
op: StringEnum6(["undo", "history", "checkpoint", "restore", "list"], {
|
|
55929
55940
|
description: "Safety operation"
|
|
55930
55941
|
}),
|
|
55931
|
-
filePath:
|
|
55932
|
-
name:
|
|
55933
|
-
files:
|
|
55942
|
+
filePath: Type12.Optional(Type12.String({ description: "File path (required for history, optional for undo)" })),
|
|
55943
|
+
name: Type12.Optional(Type12.String({ description: "Checkpoint name (required for checkpoint, restore)" })),
|
|
55944
|
+
files: Type12.Optional(Type12.Array(Type12.String(), {
|
|
55934
55945
|
description: "Specific files for checkpoint (optional, defaults to all tracked)"
|
|
55935
55946
|
}))
|
|
55936
55947
|
});
|
|
@@ -56061,12 +56072,12 @@ function registerSafetyTool(pi, ctx) {
|
|
|
56061
56072
|
}
|
|
56062
56073
|
|
|
56063
56074
|
// src/tools/semantic.ts
|
|
56064
|
-
import { Type as
|
|
56065
|
-
var SearchParams2 =
|
|
56066
|
-
query:
|
|
56075
|
+
import { Type as Type13 } from "typebox";
|
|
56076
|
+
var SearchParams2 = Type13.Object({
|
|
56077
|
+
query: Type13.String({
|
|
56067
56078
|
description: "Concept or capability to find, phrased as a programmer would describe the code. Examples: 'fuzzy match with whitespace tolerance', 'undo backup before edit', 'retry failed network request'."
|
|
56068
56079
|
}),
|
|
56069
|
-
topK:
|
|
56080
|
+
topK: Type13.Optional(Type13.Number({ description: "Maximum number of results (default: 10, max: 100)" }))
|
|
56070
56081
|
});
|
|
56071
56082
|
function buildSemanticSections(args, payload, theme) {
|
|
56072
56083
|
const response = asRecord2(payload);
|
|
@@ -56167,23 +56178,23 @@ function registerSemanticTool(pi, ctx) {
|
|
|
56167
56178
|
|
|
56168
56179
|
// src/tools/structure.ts
|
|
56169
56180
|
import { StringEnum as StringEnum7 } from "@earendil-works/pi-ai";
|
|
56170
|
-
import { Type as
|
|
56171
|
-
var TransformParams =
|
|
56181
|
+
import { Type as Type14 } from "typebox";
|
|
56182
|
+
var TransformParams = Type14.Object({
|
|
56172
56183
|
op: StringEnum7(["add_member", "add_derive", "wrap_try_catch", "add_decorator", "add_struct_tags"], { description: "Transformation operation" }),
|
|
56173
|
-
filePath:
|
|
56174
|
-
container:
|
|
56175
|
-
code:
|
|
56176
|
-
target:
|
|
56177
|
-
derives:
|
|
56178
|
-
catchBody:
|
|
56179
|
-
decorator:
|
|
56180
|
-
field:
|
|
56181
|
-
tag:
|
|
56182
|
-
value:
|
|
56183
|
-
position:
|
|
56184
|
+
filePath: Type14.String({ description: "Path to the source file" }),
|
|
56185
|
+
container: Type14.Optional(Type14.String({ description: "Class/struct/impl name for add_member" })),
|
|
56186
|
+
code: Type14.Optional(Type14.String({ description: "Member code to insert (add_member)" })),
|
|
56187
|
+
target: Type14.Optional(Type14.String({ description: "Target symbol name" })),
|
|
56188
|
+
derives: Type14.Optional(Type14.Array(Type14.String(), { description: "Derive macro names (add_derive)" })),
|
|
56189
|
+
catchBody: Type14.Optional(Type14.String({ description: "Catch block body (wrap_try_catch, default: 'throw error;')" })),
|
|
56190
|
+
decorator: Type14.Optional(Type14.String({ description: "Decorator text without @ (add_decorator)" })),
|
|
56191
|
+
field: Type14.Optional(Type14.String({ description: "Struct field name (add_struct_tags)" })),
|
|
56192
|
+
tag: Type14.Optional(Type14.String({ description: "Tag key (add_struct_tags)" })),
|
|
56193
|
+
value: Type14.Optional(Type14.String({ description: "Tag value (add_struct_tags)" })),
|
|
56194
|
+
position: Type14.Optional(Type14.String({
|
|
56184
56195
|
description: "Position hint: 'first', 'last' (default), 'before:name', 'after:name' for add_member"
|
|
56185
56196
|
})),
|
|
56186
|
-
validate:
|
|
56197
|
+
validate: Type14.Optional(StringEnum7(["syntax", "full"], {
|
|
56187
56198
|
description: "Validation level (default: syntax)"
|
|
56188
56199
|
}))
|
|
56189
56200
|
});
|
package/dist/tools/_shared.d.ts
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { BinaryBridge, BridgeRequestOptions } from "@cortexkit/aft-bridge";
|
|
5
5
|
import type { AgentToolResult, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import { Type } from "typebox";
|
|
6
7
|
import type { PluginContext } from "../types.js";
|
|
8
|
+
export declare const optionalInt: (_min: number, _max: number) => Type.TOptional<Type.TAny>;
|
|
9
|
+
export declare function coerceOptionalInt(v: unknown, paramName: string, min: number, max: number): number | undefined;
|
|
7
10
|
/**
|
|
8
11
|
* Per-command timeout overrides (milliseconds).
|
|
9
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/tools/_shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/tools/_shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,8BACC,CAAC;AAExD,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,OAAO,EACV,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,SAAS,CAWpB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQlE,CAAC;AAEF,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAErE;AAED,gEAAgE;AAChE,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAEvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAK7E;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACpC,MAAM,CAAC,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA0BlC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,QAAQ,GAAG,OAAO,EAC3C,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,QAAQ,GACjB,eAAe,CAAC,QAAQ,CAAC,CAK3B;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,GAAG,OAAO,EAC/C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,OAAO,CAAC,EAAE,QAAQ,GACjB,eAAe,CAAC,QAAQ,CAAC,CAE3B;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGvF"}
|
package/dist/tools/bash.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare const BashWatchParams: Type.TObject<{
|
|
|
14
14
|
regex: Type.TString;
|
|
15
15
|
}>]>>;
|
|
16
16
|
background: Type.TOptional<Type.TBoolean>;
|
|
17
|
-
timeout_ms: Type.TOptional<Type.
|
|
17
|
+
timeout_ms: Type.TOptional<Type.TAny>;
|
|
18
18
|
once: Type.TOptional<Type.TBoolean>;
|
|
19
19
|
}>;
|
|
20
20
|
declare const BashWriteParams: Type.TObject<{
|
|
@@ -75,7 +75,7 @@ export declare function createBashWatchTool(ctx: PluginContext): {
|
|
|
75
75
|
regex: Type.TString;
|
|
76
76
|
}>]>>;
|
|
77
77
|
background: Type.TOptional<Type.TBoolean>;
|
|
78
|
-
timeout_ms: Type.TOptional<Type.
|
|
78
|
+
timeout_ms: Type.TOptional<Type.TAny>;
|
|
79
79
|
once: Type.TOptional<Type.TBoolean>;
|
|
80
80
|
}>;
|
|
81
81
|
execute(_toolCallId: string, params: Static<typeof BashWatchParams>, _signal: AbortSignal | undefined, _onUpdate: ((update: AgentToolResult<BashWatchDetails>) => void) | undefined, extCtx: ExtensionContext): Promise<AgentToolResult<BashWatchDetails>>;
|
package/dist/tools/bash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAgB5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAgB5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiFjD,QAAA,MAAM,cAAc;;EAIlB,CAAC;AAEH,QAAA,MAAM,gBAAgB;;;EAUpB,CAAC;AAEH,QAAA,MAAM,eAAe;;;;;;;;EAQnB,CAAC;AAEH,QAAA,MAAM,eAAe;;;;;EA+BnB,CAAC;AAWH,UAAU,gBAAgB;IACxB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,gBAAiB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAAG;AAsC7D,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CA0K3E;AA8CD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa;;;;;;;;;yBASpC,MAAM,UACX,MAAM,CAAC,OAAO,gBAAgB,CAAC,WAC9B,WAAW,GAAG,SAAS,aACrB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,UACrE,gBAAgB;EAc7B;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa;;;;;;;;;;;;;;yBASnC,MAAM,UACX,MAAM,CAAC,OAAO,eAAe,CAAC,WAC7B,WAAW,GAAG,SAAS,aACrB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,UACpE,gBAAgB;EA4D7B;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa;;;;;;;;;;;yBAanC,MAAM,UACX,MAAM,CAAC,OAAO,eAAe,CAAC,WAC7B,WAAW,GAAG,SAAS,aACrB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,UACpE,gBAAgB;EAe7B;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa;;;;;;;;yBASlC,MAAM,UACX,MAAM,CAAC,OAAO,cAAc,CAAC,WAC5B,WAAW,GAAG,SAAS,aACrB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,UACnE,gBAAgB;EAe7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAGlB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAGlB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA2EjD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,kEAAkE;AAClE,UAAU,mBAAmB;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;IACxB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,YAAY,EAChB,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAsMN;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,eAAe,CAAC,mBAAmB,CAAC,CAiGtC;AAyJD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CA0B3D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,mBAAmB,EAAE,OAAO,EAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAgBR"}
|
package/dist/tools/navigate.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare function navigateParamsSchema(): Type.TObject<{
|
|
|
10
10
|
op: Type.TUnsafe<"callers" | "trace_to" | "trace_data" | "impact" | "call_tree">;
|
|
11
11
|
filePath: Type.TString;
|
|
12
12
|
symbol: Type.TString;
|
|
13
|
-
depth: Type.TOptional<Type.
|
|
13
|
+
depth: Type.TOptional<Type.TAny>;
|
|
14
14
|
expression: Type.TOptional<Type.TString>;
|
|
15
15
|
}>;
|
|
16
16
|
type NavigateArgs = Static<ReturnType<typeof navigateParamsSchema>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigate.d.ts","sourceRoot":"","sources":["../../src/tools/navigate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAQL,KAAK,iBAAiB,EAKvB,MAAM,qBAAqB,CAAC;AAE7B,iBAAS,oBAAoB;;;;;;GAY5B;AAED,KAAK,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;AAgCpE,wCAAwC;AACxC,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,MAAM,EAAE,CA0FV;AAED,wCAAwC;AACxC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB,yCAS9F;AAED,wCAAwC;AACxC,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,sFAO3B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"navigate.d.ts","sourceRoot":"","sources":["../../src/tools/navigate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAQL,KAAK,iBAAiB,EAKvB,MAAM,qBAAqB,CAAC;AAE7B,iBAAS,oBAAoB;;;;;;GAY5B;AAED,KAAK,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;AAgCpE,wCAAwC;AACxC,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,MAAM,EAAE,CA0FV;AAED,wCAAwC;AACxC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB,yCAS9F;AAED,wCAAwC;AACxC,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,sFAO3B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CA8B/E"}
|
package/dist/tools/refactor.d.ts
CHANGED
|
@@ -13,9 +13,9 @@ declare const RefactorParams: Type.TObject<{
|
|
|
13
13
|
destination: Type.TOptional<Type.TString>;
|
|
14
14
|
scope: Type.TOptional<Type.TString>;
|
|
15
15
|
name: Type.TOptional<Type.TString>;
|
|
16
|
-
startLine: Type.TOptional<Type.
|
|
17
|
-
endLine: Type.TOptional<Type.
|
|
18
|
-
callSiteLine: Type.TOptional<Type.
|
|
16
|
+
startLine: Type.TOptional<Type.TAny>;
|
|
17
|
+
endLine: Type.TOptional<Type.TAny>;
|
|
18
|
+
callSiteLine: Type.TOptional<Type.TAny>;
|
|
19
19
|
}>;
|
|
20
20
|
/** Exported for renderer unit tests. */
|
|
21
21
|
export declare function buildRefactorSections(args: Static<typeof RefactorParams>, payload: unknown, theme: Theme): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refactor.d.ts","sourceRoot":"","sources":["../../src/tools/refactor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAOL,KAAK,iBAAiB,EAKvB,MAAM,qBAAqB,CAAC;AAE7B,QAAA,MAAM,cAAc;;;;;;;;;;EAUlB,CAAC;AAEH,wCAAwC;AACxC,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,CAAC,OAAO,cAAc,CAAC,EACnC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,MAAM,EAAE,CAiCV;AAED,wCAAwC;AACxC,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,CAAC,OAAO,cAAc,CAAC,EACnC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,yCAU3B;AAED,wCAAwC;AACxC,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,IAAI,EAAE,MAAM,CAAC,OAAO,cAAc,CAAC,EACnC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,sFAO3B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"refactor.d.ts","sourceRoot":"","sources":["../../src/tools/refactor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAOL,KAAK,iBAAiB,EAKvB,MAAM,qBAAqB,CAAC;AAE7B,QAAA,MAAM,cAAc;;;;;;;;;;EAUlB,CAAC;AAEH,wCAAwC;AACxC,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,CAAC,OAAO,cAAc,CAAC,EACnC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,MAAM,EAAE,CAiCV;AAED,wCAAwC;AACxC,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,CAAC,OAAO,cAAc,CAAC,EACnC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,yCAU3B;AAED,wCAAwC;AACxC,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,IAAI,EAAE,MAAM,CAAC,OAAO,cAAc,CAAC,EACnC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,iBAAiB,sFAO3B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CAsD/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-pi",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"prepublishOnly": "bun run build"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@cortexkit/aft-bridge": "0.30.
|
|
25
|
+
"@cortexkit/aft-bridge": "0.30.1",
|
|
26
26
|
"@xterm/headless": "^5.5.0",
|
|
27
27
|
"comment-json": "^5.0.0",
|
|
28
28
|
"diff": "^8.0.4",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"zod": "^4.1.8"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@cortexkit/aft-darwin-arm64": "0.30.
|
|
34
|
-
"@cortexkit/aft-darwin-x64": "0.30.
|
|
35
|
-
"@cortexkit/aft-linux-arm64": "0.30.
|
|
36
|
-
"@cortexkit/aft-linux-x64": "0.30.
|
|
37
|
-
"@cortexkit/aft-win32-arm64": "0.30.
|
|
38
|
-
"@cortexkit/aft-win32-x64": "0.30.
|
|
33
|
+
"@cortexkit/aft-darwin-arm64": "0.30.1",
|
|
34
|
+
"@cortexkit/aft-darwin-x64": "0.30.1",
|
|
35
|
+
"@cortexkit/aft-linux-arm64": "0.30.1",
|
|
36
|
+
"@cortexkit/aft-linux-x64": "0.30.1",
|
|
37
|
+
"@cortexkit/aft-win32-arm64": "0.30.1",
|
|
38
|
+
"@cortexkit/aft-win32-x64": "0.30.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@earendil-works/pi-coding-agent": "*",
|