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.
- package/CHANGELOG.md +9 -1
- package/agent-docs/docs/development.md +5 -5
- package/agent-docs/docs/extensions.md +4 -4
- package/agent-docs/docs/packages.md +3 -3
- package/agent-docs/docs/skills.md +2 -2
- package/agent-docs/docs/tui.md +4 -4
- package/agent-docs/examples/extensions/custom-provider-anthropic/index.ts +1 -1
- package/agent-docs/examples/extensions/custom-provider-gitlab-duo/test.ts +4 -4
- package/agent-docs/examples/extensions/sandbox/index.ts +1 -1
- package/agent-docs/examples/extensions/with-deps/index.ts +1 -1
- package/agent-docs/examples/rpc-extension-ui.ts +1 -1
- package/agent-docs/examples/sdk/08-prompt-templates.ts +3 -3
- package/agent-docs/examples/sdk/README.md +1 -1
- package/dist/app/agent-session.d.ts +1 -0
- package/dist/app/agent-session.js +66 -20
- package/dist/app/collab/collab-sync.js +4 -14
- package/dist/app/index.d.ts +2 -2
- package/dist/app/index.js +1 -1
- package/dist/app/modes/action/agent.js +1 -2
- package/dist/app/modes/action/prompt.js +4 -0
- package/dist/app/modes/manage/agent.js +2 -2
- package/dist/app/modes/manage/prompt.js +8 -1
- package/dist/app/mog-command.d.ts +13 -0
- package/dist/app/mog-command.js +29 -0
- package/dist/app/new-sheet/mutation-tracker.js +14 -0
- package/dist/app/new-sheet/sdk-types.d.ts +1 -0
- package/dist/app/new-sheet/sdk-types.js +22 -2
- package/dist/app/observability/client-logging/client-logger.d.ts +4 -1
- package/dist/app/observability/client-logging/client-logger.js +7 -0
- package/dist/app/observability/client-logging/context.d.ts +5 -1
- package/dist/app/observability/client-logging/context.js +45 -0
- package/dist/app/observability/client-logging/index.d.ts +3 -2
- package/dist/app/observability/client-logging/index.js +2 -1
- package/dist/app/observability/client-logging/telemetry-policy.d.ts +5 -0
- package/dist/app/observability/client-logging/telemetry-policy.js +8 -0
- package/dist/app/observability/client-logging/types.d.ts +13 -0
- package/dist/app/prompts/com-api-reference.json +215 -146
- package/dist/app/prompts/mog-api-reference.json +11968 -5753
- package/dist/app/prompts/spreadjs-api-reference.json +1 -1
- package/dist/app/providers/llm-usage.js +2 -1
- package/dist/app/providers/shortcut-invoke.js +4 -0
- package/dist/app/providers/shortcut-stream.js +3 -0
- package/dist/app/resources/package-manager.d.ts +1 -1
- package/dist/app/resources/package-manager.js +8 -8
- package/dist/app/services/user-context.d.ts +14 -4
- package/dist/app/services/user-context.js +34 -6
- package/dist/app/session/run-agent-observability.d.ts +38 -0
- package/dist/app/session/run-agent-observability.js +49 -0
- package/dist/app/settings-manager.d.ts +2 -22
- package/dist/app/settings-manager.js +0 -16
- package/dist/app/sync/remote-skill-files.d.ts +24 -0
- package/dist/app/sync/remote-skill-files.js +73 -0
- package/dist/app/sync/skills-download.d.ts +1 -1
- package/dist/app/sync/skills-download.js +29 -44
- package/dist/app/sync/skills-status.d.ts +1 -1
- package/dist/app/sync/skills-status.js +25 -40
- package/dist/app/sync/skills-upload.d.ts +2 -1
- package/dist/app/sync/skills-upload.js +14 -41
- package/dist/app/sync/storage-client.d.ts +5 -2
- package/dist/app/sync/storage-client.js +14 -6
- package/dist/app/tools/index.d.ts +0 -1
- package/dist/app/tools/index.js +0 -1
- package/dist/app/tools/refresh-context.d.ts +1 -1
- package/dist/cli.js +1453 -1531
- package/dist/config.d.ts +1 -0
- package/dist/config.js +6 -3
- package/dist/contracts/agent-api.d.ts +31 -1
- package/dist/contracts/agent-api.js +35 -2
- package/dist/contracts/agent-execute-code.d.ts +7 -3
- package/dist/contracts/agent-execute-code.js +7 -3
- package/dist/contracts/agent-session-store.d.ts +1 -0
- package/dist/contracts/agent-settings.d.ts +6 -11
- package/dist/contracts/cancel-or-fail.d.ts +27 -0
- package/dist/contracts/cancel-or-fail.js +27 -0
- package/dist/contracts/host-tool-api.d.ts +2 -1
- package/dist/contracts/host-tool-api.js +2 -1
- package/dist/contracts/host-tool-registry.js +24 -2
- package/dist/contracts/host-tool.d.ts +69 -4
- package/dist/contracts/host-tool.js +48 -4
- package/dist/contracts/model-call.d.ts +183 -0
- package/dist/contracts/model-call.js +115 -0
- package/dist/contracts/model-stream.d.ts +100 -1
- package/dist/contracts/model-stream.js +120 -2
- package/dist/contracts/wire.d.ts +39 -2
- package/dist/contracts/wire.js +43 -2
- package/dist/core/agent-engine.d.ts +2 -1
- package/dist/core/agent-engine.js +1 -2
- package/dist/core/agent-loop.js +152 -11
- package/dist/core/agent-state-reducer.js +2 -2
- package/dist/core/core-types.d.ts +20 -1
- package/dist/core/core-types.js +7 -0
- package/dist/core/error-classification.d.ts +1 -0
- package/dist/core/error-classification.js +25 -1
- package/dist/core/pending-host-tool-requests.d.ts +1 -1
- package/dist/core/pending-host-tool-requests.js +2 -7
- package/dist/core/session/compaction/compaction.d.ts +2 -9
- package/dist/core/session/compaction/compaction.js +13 -13
- package/dist/core/session/compaction/constants.d.ts +10 -0
- package/dist/core/session/compaction/constants.js +17 -0
- package/dist/core/session/compaction/index.d.ts +1 -0
- package/dist/core/session/compaction/index.js +1 -0
- package/dist/core/session/compaction-bridge.d.ts +12 -15
- package/dist/core/session/compaction-bridge.js +9 -8
- package/dist/core/session/context-overflow.d.ts +10 -0
- package/dist/core/session/context-overflow.js +42 -0
- package/dist/core/session/session-compaction.d.ts +34 -6
- package/dist/core/session/session-compaction.js +129 -35
- package/dist/{app → core}/session/session-error-recovery.d.ts +29 -14
- package/dist/{app → core}/session/session-error-recovery.js +84 -13
- package/dist/core/session-schema.d.ts +1 -0
- package/dist/embedded-agent/anthropic-messages-transport.d.ts +34 -0
- package/dist/embedded-agent/anthropic-messages-transport.js +1015 -0
- package/dist/embedded-agent/bootstrap.js +1 -7
- package/dist/embedded-agent/compaction-wiring.d.ts +1 -6
- package/dist/embedded-agent/compaction-wiring.js +15 -10
- package/dist/embedded-agent/compose.js +332 -60
- package/dist/embedded-agent/credit-gate.d.ts +4 -3
- package/dist/embedded-agent/credit-gate.js +8 -2
- package/dist/embedded-agent/host-runtime-options.d.ts +3 -2
- package/dist/embedded-agent/host-runtime-options.js +25 -9
- package/dist/embedded-agent/host-tools/build-tool-list.d.ts +6 -9
- package/dist/embedded-agent/host-tools/build-tool-list.js +39 -24
- package/dist/embedded-agent/host-tools/create-website/contract.js +23 -10
- package/dist/embedded-agent/host-tools/execute-bash-command/contract.js +24 -14
- package/dist/embedded-agent/host-tools/execute-code/allowed-functions.json +1 -1
- package/dist/embedded-agent/host-tools/execute-code/contract.d.ts +6 -0
- package/dist/embedded-agent/host-tools/execute-code/contract.js +41 -25
- package/dist/embedded-agent/host-tools/execute-code/read-only-gate.js +4 -3
- package/dist/embedded-agent/host-tools/execute-tool/contract.js +25 -7
- package/dist/embedded-agent/host-tools/get-tool-info/contract.js +16 -4
- package/dist/embedded-agent/host-tools/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/index.js +1 -1
- package/dist/embedded-agent/host-tools/invoke-llm/contract.d.ts +1 -1
- package/dist/embedded-agent/host-tools/invoke-llm/contract.js +3 -3
- package/dist/embedded-agent/host-tools/mode-host-tools.d.ts +4 -7
- package/dist/embedded-agent/host-tools/mode-host-tools.js +18 -5
- package/dist/embedded-agent/host-tools/refresh-context/contract.d.ts +29 -0
- package/dist/embedded-agent/host-tools/refresh-context/contract.js +74 -0
- package/dist/embedded-agent/host-tools/refresh-context/index.d.ts +3 -0
- package/dist/embedded-agent/host-tools/refresh-context/index.js +3 -0
- package/dist/embedded-agent/host-tools/registry.d.ts +4 -4
- package/dist/embedded-agent/host-tools/registry.js +2 -4
- package/dist/embedded-agent/host-tools/request-credential/contract.js +53 -45
- package/dist/embedded-agent/host-tools/request-oauth/contract.d.ts +1 -3
- package/dist/embedded-agent/host-tools/request-oauth/contract.js +44 -38
- package/dist/embedded-agent/host-tools/sandbox-llm/contract.d.ts +2 -2
- package/dist/embedded-agent/host-tools/sandbox-llm/contract.js +29 -12
- package/dist/embedded-agent/host-tools/shared/index.d.ts +2 -1
- package/dist/embedded-agent/host-tools/shared/index.js +1 -1
- package/dist/embedded-agent/host-tools/shared/llm-stream.d.ts +14 -2
- package/dist/embedded-agent/host-tools/shared/llm-stream.js +40 -12
- package/dist/embedded-agent/host-tools/shared/multimodal.d.ts +9 -1
- package/dist/embedded-agent/host-tools/shared/multimodal.js +34 -1
- package/dist/embedded-agent/host-tools/switch-mode/contract.d.ts +3 -3
- package/dist/embedded-agent/host-tools/switch-mode/contract.js +32 -32
- package/dist/embedded-agent/host-tools/take-screenshot/contract.d.ts +2 -1
- package/dist/embedded-agent/host-tools/take-screenshot/contract.js +29 -13
- package/dist/embedded-agent/host-tools/task/agent-definition.d.ts +2 -0
- package/dist/embedded-agent/host-tools/task/agents/clone.d.ts +9 -0
- package/dist/embedded-agent/host-tools/task/agents/clone.js +42 -0
- package/dist/embedded-agent/host-tools/task/agents/document-reader.js +6 -5
- package/dist/embedded-agent/host-tools/task/agents/general.js +5 -7
- package/dist/embedded-agent/host-tools/task/agents/index.js +2 -0
- package/dist/embedded-agent/host-tools/task/contract.d.ts +9 -6
- package/dist/embedded-agent/host-tools/task/contract.js +50 -67
- package/dist/embedded-agent/host-tools/task/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/task/index.js +1 -1
- package/dist/embedded-agent/host-tools/task/run-subagent.d.ts +2 -0
- package/dist/embedded-agent/host-tools/task/run-subagent.js +1 -0
- package/dist/embedded-agent/host-tools/timeouts.d.ts +17 -1
- package/dist/embedded-agent/host-tools/timeouts.js +40 -2
- package/dist/embedded-agent/host-tools/tool-names.d.ts +1 -1
- package/dist/embedded-agent/host-tools/tool-names.js +1 -1
- package/dist/embedded-agent/host-tools/web-crawl/contract.js +29 -9
- package/dist/embedded-agent/host-tools/web-search/contract.d.ts +8 -1
- package/dist/embedded-agent/host-tools/web-search/contract.js +37 -9
- package/dist/embedded-agent/index.d.ts +18 -3
- package/dist/embedded-agent/index.js +3 -0
- package/dist/embedded-agent/model-call-orchestrator.d.ts +22 -0
- package/dist/embedded-agent/model-call-orchestrator.js +22 -0
- package/dist/embedded-agent/model-registry.d.ts +2 -1
- package/dist/embedded-agent/model-registry.js +29 -1
- package/dist/embedded-agent/openai-completions-transport.d.ts +24 -0
- package/dist/embedded-agent/openai-completions-transport.js +261 -0
- package/dist/embedded-agent/openai-responses-transport.d.ts +24 -0
- package/dist/embedded-agent/openai-responses-transport.js +266 -0
- package/dist/embedded-agent/pi-ai-invoke.d.ts +51 -0
- package/dist/embedded-agent/pi-ai-invoke.js +385 -0
- package/dist/embedded-agent/prompt/api-reference.d.ts +3 -2
- package/dist/embedded-agent/prompt/api-reference.js +17 -1
- package/dist/embedded-agent/prompt/build.d.ts +3 -6
- package/dist/embedded-agent/prompt/build.js +48 -36
- package/dist/embedded-agent/prompt/modes/action.d.ts +3 -3
- package/dist/embedded-agent/prompt/modes/action.js +8 -21
- package/dist/embedded-agent/prompt/modes/ask.d.ts +3 -2
- package/dist/embedded-agent/prompt/modes/ask.js +3 -6
- package/dist/embedded-agent/prompt/modes/manage.d.ts +7 -0
- package/dist/embedded-agent/prompt/modes/manage.js +77 -0
- package/dist/embedded-agent/prompt/modes/plan.d.ts +2 -2
- package/dist/embedded-agent/prompt/modes/plan.js +2 -2
- package/dist/embedded-agent/prompt/modes/review.d.ts +1 -1
- package/dist/embedded-agent/prompt/modes/review.js +1 -1
- package/dist/embedded-agent/prompt/modes/shorty.d.ts +2 -1
- package/dist/embedded-agent/prompt/modes/shorty.js +1 -4
- package/dist/embedded-agent/prompt/sections.d.ts +7 -13
- package/dist/embedded-agent/prompt/sections.js +87 -99
- package/dist/embedded-agent/recovery-wiring.d.ts +31 -0
- package/dist/embedded-agent/recovery-wiring.js +82 -0
- package/dist/embedded-agent/settings.d.ts +18 -0
- package/dist/embedded-agent/settings.js +2 -0
- package/dist/embedded-agent/stream-errors.d.ts +10 -0
- package/dist/embedded-agent/stream-errors.js +53 -0
- package/dist/embedded-agent/stream-events.js +5 -1
- package/dist/embedded-agent/stream-message-state.d.ts +14 -0
- package/dist/embedded-agent/stream-message-state.js +271 -0
- package/dist/embedded-agent/stream-sse.d.ts +78 -0
- package/dist/embedded-agent/stream-sse.js +73 -0
- package/dist/embedded-agent/stream.d.ts +30 -1
- package/dist/embedded-agent/stream.js +309 -330
- package/dist/embedded-agent/suggestions.js +68 -43
- package/dist/embedded-agent/turn-lifecycle.d.ts +40 -0
- package/dist/embedded-agent/turn-lifecycle.js +85 -0
- package/dist/embedded-agent/worker-bridge/dispatch.js +2 -11
- package/dist/embedded-agent/worker-bridge/host-client.d.ts +3 -3
- package/dist/embedded-agent/worker-bridge/host-client.js +19 -26
- package/dist/endpoints.d.ts +4 -0
- package/dist/endpoints.js +4 -0
- package/dist/main.d.ts +3 -1
- package/dist/main.js +119 -53
- package/dist/remote-control/whatsapp/transport.d.ts +35 -1
- package/dist/remote-control/whatsapp/transport.js +3 -2
- package/dist/shared/images/photon.d.ts +1 -1
- package/dist/shared/images/photon.js +1 -1
- package/dist/shell/components/selectors/port-skills-selector.js +1 -1
- package/dist/shell/components/selectors/skills-selector.js +1 -1
- package/dist/shell/export-html/session-view-model.d.ts +1 -0
- package/dist/shell/index.d.ts +0 -1
- package/dist/shell/index.js +0 -1
- package/dist/shell/interactive/interactive-mode.js +11 -4
- package/dist/shell/tools/presentation/registry.js +1 -8
- package/dist/startup/interactive-commands.d.ts +1 -1
- package/dist/startup/interactive-commands.js +29 -8
- package/dist/startup/runtime-routing.d.ts +6 -2
- package/dist/startup/runtime-routing.js +6 -5
- package/dist/startup/sync-xll.d.ts +1 -1
- package/dist/startup/sync-xll.js +1 -1
- package/dist/startup/update-flow.d.ts +20 -0
- package/dist/startup/update-flow.js +22 -0
- package/dist/startup/update-manager.d.ts +1 -1
- package/dist/startup/update-prompt.d.ts +2 -1
- package/dist/startup/update-prompt.js +1 -1
- package/dist/tool-names.d.ts +0 -1
- package/dist/tool-names.js +0 -1
- package/dist/tui/tui.js +9 -0
- package/dist/utils/string.d.ts +3 -0
- package/dist/utils/string.js +8 -0
- package/package.json +30 -18
- package/skills/advanced-mog-api/api-reference.json +14808 -9291
- package/skills/external-services/connections.md +2 -2
- package/skills/external-services/gws.md +1 -1
- package/skills/mcp/SKILL.md +4 -4
- package/user-docs/dist/index.html +4 -4
- package/user-docs/dist/shortcutxl-docs.pdf +0 -0
- package/xll/ShortcutXL.xll +0 -0
- package/xll/python/Lib/site-packages/certifi/__init__.py +1 -1
- package/xll/python/Lib/site-packages/certifi/cacert.pem +0 -41
- package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/METADATA +1 -1
- package/xll/python/Lib/site-packages/certifi-2026.5.20.dist-info/RECORD +14 -0
- package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
- package/xll/python/Lib/site-packages/idna/__main__.py +6 -0
- package/xll/python/Lib/site-packages/idna/cli.py +128 -0
- package/xll/python/Lib/site-packages/idna/codec.py +50 -13
- package/xll/python/Lib/site-packages/idna/compat.py +26 -0
- package/xll/python/Lib/site-packages/idna/core.py +284 -119
- package/xll/python/Lib/site-packages/idna/idnadata.py +3 -4
- package/xll/python/Lib/site-packages/idna/intranges.py +5 -7
- package/xll/python/Lib/site-packages/idna/package_data.py +1 -1
- package/xll/python/Lib/site-packages/idna/uts46data.py +2 -3
- package/xll/python/Lib/site-packages/idna-3.16.dist-info/METADATA +164 -0
- package/xll/python/Lib/site-packages/idna-3.16.dist-info/RECORD +28 -0
- package/xll/python/Lib/site-packages/idna-3.16.dist-info/entry_points.txt +3 -0
- package/xll/python/Lib/site-packages/pip-26.1.1.dist-info/RECORD +3 -3
- package/xll/python/Scripts/httpx.exe +0 -0
- package/xll/python/Scripts/idna.exe +0 -0
- package/xll/python/Scripts/pip.exe +0 -0
- package/xll/python/Scripts/pip3.12.exe +0 -0
- package/xll/python/Scripts/pip3.exe +0 -0
- package/xll/python/vcruntime140.dll +0 -0
- package/agent-docs/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
- package/agent-docs/examples/extensions/sandbox/package-lock.json +0 -92
- package/agent-docs/examples/extensions/with-deps/package-lock.json +0 -31
- package/dist/app/new-sheet-command.d.ts +0 -9
- package/dist/app/new-sheet-command.js +0 -24
- package/dist/app/tools/todo-list.d.ts +0 -34
- package/dist/app/tools/todo-list.js +0 -153
- package/dist/embedded-agent/host-tools/todo-list/contract.d.ts +0 -69
- package/dist/embedded-agent/host-tools/todo-list/contract.js +0 -198
- package/dist/embedded-agent/host-tools/todo-list/index.d.ts +0 -3
- package/dist/embedded-agent/host-tools/todo-list/index.js +0 -3
- package/dist/shell/presentation/todo-widget.d.ts +0 -16
- package/dist/shell/presentation/todo-widget.js +0 -54
- package/xll/python/Lib/site-packages/certifi-2026.4.22.dist-info/RECORD +0 -14
- package/xll/python/Lib/site-packages/idna-3.13.dist-info/METADATA +0 -204
- package/xll/python/Lib/site-packages/idna-3.13.dist-info/RECORD +0 -22
- /package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/INSTALLER +0 -0
- /package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/WHEEL +0 -0
- /package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/licenses/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{certifi-2026.4.22.dist-info → certifi-2026.5.20.dist-info}/top_level.txt +0 -0
- /package/xll/python/Lib/site-packages/{idna-3.13.dist-info → idna-3.16.dist-info}/INSTALLER +0 -0
- /package/xll/python/Lib/site-packages/{idna-3.13.dist-info → idna-3.16.dist-info}/WHEEL +0 -0
- /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
|
|
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
|
-
|
|
11
|
-
|
|
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:
|
|
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
|
-
|
|
58
|
-
|
|
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 `
|
|
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
|
-
├──
|
|
195
|
-
├── node_modules/ # After
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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 &&
|
|
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 &&
|
|
212
|
+
cd /path/to/brave-search && pnpm install
|
|
213
213
|
\`\`\`
|
|
214
214
|
|
|
215
215
|
## Search
|
package/agent-docs/docs/tui.md
CHANGED
|
@@ -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
|
|
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
|
-
|
|
469
|
-
|
|
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
|
-
|
|
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 &&
|
|
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:
|
|
3
|
+
* Run: pnpm exec tsx test.ts [model-id] [--thinking]
|
|
4
4
|
*
|
|
5
5
|
* Examples:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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 `
|
|
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:
|
|
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:
|
|
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:
|
|
23
|
-
2. Test:
|
|
24
|
-
3. 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({
|
|
@@ -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
|
-
|
|
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
|
-
|
|
893
|
-
|
|
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(),
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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);
|
package/dist/app/index.d.ts
CHANGED
|
@@ -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 {
|
|
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
|
|
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 {
|
|
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,
|
|
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
|
|
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,
|
|
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>;
|