@cnwenf/occ 2.1.301 → 2.1.303
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 +404 -221
- 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.303","BINARY_NAME":"occ","BUILD_TIME":"2026-08-16T18:17:52.609Z","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;
|
|
@@ -201253,6 +201253,70 @@ var init_dist8 = __esm(() => {
|
|
|
201253
201253
|
init_platform4();
|
|
201254
201254
|
});
|
|
201255
201255
|
|
|
201256
|
+
// src/utils/oauthLoginExpiry.ts
|
|
201257
|
+
function computeOAuthLoginExpiry(tokens, context4, now2 = Date.now()) {
|
|
201258
|
+
if (!context4.providerIsFirstParty || !context4.isClaudeAISubscriber) {
|
|
201259
|
+
return null;
|
|
201260
|
+
}
|
|
201261
|
+
if (!tokens || typeof tokens.refreshTokenExpiresAt !== "number") {
|
|
201262
|
+
return null;
|
|
201263
|
+
}
|
|
201264
|
+
const refreshTokenExpiresAt = tokens.refreshTokenExpiresAt;
|
|
201265
|
+
if (typeof tokens.expiresAt === "number" && tokens.expiresAt > refreshTokenExpiresAt + LOGIN_EXPIRY_WARN_WINDOW_MS) {
|
|
201266
|
+
return null;
|
|
201267
|
+
}
|
|
201268
|
+
const remaining = refreshTokenExpiresAt - now2;
|
|
201269
|
+
if (remaining > LOGIN_EXPIRY_WARN_WINDOW_MS || remaining <= 0) {
|
|
201270
|
+
return null;
|
|
201271
|
+
}
|
|
201272
|
+
return { daysLeft: Math.ceil(remaining / MS_PER_DAY) };
|
|
201273
|
+
}
|
|
201274
|
+
function getOAuthLoginExpiryInfo() {
|
|
201275
|
+
return computeOAuthLoginExpiry(getClaudeAIOAuthTokens(), {
|
|
201276
|
+
providerIsFirstParty: getAPIProvider() === "firstParty",
|
|
201277
|
+
isClaudeAISubscriber: isClaudeAISubscriber()
|
|
201278
|
+
});
|
|
201279
|
+
}
|
|
201280
|
+
function pluralize2(count3, noun) {
|
|
201281
|
+
return count3 === 1 ? noun : `${noun}s`;
|
|
201282
|
+
}
|
|
201283
|
+
var MS_PER_DAY = 86400000, LOGIN_EXPIRY_WARN_WINDOW_MS;
|
|
201284
|
+
var init_oauthLoginExpiry = __esm(() => {
|
|
201285
|
+
init_providers();
|
|
201286
|
+
init_auth6();
|
|
201287
|
+
LOGIN_EXPIRY_WARN_WINDOW_MS = 3 * MS_PER_DAY;
|
|
201288
|
+
});
|
|
201289
|
+
|
|
201290
|
+
// src/tools/WebFetchTool/cacheTtl.ts
|
|
201291
|
+
function getWebFetchCacheTtlMs() {
|
|
201292
|
+
return cachedWebFetchCacheTtlMs ??= (() => {
|
|
201293
|
+
const raw = process.env.CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS;
|
|
201294
|
+
if (raw === undefined) {
|
|
201295
|
+
return DEFAULT_WEBFETCH_CACHE_TTL_MS;
|
|
201296
|
+
}
|
|
201297
|
+
if (!/^[+-]?\d+$/.test(raw.trim())) {
|
|
201298
|
+
return DEFAULT_WEBFETCH_CACHE_TTL_MS;
|
|
201299
|
+
}
|
|
201300
|
+
const parsed = parseEnvInt(raw);
|
|
201301
|
+
if (parsed === undefined || !Number.isFinite(parsed)) {
|
|
201302
|
+
return DEFAULT_WEBFETCH_CACHE_TTL_MS;
|
|
201303
|
+
}
|
|
201304
|
+
if (parsed < 1) {
|
|
201305
|
+
return DEFAULT_WEBFETCH_CACHE_TTL_MS;
|
|
201306
|
+
}
|
|
201307
|
+
return parsed;
|
|
201308
|
+
})();
|
|
201309
|
+
}
|
|
201310
|
+
function getWebFetchCacheTtlDescription() {
|
|
201311
|
+
const minutes = Math.max(1, Math.round(getWebFetchCacheTtlMs() / 60000));
|
|
201312
|
+
return `${minutes} ${pluralize2(minutes, "minute")}`;
|
|
201313
|
+
}
|
|
201314
|
+
var DEFAULT_WEBFETCH_CACHE_TTL_MS = 900000, cachedWebFetchCacheTtlMs;
|
|
201315
|
+
var init_cacheTtl = __esm(() => {
|
|
201316
|
+
init_envValidation();
|
|
201317
|
+
init_oauthLoginExpiry();
|
|
201318
|
+
});
|
|
201319
|
+
|
|
201256
201320
|
// src/tools/WebFetchTool/prompt.ts
|
|
201257
201321
|
function makeSecondaryModelPrompt(markdownContent, prompt, isPreapprovedDomain) {
|
|
201258
201322
|
const guidelines = isPreapprovedDomain ? `Provide a concise response based on the content above. Include relevant details, code examples, and documentation excerpts as needed.` : `Provide a concise response based only on the content above. In your response:
|
|
@@ -201271,7 +201335,10 @@ ${prompt}
|
|
|
201271
201335
|
${guidelines}
|
|
201272
201336
|
`;
|
|
201273
201337
|
}
|
|
201274
|
-
var WEB_FETCH_TOOL_NAME = "WebFetch", DESCRIPTION5
|
|
201338
|
+
var WEB_FETCH_TOOL_NAME = "WebFetch", DESCRIPTION5;
|
|
201339
|
+
var init_prompt6 = __esm(() => {
|
|
201340
|
+
init_cacheTtl();
|
|
201341
|
+
DESCRIPTION5 = `
|
|
201275
201342
|
- Fetches content from a specified URL and processes it using an AI model
|
|
201276
201343
|
- Takes a URL and a prompt as input
|
|
201277
201344
|
- Fetches the URL content, converts HTML to markdown
|
|
@@ -201286,10 +201353,11 @@ Usage notes:
|
|
|
201286
201353
|
- The prompt should describe what information you want to extract from the page
|
|
201287
201354
|
- This tool is read-only and does not modify any files
|
|
201288
201355
|
- Results may be summarized if the content is very large
|
|
201289
|
-
- Includes a self-cleaning
|
|
201356
|
+
- Includes a self-cleaning cache (entries expire after ${getWebFetchCacheTtlDescription()}) for faster responses when repeatedly accessing the same URL
|
|
201290
201357
|
- When a URL redirects to a different host, the tool will inform you and provide the redirect URL in a special format. You should then make a new WebFetch request with the redirect URL to fetch the content.
|
|
201291
201358
|
- For GitHub URLs, prefer using the gh CLI via Bash instead (e.g., gh pr view, gh issue view, gh api).
|
|
201292
201359
|
`;
|
|
201360
|
+
});
|
|
201293
201361
|
|
|
201294
201362
|
// src/utils/sandbox/sandbox-adapter.ts
|
|
201295
201363
|
var exports_sandbox_adapter = {};
|
|
@@ -201792,6 +201860,7 @@ var init_sandbox_adapter = __esm(() => {
|
|
|
201792
201860
|
init_managedPath();
|
|
201793
201861
|
init_settings2();
|
|
201794
201862
|
init_prompt3();
|
|
201863
|
+
init_prompt6();
|
|
201795
201864
|
init_errors();
|
|
201796
201865
|
init_filesystem();
|
|
201797
201866
|
init_ripgrep();
|
|
@@ -230911,7 +230980,7 @@ function substituteUserConfigVariables(value, userConfig) {
|
|
|
230911
230980
|
return String(configValue);
|
|
230912
230981
|
});
|
|
230913
230982
|
}
|
|
230914
|
-
function substituteUserConfigInContent(content, options, schema) {
|
|
230983
|
+
function substituteUserConfigInContent(content, options, schema, valueTransform) {
|
|
230915
230984
|
return content.replace(/\$\{user_config\.([^}]+)\}/g, (match, key2) => {
|
|
230916
230985
|
if (schema[key2]?.sensitive === true) {
|
|
230917
230986
|
return `[sensitive option '${key2}' not available in skill content]`;
|
|
@@ -230920,7 +230989,7 @@ function substituteUserConfigInContent(content, options, schema) {
|
|
|
230920
230989
|
if (value === undefined) {
|
|
230921
230990
|
return match;
|
|
230922
230991
|
}
|
|
230923
|
-
return String(value);
|
|
230992
|
+
return valueTransform ? valueTransform(String(value)) : String(value);
|
|
230924
230993
|
});
|
|
230925
230994
|
}
|
|
230926
230995
|
var loadPluginOptions;
|
|
@@ -231338,7 +231407,7 @@ IMPORTANT - Use the correct year in search queries:
|
|
|
231338
231407
|
`;
|
|
231339
231408
|
}
|
|
231340
231409
|
var WEB_SEARCH_TOOL_NAME = "WebSearch";
|
|
231341
|
-
var
|
|
231410
|
+
var init_prompt7 = __esm(() => {
|
|
231342
231411
|
init_common2();
|
|
231343
231412
|
});
|
|
231344
231413
|
|
|
@@ -231414,6 +231483,7 @@ var init_claudeCodeGuideAgent = __esm(() => {
|
|
|
231414
231483
|
init_prompt3();
|
|
231415
231484
|
init_prompt2();
|
|
231416
231485
|
init_prompt6();
|
|
231486
|
+
init_prompt7();
|
|
231417
231487
|
init_auth6();
|
|
231418
231488
|
init_embeddedTools();
|
|
231419
231489
|
init_settings2();
|
|
@@ -231824,6 +231894,7 @@ var init_statuslineSetup = __esm(() => {
|
|
|
231824
231894
|
var VERIFICATION_SYSTEM_PROMPT, VERIFICATION_WHEN_TO_USE = "Use this agent to verify that implementation work is correct before reporting completion. Invoke after non-trivial tasks (3+ file edits, backend/API changes, infrastructure changes). Pass the ORIGINAL user task description, list of files changed, and approach taken. The agent runs builds, tests, linters, and checks to produce a PASS/FAIL/PARTIAL verdict with evidence.", VERIFICATION_AGENT;
|
|
231825
231895
|
var init_verificationAgent = __esm(() => {
|
|
231826
231896
|
init_prompt4();
|
|
231897
|
+
init_prompt6();
|
|
231827
231898
|
init_constants3();
|
|
231828
231899
|
VERIFICATION_SYSTEM_PROMPT = `You are a verification specialist. Your job is not to confirm the implementation works \u2014 it's to try to break it.
|
|
231829
231900
|
|
|
@@ -232504,14 +232575,14 @@ __export(exports_prompt2, {
|
|
|
232504
232575
|
SEND_USER_FILE_TOOL_NAME: () => SEND_USER_FILE_TOOL_NAME
|
|
232505
232576
|
});
|
|
232506
232577
|
var SEND_USER_FILE_TOOL_NAME = "";
|
|
232507
|
-
var
|
|
232578
|
+
var init_prompt8 = () => {};
|
|
232508
232579
|
|
|
232509
232580
|
// src/tools/EnterPlanModeTool/constants.ts
|
|
232510
232581
|
var ENTER_PLAN_MODE_TOOL_NAME = "EnterPlanMode", PLAN_MODE_AUTO_BASH_HANDLING_ENABLED = true;
|
|
232511
232582
|
|
|
232512
232583
|
// src/tools/AskUserQuestionTool/prompt.ts
|
|
232513
232584
|
var ASK_USER_QUESTION_TOOL_NAME = "AskUserQuestion", ASK_USER_QUESTION_TOOL_CHIP_WIDTH = 12, DESCRIPTION6 = "Asks the user multiple choice questions to gather information, clarify ambiguity, understand preferences, make decisions or offer them choices.", PREVIEW_FEATURE_PROMPT, ASK_USER_QUESTION_TOOL_PROMPT;
|
|
232514
|
-
var
|
|
232585
|
+
var init_prompt9 = __esm(() => {
|
|
232515
232586
|
PREVIEW_FEATURE_PROMPT = {
|
|
232516
232587
|
markdown: `
|
|
232517
232588
|
Preview feature:
|
|
@@ -239664,7 +239735,7 @@ function buildCronListPrompt(durableEnabled) {
|
|
|
239664
239735
|
return durableEnabled ? `List all cron jobs scheduled via ${CRON_CREATE_TOOL_NAME}, both durable (.claude/scheduled_tasks.json) and session-only.` : `List all cron jobs scheduled via ${CRON_CREATE_TOOL_NAME} in this session.`;
|
|
239665
239736
|
}
|
|
239666
239737
|
var KAIROS_CRON_REFRESH_MS, DEFAULT_MAX_AGE_DAYS, CRON_CREATE_TOOL_NAME = "CronCreate", CRON_DELETE_TOOL_NAME = "CronDelete", CRON_LIST_TOOL_NAME = "CronList", CRON_DELETE_DESCRIPTION = "Cancel a scheduled cron job by ID", CRON_LIST_DESCRIPTION = "List scheduled cron jobs";
|
|
239667
|
-
var
|
|
239738
|
+
var init_prompt10 = __esm(() => {
|
|
239668
239739
|
init_featureFlags();
|
|
239669
239740
|
init_growthbook();
|
|
239670
239741
|
init_cronTasks();
|
|
@@ -239678,15 +239749,16 @@ var ALL_AGENT_DISALLOWED_TOOLS, CUSTOM_AGENT_DISALLOWED_TOOLS, ASYNC_AGENT_ALLOW
|
|
|
239678
239749
|
var init_tools = __esm(() => {
|
|
239679
239750
|
init_featureFlags();
|
|
239680
239751
|
init_constants3();
|
|
239681
|
-
|
|
239752
|
+
init_prompt9();
|
|
239682
239753
|
init_prompt3();
|
|
239683
|
-
|
|
239754
|
+
init_prompt7();
|
|
239684
239755
|
init_prompt2();
|
|
239756
|
+
init_prompt6();
|
|
239685
239757
|
init_shellToolUtils();
|
|
239686
239758
|
init_prompt4();
|
|
239687
|
-
|
|
239759
|
+
init_prompt11();
|
|
239688
239760
|
init_SyntheticOutputTool();
|
|
239689
|
-
|
|
239761
|
+
init_prompt10();
|
|
239690
239762
|
ALL_AGENT_DISALLOWED_TOOLS = new Set([
|
|
239691
239763
|
TASK_OUTPUT_TOOL_NAME,
|
|
239692
239764
|
EXIT_PLAN_MODE_V2_TOOL_NAME,
|
|
@@ -240241,13 +240313,13 @@ Query forms:
|
|
|
240241
240313
|
- "select:Read,Edit,Grep" \u2014 fetch these exact tools by name
|
|
240242
240314
|
- "notebook jupyter" \u2014 keyword search, up to max_results best matches
|
|
240243
240315
|
- "+slack send" \u2014 require "slack" in the name, rank by remaining terms`;
|
|
240244
|
-
var
|
|
240316
|
+
var init_prompt11 = __esm(() => {
|
|
240245
240317
|
init_featureFlags();
|
|
240246
240318
|
init_state();
|
|
240247
240319
|
init_growthbook();
|
|
240248
240320
|
init_constants3();
|
|
240249
240321
|
BRIEF_TOOL_NAME3 = feature("KAIROS") || feature("KAIROS_BRIEF") ? (init_prompt(), __toCommonJS(exports_prompt)).BRIEF_TOOL_NAME : null;
|
|
240250
|
-
SEND_USER_FILE_TOOL_NAME2 = feature("KAIROS") ? (
|
|
240322
|
+
SEND_USER_FILE_TOOL_NAME2 = feature("KAIROS") ? (init_prompt8(), __toCommonJS(exports_prompt2)).SEND_USER_FILE_TOOL_NAME : null;
|
|
240251
240323
|
});
|
|
240252
240324
|
|
|
240253
240325
|
// node_modules/.bun/diff@8.0.4/node_modules/diff/libesm/diff/base.js
|
|
@@ -241699,6 +241771,7 @@ var init_microCompact = __esm(() => {
|
|
|
241699
241771
|
init_prompt4();
|
|
241700
241772
|
init_prompt2();
|
|
241701
241773
|
init_prompt6();
|
|
241774
|
+
init_prompt7();
|
|
241702
241775
|
init_debug();
|
|
241703
241776
|
init_model();
|
|
241704
241777
|
init_shellToolUtils();
|
|
@@ -260291,7 +260364,7 @@ var init_ToolSearchTool = __esm(() => {
|
|
|
260291
260364
|
init_debug();
|
|
260292
260365
|
init_stringUtils();
|
|
260293
260366
|
init_toolSearch();
|
|
260294
|
-
|
|
260367
|
+
init_prompt11();
|
|
260295
260368
|
inputSchema3 = lazySchema(() => exports_external.object({
|
|
260296
260369
|
query: exports_external.string().describe('Query to find deferred tools. Use "select:<tool_name>" for direct selection, or keywords to search.'),
|
|
260297
260370
|
max_results: exports_external.number().optional().default(5).describe("Maximum number of results to return (default: 5)")
|
|
@@ -264247,7 +264320,7 @@ Usage notes:
|
|
|
264247
264320
|
|
|
264248
264321
|
${forkEnabled ? forkExamples : currentExamples}`;
|
|
264249
264322
|
}
|
|
264250
|
-
var
|
|
264323
|
+
var init_prompt12 = __esm(() => {
|
|
264251
264324
|
init_growthbook();
|
|
264252
264325
|
init_auth6();
|
|
264253
264326
|
init_embeddedTools();
|
|
@@ -266484,7 +266557,7 @@ var init_fableCredits = __esm(() => {
|
|
|
266484
266557
|
|
|
266485
266558
|
// src/tools/SleepTool/prompt.ts
|
|
266486
266559
|
var SLEEP_TOOL_NAME = "Sleep", SLEEP_TOOL_PROMPT;
|
|
266487
|
-
var
|
|
266560
|
+
var init_prompt13 = __esm(() => {
|
|
266488
266561
|
init_xml();
|
|
266489
266562
|
SLEEP_TOOL_PROMPT = `Wait for a specified duration. The user can interrupt the sleep at any time.
|
|
266490
266563
|
|
|
@@ -376216,6 +376289,46 @@ function getMaxBashTimeoutMs(env6 = process.env) {
|
|
|
376216
376289
|
}
|
|
376217
376290
|
var DEFAULT_TIMEOUT_MS = 120000, MAX_TIMEOUT_MS = 600000;
|
|
376218
376291
|
|
|
376292
|
+
// src/utils/todoToolsAvailability.ts
|
|
376293
|
+
function isModelAtOrAboveRestrictedThreshold(modelId, restricted) {
|
|
376294
|
+
const match = /^claude-([a-z]+)-(\d+(?:-\d+)*)$/.exec(modelId);
|
|
376295
|
+
const family = match?.[1];
|
|
376296
|
+
const version5 = match?.[2];
|
|
376297
|
+
if (!family || !version5) {
|
|
376298
|
+
return false;
|
|
376299
|
+
}
|
|
376300
|
+
const threshold = restricted.find(([f4]) => f4 === family)?.[1];
|
|
376301
|
+
if (!threshold) {
|
|
376302
|
+
return false;
|
|
376303
|
+
}
|
|
376304
|
+
const segments = version5.split("-").map(Number);
|
|
376305
|
+
for (let i6 = 0;i6 < Math.max(segments.length, threshold.length); i6++) {
|
|
376306
|
+
const diff2 = (segments[i6] ?? 0) - (threshold[i6] ?? 0);
|
|
376307
|
+
if (diff2 !== 0) {
|
|
376308
|
+
return diff2 > 0;
|
|
376309
|
+
}
|
|
376310
|
+
}
|
|
376311
|
+
return true;
|
|
376312
|
+
}
|
|
376313
|
+
function areTodoToolsAvailable() {
|
|
376314
|
+
const model = getMainLoopModel();
|
|
376315
|
+
if (!isModelAtOrAboveRestrictedThreshold(model, TODO_TOOL_RESTRICTED_MODELS)) {
|
|
376316
|
+
return true;
|
|
376317
|
+
}
|
|
376318
|
+
return isEnvTruthy(process.env.CLAUDE_CODE_ENABLE_TODO_TOOLS);
|
|
376319
|
+
}
|
|
376320
|
+
var TODO_TOOL_RESTRICTED_MODELS;
|
|
376321
|
+
var init_todoToolsAvailability = __esm(() => {
|
|
376322
|
+
init_envUtils();
|
|
376323
|
+
init_model();
|
|
376324
|
+
TODO_TOOL_RESTRICTED_MODELS = [
|
|
376325
|
+
["opus", [4, 8]],
|
|
376326
|
+
["sonnet", [5]],
|
|
376327
|
+
["fable", [5]],
|
|
376328
|
+
["mythos", [5]]
|
|
376329
|
+
];
|
|
376330
|
+
});
|
|
376331
|
+
|
|
376219
376332
|
// src/utils/todo/types.ts
|
|
376220
376333
|
var TodoStatusSchema, TodoItemSchema, TodoListSchema;
|
|
376221
376334
|
var init_types12 = __esm(() => {
|
|
@@ -376231,7 +376344,7 @@ var init_types12 = __esm(() => {
|
|
|
376231
376344
|
|
|
376232
376345
|
// src/tools/TodoWriteTool/prompt.ts
|
|
376233
376346
|
var PROMPT2, DESCRIPTION7 = "Update the todo list for the current session. To be used proactively and often to track progress and pending tasks. Make sure that at least one task is in_progress at all times. Always provide both content (imperative) and activeForm (present continuous) for each task.";
|
|
376234
|
-
var
|
|
376347
|
+
var init_prompt14 = __esm(() => {
|
|
376235
376348
|
PROMPT2 = `Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
|
|
376236
376349
|
It also helps the user understand the progress of the task and overall progress of their requests.
|
|
376237
376350
|
|
|
@@ -376422,9 +376535,10 @@ var init_TodoWriteTool = __esm(() => {
|
|
|
376422
376535
|
init_growthbook();
|
|
376423
376536
|
init_Tool();
|
|
376424
376537
|
init_tasks();
|
|
376538
|
+
init_todoToolsAvailability();
|
|
376425
376539
|
init_types12();
|
|
376426
376540
|
init_constants3();
|
|
376427
|
-
|
|
376541
|
+
init_prompt14();
|
|
376428
376542
|
inputSchema8 = lazySchema(() => exports_external.strictObject({
|
|
376429
376543
|
todos: TodoListSchema().describe("The updated todo list")
|
|
376430
376544
|
}));
|
|
@@ -376455,7 +376569,7 @@ var init_TodoWriteTool = __esm(() => {
|
|
|
376455
376569
|
},
|
|
376456
376570
|
shouldDefer: true,
|
|
376457
376571
|
isEnabled() {
|
|
376458
|
-
return !isTodoV2Enabled();
|
|
376572
|
+
return !isTodoV2Enabled() && areTodoToolsAvailable();
|
|
376459
376573
|
},
|
|
376460
376574
|
toAutoClassifierInput(input) {
|
|
376461
376575
|
return `${input.todos.length} items`;
|
|
@@ -376796,7 +376910,7 @@ function getSimplePrompt() {
|
|
|
376796
376910
|
].join(`
|
|
376797
376911
|
`);
|
|
376798
376912
|
}
|
|
376799
|
-
var
|
|
376913
|
+
var init_prompt15 = __esm(() => {
|
|
376800
376914
|
init_featureFlags();
|
|
376801
376915
|
init_prompts4();
|
|
376802
376916
|
init_attribution();
|
|
@@ -379668,33 +379782,6 @@ function validateOutputRedirections(redirections, cwd2, toolPermissionContext, c
|
|
|
379668
379782
|
message: "No unsafe redirections found"
|
|
379669
379783
|
};
|
|
379670
379784
|
}
|
|
379671
|
-
function validateInputRedirections(astRedirects, cwd2, toolPermissionContext) {
|
|
379672
|
-
for (const r4 of astRedirects) {
|
|
379673
|
-
if (r4.op !== "<" || r4.target === "/dev/null") {
|
|
379674
|
-
continue;
|
|
379675
|
-
}
|
|
379676
|
-
const { allowed, resolvedPath, decisionReason } = validatePath(r4.target, cwd2, toolPermissionContext, "read");
|
|
379677
|
-
if (allowed) {
|
|
379678
|
-
continue;
|
|
379679
|
-
}
|
|
379680
|
-
const message = decisionReason?.type === "other" || decisionReason?.type === "safetyCheck" ? decisionReason.reason : decisionReason?.type === "rule" ? `Input redirection from '${resolvedPath}' was blocked by a deny rule.` : `Input redirection from '${resolvedPath}' was blocked. For security, Claude Code may only read files in the allowed working directories for this session.`;
|
|
379681
|
-
if (decisionReason?.type === "rule") {
|
|
379682
|
-
return { behavior: "deny", message, decisionReason };
|
|
379683
|
-
}
|
|
379684
|
-
const suggestion = decisionReason === undefined ? createReadRuleSuggestion(getDirectoryForPath(resolvedPath), "session") : undefined;
|
|
379685
|
-
return {
|
|
379686
|
-
behavior: "ask",
|
|
379687
|
-
message,
|
|
379688
|
-
blockedPath: resolvedPath,
|
|
379689
|
-
decisionReason,
|
|
379690
|
-
...suggestion !== undefined && { suggestions: [suggestion] }
|
|
379691
|
-
};
|
|
379692
|
-
}
|
|
379693
|
-
return {
|
|
379694
|
-
behavior: "passthrough",
|
|
379695
|
-
message: "No unsafe input redirections found"
|
|
379696
|
-
};
|
|
379697
|
-
}
|
|
379698
379785
|
function checkPathConstraints(input, cwd2, toolPermissionContext, compoundCommandHasCd, astRedirects, astCommands) {
|
|
379699
379786
|
if (!astCommands && />>\s*>\s*\(|>\s*>\s*\(|<\s*\(/.test(input.command)) {
|
|
379700
379787
|
return {
|
|
@@ -379721,12 +379808,6 @@ function checkPathConstraints(input, cwd2, toolPermissionContext, compoundComman
|
|
|
379721
379808
|
if (redirectionResult.behavior !== "passthrough") {
|
|
379722
379809
|
return redirectionResult;
|
|
379723
379810
|
}
|
|
379724
|
-
if (astRedirects) {
|
|
379725
|
-
const inputRedirectResult = validateInputRedirections(astRedirects, cwd2, toolPermissionContext);
|
|
379726
|
-
if (inputRedirectResult.behavior !== "passthrough") {
|
|
379727
|
-
return inputRedirectResult;
|
|
379728
|
-
}
|
|
379729
|
-
}
|
|
379730
379811
|
if (astCommands) {
|
|
379731
379812
|
for (const cmd of astCommands) {
|
|
379732
379813
|
const result = validateSinglePathCommandArgv(cmd, cwd2, toolPermissionContext, compoundCommandHasCd);
|
|
@@ -382956,7 +383037,7 @@ var init_BashTool = __esm(() => {
|
|
|
382956
383037
|
init_gitOperationTracking();
|
|
382957
383038
|
init_bashPermissions();
|
|
382958
383039
|
init_commandSemantics();
|
|
382959
|
-
|
|
383040
|
+
init_prompt15();
|
|
382960
383041
|
init_readOnlyValidation();
|
|
382961
383042
|
init_sedEditParser();
|
|
382962
383043
|
init_shouldUseSandbox();
|
|
@@ -389536,6 +389617,71 @@ function computeFingerprintFromMessages(messages) {
|
|
|
389536
389617
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
389537
389618
|
var init_fingerprint = () => {};
|
|
389538
389619
|
|
|
389620
|
+
// src/utils/model/unrecognizedModelSignal.ts
|
|
389621
|
+
function isModelRecognized(model) {
|
|
389622
|
+
return KNOWN_CANONICAL_MODELS.has(getCanonicalName(model)) || KNOWN_FULL_MODEL_IDS.has(model.toLowerCase());
|
|
389623
|
+
}
|
|
389624
|
+
function signalUnrecognizedModel(model, querySource) {
|
|
389625
|
+
try {
|
|
389626
|
+
if (model.includes("application-inference-profile")) {
|
|
389627
|
+
return;
|
|
389628
|
+
}
|
|
389629
|
+
const normalized = normalizeModelStringForAPI(model);
|
|
389630
|
+
const claimKey = `unrecognized-model-signal:${normalized}`;
|
|
389631
|
+
if (claimedSignals.has(claimKey)) {
|
|
389632
|
+
return;
|
|
389633
|
+
}
|
|
389634
|
+
claimedSignals.add(claimKey);
|
|
389635
|
+
if (isModelRecognized(model) || isModelRecognized(normalized)) {
|
|
389636
|
+
return;
|
|
389637
|
+
}
|
|
389638
|
+
logEvent2("tengu_api_unrecognized_model", {
|
|
389639
|
+
model,
|
|
389640
|
+
querySource
|
|
389641
|
+
});
|
|
389642
|
+
const line = `${UNRECOGNIZED_MODEL_TAG} ${JSON.stringify({ model, query_source: querySource })}`.replace(CONTROL_CHARS_PATTERN, "");
|
|
389643
|
+
if (getIsNonInteractiveSession() && process.env.CLAUDE_CODE_SESSION_KIND !== "bg") {
|
|
389644
|
+
process.stderr.write(`${line}
|
|
389645
|
+
`);
|
|
389646
|
+
} else {
|
|
389647
|
+
logForDebugging(line, { level: "warn" });
|
|
389648
|
+
}
|
|
389649
|
+
} catch {}
|
|
389650
|
+
}
|
|
389651
|
+
var UNRECOGNIZED_MODEL_TAG = "[claude-code:unrecognized_model]", CONTROL_CHARS_PATTERN, claimedSignals, KNOWN_CANONICAL_MODELS, KNOWN_FULL_MODEL_IDS;
|
|
389652
|
+
var init_unrecognizedModelSignal = __esm(() => {
|
|
389653
|
+
init_state();
|
|
389654
|
+
init_analytics();
|
|
389655
|
+
init_debug();
|
|
389656
|
+
init_model();
|
|
389657
|
+
CONTROL_CHARS_PATTERN = /[\x00-\x08\x0e-\x1f\x7f-\x9f]/g;
|
|
389658
|
+
claimedSignals = new Set;
|
|
389659
|
+
KNOWN_CANONICAL_MODELS = new Set([
|
|
389660
|
+
"claude-opus-5",
|
|
389661
|
+
"claude-opus-4-8",
|
|
389662
|
+
"claude-opus-4-7",
|
|
389663
|
+
"claude-opus-4-6",
|
|
389664
|
+
"claude-opus-4-5",
|
|
389665
|
+
"claude-opus-4-1",
|
|
389666
|
+
"claude-opus-4",
|
|
389667
|
+
"claude-sonnet-5",
|
|
389668
|
+
"claude-sonnet-4-6",
|
|
389669
|
+
"claude-sonnet-4-5",
|
|
389670
|
+
"claude-sonnet-4",
|
|
389671
|
+
"claude-haiku-4-5",
|
|
389672
|
+
"claude-fable-5",
|
|
389673
|
+
"claude-3-7-sonnet",
|
|
389674
|
+
"claude-3-5-sonnet",
|
|
389675
|
+
"claude-3-5-haiku",
|
|
389676
|
+
"claude-3-opus",
|
|
389677
|
+
"claude-3-sonnet",
|
|
389678
|
+
"claude-3-haiku"
|
|
389679
|
+
]);
|
|
389680
|
+
KNOWN_FULL_MODEL_IDS = new Set([
|
|
389681
|
+
"claude-mythos-preview"
|
|
389682
|
+
]);
|
|
389683
|
+
});
|
|
389684
|
+
|
|
389539
389685
|
// src/utils/sideQuery.ts
|
|
389540
389686
|
function extractFirstUserMessageText(messages) {
|
|
389541
389687
|
const firstUserMessage = messages.find((m5) => m5.role === "user");
|
|
@@ -389563,6 +389709,7 @@ async function sideQuery(opts) {
|
|
|
389563
389709
|
thinking,
|
|
389564
389710
|
stop_sequences
|
|
389565
389711
|
} = opts;
|
|
389712
|
+
signalUnrecognizedModel(model, opts.querySource);
|
|
389566
389713
|
const client8 = await getAnthropicClient({
|
|
389567
389714
|
maxRetries,
|
|
389568
389715
|
model,
|
|
@@ -389642,6 +389789,7 @@ var init_sideQuery = __esm(() => {
|
|
|
389642
389789
|
init_betas2();
|
|
389643
389790
|
init_fingerprint();
|
|
389644
389791
|
init_model();
|
|
389792
|
+
init_unrecognizedModelSignal();
|
|
389645
389793
|
});
|
|
389646
389794
|
|
|
389647
389795
|
// src/utils/permissions/expandWithDefaults.ts
|
|
@@ -449298,7 +449446,7 @@ Usage:${getPreReadInstruction2()}
|
|
|
449298
449446
|
- The edit will FAIL if \`old_string\` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use \`replace_all\` to change every instance of \`old_string\`.${minimalUniquenessHint}
|
|
449299
449447
|
- Use \`replace_all\` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.`;
|
|
449300
449448
|
}
|
|
449301
|
-
var
|
|
449449
|
+
var init_prompt16 = __esm(() => {
|
|
449302
449450
|
init_file();
|
|
449303
449451
|
init_prompt3();
|
|
449304
449452
|
});
|
|
@@ -449358,7 +449506,7 @@ var init_FileEditTool = __esm(() => {
|
|
|
449358
449506
|
init_fileStateGuard();
|
|
449359
449507
|
init_shellRuleMatching();
|
|
449360
449508
|
init_validateEditTool();
|
|
449361
|
-
|
|
449509
|
+
init_prompt16();
|
|
449362
449510
|
init_types10();
|
|
449363
449511
|
init_UI2();
|
|
449364
449512
|
init_utils8();
|
|
@@ -450462,7 +450610,7 @@ __export(exports_prompt5, {
|
|
|
450462
450610
|
SNIP_TOOL_NAME: () => SNIP_TOOL_NAME
|
|
450463
450611
|
});
|
|
450464
450612
|
var SNIP_TOOL_NAME = "";
|
|
450465
|
-
var
|
|
450613
|
+
var init_prompt17 = () => {};
|
|
450466
450614
|
|
|
450467
450615
|
// src/utils/collapseReadSearch.ts
|
|
450468
450616
|
function getFirstContentItem(content) {
|
|
@@ -451054,12 +451202,12 @@ var init_collapseReadSearch = __esm(() => {
|
|
|
451054
451202
|
init_constants9();
|
|
451055
451203
|
init_primitiveTools();
|
|
451056
451204
|
init_gitOperationTracking();
|
|
451057
|
-
|
|
451205
|
+
init_prompt11();
|
|
451058
451206
|
init_file();
|
|
451059
451207
|
init_fullscreen();
|
|
451060
451208
|
init_memoryFileDetection();
|
|
451061
451209
|
teamMemOps = feature("TEAMMEM") ? (init_teamMemoryOps(), __toCommonJS(exports_teamMemoryOps)) : null;
|
|
451062
|
-
SNIP_TOOL_NAME2 = feature("HISTORY_SNIP") ? (
|
|
451210
|
+
SNIP_TOOL_NAME2 = feature("HISTORY_SNIP") ? (init_prompt17(), __toCommonJS(exports_prompt5)).SNIP_TOOL_NAME : null;
|
|
451063
451211
|
});
|
|
451064
451212
|
|
|
451065
451213
|
// src/components/TaskListV2.tsx
|
|
@@ -474659,7 +474807,7 @@ var init_conversationRecovery = __esm(() => {
|
|
|
474659
474807
|
init_sessionStorage();
|
|
474660
474808
|
BRIEF_TOOL_NAME4 = feature("KAIROS") || feature("KAIROS_BRIEF") ? (init_prompt(), __toCommonJS(exports_prompt)).BRIEF_TOOL_NAME : null;
|
|
474661
474809
|
LEGACY_BRIEF_TOOL_NAME2 = feature("KAIROS") || feature("KAIROS_BRIEF") ? (init_prompt(), __toCommonJS(exports_prompt)).LEGACY_BRIEF_TOOL_NAME : null;
|
|
474662
|
-
SEND_USER_FILE_TOOL_NAME3 = feature("KAIROS") ? (
|
|
474810
|
+
SEND_USER_FILE_TOOL_NAME3 = feature("KAIROS") ? (init_prompt8(), __toCommonJS(exports_prompt2)).SEND_USER_FILE_TOOL_NAME : null;
|
|
474663
474811
|
});
|
|
474664
474812
|
|
|
474665
474813
|
// src/services/api/filesApi.ts
|
|
@@ -477857,7 +478005,7 @@ var init_AgentTool = __esm(() => {
|
|
|
477857
478005
|
init_constants3();
|
|
477858
478006
|
init_forkSubagent();
|
|
477859
478007
|
init_loadAgentsDir();
|
|
477860
|
-
|
|
478008
|
+
init_prompt12();
|
|
477861
478009
|
init_runAgent();
|
|
477862
478010
|
init_UI8();
|
|
477863
478011
|
jsx_runtime135 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -479222,7 +479370,7 @@ var init_SkillTool = __esm(() => {
|
|
|
479222
479370
|
init_skillUsageTracking();
|
|
479223
479371
|
init_uuid();
|
|
479224
479372
|
init_runAgent();
|
|
479225
|
-
|
|
479373
|
+
init_prompt27();
|
|
479226
479374
|
init_skillAttribution();
|
|
479227
479375
|
init_loadSkillsDir();
|
|
479228
479376
|
init_UI9();
|
|
@@ -496833,7 +496981,7 @@ async function applyPromptToMarkdown(prompt, markdownContent, signal, isNonInter
|
|
|
496833
496981
|
}
|
|
496834
496982
|
return "No response from model";
|
|
496835
496983
|
}
|
|
496836
|
-
var DomainBlockedError, DomainCheckFailedError, EgressBlockedError,
|
|
496984
|
+
var DomainBlockedError, DomainCheckFailedError, EgressBlockedError, MAX_CACHE_SIZE_BYTES, URL_CACHE, DOMAIN_CHECK_CACHE, turndownServicePromise, MAX_URL_LENGTH = 2000, MAX_HTTP_CONTENT_LENGTH = 10485760, FETCH_TIMEOUT_MS3 = 60000, DOMAIN_CHECK_TIMEOUT_MS = 1e4, MAX_REDIRECTS = 10, MAX_MARKDOWN_LENGTH = 1e5;
|
|
496837
496985
|
var init_utils12 = __esm(() => {
|
|
496838
496986
|
init_axios2();
|
|
496839
496987
|
init_index_min();
|
|
@@ -496844,7 +496992,9 @@ var init_utils12 = __esm(() => {
|
|
|
496844
496992
|
init_log3();
|
|
496845
496993
|
init_mcpOutputStorage();
|
|
496846
496994
|
init_settings2();
|
|
496995
|
+
init_cacheTtl();
|
|
496847
496996
|
init_preapproved();
|
|
496997
|
+
init_prompt6();
|
|
496848
496998
|
DomainBlockedError = class DomainBlockedError extends Error {
|
|
496849
496999
|
constructor(domain2) {
|
|
496850
497000
|
super(`Claude Code is unable to fetch from ${domain2}`);
|
|
@@ -496869,11 +497019,10 @@ var init_utils12 = __esm(() => {
|
|
|
496869
497019
|
this.name = "EgressBlockedError";
|
|
496870
497020
|
}
|
|
496871
497021
|
};
|
|
496872
|
-
CACHE_TTL_MS3 = 15 * 60 * 1000;
|
|
496873
497022
|
MAX_CACHE_SIZE_BYTES = 50 * 1024 * 1024;
|
|
496874
497023
|
URL_CACHE = new L({
|
|
496875
497024
|
maxSize: MAX_CACHE_SIZE_BYTES,
|
|
496876
|
-
ttl:
|
|
497025
|
+
ttl: getWebFetchCacheTtlMs()
|
|
496877
497026
|
});
|
|
496878
497027
|
DOMAIN_CHECK_CACHE = new L({
|
|
496879
497028
|
max: 128,
|
|
@@ -496912,6 +497061,7 @@ var init_WebFetchTool = __esm(() => {
|
|
|
496912
497061
|
init_format();
|
|
496913
497062
|
init_permissions2();
|
|
496914
497063
|
init_preapproved();
|
|
497064
|
+
init_prompt6();
|
|
496915
497065
|
init_UI10();
|
|
496916
497066
|
init_utils12();
|
|
496917
497067
|
inputSchema14 = lazySchema(() => exports_external.strictObject({
|
|
@@ -497196,7 +497346,7 @@ var init_CronCreateTool = __esm(() => {
|
|
|
497196
497346
|
init_cronTasks();
|
|
497197
497347
|
init_semanticBoolean();
|
|
497198
497348
|
init_teammateContext();
|
|
497199
|
-
|
|
497349
|
+
init_prompt10();
|
|
497200
497350
|
init_UI11();
|
|
497201
497351
|
inputSchema15 = lazySchema(() => exports_external.strictObject({
|
|
497202
497352
|
cron: exports_external.string().describe('Standard 5-field cron expression in local time: "M H DoM Mon DoW" (e.g. "*/5 * * * *" = every 5 minutes, "30 14 28 2 *" = Feb 28 at 2:30pm local once).'),
|
|
@@ -497301,7 +497451,7 @@ var init_CronDeleteTool = __esm(() => {
|
|
|
497301
497451
|
init_Tool();
|
|
497302
497452
|
init_cronTasks();
|
|
497303
497453
|
init_teammateContext();
|
|
497304
|
-
|
|
497454
|
+
init_prompt10();
|
|
497305
497455
|
init_UI11();
|
|
497306
497456
|
inputSchema16 = lazySchema(() => exports_external.strictObject({
|
|
497307
497457
|
id: exports_external.string().describe("Job ID returned by CronCreate.")
|
|
@@ -497380,7 +497530,7 @@ var init_CronListTool = __esm(() => {
|
|
|
497380
497530
|
init_cronTasks();
|
|
497381
497531
|
init_format();
|
|
497382
497532
|
init_teammateContext();
|
|
497383
|
-
|
|
497533
|
+
init_prompt10();
|
|
497384
497534
|
init_UI11();
|
|
497385
497535
|
inputSchema17 = lazySchema(() => exports_external.strictObject({}));
|
|
497386
497536
|
outputSchema16 = lazySchema(() => exports_external.object({
|
|
@@ -559657,18 +559807,18 @@ function parseFolderPath(folderPath) {
|
|
|
559657
559807
|
}
|
|
559658
559808
|
return { platform: platform5, buildId };
|
|
559659
559809
|
}
|
|
559660
|
-
var
|
|
559810
|
+
var import_debug176, debugCache;
|
|
559661
559811
|
var init_Cache = __esm(() => {
|
|
559662
559812
|
init_browser_data();
|
|
559663
559813
|
init_detectPlatform();
|
|
559664
|
-
|
|
559665
|
-
debugCache =
|
|
559814
|
+
import_debug176 = __toESM(require_src(), 1);
|
|
559815
|
+
debugCache = import_debug176.default("puppeteer:browsers:cache");
|
|
559666
559816
|
});
|
|
559667
559817
|
|
|
559668
559818
|
// node_modules/.bun/@puppeteer+browsers@2.13.2/node_modules/@puppeteer/browsers/lib/esm/debug.js
|
|
559669
|
-
var
|
|
559819
|
+
var import_debug177;
|
|
559670
559820
|
var init_debug3 = __esm(() => {
|
|
559671
|
-
|
|
559821
|
+
import_debug177 = __toESM(require_src(), 1);
|
|
559672
559822
|
});
|
|
559673
559823
|
|
|
559674
559824
|
// node_modules/.bun/@puppeteer+browsers@2.13.2/node_modules/@puppeteer/browsers/lib/esm/launch.js
|
|
@@ -559987,7 +560137,7 @@ var init_launch = __esm(() => {
|
|
|
559987
560137
|
init_Cache();
|
|
559988
560138
|
init_debug3();
|
|
559989
560139
|
init_detectPlatform();
|
|
559990
|
-
debugLaunch =
|
|
560140
|
+
debugLaunch = import_debug177.default("puppeteer:browsers:launcher");
|
|
559991
560141
|
CDP_WEBSOCKET_ENDPOINT_REGEX = /^DevTools listening on (ws:\/\/.*)$/;
|
|
559992
560142
|
WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX = /^WebDriver BiDi listening on (ws:\/\/.*)$/;
|
|
559993
560143
|
processListeners = new Map;
|
|
@@ -565071,10 +565221,10 @@ async function installDMG(dmgPath, folderPath) {
|
|
|
565071
565221
|
spawnSync4("hdiutil", ["detach", mountPath, "-quiet"]);
|
|
565072
565222
|
}
|
|
565073
565223
|
}
|
|
565074
|
-
var
|
|
565224
|
+
var import_debug179, debugFileUtil, internalConstantsForTesting;
|
|
565075
565225
|
var init_fileUtil = __esm(() => {
|
|
565076
|
-
|
|
565077
|
-
debugFileUtil =
|
|
565226
|
+
import_debug179 = __toESM(require_src(), 1);
|
|
565227
|
+
debugFileUtil = import_debug179.default("puppeteer:browsers:fileUtil");
|
|
565078
565228
|
internalConstantsForTesting = {
|
|
565079
565229
|
xz: "xz",
|
|
565080
565230
|
bzip2: "bzip2"
|
|
@@ -565367,7 +565517,7 @@ var init_install = __esm(() => {
|
|
|
565367
565517
|
init_fileUtil();
|
|
565368
565518
|
init_httpUtil();
|
|
565369
565519
|
import_progress = __toESM(require_node_progress(), 1);
|
|
565370
|
-
debugInstall =
|
|
565520
|
+
debugInstall = import_debug177.default("puppeteer:browsers:install");
|
|
565371
565521
|
times = new Map;
|
|
565372
565522
|
});
|
|
565373
565523
|
|
|
@@ -571642,7 +571792,7 @@ import fs22 from "fs";
|
|
|
571642
571792
|
import os16 from "os";
|
|
571643
571793
|
import { dirname as dirname45 } from "path";
|
|
571644
571794
|
import { PassThrough as PassThrough4 } from "stream";
|
|
571645
|
-
var
|
|
571795
|
+
var import_debug181, __runInitializers23 = function(thisArg, initializers, value) {
|
|
571646
571796
|
var useValue = arguments.length > 2;
|
|
571647
571797
|
for (var i6 = 0;i6 < initializers.length; i6++) {
|
|
571648
571798
|
value = useValue ? initializers[i6].call(thisArg, value) : initializers[i6].call(thisArg);
|
|
@@ -571702,8 +571852,8 @@ var init_ScreenRecorder = __esm(() => {
|
|
|
571702
571852
|
init_util6();
|
|
571703
571853
|
init_decorators();
|
|
571704
571854
|
init_disposable();
|
|
571705
|
-
|
|
571706
|
-
debugFfmpeg =
|
|
571855
|
+
import_debug181 = __toESM(require_src(), 1);
|
|
571856
|
+
debugFfmpeg = import_debug181.default("puppeteer:ffmpeg");
|
|
571707
571857
|
ScreenRecorder = (() => {
|
|
571708
571858
|
let _classSuper = PassThrough4;
|
|
571709
571859
|
let _instanceExtraInitializers = [];
|
|
@@ -572133,7 +572283,7 @@ var WEB_BROWSER_NAVIGATE_TOOL_NAME = "navigate", WEB_BROWSER_GET_PAGE_TEXT_TOOL_
|
|
|
572133
572283
|
- browser_batch cannot be nested (a batch action whose name is browser_batch is rejected).
|
|
572134
572284
|
- Prefer browser_batch to execute multiple actions in one call \u2014 it is significantly faster. Batch your next sequence of clicks, types, navigations, and screenshots together.
|
|
572135
572285
|
- Read-only iff every sub-action is read-only. A batch containing navigate (state-mutating) is NOT auto-allowed in plan mode; a batch of only get_page_text/screenshot IS auto-allowed.`;
|
|
572136
|
-
var
|
|
572286
|
+
var init_prompt18 = __esm(() => {
|
|
572137
572287
|
READONLY_SUBACTIONS = new Set([
|
|
572138
572288
|
"get_page_text",
|
|
572139
572289
|
"screenshot"
|
|
@@ -572181,7 +572331,7 @@ var init_WebBrowserTool = __esm(() => {
|
|
|
572181
572331
|
init_preapproved();
|
|
572182
572332
|
init_actions();
|
|
572183
572333
|
init_browser2();
|
|
572184
|
-
|
|
572334
|
+
init_prompt18();
|
|
572185
572335
|
navigateInputSchema = exports_external.strictObject({
|
|
572186
572336
|
url: exports_external.string().describe('The URL to navigate to, or "forward"/"back" to traverse browser history. Bare hostnames are upgraded to https://.'),
|
|
572187
572337
|
tabId: exports_external.number().optional().describe("Ignored in OCC (single shared page).")
|
|
@@ -574521,7 +574671,7 @@ var init_WebSearchTool = __esm(() => {
|
|
|
574521
574671
|
init_messages3();
|
|
574522
574672
|
init_model();
|
|
574523
574673
|
init_slowOperations();
|
|
574524
|
-
|
|
574674
|
+
init_prompt7();
|
|
574525
574675
|
init_UI14();
|
|
574526
574676
|
inputSchema21 = lazySchema(() => exports_external.strictObject({
|
|
574527
574677
|
query: exports_external.string().min(2).describe("The search query to use"),
|
|
@@ -574808,7 +574958,7 @@ var init_inProcessTeammateHelpers = __esm(() => {
|
|
|
574808
574958
|
|
|
574809
574959
|
// src/tools/ExitPlanModeTool/prompt.ts
|
|
574810
574960
|
var ASK_USER_QUESTION_TOOL_NAME2 = "AskUserQuestion", EXIT_PLAN_MODE_V2_TOOL_PROMPT;
|
|
574811
|
-
var
|
|
574961
|
+
var init_prompt19 = __esm(() => {
|
|
574812
574962
|
EXIT_PLAN_MODE_V2_TOOL_PROMPT = `Use this tool when you are in plan mode and have finished writing your plan to the plan file and are ready for user approval.
|
|
574813
574963
|
|
|
574814
574964
|
## How This Tool Works
|
|
@@ -575048,7 +575198,7 @@ var init_ExitPlanModeV2Tool = __esm(() => {
|
|
|
575048
575198
|
init_teammate();
|
|
575049
575199
|
init_teammateMailbox();
|
|
575050
575200
|
init_constants3();
|
|
575051
|
-
|
|
575201
|
+
init_prompt19();
|
|
575052
575202
|
init_UI15();
|
|
575053
575203
|
autoModeStateModule = feature("TRANSCRIPT_CLASSIFIER") ? __toCommonJS(exports_autoModeState) : null;
|
|
575054
575204
|
permissionSetupModule = feature("TRANSCRIPT_CLASSIFIER") ? (init_permissionSetup(), __toCommonJS(exports_permissionSetup)) : null;
|
|
@@ -575481,7 +575631,7 @@ var init_AskUserQuestionTool = __esm(() => {
|
|
|
575481
575631
|
init_v4();
|
|
575482
575632
|
init_ink2();
|
|
575483
575633
|
init_Tool();
|
|
575484
|
-
|
|
575634
|
+
init_prompt9();
|
|
575485
575635
|
import_compiler_runtime117 = __toESM(require_compiler_runtime(), 1);
|
|
575486
575636
|
jsx_runtime144 = __toESM(require_jsx_runtime(), 1);
|
|
575487
575637
|
questionOptionSchema = lazySchema(() => exports_external.object({
|
|
@@ -578537,9 +578687,9 @@ function getEnterPlanModeToolPrompt() {
|
|
|
578537
578687
|
return process.env.USER_TYPE === "ant" ? getEnterPlanModeToolPromptAnt() : getEnterPlanModeToolPromptExternal();
|
|
578538
578688
|
}
|
|
578539
578689
|
var WHAT_HAPPENS_SECTION;
|
|
578540
|
-
var
|
|
578690
|
+
var init_prompt20 = __esm(() => {
|
|
578541
578691
|
init_planModeV2();
|
|
578542
|
-
|
|
578692
|
+
init_prompt9();
|
|
578543
578693
|
WHAT_HAPPENS_SECTION = `## What Happens in Plan Mode
|
|
578544
578694
|
|
|
578545
578695
|
In plan mode, you'll:
|
|
@@ -578617,7 +578767,7 @@ var init_EnterPlanModeTool = __esm(() => {
|
|
|
578617
578767
|
init_PermissionUpdate();
|
|
578618
578768
|
init_permissionSetup();
|
|
578619
578769
|
init_planModeV2();
|
|
578620
|
-
|
|
578770
|
+
init_prompt20();
|
|
578621
578771
|
init_UI20();
|
|
578622
578772
|
inputSchema29 = lazySchema(() => exports_external.strictObject({}));
|
|
578623
578773
|
outputSchema26 = lazySchema(() => exports_external.object({
|
|
@@ -580283,7 +580433,7 @@ ${lines2.join(`
|
|
|
580283
580433
|
}
|
|
580284
580434
|
}
|
|
580285
580435
|
var DESCRIPTION13 = "Get or set Claude Code configuration settings.";
|
|
580286
|
-
var
|
|
580436
|
+
var init_prompt21 = __esm(() => {
|
|
580287
580437
|
init_featureFlags();
|
|
580288
580438
|
init_modelOptions();
|
|
580289
580439
|
init_voiceModeEnabled();
|
|
@@ -581106,7 +581256,7 @@ var init_ConfigTool = __esm(() => {
|
|
|
581106
581256
|
init_log3();
|
|
581107
581257
|
init_settings2();
|
|
581108
581258
|
init_slowOperations();
|
|
581109
|
-
|
|
581259
|
+
init_prompt21();
|
|
581110
581260
|
init_supportedSettings();
|
|
581111
581261
|
init_UI23();
|
|
581112
581262
|
inputSchema32 = lazySchema(() => exports_external.strictObject({
|
|
@@ -581472,7 +581622,7 @@ ${teammateTips}- Check TaskList first to avoid creating duplicate tasks
|
|
|
581472
581622
|
`;
|
|
581473
581623
|
}
|
|
581474
581624
|
var DESCRIPTION14 = "Create a new task in the task list";
|
|
581475
|
-
var
|
|
581625
|
+
var init_prompt22 = __esm(() => {
|
|
581476
581626
|
init_agentSwarmsEnabled();
|
|
581477
581627
|
});
|
|
581478
581628
|
|
|
@@ -581591,8 +581741,9 @@ var init_TaskCreateTool = __esm(() => {
|
|
|
581591
581741
|
init_Tool();
|
|
581592
581742
|
init_hooks5();
|
|
581593
581743
|
init_tasks();
|
|
581744
|
+
init_todoToolsAvailability();
|
|
581594
581745
|
init_teammate();
|
|
581595
|
-
|
|
581746
|
+
init_prompt22();
|
|
581596
581747
|
inputSchema33 = lazySchema(() => exports_external.strictObject({
|
|
581597
581748
|
subject: exports_external.string().describe("A brief title for the task"),
|
|
581598
581749
|
description: exports_external.string().describe("What needs to be done"),
|
|
@@ -581644,7 +581795,7 @@ var init_TaskCreateTool = __esm(() => {
|
|
|
581644
581795
|
},
|
|
581645
581796
|
shouldDefer: true,
|
|
581646
581797
|
isEnabled() {
|
|
581647
|
-
return isTodoV2Enabled();
|
|
581798
|
+
return isTodoV2Enabled() && areTodoToolsAvailable();
|
|
581648
581799
|
},
|
|
581649
581800
|
isConcurrencySafe() {
|
|
581650
581801
|
return true;
|
|
@@ -581739,6 +581890,7 @@ var init_TaskGetTool = __esm(() => {
|
|
|
581739
581890
|
init_v4();
|
|
581740
581891
|
init_Tool();
|
|
581741
581892
|
init_tasks();
|
|
581893
|
+
init_todoToolsAvailability();
|
|
581742
581894
|
inputSchema34 = lazySchema(() => exports_external.strictObject({
|
|
581743
581895
|
taskId: exports_external.string().describe("The ID of the task to retrieve")
|
|
581744
581896
|
}));
|
|
@@ -581773,7 +581925,7 @@ var init_TaskGetTool = __esm(() => {
|
|
|
581773
581925
|
},
|
|
581774
581926
|
shouldDefer: true,
|
|
581775
581927
|
isEnabled() {
|
|
581776
|
-
return isTodoV2Enabled();
|
|
581928
|
+
return isTodoV2Enabled() && areTodoToolsAvailable();
|
|
581777
581929
|
},
|
|
581778
581930
|
isConcurrencySafe() {
|
|
581779
581931
|
return true;
|
|
@@ -581927,6 +582079,7 @@ var init_TaskUpdateTool = __esm(() => {
|
|
|
581927
582079
|
init_agentSwarmsEnabled();
|
|
581928
582080
|
init_hooks5();
|
|
581929
582081
|
init_tasks();
|
|
582082
|
+
init_todoToolsAvailability();
|
|
581930
582083
|
init_teammate();
|
|
581931
582084
|
init_teammateMailbox();
|
|
581932
582085
|
init_constants3();
|
|
@@ -581976,7 +582129,7 @@ var init_TaskUpdateTool = __esm(() => {
|
|
|
581976
582129
|
},
|
|
581977
582130
|
shouldDefer: true,
|
|
581978
582131
|
isEnabled() {
|
|
581979
|
-
return isTodoV2Enabled();
|
|
582132
|
+
return isTodoV2Enabled() && areTodoToolsAvailable();
|
|
581980
582133
|
},
|
|
581981
582134
|
isConcurrencySafe() {
|
|
581982
582135
|
return true;
|
|
@@ -582226,7 +582379,7 @@ Use TaskGet with a specific task ID to view full details including description a
|
|
|
582226
582379
|
${teammateWorkflow}`;
|
|
582227
582380
|
}
|
|
582228
582381
|
var DESCRIPTION17 = "List all tasks in the task list";
|
|
582229
|
-
var
|
|
582382
|
+
var init_prompt23 = __esm(() => {
|
|
582230
582383
|
init_agentSwarmsEnabled();
|
|
582231
582384
|
});
|
|
582232
582385
|
|
|
@@ -582236,7 +582389,8 @@ var init_TaskListTool = __esm(() => {
|
|
|
582236
582389
|
init_v4();
|
|
582237
582390
|
init_Tool();
|
|
582238
582391
|
init_tasks();
|
|
582239
|
-
|
|
582392
|
+
init_todoToolsAvailability();
|
|
582393
|
+
init_prompt23();
|
|
582240
582394
|
inputSchema36 = lazySchema(() => exports_external.strictObject({}));
|
|
582241
582395
|
outputSchema33 = lazySchema(() => exports_external.object({
|
|
582242
582396
|
tasks: exports_external.array(exports_external.object({
|
|
@@ -582268,7 +582422,7 @@ var init_TaskListTool = __esm(() => {
|
|
|
582268
582422
|
},
|
|
582269
582423
|
shouldDefer: true,
|
|
582270
582424
|
isEnabled() {
|
|
582271
|
-
return isTodoV2Enabled();
|
|
582425
|
+
return isTodoV2Enabled() && areTodoToolsAvailable();
|
|
582272
582426
|
},
|
|
582273
582427
|
isConcurrencySafe() {
|
|
582274
582428
|
return true;
|
|
@@ -583185,7 +583339,7 @@ Approving shutdown terminates your process. Rejecting plan sends the teammate ba
|
|
|
583185
583339
|
`.trim();
|
|
583186
583340
|
}
|
|
583187
583341
|
var DESCRIPTION21 = "Send a message to another agent";
|
|
583188
|
-
var
|
|
583342
|
+
var init_prompt24 = __esm(() => {
|
|
583189
583343
|
init_featureFlags();
|
|
583190
583344
|
});
|
|
583191
583345
|
|
|
@@ -583523,7 +583677,7 @@ var init_SendMessageTool = __esm(() => {
|
|
|
583523
583677
|
init_teammate();
|
|
583524
583678
|
init_teammateMailbox();
|
|
583525
583679
|
init_resumeAgent();
|
|
583526
|
-
|
|
583680
|
+
init_prompt24();
|
|
583527
583681
|
init_UI25();
|
|
583528
583682
|
StructuredMessage = lazySchema(() => exports_external.discriminatedUnion("type", [
|
|
583529
583683
|
exports_external.object({
|
|
@@ -591310,7 +591464,7 @@ ${sleepGuidance ? sleepGuidance + `
|
|
|
591310
591464
|
- Before running destructive operations (e.g., git reset --hard, git push --force, git checkout --), consider whether there is a safer alternative that achieves the same goal. Only use destructive operations when they are truly the best approach.
|
|
591311
591465
|
- Never skip hooks (--no-verify) or bypass signing (--no-gpg-sign, -c commit.gpgsign=false) unless the user has explicitly asked for it. If a hook fails, investigate and fix the underlying issue.`;
|
|
591312
591466
|
}
|
|
591313
|
-
var
|
|
591467
|
+
var init_prompt25 = __esm(() => {
|
|
591314
591468
|
init_envUtils();
|
|
591315
591469
|
init_outputLimits();
|
|
591316
591470
|
init_powershellDetection();
|
|
@@ -591841,7 +591995,7 @@ var init_PowerShellTool = __esm(() => {
|
|
|
591841
591995
|
init_gitOperationTracking();
|
|
591842
591996
|
init_commandSemantics2();
|
|
591843
591997
|
init_powershellPermissions();
|
|
591844
|
-
|
|
591998
|
+
init_prompt25();
|
|
591845
591999
|
init_readOnlyValidation2();
|
|
591846
592000
|
init_UI26();
|
|
591847
592001
|
jsx_runtime158 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -594131,7 +594285,7 @@ var init_toolExecution = __esm(() => {
|
|
|
594131
594285
|
init_prompt3();
|
|
594132
594286
|
init_prompt4();
|
|
594133
594287
|
init_gitOperationTracking();
|
|
594134
|
-
|
|
594288
|
+
init_prompt11();
|
|
594135
594289
|
init_tools2();
|
|
594136
594290
|
init_attachments2();
|
|
594137
594291
|
init_debug();
|
|
@@ -598110,7 +598264,7 @@ var init_query2 = __esm(() => {
|
|
|
598110
598264
|
init_tokens();
|
|
598111
598265
|
init_context();
|
|
598112
598266
|
init_growthbook();
|
|
598113
|
-
|
|
598267
|
+
init_prompt13();
|
|
598114
598268
|
init_postSamplingHooks();
|
|
598115
598269
|
init_hooks5();
|
|
598116
598270
|
init_dumpPrompts();
|
|
@@ -603151,7 +603305,7 @@ var init_attachments2 = __esm(() => {
|
|
|
603151
603305
|
init_commands5();
|
|
603152
603306
|
init_uniqBy();
|
|
603153
603307
|
init_state();
|
|
603154
|
-
|
|
603308
|
+
init_prompt27();
|
|
603155
603309
|
init_context();
|
|
603156
603310
|
init_prompt3();
|
|
603157
603311
|
init_limits();
|
|
@@ -603161,7 +603315,7 @@ var init_attachments2 = __esm(() => {
|
|
|
603161
603315
|
init_file();
|
|
603162
603316
|
init_loadAgentsDir();
|
|
603163
603317
|
init_constants3();
|
|
603164
|
-
|
|
603318
|
+
init_prompt12();
|
|
603165
603319
|
init_permissions2();
|
|
603166
603320
|
init_auth6();
|
|
603167
603321
|
init_mcpStringUtils();
|
|
@@ -603577,7 +603731,7 @@ var proactiveModule3, NO_TOOLS_PREAMBLE = `CRITICAL: Respond with TEXT ONLY. Do
|
|
|
603577
603731
|
- Pay special attention to specific user feedback that you received, especially if the user told you to do something differently.
|
|
603578
603732
|
- Note any security-relevant instructions or constraints the user stated (e.g., sensitive files or data to avoid, operations that must not be performed, credential or secret handling rules). These MUST be preserved verbatim in the summary so they continue to apply after compaction.
|
|
603579
603733
|
2. Double-check for technical accuracy and completeness, addressing each required element thoroughly.`, BASE_COMPACT_PROMPT, PARTIAL_COMPACT_PROMPT, PARTIAL_COMPACT_UP_TO_PROMPT, NO_TOOLS_TRAILER;
|
|
603580
|
-
var
|
|
603734
|
+
var init_prompt26 = __esm(() => {
|
|
603581
603735
|
init_featureFlags();
|
|
603582
603736
|
proactiveModule3 = feature("PROACTIVE") || feature("KAIROS") ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
603583
603737
|
BASE_COMPACT_PROMPT = `Your task is to create a detailed summary of the conversation so far, paying close attention to the user's explicit requests and your previous actions.
|
|
@@ -604695,7 +604849,7 @@ var init_compact = __esm(() => {
|
|
|
604695
604849
|
init_withRetry();
|
|
604696
604850
|
init_internalLogging();
|
|
604697
604851
|
init_tokenEstimation();
|
|
604698
|
-
|
|
604852
|
+
init_prompt26();
|
|
604699
604853
|
sessionTranscriptModule2 = feature("KAIROS") ? (init_sessionTranscript(), __toCommonJS(exports_sessionTranscript)) : null;
|
|
604700
604854
|
});
|
|
604701
604855
|
|
|
@@ -605251,7 +605405,7 @@ var init_sessionMemoryCompact = __esm(() => {
|
|
|
605251
605405
|
init_sessionMemoryUtils();
|
|
605252
605406
|
init_compact();
|
|
605253
605407
|
init_microCompact();
|
|
605254
|
-
|
|
605408
|
+
init_prompt26();
|
|
605255
605409
|
DEFAULT_SM_COMPACT_CONFIG = {
|
|
605256
605410
|
minTokens: 1e4,
|
|
605257
605411
|
minTextBlockMessages: 5,
|
|
@@ -605540,7 +605694,7 @@ async function countBuiltInToolTokens(tools, getToolPermissionContext, agentInfo
|
|
|
605540
605694
|
};
|
|
605541
605695
|
}
|
|
605542
605696
|
const { isToolSearchEnabled: isToolSearchEnabled2 } = await Promise.resolve().then(() => (init_toolSearch(), exports_toolSearch));
|
|
605543
|
-
const { isDeferredTool: isDeferredTool2 } = await Promise.resolve().then(() => (
|
|
605697
|
+
const { isDeferredTool: isDeferredTool2 } = await Promise.resolve().then(() => (init_prompt11(), exports_prompt4));
|
|
605544
605698
|
const isDeferred = await isToolSearchEnabled2(model ?? "", tools, getToolPermissionContext, agentInfo?.activeAgents ?? [], "analyzeBuiltIn");
|
|
605545
605699
|
const alwaysLoadedTools = builtInTools.filter((t4) => !isDeferredTool2(t4));
|
|
605546
605700
|
const deferredBuiltinTools = builtInTools.filter((t4) => isDeferredTool2(t4));
|
|
@@ -605675,7 +605829,7 @@ async function countMcpToolTokens(tools, getToolPermissionContext, agentInfo, mo
|
|
|
605675
605829
|
const estimateTotal = estimates.reduce((s4, e4) => s4 + e4, 0) || 1;
|
|
605676
605830
|
const mcpToolTokensByTool = estimates.map((e4) => Math.round(e4 / estimateTotal * totalTokens));
|
|
605677
605831
|
const { isToolSearchEnabled: isToolSearchEnabled2 } = await Promise.resolve().then(() => (init_toolSearch(), exports_toolSearch));
|
|
605678
|
-
const { isDeferredTool: isDeferredTool2 } = await Promise.resolve().then(() => (
|
|
605832
|
+
const { isDeferredTool: isDeferredTool2 } = await Promise.resolve().then(() => (init_prompt11(), exports_prompt4));
|
|
605679
605833
|
const isDeferred = await isToolSearchEnabled2(model, tools, getToolPermissionContext, agentInfo?.activeAgents ?? [], "analyzeMcp");
|
|
605680
605834
|
const loadedMcpToolNames = new Set;
|
|
605681
605835
|
if (isDeferred && messages) {
|
|
@@ -606111,7 +606265,7 @@ var init_analyzeContext = __esm(() => {
|
|
|
606111
606265
|
init_tokenEstimation();
|
|
606112
606266
|
init_loadSkillsDir();
|
|
606113
606267
|
init_Tool();
|
|
606114
|
-
|
|
606268
|
+
init_prompt27();
|
|
606115
606269
|
init_api4();
|
|
606116
606270
|
init_claudemd();
|
|
606117
606271
|
init_context();
|
|
@@ -606431,7 +606585,7 @@ var init_toolSearch = __esm(() => {
|
|
|
606431
606585
|
init_growthbook();
|
|
606432
606586
|
init_analytics();
|
|
606433
606587
|
init_Tool();
|
|
606434
|
-
|
|
606588
|
+
init_prompt11();
|
|
606435
606589
|
init_analyzeContext();
|
|
606436
606590
|
init_betas2();
|
|
606437
606591
|
init_context();
|
|
@@ -607000,48 +607154,74 @@ function generateProgressiveArgumentHint(argNames, typedArgs) {
|
|
|
607000
607154
|
return;
|
|
607001
607155
|
return remaining.map((name3) => `[${name3}]`).join(" ");
|
|
607002
607156
|
}
|
|
607003
|
-
function substituteArguments(content, args, appendIfNoPlaceholder = true, argumentNames = []) {
|
|
607157
|
+
function substituteArguments(content, args, appendIfNoPlaceholder = true, argumentNames = [], valueTransform) {
|
|
607004
607158
|
if (args === undefined || args === null) {
|
|
607005
607159
|
return content;
|
|
607006
607160
|
}
|
|
607161
|
+
let work = content.replaceAll(SHIELDED_DOLLAR, SENTINEL_REPLACEMENT).replaceAll(VALUE_BOUNDARY, SENTINEL_REPLACEMENT);
|
|
607162
|
+
const insertValue = (value) => {
|
|
607163
|
+
const sanitized = (value ?? "").replaceAll(SHIELDED_DOLLAR, SENTINEL_REPLACEMENT).replaceAll(VALUE_BOUNDARY, SENTINEL_REPLACEMENT);
|
|
607164
|
+
const transformed = valueTransform ? valueTransform(sanitized) : sanitized;
|
|
607165
|
+
return VALUE_BOUNDARY + transformed.replaceAll("$", SHIELDED_DOLLAR) + VALUE_BOUNDARY;
|
|
607166
|
+
};
|
|
607007
607167
|
const parsedArgs = parseArguments2(args);
|
|
607008
|
-
const
|
|
607009
|
-
|
|
607010
|
-
|
|
607011
|
-
|
|
607012
|
-
|
|
607013
|
-
|
|
607014
|
-
|
|
607015
|
-
|
|
607168
|
+
const namedArgs = argumentNames.map((name3, index2) => ({ name: name3, index: index2 })).filter((entry) => Boolean(entry.name)).sort((left2, right2) => right2.name.length - left2.name.length);
|
|
607169
|
+
const markerAlternation = [
|
|
607170
|
+
"\\d",
|
|
607171
|
+
"ARGUMENTS",
|
|
607172
|
+
...namedArgs.map(({ name: name3 }) => `${escapeRegExp(name3)}(?![\\[\\w])`)
|
|
607173
|
+
].join("|");
|
|
607174
|
+
work = work.replace(new RegExp(`(?<!\\\\)\\\\\\$(?=${markerAlternation})`, "g"), SHIELDED_DOLLAR);
|
|
607175
|
+
let didSubstitute = false;
|
|
607176
|
+
for (const { name: name3, index: index2 } of namedArgs) {
|
|
607177
|
+
work = work.replace(new RegExp(`\\$${escapeRegExp(name3)}(?![\\[\\w])`, "g"), () => {
|
|
607178
|
+
didSubstitute = true;
|
|
607179
|
+
return insertValue(parsedArgs[index2]);
|
|
607180
|
+
});
|
|
607016
607181
|
}
|
|
607017
607182
|
work = work.replace(/\$ARGUMENTS\[(\d+)\]/g, (match, indexStr) => {
|
|
607018
607183
|
const index2 = parseInt(indexStr, 10);
|
|
607019
607184
|
if (parsedArgs[index2] === undefined) {
|
|
607020
|
-
return
|
|
607185
|
+
return SHIELDED_DOLLAR + match.slice(1);
|
|
607021
607186
|
}
|
|
607022
|
-
|
|
607187
|
+
didSubstitute = true;
|
|
607188
|
+
return insertValue(parsedArgs[index2]);
|
|
607023
607189
|
});
|
|
607024
607190
|
work = work.replace(/\$(\d+)(?!\w)/g, (match, indexStr) => {
|
|
607025
607191
|
const index2 = parseInt(indexStr, 10);
|
|
607026
607192
|
if (parsedArgs[index2] === undefined) {
|
|
607027
607193
|
return match;
|
|
607028
607194
|
}
|
|
607029
|
-
|
|
607195
|
+
didSubstitute = true;
|
|
607196
|
+
return insertValue(parsedArgs[index2]);
|
|
607197
|
+
});
|
|
607198
|
+
work = work.replaceAll("$ARGUMENTS", () => {
|
|
607199
|
+
didSubstitute = true;
|
|
607200
|
+
return insertValue(args);
|
|
607030
607201
|
});
|
|
607031
|
-
|
|
607032
|
-
if (work === beforeSubst && appendIfNoPlaceholder && args) {
|
|
607202
|
+
if (!didSubstitute && appendIfNoPlaceholder && args) {
|
|
607033
607203
|
work = work + `
|
|
607034
|
-
|
|
607035
|
-
ARGUMENTS: ${args}`;
|
|
607204
|
+
ARGUMENTS: ${insertValue(args)}`;
|
|
607036
607205
|
}
|
|
607037
|
-
return work.replaceAll(
|
|
607206
|
+
return work.replaceAll(SHIELDED_DOLLAR, "$").replaceAll(VALUE_BOUNDARY, "");
|
|
607038
607207
|
}
|
|
607208
|
+
var SHIELDED_DOLLAR = "\uFFFF", VALUE_BOUNDARY = "\uFFFE", SENTINEL_REPLACEMENT = "\uFFFD";
|
|
607039
607209
|
var init_argumentSubstitution = __esm(() => {
|
|
607040
607210
|
init_shellQuote();
|
|
607211
|
+
init_stringUtils();
|
|
607041
607212
|
});
|
|
607042
607213
|
|
|
607043
607214
|
// src/utils/promptShellExecution.ts
|
|
607044
607215
|
import { randomUUID as randomUUID30 } from "crypto";
|
|
607216
|
+
function escapeShellExecutionMarkers(value) {
|
|
607217
|
+
return value.replace(/`!/g, "` !").replace(/!`/g, "! `").replace(/(^|\s)!/gm, "$1\\!");
|
|
607218
|
+
}
|
|
607219
|
+
function escapeAngleBrackets(value) {
|
|
607220
|
+
return value.replaceAll("<", "<").replaceAll(">", ">");
|
|
607221
|
+
}
|
|
607222
|
+
function sanitizeUsername(value) {
|
|
607223
|
+
return value.replace(/[^a-zA-Z0-9._-]/g, "");
|
|
607224
|
+
}
|
|
607045
607225
|
function isSkillShellExecutionDisabled() {
|
|
607046
607226
|
if (getSettingsForSource("policySettings")?.disableSkillShellExecution === true) {
|
|
607047
607227
|
return true;
|
|
@@ -607373,7 +607553,7 @@ function createSkillCommand({
|
|
|
607373
607553
|
let finalContent = baseDir ? `Base directory for this skill: ${baseDir}
|
|
607374
607554
|
|
|
607375
607555
|
${markdownContent}` : markdownContent;
|
|
607376
|
-
finalContent = substituteArguments(finalContent, args, true, argumentNames);
|
|
607556
|
+
finalContent = substituteArguments(finalContent, args, true, argumentNames, loadedFrom === "mcp" ? (value) => escapeAngleBrackets(escapeShellExecutionMarkers(value)) : escapeShellExecutionMarkers);
|
|
607377
607557
|
if (baseDir) {
|
|
607378
607558
|
const skillDir = process.platform === "win32" ? baseDir.replace(/\\/g, "/") : baseDir;
|
|
607379
607559
|
finalContent = finalContent.replace(/\$\{CLAUDE_SKILL_DIR\}/g, skillDir);
|
|
@@ -607953,7 +608133,7 @@ async function getSkillInfo(cwd2) {
|
|
|
607953
608133
|
}
|
|
607954
608134
|
}
|
|
607955
608135
|
var SKILL_BUDGET_CONTEXT_PERCENT = 0.01, CHARS_PER_TOKEN2 = 4, DEFAULT_CONTEXT_CHARS = 200000, DEFAULT_CHAR_BUDGET, MAX_LISTING_DESC_CHARS = 1536, MIN_DESC_LENGTH = 20, getPrompt3;
|
|
607956
|
-
var
|
|
608136
|
+
var init_prompt27 = __esm(() => {
|
|
607957
608137
|
init_lodash();
|
|
607958
608138
|
init_commands5();
|
|
607959
608139
|
init_loadSkillsDir();
|
|
@@ -608129,13 +608309,13 @@ function createPluginCommand(commandName, file2, sourceName, pluginManifest, plu
|
|
|
608129
608309
|
let finalContent = config7.isSkillMode ? `Base directory for this skill: ${dirname51(file2.filePath)}
|
|
608130
608310
|
|
|
608131
608311
|
${content}` : content;
|
|
608132
|
-
finalContent = substituteArguments(finalContent, args, true, argumentNames);
|
|
608312
|
+
finalContent = substituteArguments(finalContent, args, true, argumentNames, escapeShellExecutionMarkers);
|
|
608133
608313
|
finalContent = substitutePluginVariables(finalContent, {
|
|
608134
608314
|
path: pluginPath,
|
|
608135
608315
|
source: sourceName
|
|
608136
608316
|
});
|
|
608137
608317
|
if (pluginManifest.userConfig) {
|
|
608138
|
-
finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig);
|
|
608318
|
+
finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig, escapeShellExecutionMarkers);
|
|
608139
608319
|
}
|
|
608140
608320
|
if (config7.isSkillMode) {
|
|
608141
608321
|
const rawSkillDir = dirname51(file2.filePath);
|
|
@@ -608808,7 +608988,7 @@ var init_cacheUtils = __esm(() => {
|
|
|
608808
608988
|
init_commands5();
|
|
608809
608989
|
init_outputStyles();
|
|
608810
608990
|
init_loadAgentsDir();
|
|
608811
|
-
|
|
608991
|
+
init_prompt27();
|
|
608812
608992
|
init_attachments2();
|
|
608813
608993
|
init_debug();
|
|
608814
608994
|
init_errors();
|
|
@@ -616555,7 +616735,7 @@ var init_messages3 = __esm(() => {
|
|
|
616555
616735
|
init_planAgent();
|
|
616556
616736
|
init_builtInAgents();
|
|
616557
616737
|
init_constants3();
|
|
616558
|
-
|
|
616738
|
+
init_prompt9();
|
|
616559
616739
|
init_BashTool();
|
|
616560
616740
|
init_ExitPlanModeV2Tool();
|
|
616561
616741
|
init_FileEditTool();
|
|
@@ -630768,6 +630948,7 @@ var init_apiMicrocompact = __esm(() => {
|
|
|
630768
630948
|
init_prompt4();
|
|
630769
630949
|
init_prompt2();
|
|
630770
630950
|
init_prompt6();
|
|
630951
|
+
init_prompt7();
|
|
630771
630952
|
init_shellToolUtils();
|
|
630772
630953
|
init_envValidation();
|
|
630773
630954
|
init_envUtils();
|
|
@@ -631269,6 +631450,7 @@ async function* queryModel(messages, systemPrompt, thinkingConfig, tools, signal
|
|
|
631269
631450
|
}
|
|
631270
631451
|
const previousRequestId = getPreviousRequestIdFromMessages(messages);
|
|
631271
631452
|
const resolvedModel = getAPIProvider() === "bedrock" && options.model.includes("application-inference-profile") ? await getInferenceProfileBackingModel(options.model) ?? options.model : options.model;
|
|
631453
|
+
signalUnrecognizedModel(options.model, options.querySource);
|
|
631272
631454
|
queryCheckpoint("query_tool_schema_build_start");
|
|
631273
631455
|
const isAgenticQuery = options.querySource.startsWith("repl_main_thread") || options.querySource.startsWith("agent:") || options.querySource === "sdk" || options.querySource === "hook_agent" || options.querySource === "verification_agent";
|
|
631274
631456
|
const betas = getMergedBetas(options.model, { isAgenticQuery });
|
|
@@ -631492,10 +631674,10 @@ ${deferredToolList}
|
|
|
631492
631674
|
let start = Date.now();
|
|
631493
631675
|
let attemptNumber = 0;
|
|
631494
631676
|
const attemptStartTimes = [];
|
|
631495
|
-
let stream6
|
|
631496
|
-
let streamRequestId
|
|
631497
|
-
let clientRequestId
|
|
631498
|
-
let streamResponse
|
|
631677
|
+
let stream6;
|
|
631678
|
+
let streamRequestId;
|
|
631679
|
+
let clientRequestId;
|
|
631680
|
+
let streamResponse;
|
|
631499
631681
|
function releaseStreamResources() {
|
|
631500
631682
|
cleanupStream(stream6);
|
|
631501
631683
|
stream6 = undefined;
|
|
@@ -631530,7 +631712,7 @@ ${deferredToolList}
|
|
|
631530
631712
|
}
|
|
631531
631713
|
const maxOutputTokens2 = retryContext?.maxTokensOverride || options.maxOutputTokensOverride || getMaxOutputTokensForModel(options.model);
|
|
631532
631714
|
const hasThinking = thinkingConfig.type !== "disabled" && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_THINKING);
|
|
631533
|
-
let thinking
|
|
631715
|
+
let thinking;
|
|
631534
631716
|
if (hasThinking && modelSupportsThinking(options.model)) {
|
|
631535
631717
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING) && modelSupportsAdaptiveThinking(options.model)) {
|
|
631536
631718
|
thinking = {
|
|
@@ -631622,7 +631804,7 @@ ${deferredToolList}
|
|
|
631622
631804
|
}
|
|
631623
631805
|
const newMessages = [];
|
|
631624
631806
|
let ttftMs = 0;
|
|
631625
|
-
let partialMessage
|
|
631807
|
+
let partialMessage;
|
|
631626
631808
|
const contentBlocks = [];
|
|
631627
631809
|
let usage2 = EMPTY_USAGE;
|
|
631628
631810
|
let costUSD = 0;
|
|
@@ -631630,8 +631812,8 @@ ${deferredToolList}
|
|
|
631630
631812
|
let didFallBackToNonStreaming = false;
|
|
631631
631813
|
let fallbackMessage;
|
|
631632
631814
|
let maxOutputTokens = 0;
|
|
631633
|
-
let responseHeaders
|
|
631634
|
-
let research
|
|
631815
|
+
let responseHeaders;
|
|
631816
|
+
let research;
|
|
631635
631817
|
let isFastModeRequest = isFastMode;
|
|
631636
631818
|
let isAdvisorInProgress = false;
|
|
631637
631819
|
try {
|
|
@@ -632679,11 +632861,12 @@ var init_claude = __esm(() => {
|
|
|
632679
632861
|
init_toolSearch();
|
|
632680
632862
|
init_apiLimits();
|
|
632681
632863
|
init_betas();
|
|
632682
|
-
|
|
632864
|
+
init_prompt11();
|
|
632683
632865
|
init_envValidation();
|
|
632684
632866
|
init_json();
|
|
632685
632867
|
init_bedrock();
|
|
632686
632868
|
init_model();
|
|
632869
|
+
init_unrecognizedModelSignal();
|
|
632687
632870
|
init_sessionActivity();
|
|
632688
632871
|
init_slowOperations();
|
|
632689
632872
|
init_sessionTracing();
|
|
@@ -633662,7 +633845,7 @@ __export(exports_prompt7, {
|
|
|
633662
633845
|
TERMINAL_CAPTURE_TOOL_NAME: () => TERMINAL_CAPTURE_TOOL_NAME
|
|
633663
633846
|
});
|
|
633664
633847
|
var TERMINAL_CAPTURE_TOOL_NAME = "";
|
|
633665
|
-
var
|
|
633848
|
+
var init_prompt28 = () => {};
|
|
633666
633849
|
|
|
633667
633850
|
// src/tools/VerifyPlanExecutionTool/constants.ts
|
|
633668
633851
|
var exports_constants2 = {};
|
|
@@ -633715,13 +633898,13 @@ function isAutoModeAllowlistedTool(toolName) {
|
|
|
633715
633898
|
var TERMINAL_CAPTURE_TOOL_NAME2, OVERFLOW_TEST_TOOL_NAME2, VERIFY_PLAN_EXECUTION_TOOL_NAME2, WORKFLOW_TOOL_NAME2, SAFE_YOLO_ALLOWLISTED_TOOLS;
|
|
633716
633899
|
var init_classifierDecision = __esm(() => {
|
|
633717
633900
|
init_featureFlags();
|
|
633718
|
-
|
|
633901
|
+
init_prompt9();
|
|
633719
633902
|
init_prompt3();
|
|
633720
633903
|
init_prompt2();
|
|
633721
|
-
|
|
633722
|
-
|
|
633904
|
+
init_prompt13();
|
|
633905
|
+
init_prompt11();
|
|
633723
633906
|
init_yoloClassifier();
|
|
633724
|
-
TERMINAL_CAPTURE_TOOL_NAME2 = feature("TERMINAL_PANEL") ? (
|
|
633907
|
+
TERMINAL_CAPTURE_TOOL_NAME2 = feature("TERMINAL_PANEL") ? (init_prompt28(), __toCommonJS(exports_prompt7)).TERMINAL_CAPTURE_TOOL_NAME : null;
|
|
633725
633908
|
OVERFLOW_TEST_TOOL_NAME2 = feature("OVERFLOW_TEST_TOOL") ? (init_OverflowTestTool(), __toCommonJS(exports_OverflowTestTool)).OVERFLOW_TEST_TOOL_NAME : null;
|
|
633726
633909
|
VERIFY_PLAN_EXECUTION_TOOL_NAME2 = process.env.USER_TYPE === "ant" ? (init_constants11(), __toCommonJS(exports_constants2)).VERIFY_PLAN_EXECUTION_TOOL_NAME : null;
|
|
633727
633910
|
WORKFLOW_TOOL_NAME2 = feature("WORKFLOW_SCRIPTS") ? __toCommonJS(exports_constants).WORKFLOW_TOOL_NAME : null;
|
|
@@ -644428,7 +644611,7 @@ function clearSessionCaches(preservedAgentIds = new Set) {
|
|
|
644428
644611
|
Promise.resolve().then(() => (init_utils12(), exports_utils2)).then(({ clearWebFetchCache: clearWebFetchCache2 }) => clearWebFetchCache2());
|
|
644429
644612
|
Promise.resolve().then(() => (init_ToolSearchTool(), exports_ToolSearchTool)).then(({ clearToolSearchDescriptionCache: clearToolSearchDescriptionCache2 }) => clearToolSearchDescriptionCache2());
|
|
644430
644613
|
Promise.resolve().then(() => (init_loadAgentsDir(), exports_loadAgentsDir)).then(({ clearAgentDefinitionsCache: clearAgentDefinitionsCache2 }) => clearAgentDefinitionsCache2());
|
|
644431
|
-
Promise.resolve().then(() => (
|
|
644614
|
+
Promise.resolve().then(() => (init_prompt27(), exports_prompt6)).then(({ clearPromptCache: clearPromptCache2 }) => clearPromptCache2());
|
|
644432
644615
|
}
|
|
644433
644616
|
var init_caches = __esm(() => {
|
|
644434
644617
|
init_featureFlags();
|
|
@@ -644708,7 +644891,8 @@ var init_color3 = __esm(() => {
|
|
|
644708
644891
|
|
|
644709
644892
|
// src/commands/commit.ts
|
|
644710
644893
|
function getPromptContent() {
|
|
644711
|
-
const { commit:
|
|
644894
|
+
const { commit: rawCommitAttribution } = getAttributionTexts();
|
|
644895
|
+
const commitAttribution = escapeShellExecutionMarkers(rawCommitAttribution);
|
|
644712
644896
|
let prefix = "";
|
|
644713
644897
|
if (process.env.USER_TYPE === "ant" && isUndercover()) {
|
|
644714
644898
|
prefix = getUndercoverInstructions() + `
|
|
@@ -645708,10 +645892,11 @@ var init_desktop2 = __esm(() => {
|
|
|
645708
645892
|
|
|
645709
645893
|
// src/commands/commit-push-pr.ts
|
|
645710
645894
|
function getPromptContent2(defaultBranch, prAttribution) {
|
|
645711
|
-
const { commit:
|
|
645712
|
-
const
|
|
645713
|
-
const
|
|
645714
|
-
const
|
|
645895
|
+
const { commit: rawCommitAttribution, pr: defaultPrAttribution } = getAttributionTexts();
|
|
645896
|
+
const commitAttribution = escapeShellExecutionMarkers(rawCommitAttribution);
|
|
645897
|
+
const effectivePrAttribution = escapeShellExecutionMarkers(prAttribution ?? defaultPrAttribution);
|
|
645898
|
+
const safeUser = sanitizeUsername(process.env.SAFEUSER || "");
|
|
645899
|
+
const username = sanitizeUsername(process.env.USER || "");
|
|
645715
645900
|
let prefix = "";
|
|
645716
645901
|
let reviewerArg = " and `--reviewer anthropics/claude-code`";
|
|
645717
645902
|
let addReviewerArg = " (and add `--add-reviewer anthropics/claude-code`)";
|
|
@@ -645829,7 +646014,7 @@ var init_commit_push_pr = __esm(() => {
|
|
|
645829
646014
|
|
|
645830
646015
|
## Additional instructions from user
|
|
645831
646016
|
|
|
645832
|
-
${trimmedArgs}`;
|
|
646017
|
+
${escapeShellExecutionMarkers(trimmedArgs)}`;
|
|
645833
646018
|
}
|
|
645834
646019
|
const finalContent = await executeShellCommandsInPrompt(promptContent, {
|
|
645835
646020
|
...context7,
|
|
@@ -652324,6 +652509,7 @@ var LARGE_TOOL_RESULT_PERCENT = 15, LARGE_TOOL_RESULT_TOKENS = 1e4, READ_BLOAT_P
|
|
|
652324
652509
|
var init_contextSuggestions = __esm(() => {
|
|
652325
652510
|
init_prompt3();
|
|
652326
652511
|
init_prompt2();
|
|
652512
|
+
init_prompt6();
|
|
652327
652513
|
init_file();
|
|
652328
652514
|
init_format();
|
|
652329
652515
|
});
|
|
@@ -653587,7 +653773,7 @@ var init_context_noninteractive = __esm(() => {
|
|
|
653587
653773
|
init_commands5();
|
|
653588
653774
|
init_microCompact();
|
|
653589
653775
|
init_tokenEstimation();
|
|
653590
|
-
|
|
653776
|
+
init_prompt27();
|
|
653591
653777
|
init_analyzeContext();
|
|
653592
653778
|
init_cwd2();
|
|
653593
653779
|
init_format();
|
|
@@ -669349,7 +669535,7 @@ async function loadInstallCountsCache() {
|
|
|
669349
669535
|
return null;
|
|
669350
669536
|
}
|
|
669351
669537
|
const now2 = Date.now();
|
|
669352
|
-
if (now2 - fetchedAt >
|
|
669538
|
+
if (now2 - fetchedAt > CACHE_TTL_MS3) {
|
|
669353
669539
|
logForDebugging("Install counts cache is stale (>24h old)");
|
|
669354
669540
|
return null;
|
|
669355
669541
|
}
|
|
@@ -669446,7 +669632,7 @@ function formatInstallCount(count4) {
|
|
|
669446
669632
|
const formatted = m5.toFixed(1);
|
|
669447
669633
|
return formatted.endsWith(".0") ? `${formatted.slice(0, -2)}M` : `${formatted}M`;
|
|
669448
669634
|
}
|
|
669449
|
-
var INSTALL_COUNTS_CACHE_VERSION = 1, INSTALL_COUNTS_CACHE_FILENAME = "install-counts-cache.json", INSTALL_COUNTS_URL = "https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json",
|
|
669635
|
+
var INSTALL_COUNTS_CACHE_VERSION = 1, INSTALL_COUNTS_CACHE_FILENAME = "install-counts-cache.json", INSTALL_COUNTS_URL = "https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json", CACHE_TTL_MS3;
|
|
669450
669636
|
var init_installCounts = __esm(() => {
|
|
669451
669637
|
init_axios2();
|
|
669452
669638
|
init_debug();
|
|
@@ -669456,7 +669642,7 @@ var init_installCounts = __esm(() => {
|
|
|
669456
669642
|
init_slowOperations();
|
|
669457
669643
|
init_fetchTelemetry();
|
|
669458
669644
|
init_pluginDirectories();
|
|
669459
|
-
|
|
669645
|
+
CACHE_TTL_MS3 = 24 * 60 * 60 * 1000;
|
|
669460
669646
|
});
|
|
669461
669647
|
|
|
669462
669648
|
// src/commands/plugin/PluginOptionsDialog.tsx
|
|
@@ -690867,7 +691053,7 @@ var init_Messages = __esm(() => {
|
|
|
690867
691053
|
});
|
|
690868
691054
|
proactiveModule4 = feature("PROACTIVE") || feature("KAIROS") ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
690869
691055
|
BRIEF_TOOL_NAME6 = feature("KAIROS") || feature("KAIROS_BRIEF") ? (init_prompt(), __toCommonJS(exports_prompt)).BRIEF_TOOL_NAME : null;
|
|
690870
|
-
SEND_USER_FILE_TOOL_NAME4 = feature("KAIROS") ? (
|
|
691056
|
+
SEND_USER_FILE_TOOL_NAME4 = feature("KAIROS") ? (init_prompt8(), __toCommonJS(exports_prompt2)).SEND_USER_FILE_TOOL_NAME : null;
|
|
690871
691057
|
Messages4 = React89.memo(MessagesImpl, (prev, next2) => {
|
|
690872
691058
|
const keys3 = Object.keys(prev);
|
|
690873
691059
|
for (const key4 of keys3) {
|
|
@@ -699225,7 +699411,7 @@ var init_RemoteSessionDetailDialog = __esm(() => {
|
|
|
699225
699411
|
init_ink2();
|
|
699226
699412
|
init_RemoteAgentTask();
|
|
699227
699413
|
init_constants3();
|
|
699228
|
-
|
|
699414
|
+
init_prompt9();
|
|
699229
699415
|
init_browser();
|
|
699230
699416
|
init_errors();
|
|
699231
699417
|
init_format();
|
|
@@ -731726,7 +731912,7 @@ var init_prompts4 = __esm(() => {
|
|
|
731726
731912
|
init_betas2();
|
|
731727
731913
|
init_forkSubagent();
|
|
731728
731914
|
init_systemPromptSections();
|
|
731729
|
-
|
|
731915
|
+
init_prompt13();
|
|
731730
731916
|
init_xml();
|
|
731731
731917
|
init_debug();
|
|
731732
731918
|
init_memdir();
|
|
@@ -760461,40 +760647,6 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
760461
760647
|
import_react225 = __toESM(require_react(), 1);
|
|
760462
760648
|
});
|
|
760463
760649
|
|
|
760464
|
-
// src/utils/oauthLoginExpiry.ts
|
|
760465
|
-
function computeOAuthLoginExpiry(tokens, context8, now2 = Date.now()) {
|
|
760466
|
-
if (!context8.providerIsFirstParty || !context8.isClaudeAISubscriber) {
|
|
760467
|
-
return null;
|
|
760468
|
-
}
|
|
760469
|
-
if (!tokens || typeof tokens.refreshTokenExpiresAt !== "number") {
|
|
760470
|
-
return null;
|
|
760471
|
-
}
|
|
760472
|
-
const refreshTokenExpiresAt = tokens.refreshTokenExpiresAt;
|
|
760473
|
-
if (typeof tokens.expiresAt === "number" && tokens.expiresAt > refreshTokenExpiresAt + LOGIN_EXPIRY_WARN_WINDOW_MS) {
|
|
760474
|
-
return null;
|
|
760475
|
-
}
|
|
760476
|
-
const remaining = refreshTokenExpiresAt - now2;
|
|
760477
|
-
if (remaining > LOGIN_EXPIRY_WARN_WINDOW_MS || remaining <= 0) {
|
|
760478
|
-
return null;
|
|
760479
|
-
}
|
|
760480
|
-
return { daysLeft: Math.ceil(remaining / MS_PER_DAY) };
|
|
760481
|
-
}
|
|
760482
|
-
function getOAuthLoginExpiryInfo() {
|
|
760483
|
-
return computeOAuthLoginExpiry(getClaudeAIOAuthTokens(), {
|
|
760484
|
-
providerIsFirstParty: getAPIProvider() === "firstParty",
|
|
760485
|
-
isClaudeAISubscriber: isClaudeAISubscriber()
|
|
760486
|
-
});
|
|
760487
|
-
}
|
|
760488
|
-
function pluralize2(count4, noun) {
|
|
760489
|
-
return count4 === 1 ? noun : `${noun}s`;
|
|
760490
|
-
}
|
|
760491
|
-
var MS_PER_DAY = 86400000, LOGIN_EXPIRY_WARN_WINDOW_MS;
|
|
760492
|
-
var init_oauthLoginExpiry = __esm(() => {
|
|
760493
|
-
init_providers();
|
|
760494
|
-
init_auth6();
|
|
760495
|
-
LOGIN_EXPIRY_WARN_WINDOW_MS = 3 * MS_PER_DAY;
|
|
760496
|
-
});
|
|
760497
|
-
|
|
760498
760650
|
// src/components/PromptInput/OAuthExpiryNotice.tsx
|
|
760499
760651
|
function OAuthExpiryNotice() {
|
|
760500
760652
|
const { addNotification } = useNotifications();
|
|
@@ -764445,7 +764597,7 @@ var init_commandSuggestions = __esm(() => {
|
|
|
764445
764597
|
// src/utils/suggestions/shellHistoryCompletion.ts
|
|
764446
764598
|
async function getShellHistoryCommands() {
|
|
764447
764599
|
const now2 = Date.now();
|
|
764448
|
-
if (shellHistoryCache && now2 - shellHistoryCacheTimestamp <
|
|
764600
|
+
if (shellHistoryCache && now2 - shellHistoryCacheTimestamp < CACHE_TTL_MS4) {
|
|
764449
764601
|
return shellHistoryCache;
|
|
764450
764602
|
}
|
|
764451
764603
|
const commands7 = [];
|
|
@@ -764506,7 +764658,7 @@ function getShellHistoryCompletionSync(input2) {
|
|
|
764506
764658
|
async function warmShellHistoryCache() {
|
|
764507
764659
|
await getShellHistoryCommands();
|
|
764508
764660
|
}
|
|
764509
|
-
var shellHistoryCache = null, shellHistoryCacheTimestamp = 0,
|
|
764661
|
+
var shellHistoryCache = null, shellHistoryCacheTimestamp = 0, CACHE_TTL_MS4 = 60000;
|
|
764510
764662
|
var init_shellHistoryCompletion = __esm(() => {
|
|
764511
764663
|
init_history();
|
|
764512
764664
|
init_debug();
|
|
@@ -793791,7 +793943,7 @@ var init_tipRegistry = __esm(() => {
|
|
|
793791
793943
|
init_color();
|
|
793792
793944
|
init_OverageCreditUpsell();
|
|
793793
793945
|
init_shortcutFormat();
|
|
793794
|
-
|
|
793946
|
+
init_prompt10();
|
|
793795
793947
|
init_auth6();
|
|
793796
793948
|
init_concurrentSessions();
|
|
793797
793949
|
init_config4();
|
|
@@ -794763,6 +794915,28 @@ var init_previewNeutralizer = __esm(() => {
|
|
|
794763
794915
|
LOOKALIKE_SINGLE_QUOTES_RE = /[\u2018\u2019\u201A\u201B]/g;
|
|
794764
794916
|
});
|
|
794765
794917
|
|
|
794918
|
+
// src/utils/permissionPromptNotify.ts
|
|
794919
|
+
function getToolDisplayName(toolName) {
|
|
794920
|
+
return (toolName.split("__").pop() || toolName).replace(/_/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
|
|
794921
|
+
}
|
|
794922
|
+
function schedulePermissionPromptNotifyHook(toolDisplayName, delayMs = PERMISSION_PROMPT_NOTIFY_DELAY_MS) {
|
|
794923
|
+
if (process.env.CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS) {
|
|
794924
|
+
return () => {};
|
|
794925
|
+
}
|
|
794926
|
+
const timer2 = setTimeout((displayName) => {
|
|
794927
|
+
executeNotificationHooks({
|
|
794928
|
+
message: `Claude needs your permission to use ${displayName}`,
|
|
794929
|
+
notificationType: "permission_prompt"
|
|
794930
|
+
}).catch(() => {});
|
|
794931
|
+
}, delayMs, toolDisplayName);
|
|
794932
|
+
timer2.unref();
|
|
794933
|
+
return () => clearTimeout(timer2);
|
|
794934
|
+
}
|
|
794935
|
+
var PERMISSION_PROMPT_NOTIFY_DELAY_MS = 6000;
|
|
794936
|
+
var init_permissionPromptNotify = __esm(() => {
|
|
794937
|
+
init_hooks5();
|
|
794938
|
+
});
|
|
794939
|
+
|
|
794766
794940
|
// src/cli/ndjsonSafeStringify.ts
|
|
794767
794941
|
function escapeJsLineTerminators(json2) {
|
|
794768
794942
|
return json2.replace(JS_LINE_TERMINATORS, (c9) => c9 === "\u2028" ? "\\u2028" : "\\u2029");
|
|
@@ -795103,6 +795277,7 @@ class StructuredIO {
|
|
|
795103
795277
|
const requestId = randomUUID62();
|
|
795104
795278
|
const neutralizedRequestInput = neutralizePreviewInput(input2);
|
|
795105
795279
|
onPermissionPrompt?.(buildRequiresActionDetails(tool, neutralizedRequestInput, toolUseID, requestId));
|
|
795280
|
+
const cancelPermissionPromptNotify = schedulePermissionPromptNotifyHook(getToolDisplayName(tool.name));
|
|
795106
795281
|
const sdkPromise = this.sendRequest({
|
|
795107
795282
|
subtype: "can_use_tool",
|
|
795108
795283
|
tool_name: tool.name,
|
|
@@ -795113,6 +795288,7 @@ class StructuredIO {
|
|
|
795113
795288
|
tool_use_id: toolUseID,
|
|
795114
795289
|
agent_id: toolUseContext.agentId
|
|
795115
795290
|
}, outputSchema41(), hookAbortController.signal, requestId).then((result) => ({ source: "sdk", result }));
|
|
795291
|
+
sdkPromise.then(cancelPermissionPromptNotify, cancelPermissionPromptNotify);
|
|
795116
795292
|
const winner = await Promise.race([hookPromise, sdkPromise]);
|
|
795117
795293
|
if (winner.source === "hook") {
|
|
795118
795294
|
if (winner.decision) {
|
|
@@ -795177,14 +795353,19 @@ class StructuredIO {
|
|
|
795177
795353
|
createSandboxAskCallback() {
|
|
795178
795354
|
return async (hostPattern) => {
|
|
795179
795355
|
try {
|
|
795180
|
-
const
|
|
795181
|
-
|
|
795182
|
-
|
|
795183
|
-
|
|
795184
|
-
|
|
795185
|
-
|
|
795186
|
-
|
|
795187
|
-
|
|
795356
|
+
const cancelPermissionPromptNotify = schedulePermissionPromptNotifyHook(getToolDisplayName(SANDBOX_NETWORK_ACCESS_TOOL_NAME));
|
|
795357
|
+
try {
|
|
795358
|
+
const result = await this.sendRequest({
|
|
795359
|
+
subtype: "can_use_tool",
|
|
795360
|
+
tool_name: SANDBOX_NETWORK_ACCESS_TOOL_NAME,
|
|
795361
|
+
input: { host: hostPattern.host },
|
|
795362
|
+
tool_use_id: randomUUID62(),
|
|
795363
|
+
description: `Allow network connection to ${hostPattern.host}?`
|
|
795364
|
+
}, outputSchema41());
|
|
795365
|
+
return result.behavior === "allow";
|
|
795366
|
+
} finally {
|
|
795367
|
+
cancelPermissionPromptNotify();
|
|
795368
|
+
}
|
|
795188
795369
|
} catch {
|
|
795189
795370
|
return false;
|
|
795190
795371
|
}
|
|
@@ -795263,6 +795444,7 @@ var init_structuredIO = __esm(() => {
|
|
|
795263
795444
|
init_slowOperations();
|
|
795264
795445
|
init_v4();
|
|
795265
795446
|
init_hooks5();
|
|
795447
|
+
init_permissionPromptNotify();
|
|
795266
795448
|
init_PermissionUpdate();
|
|
795267
795449
|
init_sessionState();
|
|
795268
795450
|
init_slowOperations();
|
|
@@ -800961,7 +801143,7 @@ var init_useScheduledTasks = __esm(() => {
|
|
|
800961
801143
|
init_AppState();
|
|
800962
801144
|
init_Task();
|
|
800963
801145
|
init_InProcessTeammateTask();
|
|
800964
|
-
|
|
801146
|
+
init_prompt10();
|
|
800965
801147
|
init_cronJitterConfig();
|
|
800966
801148
|
init_cronScheduler();
|
|
800967
801149
|
init_cronTasks();
|
|
@@ -804710,7 +804892,8 @@ var init_REPL = __esm(() => {
|
|
|
804710
804892
|
init_ExitPlanModePermissionRequest();
|
|
804711
804893
|
init_permissionSetup();
|
|
804712
804894
|
init_filesystem();
|
|
804713
|
-
|
|
804895
|
+
init_prompt6();
|
|
804896
|
+
init_prompt13();
|
|
804714
804897
|
init_bashPermissions();
|
|
804715
804898
|
init_config4();
|
|
804716
804899
|
init_billing();
|
|
@@ -810393,7 +810576,7 @@ Examples:
|
|
|
810393
810576
|
/batch add type annotations to all untyped function parameters`;
|
|
810394
810577
|
var init_batch = __esm(() => {
|
|
810395
810578
|
init_constants3();
|
|
810396
|
-
|
|
810579
|
+
init_prompt9();
|
|
810397
810580
|
init_git();
|
|
810398
810581
|
init_bundledSkills();
|
|
810399
810582
|
WORKER_INSTRUCTIONS = `After you finish implementing the change:
|
|
@@ -812744,7 +812927,7 @@ function registerLoopSkill() {
|
|
|
812744
812927
|
}
|
|
812745
812928
|
var DEFAULT_INTERVAL = "10m", USAGE_MESSAGE;
|
|
812746
812929
|
var init_loop = __esm(() => {
|
|
812747
|
-
|
|
812930
|
+
init_prompt10();
|
|
812748
812931
|
init_bundledSkills();
|
|
812749
812932
|
USAGE_MESSAGE = `Usage: /loop [interval] <prompt>
|
|
812750
812933
|
|
|
@@ -813110,7 +813293,7 @@ var BASE58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", BASE_
|
|
|
813110
813293
|
var init_scheduleRemoteAgents = __esm(() => {
|
|
813111
813294
|
init_growthbook();
|
|
813112
813295
|
init_policyLimits();
|
|
813113
|
-
|
|
813296
|
+
init_prompt9();
|
|
813114
813297
|
init_auth6();
|
|
813115
813298
|
init_preconditions();
|
|
813116
813299
|
init_debug();
|
|
@@ -813723,7 +813906,7 @@ async function logSkillsLoaded(cwd2, contextWindowTokens) {
|
|
|
813723
813906
|
var init_skillLoadedEvent = __esm(() => {
|
|
813724
813907
|
init_commands5();
|
|
813725
813908
|
init_analytics();
|
|
813726
|
-
|
|
813909
|
+
init_prompt27();
|
|
813727
813910
|
});
|
|
813728
813911
|
|
|
813729
813912
|
// src/cli/exit.ts
|
|
@@ -815854,7 +816037,7 @@ var init_streamlinedTransform = __esm(() => {
|
|
|
815854
816037
|
init_prompt3();
|
|
815855
816038
|
init_prompt4();
|
|
815856
816039
|
init_prompt2();
|
|
815857
|
-
|
|
816040
|
+
init_prompt7();
|
|
815858
816041
|
init_messages3();
|
|
815859
816042
|
init_shellToolUtils();
|
|
815860
816043
|
init_stringUtils();
|
|
@@ -820412,7 +820595,7 @@ var init_print = __esm(() => {
|
|
|
820412
820595
|
proactiveModule9 = feature("PROACTIVE") || feature("KAIROS") ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
820413
820596
|
cronSchedulerModule = feature("AGENT_TRIGGERS") ? (init_cronScheduler(), __toCommonJS(exports_cronScheduler)) : null;
|
|
820414
820597
|
cronJitterConfigModule = feature("AGENT_TRIGGERS") ? (init_cronJitterConfig(), __toCommonJS(exports_cronJitterConfig)) : null;
|
|
820415
|
-
cronGate = feature("AGENT_TRIGGERS") ? (
|
|
820598
|
+
cronGate = feature("AGENT_TRIGGERS") ? (init_prompt10(), __toCommonJS(exports_prompt3)) : null;
|
|
820416
820599
|
extractMemoriesModule3 = feature("EXTRACT_MEMORIES") ? (init_extractMemories(), __toCommonJS(exports_extractMemories)) : null;
|
|
820417
820600
|
receivedMessageUuids = new Set;
|
|
820418
820601
|
receivedMessageUuidsOrder = [];
|