@cnwenf/occ 2.1.270 → 2.1.271
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/cli.js +335 -317
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
globalThis.MACRO={"VERSION":"2.1.
|
|
2
|
+
globalThis.MACRO={"VERSION":"2.1.271","BUILD_TIME":"2026-07-16T13:29:55.180Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
|
|
3
3
|
// @bun
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -377369,6 +377369,243 @@ var init_UI4 = __esm(() => {
|
|
|
377369
377369
|
jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
|
|
377370
377370
|
});
|
|
377371
377371
|
|
|
377372
|
+
// src/tools/GlobTool/UI.tsx
|
|
377373
|
+
function userFacingName4() {
|
|
377374
|
+
return "Search";
|
|
377375
|
+
}
|
|
377376
|
+
function renderToolUseMessage5({
|
|
377377
|
+
pattern,
|
|
377378
|
+
path: path21
|
|
377379
|
+
}, {
|
|
377380
|
+
verbose
|
|
377381
|
+
}) {
|
|
377382
|
+
if (!pattern) {
|
|
377383
|
+
return null;
|
|
377384
|
+
}
|
|
377385
|
+
if (!path21) {
|
|
377386
|
+
return `pattern: "${pattern}"`;
|
|
377387
|
+
}
|
|
377388
|
+
return `pattern: "${pattern}", path: "${verbose ? path21 : getDisplayPath(path21)}"`;
|
|
377389
|
+
}
|
|
377390
|
+
function renderToolUseErrorMessage5(result, {
|
|
377391
|
+
verbose
|
|
377392
|
+
}) {
|
|
377393
|
+
if (!verbose && typeof result === "string" && extractTag(result, "tool_use_error")) {
|
|
377394
|
+
const errorMessage2 = extractTag(result, "tool_use_error");
|
|
377395
|
+
if (errorMessage2?.includes(FILE_NOT_FOUND_CWD_NOTE)) {
|
|
377396
|
+
return /* @__PURE__ */ jsx_runtime45.jsx(MessageResponse, {
|
|
377397
|
+
children: /* @__PURE__ */ jsx_runtime45.jsx(ThemedText, {
|
|
377398
|
+
color: "error",
|
|
377399
|
+
children: "File not found"
|
|
377400
|
+
})
|
|
377401
|
+
});
|
|
377402
|
+
}
|
|
377403
|
+
return /* @__PURE__ */ jsx_runtime45.jsx(MessageResponse, {
|
|
377404
|
+
children: /* @__PURE__ */ jsx_runtime45.jsx(ThemedText, {
|
|
377405
|
+
color: "error",
|
|
377406
|
+
children: "Error searching files"
|
|
377407
|
+
})
|
|
377408
|
+
});
|
|
377409
|
+
}
|
|
377410
|
+
return /* @__PURE__ */ jsx_runtime45.jsx(FallbackToolUseErrorMessage, {
|
|
377411
|
+
result,
|
|
377412
|
+
verbose
|
|
377413
|
+
});
|
|
377414
|
+
}
|
|
377415
|
+
function getToolUseSummary5(input) {
|
|
377416
|
+
if (!input?.pattern) {
|
|
377417
|
+
return null;
|
|
377418
|
+
}
|
|
377419
|
+
return truncate(input.pattern, TOOL_SUMMARY_MAX_LENGTH);
|
|
377420
|
+
}
|
|
377421
|
+
var jsx_runtime45;
|
|
377422
|
+
var init_UI5 = __esm(() => {
|
|
377423
|
+
init_MessageResponse();
|
|
377424
|
+
init_messages3();
|
|
377425
|
+
init_FallbackToolUseErrorMessage();
|
|
377426
|
+
init_toolLimits();
|
|
377427
|
+
init_ink2();
|
|
377428
|
+
init_file();
|
|
377429
|
+
init_format();
|
|
377430
|
+
init_UI4();
|
|
377431
|
+
jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
|
|
377432
|
+
});
|
|
377433
|
+
|
|
377434
|
+
// src/tools/GlobTool/GlobTool.ts
|
|
377435
|
+
var inputSchema6, outputSchema6, GlobTool;
|
|
377436
|
+
var init_GlobTool = __esm(() => {
|
|
377437
|
+
init_v4();
|
|
377438
|
+
init_Tool();
|
|
377439
|
+
init_cwd2();
|
|
377440
|
+
init_errors();
|
|
377441
|
+
init_file();
|
|
377442
|
+
init_fsOperations();
|
|
377443
|
+
init_glob();
|
|
377444
|
+
init_path2();
|
|
377445
|
+
init_filesystem();
|
|
377446
|
+
init_shellRuleMatching();
|
|
377447
|
+
init_UI5();
|
|
377448
|
+
inputSchema6 = lazySchema(() => exports_external.strictObject({
|
|
377449
|
+
pattern: exports_external.string().describe("The glob pattern to match files against"),
|
|
377450
|
+
path: exports_external.string().optional().describe('The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.'),
|
|
377451
|
+
tools: exports_external.array(exports_external.string()).optional().describe("Tool names to re-add to the subagent tool list when running inside an embedded agent. " + "No effect in the main REPL.")
|
|
377452
|
+
}));
|
|
377453
|
+
outputSchema6 = lazySchema(() => exports_external.object({
|
|
377454
|
+
durationMs: exports_external.number().describe("Time taken to execute the search in milliseconds"),
|
|
377455
|
+
numFiles: exports_external.number().describe("Total number of files found"),
|
|
377456
|
+
filenames: exports_external.array(exports_external.string()).describe("Array of file paths that match the pattern"),
|
|
377457
|
+
truncated: exports_external.boolean().describe("Whether results were truncated (limited to 100 files)")
|
|
377458
|
+
}));
|
|
377459
|
+
GlobTool = buildTool({
|
|
377460
|
+
name: GLOB_TOOL_NAME,
|
|
377461
|
+
searchHint: "find files by name pattern or wildcard",
|
|
377462
|
+
maxResultSizeChars: 1e5,
|
|
377463
|
+
async description() {
|
|
377464
|
+
return DESCRIPTION4;
|
|
377465
|
+
},
|
|
377466
|
+
userFacingName: userFacingName4,
|
|
377467
|
+
getToolUseSummary: getToolUseSummary5,
|
|
377468
|
+
getActivityDescription(input) {
|
|
377469
|
+
const summary = getToolUseSummary5(input);
|
|
377470
|
+
return summary ? `Finding ${summary}` : "Finding files";
|
|
377471
|
+
},
|
|
377472
|
+
get inputSchema() {
|
|
377473
|
+
return inputSchema6();
|
|
377474
|
+
},
|
|
377475
|
+
get outputSchema() {
|
|
377476
|
+
return outputSchema6();
|
|
377477
|
+
},
|
|
377478
|
+
isConcurrencySafe() {
|
|
377479
|
+
return true;
|
|
377480
|
+
},
|
|
377481
|
+
isReadOnly() {
|
|
377482
|
+
return true;
|
|
377483
|
+
},
|
|
377484
|
+
toAutoClassifierInput(input) {
|
|
377485
|
+
return input.pattern;
|
|
377486
|
+
},
|
|
377487
|
+
isSearchOrReadCommand() {
|
|
377488
|
+
return { isSearch: true, isRead: false };
|
|
377489
|
+
},
|
|
377490
|
+
getPath({ path: path21 }) {
|
|
377491
|
+
return path21 ? expandPath(path21) : getCwd();
|
|
377492
|
+
},
|
|
377493
|
+
async preparePermissionMatcher({ pattern }) {
|
|
377494
|
+
return (rulePattern) => matchWildcardPattern(rulePattern, pattern);
|
|
377495
|
+
},
|
|
377496
|
+
async validateInput({ pattern, path: path21 }) {
|
|
377497
|
+
const nullByteField = [["pattern", pattern], ["path", path21]].find(([, v6]) => v6?.includes("\x00"));
|
|
377498
|
+
if (nullByteField) {
|
|
377499
|
+
return {
|
|
377500
|
+
result: false,
|
|
377501
|
+
message: `${GLOB_TOOL_NAME} ${nullByteField[0]} cannot contain null bytes (\\0). Remove the null byte and try again.`,
|
|
377502
|
+
errorCode: 2
|
|
377503
|
+
};
|
|
377504
|
+
}
|
|
377505
|
+
if (path21) {
|
|
377506
|
+
const fs17 = getFsImplementation();
|
|
377507
|
+
const absolutePath = expandPath(path21);
|
|
377508
|
+
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
377509
|
+
return { result: true };
|
|
377510
|
+
}
|
|
377511
|
+
let stats;
|
|
377512
|
+
try {
|
|
377513
|
+
stats = await fs17.stat(absolutePath);
|
|
377514
|
+
} catch (e4) {
|
|
377515
|
+
if (isENOENT(e4)) {
|
|
377516
|
+
const cwdSuggestion = await suggestPathUnderCwd(absolutePath);
|
|
377517
|
+
let message = `Directory does not exist: ${path21}. ${FILE_NOT_FOUND_CWD_NOTE} ${getCwd()}.`;
|
|
377518
|
+
if (cwdSuggestion) {
|
|
377519
|
+
message += ` Did you mean ${cwdSuggestion}?`;
|
|
377520
|
+
}
|
|
377521
|
+
return {
|
|
377522
|
+
result: false,
|
|
377523
|
+
message,
|
|
377524
|
+
errorCode: 1
|
|
377525
|
+
};
|
|
377526
|
+
}
|
|
377527
|
+
throw e4;
|
|
377528
|
+
}
|
|
377529
|
+
if (!stats.isDirectory()) {
|
|
377530
|
+
return {
|
|
377531
|
+
result: false,
|
|
377532
|
+
message: `Path is not a directory: ${path21}`,
|
|
377533
|
+
errorCode: 2
|
|
377534
|
+
};
|
|
377535
|
+
}
|
|
377536
|
+
}
|
|
377537
|
+
return { result: true };
|
|
377538
|
+
},
|
|
377539
|
+
async checkPermissions(input, context4) {
|
|
377540
|
+
const appState = context4.getAppState();
|
|
377541
|
+
return checkReadPermissionForTool(GlobTool, input, appState.toolPermissionContext);
|
|
377542
|
+
},
|
|
377543
|
+
async prompt() {
|
|
377544
|
+
return DESCRIPTION4;
|
|
377545
|
+
},
|
|
377546
|
+
renderToolUseMessage: renderToolUseMessage5,
|
|
377547
|
+
renderToolUseErrorMessage: renderToolUseErrorMessage5,
|
|
377548
|
+
renderToolResultMessage: renderToolResultMessage4,
|
|
377549
|
+
extractSearchText({ filenames }) {
|
|
377550
|
+
return filenames.join(`
|
|
377551
|
+
`);
|
|
377552
|
+
},
|
|
377553
|
+
async call(input, { abortController, getAppState, globLimits, setAppState }) {
|
|
377554
|
+
if (input.tools && input.tools.length > 0) {
|
|
377555
|
+
setAppState((prev) => ({
|
|
377556
|
+
...prev,
|
|
377557
|
+
toolPermissionContext: {
|
|
377558
|
+
...prev.toolPermissionContext,
|
|
377559
|
+
alwaysAllowRules: {
|
|
377560
|
+
...prev.toolPermissionContext.alwaysAllowRules,
|
|
377561
|
+
command: [
|
|
377562
|
+
...new Set([
|
|
377563
|
+
...prev.toolPermissionContext.alwaysAllowRules.command || [],
|
|
377564
|
+
...input.tools
|
|
377565
|
+
])
|
|
377566
|
+
]
|
|
377567
|
+
}
|
|
377568
|
+
}
|
|
377569
|
+
}));
|
|
377570
|
+
}
|
|
377571
|
+
const start = Date.now();
|
|
377572
|
+
const appState = getAppState();
|
|
377573
|
+
const limit = globLimits?.maxResults ?? 100;
|
|
377574
|
+
const { files: files2, truncated } = await glob(input.pattern, GlobTool.getPath(input), { limit, offset: 0 }, abortController.signal, appState.toolPermissionContext);
|
|
377575
|
+
const filenames = files2.map(toRelativePath);
|
|
377576
|
+
const output = {
|
|
377577
|
+
filenames,
|
|
377578
|
+
durationMs: Date.now() - start,
|
|
377579
|
+
numFiles: filenames.length,
|
|
377580
|
+
truncated
|
|
377581
|
+
};
|
|
377582
|
+
return {
|
|
377583
|
+
data: output
|
|
377584
|
+
};
|
|
377585
|
+
},
|
|
377586
|
+
mapToolResultToToolResultBlockParam(output, toolUseID) {
|
|
377587
|
+
if (output.filenames.length === 0) {
|
|
377588
|
+
return {
|
|
377589
|
+
tool_use_id: toolUseID,
|
|
377590
|
+
type: "tool_result",
|
|
377591
|
+
content: "No files found"
|
|
377592
|
+
};
|
|
377593
|
+
}
|
|
377594
|
+
return {
|
|
377595
|
+
tool_use_id: toolUseID,
|
|
377596
|
+
type: "tool_result",
|
|
377597
|
+
content: [
|
|
377598
|
+
...output.filenames,
|
|
377599
|
+
...output.truncated ? [
|
|
377600
|
+
"(Results are truncated. Consider using a more specific path or pattern.)"
|
|
377601
|
+
] : []
|
|
377602
|
+
].join(`
|
|
377603
|
+
`)
|
|
377604
|
+
};
|
|
377605
|
+
}
|
|
377606
|
+
});
|
|
377607
|
+
});
|
|
377608
|
+
|
|
377372
377609
|
// src/tools/GrepTool/GrepTool.ts
|
|
377373
377610
|
function applyHeadLimit(items, limit, offset = 0) {
|
|
377374
377611
|
if (limit === 0) {
|
|
@@ -377390,7 +377627,7 @@ function formatLimitInfo(appliedLimit, appliedOffset) {
|
|
|
377390
377627
|
parts.push(`offset: ${appliedOffset}`);
|
|
377391
377628
|
return parts.join(", ");
|
|
377392
377629
|
}
|
|
377393
|
-
var
|
|
377630
|
+
var inputSchema7, VCS_DIRECTORIES_TO_EXCLUDE2, DEFAULT_HEAD_LIMIT = 250, outputSchema7, GrepTool;
|
|
377394
377631
|
var init_GrepTool = __esm(() => {
|
|
377395
377632
|
init_v4();
|
|
377396
377633
|
init_Tool();
|
|
@@ -377408,7 +377645,7 @@ var init_GrepTool = __esm(() => {
|
|
|
377408
377645
|
init_stringUtils();
|
|
377409
377646
|
init_prompt2();
|
|
377410
377647
|
init_UI4();
|
|
377411
|
-
|
|
377648
|
+
inputSchema7 = lazySchema(() => exports_external.strictObject({
|
|
377412
377649
|
pattern: exports_external.string().describe("The regular expression pattern to search for in file contents"),
|
|
377413
377650
|
path: exports_external.string().optional().describe("File or directory to search in (rg PATH). Defaults to current working directory."),
|
|
377414
377651
|
glob: exports_external.string().optional().describe('Glob pattern to filter files (e.g. "*.js", "*.{ts,tsx}") - maps to rg --glob'),
|
|
@@ -377433,7 +377670,7 @@ var init_GrepTool = __esm(() => {
|
|
|
377433
377670
|
".jj",
|
|
377434
377671
|
".sl"
|
|
377435
377672
|
];
|
|
377436
|
-
|
|
377673
|
+
outputSchema7 = lazySchema(() => exports_external.object({
|
|
377437
377674
|
mode: exports_external.enum(["content", "files_with_matches", "count"]).optional(),
|
|
377438
377675
|
numFiles: exports_external.number(),
|
|
377439
377676
|
filenames: exports_external.array(exports_external.string()),
|
|
@@ -377462,10 +377699,10 @@ var init_GrepTool = __esm(() => {
|
|
|
377462
377699
|
return summary ? `Searching for ${summary}` : "Searching";
|
|
377463
377700
|
},
|
|
377464
377701
|
get inputSchema() {
|
|
377465
|
-
return
|
|
377702
|
+
return inputSchema7();
|
|
377466
377703
|
},
|
|
377467
377704
|
get outputSchema() {
|
|
377468
|
-
return
|
|
377705
|
+
return outputSchema7();
|
|
377469
377706
|
},
|
|
377470
377707
|
isConcurrencySafe() {
|
|
377471
377708
|
return true;
|
|
@@ -377702,6 +377939,11 @@ ${filenames.join(`
|
|
|
377702
377939
|
for (const exclusion of await getGlobExclusionsForPluginCache(absolutePath)) {
|
|
377703
377940
|
args.push("--glob", exclusion);
|
|
377704
377941
|
}
|
|
377942
|
+
try {
|
|
377943
|
+
new RegExp(pattern);
|
|
377944
|
+
} catch {
|
|
377945
|
+
throw new Error(`Search failed: ripgrep rejected the pattern "${pattern}"`);
|
|
377946
|
+
}
|
|
377705
377947
|
const results = await ripGrep(args, absolutePath, abortController.signal, {
|
|
377706
377948
|
rejectOnInputError: true
|
|
377707
377949
|
});
|
|
@@ -377797,244 +378039,6 @@ ${filenames.join(`
|
|
|
377797
378039
|
});
|
|
377798
378040
|
});
|
|
377799
378041
|
|
|
377800
|
-
// src/tools/GlobTool/UI.tsx
|
|
377801
|
-
function userFacingName4() {
|
|
377802
|
-
return "Search";
|
|
377803
|
-
}
|
|
377804
|
-
function renderToolUseMessage5({
|
|
377805
|
-
pattern,
|
|
377806
|
-
path: path21
|
|
377807
|
-
}, {
|
|
377808
|
-
verbose
|
|
377809
|
-
}) {
|
|
377810
|
-
if (!pattern) {
|
|
377811
|
-
return null;
|
|
377812
|
-
}
|
|
377813
|
-
if (!path21) {
|
|
377814
|
-
return `pattern: "${pattern}"`;
|
|
377815
|
-
}
|
|
377816
|
-
return `pattern: "${pattern}", path: "${verbose ? path21 : getDisplayPath(path21)}"`;
|
|
377817
|
-
}
|
|
377818
|
-
function renderToolUseErrorMessage5(result, {
|
|
377819
|
-
verbose
|
|
377820
|
-
}) {
|
|
377821
|
-
if (!verbose && typeof result === "string" && extractTag(result, "tool_use_error")) {
|
|
377822
|
-
const errorMessage2 = extractTag(result, "tool_use_error");
|
|
377823
|
-
if (errorMessage2?.includes(FILE_NOT_FOUND_CWD_NOTE)) {
|
|
377824
|
-
return /* @__PURE__ */ jsx_runtime45.jsx(MessageResponse, {
|
|
377825
|
-
children: /* @__PURE__ */ jsx_runtime45.jsx(ThemedText, {
|
|
377826
|
-
color: "error",
|
|
377827
|
-
children: "File not found"
|
|
377828
|
-
})
|
|
377829
|
-
});
|
|
377830
|
-
}
|
|
377831
|
-
return /* @__PURE__ */ jsx_runtime45.jsx(MessageResponse, {
|
|
377832
|
-
children: /* @__PURE__ */ jsx_runtime45.jsx(ThemedText, {
|
|
377833
|
-
color: "error",
|
|
377834
|
-
children: "Error searching files"
|
|
377835
|
-
})
|
|
377836
|
-
});
|
|
377837
|
-
}
|
|
377838
|
-
return /* @__PURE__ */ jsx_runtime45.jsx(FallbackToolUseErrorMessage, {
|
|
377839
|
-
result,
|
|
377840
|
-
verbose
|
|
377841
|
-
});
|
|
377842
|
-
}
|
|
377843
|
-
function getToolUseSummary5(input) {
|
|
377844
|
-
if (!input?.pattern) {
|
|
377845
|
-
return null;
|
|
377846
|
-
}
|
|
377847
|
-
return truncate(input.pattern, TOOL_SUMMARY_MAX_LENGTH);
|
|
377848
|
-
}
|
|
377849
|
-
var jsx_runtime45, renderToolResultMessage5;
|
|
377850
|
-
var init_UI5 = __esm(() => {
|
|
377851
|
-
init_MessageResponse();
|
|
377852
|
-
init_messages3();
|
|
377853
|
-
init_FallbackToolUseErrorMessage();
|
|
377854
|
-
init_toolLimits();
|
|
377855
|
-
init_ink2();
|
|
377856
|
-
init_file();
|
|
377857
|
-
init_format();
|
|
377858
|
-
init_GrepTool();
|
|
377859
|
-
jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
|
|
377860
|
-
renderToolResultMessage5 = GrepTool.renderToolResultMessage;
|
|
377861
|
-
});
|
|
377862
|
-
|
|
377863
|
-
// src/tools/GlobTool/GlobTool.ts
|
|
377864
|
-
var inputSchema7, outputSchema7, GlobTool;
|
|
377865
|
-
var init_GlobTool = __esm(() => {
|
|
377866
|
-
init_v4();
|
|
377867
|
-
init_Tool();
|
|
377868
|
-
init_cwd2();
|
|
377869
|
-
init_errors();
|
|
377870
|
-
init_file();
|
|
377871
|
-
init_fsOperations();
|
|
377872
|
-
init_glob();
|
|
377873
|
-
init_path2();
|
|
377874
|
-
init_filesystem();
|
|
377875
|
-
init_shellRuleMatching();
|
|
377876
|
-
init_UI5();
|
|
377877
|
-
inputSchema7 = lazySchema(() => exports_external.strictObject({
|
|
377878
|
-
pattern: exports_external.string().describe("The glob pattern to match files against"),
|
|
377879
|
-
path: exports_external.string().optional().describe('The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.'),
|
|
377880
|
-
tools: exports_external.array(exports_external.string()).optional().describe("Tool names to re-add to the subagent tool list when running inside an embedded agent. " + "No effect in the main REPL.")
|
|
377881
|
-
}));
|
|
377882
|
-
outputSchema7 = lazySchema(() => exports_external.object({
|
|
377883
|
-
durationMs: exports_external.number().describe("Time taken to execute the search in milliseconds"),
|
|
377884
|
-
numFiles: exports_external.number().describe("Total number of files found"),
|
|
377885
|
-
filenames: exports_external.array(exports_external.string()).describe("Array of file paths that match the pattern"),
|
|
377886
|
-
truncated: exports_external.boolean().describe("Whether results were truncated (limited to 100 files)")
|
|
377887
|
-
}));
|
|
377888
|
-
GlobTool = buildTool({
|
|
377889
|
-
name: GLOB_TOOL_NAME,
|
|
377890
|
-
searchHint: "find files by name pattern or wildcard",
|
|
377891
|
-
maxResultSizeChars: 1e5,
|
|
377892
|
-
async description() {
|
|
377893
|
-
return DESCRIPTION4;
|
|
377894
|
-
},
|
|
377895
|
-
userFacingName: userFacingName4,
|
|
377896
|
-
getToolUseSummary: getToolUseSummary5,
|
|
377897
|
-
getActivityDescription(input) {
|
|
377898
|
-
const summary = getToolUseSummary5(input);
|
|
377899
|
-
return summary ? `Finding ${summary}` : "Finding files";
|
|
377900
|
-
},
|
|
377901
|
-
get inputSchema() {
|
|
377902
|
-
return inputSchema7();
|
|
377903
|
-
},
|
|
377904
|
-
get outputSchema() {
|
|
377905
|
-
return outputSchema7();
|
|
377906
|
-
},
|
|
377907
|
-
isConcurrencySafe() {
|
|
377908
|
-
return true;
|
|
377909
|
-
},
|
|
377910
|
-
isReadOnly() {
|
|
377911
|
-
return true;
|
|
377912
|
-
},
|
|
377913
|
-
toAutoClassifierInput(input) {
|
|
377914
|
-
return input.pattern;
|
|
377915
|
-
},
|
|
377916
|
-
isSearchOrReadCommand() {
|
|
377917
|
-
return { isSearch: true, isRead: false };
|
|
377918
|
-
},
|
|
377919
|
-
getPath({ path: path21 }) {
|
|
377920
|
-
return path21 ? expandPath(path21) : getCwd();
|
|
377921
|
-
},
|
|
377922
|
-
async preparePermissionMatcher({ pattern }) {
|
|
377923
|
-
return (rulePattern) => matchWildcardPattern(rulePattern, pattern);
|
|
377924
|
-
},
|
|
377925
|
-
async validateInput({ pattern, path: path21 }) {
|
|
377926
|
-
const nullByteField = [["pattern", pattern], ["path", path21]].find(([, v6]) => v6?.includes("\x00"));
|
|
377927
|
-
if (nullByteField) {
|
|
377928
|
-
return {
|
|
377929
|
-
result: false,
|
|
377930
|
-
message: `${GLOB_TOOL_NAME} ${nullByteField[0]} cannot contain null bytes (\\0). Remove the null byte and try again.`,
|
|
377931
|
-
errorCode: 2
|
|
377932
|
-
};
|
|
377933
|
-
}
|
|
377934
|
-
if (path21) {
|
|
377935
|
-
const fs17 = getFsImplementation();
|
|
377936
|
-
const absolutePath = expandPath(path21);
|
|
377937
|
-
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
377938
|
-
return { result: true };
|
|
377939
|
-
}
|
|
377940
|
-
let stats;
|
|
377941
|
-
try {
|
|
377942
|
-
stats = await fs17.stat(absolutePath);
|
|
377943
|
-
} catch (e4) {
|
|
377944
|
-
if (isENOENT(e4)) {
|
|
377945
|
-
const cwdSuggestion = await suggestPathUnderCwd(absolutePath);
|
|
377946
|
-
let message = `Directory does not exist: ${path21}. ${FILE_NOT_FOUND_CWD_NOTE} ${getCwd()}.`;
|
|
377947
|
-
if (cwdSuggestion) {
|
|
377948
|
-
message += ` Did you mean ${cwdSuggestion}?`;
|
|
377949
|
-
}
|
|
377950
|
-
return {
|
|
377951
|
-
result: false,
|
|
377952
|
-
message,
|
|
377953
|
-
errorCode: 1
|
|
377954
|
-
};
|
|
377955
|
-
}
|
|
377956
|
-
throw e4;
|
|
377957
|
-
}
|
|
377958
|
-
if (!stats.isDirectory()) {
|
|
377959
|
-
return {
|
|
377960
|
-
result: false,
|
|
377961
|
-
message: `Path is not a directory: ${path21}`,
|
|
377962
|
-
errorCode: 2
|
|
377963
|
-
};
|
|
377964
|
-
}
|
|
377965
|
-
}
|
|
377966
|
-
return { result: true };
|
|
377967
|
-
},
|
|
377968
|
-
async checkPermissions(input, context4) {
|
|
377969
|
-
const appState = context4.getAppState();
|
|
377970
|
-
return checkReadPermissionForTool(GlobTool, input, appState.toolPermissionContext);
|
|
377971
|
-
},
|
|
377972
|
-
async prompt() {
|
|
377973
|
-
return DESCRIPTION4;
|
|
377974
|
-
},
|
|
377975
|
-
renderToolUseMessage: renderToolUseMessage5,
|
|
377976
|
-
renderToolUseErrorMessage: renderToolUseErrorMessage5,
|
|
377977
|
-
renderToolResultMessage: renderToolResultMessage5,
|
|
377978
|
-
extractSearchText({ filenames }) {
|
|
377979
|
-
return filenames.join(`
|
|
377980
|
-
`);
|
|
377981
|
-
},
|
|
377982
|
-
async call(input, { abortController, getAppState, globLimits, setAppState }) {
|
|
377983
|
-
if (input.tools && input.tools.length > 0) {
|
|
377984
|
-
setAppState((prev) => ({
|
|
377985
|
-
...prev,
|
|
377986
|
-
toolPermissionContext: {
|
|
377987
|
-
...prev.toolPermissionContext,
|
|
377988
|
-
alwaysAllowRules: {
|
|
377989
|
-
...prev.toolPermissionContext.alwaysAllowRules,
|
|
377990
|
-
command: [
|
|
377991
|
-
...new Set([
|
|
377992
|
-
...prev.toolPermissionContext.alwaysAllowRules.command || [],
|
|
377993
|
-
...input.tools
|
|
377994
|
-
])
|
|
377995
|
-
]
|
|
377996
|
-
}
|
|
377997
|
-
}
|
|
377998
|
-
}));
|
|
377999
|
-
}
|
|
378000
|
-
const start = Date.now();
|
|
378001
|
-
const appState = getAppState();
|
|
378002
|
-
const limit = globLimits?.maxResults ?? 100;
|
|
378003
|
-
const { files: files2, truncated } = await glob(input.pattern, GlobTool.getPath(input), { limit, offset: 0 }, abortController.signal, appState.toolPermissionContext);
|
|
378004
|
-
const filenames = files2.map(toRelativePath);
|
|
378005
|
-
const output = {
|
|
378006
|
-
filenames,
|
|
378007
|
-
durationMs: Date.now() - start,
|
|
378008
|
-
numFiles: filenames.length,
|
|
378009
|
-
truncated
|
|
378010
|
-
};
|
|
378011
|
-
return {
|
|
378012
|
-
data: output
|
|
378013
|
-
};
|
|
378014
|
-
},
|
|
378015
|
-
mapToolResultToToolResultBlockParam(output, toolUseID) {
|
|
378016
|
-
if (output.filenames.length === 0) {
|
|
378017
|
-
return {
|
|
378018
|
-
tool_use_id: toolUseID,
|
|
378019
|
-
type: "tool_result",
|
|
378020
|
-
content: "No files found"
|
|
378021
|
-
};
|
|
378022
|
-
}
|
|
378023
|
-
return {
|
|
378024
|
-
tool_use_id: toolUseID,
|
|
378025
|
-
type: "tool_result",
|
|
378026
|
-
content: [
|
|
378027
|
-
...output.filenames,
|
|
378028
|
-
...output.truncated ? [
|
|
378029
|
-
"(Results are truncated. Consider using a more specific path or pattern.)"
|
|
378030
|
-
] : []
|
|
378031
|
-
].join(`
|
|
378032
|
-
`)
|
|
378033
|
-
};
|
|
378034
|
-
}
|
|
378035
|
-
});
|
|
378036
|
-
});
|
|
378037
|
-
|
|
378038
378042
|
// src/services/teamMemorySync/types.ts
|
|
378039
378043
|
var TeamMemoryContentSchema, TeamMemoryDataSchema, TeamMemoryTooManyEntriesSchema;
|
|
378040
378044
|
var init_types12 = __esm(() => {
|
|
@@ -385518,7 +385522,7 @@ function renderToolUseQueuedMessage() {
|
|
|
385518
385522
|
})
|
|
385519
385523
|
});
|
|
385520
385524
|
}
|
|
385521
|
-
function
|
|
385525
|
+
function renderToolResultMessage5(content, progressMessagesForMessage, {
|
|
385522
385526
|
verbose,
|
|
385523
385527
|
theme: _theme,
|
|
385524
385528
|
tools: _tools,
|
|
@@ -386329,7 +386333,7 @@ For commands that are harder to parse at a glance (piped commands, obscure flags
|
|
|
386329
386333
|
renderToolUseMessage: renderToolUseMessage6,
|
|
386330
386334
|
renderToolUseProgressMessage,
|
|
386331
386335
|
renderToolUseQueuedMessage,
|
|
386332
|
-
renderToolResultMessage:
|
|
386336
|
+
renderToolResultMessage: renderToolResultMessage5,
|
|
386333
386337
|
extractSearchText({
|
|
386334
386338
|
stdout,
|
|
386335
386339
|
stderr
|
|
@@ -393379,6 +393383,31 @@ function resolveAgentTools(agentDefinition, availableTools, isAsync2 = false, is
|
|
|
393379
393383
|
allowedAgentTypes
|
|
393380
393384
|
};
|
|
393381
393385
|
}
|
|
393386
|
+
function agentToolResultSchema() {
|
|
393387
|
+
return _agentToolResultSchemaCache ??= exports_external.object({
|
|
393388
|
+
agentId: exports_external.string(),
|
|
393389
|
+
agentType: exports_external.string().optional(),
|
|
393390
|
+
content: exports_external.array(exports_external.object({ type: exports_external.literal("text"), text: exports_external.string() })),
|
|
393391
|
+
totalToolUseCount: exports_external.number(),
|
|
393392
|
+
totalDurationMs: exports_external.number(),
|
|
393393
|
+
totalTokens: exports_external.number(),
|
|
393394
|
+
usage: exports_external.object({
|
|
393395
|
+
input_tokens: exports_external.number(),
|
|
393396
|
+
output_tokens: exports_external.number(),
|
|
393397
|
+
cache_creation_input_tokens: exports_external.number().nullable(),
|
|
393398
|
+
cache_read_input_tokens: exports_external.number().nullable(),
|
|
393399
|
+
server_tool_use: exports_external.object({
|
|
393400
|
+
web_search_requests: exports_external.number(),
|
|
393401
|
+
web_fetch_requests: exports_external.number()
|
|
393402
|
+
}).nullable(),
|
|
393403
|
+
service_tier: exports_external.enum(["standard", "priority", "batch"]).nullable(),
|
|
393404
|
+
cache_creation: exports_external.object({
|
|
393405
|
+
ephemeral_1h_input_tokens: exports_external.number(),
|
|
393406
|
+
ephemeral_5m_input_tokens: exports_external.number()
|
|
393407
|
+
}).nullable()
|
|
393408
|
+
})
|
|
393409
|
+
});
|
|
393410
|
+
}
|
|
393382
393411
|
function countToolUses(messages) {
|
|
393383
393412
|
let count3 = 0;
|
|
393384
393413
|
for (const m5 of messages) {
|
|
@@ -393659,7 +393688,7 @@ ${finalMessage}`;
|
|
|
393659
393688
|
clearDumpState(agentIdForCleanup);
|
|
393660
393689
|
}
|
|
393661
393690
|
}
|
|
393662
|
-
var
|
|
393691
|
+
var _agentToolResultSchemaCache;
|
|
393663
393692
|
var init_agentToolUtils = __esm(() => {
|
|
393664
393693
|
init_featureFlags();
|
|
393665
393694
|
init_v4();
|
|
@@ -393683,29 +393712,6 @@ var init_agentToolUtils = __esm(() => {
|
|
|
393683
393712
|
init_teammateContext();
|
|
393684
393713
|
init_tokens();
|
|
393685
393714
|
init_constants3();
|
|
393686
|
-
agentToolResultSchema = lazySchema(() => exports_external.object({
|
|
393687
|
-
agentId: exports_external.string(),
|
|
393688
|
-
agentType: exports_external.string().optional(),
|
|
393689
|
-
content: exports_external.array(exports_external.object({ type: exports_external.literal("text"), text: exports_external.string() })),
|
|
393690
|
-
totalToolUseCount: exports_external.number(),
|
|
393691
|
-
totalDurationMs: exports_external.number(),
|
|
393692
|
-
totalTokens: exports_external.number(),
|
|
393693
|
-
usage: exports_external.object({
|
|
393694
|
-
input_tokens: exports_external.number(),
|
|
393695
|
-
output_tokens: exports_external.number(),
|
|
393696
|
-
cache_creation_input_tokens: exports_external.number().nullable(),
|
|
393697
|
-
cache_read_input_tokens: exports_external.number().nullable(),
|
|
393698
|
-
server_tool_use: exports_external.object({
|
|
393699
|
-
web_search_requests: exports_external.number(),
|
|
393700
|
-
web_fetch_requests: exports_external.number()
|
|
393701
|
-
}).nullable(),
|
|
393702
|
-
service_tier: exports_external.enum(["standard", "priority", "batch"]).nullable(),
|
|
393703
|
-
cache_creation: exports_external.object({
|
|
393704
|
-
ephemeral_1h_input_tokens: exports_external.number(),
|
|
393705
|
-
ephemeral_5m_input_tokens: exports_external.number()
|
|
393706
|
-
}).nullable()
|
|
393707
|
-
})
|
|
393708
|
-
}));
|
|
393709
393715
|
});
|
|
393710
393716
|
|
|
393711
393717
|
// src/components/AgentProgressLine.tsx
|
|
@@ -451971,7 +451977,7 @@ function renderToolUseErrorMessage7(result, {
|
|
|
451971
451977
|
verbose
|
|
451972
451978
|
});
|
|
451973
451979
|
}
|
|
451974
|
-
function
|
|
451980
|
+
function renderToolResultMessage6({
|
|
451975
451981
|
cell_id,
|
|
451976
451982
|
new_source,
|
|
451977
451983
|
error: error52
|
|
@@ -452137,7 +452143,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
452137
452143
|
renderToolUseMessage: renderToolUseMessage7,
|
|
452138
452144
|
renderToolUseRejectedMessage: renderToolUseRejectedMessage3,
|
|
452139
452145
|
renderToolUseErrorMessage: renderToolUseErrorMessage7,
|
|
452140
|
-
renderToolResultMessage:
|
|
452146
|
+
renderToolResultMessage: renderToolResultMessage6,
|
|
452141
452147
|
async validateInput({ notebook_path, cell_type, cell_id, edit_mode = "replace" }, toolUseContext) {
|
|
452142
452148
|
const fullPath = isAbsolute22(notebook_path) ? notebook_path : resolve34(getCwd(), notebook_path);
|
|
452143
452149
|
if (fullPath.startsWith("\\\\") || fullPath.startsWith("//")) {
|
|
@@ -471915,7 +471921,7 @@ function _temp39(pm_0) {
|
|
|
471915
471921
|
function _temp210(pm) {
|
|
471916
471922
|
return hasProgressMessage(pm.data);
|
|
471917
471923
|
}
|
|
471918
|
-
function
|
|
471924
|
+
function renderToolResultMessage7(data, progressMessagesForMessage, {
|
|
471919
471925
|
tools,
|
|
471920
471926
|
verbose,
|
|
471921
471927
|
theme,
|
|
@@ -480588,7 +480594,7 @@ duration_ms: ${data.totalDurationMs}</usage>`
|
|
|
480588
480594
|
}
|
|
480589
480595
|
throw new Error(`Unexpected agent tool result status: ${data.status}`);
|
|
480590
480596
|
},
|
|
480591
|
-
renderToolResultMessage:
|
|
480597
|
+
renderToolResultMessage: renderToolResultMessage7,
|
|
480592
480598
|
renderToolUseMessage: renderToolUseMessage9,
|
|
480593
480599
|
renderToolUseTag: renderToolUseTag2,
|
|
480594
480600
|
renderToolUseProgressMessage: renderToolUseProgressMessage3,
|
|
@@ -480616,7 +480622,7 @@ function getToolUseIDFromParentMessage(parentMessage, toolName) {
|
|
|
480616
480622
|
}
|
|
480617
480623
|
|
|
480618
480624
|
// src/tools/SkillTool/UI.tsx
|
|
480619
|
-
function
|
|
480625
|
+
function renderToolResultMessage8(output) {
|
|
480620
480626
|
if ("status" in output && output.status === "forked") {
|
|
480621
480627
|
return /* @__PURE__ */ jsx_runtime134.jsx(MessageResponse, {
|
|
480622
480628
|
height: 1,
|
|
@@ -481404,7 +481410,7 @@ ${result.result}`
|
|
|
481404
481410
|
content: `Launching skill: ${result.commandName}`
|
|
481405
481411
|
};
|
|
481406
481412
|
},
|
|
481407
|
-
renderToolResultMessage:
|
|
481413
|
+
renderToolResultMessage: renderToolResultMessage8,
|
|
481408
481414
|
renderToolUseMessage: renderToolUseMessage10,
|
|
481409
481415
|
renderToolUseProgressMessage: renderToolUseProgressMessage4,
|
|
481410
481416
|
renderToolUseRejectedMessage: renderToolUseRejectedMessage5,
|
|
@@ -481595,7 +481601,7 @@ function renderToolUseProgressMessage5() {
|
|
|
481595
481601
|
})
|
|
481596
481602
|
});
|
|
481597
481603
|
}
|
|
481598
|
-
function
|
|
481604
|
+
function renderToolResultMessage9({
|
|
481599
481605
|
bytes,
|
|
481600
481606
|
code,
|
|
481601
481607
|
codeText,
|
|
@@ -498862,7 +498868,7 @@ ${DESCRIPTION5}`;
|
|
|
498862
498868
|
},
|
|
498863
498869
|
renderToolUseMessage: renderToolUseMessage11,
|
|
498864
498870
|
renderToolUseProgressMessage: renderToolUseProgressMessage5,
|
|
498865
|
-
renderToolResultMessage:
|
|
498871
|
+
renderToolResultMessage: renderToolResultMessage9,
|
|
498866
498872
|
async call({ url: url3, prompt }, { abortController, options: { isNonInteractiveSession } }) {
|
|
498867
498873
|
const start = Date.now();
|
|
498868
498874
|
const response3 = await getURLMarkdownContent(url3, abortController);
|
|
@@ -574857,7 +574863,7 @@ function truncateCommand(command5) {
|
|
|
574857
574863
|
}
|
|
574858
574864
|
return truncated.trim();
|
|
574859
574865
|
}
|
|
574860
|
-
function
|
|
574866
|
+
function renderToolResultMessage10(output2, _progressMessagesForMessage, {
|
|
574861
574867
|
verbose
|
|
574862
574868
|
}) {
|
|
574863
574869
|
if (false) {}
|
|
@@ -574960,7 +574966,7 @@ var init_TaskStopTool = __esm(() => {
|
|
|
574960
574966
|
};
|
|
574961
574967
|
},
|
|
574962
574968
|
renderToolUseMessage: renderToolUseMessage12,
|
|
574963
|
-
renderToolResultMessage:
|
|
574969
|
+
renderToolResultMessage: renderToolResultMessage10,
|
|
574964
574970
|
async call({ task_id, shell_id }, { getAppState, setAppState, abortController }) {
|
|
574965
574971
|
const id = task_id ?? shell_id;
|
|
574966
574972
|
if (!id) {
|
|
@@ -575181,7 +575187,7 @@ var init_attachments = __esm(() => {
|
|
|
575181
575187
|
function renderToolUseMessage13() {
|
|
575182
575188
|
return "";
|
|
575183
575189
|
}
|
|
575184
|
-
function
|
|
575190
|
+
function renderToolResultMessage11(output2, _progressMessages, options) {
|
|
575185
575191
|
const hasAttachments = (output2.attachments?.length ?? 0) > 0;
|
|
575186
575192
|
if (!output2.message && !hasAttachments) {
|
|
575187
575193
|
return null;
|
|
@@ -575429,7 +575435,7 @@ var init_BriefTool = __esm(() => {
|
|
|
575429
575435
|
};
|
|
575430
575436
|
},
|
|
575431
575437
|
renderToolUseMessage: renderToolUseMessage13,
|
|
575432
|
-
renderToolResultMessage:
|
|
575438
|
+
renderToolResultMessage: renderToolResultMessage11,
|
|
575433
575439
|
async call({ message, attachments, status }, context7) {
|
|
575434
575440
|
const sentAt = new Date().toISOString();
|
|
575435
575441
|
logEvent2("tengu_brief_send", {
|
|
@@ -576240,7 +576246,7 @@ function renderToolUseProgressMessage6(progressMessages) {
|
|
|
576240
576246
|
return null;
|
|
576241
576247
|
}
|
|
576242
576248
|
}
|
|
576243
|
-
function
|
|
576249
|
+
function renderToolResultMessage12(output2) {
|
|
576244
576250
|
const {
|
|
576245
576251
|
searchCount
|
|
576246
576252
|
} = getSearchSummary(output2.results ?? []);
|
|
@@ -576432,7 +576438,7 @@ var init_WebSearchTool = __esm(() => {
|
|
|
576432
576438
|
},
|
|
576433
576439
|
renderToolUseMessage: renderToolUseMessage14,
|
|
576434
576440
|
renderToolUseProgressMessage: renderToolUseProgressMessage6,
|
|
576435
|
-
renderToolResultMessage:
|
|
576441
|
+
renderToolResultMessage: renderToolResultMessage12,
|
|
576436
576442
|
extractSearchText() {
|
|
576437
576443
|
return "";
|
|
576438
576444
|
},
|
|
@@ -576649,7 +576655,7 @@ Ensure your plan is complete and unambiguous:
|
|
|
576649
576655
|
function renderToolUseMessage15() {
|
|
576650
576656
|
return null;
|
|
576651
576657
|
}
|
|
576652
|
-
function
|
|
576658
|
+
function renderToolResultMessage13(output2, _progressMessagesForMessage, {
|
|
576653
576659
|
theme: _theme
|
|
576654
576660
|
}) {
|
|
576655
576661
|
const {
|
|
@@ -576940,7 +576946,7 @@ var init_ExitPlanModeV2Tool = __esm(() => {
|
|
|
576940
576946
|
};
|
|
576941
576947
|
},
|
|
576942
576948
|
renderToolUseMessage: renderToolUseMessage15,
|
|
576943
|
-
renderToolResultMessage:
|
|
576949
|
+
renderToolResultMessage: renderToolResultMessage13,
|
|
576944
576950
|
renderToolUseRejectedMessage: renderToolUseRejectedMessage6,
|
|
576945
576951
|
async call(input2, context7) {
|
|
576946
576952
|
const isAgent = !!context7.agentId;
|
|
@@ -578192,7 +578198,7 @@ function renderToolUseErrorMessage10(result, {
|
|
|
578192
578198
|
verbose
|
|
578193
578199
|
});
|
|
578194
578200
|
}
|
|
578195
|
-
function
|
|
578201
|
+
function renderToolResultMessage14(output2, _progressMessages, {
|
|
578196
578202
|
verbose
|
|
578197
578203
|
}) {
|
|
578198
578204
|
if (output2.resultCount !== undefined && output2.fileCount !== undefined) {
|
|
@@ -578661,7 +578667,7 @@ var init_LSPTool = __esm(() => {
|
|
|
578661
578667
|
},
|
|
578662
578668
|
renderToolUseMessage: renderToolUseMessage16,
|
|
578663
578669
|
renderToolUseErrorMessage: renderToolUseErrorMessage10,
|
|
578664
|
-
renderToolResultMessage:
|
|
578670
|
+
renderToolResultMessage: renderToolResultMessage14,
|
|
578665
578671
|
async call(input2, _context) {
|
|
578666
578672
|
const absolutePath = expandPath(input2.filePath);
|
|
578667
578673
|
const cwd2 = getCwd();
|
|
@@ -578811,7 +578817,7 @@ function renderToolUseMessage17(input2) {
|
|
|
578811
578817
|
function userFacingName7() {
|
|
578812
578818
|
return "readMcpResource";
|
|
578813
578819
|
}
|
|
578814
|
-
function
|
|
578820
|
+
function renderToolResultMessage15(output2, _progressMessagesForMessage, {
|
|
578815
578821
|
verbose
|
|
578816
578822
|
}) {
|
|
578817
578823
|
if (!output2 || !output2.contents || output2.contents.length === 0) {
|
|
@@ -578938,7 +578944,7 @@ var init_ReadMcpResourceTool = __esm(() => {
|
|
|
578938
578944
|
},
|
|
578939
578945
|
renderToolUseMessage: renderToolUseMessage17,
|
|
578940
578946
|
userFacingName: userFacingName7,
|
|
578941
|
-
renderToolResultMessage:
|
|
578947
|
+
renderToolResultMessage: renderToolResultMessage15,
|
|
578942
578948
|
isResultTruncated(output2) {
|
|
578943
578949
|
return isOutputLineTruncated(jsonStringify(output2));
|
|
578944
578950
|
},
|
|
@@ -578977,7 +578983,7 @@ function renderToolUseMessage18(input2) {
|
|
|
578977
578983
|
function userFacingName8() {
|
|
578978
578984
|
return "readMcpResourceDir";
|
|
578979
578985
|
}
|
|
578980
|
-
function
|
|
578986
|
+
function renderToolResultMessage16(output2, _progressMessagesForMessage, { verbose }) {
|
|
578981
578987
|
if (output2?.error) {
|
|
578982
578988
|
return /* @__PURE__ */ jsx_runtime145.jsx(OutputLine, {
|
|
578983
578989
|
content: output2.error,
|
|
@@ -579135,7 +579141,7 @@ var init_ReadMcpResourceDirTool = __esm(() => {
|
|
|
579135
579141
|
},
|
|
579136
579142
|
renderToolUseMessage: renderToolUseMessage18,
|
|
579137
579143
|
userFacingName: userFacingName8,
|
|
579138
|
-
renderToolResultMessage:
|
|
579144
|
+
renderToolResultMessage: renderToolResultMessage16,
|
|
579139
579145
|
isResultTruncated(output2) {
|
|
579140
579146
|
return isOutputLineTruncated(jsonStringify(output2));
|
|
579141
579147
|
},
|
|
@@ -579362,7 +579368,7 @@ In plan mode, you'll:
|
|
|
579362
579368
|
function renderToolUseMessage19() {
|
|
579363
579369
|
return null;
|
|
579364
579370
|
}
|
|
579365
|
-
function
|
|
579371
|
+
function renderToolResultMessage17(_output, _progressMessagesForMessage, _options) {
|
|
579366
579372
|
return /* @__PURE__ */ jsx_runtime146.jsxs(ThemedBox_default, {
|
|
579367
579373
|
flexDirection: "column",
|
|
579368
579374
|
marginTop: 1,
|
|
@@ -579461,7 +579467,7 @@ var init_EnterPlanModeTool = __esm(() => {
|
|
|
579461
579467
|
return true;
|
|
579462
579468
|
},
|
|
579463
579469
|
renderToolUseMessage: renderToolUseMessage19,
|
|
579464
|
-
renderToolResultMessage:
|
|
579470
|
+
renderToolResultMessage: renderToolResultMessage17,
|
|
579465
579471
|
renderToolUseRejectedMessage: renderToolUseRejectedMessage7,
|
|
579466
579472
|
async call(_input, context7) {
|
|
579467
579473
|
if (context7.agentId) {
|
|
@@ -579572,7 +579578,7 @@ function getEnterWorktreeToolPrompt() {
|
|
|
579572
579578
|
function renderToolUseMessage20() {
|
|
579573
579579
|
return "Creating worktree\u2026";
|
|
579574
579580
|
}
|
|
579575
|
-
function
|
|
579581
|
+
function renderToolResultMessage18(output2, _progressMessagesForMessage, _options) {
|
|
579576
579582
|
return /* @__PURE__ */ jsx_runtime147.jsxs(ThemedBox_default, {
|
|
579577
579583
|
flexDirection: "column",
|
|
579578
579584
|
children: [
|
|
@@ -579765,7 +579771,7 @@ var init_EnterWorktreeTool = __esm(() => {
|
|
|
579765
579771
|
return input2.name ?? "";
|
|
579766
579772
|
},
|
|
579767
579773
|
renderToolUseMessage: renderToolUseMessage20,
|
|
579768
|
-
renderToolResultMessage:
|
|
579774
|
+
renderToolResultMessage: renderToolResultMessage18,
|
|
579769
579775
|
async call(input2) {
|
|
579770
579776
|
if (getCurrentWorktreeSession() && !input2.path) {
|
|
579771
579777
|
throw new Error("Already in a worktree session. Pass `path` to switch into another existing worktree, or use ExitWorktree to leave this one before creating a new worktree.");
|
|
@@ -579847,7 +579853,7 @@ If called outside an EnterWorktree session, the tool is a **no-op**: it reports
|
|
|
579847
579853
|
function renderToolUseMessage21() {
|
|
579848
579854
|
return "Exiting worktree\u2026";
|
|
579849
579855
|
}
|
|
579850
|
-
function
|
|
579856
|
+
function renderToolResultMessage19(output2, _progressMessagesForMessage, _options) {
|
|
579851
579857
|
const actionLabel = output2.action === "keep" ? "Kept worktree" : "Removed worktree";
|
|
579852
579858
|
return /* @__PURE__ */ jsx_runtime148.jsxs(ThemedBox_default, {
|
|
579853
579859
|
flexDirection: "column",
|
|
@@ -580017,7 +580023,7 @@ var init_ExitWorktreeTool = __esm(() => {
|
|
|
580017
580023
|
return { result: true };
|
|
580018
580024
|
},
|
|
580019
580025
|
renderToolUseMessage: renderToolUseMessage21,
|
|
580020
|
-
renderToolResultMessage:
|
|
580026
|
+
renderToolResultMessage: renderToolResultMessage19,
|
|
580021
580027
|
async call(input2) {
|
|
580022
580028
|
const session = getCurrentWorktreeSession();
|
|
580023
580029
|
if (!session) {
|
|
@@ -581077,7 +581083,7 @@ function renderToolUseMessage22(input2) {
|
|
|
581077
581083
|
]
|
|
581078
581084
|
});
|
|
581079
581085
|
}
|
|
581080
|
-
function
|
|
581086
|
+
function renderToolResultMessage20(content) {
|
|
581081
581087
|
if (!content.success) {
|
|
581082
581088
|
return /* @__PURE__ */ jsx_runtime149.jsx(MessageResponse, {
|
|
581083
581089
|
children: /* @__PURE__ */ jsx_runtime149.jsxs(ThemedText, {
|
|
@@ -581925,7 +581931,7 @@ var init_ConfigTool = __esm(() => {
|
|
|
581925
581931
|
};
|
|
581926
581932
|
},
|
|
581927
581933
|
renderToolUseMessage: renderToolUseMessage22,
|
|
581928
|
-
renderToolResultMessage:
|
|
581934
|
+
renderToolResultMessage: renderToolResultMessage20,
|
|
581929
581935
|
renderToolUseRejectedMessage: renderToolUseRejectedMessage8,
|
|
581930
581936
|
async call({ setting, value }, context7) {
|
|
581931
581937
|
if (feature("VOICE_MODE") && setting === "voiceEnabled") {
|
|
@@ -583146,7 +583152,7 @@ The response is the raw JSON from the API.`;
|
|
|
583146
583152
|
function renderToolUseMessage23(input2) {
|
|
583147
583153
|
return `${input2.action ?? ""}${input2.trigger_id ? ` ${input2.trigger_id}` : ""}`;
|
|
583148
583154
|
}
|
|
583149
|
-
function
|
|
583155
|
+
function renderToolResultMessage21(output2) {
|
|
583150
583156
|
const lines2 = countCharInString(output2.json, `
|
|
583151
583157
|
`) + 1;
|
|
583152
583158
|
return /* @__PURE__ */ jsx_runtime150.jsx(MessageResponse, {
|
|
@@ -583312,7 +583318,7 @@ ${output2.json}`
|
|
|
583312
583318
|
};
|
|
583313
583319
|
},
|
|
583314
583320
|
renderToolUseMessage: renderToolUseMessage23,
|
|
583315
|
-
renderToolResultMessage:
|
|
583321
|
+
renderToolResultMessage: renderToolResultMessage21
|
|
583316
583322
|
});
|
|
583317
583323
|
});
|
|
583318
583324
|
|
|
@@ -583948,7 +583954,7 @@ function renderToolUseMessage24(input2) {
|
|
|
583948
583954
|
}
|
|
583949
583955
|
return null;
|
|
583950
583956
|
}
|
|
583951
|
-
function
|
|
583957
|
+
function renderToolResultMessage22(content, _progressMessages, {
|
|
583952
583958
|
verbose
|
|
583953
583959
|
}) {
|
|
583954
583960
|
const result = typeof content === "string" ? jsonParse(content) : content;
|
|
@@ -584603,7 +584609,7 @@ var init_SendMessageTool = __esm(() => {
|
|
|
584603
584609
|
}
|
|
584604
584610
|
},
|
|
584605
584611
|
renderToolUseMessage: renderToolUseMessage24,
|
|
584606
|
-
renderToolResultMessage:
|
|
584612
|
+
renderToolResultMessage: renderToolResultMessage22
|
|
584607
584613
|
});
|
|
584608
584614
|
});
|
|
584609
584615
|
|
|
@@ -591983,7 +591989,7 @@ function renderToolUseQueuedMessage3() {
|
|
|
591983
591989
|
})
|
|
591984
591990
|
});
|
|
591985
591991
|
}
|
|
591986
|
-
function
|
|
591992
|
+
function renderToolResultMessage23(content, progressMessagesForMessage, {
|
|
591987
591993
|
verbose,
|
|
591988
591994
|
theme: _theme,
|
|
591989
591995
|
tools: _tools,
|
|
@@ -592582,7 +592588,7 @@ var init_PowerShellTool = __esm(() => {
|
|
|
592582
592588
|
renderToolUseMessage: renderToolUseMessage25,
|
|
592583
592589
|
renderToolUseProgressMessage: renderToolUseProgressMessage7,
|
|
592584
592590
|
renderToolUseQueuedMessage: renderToolUseQueuedMessage3,
|
|
592585
|
-
renderToolResultMessage:
|
|
592591
|
+
renderToolResultMessage: renderToolResultMessage23,
|
|
592586
592592
|
renderToolUseErrorMessage: renderToolUseErrorMessage11,
|
|
592587
592593
|
mapToolResultToToolResultBlockParam({
|
|
592588
592594
|
interrupted,
|
|
@@ -617610,7 +617616,7 @@ Parameters:
|
|
|
617610
617616
|
function renderToolUseMessage26(input2) {
|
|
617611
617617
|
return input2.server ? `List MCP resources from server "${input2.server}"` : `List all MCP resources`;
|
|
617612
617618
|
}
|
|
617613
|
-
function
|
|
617619
|
+
function renderToolResultMessage24(output2, _progressMessagesForMessage, {
|
|
617614
617620
|
verbose
|
|
617615
617621
|
}) {
|
|
617616
617622
|
if (!output2 || output2.length === 0) {
|
|
@@ -617707,7 +617713,7 @@ var init_ListMcpResourcesTool = __esm(() => {
|
|
|
617707
617713
|
},
|
|
617708
617714
|
renderToolUseMessage: renderToolUseMessage26,
|
|
617709
617715
|
userFacingName: () => "listMcpResources",
|
|
617710
|
-
renderToolResultMessage:
|
|
617716
|
+
renderToolResultMessage: renderToolResultMessage24,
|
|
617711
617717
|
isResultTruncated(output2) {
|
|
617712
617718
|
return isOutputLineTruncated(jsonStringify(output2));
|
|
617713
617719
|
},
|
|
@@ -618020,7 +618026,7 @@ function renderToolUseProgressMessage8(progressMessagesForMessage) {
|
|
|
618020
618026
|
})
|
|
618021
618027
|
});
|
|
618022
618028
|
}
|
|
618023
|
-
function
|
|
618029
|
+
function renderToolResultMessage25(output2, _progressMessagesForMessage, {
|
|
618024
618030
|
verbose,
|
|
618025
618031
|
input: input2
|
|
618026
618032
|
}) {
|
|
@@ -618423,7 +618429,7 @@ var init_MCPTool = __esm(() => {
|
|
|
618423
618429
|
renderToolUseMessage: renderToolUseMessage27,
|
|
618424
618430
|
userFacingName: () => "mcp",
|
|
618425
618431
|
renderToolUseProgressMessage: renderToolUseProgressMessage8,
|
|
618426
|
-
renderToolResultMessage:
|
|
618432
|
+
renderToolResultMessage: renderToolResultMessage25,
|
|
618427
618433
|
isResultTruncated(output2) {
|
|
618428
618434
|
return isOutputLineTruncated(output2);
|
|
618429
618435
|
},
|
|
@@ -623007,7 +623013,7 @@ function renderChromeViewTabLink(input2) {
|
|
|
623007
623013
|
}
|
|
623008
623014
|
function renderChromeToolResultMessage(output2, toolName, verbose) {
|
|
623009
623015
|
if (verbose) {
|
|
623010
|
-
return
|
|
623016
|
+
return renderToolResultMessage25(output2, [], {
|
|
623011
623017
|
verbose
|
|
623012
623018
|
});
|
|
623013
623019
|
}
|
|
@@ -809168,6 +809174,19 @@ function findClosestSubcommand(word, program3) {
|
|
|
809168
809174
|
return best;
|
|
809169
809175
|
}
|
|
809170
809176
|
|
|
809177
|
+
// src/utils/forwardSubagentTextGuard.ts
|
|
809178
|
+
function checkForwardSubagentTextGuard(effective, isNonInteractiveSession, outputFormat, cliFlag) {
|
|
809179
|
+
if (effective) {
|
|
809180
|
+
if (!isNonInteractiveSession || outputFormat !== "stream-json") {
|
|
809181
|
+
if (cliFlag) {
|
|
809182
|
+
return FORWARD_SUBAGENT_TEXT_ERROR;
|
|
809183
|
+
}
|
|
809184
|
+
}
|
|
809185
|
+
}
|
|
809186
|
+
return null;
|
|
809187
|
+
}
|
|
809188
|
+
var FORWARD_SUBAGENT_TEXT_ERROR = "Error: --forward-subagent-text requires --print and --output-format=stream-json.";
|
|
809189
|
+
|
|
809171
809190
|
// src/migrations/migrateAutoUpdatesToSettings.ts
|
|
809172
809191
|
function migrateAutoUpdatesToSettings() {
|
|
809173
809192
|
const globalConfig2 = getGlobalConfig();
|
|
@@ -819948,12 +819967,11 @@ ${hint}` : hint;
|
|
|
819948
819967
|
process.exit(1);
|
|
819949
819968
|
}
|
|
819950
819969
|
}
|
|
819951
|
-
|
|
819952
|
-
|
|
819953
|
-
|
|
819954
|
-
|
|
819955
|
-
|
|
819956
|
-
}
|
|
819970
|
+
{
|
|
819971
|
+
const guardError = checkForwardSubagentTextGuard(effectiveForwardSubagentText, isNonInteractiveSession, outputFormat, forwardSubagentText);
|
|
819972
|
+
if (guardError) {
|
|
819973
|
+
writeToStderr(guardError);
|
|
819974
|
+
process.exit(1);
|
|
819957
819975
|
}
|
|
819958
819976
|
}
|
|
819959
819977
|
if (options.sessionPersistence === false && !isNonInteractiveSession) {
|