shortcutxl 0.2.0
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/README.md +59 -0
- package/agent-docs/README.md +397 -0
- package/agent-docs/docs/compaction.md +390 -0
- package/agent-docs/docs/custom-provider.md +580 -0
- package/agent-docs/docs/development.md +69 -0
- package/agent-docs/docs/extensions.md +1971 -0
- package/agent-docs/docs/json.md +79 -0
- package/agent-docs/docs/keybindings.md +174 -0
- package/agent-docs/docs/models.md +293 -0
- package/agent-docs/docs/packages.md +209 -0
- package/agent-docs/docs/prompt-templates.md +67 -0
- package/agent-docs/docs/providers.md +186 -0
- package/agent-docs/docs/rpc.md +1317 -0
- package/agent-docs/docs/sdk.md +962 -0
- package/agent-docs/docs/session.md +412 -0
- package/agent-docs/docs/settings.md +223 -0
- package/agent-docs/docs/shell-aliases.md +13 -0
- package/agent-docs/docs/skills.md +231 -0
- package/agent-docs/docs/terminal-setup.md +70 -0
- package/agent-docs/docs/termux.md +127 -0
- package/agent-docs/docs/themes.md +295 -0
- package/agent-docs/docs/tree.md +219 -0
- package/agent-docs/docs/tui.md +887 -0
- package/agent-docs/docs/windows.md +17 -0
- package/agent-docs/examples/README.md +25 -0
- package/agent-docs/examples/extensions/README.md +205 -0
- package/agent-docs/examples/extensions/antigravity-image-gen.ts +447 -0
- package/agent-docs/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/agent-docs/examples/extensions/bash-spawn-hook.ts +30 -0
- package/agent-docs/examples/extensions/bookmark.ts +50 -0
- package/agent-docs/examples/extensions/built-in-tool-renderer.ts +256 -0
- package/agent-docs/examples/extensions/claude-rules.ts +86 -0
- package/agent-docs/examples/extensions/commands.ts +75 -0
- package/agent-docs/examples/extensions/confirm-destructive.ts +59 -0
- package/agent-docs/examples/extensions/custom-compaction.ts +126 -0
- package/agent-docs/examples/extensions/custom-footer.ts +63 -0
- package/agent-docs/examples/extensions/custom-header.ts +73 -0
- package/agent-docs/examples/extensions/custom-provider-anthropic/index.ts +660 -0
- package/agent-docs/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/agent-docs/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/agent-docs/examples/extensions/custom-provider-gitlab-duo/index.ts +362 -0
- package/agent-docs/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/agent-docs/examples/extensions/custom-provider-gitlab-duo/test.ts +88 -0
- package/agent-docs/examples/extensions/custom-provider-qwen-cli/index.ts +349 -0
- package/agent-docs/examples/extensions/custom-provider-qwen-cli/package.json +16 -0
- package/agent-docs/examples/extensions/dirty-repo-guard.ts +56 -0
- package/agent-docs/examples/extensions/doom-overlay/README.md +46 -0
- package/agent-docs/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/agent-docs/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/agent-docs/examples/extensions/doom-overlay/doom-component.ts +133 -0
- package/agent-docs/examples/extensions/doom-overlay/doom-engine.ts +186 -0
- package/agent-docs/examples/extensions/doom-overlay/doom-keys.ts +108 -0
- package/agent-docs/examples/extensions/doom-overlay/index.ts +74 -0
- package/agent-docs/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/agent-docs/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/agent-docs/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/agent-docs/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/agent-docs/examples/extensions/dynamic-resources/index.ts +15 -0
- package/agent-docs/examples/extensions/dynamic-tools.ts +77 -0
- package/agent-docs/examples/extensions/event-bus.ts +43 -0
- package/agent-docs/examples/extensions/file-trigger.ts +41 -0
- package/agent-docs/examples/extensions/git-checkpoint.ts +53 -0
- package/agent-docs/examples/extensions/handoff.ts +155 -0
- package/agent-docs/examples/extensions/hello.ts +25 -0
- package/agent-docs/examples/extensions/inline-bash.ts +94 -0
- package/agent-docs/examples/extensions/input-transform.ts +43 -0
- package/agent-docs/examples/extensions/interactive-shell.ts +209 -0
- package/agent-docs/examples/extensions/mac-system-theme.ts +47 -0
- package/agent-docs/examples/extensions/message-renderer.ts +59 -0
- package/agent-docs/examples/extensions/minimal-mode.ts +430 -0
- package/agent-docs/examples/extensions/modal-editor.ts +90 -0
- package/agent-docs/examples/extensions/model-status.ts +31 -0
- package/agent-docs/examples/extensions/notify.ts +55 -0
- package/agent-docs/examples/extensions/overlay-qa-tests.ts +936 -0
- package/agent-docs/examples/extensions/overlay-test.ts +159 -0
- package/agent-docs/examples/extensions/permission-gate.ts +37 -0
- package/agent-docs/examples/extensions/pirate.ts +47 -0
- package/agent-docs/examples/extensions/plan-mode/README.md +65 -0
- package/agent-docs/examples/extensions/plan-mode/index.ts +363 -0
- package/agent-docs/examples/extensions/plan-mode/utils.ts +173 -0
- package/agent-docs/examples/extensions/preset.ts +418 -0
- package/agent-docs/examples/extensions/protected-paths.ts +30 -0
- package/agent-docs/examples/extensions/qna.ts +122 -0
- package/agent-docs/examples/extensions/question.ts +278 -0
- package/agent-docs/examples/extensions/questionnaire.ts +440 -0
- package/agent-docs/examples/extensions/rainbow-editor.ts +90 -0
- package/agent-docs/examples/extensions/reload-runtime.ts +37 -0
- package/agent-docs/examples/extensions/rpc-demo.ts +124 -0
- package/agent-docs/examples/extensions/sandbox/index.ts +324 -0
- package/agent-docs/examples/extensions/sandbox/package-lock.json +92 -0
- package/agent-docs/examples/extensions/sandbox/package.json +19 -0
- package/agent-docs/examples/extensions/send-user-message.ts +97 -0
- package/agent-docs/examples/extensions/session-name.ts +27 -0
- package/agent-docs/examples/extensions/shutdown-command.ts +69 -0
- package/agent-docs/examples/extensions/snake.ts +343 -0
- package/agent-docs/examples/extensions/space-invaders.ts +566 -0
- package/agent-docs/examples/extensions/ssh.ts +233 -0
- package/agent-docs/examples/extensions/status-line.ts +40 -0
- package/agent-docs/examples/extensions/subagent/README.md +172 -0
- package/agent-docs/examples/extensions/subagent/agents/planner.md +37 -0
- package/agent-docs/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/agent-docs/examples/extensions/subagent/agents/scout.md +50 -0
- package/agent-docs/examples/extensions/subagent/agents/worker.md +24 -0
- package/agent-docs/examples/extensions/subagent/agents.ts +130 -0
- package/agent-docs/examples/extensions/subagent/index.ts +1068 -0
- package/agent-docs/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/agent-docs/examples/extensions/subagent/prompts/implement.md +10 -0
- package/agent-docs/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/agent-docs/examples/extensions/summarize.ts +206 -0
- package/agent-docs/examples/extensions/system-prompt-header.ts +17 -0
- package/agent-docs/examples/extensions/timed-confirm.ts +72 -0
- package/agent-docs/examples/extensions/titlebar-spinner.ts +58 -0
- package/agent-docs/examples/extensions/todo.ts +314 -0
- package/agent-docs/examples/extensions/tool-override.ts +146 -0
- package/agent-docs/examples/extensions/tools.ts +145 -0
- package/agent-docs/examples/extensions/trigger-compact.ts +40 -0
- package/agent-docs/examples/extensions/truncated-tool.ts +194 -0
- package/agent-docs/examples/extensions/widget-placement.ts +17 -0
- package/agent-docs/examples/extensions/with-deps/index.ts +37 -0
- package/agent-docs/examples/extensions/with-deps/package-lock.json +31 -0
- package/agent-docs/examples/extensions/with-deps/package.json +22 -0
- package/agent-docs/examples/rpc-extension-ui.ts +654 -0
- package/agent-docs/examples/sdk/01-minimal.ts +22 -0
- package/agent-docs/examples/sdk/02-custom-model.ts +48 -0
- package/agent-docs/examples/sdk/03-custom-prompt.ts +55 -0
- package/agent-docs/examples/sdk/04-skills.ts +53 -0
- package/agent-docs/examples/sdk/05-tools.ts +56 -0
- package/agent-docs/examples/sdk/06-extensions.ts +88 -0
- package/agent-docs/examples/sdk/07-context-files.ts +40 -0
- package/agent-docs/examples/sdk/08-prompt-templates.ts +47 -0
- package/agent-docs/examples/sdk/09-api-keys-and-oauth.ts +48 -0
- package/agent-docs/examples/sdk/10-settings.ts +54 -0
- package/agent-docs/examples/sdk/11-sessions.ts +48 -0
- package/agent-docs/examples/sdk/12-full-control.ts +82 -0
- package/agent-docs/examples/sdk/README.md +144 -0
- package/agent-docs/xll-skill.md +61 -0
- package/agent-docs/xll-spec.md +110 -0
- package/dist/cli/args.js +290 -0
- package/dist/cli/config-selector.js +31 -0
- package/dist/cli/file-processor.js +79 -0
- package/dist/cli/list-models.js +92 -0
- package/dist/cli/package-commands.js +210 -0
- package/dist/cli/report-settings-errors.js +11 -0
- package/dist/cli/session-picker.js +34 -0
- package/dist/cli.js +19 -0
- package/dist/config.js +288 -0
- package/dist/core/abort.js +15 -0
- package/dist/core/agent-loop.js +352 -0
- package/dist/core/agent-session.js +2019 -0
- package/dist/core/agent.js +410 -0
- package/dist/core/auth-storage.js +456 -0
- package/dist/core/bash-executor.js +222 -0
- package/dist/core/compaction/branch-summarization.js +242 -0
- package/dist/core/compaction/compaction.js +610 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/utils.js +139 -0
- package/dist/core/defaults.js +6 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/exec.js +71 -0
- package/dist/core/export-html/ansi-to-html.js +256 -0
- package/dist/core/export-html/index.js +238 -0
- package/dist/core/export-html/session-view-model.js +342 -0
- package/dist/core/export-html/template.css +1110 -0
- package/dist/core/export-html/template.html +76 -0
- package/dist/core/export-html/template.js +1990 -0
- package/dist/core/export-html/tool-renderer.js +63 -0
- package/dist/core/export-html/vendor/highlight.min.js +7725 -0
- package/dist/core/export-html/vendor/marked.min.js +1803 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/loader.js +422 -0
- package/dist/core/extensions/runner.js +651 -0
- package/dist/core/extensions/types.js +35 -0
- package/dist/core/extensions/wrapper.js +102 -0
- package/dist/core/footer-data-provider.js +162 -0
- package/dist/core/index.js +9 -0
- package/dist/core/keybindings.js +153 -0
- package/dist/core/messages.js +133 -0
- package/dist/core/model-registry.js +539 -0
- package/dist/core/model-resolver.js +370 -0
- package/dist/core/package-manager.js +1485 -0
- package/dist/core/prompt-templates.js +253 -0
- package/dist/core/resolve-config-value.js +59 -0
- package/dist/core/resource-loader.js +700 -0
- package/dist/core/sdk.js +197 -0
- package/dist/core/session-bash.js +99 -0
- package/dist/core/session-compaction.js +165 -0
- package/dist/core/session-manager.js +1153 -0
- package/dist/core/session-models.js +99 -0
- package/dist/core/session-retry.js +155 -0
- package/dist/core/settings-manager.js +572 -0
- package/dist/core/skills.js +382 -0
- package/dist/core/slash-commands.js +31 -0
- package/dist/core/system-prompt.js +161 -0
- package/dist/core/theme.js +770 -0
- package/dist/core/timings.js +26 -0
- package/dist/core/tools/bash.js +258 -0
- package/dist/core/tools/edit-diff.js +245 -0
- package/dist/core/tools/edit.js +148 -0
- package/dist/core/tools/find.js +208 -0
- package/dist/core/tools/grep.js +246 -0
- package/dist/core/tools/index.js +67 -0
- package/dist/core/tools/ls.js +123 -0
- package/dist/core/tools/path-utils.js +81 -0
- package/dist/core/tools/read.js +160 -0
- package/dist/core/tools/truncate.js +70 -0
- package/dist/core/tools/write.js +82 -0
- package/dist/custom/agents/action.js +13 -0
- package/dist/custom/agents/document-reader.js +70 -0
- package/dist/custom/agents/general.js +26 -0
- package/dist/custom/agents/index.js +49 -0
- package/dist/custom/agents/installation.js +13 -0
- package/dist/custom/agents/types.js +7 -0
- package/dist/custom/auth/refresh-timer.js +33 -0
- package/dist/custom/auth/shortcut-oauth.js +145 -0
- package/dist/custom/constants.js +21 -0
- package/dist/custom/context/workbook-summary.js +73 -0
- package/dist/custom/credits/shortcut-credits.js +29 -0
- package/dist/custom/cron/cron-daemon-entry.js +18 -0
- package/dist/custom/cron/daemon-ipc.js +131 -0
- package/dist/custom/cron/daemon.js +224 -0
- package/dist/custom/cron/jobs.js +226 -0
- package/dist/custom/cron/run-log.js +51 -0
- package/dist/custom/cron/schedule.js +72 -0
- package/dist/custom/cron/status-line.js +98 -0
- package/dist/custom/cron/store.js +87 -0
- package/dist/custom/cron/types.js +8 -0
- package/dist/custom/dev/index.js +59 -0
- package/dist/custom/dev/trace-export.js +58 -0
- package/dist/custom/ensure-excel.js +63 -0
- package/dist/custom/excel-config.js +36 -0
- package/dist/custom/preflight.js +422 -0
- package/dist/custom/prompts/action.js +100 -0
- package/dist/custom/prompts/api.js +66 -0
- package/dist/custom/prompts/installation.js +124 -0
- package/dist/custom/prompts/shared.js +138 -0
- package/dist/custom/providers/llm-usage.js +42 -0
- package/dist/custom/providers/message-converter.js +74 -0
- package/dist/custom/providers/provider-ids.js +9 -0
- package/dist/custom/providers/register-openai-codex-provider.js +27 -0
- package/dist/custom/providers/register-shortcut-provider.js +52 -0
- package/dist/custom/providers/shortcut-invoke.js +117 -0
- package/dist/custom/providers/shortcut-stream.js +252 -0
- package/dist/custom/providers/sse-protocol.js +38 -0
- package/dist/custom/sync-xll.js +130 -0
- package/dist/custom/tools/cron.js +413 -0
- package/dist/custom/tools/excel-exec.js +167 -0
- package/dist/custom/tools/excel-range.js +50 -0
- package/dist/custom/tools/llm-analysis.js +265 -0
- package/dist/custom/tools/render-helpers.js +38 -0
- package/dist/custom/tools/switch-mode.js +94 -0
- package/dist/custom/tools/task/agents.js +6 -0
- package/dist/custom/tools/task/index.js +8 -0
- package/dist/custom/tools/task/render.js +348 -0
- package/dist/custom/tools/task/subprocess.js +320 -0
- package/dist/custom/tools/task/task.js +205 -0
- package/dist/custom/tools/todo-list.js +195 -0
- package/dist/custom/tracing/session-upload.js +93 -0
- package/dist/index.js +45 -0
- package/dist/main.js +613 -0
- package/dist/migrations.js +265 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/interactive/components/armin.js +337 -0
- package/dist/modes/interactive/components/assistant-message.js +94 -0
- package/dist/modes/interactive/components/bash-execution.js +171 -0
- package/dist/modes/interactive/components/bordered-loader.js +51 -0
- package/dist/modes/interactive/components/branch-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +46 -0
- package/dist/modes/interactive/components/config-selector.js +488 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/custom-editor.js +93 -0
- package/dist/modes/interactive/components/custom-message.js +81 -0
- package/dist/modes/interactive/components/daxnuts.js +140 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/extension-editor.js +105 -0
- package/dist/modes/interactive/components/extension-input.js +61 -0
- package/dist/modes/interactive/components/extension-selector.js +78 -0
- package/dist/modes/interactive/components/footer.js +309 -0
- package/dist/modes/interactive/components/index.js +33 -0
- package/dist/modes/interactive/components/keybinding-hints.js +61 -0
- package/dist/modes/interactive/components/layout.js +64 -0
- package/dist/modes/interactive/components/login-dialog.js +148 -0
- package/dist/modes/interactive/components/model-selector.js +237 -0
- package/dist/modes/interactive/components/oauth-selector.js +111 -0
- package/dist/modes/interactive/components/session-selector-search.js +157 -0
- package/dist/modes/interactive/components/session-selector.js +860 -0
- package/dist/modes/interactive/components/settings-selector.js +123 -0
- package/dist/modes/interactive/components/show-images-selector.js +35 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +48 -0
- package/dist/modes/interactive/components/theme-selector.js +47 -0
- package/dist/modes/interactive/components/thinking-selector.js +47 -0
- package/dist/modes/interactive/components/tool-execution.js +789 -0
- package/dist/modes/interactive/components/tool-group.js +106 -0
- package/dist/modes/interactive/components/tree-selector.js +962 -0
- package/dist/modes/interactive/components/user-message-selector.js +115 -0
- package/dist/modes/interactive/components/user-message.js +48 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/file-attachments.js +135 -0
- package/dist/modes/interactive/interactive-mode.js +3775 -0
- package/dist/modes/interactive/theme/dark.json +85 -0
- package/dist/modes/interactive/theme/light.json +85 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.js +177 -0
- package/dist/modes/print-mode.js +101 -0
- package/dist/modes/rpc/rpc-client.js +387 -0
- package/dist/modes/rpc/rpc-mode.js +509 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/subagent-entry.js +145 -0
- package/dist/tool-names.js +34 -0
- package/dist/tui/autocomplete.js +596 -0
- package/dist/tui/components/box.js +104 -0
- package/dist/tui/components/cancellable-loader.js +35 -0
- package/dist/tui/components/editor.js +1679 -0
- package/dist/tui/components/image.js +69 -0
- package/dist/tui/components/input.js +433 -0
- package/dist/tui/components/loader.js +49 -0
- package/dist/tui/components/markdown.js +629 -0
- package/dist/tui/components/select-list.js +152 -0
- package/dist/tui/components/settings-list.js +185 -0
- package/dist/tui/components/spacer.js +23 -0
- package/dist/tui/components/text.js +89 -0
- package/dist/tui/components/truncated-text.js +51 -0
- package/dist/tui/editor-component.js +2 -0
- package/dist/tui/fuzzy.js +107 -0
- package/dist/tui/get-east-asian-width/index.js +32 -0
- package/dist/tui/get-east-asian-width/lookup.js +404 -0
- package/dist/tui/index.js +32 -0
- package/dist/tui/keybindings.js +114 -0
- package/dist/tui/keys.js +959 -0
- package/dist/tui/kill-ring.js +44 -0
- package/dist/tui/stdin-buffer.js +317 -0
- package/dist/tui/terminal-image.js +288 -0
- package/dist/tui/terminal.js +249 -0
- package/dist/tui/tui/autocomplete.js +596 -0
- package/dist/tui/tui/components/box.js +106 -0
- package/dist/tui/tui/components/cancellable-loader.js +35 -0
- package/dist/tui/tui/components/editor.js +1679 -0
- package/dist/tui/tui/components/image.js +69 -0
- package/dist/tui/tui/components/input.js +433 -0
- package/dist/tui/tui/components/loader.js +49 -0
- package/dist/tui/tui/components/markdown.js +629 -0
- package/dist/tui/tui/components/select-list.js +152 -0
- package/dist/tui/tui/components/settings-list.js +185 -0
- package/dist/tui/tui/components/spacer.js +23 -0
- package/dist/tui/tui/components/text.js +91 -0
- package/dist/tui/tui/components/truncated-text.js +51 -0
- package/dist/tui/tui/editor-component.js +2 -0
- package/dist/tui/tui/fuzzy.js +107 -0
- package/dist/tui/tui/get-east-asian-width/index.js +32 -0
- package/dist/tui/tui/get-east-asian-width/lookup.js +404 -0
- package/dist/tui/tui/index.js +32 -0
- package/dist/tui/tui/keybindings.js +114 -0
- package/dist/tui/tui/keys.js +959 -0
- package/dist/tui/tui/kill-ring.js +44 -0
- package/dist/tui/tui/stdin-buffer.js +317 -0
- package/dist/tui/tui/terminal-image.js +288 -0
- package/dist/tui/tui/terminal.js +249 -0
- package/dist/tui/tui/tui.js +955 -0
- package/dist/tui/tui/undo-stack.js +25 -0
- package/dist/tui/tui/utils.js +800 -0
- package/dist/tui/tui.js +955 -0
- package/dist/tui/undo-stack.js +25 -0
- package/dist/tui/utils.js +800 -0
- package/dist/utils/changelog.js +87 -0
- package/dist/utils/clipboard-image.js +164 -0
- package/dist/utils/clipboard-native.js +14 -0
- package/dist/utils/clipboard.js +67 -0
- package/dist/utils/frontmatter.js +26 -0
- package/dist/utils/git.js +166 -0
- package/dist/utils/image-convert.js +35 -0
- package/dist/utils/image-resize.js +183 -0
- package/dist/utils/mime.js +26 -0
- package/dist/utils/photon.js +121 -0
- package/dist/utils/shell.js +217 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/tools-manager.js +259 -0
- package/package.json +78 -0
- package/skills/excel-com-api/SKILL.md +74 -0
- package/skills/excel-com-api/excel-type-library.py +27767 -0
- package/skills/excel-com-api/office-type-library.py +10867 -0
- package/skills/integrations/SKILL.md +138 -0
- package/skills/integrations/alphasense.md +457 -0
- package/skills/integrations/bloomberg.md +803 -0
- package/skills/integrations/calcbench.md +315 -0
- package/skills/integrations/capiq.md +848 -0
- package/skills/integrations/dynamics-365-finance.md +354 -0
- package/skills/integrations/earnings_transcripts.md +387 -0
- package/skills/integrations/factset.md +758 -0
- package/skills/integrations/ice-fixed-income.md +344 -0
- package/skills/integrations/moodys-analytics.md +313 -0
- package/skills/integrations/morningstar.md +433 -0
- package/skills/integrations/nasdaq-data-link.md +249 -0
- package/skills/integrations/pitchbook.md +413 -0
- package/skills/integrations/preqin.md +422 -0
- package/skills/integrations/quickbooks.md +289 -0
- package/skills/integrations/quickfs.md +314 -0
- package/skills/integrations/refinitiv.md +473 -0
- package/skills/integrations/sage-intacct.md +401 -0
- package/skills/integrations/visible-alpha.md +320 -0
- package/skills/integrations/xero.md +393 -0
- package/skills/integrations/ycharts.md +306 -0
- package/skills/pdf-creation/SKILL.md +93 -0
- package/skills/pdf-extraction/SKILL.md +32 -0
- package/skills/powerpoint-creation/SKILL.md +110 -0
- package/skills/sec-edgar/SKILL.md +127 -0
- package/skills/sec-edgar/sec_to_pdf.py +109 -0
- package/xll/ShortcutXL.xll +0 -0
- package/xll/modules/debug_render.py +272 -0
- package/xll/modules/gameboy.py +241 -0
- package/xll/modules/pong.py +188 -0
- package/xll/modules/shortcut_xl/__init__.py +18 -0
- package/xll/modules/shortcut_xl/_categorize.py +200 -0
- package/xll/modules/shortcut_xl/_com.py +108 -0
- package/xll/modules/shortcut_xl/_format.py +252 -0
- package/xll/modules/shortcut_xl/_log.py +12 -0
- package/xll/modules/shortcut_xl/_managed.py +116 -0
- package/xll/modules/shortcut_xl/_registry.py +44 -0
- package/xll/modules/shortcut_xl/_threading.py +161 -0
- package/xll/modules/shortcut_xl/_tracking.py +283 -0
- package/xll/modules/stocks.py +100 -0
- package/xll/python3.dll +0 -0
- package/xll/python312.dll +0 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Analysis tool — sends local files (images, PDFs, text) to a vision LLM
|
|
3
|
+
* via the backend proxy for analysis/extraction.
|
|
4
|
+
*
|
|
5
|
+
* Output is always written to the agent temp directory.
|
|
6
|
+
*/
|
|
7
|
+
import { readFile, mkdir, writeFile, readdir, stat, unlink } from 'fs/promises';
|
|
8
|
+
import { join, extname, basename } from 'path';
|
|
9
|
+
import { Type } from '@sinclair/typebox';
|
|
10
|
+
import { LLM_ANALYSIS } from '../../tool-names.js';
|
|
11
|
+
import { SHORTCUT_PROVIDER_ID } from '../providers/provider-ids.js';
|
|
12
|
+
import { APP_NAME, getAgentDir } from '../../config.js';
|
|
13
|
+
import { Text } from '../../tui/index.js';
|
|
14
|
+
const TOOL_NAME = LLM_ANALYSIS;
|
|
15
|
+
const OUTPUT_DIR_NAME = 'llm_analysis';
|
|
16
|
+
const CLEANUP_MAX_AGE_MS = 60 * 60 * 1000; // 1 hour
|
|
17
|
+
/** MIME types for binary files sent as base64 image blocks. */
|
|
18
|
+
const IMAGE_EXTENSIONS = {
|
|
19
|
+
'.png': 'image/png',
|
|
20
|
+
'.jpg': 'image/jpeg',
|
|
21
|
+
'.jpeg': 'image/jpeg',
|
|
22
|
+
'.gif': 'image/gif',
|
|
23
|
+
'.webp': 'image/webp',
|
|
24
|
+
};
|
|
25
|
+
/** Extensions treated as readable text (sent as text blocks). */
|
|
26
|
+
const TEXT_EXTENSIONS = new Set([
|
|
27
|
+
'.txt', '.csv', '.tsv', '.json', '.jsonl', '.md', '.xml', '.yaml', '.yml',
|
|
28
|
+
'.html', '.css', '.js', '.ts', '.py', '.sql', '.log', '.sh', '.cfg', '.ini',
|
|
29
|
+
'.toml', '.env', '.bat', '.ps1', '.r', '.sas', '.do', '.vba', '.bas',
|
|
30
|
+
]);
|
|
31
|
+
const MODELS = {
|
|
32
|
+
'gemini-3-flash-preview': 'gemini-3-flash-preview',
|
|
33
|
+
'claude-haiku-4-5-20251001': 'claude-haiku-4-5-20251001',
|
|
34
|
+
};
|
|
35
|
+
const DEFAULT_MODEL = 'gemini-3-flash-preview';
|
|
36
|
+
const SYSTEM_PROMPT = `You are a document extraction assistant.
|
|
37
|
+
|
|
38
|
+
Extraction rules:
|
|
39
|
+
- Preserve data exactly: extracted numbers, formulas, formatting, and text must match the source precisely
|
|
40
|
+
- For structured data extractions such as tables
|
|
41
|
+
- The delimiter used must be unambiguous and not included in the data itself. Use pipes \`|\` by default.
|
|
42
|
+
- Make sure to handle empty values appropriately (e.g., "| |"). Skipping empty values will cause errors when programmatic extraction is done
|
|
43
|
+
|
|
44
|
+
Referencing:
|
|
45
|
+
- Ensure that extracted data is cited. For example, [Page X, Table "Name"] or [Page X, Section "Name"] before a dump of data blocks.
|
|
46
|
+
- IMPORTANT: Always cite using page numbers from the source document (on the bottom right of the page)`;
|
|
47
|
+
const TOOL_DESCRIPTION = `\
|
|
48
|
+
Analyzes files using a vision LLM (Gemini Flash or Claude Haiku). Sends files to the LLM and saves the analysis output to a temp file.
|
|
49
|
+
|
|
50
|
+
Supported image types: ${Object.keys(IMAGE_EXTENSIONS).join(', ')}
|
|
51
|
+
Supported text types: ${[...TEXT_EXTENSIONS].join(', ')}
|
|
52
|
+
Also supports: .pdf
|
|
53
|
+
|
|
54
|
+
MODEL SELECTION:
|
|
55
|
+
- "gemini-3-flash-preview" (default): Best for careful extraction, tables, and especially images
|
|
56
|
+
- "claude-haiku-4-5-20251001": Quick scanning, structure discovery
|
|
57
|
+
|
|
58
|
+
FOR EXTRACTION TASKS:
|
|
59
|
+
- Pay close attention to edge cases, such as commas, spaces, signs and null values.
|
|
60
|
+
- For financial data, parentheses are used to indicate negative values.
|
|
61
|
+
|
|
62
|
+
Output is saved to a temp file and the path is returned. Read the file to see the full output.`;
|
|
63
|
+
const schema = Type.Object({
|
|
64
|
+
description: Type.String({
|
|
65
|
+
description: "Brief human-readable description of what this analysis will do (e.g., 'Extracting sales data from Q4 report')",
|
|
66
|
+
}),
|
|
67
|
+
file_paths: Type.Array(Type.String(), {
|
|
68
|
+
description: 'List of local file paths to analyze (e.g., ["C:/Users/me/report.pdf"]). Max 20.',
|
|
69
|
+
maxItems: 20,
|
|
70
|
+
}),
|
|
71
|
+
query: Type.String({
|
|
72
|
+
description: 'The question/instruction for the LLM about the file content.',
|
|
73
|
+
}),
|
|
74
|
+
model: Type.Optional(Type.String({
|
|
75
|
+
description: `Model to use: '${DEFAULT_MODEL}' (default, best for images/tables) or 'claude-haiku-4-5-20251001' (fallback/verifier)`,
|
|
76
|
+
})),
|
|
77
|
+
output_filename: Type.Optional(Type.String({
|
|
78
|
+
description: "Optional output filename (e.g., 'analysis.md'). Auto-generated if omitted.",
|
|
79
|
+
})),
|
|
80
|
+
});
|
|
81
|
+
/** Get (and create) the output directory for analysis results. */
|
|
82
|
+
async function getOutputDir() {
|
|
83
|
+
const dir = join(getAgentDir(), 'temp', OUTPUT_DIR_NAME);
|
|
84
|
+
await mkdir(dir, { recursive: true });
|
|
85
|
+
return dir;
|
|
86
|
+
}
|
|
87
|
+
/** Clean up files older than CLEANUP_MAX_AGE_MS. Best-effort, never throws. */
|
|
88
|
+
async function cleanupOldFiles(dir) {
|
|
89
|
+
try {
|
|
90
|
+
const entries = await readdir(dir);
|
|
91
|
+
const now = Date.now();
|
|
92
|
+
for (const entry of entries) {
|
|
93
|
+
try {
|
|
94
|
+
const filePath = join(dir, entry);
|
|
95
|
+
const fileStat = await stat(filePath);
|
|
96
|
+
if (fileStat.isFile() && now - fileStat.mtimeMs > CLEANUP_MAX_AGE_MS) {
|
|
97
|
+
await unlink(filePath);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
// skip individual file errors
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// directory might not exist yet
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** Build the content blocks for the LLM request. */
|
|
110
|
+
async function buildContent(filePaths, query) {
|
|
111
|
+
const contentBlocks = [];
|
|
112
|
+
for (const filePath of filePaths) {
|
|
113
|
+
const ext = extname(filePath).toLowerCase();
|
|
114
|
+
if (ext === '.pdf') {
|
|
115
|
+
// PDF: send as base64 document source
|
|
116
|
+
const buffer = await readFile(filePath);
|
|
117
|
+
const base64 = buffer.toString('base64');
|
|
118
|
+
contentBlocks.push({
|
|
119
|
+
type: 'image_url',
|
|
120
|
+
image_url: { url: `data:application/pdf;base64,${base64}` },
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
else if (IMAGE_EXTENSIONS[ext]) {
|
|
124
|
+
// Image: send as base64 image
|
|
125
|
+
const buffer = await readFile(filePath);
|
|
126
|
+
const base64 = buffer.toString('base64');
|
|
127
|
+
contentBlocks.push({
|
|
128
|
+
type: 'image_url',
|
|
129
|
+
image_url: { url: `data:${IMAGE_EXTENSIONS[ext]};base64,${base64}` },
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else if (TEXT_EXTENSIONS.has(ext)) {
|
|
133
|
+
// Text: read and include as text block
|
|
134
|
+
const buffer = await readFile(filePath);
|
|
135
|
+
const text = buffer.toString('utf-8');
|
|
136
|
+
contentBlocks.push({
|
|
137
|
+
type: 'text',
|
|
138
|
+
text: `--- File: ${basename(filePath)} ---\n${text}`,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
// Unknown extension: try as text
|
|
143
|
+
const buffer = await readFile(filePath);
|
|
144
|
+
const text = buffer.toString('utf-8');
|
|
145
|
+
contentBlocks.push({
|
|
146
|
+
type: 'text',
|
|
147
|
+
text: `--- File: ${basename(filePath)} ---\n${text}`,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Add the query
|
|
152
|
+
if (filePaths.length > 0) {
|
|
153
|
+
const filesList = filePaths.map((fp) => `- ${basename(fp)}`).join('\n');
|
|
154
|
+
contentBlocks.push({
|
|
155
|
+
type: 'text',
|
|
156
|
+
text: `Query: ${query}\n\nFiles:\n${filesList}`,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
contentBlocks.push({ type: 'text', text: query });
|
|
161
|
+
}
|
|
162
|
+
return [
|
|
163
|
+
{ role: 'system', content: SYSTEM_PROMPT },
|
|
164
|
+
{ role: 'human', content: contentBlocks },
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
export function createLlmAnalysisTool(baseUrl) {
|
|
168
|
+
return {
|
|
169
|
+
name: TOOL_NAME,
|
|
170
|
+
label: 'LLM Analysis',
|
|
171
|
+
description: TOOL_DESCRIPTION,
|
|
172
|
+
parameters: schema,
|
|
173
|
+
renderCall(args, options, theme) {
|
|
174
|
+
const desc = typeof args?.description === 'string' ? args.description : '';
|
|
175
|
+
const label = desc || 'llm_analysis';
|
|
176
|
+
const title = theme.fg('toolTitle', theme.bold(`🔍 ${label}`));
|
|
177
|
+
if (!options.expanded) {
|
|
178
|
+
return new Text(title, 0, 0);
|
|
179
|
+
}
|
|
180
|
+
const files = Array.isArray(args?.file_paths)
|
|
181
|
+
? args.file_paths.map((fp) => ` ${basename(fp)}`).join('\n')
|
|
182
|
+
: '';
|
|
183
|
+
const model = args?.model || DEFAULT_MODEL;
|
|
184
|
+
const details = [
|
|
185
|
+
files ? `Files:\n${files}` : '',
|
|
186
|
+
`Model: ${model}`,
|
|
187
|
+
args?.query ? `Query: ${args.query}` : '',
|
|
188
|
+
]
|
|
189
|
+
.filter(Boolean)
|
|
190
|
+
.join('\n');
|
|
191
|
+
return new Text(`${title}\n\n${theme.fg('toolOutput', details)}`, 0, 0);
|
|
192
|
+
},
|
|
193
|
+
renderResult(result, options, theme) {
|
|
194
|
+
if (!options.expanded)
|
|
195
|
+
return undefined;
|
|
196
|
+
const textBlocks = result.content?.filter((c) => c.type === 'text') || [];
|
|
197
|
+
const output = textBlocks.map((c) => ('text' in c ? c.text : '') || '').join('\n');
|
|
198
|
+
if (!output)
|
|
199
|
+
return undefined;
|
|
200
|
+
return new Text(theme.fg('toolOutput', output), 0, 0);
|
|
201
|
+
},
|
|
202
|
+
async execute(toolCallId, { description: _description, file_paths, query, model, output_filename }, signal, _onUpdate, ctx) {
|
|
203
|
+
const selectedModel = (model && model in MODELS ? model : DEFAULT_MODEL);
|
|
204
|
+
// Get output dir and clean old files
|
|
205
|
+
const outputDir = await getOutputDir();
|
|
206
|
+
await cleanupOldFiles(outputDir);
|
|
207
|
+
// Get API key from model registry
|
|
208
|
+
const apiKey = ctx?.modelRegistry
|
|
209
|
+
? await ctx.modelRegistry.getApiKeyForProvider(SHORTCUT_PROVIDER_ID)
|
|
210
|
+
: undefined;
|
|
211
|
+
if (!apiKey) {
|
|
212
|
+
throw new Error('Not authenticated. Please log in first.');
|
|
213
|
+
}
|
|
214
|
+
// Build LLM messages
|
|
215
|
+
const messages = await buildContent(file_paths, query);
|
|
216
|
+
// Call the backend /api/llm/invoke endpoint
|
|
217
|
+
const body = {
|
|
218
|
+
model: MODELS[selectedModel],
|
|
219
|
+
messages,
|
|
220
|
+
effort_level: 'low',
|
|
221
|
+
thinking_type: 'off',
|
|
222
|
+
};
|
|
223
|
+
let response;
|
|
224
|
+
try {
|
|
225
|
+
response = await fetch(`${baseUrl}/api/llm/invoke`, {
|
|
226
|
+
method: 'POST',
|
|
227
|
+
headers: {
|
|
228
|
+
'Content-Type': 'application/json',
|
|
229
|
+
Authorization: `Bearer ${apiKey}`,
|
|
230
|
+
'User-Agent': `Mozilla/5.0 (compatible; ${APP_NAME}-coding-agent/1.0)`,
|
|
231
|
+
},
|
|
232
|
+
body: JSON.stringify(body),
|
|
233
|
+
signal,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
catch (e) {
|
|
237
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
238
|
+
throw new Error(`Failed to connect to LLM proxy: ${msg}`);
|
|
239
|
+
}
|
|
240
|
+
if (!response.ok) {
|
|
241
|
+
const raw = await response.text();
|
|
242
|
+
const text = raw.split('\n').slice(0, 10).join('\n');
|
|
243
|
+
throw new Error(`LLM proxy error ${response.status}: ${text}`);
|
|
244
|
+
}
|
|
245
|
+
const data = (await response.json());
|
|
246
|
+
if (!data.text) {
|
|
247
|
+
throw new Error('LLM returned empty response');
|
|
248
|
+
}
|
|
249
|
+
// Write output to temp file
|
|
250
|
+
const filename = output_filename || `analysis_${toolCallId.slice(-8)}_${Date.now()}.md`;
|
|
251
|
+
const outputPath = join(outputDir, filename);
|
|
252
|
+
await writeFile(outputPath, data.text, 'utf-8');
|
|
253
|
+
return {
|
|
254
|
+
content: [
|
|
255
|
+
{
|
|
256
|
+
type: 'text',
|
|
257
|
+
text: `Analysis complete. Output saved to: ${outputPath}\n\nUse the read tool to view the full output.`,
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
details: undefined,
|
|
261
|
+
};
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=llm-analysis.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rendering utilities for custom tool renderCall/renderResult.
|
|
3
|
+
*
|
|
4
|
+
* These exist here (not in modes/) so that custom/ doesn't violate
|
|
5
|
+
* the import boundary. They only depend on core/ and external packages.
|
|
6
|
+
*/
|
|
7
|
+
import { highlight, supportsLanguage } from 'cli-highlight';
|
|
8
|
+
import { theme } from '../../core/theme.js';
|
|
9
|
+
/**
|
|
10
|
+
* Highlight code with syntax coloring. Returns array of lines.
|
|
11
|
+
*/
|
|
12
|
+
export function highlightCode(code, lang) {
|
|
13
|
+
const validLang = lang && supportsLanguage(lang) ? lang : undefined;
|
|
14
|
+
const cliTheme = {
|
|
15
|
+
keyword: (s) => theme.fg('syntaxKeyword', s),
|
|
16
|
+
built_in: (s) => theme.fg('syntaxType', s),
|
|
17
|
+
literal: (s) => theme.fg('syntaxNumber', s),
|
|
18
|
+
number: (s) => theme.fg('syntaxNumber', s),
|
|
19
|
+
string: (s) => theme.fg('syntaxString', s),
|
|
20
|
+
comment: (s) => theme.fg('syntaxComment', s),
|
|
21
|
+
function: (s) => theme.fg('syntaxFunction', s),
|
|
22
|
+
title: (s) => theme.fg('syntaxFunction', s),
|
|
23
|
+
class: (s) => theme.fg('syntaxType', s),
|
|
24
|
+
type: (s) => theme.fg('syntaxType', s),
|
|
25
|
+
attr: (s) => theme.fg('syntaxVariable', s),
|
|
26
|
+
variable: (s) => theme.fg('syntaxVariable', s),
|
|
27
|
+
params: (s) => theme.fg('syntaxVariable', s),
|
|
28
|
+
operator: (s) => theme.fg('syntaxOperator', s),
|
|
29
|
+
punctuation: (s) => theme.fg('syntaxPunctuation', s)
|
|
30
|
+
};
|
|
31
|
+
try {
|
|
32
|
+
return highlight(code, { language: validLang, ignoreIllegals: true, theme: cliTheme }).split('\n');
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return code.split('\n');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=render-helpers.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* switch_mode tool — swap agent definition mid-session.
|
|
3
|
+
*
|
|
4
|
+
* Each agent definition bundles a system prompt and tool set.
|
|
5
|
+
* This tool transitions between them (e.g. installation → action)
|
|
6
|
+
* while keeping message history.
|
|
7
|
+
*
|
|
8
|
+
* Each agent declares which modes it can switch to via `switchTo`.
|
|
9
|
+
*/
|
|
10
|
+
import { Type } from '@sinclair/typebox';
|
|
11
|
+
import { SWITCH_MODE } from '../../tool-names.js';
|
|
12
|
+
import { actionAgent } from '../agents/action.js';
|
|
13
|
+
import { installationAgent } from '../agents/installation.js';
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Constants
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
const TOOL_NAME = SWITCH_MODE;
|
|
18
|
+
const TOOL_LABEL = 'Switch Mode';
|
|
19
|
+
const MODES = [installationAgent(), actionAgent()];
|
|
20
|
+
const MODE_LIST = MODES.map((a) => {
|
|
21
|
+
const targets = (a.switchTo ?? []).join(', ');
|
|
22
|
+
return `- ${a.name}: ${a.description} (can switch to: ${targets || 'none'})`;
|
|
23
|
+
}).join('\n');
|
|
24
|
+
const MODE_NAMES = MODES.map((a) => a.name);
|
|
25
|
+
const TOOL_DESCRIPTION = `\
|
|
26
|
+
Switch the agent to a different mode. This swaps the system prompt and active tools while keeping message history.
|
|
27
|
+
|
|
28
|
+
Available modes:
|
|
29
|
+
${MODE_LIST}
|
|
30
|
+
|
|
31
|
+
You can only switch to modes allowed by your current mode.`;
|
|
32
|
+
const PROMPT_SNIPPET = `\
|
|
33
|
+
Switch between agent modes.
|
|
34
|
+
|
|
35
|
+
Modes:
|
|
36
|
+
${MODE_LIST}
|
|
37
|
+
|
|
38
|
+
You can only switch to modes allowed by your current mode.`;
|
|
39
|
+
const schema = Type.Object({
|
|
40
|
+
mode: Type.Union(MODE_NAMES.map((n) => Type.Literal(n)), { description: 'The name of the agent mode to switch to' })
|
|
41
|
+
});
|
|
42
|
+
export function createSwitchModeTool(session) {
|
|
43
|
+
return {
|
|
44
|
+
name: TOOL_NAME,
|
|
45
|
+
label: TOOL_LABEL,
|
|
46
|
+
description: TOOL_DESCRIPTION,
|
|
47
|
+
promptSnippet: PROMPT_SNIPPET,
|
|
48
|
+
parameters: schema,
|
|
49
|
+
async execute(_toolCallId, params) {
|
|
50
|
+
const currentMode = currentModeRef;
|
|
51
|
+
const current = MODES.find((a) => a.name === currentMode);
|
|
52
|
+
// Only allow switching to modes declared in current agent's switchTo
|
|
53
|
+
const allowedNames = current?.switchTo ?? [];
|
|
54
|
+
const allowed = MODES.filter((a) => allowedNames.includes(a.name));
|
|
55
|
+
const target = allowed.find((a) => a.name === params.mode);
|
|
56
|
+
if (!target) {
|
|
57
|
+
const available = allowed.length > 0
|
|
58
|
+
? allowed.map((a) => `${a.name}: ${a.description}`).join('\n')
|
|
59
|
+
: '(none)';
|
|
60
|
+
return {
|
|
61
|
+
content: [
|
|
62
|
+
{
|
|
63
|
+
type: 'text',
|
|
64
|
+
text: `Cannot switch to "${params.mode}" from ${currentMode} mode. Available:\n${available}`
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
details: null
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const s = session();
|
|
71
|
+
s.setBaseSystemPrompt(target.systemPrompt);
|
|
72
|
+
s.setActiveToolsByName([...target.tools]);
|
|
73
|
+
currentModeRef = target.name;
|
|
74
|
+
// Snapshot the new system prompt + tools into the session trace so the
|
|
75
|
+
// JSONL reflects the mode switch (otherwise only the initial prompt is recorded).
|
|
76
|
+
s.sessionManager.appendSystemPrompt(s.systemPrompt);
|
|
77
|
+
s.sessionManager.appendToolDefinitions(s.agent.state.tools.map((t) => ({
|
|
78
|
+
name: t.name,
|
|
79
|
+
description: t.description,
|
|
80
|
+
parameters: t.parameters
|
|
81
|
+
})));
|
|
82
|
+
return {
|
|
83
|
+
content: [{ type: 'text', text: `Switched to ${target.name} mode.` }],
|
|
84
|
+
details: null
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** Mutable ref updated on switch — read by getCurrentMode closure */
|
|
90
|
+
let currentModeRef = '';
|
|
91
|
+
export function setCurrentMode(mode) {
|
|
92
|
+
currentModeRef = mode;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=switch-mode.js.map
|