@ashx-j/lunr-dev 0.2.40-dev.59.1 → 0.2.40-dev.61.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/builtin-extensions/pi-lsp-extension/bemol-extension/index.js +2 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +2 -1
- package/dist/core/tools/edit.d.ts +11 -4
- package/dist/core/tools/edit.js +36 -20
- package/dist/modes/interactive/tool-renderers/edit.js +4 -0
- package/dist/node-runtime/{agent-session-services-UOVUJAX2.js → agent-session-services-ITD5IM37.js} +2 -2
- package/dist/node-runtime/{builtin-extensions-JNJRND4E.js → builtin-extensions-XXQB5IKI.js} +1 -1
- package/dist/node-runtime/{chunk-S46QLY2F.js → chunk-2HWXHS3B.js} +2 -2
- package/dist/node-runtime/{chunk-XXGJ7Z3C.js → chunk-2XLJRAYG.js} +3 -3
- package/dist/node-runtime/{chunk-EJMB4PAV.js → chunk-4JOKLU3I.js} +35 -20
- package/dist/node-runtime/{chunk-BQROL43X.js → chunk-AYHDHGIW.js} +7 -7
- package/dist/node-runtime/{chunk-Y7DFMHY5.js → chunk-HPZUPSXR.js} +4 -4
- package/dist/node-runtime/{chunk-U7MTVVT3.js → chunk-JCL5IRM5.js} +1 -1
- package/dist/node-runtime/{chunk-QDQAKIVU.js → chunk-OZAOEWH2.js} +1 -1
- package/dist/node-runtime/{chunk-HYOPEHDE.js → chunk-QQSC6CTJ.js} +1 -1
- package/dist/node-runtime/{chunk-FCINT2KC.js → chunk-WXC5RUA3.js} +2 -2
- package/dist/node-runtime/{command-6GJNLXGD.js → command-ITCOAWXU.js} +1 -1
- package/dist/node-runtime/{gateway-UDWVYEGX.js → gateway-PVL3CM65.js} +1 -1
- package/dist/node-runtime/index.js +7 -7
- package/dist/node-runtime/{interactive-mode-VCPSTUAW.js → interactive-mode-OQ3N64DI.js} +4 -4
- package/dist/node-runtime/{lunr-cron-3VI5CLK3.js → lunr-cron-UKWWRJXT.js} +1 -1
- package/dist/node-runtime/main.js +4 -4
- package/dist/node-runtime/{pi-subagents-YVVMY4B4.js → pi-subagents-2ZE5BKGM.js} +3 -3
- package/dist/node-runtime/{print-mode-M52NLHKG.js → print-mode-LQS3GH3Y.js} +3 -3
- package/dist/node-runtime/rpc-entry.js +4 -4
- package/dist/node-runtime/{subagent-executor-RTGKJ35C.js → subagent-executor-LXYQ3RES.js} +2 -2
- package/dist/node-runtime/{tool-renderers-KL5EPAMN.js → tool-renderers-XZX7BEOM.js} +1 -1
- package/docs/extensions.md +3 -1
- package/examples/extensions/built-in-tool-renderer.ts +2 -0
- package/examples/extensions/minimal-mode.ts +2 -0
- package/install-lock/package-lock.json +24 -24
- package/install-lock/package.json +2 -2
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -50,7 +50,8 @@ export default function bemolExtension(pi) {
|
|
|
50
50
|
if (bemol.isBrazilWorkspace) {
|
|
51
51
|
provider = new BemolWorkspaceProvider(bemol);
|
|
52
52
|
// Store on event bus so the LSP extension can find it regardless of load order
|
|
53
|
-
pi.events
|
|
53
|
+
const bus = pi.events;
|
|
54
|
+
bus["lsp:workspace-provider"] = provider;
|
|
54
55
|
pi.events.emit("lsp:register-workspace-provider", provider);
|
|
55
56
|
}
|
|
56
57
|
// Register /bemol command and update status once we have UI context
|
|
@@ -155,7 +155,8 @@ export default function lspExtension(pi) {
|
|
|
155
155
|
};
|
|
156
156
|
pi.events.on("lsp:register-workspace-provider", applyProvider);
|
|
157
157
|
// Check for provider registered before our listener existed
|
|
158
|
-
const
|
|
158
|
+
const bus = pi.events;
|
|
159
|
+
const existing = bus["lsp:workspace-provider"];
|
|
159
160
|
if (existing)
|
|
160
161
|
applyProvider(existing);
|
|
161
162
|
const setLspStatus = (color, text) => {
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import type { AgentTool } from "@ashx-j/lunr-agent";
|
|
2
|
-
import {
|
|
2
|
+
import { Type } from "typebox";
|
|
3
3
|
import type { ToolDefinition } from "../extensions/types.ts";
|
|
4
|
+
import { type Edit } from "./edit-diff.ts";
|
|
4
5
|
declare const editSchema: Type.TObject<{
|
|
5
6
|
path: Type.TString;
|
|
6
|
-
|
|
7
|
+
oldText: Type.TOptional<Type.TString>;
|
|
8
|
+
newText: Type.TOptional<Type.TString>;
|
|
9
|
+
edits: Type.TOptional<Type.TArray<Type.TObject<{
|
|
7
10
|
oldText: Type.TString;
|
|
8
11
|
newText: Type.TString;
|
|
9
|
-
}
|
|
12
|
+
}>>>;
|
|
10
13
|
}>;
|
|
11
|
-
|
|
14
|
+
/** Edit arguments after `prepareEditArguments` folds the flat oldText/newText form into `edits`. */
|
|
15
|
+
export type EditToolInput = {
|
|
16
|
+
path: string;
|
|
17
|
+
edits: Edit[];
|
|
18
|
+
};
|
|
12
19
|
export interface EditToolDetails {
|
|
13
20
|
/** Display-oriented diff of the changes made */
|
|
14
21
|
diff: string;
|
package/dist/core/tools/edit.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { validateToolArguments } from "@ashx-j/lunr-ai";
|
|
1
2
|
import { constants } from "fs";
|
|
2
3
|
import { access as fsAccess, readFile as fsReadFile, writeFile as fsWriteFile } from "fs/promises";
|
|
3
4
|
import { Type } from "typebox";
|
|
@@ -5,30 +6,34 @@ import { applyEditsToNormalizedContent, detectLineEnding, generateDiffString, ge
|
|
|
5
6
|
import { withFileMutationQueue } from "./file-mutation-queue.js";
|
|
6
7
|
import { resolveToCwd } from "./path-utils.js";
|
|
7
8
|
import { wrapToolDefinition } from "./tool-definition-wrapper.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}),
|
|
12
|
-
newText: Type.String({ description: "Replacement text for this targeted edit." }),
|
|
13
|
-
}, {});
|
|
9
|
+
// The tool description carries the matching rules, so the properties stay short: each one costs
|
|
10
|
+
// first-request tokens on every session.
|
|
11
|
+
const replaceEditSchema = Type.Object({ oldText: Type.String(), newText: Type.String() });
|
|
14
12
|
const editSchema = Type.Object({
|
|
15
13
|
path: Type.String({ description: "Path to the file to edit (relative or absolute)" }),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}),
|
|
14
|
+
oldText: Type.Optional(Type.String({ description: "Exact text to replace (one replacement)" })),
|
|
15
|
+
newText: Type.Optional(Type.String({ description: "Replacement for oldText" })),
|
|
16
|
+
edits: Type.Optional(Type.Array(replaceEditSchema, { description: "Several replacements, each matched against the original file" })),
|
|
19
17
|
}, {});
|
|
20
18
|
const defaultEditOperations = {
|
|
21
19
|
readFile: (path) => fsReadFile(path),
|
|
22
20
|
writeFile: (path, content) => fsWriteFile(path, content, "utf-8"),
|
|
23
21
|
access: (path) => fsAccess(path, constants.R_OK | constants.W_OK),
|
|
24
22
|
};
|
|
23
|
+
const FLAT_FORM_HINT = 'For one replacement, send top-level strings: {"path": "...", "oldText": "...", "newText": "..."}';
|
|
24
|
+
function invalidEditArguments(problem, args) {
|
|
25
|
+
return new Error(`Validation failed for tool "edit":\n - ${problem}\n\nReceived arguments:\n${JSON.stringify(args, null, 2)}\n\n${FLAT_FORM_HINT}`);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Folds the flat form (top-level oldText/newText) into `edits`. Any other call is returned as it came,
|
|
29
|
+
* so the agent loop's validation, its coercions and extra fields reach hooks exactly as before. This
|
|
30
|
+
* runs that validation once first only to add the flat form to its error, which the model reads.
|
|
31
|
+
*/
|
|
25
32
|
function prepareEditArguments(input) {
|
|
26
|
-
|
|
27
|
-
return input;
|
|
28
|
-
}
|
|
33
|
+
// Untyped model input: the validator below checks it.
|
|
29
34
|
const args = input;
|
|
30
35
|
// Some models (Opus 4.6, GLM-5.1) send edits as a JSON string instead of an array
|
|
31
|
-
if (typeof args.edits === "string") {
|
|
36
|
+
if (args && typeof args === "object" && typeof args.edits === "string") {
|
|
32
37
|
try {
|
|
33
38
|
const parsed = JSON.parse(args.edits);
|
|
34
39
|
if (Array.isArray(parsed))
|
|
@@ -38,14 +43,25 @@ function prepareEditArguments(input) {
|
|
|
38
43
|
// Not JSON: leave the string so schema validation reports the bad edits argument.
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
let valid;
|
|
47
|
+
try {
|
|
48
|
+
valid = validateToolArguments({ name: "edit", description: "", parameters: editSchema }, { type: "toolCall", id: "", name: "edit", arguments: args });
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
throw new Error(`${error instanceof Error ? error.message : String(error)}\n\n${FLAT_FORM_HINT}`);
|
|
52
|
+
}
|
|
53
|
+
const { oldText, newText, edits, ...rest } = valid;
|
|
54
|
+
if (oldText === undefined && newText === undefined) {
|
|
55
|
+
if (edits === undefined)
|
|
56
|
+
throw invalidEditArguments("send oldText and newText, or edits", args);
|
|
43
57
|
return args;
|
|
44
58
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
if (edits !== undefined)
|
|
60
|
+
throw invalidEditArguments("send oldText and newText, or edits, not both", args);
|
|
61
|
+
if (oldText === undefined || newText === undefined) {
|
|
62
|
+
throw invalidEditArguments("send oldText and newText together", args);
|
|
63
|
+
}
|
|
64
|
+
return { ...rest, edits: [{ oldText, newText }] };
|
|
49
65
|
}
|
|
50
66
|
function validateEditInput(input) {
|
|
51
67
|
if (!Array.isArray(input.edits) || input.edits.length === 0) {
|
|
@@ -58,7 +74,7 @@ export function createEditToolDefinition(cwd, options) {
|
|
|
58
74
|
return {
|
|
59
75
|
name: "edit",
|
|
60
76
|
label: "edit",
|
|
61
|
-
description: "Edit a single file using exact text replacement.
|
|
77
|
+
description: "Edit a single file using exact text replacement. Pass either oldText and newText for one replacement, or edits[] for several replacements in the same file, not both. Every oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit. Do not include large unchanged regions just to connect distant changes.",
|
|
62
78
|
promptSnippet: "Make precise file edits with exact text replacement, including multiple disjoint edits in one call",
|
|
63
79
|
promptGuidelines: [
|
|
64
80
|
"Use edit for precise changes (edits[].oldText must match exactly)",
|
|
@@ -31,6 +31,10 @@ function getRenderablePreviewInput(args) {
|
|
|
31
31
|
if (!path) {
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
|
+
// The tool rejects a call that sends both forms, so it gets no preview.
|
|
35
|
+
if (args.edits !== undefined && (args.oldText !== undefined || args.newText !== undefined)) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
34
38
|
if (Array.isArray(args.edits) &&
|
|
35
39
|
args.edits.length > 0 &&
|
|
36
40
|
args.edits.every((edit) => typeof edit?.oldText === "string" && typeof edit?.newText === "string")) {
|
package/dist/node-runtime/{agent-session-services-UOVUJAX2.js → agent-session-services-ITD5IM37.js}
RENAMED
|
@@ -2,7 +2,7 @@ import { createRequire as __lunrRequire } from "node:module"; const require = __
|
|
|
2
2
|
import {
|
|
3
3
|
createAgentSessionFromServices,
|
|
4
4
|
createAgentSessionServices
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2HWXHS3B.js";
|
|
6
6
|
import "./chunk-QP4I6GEW.js";
|
|
7
7
|
import "./chunk-KDBQKVNZ.js";
|
|
8
8
|
import "./chunk-GLSX5WQB.js";
|
|
@@ -15,7 +15,7 @@ import "./chunk-6Z5EUITR.js";
|
|
|
15
15
|
import "./chunk-IXG6F4NT.js";
|
|
16
16
|
import "./chunk-CGBXPL3E.js";
|
|
17
17
|
import "./chunk-IMLLN6W5.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-4JOKLU3I.js";
|
|
19
19
|
import "./chunk-PGWSMQ4K.js";
|
|
20
20
|
import "./chunk-YSB6URMT.js";
|
|
21
21
|
import "./chunk-IAZSK7KK.js";
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
removeOnExit,
|
|
49
49
|
resolveChildRuntimePermissionMode,
|
|
50
50
|
wrapToolDefinition
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-4JOKLU3I.js";
|
|
52
52
|
import {
|
|
53
53
|
AutoReviewTracker,
|
|
54
54
|
SUBAGENT_CHILD_AUTO_REVIEW_ENV,
|
|
@@ -3622,7 +3622,7 @@ ${command}` : command, result = await executeBashWithOperations(resolvedCommand,
|
|
|
3622
3622
|
let [{ exportSessionToHtml }, { createToolHtmlRenderer }, { getBuiltinToolRenderer }] = await Promise.all([
|
|
3623
3623
|
import("./export-html-SW3CIZRJ.js"),
|
|
3624
3624
|
import("./tool-renderer-MV5O452K.js"),
|
|
3625
|
-
import("./tool-renderers-
|
|
3625
|
+
import("./tool-renderers-XZX7BEOM.js")
|
|
3626
3626
|
]), configuredThemeName = this.settingsManager.getTheme(), themeName = configuredThemeName && getThemeByName(configuredThemeName) ? configuredThemeName : void 0, toolRenderer = createToolHtmlRenderer({
|
|
3627
3627
|
// Built-in definitions carry no renderers; the export draws them as the TUI does.
|
|
3628
3628
|
getToolDefinition: (name) => {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
getBuiltinToolRenderer,
|
|
17
17
|
truncateToVisualLines
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QQSC6CTJ.js";
|
|
19
19
|
import {
|
|
20
20
|
copyToClipboard,
|
|
21
21
|
readClipboardText
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
peekRollbackTurnsConsumed,
|
|
61
61
|
rollbackLastTurn,
|
|
62
62
|
setRollbackWarningHandler
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-2HWXHS3B.js";
|
|
64
64
|
import {
|
|
65
65
|
notifyTodosEnabledChanged
|
|
66
66
|
} from "./chunk-KDBQKVNZ.js";
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
ensureTool,
|
|
82
82
|
getToolPath,
|
|
83
83
|
sweepStaleTempFiles
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-4JOKLU3I.js";
|
|
85
85
|
import {
|
|
86
86
|
convertToPng,
|
|
87
87
|
processImage
|
|
@@ -721,41 +721,56 @@ function createBashTool(cwd, options) {
|
|
|
721
721
|
}
|
|
722
722
|
|
|
723
723
|
// packages/coding-agent/dist/core/tools/edit.js
|
|
724
|
+
import { validateToolArguments } from "@ashx-j/lunr-ai";
|
|
724
725
|
import { constants as constants2 } from "fs";
|
|
725
726
|
import { access as fsAccess2, readFile as fsReadFile, writeFile as fsWriteFile } from "fs/promises";
|
|
726
727
|
import { Type as Type3 } from "typebox";
|
|
727
|
-
var replaceEditSchema = Type3.Object({
|
|
728
|
-
oldText: Type3.String({
|
|
729
|
-
description: "Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call."
|
|
730
|
-
}),
|
|
731
|
-
newText: Type3.String({ description: "Replacement text for this targeted edit." })
|
|
732
|
-
}, {}), editSchema = Type3.Object({
|
|
728
|
+
var replaceEditSchema = Type3.Object({ oldText: Type3.String(), newText: Type3.String() }), editSchema = Type3.Object({
|
|
733
729
|
path: Type3.String({ description: "Path to the file to edit (relative or absolute)" }),
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
})
|
|
730
|
+
oldText: Type3.Optional(Type3.String({ description: "Exact text to replace (one replacement)" })),
|
|
731
|
+
newText: Type3.Optional(Type3.String({ description: "Replacement for oldText" })),
|
|
732
|
+
edits: Type3.Optional(Type3.Array(replaceEditSchema, { description: "Several replacements, each matched against the original file" }))
|
|
737
733
|
}, {}), defaultEditOperations = {
|
|
738
734
|
readFile: (path3) => fsReadFile(path3),
|
|
739
735
|
writeFile: (path3, content) => fsWriteFile(path3, content, "utf-8"),
|
|
740
736
|
access: (path3) => fsAccess2(path3, constants2.R_OK | constants2.W_OK)
|
|
741
|
-
};
|
|
737
|
+
}, FLAT_FORM_HINT = 'For one replacement, send top-level strings: {"path": "...", "oldText": "...", "newText": "..."}';
|
|
738
|
+
function invalidEditArguments(problem, args) {
|
|
739
|
+
return new Error(`Validation failed for tool "edit":
|
|
740
|
+
- ${problem}
|
|
741
|
+
|
|
742
|
+
Received arguments:
|
|
743
|
+
${JSON.stringify(args, null, 2)}
|
|
744
|
+
|
|
745
|
+
${FLAT_FORM_HINT}`);
|
|
746
|
+
}
|
|
742
747
|
function prepareEditArguments(input) {
|
|
743
|
-
if (!input || typeof input != "object")
|
|
744
|
-
return input;
|
|
745
748
|
let args = input;
|
|
746
|
-
if (typeof args.edits == "string")
|
|
749
|
+
if (args && typeof args == "object" && typeof args.edits == "string")
|
|
747
750
|
try {
|
|
748
751
|
let parsed = JSON.parse(args.edits);
|
|
749
752
|
Array.isArray(parsed) && (args.edits = parsed);
|
|
750
753
|
} catch {
|
|
751
754
|
}
|
|
752
|
-
let
|
|
753
|
-
|
|
755
|
+
let valid;
|
|
756
|
+
try {
|
|
757
|
+
valid = validateToolArguments({ name: "edit", description: "", parameters: editSchema }, { type: "toolCall", id: "", name: "edit", arguments: args });
|
|
758
|
+
} catch (error) {
|
|
759
|
+
throw new Error(`${error instanceof Error ? error.message : String(error)}
|
|
760
|
+
|
|
761
|
+
${FLAT_FORM_HINT}`);
|
|
762
|
+
}
|
|
763
|
+
let { oldText, newText, edits, ...rest } = valid;
|
|
764
|
+
if (oldText === void 0 && newText === void 0) {
|
|
765
|
+
if (edits === void 0)
|
|
766
|
+
throw invalidEditArguments("send oldText and newText, or edits", args);
|
|
754
767
|
return args;
|
|
755
|
-
|
|
756
|
-
edits
|
|
757
|
-
|
|
758
|
-
|
|
768
|
+
}
|
|
769
|
+
if (edits !== void 0)
|
|
770
|
+
throw invalidEditArguments("send oldText and newText, or edits, not both", args);
|
|
771
|
+
if (oldText === void 0 || newText === void 0)
|
|
772
|
+
throw invalidEditArguments("send oldText and newText together", args);
|
|
773
|
+
return { ...rest, edits: [{ oldText, newText }] };
|
|
759
774
|
}
|
|
760
775
|
function validateEditInput(input) {
|
|
761
776
|
if (!Array.isArray(input.edits) || input.edits.length === 0)
|
|
@@ -767,7 +782,7 @@ function createEditToolDefinition(cwd, options) {
|
|
|
767
782
|
return {
|
|
768
783
|
name: "edit",
|
|
769
784
|
label: "edit",
|
|
770
|
-
description: "Edit a single file using exact text replacement.
|
|
785
|
+
description: "Edit a single file using exact text replacement. Pass either oldText and newText for one replacement, or edits[] for several replacements in the same file, not both. Every oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit. Do not include large unchanged regions just to connect distant changes.",
|
|
771
786
|
promptSnippet: "Make precise file edits with exact text replacement, including multiple disjoint edits in one call",
|
|
772
787
|
promptGuidelines: [
|
|
773
788
|
"Use edit for precise changes (edits[].oldText must match exactly)",
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
lightBuiltinExtensions,
|
|
8
8
|
loadAllBuiltinExtensions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WXC5RUA3.js";
|
|
10
10
|
import {
|
|
11
11
|
createStartupTui,
|
|
12
12
|
showStartupSelector,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
formatNoModelSelectedMessage,
|
|
28
28
|
formatNoModelsAvailableMessage,
|
|
29
29
|
getMissingSessionCwdIssue
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2HWXHS3B.js";
|
|
31
31
|
import {
|
|
32
32
|
restoreStdout,
|
|
33
33
|
takeOverStdout
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
import {
|
|
45
45
|
applyInheritedSubagentPermissions,
|
|
46
46
|
detectSupportedImageMimeTypeFromFile
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-4JOKLU3I.js";
|
|
48
48
|
import {
|
|
49
49
|
processImage
|
|
50
50
|
} from "./chunk-IAZSK7KK.js";
|
|
@@ -824,7 +824,7 @@ async function main(args, options) {
|
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
826
826
|
if (args[0] === "gateway") {
|
|
827
|
-
let { handleGatewayCommand } = await import("./command-
|
|
827
|
+
let { handleGatewayCommand } = await import("./command-ITCOAWXU.js");
|
|
828
828
|
if (await handleGatewayCommand(args))
|
|
829
829
|
return;
|
|
830
830
|
}
|
|
@@ -847,7 +847,7 @@ async function main(args, options) {
|
|
|
847
847
|
}
|
|
848
848
|
console.log(`Exported to: ${result}`), process.exit(0);
|
|
849
849
|
}
|
|
850
|
-
let appMode = resolveAppMode(parsed, process.stdin.isTTY, process.stdout.isTTY), startupBenchmark = isTruthyEnvFlag(process.env.PI_STARTUP_BENCHMARK), readsStdin = appMode !== "rpc" && !startupBenchmark, earlyStdin = options?.pipedStdin ?? (readsStdin && appMode !== "interactive" && !readsStdinBeforeTurn(parsed) ? readPipedStdin() : void 0), interactiveModeImport = appMode === "interactive" ? import("./interactive-mode-
|
|
850
|
+
let appMode = resolveAppMode(parsed, process.stdin.isTTY, process.stdout.isTTY), startupBenchmark = isTruthyEnvFlag(process.env.PI_STARTUP_BENCHMARK), readsStdin = appMode !== "rpc" && !startupBenchmark, earlyStdin = options?.pipedStdin ?? (readsStdin && appMode !== "interactive" && !readsStdinBeforeTurn(parsed) ? readPipedStdin() : void 0), interactiveModeImport = appMode === "interactive" ? import("./interactive-mode-OQ3N64DI.js") : void 0, startupView = appMode === "interactive" ? options?.startupView : void 0;
|
|
851
851
|
options?.startupView && !startupView && options.startupView.stop(), applyInheritedSubagentPermissions(), appMode !== "interactive" && !isPlainRuntimeMetadataCommand(parsed) && takeOverStdout(), parsed.mode === "rpc" && parsed.fileArgs.length > 0 && (console.error(chalk4.red("Error: @file arguments are not supported in RPC mode")), process.exit(1)), validateForkFlags(parsed), validateSessionIdFlags(parsed);
|
|
852
852
|
let { migratedAuthProviders: migratedProviders, deprecationWarnings } = runMigrations(cwd);
|
|
853
853
|
time("runMigrations");
|
|
@@ -1038,7 +1038,7 @@ ${EXTENSION_LOAD_FAILURE_HINT}` : "";
|
|
|
1038
1038
|
} else if (appMode === "interactive") {
|
|
1039
1039
|
let [{ InteractiveMode }, { loadDeferredBuiltinExtensions }] = await Promise.all([
|
|
1040
1040
|
interactiveModeImport,
|
|
1041
|
-
import("./builtin-extensions-
|
|
1041
|
+
import("./builtin-extensions-XXQB5IKI.js")
|
|
1042
1042
|
]), interactiveMode = new InteractiveMode(runtime, {
|
|
1043
1043
|
migratedProviders,
|
|
1044
1044
|
modelFallbackMessage,
|
|
@@ -1061,7 +1061,7 @@ ${EXTENSION_LOAD_FAILURE_HINT}` : "";
|
|
|
1061
1061
|
}
|
|
1062
1062
|
await interactiveMode.init(), time("interactiveMode.init"), process.stderr.isTTY ? process.once("exit", printTimings) : printTimings(), await interactiveMode.run();
|
|
1063
1063
|
} else {
|
|
1064
|
-
let { runPrintMode } = await import("./print-mode-
|
|
1064
|
+
let { runPrintMode } = await import("./print-mode-LQS3GH3Y.js");
|
|
1065
1065
|
printTimings();
|
|
1066
1066
|
let exitCode = await runPrintMode(runtime, {
|
|
1067
1067
|
mode: toPrintOutputMode(appMode),
|
|
@@ -1324,12 +1324,12 @@ async function shutdownBridgeSession(session, reason, targetSessionFile) {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
async function defaultSessionFactory(key, reopen) {
|
|
1326
1326
|
let ui = createGatewayUI(key), [{ loadAllBuiltinExtensions }, { getAgentDir: getAgentDir2 }, { registerCustomizeBridge }, { registerMemoryCapBridge }, { registerModelTierBridge }, { createAgentSessionFromServices, createAgentSessionServices }, { SessionManager: SessionManager2 }, { SettingsManager }, { bindRuntimeBridges }] = await Promise.all([
|
|
1327
|
-
import("./builtin-extensions-
|
|
1327
|
+
import("./builtin-extensions-XXQB5IKI.js"),
|
|
1328
1328
|
import("./config-VE6BFU75.js"),
|
|
1329
1329
|
import("./customize-ZR4EB43D.js"),
|
|
1330
1330
|
import("./memory-cap-AT2WMZQY.js"),
|
|
1331
1331
|
import("./model-tiers-RMCC6X6R.js"),
|
|
1332
|
-
import("./agent-session-services-
|
|
1332
|
+
import("./agent-session-services-ITD5IM37.js"),
|
|
1333
1333
|
import("./session-manager-I6535F4R.js"),
|
|
1334
1334
|
import("./settings-manager-POAEKXK4.js"),
|
|
1335
1335
|
import("./runtime-bridges-N3J2AYYF.js")
|
|
@@ -1766,12 +1766,12 @@ function extractUserText(message) {
|
|
|
1766
1766
|
var deliveryBridge = globalBridge(/* @__PURE__ */ Symbol.for("@lunr/cron-delivery"));
|
|
1767
1767
|
async function defaultCronSessionFactory(job, modelOverride) {
|
|
1768
1768
|
let [{ loadAllBuiltinExtensions }, { getAgentDir: getAgentDir2 }, { registerCustomizeBridge }, { registerMemoryCapBridge }, { registerModelTierBridge }, { createAgentSessionFromServices, createAgentSessionServices }, { SessionManager: SessionManager2 }, { SettingsManager }, { bindRuntimeBridges }] = await Promise.all([
|
|
1769
|
-
import("./builtin-extensions-
|
|
1769
|
+
import("./builtin-extensions-XXQB5IKI.js"),
|
|
1770
1770
|
import("./config-VE6BFU75.js"),
|
|
1771
1771
|
import("./customize-ZR4EB43D.js"),
|
|
1772
1772
|
import("./memory-cap-AT2WMZQY.js"),
|
|
1773
1773
|
import("./model-tiers-RMCC6X6R.js"),
|
|
1774
|
-
import("./agent-session-services-
|
|
1774
|
+
import("./agent-session-services-ITD5IM37.js"),
|
|
1775
1775
|
import("./session-manager-I6535F4R.js"),
|
|
1776
1776
|
import("./settings-manager-POAEKXK4.js"),
|
|
1777
1777
|
import("./runtime-bridges-N3J2AYYF.js")
|
|
@@ -233,7 +233,7 @@ function getRenderablePreviewInput(args) {
|
|
|
233
233
|
if (!args)
|
|
234
234
|
return null;
|
|
235
235
|
let path = typeof args.path == "string" ? args.path : typeof args.file_path == "string" ? args.file_path : null;
|
|
236
|
-
return path ? Array.isArray(args.edits) && args.edits.length > 0 && args.edits.every((edit) => typeof edit?.oldText == "string" && typeof edit?.newText == "string") ? { path, edits: args.edits } : typeof args.oldText == "string" && typeof args.newText == "string" ? { path, edits: [{ oldText: args.oldText, newText: args.newText }] } : null
|
|
236
|
+
return !path || args.edits !== void 0 && (args.oldText !== void 0 || args.newText !== void 0) ? null : Array.isArray(args.edits) && args.edits.length > 0 && args.edits.every((edit) => typeof edit?.oldText == "string" && typeof edit?.newText == "string") ? { path, edits: args.edits } : typeof args.oldText == "string" && typeof args.newText == "string" ? { path, edits: [{ oldText: args.oldText, newText: args.newText }] } : null;
|
|
237
237
|
}
|
|
238
238
|
function formatEditCall(args, theme2, cwd, compact = !1) {
|
|
239
239
|
let rawPath = str(args?.file_path ?? args?.path);
|
|
@@ -979,11 +979,11 @@ var lightBuiltinExtensions = [
|
|
|
979
979
|
], DEFERRED_BUILTIN_LOADERS = [
|
|
980
980
|
{ name: "pi-ollama-cloud", load: () => import("./pi-ollama-cloud-2KQAFVBI.js") },
|
|
981
981
|
{ name: "narumiruna-pi-goal", load: () => import("./goal-CVGA3XFI.js") },
|
|
982
|
-
{ name: "lunr-cron", load: () => import("./lunr-cron-
|
|
982
|
+
{ name: "lunr-cron", load: () => import("./lunr-cron-UKWWRJXT.js") },
|
|
983
983
|
{ name: "lunr-pr-watch", load: () => import("./lunr-pr-watch-C7Q3TFT6.js") },
|
|
984
984
|
{ name: "pi-intercom", load: () => import("./pi-intercom-ZRDKISVO.js") },
|
|
985
985
|
{ name: "pi-prompt-template-model", load: () => import("./pi-prompt-template-model-UL2T2HLL.js") },
|
|
986
|
-
{ name: "pi-subagents", load: () => import("./pi-subagents-
|
|
986
|
+
{ name: "pi-subagents", load: () => import("./pi-subagents-2ZE5BKGM.js") },
|
|
987
987
|
{ name: "pi-web-access", load: () => import("./pi-web-access-3LE56I3G.js") },
|
|
988
988
|
{ name: "lunr-browser", load: () => import("./lunr-browser-3CVKQBIJ.js") },
|
|
989
989
|
{ name: "pi-lsp-extension", load: () => import("./src-J6FSKIFT.js") },
|
|
@@ -32,7 +32,7 @@ lunr gateway autostart off|login|boot
|
|
|
32
32
|
lunr gateway pair approve <platform> <code> [--owner]
|
|
33
33
|
lunr gateway pair list`);
|
|
34
34
|
else {
|
|
35
|
-
let { runGateway } = await import("./gateway-
|
|
35
|
+
let { runGateway } = await import("./gateway-PVL3CM65.js");
|
|
36
36
|
process.exitCode = await runGateway(sub === "run" ? args.slice(2) : args.slice(1));
|
|
37
37
|
}
|
|
38
38
|
} catch (error) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
runPrintMode
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OZAOEWH2.js";
|
|
5
5
|
import {
|
|
6
6
|
AssistantMessageComponent,
|
|
7
7
|
BashExecutionComponent,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
TreeSelectorComponent,
|
|
21
21
|
UserMessageComponent,
|
|
22
22
|
UserMessageSelectorComponent
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2XLJRAYG.js";
|
|
24
24
|
import "./chunk-JDIZKHWA.js";
|
|
25
25
|
import "./chunk-VCVGJLQA.js";
|
|
26
26
|
import {
|
|
@@ -37,7 +37,7 @@ import "./chunk-X6LRALCV.js";
|
|
|
37
37
|
import {
|
|
38
38
|
renderDiff,
|
|
39
39
|
truncateToVisualLines
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-QQSC6CTJ.js";
|
|
41
41
|
import {
|
|
42
42
|
copyToClipboard
|
|
43
43
|
} from "./chunk-2X4MTTY2.js";
|
|
@@ -46,9 +46,9 @@ import "./chunk-3RR3PVJB.js";
|
|
|
46
46
|
import "./chunk-UWYPDXMG.js";
|
|
47
47
|
import {
|
|
48
48
|
main
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-AYHDHGIW.js";
|
|
50
50
|
import "./chunk-KETNCBTB.js";
|
|
51
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-WXC5RUA3.js";
|
|
52
52
|
import "./chunk-PDQLKTGM.js";
|
|
53
53
|
import "./chunk-LY6VVOF4.js";
|
|
54
54
|
import "./chunk-PKDES47T.js";
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
parseSkillBlock,
|
|
66
66
|
wrapRegisteredTool,
|
|
67
67
|
wrapRegisteredTools
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-2HWXHS3B.js";
|
|
69
69
|
import {
|
|
70
70
|
DefaultResourceLoader,
|
|
71
71
|
createEventBus,
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
createReadToolDefinition,
|
|
131
131
|
createWriteTool,
|
|
132
132
|
createWriteToolDefinition
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-4JOKLU3I.js";
|
|
134
134
|
import "./chunk-PGWSMQ4K.js";
|
|
135
135
|
import {
|
|
136
136
|
withFileMutationQueue
|
|
@@ -2,19 +2,19 @@ import { createRequire as __lunrRequire } from "node:module"; const require = __
|
|
|
2
2
|
import {
|
|
3
3
|
InteractiveMode,
|
|
4
4
|
startInteractiveToolInstalls
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2XLJRAYG.js";
|
|
6
6
|
import "./chunk-JDIZKHWA.js";
|
|
7
7
|
import "./chunk-VCVGJLQA.js";
|
|
8
8
|
import "./chunk-GX7UZDSI.js";
|
|
9
9
|
import "./chunk-US544NN6.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-QQSC6CTJ.js";
|
|
11
11
|
import "./chunk-2X4MTTY2.js";
|
|
12
12
|
import "./chunk-NUIFPZWX.js";
|
|
13
13
|
import "./chunk-3RR3PVJB.js";
|
|
14
14
|
import "./chunk-UWYPDXMG.js";
|
|
15
15
|
import "./chunk-PDQLKTGM.js";
|
|
16
16
|
import "./chunk-5ZH3ZFIZ.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-2HWXHS3B.js";
|
|
18
18
|
import "./chunk-QP4I6GEW.js";
|
|
19
19
|
import "./chunk-KDBQKVNZ.js";
|
|
20
20
|
import "./chunk-GLSX5WQB.js";
|
|
@@ -27,7 +27,7 @@ import "./chunk-6Z5EUITR.js";
|
|
|
27
27
|
import "./chunk-IXG6F4NT.js";
|
|
28
28
|
import "./chunk-CGBXPL3E.js";
|
|
29
29
|
import "./chunk-IMLLN6W5.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-4JOKLU3I.js";
|
|
31
31
|
import "./chunk-PGWSMQ4K.js";
|
|
32
32
|
import "./chunk-YSB6URMT.js";
|
|
33
33
|
import "./chunk-IAZSK7KK.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
main
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AYHDHGIW.js";
|
|
5
5
|
import "./chunk-KETNCBTB.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-WXC5RUA3.js";
|
|
7
7
|
import "./chunk-PDQLKTGM.js";
|
|
8
8
|
import "./chunk-LY6VVOF4.js";
|
|
9
9
|
import "./chunk-PKDES47T.js";
|
|
10
10
|
import "./chunk-TYHNGMLA.js";
|
|
11
11
|
import "./chunk-5ZH3ZFIZ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-2HWXHS3B.js";
|
|
13
13
|
import "./chunk-QP4I6GEW.js";
|
|
14
14
|
import "./chunk-KDBQKVNZ.js";
|
|
15
15
|
import "./chunk-GLSX5WQB.js";
|
|
@@ -22,7 +22,7 @@ import "./chunk-6Z5EUITR.js";
|
|
|
22
22
|
import "./chunk-IXG6F4NT.js";
|
|
23
23
|
import "./chunk-CGBXPL3E.js";
|
|
24
24
|
import "./chunk-IMLLN6W5.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-4JOKLU3I.js";
|
|
26
26
|
import "./chunk-PGWSMQ4K.js";
|
|
27
27
|
import "./chunk-YSB6URMT.js";
|
|
28
28
|
import "./chunk-IAZSK7KK.js";
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
validateExecutionAcceptance,
|
|
74
74
|
validateToolBudgetConfig,
|
|
75
75
|
writeAtomicJson
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-JCL5IRM5.js";
|
|
77
77
|
import {
|
|
78
78
|
ASYNC_DIR,
|
|
79
79
|
DEFAULT_ARTIFACT_CONFIG,
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
createSubagentCancellation,
|
|
122
122
|
registerSubagentCancellation
|
|
123
123
|
} from "./chunk-IMLLN6W5.js";
|
|
124
|
-
import "./chunk-
|
|
124
|
+
import "./chunk-4JOKLU3I.js";
|
|
125
125
|
import "./chunk-PGWSMQ4K.js";
|
|
126
126
|
import "./chunk-YSB6URMT.js";
|
|
127
127
|
import "./chunk-IAZSK7KK.js";
|
|
@@ -6444,7 +6444,7 @@ function registerSubagentExtension(pi) {
|
|
|
6444
6444
|
try {
|
|
6445
6445
|
let currentGeneration = generation;
|
|
6446
6446
|
if (signal?.throwIfAborted(), !executorPromise) {
|
|
6447
|
-
let pending = import("./subagent-executor-
|
|
6447
|
+
let pending = import("./subagent-executor-LXYQ3RES.js").then(({ createSubagentExecutor }) => {
|
|
6448
6448
|
if (generation !== currentGeneration)
|
|
6449
6449
|
throw new Error("Subagent session changed before initialization");
|
|
6450
6450
|
return createSubagentExecutor({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
runPrintMode
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OZAOEWH2.js";
|
|
5
5
|
import "./chunk-JDIZKHWA.js";
|
|
6
6
|
import "./chunk-U5F4IC7R.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-2HWXHS3B.js";
|
|
8
8
|
import "./chunk-QP4I6GEW.js";
|
|
9
9
|
import "./chunk-KDBQKVNZ.js";
|
|
10
10
|
import "./chunk-GLSX5WQB.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-6Z5EUITR.js";
|
|
|
17
17
|
import "./chunk-IXG6F4NT.js";
|
|
18
18
|
import "./chunk-CGBXPL3E.js";
|
|
19
19
|
import "./chunk-IMLLN6W5.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-4JOKLU3I.js";
|
|
21
21
|
import "./chunk-PGWSMQ4K.js";
|
|
22
22
|
import "./chunk-YSB6URMT.js";
|
|
23
23
|
import "./chunk-IAZSK7KK.js";
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
main
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AYHDHGIW.js";
|
|
6
6
|
import "./chunk-KETNCBTB.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-WXC5RUA3.js";
|
|
8
8
|
import "./chunk-PDQLKTGM.js";
|
|
9
9
|
import "./chunk-LY6VVOF4.js";
|
|
10
10
|
import "./chunk-PKDES47T.js";
|
|
11
11
|
import "./chunk-TYHNGMLA.js";
|
|
12
12
|
import "./chunk-5ZH3ZFIZ.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-2HWXHS3B.js";
|
|
14
14
|
import "./chunk-QP4I6GEW.js";
|
|
15
15
|
import "./chunk-KDBQKVNZ.js";
|
|
16
16
|
import "./chunk-GLSX5WQB.js";
|
|
@@ -23,7 +23,7 @@ import "./chunk-6Z5EUITR.js";
|
|
|
23
23
|
import "./chunk-IXG6F4NT.js";
|
|
24
24
|
import "./chunk-CGBXPL3E.js";
|
|
25
25
|
import "./chunk-IMLLN6W5.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-4JOKLU3I.js";
|
|
27
27
|
import "./chunk-PGWSMQ4K.js";
|
|
28
28
|
import "./chunk-YSB6URMT.js";
|
|
29
29
|
import "./chunk-IAZSK7KK.js";
|
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
writeNestedControlRequest,
|
|
145
145
|
writeNestedEvent,
|
|
146
146
|
writePrivateAtomicJson
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-JCL5IRM5.js";
|
|
148
148
|
import {
|
|
149
149
|
ASYNC_DIR,
|
|
150
150
|
CHAIN_RUNS_DIR,
|
|
@@ -200,7 +200,7 @@ import {
|
|
|
200
200
|
removeOnExit,
|
|
201
201
|
resolveChildPermissions,
|
|
202
202
|
snapshotParentPermissionMode
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-4JOKLU3I.js";
|
|
204
204
|
import {
|
|
205
205
|
snapshotParentAutoReview
|
|
206
206
|
} from "./chunk-PGWSMQ4K.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getBuiltinToolRenderer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QQSC6CTJ.js";
|
|
5
5
|
import "./chunk-4SBPXNVV.js";
|
|
6
6
|
import "./chunk-53YJI7JU.js";
|
|
7
7
|
import "./chunk-SJVCEPQS.js";
|
package/docs/extensions.md
CHANGED
|
@@ -1912,7 +1912,7 @@ async execute(toolCallId, params) {
|
|
|
1912
1912
|
|
|
1913
1913
|
**Argument preparation:** `prepareArguments(args)` is optional. If defined, it runs before schema validation and before `execute()`. Use it to mimic an older accepted input shape when lunR resumes an older session whose stored tool call arguments no longer match the current schema. Return the object you want validated against `parameters`. Keep the public schema strict. Do not add deprecated compatibility fields to `parameters` just to keep old resumed sessions working.
|
|
1914
1914
|
|
|
1915
|
-
Example: an older session may contain
|
|
1915
|
+
Example: an older session may contain a call to your own `edit` tool with top-level `oldText` and `newText`, while your current schema only accepts `edits: [{ oldText, newText }]`.
|
|
1916
1916
|
|
|
1917
1917
|
```typescript
|
|
1918
1918
|
pi.registerTool({
|
|
@@ -1976,6 +1976,8 @@ See [examples/extensions/tool-override.ts](../examples/extensions/tool-override.
|
|
|
1976
1976
|
|
|
1977
1977
|
**Rendering:** Built-in renderer inheritance is resolved per slot. Execution override and rendering override are independent. If your override omits `renderCall`, the built-in `renderCall` is used. If your override omits `renderResult`, the built-in `renderResult` is used. If your override omits both, the built-in renderer is used automatically (syntax highlighting, diffs, etc.). This lets you wrap built-in tools for logging or access control without reimplementing the UI.
|
|
1978
1978
|
|
|
1979
|
+
An override of `edit` that reuses the built-in `parameters` must also pass the built-in `prepareArguments`. It folds the flat `oldText`/`newText` form into `edits`, and without it a flat call reaches `execute` with no `edits`.
|
|
1980
|
+
|
|
1979
1981
|
**Your implementation must match the exact result shape**, including the `details` type. The UI and session logic depend on these shapes for rendering and state tracking.
|
|
1980
1982
|
|
|
1981
1983
|
Built-in tool implementations:
|
|
@@ -157,6 +157,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
157
157
|
label: "edit",
|
|
158
158
|
description: originalEdit.description,
|
|
159
159
|
parameters: originalEdit.parameters,
|
|
160
|
+
// Folds the flat oldText/newText form into edits before execute sees it.
|
|
161
|
+
prepareArguments: originalEdit.prepareArguments,
|
|
160
162
|
renderShell: "self",
|
|
161
163
|
|
|
162
164
|
async execute(toolCallId, params, signal, onUpdate) {
|
|
@@ -212,6 +212,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
212
212
|
description:
|
|
213
213
|
"Edit a file by replacing exact text. The oldText must match exactly (including whitespace). Use this for precise, surgical edits.",
|
|
214
214
|
parameters: getBuiltInTools(process.cwd()).edit.parameters,
|
|
215
|
+
// Folds the flat oldText/newText form into edits before execute sees it.
|
|
216
|
+
prepareArguments: getBuiltInTools(process.cwd()).edit.prepareArguments,
|
|
215
217
|
|
|
216
218
|
async execute(toolCallId, params, signal, onUpdate, ctx) {
|
|
217
219
|
const tools = getBuiltInTools(ctx.cwd);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashx-j/lunr-dev-install",
|
|
3
|
-
"version": "0.2.40-dev.
|
|
3
|
+
"version": "0.2.40-dev.61.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@ashx-j/lunr-dev-install",
|
|
9
|
-
"version": "0.2.40-dev.
|
|
9
|
+
"version": "0.2.40-dev.61.1",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@ashx-j/lunr-dev": "0.2.40-dev.
|
|
11
|
+
"@ashx-j/lunr-dev": "0.2.40-dev.61.1"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=22.19.0"
|
|
@@ -598,11 +598,11 @@
|
|
|
598
598
|
}
|
|
599
599
|
},
|
|
600
600
|
"node_modules/@ashx-j/lunr-agent": {
|
|
601
|
-
"version": "0.2.40-dev.
|
|
602
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-agent/-/lunr-agent-0.2.40-dev.
|
|
601
|
+
"version": "0.2.40-dev.61.1",
|
|
602
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-agent/-/lunr-agent-0.2.40-dev.61.1.tgz",
|
|
603
603
|
"license": "MIT",
|
|
604
604
|
"dependencies": {
|
|
605
|
-
"@ashx-j/lunr-ai": "0.2.40-dev.
|
|
605
|
+
"@ashx-j/lunr-ai": "0.2.40-dev.61.1",
|
|
606
606
|
"typebox": "1.1.38"
|
|
607
607
|
},
|
|
608
608
|
"engines": {
|
|
@@ -610,8 +610,8 @@
|
|
|
610
610
|
}
|
|
611
611
|
},
|
|
612
612
|
"node_modules/@ashx-j/lunr-ai": {
|
|
613
|
-
"version": "0.2.40-dev.
|
|
614
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-ai/-/lunr-ai-0.2.40-dev.
|
|
613
|
+
"version": "0.2.40-dev.61.1",
|
|
614
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-ai/-/lunr-ai-0.2.40-dev.61.1.tgz",
|
|
615
615
|
"license": "MIT",
|
|
616
616
|
"dependencies": {
|
|
617
617
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -634,14 +634,14 @@
|
|
|
634
634
|
}
|
|
635
635
|
},
|
|
636
636
|
"node_modules/@ashx-j/lunr-dev": {
|
|
637
|
-
"version": "0.2.40-dev.
|
|
638
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-dev/-/lunr-dev-0.2.40-dev.
|
|
637
|
+
"version": "0.2.40-dev.61.1",
|
|
638
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-dev/-/lunr-dev-0.2.40-dev.61.1.tgz",
|
|
639
639
|
"license": "MIT",
|
|
640
640
|
"dependencies": {
|
|
641
641
|
"@agentclientprotocol/sdk": "0.26.0",
|
|
642
|
-
"@ashx-j/lunr-agent": "0.2.40-dev.
|
|
643
|
-
"@ashx-j/lunr-ai": "0.2.40-dev.
|
|
644
|
-
"@ashx-j/lunr-tui": "0.2.40-dev.
|
|
642
|
+
"@ashx-j/lunr-agent": "0.2.40-dev.61.1",
|
|
643
|
+
"@ashx-j/lunr-ai": "0.2.40-dev.61.1",
|
|
644
|
+
"@ashx-j/lunr-tui": "0.2.40-dev.61.1",
|
|
645
645
|
"@modelcontextprotocol/ext-apps": "1.7.4",
|
|
646
646
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
647
647
|
"@mozilla/readability": "0.6.0",
|
|
@@ -677,9 +677,9 @@
|
|
|
677
677
|
},
|
|
678
678
|
"optionalDependencies": {
|
|
679
679
|
"@mariozechner/clipboard": "0.3.9",
|
|
680
|
-
"@ashx-j/lunr-computer-win32-x64": "0.2.40-dev.
|
|
681
|
-
"@ashx-j/lunr-computer-win32-arm64": "0.2.40-dev.
|
|
682
|
-
"@ashx-j/lunr-computer-darwin-arm64": "0.2.40-dev.
|
|
680
|
+
"@ashx-j/lunr-computer-win32-x64": "0.2.40-dev.61.1",
|
|
681
|
+
"@ashx-j/lunr-computer-win32-arm64": "0.2.40-dev.61.1",
|
|
682
|
+
"@ashx-j/lunr-computer-darwin-arm64": "0.2.40-dev.61.1"
|
|
683
683
|
},
|
|
684
684
|
"bin": {
|
|
685
685
|
"lunr-dev": "dist/dev-cli.js"
|
|
@@ -699,8 +699,8 @@
|
|
|
699
699
|
}
|
|
700
700
|
},
|
|
701
701
|
"node_modules/@ashx-j/lunr-tui": {
|
|
702
|
-
"version": "0.2.40-dev.
|
|
703
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-tui/-/lunr-tui-0.2.40-dev.
|
|
702
|
+
"version": "0.2.40-dev.61.1",
|
|
703
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-tui/-/lunr-tui-0.2.40-dev.61.1.tgz",
|
|
704
704
|
"license": "MIT",
|
|
705
705
|
"dependencies": {
|
|
706
706
|
"get-east-asian-width": "1.6.0",
|
|
@@ -3694,8 +3694,8 @@
|
|
|
3694
3694
|
}
|
|
3695
3695
|
},
|
|
3696
3696
|
"node_modules/@ashx-j/lunr-computer-win32-x64": {
|
|
3697
|
-
"version": "0.2.40-dev.
|
|
3698
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-computer-win32-x64/-/lunr-computer-win32-x64-0.2.40-dev.
|
|
3697
|
+
"version": "0.2.40-dev.61.1",
|
|
3698
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-computer-win32-x64/-/lunr-computer-win32-x64-0.2.40-dev.61.1.tgz",
|
|
3699
3699
|
"license": "MIT",
|
|
3700
3700
|
"optional": true,
|
|
3701
3701
|
"os": [
|
|
@@ -3706,8 +3706,8 @@
|
|
|
3706
3706
|
]
|
|
3707
3707
|
},
|
|
3708
3708
|
"node_modules/@ashx-j/lunr-computer-win32-arm64": {
|
|
3709
|
-
"version": "0.2.40-dev.
|
|
3710
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-computer-win32-arm64/-/lunr-computer-win32-arm64-0.2.40-dev.
|
|
3709
|
+
"version": "0.2.40-dev.61.1",
|
|
3710
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-computer-win32-arm64/-/lunr-computer-win32-arm64-0.2.40-dev.61.1.tgz",
|
|
3711
3711
|
"license": "MIT",
|
|
3712
3712
|
"optional": true,
|
|
3713
3713
|
"os": [
|
|
@@ -3718,8 +3718,8 @@
|
|
|
3718
3718
|
]
|
|
3719
3719
|
},
|
|
3720
3720
|
"node_modules/@ashx-j/lunr-computer-darwin-arm64": {
|
|
3721
|
-
"version": "0.2.40-dev.
|
|
3722
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-computer-darwin-arm64/-/lunr-computer-darwin-arm64-0.2.40-dev.
|
|
3721
|
+
"version": "0.2.40-dev.61.1",
|
|
3722
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-computer-darwin-arm64/-/lunr-computer-darwin-arm64-0.2.40-dev.61.1.tgz",
|
|
3723
3723
|
"license": "MIT",
|
|
3724
3724
|
"optional": true,
|
|
3725
3725
|
"os": [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashx-j/lunr-dev-install",
|
|
3
|
-
"version": "0.2.40-dev.
|
|
3
|
+
"version": "0.2.40-dev.61.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Lockfile root used by the Pi installer and updater.",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@ashx-j/lunr-dev": "0.2.40-dev.
|
|
7
|
+
"@ashx-j/lunr-dev": "0.2.40-dev.61.1"
|
|
8
8
|
},
|
|
9
9
|
"overrides": {
|
|
10
10
|
"rimraf": "6.1.2",
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashx-j/lunr-dev",
|
|
3
|
-
"version": "0.2.40-dev.
|
|
3
|
+
"version": "0.2.40-dev.61.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@ashx-j/lunr-dev",
|
|
9
|
-
"version": "0.2.40-dev.
|
|
9
|
+
"version": "0.2.40-dev.61.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@agentclientprotocol/sdk": "0.26.0",
|
|
13
|
-
"@ashx-j/lunr-agent": "0.2.40-dev.
|
|
14
|
-
"@ashx-j/lunr-ai": "0.2.40-dev.
|
|
15
|
-
"@ashx-j/lunr-tui": "0.2.40-dev.
|
|
13
|
+
"@ashx-j/lunr-agent": "0.2.40-dev.61.1",
|
|
14
|
+
"@ashx-j/lunr-ai": "0.2.40-dev.61.1",
|
|
15
|
+
"@ashx-j/lunr-tui": "0.2.40-dev.61.1",
|
|
16
16
|
"@modelcontextprotocol/ext-apps": "1.7.4",
|
|
17
17
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
18
18
|
"@mozilla/readability": "0.6.0",
|
|
@@ -650,11 +650,11 @@
|
|
|
650
650
|
}
|
|
651
651
|
},
|
|
652
652
|
"node_modules/@ashx-j/lunr-agent": {
|
|
653
|
-
"version": "0.2.40-dev.
|
|
654
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-agent/-/lunr-agent-0.2.40-dev.
|
|
653
|
+
"version": "0.2.40-dev.61.1",
|
|
654
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-agent/-/lunr-agent-0.2.40-dev.61.1.tgz",
|
|
655
655
|
"license": "MIT",
|
|
656
656
|
"dependencies": {
|
|
657
|
-
"@ashx-j/lunr-ai": "0.2.40-dev.
|
|
657
|
+
"@ashx-j/lunr-ai": "0.2.40-dev.61.1",
|
|
658
658
|
"typebox": "1.1.38"
|
|
659
659
|
},
|
|
660
660
|
"engines": {
|
|
@@ -662,8 +662,8 @@
|
|
|
662
662
|
}
|
|
663
663
|
},
|
|
664
664
|
"node_modules/@ashx-j/lunr-ai": {
|
|
665
|
-
"version": "0.2.40-dev.
|
|
666
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-ai/-/lunr-ai-0.2.40-dev.
|
|
665
|
+
"version": "0.2.40-dev.61.1",
|
|
666
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-ai/-/lunr-ai-0.2.40-dev.61.1.tgz",
|
|
667
667
|
"license": "MIT",
|
|
668
668
|
"dependencies": {
|
|
669
669
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -686,8 +686,8 @@
|
|
|
686
686
|
}
|
|
687
687
|
},
|
|
688
688
|
"node_modules/@ashx-j/lunr-tui": {
|
|
689
|
-
"version": "0.2.40-dev.
|
|
690
|
-
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-tui/-/lunr-tui-0.2.40-dev.
|
|
689
|
+
"version": "0.2.40-dev.61.1",
|
|
690
|
+
"resolved": "https://registry.npmjs.org/@ashx-j/lunr-tui/-/lunr-tui-0.2.40-dev.61.1.tgz",
|
|
691
691
|
"license": "MIT",
|
|
692
692
|
"dependencies": {
|
|
693
693
|
"get-east-asian-width": "1.6.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashx-j/lunr-dev",
|
|
3
|
-
"version": "0.2.40-dev.
|
|
3
|
+
"version": "0.2.40-dev.61.1",
|
|
4
4
|
"description": "Terminal coding agent with subagents, MCP, permission modes, scheduled prompts and a Telegram/Discord bot",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@agentclientprotocol/sdk": "0.26.0",
|
|
52
|
-
"@ashx-j/lunr-agent": "0.2.40-dev.
|
|
53
|
-
"@ashx-j/lunr-ai": "0.2.40-dev.
|
|
54
|
-
"@ashx-j/lunr-tui": "0.2.40-dev.
|
|
52
|
+
"@ashx-j/lunr-agent": "0.2.40-dev.61.1",
|
|
53
|
+
"@ashx-j/lunr-ai": "0.2.40-dev.61.1",
|
|
54
|
+
"@ashx-j/lunr-tui": "0.2.40-dev.61.1",
|
|
55
55
|
"@modelcontextprotocol/ext-apps": "1.7.4",
|
|
56
56
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
57
57
|
"@mozilla/readability": "0.6.0",
|