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
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-6SZCPHCL.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getGroupFloorState
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AJNXWGX2.mjs";
|
|
8
8
|
import {
|
|
9
9
|
defineTool
|
|
10
10
|
} from "./chunk-DFJFMZX6.mjs";
|
|
@@ -27,18 +27,25 @@ import {
|
|
|
27
27
|
registerDynamicDeptHandoff,
|
|
28
28
|
resolveOrgProjectRootByTeamId,
|
|
29
29
|
submitAuditVerdict
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-3OXBG4OP.mjs";
|
|
31
31
|
import {
|
|
32
32
|
isOrgPipelineCharter,
|
|
33
33
|
resolvePeerDynamicDeptSlug,
|
|
34
34
|
resolvePeerIsCeoAgent,
|
|
35
35
|
resolvePeerPipelineRole,
|
|
36
36
|
resolvePipelineDeptLeadBySlug
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-6SYECCCG.mjs";
|
|
38
38
|
import {
|
|
39
39
|
deptLabelFromCharter,
|
|
40
40
|
workspaceSubdirForDept
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-6ZWKLMY3.mjs";
|
|
42
|
+
import {
|
|
43
|
+
loadPipelineCharter
|
|
44
|
+
} from "./chunk-KHQZ35IL.mjs";
|
|
45
|
+
import {
|
|
46
|
+
catalogSupportsVerdict,
|
|
47
|
+
resolveCatalogContract
|
|
48
|
+
} from "./chunk-HQLCDNMN.mjs";
|
|
42
49
|
import {
|
|
43
50
|
ORG_PIPELINE_ARTIFACT_KIND,
|
|
44
51
|
ORG_PIPELINE_DEPT_LABELS,
|
|
@@ -47,13 +54,6 @@ import {
|
|
|
47
54
|
activeDepartmentForPhase,
|
|
48
55
|
isPipelineDepartmentId
|
|
49
56
|
} from "./chunk-LREFRIQQ.mjs";
|
|
50
|
-
import {
|
|
51
|
-
loadPipelineCharter
|
|
52
|
-
} from "./chunk-KHQZ35IL.mjs";
|
|
53
|
-
import {
|
|
54
|
-
catalogSupportsVerdict,
|
|
55
|
-
resolveCatalogContract
|
|
56
|
-
} from "./chunk-HQLCDNMN.mjs";
|
|
57
57
|
import {
|
|
58
58
|
loadTeamCharter
|
|
59
59
|
} from "./chunk-KDZWHGGN.mjs";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TOOLBOX_UI_META,
|
|
3
|
+
fallbackToolboxUiMeta
|
|
4
|
+
} from "./chunk-F2KFLTBF.mjs";
|
|
1
5
|
import {
|
|
2
6
|
OWNED_TURN_TOOL_CATALOG,
|
|
3
7
|
resolveEnabledOwnedTurnTools
|
|
4
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-THN36GA5.mjs";
|
|
5
9
|
import {
|
|
6
10
|
gatewayAgentWantsFullToolLoop,
|
|
7
11
|
init_native_gateway_config,
|
|
8
12
|
resolveGatewayAgentToolsProfile
|
|
9
13
|
} from "./chunk-LR5GC3NZ.mjs";
|
|
10
|
-
import {
|
|
11
|
-
TOOLBOX_UI_META,
|
|
12
|
-
fallbackToolboxUiMeta
|
|
13
|
-
} from "./chunk-F2KFLTBF.mjs";
|
|
14
14
|
import {
|
|
15
15
|
init_path
|
|
16
16
|
} from "./chunk-PC5T3S3D.mjs";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
handleMemoryProductControlPlaneRoute,
|
|
14
14
|
readLastMemoryReadinessGate,
|
|
15
15
|
readLastMemoryReadinessReport
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-I4LMW3IM.mjs";
|
|
17
17
|
import {
|
|
18
18
|
buildMemorySoakEvidenceSummary,
|
|
19
19
|
completeMemorySoakSession,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
} from "./chunk-6SJTUWEO.mjs";
|
|
46
46
|
import {
|
|
47
47
|
buildContextPackForTurn
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-N3YQ5IL6.mjs";
|
|
49
49
|
import {
|
|
50
50
|
generateSkillEvolutionSuggestions
|
|
51
51
|
} from "./chunk-J72V5GVI.mjs";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-4ELPLFOH.mjs";
|
|
12
12
|
import {
|
|
13
13
|
resolveTranscriptBudgetBytesForContextWindow
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-P262PAGZ.mjs";
|
|
15
15
|
|
|
16
16
|
// src/mobile/context-compact/context-budget-gate.ts
|
|
17
17
|
function resolveContextBudgetSignalSource() {
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
selectAnthropicAdapterByBaseUrl
|
|
3
|
+
} from "./chunk-UQLGVSQH.mjs";
|
|
4
|
+
import {
|
|
5
|
+
readAnthropicSseEventStream
|
|
6
|
+
} from "./chunk-SPO74LMZ.mjs";
|
|
1
7
|
import {
|
|
2
8
|
AnthropicIncrementalDeliverer
|
|
3
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3TTLV2GM.mjs";
|
|
10
|
+
import {
|
|
11
|
+
applyConfiguredMaxTokens,
|
|
12
|
+
fetchNativeProviderWithRetry,
|
|
13
|
+
formatRequestShape,
|
|
14
|
+
stringifyJsonRequestBody
|
|
15
|
+
} from "./chunk-E5LABIPO.mjs";
|
|
4
16
|
import {
|
|
5
17
|
init_native_provider_api_key,
|
|
6
18
|
resolveNativeProviderApiKeySync
|
|
@@ -13,17 +25,11 @@ import {
|
|
|
13
25
|
resolveProviderSliceFromGatewayConfig
|
|
14
26
|
} from "./chunk-LR5GC3NZ.mjs";
|
|
15
27
|
import {
|
|
16
|
-
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
readAnthropicSseEventStream
|
|
20
|
-
} from "./chunk-SPO74LMZ.mjs";
|
|
28
|
+
applyAnthropicProviderAccelerationToRequestBody
|
|
29
|
+
} from "./chunk-JHQIGDVB.mjs";
|
|
21
30
|
import {
|
|
22
31
|
interpretAnthropicStreamEvent
|
|
23
32
|
} from "./chunk-LJ5OPMYI.mjs";
|
|
24
|
-
import {
|
|
25
|
-
applyAnthropicProviderAccelerationToRequestBody
|
|
26
|
-
} from "./chunk-JHQIGDVB.mjs";
|
|
27
33
|
|
|
28
34
|
// src/mobile/native-anthropic-messages-stream.ts
|
|
29
35
|
init_native_gateway_config();
|
|
@@ -138,7 +144,8 @@ async function runNativeAnthropicMessagesStreamToDispatcher(params) {
|
|
|
138
144
|
if (params.providerAccelerationPlan || providerAcceleration.application.applied || providerAcceleration.application.warnings.length > 0) {
|
|
139
145
|
params.log(formatProviderAccelerationApplication(providerAcceleration.application));
|
|
140
146
|
}
|
|
141
|
-
const
|
|
147
|
+
const adapter = selectAnthropicAdapterByBaseUrl(cfg.baseUrl);
|
|
148
|
+
const thinkingForBody = adapter.resolveThinkingForBody({
|
|
142
149
|
reasoningMode: params.reasoningMode,
|
|
143
150
|
model: cfg.model,
|
|
144
151
|
configuredThinking: requestBody.thinking
|
|
@@ -146,12 +153,34 @@ async function runNativeAnthropicMessagesStreamToDispatcher(params) {
|
|
|
146
153
|
if (thinkingForBody !== void 0) {
|
|
147
154
|
requestBody.thinking = thinkingForBody;
|
|
148
155
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
156
|
+
applyConfiguredMaxTokens(requestBody, cfg.maxTokens);
|
|
157
|
+
const { bodyText, bodyBytes } = stringifyJsonRequestBody(requestBody);
|
|
158
|
+
params.log(
|
|
159
|
+
`[XKZOOM][native-reply][anthropic-messages] request_shape ${formatRequestShape({
|
|
160
|
+
bodyBytes,
|
|
161
|
+
messages: transcriptMessages,
|
|
162
|
+
maxTokens: requestBody.max_tokens
|
|
163
|
+
})}`
|
|
164
|
+
);
|
|
165
|
+
const res = await fetchNativeProviderWithRetry(
|
|
166
|
+
url,
|
|
167
|
+
{
|
|
168
|
+
method: "POST",
|
|
169
|
+
headers: buildNativeAnthropicRequestHeaders(cfg),
|
|
170
|
+
body: bodyText,
|
|
171
|
+
signal: params.signal
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
label: "anthropic-messages",
|
|
175
|
+
providerId: cfg.providerId,
|
|
176
|
+
model: cfg.model,
|
|
177
|
+
adapter: adapter.id,
|
|
178
|
+
bodyBytes,
|
|
179
|
+
messages: transcriptMessages,
|
|
180
|
+
maxTokens: requestBody.max_tokens,
|
|
181
|
+
log: params.log
|
|
182
|
+
}
|
|
183
|
+
);
|
|
155
184
|
if (!res.ok) {
|
|
156
185
|
const t = await res.text();
|
|
157
186
|
throw new Error(`native anthropic-messages HTTP ${res.status}: ${t.slice(0, 500)}`);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveNativeAnthropicMessagesConfigFromGatewayConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FZ7NLBVP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
resolveNativeOpenAiChatConfigFromGatewayConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BHT6B2TV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
diagnoseNativeReplyRouteMiss,
|
|
9
9
|
init_native_provider_api_key
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
getOrgProjectByTeamId,
|
|
13
13
|
saveCeoOpsBrief
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3OXBG4OP.mjs";
|
|
15
15
|
import {
|
|
16
16
|
isOrgPipelineCharter,
|
|
17
17
|
resolvePeerIsCeoAgent
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-6SYECCCG.mjs";
|
|
19
19
|
import {
|
|
20
20
|
loadTeamCharter
|
|
21
21
|
} from "./chunk-KDZWHGGN.mjs";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildCompactArchiveDigest,
|
|
3
|
+
buildEngineFallbackActionSteps,
|
|
4
|
+
buildRelatedFilesMarkdown,
|
|
5
|
+
inferOpenLoopsFromSnapshot
|
|
6
|
+
} from "./chunk-UHHTLW2Z.mjs";
|
|
1
7
|
import {
|
|
2
8
|
resolveCompactNotePathForTarget,
|
|
3
9
|
resolveMemoryMdPath
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
extractKeyFactsMarkdownFromTranscript
|
|
7
|
-
} from "./chunk-E4GA33KE.mjs";
|
|
10
|
+
} from "./chunk-L7PMYQN5.mjs";
|
|
8
11
|
import {
|
|
9
12
|
buildEngineFallbackCompactNoteSections
|
|
10
13
|
} from "./chunk-OIMCXCOZ.mjs";
|
|
11
14
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
buildRelatedFilesMarkdown,
|
|
15
|
-
inferOpenLoopsFromSnapshot
|
|
16
|
-
} from "./chunk-UHHTLW2Z.mjs";
|
|
15
|
+
extractKeyFactsMarkdownFromTranscript
|
|
16
|
+
} from "./chunk-E4GA33KE.mjs";
|
|
17
17
|
import {
|
|
18
18
|
resolveRecoveryContextBudget,
|
|
19
19
|
truncateMiddle
|
|
@@ -4,10 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-UAQDS6V2.mjs";
|
|
5
5
|
import {
|
|
6
6
|
buildContextPackForTurn
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
retrieveMemoryEvidence
|
|
10
|
-
} from "./chunk-VS2URZFN.mjs";
|
|
7
|
+
} from "./chunk-N3YQ5IL6.mjs";
|
|
11
8
|
import {
|
|
12
9
|
buildSkillRegistryReport,
|
|
13
10
|
buildSkillRegistryView,
|
|
@@ -21,6 +18,9 @@ import {
|
|
|
21
18
|
proposeSkillVersion,
|
|
22
19
|
readSkillLifecycle
|
|
23
20
|
} from "./chunk-2AHSYECT.mjs";
|
|
21
|
+
import {
|
|
22
|
+
retrieveMemoryEvidence
|
|
23
|
+
} from "./chunk-VS2URZFN.mjs";
|
|
24
24
|
import {
|
|
25
25
|
traceMemoryEvidence
|
|
26
26
|
} from "./chunk-LWCO2YNI.mjs";
|
|
@@ -38,9 +38,6 @@ import {
|
|
|
38
38
|
buildContextPackCostReport,
|
|
39
39
|
recommendContextBudgetClass
|
|
40
40
|
} from "./chunk-5Z5IS4XG.mjs";
|
|
41
|
-
import {
|
|
42
|
-
buildContextPackTelemetryRecord
|
|
43
|
-
} from "./chunk-73SN5UQC.mjs";
|
|
44
41
|
import {
|
|
45
42
|
applyContextPackBudget
|
|
46
43
|
} from "./chunk-DUB3FBYX.mjs";
|
|
@@ -54,6 +51,9 @@ import {
|
|
|
54
51
|
readRunLedgerEvents,
|
|
55
52
|
updateRunLedger
|
|
56
53
|
} from "./chunk-4WWT6OC2.mjs";
|
|
54
|
+
import {
|
|
55
|
+
buildContextPackTelemetryRecord
|
|
56
|
+
} from "./chunk-73SN5UQC.mjs";
|
|
57
57
|
import {
|
|
58
58
|
recordGroupConvergenceTeamMemory
|
|
59
59
|
} from "./chunk-Q7NYATKS.mjs";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
countBatonPlanNodes,
|
|
11
11
|
filterAgentBatonRelayTargets,
|
|
12
12
|
resolveBatonIntentFromText
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DXPZNBSQ.mjs";
|
|
14
14
|
import {
|
|
15
15
|
buildGroupMemberAliases,
|
|
16
16
|
stripSelfMention,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
registerInFlightRun,
|
|
30
30
|
setExecutionPlan,
|
|
31
31
|
setGroupFloorState
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-AJNXWGX2.mjs";
|
|
33
33
|
import {
|
|
34
34
|
assessNodeCompletion,
|
|
35
35
|
buildExecutionPlan,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
resolvePlanNodeTimeoutMs,
|
|
44
44
|
skipUnreachableNodes,
|
|
45
45
|
toExecutionPlanSnapshot
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-7MOQ462O.mjs";
|
|
47
47
|
import {
|
|
48
48
|
getMobileChatStore
|
|
49
49
|
} from "./chunk-CVXJ45WI.mjs";
|
|
@@ -9,19 +9,19 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
OWNED_TURN_TOOL_NAMES,
|
|
11
11
|
resolveOwnedToolNamesByTier
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-THN36GA5.mjs";
|
|
13
|
+
import {
|
|
14
|
+
buildOwnedWebSearchPayload
|
|
15
|
+
} from "./chunk-I23YODIQ.mjs";
|
|
13
16
|
import {
|
|
14
17
|
webSmokeTool
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EYK3W2NV.mjs";
|
|
16
19
|
import {
|
|
17
20
|
writeOwnedFile
|
|
18
21
|
} from "./chunk-PINXXWFJ.mjs";
|
|
19
22
|
import {
|
|
20
23
|
videoGenerateTool
|
|
21
24
|
} from "./chunk-ZW24EQKD.mjs";
|
|
22
|
-
import {
|
|
23
|
-
buildOwnedWebSearchPayload
|
|
24
|
-
} from "./chunk-I23YODIQ.mjs";
|
|
25
25
|
import {
|
|
26
26
|
buildOwnedSessionsSendPayload,
|
|
27
27
|
buildOwnedSessionsSpawnPayload,
|
|
@@ -34,6 +34,9 @@ import {
|
|
|
34
34
|
buildOwnedSessionStatus,
|
|
35
35
|
readOwnedSessionStatusParams
|
|
36
36
|
} from "./chunk-5ZMY6RTR.mjs";
|
|
37
|
+
import {
|
|
38
|
+
musicGenerateTool
|
|
39
|
+
} from "./chunk-634RMCSZ.mjs";
|
|
37
40
|
import {
|
|
38
41
|
listOwnedProcesses,
|
|
39
42
|
logOwnedProcess,
|
|
@@ -44,28 +47,31 @@ import {
|
|
|
44
47
|
} from "./chunk-CTKIQWTE.mjs";
|
|
45
48
|
import {
|
|
46
49
|
memoryControlTool
|
|
47
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-WGLYR2YT.mjs";
|
|
48
51
|
import {
|
|
49
52
|
readOwnedMemoryFile
|
|
50
53
|
} from "./chunk-N2CMVW47.mjs";
|
|
51
54
|
import {
|
|
52
55
|
memoryRuntimeEvalTool
|
|
53
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-M6VHS3HQ.mjs";
|
|
54
57
|
import {
|
|
55
58
|
buildOwnedMessagePayload
|
|
56
59
|
} from "./chunk-VWAUDB4X.mjs";
|
|
57
60
|
import {
|
|
58
61
|
buildOwnedModelsList
|
|
59
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-6AY6OPO5.mjs";
|
|
60
63
|
import {
|
|
61
|
-
|
|
62
|
-
} from "./chunk-
|
|
64
|
+
handoffTool
|
|
65
|
+
} from "./chunk-ESYRDWFO.mjs";
|
|
63
66
|
import {
|
|
64
67
|
buildOwnedImageGeneratePayload
|
|
65
68
|
} from "./chunk-F4QXCGDQ.mjs";
|
|
66
69
|
import {
|
|
67
70
|
buildOwnedImagePayload
|
|
68
71
|
} from "./chunk-PUND56EY.mjs";
|
|
72
|
+
import {
|
|
73
|
+
applyOwnedEdit
|
|
74
|
+
} from "./chunk-IT2GAHAL.mjs";
|
|
69
75
|
import {
|
|
70
76
|
runOwnedExec
|
|
71
77
|
} from "./chunk-T6XDJ2QQ.mjs";
|
|
@@ -79,44 +85,38 @@ import {
|
|
|
79
85
|
listOwnedSessions
|
|
80
86
|
} from "./chunk-VA7SUI2L.mjs";
|
|
81
87
|
import {
|
|
82
|
-
|
|
83
|
-
} from "./chunk-
|
|
88
|
+
browserTool
|
|
89
|
+
} from "./chunk-2IZUNNW7.mjs";
|
|
90
|
+
import {
|
|
91
|
+
buildOwnedWebFetchPayload
|
|
92
|
+
} from "./chunk-UPNUSBKT.mjs";
|
|
84
93
|
import {
|
|
85
94
|
ceoConfirmRequirementsTool
|
|
86
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-RYSPXH7G.mjs";
|
|
87
96
|
import {
|
|
88
97
|
ceoDecisionTool
|
|
89
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-PBBRBETA.mjs";
|
|
90
99
|
import {
|
|
91
100
|
ceoOpsBriefTool
|
|
92
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-GSIZ5FR6.mjs";
|
|
93
102
|
import {
|
|
94
103
|
ceoRedirectTool
|
|
95
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-WRRJFJ2N.mjs";
|
|
96
105
|
import {
|
|
97
106
|
commitStackLessonTool
|
|
98
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-S5ROBD7X.mjs";
|
|
99
108
|
import {
|
|
100
109
|
contextCompactTool
|
|
101
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-MVKCMXBY.mjs";
|
|
102
111
|
import {
|
|
103
112
|
searchOwnedMemory
|
|
104
113
|
} from "./chunk-QWFX5VEN.mjs";
|
|
105
114
|
import {
|
|
106
115
|
devToolkitTool
|
|
107
116
|
} from "./chunk-KJR74IUO.mjs";
|
|
108
|
-
import {
|
|
109
|
-
applyOwnedEdit
|
|
110
|
-
} from "./chunk-IT2GAHAL.mjs";
|
|
111
117
|
import {
|
|
112
118
|
listOwnedAgents
|
|
113
119
|
} from "./chunk-LBZCBBHU.mjs";
|
|
114
|
-
import {
|
|
115
|
-
browserTool
|
|
116
|
-
} from "./chunk-2IZUNNW7.mjs";
|
|
117
|
-
import {
|
|
118
|
-
buildOwnedWebFetchPayload
|
|
119
|
-
} from "./chunk-UPNUSBKT.mjs";
|
|
120
120
|
|
|
121
121
|
// src/owned-tools/router.ts
|
|
122
122
|
var T1_OWNED_TOOL_NAMES = resolveOwnedToolNamesByTier("T1");
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
tryKickPipelinePostCloseRound,
|
|
10
10
|
tryRedirectPipelineFloor,
|
|
11
11
|
tryStopPipelineAfterTerminalDecision
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3EV63LAA.mjs";
|
|
13
13
|
import {
|
|
14
14
|
isOrgProjectPipelineEnabled
|
|
15
15
|
} from "./chunk-AZVEPDT6.mjs";
|
|
16
16
|
import {
|
|
17
17
|
enqueuePostCloseDebrief
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ED4H2DM7.mjs";
|
|
19
19
|
import {
|
|
20
20
|
acceptHandoff,
|
|
21
21
|
confirmCeoProjectRequirements,
|
|
@@ -33,15 +33,15 @@ import {
|
|
|
33
33
|
submitAuditVerdict,
|
|
34
34
|
submitCeoDecisionRouted,
|
|
35
35
|
submitProjectBrief
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import {
|
|
38
|
-
isPipelineDepartmentId
|
|
39
|
-
} from "./chunk-LREFRIQQ.mjs";
|
|
36
|
+
} from "./chunk-3OXBG4OP.mjs";
|
|
40
37
|
import {
|
|
41
38
|
loadPipelineCharter,
|
|
42
39
|
resolveDeptLeadAgentId,
|
|
43
40
|
resolveDeptMemberAgentIds
|
|
44
41
|
} from "./chunk-KHQZ35IL.mjs";
|
|
42
|
+
import {
|
|
43
|
+
isPipelineDepartmentId
|
|
44
|
+
} from "./chunk-LREFRIQQ.mjs";
|
|
45
45
|
import {
|
|
46
46
|
loadTeamCharter
|
|
47
47
|
} from "./chunk-KDZWHGGN.mjs";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
buildMemoryReadinessReport,
|
|
4
4
|
readLastMemoryReadinessGate,
|
|
5
5
|
readLastMemoryReadinessReport
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I4LMW3IM.mjs";
|
|
7
7
|
import {
|
|
8
8
|
buildMemorySoakEvidenceSummary,
|
|
9
9
|
completeMemorySoakSession,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
readLastMemoryRuntimeEvalReport,
|
|
24
24
|
runMemoryRuntimeV2SelfEval
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-IVR74IXK.mjs";
|
|
26
26
|
import {
|
|
27
27
|
buildSkillRegistryReport,
|
|
28
28
|
formatSkillRegistryBlock,
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
handleSaveTeamHandover,
|
|
9
9
|
handleUpdateGroupMembers,
|
|
10
10
|
handleUpdateGroupSettings
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WNI5ZPQY.mjs";
|
|
12
12
|
import {
|
|
13
13
|
tryHandleAgentShopRoute
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QCSNRVL2.mjs";
|
|
15
15
|
import {
|
|
16
16
|
handleAcceptHandoff,
|
|
17
17
|
handleCeoDecision,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
handleRestartOrgProject,
|
|
26
26
|
handleSubmitAuditVerdict,
|
|
27
27
|
handleSubmitProjectBrief
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-LXEKUNXI.mjs";
|
|
29
29
|
import {
|
|
30
30
|
listMediaAssetLibrary
|
|
31
31
|
} from "./chunk-QVEQRCOD.mjs";
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
} from "./chunk-4POYX4AW.mjs";
|
|
51
51
|
import {
|
|
52
52
|
handleMemoryProductControlPlaneRoute
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-I4LMW3IM.mjs";
|
|
54
54
|
import {
|
|
55
55
|
SessionIdAgentConflictError
|
|
56
56
|
} from "./chunk-KPJOJH6H.mjs";
|
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
var TRANSCRIPT_BUDGET_BYTES_PER_TOKEN = 4;
|
|
3
3
|
var TRANSCRIPT_CONTEXT_WINDOW_RATIO = 0.35;
|
|
4
4
|
var MIN_TRANSCRIPT_BUDGET_BYTES = 64 * 1024;
|
|
5
|
-
var
|
|
5
|
+
var DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES = 128 * 1024;
|
|
6
|
+
var HARD_MAX_TRANSCRIPT_BUDGET_BYTES = 4 * 1024 * 1024;
|
|
6
7
|
function positiveInteger(value) {
|
|
7
8
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
|
|
8
9
|
return void 0;
|
|
9
10
|
}
|
|
10
11
|
return Math.trunc(value);
|
|
11
12
|
}
|
|
13
|
+
function readMaxTranscriptBudgetBytes(env = process.env) {
|
|
14
|
+
const raw = env.XKZOOM_NATIVE_TRANSCRIPT_MAX_REQUEST_BYTES?.trim();
|
|
15
|
+
if (!raw) {
|
|
16
|
+
return DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES;
|
|
17
|
+
}
|
|
18
|
+
const parsed = Number.parseInt(raw, 10);
|
|
19
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
20
|
+
return DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES;
|
|
21
|
+
}
|
|
22
|
+
return Math.min(HARD_MAX_TRANSCRIPT_BUDGET_BYTES, Math.max(MIN_TRANSCRIPT_BUDGET_BYTES, parsed));
|
|
23
|
+
}
|
|
12
24
|
function resolveTranscriptBudgetBytesForContextWindow(contextWindowTokens) {
|
|
13
25
|
const tokens = positiveInteger(contextWindowTokens);
|
|
14
26
|
if (tokens === void 0) {
|
|
@@ -18,7 +30,7 @@ function resolveTranscriptBudgetBytesForContextWindow(contextWindowTokens) {
|
|
|
18
30
|
tokens * TRANSCRIPT_CONTEXT_WINDOW_RATIO * TRANSCRIPT_BUDGET_BYTES_PER_TOKEN
|
|
19
31
|
);
|
|
20
32
|
return Math.min(
|
|
21
|
-
|
|
33
|
+
readMaxTranscriptBudgetBytes(),
|
|
22
34
|
Math.max(MIN_TRANSCRIPT_BUDGET_BYTES, estimated)
|
|
23
35
|
);
|
|
24
36
|
}
|
|
@@ -28,6 +40,7 @@ function buildNativeTranscriptBudgetForContextWindow(contextWindowTokens) {
|
|
|
28
40
|
}
|
|
29
41
|
|
|
30
42
|
export {
|
|
43
|
+
DEFAULT_MAX_NATIVE_TRANSCRIPT_BUDGET_BYTES,
|
|
31
44
|
resolveTranscriptBudgetBytesForContextWindow,
|
|
32
45
|
buildNativeTranscriptBudgetForContextWindow
|
|
33
46
|
};
|