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,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POWERED BY DAXNUTS - Easter egg for OpenCode + Kimi K2.5
|
|
3
|
+
*
|
|
4
|
+
* A heartfelt tribute to dax (@thdxr) for providing free Kimi K2.5 access via OpenCode.
|
|
5
|
+
*/
|
|
6
|
+
import { theme } from '../../../core/theme.js';
|
|
7
|
+
// 32x32 RGB image of dax, hex encoded (3 bytes per pixel)
|
|
8
|
+
const DAX_HEX = 'bbbab8b9b9b6b9b8b5bcbbb8b8b7b4b7b5b2b6b5b2b8b7b4b7b6b3b6b4b1bdbcb8bab8b6bbb8b5b8b5b1bbb8b4c2bebbc1bebac0bdbabfbcb9c1bebabfbebbc0bfbcc0bdbabbb8b5c1bfbcbfbcb8bbb9b6bfbcb8c2bfbcc1bfbcbfbbb8bdb9b6b8b7b5b9b8b5b8b8b5b5b5b2b6b5b2b8b7b4b9b8b5b9b8b5b6b5b3bab8b5bcbab7bbb9b6bbb8b5bfb9b5bdb2abbcb0a8beb2aabeb5afbfbab6bebab7c0bfbcbebdbabebbb8c0bdbabfbebbc2bebbbdbab7c3c0bdc3c0bdc1bebbc2bebabfbcb8bab9b6b7b6b3b2b1aeb6b5b2b5b4b1b5b4b2b6b5b2b7b6b4b9b8b6b7b6b3bbbab7b2afaba5988fb49e90b09481b79a88b39683b09583b7a395bfb6b0c0bdbabdbbb8bebcb9c1bfbcc0bebbbdbab7bebbb8c2bfbcc0bdbac0bcb9bdb9b6c0bcb8b5b4b2b4b3b0bab9b6b9b9b6b5b4b1b5b4b1b6b5b3b9b8b5b9b8b6b9b8b6b2aeaa968174a6836eaa856eab846eaf8973ac8973b08f79b18f7ab39786b7a89dbbb3aebfbab6c2c0bdbebcb9bfbdbac3c1bdc2bebbc0bcb9bdb9b6c1bdbabfbbb8b4b3b0b9b8b5b8b7b5b4b3b1b5b4b1b8b7b4b8b7b5bab9b6bbbab7b1afad8c7a719d735ca47860a87d65a98069ae8972ae8c75af8d77aa826ba98067aa8974b39e90b6a79dbbb2adc0bdbac1bfbdbfbbb8c1bdb9bebab6c0bdb9bfbbb8c1bdbab4b2b0b7b6b4b7b6b3b4b2b0bab9b7b6b5b2b6b5b2bab9b6bab9b6958c87977663aa836bac8772b08f7aad8c77b2917db0917db0907cac8971a77d64a87f67ac8972b29887b8a89dbfbab5bfbdbac1bebac0bcb9c0bcb9c0bcb9c1bebabebab7b8b7b4b7b6b4b5b4b1b5b4b2b7b6b3b5b4b2bab9b7bab9b6b4b1ada88f7fad8973ae8d78b19684b19685b29786b69a89b29582b1917daa856ea87e66a97e66ad866ea9826baf9280b8ada6bdbbb8bebab7bfbbb8c1bdbabfbbb8bcb8b4bcb8b5b6b4b2b7b5b3b6b5b2b8b7b4b3b2afb8b7b4b6b5b2b3b2b0b3a59aab856fad8d78b0917eb19886b49b8bb49a89b39785b0917eaf8f7cab866fa77d65a77a61a87d64a9816ab08f79b5a296c1bcb8c3bfbcc2bebbbebab7bfbbb7bdbab6c2bebab8b7b4b7b6b4b6b5b3b7b6b3b6b5b2b9b8b6b4b3b1b6b1acac8f7ca9826bae8f7aaf9583b49c8cb49c8bb79d8cb59987b19380ad8e79ae8c77af8e78ac8771a3775faa826bae8972b39888bbb6b2bebbb8bfbbb8bfbbb8c0bdb9bebbb7c0bdb9b6b5b2b9b8b5b4b3b1b8b7b5b4b3b0b7b6b4b6b5b3b1a7a0aa8772a77d65a88570b49887b19b8d9c887c907a6d987f71aa907faf917daf8e7aad8c78ac8b77a8836ca9836cac8770b49b8abdb6b2c0bcb9c0bdb9bfbbb8bebab7bfbcb9bebab7b9b8b6b5b4b2b9b8b5b8b7b5b8b7b4b7b6b4b5b4b2b3a9a2ad8973a1755da9856fb398858c776a65544b776358725d526e594d9c7f6eb1907ba68672ad8e7aab8771ac856db18f79b3a092beb9b5c1bdbabdb9b5bebab7bfbbb7bebab7bcb9b6b7b6b4b6b6b3b8b7b4b5b4b2b8b6b4b7b6b3b4b3b0b4aba4a6826ba3775fb08e79b19584a88e7daa8e7db29481ad8f7c997e6da38674ac8d79ac8e7aae917f9a7c6a896a599a7c6ab3a398c1bdbabdb9b6bcb8b5bebab6bebab7bdb9b5bdb9b6b5b4b1b7b5b3b5b4b2b7b6b3b7b6b4b3b3b0b3b2b0b4aca5a7846fa97f68ae8f7bae9383b59c8bb2937fae8e79ac8b76af927eaf927eb29683b39885b2988891786a72594c6e594d978d86bdbab7bab7b3c0bcb9c0bcb9bebab7bebbb7bdb9b6b3b2b0b4b3b0b5b4b2b4b4b1b4b3b1b4b3b1b4b3b0b6ada5aa8670a57a62ad8e7ab29b8cb69d8dab856fa9826aa88069ab8771af907db49987b19684b29886b59987b39480b09787b5a9a1bcb8b5bebab7bdb9b5bebab7bfbbb8bfbbb7bbb7b4b3b2afb8b7b5b8b7b5b3b2b0b5b4b2b6b5b3b6b4b1afa299a98975a9826baf907cb39988b49a89af8e7aac8973aa856eaf8c74b1917dae907dac907db39988b29785b49785b7a090b9aca3bfbab7bcb8b5bdb9b6bcb8b4bcb8b5bdb9b5bcb8b4b5b4b2b6b5b3b4b3b0b4b3b0b9b8b5b8b6b4908b88887467aa8f7ea78976ad8973b08b74b59885b69e8eb29888b1917cb1917db1937fae907cb19686b39a8ab29886b59b8ab8a192b6aaa3b7b2afbcb8b4bcb8b5bbb7b4c0bcb9bebab7c0bcb9b6b5b2b6b5b3b4b3b0bab9b7b7b6b4b1b0ae7b716ba083709b806f716158967764b08870b29481b69b8ab69f8fb39a89b69f90b49d8db39a89b29988b49c8cb6a090b8a496baa49593867f8f8986bfbbb7bdb9b5bcb7b4bab6b3b9b5b2bab6b2b4b3b1b3b3b0b6b5b3b8b7b5b4b2b0a7a5a38f837dae917ea084725a504c63544da28370b39784b59e8db2a093a698909b918b998e8790857e95877dad998bb39c8cb5a091b9a2938d827c95908dbebab6bbb7b3bdbab7bbb7b4bdb9b6bbb7b4b4b3b0b5b4b1b8b7b5b6b5b3b8b8b5b4b2af968f8ab29a8bab9485544b483a323073655d96887f70655f61595547403e453e3c453f3d57504f655e5b90847db39c8db7a090b6a09189807aaba6a3bdb9b6c0bcb9bebab7bcb7b4bebab7bbb7b4b3b2b0b6b5b3b2b1afb7b6b4b8b7b4b5b4b1aeaba8b5a89fac998d4d44412d25244d46444e4744322b293a3230423937433a37352d2a59504c534b48524a48988a81b59f8fb19c8d827974b2afacbdb9b5bcb8b4bdb9b5bcb8b5bdb9b6bab6b2b8b7b5b5b4b2b6b6b3b9b8b5b7b6b3b6b5b2b8b6b3b9b4b1b2a9a26c64612d25242d2625312a28352d2c453d3a78675c8d7a6ea09792aea6a0615854332b29524a479f8e82b09d90a49b96c1bdb9bebab7bfbbb8bbb8b4b9b5b1b8b4b0b9b4b0b7b6b4b8b7b5b8b7b4b6b5b3b8b6b3bab9b6b9b8b5b4b3b0b7b5b2a5a29f453d3b261e1d261f1e2e2625413936857268977865b19482b5a69caca5a07c7572453d3b746963a0948cc5bfbbc0bbb8beb9b6bbb7b3bbb6b3b7b3afb8b4b0b9b5b1b7b6b3b6b5b3b5b4b2b5b4b2b7b6b3b7b6b3b8b6b3b4b2afb7b6b3b3b1ae6d6765251f1e1e18172a22212d2523443b3971625ab19888b09482a89182877e792c25243e3634766d6abeb9b5bfbbb7bebab6bcb7b3bbb6b3b9b5b1b7b3afb8b4b0b4b3b0b5b4b1b5b4b1b4b3b1b5b4b2b8b6b4b5b3b0b9b6b4b5b4b1b6b4b27f79762a2322221c1b2d2524221b1a443e3c47413f6f676281766f867971675e5a3e37352a222166605dbab7b3bdb9b5beb9b5bcb7b3bcb7b3b9b4b0bab6b2bab6b2b5b3b0b6b4b2b3b2afb7b6b3b4b4b1b4b3b0b6b4b1b5b4b1b4b3b0b9b6b29a8c8252474230292828201f181212322c2c231e1d1c16162c26252923222d26252d2523332b2a8e8885bcb8b5bcb7b3bbb6b2bcb7b3b9b4b1b9b5b1b7b2afb7b2ae7a838e9b9b9caeadacb3b2b0b3b2afb7b7b4b6b5b3b6b6b3b7b6b3b9ada4a991808e7b6f50453f2b24231a14142923221f19181d17161f18182620201d17162a22215d5654b7b3b0bbb7b3bbb6b2b8b4b0bab5b1bbb6b2bab5b1b8b4b0bab6b22c496b4c5d735f68766e727a828285929090adaba8b7b2aeb6a59ab39682a28470a387748e76674e403a1a14141d1716181211221c1c1f1918221c1b2f2827342d2c8d8884bab6b3b9b5b2bab5b1bab5b1b9b4b0bab6b2b8b4b0b9b4b0b7b2ae325e8b365f8a3a5d833f5b7a545f70646469706b6aa08f84b08e78b18e769f7e689e7f6b9e816d907766584940362d2a1c1615201b1a1a1413201a1a251e1d393331a39e9bbab5b1bcb7b3bab6b2b8b3afb8b4b0b9b4b0b9b4b1bab5b2b5b0ac3d6c9843729d44719c426e98415f805a64716f6a699d8677b1927eb3947faa89749d7a649f7f6ba487749e837186716454463f2c25231e181837302e3a33317a7471beb9b6bcb8b4bbb6b2b6b2aebab5b1b9b5b1b8b3afbab6b2b6b1adb5aeaa4877a14c7aa44e7ba345719a3a5d80586b7f767475927b6eb1927faf8e79b08e78a78169a07861a17f6aa58570a688749b83738270666f66618a8480a49e99b7b2aebab6b2bcb8b4b9b5b1b7b2aebab5b1b9b4b0b6b1aeb6b1adb2aca8b2aca84876a04a78a2517fa74771973a5d80405c7a6161677c695fac8a75b08d77b4917aaf8971ad876fa5816aa6846ea78670a98a76ac9484ab9f96b2aca8bdb8b4bcb7b3bcb8b4bcb8b4b8b3afb7b2aeb9b4b0b8b3afb8b2aeb6afabb3aeaab2aeaa4878a14b7aa34c7ba44a759b3d63873b5f825b67766f5f569c7e6caf8c77b18f79b28f78b5927caf8e78a98872aa8a76a98a76ac917fada199b7b0acb9b3afbfb9b5c1bab6bdb6b2b8b3afbab5b1b9b4b0b6afabb7b1adb3ada9b3aeaab0aba8';
|
|
9
|
+
const WIDTH = 32;
|
|
10
|
+
const HEIGHT = 32;
|
|
11
|
+
function parseImage() {
|
|
12
|
+
const pixels = [];
|
|
13
|
+
for (let y = 0; y < HEIGHT; y++) {
|
|
14
|
+
const row = [];
|
|
15
|
+
for (let x = 0; x < WIDTH; x++) {
|
|
16
|
+
const idx = (y * WIDTH + x) * 6;
|
|
17
|
+
const r = parseInt(DAX_HEX.slice(idx, idx + 2), 16);
|
|
18
|
+
const g = parseInt(DAX_HEX.slice(idx + 2, idx + 4), 16);
|
|
19
|
+
const b = parseInt(DAX_HEX.slice(idx + 4, idx + 6), 16);
|
|
20
|
+
row.push([r, g, b]);
|
|
21
|
+
}
|
|
22
|
+
pixels.push(row);
|
|
23
|
+
}
|
|
24
|
+
return pixels;
|
|
25
|
+
}
|
|
26
|
+
function rgb(r, g, b, bg = false) {
|
|
27
|
+
return `\x1b[${bg ? 48 : 38};2;${r};${g};${b}m`;
|
|
28
|
+
}
|
|
29
|
+
const RESET = '\x1b[0m';
|
|
30
|
+
function buildImage() {
|
|
31
|
+
const pixels = parseImage();
|
|
32
|
+
const lines = [];
|
|
33
|
+
// Use half-block chars: ▄ with bg=top pixel, fg=bottom pixel
|
|
34
|
+
for (let row = 0; row < HEIGHT; row += 2) {
|
|
35
|
+
let line = '';
|
|
36
|
+
for (let x = 0; x < WIDTH; x++) {
|
|
37
|
+
const top = pixels[row][x];
|
|
38
|
+
const bottom = pixels[row + 1]?.[x] ?? top;
|
|
39
|
+
line += `${rgb(bottom[0], bottom[1], bottom[2])}${rgb(top[0], top[1], top[2], true)}▄`;
|
|
40
|
+
}
|
|
41
|
+
line += RESET;
|
|
42
|
+
lines.push(line);
|
|
43
|
+
}
|
|
44
|
+
return lines;
|
|
45
|
+
}
|
|
46
|
+
export class DaxnutsComponent {
|
|
47
|
+
ui;
|
|
48
|
+
image;
|
|
49
|
+
interval = null;
|
|
50
|
+
tick = 0;
|
|
51
|
+
maxTicks = 25; // ~2 seconds at 80ms
|
|
52
|
+
cachedLines = [];
|
|
53
|
+
cachedWidth = 0;
|
|
54
|
+
cachedTick = -1;
|
|
55
|
+
constructor(ui) {
|
|
56
|
+
this.ui = ui;
|
|
57
|
+
this.image = buildImage();
|
|
58
|
+
this.startAnimation();
|
|
59
|
+
}
|
|
60
|
+
invalidate() {
|
|
61
|
+
this.cachedWidth = 0;
|
|
62
|
+
}
|
|
63
|
+
startAnimation() {
|
|
64
|
+
this.interval = setInterval(() => {
|
|
65
|
+
this.tick++;
|
|
66
|
+
if (this.tick >= this.maxTicks) {
|
|
67
|
+
this.stopAnimation();
|
|
68
|
+
}
|
|
69
|
+
this.cachedWidth = 0;
|
|
70
|
+
this.ui.requestRender();
|
|
71
|
+
}, 80);
|
|
72
|
+
}
|
|
73
|
+
stopAnimation() {
|
|
74
|
+
if (this.interval) {
|
|
75
|
+
clearInterval(this.interval);
|
|
76
|
+
this.interval = null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
render(width) {
|
|
80
|
+
if (width === this.cachedWidth && this.cachedTick === this.tick) {
|
|
81
|
+
return this.cachedLines;
|
|
82
|
+
}
|
|
83
|
+
const t = theme;
|
|
84
|
+
const lines = [];
|
|
85
|
+
const center = (s) => {
|
|
86
|
+
const visible = s.replace(/\x1b\[[0-9;]*m/g, '').length;
|
|
87
|
+
const left = Math.max(0, Math.floor((width - visible) / 2));
|
|
88
|
+
return ' '.repeat(left) + s;
|
|
89
|
+
};
|
|
90
|
+
lines.push('');
|
|
91
|
+
// Scanline reveal effect: show rows progressively
|
|
92
|
+
const revealedRows = Math.min(this.image.length, Math.floor((this.tick / this.maxTicks) * (this.image.length + 3)));
|
|
93
|
+
for (let i = 0; i < this.image.length; i++) {
|
|
94
|
+
if (i < revealedRows) {
|
|
95
|
+
lines.push(center(this.image[i]));
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// Show scan line
|
|
99
|
+
if (i === revealedRows) {
|
|
100
|
+
const scanline = '▓'.repeat(WIDTH);
|
|
101
|
+
lines.push(center(rgb(100, 200, 255) + scanline + RESET));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
lines.push(center(' '.repeat(WIDTH)));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
lines.push('');
|
|
109
|
+
// Fade in text after image is revealed
|
|
110
|
+
const textPhase = Math.max(0, this.tick - this.maxTicks * 0.6);
|
|
111
|
+
if (textPhase > 0 || this.tick >= this.maxTicks) {
|
|
112
|
+
lines.push(center(t.fg('accent', 'Free Kimi K2.5 via OpenCode Zen')));
|
|
113
|
+
lines.push(center(t.fg('success', '"Powered by daxnuts"')));
|
|
114
|
+
lines.push(center(t.fg('muted', '— @thdxr')));
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
lines.push('');
|
|
118
|
+
lines.push('');
|
|
119
|
+
lines.push('');
|
|
120
|
+
}
|
|
121
|
+
lines.push('');
|
|
122
|
+
if (textPhase > 2 || this.tick >= this.maxTicks) {
|
|
123
|
+
lines.push(center(t.fg('dim', 'Try OpenCode')));
|
|
124
|
+
lines.push(center(t.fg('mdLink', 'https://mistral.ai/news/mistral-vibe-2-0')));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
lines.push('');
|
|
128
|
+
lines.push('');
|
|
129
|
+
}
|
|
130
|
+
lines.push('');
|
|
131
|
+
this.cachedLines = lines;
|
|
132
|
+
this.cachedWidth = width;
|
|
133
|
+
this.cachedTick = this.tick;
|
|
134
|
+
return lines;
|
|
135
|
+
}
|
|
136
|
+
dispose() {
|
|
137
|
+
this.stopAnimation();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=daxnuts.js.map
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as Diff from 'diff';
|
|
2
|
+
import { theme } from '../../../core/theme.js';
|
|
3
|
+
/**
|
|
4
|
+
* Parse diff line to extract prefix, line number, and content.
|
|
5
|
+
* Format: "+123 content" or "-123 content" or " 123 content" or " ..."
|
|
6
|
+
*/
|
|
7
|
+
function parseDiffLine(line) {
|
|
8
|
+
const match = line.match(/^([+-\s])(\s*\d*)\s(.*)$/);
|
|
9
|
+
if (!match)
|
|
10
|
+
return null;
|
|
11
|
+
return { prefix: match[1], lineNum: match[2], content: match[3] };
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Replace tabs with spaces for consistent rendering.
|
|
15
|
+
*/
|
|
16
|
+
function replaceTabs(text) {
|
|
17
|
+
return text.replace(/\t/g, ' ');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Compute word-level diff and render with inverse on changed parts.
|
|
21
|
+
* Uses diffWords which groups whitespace with adjacent words for cleaner highlighting.
|
|
22
|
+
* Strips leading whitespace from inverse to avoid highlighting indentation.
|
|
23
|
+
*/
|
|
24
|
+
function renderIntraLineDiff(oldContent, newContent) {
|
|
25
|
+
const wordDiff = Diff.diffWords(oldContent, newContent);
|
|
26
|
+
let removedLine = '';
|
|
27
|
+
let addedLine = '';
|
|
28
|
+
let isFirstRemoved = true;
|
|
29
|
+
let isFirstAdded = true;
|
|
30
|
+
for (const part of wordDiff) {
|
|
31
|
+
if (part.removed) {
|
|
32
|
+
let value = part.value;
|
|
33
|
+
// Strip leading whitespace from the first removed part
|
|
34
|
+
if (isFirstRemoved) {
|
|
35
|
+
const leadingWs = value.match(/^(\s*)/)?.[1] || '';
|
|
36
|
+
value = value.slice(leadingWs.length);
|
|
37
|
+
removedLine += leadingWs;
|
|
38
|
+
isFirstRemoved = false;
|
|
39
|
+
}
|
|
40
|
+
if (value) {
|
|
41
|
+
removedLine += theme.inverse(value);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else if (part.added) {
|
|
45
|
+
let value = part.value;
|
|
46
|
+
// Strip leading whitespace from the first added part
|
|
47
|
+
if (isFirstAdded) {
|
|
48
|
+
const leadingWs = value.match(/^(\s*)/)?.[1] || '';
|
|
49
|
+
value = value.slice(leadingWs.length);
|
|
50
|
+
addedLine += leadingWs;
|
|
51
|
+
isFirstAdded = false;
|
|
52
|
+
}
|
|
53
|
+
if (value) {
|
|
54
|
+
addedLine += theme.inverse(value);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
removedLine += part.value;
|
|
59
|
+
addedLine += part.value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return { removedLine, addedLine };
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Render a diff string with colored lines and intra-line change highlighting.
|
|
66
|
+
* - Context lines: dim/gray
|
|
67
|
+
* - Removed lines: red, with inverse on changed tokens
|
|
68
|
+
* - Added lines: green, with inverse on changed tokens
|
|
69
|
+
*/
|
|
70
|
+
export function renderDiff(diffText, _options = {}) {
|
|
71
|
+
const lines = diffText.split('\n');
|
|
72
|
+
const result = [];
|
|
73
|
+
let i = 0;
|
|
74
|
+
while (i < lines.length) {
|
|
75
|
+
const line = lines[i];
|
|
76
|
+
const parsed = parseDiffLine(line);
|
|
77
|
+
if (!parsed) {
|
|
78
|
+
result.push(theme.fg('toolDiffContext', line));
|
|
79
|
+
i++;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (parsed.prefix === '-') {
|
|
83
|
+
// Collect consecutive removed lines
|
|
84
|
+
const removedLines = [];
|
|
85
|
+
while (i < lines.length) {
|
|
86
|
+
const p = parseDiffLine(lines[i]);
|
|
87
|
+
if (!p || p.prefix !== '-')
|
|
88
|
+
break;
|
|
89
|
+
removedLines.push({ lineNum: p.lineNum, content: p.content });
|
|
90
|
+
i++;
|
|
91
|
+
}
|
|
92
|
+
// Collect consecutive added lines
|
|
93
|
+
const addedLines = [];
|
|
94
|
+
while (i < lines.length) {
|
|
95
|
+
const p = parseDiffLine(lines[i]);
|
|
96
|
+
if (!p || p.prefix !== '+')
|
|
97
|
+
break;
|
|
98
|
+
addedLines.push({ lineNum: p.lineNum, content: p.content });
|
|
99
|
+
i++;
|
|
100
|
+
}
|
|
101
|
+
// Only do intra-line diffing when there's exactly one removed and one added line
|
|
102
|
+
// (indicating a single line modification). Otherwise, show lines as-is.
|
|
103
|
+
if (removedLines.length === 1 && addedLines.length === 1) {
|
|
104
|
+
const removed = removedLines[0];
|
|
105
|
+
const added = addedLines[0];
|
|
106
|
+
const { removedLine, addedLine } = renderIntraLineDiff(replaceTabs(removed.content), replaceTabs(added.content));
|
|
107
|
+
result.push(theme.fg('toolDiffRemoved', `-${removed.lineNum} ${removedLine}`));
|
|
108
|
+
result.push(theme.fg('toolDiffAdded', `+${added.lineNum} ${addedLine}`));
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
// Show all removed lines first, then all added lines
|
|
112
|
+
for (const removed of removedLines) {
|
|
113
|
+
result.push(theme.fg('toolDiffRemoved', `-${removed.lineNum} ${replaceTabs(removed.content)}`));
|
|
114
|
+
}
|
|
115
|
+
for (const added of addedLines) {
|
|
116
|
+
result.push(theme.fg('toolDiffAdded', `+${added.lineNum} ${replaceTabs(added.content)}`));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else if (parsed.prefix === '+') {
|
|
121
|
+
// Standalone added line
|
|
122
|
+
result.push(theme.fg('toolDiffAdded', `+${parsed.lineNum} ${replaceTabs(parsed.content)}`));
|
|
123
|
+
i++;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
// Context line
|
|
127
|
+
result.push(theme.fg('toolDiffContext', ` ${parsed.lineNum} ${replaceTabs(parsed.content)}`));
|
|
128
|
+
i++;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return result.join('\n');
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { theme } from '../../../core/theme.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dynamic border component that adjusts to viewport width.
|
|
4
|
+
*
|
|
5
|
+
* Note: When used from extensions loaded via jiti, the global `theme` may be undefined
|
|
6
|
+
* because jiti creates a separate module cache. Always pass an explicit color
|
|
7
|
+
* function when using DynamicBorder in components exported for extension use.
|
|
8
|
+
*/
|
|
9
|
+
export class DynamicBorder {
|
|
10
|
+
color;
|
|
11
|
+
constructor(color = (str) => theme.fg('border', str)) {
|
|
12
|
+
this.color = color;
|
|
13
|
+
}
|
|
14
|
+
invalidate() {
|
|
15
|
+
// No cached state to invalidate currently
|
|
16
|
+
}
|
|
17
|
+
render(width) {
|
|
18
|
+
return [this.color('─'.repeat(Math.max(1, width)))];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=dynamic-border.js.map
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-line editor component for extensions.
|
|
3
|
+
* Supports Ctrl+G for external editor.
|
|
4
|
+
*/
|
|
5
|
+
import { Container, Editor, getEditorKeybindings, Spacer, Text } from '../../../tui/index.js';
|
|
6
|
+
import { spawnSync } from 'node:child_process';
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as os from 'node:os';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
import { theme } from '../../../core/theme.js';
|
|
11
|
+
import { getEditorTheme } from '../theme/theme.js';
|
|
12
|
+
import { DynamicBorder } from './dynamic-border.js';
|
|
13
|
+
import { appKeyHint, keyHint } from './keybinding-hints.js';
|
|
14
|
+
export class ExtensionEditorComponent extends Container {
|
|
15
|
+
editor;
|
|
16
|
+
onSubmitCallback;
|
|
17
|
+
onCancelCallback;
|
|
18
|
+
tui;
|
|
19
|
+
keybindings;
|
|
20
|
+
constructor(tui, keybindings, title, prefill, onSubmit, onCancel, options) {
|
|
21
|
+
super();
|
|
22
|
+
this.tui = tui;
|
|
23
|
+
this.keybindings = keybindings;
|
|
24
|
+
this.onSubmitCallback = onSubmit;
|
|
25
|
+
this.onCancelCallback = onCancel;
|
|
26
|
+
// Add top border
|
|
27
|
+
this.addChild(new DynamicBorder());
|
|
28
|
+
this.addChild(new Spacer(1));
|
|
29
|
+
// Add title
|
|
30
|
+
this.addChild(new Text(theme.fg('accent', title), 1, 0));
|
|
31
|
+
this.addChild(new Spacer(1));
|
|
32
|
+
// Create editor
|
|
33
|
+
this.editor = new Editor(tui, getEditorTheme(), options);
|
|
34
|
+
if (prefill) {
|
|
35
|
+
this.editor.setText(prefill);
|
|
36
|
+
}
|
|
37
|
+
// Wire up Enter to submit (Shift+Enter for newlines, like the main editor)
|
|
38
|
+
this.editor.onSubmit = (text) => {
|
|
39
|
+
this.onSubmitCallback(text);
|
|
40
|
+
};
|
|
41
|
+
this.addChild(this.editor);
|
|
42
|
+
this.addChild(new Spacer(1));
|
|
43
|
+
// Add hint
|
|
44
|
+
const hasExternalEditor = !!(process.env.VISUAL || process.env.EDITOR);
|
|
45
|
+
const hint = keyHint('selectConfirm', 'submit') +
|
|
46
|
+
' ' +
|
|
47
|
+
keyHint('newLine', 'newline') +
|
|
48
|
+
' ' +
|
|
49
|
+
keyHint('selectCancel', 'cancel') +
|
|
50
|
+
(hasExternalEditor
|
|
51
|
+
? ` ${appKeyHint(this.keybindings, 'externalEditor', 'external editor')}`
|
|
52
|
+
: '');
|
|
53
|
+
this.addChild(new Text(hint, 1, 0));
|
|
54
|
+
this.addChild(new Spacer(1));
|
|
55
|
+
// Add bottom border
|
|
56
|
+
this.addChild(new DynamicBorder());
|
|
57
|
+
}
|
|
58
|
+
handleInput(keyData) {
|
|
59
|
+
const kb = getEditorKeybindings();
|
|
60
|
+
// Escape or Ctrl+C to cancel
|
|
61
|
+
if (kb.matches(keyData, 'selectCancel')) {
|
|
62
|
+
this.onCancelCallback();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// External editor (app keybinding)
|
|
66
|
+
if (this.keybindings.matches(keyData, 'externalEditor')) {
|
|
67
|
+
this.openExternalEditor();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
// Forward to editor
|
|
71
|
+
this.editor.handleInput(keyData);
|
|
72
|
+
}
|
|
73
|
+
openExternalEditor() {
|
|
74
|
+
const editorCmd = process.env.VISUAL || process.env.EDITOR;
|
|
75
|
+
if (!editorCmd) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const currentText = this.editor.getText();
|
|
79
|
+
const tmpFile = path.join(os.tmpdir(), `pi-extension-editor-${Date.now()}.md`);
|
|
80
|
+
try {
|
|
81
|
+
fs.writeFileSync(tmpFile, currentText, 'utf-8');
|
|
82
|
+
this.tui.stop();
|
|
83
|
+
const [editor, ...editorArgs] = editorCmd.split(' ');
|
|
84
|
+
const result = spawnSync(editor, [...editorArgs, tmpFile], {
|
|
85
|
+
stdio: 'inherit'
|
|
86
|
+
});
|
|
87
|
+
if (result.status === 0) {
|
|
88
|
+
const newContent = fs.readFileSync(tmpFile, 'utf-8').replace(/\n$/, '');
|
|
89
|
+
this.editor.setText(newContent);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
try {
|
|
94
|
+
fs.unlinkSync(tmpFile);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Ignore cleanup errors
|
|
98
|
+
}
|
|
99
|
+
this.tui.start();
|
|
100
|
+
// Force full re-render since external editor uses alternate screen
|
|
101
|
+
this.tui.requestRender(true);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=extension-editor.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple text input component for extensions.
|
|
3
|
+
*/
|
|
4
|
+
import { Container, getEditorKeybindings, Input, Spacer, Text } from '../../../tui/index.js';
|
|
5
|
+
import { theme } from '../../../core/theme.js';
|
|
6
|
+
import { CountdownTimer } from './countdown-timer.js';
|
|
7
|
+
import { DynamicBorder } from './dynamic-border.js';
|
|
8
|
+
import { keyHint } from './keybinding-hints.js';
|
|
9
|
+
export class ExtensionInputComponent extends Container {
|
|
10
|
+
input;
|
|
11
|
+
onSubmitCallback;
|
|
12
|
+
onCancelCallback;
|
|
13
|
+
titleText;
|
|
14
|
+
baseTitle;
|
|
15
|
+
countdown;
|
|
16
|
+
// Focusable implementation - propagate to input for IME cursor positioning
|
|
17
|
+
_focused = false;
|
|
18
|
+
get focused() {
|
|
19
|
+
return this._focused;
|
|
20
|
+
}
|
|
21
|
+
set focused(value) {
|
|
22
|
+
this._focused = value;
|
|
23
|
+
this.input.focused = value;
|
|
24
|
+
}
|
|
25
|
+
constructor(title, _placeholder, onSubmit, onCancel, opts) {
|
|
26
|
+
super();
|
|
27
|
+
this.onSubmitCallback = onSubmit;
|
|
28
|
+
this.onCancelCallback = onCancel;
|
|
29
|
+
this.baseTitle = title;
|
|
30
|
+
this.addChild(new DynamicBorder());
|
|
31
|
+
this.addChild(new Spacer(1));
|
|
32
|
+
this.titleText = new Text(theme.fg('accent', title), 1, 0);
|
|
33
|
+
this.addChild(this.titleText);
|
|
34
|
+
this.addChild(new Spacer(1));
|
|
35
|
+
if (opts?.timeout && opts.timeout > 0 && opts.tui) {
|
|
36
|
+
this.countdown = new CountdownTimer(opts.timeout, opts.tui, (s) => this.titleText.setText(theme.fg('accent', `${this.baseTitle} (${s}s)`)), () => this.onCancelCallback());
|
|
37
|
+
}
|
|
38
|
+
this.input = new Input();
|
|
39
|
+
this.addChild(this.input);
|
|
40
|
+
this.addChild(new Spacer(1));
|
|
41
|
+
this.addChild(new Text(`${keyHint('selectConfirm', 'submit')} ${keyHint('selectCancel', 'cancel')}`, 1, 0));
|
|
42
|
+
this.addChild(new Spacer(1));
|
|
43
|
+
this.addChild(new DynamicBorder());
|
|
44
|
+
}
|
|
45
|
+
handleInput(keyData) {
|
|
46
|
+
const kb = getEditorKeybindings();
|
|
47
|
+
if (kb.matches(keyData, 'selectConfirm') || keyData === '\n') {
|
|
48
|
+
this.onSubmitCallback(this.input.getValue());
|
|
49
|
+
}
|
|
50
|
+
else if (kb.matches(keyData, 'selectCancel')) {
|
|
51
|
+
this.onCancelCallback();
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.input.handleInput(keyData);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
dispose() {
|
|
58
|
+
this.countdown?.dispose();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=extension-input.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic selector component for extensions.
|
|
3
|
+
* Displays a list of string options with keyboard navigation.
|
|
4
|
+
*/
|
|
5
|
+
import { Container, getEditorKeybindings, Spacer, Text } from '../../../tui/index.js';
|
|
6
|
+
import { theme } from '../../../core/theme.js';
|
|
7
|
+
import { CountdownTimer } from './countdown-timer.js';
|
|
8
|
+
import { DynamicBorder } from './dynamic-border.js';
|
|
9
|
+
import { keyHint, rawKeyHint } from './keybinding-hints.js';
|
|
10
|
+
export class ExtensionSelectorComponent extends Container {
|
|
11
|
+
options;
|
|
12
|
+
selectedIndex = 0;
|
|
13
|
+
listContainer;
|
|
14
|
+
onSelectCallback;
|
|
15
|
+
onCancelCallback;
|
|
16
|
+
titleText;
|
|
17
|
+
baseTitle;
|
|
18
|
+
countdown;
|
|
19
|
+
constructor(title, options, onSelect, onCancel, opts) {
|
|
20
|
+
super();
|
|
21
|
+
this.options = options;
|
|
22
|
+
this.onSelectCallback = onSelect;
|
|
23
|
+
this.onCancelCallback = onCancel;
|
|
24
|
+
this.baseTitle = title;
|
|
25
|
+
this.addChild(new DynamicBorder());
|
|
26
|
+
this.addChild(new Spacer(1));
|
|
27
|
+
this.titleText = new Text(theme.fg('accent', title), 1, 0);
|
|
28
|
+
this.addChild(this.titleText);
|
|
29
|
+
this.addChild(new Spacer(1));
|
|
30
|
+
if (opts?.timeout && opts.timeout > 0 && opts.tui) {
|
|
31
|
+
this.countdown = new CountdownTimer(opts.timeout, opts.tui, (s) => this.titleText.setText(theme.fg('accent', `${this.baseTitle} (${s}s)`)), () => this.onCancelCallback());
|
|
32
|
+
}
|
|
33
|
+
this.listContainer = new Container();
|
|
34
|
+
this.addChild(this.listContainer);
|
|
35
|
+
this.addChild(new Spacer(1));
|
|
36
|
+
this.addChild(new Text(rawKeyHint('↑↓', 'navigate') +
|
|
37
|
+
' ' +
|
|
38
|
+
keyHint('selectConfirm', 'select') +
|
|
39
|
+
' ' +
|
|
40
|
+
keyHint('selectCancel', 'cancel'), 1, 0));
|
|
41
|
+
this.addChild(new Spacer(1));
|
|
42
|
+
this.addChild(new DynamicBorder());
|
|
43
|
+
this.updateList();
|
|
44
|
+
}
|
|
45
|
+
updateList() {
|
|
46
|
+
this.listContainer.clear();
|
|
47
|
+
for (let i = 0; i < this.options.length; i++) {
|
|
48
|
+
const isSelected = i === this.selectedIndex;
|
|
49
|
+
const text = isSelected
|
|
50
|
+
? theme.fg('accent', '→ ') + theme.fg('accent', this.options[i])
|
|
51
|
+
: ` ${theme.fg('text', this.options[i])}`;
|
|
52
|
+
this.listContainer.addChild(new Text(text, 1, 0));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
handleInput(keyData) {
|
|
56
|
+
const kb = getEditorKeybindings();
|
|
57
|
+
if (kb.matches(keyData, 'selectUp') || keyData === 'k') {
|
|
58
|
+
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
59
|
+
this.updateList();
|
|
60
|
+
}
|
|
61
|
+
else if (kb.matches(keyData, 'selectDown') || keyData === 'j') {
|
|
62
|
+
this.selectedIndex = Math.min(this.options.length - 1, this.selectedIndex + 1);
|
|
63
|
+
this.updateList();
|
|
64
|
+
}
|
|
65
|
+
else if (kb.matches(keyData, 'selectConfirm') || keyData === '\n') {
|
|
66
|
+
const selected = this.options[this.selectedIndex];
|
|
67
|
+
if (selected)
|
|
68
|
+
this.onSelectCallback(selected);
|
|
69
|
+
}
|
|
70
|
+
else if (kb.matches(keyData, 'selectCancel')) {
|
|
71
|
+
this.onCancelCallback();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
dispose() {
|
|
75
|
+
this.countdown?.dispose();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=extension-selector.js.map
|