xkzoom 1.5.1 → 1.5.3
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 +125 -55
- package/dist/{chunk-VPRVZWF3.mjs → chunk-37LYF6K2.mjs} +1 -1
- package/dist/{chunk-OCQUSYRP.mjs → chunk-3EV63LAA.mjs} +12 -12
- package/dist/{chunk-W4MKSQGZ.mjs → chunk-3FF266OG.mjs} +1 -1
- package/dist/{chunk-J5HTLG3V.mjs → chunk-3LR4CLDE.mjs} +1 -1
- package/dist/{chunk-CDLS44GZ.mjs → chunk-3TTLV2GM.mjs} +1 -1
- package/dist/{chunk-JG3EPJ32.mjs → chunk-54GVKP6B.mjs} +6 -6
- package/dist/{chunk-M52HZV6R.mjs → chunk-5VR6UOGC.mjs} +1 -1
- package/dist/{chunk-GBG4AJON.mjs → chunk-6EI5MFLD.mjs} +4 -4
- package/dist/{chunk-A23OTVH2.mjs → chunk-6LKZYMIW.mjs} +30 -30
- package/dist/{chunk-TAQQSDJN.mjs → chunk-6SYECCCG.mjs} +6 -6
- package/dist/{chunk-24GJWXMG.mjs → chunk-7MOQ462O.mjs} +1 -1
- package/dist/{chunk-LFZAVCVW.mjs → chunk-AJNXWGX2.mjs} +1 -1
- package/dist/{chunk-5DMSAPS2.mjs → chunk-APQRVOZQ.mjs} +5 -5
- package/dist/{chunk-YAD4VG2K.mjs → chunk-BHT6B2TV.mjs} +36 -6
- package/dist/{chunk-BV76CMVR.mjs → chunk-BN273XTH.mjs} +1 -1
- package/dist/{chunk-IXYH42YO.mjs → chunk-C5VQPAOA.mjs} +1 -1
- package/dist/{chunk-PY7W2X6W.mjs → chunk-CQAQRU4P.mjs} +114 -107
- package/dist/{chunk-Q4XUEIOE.mjs → chunk-CVIZMDMZ.mjs} +1 -1
- package/dist/{chunk-SIIEMWE3.mjs → chunk-DB4XTPJF.mjs} +7 -7
- package/dist/{chunk-URF75O5Z.mjs → chunk-DBYEZK64.mjs} +1 -1
- package/dist/{chunk-GIAML5K5.mjs → chunk-DQ7J7RST.mjs} +1 -1
- package/dist/{chunk-BHMWYAVS.mjs → chunk-DXPZNBSQ.mjs} +3 -3
- package/dist/chunk-E5LABIPO.mjs +201 -0
- package/dist/{chunk-A5DUSLHF.mjs → chunk-ED4H2DM7.mjs} +1 -1
- package/dist/{chunk-KYTJH3R3.mjs → chunk-EE3NRJLQ.mjs} +1 -1
- package/dist/{chunk-T4LPE43H.mjs → chunk-ESYRDWFO.mjs} +11 -11
- package/dist/{chunk-CQUISJWG.mjs → chunk-EYK3W2NV.mjs} +1 -1
- package/dist/{chunk-Z7GTU7KF.mjs → chunk-FAJHYXNU.mjs} +5 -5
- package/dist/{chunk-XHO73X2N.mjs → chunk-FKCGJ3BF.mjs} +2 -2
- package/dist/{chunk-HJN232FK.mjs → chunk-FLVJABFP.mjs} +1 -1
- package/dist/{chunk-H5DIQHEQ.mjs → chunk-FZ7NLBVP.mjs} +45 -16
- package/dist/{chunk-HTU5W436.mjs → chunk-G5LQ2PQ6.mjs} +2 -2
- package/dist/{chunk-LTBQWMAJ.mjs → chunk-GSIZ5FR6.mjs} +2 -2
- package/dist/{chunk-UANVP2AV.mjs → chunk-H4BNL7XG.mjs} +1 -1
- package/dist/{chunk-Q6XX6X24.mjs → chunk-I4LMW3IM.mjs} +1 -1
- package/dist/{chunk-VIZQURO5.mjs → chunk-IGJFAE72.mjs} +9 -9
- package/dist/{chunk-7AZVQS2H.mjs → chunk-IVR74IXK.mjs} +7 -7
- package/dist/{chunk-YILSXMZI.mjs → chunk-KI7AMK7P.mjs} +3 -3
- package/dist/{chunk-EQNHKW6L.mjs → chunk-LJF6JSJB.mjs} +1 -1
- package/dist/{chunk-JD5NPIMO.mjs → chunk-LSQ47CLM.mjs} +27 -27
- package/dist/{chunk-IPIV4NGB.mjs → chunk-LXEKUNXI.mjs} +6 -6
- package/dist/{chunk-HR43WO4Q.mjs → chunk-M6VHS3HQ.mjs} +2 -2
- package/dist/{chunk-4DYFM3EC.mjs → chunk-MI6GFOCU.mjs} +4 -4
- package/dist/{chunk-CFZVBILR.mjs → chunk-MIXYB6BH.mjs} +1 -1
- package/dist/{chunk-K4RHLREV.mjs → chunk-MVKCMXBY.mjs} +1 -1
- package/dist/{chunk-JG3K4N5B.mjs → chunk-NIV5GVCE.mjs} +1 -1
- package/dist/{chunk-ZTKJR7OC.mjs → chunk-OWIXULFQ.mjs} +1 -1
- package/dist/{chunk-Y6SJUTY6.mjs → chunk-P262PAGZ.mjs} +15 -2
- package/dist/{chunk-5JGUBBXN.mjs → chunk-PBBRBETA.mjs} +4 -4
- package/dist/{chunk-EGWLJJY7.mjs → chunk-QSHIFD37.mjs} +2 -2
- package/dist/{chunk-WJIY3BIA.mjs → chunk-QSQ274C6.mjs} +44 -16
- package/dist/{chunk-H5TJYSTV.mjs → chunk-QSUD6TNR.mjs} +5 -5
- package/dist/{chunk-YPAQRMUI.mjs → chunk-QYXYVBTO.mjs} +2 -2
- package/dist/{chunk-OB4JJLDC.mjs → chunk-RVW5XO4A.mjs} +4 -4
- package/dist/{chunk-CNHOCDRM.mjs → chunk-RYSPXH7G.mjs} +2 -2
- package/dist/{chunk-CCCPWU2O.mjs → chunk-RZW4EEPW.mjs} +22 -22
- package/dist/{chunk-GGWUDW5W.mjs → chunk-S5ROBD7X.mjs} +2 -2
- package/dist/{chunk-QUXUHJZW.mjs → chunk-SQHTVHQ7.mjs} +7 -7
- package/dist/{chunk-ZM23SMRO.mjs → chunk-T5ZCLYLJ.mjs} +1 -1
- package/dist/{chunk-NYG3IUXK.mjs → chunk-TER7DFHP.mjs} +1 -1
- package/dist/{chunk-RTANSWHW.mjs → chunk-THN36GA5.mjs} +27 -27
- package/dist/{chunk-GUADF3KN.mjs → chunk-ULXTQSV6.mjs} +4 -0
- package/dist/{chunk-PG5CHH66.mjs → chunk-VHRFLCMY.mjs} +1 -1
- package/dist/{chunk-BSQF7NF4.mjs → chunk-W7OJPFTN.mjs} +2 -2
- package/dist/{chunk-S7FQBXOO.mjs → chunk-WGLYR2YT.mjs} +1 -1
- package/dist/{chunk-G5ZU7562.mjs → chunk-WNI5ZPQY.mjs} +7 -7
- package/dist/{chunk-7FLALKSN.mjs → chunk-WRRJFJ2N.mjs} +7 -7
- package/dist/{chunk-ILROJZBI.mjs → chunk-WV6OKJ4J.mjs} +37 -9
- package/dist/{chunk-ASIBETCT.mjs → chunk-X7P6B2LK.mjs} +10 -10
- package/dist/{chunk-MWRQORKQ.mjs → chunk-XF4EURDX.mjs} +1 -1
- package/dist/{chunk-ETD5LGJY.mjs → chunk-Z3COATFF.mjs} +1 -1
- package/dist/index.js +336 -31
- package/dist/index.mjs +169 -168
- package/dist/mobile/action-planner.js +21 -1
- package/dist/mobile/action-planner.mjs +95 -94
- package/dist/mobile/agent-capabilities.js +21 -1
- package/dist/mobile/agent-capabilities.mjs +96 -95
- package/dist/mobile/agent-shop/handlers.mjs +3 -3
- 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 +104 -103
- package/dist/mobile/anthropic-owned-tool-executor.js +21 -1
- package/dist/mobile/anthropic-owned-tool-executor.mjs +103 -102
- package/dist/mobile/api.mjs +49 -49
- package/dist/mobile/context-compact/compact-artifact-enrich.js +19 -0
- package/dist/mobile/context-compact/compact-artifact-enrich.mjs +16 -15
- package/dist/mobile/context-compact/compact-artifact-writer.mjs +4 -4
- package/dist/mobile/context-compact/compact-engine-artifacts.mjs +5 -5
- package/dist/mobile/context-compact/compact-memory-distill-job.mjs +3 -3
- package/dist/mobile/context-compact/compact-message-collector.mjs +2 -2
- package/dist/mobile/context-compact/compact-orchestrator.js +21 -1
- package/dist/mobile/context-compact/compact-orchestrator.mjs +34 -33
- package/dist/mobile/context-compact/compact-resume-prefetch.mjs +4 -4
- package/dist/mobile/context-compact/compact-summarizer-engine-artifact.js +19 -0
- package/dist/mobile/context-compact/compact-summarizer-engine-artifact.mjs +18 -17
- package/dist/mobile/context-compact/compact-summarizer-llm-request.js +19 -0
- package/dist/mobile/context-compact/compact-summarizer-llm-request.mjs +10 -9
- package/dist/mobile/context-compact/compact-summarizer-llm.js +19 -0
- package/dist/mobile/context-compact/compact-summarizer-llm.mjs +11 -10
- package/dist/mobile/context-compact/compact-summarizer.js +19 -0
- package/dist/mobile/context-compact/compact-summarizer.mjs +15 -14
- package/dist/mobile/context-compact/compact-write-verifier.mjs +2 -2
- 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 +99 -98
- package/dist/mobile/group/conductor-llm.js +19 -0
- package/dist/mobile/group/conductor-llm.mjs +13 -12
- package/dist/mobile/group/conductor-plan-llm.js +19 -0
- package/dist/mobile/group/conductor-plan-llm.mjs +19 -18
- package/dist/mobile/group/delivery-verification.mjs +4 -4
- package/dist/mobile/group/direct-chat-group-context.mjs +1 -1
- package/dist/mobile/group/execution-plan.mjs +5 -5
- package/dist/mobile/group/floor-scheduler.mjs +7 -7
- package/dist/mobile/group/floor-state-store.mjs +6 -6
- package/dist/mobile/group/group-api-handlers.mjs +38 -38
- package/dist/mobile/group/group-peer-private-context.mjs +1 -1
- package/dist/mobile/group/group-session.mjs +19 -19
- package/dist/mobile/group/index.mjs +32 -32
- package/dist/mobile/group/memory-supplement.mjs +10 -10
- package/dist/mobile/group/orchestrator.mjs +30 -30
- package/dist/mobile/group/pipeline-ceo-dept-mention-parse.mjs +3 -3
- package/dist/mobile/group/pipeline-handoff-verification.mjs +3 -3
- package/dist/mobile/group/pipeline-turn-outcome.mjs +2 -2
- package/dist/mobile/group/plan-runtime.mjs +18 -18
- package/dist/mobile/group/relation-distill.mjs +8 -8
- package/dist/mobile/group/runtime-integration.mjs +36 -36
- package/dist/mobile/index.js +336 -31
- package/dist/mobile/index.mjs +164 -163
- package/dist/mobile/interrupted-turn.js +5 -0
- package/dist/mobile/interrupted-turn.mjs +3 -1
- package/dist/mobile/memory-contract-r1-prefetch.mjs +11 -11
- package/dist/mobile/memory-contract-r5-empty-result.mjs +12 -12
- package/dist/mobile/memory-runtime-v2/eval-runner.mjs +4 -4
- package/dist/mobile/memory-runtime-v2/evidence-plan.mjs +5 -5
- package/dist/mobile/memory-runtime-v2/index.mjs +15 -15
- package/dist/mobile/memory-runtime-v2/memory-control-plane.mjs +5 -5
- package/dist/mobile/memory-runtime-v2/memory-readiness.mjs +5 -5
- package/dist/mobile/memory-runtime-v2/orchestrator.mjs +3 -3
- package/dist/mobile/memory-runtime-v2/public-api.mjs +6 -6
- 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 +11 -10
- 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 +10 -9
- package/dist/mobile/native-reply-system-prompt-layers.js +21 -1
- package/dist/mobile/native-reply-system-prompt-layers.mjs +96 -95
- 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 +104 -103
- package/dist/mobile/reply-dispatch-warmup.mjs +2 -2
- package/dist/mobile/runtime.js +336 -31
- package/dist/mobile/runtime.mjs +161 -160
- package/dist/mobile/stream-inbound/mobile-text-stream-pipeline.mjs +3 -3
- package/dist/mobile/tool-use-input-normalize.js +21 -1
- package/dist/mobile/tool-use-input-normalize.mjs +98 -97
- package/dist/mobile/tools/mobile-compact-tool-bridge.js +21 -1
- package/dist/mobile/tools/mobile-compact-tool-bridge.mjs +98 -97
- package/dist/org/dept-context.mjs +4 -4
- package/dist/org/index.mjs +14 -14
- package/dist/owned-tools/ceo-confirm-requirements.mjs +12 -12
- package/dist/owned-tools/ceo-decision.mjs +18 -18
- package/dist/owned-tools/ceo-ops-brief.mjs +12 -12
- package/dist/owned-tools/ceo-redirect.mjs +37 -37
- package/dist/owned-tools/commit-stack-lesson.mjs +13 -13
- package/dist/owned-tools/compact/execute.js +21 -1
- package/dist/owned-tools/compact/execute.mjs +96 -95
- package/dist/owned-tools/compact/gateway-tool-factory.js +21 -1
- package/dist/owned-tools/compact/gateway-tool-factory.mjs +97 -96
- package/dist/owned-tools/compact/registry.js +21 -1
- package/dist/owned-tools/compact/registry.mjs +95 -94
- package/dist/owned-tools/context-compact.js +21 -1
- package/dist/owned-tools/context-compact.mjs +42 -41
- package/dist/owned-tools/groups-history.mjs +1 -1
- package/dist/owned-tools/handoff.mjs +17 -17
- package/dist/owned-tools/memory-control.mjs +7 -7
- package/dist/owned-tools/memory-runtime-eval.mjs +6 -6
- package/dist/owned-tools/message.mjs +2 -2
- package/dist/owned-tools/models-list.mjs +2 -2
- package/dist/owned-tools/register-owned-providers.mjs +5 -5
- package/dist/owned-tools/registry.js +21 -1
- package/dist/owned-tools/registry.mjs +94 -93
- package/dist/owned-tools/router.js +21 -1
- package/dist/owned-tools/router.mjs +95 -94
- package/dist/owned-tools/runtime-bridge.js +21 -1
- package/dist/owned-tools/runtime-bridge.mjs +96 -95
- package/dist/owned-tools/session-status.mjs +1 -1
- package/dist/owned-tools/sessions-history-resolver.mjs +2 -2
- package/dist/owned-tools/sessions-history.mjs +1 -1
- package/dist/owned-tools/sessions-send.mjs +1 -1
- package/dist/owned-tools/subagents.mjs +1 -1
- package/dist/owned-tools/tool-contract-prompt.js +21 -1
- package/dist/owned-tools/tool-contract-prompt.mjs +95 -94
- package/dist/owned-tools/tool-result-envelope.js +21 -1
- package/dist/owned-tools/tool-result-envelope.mjs +97 -96
- package/dist/owned-tools/tool-usage-guide.js +21 -1
- package/dist/owned-tools/tool-usage-guide.mjs +94 -93
- package/dist/owned-tools/tts.mjs +4 -4
- package/dist/owned-tools/web-smoke.mjs +6 -6
- package/dist/project/file-tool-scope-default.mjs +6 -6
- package/dist/project-pipeline/handlers.mjs +37 -37
- package/dist/project-pipeline/index.mjs +40 -40
- package/dist/project-pipeline/pipeline-routing.mjs +2 -2
- package/dist/project-pipeline/post-close-skill-evolution.mjs +5 -5
- package/dist/project-pipeline/project-store.mjs +5 -5
- package/gateway-core/README.md +6 -0
- package/package.json +5 -2
- package/dist/{chunk-UNZ3D3B3.mjs → chunk-3OXBG4OP.mjs} +5 -5
- package/dist/{chunk-NRJWLPTI.mjs → chunk-6AY6OPO5.mjs} +3 -3
- package/dist/{chunk-JA65ZG3H.mjs → chunk-6ZWKLMY3.mjs} +4 -4
- package/dist/{chunk-T23H5D4O.mjs → chunk-AINHKBJW.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-QM7MTC5Q.mjs → chunk-H6LMX5G5.mjs} +3 -3
- package/dist/{chunk-2TBXT3PD.mjs → chunk-J74WVZGF.mjs} +6 -6
- package/dist/{chunk-WPLDZLAL.mjs → chunk-L7PMYQN5.mjs} +3 -3
- package/dist/{chunk-CORUFGMR.mjs → chunk-N3YQ5IL6.mjs} +7 -7
- package/dist/{chunk-5LUTMHVL.mjs → chunk-NXKHSX4M.mjs} +3 -3
- package/dist/{chunk-MGWYJD5Q.mjs → chunk-QCSNRVL2.mjs} +8 -8
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readLastMemoryRuntimeEvalReport,
|
|
3
3
|
runMemoryRuntimeV2SelfEval
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-IVR74IXK.mjs";
|
|
5
5
|
import "../../chunk-UAQDS6V2.mjs";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-VS2URZFN.mjs";
|
|
6
|
+
import "../../chunk-N3YQ5IL6.mjs";
|
|
8
7
|
import "../../chunk-J72V5GVI.mjs";
|
|
9
8
|
import "../../chunk-2AHSYECT.mjs";
|
|
9
|
+
import "../../chunk-VS2URZFN.mjs";
|
|
10
10
|
import "../../chunk-LWCO2YNI.mjs";
|
|
11
11
|
import "../../chunk-TSIQCRWD.mjs";
|
|
12
12
|
import "../../chunk-KCZIK3TH.mjs";
|
|
13
13
|
import "../../chunk-NJAPWQ4D.mjs";
|
|
14
14
|
import "../../chunk-5Z5IS4XG.mjs";
|
|
15
|
-
import "../../chunk-73SN5UQC.mjs";
|
|
16
15
|
import "../../chunk-DUB3FBYX.mjs";
|
|
17
16
|
import "../../chunk-EL6TOIFZ.mjs";
|
|
18
17
|
import "../../chunk-XL3MUGFG.mjs";
|
|
19
18
|
import "../../chunk-4WWT6OC2.mjs";
|
|
19
|
+
import "../../chunk-73SN5UQC.mjs";
|
|
20
20
|
import "../../chunk-Q7NYATKS.mjs";
|
|
21
21
|
import "../../chunk-M2GS2K6H.mjs";
|
|
22
22
|
import "../../chunk-24ASGNQU.mjs";
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildMemoryEvidencePlan
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-I4LMW3IM.mjs";
|
|
4
4
|
import "../../chunk-XQUKAHWK.mjs";
|
|
5
5
|
import "../../chunk-DDD2BA7K.mjs";
|
|
6
6
|
import "../../chunk-DDNZWJII.mjs";
|
|
7
7
|
import "../../chunk-ZZLJUAEK.mjs";
|
|
8
8
|
import "../../chunk-6SJTUWEO.mjs";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-IVR74IXK.mjs";
|
|
10
10
|
import "../../chunk-UAQDS6V2.mjs";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-VS2URZFN.mjs";
|
|
11
|
+
import "../../chunk-N3YQ5IL6.mjs";
|
|
13
12
|
import "../../chunk-J72V5GVI.mjs";
|
|
14
13
|
import "../../chunk-2AHSYECT.mjs";
|
|
14
|
+
import "../../chunk-VS2URZFN.mjs";
|
|
15
15
|
import "../../chunk-LWCO2YNI.mjs";
|
|
16
16
|
import "../../chunk-TSIQCRWD.mjs";
|
|
17
17
|
import "../../chunk-KCZIK3TH.mjs";
|
|
18
18
|
import "../../chunk-NJAPWQ4D.mjs";
|
|
19
19
|
import "../../chunk-5Z5IS4XG.mjs";
|
|
20
|
-
import "../../chunk-73SN5UQC.mjs";
|
|
21
20
|
import "../../chunk-DUB3FBYX.mjs";
|
|
22
21
|
import "../../chunk-EL6TOIFZ.mjs";
|
|
23
22
|
import "../../chunk-UH6VXWMV.mjs";
|
|
24
23
|
import "../../chunk-XL3MUGFG.mjs";
|
|
25
24
|
import "../../chunk-4WWT6OC2.mjs";
|
|
25
|
+
import "../../chunk-73SN5UQC.mjs";
|
|
26
26
|
import "../../chunk-Q7NYATKS.mjs";
|
|
27
27
|
import "../../chunk-M2GS2K6H.mjs";
|
|
28
28
|
import "../../chunk-24ASGNQU.mjs";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
provider_acceleration,
|
|
22
22
|
run_ledger,
|
|
23
23
|
skill_lifecycle
|
|
24
|
-
} from "../../chunk-
|
|
24
|
+
} from "../../chunk-FKCGJ3BF.mjs";
|
|
25
25
|
import {
|
|
26
26
|
MemoryMaintenanceScheduler,
|
|
27
27
|
drainMemoryMaintenanceQueue,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
handleMemoryProductControlPlaneRoute,
|
|
48
48
|
readLastMemoryReadinessGate,
|
|
49
49
|
readLastMemoryReadinessReport
|
|
50
|
-
} from "../../chunk-
|
|
50
|
+
} from "../../chunk-I4LMW3IM.mjs";
|
|
51
51
|
import {
|
|
52
52
|
REQUIRED_SOAK_SCENARIOS,
|
|
53
53
|
buildMemorySoakEvidenceSummary,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
import {
|
|
91
91
|
readLastMemoryRuntimeEvalReport,
|
|
92
92
|
runMemoryRuntimeV2SelfEval
|
|
93
|
-
} from "../../chunk-
|
|
93
|
+
} from "../../chunk-IVR74IXK.mjs";
|
|
94
94
|
import {
|
|
95
95
|
beginToolSideEffect,
|
|
96
96
|
completeToolSideEffect,
|
|
@@ -100,11 +100,7 @@ import {
|
|
|
100
100
|
} from "../../chunk-UAQDS6V2.mjs";
|
|
101
101
|
import {
|
|
102
102
|
buildContextPackForTurn
|
|
103
|
-
} from "../../chunk-
|
|
104
|
-
import {
|
|
105
|
-
formatRetrievedMemoryEvidenceBlock,
|
|
106
|
-
retrieveMemoryEvidence
|
|
107
|
-
} from "../../chunk-VS2URZFN.mjs";
|
|
103
|
+
} from "../../chunk-N3YQ5IL6.mjs";
|
|
108
104
|
import {
|
|
109
105
|
SKILL_REGISTRY_REPORT_SCHEMA_VERSION,
|
|
110
106
|
SKILL_REGISTRY_VIEW_SCHEMA_VERSION,
|
|
@@ -125,6 +121,10 @@ import {
|
|
|
125
121
|
recordSkillNegativeSample,
|
|
126
122
|
suggestSkillDeprecation
|
|
127
123
|
} from "../../chunk-2AHSYECT.mjs";
|
|
124
|
+
import {
|
|
125
|
+
formatRetrievedMemoryEvidenceBlock,
|
|
126
|
+
retrieveMemoryEvidence
|
|
127
|
+
} from "../../chunk-VS2URZFN.mjs";
|
|
128
128
|
import {
|
|
129
129
|
traceMemoryEvidence
|
|
130
130
|
} from "../../chunk-LWCO2YNI.mjs";
|
|
@@ -151,13 +151,6 @@ import {
|
|
|
151
151
|
recommendContextBudgetClass,
|
|
152
152
|
refreshContextPackCostReport
|
|
153
153
|
} from "../../chunk-5Z5IS4XG.mjs";
|
|
154
|
-
import {
|
|
155
|
-
buildContextPackTelemetryRecord,
|
|
156
|
-
readContextPackTelemetryHistory,
|
|
157
|
-
readLastContextPackTelemetry,
|
|
158
|
-
recordContextPackTelemetry,
|
|
159
|
-
safeRecordContextPackTelemetry
|
|
160
|
-
} from "../../chunk-73SN5UQC.mjs";
|
|
161
154
|
import {
|
|
162
155
|
applyContextPackBudget,
|
|
163
156
|
estimateContextPackChars
|
|
@@ -182,6 +175,13 @@ import {
|
|
|
182
175
|
readRunLedgerEvents,
|
|
183
176
|
updateRunLedger
|
|
184
177
|
} from "../../chunk-4WWT6OC2.mjs";
|
|
178
|
+
import {
|
|
179
|
+
buildContextPackTelemetryRecord,
|
|
180
|
+
readContextPackTelemetryHistory,
|
|
181
|
+
readLastContextPackTelemetry,
|
|
182
|
+
recordContextPackTelemetry,
|
|
183
|
+
safeRecordContextPackTelemetry
|
|
184
|
+
} from "../../chunk-73SN5UQC.mjs";
|
|
185
185
|
import "../../chunk-Q7NYATKS.mjs";
|
|
186
186
|
import {
|
|
187
187
|
runMemoryConsolidation
|
|
@@ -3,29 +3,29 @@ import {
|
|
|
3
3
|
buildMemoryProductControlPlaneManifest,
|
|
4
4
|
buildMemoryProductControlPlaneOverview,
|
|
5
5
|
handleMemoryProductControlPlaneRoute
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-I4LMW3IM.mjs";
|
|
7
7
|
import "../../chunk-XQUKAHWK.mjs";
|
|
8
8
|
import "../../chunk-DDD2BA7K.mjs";
|
|
9
9
|
import "../../chunk-DDNZWJII.mjs";
|
|
10
10
|
import "../../chunk-ZZLJUAEK.mjs";
|
|
11
11
|
import "../../chunk-6SJTUWEO.mjs";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-IVR74IXK.mjs";
|
|
13
13
|
import "../../chunk-UAQDS6V2.mjs";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-VS2URZFN.mjs";
|
|
14
|
+
import "../../chunk-N3YQ5IL6.mjs";
|
|
16
15
|
import "../../chunk-J72V5GVI.mjs";
|
|
17
16
|
import "../../chunk-2AHSYECT.mjs";
|
|
17
|
+
import "../../chunk-VS2URZFN.mjs";
|
|
18
18
|
import "../../chunk-LWCO2YNI.mjs";
|
|
19
19
|
import "../../chunk-TSIQCRWD.mjs";
|
|
20
20
|
import "../../chunk-KCZIK3TH.mjs";
|
|
21
21
|
import "../../chunk-NJAPWQ4D.mjs";
|
|
22
22
|
import "../../chunk-5Z5IS4XG.mjs";
|
|
23
|
-
import "../../chunk-73SN5UQC.mjs";
|
|
24
23
|
import "../../chunk-DUB3FBYX.mjs";
|
|
25
24
|
import "../../chunk-EL6TOIFZ.mjs";
|
|
26
25
|
import "../../chunk-UH6VXWMV.mjs";
|
|
27
26
|
import "../../chunk-XL3MUGFG.mjs";
|
|
28
27
|
import "../../chunk-4WWT6OC2.mjs";
|
|
28
|
+
import "../../chunk-73SN5UQC.mjs";
|
|
29
29
|
import "../../chunk-Q7NYATKS.mjs";
|
|
30
30
|
import "../../chunk-M2GS2K6H.mjs";
|
|
31
31
|
import "../../chunk-24ASGNQU.mjs";
|
|
@@ -4,29 +4,29 @@ import {
|
|
|
4
4
|
evaluateMemoryReadinessGate,
|
|
5
5
|
readLastMemoryReadinessGate,
|
|
6
6
|
readLastMemoryReadinessReport
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-I4LMW3IM.mjs";
|
|
8
8
|
import "../../chunk-XQUKAHWK.mjs";
|
|
9
9
|
import "../../chunk-DDD2BA7K.mjs";
|
|
10
10
|
import "../../chunk-DDNZWJII.mjs";
|
|
11
11
|
import "../../chunk-ZZLJUAEK.mjs";
|
|
12
12
|
import "../../chunk-6SJTUWEO.mjs";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-IVR74IXK.mjs";
|
|
14
14
|
import "../../chunk-UAQDS6V2.mjs";
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-VS2URZFN.mjs";
|
|
15
|
+
import "../../chunk-N3YQ5IL6.mjs";
|
|
17
16
|
import "../../chunk-J72V5GVI.mjs";
|
|
18
17
|
import "../../chunk-2AHSYECT.mjs";
|
|
18
|
+
import "../../chunk-VS2URZFN.mjs";
|
|
19
19
|
import "../../chunk-LWCO2YNI.mjs";
|
|
20
20
|
import "../../chunk-TSIQCRWD.mjs";
|
|
21
21
|
import "../../chunk-KCZIK3TH.mjs";
|
|
22
22
|
import "../../chunk-NJAPWQ4D.mjs";
|
|
23
23
|
import "../../chunk-5Z5IS4XG.mjs";
|
|
24
|
-
import "../../chunk-73SN5UQC.mjs";
|
|
25
24
|
import "../../chunk-DUB3FBYX.mjs";
|
|
26
25
|
import "../../chunk-EL6TOIFZ.mjs";
|
|
27
26
|
import "../../chunk-UH6VXWMV.mjs";
|
|
28
27
|
import "../../chunk-XL3MUGFG.mjs";
|
|
29
28
|
import "../../chunk-4WWT6OC2.mjs";
|
|
29
|
+
import "../../chunk-73SN5UQC.mjs";
|
|
30
30
|
import "../../chunk-Q7NYATKS.mjs";
|
|
31
31
|
import "../../chunk-M2GS2K6H.mjs";
|
|
32
32
|
import "../../chunk-24ASGNQU.mjs";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildContextPackForTurn
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-VS2URZFN.mjs";
|
|
3
|
+
} from "../../chunk-N3YQ5IL6.mjs";
|
|
5
4
|
import "../../chunk-J72V5GVI.mjs";
|
|
6
5
|
import "../../chunk-2AHSYECT.mjs";
|
|
6
|
+
import "../../chunk-VS2URZFN.mjs";
|
|
7
7
|
import "../../chunk-TSIQCRWD.mjs";
|
|
8
8
|
import "../../chunk-5Z5IS4XG.mjs";
|
|
9
|
-
import "../../chunk-73SN5UQC.mjs";
|
|
10
9
|
import "../../chunk-DUB3FBYX.mjs";
|
|
11
10
|
import "../../chunk-XL3MUGFG.mjs";
|
|
12
11
|
import "../../chunk-4WWT6OC2.mjs";
|
|
12
|
+
import "../../chunk-73SN5UQC.mjs";
|
|
13
13
|
import "../../chunk-24ASGNQU.mjs";
|
|
14
14
|
import "../../chunk-EZ2UKNOZ.mjs";
|
|
15
15
|
import "../../chunk-2NY5IEPV.mjs";
|
|
@@ -17,27 +17,26 @@ import {
|
|
|
17
17
|
provider_acceleration,
|
|
18
18
|
run_ledger,
|
|
19
19
|
skill_lifecycle
|
|
20
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-FKCGJ3BF.mjs";
|
|
21
21
|
import "../../chunk-IHH6JKPK.mjs";
|
|
22
22
|
import "../../chunk-UJHGVFHZ.mjs";
|
|
23
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-I4LMW3IM.mjs";
|
|
24
24
|
import "../../chunk-XQUKAHWK.mjs";
|
|
25
25
|
import "../../chunk-DDD2BA7K.mjs";
|
|
26
26
|
import "../../chunk-DDNZWJII.mjs";
|
|
27
27
|
import "../../chunk-ZZLJUAEK.mjs";
|
|
28
28
|
import "../../chunk-6SJTUWEO.mjs";
|
|
29
|
-
import "../../chunk-
|
|
29
|
+
import "../../chunk-IVR74IXK.mjs";
|
|
30
30
|
import "../../chunk-UAQDS6V2.mjs";
|
|
31
|
-
import "../../chunk-
|
|
32
|
-
import "../../chunk-VS2URZFN.mjs";
|
|
31
|
+
import "../../chunk-N3YQ5IL6.mjs";
|
|
33
32
|
import "../../chunk-J72V5GVI.mjs";
|
|
34
33
|
import "../../chunk-2AHSYECT.mjs";
|
|
34
|
+
import "../../chunk-VS2URZFN.mjs";
|
|
35
35
|
import "../../chunk-LWCO2YNI.mjs";
|
|
36
36
|
import "../../chunk-TSIQCRWD.mjs";
|
|
37
37
|
import "../../chunk-KCZIK3TH.mjs";
|
|
38
38
|
import "../../chunk-NJAPWQ4D.mjs";
|
|
39
39
|
import "../../chunk-5Z5IS4XG.mjs";
|
|
40
|
-
import "../../chunk-73SN5UQC.mjs";
|
|
41
40
|
import "../../chunk-DUB3FBYX.mjs";
|
|
42
41
|
import "../../chunk-EL6TOIFZ.mjs";
|
|
43
42
|
import {
|
|
@@ -45,6 +44,7 @@ import {
|
|
|
45
44
|
} from "../../chunk-UH6VXWMV.mjs";
|
|
46
45
|
import "../../chunk-XL3MUGFG.mjs";
|
|
47
46
|
import "../../chunk-4WWT6OC2.mjs";
|
|
47
|
+
import "../../chunk-73SN5UQC.mjs";
|
|
48
48
|
import "../../chunk-Q7NYATKS.mjs";
|
|
49
49
|
import "../../chunk-M2GS2K6H.mjs";
|
|
50
50
|
import "../../chunk-24ASGNQU.mjs";
|
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/mobile/model-context-window-budget.ts
|
|
21
21
|
var model_context_window_budget_exports = {};
|
|
22
22
|
__export(model_context_window_budget_exports, {
|
|
23
|
+
DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES: () => DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES,
|
|
23
24
|
buildNativeTranscriptBudgetForContextWindow: () => buildNativeTranscriptBudgetForContextWindow,
|
|
24
25
|
resolveTranscriptBudgetBytesForContextWindow: () => resolveTranscriptBudgetBytesForContextWindow
|
|
25
26
|
});
|
|
@@ -27,13 +28,25 @@ module.exports = __toCommonJS(model_context_window_budget_exports);
|
|
|
27
28
|
var TRANSCRIPT_BUDGET_BYTES_PER_TOKEN = 4;
|
|
28
29
|
var TRANSCRIPT_CONTEXT_WINDOW_RATIO = 0.35;
|
|
29
30
|
var MIN_TRANSCRIPT_BUDGET_BYTES = 64 * 1024;
|
|
30
|
-
var
|
|
31
|
+
var DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES = 128 * 1024;
|
|
32
|
+
var HARD_MAX_TRANSCRIPT_BUDGET_BYTES = 4 * 1024 * 1024;
|
|
31
33
|
function positiveInteger(value) {
|
|
32
34
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
|
|
33
35
|
return void 0;
|
|
34
36
|
}
|
|
35
37
|
return Math.trunc(value);
|
|
36
38
|
}
|
|
39
|
+
function readMaxTranscriptBudgetBytes(env = process.env) {
|
|
40
|
+
const raw = env.XKZOOM_NATIVE_TRANSCRIPT_MAX_REQUEST_BYTES?.trim();
|
|
41
|
+
if (!raw) {
|
|
42
|
+
return DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES;
|
|
43
|
+
}
|
|
44
|
+
const parsed = Number.parseInt(raw, 10);
|
|
45
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
46
|
+
return DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES;
|
|
47
|
+
}
|
|
48
|
+
return Math.min(HARD_MAX_TRANSCRIPT_BUDGET_BYTES, Math.max(MIN_TRANSCRIPT_BUDGET_BYTES, parsed));
|
|
49
|
+
}
|
|
37
50
|
function resolveTranscriptBudgetBytesForContextWindow(contextWindowTokens) {
|
|
38
51
|
const tokens = positiveInteger(contextWindowTokens);
|
|
39
52
|
if (tokens === void 0) {
|
|
@@ -43,7 +56,7 @@ function resolveTranscriptBudgetBytesForContextWindow(contextWindowTokens) {
|
|
|
43
56
|
tokens * TRANSCRIPT_CONTEXT_WINDOW_RATIO * TRANSCRIPT_BUDGET_BYTES_PER_TOKEN
|
|
44
57
|
);
|
|
45
58
|
return Math.min(
|
|
46
|
-
|
|
59
|
+
readMaxTranscriptBudgetBytes(),
|
|
47
60
|
Math.max(MIN_TRANSCRIPT_BUDGET_BYTES, estimated)
|
|
48
61
|
);
|
|
49
62
|
}
|
|
@@ -53,6 +66,7 @@ function buildNativeTranscriptBudgetForContextWindow(contextWindowTokens) {
|
|
|
53
66
|
}
|
|
54
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
68
|
0 && (module.exports = {
|
|
69
|
+
DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES,
|
|
56
70
|
buildNativeTranscriptBudgetForContextWindow,
|
|
57
71
|
resolveTranscriptBudgetBytesForContextWindow
|
|
58
72
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES,
|
|
2
3
|
buildNativeTranscriptBudgetForContextWindow,
|
|
3
4
|
resolveTranscriptBudgetBytesForContextWindow
|
|
4
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-P262PAGZ.mjs";
|
|
5
6
|
import "../chunk-HEBXNMVQ.mjs";
|
|
6
7
|
export {
|
|
8
|
+
DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES,
|
|
7
9
|
buildNativeTranscriptBudgetForContextWindow,
|
|
8
10
|
resolveTranscriptBudgetBytesForContextWindow
|
|
9
11
|
};
|
|
@@ -1287,6 +1287,199 @@ var minimaxOpenAiCompletionsAdapter = {
|
|
|
1287
1287
|
id: "minimax"
|
|
1288
1288
|
};
|
|
1289
1289
|
|
|
1290
|
+
// src/mobile/native-request-diagnostics.ts
|
|
1291
|
+
function compactLogValue(value, maxLen = 180) {
|
|
1292
|
+
const text = String(value ?? "").replace(/\s+/g, " ").trim();
|
|
1293
|
+
if (!text) {
|
|
1294
|
+
return "";
|
|
1295
|
+
}
|
|
1296
|
+
return text.length > maxLen ? `${text.slice(0, maxLen)}...` : text;
|
|
1297
|
+
}
|
|
1298
|
+
function readErrorProp(value, key) {
|
|
1299
|
+
return value && typeof value === "object" ? value[key] : void 0;
|
|
1300
|
+
}
|
|
1301
|
+
function positiveInteger(value) {
|
|
1302
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
|
|
1303
|
+
return void 0;
|
|
1304
|
+
}
|
|
1305
|
+
return Math.trunc(value);
|
|
1306
|
+
}
|
|
1307
|
+
function formatNativeFetchErrorForLog(error) {
|
|
1308
|
+
const parts = [];
|
|
1309
|
+
let current = error;
|
|
1310
|
+
for (let depth = 0; depth < 4 && current !== null && current !== void 0; depth += 1) {
|
|
1311
|
+
const prefix = depth === 0 ? "error" : `cause${depth}`;
|
|
1312
|
+
const name = compactLogValue(readErrorProp(current, "name"));
|
|
1313
|
+
const message = current instanceof Error ? compactLogValue(current.message) : compactLogValue(readErrorProp(current, "message") ?? current);
|
|
1314
|
+
const code = compactLogValue(readErrorProp(current, "code"));
|
|
1315
|
+
const errno = compactLogValue(readErrorProp(current, "errno"));
|
|
1316
|
+
if (name) parts.push(`${prefix}Name=${name}`);
|
|
1317
|
+
if (message) parts.push(`${prefix}Message=${message}`);
|
|
1318
|
+
if (code) parts.push(`${prefix}Code=${code}`);
|
|
1319
|
+
if (errno) parts.push(`${prefix}Errno=${errno}`);
|
|
1320
|
+
current = readErrorProp(current, "cause");
|
|
1321
|
+
}
|
|
1322
|
+
return parts.join(" ") || "error=unknown";
|
|
1323
|
+
}
|
|
1324
|
+
function applyConfiguredMaxTokens(requestBody, maxTokens) {
|
|
1325
|
+
const configured = positiveInteger(maxTokens);
|
|
1326
|
+
if (configured === void 0) {
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1329
|
+
const existing = positiveInteger(requestBody.max_tokens);
|
|
1330
|
+
requestBody.max_tokens = existing === void 0 ? configured : Math.min(existing, configured);
|
|
1331
|
+
}
|
|
1332
|
+
function stringifyJsonRequestBody(requestBody) {
|
|
1333
|
+
const bodyText = JSON.stringify(requestBody);
|
|
1334
|
+
return {
|
|
1335
|
+
bodyText,
|
|
1336
|
+
bodyBytes: Buffer.byteLength(bodyText, "utf8")
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
function formatRequestShape(input) {
|
|
1340
|
+
const messageCount = Array.isArray(input.messages) ? input.messages.length : 0;
|
|
1341
|
+
const toolCount = Array.isArray(input.tools) ? input.tools.length : 0;
|
|
1342
|
+
const maxTokens = positiveInteger(input.maxTokens);
|
|
1343
|
+
return `bodyBytes=${input.bodyBytes} messages=${messageCount} tools=${toolCount} max_tokens=${maxTokens ?? "n/a"}`;
|
|
1344
|
+
}
|
|
1345
|
+
var DEFAULT_PROVIDER_FETCH_MAX_ATTEMPTS = 2;
|
|
1346
|
+
var HARD_PROVIDER_FETCH_MAX_ATTEMPTS = 4;
|
|
1347
|
+
var DEFAULT_PROVIDER_FETCH_RETRY_BASE_MS = 350;
|
|
1348
|
+
var HARD_PROVIDER_FETCH_RETRY_BASE_MS = 5e3;
|
|
1349
|
+
var RETRYABLE_NATIVE_FETCH_RE = new RegExp(
|
|
1350
|
+
[
|
|
1351
|
+
"fetch failed",
|
|
1352
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
1353
|
+
"UND_ERR_HEADERS_TIMEOUT",
|
|
1354
|
+
"UND_ERR_SOCKET",
|
|
1355
|
+
"ECONNRESET",
|
|
1356
|
+
"ETIMEDOUT",
|
|
1357
|
+
"ECONNREFUSED",
|
|
1358
|
+
"ENOTFOUND",
|
|
1359
|
+
"EAI_AGAIN",
|
|
1360
|
+
"socket hang up",
|
|
1361
|
+
"network connection lost",
|
|
1362
|
+
"network request failed"
|
|
1363
|
+
].join("|"),
|
|
1364
|
+
"i"
|
|
1365
|
+
);
|
|
1366
|
+
function readClampedPositiveEnvInt(env, key, fallback, max) {
|
|
1367
|
+
const raw = (env[key] ?? "").trim();
|
|
1368
|
+
const n = Number.parseInt(raw, 10);
|
|
1369
|
+
if (!Number.isFinite(n) || n <= 0) {
|
|
1370
|
+
return fallback;
|
|
1371
|
+
}
|
|
1372
|
+
return Math.min(Math.trunc(n), max);
|
|
1373
|
+
}
|
|
1374
|
+
function readClampedNonNegativeEnvInt(env, key, fallback, max) {
|
|
1375
|
+
const raw = (env[key] ?? "").trim();
|
|
1376
|
+
const n = Number.parseInt(raw, 10);
|
|
1377
|
+
if (!Number.isFinite(n) || n < 0) {
|
|
1378
|
+
return fallback;
|
|
1379
|
+
}
|
|
1380
|
+
return Math.min(Math.trunc(n), max);
|
|
1381
|
+
}
|
|
1382
|
+
function readProviderFetchMaxAttempts(env) {
|
|
1383
|
+
return readClampedPositiveEnvInt(
|
|
1384
|
+
env,
|
|
1385
|
+
"XKZOOM_NATIVE_PROVIDER_FETCH_MAX_ATTEMPTS",
|
|
1386
|
+
DEFAULT_PROVIDER_FETCH_MAX_ATTEMPTS,
|
|
1387
|
+
HARD_PROVIDER_FETCH_MAX_ATTEMPTS
|
|
1388
|
+
);
|
|
1389
|
+
}
|
|
1390
|
+
function readProviderFetchRetryBaseMs(env) {
|
|
1391
|
+
return readClampedNonNegativeEnvInt(
|
|
1392
|
+
env,
|
|
1393
|
+
"XKZOOM_NATIVE_PROVIDER_FETCH_RETRY_BASE_MS",
|
|
1394
|
+
DEFAULT_PROVIDER_FETCH_RETRY_BASE_MS,
|
|
1395
|
+
HARD_PROVIDER_FETCH_RETRY_BASE_MS
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
function isAbortLikeFetchError(error) {
|
|
1399
|
+
const name = compactLogValue(readErrorProp(error, "name"));
|
|
1400
|
+
return name === "AbortError";
|
|
1401
|
+
}
|
|
1402
|
+
function collectFetchErrorText(error) {
|
|
1403
|
+
const parts = [];
|
|
1404
|
+
let current = error;
|
|
1405
|
+
for (let depth = 0; depth < 4 && current !== null && current !== void 0; depth += 1) {
|
|
1406
|
+
parts.push(
|
|
1407
|
+
compactLogValue(readErrorProp(current, "name")),
|
|
1408
|
+
current instanceof Error ? compactLogValue(current.message) : compactLogValue(readErrorProp(current, "message") ?? current),
|
|
1409
|
+
compactLogValue(readErrorProp(current, "code")),
|
|
1410
|
+
compactLogValue(readErrorProp(current, "errno"))
|
|
1411
|
+
);
|
|
1412
|
+
current = readErrorProp(current, "cause");
|
|
1413
|
+
}
|
|
1414
|
+
return parts.filter(Boolean).join(" ");
|
|
1415
|
+
}
|
|
1416
|
+
function isRetryableNativeProviderFetchError(error) {
|
|
1417
|
+
return !isAbortLikeFetchError(error) && RETRYABLE_NATIVE_FETCH_RE.test(collectFetchErrorText(error));
|
|
1418
|
+
}
|
|
1419
|
+
function formatProviderRetryContext(context) {
|
|
1420
|
+
const parts = [
|
|
1421
|
+
`provider=${context.providerId}`,
|
|
1422
|
+
`model=${context.model}`,
|
|
1423
|
+
context.adapter ? `adapter=${context.adapter}` : "",
|
|
1424
|
+
typeof context.iteration === "number" ? `iteration=${context.iteration}` : ""
|
|
1425
|
+
];
|
|
1426
|
+
return parts.filter(Boolean).join(" ");
|
|
1427
|
+
}
|
|
1428
|
+
function asAbortSignal(signal) {
|
|
1429
|
+
if (signal && typeof signal === "object" && "aborted" in signal) {
|
|
1430
|
+
return signal;
|
|
1431
|
+
}
|
|
1432
|
+
return void 0;
|
|
1433
|
+
}
|
|
1434
|
+
async function waitForProviderFetchRetryDelay(delayMs, signal) {
|
|
1435
|
+
if (delayMs <= 0) {
|
|
1436
|
+
return;
|
|
1437
|
+
}
|
|
1438
|
+
if (signal?.aborted) {
|
|
1439
|
+
throw new DOMException("Aborted", "AbortError");
|
|
1440
|
+
}
|
|
1441
|
+
await new Promise((resolve, reject) => {
|
|
1442
|
+
const timer = setTimeout(() => {
|
|
1443
|
+
signal?.removeEventListener("abort", onAbort);
|
|
1444
|
+
resolve();
|
|
1445
|
+
}, delayMs);
|
|
1446
|
+
const onAbort = () => {
|
|
1447
|
+
clearTimeout(timer);
|
|
1448
|
+
reject(new DOMException("Aborted", "AbortError"));
|
|
1449
|
+
};
|
|
1450
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
async function fetchNativeProviderWithRetry(url, init, context, env = process.env) {
|
|
1454
|
+
const maxAttempts = readProviderFetchMaxAttempts(env);
|
|
1455
|
+
const retryBaseMs = readProviderFetchRetryBaseMs(env);
|
|
1456
|
+
const signal = asAbortSignal(init.signal);
|
|
1457
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
1458
|
+
try {
|
|
1459
|
+
return await fetch(url, init);
|
|
1460
|
+
} catch (error) {
|
|
1461
|
+
const retry = attempt < maxAttempts && !signal?.aborted && isRetryableNativeProviderFetchError(error);
|
|
1462
|
+
context.log(
|
|
1463
|
+
`[XKZOOM][native-reply][${context.label}] fetch_failed ${url} ${formatProviderRetryContext(context)} attempt=${attempt}/${maxAttempts} retry=${retry ? 1 : 0} ${formatRequestShape({
|
|
1464
|
+
bodyBytes: context.bodyBytes,
|
|
1465
|
+
messages: context.messages,
|
|
1466
|
+
tools: context.tools,
|
|
1467
|
+
maxTokens: context.maxTokens
|
|
1468
|
+
})} ${formatNativeFetchErrorForLog(error)}`
|
|
1469
|
+
);
|
|
1470
|
+
if (!retry) {
|
|
1471
|
+
throw error;
|
|
1472
|
+
}
|
|
1473
|
+
const delayMs = retryBaseMs * attempt;
|
|
1474
|
+
context.log(
|
|
1475
|
+
`[XKZOOM][native-reply][${context.label}] fetch_retry ${url} ${formatProviderRetryContext(context)} nextAttempt=${attempt + 1}/${maxAttempts} delayMs=${delayMs}`
|
|
1476
|
+
);
|
|
1477
|
+
await waitForProviderFetchRetryDelay(delayMs, signal);
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
throw new Error(`native provider fetch retry exhausted: ${url}`);
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1290
1483
|
// src/mobile/native-openai-text-stream.ts
|
|
1291
1484
|
function mergeOpenAiCompatibleStreamChunk(fullSoFar, incoming) {
|
|
1292
1485
|
if (incoming.length === 0) {
|
|
@@ -2216,7 +2409,8 @@ async function runNativeAnthropicMessagesStreamToDispatcher(params) {
|
|
|
2216
2409
|
if (params.providerAccelerationPlan || providerAcceleration.application.applied || providerAcceleration.application.warnings.length > 0) {
|
|
2217
2410
|
params.log(formatProviderAccelerationApplication(providerAcceleration.application));
|
|
2218
2411
|
}
|
|
2219
|
-
const
|
|
2412
|
+
const adapter = selectAnthropicAdapterByBaseUrl(cfg.baseUrl);
|
|
2413
|
+
const thinkingForBody = adapter.resolveThinkingForBody({
|
|
2220
2414
|
reasoningMode: params.reasoningMode,
|
|
2221
2415
|
model: cfg.model,
|
|
2222
2416
|
configuredThinking: requestBody.thinking
|
|
@@ -2224,12 +2418,34 @@ async function runNativeAnthropicMessagesStreamToDispatcher(params) {
|
|
|
2224
2418
|
if (thinkingForBody !== void 0) {
|
|
2225
2419
|
requestBody.thinking = thinkingForBody;
|
|
2226
2420
|
}
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2421
|
+
applyConfiguredMaxTokens(requestBody, cfg.maxTokens);
|
|
2422
|
+
const { bodyText, bodyBytes } = stringifyJsonRequestBody(requestBody);
|
|
2423
|
+
params.log(
|
|
2424
|
+
`[XKZOOM][native-reply][anthropic-messages] request_shape ${formatRequestShape({
|
|
2425
|
+
bodyBytes,
|
|
2426
|
+
messages: transcriptMessages,
|
|
2427
|
+
maxTokens: requestBody.max_tokens
|
|
2428
|
+
})}`
|
|
2429
|
+
);
|
|
2430
|
+
const res = await fetchNativeProviderWithRetry(
|
|
2431
|
+
url,
|
|
2432
|
+
{
|
|
2433
|
+
method: "POST",
|
|
2434
|
+
headers: buildNativeAnthropicRequestHeaders(cfg),
|
|
2435
|
+
body: bodyText,
|
|
2436
|
+
signal: params.signal
|
|
2437
|
+
},
|
|
2438
|
+
{
|
|
2439
|
+
label: "anthropic-messages",
|
|
2440
|
+
providerId: cfg.providerId,
|
|
2441
|
+
model: cfg.model,
|
|
2442
|
+
adapter: adapter.id,
|
|
2443
|
+
bodyBytes,
|
|
2444
|
+
messages: transcriptMessages,
|
|
2445
|
+
maxTokens: requestBody.max_tokens,
|
|
2446
|
+
log: params.log
|
|
2447
|
+
}
|
|
2448
|
+
);
|
|
2233
2449
|
if (!res.ok) {
|
|
2234
2450
|
const t = await res.text();
|
|
2235
2451
|
throw new Error(`native anthropic-messages HTTP ${res.status}: ${t.slice(0, 500)}`);
|
|
@@ -5,27 +5,28 @@ import {
|
|
|
5
5
|
resolveNativeAnthropicMessagesConfigFromGatewayConfig,
|
|
6
6
|
resolveNativeAnthropicMessagesUrl,
|
|
7
7
|
runNativeAnthropicMessagesStreamToDispatcher
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-FZ7NLBVP.mjs";
|
|
9
|
+
import "../chunk-UQLGVSQH.mjs";
|
|
10
|
+
import "../chunk-E7BFLHLM.mjs";
|
|
11
|
+
import "../chunk-SPO74LMZ.mjs";
|
|
12
|
+
import "../chunk-3TTLV2GM.mjs";
|
|
13
|
+
import "../chunk-BHT6B2TV.mjs";
|
|
14
|
+
import "../chunk-E5LABIPO.mjs";
|
|
11
15
|
import "../chunk-C36JYBG7.mjs";
|
|
12
16
|
import "../chunk-PJDUIH5J.mjs";
|
|
13
17
|
import "../chunk-NEDXMES6.mjs";
|
|
14
18
|
import {
|
|
15
19
|
buildNativeReplySystemPrompt
|
|
16
20
|
} from "../chunk-LR5GC3NZ.mjs";
|
|
17
|
-
import "../chunk-UQLGVSQH.mjs";
|
|
18
|
-
import "../chunk-E7BFLHLM.mjs";
|
|
19
|
-
import "../chunk-5AM5MS43.mjs";
|
|
20
|
-
import "../chunk-SPO74LMZ.mjs";
|
|
21
|
-
import {
|
|
22
|
-
parseAnthropicSseDataLine
|
|
23
|
-
} from "../chunk-LJ5OPMYI.mjs";
|
|
24
21
|
import "../chunk-JHQIGDVB.mjs";
|
|
25
22
|
import "../chunk-DSSVZ47P.mjs";
|
|
26
23
|
import "../chunk-SBBPQQYS.mjs";
|
|
27
24
|
import "../chunk-6GQKKEQA.mjs";
|
|
28
25
|
import "../chunk-QWSPMYE5.mjs";
|
|
26
|
+
import {
|
|
27
|
+
parseAnthropicSseDataLine
|
|
28
|
+
} from "../chunk-LJ5OPMYI.mjs";
|
|
29
|
+
import "../chunk-5AM5MS43.mjs";
|
|
29
30
|
import "../chunk-KIY5JPAA.mjs";
|
|
30
31
|
import "../chunk-4V5RUOBT.mjs";
|
|
31
32
|
import "../chunk-67ZUQKRE.mjs";
|