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
package/README.md CHANGED
@@ -38,6 +38,50 @@ entries, or VPS deployment scripts.
38
38
 
39
39
  ## Release Notes
40
40
 
41
+ ### 1.5.4
42
+
43
+ 发布日期: 2026-07-01
44
+
45
+ 对外版本真源: xkzoom-gateway(desktop / app 同步至 1.5.4)
46
+
47
+ #### 概述
48
+
49
+ 1.5.4 是在 1.5.3 基础上的修复版本。网关运行时相较 1.5.3 无功能变更,本次问题与修复集中在桌面客户端;网关 npm 包随版本线对齐发布,供 desktop 1.5.4 安装包内嵌。
50
+
51
+ #### 修复(桌面客户端 xkzoom-desktop)
52
+
53
+ - 智能体商店领取 Agent 后首条消息无回复、Agent 空转、上下文面板报 "session not found"。
54
+ 桌面端会为“已领取但尚未开聊”的 Agent 在会话列表生成占位入口(`agent-placeholder:*`)。此前发送时把该客户端自造的占位 id 原样发给网关,网关据此把一个以占位 id 为真实 id 的会话落库,与前端占位检测冲突,导致草稿永远无法重绑到真实会话。现在占位草稿发送时改发空 `sessionId`,由网关 mint 正规会话 id,前端既有的 ACK / 事件 / 接收自动切换逻辑完成“占位 → 真实会话”重绑;`selectSession` 增加“尚未落库才按草稿处理”的防御,历史存量里被错误落库的占位会话也能正常加载历史。
55
+ - 程序内右上角“检查更新”始终显示“更新检查失败:fetch failed”。
56
+ 更新检查只请求 CDN 自定义域名 `download.xkzoom.com`,在部分网络下对该域名直连超时(UND_ERR_CONNECT_TIMEOUT)。现在清单与安装包请求都新增 OSS 原始域名同路径兜底(`download.xkzoom.com` → `xkzoom-installers.oss-cn-hangzhou.aliyuncs.com`),CDN 与 OSS 任一可达即成功;清单请求另加约 6s 连接超时以快速切换(大文件下载不设超时)。结果:无新版显示“已是最新版本”,有新版可在程序内直接下载并拉起安装器。
57
+
58
+ #### 网关运行时(xkzoom npm)
59
+
60
+ - 无功能变更,与 1.5.3 一致。仅版本号对齐至 1.5.4。
61
+
62
+ #### 维护 / CI(不影响 npm 包内容)
63
+
64
+ - release-gate 的 `release-artifact-shape` 校验前先执行 `pnpm run build`,修复独立 matrix job 因缺少 dist 产物导致的误报。
65
+
66
+ #### 升级说明
67
+
68
+ - 已装 1.5.3 的用户升级到 desktop 1.5.4 后,上述两个问题即修复。
69
+ - 网关端从 1.5.3 升到 1.5.4 无需任何迁移或配置变更。
70
+
71
+ ### 1.5.3
72
+
73
+ - Hardens native provider calls against transient upstream connection failures:
74
+ OpenAI-compatible and Anthropic-compatible request paths now retry retryable
75
+ network/connect failures once before surfacing a failed assistant turn.
76
+ - Adds shared retry diagnostics for native provider fetches, including attempt
77
+ counts, retry decisions, request shape, and cause-chain error codes without
78
+ logging prompts or API keys.
79
+ - Applies the retry path to the owned turn runners used by Desktop/App replies
80
+ and to the legacy text-stream helpers, keeping HTTP errors, aborts, and empty
81
+ stream failures honest.
82
+ - Adds regression coverage for `UND_ERR_CONNECT_TIMEOUT` recovery on both
83
+ OpenAI-compatible and Anthropic-compatible native turn paths.
84
+
41
85
  ### 1.5.2
42
86
 
43
87
  - Publishes the 1.5.x owned gateway runtime with complete npm package metadata
@@ -66,46 +110,46 @@ entries, or VPS deployment scripts.
66
110
  ## Runtime
67
111
 
68
112
  - Start the gateway with `pnpm run gateway:run` or the `xkzoom` bin.
69
- - The default state root is `~/.xkzoom`.
70
- - Set `XKZOOM_STATE_DIR` to use an explicit state root.
71
- - `gateway-core/runtime/gateway/owned-gateway-entry.cjs` owns the gateway CLI
72
- entry.
73
- - `gateway-core/runtime/reply/load-owned-reply-runtime.cjs` owns reply runtime
74
- loading.
75
- - `gateway-core/runtime/mobile-relay` owns relay and connector processes.
76
-
77
- ## Product Surface
78
-
79
- - Skills are read from agent workspaces and XKZOOM global skills.
80
- - The API does not return retired bundled skills by default.
81
- - Agent creation uses the native XKZOOM skeleton writer.
82
- - Mobile REST and `/mobile/ws` are part of the owned gateway path.
83
- - Third-party chat software integrations, web control UI, tunnel, and TUN are
84
- disabled product surfaces.
85
-
86
- ## Verification
87
-
88
- Run the core checks before publishing or handing off:
89
-
90
- ```bash
91
- pnpm run build
92
- pnpm run typecheck:test
93
- pnpm run verify:release-artifact:shape
94
- pnpm run verify:zero-legacy-source
95
- ```
96
-
97
- Useful focused checks:
98
-
99
- ```bash
100
- pnpm run test:mobile:regression
101
- pnpm run test:dev-tools
102
- pnpm run verify:mobile:runtime
103
- ```
104
-
105
- ## Documentation
106
-
107
- - [Gateway Core](docs/gateway-core.md)
108
- - [State Root](docs/state-root.md)
109
- - [Skills And Agents](docs/skills-and-agents.md)
110
- - [Mobile Relay Connector](docs/mobile-relay-connector.md)
111
- - [Release Verification](docs/release-verification.md)
113
+ - The default state root is `~/.xkzoom`.
114
+ - Set `XKZOOM_STATE_DIR` to use an explicit state root.
115
+ - `gateway-core/runtime/gateway/owned-gateway-entry.cjs` owns the gateway CLI
116
+ entry.
117
+ - `gateway-core/runtime/reply/load-owned-reply-runtime.cjs` owns reply runtime
118
+ loading.
119
+ - `gateway-core/runtime/mobile-relay` owns relay and connector processes.
120
+
121
+ ## Product Surface
122
+
123
+ - Skills are read from agent workspaces and XKZOOM global skills.
124
+ - The API does not return retired bundled skills by default.
125
+ - Agent creation uses the native XKZOOM skeleton writer.
126
+ - Mobile REST and `/mobile/ws` are part of the owned gateway path.
127
+ - Third-party chat software integrations, web control UI, tunnel, and TUN are
128
+ disabled product surfaces.
129
+
130
+ ## Verification
131
+
132
+ Run the core checks before publishing or handing off:
133
+
134
+ ```bash
135
+ pnpm run build
136
+ pnpm run typecheck:test
137
+ pnpm run verify:release-artifact:shape
138
+ pnpm run verify:zero-legacy-source
139
+ ```
140
+
141
+ Useful focused checks:
142
+
143
+ ```bash
144
+ pnpm run test:mobile:regression
145
+ pnpm run test:dev-tools
146
+ pnpm run verify:mobile:runtime
147
+ ```
148
+
149
+ ## Documentation
150
+
151
+ - [Gateway Core](docs/gateway-core.md)
152
+ - [State Root](docs/state-root.md)
153
+ - [Skills And Agents](docs/skills-and-agents.md)
154
+ - [Mobile Relay Connector](docs/mobile-relay-connector.md)
155
+ - [Release Verification](docs/release-verification.md)
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  formatMemoryRetrievedBlock
3
- } from "./chunk-Q4XUEIOE.mjs";
3
+ } from "./chunk-PW3ULDNL.mjs";
4
4
  import {
5
5
  getGatewayMemorySearchManager
6
6
  } from "./chunk-X7ZWYPCN.mjs";
@@ -1,50 +1,55 @@
1
1
  import {
2
- MobileSessionAgentEventBridge
3
- } from "./chunk-JDHB2EC6.mjs";
2
+ MobileTextStreamPipeline
3
+ } from "./chunk-XNQJRIGR.mjs";
4
4
  import {
5
- dispatchNontextReplyFromExtracted
6
- } from "./chunk-TKW3XDFP.mjs";
5
+ buildRuntimeTextDeliverPayload
6
+ } from "./chunk-WMKSZMB7.mjs";
7
7
  import {
8
- MobileTextStreamPipeline
9
- } from "./chunk-2TBXT3PD.mjs";
8
+ MobileSessionAgentEventBridge
9
+ } from "./chunk-JDHB2EC6.mjs";
10
10
  import {
11
11
  MobileStreamRoundToolFlight
12
12
  } from "./chunk-6B2OT7ND.mjs";
13
13
  import {
14
- buildRuntimeTextDeliverPayload
15
- } from "./chunk-WMKSZMB7.mjs";
14
+ dispatchNontextReplyFromExtracted
15
+ } from "./chunk-TKW3XDFP.mjs";
16
16
  import {
17
17
  buildDirectChatGroupContextBlock
18
18
  } from "./chunk-LGNLS7ZN.mjs";
19
+ import {
20
+ inferMobileUpstreamDispatchFailureMeta
21
+ } from "./chunk-7L46MOG4.mjs";
19
22
  import {
20
23
  callPostAgentIntentLlm
21
- } from "./chunk-PG5CHH66.mjs";
24
+ } from "./chunk-YPKHMAO4.mjs";
22
25
  import {
23
26
  callConductorPlanLlm
24
- } from "./chunk-YPAQRMUI.mjs";
27
+ } from "./chunk-PETWGCGB.mjs";
25
28
  import {
26
29
  buildRunningSummaryContextBlock
27
30
  } from "./chunk-42NDWKUN.mjs";
28
31
  import {
29
32
  detectCompactDoneFromAssistantText,
30
33
  evaluateAndMaybeRunContextCompact
31
- } from "./chunk-SIIEMWE3.mjs";
32
- import {
33
- inferMobileUpstreamDispatchFailureMeta
34
- } from "./chunk-7L46MOG4.mjs";
35
- import {
36
- registerXreBucketGatewayBridge
37
- } from "./chunk-PJKLQF3K.mjs";
34
+ } from "./chunk-F35EHL5U.mjs";
38
35
  import {
39
36
  createFinalTraceLogger,
40
37
  previewFinalTraceText
41
38
  } from "./chunk-5PZJDP37.mjs";
39
+ import {
40
+ registerXreBucketGatewayBridge
41
+ } from "./chunk-PJKLQF3K.mjs";
42
42
  import {
43
43
  resolveDefaultFileToolScopeForTurn
44
44
  } from "./chunk-JG3K4N5B.mjs";
45
45
  import {
46
46
  applyStateRootHygiene
47
47
  } from "./chunk-BAS4J57E.mjs";
48
+ import {
49
+ buildToolResultMediaUrlList,
50
+ mapRawSourcePerDeliveredPart,
51
+ slimDeliveredPartForToolResult
52
+ } from "./chunk-BIEZNK2B.mjs";
48
53
  import {
49
54
  getMobileWebSocketServer
50
55
  } from "./chunk-ZMQ3UOGP.mjs";
@@ -62,11 +67,6 @@ import {
62
67
  import {
63
68
  detectToolChoicePolicyForTurn
64
69
  } from "./chunk-O6YH4BTO.mjs";
65
- import {
66
- buildToolResultMediaUrlList,
67
- mapRawSourcePerDeliveredPart,
68
- slimDeliveredPartForToolResult
69
- } from "./chunk-BIEZNK2B.mjs";
70
70
  import {
71
71
  ensureReplyDispatchWarmupComplete,
72
72
  startReplyDispatchWarmup
@@ -80,9 +80,13 @@ import {
80
80
  import {
81
81
  settleMobileReasoningDeliverAfterInboundIdle
82
82
  } from "./chunk-GSWQMKOE.mjs";
83
+ import {
84
+ appendMobileOfflineBatchGatewayTranscriptMaybe,
85
+ offlineSyncPartToGatewayPlainText
86
+ } from "./chunk-CYVEZZL5.mjs";
83
87
  import {
84
88
  runNativeOpenAiCompletionsTurnToDispatcher
85
- } from "./chunk-ILROJZBI.mjs";
89
+ } from "./chunk-TQBVFKCT.mjs";
86
90
  import {
87
91
  detectFakeProviderImageUrl,
88
92
  rehostRemoteImageUrlIfNeeded
@@ -99,23 +103,19 @@ import {
99
103
  resolveNativeReplyRoute,
100
104
  resolveNativeReplyRouteAsync,
101
105
  shouldResolveNativeReplyRouteAsync
102
- } from "./chunk-HTU5W436.mjs";
106
+ } from "./chunk-GZJMFCRG.mjs";
103
107
  import {
104
108
  buildNativeAnthropicTurnToolBlocks,
105
109
  buildNativeOpenAiTurnToolBlocks,
106
110
  buildNativeReplyRuntimeContextBlocks,
107
111
  buildOwnedNativeReplyChildTurnBlocks
108
- } from "./chunk-EQNHKW6L.mjs";
112
+ } from "./chunk-4JXTPCOE.mjs";
109
113
  import {
110
114
  composeNativeReplySystemPrompt
111
115
  } from "./chunk-3STOFADV.mjs";
112
- import {
113
- appendMobileOfflineBatchGatewayTranscriptMaybe,
114
- offlineSyncPartToGatewayPlainText
115
- } from "./chunk-CYVEZZL5.mjs";
116
116
  import {
117
117
  formatNativeAnthropicTurnUserMessage
118
- } from "./chunk-KYTJH3R3.mjs";
118
+ } from "./chunk-EE3NRJLQ.mjs";
119
119
  import {
120
120
  isMobileSuppressFinalBlockAssistTextDeliverEnabled,
121
121
  shouldSuppressAssistTextFromNativeDeliver
@@ -138,10 +138,10 @@ import {
138
138
  } from "./chunk-CTOIVB2P.mjs";
139
139
  import {
140
140
  runR5EmptyResultInvestigation
141
- } from "./chunk-UANVP2AV.mjs";
141
+ } from "./chunk-27BXVTXH.mjs";
142
142
  import {
143
143
  prefetchMemoryR1Block
144
- } from "./chunk-Q4XUEIOE.mjs";
144
+ } from "./chunk-PW3ULDNL.mjs";
145
145
  import {
146
146
  rehydrateChatMessageForClient,
147
147
  rehydrateChatMessagesForClient
@@ -164,8 +164,9 @@ import {
164
164
  extractLastToolNameFromError,
165
165
  extractTurnMetricFromError,
166
166
  findActiveInterruptedTurnSnapshotBefore,
167
+ hasInterruptedTurnRecoveryEvidence,
167
168
  isInterruptedTurnResumeRequest
168
- } from "./chunk-GUADF3KN.mjs";
169
+ } from "./chunk-ULXTQSV6.mjs";
169
170
  import {
170
171
  expandMediaUrlWildcards
171
172
  } from "./chunk-RXRZEWNK.mjs";
@@ -209,10 +210,10 @@ import {
209
210
  } from "./chunk-B4YKXZ5W.mjs";
210
211
  import {
211
212
  runNativeAnthropicMessagesTurnToDispatcher
212
- } from "./chunk-WJIY3BIA.mjs";
213
+ } from "./chunk-5SE4JOKE.mjs";
213
214
  import {
214
215
  createMobileApiRequestHandler
215
- } from "./chunk-4DYFM3EC.mjs";
216
+ } from "./chunk-JBKRS62W.mjs";
216
217
  import {
217
218
  consumeInboundMobileUploadRef,
218
219
  looksLikeXkzoomMediaRefV1
@@ -222,12 +223,12 @@ import {
222
223
  } from "./chunk-FU5NWQEP.mjs";
223
224
  import {
224
225
  buildAgentCapabilities
225
- } from "./chunk-Z7GTU7KF.mjs";
226
+ } from "./chunk-LESS4N25.mjs";
226
227
  import {
227
228
  OWNED_TURN_TOOL_NAMES,
228
229
  buildOwnedToolsCatalog,
229
230
  buildOwnedTurnToolSchemas
230
- } from "./chunk-RTANSWHW.mjs";
231
+ } from "./chunk-3ZH273T7.mjs";
231
232
  import {
232
233
  buildSessionTranscriptMeterFromMessages
233
234
  } from "./chunk-4IWTTXQE.mjs";
@@ -244,10 +245,10 @@ import {
244
245
  } from "./chunk-4ELPLFOH.mjs";
245
246
  import {
246
247
  buildNativeTranscriptBudgetForContextWindow
247
- } from "./chunk-Y6SJUTY6.mjs";
248
+ } from "./chunk-P262PAGZ.mjs";
248
249
  import {
249
250
  runNativeAnthropicMessagesStreamToDispatcher
250
- } from "./chunk-H5DIQHEQ.mjs";
251
+ } from "./chunk-UXEZFEB3.mjs";
251
252
  import {
252
253
  MemoryContractR1Tracker,
253
254
  MemoryContractR2Tracker,
@@ -269,7 +270,7 @@ import {
269
270
  } from "./chunk-BW737ZQN.mjs";
270
271
  import {
271
272
  runNativeOpenAiTextStreamToDispatcher
272
- } from "./chunk-YAD4VG2K.mjs";
273
+ } from "./chunk-MKYCBV3H.mjs";
273
274
  import {
274
275
  diagnoseNativeReplyRouteMiss,
275
276
  formatNativeReplyRouteMissMessage
@@ -285,7 +286,7 @@ import {
285
286
  dispatchGroupSessionMessage,
286
287
  forceStopGroupFloorState,
287
288
  initGroupCollaborationEngine
288
- } from "./chunk-OCQUSYRP.mjs";
289
+ } from "./chunk-JFFBD5TV.mjs";
289
290
  import {
290
291
  buildGroupPeerTranscriptProjection
291
292
  } from "./chunk-BSG6WLML.mjs";
@@ -298,13 +299,13 @@ import {
298
299
  } from "./chunk-4POYX4AW.mjs";
299
300
  import {
300
301
  buildContextPackForTurn
301
- } from "./chunk-CORUFGMR.mjs";
302
- import {
303
- maybeCheckpointRunLedger
304
- } from "./chunk-EL6TOIFZ.mjs";
302
+ } from "./chunk-MPGMU75K.mjs";
305
303
  import {
306
304
  renderContextPackStablePrefixForProviderCache
307
305
  } from "./chunk-XL3MUGFG.mjs";
306
+ import {
307
+ maybeCheckpointRunLedger
308
+ } from "./chunk-EL6TOIFZ.mjs";
308
309
  import {
309
310
  updateRunLedger
310
311
  } from "./chunk-4WWT6OC2.mjs";
@@ -3451,6 +3452,12 @@ ${inbound.bodyText}` : inbound.bodyText;
3451
3452
  lastToolName: params.lastToolName ?? lastToolNameForInterruptedTurn,
3452
3453
  error: params.error
3453
3454
  });
3455
+ if (!hasInterruptedTurnRecoveryEvidence(snapshot)) {
3456
+ this.logInfo(
3457
+ `[XKZOOM][turn-timeout][snapshot] skipped session=${session.id} conversationId=${identity.conversationId ?? "none"} userMessage=${userMessage.id} targetMessage=${target.id} assistantMessage=${assistantMessage?.id ?? "none"} turn_timeout_kind=${snapshot.turn_timeout_kind} recoverableEvidence=0 visibleTextLength=${snapshot.visibleTextLength}`
3458
+ );
3459
+ return null;
3460
+ }
3454
3461
  target.interruptedTurn = snapshot;
3455
3462
  this.store.persistMessage(session.id, target.id);
3456
3463
  this.logInfo(
@@ -10,7 +10,7 @@ import {
10
10
  countBatonPlanNodes,
11
11
  filterAgentBatonRelayTargets,
12
12
  resolveBatonIntentFromText
13
- } from "./chunk-BHMWYAVS.mjs";
13
+ } from "./chunk-YYDDQEY4.mjs";
14
14
  import {
15
15
  buildGroupMemberAliases,
16
16
  stripSelfMention,
@@ -3,7 +3,7 @@ import {
3
3
  isOwnedRoutableToolName,
4
4
  resolveOwnedToolMode,
5
5
  routeOwnedToolCall
6
- } from "./chunk-JD5NPIMO.mjs";
6
+ } from "./chunk-5YEFG7BF.mjs";
7
7
  import {
8
8
  resolveOwnedSessionsHistory
9
9
  } from "./chunk-KLQSTA6K.mjs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  isToolUseInputComplete
3
- } from "./chunk-ZM23SMRO.mjs";
3
+ } from "./chunk-GIC2RBVM.mjs";
4
4
  import {
5
5
  OWNED_TURN_TOOL_BY_NAME
6
- } from "./chunk-RTANSWHW.mjs";
6
+ } from "./chunk-3ZH273T7.mjs";
7
7
  import {
8
8
  parseToolUseInput,
9
9
  salvagePartialToolUseInput
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mergeRunningSummary
3
- } from "./chunk-H5TJYSTV.mjs";
3
+ } from "./chunk-MRTQWCNC.mjs";
4
4
 
5
5
  // src/mobile/context-compact/compact-artifact-enrich.ts
6
6
  function normalizeForCompare(text) {
@@ -1,3 +1,6 @@
1
+ import {
2
+ notesSearchTool
3
+ } from "./chunk-77HWNHNA.mjs";
1
4
  import {
2
5
  summarizeTranscriptTool
3
6
  } from "./chunk-4IUL5JAK.mjs";
@@ -8,8 +11,8 @@ import {
8
11
  notesGetTool
9
12
  } from "./chunk-3JF27U3D.mjs";
10
13
  import {
11
- notesSearchTool
12
- } from "./chunk-77HWNHNA.mjs";
14
+ webSearchTool
15
+ } from "./chunk-I23YODIQ.mjs";
13
16
  import {
14
17
  webSmokeTool
15
18
  } from "./chunk-CQUISJWG.mjs";
@@ -18,7 +21,7 @@ import {
18
21
  } from "./chunk-PINXXWFJ.mjs";
19
22
  import {
20
23
  ttsTool
21
- } from "./chunk-JIY7IOQ5.mjs";
24
+ } from "./chunk-DRY7AJMM.mjs";
22
25
  import {
23
26
  videoGenerateTool
24
27
  } from "./chunk-ZW24EQKD.mjs";
@@ -28,9 +31,6 @@ import {
28
31
  import {
29
32
  voiceDesignTool
30
33
  } from "./chunk-DS3VLDJA.mjs";
31
- import {
32
- webSearchTool
33
- } from "./chunk-I23YODIQ.mjs";
34
34
  import {
35
35
  sessionsSendTool
36
36
  } from "./chunk-WXELBVXY.mjs";
@@ -40,6 +40,9 @@ import {
40
40
  import {
41
41
  sessionStatusTool
42
42
  } from "./chunk-5ZMY6RTR.mjs";
43
+ import {
44
+ musicGenerateTool
45
+ } from "./chunk-634RMCSZ.mjs";
43
46
  import {
44
47
  pdfTool
45
48
  } from "./chunk-MJ6DSJJF.mjs";
@@ -51,13 +54,13 @@ import {
51
54
  } from "./chunk-CTKIQWTE.mjs";
52
55
  import {
53
56
  memoryControlTool
54
- } from "./chunk-S7FQBXOO.mjs";
57
+ } from "./chunk-L252ASZW.mjs";
55
58
  import {
56
59
  memoryGetTool
57
60
  } from "./chunk-N2CMVW47.mjs";
58
61
  import {
59
62
  memoryRuntimeEvalTool
60
- } from "./chunk-HR43WO4Q.mjs";
63
+ } from "./chunk-M5IU6U3O.mjs";
61
64
  import {
62
65
  messageTool
63
66
  } from "./chunk-VWAUDB4X.mjs";
@@ -65,8 +68,8 @@ import {
65
68
  modelsListTool
66
69
  } from "./chunk-NRJWLPTI.mjs";
67
70
  import {
68
- musicGenerateTool
69
- } from "./chunk-634RMCSZ.mjs";
71
+ handoffTool
72
+ } from "./chunk-7LEEVP5O.mjs";
70
73
  import {
71
74
  imageGenerateTool
72
75
  } from "./chunk-F4QXCGDQ.mjs";
@@ -76,6 +79,9 @@ import {
76
79
  import {
77
80
  lyricsGenerateTool
78
81
  } from "./chunk-LT2FPTFV.mjs";
82
+ import {
83
+ editTool
84
+ } from "./chunk-IT2GAHAL.mjs";
79
85
  import {
80
86
  execTool
81
87
  } from "./chunk-T6XDJ2QQ.mjs";
@@ -89,44 +95,38 @@ import {
89
95
  sessionsListTool
90
96
  } from "./chunk-VA7SUI2L.mjs";
91
97
  import {
92
- handoffTool
93
- } from "./chunk-T4LPE43H.mjs";
98
+ browserTool
99
+ } from "./chunk-2IZUNNW7.mjs";
100
+ import {
101
+ webFetchTool
102
+ } from "./chunk-UPNUSBKT.mjs";
94
103
  import {
95
104
  ceoConfirmRequirementsTool
96
- } from "./chunk-CNHOCDRM.mjs";
105
+ } from "./chunk-NHICONJ3.mjs";
97
106
  import {
98
107
  ceoDecisionTool
99
- } from "./chunk-5JGUBBXN.mjs";
108
+ } from "./chunk-NIU6GWKB.mjs";
100
109
  import {
101
110
  ceoOpsBriefTool
102
- } from "./chunk-LTBQWMAJ.mjs";
111
+ } from "./chunk-6W4W5JLG.mjs";
103
112
  import {
104
113
  ceoRedirectTool
105
- } from "./chunk-7FLALKSN.mjs";
114
+ } from "./chunk-MQKREMOB.mjs";
106
115
  import {
107
116
  commitStackLessonTool
108
- } from "./chunk-GGWUDW5W.mjs";
117
+ } from "./chunk-IGDJGBAI.mjs";
109
118
  import {
110
119
  contextCompactTool
111
- } from "./chunk-K4RHLREV.mjs";
120
+ } from "./chunk-FG6QCRVN.mjs";
112
121
  import {
113
122
  memorySearchTool
114
123
  } from "./chunk-QWFX5VEN.mjs";
115
124
  import {
116
125
  devToolkitTool
117
126
  } from "./chunk-KJR74IUO.mjs";
118
- import {
119
- editTool
120
- } from "./chunk-IT2GAHAL.mjs";
121
127
  import {
122
128
  agentsListTool
123
129
  } from "./chunk-LBZCBBHU.mjs";
124
- import {
125
- browserTool
126
- } from "./chunk-2IZUNNW7.mjs";
127
- import {
128
- webFetchTool
129
- } from "./chunk-UPNUSBKT.mjs";
130
130
  import {
131
131
  sessionsSpawnTool,
132
132
  subagentsTool
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  NATIVE_TURN_TOOL_CONTRACT_PROMPT,
3
3
  buildRuntimeAvailableToolsBlock
4
- } from "./chunk-W4MKSQGZ.mjs";
4
+ } from "./chunk-K7RZQIPZ.mjs";
5
5
  import {
6
6
  OWNED_REPLY_CHILD_EXTRA_PROMPT,
7
7
  OWNED_REPLY_ORCHESTRATION_TOOL_DENY
@@ -5,16 +5,22 @@ import {
5
5
  import {
6
6
  buildMvpAnthropicToolSchemas,
7
7
  executeAnthropicToolUse
8
- } from "./chunk-QUXUHJZW.mjs";
8
+ } from "./chunk-TADSGGK2.mjs";
9
9
  import {
10
10
  diagnoseToolUseInputReadiness,
11
11
  formatToolInputDiagLine,
12
12
  isExecutableToolUseInput,
13
13
  resolveToolUseInput
14
- } from "./chunk-BSQF7NF4.mjs";
14
+ } from "./chunk-3KJHUTOO.mjs";
15
15
  import {
16
16
  AnthropicIncrementalDeliverer
17
- } from "./chunk-CDLS44GZ.mjs";
17
+ } from "./chunk-76MFE24I.mjs";
18
+ import {
19
+ applyConfiguredMaxTokens,
20
+ fetchNativeProviderWithRetry,
21
+ formatRequestShape,
22
+ stringifyJsonRequestBody
23
+ } from "./chunk-E5LABIPO.mjs";
18
24
  import {
19
25
  selectAnthropicAdapter
20
26
  } from "./chunk-UQLGVSQH.mjs";
@@ -630,15 +636,37 @@ function createFetchAnthropicTurnStreamFn(cfg, log, providerAccelerationPlan, pr
630
636
  toolChoiceLog = `skipped(${policy.kind}:adapter-undefined)`;
631
637
  }
632
638
  }
639
+ applyConfiguredMaxTokens(requestBody, cfg.maxTokens);
640
+ const { bodyText, bodyBytes } = stringifyJsonRequestBody(requestBody);
633
641
  log(
634
- `[XKZOOM][native-reply][anthropic-turn] POST ${url} adapter=${adapter.id} provider=${cfg.providerId} model=${cfg.model} iteration=${req.iteration} tools=${Array.isArray(req.tools) ? req.tools.length : 0} tool_choice=${toolChoiceLog}` + (requestBody.thinking !== void 0 && requestBody.thinking !== null ? ` thinking=${requestBody.thinking.type ?? "1"}` : " thinking=0")
642
+ `[XKZOOM][native-reply][anthropic-turn] POST ${url} adapter=${adapter.id} provider=${cfg.providerId} model=${cfg.model} iteration=${req.iteration} tools=${Array.isArray(req.tools) ? req.tools.length : 0} tool_choice=${toolChoiceLog}` + (requestBody.thinking !== void 0 && requestBody.thinking !== null ? ` thinking=${requestBody.thinking.type ?? "1"}` : " thinking=0") + ` ${formatRequestShape({
643
+ bodyBytes,
644
+ messages: req.messages,
645
+ tools: req.tools,
646
+ maxTokens: requestBody.max_tokens
647
+ })}`
648
+ );
649
+ const res = await fetchNativeProviderWithRetry(
650
+ url,
651
+ {
652
+ method: "POST",
653
+ headers,
654
+ body: bodyText,
655
+ signal
656
+ },
657
+ {
658
+ label: "anthropic-turn",
659
+ providerId: cfg.providerId,
660
+ model: cfg.model,
661
+ adapter: adapter.id,
662
+ iteration: req.iteration,
663
+ bodyBytes,
664
+ messages: req.messages,
665
+ tools: req.tools,
666
+ maxTokens: requestBody.max_tokens,
667
+ log
668
+ }
635
669
  );
636
- const res = await fetch(url, {
637
- method: "POST",
638
- headers,
639
- body: JSON.stringify(requestBody),
640
- signal
641
- });
642
670
  if (!res.ok) {
643
671
  const t = await res.text();
644
672
  throw new Error(`native anthropic-turn HTTP ${res.status}: ${t.slice(0, 500)}`);