@opencow-ai/opencow-agent-sdk 0.4.12 → 0.4.13
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 +102 -34
- package/dist/client.js +101 -26
- package/dist/controller/compact/autoCompact.d.ts +4 -0
- package/dist/controller/loop.d.ts +1 -0
- package/dist/entrypoints/sdk/runtimeTypes.d.ts +25 -4
- package/dist/providers/codex/shim.d.ts +3 -3
- package/dist/providers/openai/shim.d.ts +8 -19
- package/dist/providers/shared/config.d.ts +4 -3
- package/dist/providers/shared/model/maxTokens.d.ts +1 -0
- package/dist/providers/shared/routing.d.ts +3 -1
- package/dist/query.d.ts +1 -0
- package/dist/sdk.js +101 -26
- package/dist/types/toolRuntime.d.ts +1 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -85561,7 +85561,7 @@ function convertChunkUsage(usage) {
|
|
|
85561
85561
|
return openaiUsageToAnthropicUsage(usage);
|
|
85562
85562
|
}
|
|
85563
85563
|
function toOpenAIChatReasoningEffort(effort) {
|
|
85564
|
-
return effort
|
|
85564
|
+
return effort;
|
|
85565
85565
|
}
|
|
85566
85566
|
function getOpenAIChatProviderCapabilities(model) {
|
|
85567
85567
|
return {
|
|
@@ -86006,7 +86006,14 @@ class OpenAIShimMessages {
|
|
|
86006
86006
|
let httpResponse;
|
|
86007
86007
|
const promise2 = (async () => {
|
|
86008
86008
|
const overrideTransport = self2.providerOverride?.transport === "anthropic" ? undefined : self2.providerOverride?.transport;
|
|
86009
|
-
const
|
|
86009
|
+
const hasProviderReasoningEffortOverride = !!self2.providerOverride && Object.prototype.hasOwnProperty.call(self2.providerOverride, "reasoningEffort");
|
|
86010
|
+
const reasoningEffortOverride = hasProviderReasoningEffortOverride ? self2.providerOverride?.reasoningEffort ?? null : self2.reasoningEffort;
|
|
86011
|
+
const request = resolveProviderRequest({
|
|
86012
|
+
model: self2.providerOverride?.model ?? params.model,
|
|
86013
|
+
baseUrl: self2.providerOverride?.baseURL,
|
|
86014
|
+
...reasoningEffortOverride !== undefined ? { reasoningEffortOverride } : {},
|
|
86015
|
+
transportOverride: overrideTransport
|
|
86016
|
+
});
|
|
86010
86017
|
const response = await self2._doRequest(request, params, options);
|
|
86011
86018
|
httpResponse = response;
|
|
86012
86019
|
if (params.stream) {
|
|
@@ -92628,7 +92635,7 @@ function parseReasoningEffort(value) {
|
|
|
92628
92635
|
if (!value)
|
|
92629
92636
|
return;
|
|
92630
92637
|
const normalized = value.trim().toLowerCase();
|
|
92631
|
-
if (normalized === "low" || normalized === "medium" || normalized === "high" || normalized === "xhigh") {
|
|
92638
|
+
if (normalized === "none" || normalized === "minimal" || normalized === "low" || normalized === "medium" || normalized === "high" || normalized === "xhigh") {
|
|
92632
92639
|
return normalized;
|
|
92633
92640
|
}
|
|
92634
92641
|
return;
|
|
@@ -92749,7 +92756,10 @@ function resolveProviderRequest(options) {
|
|
|
92749
92756
|
transportOverride: options?.transportOverride
|
|
92750
92757
|
});
|
|
92751
92758
|
const resolvedModel = transport === "chat_completions" && isEnvTruthy(getQueryEnvVar("CLAUDE_CODE_USE_GITHUB")) ? normalizeGithubModelsApiModel(requestedModel) : descriptor.baseModel;
|
|
92752
|
-
const
|
|
92759
|
+
const hasReasoningEffortOverride = !!options && Object.prototype.hasOwnProperty.call(options, "reasoningEffortOverride");
|
|
92760
|
+
const rawEnvReasoningEffortOverride = getQueryEnvVar(QUERY_ENV_KEY_REASONING_EFFORT_OVERRIDE);
|
|
92761
|
+
const envReasoningEffortOverride = parseReasoningEffort(rawEnvReasoningEffortOverride);
|
|
92762
|
+
const reasoning = hasReasoningEffortOverride ? options?.reasoningEffortOverride ? { effort: options.reasoningEffortOverride } : undefined : rawEnvReasoningEffortOverride === QUERY_ENV_VALUE_REASONING_EFFORT_CLEAR ? undefined : envReasoningEffortOverride ? { effort: envReasoningEffortOverride } : descriptor.reasoning;
|
|
92753
92763
|
return {
|
|
92754
92764
|
transport,
|
|
92755
92765
|
requestedModel,
|
|
@@ -92860,7 +92870,7 @@ function getReasoningEffortForModel(model) {
|
|
|
92860
92870
|
const aliasConfig = CODEX_ALIAS_MODELS[alias];
|
|
92861
92871
|
return aliasConfig?.reasoningEffort;
|
|
92862
92872
|
}
|
|
92863
|
-
var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1", DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api/codex", DEFAULT_GITHUB_MODELS_API_MODEL = "openai/gpt-4.1", CODEX_ALIAS_MODELS, QUERY_ENV_KEY_TRANSPORT_OVERRIDE = "__OPENCOW_TRANSPORT_OVERRIDE", QUERY_ENV_KEY_PROVIDER_SPECIFIC_OPENAI_RESPONSES = "__OPENCOW_PROVIDER_SPECIFIC_OPENAI_RESPONSES", LOCALHOST_HOSTNAMES, warnedCodexAliasOnce = false, MissingProviderModelError;
|
|
92873
|
+
var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1", DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api/codex", DEFAULT_GITHUB_MODELS_API_MODEL = "openai/gpt-4.1", CODEX_ALIAS_MODELS, QUERY_ENV_KEY_TRANSPORT_OVERRIDE = "__OPENCOW_TRANSPORT_OVERRIDE", QUERY_ENV_KEY_REASONING_EFFORT_OVERRIDE = "__OPENCOW_REASONING_EFFORT_OVERRIDE", QUERY_ENV_VALUE_REASONING_EFFORT_CLEAR = "__OPENCOW_CLEAR_REASONING_EFFORT__", QUERY_ENV_KEY_PROVIDER_SPECIFIC_OPENAI_RESPONSES = "__OPENCOW_PROVIDER_SPECIFIC_OPENAI_RESPONSES", LOCALHOST_HOSTNAMES, warnedCodexAliasOnce = false, MissingProviderModelError;
|
|
92864
92874
|
var init_config3 = __esm(() => {
|
|
92865
92875
|
init_envUtils();
|
|
92866
92876
|
init_state2();
|
|
@@ -94524,7 +94534,7 @@ function printStartupScreen() {
|
|
|
94524
94534
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
94525
94535
|
out.push(boxRow(sRow, W2, sLen));
|
|
94526
94536
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
94527
|
-
out.push(` ${DIM}${rgb(...DIMCOL)}opencow ${RESET}${rgb(...ACCENT)}v${"0.4.
|
|
94537
|
+
out.push(` ${DIM}${rgb(...DIMCOL)}opencow ${RESET}${rgb(...ACCENT)}v${"0.4.13"}${RESET}`);
|
|
94528
94538
|
out.push("");
|
|
94529
94539
|
process.stdout.write(out.join(`
|
|
94530
94540
|
`) + `
|
|
@@ -113069,15 +113079,16 @@ function isMaxTokensCapEnabled() {
|
|
|
113069
113079
|
}
|
|
113070
113080
|
function getMaxOutputTokensForModel(model, opts) {
|
|
113071
113081
|
const maxOutputTokens = getModelMaxOutputTokens(model);
|
|
113072
|
-
const
|
|
113082
|
+
const upperLimit = opts?.upperLimitOverride !== undefined && Number.isFinite(opts.upperLimitOverride) && opts.upperLimitOverride >= 1 ? Math.floor(opts.upperLimitOverride) : maxOutputTokens.upperLimit;
|
|
113083
|
+
const defaultTokens = isMaxTokensCapEnabled() ? Math.min(maxOutputTokens.default, CAPPED_DEFAULT_MAX_TOKENS, upperLimit) : Math.min(maxOutputTokens.default, upperLimit);
|
|
113073
113084
|
if (opts?.override !== undefined) {
|
|
113074
|
-
if (!Number.isFinite(opts.override) || opts.override < 1 || opts.override >
|
|
113075
|
-
console.warn(`[opencow] Options.maxOutputTokens=${opts.override} out of range ` + `[1, ${
|
|
113085
|
+
if (!Number.isFinite(opts.override) || opts.override < 1 || opts.override > upperLimit) {
|
|
113086
|
+
console.warn(`[opencow] Options.maxOutputTokens=${opts.override} out of range ` + `[1, ${upperLimit}] for model ${model}; clamping.`);
|
|
113076
113087
|
}
|
|
113077
|
-
const clamped = Math.min(Math.max(1, Math.floor(opts.override)),
|
|
113088
|
+
const clamped = Math.min(Math.max(1, Math.floor(opts.override)), upperLimit);
|
|
113078
113089
|
return clamped;
|
|
113079
113090
|
}
|
|
113080
|
-
const result = validateBoundedIntEnvVar("CLAUDE_CODE_MAX_OUTPUT_TOKENS", resolveEnvVar("MAX_OUTPUT_TOKENS"), defaultTokens,
|
|
113091
|
+
const result = validateBoundedIntEnvVar("CLAUDE_CODE_MAX_OUTPUT_TOKENS", resolveEnvVar("MAX_OUTPUT_TOKENS"), defaultTokens, upperLimit);
|
|
113081
113092
|
return result.effective;
|
|
113082
113093
|
}
|
|
113083
113094
|
var init_maxTokens = __esm(() => {
|
|
@@ -118590,6 +118601,13 @@ function getDisableExtglobCommand(shellPath) {
|
|
|
118590
118601
|
}
|
|
118591
118602
|
return null;
|
|
118592
118603
|
}
|
|
118604
|
+
function getHostProvidedPathCommand() {
|
|
118605
|
+
const path11 = getHostProvidedEnvVar("PATH");
|
|
118606
|
+
if (!path11) {
|
|
118607
|
+
return null;
|
|
118608
|
+
}
|
|
118609
|
+
return `export PATH=${quote([path11])}`;
|
|
118610
|
+
}
|
|
118593
118611
|
async function createBashShellProvider(shellPath, options2) {
|
|
118594
118612
|
let currentSandboxTmpDir;
|
|
118595
118613
|
const snapshotPromise = options2?.skipSnapshot ? Promise.resolve(undefined) : createAndSaveSnapshot(shellPath).catch((error41) => {
|
|
@@ -118630,6 +118648,10 @@ async function createBashShellProvider(shellPath, options2) {
|
|
|
118630
118648
|
const finalPath = getPlatform() === "windows" ? windowsPathToPosixPath(snapshotFilePath) : snapshotFilePath;
|
|
118631
118649
|
commandParts.push(`source ${quote([finalPath])} 2>/dev/null || true`);
|
|
118632
118650
|
}
|
|
118651
|
+
const hostPathCommand = getHostProvidedPathCommand();
|
|
118652
|
+
if (hostPathCommand) {
|
|
118653
|
+
commandParts.push(hostPathCommand);
|
|
118654
|
+
}
|
|
118633
118655
|
const sessionEnvScript2 = await getSessionEnvironmentScript();
|
|
118634
118656
|
if (sessionEnvScript2) {
|
|
118635
118657
|
commandParts.push(sessionEnvScript2);
|
|
@@ -243655,7 +243677,11 @@ async function* queryLoop(params, consumedCommandUuids) {
|
|
|
243655
243677
|
if (false) {}
|
|
243656
243678
|
const mediaRecoveryEnabled = reactiveCompact?.isReactiveCompactEnabled() ?? false;
|
|
243657
243679
|
if (!compactionResult && querySource !== "compact" && querySource !== "session_memory" && !(reactiveCompact?.isReactiveCompactEnabled() && isAutoCompactEnabled()) && !collapseOwnsIt) {
|
|
243658
|
-
const { isAtBlockingLimit } = calculateTokenWarningState(tokenCountWithEstimation(messagesForQuery) - snipTokensFreed, toolUseContext.options.mainLoopModel
|
|
243680
|
+
const { isAtBlockingLimit } = calculateTokenWarningState(tokenCountWithEstimation(messagesForQuery) - snipTokensFreed, toolUseContext.options.mainLoopModel, {
|
|
243681
|
+
contextWindow: toolUseContext.options.contextWindow,
|
|
243682
|
+
maxOutputTokens: toolUseContext.options.maxOutputTokens,
|
|
243683
|
+
maxOutputTokensLimit: toolUseContext.options.maxOutputTokensLimit
|
|
243684
|
+
});
|
|
243659
243685
|
if (isAtBlockingLimit) {
|
|
243660
243686
|
yield createAssistantAPIErrorMessage({
|
|
243661
243687
|
content: PROMPT_TOO_LONG_ERROR_MESSAGE,
|
|
@@ -243698,6 +243724,7 @@ async function* queryLoop(params, consumedCommandUuids) {
|
|
|
243698
243724
|
allowedAgentTypes: toolUseContext.options.agentDefinitions.allowedAgentTypes,
|
|
243699
243725
|
hasAppendSystemPrompt: !!toolUseContext.options.appendSystemPrompt,
|
|
243700
243726
|
maxOutputTokensOverride,
|
|
243727
|
+
maxOutputTokensLimitOverride: params.maxOutputTokensLimitOverride,
|
|
243701
243728
|
fetchOverride: dumpPromptsFetch,
|
|
243702
243729
|
mcpTools: appState.mcp.tools,
|
|
243703
243730
|
hasPendingMcpServers: appState.mcp.clients.some((c6) => c6.type === "pending"),
|
|
@@ -244407,7 +244434,7 @@ function getAnthropicEnvMetadata() {
|
|
|
244407
244434
|
function getBuildAgeMinutes() {
|
|
244408
244435
|
if (false)
|
|
244409
244436
|
;
|
|
244410
|
-
const buildTime = new Date("2026-06-
|
|
244437
|
+
const buildTime = new Date("2026-06-25T12:29:02.938Z").getTime();
|
|
244411
244438
|
if (isNaN(buildTime))
|
|
244412
244439
|
return;
|
|
244413
244440
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -245008,6 +245035,7 @@ async function runForkedAgent({
|
|
|
245008
245035
|
toolUseContext: isolatedToolUseContext,
|
|
245009
245036
|
querySource,
|
|
245010
245037
|
maxOutputTokensOverride: maxOutputTokens,
|
|
245038
|
+
maxOutputTokensLimitOverride: isolatedToolUseContext.options.maxOutputTokensLimit,
|
|
245011
245039
|
maxTurns,
|
|
245012
245040
|
skipCacheWrite
|
|
245013
245041
|
})) {
|
|
@@ -302297,7 +302325,17 @@ ${formattedSummary}`;
|
|
|
302297
302325
|
if (transcriptPath) {
|
|
302298
302326
|
baseSummary += `
|
|
302299
302327
|
|
|
302300
|
-
|
|
302328
|
+
IMPORTANT — Transcript recovery protocol:
|
|
302329
|
+
The full pre-compaction conversation is preserved at: ${transcriptPath}
|
|
302330
|
+
When you encounter ANY of these situations, you MUST use the Read tool to search the transcript for the missing context BEFORE responding:
|
|
302331
|
+
- You are unsure about a specific detail (file path, function name, error message, code snippet, user preference)
|
|
302332
|
+
- The user references something you cannot find in the summary above
|
|
302333
|
+
- You need exact code that was previously read or written
|
|
302334
|
+
- You are about to make a decision but feel uncertain whether the user already gave guidance on it
|
|
302335
|
+
- A tool name, skill name, or configuration was discussed but is not in the summary
|
|
302336
|
+
|
|
302337
|
+
The transcript is a JSONL file. Read its tail (last 500–2000 lines) first for the most recent context; if that doesn't resolve the gap, read earlier sections.
|
|
302338
|
+
Do NOT guess or hallucinate details that might have been discussed — read the transcript instead.`;
|
|
302301
302339
|
}
|
|
302302
302340
|
if (recentMessagesPreserved) {
|
|
302303
302341
|
baseSummary += `
|
|
@@ -302364,6 +302402,7 @@ Your summary should include the following sections:
|
|
|
302364
302402
|
8. Current Work: Describe in detail precisely what was being worked on immediately before this summary request, paying special attention to the most recent messages from both user and assistant. Include file names and code snippets where applicable.
|
|
302365
302403
|
9. Optional Next Step: List the next step that you will take that is related to the most recent work you were doing. IMPORTANT: ensure that this step is DIRECTLY in line with the user's most recent explicit requests, and the task you were working on immediately before this summary request. If your last task was concluded, then only list next steps if they are explicitly in line with the users request. Do not start on tangential requests or really old requests that were already completed without confirming with the user first.
|
|
302366
302404
|
If there is a next step, include direct quotes from the most recent conversation showing exactly what task you were working on and where you left off. This should be verbatim to ensure there's no drift in task interpretation.
|
|
302405
|
+
10. Uncertain or Incomplete Context: List any items where you are not fully confident in the details — e.g., a tool/skill name you vaguely recall but cannot confirm, a user preference you think was stated but cannot pinpoint, or a decision whose rationale is unclear. Mark each with [NEEDS_TRANSCRIPT_LOOKUP] so the post-compaction assistant knows to read the transcript file for these specific items before acting on them.
|
|
302367
302406
|
|
|
302368
302407
|
Here's an example of how your output should be structured:
|
|
302369
302408
|
|
|
@@ -302414,10 +302453,14 @@ Here's an example of how your output should be structured:
|
|
|
302414
302453
|
9. Optional Next Step:
|
|
302415
302454
|
[Optional Next step to take]
|
|
302416
302455
|
|
|
302456
|
+
10. Uncertain or Incomplete Context:
|
|
302457
|
+
- [Item with unclear details] [NEEDS_TRANSCRIPT_LOOKUP]
|
|
302458
|
+
- [...]
|
|
302459
|
+
|
|
302417
302460
|
</summary>
|
|
302418
302461
|
</example>
|
|
302419
302462
|
|
|
302420
|
-
Please provide your summary based on the conversation so far, following this structure and ensuring precision and thoroughness in your response.
|
|
302463
|
+
Please provide your summary based on the conversation so far, following this structure and ensuring precision and thoroughness in your response.
|
|
302421
302464
|
|
|
302422
302465
|
There may be additional summarization instructions provided in the included context. If so, remember to follow these instructions when creating the above summary. Examples of instructions include:
|
|
302423
302466
|
<example>
|
|
@@ -302445,6 +302488,7 @@ Your summary should include the following sections:
|
|
|
302445
302488
|
7. Pending Tasks: Outline any pending tasks from the recent messages.
|
|
302446
302489
|
8. Current Work: Describe precisely what was being worked on immediately before this summary request.
|
|
302447
302490
|
9. Optional Next Step: List the next step related to the most recent work. Include direct quotes from the most recent conversation.
|
|
302491
|
+
10. Uncertain or Incomplete Context: List any items where details are unclear or potentially missing from the recent messages. Mark each with [NEEDS_TRANSCRIPT_LOOKUP].
|
|
302448
302492
|
|
|
302449
302493
|
Here's an example of how your output should be structured:
|
|
302450
302494
|
|
|
@@ -302485,6 +302529,9 @@ Here's an example of how your output should be structured:
|
|
|
302485
302529
|
9. Optional Next Step:
|
|
302486
302530
|
[Optional Next step to take]
|
|
302487
302531
|
|
|
302532
|
+
10. Uncertain or Incomplete Context:
|
|
302533
|
+
- [Item with unclear details] [NEEDS_TRANSCRIPT_LOOKUP]
|
|
302534
|
+
|
|
302488
302535
|
</summary>
|
|
302489
302536
|
</example>
|
|
302490
302537
|
|
|
@@ -302505,6 +302552,7 @@ Your summary should include the following sections:
|
|
|
302505
302552
|
7. Pending Tasks: Outline any pending tasks.
|
|
302506
302553
|
8. Work Completed: Describe what was accomplished by the end of this portion.
|
|
302507
302554
|
9. Context for Continuing Work: Summarize any context, decisions, or state that would be needed to understand and continue the work in subsequent messages.
|
|
302555
|
+
10. Uncertain or Incomplete Context: List any items where details are unclear or potentially incomplete. Mark each with [NEEDS_TRANSCRIPT_LOOKUP] so the continuing session knows to look them up in the transcript before acting.
|
|
302508
302556
|
|
|
302509
302557
|
Here's an example of how your output should be structured:
|
|
302510
302558
|
|
|
@@ -302545,6 +302593,9 @@ Here's an example of how your output should be structured:
|
|
|
302545
302593
|
9. Context for Continuing Work:
|
|
302546
302594
|
[Key context, decisions, or state needed to continue the work]
|
|
302547
302595
|
|
|
302596
|
+
10. Uncertain or Incomplete Context:
|
|
302597
|
+
- [Item with unclear details] [NEEDS_TRANSCRIPT_LOOKUP]
|
|
302598
|
+
|
|
302548
302599
|
</summary>
|
|
302549
302600
|
</example>
|
|
302550
302601
|
|
|
@@ -303199,7 +303250,10 @@ async function streamCompactSummary({
|
|
|
303199
303250
|
toolChoice: undefined,
|
|
303200
303251
|
isNonInteractiveSession: context4.options.isNonInteractiveSession,
|
|
303201
303252
|
hasAppendSystemPrompt: !!context4.options.appendSystemPrompt,
|
|
303202
|
-
maxOutputTokensOverride: Math.min(COMPACT_MAX_OUTPUT_TOKENS, getMaxOutputTokensForModel(context4.options.mainLoopModel
|
|
303253
|
+
maxOutputTokensOverride: Math.min(COMPACT_MAX_OUTPUT_TOKENS, getMaxOutputTokensForModel(context4.options.mainLoopModel, {
|
|
303254
|
+
upperLimitOverride: context4.options.maxOutputTokensLimit
|
|
303255
|
+
})),
|
|
303256
|
+
maxOutputTokensLimitOverride: context4.options.maxOutputTokensLimit,
|
|
303203
303257
|
querySource: "compact",
|
|
303204
303258
|
agents: context4.options.agentDefinitions.activeAgents,
|
|
303205
303259
|
mcpTools: [],
|
|
@@ -304096,7 +304150,10 @@ var init_sessionMemoryCompact = __esm(() => {
|
|
|
304096
304150
|
|
|
304097
304151
|
// src/controller/compact/autoCompact.ts
|
|
304098
304152
|
function getEffectiveContextWindowSize(model, opts) {
|
|
304099
|
-
const reservedTokensForSummary = Math.min(getMaxOutputTokensForModel(model, {
|
|
304153
|
+
const reservedTokensForSummary = Math.min(getMaxOutputTokensForModel(model, {
|
|
304154
|
+
override: opts?.maxOutputTokens,
|
|
304155
|
+
upperLimitOverride: opts?.maxOutputTokensLimit
|
|
304156
|
+
}), MAX_OUTPUT_TOKENS_FOR_SUMMARY);
|
|
304100
304157
|
let contextWindow = getContextWindowForModel(model, getSdkBetas(), {
|
|
304101
304158
|
override: opts?.contextWindow
|
|
304102
304159
|
});
|
|
@@ -304182,7 +304239,8 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
|
|
|
304182
304239
|
const model = toolUseContext.options.mainLoopModel;
|
|
304183
304240
|
const opts = {
|
|
304184
304241
|
contextWindow: toolUseContext.options.contextWindow,
|
|
304185
|
-
maxOutputTokens: toolUseContext.options.maxOutputTokens
|
|
304242
|
+
maxOutputTokens: toolUseContext.options.maxOutputTokens,
|
|
304243
|
+
maxOutputTokensLimit: toolUseContext.options.maxOutputTokensLimit
|
|
304186
304244
|
};
|
|
304187
304245
|
const shouldCompact = await shouldAutoCompact(messages, model, querySource, snipTokensFreed, opts);
|
|
304188
304246
|
if (!shouldCompact) {
|
|
@@ -307630,7 +307688,10 @@ ${deferredToolList}
|
|
|
307630
307688
|
betasParams.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
307631
307689
|
}
|
|
307632
307690
|
}
|
|
307633
|
-
const maxOutputTokens2 = retryContext?.maxTokensOverride ||
|
|
307691
|
+
const maxOutputTokens2 = retryContext?.maxTokensOverride || getMaxOutputTokensForModel(options2.model, {
|
|
307692
|
+
override: options2.maxOutputTokensOverride,
|
|
307693
|
+
upperLimitOverride: options2.maxOutputTokensLimitOverride
|
|
307694
|
+
});
|
|
307634
307695
|
const hasThinking = thinkingConfig.type !== "disabled" && !isEnvTruthy(resolveEnvVar("DISABLE_THINKING"));
|
|
307635
307696
|
let thinking = undefined;
|
|
307636
307697
|
if (hasThinking && modelSupportsThinking(options2.model)) {
|
|
@@ -460063,8 +460124,10 @@ async function processUserInputBase(input, mode, setToolJSX, context6, pastedCon
|
|
|
460063
460124
|
}
|
|
460064
460125
|
}
|
|
460065
460126
|
}
|
|
460127
|
+
const processSlashCommand = getProcessSlashCommand();
|
|
460066
460128
|
if (false) {}
|
|
460067
|
-
const
|
|
460129
|
+
const shouldFallbackSlashToPrompt = inputString !== null && mode === "prompt" && !effectiveSkipSlash && inputString.startsWith("/") && !processSlashCommand;
|
|
460130
|
+
const shouldExtractAttachments = !skipAttachments && inputString !== null && (mode !== "prompt" || effectiveSkipSlash || !inputString.startsWith("/") || shouldFallbackSlashToPrompt);
|
|
460068
460131
|
queryCheckpoint("query_attachment_loading_start");
|
|
460069
460132
|
const attachmentMessages = shouldExtractAttachments ? await toArray2(getAttachmentMessages(inputString, context6, ideSelection ?? null, [], messages, querySource)) : [];
|
|
460070
460133
|
queryCheckpoint("query_attachment_loading_end");
|
|
@@ -460075,11 +460138,10 @@ async function processUserInputBase(input, mode, setToolJSX, context6, pastedCon
|
|
|
460075
460138
|
return addImageMetadataMessage(await processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context6, setToolJSX), imageMetadataTexts);
|
|
460076
460139
|
}
|
|
460077
460140
|
if (inputString !== null && !effectiveSkipSlash && inputString.startsWith("/")) {
|
|
460078
|
-
|
|
460079
|
-
|
|
460080
|
-
|
|
460081
|
-
|
|
460082
|
-
return addImageMetadataMessage(slashResult, imageMetadataTexts);
|
|
460141
|
+
if (processSlashCommand) {
|
|
460142
|
+
const slashResult = await processSlashCommand(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context6, setToolJSX, uuid3, isAlreadyProcessing, canUseTool);
|
|
460143
|
+
return addImageMetadataMessage(slashResult, imageMetadataTexts);
|
|
460144
|
+
}
|
|
460083
460145
|
}
|
|
460084
460146
|
if (inputString !== null && mode === "prompt") {
|
|
460085
460147
|
const trimmedInput = inputString.trim();
|
|
@@ -479782,7 +479844,7 @@ function buildPrimarySection() {
|
|
|
479782
479844
|
}, undefined, false, undefined, this);
|
|
479783
479845
|
return [{
|
|
479784
479846
|
label: "Version",
|
|
479785
|
-
value: "0.4.
|
|
479847
|
+
value: "0.4.13"
|
|
479786
479848
|
}, {
|
|
479787
479849
|
label: "Session name",
|
|
479788
479850
|
value: nameValue
|
|
@@ -536104,7 +536166,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
536104
536166
|
var call58 = async () => {
|
|
536105
536167
|
return {
|
|
536106
536168
|
type: "text",
|
|
536107
|
-
value: `${"99.0.0"} (built ${"2026-06-
|
|
536169
|
+
value: `${"99.0.0"} (built ${"2026-06-25T12:29:02.938Z"})`
|
|
536108
536170
|
};
|
|
536109
536171
|
}, version2, version_default;
|
|
536110
536172
|
var init_version = __esm(() => {
|
|
@@ -558214,7 +558276,7 @@ function WelcomeV2() {
|
|
|
558214
558276
|
dimColor: true,
|
|
558215
558277
|
children: [
|
|
558216
558278
|
"v",
|
|
558217
|
-
"0.4.
|
|
558279
|
+
"0.4.13",
|
|
558218
558280
|
" "
|
|
558219
558281
|
]
|
|
558220
558282
|
}, undefined, true, undefined, this)
|
|
@@ -558414,7 +558476,7 @@ function WelcomeV2() {
|
|
|
558414
558476
|
dimColor: true,
|
|
558415
558477
|
children: [
|
|
558416
558478
|
"v",
|
|
558417
|
-
"0.4.
|
|
558479
|
+
"0.4.13",
|
|
558418
558480
|
" "
|
|
558419
558481
|
]
|
|
558420
558482
|
}, undefined, true, undefined, this)
|
|
@@ -558640,7 +558702,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
558640
558702
|
dimColor: true,
|
|
558641
558703
|
children: [
|
|
558642
558704
|
"v",
|
|
558643
|
-
"0.4.
|
|
558705
|
+
"0.4.13",
|
|
558644
558706
|
" "
|
|
558645
558707
|
]
|
|
558646
558708
|
}, undefined, true, undefined, this);
|
|
@@ -558894,7 +558956,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
558894
558956
|
dimColor: true,
|
|
558895
558957
|
children: [
|
|
558896
558958
|
"v",
|
|
558897
|
-
"0.4.
|
|
558959
|
+
"0.4.13",
|
|
558898
558960
|
" "
|
|
558899
558961
|
]
|
|
558900
558962
|
}, undefined, true, undefined, this);
|
|
@@ -569513,6 +569575,7 @@ class QueryEngine {
|
|
|
569513
569575
|
maxTurns,
|
|
569514
569576
|
maxBudgetUsd,
|
|
569515
569577
|
maxOutputTokens,
|
|
569578
|
+
maxOutputTokensLimit,
|
|
569516
569579
|
contextWindow,
|
|
569517
569580
|
compact: compact2,
|
|
569518
569581
|
taskBudget,
|
|
@@ -569602,6 +569665,7 @@ class QueryEngine {
|
|
|
569602
569665
|
theme: resolveThemeSetting(getGlobalConfig().theme),
|
|
569603
569666
|
maxBudgetUsd,
|
|
569604
569667
|
maxOutputTokens,
|
|
569668
|
+
maxOutputTokensLimit,
|
|
569605
569669
|
contextWindow,
|
|
569606
569670
|
modelProviders: this.config.modelProviders,
|
|
569607
569671
|
subagentDisallowedTools: this.config.subagentDisallowedTools
|
|
@@ -569707,6 +569771,7 @@ class QueryEngine {
|
|
|
569707
569771
|
agentDefinitions: { activeAgents: agents2, allAgents: [] },
|
|
569708
569772
|
maxBudgetUsd,
|
|
569709
569773
|
maxOutputTokens,
|
|
569774
|
+
maxOutputTokensLimit,
|
|
569710
569775
|
contextWindow,
|
|
569711
569776
|
modelProviders: this.config.modelProviders,
|
|
569712
569777
|
subagentDisallowedTools: this.config.subagentDisallowedTools
|
|
@@ -569827,6 +569892,7 @@ class QueryEngine {
|
|
|
569827
569892
|
querySource: "sdk",
|
|
569828
569893
|
maxTurns,
|
|
569829
569894
|
maxOutputTokensOverride: maxOutputTokens,
|
|
569895
|
+
maxOutputTokensLimitOverride: maxOutputTokensLimit,
|
|
569830
569896
|
compactRequest: compact2,
|
|
569831
569897
|
taskBudget
|
|
569832
569898
|
})) {
|
|
@@ -570197,6 +570263,7 @@ async function* ask({
|
|
|
570197
570263
|
maxTurns,
|
|
570198
570264
|
maxBudgetUsd,
|
|
570199
570265
|
maxOutputTokens,
|
|
570266
|
+
maxOutputTokensLimit,
|
|
570200
570267
|
contextWindow,
|
|
570201
570268
|
compact: compact2,
|
|
570202
570269
|
taskBudget,
|
|
@@ -570242,6 +570309,7 @@ async function* ask({
|
|
|
570242
570309
|
maxTurns,
|
|
570243
570310
|
maxBudgetUsd,
|
|
570244
570311
|
maxOutputTokens,
|
|
570312
|
+
maxOutputTokensLimit,
|
|
570245
570313
|
contextWindow,
|
|
570246
570314
|
compact: compact2,
|
|
570247
570315
|
taskBudget,
|
|
@@ -579756,7 +579824,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
579756
579824
|
pendingHookMessages
|
|
579757
579825
|
}, renderAndRun);
|
|
579758
579826
|
}
|
|
579759
|
-
}).version("0.4.
|
|
579827
|
+
}).version("0.4.13 (OpenCow)", "-v, --version", "Output the version number");
|
|
579760
579828
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
579761
579829
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
579762
579830
|
if (canUserConfigureAdvisor()) {
|
|
@@ -580402,7 +580470,7 @@ if (false) {}
|
|
|
580402
580470
|
async function main2() {
|
|
580403
580471
|
const args = process.argv.slice(2);
|
|
580404
580472
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
580405
|
-
console.log(`${"0.4.
|
|
580473
|
+
console.log(`${"0.4.13"} (OpenCow)`);
|
|
580406
580474
|
return;
|
|
580407
580475
|
}
|
|
580408
580476
|
if (args.includes("--provider")) {
|
|
@@ -580520,4 +580588,4 @@ async function main2() {
|
|
|
580520
580588
|
}
|
|
580521
580589
|
main2();
|
|
580522
580590
|
|
|
580523
|
-
//# debugId=
|
|
580591
|
+
//# debugId=D1D0071A1FA049F864756E2164756E21
|