@opencow-ai/opencow-agent-sdk 0.4.14 → 0.4.16
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.mjs +74 -35
- package/dist/client.js +65 -26
- package/dist/sdk.js +65 -26
- package/dist/session/queryHelpers.d.ts +10 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -94698,7 +94698,7 @@ function printStartupScreen() {
|
|
|
94698
94698
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
94699
94699
|
out.push(boxRow(sRow, W2, sLen));
|
|
94700
94700
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
94701
|
-
out.push(` ${DIM}${rgb(...DIMCOL)}opencow ${RESET}${rgb(...ACCENT)}v${"0.4.
|
|
94701
|
+
out.push(` ${DIM}${rgb(...DIMCOL)}opencow ${RESET}${rgb(...ACCENT)}v${"0.4.16"}${RESET}`);
|
|
94702
94702
|
out.push("");
|
|
94703
94703
|
process.stdout.write(out.join(`
|
|
94704
94704
|
`) + `
|
|
@@ -244619,7 +244619,7 @@ function getAnthropicEnvMetadata() {
|
|
|
244619
244619
|
function getBuildAgeMinutes() {
|
|
244620
244620
|
if (false)
|
|
244621
244621
|
;
|
|
244622
|
-
const buildTime = new Date("2026-07-
|
|
244622
|
+
const buildTime = new Date("2026-07-08T06:56:56.372Z").getTime();
|
|
244623
244623
|
if (isNaN(buildTime))
|
|
244624
244624
|
return;
|
|
244625
244625
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -246193,6 +246193,27 @@ function isResultSuccessful(message, stopReason = null) {
|
|
|
246193
246193
|
}
|
|
246194
246194
|
return stopReason === "end_turn";
|
|
246195
246195
|
}
|
|
246196
|
+
function buildErrorDuringExecutionDiagnostic({
|
|
246197
|
+
resultType,
|
|
246198
|
+
lastContentType,
|
|
246199
|
+
stopReason
|
|
246200
|
+
}) {
|
|
246201
|
+
return `${ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX} result_type=${resultType} last_content_type=${lastContentType} stop_reason=${stopReason}`;
|
|
246202
|
+
}
|
|
246203
|
+
function buildErrorDuringExecutionErrors({
|
|
246204
|
+
recentErrors,
|
|
246205
|
+
stopReason
|
|
246206
|
+
}) {
|
|
246207
|
+
const visibleErrors = recentErrors.filter((error41) => !error41.startsWith(ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX));
|
|
246208
|
+
if (visibleErrors.length > 0)
|
|
246209
|
+
return visibleErrors;
|
|
246210
|
+
if (stopReason === "tool_use") {
|
|
246211
|
+
return [
|
|
246212
|
+
"The upstream model requested a tool but did not produce a final assistant response after the tool result."
|
|
246213
|
+
];
|
|
246214
|
+
}
|
|
246215
|
+
return ["The upstream model stopped before producing a final assistant response."];
|
|
246216
|
+
}
|
|
246196
246217
|
function normalizeUserMessageForSdk(message) {
|
|
246197
246218
|
const content = message.content;
|
|
246198
246219
|
if (!Array.isArray(content))
|
|
@@ -246497,7 +246518,7 @@ function extractCliName(command) {
|
|
|
246497
246518
|
}
|
|
246498
246519
|
return;
|
|
246499
246520
|
}
|
|
246500
|
-
var ASK_READ_FILE_STATE_CACHE_SIZE = 10, MAX_TOOL_PROGRESS_TRACKING_ENTRIES = 100, TOOL_PROGRESS_THROTTLE_MS = 30000, toolProgressLastSentTime, STRIPPED_COMMANDS;
|
|
246521
|
+
var ASK_READ_FILE_STATE_CACHE_SIZE = 10, ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX = "[ede_diagnostic]", MAX_TOOL_PROGRESS_TRACKING_ENTRIES = 100, TOOL_PROGRESS_THROTTLE_MS = 30000, toolProgressLastSentTime, STRIPPED_COMMANDS;
|
|
246501
246522
|
var init_queryHelpers = __esm(() => {
|
|
246502
246523
|
init_last();
|
|
246503
246524
|
init_state();
|
|
@@ -273412,7 +273433,7 @@ var init_GlobTool = __esm(() => {
|
|
|
273412
273433
|
} = lazyUI("Glob"));
|
|
273413
273434
|
inputSchema10 = lazySchema(() => exports_external.strictObject({
|
|
273414
273435
|
pattern: exports_external.preprocess((value) => typeof value === "string" && value.trim().length === 0 ? undefined : value, exports_external.string().default(DEFAULT_GLOB_PATTERN).describe('The glob pattern to match files against. Defaults to "*" when omitted.')),
|
|
273415
|
-
path: exports_external.string().optional().describe(
|
|
273436
|
+
path: exports_external.string().optional().describe("Optional directory path to search. Omit this field to use the current working directory.")
|
|
273416
273437
|
}));
|
|
273417
273438
|
outputSchema9 = lazySchema(() => exports_external.object({
|
|
273418
273439
|
durationMs: exports_external.number().describe("Time taken to execute the search in milliseconds"),
|
|
@@ -273546,6 +273567,18 @@ var init_GlobTool = __esm(() => {
|
|
|
273546
273567
|
});
|
|
273547
273568
|
|
|
273548
273569
|
// src/capabilities/tools/GrepTool/GrepTool.ts
|
|
273570
|
+
function grepBoolean(inner) {
|
|
273571
|
+
return exports_external.preprocess((value) => {
|
|
273572
|
+
if (typeof value === "string") {
|
|
273573
|
+
const normalized = value.trim().toLowerCase();
|
|
273574
|
+
if (normalized === "true")
|
|
273575
|
+
return true;
|
|
273576
|
+
if (normalized === "false")
|
|
273577
|
+
return false;
|
|
273578
|
+
}
|
|
273579
|
+
return value;
|
|
273580
|
+
}, inner);
|
|
273581
|
+
}
|
|
273549
273582
|
function applyHeadLimit(items, limit, offset = 0) {
|
|
273550
273583
|
if (limit === 0) {
|
|
273551
273584
|
return { items: items.slice(offset), appliedLimit: undefined };
|
|
@@ -273579,7 +273612,6 @@ var init_GrepTool = __esm(() => {
|
|
|
273579
273612
|
init_shellRuleMatching();
|
|
273580
273613
|
init_orphanedPluginFilter();
|
|
273581
273614
|
init_ripgrep();
|
|
273582
|
-
init_semanticBoolean();
|
|
273583
273615
|
init_semanticNumber();
|
|
273584
273616
|
init_stringUtils();
|
|
273585
273617
|
init_prompt3();
|
|
@@ -273592,19 +273624,19 @@ var init_GrepTool = __esm(() => {
|
|
|
273592
273624
|
} = lazyUI("Grep"));
|
|
273593
273625
|
inputSchema11 = lazySchema(() => exports_external.strictObject({
|
|
273594
273626
|
pattern: exports_external.preprocess((value) => typeof value === "string" && value.trim().length === 0 ? undefined : value, exports_external.string().default(DEFAULT_GREP_PATTERN).describe('The regular expression pattern to search for in file contents. Defaults to "." (match any non-empty line) when omitted.')),
|
|
273595
|
-
path: exports_external.string().optional().describe("File or directory to search
|
|
273596
|
-
glob: exports_external.string().optional().describe('Glob pattern to filter files (e.g. "*.js", "*.{ts,tsx}")
|
|
273597
|
-
output_mode: exports_external.enum(["content", "files_with_matches", "count"]).optional().describe('Output mode: "content" shows matching lines (supports
|
|
273598
|
-
"-B": semanticNumber(exports_external.number().optional()).describe('
|
|
273599
|
-
"-A": semanticNumber(exports_external.number().optional()).describe('
|
|
273600
|
-
"-C": semanticNumber(exports_external.number().optional()).describe("Alias for context."),
|
|
273601
|
-
context: semanticNumber(exports_external.number().optional()).describe('
|
|
273602
|
-
"-n":
|
|
273603
|
-
"-i":
|
|
273604
|
-
type: exports_external.string().optional().describe("File type
|
|
273605
|
-
head_limit: semanticNumber(exports_external.number().optional()).describe(
|
|
273606
|
-
offset: semanticNumber(exports_external.number().optional()).describe(
|
|
273607
|
-
multiline:
|
|
273627
|
+
path: exports_external.string().optional().describe("File or directory path to search. Defaults to current working directory."),
|
|
273628
|
+
glob: exports_external.string().optional().describe('Glob pattern to filter searched files (e.g. "*.js", "*.{ts,tsx}").'),
|
|
273629
|
+
output_mode: exports_external.enum(["content", "files_with_matches", "count"]).optional().describe('Output mode: "content" shows matching lines (supports context line fields, the -n boolean field, and head_limit), "files_with_matches" shows file paths (supports head_limit), "count" shows match counts (supports head_limit). Defaults to "files_with_matches".'),
|
|
273630
|
+
"-B": semanticNumber(exports_external.number().optional()).describe('JSON number field: lines to show before each match. Requires output_mode: "content", ignored otherwise.'),
|
|
273631
|
+
"-A": semanticNumber(exports_external.number().optional()).describe('JSON number field: lines to show after each match. Requires output_mode: "content", ignored otherwise.'),
|
|
273632
|
+
"-C": semanticNumber(exports_external.number().optional()).describe("JSON number field: lines to show before and after each match. Alias for context."),
|
|
273633
|
+
context: semanticNumber(exports_external.number().optional()).describe('JSON number field: lines to show before and after each match. Requires output_mode: "content", ignored otherwise.'),
|
|
273634
|
+
"-n": grepBoolean(exports_external.boolean().optional()).describe('JSON boolean field that controls whether output includes line numbers. Requires output_mode: "content", ignored otherwise. Defaults to true.'),
|
|
273635
|
+
"-i": grepBoolean(exports_external.boolean().optional()).describe("JSON boolean field that enables case-insensitive search."),
|
|
273636
|
+
type: exports_external.string().optional().describe("File type filter. Common values: js, py, rust, go, java, etc. More efficient than glob for standard file types."),
|
|
273637
|
+
head_limit: semanticNumber(exports_external.number().optional()).describe("JSON number field limiting returned lines or entries. Works across all output modes: content limits output lines, files_with_matches limits file paths, count limits count entries. Defaults to 250 when unspecified. Pass 0 for unlimited, sparingly."),
|
|
273638
|
+
offset: semanticNumber(exports_external.number().optional()).describe("JSON number field skipping the first N returned lines or entries before applying head_limit. Works across all output modes. Defaults to 0."),
|
|
273639
|
+
multiline: grepBoolean(exports_external.boolean().optional()).describe("JSON boolean field that enables multiline mode where . matches newlines and patterns can span lines. Default: false.")
|
|
273608
273640
|
}));
|
|
273609
273641
|
VCS_DIRECTORIES_TO_EXCLUDE2 = [
|
|
273610
273642
|
".git",
|
|
@@ -480054,7 +480086,7 @@ function buildPrimarySection() {
|
|
|
480054
480086
|
}, undefined, false, undefined, this);
|
|
480055
480087
|
return [{
|
|
480056
480088
|
label: "Version",
|
|
480057
|
-
value: "0.4.
|
|
480089
|
+
value: "0.4.16"
|
|
480058
480090
|
}, {
|
|
480059
480091
|
label: "Session name",
|
|
480060
480092
|
value: nameValue
|
|
@@ -536377,7 +536409,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
536377
536409
|
var call58 = async () => {
|
|
536378
536410
|
return {
|
|
536379
536411
|
type: "text",
|
|
536380
|
-
value: `${"99.0.0"} (built ${"2026-07-
|
|
536412
|
+
value: `${"99.0.0"} (built ${"2026-07-08T06:56:56.372Z"})`
|
|
536381
536413
|
};
|
|
536382
536414
|
}, version2, version_default;
|
|
536383
536415
|
var init_version = __esm(() => {
|
|
@@ -558487,7 +558519,7 @@ function WelcomeV2() {
|
|
|
558487
558519
|
dimColor: true,
|
|
558488
558520
|
children: [
|
|
558489
558521
|
"v",
|
|
558490
|
-
"0.4.
|
|
558522
|
+
"0.4.16",
|
|
558491
558523
|
" "
|
|
558492
558524
|
]
|
|
558493
558525
|
}, undefined, true, undefined, this)
|
|
@@ -558687,7 +558719,7 @@ function WelcomeV2() {
|
|
|
558687
558719
|
dimColor: true,
|
|
558688
558720
|
children: [
|
|
558689
558721
|
"v",
|
|
558690
|
-
"0.4.
|
|
558722
|
+
"0.4.16",
|
|
558691
558723
|
" "
|
|
558692
558724
|
]
|
|
558693
558725
|
}, undefined, true, undefined, this)
|
|
@@ -558913,7 +558945,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
558913
558945
|
dimColor: true,
|
|
558914
558946
|
children: [
|
|
558915
558947
|
"v",
|
|
558916
|
-
"0.4.
|
|
558948
|
+
"0.4.16",
|
|
558917
558949
|
" "
|
|
558918
558950
|
]
|
|
558919
558951
|
}, undefined, true, undefined, this);
|
|
@@ -559167,7 +559199,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
559167
559199
|
dimColor: true,
|
|
559168
559200
|
children: [
|
|
559169
559201
|
"v",
|
|
559170
|
-
"0.4.
|
|
559202
|
+
"0.4.16",
|
|
559171
559203
|
" "
|
|
559172
559204
|
]
|
|
559173
559205
|
}, undefined, true, undefined, this);
|
|
@@ -570390,6 +570422,17 @@ class QueryEngine {
|
|
|
570390
570422
|
};
|
|
570391
570423
|
return;
|
|
570392
570424
|
}
|
|
570425
|
+
const recentErrors = (() => {
|
|
570426
|
+
const all4 = getInMemoryErrors();
|
|
570427
|
+
const start = errorLogWatermark ? all4.lastIndexOf(errorLogWatermark) + 1 : 0;
|
|
570428
|
+
return all4.slice(start).map((_) => _.error);
|
|
570429
|
+
})();
|
|
570430
|
+
const edeDiagnostic = buildErrorDuringExecutionDiagnostic({
|
|
570431
|
+
resultType: edeResultType,
|
|
570432
|
+
lastContentType: edeLastContentType,
|
|
570433
|
+
stopReason: lastStopReason
|
|
570434
|
+
});
|
|
570435
|
+
logForDebugging2(edeDiagnostic, { level: "warn" });
|
|
570393
570436
|
yield {
|
|
570394
570437
|
type: "result",
|
|
570395
570438
|
subtype: "error_during_execution",
|
|
@@ -570405,14 +570448,10 @@ class QueryEngine {
|
|
|
570405
570448
|
permission_denials: this.permissionDenials,
|
|
570406
570449
|
fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
|
|
570407
570450
|
uuid: randomUUID46(),
|
|
570408
|
-
errors: (
|
|
570409
|
-
|
|
570410
|
-
|
|
570411
|
-
|
|
570412
|
-
`[ede_diagnostic] result_type=${edeResultType} last_content_type=${edeLastContentType} stop_reason=${lastStopReason}`,
|
|
570413
|
-
...all4.slice(start).map((_) => _.error)
|
|
570414
|
-
];
|
|
570415
|
-
})()
|
|
570451
|
+
errors: buildErrorDuringExecutionErrors({
|
|
570452
|
+
recentErrors,
|
|
570453
|
+
stopReason: lastStopReason
|
|
570454
|
+
})
|
|
570416
570455
|
};
|
|
570417
570456
|
return;
|
|
570418
570457
|
}
|
|
@@ -580035,7 +580074,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
580035
580074
|
pendingHookMessages
|
|
580036
580075
|
}, renderAndRun);
|
|
580037
580076
|
}
|
|
580038
|
-
}).version("0.4.
|
|
580077
|
+
}).version("0.4.16 (OpenCow)", "-v, --version", "Output the version number");
|
|
580039
580078
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
580040
580079
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
580041
580080
|
if (canUserConfigureAdvisor()) {
|
|
@@ -580681,7 +580720,7 @@ if (false) {}
|
|
|
580681
580720
|
async function main2() {
|
|
580682
580721
|
const args = process.argv.slice(2);
|
|
580683
580722
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
580684
|
-
console.log(`${"0.4.
|
|
580723
|
+
console.log(`${"0.4.16"} (OpenCow)`);
|
|
580685
580724
|
return;
|
|
580686
580725
|
}
|
|
580687
580726
|
if (args.includes("--provider")) {
|
|
@@ -580799,4 +580838,4 @@ async function main2() {
|
|
|
580799
580838
|
}
|
|
580800
580839
|
main2();
|
|
580801
580840
|
|
|
580802
|
-
//# debugId=
|
|
580841
|
+
//# debugId=79939475117F759764756E2164756E21
|
package/dist/client.js
CHANGED
|
@@ -233960,6 +233960,27 @@ function isResultSuccessful(message, stopReason = null) {
|
|
|
233960
233960
|
}
|
|
233961
233961
|
return stopReason === "end_turn";
|
|
233962
233962
|
}
|
|
233963
|
+
function buildErrorDuringExecutionDiagnostic({
|
|
233964
|
+
resultType,
|
|
233965
|
+
lastContentType,
|
|
233966
|
+
stopReason
|
|
233967
|
+
}) {
|
|
233968
|
+
return `${ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX} result_type=${resultType} last_content_type=${lastContentType} stop_reason=${stopReason}`;
|
|
233969
|
+
}
|
|
233970
|
+
function buildErrorDuringExecutionErrors({
|
|
233971
|
+
recentErrors,
|
|
233972
|
+
stopReason
|
|
233973
|
+
}) {
|
|
233974
|
+
const visibleErrors = recentErrors.filter((error41) => !error41.startsWith(ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX));
|
|
233975
|
+
if (visibleErrors.length > 0)
|
|
233976
|
+
return visibleErrors;
|
|
233977
|
+
if (stopReason === "tool_use") {
|
|
233978
|
+
return [
|
|
233979
|
+
"The upstream model requested a tool but did not produce a final assistant response after the tool result."
|
|
233980
|
+
];
|
|
233981
|
+
}
|
|
233982
|
+
return ["The upstream model stopped before producing a final assistant response."];
|
|
233983
|
+
}
|
|
233963
233984
|
function normalizeUserMessageForSdk(message) {
|
|
233964
233985
|
const content = message.content;
|
|
233965
233986
|
if (!Array.isArray(content))
|
|
@@ -234147,7 +234168,7 @@ async function* handleOrphanedPermission(orphanedPermission, tools, mutableMessa
|
|
|
234147
234168
|
}
|
|
234148
234169
|
}
|
|
234149
234170
|
}
|
|
234150
|
-
var MAX_TOOL_PROGRESS_TRACKING_ENTRIES = 100, TOOL_PROGRESS_THROTTLE_MS = 30000, toolProgressLastSentTime, STRIPPED_COMMANDS;
|
|
234171
|
+
var ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX = "[ede_diagnostic]", MAX_TOOL_PROGRESS_TRACKING_ENTRIES = 100, TOOL_PROGRESS_THROTTLE_MS = 30000, toolProgressLastSentTime, STRIPPED_COMMANDS;
|
|
234151
234172
|
var init_queryHelpers = __esm(() => {
|
|
234152
234173
|
init_last();
|
|
234153
234174
|
init_state();
|
|
@@ -254773,7 +254794,7 @@ var init_GlobTool = __esm(() => {
|
|
|
254773
254794
|
} = lazyUI("Glob"));
|
|
254774
254795
|
inputSchema9 = lazySchema(() => exports_external2.strictObject({
|
|
254775
254796
|
pattern: exports_external2.preprocess((value) => typeof value === "string" && value.trim().length === 0 ? undefined : value, exports_external2.string().default(DEFAULT_GLOB_PATTERN).describe('The glob pattern to match files against. Defaults to "*" when omitted.')),
|
|
254776
|
-
path: exports_external2.string().optional().describe(
|
|
254797
|
+
path: exports_external2.string().optional().describe("Optional directory path to search. Omit this field to use the current working directory.")
|
|
254777
254798
|
}));
|
|
254778
254799
|
outputSchema8 = lazySchema(() => exports_external2.object({
|
|
254779
254800
|
durationMs: exports_external2.number().describe("Time taken to execute the search in milliseconds"),
|
|
@@ -254922,6 +254943,18 @@ var init_semanticNumber = __esm(() => {
|
|
|
254922
254943
|
});
|
|
254923
254944
|
|
|
254924
254945
|
// src/capabilities/tools/GrepTool/GrepTool.ts
|
|
254946
|
+
function grepBoolean(inner) {
|
|
254947
|
+
return exports_external2.preprocess((value) => {
|
|
254948
|
+
if (typeof value === "string") {
|
|
254949
|
+
const normalized = value.trim().toLowerCase();
|
|
254950
|
+
if (normalized === "true")
|
|
254951
|
+
return true;
|
|
254952
|
+
if (normalized === "false")
|
|
254953
|
+
return false;
|
|
254954
|
+
}
|
|
254955
|
+
return value;
|
|
254956
|
+
}, inner);
|
|
254957
|
+
}
|
|
254925
254958
|
function applyHeadLimit(items, limit, offset = 0) {
|
|
254926
254959
|
if (limit === 0) {
|
|
254927
254960
|
return { items: items.slice(offset), appliedLimit: undefined };
|
|
@@ -254955,7 +254988,6 @@ var init_GrepTool = __esm(() => {
|
|
|
254955
254988
|
init_shellRuleMatching();
|
|
254956
254989
|
init_orphanedPluginFilter();
|
|
254957
254990
|
init_ripgrep();
|
|
254958
|
-
init_semanticBoolean();
|
|
254959
254991
|
init_semanticNumber();
|
|
254960
254992
|
init_stringUtils();
|
|
254961
254993
|
init_prompt4();
|
|
@@ -254968,19 +255000,19 @@ var init_GrepTool = __esm(() => {
|
|
|
254968
255000
|
} = lazyUI("Grep"));
|
|
254969
255001
|
inputSchema10 = lazySchema(() => exports_external2.strictObject({
|
|
254970
255002
|
pattern: exports_external2.preprocess((value) => typeof value === "string" && value.trim().length === 0 ? undefined : value, exports_external2.string().default(DEFAULT_GREP_PATTERN).describe('The regular expression pattern to search for in file contents. Defaults to "." (match any non-empty line) when omitted.')),
|
|
254971
|
-
path: exports_external2.string().optional().describe("File or directory to search
|
|
254972
|
-
glob: exports_external2.string().optional().describe('Glob pattern to filter files (e.g. "*.js", "*.{ts,tsx}")
|
|
254973
|
-
output_mode: exports_external2.enum(["content", "files_with_matches", "count"]).optional().describe('Output mode: "content" shows matching lines (supports
|
|
254974
|
-
"-B": semanticNumber(exports_external2.number().optional()).describe('
|
|
254975
|
-
"-A": semanticNumber(exports_external2.number().optional()).describe('
|
|
254976
|
-
"-C": semanticNumber(exports_external2.number().optional()).describe("Alias for context."),
|
|
254977
|
-
context: semanticNumber(exports_external2.number().optional()).describe('
|
|
254978
|
-
"-n":
|
|
254979
|
-
"-i":
|
|
254980
|
-
type: exports_external2.string().optional().describe("File type
|
|
254981
|
-
head_limit: semanticNumber(exports_external2.number().optional()).describe(
|
|
254982
|
-
offset: semanticNumber(exports_external2.number().optional()).describe(
|
|
254983
|
-
multiline:
|
|
255003
|
+
path: exports_external2.string().optional().describe("File or directory path to search. Defaults to current working directory."),
|
|
255004
|
+
glob: exports_external2.string().optional().describe('Glob pattern to filter searched files (e.g. "*.js", "*.{ts,tsx}").'),
|
|
255005
|
+
output_mode: exports_external2.enum(["content", "files_with_matches", "count"]).optional().describe('Output mode: "content" shows matching lines (supports context line fields, the -n boolean field, and head_limit), "files_with_matches" shows file paths (supports head_limit), "count" shows match counts (supports head_limit). Defaults to "files_with_matches".'),
|
|
255006
|
+
"-B": semanticNumber(exports_external2.number().optional()).describe('JSON number field: lines to show before each match. Requires output_mode: "content", ignored otherwise.'),
|
|
255007
|
+
"-A": semanticNumber(exports_external2.number().optional()).describe('JSON number field: lines to show after each match. Requires output_mode: "content", ignored otherwise.'),
|
|
255008
|
+
"-C": semanticNumber(exports_external2.number().optional()).describe("JSON number field: lines to show before and after each match. Alias for context."),
|
|
255009
|
+
context: semanticNumber(exports_external2.number().optional()).describe('JSON number field: lines to show before and after each match. Requires output_mode: "content", ignored otherwise.'),
|
|
255010
|
+
"-n": grepBoolean(exports_external2.boolean().optional()).describe('JSON boolean field that controls whether output includes line numbers. Requires output_mode: "content", ignored otherwise. Defaults to true.'),
|
|
255011
|
+
"-i": grepBoolean(exports_external2.boolean().optional()).describe("JSON boolean field that enables case-insensitive search."),
|
|
255012
|
+
type: exports_external2.string().optional().describe("File type filter. Common values: js, py, rust, go, java, etc. More efficient than glob for standard file types."),
|
|
255013
|
+
head_limit: semanticNumber(exports_external2.number().optional()).describe("JSON number field limiting returned lines or entries. Works across all output modes: content limits output lines, files_with_matches limits file paths, count limits count entries. Defaults to 250 when unspecified. Pass 0 for unlimited, sparingly."),
|
|
255014
|
+
offset: semanticNumber(exports_external2.number().optional()).describe("JSON number field skipping the first N returned lines or entries before applying head_limit. Works across all output modes. Defaults to 0."),
|
|
255015
|
+
multiline: grepBoolean(exports_external2.boolean().optional()).describe("JSON boolean field that enables multiline mode where . matches newlines and patterns can span lines. Default: false.")
|
|
254984
255016
|
}));
|
|
254985
255017
|
VCS_DIRECTORIES_TO_EXCLUDE = [
|
|
254986
255018
|
".git",
|
|
@@ -282872,7 +282904,7 @@ function getAnthropicEnvMetadata() {
|
|
|
282872
282904
|
function getBuildAgeMinutes() {
|
|
282873
282905
|
if (false)
|
|
282874
282906
|
;
|
|
282875
|
-
const buildTime = new Date("2026-07-
|
|
282907
|
+
const buildTime = new Date("2026-07-08T06:56:56.372Z").getTime();
|
|
282876
282908
|
if (isNaN(buildTime))
|
|
282877
282909
|
return;
|
|
282878
282910
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -300862,6 +300894,17 @@ class QueryEngine {
|
|
|
300862
300894
|
};
|
|
300863
300895
|
return;
|
|
300864
300896
|
}
|
|
300897
|
+
const recentErrors = (() => {
|
|
300898
|
+
const all4 = getInMemoryErrors();
|
|
300899
|
+
const start = errorLogWatermark ? all4.lastIndexOf(errorLogWatermark) + 1 : 0;
|
|
300900
|
+
return all4.slice(start).map((_) => _.error);
|
|
300901
|
+
})();
|
|
300902
|
+
const edeDiagnostic = buildErrorDuringExecutionDiagnostic({
|
|
300903
|
+
resultType: edeResultType,
|
|
300904
|
+
lastContentType: edeLastContentType,
|
|
300905
|
+
stopReason: lastStopReason
|
|
300906
|
+
});
|
|
300907
|
+
logForDebugging(edeDiagnostic, { level: "warn" });
|
|
300865
300908
|
yield {
|
|
300866
300909
|
type: "result",
|
|
300867
300910
|
subtype: "error_during_execution",
|
|
@@ -300877,14 +300920,10 @@ class QueryEngine {
|
|
|
300877
300920
|
permission_denials: this.permissionDenials,
|
|
300878
300921
|
fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
|
|
300879
300922
|
uuid: randomUUID23(),
|
|
300880
|
-
errors: (
|
|
300881
|
-
|
|
300882
|
-
|
|
300883
|
-
|
|
300884
|
-
`[ede_diagnostic] result_type=${edeResultType} last_content_type=${edeLastContentType} stop_reason=${lastStopReason}`,
|
|
300885
|
-
...all4.slice(start).map((_) => _.error)
|
|
300886
|
-
];
|
|
300887
|
-
})()
|
|
300923
|
+
errors: buildErrorDuringExecutionErrors({
|
|
300924
|
+
recentErrors,
|
|
300925
|
+
stopReason: lastStopReason
|
|
300926
|
+
})
|
|
300888
300927
|
};
|
|
300889
300928
|
return;
|
|
300890
300929
|
}
|
|
@@ -336355,4 +336394,4 @@ export {
|
|
|
336355
336394
|
AbortError2 as AbortError
|
|
336356
336395
|
};
|
|
336357
336396
|
|
|
336358
|
-
//# debugId=
|
|
336397
|
+
//# debugId=116A1A82F0582B0D64756E2164756E21
|
package/dist/sdk.js
CHANGED
|
@@ -233960,6 +233960,27 @@ function isResultSuccessful(message, stopReason = null) {
|
|
|
233960
233960
|
}
|
|
233961
233961
|
return stopReason === "end_turn";
|
|
233962
233962
|
}
|
|
233963
|
+
function buildErrorDuringExecutionDiagnostic({
|
|
233964
|
+
resultType,
|
|
233965
|
+
lastContentType,
|
|
233966
|
+
stopReason
|
|
233967
|
+
}) {
|
|
233968
|
+
return `${ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX} result_type=${resultType} last_content_type=${lastContentType} stop_reason=${stopReason}`;
|
|
233969
|
+
}
|
|
233970
|
+
function buildErrorDuringExecutionErrors({
|
|
233971
|
+
recentErrors,
|
|
233972
|
+
stopReason
|
|
233973
|
+
}) {
|
|
233974
|
+
const visibleErrors = recentErrors.filter((error41) => !error41.startsWith(ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX));
|
|
233975
|
+
if (visibleErrors.length > 0)
|
|
233976
|
+
return visibleErrors;
|
|
233977
|
+
if (stopReason === "tool_use") {
|
|
233978
|
+
return [
|
|
233979
|
+
"The upstream model requested a tool but did not produce a final assistant response after the tool result."
|
|
233980
|
+
];
|
|
233981
|
+
}
|
|
233982
|
+
return ["The upstream model stopped before producing a final assistant response."];
|
|
233983
|
+
}
|
|
233963
233984
|
function normalizeUserMessageForSdk(message) {
|
|
233964
233985
|
const content = message.content;
|
|
233965
233986
|
if (!Array.isArray(content))
|
|
@@ -234147,7 +234168,7 @@ async function* handleOrphanedPermission(orphanedPermission, tools, mutableMessa
|
|
|
234147
234168
|
}
|
|
234148
234169
|
}
|
|
234149
234170
|
}
|
|
234150
|
-
var MAX_TOOL_PROGRESS_TRACKING_ENTRIES = 100, TOOL_PROGRESS_THROTTLE_MS = 30000, toolProgressLastSentTime, STRIPPED_COMMANDS;
|
|
234171
|
+
var ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX = "[ede_diagnostic]", MAX_TOOL_PROGRESS_TRACKING_ENTRIES = 100, TOOL_PROGRESS_THROTTLE_MS = 30000, toolProgressLastSentTime, STRIPPED_COMMANDS;
|
|
234151
234172
|
var init_queryHelpers = __esm(() => {
|
|
234152
234173
|
init_last();
|
|
234153
234174
|
init_state();
|
|
@@ -254773,7 +254794,7 @@ var init_GlobTool = __esm(() => {
|
|
|
254773
254794
|
} = lazyUI("Glob"));
|
|
254774
254795
|
inputSchema9 = lazySchema(() => exports_external2.strictObject({
|
|
254775
254796
|
pattern: exports_external2.preprocess((value) => typeof value === "string" && value.trim().length === 0 ? undefined : value, exports_external2.string().default(DEFAULT_GLOB_PATTERN).describe('The glob pattern to match files against. Defaults to "*" when omitted.')),
|
|
254776
|
-
path: exports_external2.string().optional().describe(
|
|
254797
|
+
path: exports_external2.string().optional().describe("Optional directory path to search. Omit this field to use the current working directory.")
|
|
254777
254798
|
}));
|
|
254778
254799
|
outputSchema8 = lazySchema(() => exports_external2.object({
|
|
254779
254800
|
durationMs: exports_external2.number().describe("Time taken to execute the search in milliseconds"),
|
|
@@ -254922,6 +254943,18 @@ var init_semanticNumber = __esm(() => {
|
|
|
254922
254943
|
});
|
|
254923
254944
|
|
|
254924
254945
|
// src/capabilities/tools/GrepTool/GrepTool.ts
|
|
254946
|
+
function grepBoolean(inner) {
|
|
254947
|
+
return exports_external2.preprocess((value) => {
|
|
254948
|
+
if (typeof value === "string") {
|
|
254949
|
+
const normalized = value.trim().toLowerCase();
|
|
254950
|
+
if (normalized === "true")
|
|
254951
|
+
return true;
|
|
254952
|
+
if (normalized === "false")
|
|
254953
|
+
return false;
|
|
254954
|
+
}
|
|
254955
|
+
return value;
|
|
254956
|
+
}, inner);
|
|
254957
|
+
}
|
|
254925
254958
|
function applyHeadLimit(items, limit, offset = 0) {
|
|
254926
254959
|
if (limit === 0) {
|
|
254927
254960
|
return { items: items.slice(offset), appliedLimit: undefined };
|
|
@@ -254955,7 +254988,6 @@ var init_GrepTool = __esm(() => {
|
|
|
254955
254988
|
init_shellRuleMatching();
|
|
254956
254989
|
init_orphanedPluginFilter();
|
|
254957
254990
|
init_ripgrep();
|
|
254958
|
-
init_semanticBoolean();
|
|
254959
254991
|
init_semanticNumber();
|
|
254960
254992
|
init_stringUtils();
|
|
254961
254993
|
init_prompt4();
|
|
@@ -254968,19 +255000,19 @@ var init_GrepTool = __esm(() => {
|
|
|
254968
255000
|
} = lazyUI("Grep"));
|
|
254969
255001
|
inputSchema10 = lazySchema(() => exports_external2.strictObject({
|
|
254970
255002
|
pattern: exports_external2.preprocess((value) => typeof value === "string" && value.trim().length === 0 ? undefined : value, exports_external2.string().default(DEFAULT_GREP_PATTERN).describe('The regular expression pattern to search for in file contents. Defaults to "." (match any non-empty line) when omitted.')),
|
|
254971
|
-
path: exports_external2.string().optional().describe("File or directory to search
|
|
254972
|
-
glob: exports_external2.string().optional().describe('Glob pattern to filter files (e.g. "*.js", "*.{ts,tsx}")
|
|
254973
|
-
output_mode: exports_external2.enum(["content", "files_with_matches", "count"]).optional().describe('Output mode: "content" shows matching lines (supports
|
|
254974
|
-
"-B": semanticNumber(exports_external2.number().optional()).describe('
|
|
254975
|
-
"-A": semanticNumber(exports_external2.number().optional()).describe('
|
|
254976
|
-
"-C": semanticNumber(exports_external2.number().optional()).describe("Alias for context."),
|
|
254977
|
-
context: semanticNumber(exports_external2.number().optional()).describe('
|
|
254978
|
-
"-n":
|
|
254979
|
-
"-i":
|
|
254980
|
-
type: exports_external2.string().optional().describe("File type
|
|
254981
|
-
head_limit: semanticNumber(exports_external2.number().optional()).describe(
|
|
254982
|
-
offset: semanticNumber(exports_external2.number().optional()).describe(
|
|
254983
|
-
multiline:
|
|
255003
|
+
path: exports_external2.string().optional().describe("File or directory path to search. Defaults to current working directory."),
|
|
255004
|
+
glob: exports_external2.string().optional().describe('Glob pattern to filter searched files (e.g. "*.js", "*.{ts,tsx}").'),
|
|
255005
|
+
output_mode: exports_external2.enum(["content", "files_with_matches", "count"]).optional().describe('Output mode: "content" shows matching lines (supports context line fields, the -n boolean field, and head_limit), "files_with_matches" shows file paths (supports head_limit), "count" shows match counts (supports head_limit). Defaults to "files_with_matches".'),
|
|
255006
|
+
"-B": semanticNumber(exports_external2.number().optional()).describe('JSON number field: lines to show before each match. Requires output_mode: "content", ignored otherwise.'),
|
|
255007
|
+
"-A": semanticNumber(exports_external2.number().optional()).describe('JSON number field: lines to show after each match. Requires output_mode: "content", ignored otherwise.'),
|
|
255008
|
+
"-C": semanticNumber(exports_external2.number().optional()).describe("JSON number field: lines to show before and after each match. Alias for context."),
|
|
255009
|
+
context: semanticNumber(exports_external2.number().optional()).describe('JSON number field: lines to show before and after each match. Requires output_mode: "content", ignored otherwise.'),
|
|
255010
|
+
"-n": grepBoolean(exports_external2.boolean().optional()).describe('JSON boolean field that controls whether output includes line numbers. Requires output_mode: "content", ignored otherwise. Defaults to true.'),
|
|
255011
|
+
"-i": grepBoolean(exports_external2.boolean().optional()).describe("JSON boolean field that enables case-insensitive search."),
|
|
255012
|
+
type: exports_external2.string().optional().describe("File type filter. Common values: js, py, rust, go, java, etc. More efficient than glob for standard file types."),
|
|
255013
|
+
head_limit: semanticNumber(exports_external2.number().optional()).describe("JSON number field limiting returned lines or entries. Works across all output modes: content limits output lines, files_with_matches limits file paths, count limits count entries. Defaults to 250 when unspecified. Pass 0 for unlimited, sparingly."),
|
|
255014
|
+
offset: semanticNumber(exports_external2.number().optional()).describe("JSON number field skipping the first N returned lines or entries before applying head_limit. Works across all output modes. Defaults to 0."),
|
|
255015
|
+
multiline: grepBoolean(exports_external2.boolean().optional()).describe("JSON boolean field that enables multiline mode where . matches newlines and patterns can span lines. Default: false.")
|
|
254984
255016
|
}));
|
|
254985
255017
|
VCS_DIRECTORIES_TO_EXCLUDE = [
|
|
254986
255018
|
".git",
|
|
@@ -282872,7 +282904,7 @@ function getAnthropicEnvMetadata() {
|
|
|
282872
282904
|
function getBuildAgeMinutes() {
|
|
282873
282905
|
if (false)
|
|
282874
282906
|
;
|
|
282875
|
-
const buildTime = new Date("2026-07-
|
|
282907
|
+
const buildTime = new Date("2026-07-08T06:56:56.372Z").getTime();
|
|
282876
282908
|
if (isNaN(buildTime))
|
|
282877
282909
|
return;
|
|
282878
282910
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -300862,6 +300894,17 @@ class QueryEngine {
|
|
|
300862
300894
|
};
|
|
300863
300895
|
return;
|
|
300864
300896
|
}
|
|
300897
|
+
const recentErrors = (() => {
|
|
300898
|
+
const all4 = getInMemoryErrors();
|
|
300899
|
+
const start = errorLogWatermark ? all4.lastIndexOf(errorLogWatermark) + 1 : 0;
|
|
300900
|
+
return all4.slice(start).map((_) => _.error);
|
|
300901
|
+
})();
|
|
300902
|
+
const edeDiagnostic = buildErrorDuringExecutionDiagnostic({
|
|
300903
|
+
resultType: edeResultType,
|
|
300904
|
+
lastContentType: edeLastContentType,
|
|
300905
|
+
stopReason: lastStopReason
|
|
300906
|
+
});
|
|
300907
|
+
logForDebugging(edeDiagnostic, { level: "warn" });
|
|
300865
300908
|
yield {
|
|
300866
300909
|
type: "result",
|
|
300867
300910
|
subtype: "error_during_execution",
|
|
@@ -300877,14 +300920,10 @@ class QueryEngine {
|
|
|
300877
300920
|
permission_denials: this.permissionDenials,
|
|
300878
300921
|
fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
|
|
300879
300922
|
uuid: randomUUID23(),
|
|
300880
|
-
errors: (
|
|
300881
|
-
|
|
300882
|
-
|
|
300883
|
-
|
|
300884
|
-
`[ede_diagnostic] result_type=${edeResultType} last_content_type=${edeLastContentType} stop_reason=${lastStopReason}`,
|
|
300885
|
-
...all4.slice(start).map((_) => _.error)
|
|
300886
|
-
];
|
|
300887
|
-
})()
|
|
300923
|
+
errors: buildErrorDuringExecutionErrors({
|
|
300924
|
+
recentErrors,
|
|
300925
|
+
stopReason: lastStopReason
|
|
300926
|
+
})
|
|
300888
300927
|
};
|
|
300889
300928
|
return;
|
|
300890
300929
|
}
|
|
@@ -336355,4 +336394,4 @@ export {
|
|
|
336355
336394
|
AbortError2 as AbortError
|
|
336356
336395
|
};
|
|
336357
336396
|
|
|
336358
|
-
//# debugId=
|
|
336397
|
+
//# debugId=B9DA1355E8B3544864756E2164756E21
|
|
@@ -15,6 +15,16 @@ export type PermissionPromptTool = Tool<ReturnType<typeof permissionToolInputSch
|
|
|
15
15
|
* (model chose to emit no content blocks)
|
|
16
16
|
*/
|
|
17
17
|
export declare function isResultSuccessful(message: Message | undefined, stopReason?: string | null): message is Message;
|
|
18
|
+
export declare const ERROR_DURING_EXECUTION_DIAGNOSTIC_PREFIX = "[ede_diagnostic]";
|
|
19
|
+
export declare function buildErrorDuringExecutionDiagnostic({ resultType, lastContentType, stopReason, }: {
|
|
20
|
+
resultType: string;
|
|
21
|
+
lastContentType: string;
|
|
22
|
+
stopReason: string | null;
|
|
23
|
+
}): string;
|
|
24
|
+
export declare function buildErrorDuringExecutionErrors({ recentErrors, stopReason, }: {
|
|
25
|
+
recentErrors: string[];
|
|
26
|
+
stopReason: string | null;
|
|
27
|
+
}): string[];
|
|
18
28
|
export declare function normalizeMessage(message: Message): Generator<SDKMessage>;
|
|
19
29
|
export declare function handleOrphanedPermission(orphanedPermission: OrphanedPermission, tools: Tools, mutableMessages: Message[], processUserInputContext: ProcessUserInputContext): AsyncGenerator<SDKMessage, void, unknown>;
|
|
20
30
|
export declare function extractReadFilesFromMessages(messages: Message[], cwd: string, maxSize?: number): FileStateCache;
|
package/package.json
CHANGED