@xopcai/xopc 0.0.303 → 0.0.307

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 (431) hide show
  1. package/README.md +4 -4
  2. package/README.zh-CN.md +4 -4
  3. package/dist/browser-ext/dist/assets/{auth-B_9ZuGDx.js → auth-C3yV1y_l.js} +67 -22
  4. package/dist/browser-ext/dist/background.js +4 -4
  5. package/dist/browser-ext/dist/sidepanel.html +1 -1
  6. package/dist/browser-ext/dist/sidepanel.js +3 -3
  7. package/dist/browser-ext/manifest.json +1 -1
  8. package/dist/extensions/feishu/xopc.extension.json +0 -3
  9. package/dist/extensions/telegram/xopc.extension.json +1 -4
  10. package/dist/extensions/weixin/xopc.extension.json +0 -3
  11. package/dist/gateway/static/root/assets/{activity-store-DCi5rh4e.js → activity-store-wgSB2HYK.js} +1 -1
  12. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Ch3DzUvP.js → agent-avatar-dicebear-CZeQo09T.js} +1 -1
  13. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BPsRb9Ck.js +1 -0
  14. package/dist/gateway/static/root/assets/{agents-DXHD-ST3.js → agents-BlrHMbRx.js} +1 -1
  15. package/dist/gateway/static/root/assets/{api-CAV9PN9i.js → api-BKHmTb0w.js} +1 -1
  16. package/dist/gateway/static/root/assets/api-DFOlahZv.js +1 -0
  17. package/dist/gateway/static/root/assets/app-management-settings-panel-Bzw4fQP8.js +1 -0
  18. package/dist/gateway/static/root/assets/appearance-settings-8GZpUXva.js +1 -0
  19. package/dist/gateway/static/root/assets/apps-page-BkQQtIxH.js +1 -0
  20. package/dist/gateway/static/root/assets/{archive-plugin-BKGzaVvM.js → archive-plugin-CQ2NaoHb.js} +1 -1
  21. package/dist/gateway/static/root/assets/{attachment-load-8bARdLnp.js → attachment-load-BFi1H7yJ.js} +1 -1
  22. package/dist/gateway/static/root/assets/{automations-page-BAEenyzx.js → automations-page-CDBXcii_.js} +1 -1
  23. package/dist/gateway/static/root/assets/automations-workspace-CUpiTTiY.js +6 -0
  24. package/dist/gateway/static/root/assets/{binary-plugins-Cv3GS9Eo.js → binary-plugins-D07eWmOx.js} +1 -1
  25. package/dist/gateway/static/root/assets/{block-editor-D4ZIVQbk.css → block-editor-BdOTO0Yo.css} +1 -1
  26. package/dist/gateway/static/root/assets/{block-editor-DUeb92LG.js → block-editor-CtVnjyYU.js} +3 -3
  27. package/dist/gateway/static/root/assets/{browser-automation-inputs-BGT0xoTv.js → browser-automation-inputs-BzkJog8e.js} +1 -1
  28. package/dist/gateway/static/root/assets/{browser-automations-page-D1O22WIf.js → browser-automations-page-DyrSbDdG.js} +2 -2
  29. package/dist/gateway/static/root/assets/browser-settings-page-CqTxLpil.js +3 -0
  30. package/dist/gateway/static/root/assets/button-CS04eWY9.js +1 -0
  31. package/dist/gateway/static/root/assets/capabilities-settings-panel-BZ_-pnS6.js +8 -0
  32. package/dist/gateway/static/root/assets/channels-settings-DAD9qE3J.js +1 -0
  33. package/dist/gateway/static/root/assets/{channels-status-swr-C_icwbWj.js → channels-status-swr-B2JwuTjG.js} +1 -1
  34. package/dist/gateway/static/root/assets/{chat-terminal-dock-D-JYPVYl.js → chat-terminal-dock-B62SZdAo.js} +2 -2
  35. package/dist/gateway/static/root/assets/{computer-settings-page-Bcfp948A.js → computer-settings-page-ClSresNq.js} +1 -1
  36. package/dist/gateway/static/root/assets/connector-service-page-CPqVmNvx.js +1 -0
  37. package/dist/gateway/static/root/assets/connectors-page-BUQyg3CW.js +2 -0
  38. package/dist/gateway/static/root/assets/cron-expression-CTMi_tql.js +2 -0
  39. package/dist/gateway/static/root/assets/date-picker-B71AJK50.js +1 -0
  40. package/dist/gateway/static/root/assets/{dependency-picker-UtoUm57Q.js → dependency-picker-DlyGK-kA.js} +1 -1
  41. package/dist/gateway/static/root/assets/{desktop-pet-Bryx7gRM.js → desktop-pet-DGkbTE8_.js} +1 -1
  42. package/dist/gateway/static/root/assets/desktop-pet-settings-BY8r9j66.js +1 -0
  43. package/dist/gateway/static/root/assets/device-pairing-wizard-DzRrgd59.js +1 -0
  44. package/dist/gateway/static/root/assets/{extension-debug-page-DQlFTVBx.js → extension-debug-page-L8Mm1n3A.js} +1 -1
  45. package/dist/gateway/static/root/assets/{extension-page-BSsqRDXh.js → extension-page-CFc4vSNU.js} +1 -1
  46. package/dist/gateway/static/root/assets/{extension-settings-page-DbVZv9ve.js → extension-settings-page-B5zWyHr3.js} +1 -1
  47. package/dist/gateway/static/root/assets/{gateway-config-swr-D5AM8cyQ.js → gateway-config-swr-B6wHa6ZI.js} +1 -1
  48. package/dist/gateway/static/root/assets/gateway-realtime-B53R0CA4.js +1 -0
  49. package/dist/gateway/static/root/assets/gateway-realtime-store-BLDgrJ30.js +1 -0
  50. package/dist/gateway/static/root/assets/gateway-settings-D7qmTH4R.js +1 -0
  51. package/dist/gateway/static/root/assets/{gateway-startup-retry-CSJWdnFs.js → gateway-startup-retry-DRzGnEV-.js} +1 -1
  52. package/dist/gateway/static/root/assets/{heartbeat-settings-Cxowc29b.js → heartbeat-settings-Glsl3X5b.js} +1 -1
  53. package/dist/gateway/static/root/assets/home-page-s9hDQ8Hc.js +1 -0
  54. package/dist/gateway/static/root/assets/{image-generation-api-BNh604hw.js → image-generation-api-Ck_pyDom.js} +1 -1
  55. package/dist/gateway/static/root/assets/imports-page-ByBX7ome.js +1 -0
  56. package/dist/gateway/static/root/assets/index-RBCkv8a_.js +79 -0
  57. package/dist/gateway/static/root/assets/index-cFU4S35z.css +1 -0
  58. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-C45RlO8a.js +1 -0
  59. package/dist/gateway/static/root/assets/local-app-workbench-page-DP0x2jpR.js +2 -0
  60. package/dist/gateway/static/root/assets/{local-apps-page-CXPaPDGm.js → local-apps-page-C_AQc2bI.js} +1 -1
  61. package/dist/gateway/static/root/assets/{locale-store-DLK05Y1a.js → locale-store-msTfRK8P.js} +1 -1
  62. package/dist/gateway/static/root/assets/logs-page-DvM8Pyok.js +2 -0
  63. package/dist/gateway/static/root/assets/management-settings-D1uwSutV.js +1 -0
  64. package/dist/gateway/static/root/assets/{markdown-view-B8maDRWh.js → markdown-view-BInabSKf.js} +2 -2
  65. package/dist/gateway/static/root/assets/{media-plugins-tSJ0CvcX.js → media-plugins-C4mhf13f.js} +1 -1
  66. package/dist/gateway/static/root/assets/messages-F74LVAiU.js +3 -0
  67. package/dist/gateway/static/root/assets/note-detail-panel-D35sErp2.js +5 -0
  68. package/dist/gateway/static/root/assets/notes-page-8jCDklDn.js +8 -0
  69. package/dist/gateway/static/root/assets/{page-tabs-CQx6H-GS.js → page-tabs-1go_BtX1.js} +1 -1
  70. package/dist/gateway/static/root/assets/{popover-select-DldSX8GX.js → popover-select-9i-ZtHXL.js} +1 -1
  71. package/dist/gateway/static/root/assets/{preview-open-alternatives-A3-bVtdy.js → preview-open-alternatives-DmoSC0j1.js} +1 -1
  72. package/dist/gateway/static/root/assets/{proactive-page-D46cR3sf.js → proactive-page-xAjKTIID.js} +1 -1
  73. package/dist/gateway/static/root/assets/{product-open-page-CujZXOea.js → product-open-page-gmi5LLwM.js} +1 -1
  74. package/dist/gateway/static/root/assets/project-detail-page-BUMQHy_N.js +1 -0
  75. package/dist/gateway/static/root/assets/projects-page-DT-Mt7XR.js +1 -0
  76. package/dist/gateway/static/root/assets/{registry-api-BMFL4vis.js → registry-api-BSWtko7U.js} +1 -1
  77. package/dist/gateway/static/root/assets/remote-access-hub-Clz3byir.js +1 -0
  78. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CR0qvq9C.js → runtime-tools-settings-panel-ClkOoxDl.js} +2 -2
  79. package/dist/gateway/static/root/assets/{schema-form-BUD9lLEE.js → schema-form-BuEmLiaU.js} +1 -1
  80. package/dist/gateway/static/root/assets/sessions-page-tQRwktKm.js +1 -0
  81. package/dist/gateway/static/root/assets/settings-advanced-gate-DqWg9XS5.js +1 -0
  82. package/dist/gateway/static/root/assets/{settings-form-section-BZPCUH6a.js → settings-form-section-Dor39QON.js} +1 -1
  83. package/dist/gateway/static/root/assets/{settings-page-XoHmqIdm.js → settings-page-Xj-yvIc8.js} +1 -1
  84. package/dist/gateway/static/root/assets/setup-status-panel-BB_sMB7P.js +1 -0
  85. package/dist/gateway/static/root/assets/share-preview-page-BFWZoXdm.js +2 -0
  86. package/dist/gateway/static/root/assets/shares-settings-oDALm4b6.js +1 -0
  87. package/dist/gateway/static/root/assets/skill-reload-api-DmwelnfK.js +1 -0
  88. package/dist/gateway/static/root/assets/skills-page-BE9JXz4U.js +2 -0
  89. package/dist/gateway/static/root/assets/{skills-page.utils-CH-quGxZ.js → skills-page.utils-Ii8qeXhs.js} +1 -1
  90. package/dist/gateway/static/root/assets/{system-settings-panel-CGC7eBso.js → system-settings-panel-Di6OSO-0.js} +1 -1
  91. package/dist/gateway/static/root/assets/task-detail-page-D1AWszc7.js +1 -0
  92. package/dist/gateway/static/root/assets/theme-store-1SZ-HFHX.js +1 -0
  93. package/dist/gateway/static/root/assets/tunnel-api-DDOlOYlj.js +1 -0
  94. package/dist/gateway/static/root/assets/{use-autosave-BydB6x2K.js → use-autosave-CQ8uWNnB.js} +1 -1
  95. package/dist/gateway/static/root/assets/user-model-page-C00i4ea0.js +2 -0
  96. package/dist/gateway/static/root/assets/{voice-api-key-field-CPUDBcag.js → voice-api-key-field-COTzshjL.js} +1 -1
  97. package/dist/gateway/static/root/assets/{voice-config-api-bZqN8-UF.js → voice-config-api-DgJML_uM.js} +1 -1
  98. package/dist/gateway/static/root/assets/{work-discovery-overlay-D_FmJbGH.js → work-discovery-overlay-_URrXbi4.js} +1 -1
  99. package/dist/gateway/static/root/assets/workflow-run-setup-panel-CALs-1nd.js +3 -0
  100. package/dist/gateway/static/root/assets/workflows-page-BUiBjz6m.js +6 -0
  101. package/dist/gateway/static/root/channel-icons/feishu.svg +6 -12
  102. package/dist/gateway/static/root/connector-icons/SOURCES.md +12 -0
  103. package/dist/gateway/static/root/connector-icons/dingtalk-mark.svg +1 -0
  104. package/dist/gateway/static/root/connector-icons/tencent-meeting-mark.svg +37 -0
  105. package/dist/gateway/static/root/connector-icons/wps-calendar.svg +14 -0
  106. package/dist/gateway/static/root/connector-icons/wps-docs.svg +14 -0
  107. package/dist/gateway/static/root/connector-icons/wps-mail.svg +7 -0
  108. package/dist/gateway/static/root/index.html +14 -12
  109. package/dist/package.js +1 -1
  110. package/dist/packages/gateway-contract/src/device-pairing.js +100 -7
  111. package/dist/packages/gateway-contract/src/gateway-scopes.js +53 -0
  112. package/dist/packages/gateway-contract/src/index.js +2 -0
  113. package/dist/packages/realtime-client/src/index.js +14 -2
  114. package/dist/packages/realtime-protocol/src/index.js +18 -14
  115. package/dist/src/agent/agent-instance-gateway.d.ts +2 -0
  116. package/dist/src/agent/agent-manager.d.ts +2 -0
  117. package/dist/src/agent/agent-manager.js +40 -12
  118. package/dist/src/agent/agent-scope.d.ts +4 -1
  119. package/dist/src/agent/agent-scope.js +19 -3
  120. package/dist/src/agent/commands/command-isolation.js +11 -9
  121. package/dist/src/agent/commands/command-registry.js +18 -33
  122. package/dist/src/agent/context/audit.js +12 -2
  123. package/dist/src/agent/context/coordinator.d.ts +13 -3
  124. package/dist/src/agent/context/coordinator.js +27 -11
  125. package/dist/src/agent/context/execution-context.js +42 -22
  126. package/dist/src/agent/context/execution-context.types.d.ts +4 -2
  127. package/dist/src/agent/context/execution-scope.d.ts +2 -2
  128. package/dist/src/agent/context/execution-scope.js +1 -1
  129. package/dist/src/agent/context/project-context.d.ts +2 -2
  130. package/dist/src/agent/context/project-context.js +3 -3
  131. package/dist/src/agent/embedded/run-for-session.d.ts +1 -0
  132. package/dist/src/agent/embedded/run-for-session.js +7 -1
  133. package/dist/src/agent/external-tools/composio-provider.js +83 -20
  134. package/dist/src/agent/external-tools/gateway-tools.js +2 -1
  135. package/dist/src/agent/inbound/attachment-pipeline.d.ts +2 -0
  136. package/dist/src/agent/inbound/attachment-pipeline.js +3 -3
  137. package/dist/src/agent/inbound/inbound-loop.js +1 -0
  138. package/dist/src/agent/inbound/turn-dispatcher.js +3 -3
  139. package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
  140. package/dist/src/agent/mcp/mcp-stdio-transport.js +5 -2
  141. package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
  142. package/dist/src/agent/memory/compaction-promotion.js +7 -2
  143. package/dist/src/agent/memory/create-memory-manager.js +1 -0
  144. package/dist/src/agent/memory/manager.d.ts +6 -0
  145. package/dist/src/agent/memory/manager.js +74 -39
  146. package/dist/src/agent/memory/runtime.d.ts +3 -3
  147. package/dist/src/agent/memory/runtime.js +11 -4
  148. package/dist/src/agent/orchestration/agent-orchestrator.js +4 -1
  149. package/dist/src/agent/prompt/cache-boundary.d.ts +2 -0
  150. package/dist/src/agent/prompt/cache-boundary.js +10 -1
  151. package/dist/src/agent/service/build-direct-message-content.d.ts +1 -0
  152. package/dist/src/agent/service/build-direct-message-content.js +2 -1
  153. package/dist/src/agent/service/direct-turn-helpers.js +3 -2
  154. package/dist/src/agent/service/process-direct-streaming.d.ts +3 -1
  155. package/dist/src/agent/service/process-direct-streaming.js +3 -2
  156. package/dist/src/agent/service/webchat-tts.d.ts +0 -4
  157. package/dist/src/agent/service/webchat-tts.js +20 -19
  158. package/dist/src/agent/tools/factory.js +3 -3
  159. package/dist/src/agent/tools/knowledge-memory-tool.d.ts +2 -2
  160. package/dist/src/agent/tools/knowledge-memory-tool.js +7 -7
  161. package/dist/src/browser/native-messaging-host.js +2 -2
  162. package/dist/src/channels/attachments/voice-stt-webchat.d.ts +3 -0
  163. package/dist/src/channels/attachments/voice-stt-webchat.js +22 -9
  164. package/dist/src/cli/commands/agent.js +2 -0
  165. package/dist/src/cli/commands/config.js +8 -9
  166. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  167. package/dist/src/cli/commands/extension-marketplace.js +69 -44
  168. package/dist/src/cli/commands/extension-pack.js +0 -2
  169. package/dist/src/cli/commands/extension.js +4 -25
  170. package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
  171. package/dist/src/cli/commands/onboard/gateway.js +2 -1
  172. package/dist/src/cli/utils/init-workspace-core.js +5 -2
  173. package/dist/src/config/index.js +2 -2
  174. package/dist/src/config/loader.d.ts +1 -0
  175. package/dist/src/config/loader.js +14 -1
  176. package/dist/src/config/schema.d.ts +22 -3
  177. package/dist/src/config/schema.js +13 -3
  178. package/dist/src/connectors/account-access.d.ts +4 -0
  179. package/dist/src/connectors/account-access.js +23 -0
  180. package/dist/src/connectors/approval-resume.d.ts +4 -0
  181. package/dist/src/connectors/approval-resume.js +23 -0
  182. package/dist/src/connectors/auth-provider-registry.d.ts +1 -0
  183. package/dist/src/connectors/auth-provider-registry.js +2 -1
  184. package/dist/src/connectors/authorization-attempts.d.ts +21 -0
  185. package/dist/src/connectors/authorization-attempts.js +33 -0
  186. package/dist/src/connectors/builtin-catalog.js +1 -3
  187. package/dist/src/connectors/catalog.js +2 -1
  188. package/dist/src/connectors/china-catalog.d.ts +2 -0
  189. package/dist/src/connectors/china-catalog.js +430 -0
  190. package/dist/src/connectors/composio-backends.d.ts +26 -0
  191. package/dist/src/connectors/composio-backends.js +65 -0
  192. package/dist/src/connectors/composio-catalog.js +2 -1
  193. package/dist/src/connectors/composio-managed-client.js +3 -1
  194. package/dist/src/connectors/composio-managed-events.js +5 -2
  195. package/dist/src/connectors/composio-session-types.d.ts +2 -0
  196. package/dist/src/connectors/composio-sessions.d.ts +11 -2
  197. package/dist/src/connectors/composio-sessions.js +137 -35
  198. package/dist/src/connectors/composio-triggers.js +4 -2
  199. package/dist/src/connectors/composio.d.ts +11 -8
  200. package/dist/src/connectors/composio.js +68 -84
  201. package/dist/src/connectors/connected-source-ingestion.js +4 -3
  202. package/dist/src/connectors/connection-recovery-service.js +25 -13
  203. package/dist/src/connectors/connector-identity.d.ts +2 -0
  204. package/dist/src/connectors/connector-identity.js +18 -5
  205. package/dist/src/connectors/content-enrichment.js +1 -1
  206. package/dist/src/connectors/instances.js +1 -7
  207. package/dist/src/connectors/learning-coordinator.js +4 -3
  208. package/dist/src/connectors/materialize.js +14 -1
  209. package/dist/src/connectors/policy.d.ts +1 -1
  210. package/dist/src/connectors/policy.js +1 -1
  211. package/dist/src/connectors/principal.js +24 -3
  212. package/dist/src/connectors/providers.d.ts +1 -0
  213. package/dist/src/connectors/providers.js +14 -2
  214. package/dist/src/connectors/runtime-adapter-registry.js +4 -9
  215. package/dist/src/connectors/secret-store.d.ts +4 -1
  216. package/dist/src/connectors/secret-store.js +7 -3
  217. package/dist/src/connectors/source-change-publisher.js +4 -2
  218. package/dist/src/connectors/types.d.ts +16 -11
  219. package/dist/src/connectors/workflow-preflight.d.ts +2 -1
  220. package/dist/src/connectors/workflow-preflight.js +20 -3
  221. package/dist/src/execution-environments/local-worktree-manager.js +17 -15
  222. package/dist/src/execution-environments/store.js +4 -2
  223. package/dist/src/execution-environments/types.d.ts +3 -0
  224. package/dist/src/execution-environments/types.js +2 -1
  225. package/dist/src/execution-environments/worktree-safety.d.ts +8 -0
  226. package/dist/src/execution-environments/worktree-safety.js +43 -0
  227. package/dist/src/extensions/activation-planner.d.ts +1 -1
  228. package/dist/src/extensions/activation-planner.js +1 -1
  229. package/dist/src/extensions/api-version.d.ts +4 -0
  230. package/dist/src/extensions/api-version.js +15 -0
  231. package/dist/src/extensions/api.d.ts +3 -9
  232. package/dist/src/extensions/api.js +26 -32
  233. package/dist/src/extensions/config-validation.d.ts +8 -0
  234. package/dist/src/extensions/config-validation.js +25 -0
  235. package/dist/src/extensions/extension-registry-impl.d.ts +20 -9
  236. package/dist/src/extensions/extension-registry-impl.js +79 -11
  237. package/dist/src/extensions/hooks.d.ts +1 -1
  238. package/dist/src/extensions/index.d.ts +2 -1
  239. package/dist/src/extensions/install-transaction.d.ts +2 -0
  240. package/dist/src/extensions/install-transaction.js +32 -21
  241. package/dist/src/extensions/install.js +18 -1
  242. package/dist/src/extensions/loader.d.ts +5 -5
  243. package/dist/src/extensions/loader.js +109 -47
  244. package/dist/src/extensions/lockfile.d.ts +3 -5
  245. package/dist/src/extensions/lockfile.js +41 -14
  246. package/dist/src/extensions/normalize-manifest.js +6 -60
  247. package/dist/src/extensions/sdk/index.d.ts +3 -2
  248. package/dist/src/extensions/sdk/index.js +2 -2
  249. package/dist/src/extensions/sdk/testing.js +0 -4
  250. package/dist/src/extensions/security.js +5 -7
  251. package/dist/src/extensions/types/core.d.ts +0 -5
  252. package/dist/src/extensions/types/index.d.ts +1 -1
  253. package/dist/src/extensions/types/manifest.d.ts +1 -25
  254. package/dist/src/extensions/types/providers.d.ts +1 -1
  255. package/dist/src/extensions/types/registration.d.ts +0 -12
  256. package/dist/src/extensions/update.js +71 -30
  257. package/dist/src/gateway/heartbeat/service.js +2 -2
  258. package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -1
  259. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +47 -10
  260. package/dist/src/gateway/hono/routes/connectors.js +208 -17
  261. package/dist/src/gateway/hono/routes/context-sources.js +1 -1
  262. package/dist/src/gateway/hono/routes/devices.js +10 -7
  263. package/dist/src/gateway/hono/routes/endpoint-compatibility.js +6 -0
  264. package/dist/src/gateway/hono/routes/extension-gateway.js +0 -33
  265. package/dist/src/gateway/hono/routes/home.js +4 -1
  266. package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -1
  267. package/dist/src/gateway/hono/routes/mcp.js +1 -1
  268. package/dist/src/gateway/hono/routes/realtime.js +30 -8
  269. package/dist/src/gateway/hono/routes/user-model.js +25 -6
  270. package/dist/src/gateway/index.js +4 -1
  271. package/dist/src/gateway/lock.d.ts +2 -0
  272. package/dist/src/gateway/lock.js +31 -14
  273. package/dist/src/gateway/run-loop.js +2 -1
  274. package/dist/src/gateway/security/gateway-scopes.d.ts +2 -5
  275. package/dist/src/gateway/security/gateway-scopes.js +3 -45
  276. package/dist/src/gateway/security/index.js +2 -1
  277. package/dist/src/gateway/service.js +11 -7
  278. package/dist/src/heartbeat/index.js +1 -1
  279. package/dist/src/imports/importService.d.ts +1 -1
  280. package/dist/src/imports/inventory.js +16 -2
  281. package/dist/src/imports/productImport.js +5 -5
  282. package/dist/src/imports/types.d.ts +3 -3
  283. package/dist/src/infra/exec.d.ts +2 -2
  284. package/dist/src/infra/exec.js +32 -27
  285. package/dist/src/infra/run-command.js +15 -50
  286. package/dist/src/infra/update-restart.js +1 -1
  287. package/dist/src/knowledge/connected-knowledge-pipeline.js +13 -3
  288. package/dist/src/knowledge-memory/domain.d.ts +17 -1
  289. package/dist/src/knowledge-memory/index.js +2 -2
  290. package/dist/src/knowledge-memory/repository.d.ts +26 -4
  291. package/dist/src/knowledge-memory/repository.js +171 -36
  292. package/dist/src/mcp/channel-bridge.js +7 -3
  293. package/dist/src/media-understanding/registry.js +6 -1
  294. package/dist/src/migrations/knowledge-memory-read-policy-config.d.ts +2 -0
  295. package/dist/src/migrations/knowledge-memory-read-policy-config.js +48 -0
  296. package/dist/src/migrations/runner.js +2 -1
  297. package/dist/src/proactive/follow-ups.js +2 -1
  298. package/dist/src/process/bounded-output.d.ts +10 -0
  299. package/dist/src/process/bounded-output.js +41 -0
  300. package/dist/src/process/kill-tree.d.ts +6 -17
  301. package/dist/src/process/kill-tree.js +43 -75
  302. package/dist/src/process/process-spec.d.ts +39 -0
  303. package/dist/src/process/process-spec.js +13 -0
  304. package/dist/src/process/run-process.d.ts +4 -0
  305. package/dist/src/process/run-process.js +97 -0
  306. package/dist/src/providers/plugin-registry.d.ts +1 -1
  307. package/dist/src/providers/plugin-registry.js +6 -0
  308. package/dist/src/realtime/runtime.js +3 -1
  309. package/dist/src/session/store.js +1 -1
  310. package/dist/src/storage/sqlite/connection-wait-repository.d.ts +3 -0
  311. package/dist/src/storage/sqlite/connection-wait-repository.js +63 -2
  312. package/dist/src/storage/sqlite/connector-account-repository.d.ts +6 -0
  313. package/dist/src/storage/sqlite/connector-account-repository.js +35 -7
  314. package/dist/src/storage/sqlite/connector-repository.js +15 -10
  315. package/dist/src/storage/sqlite/connector-sync-policy-repository.js +1 -1
  316. package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
  317. package/dist/src/storage/sqlite/index.d.ts +1 -1
  318. package/dist/src/storage/sqlite/index.js +6 -4
  319. package/dist/src/storage/sqlite/migrations/180_execution_environment_ownership.sql +7 -0
  320. package/dist/src/storage/sqlite/migrations/181_knowledge_item_status_events.sql +12 -0
  321. package/dist/src/storage/sqlite/migrations/182_connector_account_policies.sql +92 -0
  322. package/dist/src/storage/sqlite/migrations/183_connector_backend_consistency.sql +20 -0
  323. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  324. package/dist/src/storage/sqlite/migrations/runner.js +7 -7
  325. package/dist/src/storage/sqlite/schema.js +1 -1
  326. package/dist/src/storage/sqlite/schema.sql +13 -0
  327. package/dist/src/storage/sqlite/transcript-repository.d.ts +4 -0
  328. package/dist/src/storage/sqlite/transcript-repository.js +36 -1
  329. package/dist/src/tasks/home-query-service.js +3 -3
  330. package/dist/src/tui/backends/embedded-backend.d.ts +24 -8
  331. package/dist/src/tui/backends/embedded-backend.js +114 -10
  332. package/dist/src/tui/backends/gateway-realtime-backend.d.ts +18 -0
  333. package/dist/src/tui/backends/gateway-realtime-backend.js +31 -4
  334. package/dist/src/tui/components/assistant-message.d.ts +4 -1
  335. package/dist/src/tui/components/assistant-message.js +10 -2
  336. package/dist/src/tui/components/cell-render-mode.d.ts +4 -0
  337. package/dist/src/tui/components/cell-render-mode.js +1 -0
  338. package/dist/src/tui/components/chat-log.d.ts +17 -4
  339. package/dist/src/tui/components/chat-log.js +68 -50
  340. package/dist/src/tui/components/custom-editor.d.ts +2 -2
  341. package/dist/src/tui/components/custom-editor.js +5 -1
  342. package/dist/src/tui/components/pending-input-preview.d.ts +9 -0
  343. package/dist/src/tui/components/pending-input-preview.js +33 -0
  344. package/dist/src/tui/components/semantic-cell.d.ts +17 -0
  345. package/dist/src/tui/components/semantic-cell.js +29 -0
  346. package/dist/src/tui/components/tool-execution.d.ts +5 -1
  347. package/dist/src/tui/components/tool-execution.js +33 -10
  348. package/dist/src/tui/components/transcript-overlay.d.ts +29 -0
  349. package/dist/src/tui/components/transcript-overlay.js +114 -0
  350. package/dist/src/tui/components/tui-bottom-bar.js +3 -1
  351. package/dist/src/tui/components/user-message.d.ts +5 -1
  352. package/dist/src/tui/components/user-message.js +12 -1
  353. package/dist/src/tui/extension-host/load-extensions.d.ts +1 -1
  354. package/dist/src/tui/extension-host/runtime-context.js +2 -1
  355. package/dist/src/tui/extension-host/runtime.d.ts +1 -1
  356. package/dist/src/tui/format-tui-hotkeys.js +8 -1
  357. package/dist/src/tui/tui-agent-events.js +31 -0
  358. package/dist/src/tui/tui-backend.d.ts +23 -11
  359. package/dist/src/tui/tui-backend.js +1 -9
  360. package/dist/src/tui/tui-chat-input-state.d.ts +25 -0
  361. package/dist/src/tui/tui-chat-input-state.js +36 -0
  362. package/dist/src/tui/tui-command-formatters.js +2 -1
  363. package/dist/src/tui/tui-commands.js +1 -1
  364. package/dist/src/tui/tui-startup-resources.js +1 -1
  365. package/dist/src/tui/tui-types.d.ts +2 -1
  366. package/dist/src/tui/tui-types.js +2 -1
  367. package/dist/src/tui/tui.js +122 -30
  368. package/dist/src/tui/xopc-tui-keybindings.d.ts +23 -3
  369. package/dist/src/tui/xopc-tui-keybindings.js +22 -2
  370. package/dist/src/user-context/access-policy.d.ts +2 -2
  371. package/dist/src/user-context/access-policy.js +10 -2
  372. package/dist/src/user-context/config.d.ts +23 -6
  373. package/dist/src/user-context/config.js +54 -7
  374. package/dist/src/voice/platform-streams.js +11 -1
  375. package/dist/src/voice/realtime/omniEngine.js +13 -1
  376. package/dist/src/voice/realtime/runtime.js +2 -1
  377. package/dist/src/voice/tts/audio.js +1 -1
  378. package/dist/src/voice/tts/speech-registry.js +6 -1
  379. package/dist/src/workflows/domain/definition.d.ts +1 -0
  380. package/dist/src/workflows/domain/validation.js +1 -1
  381. package/dist/src/workflows/service/workflow-run-service.js +14 -0
  382. package/dist/src/workflows/service/workflow-session-bridge.d.ts +1 -0
  383. package/dist/src/workflows/service/workflow-session-bridge.js +1 -0
  384. package/package.json +5 -3
  385. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-4oGrNj3m.js +0 -1
  386. package/dist/gateway/static/root/assets/api-fPapljyb.js +0 -1
  387. package/dist/gateway/static/root/assets/app-management-settings-panel-CdXnNtTg.js +0 -1
  388. package/dist/gateway/static/root/assets/appearance-settings-izNAyDhW.js +0 -1
  389. package/dist/gateway/static/root/assets/apps-page-BQb3RCga.js +0 -1
  390. package/dist/gateway/static/root/assets/automations-workspace-5vTl4x0h.js +0 -6
  391. package/dist/gateway/static/root/assets/browser-settings-page-CH9prS-f.js +0 -3
  392. package/dist/gateway/static/root/assets/button-CGlRPNzi.js +0 -1
  393. package/dist/gateway/static/root/assets/capabilities-settings-panel-DMURlZbj.js +0 -8
  394. package/dist/gateway/static/root/assets/channels-settings-CFBS3Yqy.js +0 -1
  395. package/dist/gateway/static/root/assets/connectors-page-DI1c3BMz.js +0 -2
  396. package/dist/gateway/static/root/assets/cron-expression-BJMBFKCh.js +0 -2
  397. package/dist/gateway/static/root/assets/date-picker-BFRIn5y9.js +0 -1
  398. package/dist/gateway/static/root/assets/desktop-pet-settings-DFsyEJUr.js +0 -1
  399. package/dist/gateway/static/root/assets/device-pairing-wizard-C3TQVPRy.js +0 -1
  400. package/dist/gateway/static/root/assets/gateway-settings-DUqVsB3X.js +0 -1
  401. package/dist/gateway/static/root/assets/home-page-CLkumXdN.js +0 -1
  402. package/dist/gateway/static/root/assets/imports-page-DXNfRmk9.js +0 -1
  403. package/dist/gateway/static/root/assets/index-BLRIcVQa.css +0 -1
  404. package/dist/gateway/static/root/assets/index-gheM453N.js +0 -79
  405. package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-5Hcec8Xf.js +0 -1
  406. package/dist/gateway/static/root/assets/local-app-workbench-page-BDg1-fcw.js +0 -2
  407. package/dist/gateway/static/root/assets/logs-page-BWZc5jwO.js +0 -2
  408. package/dist/gateway/static/root/assets/management-settings-COa3PhMs.js +0 -1
  409. package/dist/gateway/static/root/assets/messages-C9h8SImu.js +0 -3
  410. package/dist/gateway/static/root/assets/note-detail-panel-D_YGzNcR.js +0 -5
  411. package/dist/gateway/static/root/assets/notes-page-D1f2oI2-.js +0 -8
  412. package/dist/gateway/static/root/assets/project-detail-page-CRlD_Rwv.js +0 -1
  413. package/dist/gateway/static/root/assets/projects-page-mmX0SavY.js +0 -1
  414. package/dist/gateway/static/root/assets/remote-access-hub-Cqr3K6T5.js +0 -1
  415. package/dist/gateway/static/root/assets/sessions-page-CPkvbdJP.js +0 -1
  416. package/dist/gateway/static/root/assets/settings-advanced-gate-Cu0DAbeH.js +0 -1
  417. package/dist/gateway/static/root/assets/setup-status-panel-D8fQF1jZ.js +0 -1
  418. package/dist/gateway/static/root/assets/share-preview-page-BgHqwTuT.js +0 -2
  419. package/dist/gateway/static/root/assets/shares-settings-Id4vRHzI.js +0 -1
  420. package/dist/gateway/static/root/assets/skill-reload-api-BB2Fj_di.js +0 -1
  421. package/dist/gateway/static/root/assets/skills-page-BAwF4LpS.js +0 -2
  422. package/dist/gateway/static/root/assets/task-detail-page-BVjw812D.js +0 -1
  423. package/dist/gateway/static/root/assets/theme-store-KfFEGMlp.js +0 -1
  424. package/dist/gateway/static/root/assets/tunnel-api-Do98Xk05.js +0 -1
  425. package/dist/gateway/static/root/assets/user-model-page-Nv68a4ak.js +0 -2
  426. package/dist/gateway/static/root/assets/workflow-run-setup-panel-1lZ_btki.js +0 -3
  427. package/dist/gateway/static/root/assets/workflows-page-DFOhccm3.js +0 -6
  428. package/dist/src/extensions/when-context.d.ts +0 -6
  429. package/dist/src/extensions/when-context.js +0 -26
  430. package/dist/src/extensions/when-expression.d.ts +0 -11
  431. package/dist/src/extensions/when-expression.js +0 -213
@@ -1,4 +1,5 @@
1
1
  import { theme } from "../theme.js";
2
+ import { countPendingChatInputs } from "../tui-chat-input-state.js";
2
3
  import { formatContextUsageLabel } from "../tui-context-usage.js";
3
4
  import { getGitBranchCached } from "../tui-git-branch.js";
4
5
  import { formatActiveRunStatus } from "../tui-run-status-format.js";
@@ -95,7 +96,8 @@ var TuiBottomBar = class {
95
96
  if (ctxLabel) leftParts.push(ctxLabel);
96
97
  if (state.isCompacting) leftParts.push("compact…");
97
98
  else if (state.compactionQueue.length > 0) leftParts.push(`C${state.compactionQueue.length}`);
98
- if (state.pendingInputCount > 0) leftParts.push(`Q${state.pendingInputCount}`);
99
+ const pendingInputCount = countPendingChatInputs(state.chatInputState?.inputs ?? []);
100
+ if (pendingInputCount > 0) leftParts.push(`Q${pendingInputCount}`);
99
101
  let statsLeft = leftParts.join(" · ");
100
102
  const modelId = state.sessionInfo.model ?? "unknown";
101
103
  const prov = state.sessionInfo.modelProvider;
@@ -1,8 +1,12 @@
1
1
  import { Container } from '@earendil-works/pi-tui';
2
+ import type { CellRenderMode, ModeAwareCell } from './cell-render-mode.js';
2
3
  export declare function normalizeUserContent(content: string | unknown[]): string;
3
- export declare class UserMessageComponent extends Container {
4
+ export declare class UserMessageComponent extends Container implements ModeAwareCell {
4
5
  private body;
6
+ private content;
7
+ private renderMode;
5
8
  constructor(text: string | unknown[]);
6
9
  setText(text: string | unknown[]): void;
10
+ setRenderMode(mode: CellRenderMode): void;
7
11
  render(width: number): string[];
8
12
  }
@@ -1,5 +1,5 @@
1
1
  import { markdownTheme, theme } from "../theme.js";
2
- import { Box, Container, Markdown } from "@earendil-works/pi-tui";
2
+ import { Box, Container, Markdown, Text } from "@earendil-works/pi-tui";
3
3
  //#region src/tui/components/user-message.ts
4
4
  const OSC133_ZONE_START = "\x1B]133;A\x07";
5
5
  const OSC133_ZONE_END = "\x1B]133;B\x07";
@@ -31,17 +31,28 @@ function normalizeUserContent(content) {
31
31
  }
32
32
  var UserMessageComponent = class extends Container {
33
33
  body;
34
+ content;
35
+ renderMode = "compact";
34
36
  constructor(text) {
35
37
  super();
38
+ this.content = text;
36
39
  this.body = new Markdown(normalizeUserContent(text), 1, 0, markdownTheme, { color: (line) => theme.userText(line) }, { preserveOrderedListMarkers: true });
37
40
  const box = new Box(1, 1, (line) => theme.userBg(line));
38
41
  box.addChild(this.body);
39
42
  this.addChild(box);
40
43
  }
41
44
  setText(text) {
45
+ this.content = text;
42
46
  this.body.setText(normalizeUserContent(text));
43
47
  }
48
+ setRenderMode(mode) {
49
+ this.renderMode = mode;
50
+ }
44
51
  render(width) {
52
+ if (this.renderMode === "raw") return new Text(JSON.stringify({
53
+ role: "user",
54
+ content: this.content
55
+ }, null, 2), 0, 0).render(width);
45
56
  const lines = super.render(width);
46
57
  if (lines.length === 0) return lines;
47
58
  lines[0] = OSC133_ZONE_START + lines[0];
@@ -1,4 +1,4 @@
1
- import type { ExtensionRegistryImpl } from '../../extensions/loader.js';
1
+ import type { ExtensionRegistryImpl } from '../../extensions/extension-registry-impl.js';
2
2
  /** Load activated extensions for embedded TUI (shared registry with AgentService). */
3
3
  export declare function loadExtensionsForTuiLocalMode(runtime?: {
4
4
  setLabel?: (entryId: string, label: string | undefined) => void;
@@ -1,5 +1,6 @@
1
1
  import { getAllModels, getApiKey, init_providers } from "../../providers/index.js";
2
2
  import { theme } from "../theme.js";
3
+ import { countPendingChatInputs } from "../tui-chat-input-state.js";
3
4
  import { computeContextUsagePercent } from "../tui-context-usage.js";
4
5
  //#region src/tui/extension-host/runtime-context.ts
5
6
  init_providers();
@@ -85,7 +86,7 @@ function isTuiIdle(state) {
85
86
  return state.activeRunId == null && !state.isCompacting && !BUSY_ACTIVITY_STATUSES.has(state.activityStatus);
86
87
  }
87
88
  function hasPendingTuiMessages(state) {
88
- return (state.pendingInputCount ?? 0) > 0 || (state.compactionQueue?.length ?? 0) > 0;
89
+ return countPendingChatInputs(state.chatInputState?.inputs ?? []) > 0 || (state.compactionQueue?.length ?? 0) > 0;
89
90
  }
90
91
  function getTuiContextUsage(state) {
91
92
  const sessionInfo = state.sessionInfo;
@@ -1,5 +1,5 @@
1
1
  import { type Component, type AutocompleteItem, type AutocompleteProvider, type KeybindingsManager, type OverlayHandle, type OverlayOptions, type TUI } from '@earendil-works/pi-tui';
2
- import type { ExtensionRegistryImpl } from '../../extensions/loader.js';
2
+ import type { ExtensionRegistryImpl } from '../../extensions/extension-registry-impl.js';
3
3
  import type { TuiAutocompleteSuggestion, TuiCompactOptions, TuiCompactResult, TuiEditorFactory, TuiForkOptions, TuiModelRegistry, TuiNavigateTreeOptions, TuiNewSessionOptions, TuiReasoningLevel, TuiReplacedSessionContext, TuiReplacementResult, TuiReadonlySessionManager, TuiSlashCommandContext, TuiShortcutHandler, TuiSlashCommandHandler, TuiSwitchSessionOptions, TuiSystemPromptOptions, TuiTerminalInputHandler, TuiSetThemeResult, TuiTheme, TuiThemeInfo, TuiThinkingLevel, TuiVerboseLevel, TuiWorkingIndicatorOptions } from '../../extensions/types/tui.js';
4
4
  import type { ChatLog } from '../components/chat-log.js';
5
5
  import type { TuiHeader } from '../components/tui-header.js';
@@ -2,9 +2,16 @@ import { theme } from "./theme.js";
2
2
  import { XOPC_TUI_HOTKEY_ORDER } from "./xopc-tui-keybindings.js";
3
3
  import { getTuiKeybindingsPath } from "./tui-keybindings-file.js";
4
4
  //#region src/tui/format-tui-hotkeys.ts
5
+ const KEY_DISPLAY = {
6
+ up: "↑",
7
+ down: "↓",
8
+ left: "←",
9
+ right: "→"
10
+ };
5
11
  function formatKeyText(key, options = {}) {
6
12
  return key.split("/").map((part) => part.split("+").map((keyPart) => {
7
- const display = process.platform === "darwin" && keyPart.toLowerCase() === "alt" ? "option" : keyPart;
13
+ const normalized = keyPart.toLowerCase();
14
+ const display = KEY_DISPLAY[normalized] ?? (process.platform === "darwin" && normalized === "alt" ? "option" : keyPart);
8
15
  return options.capitalize ? display.charAt(0).toUpperCase() + display.slice(1) : display;
9
16
  }).join("+")).join("/");
10
17
  }
@@ -341,6 +341,37 @@ function dispatchAgentEvent(event, data, state, chatLog, tui, setActivityStatus,
341
341
  tui.requestRender();
342
342
  break;
343
343
  }
344
+ case "task_plan_updated": {
345
+ const lines = (Array.isArray(p.items) ? p.items : []).flatMap((item) => {
346
+ if (!item || typeof item !== "object") return [];
347
+ const record = item;
348
+ const status = typeof record.status === "string" ? record.status : "pending";
349
+ const title = typeof record.title === "string" ? record.title : "";
350
+ return title ? [`[${status}] ${title}`] : [];
351
+ });
352
+ const planId = typeof p.planId === "string" ? p.planId : `${runId}:plan`;
353
+ chatLog.upsertSemanticCell(planId, {
354
+ kind: "plan",
355
+ title: typeof p.explanation === "string" && p.explanation.trim() ? p.explanation : "Execution plan",
356
+ lines,
357
+ raw: p
358
+ });
359
+ tui.requestRender();
360
+ break;
361
+ }
362
+ case "clarify_request": {
363
+ const requestId = typeof p.requestId === "string" ? p.requestId : `${runId}:question`;
364
+ const kind = p.kind === "approval" ? "approval" : "question";
365
+ const choices = Array.isArray(p.choices) ? p.choices.filter((choice) => typeof choice === "string") : [];
366
+ chatLog.upsertSemanticCell(requestId, {
367
+ kind,
368
+ title: typeof p.question === "string" ? p.question : kind === "approval" ? "Approval required" : "Input required",
369
+ lines: choices.map((choice) => `• ${choice}`),
370
+ raw: p
371
+ });
372
+ tui.requestRender();
373
+ break;
374
+ }
344
375
  }
345
376
  }
346
377
  const DEFAULT_STREAMING_WATCHDOG_MS = 3e4;
@@ -3,6 +3,9 @@ import type { SessionTimelineItem } from '../session/transcript-outline.js';
3
3
  import type { ExportFormat } from '../session/types.js';
4
4
  import type { ReviewContext } from '../review/review-git.js';
5
5
  import type { SessionInfo, TuiEventSource } from './tui-types.js';
6
+ import type { TuiChatInputDelivery, TuiChatInputState } from './tui-chat-input-state.js';
7
+ export type { TuiChatInput, TuiChatInputDelivery, TuiChatInputState, TuiChatInputStatus } from './tui-chat-input-state.js';
8
+ export { countPendingChatInputs } from './tui-chat-input-state.js';
6
9
  /** Options for sending a chat message. */
7
10
  export interface ChatSendOptions {
8
11
  conversationId: string;
@@ -120,15 +123,6 @@ export interface TuiStartupResources {
120
123
  workflows: string[];
121
124
  connectors: string[];
122
125
  }
123
- export interface TuiChatInputState {
124
- conversationId: string;
125
- revision: number;
126
- inputs: Array<{
127
- id: string;
128
- status: string;
129
- }>;
130
- }
131
- export declare function countPendingChatInputs(inputs: readonly unknown[]): number;
132
126
  export interface TuiWorkspaceFileSearchEntry {
133
127
  name: string;
134
128
  path: string;
@@ -224,12 +218,30 @@ export interface TuiBackend {
224
218
  submitChatInput(opts: {
225
219
  conversationId: string;
226
220
  message: string;
227
- delivery: 'next' | 'steer';
221
+ delivery: TuiChatInputDelivery;
228
222
  }): Promise<{
229
223
  ok: boolean;
230
- effectiveDelivery?: 'next' | 'steer';
224
+ effectiveDelivery?: TuiChatInputDelivery;
225
+ state?: TuiChatInputState;
231
226
  }>;
232
227
  getChatInputState(conversationId: string): Promise<TuiChatInputState>;
228
+ updateChatInput(opts: {
229
+ conversationId: string;
230
+ inputId: string;
231
+ version: number;
232
+ content: string;
233
+ }): Promise<{
234
+ ok: boolean;
235
+ state?: TuiChatInputState;
236
+ }>;
237
+ removeChatInput(opts: {
238
+ conversationId: string;
239
+ inputId: string;
240
+ version: number;
241
+ }): Promise<{
242
+ ok: boolean;
243
+ state?: TuiChatInputState;
244
+ }>;
233
245
  /** Start a workflow run directly, without routing through the LLM. */
234
246
  startWorkflowRun?(opts: TuiWorkflowRunStartRequest): Promise<TuiWorkflowRunStartResult>;
235
247
  /** Resolve or create the project implied by the TUI launch workspace. */
@@ -1,10 +1,2 @@
1
- //#region src/tui/tui-backend.ts
2
- function countPendingChatInputs(inputs) {
3
- return inputs.filter((input) => {
4
- if (!input || typeof input !== "object") return false;
5
- const status = input.status;
6
- return status === "queued" || status === "interrupted";
7
- }).length;
8
- }
9
- //#endregion
1
+ import { countPendingChatInputs } from "./tui-chat-input-state.js";
10
2
  export { countPendingChatInputs };
@@ -0,0 +1,25 @@
1
+ export type TuiChatInputDelivery = 'next' | 'steer';
2
+ export type TuiChatInputStatus = 'queued' | 'running' | 'injecting' | 'completed' | 'cancelled' | 'failed' | 'interrupted' | 'suspended';
3
+ export interface TuiChatInput {
4
+ id: string;
5
+ content: string;
6
+ requestedDelivery: TuiChatInputDelivery;
7
+ effectiveDelivery: TuiChatInputDelivery;
8
+ status: TuiChatInputStatus;
9
+ version: number;
10
+ position?: number;
11
+ error?: string;
12
+ }
13
+ export interface TuiChatInputState {
14
+ conversationId: string;
15
+ revision: number;
16
+ activeRunId?: string;
17
+ activeInputId?: string;
18
+ inputs: TuiChatInput[];
19
+ }
20
+ export declare function createEmptyChatInputState(conversationId: string): TuiChatInputState;
21
+ export declare function isPendingChatInput(input: TuiChatInput): boolean;
22
+ export declare function countPendingChatInputs(inputs: readonly TuiChatInput[]): number;
23
+ export declare function acceptChatInputState(current: TuiChatInputState, incoming: TuiChatInputState): TuiChatInputState;
24
+ export declare function findLastEditableChatInput(state: TuiChatInputState): TuiChatInput | undefined;
25
+ export declare function commitDeliveredChatInput(state: TuiChatInputState, content: string): TuiChatInputState;
@@ -0,0 +1,36 @@
1
+ //#region src/tui/tui-chat-input-state.ts
2
+ function createEmptyChatInputState(conversationId) {
3
+ return {
4
+ conversationId,
5
+ revision: -1,
6
+ inputs: []
7
+ };
8
+ }
9
+ function isPendingChatInput(input) {
10
+ return input.status === "queued" || input.status === "injecting" || input.status === "interrupted";
11
+ }
12
+ function countPendingChatInputs(inputs) {
13
+ return inputs.filter(isPendingChatInput).length;
14
+ }
15
+ function acceptChatInputState(current, incoming) {
16
+ if (current.conversationId !== incoming.conversationId) return incoming;
17
+ return incoming.revision >= current.revision ? incoming : current;
18
+ }
19
+ function findLastEditableChatInput(state) {
20
+ return state.inputs.filter((input) => input.status === "queued").sort((left, right) => (left.position ?? 0) - (right.position ?? 0)).at(-1);
21
+ }
22
+ function commitDeliveredChatInput(state, content) {
23
+ const normalized = content.trim();
24
+ if (!normalized) return state;
25
+ const matches = (input, status) => input.status === status && input.content.trim() === normalized;
26
+ let index = state.inputs.findIndex((input) => matches(input, "injecting"));
27
+ if (index < 0) index = state.inputs.findIndex((input) => matches(input, "queued"));
28
+ if (index < 0) return state;
29
+ return {
30
+ ...state,
31
+ revision: state.revision + 1,
32
+ inputs: state.inputs.filter((_, inputIndex) => inputIndex !== index)
33
+ };
34
+ }
35
+ //#endregion
36
+ export { acceptChatInputState, commitDeliveredChatInput, countPendingChatInputs, createEmptyChatInputState, findLastEditableChatInput, isPendingChatInput };
@@ -6,6 +6,7 @@ import { getProviderDisplayName, getSortedProviders, init_providers, providerSup
6
6
  import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
7
7
  import { normalizeVerboseLevel } from "../agent/transcript/thinking-types.js";
8
8
  import "../config/index.js";
9
+ import { countPendingChatInputs } from "./tui-chat-input-state.js";
9
10
  import { computeContextUsagePercent, formatContextUsageLabel } from "./tui-context-usage.js";
10
11
  import { formatSessionPickerDescription } from "./tui-session-format.js";
11
12
  import { formatTuiTranscriptTreeEntryDisplayText } from "./tui-transcript-tree.js";
@@ -455,7 +456,7 @@ function formatTuiSessionInfo(state, stats) {
455
456
  `Context: ${contextLabel}`,
456
457
  `Tools: ${state.toolsExpanded ? "expanded" : "collapsed"}`,
457
458
  `Thinking Display: ${state.showThinking ? "on" : "off"}`,
458
- `Pending Inputs: ${state.pendingInputCount}`,
459
+ `Pending Inputs: ${countPendingChatInputs(state.chatInputState?.inputs ?? [])}`,
459
460
  ...formatTuiSessionStatsBlock(stats)
460
461
  ].join("\n");
461
462
  }
@@ -272,7 +272,7 @@ function formatTuiHelpText(isLocal, keybindings, extraSlashCommands = [], skillS
272
272
  const thinkingToggle = keyLabel(keybindings, "app.thinking.toggle", "Ctrl+T");
273
273
  const editorExternal = keyLabel(keybindings, "app.editor.external", "Ctrl+G");
274
274
  const suspend = keyLabel(keybindings, "app.suspend", "Ctrl+Z");
275
- const followUp = keyLabel(keybindings, "app.message.followUp", "Alt+Enter");
275
+ const followUp = keyLabel(keybindings, "app.message.followUp", "Tab");
276
276
  const pasteImage = keyLabel(keybindings, "app.clipboard.pasteImage", "Ctrl+V / Alt+V");
277
277
  const clearInput = keyLabel(keybindings, "app.clear", "Ctrl+C");
278
278
  const exit = keyLabel(keybindings, "app.exit", "Ctrl+D");
@@ -2,10 +2,10 @@ import { resolveStateDir } from "../config/paths-state.js";
2
2
  import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
3
3
  import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
4
4
  import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
5
+ import { listConnectorInstances } from "../connectors/instances.js";
5
6
  import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
6
7
  import { loadSkills } from "../agent/skills/index.js";
7
8
  import { createWorkflowCatalog } from "../agent/workflow/catalog.js";
8
- import { listConnectorInstances } from "../connectors/instances.js";
9
9
  import { getWorkspacePath } from "../config/workspace-path-helpers.js";
10
10
  import "../config/index.js";
11
11
  import { basename } from "node:path";
@@ -1,4 +1,5 @@
1
1
  import type { GatewayCredential } from '../gateway/credential.js';
2
+ import { type TuiChatInputState } from './tui-chat-input-state.js';
2
3
  /** TUI configuration options passed from CLI. */
3
4
  export interface TuiOptions {
4
5
  /** Connect to a running gateway instead of embedded mode. */
@@ -77,7 +78,7 @@ export interface TuiState {
77
78
  /** Last Ctrl+C timestamp for double-press exit (see `resolveCtrlCAction`). */
78
79
  lastCtrlCAt: number;
79
80
  exitRequested: boolean;
80
- pendingInputCount: number;
81
+ chatInputState: TuiChatInputState;
81
82
  /** Ctrl+P cycle filter; `null` = all models from catalog. */
82
83
  scopedModelRefs: string[] | null;
83
84
  /** Last Escape timestamp for double-press actions. */
@@ -1,3 +1,4 @@
1
+ import { createEmptyChatInputState } from "./tui-chat-input-state.js";
1
2
  //#region src/tui/tui-types.ts
2
3
  function createInitialState(conversationId) {
3
4
  return {
@@ -24,7 +25,7 @@ function createInitialState(conversationId) {
24
25
  showThinking: false,
25
26
  lastCtrlCAt: 0,
26
27
  exitRequested: false,
27
- pendingInputCount: 0,
28
+ chatInputState: createEmptyChatInputState(conversationId),
28
29
  scopedModelRefs: null,
29
30
  lastEscapeAt: 0,
30
31
  progressMessage: null,
@@ -21,7 +21,7 @@ import { copyTextToClipboard } from "./clipboard-text.js";
21
21
  import { createXopcTuiKeybindingsManager } from "./tui-keybindings-file.js";
22
22
  import { isActiveRunStreamStale, markActiveRunStalled, markRunRecovering, markRunRecoveryComplete, markRunSending } from "./tui-run-state.js";
23
23
  import { clearSeenStreamEvents, clearSeenStreamEventsForRun, dispatchAgentEvent } from "./tui-agent-events.js";
24
- import { countPendingChatInputs } from "./tui-backend.js";
24
+ import { acceptChatInputState, createEmptyChatInputState, findLastEditableChatInput } from "./tui-chat-input-state.js";
25
25
  import { transcriptTreeEntryIdToRowNumber } from "./tui-transcript-tree.js";
26
26
  import { formatTuiCompactionResult, formatTuiShareResult } from "./tui-command-formatters.js";
27
27
  import { formatTuiStartupText } from "./tui-startup-text.js";
@@ -50,6 +50,8 @@ import { GatewayRealtimeBackend } from "./backends/gateway-realtime-backend.js";
50
50
  import { ChatLog } from "./components/chat-log.js";
51
51
  import { CustomEditor } from "./components/custom-editor.js";
52
52
  import { TuiBottomBar } from "./components/tui-bottom-bar.js";
53
+ import { PendingInputPreview } from "./components/pending-input-preview.js";
54
+ import { TranscriptOverlay } from "./components/transcript-overlay.js";
53
55
  import { TuiHeader } from "./components/tui-header.js";
54
56
  import { loadExtensionsForTuiLocalMode } from "./extension-host/load-extensions.js";
55
57
  import { createTuiExtensionRuntime } from "./extension-host/runtime.js";
@@ -263,6 +265,7 @@ async function runTui(opts) {
263
265
  }), keybindings);
264
266
  const statusContainer = new Container();
265
267
  const bottomBar = new TuiBottomBar(() => state, () => opts.thinking);
268
+ const pendingInputPreview = new PendingInputPreview(() => state.chatInputState, keybindings);
266
269
  const chatLog = new ChatLog(keybindings);
267
270
  chatLog.setViewportRowsProvider(() => Math.max(8, tui.terminal.rows - 8));
268
271
  let startupResources;
@@ -372,6 +375,7 @@ async function runTui(opts) {
372
375
  root.addChild(header);
373
376
  root.addChild(chatLog);
374
377
  root.addChild(statusContainer);
378
+ root.addChild(pendingInputPreview);
375
379
  root.addChild(editorContainer);
376
380
  root.addChild(bottomBar);
377
381
  tui.addChild(root);
@@ -1458,6 +1462,20 @@ async function runTui(opts) {
1458
1462
  })();
1459
1463
  };
1460
1464
  const isAgentBusy = () => state.activeRunId != null || state.isCompacting || busyStates.has(state.activityStatus);
1465
+ let editingQueuedInput;
1466
+ const applyChatInputState = (incoming) => {
1467
+ if (incoming.conversationId !== state.currentConversationId) return;
1468
+ const next = acceptChatInputState(state.chatInputState, incoming);
1469
+ if (next === state.chatInputState) return;
1470
+ state.chatInputState = next;
1471
+ if (editingQueuedInput) {
1472
+ const edited = next.inputs.find((input) => input.id === editingQueuedInput?.id);
1473
+ if (!edited || edited.version !== editingQueuedInput.version) editingQueuedInput = void 0;
1474
+ }
1475
+ pendingInputPreview.invalidate();
1476
+ bottomBar.invalidate();
1477
+ tui.requestRender();
1478
+ };
1461
1479
  const sendSteeringToActiveRun = (text) => {
1462
1480
  touchStreamingActivity();
1463
1481
  tui.requestRender();
@@ -1465,15 +1483,12 @@ async function runTui(opts) {
1465
1483
  conversationId: state.currentConversationId,
1466
1484
  message: text,
1467
1485
  delivery: "steer"
1468
- }).then(({ ok, effectiveDelivery }) => {
1486
+ }).then(({ ok, state: inputState }) => {
1469
1487
  if (!ok) {
1470
1488
  if (!editor.getText().trim()) editor.setText(text);
1471
1489
  chatLog.addSystem(theme.dim(formatSteerUnavailableHint(keybindings)));
1472
- } else {
1473
- chatLog.addUser(text);
1474
- chatLog.addSystem(theme.dim(effectiveDelivery === "steer" ? "Added to this reply." : "Queued as the next message."));
1475
- refreshPendingInputCount();
1476
- }
1490
+ } else if (inputState) applyChatInputState(inputState);
1491
+ else refreshChatInputState();
1477
1492
  tui.requestRender();
1478
1493
  }).catch((error) => {
1479
1494
  if (!editor.getText().trim()) editor.setText(text);
@@ -1831,15 +1846,10 @@ async function runTui(opts) {
1831
1846
  applyComposerHistory(await client.getComposerInputHistory());
1832
1847
  } catch {}
1833
1848
  };
1834
- const refreshPendingInputCount = async (conversationId = state.currentConversationId) => {
1849
+ const refreshChatInputState = async (conversationId = state.currentConversationId) => {
1835
1850
  try {
1836
- const inputState = await client.getChatInputState(conversationId);
1837
- if (state.currentConversationId === conversationId) state.pendingInputCount = countPendingChatInputs(inputState.inputs);
1838
- } catch {
1839
- if (state.currentConversationId === conversationId) state.pendingInputCount = 0;
1840
- }
1841
- bottomBar.invalidate();
1842
- tui.requestRender();
1851
+ applyChatInputState(await client.getChatInputState(conversationId));
1852
+ } catch {}
1843
1853
  };
1844
1854
  const recordChatHistory = (value) => {
1845
1855
  const text = value.trim();
@@ -1879,10 +1889,37 @@ async function runTui(opts) {
1879
1889
  }),
1880
1890
  enabled: shouldEnableWindowsGitBashPasteFallback()
1881
1891
  });
1882
- defaultEditor.onSubmit = submitBurst;
1892
+ const saveEditedQueuedInput = (text) => {
1893
+ const target = editingQueuedInput;
1894
+ if (!target) return false;
1895
+ const content = text.trim();
1896
+ if (!content) return true;
1897
+ const conversationId = state.currentConversationId;
1898
+ client.updateChatInput({
1899
+ conversationId,
1900
+ inputId: target.id,
1901
+ version: target.version,
1902
+ content
1903
+ }).then(({ ok, state: inputState }) => {
1904
+ if (inputState) applyChatInputState(inputState);
1905
+ if (!ok) throw new Error("Queued input changed; refreshed latest state");
1906
+ editingQueuedInput = void 0;
1907
+ if (state.currentConversationId === conversationId && editor.getText().trim() === content) editor.setText("");
1908
+ recordChatHistory(content);
1909
+ tui.requestRender();
1910
+ }).catch((error) => {
1911
+ chatLog.addSystem(theme.dim(`Edit failed: ${error instanceof Error ? error.message : String(error)}`));
1912
+ tui.requestRender();
1913
+ });
1914
+ return true;
1915
+ };
1916
+ defaultEditor.onSubmit = (text) => {
1917
+ if (!saveEditedQueuedInput(text)) submitBurst(text);
1918
+ };
1883
1919
  const handleFollowUp = () => {
1884
1920
  const text = editor.getText().trim();
1885
1921
  if (!text && pendingImageAttachments.length === 0) return;
1922
+ if (saveEditedQueuedInput(text)) return;
1886
1923
  if (isAgentBusy()) {
1887
1924
  if (pendingImageAttachments.length > 0) {
1888
1925
  chatLog.addSystem(theme.dim("Image attachments cannot be queued while the agent is busy. Wait for this reply to finish, then send."));
@@ -1894,12 +1931,12 @@ async function runTui(opts) {
1894
1931
  conversationId,
1895
1932
  message: text,
1896
1933
  delivery: "next"
1897
- }).then(async ({ ok }) => {
1934
+ }).then(({ ok, state: inputState }) => {
1898
1935
  if (!ok) throw new Error("Gateway did not accept the message");
1899
1936
  recordChatHistory(text);
1900
1937
  if (state.currentConversationId === conversationId && editor.getText().trim() === text) editor.setText("");
1901
- chatLog.addSystem(theme.dim("Queued as the next message."));
1902
- await refreshPendingInputCount(conversationId);
1938
+ if (inputState) applyChatInputState(inputState);
1939
+ else refreshChatInputState(conversationId);
1903
1940
  }).catch((error) => {
1904
1941
  const errorMessage = error instanceof Error ? error.message : String(error);
1905
1942
  chatLog.addSystem(theme.dim(`Queue failed: ${errorMessage}`));
@@ -1911,8 +1948,9 @@ async function runTui(opts) {
1911
1948
  };
1912
1949
  const setConversationId = (key) => {
1913
1950
  state.currentConversationId = resolveConversationId(key);
1914
- state.pendingInputCount = 0;
1915
- refreshPendingInputCount(state.currentConversationId);
1951
+ state.chatInputState = createEmptyChatInputState(state.currentConversationId);
1952
+ editingQueuedInput = void 0;
1953
+ refreshChatInputState(state.currentConversationId);
1916
1954
  updateAgentFromPicker(key);
1917
1955
  };
1918
1956
  const updateAgentFromPicker = (key) => {
@@ -2105,6 +2143,66 @@ async function runTui(opts) {
2105
2143
  })();
2106
2144
  };
2107
2145
  defaultEditor.onAction("app.message.followUp", handleFollowUp);
2146
+ defaultEditor.onAction("app.message.editQueued", () => {
2147
+ if (editor.getText().length > 0) return false;
2148
+ const target = findLastEditableChatInput(state.chatInputState);
2149
+ if (!target) return false;
2150
+ editingQueuedInput = {
2151
+ id: target.id,
2152
+ version: target.version
2153
+ };
2154
+ editor.setText(target.content);
2155
+ tui.requestRender();
2156
+ return true;
2157
+ });
2158
+ defaultEditor.onAction("app.message.deleteQueued", () => {
2159
+ const target = findLastEditableChatInput(state.chatInputState);
2160
+ if (!target) return false;
2161
+ const conversationId = state.currentConversationId;
2162
+ client.removeChatInput({
2163
+ conversationId,
2164
+ inputId: target.id,
2165
+ version: target.version
2166
+ }).then(({ ok, state: inputState }) => {
2167
+ if (inputState) applyChatInputState(inputState);
2168
+ if (!ok) throw new Error("Queued input changed; refreshed latest state");
2169
+ if (editingQueuedInput?.id === target.id) editingQueuedInput = void 0;
2170
+ tui.requestRender();
2171
+ }).catch((error) => {
2172
+ chatLog.addSystem(theme.dim(`Delete failed: ${error instanceof Error ? error.message : String(error)}`));
2173
+ tui.requestRender();
2174
+ });
2175
+ return true;
2176
+ });
2177
+ const openTranscriptOverlay = (initialMode) => {
2178
+ if (!client.loadHistoryWindow) {
2179
+ chatLog.addSystem("Transcript paging is unavailable for this backend.");
2180
+ tui.requestRender();
2181
+ return;
2182
+ }
2183
+ let close = () => {};
2184
+ const overlay = new TranscriptOverlay({
2185
+ keybindings,
2186
+ initialMode,
2187
+ viewportRows: () => tui.terminal.rows,
2188
+ onClose: () => close(),
2189
+ onRender: () => tui.requestRender(),
2190
+ loadWindow: (rowNumber) => client.loadHistoryWindow({
2191
+ conversationId: state.currentConversationId,
2192
+ rowNumber,
2193
+ before: 120,
2194
+ after: 0
2195
+ })
2196
+ });
2197
+ close = openEditorSelector(overlay, overlay);
2198
+ overlay.initialize().catch((error) => {
2199
+ close();
2200
+ chatLog.addSystem(`Transcript failed: ${error instanceof Error ? error.message : String(error)}`);
2201
+ tui.requestRender();
2202
+ });
2203
+ };
2204
+ defaultEditor.onAction("app.transcript.open", () => openTranscriptOverlay("transcript"));
2205
+ defaultEditor.onAction("app.transcript.raw", () => openTranscriptOverlay("raw"));
2108
2206
  streamWatchdogId = setInterval(() => {
2109
2207
  const now = Date.now();
2110
2208
  if (!isActiveRunStreamStale(state, now, 3e4)) return;
@@ -2141,11 +2239,7 @@ async function runTui(opts) {
2141
2239
  client.onEvent = (evt) => {
2142
2240
  const data = evt.data ?? {};
2143
2241
  if (evt.event === "session.input-state") {
2144
- if (data.conversationId === state.currentConversationId && Array.isArray(data.inputs)) {
2145
- state.pendingInputCount = countPendingChatInputs(data.inputs);
2146
- bottomBar.invalidate();
2147
- tui.requestRender();
2148
- }
2242
+ if (data.conversationId === state.currentConversationId && Array.isArray(data.inputs) && typeof data.revision === "number") applyChatInputState(data);
2149
2243
  return;
2150
2244
  }
2151
2245
  if (evt.event === "composer-history.appended") {
@@ -2216,10 +2310,8 @@ async function runTui(opts) {
2216
2310
  await refreshSessionInfoWithBorder();
2217
2311
  persistCurrentNewSessionContext();
2218
2312
  try {
2219
- state.pendingInputCount = countPendingChatInputs((await client.getChatInputState(state.currentConversationId)).inputs);
2220
- } catch {
2221
- state.pendingInputCount = 0;
2222
- }
2313
+ applyChatInputState(await client.getChatInputState(state.currentConversationId));
2314
+ } catch {}
2223
2315
  await refreshModelChoices();
2224
2316
  await loadSessionHistory({ merge: true });
2225
2317
  cleanupAbandonedTuiSessions(client, state.currentConversationId).catch(() => {});