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,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOOM Component for overlay mode
|
|
3
|
+
*
|
|
4
|
+
* Renders DOOM frames using half-block characters (▀) with 24-bit color.
|
|
5
|
+
* Height is calculated from width to maintain DOOM's aspect ratio.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { Component } from 'shortcutxl';
|
|
9
|
+
import { isKeyRelease, type TUI } from 'shortcutxl';
|
|
10
|
+
import type { DoomEngine } from './doom-engine.js';
|
|
11
|
+
import { DoomKeys, mapKeyToDoom } from './doom-keys.js';
|
|
12
|
+
|
|
13
|
+
function renderHalfBlock(
|
|
14
|
+
rgba: Uint8Array,
|
|
15
|
+
width: number,
|
|
16
|
+
height: number,
|
|
17
|
+
targetCols: number,
|
|
18
|
+
targetRows: number
|
|
19
|
+
): string[] {
|
|
20
|
+
const lines: string[] = [];
|
|
21
|
+
const scaleX = width / targetCols;
|
|
22
|
+
const scaleY = height / (targetRows * 2);
|
|
23
|
+
|
|
24
|
+
for (let row = 0; row < targetRows; row++) {
|
|
25
|
+
let line = '';
|
|
26
|
+
const srcY1 = Math.floor(row * 2 * scaleY);
|
|
27
|
+
const srcY2 = Math.floor((row * 2 + 1) * scaleY);
|
|
28
|
+
|
|
29
|
+
for (let col = 0; col < targetCols; col++) {
|
|
30
|
+
const srcX = Math.floor(col * scaleX);
|
|
31
|
+
const idx1 = (srcY1 * width + srcX) * 4;
|
|
32
|
+
const idx2 = (srcY2 * width + srcX) * 4;
|
|
33
|
+
const r1 = rgba[idx1] ?? 0,
|
|
34
|
+
g1 = rgba[idx1 + 1] ?? 0,
|
|
35
|
+
b1 = rgba[idx1 + 2] ?? 0;
|
|
36
|
+
const r2 = rgba[idx2] ?? 0,
|
|
37
|
+
g2 = rgba[idx2 + 1] ?? 0,
|
|
38
|
+
b2 = rgba[idx2 + 2] ?? 0;
|
|
39
|
+
line += `\x1b[38;2;${r1};${g1};${b1}m\x1b[48;2;${r2};${g2};${b2}m▀`;
|
|
40
|
+
}
|
|
41
|
+
line += '\x1b[0m';
|
|
42
|
+
lines.push(line);
|
|
43
|
+
}
|
|
44
|
+
return lines;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export class DoomOverlayComponent implements Component {
|
|
48
|
+
private engine: DoomEngine;
|
|
49
|
+
private tui: TUI;
|
|
50
|
+
private interval: ReturnType<typeof setInterval> | null = null;
|
|
51
|
+
private onExit: () => void;
|
|
52
|
+
|
|
53
|
+
// Opt-in to key release events for smooth movement
|
|
54
|
+
wantsKeyRelease = true;
|
|
55
|
+
|
|
56
|
+
constructor(tui: TUI, engine: DoomEngine, onExit: () => void, resume = false) {
|
|
57
|
+
this.tui = tui;
|
|
58
|
+
this.engine = engine;
|
|
59
|
+
this.onExit = onExit;
|
|
60
|
+
|
|
61
|
+
// Unpause if resuming
|
|
62
|
+
if (resume) {
|
|
63
|
+
this.engine.pushKey(true, DoomKeys.KEY_PAUSE);
|
|
64
|
+
this.engine.pushKey(false, DoomKeys.KEY_PAUSE);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
this.startGameLoop();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private startGameLoop(): void {
|
|
71
|
+
this.interval = setInterval(() => {
|
|
72
|
+
try {
|
|
73
|
+
this.engine.tick();
|
|
74
|
+
this.tui.requestRender();
|
|
75
|
+
} catch {
|
|
76
|
+
// WASM error (e.g., exit via DOOM menu) - treat as quit
|
|
77
|
+
this.dispose();
|
|
78
|
+
this.onExit();
|
|
79
|
+
}
|
|
80
|
+
}, 1000 / 35);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
handleInput(data: string): void {
|
|
84
|
+
// Q to pause and exit (but not on release)
|
|
85
|
+
if (!isKeyRelease(data) && (data === 'q' || data === 'Q')) {
|
|
86
|
+
// Send DOOM's pause key before exiting
|
|
87
|
+
this.engine.pushKey(true, DoomKeys.KEY_PAUSE);
|
|
88
|
+
this.engine.pushKey(false, DoomKeys.KEY_PAUSE);
|
|
89
|
+
this.dispose();
|
|
90
|
+
this.onExit();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const doomKeys = mapKeyToDoom(data);
|
|
95
|
+
if (doomKeys.length === 0) return;
|
|
96
|
+
|
|
97
|
+
const released = isKeyRelease(data);
|
|
98
|
+
|
|
99
|
+
for (const key of doomKeys) {
|
|
100
|
+
this.engine.pushKey(!released, key);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
render(width: number): string[] {
|
|
105
|
+
// DOOM renders at 640x400 (1.6:1 ratio)
|
|
106
|
+
// With half-block characters, each terminal row = 2 pixels
|
|
107
|
+
// So effective ratio is 640:200 = 3.2:1 (width:height in terminal cells)
|
|
108
|
+
// Add 1 row for footer
|
|
109
|
+
const ASPECT_RATIO = 3.2;
|
|
110
|
+
const MIN_HEIGHT = 10;
|
|
111
|
+
const height = Math.max(MIN_HEIGHT, Math.floor(width / ASPECT_RATIO));
|
|
112
|
+
|
|
113
|
+
const rgba = this.engine.getFrameRGBA();
|
|
114
|
+
const lines = renderHalfBlock(rgba, this.engine.width, this.engine.height, width, height);
|
|
115
|
+
|
|
116
|
+
// Footer
|
|
117
|
+
const footer =
|
|
118
|
+
' DOOM | Q=Pause | WASD=Move | Shift+WASD=Run | Space=Use | F=Fire | 1-7=Weapons';
|
|
119
|
+
const truncatedFooter = footer.length > width ? footer.slice(0, width) : footer;
|
|
120
|
+
lines.push(`\x1b[2m${truncatedFooter}\x1b[0m`);
|
|
121
|
+
|
|
122
|
+
return lines;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
invalidate(): void {}
|
|
126
|
+
|
|
127
|
+
dispose(): void {
|
|
128
|
+
if (this.interval) {
|
|
129
|
+
clearInterval(this.interval);
|
|
130
|
+
this.interval = null;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOOM Engine - WebAssembly wrapper for doomgeneric
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
6
|
+
import { createRequire } from 'node:module';
|
|
7
|
+
import { dirname, join } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
|
|
10
|
+
export interface DoomModule {
|
|
11
|
+
_doomgeneric_Create: (argc: number, argv: number) => void;
|
|
12
|
+
_doomgeneric_Tick: () => void;
|
|
13
|
+
_DG_GetFrameBuffer: () => number;
|
|
14
|
+
_DG_GetScreenWidth: () => number;
|
|
15
|
+
_DG_GetScreenHeight: () => number;
|
|
16
|
+
_DG_PushKeyEvent: (pressed: number, key: number) => void;
|
|
17
|
+
_malloc: (size: number) => number;
|
|
18
|
+
_free: (ptr: number) => void;
|
|
19
|
+
HEAPU8: Uint8Array;
|
|
20
|
+
HEAPU32: Uint32Array;
|
|
21
|
+
FS_createDataFile: (
|
|
22
|
+
parent: string,
|
|
23
|
+
name: string,
|
|
24
|
+
data: number[],
|
|
25
|
+
canRead: boolean,
|
|
26
|
+
canWrite: boolean
|
|
27
|
+
) => void;
|
|
28
|
+
FS_createPath: (parent: string, path: string, canRead: boolean, canWrite: boolean) => string;
|
|
29
|
+
setValue: (ptr: number, value: number, type: string) => void;
|
|
30
|
+
getValue: (ptr: number, type: string) => number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class DoomEngine {
|
|
34
|
+
private module: DoomModule | null = null;
|
|
35
|
+
private frameBufferPtr: number = 0;
|
|
36
|
+
private initialized = false;
|
|
37
|
+
private wadPath: string;
|
|
38
|
+
private _width = 640;
|
|
39
|
+
private _height = 400;
|
|
40
|
+
|
|
41
|
+
constructor(wadPath: string) {
|
|
42
|
+
this.wadPath = wadPath;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get width(): number {
|
|
46
|
+
return this._width;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get height(): number {
|
|
50
|
+
return this._height;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async init(): Promise<void> {
|
|
54
|
+
// Locate WASM build
|
|
55
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
56
|
+
const buildDir = join(__dirname, 'doom', 'build');
|
|
57
|
+
const doomJsPath = join(buildDir, 'doom.js');
|
|
58
|
+
|
|
59
|
+
if (!existsSync(doomJsPath)) {
|
|
60
|
+
throw new Error(`WASM not found at ${doomJsPath}. Run ./doom/build.sh first`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Read WAD file
|
|
64
|
+
const wadData = readFileSync(this.wadPath);
|
|
65
|
+
const wadArray = Array.from(new Uint8Array(wadData));
|
|
66
|
+
|
|
67
|
+
// Load WASM module - eval to bypass jiti completely
|
|
68
|
+
const doomJsCode = readFileSync(doomJsPath, 'utf-8');
|
|
69
|
+
const moduleExports: { exports: unknown } = { exports: {} };
|
|
70
|
+
const nativeRequire = createRequire(doomJsPath);
|
|
71
|
+
const moduleFunc = new Function(
|
|
72
|
+
'module',
|
|
73
|
+
'exports',
|
|
74
|
+
'__dirname',
|
|
75
|
+
'__filename',
|
|
76
|
+
'require',
|
|
77
|
+
doomJsCode
|
|
78
|
+
);
|
|
79
|
+
moduleFunc(moduleExports, moduleExports.exports, buildDir, doomJsPath, nativeRequire);
|
|
80
|
+
const createDoomModule = moduleExports.exports as (config: unknown) => Promise<DoomModule>;
|
|
81
|
+
|
|
82
|
+
const moduleConfig = {
|
|
83
|
+
locateFile: (path: string) => {
|
|
84
|
+
if (path.endsWith('.wasm')) {
|
|
85
|
+
return join(buildDir, path);
|
|
86
|
+
}
|
|
87
|
+
return path;
|
|
88
|
+
},
|
|
89
|
+
print: () => {},
|
|
90
|
+
printErr: () => {},
|
|
91
|
+
preRun: [
|
|
92
|
+
(module: DoomModule) => {
|
|
93
|
+
// Create /doom directory and add WAD
|
|
94
|
+
module.FS_createPath('/', 'doom', true, true);
|
|
95
|
+
module.FS_createDataFile('/doom', 'doom1.wad', wadArray, true, false);
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
this.module = await createDoomModule(moduleConfig);
|
|
101
|
+
if (!this.module) {
|
|
102
|
+
throw new Error('Failed to initialize DOOM module');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Initialize DOOM
|
|
106
|
+
this.initDoom();
|
|
107
|
+
|
|
108
|
+
// Get framebuffer info
|
|
109
|
+
this.frameBufferPtr = this.module._DG_GetFrameBuffer();
|
|
110
|
+
this._width = this.module._DG_GetScreenWidth();
|
|
111
|
+
this._height = this.module._DG_GetScreenHeight();
|
|
112
|
+
this.initialized = true;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private initDoom(): void {
|
|
116
|
+
if (!this.module) return;
|
|
117
|
+
|
|
118
|
+
const args = ['doom', '-iwad', '/doom/doom1.wad'];
|
|
119
|
+
const argPtrs: number[] = [];
|
|
120
|
+
|
|
121
|
+
for (const arg of args) {
|
|
122
|
+
const ptr = this.module._malloc(arg.length + 1);
|
|
123
|
+
for (let i = 0; i < arg.length; i++) {
|
|
124
|
+
this.module.setValue(ptr + i, arg.charCodeAt(i), 'i8');
|
|
125
|
+
}
|
|
126
|
+
this.module.setValue(ptr + arg.length, 0, 'i8');
|
|
127
|
+
argPtrs.push(ptr);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const argvPtr = this.module._malloc(argPtrs.length * 4);
|
|
131
|
+
for (let i = 0; i < argPtrs.length; i++) {
|
|
132
|
+
this.module.setValue(argvPtr + i * 4, argPtrs[i]!, 'i32');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
this.module._doomgeneric_Create(args.length, argvPtr);
|
|
136
|
+
|
|
137
|
+
for (const ptr of argPtrs) {
|
|
138
|
+
this.module._free(ptr);
|
|
139
|
+
}
|
|
140
|
+
this.module._free(argvPtr);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Run one game tick
|
|
145
|
+
*/
|
|
146
|
+
tick(): void {
|
|
147
|
+
if (!this.module || !this.initialized) return;
|
|
148
|
+
this.module._doomgeneric_Tick();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Get current frame as RGBA pixel data
|
|
153
|
+
* DOOM outputs ARGB, we convert to RGBA
|
|
154
|
+
*/
|
|
155
|
+
getFrameRGBA(): Uint8Array {
|
|
156
|
+
if (!this.module || !this.initialized) {
|
|
157
|
+
return new Uint8Array(this._width * this._height * 4);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const pixels = this._width * this._height;
|
|
161
|
+
const buffer = new Uint8Array(pixels * 4);
|
|
162
|
+
|
|
163
|
+
for (let i = 0; i < pixels; i++) {
|
|
164
|
+
const argb = this.module.getValue(this.frameBufferPtr + i * 4, 'i32');
|
|
165
|
+
const offset = i * 4;
|
|
166
|
+
buffer[offset + 0] = (argb >> 16) & 0xff; // R
|
|
167
|
+
buffer[offset + 1] = (argb >> 8) & 0xff; // G
|
|
168
|
+
buffer[offset + 2] = argb & 0xff; // B
|
|
169
|
+
buffer[offset + 3] = 255; // A
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return buffer;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Push a key event
|
|
177
|
+
*/
|
|
178
|
+
pushKey(pressed: boolean, key: number): void {
|
|
179
|
+
if (!this.module || !this.initialized) return;
|
|
180
|
+
this.module._DG_PushKeyEvent(pressed ? 1 : 0, key);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
isInitialized(): boolean {
|
|
184
|
+
return this.initialized;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOOM key codes (from doomkeys.h)
|
|
3
|
+
*/
|
|
4
|
+
export const DoomKeys = {
|
|
5
|
+
KEY_RIGHTARROW: 0xae,
|
|
6
|
+
KEY_LEFTARROW: 0xac,
|
|
7
|
+
KEY_UPARROW: 0xad,
|
|
8
|
+
KEY_DOWNARROW: 0xaf,
|
|
9
|
+
KEY_STRAFE_L: 0xa0,
|
|
10
|
+
KEY_STRAFE_R: 0xa1,
|
|
11
|
+
KEY_USE: 0xa2,
|
|
12
|
+
KEY_FIRE: 0xa3,
|
|
13
|
+
KEY_ESCAPE: 27,
|
|
14
|
+
KEY_ENTER: 13,
|
|
15
|
+
KEY_TAB: 9,
|
|
16
|
+
KEY_F1: 0x80 + 0x3b,
|
|
17
|
+
KEY_F2: 0x80 + 0x3c,
|
|
18
|
+
KEY_F3: 0x80 + 0x3d,
|
|
19
|
+
KEY_F4: 0x80 + 0x3e,
|
|
20
|
+
KEY_F5: 0x80 + 0x3f,
|
|
21
|
+
KEY_F6: 0x80 + 0x40,
|
|
22
|
+
KEY_F7: 0x80 + 0x41,
|
|
23
|
+
KEY_F8: 0x80 + 0x42,
|
|
24
|
+
KEY_F9: 0x80 + 0x43,
|
|
25
|
+
KEY_F10: 0x80 + 0x44,
|
|
26
|
+
KEY_F11: 0x80 + 0x57,
|
|
27
|
+
KEY_F12: 0x80 + 0x58,
|
|
28
|
+
KEY_BACKSPACE: 127,
|
|
29
|
+
KEY_PAUSE: 0xff,
|
|
30
|
+
KEY_EQUALS: 0x3d,
|
|
31
|
+
KEY_MINUS: 0x2d,
|
|
32
|
+
KEY_RSHIFT: 0x80 + 0x36,
|
|
33
|
+
KEY_RCTRL: 0x80 + 0x1d,
|
|
34
|
+
KEY_RALT: 0x80 + 0x38
|
|
35
|
+
} as const;
|
|
36
|
+
|
|
37
|
+
import { Key, matchesKey, parseKey } from 'shortcutxl';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Map terminal key input to DOOM key codes
|
|
41
|
+
* Supports both raw terminal input and Kitty protocol sequences
|
|
42
|
+
*/
|
|
43
|
+
export function mapKeyToDoom(data: string): number[] {
|
|
44
|
+
// Arrow keys
|
|
45
|
+
if (matchesKey(data, Key.up)) return [DoomKeys.KEY_UPARROW];
|
|
46
|
+
if (matchesKey(data, Key.down)) return [DoomKeys.KEY_DOWNARROW];
|
|
47
|
+
if (matchesKey(data, Key.right)) return [DoomKeys.KEY_RIGHTARROW];
|
|
48
|
+
if (matchesKey(data, Key.left)) return [DoomKeys.KEY_LEFTARROW];
|
|
49
|
+
|
|
50
|
+
// WASD - check both raw char and Kitty sequences
|
|
51
|
+
if (data === 'w' || matchesKey(data, 'w')) return [DoomKeys.KEY_UPARROW];
|
|
52
|
+
if (data === 'W' || matchesKey(data, Key.shift('w')))
|
|
53
|
+
return [DoomKeys.KEY_UPARROW, DoomKeys.KEY_RSHIFT];
|
|
54
|
+
if (data === 's' || matchesKey(data, 's')) return [DoomKeys.KEY_DOWNARROW];
|
|
55
|
+
if (data === 'S' || matchesKey(data, Key.shift('s')))
|
|
56
|
+
return [DoomKeys.KEY_DOWNARROW, DoomKeys.KEY_RSHIFT];
|
|
57
|
+
if (data === 'a' || matchesKey(data, 'a')) return [DoomKeys.KEY_STRAFE_L];
|
|
58
|
+
if (data === 'A' || matchesKey(data, Key.shift('a')))
|
|
59
|
+
return [DoomKeys.KEY_STRAFE_L, DoomKeys.KEY_RSHIFT];
|
|
60
|
+
if (data === 'd' || matchesKey(data, 'd')) return [DoomKeys.KEY_STRAFE_R];
|
|
61
|
+
if (data === 'D' || matchesKey(data, Key.shift('d')))
|
|
62
|
+
return [DoomKeys.KEY_STRAFE_R, DoomKeys.KEY_RSHIFT];
|
|
63
|
+
|
|
64
|
+
// Fire - F key
|
|
65
|
+
if (data === 'f' || data === 'F' || matchesKey(data, 'f') || matchesKey(data, Key.shift('f'))) {
|
|
66
|
+
return [DoomKeys.KEY_FIRE];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Use/Open
|
|
70
|
+
if (data === ' ' || matchesKey(data, Key.space)) return [DoomKeys.KEY_USE];
|
|
71
|
+
|
|
72
|
+
// Menu/UI keys
|
|
73
|
+
if (matchesKey(data, Key.enter)) return [DoomKeys.KEY_ENTER];
|
|
74
|
+
if (matchesKey(data, Key.escape)) return [DoomKeys.KEY_ESCAPE];
|
|
75
|
+
if (matchesKey(data, Key.tab)) return [DoomKeys.KEY_TAB];
|
|
76
|
+
if (matchesKey(data, Key.backspace)) return [DoomKeys.KEY_BACKSPACE];
|
|
77
|
+
|
|
78
|
+
// Ctrl keys (except Ctrl+C) = fire (legacy support)
|
|
79
|
+
const parsed = parseKey(data);
|
|
80
|
+
if (parsed?.startsWith('ctrl+') && parsed !== 'ctrl+c') {
|
|
81
|
+
return [DoomKeys.KEY_FIRE];
|
|
82
|
+
}
|
|
83
|
+
if (data.length === 1 && data.charCodeAt(0) < 32 && data !== '\x03') {
|
|
84
|
+
return [DoomKeys.KEY_FIRE];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Weapon selection (0-9)
|
|
88
|
+
if (data >= '0' && data <= '9') return [data.charCodeAt(0)];
|
|
89
|
+
|
|
90
|
+
// Plus/minus for screen size
|
|
91
|
+
if (data === '+' || data === '=') return [DoomKeys.KEY_EQUALS];
|
|
92
|
+
if (data === '-') return [DoomKeys.KEY_MINUS];
|
|
93
|
+
|
|
94
|
+
// Y/N for prompts
|
|
95
|
+
if (data === 'y' || data === 'Y' || matchesKey(data, 'y') || matchesKey(data, Key.shift('y'))) {
|
|
96
|
+
return ['y'.charCodeAt(0)];
|
|
97
|
+
}
|
|
98
|
+
if (data === 'n' || data === 'N' || matchesKey(data, 'n') || matchesKey(data, Key.shift('n'))) {
|
|
99
|
+
return ['n'.charCodeAt(0)];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Other printable characters (for cheats)
|
|
103
|
+
if (data.length === 1 && data.charCodeAt(0) >= 32) {
|
|
104
|
+
return [data.toLowerCase().charCodeAt(0)];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOOM Overlay Demo - Play DOOM as an overlay
|
|
3
|
+
*
|
|
4
|
+
* Usage: shortcut --extension ./examples/extensions/doom-overlay
|
|
5
|
+
*
|
|
6
|
+
* Commands:
|
|
7
|
+
* /doom-overlay - Play DOOM in an overlay (Q to pause/exit)
|
|
8
|
+
*
|
|
9
|
+
* This demonstrates that overlays can handle real-time game rendering at 35 FPS.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { ExtensionAPI } from 'shortcutxl';
|
|
13
|
+
import { DoomOverlayComponent } from './doom-component.js';
|
|
14
|
+
import { DoomEngine } from './doom-engine.js';
|
|
15
|
+
import { ensureWadFile } from './wad-finder.js';
|
|
16
|
+
|
|
17
|
+
// Persistent engine instance - survives between invocations
|
|
18
|
+
let activeEngine: DoomEngine | null = null;
|
|
19
|
+
let activeWadPath: string | null = null;
|
|
20
|
+
|
|
21
|
+
export default function (shortcut: ExtensionAPI) {
|
|
22
|
+
shortcut.registerCommand('doom-overlay', {
|
|
23
|
+
description: 'Play DOOM as an overlay. Q to pause and exit.',
|
|
24
|
+
|
|
25
|
+
handler: async (args, ctx) => {
|
|
26
|
+
if (!ctx.hasUI) {
|
|
27
|
+
ctx.ui.notify('DOOM requires interactive mode', 'error');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Auto-download WAD if not present
|
|
32
|
+
ctx.ui.notify('Loading DOOM...', 'info');
|
|
33
|
+
const wad = args?.trim() ? args.trim() : await ensureWadFile();
|
|
34
|
+
|
|
35
|
+
if (!wad) {
|
|
36
|
+
ctx.ui.notify('Failed to download DOOM WAD file. Check your internet connection.', 'error');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
// Reuse existing engine if same WAD, otherwise create new
|
|
42
|
+
let isResume = false;
|
|
43
|
+
if (activeEngine && activeWadPath === wad) {
|
|
44
|
+
ctx.ui.notify('Resuming DOOM...', 'info');
|
|
45
|
+
isResume = true;
|
|
46
|
+
} else {
|
|
47
|
+
ctx.ui.notify(`Loading DOOM from ${wad}...`, 'info');
|
|
48
|
+
activeEngine = new DoomEngine(wad);
|
|
49
|
+
await activeEngine.init();
|
|
50
|
+
activeWadPath = wad;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
await ctx.ui.custom(
|
|
54
|
+
(tui, _theme, _keybindings, done) => {
|
|
55
|
+
return new DoomOverlayComponent(tui, activeEngine!, () => done(undefined), isResume);
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
overlay: true,
|
|
59
|
+
overlayOptions: {
|
|
60
|
+
width: '75%',
|
|
61
|
+
maxHeight: '95%',
|
|
62
|
+
anchor: 'center',
|
|
63
|
+
margin: { top: 1 }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
ctx.ui.notify(`Failed to load DOOM: ${error}`, 'error');
|
|
69
|
+
activeEngine = null;
|
|
70
|
+
activeWadPath = null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { existsSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
// Get the bundled WAD path (relative to this module)
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const BUNDLED_WAD = join(__dirname, 'doom1.wad');
|
|
8
|
+
const WAD_URL = 'https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad';
|
|
9
|
+
|
|
10
|
+
const DEFAULT_WAD_PATHS = ['./doom1.wad', './DOOM1.WAD', '~/doom1.wad', '~/.doom/doom1.wad'];
|
|
11
|
+
|
|
12
|
+
export function findWadFile(customPath?: string): string | null {
|
|
13
|
+
if (customPath) {
|
|
14
|
+
const resolved = resolve(customPath.replace(/^~/, process.env.HOME || ''));
|
|
15
|
+
if (existsSync(resolved)) return resolved;
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Check bundled WAD first
|
|
20
|
+
if (existsSync(BUNDLED_WAD)) {
|
|
21
|
+
return BUNDLED_WAD;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Fall back to default paths
|
|
25
|
+
for (const p of DEFAULT_WAD_PATHS) {
|
|
26
|
+
const resolved = resolve(p.replace(/^~/, process.env.HOME || ''));
|
|
27
|
+
if (existsSync(resolved)) return resolved;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Download the shareware WAD if not present. Returns path or null on failure. */
|
|
34
|
+
export async function ensureWadFile(): Promise<string | null> {
|
|
35
|
+
// Check if already exists
|
|
36
|
+
const existing = findWadFile();
|
|
37
|
+
if (existing) return existing;
|
|
38
|
+
|
|
39
|
+
// Download to bundled location
|
|
40
|
+
try {
|
|
41
|
+
const response = await fetch(WAD_URL);
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
throw new Error(`HTTP ${response.status}`);
|
|
44
|
+
}
|
|
45
|
+
const buffer = await response.arrayBuffer();
|
|
46
|
+
writeFileSync(BUNDLED_WAD, Buffer.from(buffer));
|
|
47
|
+
return BUNDLED_WAD;
|
|
48
|
+
} catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
+
"name": "dynamic-resources",
|
|
4
|
+
"vars": {
|
|
5
|
+
"cyan": "#00d7ff",
|
|
6
|
+
"blue": "#5f87ff",
|
|
7
|
+
"green": "#b5bd68",
|
|
8
|
+
"red": "#cc6666",
|
|
9
|
+
"yellow": "#ffff00",
|
|
10
|
+
"gray": "#808080",
|
|
11
|
+
"dimGray": "#666666",
|
|
12
|
+
"darkGray": "#505050",
|
|
13
|
+
"accent": "#8abeb7",
|
|
14
|
+
"selectedBg": "#3a3a4a",
|
|
15
|
+
"userMsgBg": "#343541",
|
|
16
|
+
"toolPendingBg": "#282832",
|
|
17
|
+
"toolSuccessBg": "#283228",
|
|
18
|
+
"toolErrorBg": "#3c2828",
|
|
19
|
+
"customMsgBg": "#2d2838"
|
|
20
|
+
},
|
|
21
|
+
"colors": {
|
|
22
|
+
"accent": "accent",
|
|
23
|
+
"border": "blue",
|
|
24
|
+
"borderAccent": "cyan",
|
|
25
|
+
"borderMuted": "darkGray",
|
|
26
|
+
"success": "green",
|
|
27
|
+
"error": "red",
|
|
28
|
+
"warning": "yellow",
|
|
29
|
+
"muted": "gray",
|
|
30
|
+
"dim": "dimGray",
|
|
31
|
+
"text": "",
|
|
32
|
+
"thinkingText": "gray",
|
|
33
|
+
"selectedBg": "selectedBg",
|
|
34
|
+
"userMessageBg": "userMsgBg",
|
|
35
|
+
"userMessageText": "",
|
|
36
|
+
"customMessageBg": "customMsgBg",
|
|
37
|
+
"customMessageText": "",
|
|
38
|
+
"customMessageLabel": "#9575cd",
|
|
39
|
+
"toolPendingBg": "toolPendingBg",
|
|
40
|
+
"toolSuccessBg": "toolSuccessBg",
|
|
41
|
+
"toolErrorBg": "toolErrorBg",
|
|
42
|
+
"toolTitle": "",
|
|
43
|
+
"toolOutput": "gray",
|
|
44
|
+
"mdHeading": "#f0c674",
|
|
45
|
+
"mdLink": "#81a2be",
|
|
46
|
+
"mdLinkUrl": "dimGray",
|
|
47
|
+
"mdCode": "accent",
|
|
48
|
+
"mdCodeBlock": "green",
|
|
49
|
+
"mdCodeBlockBorder": "gray",
|
|
50
|
+
"mdQuote": "gray",
|
|
51
|
+
"mdQuoteBorder": "gray",
|
|
52
|
+
"mdHr": "gray",
|
|
53
|
+
"mdListBullet": "accent",
|
|
54
|
+
"toolDiffAdded": "green",
|
|
55
|
+
"toolDiffRemoved": "red",
|
|
56
|
+
"toolDiffContext": "gray",
|
|
57
|
+
"syntaxComment": "#6A9955",
|
|
58
|
+
"syntaxKeyword": "#569CD6",
|
|
59
|
+
"syntaxFunction": "#DCDCAA",
|
|
60
|
+
"syntaxVariable": "#9CDCFE",
|
|
61
|
+
"syntaxString": "#CE9178",
|
|
62
|
+
"syntaxNumber": "#B5CEA8",
|
|
63
|
+
"syntaxType": "#4EC9B0",
|
|
64
|
+
"syntaxOperator": "#D4D4D4",
|
|
65
|
+
"syntaxPunctuation": "#D4D4D4",
|
|
66
|
+
"thinkingOff": "darkGray",
|
|
67
|
+
"thinkingMinimal": "#6e6e6e",
|
|
68
|
+
"thinkingLow": "#5f87af",
|
|
69
|
+
"thinkingMedium": "#81a2be",
|
|
70
|
+
"thinkingHigh": "#b294bb",
|
|
71
|
+
"thinkingXhigh": "#d183e8",
|
|
72
|
+
"bashMode": "green"
|
|
73
|
+
},
|
|
74
|
+
"export": {
|
|
75
|
+
"pageBg": "#18181e",
|
|
76
|
+
"cardBg": "#1e1e24",
|
|
77
|
+
"infoBg": "#3c3728"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { dirname, join } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import type { ExtensionAPI } from 'shortcutxl';
|
|
4
|
+
|
|
5
|
+
const baseDir = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
|
|
7
|
+
export default function (shortcut: ExtensionAPI) {
|
|
8
|
+
shortcut.on('resources_discover', () => {
|
|
9
|
+
return {
|
|
10
|
+
skillPaths: [join(baseDir, 'SKILL.md')],
|
|
11
|
+
promptPaths: [join(baseDir, 'dynamic.md')],
|
|
12
|
+
themePaths: [join(baseDir, 'dynamic.json')]
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
}
|