xkzoom 1.5.2 → 1.5.4
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/README.md +87 -43
- package/dist/{chunk-UANVP2AV.mjs → chunk-27BXVTXH.mjs} +1 -1
- package/dist/{chunk-PY7W2X6W.mjs → chunk-2DR5RT3I.mjs} +52 -45
- package/dist/{chunk-YILSXMZI.mjs → chunk-2IQAT3PE.mjs} +1 -1
- package/dist/{chunk-IXYH42YO.mjs → chunk-2VSERWT6.mjs} +1 -1
- package/dist/{chunk-BSQF7NF4.mjs → chunk-3KJHUTOO.mjs} +2 -2
- package/dist/{chunk-URF75O5Z.mjs → chunk-3VA3YDYL.mjs} +1 -1
- package/dist/{chunk-RTANSWHW.mjs → chunk-3ZH273T7.mjs} +27 -27
- package/dist/{chunk-EQNHKW6L.mjs → chunk-4JXTPCOE.mjs} +1 -1
- package/dist/{chunk-WJIY3BIA.mjs → chunk-5SE4JOKE.mjs} +38 -10
- package/dist/{chunk-JD5NPIMO.mjs → chunk-5YEFG7BF.mjs} +25 -25
- package/dist/{chunk-LTBQWMAJ.mjs → chunk-6W4W5JLG.mjs} +1 -1
- package/dist/{chunk-CDLS44GZ.mjs → chunk-76MFE24I.mjs} +1 -1
- package/dist/{chunk-IPIV4NGB.mjs → chunk-76TKUYY3.mjs} +2 -2
- package/dist/{chunk-T4LPE43H.mjs → chunk-7LEEVP5O.mjs} +1 -1
- package/dist/{chunk-A5DUSLHF.mjs → chunk-DCSERRXG.mjs} +1 -1
- package/dist/{chunk-ASIBETCT.mjs → chunk-E2TTUY6R.mjs} +2 -2
- package/dist/chunk-E5LABIPO.mjs +201 -0
- package/dist/{chunk-KYTJH3R3.mjs → chunk-EE3NRJLQ.mjs} +1 -1
- package/dist/{chunk-SIIEMWE3.mjs → chunk-F35EHL5U.mjs} +3 -3
- package/dist/{chunk-K4RHLREV.mjs → chunk-FG6QCRVN.mjs} +1 -1
- package/dist/{chunk-HJN232FK.mjs → chunk-FLVJABFP.mjs} +1 -1
- package/dist/{chunk-ZM23SMRO.mjs → chunk-GIC2RBVM.mjs} +1 -1
- package/dist/{chunk-HTU5W436.mjs → chunk-GZJMFCRG.mjs} +2 -2
- package/dist/{chunk-JG3EPJ32.mjs → chunk-HAI7DJD2.mjs} +3 -3
- package/dist/{chunk-OB4JJLDC.mjs → chunk-HYSOWPIC.mjs} +2 -2
- package/dist/{chunk-G5ZU7562.mjs → chunk-IDQ5B572.mjs} +6 -6
- package/dist/{chunk-GGWUDW5W.mjs → chunk-IGDJGBAI.mjs} +1 -1
- package/dist/{chunk-A23OTVH2.mjs → chunk-J5AXFEDQ.mjs} +18 -18
- package/dist/{chunk-4DYFM3EC.mjs → chunk-JBKRS62W.mjs} +3 -3
- package/dist/{chunk-OCQUSYRP.mjs → chunk-JFFBD5TV.mjs} +14 -14
- package/dist/{chunk-VPRVZWF3.mjs → chunk-JI67TW4E.mjs} +1 -1
- package/dist/{chunk-GBG4AJON.mjs → chunk-JJKRD5DL.mjs} +1 -1
- package/dist/{chunk-7AZVQS2H.mjs → chunk-JXDHNASC.mjs} +12 -12
- package/dist/{chunk-W4MKSQGZ.mjs → chunk-K7RZQIPZ.mjs} +1 -1
- package/dist/{chunk-J5HTLG3V.mjs → chunk-KPDVZFJY.mjs} +1 -1
- package/dist/{chunk-S7FQBXOO.mjs → chunk-L252ASZW.mjs} +1 -1
- package/dist/{chunk-Z7GTU7KF.mjs → chunk-LESS4N25.mjs} +1 -1
- package/dist/{chunk-5DMSAPS2.mjs → chunk-M3ISDSQP.mjs} +7 -7
- package/dist/{chunk-HR43WO4Q.mjs → chunk-M5IU6U3O.mjs} +2 -2
- package/dist/{chunk-BV76CMVR.mjs → chunk-MBOWNG3A.mjs} +1 -1
- package/dist/{chunk-CCCPWU2O.mjs → chunk-MDZUWIBH.mjs} +4 -4
- package/dist/{chunk-YAD4VG2K.mjs → chunk-MKYCBV3H.mjs} +36 -6
- package/dist/{chunk-CORUFGMR.mjs → chunk-MPGMU75K.mjs} +4 -4
- package/dist/{chunk-7FLALKSN.mjs → chunk-MQKREMOB.mjs} +2 -2
- package/dist/{chunk-H5TJYSTV.mjs → chunk-MRTQWCNC.mjs} +1 -1
- package/dist/{chunk-CNHOCDRM.mjs → chunk-NHICONJ3.mjs} +1 -1
- package/dist/{chunk-5JGUBBXN.mjs → chunk-NIU6GWKB.mjs} +2 -2
- package/dist/{chunk-Q6XX6X24.mjs → chunk-OBYPZT2S.mjs} +6 -6
- package/dist/{chunk-Y6SJUTY6.mjs → chunk-P262PAGZ.mjs} +15 -2
- package/dist/{chunk-YPAQRMUI.mjs → chunk-PETWGCGB.mjs} +1 -1
- package/dist/{chunk-Q4XUEIOE.mjs → chunk-PW3ULDNL.mjs} +1 -1
- package/dist/{chunk-EGWLJJY7.mjs → chunk-RKZ56GST.mjs} +2 -2
- package/dist/{chunk-QUXUHJZW.mjs → chunk-TADSGGK2.mjs} +7 -7
- package/dist/{chunk-ILROJZBI.mjs → chunk-TQBVFKCT.mjs} +37 -9
- package/dist/{chunk-M52HZV6R.mjs → chunk-TVH4LII3.mjs} +1 -1
- package/dist/{chunk-GUADF3KN.mjs → chunk-ULXTQSV6.mjs} +4 -0
- package/dist/{chunk-H5DIQHEQ.mjs → chunk-UXEZFEB3.mjs} +37 -8
- package/dist/{chunk-XHO73X2N.mjs → chunk-VNEPNUBZ.mjs} +13 -13
- package/dist/{chunk-NYG3IUXK.mjs → chunk-W75Z6CZR.mjs} +1 -1
- package/dist/{chunk-PG5CHH66.mjs → chunk-YPKHMAO4.mjs} +1 -1
- package/dist/index.js +336 -31
- package/dist/index.mjs +104 -103
- package/dist/mobile/action-planner.js +21 -1
- package/dist/mobile/action-planner.mjs +60 -59
- package/dist/mobile/agent-capabilities.js +21 -1
- package/dist/mobile/agent-capabilities.mjs +60 -59
- package/dist/mobile/anthropic-incremental-deliver.js +19 -0
- package/dist/mobile/anthropic-incremental-deliver.mjs +3 -2
- package/dist/mobile/anthropic-messages-turn-runner.js +224 -8
- package/dist/mobile/anthropic-messages-turn-runner.mjs +69 -68
- package/dist/mobile/anthropic-owned-tool-executor.js +21 -1
- package/dist/mobile/anthropic-owned-tool-executor.mjs +68 -67
- package/dist/mobile/api.mjs +31 -31
- package/dist/mobile/context-compact/compact-artifact-enrich.js +19 -0
- package/dist/mobile/context-compact/compact-artifact-enrich.mjs +8 -7
- package/dist/mobile/context-compact/compact-orchestrator.js +21 -1
- package/dist/mobile/context-compact/compact-orchestrator.mjs +12 -11
- package/dist/mobile/context-compact/compact-summarizer-engine-artifact.js +19 -0
- package/dist/mobile/context-compact/compact-summarizer-engine-artifact.mjs +8 -7
- package/dist/mobile/context-compact/compact-summarizer-llm-request.js +19 -0
- package/dist/mobile/context-compact/compact-summarizer-llm-request.mjs +5 -4
- package/dist/mobile/context-compact/compact-summarizer-llm.js +19 -0
- package/dist/mobile/context-compact/compact-summarizer-llm.mjs +6 -5
- package/dist/mobile/context-compact/compact-summarizer.js +19 -0
- package/dist/mobile/context-compact/compact-summarizer.mjs +7 -6
- package/dist/mobile/context-compact/context-budget-gate.js +14 -2
- package/dist/mobile/context-compact/context-budget-gate.mjs +2 -2
- package/dist/mobile/context-compact/runtime-compact-hook.js +33 -2
- package/dist/mobile/context-compact/runtime-compact-hook.mjs +64 -63
- package/dist/mobile/group/conductor-llm.js +19 -0
- package/dist/mobile/group/conductor-llm.mjs +7 -6
- package/dist/mobile/group/conductor-plan-llm.js +19 -0
- package/dist/mobile/group/conductor-plan-llm.mjs +7 -6
- package/dist/mobile/group/floor-scheduler.mjs +2 -2
- package/dist/mobile/group/group-api-handlers.mjs +21 -21
- package/dist/mobile/group/group-session.mjs +5 -5
- package/dist/mobile/group/index.mjs +16 -16
- package/dist/mobile/group/memory-supplement.mjs +4 -4
- package/dist/mobile/group/orchestrator.mjs +15 -15
- package/dist/mobile/group/plan-runtime.mjs +4 -4
- package/dist/mobile/group/relation-distill.mjs +3 -3
- package/dist/mobile/group/runtime-integration.mjs +19 -19
- package/dist/mobile/group/team-memory-runtime.mjs +3 -3
- package/dist/mobile/index.js +336 -31
- package/dist/mobile/index.mjs +101 -100
- package/dist/mobile/interrupted-turn.js +5 -0
- package/dist/mobile/interrupted-turn.mjs +3 -1
- package/dist/mobile/memory-contract-r1-prefetch.mjs +5 -5
- package/dist/mobile/memory-contract-r5-empty-result.mjs +6 -6
- package/dist/mobile/memory-runtime-v2/eval-runner.mjs +8 -8
- package/dist/mobile/memory-runtime-v2/evidence-plan.mjs +11 -11
- package/dist/mobile/memory-runtime-v2/index.mjs +31 -31
- package/dist/mobile/memory-runtime-v2/local-source-import.mjs +3 -3
- package/dist/mobile/memory-runtime-v2/memory-control-plane.mjs +11 -11
- package/dist/mobile/memory-runtime-v2/memory-readiness.mjs +11 -11
- package/dist/mobile/memory-runtime-v2/orchestrator.mjs +4 -4
- package/dist/mobile/memory-runtime-v2/project-tool-event.mjs +2 -2
- package/dist/mobile/memory-runtime-v2/public-api.mjs +12 -12
- package/dist/mobile/memory-runtime-v2/retrieval.mjs +2 -2
- package/dist/mobile/model-context-window-budget.js +16 -2
- package/dist/mobile/model-context-window-budget.mjs +3 -1
- package/dist/mobile/native-anthropic-messages-stream.js +223 -7
- package/dist/mobile/native-anthropic-messages-stream.mjs +4 -3
- package/dist/mobile/native-anthropic-turn-errors.mjs +2 -2
- package/dist/mobile/native-openai-text-stream.js +223 -6
- package/dist/mobile/native-openai-text-stream.mjs +2 -1
- package/dist/mobile/native-reply-route.js +19 -0
- package/dist/mobile/native-reply-route.mjs +5 -4
- package/dist/mobile/native-reply-system-prompt-layers.js +21 -1
- package/dist/mobile/native-reply-system-prompt-layers.mjs +61 -60
- package/dist/mobile/native-request-diagnostics.js +230 -0
- package/dist/mobile/native-request-diagnostics.mjs +17 -0
- package/dist/mobile/native-stream-block-emit.js +19 -0
- package/dist/mobile/native-stream-block-emit.mjs +2 -1
- package/dist/mobile/openai-completions-turn-runner.js +224 -8
- package/dist/mobile/openai-completions-turn-runner.mjs +69 -68
- package/dist/mobile/runtime.js +336 -31
- package/dist/mobile/runtime.mjs +100 -99
- package/dist/mobile/stream-inbound/mobile-text-stream-pipeline.mjs +4 -4
- package/dist/mobile/tool-use-input-normalize.js +21 -1
- package/dist/mobile/tool-use-input-normalize.mjs +63 -62
- package/dist/mobile/tools/mobile-compact-tool-bridge.js +21 -1
- package/dist/mobile/tools/mobile-compact-tool-bridge.mjs +63 -62
- package/dist/org/dept-context.mjs +2 -2
- package/dist/org/index.mjs +8 -8
- package/dist/owned-tools/ceo-confirm-requirements.mjs +3 -3
- package/dist/owned-tools/ceo-decision.mjs +4 -4
- package/dist/owned-tools/ceo-ops-brief.mjs +3 -3
- package/dist/owned-tools/ceo-redirect.mjs +20 -20
- package/dist/owned-tools/commit-stack-lesson.mjs +4 -4
- package/dist/owned-tools/compact/execute.js +21 -1
- package/dist/owned-tools/compact/execute.mjs +61 -60
- package/dist/owned-tools/compact/gateway-tool-factory.js +21 -1
- package/dist/owned-tools/compact/gateway-tool-factory.mjs +62 -61
- package/dist/owned-tools/compact/registry.js +21 -1
- package/dist/owned-tools/compact/registry.mjs +60 -59
- package/dist/owned-tools/context-compact.js +21 -1
- package/dist/owned-tools/context-compact.mjs +25 -24
- package/dist/owned-tools/handoff.mjs +3 -3
- package/dist/owned-tools/memory-control.mjs +13 -13
- package/dist/owned-tools/memory-runtime-eval.mjs +12 -12
- package/dist/owned-tools/register-owned-providers.mjs +3 -3
- package/dist/owned-tools/registry.js +21 -1
- package/dist/owned-tools/registry.mjs +59 -58
- package/dist/owned-tools/router.js +21 -1
- package/dist/owned-tools/router.mjs +60 -59
- package/dist/owned-tools/runtime-bridge.js +21 -1
- package/dist/owned-tools/runtime-bridge.mjs +61 -60
- package/dist/owned-tools/tool-contract-prompt.js +21 -1
- package/dist/owned-tools/tool-contract-prompt.mjs +60 -59
- package/dist/owned-tools/tool-result-envelope.js +21 -1
- package/dist/owned-tools/tool-result-envelope.mjs +62 -61
- package/dist/owned-tools/tool-usage-guide.js +21 -1
- package/dist/owned-tools/tool-usage-guide.mjs +59 -58
- package/dist/owned-tools/tts.mjs +2 -2
- package/dist/project-pipeline/handlers.mjs +20 -20
- package/dist/project-pipeline/index.mjs +20 -20
- package/dist/project-pipeline/post-close-skill-evolution.mjs +3 -3
- package/package.json +2 -2
- package/dist/{chunk-KCZIK3TH.mjs → chunk-2QCX6RPN.mjs} +3 -3
- package/dist/{chunk-2BGXTBZX.mjs → chunk-D3N7EHB2.mjs} +8 -8
- package/dist/{chunk-JIY7IOQ5.mjs → chunk-DRY7AJMM.mjs} +3 -3
- package/dist/{chunk-VS2URZFN.mjs → chunk-HWGRW6YP.mjs} +3 -3
- package/dist/{chunk-Q7NYATKS.mjs → chunk-UR6LPERL.mjs} +3 -3
- package/dist/{chunk-TAQQSDJN.mjs → chunk-WPMJCKI2.mjs} +3 -3
- package/dist/{chunk-2TBXT3PD.mjs → chunk-XNQJRIGR.mjs} +9 -9
- package/dist/{chunk-BHMWYAVS.mjs → chunk-YYDDQEY4.mjs} +3 -3
|
@@ -17665,6 +17665,199 @@ var minimaxOpenAiCompletionsAdapter = {
|
|
|
17665
17665
|
id: "minimax"
|
|
17666
17666
|
};
|
|
17667
17667
|
|
|
17668
|
+
// src/mobile/native-request-diagnostics.ts
|
|
17669
|
+
function compactLogValue(value, maxLen = 180) {
|
|
17670
|
+
const text = String(value ?? "").replace(/\s+/g, " ").trim();
|
|
17671
|
+
if (!text) {
|
|
17672
|
+
return "";
|
|
17673
|
+
}
|
|
17674
|
+
return text.length > maxLen ? `${text.slice(0, maxLen)}...` : text;
|
|
17675
|
+
}
|
|
17676
|
+
function readErrorProp(value, key) {
|
|
17677
|
+
return value && typeof value === "object" ? value[key] : void 0;
|
|
17678
|
+
}
|
|
17679
|
+
function positiveInteger(value) {
|
|
17680
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
|
|
17681
|
+
return void 0;
|
|
17682
|
+
}
|
|
17683
|
+
return Math.trunc(value);
|
|
17684
|
+
}
|
|
17685
|
+
function formatNativeFetchErrorForLog(error) {
|
|
17686
|
+
const parts = [];
|
|
17687
|
+
let current = error;
|
|
17688
|
+
for (let depth = 0; depth < 4 && current !== null && current !== void 0; depth += 1) {
|
|
17689
|
+
const prefix = depth === 0 ? "error" : `cause${depth}`;
|
|
17690
|
+
const name = compactLogValue(readErrorProp(current, "name"));
|
|
17691
|
+
const message = current instanceof Error ? compactLogValue(current.message) : compactLogValue(readErrorProp(current, "message") ?? current);
|
|
17692
|
+
const code = compactLogValue(readErrorProp(current, "code"));
|
|
17693
|
+
const errno = compactLogValue(readErrorProp(current, "errno"));
|
|
17694
|
+
if (name) parts.push(`${prefix}Name=${name}`);
|
|
17695
|
+
if (message) parts.push(`${prefix}Message=${message}`);
|
|
17696
|
+
if (code) parts.push(`${prefix}Code=${code}`);
|
|
17697
|
+
if (errno) parts.push(`${prefix}Errno=${errno}`);
|
|
17698
|
+
current = readErrorProp(current, "cause");
|
|
17699
|
+
}
|
|
17700
|
+
return parts.join(" ") || "error=unknown";
|
|
17701
|
+
}
|
|
17702
|
+
function applyConfiguredMaxTokens(requestBody, maxTokens) {
|
|
17703
|
+
const configured = positiveInteger(maxTokens);
|
|
17704
|
+
if (configured === void 0) {
|
|
17705
|
+
return;
|
|
17706
|
+
}
|
|
17707
|
+
const existing = positiveInteger(requestBody.max_tokens);
|
|
17708
|
+
requestBody.max_tokens = existing === void 0 ? configured : Math.min(existing, configured);
|
|
17709
|
+
}
|
|
17710
|
+
function stringifyJsonRequestBody(requestBody) {
|
|
17711
|
+
const bodyText = JSON.stringify(requestBody);
|
|
17712
|
+
return {
|
|
17713
|
+
bodyText,
|
|
17714
|
+
bodyBytes: Buffer.byteLength(bodyText, "utf8")
|
|
17715
|
+
};
|
|
17716
|
+
}
|
|
17717
|
+
function formatRequestShape(input) {
|
|
17718
|
+
const messageCount = Array.isArray(input.messages) ? input.messages.length : 0;
|
|
17719
|
+
const toolCount = Array.isArray(input.tools) ? input.tools.length : 0;
|
|
17720
|
+
const maxTokens = positiveInteger(input.maxTokens);
|
|
17721
|
+
return `bodyBytes=${input.bodyBytes} messages=${messageCount} tools=${toolCount} max_tokens=${maxTokens ?? "n/a"}`;
|
|
17722
|
+
}
|
|
17723
|
+
var DEFAULT_PROVIDER_FETCH_MAX_ATTEMPTS = 2;
|
|
17724
|
+
var HARD_PROVIDER_FETCH_MAX_ATTEMPTS = 4;
|
|
17725
|
+
var DEFAULT_PROVIDER_FETCH_RETRY_BASE_MS = 350;
|
|
17726
|
+
var HARD_PROVIDER_FETCH_RETRY_BASE_MS = 5e3;
|
|
17727
|
+
var RETRYABLE_NATIVE_FETCH_RE = new RegExp(
|
|
17728
|
+
[
|
|
17729
|
+
"fetch failed",
|
|
17730
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
17731
|
+
"UND_ERR_HEADERS_TIMEOUT",
|
|
17732
|
+
"UND_ERR_SOCKET",
|
|
17733
|
+
"ECONNRESET",
|
|
17734
|
+
"ETIMEDOUT",
|
|
17735
|
+
"ECONNREFUSED",
|
|
17736
|
+
"ENOTFOUND",
|
|
17737
|
+
"EAI_AGAIN",
|
|
17738
|
+
"socket hang up",
|
|
17739
|
+
"network connection lost",
|
|
17740
|
+
"network request failed"
|
|
17741
|
+
].join("|"),
|
|
17742
|
+
"i"
|
|
17743
|
+
);
|
|
17744
|
+
function readClampedPositiveEnvInt(env, key, fallback, max) {
|
|
17745
|
+
const raw = (env[key] ?? "").trim();
|
|
17746
|
+
const n = Number.parseInt(raw, 10);
|
|
17747
|
+
if (!Number.isFinite(n) || n <= 0) {
|
|
17748
|
+
return fallback;
|
|
17749
|
+
}
|
|
17750
|
+
return Math.min(Math.trunc(n), max);
|
|
17751
|
+
}
|
|
17752
|
+
function readClampedNonNegativeEnvInt(env, key, fallback, max) {
|
|
17753
|
+
const raw = (env[key] ?? "").trim();
|
|
17754
|
+
const n = Number.parseInt(raw, 10);
|
|
17755
|
+
if (!Number.isFinite(n) || n < 0) {
|
|
17756
|
+
return fallback;
|
|
17757
|
+
}
|
|
17758
|
+
return Math.min(Math.trunc(n), max);
|
|
17759
|
+
}
|
|
17760
|
+
function readProviderFetchMaxAttempts(env) {
|
|
17761
|
+
return readClampedPositiveEnvInt(
|
|
17762
|
+
env,
|
|
17763
|
+
"XKZOOM_NATIVE_PROVIDER_FETCH_MAX_ATTEMPTS",
|
|
17764
|
+
DEFAULT_PROVIDER_FETCH_MAX_ATTEMPTS,
|
|
17765
|
+
HARD_PROVIDER_FETCH_MAX_ATTEMPTS
|
|
17766
|
+
);
|
|
17767
|
+
}
|
|
17768
|
+
function readProviderFetchRetryBaseMs(env) {
|
|
17769
|
+
return readClampedNonNegativeEnvInt(
|
|
17770
|
+
env,
|
|
17771
|
+
"XKZOOM_NATIVE_PROVIDER_FETCH_RETRY_BASE_MS",
|
|
17772
|
+
DEFAULT_PROVIDER_FETCH_RETRY_BASE_MS,
|
|
17773
|
+
HARD_PROVIDER_FETCH_RETRY_BASE_MS
|
|
17774
|
+
);
|
|
17775
|
+
}
|
|
17776
|
+
function isAbortLikeFetchError(error) {
|
|
17777
|
+
const name = compactLogValue(readErrorProp(error, "name"));
|
|
17778
|
+
return name === "AbortError";
|
|
17779
|
+
}
|
|
17780
|
+
function collectFetchErrorText(error) {
|
|
17781
|
+
const parts = [];
|
|
17782
|
+
let current = error;
|
|
17783
|
+
for (let depth = 0; depth < 4 && current !== null && current !== void 0; depth += 1) {
|
|
17784
|
+
parts.push(
|
|
17785
|
+
compactLogValue(readErrorProp(current, "name")),
|
|
17786
|
+
current instanceof Error ? compactLogValue(current.message) : compactLogValue(readErrorProp(current, "message") ?? current),
|
|
17787
|
+
compactLogValue(readErrorProp(current, "code")),
|
|
17788
|
+
compactLogValue(readErrorProp(current, "errno"))
|
|
17789
|
+
);
|
|
17790
|
+
current = readErrorProp(current, "cause");
|
|
17791
|
+
}
|
|
17792
|
+
return parts.filter(Boolean).join(" ");
|
|
17793
|
+
}
|
|
17794
|
+
function isRetryableNativeProviderFetchError(error) {
|
|
17795
|
+
return !isAbortLikeFetchError(error) && RETRYABLE_NATIVE_FETCH_RE.test(collectFetchErrorText(error));
|
|
17796
|
+
}
|
|
17797
|
+
function formatProviderRetryContext(context) {
|
|
17798
|
+
const parts = [
|
|
17799
|
+
`provider=${context.providerId}`,
|
|
17800
|
+
`model=${context.model}`,
|
|
17801
|
+
context.adapter ? `adapter=${context.adapter}` : "",
|
|
17802
|
+
typeof context.iteration === "number" ? `iteration=${context.iteration}` : ""
|
|
17803
|
+
];
|
|
17804
|
+
return parts.filter(Boolean).join(" ");
|
|
17805
|
+
}
|
|
17806
|
+
function asAbortSignal(signal) {
|
|
17807
|
+
if (signal && typeof signal === "object" && "aborted" in signal) {
|
|
17808
|
+
return signal;
|
|
17809
|
+
}
|
|
17810
|
+
return void 0;
|
|
17811
|
+
}
|
|
17812
|
+
async function waitForProviderFetchRetryDelay(delayMs, signal) {
|
|
17813
|
+
if (delayMs <= 0) {
|
|
17814
|
+
return;
|
|
17815
|
+
}
|
|
17816
|
+
if (signal?.aborted) {
|
|
17817
|
+
throw new DOMException("Aborted", "AbortError");
|
|
17818
|
+
}
|
|
17819
|
+
await new Promise((resolve9, reject) => {
|
|
17820
|
+
const timer = setTimeout(() => {
|
|
17821
|
+
signal?.removeEventListener("abort", onAbort);
|
|
17822
|
+
resolve9();
|
|
17823
|
+
}, delayMs);
|
|
17824
|
+
const onAbort = () => {
|
|
17825
|
+
clearTimeout(timer);
|
|
17826
|
+
reject(new DOMException("Aborted", "AbortError"));
|
|
17827
|
+
};
|
|
17828
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
17829
|
+
});
|
|
17830
|
+
}
|
|
17831
|
+
async function fetchNativeProviderWithRetry(url, init, context, env = process.env) {
|
|
17832
|
+
const maxAttempts = readProviderFetchMaxAttempts(env);
|
|
17833
|
+
const retryBaseMs = readProviderFetchRetryBaseMs(env);
|
|
17834
|
+
const signal = asAbortSignal(init.signal);
|
|
17835
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
17836
|
+
try {
|
|
17837
|
+
return await fetch(url, init);
|
|
17838
|
+
} catch (error) {
|
|
17839
|
+
const retry = attempt < maxAttempts && !signal?.aborted && isRetryableNativeProviderFetchError(error);
|
|
17840
|
+
context.log(
|
|
17841
|
+
`[XKZOOM][native-reply][${context.label}] fetch_failed ${url} ${formatProviderRetryContext(context)} attempt=${attempt}/${maxAttempts} retry=${retry ? 1 : 0} ${formatRequestShape({
|
|
17842
|
+
bodyBytes: context.bodyBytes,
|
|
17843
|
+
messages: context.messages,
|
|
17844
|
+
tools: context.tools,
|
|
17845
|
+
maxTokens: context.maxTokens
|
|
17846
|
+
})} ${formatNativeFetchErrorForLog(error)}`
|
|
17847
|
+
);
|
|
17848
|
+
if (!retry) {
|
|
17849
|
+
throw error;
|
|
17850
|
+
}
|
|
17851
|
+
const delayMs = retryBaseMs * attempt;
|
|
17852
|
+
context.log(
|
|
17853
|
+
`[XKZOOM][native-reply][${context.label}] fetch_retry ${url} ${formatProviderRetryContext(context)} nextAttempt=${attempt + 1}/${maxAttempts} delayMs=${delayMs}`
|
|
17854
|
+
);
|
|
17855
|
+
await waitForProviderFetchRetryDelay(delayMs, signal);
|
|
17856
|
+
}
|
|
17857
|
+
}
|
|
17858
|
+
throw new Error(`native provider fetch retry exhausted: ${url}`);
|
|
17859
|
+
}
|
|
17860
|
+
|
|
17668
17861
|
// src/mobile/native-openai-text-stream.ts
|
|
17669
17862
|
var isRecord3 = isGatewayConfigRecord;
|
|
17670
17863
|
function resolveOpenAiCompletionsBodyExtras(provider, baseUrl) {
|
|
@@ -24975,7 +25168,8 @@ var IMAGE_BLOCK_BUDGET_BYTES = 8 * 1024;
|
|
|
24975
25168
|
|
|
24976
25169
|
// src/mobile/model-context-window-budget.ts
|
|
24977
25170
|
var MIN_TRANSCRIPT_BUDGET_BYTES = 64 * 1024;
|
|
24978
|
-
var
|
|
25171
|
+
var DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES = 128 * 1024;
|
|
25172
|
+
var HARD_MAX_TRANSCRIPT_BUDGET_BYTES = 4 * 1024 * 1024;
|
|
24979
25173
|
|
|
24980
25174
|
// src/mobile/context-compact/context-budget-gate.ts
|
|
24981
25175
|
function resolveContextBudgetSignalSource() {
|
|
@@ -39977,15 +40171,37 @@ function createFetchAnthropicTurnStreamFn(cfg, log, providerAccelerationPlan, pr
|
|
|
39977
40171
|
toolChoiceLog = `skipped(${policy.kind}:adapter-undefined)`;
|
|
39978
40172
|
}
|
|
39979
40173
|
}
|
|
40174
|
+
applyConfiguredMaxTokens(requestBody, cfg.maxTokens);
|
|
40175
|
+
const { bodyText, bodyBytes } = stringifyJsonRequestBody(requestBody);
|
|
39980
40176
|
log(
|
|
39981
|
-
`[XKZOOM][native-reply][anthropic-turn] POST ${url} adapter=${adapter.id} provider=${cfg.providerId} model=${cfg.model} iteration=${req.iteration} tools=${Array.isArray(req.tools) ? req.tools.length : 0} tool_choice=${toolChoiceLog}` + (requestBody.thinking !== void 0 && requestBody.thinking !== null ? ` thinking=${requestBody.thinking.type ?? "1"}` : " thinking=0")
|
|
40177
|
+
`[XKZOOM][native-reply][anthropic-turn] POST ${url} adapter=${adapter.id} provider=${cfg.providerId} model=${cfg.model} iteration=${req.iteration} tools=${Array.isArray(req.tools) ? req.tools.length : 0} tool_choice=${toolChoiceLog}` + (requestBody.thinking !== void 0 && requestBody.thinking !== null ? ` thinking=${requestBody.thinking.type ?? "1"}` : " thinking=0") + ` ${formatRequestShape({
|
|
40178
|
+
bodyBytes,
|
|
40179
|
+
messages: req.messages,
|
|
40180
|
+
tools: req.tools,
|
|
40181
|
+
maxTokens: requestBody.max_tokens
|
|
40182
|
+
})}`
|
|
40183
|
+
);
|
|
40184
|
+
const res = await fetchNativeProviderWithRetry(
|
|
40185
|
+
url,
|
|
40186
|
+
{
|
|
40187
|
+
method: "POST",
|
|
40188
|
+
headers,
|
|
40189
|
+
body: bodyText,
|
|
40190
|
+
signal
|
|
40191
|
+
},
|
|
40192
|
+
{
|
|
40193
|
+
label: "anthropic-turn",
|
|
40194
|
+
providerId: cfg.providerId,
|
|
40195
|
+
model: cfg.model,
|
|
40196
|
+
adapter: adapter.id,
|
|
40197
|
+
iteration: req.iteration,
|
|
40198
|
+
bodyBytes,
|
|
40199
|
+
messages: req.messages,
|
|
40200
|
+
tools: req.tools,
|
|
40201
|
+
maxTokens: requestBody.max_tokens,
|
|
40202
|
+
log
|
|
40203
|
+
}
|
|
39982
40204
|
);
|
|
39983
|
-
const res = await fetch(url, {
|
|
39984
|
-
method: "POST",
|
|
39985
|
-
headers,
|
|
39986
|
-
body: JSON.stringify(requestBody),
|
|
39987
|
-
signal
|
|
39988
|
-
});
|
|
39989
40205
|
if (!res.ok) {
|
|
39990
40206
|
const t = await res.text();
|
|
39991
40207
|
throw new Error(`native anthropic-turn HTTP ${res.status}: ${t.slice(0, 500)}`);
|
|
@@ -3,66 +3,68 @@ import {
|
|
|
3
3
|
nativeAnthropicMessagesModelTurnRunner,
|
|
4
4
|
runAnthropicMessagesTurn,
|
|
5
5
|
runNativeAnthropicMessagesTurnToDispatcher
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-5SE4JOKE.mjs";
|
|
7
7
|
import "../chunk-PUZNRJEW.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-TADSGGK2.mjs";
|
|
9
9
|
import "../chunk-M27ATRAG.mjs";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-D3N7EHB2.mjs";
|
|
11
|
+
import "../chunk-OZQHJ2VA.mjs";
|
|
11
12
|
import "../chunk-YIJDZ7M3.mjs";
|
|
12
13
|
import "../chunk-QGUIRS2J.mjs";
|
|
14
|
+
import "../chunk-ZD4JSVZP.mjs";
|
|
13
15
|
import "../chunk-5UAYDBJR.mjs";
|
|
14
16
|
import "../chunk-NSME5UMW.mjs";
|
|
15
17
|
import "../chunk-YUB67QUF.mjs";
|
|
16
18
|
import "../chunk-QADC4VKT.mjs";
|
|
17
19
|
import "../chunk-LBJQ444U.mjs";
|
|
18
20
|
import "../chunk-I7O5UR24.mjs";
|
|
19
|
-
import "../chunk-OZQHJ2VA.mjs";
|
|
20
21
|
import "../chunk-G4PQM7UM.mjs";
|
|
21
22
|
import "../chunk-T6X33GMC.mjs";
|
|
22
23
|
import "../chunk-3N43E4D5.mjs";
|
|
23
24
|
import "../chunk-O6ITK4H3.mjs";
|
|
24
25
|
import "../chunk-WHMATAP4.mjs";
|
|
25
26
|
import "../chunk-PX55IRYL.mjs";
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-JD5NPIMO.mjs";
|
|
27
|
+
import "../chunk-3KJHUTOO.mjs";
|
|
28
|
+
import "../chunk-GIC2RBVM.mjs";
|
|
29
|
+
import "../chunk-2VSERWT6.mjs";
|
|
30
|
+
import "../chunk-5YEFG7BF.mjs";
|
|
31
31
|
import "../chunk-KLQSTA6K.mjs";
|
|
32
32
|
import "../chunk-WZMIOVDV.mjs";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-MBOWNG3A.mjs";
|
|
34
34
|
import "../chunk-KWQEFCOY.mjs";
|
|
35
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-3ZH273T7.mjs";
|
|
36
|
+
import "../chunk-77HWNHNA.mjs";
|
|
36
37
|
import "../chunk-4IUL5JAK.mjs";
|
|
37
38
|
import "../chunk-CKXZA326.mjs";
|
|
38
39
|
import "../chunk-3JF27U3D.mjs";
|
|
39
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-I23YODIQ.mjs";
|
|
40
41
|
import "../chunk-CQUISJWG.mjs";
|
|
41
42
|
import "../chunk-PINXXWFJ.mjs";
|
|
42
43
|
import "../chunk-5A6PJOVC.mjs";
|
|
43
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-DRY7AJMM.mjs";
|
|
44
45
|
import "../chunk-M3PHJAPB.mjs";
|
|
45
46
|
import "../chunk-ZW24EQKD.mjs";
|
|
46
47
|
import "../chunk-EUZU6RVZ.mjs";
|
|
47
48
|
import "../chunk-DS3VLDJA.mjs";
|
|
48
|
-
import "../chunk-I23YODIQ.mjs";
|
|
49
49
|
import "../chunk-WXELBVXY.mjs";
|
|
50
50
|
import "../chunk-Z2JNJLJM.mjs";
|
|
51
|
+
import "../chunk-23G5U4RO.mjs";
|
|
51
52
|
import "../chunk-5ZMY6RTR.mjs";
|
|
53
|
+
import "../chunk-634RMCSZ.mjs";
|
|
52
54
|
import "../chunk-MJ6DSJJF.mjs";
|
|
53
55
|
import "../chunk-TRMEHTAT.mjs";
|
|
54
56
|
import "../chunk-CTKIQWTE.mjs";
|
|
55
|
-
import "../chunk-
|
|
56
|
-
import "../chunk-S7FQBXOO.mjs";
|
|
57
|
+
import "../chunk-L252ASZW.mjs";
|
|
57
58
|
import "../chunk-N2CMVW47.mjs";
|
|
58
|
-
import "../chunk-
|
|
59
|
+
import "../chunk-M5IU6U3O.mjs";
|
|
59
60
|
import "../chunk-VWAUDB4X.mjs";
|
|
60
61
|
import "../chunk-NRJWLPTI.mjs";
|
|
61
|
-
import "../chunk-
|
|
62
|
+
import "../chunk-7LEEVP5O.mjs";
|
|
62
63
|
import "../chunk-F4QXCGDQ.mjs";
|
|
63
64
|
import "../chunk-PUND56EY.mjs";
|
|
64
65
|
import "../chunk-LT2FPTFV.mjs";
|
|
65
66
|
import "../chunk-WXLTNKDF.mjs";
|
|
67
|
+
import "../chunk-IT2GAHAL.mjs";
|
|
66
68
|
import "../chunk-56MXMULP.mjs";
|
|
67
69
|
import "../chunk-T6XDJ2QQ.mjs";
|
|
68
70
|
import "../chunk-BRJJML7A.mjs";
|
|
@@ -75,29 +77,31 @@ import "../chunk-BFSOQ5IG.mjs";
|
|
|
75
77
|
import "../chunk-IKQ7CLX3.mjs";
|
|
76
78
|
import "../chunk-VA7SUI2L.mjs";
|
|
77
79
|
import "../chunk-C5FHWCQN.mjs";
|
|
78
|
-
import "../chunk-
|
|
79
|
-
import "../chunk-
|
|
80
|
-
import "../chunk-
|
|
81
|
-
import "../chunk-
|
|
82
|
-
import "../chunk-
|
|
83
|
-
import "../chunk-
|
|
84
|
-
import "../chunk-
|
|
80
|
+
import "../chunk-2IZUNNW7.mjs";
|
|
81
|
+
import "../chunk-UPNUSBKT.mjs";
|
|
82
|
+
import "../chunk-AV3DCNW4.mjs";
|
|
83
|
+
import "../chunk-NHICONJ3.mjs";
|
|
84
|
+
import "../chunk-NIU6GWKB.mjs";
|
|
85
|
+
import "../chunk-6W4W5JLG.mjs";
|
|
86
|
+
import "../chunk-MQKREMOB.mjs";
|
|
87
|
+
import "../chunk-IGDJGBAI.mjs";
|
|
88
|
+
import "../chunk-FG6QCRVN.mjs";
|
|
85
89
|
import "../chunk-X3BY5KPX.mjs";
|
|
86
|
-
import "../chunk-
|
|
90
|
+
import "../chunk-MDZUWIBH.mjs";
|
|
87
91
|
import "../chunk-M5OZFTYB.mjs";
|
|
88
92
|
import "../chunk-H2UCPL5O.mjs";
|
|
89
93
|
import "../chunk-I5A67DYI.mjs";
|
|
90
94
|
import "../chunk-NRPJCCDI.mjs";
|
|
91
|
-
import "../chunk-
|
|
95
|
+
import "../chunk-FLVJABFP.mjs";
|
|
92
96
|
import "../chunk-IMJV6WJP.mjs";
|
|
93
97
|
import "../chunk-4IWTTXQE.mjs";
|
|
94
98
|
import "../chunk-ZTKJR7OC.mjs";
|
|
95
|
-
import "../chunk-
|
|
99
|
+
import "../chunk-JJKRD5DL.mjs";
|
|
96
100
|
import "../chunk-7NIZD2CT.mjs";
|
|
97
|
-
import "../chunk-
|
|
98
|
-
import "../chunk-
|
|
99
|
-
import "../chunk-
|
|
100
|
-
import "../chunk-
|
|
101
|
+
import "../chunk-3VA3YDYL.mjs";
|
|
102
|
+
import "../chunk-MRTQWCNC.mjs";
|
|
103
|
+
import "../chunk-HAI7DJD2.mjs";
|
|
104
|
+
import "../chunk-HYSOWPIC.mjs";
|
|
101
105
|
import "../chunk-AAVCVONC.mjs";
|
|
102
106
|
import "../chunk-NH3HEDTR.mjs";
|
|
103
107
|
import "../chunk-NHI2FACI.mjs";
|
|
@@ -116,23 +120,19 @@ import "../chunk-NDHB4EIS.mjs";
|
|
|
116
120
|
import "../chunk-OIMCXCOZ.mjs";
|
|
117
121
|
import "../chunk-UHHTLW2Z.mjs";
|
|
118
122
|
import "../chunk-UUUBYCJP.mjs";
|
|
119
|
-
import "../chunk-
|
|
123
|
+
import "../chunk-VNEPNUBZ.mjs";
|
|
120
124
|
import "../chunk-IHH6JKPK.mjs";
|
|
121
125
|
import "../chunk-UJHGVFHZ.mjs";
|
|
122
126
|
import "../chunk-QWFX5VEN.mjs";
|
|
123
127
|
import "../chunk-KJR74IUO.mjs";
|
|
124
|
-
import "../chunk-IT2GAHAL.mjs";
|
|
125
128
|
import "../chunk-MJDJIPB4.mjs";
|
|
126
129
|
import "../chunk-TYJNITLS.mjs";
|
|
127
130
|
import "../chunk-PRXIJYAJ.mjs";
|
|
128
131
|
import "../chunk-LBZCBBHU.mjs";
|
|
129
|
-
import "../chunk-2IZUNNW7.mjs";
|
|
130
|
-
import "../chunk-UPNUSBKT.mjs";
|
|
131
|
-
import "../chunk-AV3DCNW4.mjs";
|
|
132
132
|
import "../chunk-VA632PNM.mjs";
|
|
133
133
|
import "../chunk-4ELPLFOH.mjs";
|
|
134
|
-
import "../chunk-
|
|
135
|
-
import "../chunk-
|
|
134
|
+
import "../chunk-P262PAGZ.mjs";
|
|
135
|
+
import "../chunk-UXEZFEB3.mjs";
|
|
136
136
|
import "../chunk-44L5RQKZ.mjs";
|
|
137
137
|
import "../chunk-XQFQO4EA.mjs";
|
|
138
138
|
import "../chunk-GU4CQC5I.mjs";
|
|
@@ -141,11 +141,12 @@ import "../chunk-GOSSEVA6.mjs";
|
|
|
141
141
|
import "../chunk-X7ZWYPCN.mjs";
|
|
142
142
|
import "../chunk-BW737ZQN.mjs";
|
|
143
143
|
import "../chunk-3UZNL3V3.mjs";
|
|
144
|
-
import "../chunk-
|
|
145
|
-
import "../chunk-
|
|
144
|
+
import "../chunk-76MFE24I.mjs";
|
|
145
|
+
import "../chunk-MKYCBV3H.mjs";
|
|
146
146
|
import "../chunk-C36JYBG7.mjs";
|
|
147
147
|
import "../chunk-PJDUIH5J.mjs";
|
|
148
148
|
import "../chunk-NEDXMES6.mjs";
|
|
149
|
+
import "../chunk-E5LABIPO.mjs";
|
|
149
150
|
import "../chunk-LR5GC3NZ.mjs";
|
|
150
151
|
import "../chunk-UQLGVSQH.mjs";
|
|
151
152
|
import "../chunk-E7BFLHLM.mjs";
|
|
@@ -155,16 +156,16 @@ import "../chunk-LJ5OPMYI.mjs";
|
|
|
155
156
|
import "../chunk-MORFK46T.mjs";
|
|
156
157
|
import "../chunk-K5GKQRJY.mjs";
|
|
157
158
|
import "../chunk-54MLYQ72.mjs";
|
|
158
|
-
import "../chunk-
|
|
159
|
+
import "../chunk-JFFBD5TV.mjs";
|
|
159
160
|
import "../chunk-UFV3WER4.mjs";
|
|
160
161
|
import "../chunk-BSG6WLML.mjs";
|
|
161
|
-
import "../chunk-
|
|
162
|
-
import "../chunk-
|
|
162
|
+
import "../chunk-J5AXFEDQ.mjs";
|
|
163
|
+
import "../chunk-W75Z6CZR.mjs";
|
|
163
164
|
import "../chunk-A5OB3QEO.mjs";
|
|
164
165
|
import "../chunk-CRN5R5GG.mjs";
|
|
165
166
|
import "../chunk-VAERBRDX.mjs";
|
|
166
167
|
import "../chunk-L4Z7ND7Z.mjs";
|
|
167
|
-
import "../chunk-
|
|
168
|
+
import "../chunk-2IQAT3PE.mjs";
|
|
168
169
|
import "../chunk-UPZP6IT3.mjs";
|
|
169
170
|
import "../chunk-YH3GFC5X.mjs";
|
|
170
171
|
import "../chunk-C3CZKA3E.mjs";
|
|
@@ -172,7 +173,8 @@ import "../chunk-GIAML5K5.mjs";
|
|
|
172
173
|
import "../chunk-DCAXPHP4.mjs";
|
|
173
174
|
import "../chunk-QFW3ZP6R.mjs";
|
|
174
175
|
import "../chunk-RSMNVCI6.mjs";
|
|
175
|
-
import "../chunk-
|
|
176
|
+
import "../chunk-TOCC5J66.mjs";
|
|
177
|
+
import "../chunk-YYDDQEY4.mjs";
|
|
176
178
|
import "../chunk-MXXTDG5V.mjs";
|
|
177
179
|
import "../chunk-FY2QAWA6.mjs";
|
|
178
180
|
import "../chunk-7XD4NIAR.mjs";
|
|
@@ -183,18 +185,13 @@ import "../chunk-77TFPTUO.mjs";
|
|
|
183
185
|
import "../chunk-ROR7IO7Q.mjs";
|
|
184
186
|
import "../chunk-XEGXKEIR.mjs";
|
|
185
187
|
import "../chunk-HJCKITZG.mjs";
|
|
186
|
-
import "../chunk-TOCC5J66.mjs";
|
|
187
188
|
import "../chunk-DT2WBACK.mjs";
|
|
188
189
|
import "../chunk-AZVEPDT6.mjs";
|
|
189
|
-
import "../chunk-S4AIBE4O.mjs";
|
|
190
|
-
import "../chunk-LOGWIK2T.mjs";
|
|
191
|
-
import "../chunk-Z7C7KX3U.mjs";
|
|
192
|
-
import "../chunk-QRMV5CAE.mjs";
|
|
193
190
|
import "../chunk-RZOILUDC.mjs";
|
|
194
191
|
import "../chunk-BJ6YI2DJ.mjs";
|
|
192
|
+
import "../chunk-6SZCPHCL.mjs";
|
|
195
193
|
import "../chunk-4POYX4AW.mjs";
|
|
196
194
|
import "../chunk-NJYJS6MU.mjs";
|
|
197
|
-
import "../chunk-6SZCPHCL.mjs";
|
|
198
195
|
import "../chunk-LFZAVCVW.mjs";
|
|
199
196
|
import "../chunk-INHFVKZY.mjs";
|
|
200
197
|
import "../chunk-24GJWXMG.mjs";
|
|
@@ -203,39 +200,43 @@ import "../chunk-MWRQORKQ.mjs";
|
|
|
203
200
|
import "../chunk-T23H5D4O.mjs";
|
|
204
201
|
import "../chunk-BHA3SMKH.mjs";
|
|
205
202
|
import "../chunk-GYZ4IXUD.mjs";
|
|
206
|
-
import "../chunk-
|
|
207
|
-
import "../chunk-
|
|
203
|
+
import "../chunk-DCSERRXG.mjs";
|
|
204
|
+
import "../chunk-OBYPZT2S.mjs";
|
|
208
205
|
import "../chunk-XQUKAHWK.mjs";
|
|
206
|
+
import "../chunk-6SJTUWEO.mjs";
|
|
209
207
|
import "../chunk-DDD2BA7K.mjs";
|
|
210
208
|
import "../chunk-DDNZWJII.mjs";
|
|
211
209
|
import "../chunk-ZZLJUAEK.mjs";
|
|
212
|
-
import "../chunk-
|
|
213
|
-
import "../chunk-7AZVQS2H.mjs";
|
|
210
|
+
import "../chunk-JXDHNASC.mjs";
|
|
214
211
|
import "../chunk-UAQDS6V2.mjs";
|
|
215
|
-
import "../chunk-
|
|
216
|
-
import "../chunk-
|
|
212
|
+
import "../chunk-MPGMU75K.mjs";
|
|
213
|
+
import "../chunk-HWGRW6YP.mjs";
|
|
217
214
|
import "../chunk-J72V5GVI.mjs";
|
|
218
215
|
import "../chunk-2AHSYECT.mjs";
|
|
219
216
|
import "../chunk-LWCO2YNI.mjs";
|
|
220
217
|
import "../chunk-TSIQCRWD.mjs";
|
|
221
|
-
import "../chunk-
|
|
218
|
+
import "../chunk-XL3MUGFG.mjs";
|
|
219
|
+
import "../chunk-2QCX6RPN.mjs";
|
|
222
220
|
import "../chunk-NJAPWQ4D.mjs";
|
|
223
221
|
import "../chunk-5Z5IS4XG.mjs";
|
|
224
222
|
import "../chunk-73SN5UQC.mjs";
|
|
225
223
|
import "../chunk-DUB3FBYX.mjs";
|
|
226
224
|
import "../chunk-EL6TOIFZ.mjs";
|
|
227
|
-
import "../chunk-UH6VXWMV.mjs";
|
|
228
|
-
import "../chunk-XL3MUGFG.mjs";
|
|
229
225
|
import "../chunk-4WWT6OC2.mjs";
|
|
230
|
-
import "../chunk-
|
|
231
|
-
import "../chunk-
|
|
232
|
-
import "../chunk-24ASGNQU.mjs";
|
|
226
|
+
import "../chunk-UH6VXWMV.mjs";
|
|
227
|
+
import "../chunk-UR6LPERL.mjs";
|
|
233
228
|
import "../chunk-EZ2UKNOZ.mjs";
|
|
234
229
|
import "../chunk-2NY5IEPV.mjs";
|
|
230
|
+
import "../chunk-M2GS2K6H.mjs";
|
|
231
|
+
import "../chunk-24ASGNQU.mjs";
|
|
235
232
|
import "../chunk-6D7J5WJS.mjs";
|
|
236
233
|
import "../chunk-EGCSHXCF.mjs";
|
|
237
234
|
import "../chunk-3CPVI6Y2.mjs";
|
|
238
235
|
import "../chunk-DFJFMZX6.mjs";
|
|
236
|
+
import "../chunk-S4AIBE4O.mjs";
|
|
237
|
+
import "../chunk-LOGWIK2T.mjs";
|
|
238
|
+
import "../chunk-Z7C7KX3U.mjs";
|
|
239
|
+
import "../chunk-QRMV5CAE.mjs";
|
|
239
240
|
import "../chunk-CVXJ45WI.mjs";
|
|
240
241
|
import "../chunk-XR5ZIHLY.mjs";
|
|
241
242
|
import "../chunk-UP2LAH6M.mjs";
|
|
@@ -253,13 +254,13 @@ import "../chunk-DPNXFDFK.mjs";
|
|
|
253
254
|
import "../chunk-WRZWEAMN.mjs";
|
|
254
255
|
import "../chunk-IKQPTA2J.mjs";
|
|
255
256
|
import "../chunk-GEXTQELG.mjs";
|
|
256
|
-
import "../chunk-
|
|
257
|
+
import "../chunk-M3ISDSQP.mjs";
|
|
257
258
|
import "../chunk-LDBMLTV2.mjs";
|
|
258
|
-
import "../chunk-OJYZLNSD.mjs";
|
|
259
259
|
import "../chunk-F23B3GJV.mjs";
|
|
260
260
|
import "../chunk-UNZ3D3B3.mjs";
|
|
261
261
|
import "../chunk-NMPWPD2P.mjs";
|
|
262
|
-
import "../chunk-
|
|
262
|
+
import "../chunk-OJYZLNSD.mjs";
|
|
263
|
+
import "../chunk-WPMJCKI2.mjs";
|
|
263
264
|
import "../chunk-HJK5A3DD.mjs";
|
|
264
265
|
import "../chunk-JA65ZG3H.mjs";
|
|
265
266
|
import "../chunk-LREFRIQQ.mjs";
|
|
@@ -267,10 +268,10 @@ import "../chunk-KHQZ35IL.mjs";
|
|
|
267
268
|
import "../chunk-QOKQVPZ6.mjs";
|
|
268
269
|
import "../chunk-HQLCDNMN.mjs";
|
|
269
270
|
import "../chunk-6XBAYBWZ.mjs";
|
|
271
|
+
import "../chunk-KDZWHGGN.mjs";
|
|
270
272
|
import "../chunk-I3T745ZX.mjs";
|
|
271
273
|
import "../chunk-Q7YUHFMS.mjs";
|
|
272
274
|
import "../chunk-2B6C5VWQ.mjs";
|
|
273
|
-
import "../chunk-KDZWHGGN.mjs";
|
|
274
275
|
import "../chunk-AFD4DOFH.mjs";
|
|
275
276
|
import "../chunk-DJPMIVQY.mjs";
|
|
276
277
|
import "../chunk-DAQHVMKF.mjs";
|
|
@@ -21559,6 +21559,25 @@ var minimaxOpenAiCompletionsAdapter = {
|
|
|
21559
21559
|
id: "minimax"
|
|
21560
21560
|
};
|
|
21561
21561
|
|
|
21562
|
+
// src/mobile/native-request-diagnostics.ts
|
|
21563
|
+
var RETRYABLE_NATIVE_FETCH_RE = new RegExp(
|
|
21564
|
+
[
|
|
21565
|
+
"fetch failed",
|
|
21566
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
21567
|
+
"UND_ERR_HEADERS_TIMEOUT",
|
|
21568
|
+
"UND_ERR_SOCKET",
|
|
21569
|
+
"ECONNRESET",
|
|
21570
|
+
"ETIMEDOUT",
|
|
21571
|
+
"ECONNREFUSED",
|
|
21572
|
+
"ENOTFOUND",
|
|
21573
|
+
"EAI_AGAIN",
|
|
21574
|
+
"socket hang up",
|
|
21575
|
+
"network connection lost",
|
|
21576
|
+
"network request failed"
|
|
21577
|
+
].join("|"),
|
|
21578
|
+
"i"
|
|
21579
|
+
);
|
|
21580
|
+
|
|
21562
21581
|
// src/mobile/native-openai-text-stream.ts
|
|
21563
21582
|
var isRecord5 = isGatewayConfigRecord;
|
|
21564
21583
|
function resolveOpenAiCompletionsBodyExtras(provider, baseUrl) {
|
|
@@ -24103,7 +24122,8 @@ var IMAGE_BLOCK_BUDGET_BYTES = 8 * 1024;
|
|
|
24103
24122
|
|
|
24104
24123
|
// src/mobile/model-context-window-budget.ts
|
|
24105
24124
|
var MIN_TRANSCRIPT_BUDGET_BYTES = 64 * 1024;
|
|
24106
|
-
var
|
|
24125
|
+
var DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES = 128 * 1024;
|
|
24126
|
+
var HARD_MAX_TRANSCRIPT_BUDGET_BYTES = 4 * 1024 * 1024;
|
|
24107
24127
|
|
|
24108
24128
|
// src/mobile/context-compact/context-budget-gate.ts
|
|
24109
24129
|
function resolveContextBudgetSignalSource() {
|