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.
Files changed (188) hide show
  1. package/README.md +87 -43
  2. package/dist/{chunk-UANVP2AV.mjs → chunk-27BXVTXH.mjs} +1 -1
  3. package/dist/{chunk-PY7W2X6W.mjs → chunk-2DR5RT3I.mjs} +52 -45
  4. package/dist/{chunk-YILSXMZI.mjs → chunk-2IQAT3PE.mjs} +1 -1
  5. package/dist/{chunk-IXYH42YO.mjs → chunk-2VSERWT6.mjs} +1 -1
  6. package/dist/{chunk-BSQF7NF4.mjs → chunk-3KJHUTOO.mjs} +2 -2
  7. package/dist/{chunk-URF75O5Z.mjs → chunk-3VA3YDYL.mjs} +1 -1
  8. package/dist/{chunk-RTANSWHW.mjs → chunk-3ZH273T7.mjs} +27 -27
  9. package/dist/{chunk-EQNHKW6L.mjs → chunk-4JXTPCOE.mjs} +1 -1
  10. package/dist/{chunk-WJIY3BIA.mjs → chunk-5SE4JOKE.mjs} +38 -10
  11. package/dist/{chunk-JD5NPIMO.mjs → chunk-5YEFG7BF.mjs} +25 -25
  12. package/dist/{chunk-LTBQWMAJ.mjs → chunk-6W4W5JLG.mjs} +1 -1
  13. package/dist/{chunk-CDLS44GZ.mjs → chunk-76MFE24I.mjs} +1 -1
  14. package/dist/{chunk-IPIV4NGB.mjs → chunk-76TKUYY3.mjs} +2 -2
  15. package/dist/{chunk-T4LPE43H.mjs → chunk-7LEEVP5O.mjs} +1 -1
  16. package/dist/{chunk-A5DUSLHF.mjs → chunk-DCSERRXG.mjs} +1 -1
  17. package/dist/{chunk-ASIBETCT.mjs → chunk-E2TTUY6R.mjs} +2 -2
  18. package/dist/chunk-E5LABIPO.mjs +201 -0
  19. package/dist/{chunk-KYTJH3R3.mjs → chunk-EE3NRJLQ.mjs} +1 -1
  20. package/dist/{chunk-SIIEMWE3.mjs → chunk-F35EHL5U.mjs} +3 -3
  21. package/dist/{chunk-K4RHLREV.mjs → chunk-FG6QCRVN.mjs} +1 -1
  22. package/dist/{chunk-HJN232FK.mjs → chunk-FLVJABFP.mjs} +1 -1
  23. package/dist/{chunk-ZM23SMRO.mjs → chunk-GIC2RBVM.mjs} +1 -1
  24. package/dist/{chunk-HTU5W436.mjs → chunk-GZJMFCRG.mjs} +2 -2
  25. package/dist/{chunk-JG3EPJ32.mjs → chunk-HAI7DJD2.mjs} +3 -3
  26. package/dist/{chunk-OB4JJLDC.mjs → chunk-HYSOWPIC.mjs} +2 -2
  27. package/dist/{chunk-G5ZU7562.mjs → chunk-IDQ5B572.mjs} +6 -6
  28. package/dist/{chunk-GGWUDW5W.mjs → chunk-IGDJGBAI.mjs} +1 -1
  29. package/dist/{chunk-A23OTVH2.mjs → chunk-J5AXFEDQ.mjs} +18 -18
  30. package/dist/{chunk-4DYFM3EC.mjs → chunk-JBKRS62W.mjs} +3 -3
  31. package/dist/{chunk-OCQUSYRP.mjs → chunk-JFFBD5TV.mjs} +14 -14
  32. package/dist/{chunk-VPRVZWF3.mjs → chunk-JI67TW4E.mjs} +1 -1
  33. package/dist/{chunk-GBG4AJON.mjs → chunk-JJKRD5DL.mjs} +1 -1
  34. package/dist/{chunk-7AZVQS2H.mjs → chunk-JXDHNASC.mjs} +12 -12
  35. package/dist/{chunk-W4MKSQGZ.mjs → chunk-K7RZQIPZ.mjs} +1 -1
  36. package/dist/{chunk-J5HTLG3V.mjs → chunk-KPDVZFJY.mjs} +1 -1
  37. package/dist/{chunk-S7FQBXOO.mjs → chunk-L252ASZW.mjs} +1 -1
  38. package/dist/{chunk-Z7GTU7KF.mjs → chunk-LESS4N25.mjs} +1 -1
  39. package/dist/{chunk-5DMSAPS2.mjs → chunk-M3ISDSQP.mjs} +7 -7
  40. package/dist/{chunk-HR43WO4Q.mjs → chunk-M5IU6U3O.mjs} +2 -2
  41. package/dist/{chunk-BV76CMVR.mjs → chunk-MBOWNG3A.mjs} +1 -1
  42. package/dist/{chunk-CCCPWU2O.mjs → chunk-MDZUWIBH.mjs} +4 -4
  43. package/dist/{chunk-YAD4VG2K.mjs → chunk-MKYCBV3H.mjs} +36 -6
  44. package/dist/{chunk-CORUFGMR.mjs → chunk-MPGMU75K.mjs} +4 -4
  45. package/dist/{chunk-7FLALKSN.mjs → chunk-MQKREMOB.mjs} +2 -2
  46. package/dist/{chunk-H5TJYSTV.mjs → chunk-MRTQWCNC.mjs} +1 -1
  47. package/dist/{chunk-CNHOCDRM.mjs → chunk-NHICONJ3.mjs} +1 -1
  48. package/dist/{chunk-5JGUBBXN.mjs → chunk-NIU6GWKB.mjs} +2 -2
  49. package/dist/{chunk-Q6XX6X24.mjs → chunk-OBYPZT2S.mjs} +6 -6
  50. package/dist/{chunk-Y6SJUTY6.mjs → chunk-P262PAGZ.mjs} +15 -2
  51. package/dist/{chunk-YPAQRMUI.mjs → chunk-PETWGCGB.mjs} +1 -1
  52. package/dist/{chunk-Q4XUEIOE.mjs → chunk-PW3ULDNL.mjs} +1 -1
  53. package/dist/{chunk-EGWLJJY7.mjs → chunk-RKZ56GST.mjs} +2 -2
  54. package/dist/{chunk-QUXUHJZW.mjs → chunk-TADSGGK2.mjs} +7 -7
  55. package/dist/{chunk-ILROJZBI.mjs → chunk-TQBVFKCT.mjs} +37 -9
  56. package/dist/{chunk-M52HZV6R.mjs → chunk-TVH4LII3.mjs} +1 -1
  57. package/dist/{chunk-GUADF3KN.mjs → chunk-ULXTQSV6.mjs} +4 -0
  58. package/dist/{chunk-H5DIQHEQ.mjs → chunk-UXEZFEB3.mjs} +37 -8
  59. package/dist/{chunk-XHO73X2N.mjs → chunk-VNEPNUBZ.mjs} +13 -13
  60. package/dist/{chunk-NYG3IUXK.mjs → chunk-W75Z6CZR.mjs} +1 -1
  61. package/dist/{chunk-PG5CHH66.mjs → chunk-YPKHMAO4.mjs} +1 -1
  62. package/dist/index.js +336 -31
  63. package/dist/index.mjs +104 -103
  64. package/dist/mobile/action-planner.js +21 -1
  65. package/dist/mobile/action-planner.mjs +60 -59
  66. package/dist/mobile/agent-capabilities.js +21 -1
  67. package/dist/mobile/agent-capabilities.mjs +60 -59
  68. package/dist/mobile/anthropic-incremental-deliver.js +19 -0
  69. package/dist/mobile/anthropic-incremental-deliver.mjs +3 -2
  70. package/dist/mobile/anthropic-messages-turn-runner.js +224 -8
  71. package/dist/mobile/anthropic-messages-turn-runner.mjs +69 -68
  72. package/dist/mobile/anthropic-owned-tool-executor.js +21 -1
  73. package/dist/mobile/anthropic-owned-tool-executor.mjs +68 -67
  74. package/dist/mobile/api.mjs +31 -31
  75. package/dist/mobile/context-compact/compact-artifact-enrich.js +19 -0
  76. package/dist/mobile/context-compact/compact-artifact-enrich.mjs +8 -7
  77. package/dist/mobile/context-compact/compact-orchestrator.js +21 -1
  78. package/dist/mobile/context-compact/compact-orchestrator.mjs +12 -11
  79. package/dist/mobile/context-compact/compact-summarizer-engine-artifact.js +19 -0
  80. package/dist/mobile/context-compact/compact-summarizer-engine-artifact.mjs +8 -7
  81. package/dist/mobile/context-compact/compact-summarizer-llm-request.js +19 -0
  82. package/dist/mobile/context-compact/compact-summarizer-llm-request.mjs +5 -4
  83. package/dist/mobile/context-compact/compact-summarizer-llm.js +19 -0
  84. package/dist/mobile/context-compact/compact-summarizer-llm.mjs +6 -5
  85. package/dist/mobile/context-compact/compact-summarizer.js +19 -0
  86. package/dist/mobile/context-compact/compact-summarizer.mjs +7 -6
  87. package/dist/mobile/context-compact/context-budget-gate.js +14 -2
  88. package/dist/mobile/context-compact/context-budget-gate.mjs +2 -2
  89. package/dist/mobile/context-compact/runtime-compact-hook.js +33 -2
  90. package/dist/mobile/context-compact/runtime-compact-hook.mjs +64 -63
  91. package/dist/mobile/group/conductor-llm.js +19 -0
  92. package/dist/mobile/group/conductor-llm.mjs +7 -6
  93. package/dist/mobile/group/conductor-plan-llm.js +19 -0
  94. package/dist/mobile/group/conductor-plan-llm.mjs +7 -6
  95. package/dist/mobile/group/floor-scheduler.mjs +2 -2
  96. package/dist/mobile/group/group-api-handlers.mjs +21 -21
  97. package/dist/mobile/group/group-session.mjs +5 -5
  98. package/dist/mobile/group/index.mjs +16 -16
  99. package/dist/mobile/group/memory-supplement.mjs +4 -4
  100. package/dist/mobile/group/orchestrator.mjs +15 -15
  101. package/dist/mobile/group/plan-runtime.mjs +4 -4
  102. package/dist/mobile/group/relation-distill.mjs +3 -3
  103. package/dist/mobile/group/runtime-integration.mjs +19 -19
  104. package/dist/mobile/group/team-memory-runtime.mjs +3 -3
  105. package/dist/mobile/index.js +336 -31
  106. package/dist/mobile/index.mjs +101 -100
  107. package/dist/mobile/interrupted-turn.js +5 -0
  108. package/dist/mobile/interrupted-turn.mjs +3 -1
  109. package/dist/mobile/memory-contract-r1-prefetch.mjs +5 -5
  110. package/dist/mobile/memory-contract-r5-empty-result.mjs +6 -6
  111. package/dist/mobile/memory-runtime-v2/eval-runner.mjs +8 -8
  112. package/dist/mobile/memory-runtime-v2/evidence-plan.mjs +11 -11
  113. package/dist/mobile/memory-runtime-v2/index.mjs +31 -31
  114. package/dist/mobile/memory-runtime-v2/local-source-import.mjs +3 -3
  115. package/dist/mobile/memory-runtime-v2/memory-control-plane.mjs +11 -11
  116. package/dist/mobile/memory-runtime-v2/memory-readiness.mjs +11 -11
  117. package/dist/mobile/memory-runtime-v2/orchestrator.mjs +4 -4
  118. package/dist/mobile/memory-runtime-v2/project-tool-event.mjs +2 -2
  119. package/dist/mobile/memory-runtime-v2/public-api.mjs +12 -12
  120. package/dist/mobile/memory-runtime-v2/retrieval.mjs +2 -2
  121. package/dist/mobile/model-context-window-budget.js +16 -2
  122. package/dist/mobile/model-context-window-budget.mjs +3 -1
  123. package/dist/mobile/native-anthropic-messages-stream.js +223 -7
  124. package/dist/mobile/native-anthropic-messages-stream.mjs +4 -3
  125. package/dist/mobile/native-anthropic-turn-errors.mjs +2 -2
  126. package/dist/mobile/native-openai-text-stream.js +223 -6
  127. package/dist/mobile/native-openai-text-stream.mjs +2 -1
  128. package/dist/mobile/native-reply-route.js +19 -0
  129. package/dist/mobile/native-reply-route.mjs +5 -4
  130. package/dist/mobile/native-reply-system-prompt-layers.js +21 -1
  131. package/dist/mobile/native-reply-system-prompt-layers.mjs +61 -60
  132. package/dist/mobile/native-request-diagnostics.js +230 -0
  133. package/dist/mobile/native-request-diagnostics.mjs +17 -0
  134. package/dist/mobile/native-stream-block-emit.js +19 -0
  135. package/dist/mobile/native-stream-block-emit.mjs +2 -1
  136. package/dist/mobile/openai-completions-turn-runner.js +224 -8
  137. package/dist/mobile/openai-completions-turn-runner.mjs +69 -68
  138. package/dist/mobile/runtime.js +336 -31
  139. package/dist/mobile/runtime.mjs +100 -99
  140. package/dist/mobile/stream-inbound/mobile-text-stream-pipeline.mjs +4 -4
  141. package/dist/mobile/tool-use-input-normalize.js +21 -1
  142. package/dist/mobile/tool-use-input-normalize.mjs +63 -62
  143. package/dist/mobile/tools/mobile-compact-tool-bridge.js +21 -1
  144. package/dist/mobile/tools/mobile-compact-tool-bridge.mjs +63 -62
  145. package/dist/org/dept-context.mjs +2 -2
  146. package/dist/org/index.mjs +8 -8
  147. package/dist/owned-tools/ceo-confirm-requirements.mjs +3 -3
  148. package/dist/owned-tools/ceo-decision.mjs +4 -4
  149. package/dist/owned-tools/ceo-ops-brief.mjs +3 -3
  150. package/dist/owned-tools/ceo-redirect.mjs +20 -20
  151. package/dist/owned-tools/commit-stack-lesson.mjs +4 -4
  152. package/dist/owned-tools/compact/execute.js +21 -1
  153. package/dist/owned-tools/compact/execute.mjs +61 -60
  154. package/dist/owned-tools/compact/gateway-tool-factory.js +21 -1
  155. package/dist/owned-tools/compact/gateway-tool-factory.mjs +62 -61
  156. package/dist/owned-tools/compact/registry.js +21 -1
  157. package/dist/owned-tools/compact/registry.mjs +60 -59
  158. package/dist/owned-tools/context-compact.js +21 -1
  159. package/dist/owned-tools/context-compact.mjs +25 -24
  160. package/dist/owned-tools/handoff.mjs +3 -3
  161. package/dist/owned-tools/memory-control.mjs +13 -13
  162. package/dist/owned-tools/memory-runtime-eval.mjs +12 -12
  163. package/dist/owned-tools/register-owned-providers.mjs +3 -3
  164. package/dist/owned-tools/registry.js +21 -1
  165. package/dist/owned-tools/registry.mjs +59 -58
  166. package/dist/owned-tools/router.js +21 -1
  167. package/dist/owned-tools/router.mjs +60 -59
  168. package/dist/owned-tools/runtime-bridge.js +21 -1
  169. package/dist/owned-tools/runtime-bridge.mjs +61 -60
  170. package/dist/owned-tools/tool-contract-prompt.js +21 -1
  171. package/dist/owned-tools/tool-contract-prompt.mjs +60 -59
  172. package/dist/owned-tools/tool-result-envelope.js +21 -1
  173. package/dist/owned-tools/tool-result-envelope.mjs +62 -61
  174. package/dist/owned-tools/tool-usage-guide.js +21 -1
  175. package/dist/owned-tools/tool-usage-guide.mjs +59 -58
  176. package/dist/owned-tools/tts.mjs +2 -2
  177. package/dist/project-pipeline/handlers.mjs +20 -20
  178. package/dist/project-pipeline/index.mjs +20 -20
  179. package/dist/project-pipeline/post-close-skill-evolution.mjs +3 -3
  180. package/package.json +2 -2
  181. package/dist/{chunk-KCZIK3TH.mjs → chunk-2QCX6RPN.mjs} +3 -3
  182. package/dist/{chunk-2BGXTBZX.mjs → chunk-D3N7EHB2.mjs} +8 -8
  183. package/dist/{chunk-JIY7IOQ5.mjs → chunk-DRY7AJMM.mjs} +3 -3
  184. package/dist/{chunk-VS2URZFN.mjs → chunk-HWGRW6YP.mjs} +3 -3
  185. package/dist/{chunk-Q7NYATKS.mjs → chunk-UR6LPERL.mjs} +3 -3
  186. package/dist/{chunk-TAQQSDJN.mjs → chunk-WPMJCKI2.mjs} +3 -3
  187. package/dist/{chunk-2TBXT3PD.mjs → chunk-XNQJRIGR.mjs} +9 -9
  188. package/dist/{chunk-BHMWYAVS.mjs → chunk-YYDDQEY4.mjs} +3 -3
@@ -9,7 +9,10 @@ import {
9
9
  import {
10
10
  OWNED_TURN_TOOL_NAMES,
11
11
  resolveOwnedToolNamesByTier
12
- } from "./chunk-RTANSWHW.mjs";
12
+ } from "./chunk-3ZH273T7.mjs";
13
+ import {
14
+ buildOwnedWebSearchPayload
15
+ } from "./chunk-I23YODIQ.mjs";
13
16
  import {
14
17
  webSmokeTool
15
18
  } from "./chunk-CQUISJWG.mjs";
@@ -19,9 +22,6 @@ import {
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,13 +47,13 @@ import {
44
47
  } from "./chunk-CTKIQWTE.mjs";
45
48
  import {
46
49
  memoryControlTool
47
- } from "./chunk-S7FQBXOO.mjs";
50
+ } from "./chunk-L252ASZW.mjs";
48
51
  import {
49
52
  readOwnedMemoryFile
50
53
  } from "./chunk-N2CMVW47.mjs";
51
54
  import {
52
55
  memoryRuntimeEvalTool
53
- } from "./chunk-HR43WO4Q.mjs";
56
+ } from "./chunk-M5IU6U3O.mjs";
54
57
  import {
55
58
  buildOwnedMessagePayload
56
59
  } from "./chunk-VWAUDB4X.mjs";
@@ -58,14 +61,17 @@ import {
58
61
  buildOwnedModelsList
59
62
  } from "./chunk-NRJWLPTI.mjs";
60
63
  import {
61
- musicGenerateTool
62
- } from "./chunk-634RMCSZ.mjs";
64
+ handoffTool
65
+ } from "./chunk-7LEEVP5O.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
- handoffTool
83
- } from "./chunk-T4LPE43H.mjs";
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-CNHOCDRM.mjs";
95
+ } from "./chunk-NHICONJ3.mjs";
87
96
  import {
88
97
  ceoDecisionTool
89
- } from "./chunk-5JGUBBXN.mjs";
98
+ } from "./chunk-NIU6GWKB.mjs";
90
99
  import {
91
100
  ceoOpsBriefTool
92
- } from "./chunk-LTBQWMAJ.mjs";
101
+ } from "./chunk-6W4W5JLG.mjs";
93
102
  import {
94
103
  ceoRedirectTool
95
- } from "./chunk-7FLALKSN.mjs";
104
+ } from "./chunk-MQKREMOB.mjs";
96
105
  import {
97
106
  commitStackLessonTool
98
- } from "./chunk-GGWUDW5W.mjs";
107
+ } from "./chunk-IGDJGBAI.mjs";
99
108
  import {
100
109
  contextCompactTool
101
- } from "./chunk-K4RHLREV.mjs";
110
+ } from "./chunk-FG6QCRVN.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");
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  isOrgPipelineCharter,
17
17
  resolvePeerIsCeoAgent
18
- } from "./chunk-TAQQSDJN.mjs";
18
+ } from "./chunk-WPMJCKI2.mjs";
19
19
  import {
20
20
  loadTeamCharter
21
21
  } from "./chunk-KDZWHGGN.mjs";
@@ -6,7 +6,7 @@ import {
6
6
  readNativeStreamReasoningEmitIntervalMs,
7
7
  readNativeStreamReasoningMinChars,
8
8
  shouldEmitNativeStreamBlock
9
- } from "./chunk-YAD4VG2K.mjs";
9
+ } from "./chunk-MKYCBV3H.mjs";
10
10
 
11
11
  // src/mobile/anthropic-incremental-deliver.ts
12
12
  var NATIVE_ANTHROPIC_STREAM_BLOCK_MIN_CHARS = readNativeStreamBlockMinChars();
@@ -9,13 +9,13 @@ import {
9
9
  tryKickPipelinePostCloseRound,
10
10
  tryRedirectPipelineFloor,
11
11
  tryStopPipelineAfterTerminalDecision
12
- } from "./chunk-OCQUSYRP.mjs";
12
+ } from "./chunk-JFFBD5TV.mjs";
13
13
  import {
14
14
  isOrgProjectPipelineEnabled
15
15
  } from "./chunk-AZVEPDT6.mjs";
16
16
  import {
17
17
  enqueuePostCloseDebrief
18
- } from "./chunk-A5DUSLHF.mjs";
18
+ } from "./chunk-DCSERRXG.mjs";
19
19
  import {
20
20
  acceptHandoff,
21
21
  confirmCeoProjectRequirements,
@@ -34,7 +34,7 @@ import {
34
34
  resolvePeerIsCeoAgent,
35
35
  resolvePeerPipelineRole,
36
36
  resolvePipelineDeptLeadBySlug
37
- } from "./chunk-TAQQSDJN.mjs";
37
+ } from "./chunk-WPMJCKI2.mjs";
38
38
  import {
39
39
  deptLabelFromCharter,
40
40
  workspaceSubdirForDept
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  isOrgPipelineCharter,
7
7
  resolvePipelineDeptLead
8
- } from "./chunk-TAQQSDJN.mjs";
8
+ } from "./chunk-WPMJCKI2.mjs";
9
9
  import {
10
10
  loadTeamCharter
11
11
  } from "./chunk-KDZWHGGN.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-NZPFW3RO.mjs";
4
4
  import {
5
5
  createInitialFloorState
6
- } from "./chunk-BHMWYAVS.mjs";
6
+ } from "./chunk-YYDDQEY4.mjs";
7
7
  import {
8
8
  getGroupFloorState,
9
9
  setGroupFloorState
@@ -25,7 +25,7 @@ import {
25
25
  } from "./chunk-UNZ3D3B3.mjs";
26
26
  import {
27
27
  isOrgPipelineCharter
28
- } from "./chunk-TAQQSDJN.mjs";
28
+ } from "./chunk-WPMJCKI2.mjs";
29
29
  import {
30
30
  ORG_PIPELINE_CHARTER_RULES,
31
31
  ORG_PIPELINE_DEPT_ORDER,
@@ -0,0 +1,201 @@
1
+ // src/mobile/native-request-diagnostics.ts
2
+ function compactLogValue(value, maxLen = 180) {
3
+ const text = String(value ?? "").replace(/\s+/g, " ").trim();
4
+ if (!text) {
5
+ return "";
6
+ }
7
+ return text.length > maxLen ? `${text.slice(0, maxLen)}...` : text;
8
+ }
9
+ function readErrorProp(value, key) {
10
+ return value && typeof value === "object" ? value[key] : void 0;
11
+ }
12
+ function positiveInteger(value) {
13
+ if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
14
+ return void 0;
15
+ }
16
+ return Math.trunc(value);
17
+ }
18
+ function formatNativeFetchErrorForLog(error) {
19
+ const parts = [];
20
+ let current = error;
21
+ for (let depth = 0; depth < 4 && current !== null && current !== void 0; depth += 1) {
22
+ const prefix = depth === 0 ? "error" : `cause${depth}`;
23
+ const name = compactLogValue(readErrorProp(current, "name"));
24
+ const message = current instanceof Error ? compactLogValue(current.message) : compactLogValue(readErrorProp(current, "message") ?? current);
25
+ const code = compactLogValue(readErrorProp(current, "code"));
26
+ const errno = compactLogValue(readErrorProp(current, "errno"));
27
+ if (name) parts.push(`${prefix}Name=${name}`);
28
+ if (message) parts.push(`${prefix}Message=${message}`);
29
+ if (code) parts.push(`${prefix}Code=${code}`);
30
+ if (errno) parts.push(`${prefix}Errno=${errno}`);
31
+ current = readErrorProp(current, "cause");
32
+ }
33
+ return parts.join(" ") || "error=unknown";
34
+ }
35
+ function applyConfiguredMaxTokens(requestBody, maxTokens) {
36
+ const configured = positiveInteger(maxTokens);
37
+ if (configured === void 0) {
38
+ return;
39
+ }
40
+ const existing = positiveInteger(requestBody.max_tokens);
41
+ requestBody.max_tokens = existing === void 0 ? configured : Math.min(existing, configured);
42
+ }
43
+ function stringifyJsonRequestBody(requestBody) {
44
+ const bodyText = JSON.stringify(requestBody);
45
+ return {
46
+ bodyText,
47
+ bodyBytes: Buffer.byteLength(bodyText, "utf8")
48
+ };
49
+ }
50
+ function formatRequestShape(input) {
51
+ const messageCount = Array.isArray(input.messages) ? input.messages.length : 0;
52
+ const toolCount = Array.isArray(input.tools) ? input.tools.length : 0;
53
+ const maxTokens = positiveInteger(input.maxTokens);
54
+ return `bodyBytes=${input.bodyBytes} messages=${messageCount} tools=${toolCount} max_tokens=${maxTokens ?? "n/a"}`;
55
+ }
56
+ var DEFAULT_PROVIDER_FETCH_MAX_ATTEMPTS = 2;
57
+ var HARD_PROVIDER_FETCH_MAX_ATTEMPTS = 4;
58
+ var DEFAULT_PROVIDER_FETCH_RETRY_BASE_MS = 350;
59
+ var HARD_PROVIDER_FETCH_RETRY_BASE_MS = 5e3;
60
+ var RETRYABLE_NATIVE_FETCH_RE = new RegExp(
61
+ [
62
+ "fetch failed",
63
+ "UND_ERR_CONNECT_TIMEOUT",
64
+ "UND_ERR_HEADERS_TIMEOUT",
65
+ "UND_ERR_SOCKET",
66
+ "ECONNRESET",
67
+ "ETIMEDOUT",
68
+ "ECONNREFUSED",
69
+ "ENOTFOUND",
70
+ "EAI_AGAIN",
71
+ "socket hang up",
72
+ "network connection lost",
73
+ "network request failed"
74
+ ].join("|"),
75
+ "i"
76
+ );
77
+ function readClampedPositiveEnvInt(env, key, fallback, max) {
78
+ const raw = (env[key] ?? "").trim();
79
+ const n = Number.parseInt(raw, 10);
80
+ if (!Number.isFinite(n) || n <= 0) {
81
+ return fallback;
82
+ }
83
+ return Math.min(Math.trunc(n), max);
84
+ }
85
+ function readClampedNonNegativeEnvInt(env, key, fallback, max) {
86
+ const raw = (env[key] ?? "").trim();
87
+ const n = Number.parseInt(raw, 10);
88
+ if (!Number.isFinite(n) || n < 0) {
89
+ return fallback;
90
+ }
91
+ return Math.min(Math.trunc(n), max);
92
+ }
93
+ function readProviderFetchMaxAttempts(env) {
94
+ return readClampedPositiveEnvInt(
95
+ env,
96
+ "XKZOOM_NATIVE_PROVIDER_FETCH_MAX_ATTEMPTS",
97
+ DEFAULT_PROVIDER_FETCH_MAX_ATTEMPTS,
98
+ HARD_PROVIDER_FETCH_MAX_ATTEMPTS
99
+ );
100
+ }
101
+ function readProviderFetchRetryBaseMs(env) {
102
+ return readClampedNonNegativeEnvInt(
103
+ env,
104
+ "XKZOOM_NATIVE_PROVIDER_FETCH_RETRY_BASE_MS",
105
+ DEFAULT_PROVIDER_FETCH_RETRY_BASE_MS,
106
+ HARD_PROVIDER_FETCH_RETRY_BASE_MS
107
+ );
108
+ }
109
+ function isAbortLikeFetchError(error) {
110
+ const name = compactLogValue(readErrorProp(error, "name"));
111
+ return name === "AbortError";
112
+ }
113
+ function collectFetchErrorText(error) {
114
+ const parts = [];
115
+ let current = error;
116
+ for (let depth = 0; depth < 4 && current !== null && current !== void 0; depth += 1) {
117
+ parts.push(
118
+ compactLogValue(readErrorProp(current, "name")),
119
+ current instanceof Error ? compactLogValue(current.message) : compactLogValue(readErrorProp(current, "message") ?? current),
120
+ compactLogValue(readErrorProp(current, "code")),
121
+ compactLogValue(readErrorProp(current, "errno"))
122
+ );
123
+ current = readErrorProp(current, "cause");
124
+ }
125
+ return parts.filter(Boolean).join(" ");
126
+ }
127
+ function isRetryableNativeProviderFetchError(error) {
128
+ return !isAbortLikeFetchError(error) && RETRYABLE_NATIVE_FETCH_RE.test(collectFetchErrorText(error));
129
+ }
130
+ function formatProviderRetryContext(context) {
131
+ const parts = [
132
+ `provider=${context.providerId}`,
133
+ `model=${context.model}`,
134
+ context.adapter ? `adapter=${context.adapter}` : "",
135
+ typeof context.iteration === "number" ? `iteration=${context.iteration}` : ""
136
+ ];
137
+ return parts.filter(Boolean).join(" ");
138
+ }
139
+ function asAbortSignal(signal) {
140
+ if (signal && typeof signal === "object" && "aborted" in signal) {
141
+ return signal;
142
+ }
143
+ return void 0;
144
+ }
145
+ async function waitForProviderFetchRetryDelay(delayMs, signal) {
146
+ if (delayMs <= 0) {
147
+ return;
148
+ }
149
+ if (signal?.aborted) {
150
+ throw new DOMException("Aborted", "AbortError");
151
+ }
152
+ await new Promise((resolve, reject) => {
153
+ const timer = setTimeout(() => {
154
+ signal?.removeEventListener("abort", onAbort);
155
+ resolve();
156
+ }, delayMs);
157
+ const onAbort = () => {
158
+ clearTimeout(timer);
159
+ reject(new DOMException("Aborted", "AbortError"));
160
+ };
161
+ signal?.addEventListener("abort", onAbort, { once: true });
162
+ });
163
+ }
164
+ async function fetchNativeProviderWithRetry(url, init, context, env = process.env) {
165
+ const maxAttempts = readProviderFetchMaxAttempts(env);
166
+ const retryBaseMs = readProviderFetchRetryBaseMs(env);
167
+ const signal = asAbortSignal(init.signal);
168
+ for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
169
+ try {
170
+ return await fetch(url, init);
171
+ } catch (error) {
172
+ const retry = attempt < maxAttempts && !signal?.aborted && isRetryableNativeProviderFetchError(error);
173
+ context.log(
174
+ `[XKZOOM][native-reply][${context.label}] fetch_failed ${url} ${formatProviderRetryContext(context)} attempt=${attempt}/${maxAttempts} retry=${retry ? 1 : 0} ${formatRequestShape({
175
+ bodyBytes: context.bodyBytes,
176
+ messages: context.messages,
177
+ tools: context.tools,
178
+ maxTokens: context.maxTokens
179
+ })} ${formatNativeFetchErrorForLog(error)}`
180
+ );
181
+ if (!retry) {
182
+ throw error;
183
+ }
184
+ const delayMs = retryBaseMs * attempt;
185
+ context.log(
186
+ `[XKZOOM][native-reply][${context.label}] fetch_retry ${url} ${formatProviderRetryContext(context)} nextAttempt=${attempt + 1}/${maxAttempts} delayMs=${delayMs}`
187
+ );
188
+ await waitForProviderFetchRetryDelay(delayMs, signal);
189
+ }
190
+ }
191
+ throw new Error(`native provider fetch retry exhausted: ${url}`);
192
+ }
193
+
194
+ export {
195
+ formatNativeFetchErrorForLog,
196
+ applyConfiguredMaxTokens,
197
+ stringifyJsonRequestBody,
198
+ formatRequestShape,
199
+ isRetryableNativeProviderFetchError,
200
+ fetchNativeProviderWithRetry
201
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  classifyTurnTimeoutKind,
3
3
  formatTurnTimeoutKindForUser
4
- } from "./chunk-GUADF3KN.mjs";
4
+ } from "./chunk-ULXTQSV6.mjs";
5
5
 
6
6
  // src/mobile/native-anthropic-turn-errors.ts
7
7
  function isPlainUpstreamConnectionFailure(message, kind) {
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  isCompactOwnedToolName
3
- } from "./chunk-M52HZV6R.mjs";
3
+ } from "./chunk-TVH4LII3.mjs";
4
4
  import {
5
5
  collectRecentMessagesForCompact,
6
6
  formatRecentMessagesForPrompt
7
7
  } from "./chunk-X3BY5KPX.mjs";
8
8
  import {
9
9
  runCompactPipeline
10
- } from "./chunk-CCCPWU2O.mjs";
10
+ } from "./chunk-MDZUWIBH.mjs";
11
11
  import {
12
12
  evaluateContextBudgetGate,
13
13
  requestGatewayCompaction
14
- } from "./chunk-HJN232FK.mjs";
14
+ } from "./chunk-FLVJABFP.mjs";
15
15
  import {
16
16
  scheduleMemoryMaintenance
17
17
  } from "./chunk-IHH6JKPK.mjs";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-X3BY5KPX.mjs";
5
5
  import {
6
6
  runCompactPipeline
7
- } from "./chunk-CCCPWU2O.mjs";
7
+ } from "./chunk-MDZUWIBH.mjs";
8
8
  import {
9
9
  registerContextCompactExecutor
10
10
  } from "./chunk-UH6VXWMV.mjs";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-4ELPLFOH.mjs";
12
12
  import {
13
13
  resolveTranscriptBudgetBytesForContextWindow
14
- } from "./chunk-Y6SJUTY6.mjs";
14
+ } from "./chunk-P262PAGZ.mjs";
15
15
 
16
16
  // src/mobile/context-compact/context-budget-gate.ts
17
17
  function resolveContextBudgetSignalSource() {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sanitizeOwnedToolVisiblePayload
3
- } from "./chunk-IXYH42YO.mjs";
3
+ } from "./chunk-2VSERWT6.mjs";
4
4
  import {
5
5
  ownedToolPayloadIndicatesFailure
6
6
  } from "./chunk-GYZ4IXUD.mjs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveNativeAnthropicMessagesConfigFromGatewayConfig
3
- } from "./chunk-H5DIQHEQ.mjs";
3
+ } from "./chunk-UXEZFEB3.mjs";
4
4
  import {
5
5
  resolveNativeOpenAiChatConfigFromGatewayConfig
6
- } from "./chunk-YAD4VG2K.mjs";
6
+ } from "./chunk-MKYCBV3H.mjs";
7
7
  import {
8
8
  diagnoseNativeReplyRouteMiss,
9
9
  init_native_provider_api_key
@@ -2,7 +2,7 @@ import {
2
2
  buildCompactSummarizerAnthropicRequestBody,
3
3
  buildCompactSummarizerOpenAiRequestBody,
4
4
  summarizeCompactSummarizerRequestForLog
5
- } from "./chunk-OB4JJLDC.mjs";
5
+ } from "./chunk-HYSOWPIC.mjs";
6
6
  import {
7
7
  resolveCompactSummarizerModelOverride,
8
8
  resolveCompactSummarizerTimeoutMs
@@ -12,7 +12,7 @@ import {
12
12
  resolveAnthropicMessagesBodyExtras,
13
13
  resolveNativeAnthropicMessagesConfigFromGatewayConfig,
14
14
  resolveNativeAnthropicMessagesUrl
15
- } from "./chunk-H5DIQHEQ.mjs";
15
+ } from "./chunk-UXEZFEB3.mjs";
16
16
  import {
17
17
  resolveNativeProviderApiKeyViaGatewayAuth
18
18
  } from "./chunk-44L5RQKZ.mjs";
@@ -20,7 +20,7 @@ import {
20
20
  resolveNativeOpenAiChatCompletionsUrl,
21
21
  resolveNativeOpenAiChatConfigFromGatewayConfig,
22
22
  resolveOpenAiCompletionsBodyExtras
23
- } from "./chunk-YAD4VG2K.mjs";
23
+ } from "./chunk-MKYCBV3H.mjs";
24
24
  import {
25
25
  init_native_provider_api_key,
26
26
  resolveNativeProviderApiKeySync
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-GR7LH34J.mjs";
4
4
  import {
5
5
  resolveAnthropicMessagesBodyExtras
6
- } from "./chunk-H5DIQHEQ.mjs";
6
+ } from "./chunk-UXEZFEB3.mjs";
7
7
  import {
8
8
  resolveOpenAiCompletionsBodyExtras
9
- } from "./chunk-YAD4VG2K.mjs";
9
+ } from "./chunk-MKYCBV3H.mjs";
10
10
  import {
11
11
  isMinimaxM3Model,
12
12
  resolveMinimaxM3AnthropicThinking
@@ -2,13 +2,13 @@ import {
2
2
  createGroupChatSession,
3
3
  updateGroupMembers,
4
4
  updateGroupSettings
5
- } from "./chunk-ASIBETCT.mjs";
5
+ } from "./chunk-E2TTUY6R.mjs";
6
6
  import {
7
7
  tryKickPipelineCeoRequirementConfirmation
8
- } from "./chunk-OCQUSYRP.mjs";
8
+ } from "./chunk-JFFBD5TV.mjs";
9
9
  import {
10
10
  floorStateToEventPayload
11
- } from "./chunk-BHMWYAVS.mjs";
11
+ } from "./chunk-YYDDQEY4.mjs";
12
12
  import {
13
13
  LEGACY_GROUP_CHAT_DISABLED_CODE,
14
14
  isLegacyGroupChatEnabled
@@ -20,13 +20,13 @@ import {
20
20
  getTeamTaskBoard,
21
21
  patchTeamTaskBoard
22
22
  } from "./chunk-BHA3SMKH.mjs";
23
+ import {
24
+ getOrgProjectByTeamId
25
+ } from "./chunk-UNZ3D3B3.mjs";
23
26
  import {
24
27
  buildBossRelationPanel,
25
28
  neutralizeRelationPair
26
29
  } from "./chunk-OJYZLNSD.mjs";
27
- import {
28
- getOrgProjectByTeamId
29
- } from "./chunk-UNZ3D3B3.mjs";
30
30
  import {
31
31
  ORG_PIPELINE_TEMPLATE_ID
32
32
  } from "./chunk-LREFRIQQ.mjs";
@@ -2,7 +2,7 @@ import {
2
2
  PostCloseSkillEvolutionError,
3
3
  mergeStackLessonSkill,
4
4
  recordPostCloseDebriefStatus
5
- } from "./chunk-A5DUSLHF.mjs";
5
+ } from "./chunk-DCSERRXG.mjs";
6
6
  import {
7
7
  defineTool
8
8
  } from "./chunk-DFJFMZX6.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildPairwiseRelationImpression
3
- } from "./chunk-NYG3IUXK.mjs";
3
+ } from "./chunk-W75Z6CZR.mjs";
4
4
  import {
5
5
  formatNormalGroupRouteReceipt
6
6
  } from "./chunk-A5OB3QEO.mjs";
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-L4Z7ND7Z.mjs";
22
22
  import {
23
23
  runPlanRuntime
24
- } from "./chunk-YILSXMZI.mjs";
24
+ } from "./chunk-2IQAT3PE.mjs";
25
25
  import {
26
26
  applyUserContinue,
27
27
  applyUserNewTopic,
@@ -69,7 +69,7 @@ import {
69
69
  selectNextSpeaker,
70
70
  shouldConverge,
71
71
  shouldConvergeNaturally
72
- } from "./chunk-BHMWYAVS.mjs";
72
+ } from "./chunk-YYDDQEY4.mjs";
73
73
  import {
74
74
  buildGroupMemberAliases,
75
75
  collectMentionedMembers,
@@ -110,20 +110,14 @@ import {
110
110
  import {
111
111
  isGroupWorkLaneEnabled
112
112
  } from "./chunk-AZVEPDT6.mjs";
113
- import {
114
- writeTeamMinutes
115
- } from "./chunk-S4AIBE4O.mjs";
116
- import {
117
- buildMinutesDraftFromConvergence
118
- } from "./chunk-Z7C7KX3U.mjs";
119
- import {
120
- createRemarkResolver
121
- } from "./chunk-4POYX4AW.mjs";
122
113
  import {
123
114
  clearPipelineDeptRollup,
124
115
  markPipelineDeptRollupMemberDone,
125
116
  startPipelineDeptRollup
126
117
  } from "./chunk-6SZCPHCL.mjs";
118
+ import {
119
+ createRemarkResolver
120
+ } from "./chunk-4POYX4AW.mjs";
127
121
  import {
128
122
  clearAllInFlightRuns,
129
123
  clearInFlightRun,
@@ -168,28 +162,34 @@ import {
168
162
  hasPendingDeptPostCloseDebrief,
169
163
  resolveNextPostCloseDebriefAgentId,
170
164
  resolvePostCloseDebriefAgentOrder
171
- } from "./chunk-A5DUSLHF.mjs";
165
+ } from "./chunk-DCSERRXG.mjs";
172
166
  import {
173
167
  recordGroupConvergenceTeamMemory
174
- } from "./chunk-Q7NYATKS.mjs";
168
+ } from "./chunk-UR6LPERL.mjs";
169
+ import {
170
+ writeTeamMinutes
171
+ } from "./chunk-S4AIBE4O.mjs";
172
+ import {
173
+ buildMinutesDraftFromConvergence
174
+ } from "./chunk-Z7C7KX3U.mjs";
175
175
  import {
176
176
  getMobileChatStore
177
177
  } from "./chunk-CVXJ45WI.mjs";
178
+ import {
179
+ getOrgProjectByTeamId
180
+ } from "./chunk-UNZ3D3B3.mjs";
178
181
  import {
179
182
  accumulateNegAndShouldFuse,
180
183
  neutralizeRelationPair,
181
184
  writePeerRelationNote
182
185
  } from "./chunk-OJYZLNSD.mjs";
183
- import {
184
- getOrgProjectByTeamId
185
- } from "./chunk-UNZ3D3B3.mjs";
186
186
  import {
187
187
  isOrgPipelineCharter,
188
188
  resolvePeerIsCeoAgent,
189
189
  resolvePeerPipelineRole,
190
190
  resolvePipelineDeptLead,
191
191
  resolvePipelineDeptMembers
192
- } from "./chunk-TAQQSDJN.mjs";
192
+ } from "./chunk-WPMJCKI2.mjs";
193
193
  import {
194
194
  resolveActivePipelineLead,
195
195
  resolveDynamicDeptLead
@@ -8,7 +8,7 @@ import {
8
8
  handleSaveTeamHandover,
9
9
  handleUpdateGroupMembers,
10
10
  handleUpdateGroupSettings
11
- } from "./chunk-G5ZU7562.mjs";
11
+ } from "./chunk-IDQ5B572.mjs";
12
12
  import {
13
13
  tryHandleAgentShopRoute
14
14
  } from "./chunk-MGWYJD5Q.mjs";
@@ -25,7 +25,7 @@ import {
25
25
  handleRestartOrgProject,
26
26
  handleSubmitAuditVerdict,
27
27
  handleSubmitProjectBrief
28
- } from "./chunk-IPIV4NGB.mjs";
28
+ } from "./chunk-76TKUYY3.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-Q6XX6X24.mjs";
53
+ } from "./chunk-OBYPZT2S.mjs";
54
54
  import {
55
55
  SessionIdAgentConflictError
56
56
  } from "./chunk-KPJOJH6H.mjs";