shortcutxl 0.3.53 → 0.3.55

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 (311) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/agent-docs/docs/development.md +5 -5
  3. package/agent-docs/docs/extensions.md +4 -4
  4. package/agent-docs/docs/packages.md +3 -3
  5. package/agent-docs/docs/skills.md +2 -2
  6. package/agent-docs/docs/tui.md +4 -4
  7. package/agent-docs/examples/extensions/custom-provider-anthropic/index.ts +1 -1
  8. package/agent-docs/examples/extensions/custom-provider-gitlab-duo/test.ts +4 -4
  9. package/agent-docs/examples/extensions/sandbox/index.ts +1 -1
  10. package/agent-docs/examples/extensions/with-deps/index.ts +1 -1
  11. package/agent-docs/examples/rpc-extension-ui.ts +1 -1
  12. package/agent-docs/examples/sdk/08-prompt-templates.ts +3 -3
  13. package/agent-docs/examples/sdk/README.md +1 -1
  14. package/dist/app/agent-session.d.ts +1 -0
  15. package/dist/app/agent-session.js +66 -20
  16. package/dist/app/collab/collab-sync.js +4 -14
  17. package/dist/app/index.d.ts +2 -2
  18. package/dist/app/index.js +1 -1
  19. package/dist/app/modes/action/agent.js +1 -2
  20. package/dist/app/modes/action/prompt.js +4 -0
  21. package/dist/app/modes/manage/agent.js +2 -2
  22. package/dist/app/modes/manage/prompt.js +8 -1
  23. package/dist/app/mog-command.d.ts +13 -0
  24. package/dist/app/mog-command.js +29 -0
  25. package/dist/app/new-sheet/mutation-tracker.js +14 -0
  26. package/dist/app/new-sheet/sdk-types.d.ts +1 -0
  27. package/dist/app/new-sheet/sdk-types.js +22 -2
  28. package/dist/app/observability/client-logging/client-logger.d.ts +4 -1
  29. package/dist/app/observability/client-logging/client-logger.js +7 -0
  30. package/dist/app/observability/client-logging/context.d.ts +5 -1
  31. package/dist/app/observability/client-logging/context.js +45 -0
  32. package/dist/app/observability/client-logging/index.d.ts +3 -2
  33. package/dist/app/observability/client-logging/index.js +2 -1
  34. package/dist/app/observability/client-logging/telemetry-policy.d.ts +5 -0
  35. package/dist/app/observability/client-logging/telemetry-policy.js +8 -0
  36. package/dist/app/observability/client-logging/types.d.ts +13 -0
  37. package/dist/app/prompts/com-api-reference.json +215 -146
  38. package/dist/app/prompts/mog-api-reference.json +11968 -5753
  39. package/dist/app/prompts/spreadjs-api-reference.json +1 -1
  40. package/dist/app/providers/llm-usage.js +2 -1
  41. package/dist/app/providers/shortcut-invoke.js +4 -0
  42. package/dist/app/providers/shortcut-stream.js +3 -0
  43. package/dist/app/resources/package-manager.d.ts +1 -1
  44. package/dist/app/resources/package-manager.js +8 -8
  45. package/dist/app/services/user-context.d.ts +14 -4
  46. package/dist/app/services/user-context.js +34 -6
  47. package/dist/app/session/run-agent-observability.d.ts +38 -0
  48. package/dist/app/session/run-agent-observability.js +49 -0
  49. package/dist/app/settings-manager.d.ts +2 -22
  50. package/dist/app/settings-manager.js +0 -16
  51. package/dist/app/sync/remote-skill-files.d.ts +24 -0
  52. package/dist/app/sync/remote-skill-files.js +73 -0
  53. package/dist/app/sync/skills-download.d.ts +1 -1
  54. package/dist/app/sync/skills-download.js +29 -44
  55. package/dist/app/sync/skills-status.d.ts +1 -1
  56. package/dist/app/sync/skills-status.js +25 -40
  57. package/dist/app/sync/skills-upload.d.ts +2 -1
  58. package/dist/app/sync/skills-upload.js +14 -41
  59. package/dist/app/sync/storage-client.d.ts +5 -2
  60. package/dist/app/sync/storage-client.js +14 -6
  61. package/dist/app/tools/index.d.ts +0 -1
  62. package/dist/app/tools/index.js +0 -1
  63. package/dist/app/tools/refresh-context.d.ts +1 -1
  64. package/dist/cli.js +1453 -1531
  65. package/dist/config.d.ts +1 -0
  66. package/dist/config.js +6 -3
  67. package/dist/contracts/agent-api.d.ts +31 -1
  68. package/dist/contracts/agent-api.js +35 -2
  69. package/dist/contracts/agent-execute-code.d.ts +7 -3
  70. package/dist/contracts/agent-execute-code.js +7 -3
  71. package/dist/contracts/agent-session-store.d.ts +1 -0
  72. package/dist/contracts/agent-settings.d.ts +6 -11
  73. package/dist/contracts/cancel-or-fail.d.ts +27 -0
  74. package/dist/contracts/cancel-or-fail.js +27 -0
  75. package/dist/contracts/host-tool-api.d.ts +2 -1
  76. package/dist/contracts/host-tool-api.js +2 -1
  77. package/dist/contracts/host-tool-registry.js +24 -2
  78. package/dist/contracts/host-tool.d.ts +69 -4
  79. package/dist/contracts/host-tool.js +48 -4
  80. package/dist/contracts/model-call.d.ts +183 -0
  81. package/dist/contracts/model-call.js +115 -0
  82. package/dist/contracts/model-stream.d.ts +100 -1
  83. package/dist/contracts/model-stream.js +120 -2
  84. package/dist/contracts/wire.d.ts +39 -2
  85. package/dist/contracts/wire.js +43 -2
  86. package/dist/core/agent-engine.d.ts +2 -1
  87. package/dist/core/agent-engine.js +1 -2
  88. package/dist/core/agent-loop.js +152 -11
  89. package/dist/core/agent-state-reducer.js +2 -2
  90. package/dist/core/core-types.d.ts +20 -1
  91. package/dist/core/core-types.js +7 -0
  92. package/dist/core/error-classification.d.ts +1 -0
  93. package/dist/core/error-classification.js +25 -1
  94. package/dist/core/pending-host-tool-requests.d.ts +1 -1
  95. package/dist/core/pending-host-tool-requests.js +2 -7
  96. package/dist/core/session/compaction/compaction.d.ts +2 -9
  97. package/dist/core/session/compaction/compaction.js +13 -13
  98. package/dist/core/session/compaction/constants.d.ts +10 -0
  99. package/dist/core/session/compaction/constants.js +17 -0
  100. package/dist/core/session/compaction/index.d.ts +1 -0
  101. package/dist/core/session/compaction/index.js +1 -0
  102. package/dist/core/session/compaction-bridge.d.ts +12 -15
  103. package/dist/core/session/compaction-bridge.js +9 -8
  104. package/dist/core/session/context-overflow.d.ts +10 -0
  105. package/dist/core/session/context-overflow.js +42 -0
  106. package/dist/core/session/session-compaction.d.ts +34 -6
  107. package/dist/core/session/session-compaction.js +129 -35
  108. package/dist/{app → core}/session/session-error-recovery.d.ts +29 -14
  109. package/dist/{app → core}/session/session-error-recovery.js +84 -13
  110. package/dist/core/session-schema.d.ts +1 -0
  111. package/dist/embedded-agent/anthropic-messages-transport.d.ts +34 -0
  112. package/dist/embedded-agent/anthropic-messages-transport.js +1015 -0
  113. package/dist/embedded-agent/bootstrap.js +1 -7
  114. package/dist/embedded-agent/compaction-wiring.d.ts +1 -6
  115. package/dist/embedded-agent/compaction-wiring.js +15 -10
  116. package/dist/embedded-agent/compose.js +332 -60
  117. package/dist/embedded-agent/credit-gate.d.ts +4 -3
  118. package/dist/embedded-agent/credit-gate.js +8 -2
  119. package/dist/embedded-agent/host-runtime-options.d.ts +3 -2
  120. package/dist/embedded-agent/host-runtime-options.js +25 -9
  121. package/dist/embedded-agent/host-tools/build-tool-list.d.ts +6 -9
  122. package/dist/embedded-agent/host-tools/build-tool-list.js +39 -24
  123. package/dist/embedded-agent/host-tools/create-website/contract.js +23 -10
  124. package/dist/embedded-agent/host-tools/execute-bash-command/contract.js +24 -14
  125. package/dist/embedded-agent/host-tools/execute-code/allowed-functions.json +1 -1
  126. package/dist/embedded-agent/host-tools/execute-code/contract.d.ts +6 -0
  127. package/dist/embedded-agent/host-tools/execute-code/contract.js +41 -25
  128. package/dist/embedded-agent/host-tools/execute-code/read-only-gate.js +4 -3
  129. package/dist/embedded-agent/host-tools/execute-tool/contract.js +25 -7
  130. package/dist/embedded-agent/host-tools/get-tool-info/contract.js +16 -4
  131. package/dist/embedded-agent/host-tools/index.d.ts +1 -1
  132. package/dist/embedded-agent/host-tools/index.js +1 -1
  133. package/dist/embedded-agent/host-tools/invoke-llm/contract.d.ts +1 -1
  134. package/dist/embedded-agent/host-tools/invoke-llm/contract.js +3 -3
  135. package/dist/embedded-agent/host-tools/mode-host-tools.d.ts +4 -7
  136. package/dist/embedded-agent/host-tools/mode-host-tools.js +18 -5
  137. package/dist/embedded-agent/host-tools/refresh-context/contract.d.ts +29 -0
  138. package/dist/embedded-agent/host-tools/refresh-context/contract.js +74 -0
  139. package/dist/embedded-agent/host-tools/refresh-context/index.d.ts +3 -0
  140. package/dist/embedded-agent/host-tools/refresh-context/index.js +3 -0
  141. package/dist/embedded-agent/host-tools/registry.d.ts +4 -4
  142. package/dist/embedded-agent/host-tools/registry.js +2 -4
  143. package/dist/embedded-agent/host-tools/request-credential/contract.js +53 -45
  144. package/dist/embedded-agent/host-tools/request-oauth/contract.d.ts +1 -3
  145. package/dist/embedded-agent/host-tools/request-oauth/contract.js +44 -38
  146. package/dist/embedded-agent/host-tools/sandbox-llm/contract.d.ts +2 -2
  147. package/dist/embedded-agent/host-tools/sandbox-llm/contract.js +29 -12
  148. package/dist/embedded-agent/host-tools/shared/index.d.ts +2 -1
  149. package/dist/embedded-agent/host-tools/shared/index.js +1 -1
  150. package/dist/embedded-agent/host-tools/shared/llm-stream.d.ts +14 -2
  151. package/dist/embedded-agent/host-tools/shared/llm-stream.js +40 -12
  152. package/dist/embedded-agent/host-tools/shared/multimodal.d.ts +9 -1
  153. package/dist/embedded-agent/host-tools/shared/multimodal.js +34 -1
  154. package/dist/embedded-agent/host-tools/switch-mode/contract.d.ts +3 -3
  155. package/dist/embedded-agent/host-tools/switch-mode/contract.js +32 -32
  156. package/dist/embedded-agent/host-tools/take-screenshot/contract.d.ts +2 -1
  157. package/dist/embedded-agent/host-tools/take-screenshot/contract.js +29 -13
  158. package/dist/embedded-agent/host-tools/task/agent-definition.d.ts +2 -0
  159. package/dist/embedded-agent/host-tools/task/agents/clone.d.ts +9 -0
  160. package/dist/embedded-agent/host-tools/task/agents/clone.js +42 -0
  161. package/dist/embedded-agent/host-tools/task/agents/document-reader.js +6 -5
  162. package/dist/embedded-agent/host-tools/task/agents/general.js +5 -7
  163. package/dist/embedded-agent/host-tools/task/agents/index.js +2 -0
  164. package/dist/embedded-agent/host-tools/task/contract.d.ts +9 -6
  165. package/dist/embedded-agent/host-tools/task/contract.js +50 -67
  166. package/dist/embedded-agent/host-tools/task/index.d.ts +1 -1
  167. package/dist/embedded-agent/host-tools/task/index.js +1 -1
  168. package/dist/embedded-agent/host-tools/task/run-subagent.d.ts +2 -0
  169. package/dist/embedded-agent/host-tools/task/run-subagent.js +1 -0
  170. package/dist/embedded-agent/host-tools/timeouts.d.ts +17 -1
  171. package/dist/embedded-agent/host-tools/timeouts.js +40 -2
  172. package/dist/embedded-agent/host-tools/tool-names.d.ts +1 -1
  173. package/dist/embedded-agent/host-tools/tool-names.js +1 -1
  174. package/dist/embedded-agent/host-tools/web-crawl/contract.js +29 -9
  175. package/dist/embedded-agent/host-tools/web-search/contract.d.ts +8 -1
  176. package/dist/embedded-agent/host-tools/web-search/contract.js +37 -9
  177. package/dist/embedded-agent/index.d.ts +18 -3
  178. package/dist/embedded-agent/index.js +3 -0
  179. package/dist/embedded-agent/model-call-orchestrator.d.ts +22 -0
  180. package/dist/embedded-agent/model-call-orchestrator.js +22 -0
  181. package/dist/embedded-agent/model-registry.d.ts +2 -1
  182. package/dist/embedded-agent/model-registry.js +29 -1
  183. package/dist/embedded-agent/openai-completions-transport.d.ts +24 -0
  184. package/dist/embedded-agent/openai-completions-transport.js +261 -0
  185. package/dist/embedded-agent/openai-responses-transport.d.ts +24 -0
  186. package/dist/embedded-agent/openai-responses-transport.js +266 -0
  187. package/dist/embedded-agent/pi-ai-invoke.d.ts +51 -0
  188. package/dist/embedded-agent/pi-ai-invoke.js +385 -0
  189. package/dist/embedded-agent/prompt/api-reference.d.ts +3 -2
  190. package/dist/embedded-agent/prompt/api-reference.js +17 -1
  191. package/dist/embedded-agent/prompt/build.d.ts +3 -6
  192. package/dist/embedded-agent/prompt/build.js +48 -36
  193. package/dist/embedded-agent/prompt/modes/action.d.ts +3 -3
  194. package/dist/embedded-agent/prompt/modes/action.js +8 -21
  195. package/dist/embedded-agent/prompt/modes/ask.d.ts +3 -2
  196. package/dist/embedded-agent/prompt/modes/ask.js +3 -6
  197. package/dist/embedded-agent/prompt/modes/manage.d.ts +7 -0
  198. package/dist/embedded-agent/prompt/modes/manage.js +77 -0
  199. package/dist/embedded-agent/prompt/modes/plan.d.ts +2 -2
  200. package/dist/embedded-agent/prompt/modes/plan.js +2 -2
  201. package/dist/embedded-agent/prompt/modes/review.d.ts +1 -1
  202. package/dist/embedded-agent/prompt/modes/review.js +1 -1
  203. package/dist/embedded-agent/prompt/modes/shorty.d.ts +2 -1
  204. package/dist/embedded-agent/prompt/modes/shorty.js +1 -4
  205. package/dist/embedded-agent/prompt/sections.d.ts +7 -13
  206. package/dist/embedded-agent/prompt/sections.js +87 -99
  207. package/dist/embedded-agent/recovery-wiring.d.ts +31 -0
  208. package/dist/embedded-agent/recovery-wiring.js +82 -0
  209. package/dist/embedded-agent/settings.d.ts +18 -0
  210. package/dist/embedded-agent/settings.js +2 -0
  211. package/dist/embedded-agent/stream-errors.d.ts +10 -0
  212. package/dist/embedded-agent/stream-errors.js +53 -0
  213. package/dist/embedded-agent/stream-events.js +5 -1
  214. package/dist/embedded-agent/stream-message-state.d.ts +14 -0
  215. package/dist/embedded-agent/stream-message-state.js +271 -0
  216. package/dist/embedded-agent/stream-sse.d.ts +78 -0
  217. package/dist/embedded-agent/stream-sse.js +73 -0
  218. package/dist/embedded-agent/stream.d.ts +30 -1
  219. package/dist/embedded-agent/stream.js +309 -330
  220. package/dist/embedded-agent/suggestions.js +68 -43
  221. package/dist/embedded-agent/turn-lifecycle.d.ts +40 -0
  222. package/dist/embedded-agent/turn-lifecycle.js +85 -0
  223. package/dist/embedded-agent/worker-bridge/dispatch.js +2 -11
  224. package/dist/embedded-agent/worker-bridge/host-client.d.ts +3 -3
  225. package/dist/embedded-agent/worker-bridge/host-client.js +19 -26
  226. package/dist/endpoints.d.ts +4 -0
  227. package/dist/endpoints.js +4 -0
  228. package/dist/main.d.ts +3 -1
  229. package/dist/main.js +119 -53
  230. package/dist/remote-control/whatsapp/transport.d.ts +35 -1
  231. package/dist/remote-control/whatsapp/transport.js +3 -2
  232. package/dist/shared/images/photon.d.ts +1 -1
  233. package/dist/shared/images/photon.js +1 -1
  234. package/dist/shell/components/selectors/port-skills-selector.js +1 -1
  235. package/dist/shell/components/selectors/skills-selector.js +1 -1
  236. package/dist/shell/export-html/session-view-model.d.ts +1 -0
  237. package/dist/shell/index.d.ts +0 -1
  238. package/dist/shell/index.js +0 -1
  239. package/dist/shell/interactive/interactive-mode.js +11 -4
  240. package/dist/shell/tools/presentation/registry.js +1 -8
  241. package/dist/startup/interactive-commands.d.ts +1 -1
  242. package/dist/startup/interactive-commands.js +29 -8
  243. package/dist/startup/runtime-routing.d.ts +6 -2
  244. package/dist/startup/runtime-routing.js +6 -5
  245. package/dist/startup/sync-xll.d.ts +1 -1
  246. package/dist/startup/sync-xll.js +1 -1
  247. package/dist/startup/update-flow.d.ts +20 -0
  248. package/dist/startup/update-flow.js +22 -0
  249. package/dist/startup/update-manager.d.ts +1 -1
  250. package/dist/startup/update-prompt.d.ts +2 -1
  251. package/dist/startup/update-prompt.js +1 -1
  252. package/dist/tool-names.d.ts +0 -1
  253. package/dist/tool-names.js +0 -1
  254. package/dist/tui/tui.js +9 -0
  255. package/dist/utils/string.d.ts +3 -0
  256. package/dist/utils/string.js +8 -0
  257. package/package.json +30 -18
  258. package/skills/advanced-mog-api/api-reference.json +14808 -9291
  259. package/skills/external-services/connections.md +2 -2
  260. package/skills/external-services/gws.md +1 -1
  261. package/skills/mcp/SKILL.md +4 -4
  262. package/user-docs/dist/index.html +4 -4
  263. package/user-docs/dist/shortcutxl-docs.pdf +0 -0
  264. package/xll/ShortcutXL.xll +0 -0
  265. package/xll/python/Lib/site-packages/certifi/__init__.py +1 -1
  266. package/xll/python/Lib/site-packages/certifi/cacert.pem +0 -41
  267. package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/METADATA +1 -1
  268. package/xll/python/Lib/site-packages/certifi-2026.5.20.dist-info/RECORD +14 -0
  269. package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
  270. package/xll/python/Lib/site-packages/idna/__main__.py +6 -0
  271. package/xll/python/Lib/site-packages/idna/cli.py +128 -0
  272. package/xll/python/Lib/site-packages/idna/codec.py +50 -13
  273. package/xll/python/Lib/site-packages/idna/compat.py +26 -0
  274. package/xll/python/Lib/site-packages/idna/core.py +284 -119
  275. package/xll/python/Lib/site-packages/idna/idnadata.py +3 -4
  276. package/xll/python/Lib/site-packages/idna/intranges.py +5 -7
  277. package/xll/python/Lib/site-packages/idna/package_data.py +1 -1
  278. package/xll/python/Lib/site-packages/idna/uts46data.py +2 -3
  279. package/xll/python/Lib/site-packages/idna-3.16.dist-info/METADATA +164 -0
  280. package/xll/python/Lib/site-packages/idna-3.16.dist-info/RECORD +28 -0
  281. package/xll/python/Lib/site-packages/idna-3.16.dist-info/entry_points.txt +3 -0
  282. package/xll/python/Lib/site-packages/pip-26.1.1.dist-info/RECORD +3 -3
  283. package/xll/python/Scripts/httpx.exe +0 -0
  284. package/xll/python/Scripts/idna.exe +0 -0
  285. package/xll/python/Scripts/pip.exe +0 -0
  286. package/xll/python/Scripts/pip3.12.exe +0 -0
  287. package/xll/python/Scripts/pip3.exe +0 -0
  288. package/xll/python/vcruntime140.dll +0 -0
  289. package/agent-docs/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
  290. package/agent-docs/examples/extensions/sandbox/package-lock.json +0 -92
  291. package/agent-docs/examples/extensions/with-deps/package-lock.json +0 -31
  292. package/dist/app/new-sheet-command.d.ts +0 -9
  293. package/dist/app/new-sheet-command.js +0 -24
  294. package/dist/app/tools/todo-list.d.ts +0 -34
  295. package/dist/app/tools/todo-list.js +0 -153
  296. package/dist/embedded-agent/host-tools/todo-list/contract.d.ts +0 -69
  297. package/dist/embedded-agent/host-tools/todo-list/contract.js +0 -198
  298. package/dist/embedded-agent/host-tools/todo-list/index.d.ts +0 -3
  299. package/dist/embedded-agent/host-tools/todo-list/index.js +0 -3
  300. package/dist/shell/presentation/todo-widget.d.ts +0 -16
  301. package/dist/shell/presentation/todo-widget.js +0 -54
  302. package/xll/python/Lib/site-packages/certifi-2026.4.22.dist-info/RECORD +0 -14
  303. package/xll/python/Lib/site-packages/idna-3.13.dist-info/METADATA +0 -204
  304. package/xll/python/Lib/site-packages/idna-3.13.dist-info/RECORD +0 -22
  305. /package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/INSTALLER +0 -0
  306. /package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/WHEEL +0 -0
  307. /package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/licenses/LICENSE +0 -0
  308. /package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/top_level.txt +0 -0
  309. /package/xll/python/Lib/site-packages/{idna-3.13.dist-info → idna-3.16.dist-info}/INSTALLER +0 -0
  310. /package/xll/python/Lib/site-packages/{idna-3.13.dist-info → idna-3.16.dist-info}/WHEEL +0 -0
  311. /package/xll/python/Lib/site-packages/{idna-3.13.dist-info → idna-3.16.dist-info}/licenses/LICENSE.md +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.55]
4
+
5
+ - **Improved error handling** - Improved error handling.
6
+
7
+ ## [0.3.54]
8
+
9
+ - **Skill selector rendering** - Skill source and visibility selectors now stay within narrow Windows terminal widths.
10
+
3
11
  ## [0.3.53]
4
12
 
5
13
  - **Enterprise MCP OAuth fixes** - Hosted enterprise MCP servers now handle OAuth discovery and proxied requests more reliably.
@@ -140,7 +148,7 @@
140
148
  - **Connections** — Connect external data sources via `/connect`. Supports databases (Snowflake, Postgres, Oracle, MySQL), SaaS APIs (Salesforce, Notion, HubSpot, Airtable), and cloud drives. Credentials are stored in the OS keychain.
141
149
  - **Skill sync** — Download shared skills from the cloud with `/download-skills`.
142
150
  - **Skill creator** — A built-in eval-driven workflow for authoring, testing, and improving custom skills.
143
- - **Fixed local install issues** — Resolved a shell path bug that could prevent the CLI from launching after a global npm install.
151
+ - **Fixed local install issues** — Resolved a shell path bug that could prevent the CLI from launching after a global package-manager install.
144
152
 
145
153
  ## [0.2.22]
146
154
 
@@ -7,8 +7,8 @@ See [AGENTS.md](../../../AGENTS.md) for additional guidelines.
7
7
  ```bash
8
8
  git clone https://github.com/badlogic/pi-mono
9
9
  cd pi-mono
10
- npm install
11
- npm run build
10
+ pnpm install
11
+ pnpm run build
12
12
  ```
13
13
 
14
14
  Run from source:
@@ -34,7 +34,7 @@ Change `name`, `configDir`, and `bin` field for your fork. Affects CLI banner, c
34
34
 
35
35
  ## Path Resolution
36
36
 
37
- Three execution modes: npm install, standalone binary, tsx from source.
37
+ Three execution modes: pnpm install, standalone binary, tsx from source.
38
38
 
39
39
  **Always use `src/config.ts`** for package assets:
40
40
 
@@ -54,8 +54,8 @@ Never use `__dirname` directly for package assets.
54
54
 
55
55
  ```bash
56
56
  ./test.sh # Run non-LLM tests (no API keys needed)
57
- npm test # Run all tests
58
- npm test -- test/specific.test.ts # Run specific test
57
+ pnpm test # Run all tests
58
+ pnpm test -- test/specific.test.ts # Run specific test
59
59
  ```
60
60
 
61
61
  ## Project Structure
@@ -139,7 +139,7 @@ To share extensions via npm or git as Shortcut packages, see [packages.md](packa
139
139
  | `shortcutxl/tui` | TUI components for custom rendering |
140
140
  | `shortcutxl/shell` | Shell-owned render helpers and components |
141
141
 
142
- npm dependencies work too. Add a `package.json` next to your extension (or in a parent directory), run `npm install`, and imports from `node_modules/` are resolved automatically.
142
+ npm dependencies work too. Add a `package.json` next to your extension (or in a parent directory), run `pnpm install`, and imports from `node_modules/` are resolved automatically.
143
143
 
144
144
  Node.js built-ins (`node:fs`, `node:path`, etc.) are also available.
145
145
 
@@ -191,8 +191,8 @@ Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript wo
191
191
  ~/.shortcut/agent/extensions/
192
192
  └── my-extension/
193
193
  ├── package.json # Declares dependencies and entry points
194
- ├── package-lock.json
195
- ├── node_modules/ # After npm install
194
+ ├── pnpm-lock.yaml
195
+ ├── node_modules/ # After pnpm install
196
196
  └── src/
197
197
  └── index.ts
198
198
  ```
@@ -211,7 +211,7 @@ Extensions are loaded via [jiti](https://github.com/unjs/jiti), so TypeScript wo
211
211
  }
212
212
  ```
213
213
 
214
- Run `npm install` in the extension directory, then imports from `node_modules/` work automatically.
214
+ Run `pnpm install` in the extension directory, then imports from `node_modules/` work automatically.
215
215
 
216
216
  ## Events
217
217
 
@@ -52,7 +52,7 @@ npm:pkg
52
52
  ```
53
53
 
54
54
  - Versioned specs are pinned and skipped by `shortcut update`.
55
- - Global installs use `npm install -g`.
55
+ - Global installs use `pnpm add -g`.
56
56
  - Project installs go under `.shortcut/npm/`.
57
57
 
58
58
  ### git
@@ -71,7 +71,7 @@ ssh://git@github.com/user/repo@v1
71
71
  - For non-interactive runs (for example CI), you can set `GIT_TERMINAL_PROMPT=0` to disable credential prompts and set `GIT_SSH_COMMAND` (for example `ssh -o BatchMode=yes -o ConnectTimeout=5`) to fail fast.
72
72
  - Refs pin the package and skip `shortcut update`.
73
73
  - Cloned to `~/.shortcut/agent/git/<host>/<path>` (global) or `.shortcut/git/<host>/<path>` (project).
74
- - Runs `npm install` after clone or pull if `package.json` exists.
74
+ - Runs `pnpm install` after clone or pull if `package.json` exists.
75
75
 
76
76
  **SSH examples:**
77
77
  ```bash
@@ -147,7 +147,7 @@ If no `shortcut` manifest is present, Shortcut auto-discovers resources from the
147
147
 
148
148
  ## Dependencies
149
149
 
150
- Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When Shortcut installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
150
+ Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When Shortcut installs a package from npm or git, it runs `pnpm install`, so those dependencies are installed automatically.
151
151
 
152
152
  Shortcut bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `shortcutxl`, `@sinclair/typebox`.
153
153
 
@@ -115,7 +115,7 @@ description: What this skill does and when to use it. Be specific.
115
115
 
116
116
  Run once before first use:
117
117
  \`\`\`bash
118
- cd /path/to/skill && npm install
118
+ cd /path/to/skill && pnpm install
119
119
  \`\`\`
120
120
 
121
121
  ## Usage
@@ -209,7 +209,7 @@ description: Web search and content extraction via Brave Search API. Use for sea
209
209
  ## Setup
210
210
 
211
211
  \`\`\`bash
212
- cd /path/to/brave-search && npm install
212
+ cd /path/to/brave-search && pnpm install
213
213
  \`\`\`
214
214
 
215
215
  ## Search
@@ -459,20 +459,20 @@ SHORTCUT_TUI_RENDER_TRACE=C:\temp\shortcut-tui.jsonl SHORTCUT_TUI_RENDER_TRACE_F
459
459
  Set `SHORTCUT_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
460
460
 
461
461
  ```bash
462
- SHORTCUT_TUI_WRITE_LOG=/tmp/tui-ansi.log npx tsx packages/tui/test/chat-simple.ts
462
+ SHORTCUT_TUI_WRITE_LOG=/tmp/tui-ansi.log pnpm exec tsx packages/tui/test/chat-simple.ts
463
463
  ```
464
464
 
465
465
  Summarize a captured trace with:
466
466
 
467
467
  ```bash
468
- npm run analyze:tui-trace -- C:\temp\shortcut-tui.jsonl
469
- npm run analyze:tui-trace -- C:\temp\shortcut-tui.jsonl --json
468
+ pnpm run analyze:tui-trace -- C:\temp\shortcut-tui.jsonl
469
+ pnpm run analyze:tui-trace -- C:\temp\shortcut-tui.jsonl --json
470
470
  ```
471
471
 
472
472
  For deterministic repro coverage, run the PTY render matrix:
473
473
 
474
474
  ```bash
475
- npm run test:pty -- tests/interactive/tui-render-matrix/tui-render-matrix.pty.test.ts
475
+ pnpm run test:pty -- tests/interactive/tui-render-matrix/tui-render-matrix.pty.test.ts
476
476
  ```
477
477
 
478
478
  ## Performance
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * Usage:
12
12
  * # First install dependencies
13
- * cd packages/coding-agent/examples/extensions/custom-provider && npm install
13
+ * cd packages/coding-agent/examples/extensions/custom-provider && pnpm install
14
14
  *
15
15
  * # With OAuth (run /login custom-anthropic first)
16
16
  * shortcut -e ./packages/coding-agent/examples/extensions/custom-provider
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Test script for GitLab Duo extension
3
- * Run: npx tsx test.ts [model-id] [--thinking]
3
+ * Run: pnpm exec tsx test.ts [model-id] [--thinking]
4
4
  *
5
5
  * Examples:
6
- * npx tsx test.ts # Test default (claude-sonnet-4-5-20250929)
7
- * npx tsx test.ts gpt-5-codex # Test GPT-5 Codex
8
- * npx tsx test.ts claude-sonnet-4-5-20250929 --thinking
6
+ * pnpm exec tsx test.ts # Test default (claude-sonnet-4-5-20250929)
7
+ * pnpm exec tsx test.ts gpt-5-codex # Test GPT-5 Codex
8
+ * pnpm exec tsx test.ts claude-sonnet-4-5-20250929 --thinking
9
9
  */
10
10
 
11
11
  import { readFileSync } from 'fs';
@@ -32,7 +32,7 @@
32
32
  *
33
33
  * Setup:
34
34
  * 1. Copy sandbox/ directory to ~/.shortcut/agent/extensions/
35
- * 2. Run `npm install` in ~/.shortcut/agent/extensions/sandbox/
35
+ * 2. Run `pnpm install` in ~/.shortcut/agent/extensions/sandbox/
36
36
  *
37
37
  * Linux also requires: bubblewrap, socat, ripgrep
38
38
  */
@@ -2,7 +2,7 @@
2
2
  * Example extension with its own npm dependencies.
3
3
  * Tests that jiti resolves modules from the extension's own node_modules.
4
4
  *
5
- * Requires: npm install in this directory
5
+ * Requires: pnpm install in this directory
6
6
  */
7
7
 
8
8
  import { Type } from '@sinclair/typebox';
@@ -5,7 +5,7 @@
5
5
  * Demonstrates how to build a custom UI on top of the RPC protocol,
6
6
  * including handling extension UI requests (select, confirm, input, editor).
7
7
  *
8
- * Usage: npx tsx examples/rpc-extension-ui.ts
8
+ * Usage: pnpm exec tsx examples/rpc-extension-ui.ts
9
9
  *
10
10
  * Slash commands:
11
11
  * /select - demo select dialog
@@ -19,9 +19,9 @@ const deployTemplate: PromptTemplate = {
19
19
  filePath: '/virtual/prompts/deploy.md',
20
20
  content: `# Deploy Instructions
21
21
 
22
- 1. Build: npm run build
23
- 2. Test: npm test
24
- 3. Deploy: npm run deploy`
22
+ 1. Build: pnpm run build
23
+ 2. Test: pnpm test
24
+ 3. Deploy: pnpm run deploy`
25
25
  };
26
26
 
27
27
  const loader = new DefaultResourceLoader({
@@ -23,7 +23,7 @@ Programmatic usage of `shortcutxl/app` via `createAgentSession()`.
23
23
 
24
24
  ```bash
25
25
  cd packages/coding-agent
26
- npx tsx examples/sdk/01-minimal.ts
26
+ pnpm exec tsx examples/sdk/01-minimal.ts
27
27
  ```
28
28
 
29
29
  ## Quick Reference
@@ -165,6 +165,7 @@ export declare class AgentSession {
165
165
  private _autonomousState;
166
166
  private _turnIndex;
167
167
  private _persistence;
168
+ private _pendingImmediateRunAgentMetadata?;
168
169
  private _resourceLoader;
169
170
  private _prePromptContext?;
170
171
  /** Details from the last prePromptContext call (e.g. { workbooks: string[] }). Read by TUI for annotations. */
@@ -12,10 +12,11 @@
12
12
  *
13
13
  * Modes use this class and add their own I/O layer on top.
14
14
  */
15
- import { isContextOverflow } from '@mariozechner/pi-ai';
16
15
  import { SessionState } from '../core/session-state.js';
17
16
  import { createCompactionActions, createErrorRecoveryActions, triggerCompactionIfNeeded } from '../core/session/compaction-bridge.js';
17
+ import { isContextOverflow } from '../core/session/context-overflow.js';
18
18
  import { SessionCompaction } from '../core/session/session-compaction.js';
19
+ import { classifyError, SessionErrorRecovery } from '../core/session/session-error-recovery.js';
19
20
  import { isShortcutFastModeModel } from '../model-ids.js';
20
21
  import { formatFileUploadsContext, mergeFileUploads } from './file-uploads.js';
21
22
  import { expandPromptTemplate } from './resources/prompt-template-expansion.js';
@@ -31,8 +32,8 @@ import { formatRuntimePermissionBypassReminder } from './session/permission-cont
31
32
  import { PersistenceHandler } from './session/persistence-handler.js';
32
33
  import { assertNotExtensionCommand, buildMessageContent, normalizeUserContent, tryExtensionCommand } from './session/prompt-pipeline.js';
33
34
  import { QueueTracker } from './session/queue-tracker.js';
35
+ import { buildRunAgentMetadata, emitRunAgent, summarizeDeliveredUserContent } from './session/run-agent-observability.js';
34
36
  import { SessionBudgetContinuation } from './session/session-budget-continuation.js';
35
- import { classifyError, SessionErrorRecovery } from './session/session-error-recovery.js';
36
37
  import { executeNewSession, executeSwitchSession } from './session/session-lifecycle.js';
37
38
  import { getAvailableThinkingLevels, supportsThinking, supportsXhighThinking } from './session/session-models.js';
38
39
  import { computeContextUsage, computeSessionStats } from './session/session-stats.js';
@@ -85,6 +86,7 @@ export class AgentSession {
85
86
  // Event pipeline
86
87
  _turnIndex = 0; // shared counter — passed to both extension emitter and persistence
87
88
  _persistence = new PersistenceHandler();
89
+ _pendingImmediateRunAgentMetadata;
88
90
  _resourceLoader;
89
91
  _prePromptContext;
90
92
  /** Details from the last prePromptContext call (e.g. { workbooks: string[] }). Read by TUI for annotations. */
@@ -123,7 +125,7 @@ export class AgentSession {
123
125
  this.sessionManager = config.sessionManager;
124
126
  this.settingsManager = config.settingsManager;
125
127
  this.approvalState = config.approvalState;
126
- this._compaction = new SessionCompaction(config.compactionComplete);
128
+ this._compaction = new SessionCompaction({ complete: config.compactionComplete });
127
129
  this._resourceLoader = config.resourceLoader;
128
130
  this._modelRegistry = config.modelRegistry;
129
131
  this._prePromptContext = config.prePromptContext;
@@ -202,7 +204,6 @@ export class AgentSession {
202
204
  this._compactionActions = createCompactionActions({
203
205
  extensionRunner: () => this._extensions.extensionRunner,
204
206
  sessionManager: this.sessionManager,
205
- settingsManager: this.settingsManager,
206
207
  agent: this.agent,
207
208
  removeLastErrorGroup: () => this._removeLastErrorGroup()
208
209
  });
@@ -210,7 +211,6 @@ export class AgentSession {
210
211
  model: () => this.model,
211
212
  modelRegistry: this._modelRegistry,
212
213
  sessionManager: this.sessionManager,
213
- settingsManager: this.settingsManager,
214
214
  compaction: this._compaction,
215
215
  compactionActions: this._compactionActions,
216
216
  agent: this.agent
@@ -220,7 +220,6 @@ export class AgentSession {
220
220
  model: () => this.model,
221
221
  modelRegistry: this._modelRegistry,
222
222
  sessionManager: this.sessionManager,
223
- settingsManager: this.settingsManager,
224
223
  compaction: this._compaction,
225
224
  compactionActions: () => this._compactionActions,
226
225
  removeLastErrorGroup: () => this._removeLastErrorGroup(),
@@ -337,6 +336,31 @@ export class AgentSession {
337
336
  async _processAgentLoopEvent(event) {
338
337
  // --- Step 1: Queue tracking (sync) ---
339
338
  this._queueTracker.handle(event);
339
+ if (event.type === 'message_start' && event.message.role === 'user') {
340
+ const deliveredContent = summarizeDeliveredUserContent(event.message.content);
341
+ const pendingMetadata = this._pendingImmediateRunAgentMetadata;
342
+ const conversationId = this.sessionManager.getSessionId();
343
+ const userMessageId = typeof event.message.id === 'string' && event.message.id.length > 0
344
+ ? event.message.id
345
+ : undefined;
346
+ this._pendingImmediateRunAgentMetadata = undefined;
347
+ emitRunAgent(this._observability, {
348
+ ...(pendingMetadata ??
349
+ buildRunAgentMetadata({
350
+ charCount: deliveredContent.charCount,
351
+ imageCount: deliveredContent.imageCount,
352
+ conversationId,
353
+ userMessageId
354
+ })),
355
+ conversationId,
356
+ thread_id: conversationId,
357
+ platform: 'cli',
358
+ char_count: deliveredContent.charCount,
359
+ message_length: deliveredContent.charCount,
360
+ image_count: deliveredContent.imageCount,
361
+ ...(userMessageId ? { user_message_id: userMessageId, turnId: userMessageId } : {})
362
+ });
363
+ }
340
364
  // --- Step 2: Extensions (async — must complete before persistence) ---
341
365
  // Reset turnIndex on agent_start BEFORE the snapshot so extensions see 0.
342
366
  if (event.type === 'agent_start') {
@@ -434,8 +458,12 @@ export class AgentSession {
434
458
  if (didRecover)
435
459
  return;
436
460
  }
437
- // Threshold compaction for non-error responses (overflow is handled by error recovery)
438
- await this._triggerCompactionIfNeeded(lastAssistant, true);
461
+ // Threshold compaction for non-error responses (overflow is handled by error recovery).
462
+ // Auto-compaction now rejects on failure (timeout / model error / persist error) so
463
+ // that heartbeat emits a compaction_failed/timeout OpEnd row to ClickHouse with the
464
+ // real error message. The failure is already on the auto_compaction_end session event
465
+ // by the time the rejection lands here, so the agent_end hook must not crash.
466
+ await this._triggerCompactionIfNeeded(lastAssistant, true).catch(() => undefined);
439
467
  }
440
468
  }
441
469
  }
@@ -805,10 +833,13 @@ export class AgentSession {
805
833
  if (!apiKey) {
806
834
  throw new LoginRequiredError();
807
835
  }
808
- // Check if we need to compact before sending (catches aborted responses)
836
+ // Check if we need to compact before sending (catches aborted responses).
837
+ // See parallel call above re: swallowing — auto-compaction now rejects on failure
838
+ // for telemetry purposes; the failure is already on the session event so the
839
+ // pre-submit path must not abort here.
809
840
  const lastAssistant = this._findLastAssistantMessage();
810
841
  if (lastAssistant) {
811
- await this._triggerCompactionIfNeeded(lastAssistant, false);
842
+ await this._triggerCompactionIfNeeded(lastAssistant, false).catch(() => undefined);
812
843
  }
813
844
  // Build messages array (custom message if any, then user message)
814
845
  const messages = [];
@@ -836,7 +867,9 @@ export class AgentSession {
836
867
  if (currentImages) {
837
868
  userContent.push(...currentImages);
838
869
  }
870
+ const userMessageId = globalThis.crypto.randomUUID();
839
871
  messages.push({
872
+ id: userMessageId,
840
873
  role: 'user',
841
874
  content: userContent,
842
875
  timestamp: Date.now()
@@ -878,19 +911,30 @@ export class AgentSession {
878
911
  }
879
912
  this._budgetContinuation.beginPromptRun(parsedBudget?.budgetTokens);
880
913
  const workbookDetails = this.lastPrePromptDetails;
914
+ const promptMetadata = buildRunAgentMetadata({
915
+ charCount: expandedText.length,
916
+ imageCount: currentImages?.length ?? 0,
917
+ conversationId: this.sessionManager.getSessionId(),
918
+ workbookDetails,
919
+ userMessageId
920
+ });
921
+ this._pendingImmediateRunAgentMetadata = promptMetadata;
881
922
  this._observability?.info?.({
882
923
  module: 'ui',
883
924
  event: 'prompt_submitted',
884
- data: {
885
- char_count: expandedText.length,
886
- image_count: currentImages?.length ?? 0,
887
- has_workbook_context: Boolean(workbookDetails),
888
- workbook_count: workbookDetails?.workbooks?.length ?? 0,
889
- workbook_scope_mode: workbookDetails?.scopeMode
890
- }
925
+ data: promptMetadata
891
926
  });
892
- await this.agent.prompt(messages);
893
- await this._recovery.wait();
927
+ try {
928
+ await this.agent.prompt(messages);
929
+ await this._agentEventQueue.catch(() => { });
930
+ await this._recovery.wait();
931
+ }
932
+ finally {
933
+ await this._agentEventQueue.catch(() => { });
934
+ if (this._pendingImmediateRunAgentMetadata === promptMetadata) {
935
+ this._pendingImmediateRunAgentMetadata = undefined;
936
+ }
937
+ }
894
938
  }
895
939
  /** Rewrite skill commands (/skill:name args) to selected-skill markers. */
896
940
  _expandSkillCommand(text) {
@@ -1008,6 +1052,7 @@ export class AgentSession {
1008
1052
  async _queueSteer(text, images) {
1009
1053
  this._queueTracker.pushSteering(text);
1010
1054
  this.agent.steer({
1055
+ id: globalThis.crypto.randomUUID(),
1011
1056
  role: 'user',
1012
1057
  content: buildMessageContent(text, images),
1013
1058
  timestamp: Date.now()
@@ -1017,6 +1062,7 @@ export class AgentSession {
1017
1062
  async _queueFollowUp(text, images) {
1018
1063
  this._queueTracker.pushFollowUp(text);
1019
1064
  this.agent.followUp({
1065
+ id: globalThis.crypto.randomUUID(),
1020
1066
  role: 'user',
1021
1067
  content: buildMessageContent(text, images),
1022
1068
  timestamp: Date.now()
@@ -1235,7 +1281,7 @@ export class AgentSession {
1235
1281
  const apiKey = await this._modelRegistry.getApiKey(this.model);
1236
1282
  if (!apiKey)
1237
1283
  throw new Error(`No API key for ${this.model.provider}`);
1238
- return await this._compaction.runManual(this.model, apiKey, this.sessionManager.getBranch(), this.settingsManager.getCompactionSettings(), customInstructions, this._compactionActions);
1284
+ return await this._compaction.runManual(this.model, apiKey, this.sessionManager.getBranch(), customInstructions, this._compactionActions);
1239
1285
  }
1240
1286
  finally {
1241
1287
  this._reconnectToAgent();
@@ -70,21 +70,11 @@ export class CollabSync {
70
70
  try {
71
71
  // Create engine from raw Yrs bytes — preserves exact Yrs item identities
72
72
  // so that subsequent syncApply diffs merge correctly.
73
- // Suppress console.debug during creation (mog SDK logs "DatabaseBridge
74
- // unavailable" which pollutes the TUI).
75
- const origDebug = console.debug;
76
- console.debug = () => { };
77
73
  const addon = SyncBridge.getNativeAddon();
78
- let engine;
79
- try {
80
- engine = await createHeadlessEngine({
81
- computeAddon: addon,
82
- yrsState: state
83
- });
84
- }
85
- finally {
86
- console.debug = origDebug;
87
- }
74
+ const engine = await createHeadlessEngine({
75
+ computeAddon: addon,
76
+ yrsState: state
77
+ });
88
78
  const wb = engine.workbook;
89
79
  const bridge = new SyncBridge(wb);
90
80
  this.bridges.set(docId, bridge);
@@ -22,7 +22,7 @@ export { createMcpManager, type McpManager } from './mcp/index.js';
22
22
  export { isManagedMcpOAuthProvider } from './mcp/managed-oauth-providers.js';
23
23
  export { McpOAuthStore } from './mcp/oauth-state-store.js';
24
24
  export { convertToLlm, createCompactionSummaryMessage, createCustomMessage, type CustomMessage } from './messages.js';
25
- export { handleNewSheetCommand } from './new-sheet-command.js';
25
+ export { handleMogCommand } from './mog-command.js';
26
26
  export { ModelRegistry } from './providers/model-registry.js';
27
27
  export { resolveCliModel } from './providers/model-resolver.js';
28
28
  export { registerShortcutProvider } from './providers/register-shortcut-provider.js';
@@ -38,7 +38,7 @@ export type { SessionObservability } from './session/session-observability.js';
38
38
  export { FileSessionPersistenceBackend } from './session/session-persistence-backend.js';
39
39
  export type { SessionPersistenceBackend } from './session/session-persistence-backend.js';
40
40
  export type { BranchSessionStore, ModelSessionStore, PersistenceSessionStore, ProductSessionStore, SessionInfoStore } from './session/session-store-types.js';
41
- export { SettingsManager, type CompactionSettings, type ImageSettings, type PackageSource, type RetrySettings } from './settings-manager.js';
41
+ export { SettingsManager, type ImageSettings, type PackageSource, type RetrySettings } from './settings-manager.js';
42
42
  export { countSkillProposals, listSkillProposals, type ProposalKind, type SkillProposalSummary } from './skill-proposals/catalog.js';
43
43
  export { default as skillProposalsExtension } from './skill-proposals/extension.js';
44
44
  export { getSkillProposalRoots, type ProposalRoots } from './skill-proposals/proposal-fs.js';
package/dist/app/index.js CHANGED
@@ -18,7 +18,7 @@ export { createMcpManager } from './mcp/index.js';
18
18
  export { isManagedMcpOAuthProvider } from './mcp/managed-oauth-providers.js';
19
19
  export { McpOAuthStore } from './mcp/oauth-state-store.js';
20
20
  export { convertToLlm, createCompactionSummaryMessage, createCustomMessage } from './messages.js';
21
- export { handleNewSheetCommand } from './new-sheet-command.js';
21
+ export { handleMogCommand } from './mog-command.js';
22
22
  export { ModelRegistry } from './providers/model-registry.js';
23
23
  export { resolveCliModel } from './providers/model-resolver.js';
24
24
  export { registerShortcutProvider } from './providers/register-shortcut-provider.js';
@@ -5,7 +5,7 @@
5
5
  * Can switch to plan or installation mode.
6
6
  */
7
7
  import { MODE } from '../../../mode-names.js';
8
- import { ACTION_SWITCH_MODE, BASH, EXECUTE_CODE, EXECUTE_TOOL, GET_TOOL_INFO, MCP_TOOL_NAMES, SEND_MESSAGE, TASK, TODO_LIST, WRITE } from '../../../tool-names.js';
8
+ import { ACTION_SWITCH_MODE, BASH, EXECUTE_CODE, EXECUTE_TOOL, GET_TOOL_INFO, MCP_TOOL_NAMES, SEND_MESSAGE, TASK, WRITE } from '../../../tool-names.js';
9
9
  import { buildActionPrompt } from './prompt.js';
10
10
  const DESCRIPTION = 'Execute changes to the spreadsheet.';
11
11
  const TOOLS = [
@@ -14,7 +14,6 @@ const TOOLS = [
14
14
  EXECUTE_CODE,
15
15
  TASK,
16
16
  SEND_MESSAGE,
17
- TODO_LIST,
18
17
  ACTION_SWITCH_MODE,
19
18
  GET_TOOL_INFO,
20
19
  EXECUTE_TOOL,
@@ -33,6 +33,10 @@ Match the scope of your actions to what was actually requested. Complete the req
33
33
  execute_code: use it for all spreadsheet interactions
34
34
  ${engine.execTool}
35
35
 
36
+ File Writing:
37
+ - ALWAYS use the write tool to create or replace authored text files such as Markdown, TXT, CSV, JSON, YAML, scripts, notes, and plans.
38
+ - Do not use bash heredocs, echo/printf chains, or inline Python solely to transport file contents into a file unless write is unavailable or the content is naturally generated by a command.
39
+
36
40
  PDF Processing:
37
41
  - You MUST ALWAYS use document readers to understand and extract data from PDFs, no matter if it is programmatic extraction or multimodal extraction.
38
42
  - First understand the task, then parallelize document readers to optimize performance when tasks can be broken down into independent components. Always leave the real work to the document readers
@@ -5,10 +5,10 @@
5
5
  * Explicit /manage can enter it, but it does not switch out again.
6
6
  */
7
7
  import { MODE } from '../../../mode-names.js';
8
- import { EXECUTE_TOOL, GET_TOOL_INFO, MCP_TOOL_NAMES, SEND_MESSAGE, TASK, TODO_LIST } from '../../../tool-names.js';
8
+ import { EXECUTE_TOOL, GET_TOOL_INFO, MCP_TOOL_NAMES, SEND_MESSAGE, TASK } from '../../../tool-names.js';
9
9
  import { buildManagePrompt } from './prompt.js';
10
10
  const DESCRIPTION = 'Orchestration mode — decomposes complex tasks, delegates to subagents in parallel, and synthesizes results.';
11
- const TOOLS = [TASK, SEND_MESSAGE, TODO_LIST, GET_TOOL_INFO, EXECUTE_TOOL, ...MCP_TOOL_NAMES];
11
+ const TOOLS = [TASK, SEND_MESSAGE, GET_TOOL_INFO, EXECUTE_TOOL, ...MCP_TOOL_NAMES];
12
12
  /** Construct the manage-mode agent definition that orchestrates work via subagents. */
13
13
  export function manageAgent() {
14
14
  return {
@@ -17,12 +17,19 @@ Be concise and direct. No emojis. No filler phrases. Describe what you're delega
17
17
 
18
18
  You have NO direct access to the spreadsheet, file system, or shell. Your only tools are:
19
19
  - **task**: Spawn subagent workers (clone, document_reader, general)
20
- - **todo_list**: Track progress across delegated work
21
20
  - **get_tool_info / execute_tool**: Inspect and invoke tools dynamically
22
21
  - **MCP tools**: Access external services via MCP
23
22
 
24
23
  Mode switching is not available from Manage Mode. Finish orchestration here.
25
24
 
25
+ ## Progress Tracking
26
+
27
+ For complex multi-step work, make delegated workers maintain progress in small markdown files.
28
+ - Use a unique folder under \`/workspace/work/\`, such as \`/workspace/work/<task-slug>/\`.
29
+ - A single \`status.md\` is enough for most tasks; use \`plan.md\` as well when the task has phases or acceptance criteria.
30
+ - Tell workers to update current goal, completed steps, next step, blockers, and verification status as work proceeds.
31
+ - Before context refreshes or autonomous resumes, workers must leave enough state for a fresh context to continue safely.
32
+
26
33
  ## Phased Workflow
27
34
 
28
35
  ### 1. Research Phase
@@ -0,0 +1,13 @@
1
+ /**
2
+ * /mog slash command handler.
3
+ *
4
+ * Toggles the Mog headless spreadsheet engine on or off.
5
+ * Requires a restart to take effect.
6
+ */
7
+ import type { SettingsManager } from './settings-manager.js';
8
+ export interface MogCommandPolicy {
9
+ enableDisabledReason?: string;
10
+ forceEnabled?: boolean;
11
+ }
12
+ export declare function handleMogCommand(showStatus: (msg: string) => void, select: (title: string, options: string[]) => Promise<string | undefined>, settingsManager: SettingsManager, policy?: MogCommandPolicy): Promise<boolean>;
13
+ //# sourceMappingURL=mog-command.d.ts.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * /mog slash command handler.
3
+ *
4
+ * Toggles the Mog headless spreadsheet engine on or off.
5
+ * Requires a restart to take effect.
6
+ */
7
+ export async function handleMogCommand(showStatus, select, settingsManager, policy = {}) {
8
+ const current = settingsManager.getNewSheet();
9
+ const menuOptions = [
10
+ current ? 'Enable (current)' : 'Enable',
11
+ current ? 'Disable' : 'Disable (current)',
12
+ 'Cancel'
13
+ ];
14
+ const choice = await select('Mog Spreadsheet Engine', menuOptions);
15
+ if (!choice || choice === 'Cancel')
16
+ return true;
17
+ const enable = choice.startsWith('Enable');
18
+ if (enable && !current && policy.enableDisabledReason) {
19
+ showStatus(policy.enableDisabledReason);
20
+ return true;
21
+ }
22
+ if (enable !== current) {
23
+ settingsManager.setNewSheet(enable);
24
+ const suffix = policy.forceEnabled ? ' (forced by SHORTCUT_NEW_SHEET)' : '';
25
+ showStatus(`Mog ${enable ? 'enabled' : 'disabled'}${suffix} — restart session to take effect`);
26
+ }
27
+ return true;
28
+ }
29
+ //# sourceMappingURL=mog-command.js.map
@@ -137,6 +137,20 @@ function createTrackedWorksheet(ws, wb, mutations) {
137
137
  return original.call(target, updates);
138
138
  };
139
139
  }
140
+ // setArrayFormula({ startRow, startCol, endRow, endCol }, formula)
141
+ if (prop === 'setArrayFormula') {
142
+ return async (range, formula) => {
143
+ const oldValues = await captureOldRange(target, range.startRow, range.startCol, range.endRow, range.endCol);
144
+ for (let r = range.startRow; r <= range.endRow; r++) {
145
+ for (let c = range.startCol; c <= range.endCol; c++) {
146
+ const addr = indexToAddress(r, c);
147
+ const old = oldValues.get(addr) ?? { oldValue: null };
148
+ mutations.push({ workbook: wb, worksheet: target, address: addr, ...old });
149
+ }
150
+ }
151
+ return original.call(target, range, formula);
152
+ };
153
+ }
140
154
  // setDateValue(row, col, date)
141
155
  if (prop === 'setDateValue') {
142
156
  return async (row, col, ...args) => {
@@ -44,6 +44,7 @@ interface MogSdkModule {
44
44
  createWorkbook(options?: CreateWorkbookOptions): Promise<Workbook>;
45
45
  createHeadlessEngine(options: CreateHeadlessEngineOptions): Promise<HeadlessEngine>;
46
46
  }
47
+ export declare function isMogSdkAvailable(): boolean;
47
48
  export declare function normalizeMogSdkModule(value: unknown): MogSdkModule | null;
48
49
  export declare function createWorkbook(options?: CreateWorkbookOptions): Promise<Workbook>;
49
50
  export declare function createHeadlessEngine(options: CreateHeadlessEngineOptions): Promise<HeadlessEngine>;