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,144 @@
|
|
|
1
|
+
# SDK Examples
|
|
2
|
+
|
|
3
|
+
Programmatic usage of shortcutxl via `createAgentSession()`.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
| File | Description |
|
|
8
|
+
|------|-------------|
|
|
9
|
+
| `01-minimal.ts` | Simplest usage with all defaults |
|
|
10
|
+
| `02-custom-model.ts` | Select model and thinking level |
|
|
11
|
+
| `03-custom-prompt.ts` | Replace or modify system prompt |
|
|
12
|
+
| `04-skills.ts` | Discover, filter, or replace skills |
|
|
13
|
+
| `05-tools.ts` | Built-in tools, custom tools |
|
|
14
|
+
| `06-extensions.ts` | Logging, blocking, result modification |
|
|
15
|
+
| `07-context-files.ts` | AGENTS.md context files |
|
|
16
|
+
| `08-slash-commands.ts` | File-based slash commands |
|
|
17
|
+
| `09-api-keys-and-oauth.ts` | API key resolution, OAuth config |
|
|
18
|
+
| `10-settings.ts` | Override compaction, retry, terminal settings |
|
|
19
|
+
| `11-sessions.ts` | In-memory, persistent, continue, list sessions |
|
|
20
|
+
| `12-full-control.ts` | Replace everything, no discovery |
|
|
21
|
+
|
|
22
|
+
## Running
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
cd packages/coding-agent
|
|
26
|
+
npx tsx examples/sdk/01-minimal.ts
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Reference
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { getModel } from "shortcutxl";
|
|
33
|
+
import {
|
|
34
|
+
AuthStorage,
|
|
35
|
+
createAgentSession,
|
|
36
|
+
DefaultResourceLoader,
|
|
37
|
+
ModelRegistry,
|
|
38
|
+
SessionManager,
|
|
39
|
+
SettingsManager,
|
|
40
|
+
codingTools,
|
|
41
|
+
readOnlyTools,
|
|
42
|
+
readTool, bashTool, editTool, writeTool,
|
|
43
|
+
} from "shortcutxl";
|
|
44
|
+
|
|
45
|
+
// Auth and models setup
|
|
46
|
+
const authStorage = AuthStorage.create();
|
|
47
|
+
const modelRegistry = new ModelRegistry(authStorage);
|
|
48
|
+
|
|
49
|
+
// Minimal
|
|
50
|
+
const { session } = await createAgentSession({ authStorage, modelRegistry });
|
|
51
|
+
|
|
52
|
+
// Custom model
|
|
53
|
+
const model = getModel("anthropic", "claude-opus-4-5");
|
|
54
|
+
const { session } = await createAgentSession({ model, thinkingLevel: "high", authStorage, modelRegistry });
|
|
55
|
+
|
|
56
|
+
// Modify prompt
|
|
57
|
+
const loader = new DefaultResourceLoader({
|
|
58
|
+
systemPromptOverride: (base) => `${base}\n\nBe concise.`,
|
|
59
|
+
});
|
|
60
|
+
await loader.reload();
|
|
61
|
+
const { session } = await createAgentSession({ resourceLoader: loader, authStorage, modelRegistry });
|
|
62
|
+
|
|
63
|
+
// Read-only
|
|
64
|
+
const { session } = await createAgentSession({ tools: readOnlyTools, authStorage, modelRegistry });
|
|
65
|
+
|
|
66
|
+
// In-memory
|
|
67
|
+
const { session } = await createAgentSession({
|
|
68
|
+
sessionManager: SessionManager.inMemory(),
|
|
69
|
+
authStorage,
|
|
70
|
+
modelRegistry,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Full control
|
|
74
|
+
const customAuth = AuthStorage.create("/my/app/auth.json");
|
|
75
|
+
customAuth.setRuntimeApiKey("anthropic", process.env.MY_KEY!);
|
|
76
|
+
const customRegistry = new ModelRegistry(customAuth);
|
|
77
|
+
|
|
78
|
+
const resourceLoader = new DefaultResourceLoader({
|
|
79
|
+
systemPromptOverride: () => "You are helpful.",
|
|
80
|
+
extensionFactories: [myExtension],
|
|
81
|
+
skillsOverride: () => ({ skills: [], diagnostics: [] }),
|
|
82
|
+
agentsFilesOverride: () => ({ agentsFiles: [] }),
|
|
83
|
+
promptsOverride: () => ({ prompts: [], diagnostics: [] }),
|
|
84
|
+
});
|
|
85
|
+
await resourceLoader.reload();
|
|
86
|
+
|
|
87
|
+
const { session } = await createAgentSession({
|
|
88
|
+
model,
|
|
89
|
+
authStorage: customAuth,
|
|
90
|
+
modelRegistry: customRegistry,
|
|
91
|
+
resourceLoader,
|
|
92
|
+
tools: [readTool, bashTool],
|
|
93
|
+
customTools: [{ tool: myTool }],
|
|
94
|
+
sessionManager: SessionManager.inMemory(),
|
|
95
|
+
settingsManager: SettingsManager.inMemory(),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Run prompts
|
|
99
|
+
session.subscribe((event) => {
|
|
100
|
+
if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
|
|
101
|
+
process.stdout.write(event.assistantMessageEvent.delta);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
await session.prompt("Hello");
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Options
|
|
108
|
+
|
|
109
|
+
| Option | Default | Description |
|
|
110
|
+
|--------|---------|-------------|
|
|
111
|
+
| `authStorage` | `AuthStorage.create()` | Credential storage |
|
|
112
|
+
| `modelRegistry` | `new ModelRegistry(authStorage)` | Model registry |
|
|
113
|
+
| `cwd` | `process.cwd()` | Working directory |
|
|
114
|
+
| `agentDir` | `~/.shortcut/agent` | Config directory |
|
|
115
|
+
| `model` | From settings/first available | Model to use |
|
|
116
|
+
| `thinkingLevel` | From settings/"off" | off, low, medium, high |
|
|
117
|
+
| `tools` | `codingTools` | Built-in tools |
|
|
118
|
+
| `customTools` | `[]` | Additional tool definitions |
|
|
119
|
+
| `resourceLoader` | DefaultResourceLoader | Resource loader for extensions, skills, prompts, themes |
|
|
120
|
+
| `sessionManager` | `SessionManager.create(cwd)` | Persistence |
|
|
121
|
+
| `settingsManager` | `SettingsManager.create(cwd, agentDir)` | Settings overrides |
|
|
122
|
+
|
|
123
|
+
## Events
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
session.subscribe((event) => {
|
|
127
|
+
switch (event.type) {
|
|
128
|
+
case "message_update":
|
|
129
|
+
if (event.assistantMessageEvent.type === "text_delta") {
|
|
130
|
+
process.stdout.write(event.assistantMessageEvent.delta);
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
case "tool_execution_start":
|
|
134
|
+
console.log(`Tool: ${event.toolName}`);
|
|
135
|
+
break;
|
|
136
|
+
case "tool_execution_end":
|
|
137
|
+
console.log(`Result: ${event.result}`);
|
|
138
|
+
break;
|
|
139
|
+
case "agent_end":
|
|
140
|
+
console.log("Done");
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# ShortcutXL — Agent Reference
|
|
2
|
+
|
|
3
|
+
Two channels to control Excel:
|
|
4
|
+
|
|
5
|
+
1. **`POST /exec`** — run Python with full COM access. Use for imperative actions (write cells, format, create charts, read data).
|
|
6
|
+
2. **Filesystem (`modules/`)** — write `.py` files with `@xl_func` decorators. Hot-reloads in ~200ms. Use for custom Excel formulas and tick loops.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## `/exec`
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
POST http://localhost:8080/exec
|
|
14
|
+
Content-Type: application/json
|
|
15
|
+
{"code": "from shortcut_xl import xl_app\napp = xl_app()\napp.Range('A1').Value = 42"}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Returns `{"ok": true, "output": "..."}` or `{"ok": false, "error": "..."}`.
|
|
19
|
+
|
|
20
|
+
**Only import `xl_app` in `/exec`.** Never use `xl_batch`, `schedule_call`, or `xl_log` — those cause cross-thread COM errors. You already have direct main-thread access.
|
|
21
|
+
|
|
22
|
+
`xl_app()` returns `Excel.Application` — same API as VBA. Use `print()` to read values back.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## `modules/`
|
|
27
|
+
|
|
28
|
+
Discover the path: `GET http://localhost:8080/config` → `{"modules_path": "..."}`.
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
# modules/example.py
|
|
32
|
+
from shortcut_xl import xl_func, schedule_call, xl_app
|
|
33
|
+
|
|
34
|
+
@xl_func
|
|
35
|
+
def my_formula(x, y):
|
|
36
|
+
return x + y # In Excel: =my_formula(A1, B1)
|
|
37
|
+
|
|
38
|
+
def tick():
|
|
39
|
+
xl_app().Calculate()
|
|
40
|
+
schedule_call(tick, 1) # continuous updates
|
|
41
|
+
|
|
42
|
+
schedule_call(tick, 1)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Rules: function name = formula name, args are `float`/`str`/`None`, return `float`/`int`/`str`/`bool`, max 32 functions, all modules reload together on any file change.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Hard rules
|
|
50
|
+
|
|
51
|
+
| | `/exec` | `modules/` |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| **Use for** | One-shot actions, layout, formatting | Custom formulas, live data, tick loops |
|
|
54
|
+
| **Imports** | `xl_app` only | `xl_func`, `xl_app`, `xl_batch`, `schedule_call`, `xl_log` |
|
|
55
|
+
|
|
56
|
+
Never mix the two.
|
|
57
|
+
|
|
58
|
+
## Debugging
|
|
59
|
+
|
|
60
|
+
- `/exec` errors → response `error` field
|
|
61
|
+
- `@xl_func` errors → `#VALUE!` in cell, details in `%TEMP%\shortcutxl.log`
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# ShortcutXL
|
|
2
|
+
|
|
3
|
+
A native Excel add-in (`.xll`) written in C that turns Excel into a programmable surface for an AI agent. The agent runs locally on Windows as a TypeScript/Node.js CLI with a terminal TUI. It controls Excel through two channels: writing Python files for custom functions, and sending code blocks over HTTP for direct manipulation.
|
|
4
|
+
|
|
5
|
+
See `../agent/PLAN.md` for the agent architecture (loop, multiagent, session management).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Architecture
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌─ Windows ──────────────────────────────────────────┐
|
|
13
|
+
│ │
|
|
14
|
+
│ Terminal (PowerShell / Windows Terminal) │
|
|
15
|
+
│ └─ Agent CLI (Node.js, TypeScript) │
|
|
16
|
+
│ ├─ TUI (shortcutxl) │
|
|
17
|
+
│ ├─ Supervisor agent loop │
|
|
18
|
+
│ │ ├─ POST /exec → localhost:8080 ────────────┼──► HTTP
|
|
19
|
+
│ │ ├─ writes .py → modules/ ──────────────────┼──► filesystem
|
|
20
|
+
│ │ └─ Task tool → spawns worker agents │
|
|
21
|
+
│ └─ shortcutxl (Anthropic, OpenAI, Google) │
|
|
22
|
+
│ │
|
|
23
|
+
│ Excel.exe │
|
|
24
|
+
│ └─ ShortcutXL (in-process) │
|
|
25
|
+
│ ├─ HTTP server (:8080) │
|
|
26
|
+
│ │ ├─ GET /config (paths) │
|
|
27
|
+
│ │ └─ POST /exec (run Python) │
|
|
28
|
+
│ ├─ fs_watcher (hot-reload) │
|
|
29
|
+
│ ├─ CPython 3.12 (embedded) │
|
|
30
|
+
│ └─ COM → all open workbooks │
|
|
31
|
+
│ │
|
|
32
|
+
└─────────────────────────────────────────────────────┘
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
On startup the agent calls `GET /config` to discover the `modules/` path and is ready to go. Both agent and Excel run natively on Windows — no WSL boundary, no filesystem translation.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Two Channels
|
|
40
|
+
|
|
41
|
+
### 1. `POST /exec` — imperative actions
|
|
42
|
+
|
|
43
|
+
Agent sends a Python code block. The XLL runs it in the embedded runtime with full COM access to Excel. The result (stdout + stderr) is returned.
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
POST http://localhost:8080/exec
|
|
47
|
+
{"code": "from shortcut_xl import xl_app\napp = xl_app()\napp.Range('A1:D1').Value = [['Name','Revenue','Growth','Status']]\napp.Range('A1:D1').Font.Bold = True"}
|
|
48
|
+
|
|
49
|
+
→ {"ok": true, "output": ""}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use this for: writing cells, reading data, formatting, creating charts, any one-shot action.
|
|
53
|
+
|
|
54
|
+
### 2. Filesystem — custom functions
|
|
55
|
+
|
|
56
|
+
Agent writes `.py` files with `@xl_func` decorators to `modules/`. The XLL watches the directory, hot-reloads within ~200ms, and registers them as native Excel formulas.
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
# modules/dashboard.py
|
|
60
|
+
from shortcut_xl import xl_func
|
|
61
|
+
|
|
62
|
+
@xl_func
|
|
63
|
+
def revenue_ytd(region):
|
|
64
|
+
return {"EMEA": 1.2e6, "NA": 3.4e6}.get(region, 0)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
In Excel: `=revenue_ytd("EMEA")` → `1200000`
|
|
68
|
+
|
|
69
|
+
Use this for: custom worksheet functions that Excel's calc engine calls repeatedly, tick loops, animations.
|
|
70
|
+
|
|
71
|
+
### Why two channels
|
|
72
|
+
|
|
73
|
+
| Need | Channel | Reason |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| Write cells, format, charts | `/exec` | One-shot, result discarded after execution |
|
|
76
|
+
| Custom formulas (`=foo()`) | filesystem | Excel calls them on every recalculation |
|
|
77
|
+
| Tick loops, animations | filesystem | Persistent code running on a timer |
|
|
78
|
+
|
|
79
|
+
HTTP gives the agent a simple request/response interface for one-shot operations. The filesystem channel handles the only thing HTTP can't: registering functions with Excel's calc engine via `xlfRegister`, which requires in-process code that persists between calls.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## What Runs Where
|
|
84
|
+
|
|
85
|
+
| Component | Where | Why |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| Agent CLI (LLM calls, orchestration, TUI) | Windows, Node.js process | Native filesystem + HTTP to Excel, no cross-OS friction |
|
|
88
|
+
| ShortcutXL (HTTP, fs_watcher, Python, COM) | Windows, inside excel.exe | In-process access to Excel's internals |
|
|
89
|
+
| `modules/*.py` | Windows filesystem | Agent writes directly, XLL watches for changes |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Installation
|
|
94
|
+
|
|
95
|
+
**Installer (recommended):** MSI drops `ShortcutXL.xll` + embedded Python runtime. Writes registry key:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
HKCU\Software\Microsoft\Office\<version>\Excel\Options
|
|
99
|
+
OPEN = /R "C:\Program Files\Shortcut\ShortcutXL.xll"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Excel loads it automatically on every startup.
|
|
103
|
+
|
|
104
|
+
**Manual:** Excel → File → Options → Add-ins → Manage: Excel Add-ins → Browse → select `ShortcutXL.xll`.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Platform
|
|
109
|
+
|
|
110
|
+
Windows only. The XLL API is a Windows DLL interface. The custom spreadsheet engine (see `new-sheet-spec.md`) is the cross-platform path.
|
package/dist/cli/args.js
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI argument parsing and help display
|
|
3
|
+
*/
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR } from '../config.js';
|
|
6
|
+
import { isValidThinkingLevel, VALID_THINKING_LEVELS } from '../core/defaults.js';
|
|
7
|
+
import { allTools } from '../core/tools/index.js';
|
|
8
|
+
export function parseArgs(args, extensionFlags) {
|
|
9
|
+
const result = {
|
|
10
|
+
messages: [],
|
|
11
|
+
fileArgs: [],
|
|
12
|
+
unknownFlags: new Map()
|
|
13
|
+
};
|
|
14
|
+
for (let i = 0; i < args.length; i++) {
|
|
15
|
+
const arg = args[i];
|
|
16
|
+
if (arg === '--help' || arg === '-h') {
|
|
17
|
+
result.help = true;
|
|
18
|
+
}
|
|
19
|
+
else if (arg === '--version' || arg === '-v') {
|
|
20
|
+
result.version = true;
|
|
21
|
+
}
|
|
22
|
+
else if (arg === '--mode' && i + 1 < args.length) {
|
|
23
|
+
const mode = args[++i];
|
|
24
|
+
if (mode === 'text' || mode === 'json' || mode === 'rpc') {
|
|
25
|
+
result.mode = mode;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else if (arg === '--continue' || arg === '-c') {
|
|
29
|
+
result.continue = true;
|
|
30
|
+
}
|
|
31
|
+
else if (arg === '--resume' || arg === '-r') {
|
|
32
|
+
result.resume = true;
|
|
33
|
+
}
|
|
34
|
+
else if (arg === '--provider' && i + 1 < args.length) {
|
|
35
|
+
result.provider = args[++i];
|
|
36
|
+
}
|
|
37
|
+
else if (arg === '--model' && i + 1 < args.length) {
|
|
38
|
+
result.model = args[++i];
|
|
39
|
+
}
|
|
40
|
+
else if (arg === '--api-key' && i + 1 < args.length) {
|
|
41
|
+
result.apiKey = args[++i];
|
|
42
|
+
}
|
|
43
|
+
else if (arg === '--system-prompt' && i + 1 < args.length) {
|
|
44
|
+
result.systemPrompt = args[++i];
|
|
45
|
+
}
|
|
46
|
+
else if (arg === '--append-system-prompt' && i + 1 < args.length) {
|
|
47
|
+
result.appendSystemPrompt = args[++i];
|
|
48
|
+
}
|
|
49
|
+
else if (arg === '--no-session') {
|
|
50
|
+
result.noSession = true;
|
|
51
|
+
}
|
|
52
|
+
else if (arg === '--session' && i + 1 < args.length) {
|
|
53
|
+
result.session = args[++i];
|
|
54
|
+
}
|
|
55
|
+
else if (arg === '--session-dir' && i + 1 < args.length) {
|
|
56
|
+
result.sessionDir = args[++i];
|
|
57
|
+
}
|
|
58
|
+
else if (arg === '--no-tools') {
|
|
59
|
+
result.noTools = true;
|
|
60
|
+
}
|
|
61
|
+
else if (arg === '--no-custom-tools') {
|
|
62
|
+
result.noCustomTools = true;
|
|
63
|
+
}
|
|
64
|
+
else if (arg === '--custom-tools' && i + 1 < args.length) {
|
|
65
|
+
result.customTools = args[++i].split(',').map((s) => s.trim());
|
|
66
|
+
}
|
|
67
|
+
else if (arg === '--tools' && i + 1 < args.length) {
|
|
68
|
+
const toolNames = args[++i].split(',').map((s) => s.trim());
|
|
69
|
+
const validTools = [];
|
|
70
|
+
for (const name of toolNames) {
|
|
71
|
+
if (name in allTools) {
|
|
72
|
+
validTools.push(name);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
console.error(chalk.yellow(`Warning: Unknown tool "${name}". Valid tools: ${Object.keys(allTools).join(', ')}`));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
result.tools = validTools;
|
|
79
|
+
}
|
|
80
|
+
else if (arg === '--thinking' && i + 1 < args.length) {
|
|
81
|
+
const level = args[++i];
|
|
82
|
+
if (isValidThinkingLevel(level)) {
|
|
83
|
+
result.thinking = level;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
console.error(chalk.yellow(`Warning: Invalid thinking level "${level}". Valid values: ${VALID_THINKING_LEVELS.join(', ')}`));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (arg === '--print' || arg === '-p') {
|
|
90
|
+
result.print = true;
|
|
91
|
+
}
|
|
92
|
+
else if (arg === '--export' && i + 1 < args.length) {
|
|
93
|
+
result.export = args[++i];
|
|
94
|
+
}
|
|
95
|
+
else if ((arg === '--extension' || arg === '-e') && i + 1 < args.length) {
|
|
96
|
+
result.extensions = result.extensions ?? [];
|
|
97
|
+
result.extensions.push(args[++i]);
|
|
98
|
+
}
|
|
99
|
+
else if (arg === '--no-extensions' || arg === '-ne') {
|
|
100
|
+
result.noExtensions = true;
|
|
101
|
+
}
|
|
102
|
+
else if (arg === '--skill' && i + 1 < args.length) {
|
|
103
|
+
result.skills = result.skills ?? [];
|
|
104
|
+
result.skills.push(args[++i]);
|
|
105
|
+
}
|
|
106
|
+
else if (arg === '--prompt-template' && i + 1 < args.length) {
|
|
107
|
+
result.promptTemplates = result.promptTemplates ?? [];
|
|
108
|
+
result.promptTemplates.push(args[++i]);
|
|
109
|
+
}
|
|
110
|
+
else if (arg === '--theme' && i + 1 < args.length) {
|
|
111
|
+
result.themes = result.themes ?? [];
|
|
112
|
+
result.themes.push(args[++i]);
|
|
113
|
+
}
|
|
114
|
+
else if (arg === '--no-skills' || arg === '-ns') {
|
|
115
|
+
result.noSkills = true;
|
|
116
|
+
}
|
|
117
|
+
else if (arg === '--no-prompt-templates' || arg === '-np') {
|
|
118
|
+
result.noPromptTemplates = true;
|
|
119
|
+
}
|
|
120
|
+
else if (arg === '--no-themes') {
|
|
121
|
+
result.noThemes = true;
|
|
122
|
+
}
|
|
123
|
+
else if (arg === '--list-models') {
|
|
124
|
+
// Check if next arg is a search pattern (not a flag or file arg)
|
|
125
|
+
if (i + 1 < args.length && !args[i + 1].startsWith('-') && !args[i + 1].startsWith('@')) {
|
|
126
|
+
result.listModels = args[++i];
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
result.listModels = true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (arg === '--verbose') {
|
|
133
|
+
result.verbose = true;
|
|
134
|
+
}
|
|
135
|
+
else if (arg === '--subagent') {
|
|
136
|
+
result.subagent = true;
|
|
137
|
+
}
|
|
138
|
+
else if (arg === '--offline') {
|
|
139
|
+
result.offline = true;
|
|
140
|
+
}
|
|
141
|
+
else if (arg.startsWith('@')) {
|
|
142
|
+
result.fileArgs.push(arg.slice(1)); // Remove @ prefix
|
|
143
|
+
}
|
|
144
|
+
else if (arg.startsWith('--') && extensionFlags) {
|
|
145
|
+
// Check if it's an extension-registered flag
|
|
146
|
+
const flagName = arg.slice(2);
|
|
147
|
+
const extFlag = extensionFlags.get(flagName);
|
|
148
|
+
if (extFlag) {
|
|
149
|
+
if (extFlag.type === 'boolean') {
|
|
150
|
+
result.unknownFlags.set(flagName, true);
|
|
151
|
+
}
|
|
152
|
+
else if (extFlag.type === 'string' && i + 1 < args.length) {
|
|
153
|
+
result.unknownFlags.set(flagName, args[++i]);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Unknown flags without extensionFlags are silently ignored (first pass)
|
|
157
|
+
}
|
|
158
|
+
else if (!arg.startsWith('-')) {
|
|
159
|
+
result.messages.push(arg);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
export function printHelp() {
|
|
165
|
+
console.log(`${chalk.bold(APP_NAME)} - AI coding assistant with read, bash, edit, write tools
|
|
166
|
+
|
|
167
|
+
${chalk.bold('Usage:')}
|
|
168
|
+
${APP_NAME} [options] [@files...] [messages...]
|
|
169
|
+
|
|
170
|
+
${chalk.bold('Commands:')}
|
|
171
|
+
${APP_NAME} install <source> [-l] Install extension source and add to settings
|
|
172
|
+
${APP_NAME} remove <source> [-l] Remove extension source from settings
|
|
173
|
+
${APP_NAME} update [source] Update installed extensions (skips pinned sources)
|
|
174
|
+
${APP_NAME} list List installed extensions from settings
|
|
175
|
+
${APP_NAME} config Open TUI to enable/disable package resources
|
|
176
|
+
${APP_NAME} <command> --help Show help for install/remove/update/list
|
|
177
|
+
|
|
178
|
+
${chalk.bold('Options:')}
|
|
179
|
+
--provider <name> Provider name (default: google)
|
|
180
|
+
--model <pattern> Model pattern or ID (supports "provider/id" and optional ":<thinking>")
|
|
181
|
+
--api-key <key> API key (defaults to env vars)
|
|
182
|
+
--system-prompt <text> System prompt (default: coding assistant prompt)
|
|
183
|
+
--append-system-prompt <text> Append text or file contents to the system prompt
|
|
184
|
+
--mode <mode> Output mode: text (default), json, or rpc
|
|
185
|
+
--print, -p Non-interactive mode: process prompt and exit
|
|
186
|
+
--continue, -c Continue previous session
|
|
187
|
+
--resume, -r Select a session to resume
|
|
188
|
+
--session <path> Use specific session file
|
|
189
|
+
--session-dir <dir> Directory for session storage and lookup
|
|
190
|
+
--no-session Don't save session (ephemeral)
|
|
191
|
+
--no-tools Disable all built-in tools
|
|
192
|
+
--tools <tools> Comma-separated list of tools to enable (default: read,bash,edit,write)
|
|
193
|
+
Available: read, bash, edit, write, grep, find, ls
|
|
194
|
+
--thinking <level> Set thinking level: off, minimal, low, medium, high, xhigh
|
|
195
|
+
--extension, -e <path> Load an extension file (can be used multiple times)
|
|
196
|
+
--no-extensions, -ne Disable extension discovery (explicit -e paths still work)
|
|
197
|
+
--skill <path> Load a skill file or directory (can be used multiple times)
|
|
198
|
+
--no-skills, -ns Disable skills discovery and loading
|
|
199
|
+
--prompt-template <path> Load a prompt template file or directory (can be used multiple times)
|
|
200
|
+
--no-prompt-templates, -np Disable prompt template discovery and loading
|
|
201
|
+
--theme <path> Load a theme file or directory (can be used multiple times)
|
|
202
|
+
--no-themes Disable theme discovery and loading
|
|
203
|
+
--export <file> Export session file to HTML and exit
|
|
204
|
+
--list-models [search] List available models (with optional fuzzy search)
|
|
205
|
+
--verbose Force verbose startup (overrides quietStartup setting)
|
|
206
|
+
--offline Disable startup network operations (same as SHORTCUT_OFFLINE=1)
|
|
207
|
+
--help, -h Show this help
|
|
208
|
+
--version, -v Show version number
|
|
209
|
+
|
|
210
|
+
Extensions can register additional flags (e.g., --plan from plan-mode extension).
|
|
211
|
+
|
|
212
|
+
${chalk.bold('Examples:')}
|
|
213
|
+
# Interactive mode
|
|
214
|
+
${APP_NAME}
|
|
215
|
+
|
|
216
|
+
# Interactive mode with initial prompt
|
|
217
|
+
${APP_NAME} "List all .ts files in src/"
|
|
218
|
+
|
|
219
|
+
# Include files in initial message
|
|
220
|
+
${APP_NAME} @prompt.md @image.png "What color is the sky?"
|
|
221
|
+
|
|
222
|
+
# Non-interactive mode (process and exit)
|
|
223
|
+
${APP_NAME} -p "List all .ts files in src/"
|
|
224
|
+
|
|
225
|
+
# Multiple messages (interactive)
|
|
226
|
+
${APP_NAME} "Read package.json" "What dependencies do we have?"
|
|
227
|
+
|
|
228
|
+
# Continue previous session
|
|
229
|
+
${APP_NAME} --continue "What did we discuss?"
|
|
230
|
+
|
|
231
|
+
# Use different model
|
|
232
|
+
${APP_NAME} --provider openai --model gpt-4o-mini "Help me refactor this code"
|
|
233
|
+
|
|
234
|
+
# Use model with provider prefix (no --provider needed)
|
|
235
|
+
${APP_NAME} --model openai/gpt-4o "Help me refactor this code"
|
|
236
|
+
|
|
237
|
+
# Use model with thinking level shorthand
|
|
238
|
+
${APP_NAME} --model sonnet:high "Solve this complex problem"
|
|
239
|
+
|
|
240
|
+
# Start with a specific thinking level
|
|
241
|
+
${APP_NAME} --thinking high "Solve this complex problem"
|
|
242
|
+
|
|
243
|
+
# Read-only mode (no file modifications possible)
|
|
244
|
+
${APP_NAME} --tools read,grep,find,ls -p "Review the code in src/"
|
|
245
|
+
|
|
246
|
+
# Export a session file to HTML
|
|
247
|
+
${APP_NAME} --export ~/${CONFIG_DIR_NAME}/agent/sessions/--path--/session.jsonl
|
|
248
|
+
${APP_NAME} --export session.jsonl output.html
|
|
249
|
+
|
|
250
|
+
${chalk.bold('Environment Variables:')}
|
|
251
|
+
ANTHROPIC_API_KEY - Anthropic Claude API key
|
|
252
|
+
ANTHROPIC_OAUTH_TOKEN - Anthropic OAuth token (alternative to API key)
|
|
253
|
+
OPENAI_API_KEY - OpenAI GPT API key
|
|
254
|
+
AZURE_OPENAI_API_KEY - Azure OpenAI API key
|
|
255
|
+
AZURE_OPENAI_BASE_URL - Azure OpenAI base URL (https://{resource}.openai.azure.com/openai/v1)
|
|
256
|
+
AZURE_OPENAI_RESOURCE_NAME - Azure OpenAI resource name (alternative to base URL)
|
|
257
|
+
AZURE_OPENAI_API_VERSION - Azure OpenAI API version (default: v1)
|
|
258
|
+
AZURE_OPENAI_DEPLOYMENT_NAME_MAP - Azure OpenAI model=deployment map (comma-separated)
|
|
259
|
+
GEMINI_API_KEY - Google Gemini API key
|
|
260
|
+
GROQ_API_KEY - Groq API key
|
|
261
|
+
CEREBRAS_API_KEY - Cerebras API key
|
|
262
|
+
XAI_API_KEY - xAI Grok API key
|
|
263
|
+
OPENROUTER_API_KEY - OpenRouter API key
|
|
264
|
+
AI_GATEWAY_API_KEY - Vercel AI Gateway API key
|
|
265
|
+
ZAI_API_KEY - ZAI API key
|
|
266
|
+
MISTRAL_API_KEY - Mistral API key
|
|
267
|
+
MINIMAX_API_KEY - MiniMax API key
|
|
268
|
+
KIMI_API_KEY - Kimi For Coding API key
|
|
269
|
+
AWS_PROFILE - AWS profile for Amazon Bedrock
|
|
270
|
+
AWS_ACCESS_KEY_ID - AWS access key for Amazon Bedrock
|
|
271
|
+
AWS_SECRET_ACCESS_KEY - AWS secret key for Amazon Bedrock
|
|
272
|
+
AWS_BEARER_TOKEN_BEDROCK - Bedrock API key (bearer token)
|
|
273
|
+
AWS_REGION - AWS region for Amazon Bedrock (e.g., us-east-1)
|
|
274
|
+
${ENV_AGENT_DIR.padEnd(32)} - Session storage directory (default: ~/${CONFIG_DIR_NAME}/agent)
|
|
275
|
+
SHORTCUT_PACKAGE_DIR - Override package directory (for Nix/Guix store paths)
|
|
276
|
+
SHORTCUT_OFFLINE - Disable startup network operations when set to 1/true/yes
|
|
277
|
+
SHORTCUT_SHARE_VIEWER_URL - Base URL for /share command
|
|
278
|
+
SHORTCUT_SKIP_VERSION_CHECK - Skip version check at startup
|
|
279
|
+
|
|
280
|
+
${chalk.bold('Available Tools (default: read, bash, edit, write):')}
|
|
281
|
+
read - Read file contents
|
|
282
|
+
bash - Execute bash commands
|
|
283
|
+
edit - Edit files with find/replace
|
|
284
|
+
write - Write files (creates/overwrites)
|
|
285
|
+
grep - Search file contents (read-only, off by default)
|
|
286
|
+
find - Find files by glob pattern (read-only, off by default)
|
|
287
|
+
ls - List directory contents (read-only, off by default)
|
|
288
|
+
`);
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=args.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI config selector for `pi config` command
|
|
3
|
+
*/
|
|
4
|
+
import { ProcessTerminal, TUI } from '../tui/index.js';
|
|
5
|
+
import { initTheme, stopThemeWatcher } from '../core/theme.js';
|
|
6
|
+
import { ConfigSelectorComponent } from '../modes/interactive/components/config-selector.js';
|
|
7
|
+
/** Show TUI config selector and return when closed */
|
|
8
|
+
export async function selectConfig(options) {
|
|
9
|
+
// Initialize theme before showing TUI
|
|
10
|
+
initTheme(options.settingsManager.getTheme(), true);
|
|
11
|
+
return new Promise((resolve) => {
|
|
12
|
+
const ui = new TUI(new ProcessTerminal());
|
|
13
|
+
let resolved = false;
|
|
14
|
+
const selector = new ConfigSelectorComponent(options.resolvedPaths, options.settingsManager, options.cwd, options.agentDir, () => {
|
|
15
|
+
if (!resolved) {
|
|
16
|
+
resolved = true;
|
|
17
|
+
ui.stop();
|
|
18
|
+
stopThemeWatcher();
|
|
19
|
+
resolve();
|
|
20
|
+
}
|
|
21
|
+
}, () => {
|
|
22
|
+
ui.stop();
|
|
23
|
+
stopThemeWatcher();
|
|
24
|
+
process.exit(0);
|
|
25
|
+
}, () => ui.requestRender());
|
|
26
|
+
ui.addChild(selector);
|
|
27
|
+
ui.setFocus(selector.getResourceList());
|
|
28
|
+
ui.start();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=config-selector.js.map
|