apex-code 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +257 -5
- package/README.md +624 -0
- package/dist/bun/cli.d.ts +3 -1
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/cli.js +3 -9
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/runtime-setup.d.ts +2 -0
- package/dist/bun/runtime-setup.d.ts.map +1 -0
- package/dist/bun/runtime-setup.js +9 -0
- package/dist/bun/runtime-setup.js.map +1 -0
- package/dist/bun/sandbox-env-setup.d.ts +2 -0
- package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
- package/dist/bun/sandbox-env-setup.js +4 -0
- package/dist/bun/sandbox-env-setup.js.map +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +16 -5
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +2 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/session-picker.d.ts +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +13 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +16 -8
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +85 -15
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +685 -266
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +4 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +55 -0
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bug-report.d.ts +176 -0
- package/dist/core/bug-report.d.ts.map +1 -0
- package/dist/core/bug-report.js +291 -0
- package/dist/core/bug-report.js.map +1 -0
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +12 -1
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +103 -0
- package/dist/core/cache-warmer.d.ts.map +1 -0
- package/dist/core/cache-warmer.js +356 -0
- package/dist/core/cache-warmer.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +4 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +5 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +163 -66
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/context/pipeline.d.ts +8 -8
- package/dist/core/context/pipeline.d.ts.map +1 -1
- package/dist/core/context/pipeline.js +21 -12
- package/dist/core/context/pipeline.js.map +1 -1
- package/dist/core/crash-log.d.ts +27 -0
- package/dist/core/crash-log.d.ts.map +1 -0
- package/dist/core/crash-log.js +139 -0
- package/dist/core/crash-log.js.map +1 -0
- package/dist/core/export-html/template.js +6 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/jiti-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-loader.js +4 -0
- package/dist/core/extensions/jiti-loader.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +4 -0
- package/dist/core/extensions/jiti-static-loader.js.map +1 -0
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +40 -59
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +24 -8
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +195 -72
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +142 -55
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts +3 -0
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
- package/dist/core/extensions/virtual-modules.js +41 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +1 -20
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +2 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +6 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +5 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +1 -0
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +168 -20
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +44 -18
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +5 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +8 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +4 -3
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +1 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +12 -6
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/permissions/store.d.ts.map +1 -1
- package/dist/core/permissions/store.js +11 -8
- package/dist/core/permissions/store.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +6 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +61 -35
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts +4 -2
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +29 -2
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/radius.d.ts +3 -0
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +6 -0
- package/dist/core/radius.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +6 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +63 -42
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-export.d.ts +6 -2
- package/dist/core/session-export.d.ts.map +1 -1
- package/dist/core/session-export.js +14 -13
- package/dist/core/session-export.js.map +1 -1
- package/dist/core/session-manager.d.ts +66 -15
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +295 -115
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +27 -4
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +55 -7
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +5 -4
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts +49 -6
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +140 -79
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +7 -8
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +20 -115
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +1 -12
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +6 -204
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +4 -55
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +4 -60
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +4 -49
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +4 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +10 -125
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts +18 -0
- package/dist/core/tools/renderers/bash.d.ts.map +1 -0
- package/dist/core/tools/renderers/bash.js +126 -0
- package/dist/core/tools/renderers/bash.js.map +1 -0
- package/dist/core/tools/renderers/edit.d.ts +23 -0
- package/dist/core/tools/renderers/edit.d.ts.map +1 -0
- package/dist/core/tools/renderers/edit.js +207 -0
- package/dist/core/tools/renderers/edit.js.map +1 -0
- package/dist/core/tools/renderers/find.d.ts +10 -0
- package/dist/core/tools/renderers/find.d.ts.map +1 -0
- package/dist/core/tools/renderers/find.js +64 -0
- package/dist/core/tools/renderers/find.js.map +1 -0
- package/dist/core/tools/renderers/grep.d.ts +10 -0
- package/dist/core/tools/renderers/grep.d.ts.map +1 -0
- package/dist/core/tools/renderers/grep.js +69 -0
- package/dist/core/tools/renderers/grep.js.map +1 -0
- package/dist/core/tools/renderers/index.d.ts +34 -0
- package/dist/core/tools/renderers/index.d.ts.map +1 -0
- package/dist/core/tools/renderers/index.js +47 -0
- package/dist/core/tools/renderers/index.js.map +1 -0
- package/dist/core/tools/renderers/ls.d.ts +10 -0
- package/dist/core/tools/renderers/ls.d.ts.map +1 -0
- package/dist/core/tools/renderers/ls.js +58 -0
- package/dist/core/tools/renderers/ls.js.map +1 -0
- package/dist/core/tools/renderers/read.d.ts +11 -0
- package/dist/core/tools/renderers/read.d.ts.map +1 -0
- package/dist/core/tools/renderers/read.js +132 -0
- package/dist/core/tools/renderers/read.js.map +1 -0
- package/dist/core/tools/renderers/write.d.ts +10 -0
- package/dist/core/tools/renderers/write.d.ts.map +1 -0
- package/dist/core/tools/renderers/write.js +152 -0
- package/dist/core/tools/renderers/write.js.map +1 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +6 -146
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-totals.d.ts +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +5 -1
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +2 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +7 -3
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +20 -5
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +21 -13
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/bug-report.d.ts +16 -0
- package/dist/modes/interactive/bug-report.d.ts.map +1 -0
- package/dist/modes/interactive/bug-report.js +167 -0
- package/dist/modes/interactive/bug-report.js.map +1 -0
- package/dist/modes/interactive/chat-viewport.d.ts +20 -0
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
- package/dist/modes/interactive/chat-viewport.js +28 -0
- package/dist/modes/interactive/chat-viewport.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +7 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +63 -17
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +12 -5
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +12 -5
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +12 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +38 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/error-summary.d.ts +11 -0
- package/dist/modes/interactive/components/error-summary.d.ts.map +1 -0
- package/dist/modes/interactive/components/error-summary.js +31 -0
- package/dist/modes/interactive/components/error-summary.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +4 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +6 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +2 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +6 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +2 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +4 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +4 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +3 -3
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +13 -15
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +5 -5
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +74 -48
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +5 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +35 -10
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +11 -4
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +3 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +10 -3
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +6 -6
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +27 -5
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +64 -42
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +9 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +2 -2
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +43 -29
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +431 -166
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +2 -1
- package/dist/modes/interactive/theme/light.json +2 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +5 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-json.js +130 -0
- package/dist/modes/interactive/theme/theme-json.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +6 -2
- package/dist/modes/interactive/theme/theme.d.ts +14 -5
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +18 -119
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tui-renderer.d.ts +21 -0
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
- package/dist/modes/interactive/tui-renderer.js +66 -0
- package/dist/modes/interactive/tui-renderer.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +2 -2
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/testing/replay/recorded-provider.d.ts +2 -2
- package/dist/testing/replay/recorded-provider.d.ts.map +1 -1
- package/dist/testing/replay/recorded-provider.js +2 -5
- package/dist/testing/replay/recorded-provider.js.map +1 -1
- package/dist/testing/replay/runner.d.ts.map +1 -1
- package/dist/testing/replay/runner.js +0 -1
- package/dist/testing/replay/runner.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts +7 -0
- package/dist/utils/clipboard-command.d.ts.map +1 -0
- package/dist/utils/clipboard-command.js +45 -0
- package/dist/utils/clipboard-command.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +53 -81
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +111 -121
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js +2 -3
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js +1 -1
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +21 -21
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/tool-result-images.d.ts +3 -1
- package/dist/utils/tool-result-images.d.ts.map +1 -1
- package/dist/utils/tool-result-images.js +4 -1
- package/dist/utils/tool-result-images.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +11 -2
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/wsl.d.ts +3 -0
- package/dist/utils/wsl.d.ts.map +1 -0
- package/dist/utils/wsl.js +15 -0
- package/dist/utils/wsl.js.map +1 -0
- package/dist/utils/zip.d.ts +7 -0
- package/dist/utils/zip.d.ts.map +1 -0
- package/dist/utils/zip.js +60 -0
- package/dist/utils/zip.js.map +1 -0
- package/docs/cli-integration.md +107 -0
- package/docs/cli.md +269 -0
- package/docs/compaction.md +73 -24
- package/docs/configuration.md +45 -0
- package/docs/containerization.md +22 -21
- package/docs/custom-provider.md +21 -12
- package/docs/development.md +19 -0
- package/docs/docs.json +139 -95
- package/docs/extensions.md +243 -371
- package/docs/how-pi-works.md +49 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/index.md +3 -3
- package/docs/json.md +7 -3
- package/docs/keybindings.md +57 -54
- package/docs/llama-cpp.md +2 -2
- package/docs/message-types.md +261 -0
- package/docs/models.md +103 -49
- package/docs/packages.md +49 -47
- package/docs/prompt-templates.md +29 -56
- package/docs/providers.md +91 -139
- package/docs/quickstart.md +42 -14
- package/docs/rpc-commands.md +854 -0
- package/docs/rpc-extension-ui.md +200 -0
- package/docs/rpc.md +121 -223
- package/docs/sdk.md +99 -124
- package/docs/security.md +7 -7
- package/docs/session-format.md +85 -82
- package/docs/sessions.md +41 -57
- package/docs/settings.md +94 -87
- package/docs/shell-aliases.md +68 -3
- package/docs/skills.md +62 -49
- package/docs/slash-commands.md +60 -0
- package/docs/terminal-setup.md +86 -55
- package/docs/termux.md +65 -75
- package/docs/themes.md +64 -86
- package/docs/tmux.md +29 -7
- package/docs/tui.md +67 -122
- package/docs/usage.md +31 -42
- package/docs/windows.md +41 -13
- package/examples/README.md +16 -2
- package/examples/extensions/README.md +0 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +18 -12
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +2 -0
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/prompt-customizer.ts +19 -67
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/plugins/pi-example-plugin/README.md +38 -0
- package/examples/plugins/pi-example-plugin/package.json +10 -0
- package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
- package/examples/plugins/pi-example-plugin/src/session.ts +24 -0
- package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
- package/examples/rpc-client.ts +35 -0
- package/examples/rpc-extension-ui.ts +25 -5
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +861 -513
- package/package.json +27 -18
- package/dist/bun/register-bedrock.d.ts +0 -2
- package/dist/bun/register-bedrock.d.ts.map +0 -1
- package/dist/bun/register-bedrock.js +0 -4
- package/dist/bun/register-bedrock.js.map +0 -1
- package/dist/cli/experimental/auth.d.ts +0 -16
- package/dist/cli/experimental/auth.d.ts.map +0 -1
- package/dist/cli/experimental/auth.js +0 -13
- package/dist/cli/experimental/auth.js.map +0 -1
- package/dist/cli/experimental/cli.d.ts +0 -6
- package/dist/cli/experimental/cli.d.ts.map +0 -1
- package/dist/cli/experimental/cli.js +0 -5
- package/dist/cli/experimental/cli.js.map +0 -1
- package/dist/cli/experimental/command-options.d.ts +0 -17
- package/dist/cli/experimental/command-options.d.ts.map +0 -1
- package/dist/cli/experimental/command-options.js +0 -35
- package/dist/cli/experimental/command-options.js.map +0 -1
- package/dist/cli/experimental/command.d.ts +0 -63
- package/dist/cli/experimental/command.d.ts.map +0 -1
- package/dist/cli/experimental/command.js +0 -130
- package/dist/cli/experimental/command.js.map +0 -1
- package/dist/cli/experimental/commands/client.d.ts +0 -13
- package/dist/cli/experimental/commands/client.d.ts.map +0 -1
- package/dist/cli/experimental/commands/client.js +0 -25
- package/dist/cli/experimental/commands/client.js.map +0 -1
- package/dist/cli/experimental/commands/pi.d.ts +0 -15
- package/dist/cli/experimental/commands/pi.d.ts.map +0 -1
- package/dist/cli/experimental/commands/pi.js +0 -28
- package/dist/cli/experimental/commands/pi.js.map +0 -1
- package/dist/cli/experimental/commands/server.d.ts +0 -13
- package/dist/cli/experimental/commands/server.d.ts.map +0 -1
- package/dist/cli/experimental/commands/server.js +0 -25
- package/dist/cli/experimental/commands/server.js.map +0 -1
- package/dist/cli/experimental/transport-address.d.ts +0 -10
- package/dist/cli/experimental/transport-address.d.ts.map +0 -1
- package/dist/cli/experimental/transport-address.js +0 -38
- package/dist/cli/experimental/transport-address.js.map +0 -1
- package/dist/client/index.d.ts +0 -3
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js +0 -3
- package/dist/client/index.js.map +0 -1
- package/dist/client/remote-session.d.ts +0 -53
- package/dist/client/remote-session.d.ts.map +0 -1
- package/dist/client/remote-session.js +0 -340
- package/dist/client/remote-session.js.map +0 -1
- package/dist/client/transcript.d.ts +0 -12
- package/dist/client/transcript.d.ts.map +0 -1
- package/dist/client/transcript.js +0 -98
- package/dist/client/transcript.js.map +0 -1
- package/dist/utils/clipboard-native.d.ts +0 -11
- package/dist/utils/clipboard-native.d.ts.map +0 -1
- package/dist/utils/clipboard-native.js +0 -20
- package/dist/utils/clipboard-native.js.map +0 -1
package/docs/terminal-setup.md
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Configure your terminal
|
|
2
2
|
|
|
3
3
|
Apex Code uses the [Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) for reliable modifier key detection. Most modern terminals support this protocol, but some require configuration.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Pi uses extended-key protocols so terminals can distinguish combinations such as `Shift+Enter` and `Alt+Enter` from plain `Enter`. Terminal proxies, multiplexers, and built-in IDE terminals can change or discard that information.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Troubleshooting
|
|
8
8
|
|
|
9
|
-
|
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
9
|
+
| Symptom | Start here |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `Shift+Enter` submits instead of inserting a line | Your terminal's section below; for tmux, see [Run Pi in tmux](tmux.md) |
|
|
12
|
+
| `Alt+Enter` does not queue a follow-up | [WezTerm](#wezterm), [Alacritty](#alacritty), or [Windows Terminal](#windows-terminal) |
|
|
13
|
+
| Fullscreen scrolling is unusually slow | [iTerm2](#iterm2) |
|
|
14
|
+
| Links work but show no hover preview | [Ghostty](#ghostty) |
|
|
15
|
+
| Inline images or colors are not detected | [Override detected capabilities](#override-detected-capabilities) |
|
|
16
|
+
| An IME candidate window appears in the wrong place | [WezTerm](#wezterm) or [IntelliJ IDEA](#intellij-idea-integrated-terminal) |
|
|
17
|
+
| Modified keys fail only inside tmux | [Run Pi in tmux](tmux.md) |
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
Use `/hotkeys` to inspect Pi's active shortcuts. See [Keybindings](keybindings.md) to change them.
|
|
16
20
|
|
|
17
21
|
## Kitty
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
Kitty supports the required keyboard protocol without additional configuration.
|
|
20
24
|
|
|
21
25
|
## iTerm2
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
Regular terminal mode works without additional configuration.
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### Fullscreen TUI mode
|
|
29
|
+
### Fix slow fullscreen scrolling
|
|
28
30
|
|
|
29
|
-
Pi owns the viewport, so iTerm2 sends mouse-wheel reports instead of scrolling
|
|
31
|
+
In fullscreen mode, Pi owns the viewport, so iTerm2 sends mouse-wheel reports instead of scrolling native terminal history. Fast trackpad gestures can then move only about one line at a time.
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
To change this behavior:
|
|
32
34
|
|
|
33
|
-
1. Open **iTerm2
|
|
34
|
-
2. Search for **Trackpad scrolls fast
|
|
35
|
+
1. Open **iTerm2 > Settings > Advanced**.
|
|
36
|
+
2. Search for **Trackpad scrolls fast?**.
|
|
37
|
+
3. Set it to **No**.
|
|
35
38
|
|
|
36
|
-
This is an iTerm2-wide
|
|
39
|
+
This is an iTerm2-wide setting and can also change native trackpad scrolling. The underlying behavior is tracked in [iTerm2 issue 9619](https://gitlab.com/gnachman/iterm2/-/work_items/9619).
|
|
37
40
|
|
|
38
41
|
## Apple Terminal
|
|
39
42
|
|
|
@@ -43,21 +46,23 @@ This fallback only works when Apex Code runs on the same Mac as Terminal.app. It
|
|
|
43
46
|
|
|
44
47
|
## Ghostty
|
|
45
48
|
|
|
46
|
-
Add to
|
|
49
|
+
Add this mapping to Ghostty's configuration if `Alt+Backspace` does not work:
|
|
47
50
|
|
|
48
|
-
```
|
|
51
|
+
```text
|
|
49
52
|
keybind = alt+backspace=text:\x1b\x7f
|
|
50
53
|
```
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
The configuration file is `~/Library/Application Support/com.mitchellh.ghostty/config` on macOS and `~/.config/ghostty/config` on Linux.
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
Older Claude Code configurations may contain:
|
|
58
|
+
|
|
59
|
+
```text
|
|
55
60
|
keybind = shift+enter=text:\n
|
|
56
61
|
```
|
|
57
62
|
|
|
58
63
|
That mapping sends a raw linefeed byte. Inside Apex Code, that is indistinguishable from `Ctrl+J`, so tmux and Apex Code no longer see a real `shift+enter` key event.
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
### Open links in fullscreen mode
|
|
61
66
|
|
|
62
67
|
Apex Code binds `Ctrl+J` as a default newline alias, so `Shift+Enter` keeps working in tmux via that remap without extra apex-code configuration.
|
|
63
68
|
|
|
@@ -67,7 +72,7 @@ In fullscreen mode, links remain clickable, but Ghostty does not show its hover
|
|
|
67
72
|
|
|
68
73
|
## WezTerm
|
|
69
74
|
|
|
70
|
-
WezTerm
|
|
75
|
+
WezTerm normally reports `Shift+Enter` through xterm extended keys. To enable the Kitty keyboard protocol explicitly, create `~/.wezterm.lua`:
|
|
71
76
|
|
|
72
77
|
```lua
|
|
73
78
|
local wezterm = require 'wezterm'
|
|
@@ -91,7 +96,7 @@ config.keys = {
|
|
|
91
96
|
return config
|
|
92
97
|
```
|
|
93
98
|
|
|
94
|
-
|
|
99
|
+
### Position an IME candidate window in WSL
|
|
95
100
|
|
|
96
101
|
On WSL, WezTerm may require a visible hardware cursor for IME candidate window positioning. If CJK IME candidates do not follow the text cursor, set `APEX_CODE_HARDWARE_CURSOR=1` before running Apex Code or set `showHardwareCursor` to `true` in settings. The temporary `PI_HARDWARE_CURSOR` alias also works.
|
|
97
102
|
|
|
@@ -106,27 +111,41 @@ mods = "Alt"
|
|
|
106
111
|
chars = "\u001b[13;3u"
|
|
107
112
|
```
|
|
108
113
|
|
|
109
|
-
Restart Alacritty after changing the
|
|
114
|
+
Restart Alacritty after changing the file.
|
|
115
|
+
|
|
116
|
+
## VS Code integrated terminal
|
|
110
117
|
|
|
111
|
-
|
|
118
|
+
VS Code 1.109.5 and newer enable the Kitty keyboard protocol in the integrated terminal by default.
|
|
112
119
|
|
|
113
|
-
|
|
120
|
+
For an older version, add a `Shift+Enter` terminal binding to `keybindings.json`:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"key": "shift+enter",
|
|
125
|
+
"command": "workbench.action.terminal.sendSequence",
|
|
126
|
+
"args": { "text": "\u001b[13;2u" },
|
|
127
|
+
"when": "terminalFocus"
|
|
128
|
+
}
|
|
129
|
+
```
|
|
114
130
|
|
|
115
|
-
|
|
131
|
+
The user `keybindings.json` file is normally located at:
|
|
116
132
|
|
|
117
|
-
`keybindings.json` locations:
|
|
118
133
|
- macOS: `~/Library/Application Support/Code/User/keybindings.json`
|
|
119
134
|
- Linux: `~/.config/Code/User/keybindings.json`
|
|
120
135
|
- Windows: `%APPDATA%\\Code\\User\\keybindings.json`
|
|
121
136
|
|
|
122
|
-
|
|
137
|
+
## Zed integrated terminal
|
|
138
|
+
|
|
139
|
+
Add these bindings to Zed's `keymap.json`:
|
|
123
140
|
|
|
124
141
|
```json
|
|
125
142
|
{
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
|
|
129
|
-
|
|
143
|
+
"context": "Terminal",
|
|
144
|
+
"bindings": {
|
|
145
|
+
"shift-enter": ["terminal::SendText", "\u001b[13;2u"],
|
|
146
|
+
"ctrl--": ["terminal::SendText", "\u001b[45;5u"],
|
|
147
|
+
"ctrl-alt-]": ["terminal::SendText", "\u001b[93;7u"]
|
|
148
|
+
}
|
|
130
149
|
}
|
|
131
150
|
```
|
|
132
151
|
|
|
@@ -140,16 +159,12 @@ Apex Code uses Windows-style keybindings when running natively on Windows or in
|
|
|
140
159
|
- `Ctrl+Z` undoes editing on native Windows; WSL uses `Alt+Z` so `Ctrl+Z` can suspend Apex Code.
|
|
141
160
|
- `Ctrl+Q` queues a follow-up message and `Alt+Q` restores queued messages.
|
|
142
161
|
|
|
143
|
-
|
|
162
|
+
Open Windows Terminal's `settings.json` with `Ctrl+Shift+,` or **Settings > Open JSON file**. Add this object to its `actions` array:
|
|
144
163
|
|
|
145
164
|
```json
|
|
146
165
|
{
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
"command": { "action": "sendInput", "input": "\u001b[13;2u" },
|
|
150
|
-
"keys": "shift+enter"
|
|
151
|
-
}
|
|
152
|
-
]
|
|
166
|
+
"command": { "action": "sendInput", "input": "\u001b[13;2u" },
|
|
167
|
+
"keys": "shift+enter"
|
|
153
168
|
}
|
|
154
169
|
```
|
|
155
170
|
|
|
@@ -157,23 +172,39 @@ Add to `settings.json` (Ctrl+Shift+, or Settings → Open JSON file) to forward
|
|
|
157
172
|
- Windows Terminal binds `Alt+Enter` to fullscreen by default. That prevents Apex Code from receiving `Alt+Enter` for follow-up queueing.
|
|
158
173
|
- Remapping `Alt+Enter` to `sendInput` forwards the real key chord to Apex Code instead, or configure Windows Terminal to send the key and bind `app.message.followUp` to `alt+enter` in Apex Code to use it instead of the `Ctrl+Q` default.
|
|
159
174
|
|
|
160
|
-
|
|
175
|
+
### Use Alt+Enter for follow-ups
|
|
161
176
|
|
|
162
|
-
|
|
177
|
+
Windows Terminal binds `Alt+Enter` to fullscreen by default. Pi therefore uses `Ctrl+Q` for follow-ups on Windows and WSL.
|
|
163
178
|
|
|
164
|
-
|
|
179
|
+
To use `Alt+Enter` instead, configure Windows Terminal to forward the key and bind `app.message.followUp` to `alt+enter` in Pi's `keybindings.json`. See [Keybindings](keybindings.md#assign-keybindings).
|
|
165
180
|
|
|
166
|
-
|
|
167
|
-
- [Kitty](https://sw.kovidgoyal.net/kitty/)
|
|
168
|
-
- [Ghostty](https://ghostty.org/)
|
|
169
|
-
- [WezTerm](https://wezfurlong.org/wezterm/)
|
|
170
|
-
- [iTerm2](https://iterm2.com/)
|
|
171
|
-
- [Alacritty](https://github.com/alacritty/alacritty) (requires compilation with Kitty protocol support)
|
|
181
|
+
## xfce4-terminal and Terminator
|
|
172
182
|
|
|
173
|
-
|
|
183
|
+
These terminals cannot reliably distinguish modified Enter keys from plain `Enter`. Custom bindings such as `Ctrl+Enter` or `Shift+Enter` therefore may not work.
|
|
174
184
|
|
|
175
|
-
|
|
185
|
+
Use a terminal with modern extended-key support when you need those shortcuts, such as Kitty, Ghostty, WezTerm, iTerm2, Windows Terminal, or a compatible Alacritty build.
|
|
176
186
|
|
|
177
187
|
If you want the hardware cursor visible, set `APEX_CODE_HARDWARE_CURSOR=1` before running Apex Code (disabled by default for compatibility; the temporary `PI_HARDWARE_CURSOR` alias also works).
|
|
178
188
|
|
|
179
|
-
|
|
189
|
+
IntelliJ IDEA's built-in terminal cannot reliably distinguish `Shift+Enter` from plain `Enter`. Use `Ctrl+J` for a newline or run Pi in a terminal with modern extended-key support.
|
|
190
|
+
|
|
191
|
+
If an IME candidate window does not follow the text cursor, show the hardware cursor:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
export PI_HARDWARE_CURSOR=1
|
|
195
|
+
pi
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Override detected capabilities
|
|
199
|
+
|
|
200
|
+
Pi automatically detects OSC 8 hyperlinks, inline image protocols, and truecolor support. A terminal proxy or multiplexer can make that detection inaccurate.
|
|
201
|
+
|
|
202
|
+
| Capability | Environment variable | Setting |
|
|
203
|
+
|---|---|---|
|
|
204
|
+
| Hyperlinks | `PI_HYPERLINKS=1\|0\|auto` | `terminal.hyperlinks: true\|false\|"auto"` |
|
|
205
|
+
| Inline images | `PI_IMAGE_PROTOCOL=kitty\|iterm2\|none\|auto` | `terminal.images: "kitty"\|"iterm2"\|false\|"auto"` |
|
|
206
|
+
| Truecolor | `PI_TRUE_COLOR=1\|0\|auto` | `terminal.trueColor: true\|false\|"auto"` |
|
|
207
|
+
|
|
208
|
+
Settings take precedence over environment variables. An unset value or `auto` preserves automatic detection.
|
|
209
|
+
|
|
210
|
+
Only force a capability supported by the complete terminal path. Unsupported escape sequences can corrupt rendering. See [Environment Variables](environment-variables.md#pi-process-configuration) and [Settings](settings.md) for the canonical value definitions.
|
package/docs/termux.md
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Run Pi on Android with Termux
|
|
2
2
|
|
|
3
3
|
Apex Code runs on Android via [Termux](https://termux.dev/), a terminal emulator and Linux environment for Android.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Before you begin
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
2. Install [Termux:API](https://github.com/termux/termux-api#installation) from GitHub or F-Droid for clipboard and other device integrations
|
|
7
|
+
Install Termux from [GitHub or F-Droid](https://github.com/termux/termux-app#installation). Do not use the deprecated Google Play build.
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
[Termux:API](https://github.com/termux/termux-api#installation) is optional. Install it only when you want Pi to copy or paste Android clipboard text, or when shell commands need Android device APIs.
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
# Update packages
|
|
14
|
-
pkg update && pkg upgrade
|
|
11
|
+
## Install Pi
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
pkg install nodejs termux-api git
|
|
13
|
+
1. Update Termux packages:
|
|
18
14
|
|
|
19
15
|
# Install Apex Code
|
|
20
16
|
npm install -g --ignore-scripts apex-code
|
|
@@ -26,102 +22,96 @@ mkdir -p ~/.apex-code/agent
|
|
|
26
22
|
apex-code
|
|
27
23
|
```
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
3. Install Pi:
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
|
|
29
|
+
```
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
4. Verify the installation:
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
```bash
|
|
34
|
+
apex-code --version
|
|
35
|
+
```
|
|
36
36
|
|
|
37
37
|
Create `~/.apex-code/agent/AGENTS.md` to help the agent understand the Termux environment:
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
```bash
|
|
40
|
+
cd /path/to/working-folder
|
|
41
|
+
pi
|
|
42
|
+
```
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
- **OS**: Android (Termux terminal emulator)
|
|
44
|
-
- **Home**: `/data/data/com.termux/files/home`
|
|
45
|
-
- **Prefix**: `/data/data/com.termux/files/usr`
|
|
46
|
-
- **Shared storage**: `/storage/emulated/0` (Downloads, Documents, etc.)
|
|
44
|
+
Continue with the main [Quickstart](quickstart.md#3-choose-a-model) to connect a model and run your first task.
|
|
47
45
|
|
|
48
|
-
##
|
|
49
|
-
```bash
|
|
50
|
-
termux-open-url "https://example.com"
|
|
51
|
-
```
|
|
46
|
+
## Access Android shared storage
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
termux-open file.pdf # Opens with default app
|
|
56
|
-
termux-open --chooser image.jpg # Choose app
|
|
57
|
-
```
|
|
48
|
+
Termux cannot access shared Android storage until you grant permission. Run this once:
|
|
58
49
|
|
|
59
|
-
## Clipboard
|
|
60
50
|
```bash
|
|
61
|
-
termux-
|
|
62
|
-
termux-clipboard-get # Paste
|
|
51
|
+
termux-setup-storage
|
|
63
52
|
```
|
|
64
53
|
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
termux-notification -t "Title" -c "Content"
|
|
68
|
-
```
|
|
54
|
+
After approval, Android shared storage is available under `/storage/emulated/0` and through the links Termux creates under `~/storage/`.
|
|
69
55
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
termux-
|
|
75
|
-
```
|
|
56
|
+
Only grant this permission when Pi should be able to access those files. Commands and tools running in Termux use the same storage permissions as the Termux process.
|
|
57
|
+
|
|
58
|
+
## Use clipboard commands
|
|
59
|
+
|
|
60
|
+
Pi uses `termux-clipboard-set` to copy text and `termux-clipboard-get` for its clipboard-paste shortcut. Shell commands can use both commands directly. Install the Termux:API app and its command-line package:
|
|
76
61
|
|
|
77
|
-
## Sharing
|
|
78
62
|
```bash
|
|
79
|
-
termux-
|
|
63
|
+
pkg install termux-api
|
|
80
64
|
```
|
|
81
65
|
|
|
82
|
-
|
|
66
|
+
Verify the integration:
|
|
67
|
+
|
|
83
68
|
```bash
|
|
84
|
-
|
|
85
|
-
termux-
|
|
86
|
-
termux-tts-speak "hello" # Text to speech
|
|
87
|
-
termux-camera-photo out.jpg # Take photo
|
|
69
|
+
printf 'Pi clipboard test' | termux-clipboard-set
|
|
70
|
+
termux-clipboard-get
|
|
88
71
|
```
|
|
89
72
|
|
|
90
|
-
|
|
91
|
-
- Termux:API app must be installed for `termux-*` commands
|
|
92
|
-
- Use `pkg install termux-api` for the command-line tools
|
|
93
|
-
- Storage permission needed for `/storage/emulated/0` access
|
|
94
|
-
````
|
|
73
|
+
The second command should print `Pi clipboard test`.
|
|
95
74
|
|
|
96
|
-
|
|
75
|
+
The Termux clipboard API supports text only. Pi's clipboard-paste shortcut inserts that text into the editor but cannot attach clipboard images.
|
|
97
76
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
77
|
+
## Add Termux-specific instructions
|
|
78
|
+
|
|
79
|
+
Apex Code detects that it is running in Termux, but it cannot infer how you want it to interact with Android. Add only the environment details relevant to your work to `~/.apex-code/agent/AGENTS.md`:
|
|
80
|
+
|
|
81
|
+
````markdown
|
|
82
|
+
# Termux environment
|
|
83
|
+
|
|
84
|
+
- Pi runs in Termux on Android.
|
|
85
|
+
- Shared Android storage is under `/storage/emulated/0`.
|
|
86
|
+
- Open URLs with `termux-open-url "https://example.com"`.
|
|
87
|
+
- Open files with `termux-open <path>`.
|
|
88
|
+
- Do not access shared storage unless the task requires it.
|
|
89
|
+
````
|
|
90
|
+
|
|
91
|
+
Run `/reload` after changing the file during an active session.
|
|
101
92
|
|
|
102
93
|
## Troubleshooting
|
|
103
94
|
|
|
104
|
-
### Clipboard
|
|
95
|
+
### Clipboard integration fails
|
|
105
96
|
|
|
106
|
-
|
|
107
|
-
1. Termux (from GitHub or F-Droid)
|
|
108
|
-
2. Termux:API (from GitHub or F-Droid)
|
|
97
|
+
Confirm that you installed both components:
|
|
109
98
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
pkg install termux-api
|
|
113
|
-
```
|
|
99
|
+
1. The Termux:API Android app from the same source as Termux
|
|
100
|
+
2. The `termux-api` command-line package
|
|
114
101
|
|
|
115
|
-
|
|
102
|
+
Then run the clipboard verification commands above outside Pi. If they fail there, fix the Termux:API installation before retrying Pi's copy command.
|
|
116
103
|
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
termux-setup-storage
|
|
120
|
-
```
|
|
104
|
+
### Shared storage reports permission denied
|
|
121
105
|
|
|
122
|
-
|
|
106
|
+
Run `termux-setup-storage`, approve the Android permission request, and retry the path under `~/storage/` or `/storage/emulated/0`.
|
|
107
|
+
|
|
108
|
+
### Pi is not found after installation
|
|
109
|
+
|
|
110
|
+
Open a new Termux shell and run:
|
|
123
111
|
|
|
124
|
-
If npm fails, try clearing the cache:
|
|
125
112
|
```bash
|
|
126
|
-
npm
|
|
113
|
+
npm prefix -g
|
|
114
|
+
command -v pi
|
|
127
115
|
```
|
|
116
|
+
|
|
117
|
+
Confirm that the global npm binary directory is on `PATH`, then reinstall Pi if the package is missing.
|
package/docs/themes.md
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
> Apex Code can create themes. Ask it to build one for your setup.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Themes control the colors Pi uses in interactive mode and HTML exports. Pi includes `dark` and `light` themes. You can select one theme, follow your terminal's light or dark appearance, or create your own palette.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<a id="selecting-a-theme"></a>
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Choose a theme
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- [Selecting a Theme](#selecting-a-theme)
|
|
11
|
-
- [Creating a Custom Theme](#creating-a-custom-theme)
|
|
12
|
-
- [Theme Format](#theme-format)
|
|
13
|
-
- [Color Tokens](#color-tokens)
|
|
14
|
-
- [Color Values](#color-values)
|
|
15
|
-
- [Tips](#tips)
|
|
9
|
+
Open `/settings` and select **Theme**. You can use one theme for every terminal appearance or choose separate themes for light and dark terminals.
|
|
16
10
|
|
|
17
11
|
## Locations
|
|
18
12
|
|
|
@@ -33,39 +27,39 @@ Select a theme via `/settings` or in `settings.json`:
|
|
|
33
27
|
|
|
34
28
|
```json
|
|
35
29
|
{
|
|
36
|
-
"theme": "
|
|
30
|
+
"theme": "dark"
|
|
37
31
|
}
|
|
38
32
|
```
|
|
39
33
|
|
|
40
34
|
On first run, Apex Code detects your terminal background and defaults to `dark` or `light`.
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
pi --use-theme light
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"theme": "light/dark"
|
|
39
|
+
}
|
|
48
40
|
```
|
|
49
41
|
|
|
50
|
-
|
|
42
|
+
When automatic mode is active, Pi changes themes when the terminal reports an appearance change. Theme names cannot contain `/` because Pi reserves it for this setting format.
|
|
43
|
+
|
|
44
|
+
Use `--use-theme` to choose the initial theme for one invocation without changing the saved setting:
|
|
51
45
|
|
|
52
46
|
```bash
|
|
53
|
-
|
|
47
|
+
apex-code --use-theme light
|
|
48
|
+
apex-code --use-theme light/dark
|
|
54
49
|
```
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
and saves it normally.
|
|
51
|
+
See [CLI resources](cli.md#resources) for the command-line option.
|
|
58
52
|
|
|
59
|
-
##
|
|
53
|
+
## Create a custom theme
|
|
60
54
|
|
|
61
|
-
|
|
55
|
+
Copy one of the [built-in themes](https://github.com/earendil-works/pi/tree/main/packages/coding-agent/src/modes/interactive/theme) or create a new JSON file conforming to the [schema](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json).
|
|
62
56
|
|
|
63
57
|
```bash
|
|
64
58
|
mkdir -p ~/.apex-code/agent/themes
|
|
65
59
|
vim ~/.apex-code/agent/themes/my-theme.json
|
|
66
60
|
```
|
|
67
61
|
|
|
68
|
-
|
|
62
|
+
Use the theme name as the filename. Pi hot-reloads the active user theme only from `<agent-dir>/themes/<name>.json`. Run `/reload` after adding or changing a theme from any other source.
|
|
69
63
|
|
|
70
64
|
```json
|
|
71
65
|
{
|
|
@@ -88,7 +82,8 @@ vim ~/.apex-code/agent/themes/my-theme.json
|
|
|
88
82
|
"text": "",
|
|
89
83
|
"thinkingText": "secondary",
|
|
90
84
|
"selectedBg": "#2d2d30",
|
|
91
|
-
"
|
|
85
|
+
"scrollbarTrack": "secondary",
|
|
86
|
+
"scrollbarThumb": "",
|
|
92
87
|
"searchMatchBg": "#2d2d30",
|
|
93
88
|
"searchMatchText": "",
|
|
94
89
|
"userMessageBg": "#2d2d30",
|
|
@@ -135,11 +130,22 @@ vim ~/.apex-code/agent/themes/my-theme.json
|
|
|
135
130
|
}
|
|
136
131
|
```
|
|
137
132
|
|
|
138
|
-
|
|
133
|
+
| Property | Required | Responsibility |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| `$schema` | No | Enables editor validation and completion against Pi's published schema. |
|
|
136
|
+
| `name` | Yes | Identifies the theme in selectors and settings. It must be unique and cannot contain `/`. |
|
|
137
|
+
| `vars` | No | Defines reusable color values. Variables can reference other variables. |
|
|
138
|
+
| `colors` | Yes | Assigns colors to terminal UI roles. The schema identifies required and optional roles. |
|
|
139
|
+
| `export` | No | Overrides page and panel backgrounds in HTML exports. |
|
|
139
140
|
|
|
140
141
|
**Hot reload:** When you edit the currently active custom theme file, Apex Code reloads it automatically for immediate visual feedback.
|
|
141
142
|
|
|
142
|
-
|
|
143
|
+
| Form | Example | Meaning |
|
|
144
|
+
|---|---|---|
|
|
145
|
+
| RGB hexadecimal | `"#00aaff"` | A six-digit RGB color. |
|
|
146
|
+
| 256-color index | `39` | An ANSI palette index from `0` through `255`. |
|
|
147
|
+
| Variable reference | `"primary"` | The value of an entry in `vars`. |
|
|
148
|
+
| Terminal default | `""` | The terminal's default foreground or background color. |
|
|
143
149
|
|
|
144
150
|
```json
|
|
145
151
|
{
|
|
@@ -158,73 +164,45 @@ vim ~/.apex-code/agent/themes/my-theme.json
|
|
|
158
164
|
}
|
|
159
165
|
```
|
|
160
166
|
|
|
161
|
-
-
|
|
162
|
-
- `vars` is optional. Define reusable colors here, then reference them in `colors`.
|
|
163
|
-
- `colors` must define all 51 required tokens. `thinkingMax`, `scrollbarThumb`, and the two search highlight tokens are optional and use the fallbacks listed below.
|
|
167
|
+
Use the [theme JSON schema](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json) for the exact properties, required colors, and accepted value types.
|
|
164
168
|
|
|
165
|
-
|
|
169
|
+
Pi reports invalid theme files during startup and `/reload`.
|
|
166
170
|
|
|
167
|
-
##
|
|
171
|
+
## Find the color to change
|
|
168
172
|
|
|
169
|
-
|
|
173
|
+
Theme colors describe interface roles rather than individual components. Use these groups to find the relevant part of the schema:
|
|
170
174
|
|
|
171
|
-
|
|
175
|
+
| Area | Color names |
|
|
176
|
+
|---|---|
|
|
177
|
+
| General interface | `accent`, `border*`, `text`, `muted`, `dim`, `success`, `error`, `warning` |
|
|
178
|
+
| Selection and fullscreen | `selectedBg`, `searchMatch*`, `scrollbar*` |
|
|
179
|
+
| Messages | `userMessage*`, `customMessage*`, `thinkingText` |
|
|
180
|
+
| Tool execution | `toolPendingBg`, `toolSuccessBg`, `toolErrorBg`, `toolTitle`, `toolOutput` |
|
|
181
|
+
| Markdown | `md*` |
|
|
182
|
+
| Tool diffs | `toolDiff*` |
|
|
183
|
+
| Syntax highlighting | `syntax*` |
|
|
184
|
+
| Editor modes | `thinking*`, `bashMode` |
|
|
185
|
+
| HTML export | `export.pageBg`, `export.cardBg`, `export.infoBg` |
|
|
172
186
|
|
|
173
|
-
|
|
174
|
-
|-------|---------|
|
|
175
|
-
| `accent` | Primary accent (logo, selected items, cursor) |
|
|
176
|
-
| `border` | Normal borders |
|
|
177
|
-
| `borderAccent` | Highlighted borders |
|
|
178
|
-
| `borderMuted` | Subtle borders (editor) |
|
|
179
|
-
| `success` | Success states |
|
|
180
|
-
| `error` | Error states |
|
|
181
|
-
| `warning` | Warning states |
|
|
182
|
-
| `muted` | Secondary text |
|
|
183
|
-
| `dim` | Tertiary text |
|
|
184
|
-
| `text` | Default text (usually `""`) |
|
|
185
|
-
| `thinkingText` | Thinking block text |
|
|
186
|
-
|
|
187
|
-
### Backgrounds & Content (11 required, 3 optional)
|
|
187
|
+
The schema is the format reference. The built-in themes provide complete values that you can copy and adjust.
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
|-------|---------|
|
|
191
|
-
| `selectedBg` | Selected line background |
|
|
192
|
-
| `scrollbarThumb` | Fullscreen scrollbar thumb background; optional, falls back to `selectedBg` |
|
|
193
|
-
| `searchMatchBg` | Transcript search match background and current-match text; optional, falls back to `selectedBg` |
|
|
194
|
-
| `searchMatchText` | Transcript search match text and current-match background; optional, falls back to `text` |
|
|
195
|
-
| `userMessageBg` | User message background |
|
|
196
|
-
| `userMessageText` | User message text |
|
|
197
|
-
| `customMessageBg` | Extension message background |
|
|
198
|
-
| `customMessageText` | Extension message text |
|
|
199
|
-
| `customMessageLabel` | Extension message label |
|
|
200
|
-
| `toolPendingBg` | Tool box (pending) |
|
|
201
|
-
| `toolSuccessBg` | Tool box (success) |
|
|
202
|
-
| `toolErrorBg` | Tool box (error) |
|
|
203
|
-
| `toolTitle` | Tool title |
|
|
204
|
-
| `toolOutput` | Tool output text |
|
|
205
|
-
|
|
206
|
-
### Markdown (10 colors)
|
|
189
|
+
Five colors are optional and inherit another color when omitted:
|
|
207
190
|
|
|
208
|
-
|
|
|
209
|
-
|
|
210
|
-
| `
|
|
211
|
-
| `
|
|
212
|
-
| `
|
|
213
|
-
| `
|
|
214
|
-
| `
|
|
215
|
-
| `mdCodeBlockBorder` | Code block fences |
|
|
216
|
-
| `mdQuote` | Blockquote text |
|
|
217
|
-
| `mdQuoteBorder` | Blockquote border |
|
|
218
|
-
| `mdHr` | Horizontal rule |
|
|
219
|
-
| `mdListBullet` | List bullets |
|
|
220
|
-
|
|
221
|
-
### Tool Diffs (3 colors)
|
|
191
|
+
| Optional color | Fallback |
|
|
192
|
+
|---|---|
|
|
193
|
+
| `scrollbarTrack` | `muted` |
|
|
194
|
+
| `scrollbarThumb` | `text` |
|
|
195
|
+
| `searchMatchBg` | `selectedBg` |
|
|
196
|
+
| `searchMatchText` | `text` |
|
|
197
|
+
| `thinkingMax` | `thinkingXhigh` |
|
|
222
198
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
199
|
+
If `export` colors are omitted, Pi derives HTML page and panel backgrounds from `userMessageBg`.
|
|
200
|
+
|
|
201
|
+
## Load a theme from a project or package
|
|
202
|
+
|
|
203
|
+
Place a project theme in `.apex-code/themes/`. Project themes load only after [project trust](security.md#understand-project-trust) is granted.
|
|
204
|
+
|
|
205
|
+
You can also load theme files and directories through the `themes` setting or distribute them in a Pi package. See [Configuration](configuration.md), [Settings](settings.md#resources), and [Pi Packages](packages.md).
|
|
228
206
|
|
|
229
207
|
### Syntax Highlighting (9 colors)
|
|
230
208
|
|