apex-code 0.4.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 +280 -6
- 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 +56 -8
- 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 +9 -15
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +20 -137
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +2 -2
- package/dist/core/tools/delegate.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 -122
- 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 -147
- 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/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +3 -2
- package/dist/extensions/llama/ui.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 -27
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/autocomplete-source.d.ts +8 -0
- package/dist/modes/interactive/components/autocomplete-source.d.ts.map +1 -0
- package/dist/modes/interactive/components/autocomplete-source.js +23 -0
- package/dist/modes/interactive/components/autocomplete-source.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +6 -4
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/dist/modes/interactive/components/bordered-loader.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/composer-dock.d.ts +12 -0
- package/dist/modes/interactive/components/composer-dock.d.ts.map +1 -0
- package/dist/modes/interactive/components/composer-dock.js +24 -0
- package/dist/modes/interactive/components/composer-dock.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +11 -9
- package/dist/modes/interactive/components/config-selector.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 +15 -10
- 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 +15 -5
- 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 +15 -10
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +6 -6
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +12 -4
- 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/keybinding-hints.d.ts +21 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +34 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +27 -23
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +16 -20
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +7 -6
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/permission-preview.d.ts.map +1 -1
- package/dist/modes/interactive/components/permission-preview.js +3 -3
- package/dist/modes/interactive/components/permission-preview.js.map +1 -1
- package/dist/modes/interactive/components/prompt-input.d.ts +12 -0
- package/dist/modes/interactive/components/prompt-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/prompt-input.js +18 -0
- package/dist/modes/interactive/components/prompt-input.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +17 -18
- 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 +100 -67
- 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 +74 -16
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +8 -6
- package/dist/modes/interactive/components/settings-submenu.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 +14 -9
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +28 -16
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +73 -80
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-panel.js +7 -2
- package/dist/modes/interactive/components/tool-panel.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +18 -5
- 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 +12 -12
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +2 -2
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +6 -3
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +50 -31
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +494 -229
- 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/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +49 -23
- package/dist/modes/print-mode.js.map +1 -1
- 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 +43 -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 +95 -88
- 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/modes/interactive/components/message-spine.d.ts +0 -14
- package/dist/modes/interactive/components/message-spine.d.ts.map +0 -1
- package/dist/modes/interactive/components/message-spine.js +0 -19
- package/dist/modes/interactive/components/message-spine.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/models.md
CHANGED
|
@@ -1,22 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Choose a Model
|
|
2
2
|
|
|
3
3
|
Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.apex-code/agent/models.json`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Choose a connection
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- [Anthropic Messages Compatibility](#anthropic-messages-compatibility)
|
|
15
|
-
- [OpenAI Compatibility](#openai-compatibility)
|
|
7
|
+
| What you have | Recommended setup |
|
|
8
|
+
|---|---|
|
|
9
|
+
| A supported subscription | Sign in through `/login` |
|
|
10
|
+
| A provider API key | Store it through `/login` or set its environment variable |
|
|
11
|
+
| A local GGUF model | Connect Apex Code to the llama.cpp router |
|
|
12
|
+
| An OpenAI-, Anthropic-, or Google-compatible endpoint | Add it to `models.json` |
|
|
13
|
+
| A provider with a custom protocol or authentication flow | Build or install a provider extension |
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
The bundled model catalog works offline. To overlay catalog data from a service you operate, set `APEX_CODE_MODEL_CATALOG_URL`; Apex Code does not contact an upstream hosted catalog by default. Run `apex-code update --models` to refresh configured catalog data.
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
## Authenticate
|
|
18
|
+
|
|
19
|
+
Run `/login` and select a provider. Apex Code stores credentials in [`auth.json`](configuration.md#agent-directory). Run `/logout` to remove stored credentials for a provider.
|
|
20
|
+
|
|
21
|
+
You can instead provide an API key through the provider's environment variable. This is useful in CI and other environments where Apex Code should not write credentials. [Provider Authentication](providers.md) lists the variables and cloud-provider setup.
|
|
22
|
+
|
|
23
|
+
When several credential sources are configured, Apex Code uses a runtime `--api-key` first, then a stored `auth.json` credential, an `apiKey` from `models.json`, and finally the provider's environment variables or ambient cloud credentials. Provider extensions can define their own authentication behavior.
|
|
24
|
+
|
|
25
|
+
Keep `auth.json` and any credential commands private. Project settings and extensions can execute inside the Apex Code process after you trust a project. Review [Security](security.md) before loading configuration from an untrusted directory.
|
|
26
|
+
|
|
27
|
+
## Select a model
|
|
28
|
+
|
|
29
|
+
Run `/model` to search available models. The picker shows models whose providers have usable authentication. Press `Ctrl+S` on a model to save it as the default for new sessions.
|
|
30
|
+
|
|
31
|
+
Run `/thinking` to select the thinking level for the current model. Press `Ctrl+S` there to save the startup level. Apex Code limits the choices to levels supported by the selected model.
|
|
32
|
+
|
|
33
|
+
`Ctrl+P` cycles through available models. Use `/scoped-models` to control that cycle and save the selection, or configure model patterns through [Settings](settings.md#model-cycling).
|
|
34
|
+
|
|
35
|
+
A session records model and thinking-level changes. Resuming the session restores them without changing defaults for new sessions.
|
|
36
|
+
|
|
37
|
+
## Connect local models
|
|
38
|
+
|
|
39
|
+
Apex Code integrates directly with the llama.cpp router. The router discovers GGUF files and loads models on demand. Apex Code's `/llama` command manages the router, while `/model` selects one of its loaded models.
|
|
40
|
+
|
|
41
|
+
Follow [Local Models with llama.cpp](llama-cpp.md) for server startup, model layout, downloads, and connection troubleshooting.
|
|
42
|
+
|
|
43
|
+
For Ollama, LM Studio, vLLM, SGLang, and other compatible servers, [configure a compatible endpoint](#configure-a-compatible-endpoint) in `models.json`.
|
|
44
|
+
|
|
45
|
+
## Configure a compatible endpoint
|
|
46
|
+
|
|
47
|
+
Use [`models.json`](configuration.md#agent-directory) when an endpoint speaks an API Apex Code already supports. This includes most Ollama, LM Studio, vLLM, SGLang, and proxy deployments.
|
|
20
48
|
|
|
21
49
|
```json
|
|
22
50
|
{
|
|
@@ -26,7 +54,6 @@ For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
|
|
|
26
54
|
"api": "openai-completions",
|
|
27
55
|
"apiKey": "ollama",
|
|
28
56
|
"models": [
|
|
29
|
-
{ "id": "llama3.1:8b" },
|
|
30
57
|
{ "id": "qwen2.5-coder:7b" }
|
|
31
58
|
]
|
|
32
59
|
}
|
|
@@ -38,7 +65,7 @@ The `apiKey` value is a placeholder because Ollama ignores it. Apex Code still t
|
|
|
38
65
|
|
|
39
66
|
Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so Apex Code sends the system prompt as a `system` message instead. If the server also does not support `reasoning_effort`, set `compat.supportsReasoningEffort` to `false` too.
|
|
40
67
|
|
|
41
|
-
|
|
68
|
+
### Describe model input and caching
|
|
42
69
|
|
|
43
70
|
```json
|
|
44
71
|
{
|
|
@@ -204,10 +231,12 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
|
|
|
204
231
|
| `reasoning` | No | `false` | Supports extended thinking |
|
|
205
232
|
| `thinkingLevelMap` | No | omitted | Maps Apex Code thinking levels to provider values and marks unsupported levels (see below) |
|
|
206
233
|
| `input` | No | `["text"]` | Input types: `["text"]` or `["text", "image"]` |
|
|
234
|
+
| `inputLimits` | No | omitted | Request limits and image preprocessing for this model (see below) |
|
|
207
235
|
| `contextWindow` | No | `128000` | Context window size in tokens |
|
|
208
236
|
| `maxTokens` | No | `16384` | Maximum output tokens |
|
|
209
237
|
| `samplingParams` | No | omitted | Sampling parameters merged verbatim into every request body (see below) |
|
|
210
238
|
| `cost` | No | all zeros | Per-million-token rates with optional request-wide input pricing tiers |
|
|
239
|
+
| `promptCache` | No | omitted | Best-effort prompt cache lifetime in seconds per retention tier (see below) |
|
|
211
240
|
| `compat` | No | provider `compat` | Provider compatibility overrides. Merged with provider-level `compat` when both are set. |
|
|
212
241
|
|
|
213
242
|
A cost tier supplies a complete alternate rate set and applies to the full request when total input usage (`input + cacheRead + cacheWrite`) exceeds `inputTokensAbove`. When multiple tiers match, the highest threshold wins.
|
|
@@ -236,54 +265,60 @@ Current behavior:
|
|
|
236
265
|
- `/model`, `--list-models`, and the interactive footer display entries by model `id`.
|
|
237
266
|
- The configured `name` is used for model matching and secondary model detail text. It does not replace the footer/status-bar model id.
|
|
238
267
|
|
|
239
|
-
###
|
|
268
|
+
### Image Input Limits
|
|
240
269
|
|
|
241
|
-
`
|
|
270
|
+
Use `inputLimits.images.resize` to configure how new images are encoded before they enter conversation history:
|
|
242
271
|
|
|
243
272
|
```json
|
|
244
273
|
{
|
|
245
|
-
"id": "
|
|
246
|
-
"
|
|
247
|
-
|
|
248
|
-
"
|
|
249
|
-
|
|
250
|
-
|
|
274
|
+
"id": "vision-model",
|
|
275
|
+
"input": ["text", "image"],
|
|
276
|
+
"inputLimits": {
|
|
277
|
+
"images": {
|
|
278
|
+
"resize": {
|
|
279
|
+
"maxWidth": 1568,
|
|
280
|
+
"maxHeight": 1568,
|
|
281
|
+
"maxBytes": 524288,
|
|
282
|
+
"jpegQuality": 75
|
|
283
|
+
}
|
|
284
|
+
}
|
|
251
285
|
}
|
|
252
286
|
}
|
|
253
287
|
```
|
|
254
288
|
|
|
289
|
+
`maxBytes` limits the base64-encoded payload. Omitted resize fields use conservative defaults of 2000 by 2000 pixels, 4.5 MiB encoded, and JPEG quality 80. Images are encoded once; changing models does not rewrite historical images. The catalog can also describe hard request limits with `inputLimits.maxRequestBytes`, `images.maxPerMessage`, and `images.maxPerRequest`, but Apex Code does not yet rewrite or reject history based on them.
|
|
290
|
+
|
|
291
|
+
<a id="prompt-cache-lifetimes"></a>
|
|
292
|
+
|
|
293
|
+
Use `promptCache` to declare the provider's best-effort cache lifetime in seconds for the `short` or `long` retention tier:
|
|
294
|
+
|
|
295
|
+
```json
|
|
296
|
+
{ "id": "claude-sonnet-5", "promptCache": { "short": 300, "long": 3600 } }
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Choose the conservative end of any published range. A model without a lifetime for the active tier is not eligible for cache warming. A `modelOverrides` entry can set `inputLimits` or `promptCache` for a built-in or extension model, including a model accessed through a validated proxy. See [`cacheWarming`](settings.md#model-and-thinking).
|
|
300
|
+
|
|
301
|
+
Compatibility settings should describe verified differences in the endpoint's request or response behavior. Do not enable them based only on an endpoint advertising OpenAI or Anthropic compatibility.
|
|
302
|
+
|
|
303
|
+
`samplingParams` is a free-form object merged verbatim into every request body for the model, after the fields Apex Code sets itself, so its keys win. Use it to send sampling parameters Apex Code does not model — including server-specific ones like llama.cpp's `min_p` or vLLM's `top_k`:
|
|
304
|
+
|
|
305
|
+
Use an extension when the provider needs custom streaming, model discovery, or authentication behavior. See [Custom Providers](custom-provider.md) for the extension workflow.
|
|
306
|
+
|
|
255
307
|
Only OpenAI-compatible APIs apply it (`openai-completions`, `openai-responses`, `azure-openai-responses`); other APIs ignore it. Keys override Apex Code's named request fields (for example a `temperature` key here beats the request-level temperature), so prefer it as the single source of sampling truth for a model. In `modelOverrides`, `samplingParams` merges per key with the base model's value.
|
|
256
308
|
|
|
257
|
-
A
|
|
309
|
+
### A model does not appear
|
|
258
310
|
|
|
259
|
-
|
|
311
|
+
Confirm that its provider has usable authentication. Custom models can load from `models.json` but remain unavailable in `/model` until Apex Code can resolve credentials. For llama.cpp, only models currently loaded by the router appear.
|
|
260
312
|
|
|
261
313
|
Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are Apex Code thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. Maps may contain holes; for example, a model can expose `high` and `max` without exposing `xhigh`.
|
|
262
314
|
|
|
263
|
-
|
|
315
|
+
Check whether the key came from an environment variable rather than `auth.json`. Environment variables must be present in the process that starts Apex Code.
|
|
264
316
|
|
|
265
|
-
|
|
266
|
-
|-------|---------|
|
|
267
|
-
| omitted | Standard levels through `high` use the provider's default mapping; extended `xhigh` and `max` levels are unsupported |
|
|
268
|
-
| string | Level is supported and this value is sent to the provider |
|
|
269
|
-
| `null` | Level is unsupported and hidden/skipped/clamped away |
|
|
317
|
+
### Sign-in opens a browser on a remote machine
|
|
270
318
|
|
|
271
|
-
|
|
319
|
+
Complete the provider's headless authentication flow when available. Some providers let you paste the final redirect URL or authorization code back into Apex Code. See [Authenticate interactively](providers.md#authenticate-interactively).
|
|
272
320
|
|
|
273
|
-
|
|
274
|
-
{
|
|
275
|
-
"id": "deepseek-v4-pro",
|
|
276
|
-
"reasoning": true,
|
|
277
|
-
"thinkingLevelMap": {
|
|
278
|
-
"minimal": null,
|
|
279
|
-
"low": null,
|
|
280
|
-
"medium": null,
|
|
281
|
-
"high": "high",
|
|
282
|
-
"xhigh": null,
|
|
283
|
-
"max": "max"
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
```
|
|
321
|
+
### A compatible endpoint rejects requests
|
|
287
322
|
|
|
288
323
|
Example for a model where thinking cannot be disabled:
|
|
289
324
|
|
|
@@ -359,7 +394,23 @@ Use `modelOverrides` to customize built-in models and matching extension-registe
|
|
|
359
394
|
}
|
|
360
395
|
```
|
|
361
396
|
|
|
362
|
-
`modelOverrides` supports these fields per model: `name`, `reasoning`, `thinkingLevelMap`, `input`, `cost` (partial), `contextWindow`, `maxTokens`, `samplingParams` (merged per key), `headers`, `compat`.
|
|
397
|
+
`modelOverrides` supports these fields per model: `name`, `reasoning`, `thinkingLevelMap`, `input`, `inputLimits` (deep-merged), `cost` (partial), `promptCache` (merged per tier), `contextWindow`, `maxTokens`, `samplingParams` (merged per key), `headers`, `compat`.
|
|
398
|
+
|
|
399
|
+
Use a `promptCache` override to enable cache warming through a proxy whose backing cache you know, for example OpenRouter routed to Anthropic:
|
|
400
|
+
|
|
401
|
+
```json
|
|
402
|
+
{
|
|
403
|
+
"providers": {
|
|
404
|
+
"openrouter": {
|
|
405
|
+
"modelOverrides": {
|
|
406
|
+
"anthropic/claude-sonnet-4": {
|
|
407
|
+
"promptCache": { "short": 300 }
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
```
|
|
363
414
|
|
|
364
415
|
Direct OpenAI GPT-5.6 Sol, Terra, and Luna default to a `272000` context window so requests remain within OpenAI's short-context pricing tier. To opt into OpenAI's 1.05M context window, increase it for each model you use:
|
|
365
416
|
|
|
@@ -394,6 +445,8 @@ By default Apex Code sends per-tool `eager_input_streaming: true`. If a proxy or
|
|
|
394
445
|
|
|
395
446
|
Some Anthropic models require adaptive thinking (`thinking.type: "adaptive"` plus `output_config.effort`) instead of the legacy budget-based thinking payload. Built-in models set this automatically. For custom providers or aliases that route to those models, set `forceAdaptiveThinking` to `true`.
|
|
396
447
|
|
|
448
|
+
Claude models with per-turn effort support use `supportsMidConvoEffort`. Apex Code then persists each response's provider effort, reconstructs effort-only system messages on later requests, and sends thinking binding controls with `prefix_mismatch_behavior: "drop_block"` to avoid stale signed-thinking prefixes causing persistent 400 responses. Set this only for the exact supported Claude model on a faithful Anthropic Messages transport; do not enable it for APIs that merely imitate the Messages shape.
|
|
449
|
+
|
|
397
450
|
Some Anthropic-compatible providers emit thinking blocks with empty signatures and still expect them on replay. Set `allowEmptySignature` to `true` only for those providers; real Anthropic rejects empty thinking signatures.
|
|
398
451
|
|
|
399
452
|
Built-in Anthropic models enable `supportsStrictTools` in their model metadata. Custom Anthropic-compatible models must set it to `true` when their endpoint accepts strict JSON-schema tool definitions.
|
|
@@ -430,8 +483,10 @@ Built-in Anthropic models enable `supportsStrictTools` in their model metadata.
|
|
|
430
483
|
| `sendSessionAffinityHeaders` | Whether to send `x-session-affinity` from the session id when caching is enabled. Default: auto-detected for known providers. |
|
|
431
484
|
| `supportsCacheControlOnTools` | Whether the provider accepts Anthropic-style `cache_control` markers on tool definitions. Default: `true`. |
|
|
432
485
|
| `forceAdaptiveThinking` | Whether to send adaptive thinking (`thinking.type: "adaptive"` plus `output_config.effort`) for this model. Built-in adaptive models set this automatically. Default: `false`. |
|
|
486
|
+
| `supportsMidConvoEffort` | Whether the exact Claude model transport supports per-turn effort system messages and thinking binding controls. Apex Code persists native effort levels and always sends `drop_block` when enabled. Default: `false`. |
|
|
433
487
|
| `allowEmptySignature` | Whether to replay empty thinking signatures as `signature: ""` instead of converting thinking to text. Default: `false`. |
|
|
434
488
|
| `supportsStrictTools` | Whether the provider accepts strict JSON-schema tool definitions. Default: `false`; built-in Anthropic models enable it in generated metadata. |
|
|
489
|
+
| `allowedFallbackModels` | Up to three server-side fallback models, each with `provider`, `model`, and complete `cost` metadata. An empty array disables fallback. |
|
|
435
490
|
|
|
436
491
|
## OpenAI Compatibility
|
|
437
492
|
|
|
@@ -478,8 +533,7 @@ For providers with partial OpenAI compatibility, use the `compat` field.
|
|
|
478
533
|
| `sessionAffinityFormat` | For `openai-completions` and `openai-responses`, the session-affinity header format: `openai` sends `session_id`/`x-client-request-id` (completions also `x-session-affinity`), `openai-nosession` omits the underscore-containing `session_id` header, `openrouter` sends `x-session-id`. Does not affect the `prompt_cache_key` body param. Default: auto-detected. |
|
|
479
534
|
| `supportsStrictMode` | Whether the provider accepts strict JSON-schema function tool definitions. Custom `openai-responses` models default to `true` when omitted; an explicit `false` opts out. Other APIs are unchanged. |
|
|
480
535
|
| `supportsOpenAIGrammarTools` | Whether OpenAI-compatible APIs emit custom Lark/regex grammar tools. When `false`, grammar-constrained tools fall back to normal function tools. Default: `false`; the built-in model catalog enables it for GPT-5+ models on OpenAI, OpenAI Codex, Azure OpenAI, GitHub Copilot, opencode, and Cloudflare AI Gateway. |
|
|
481
|
-
| `
|
|
482
|
-
| `supportsLongCacheRetention` | Whether the provider accepts long cache retention when cache retention is `long`: `prompt_cache_retention: "24h"` for OpenAI prompt caching, or `cache_control.ttl: "1h"` when `cacheControlFormat` is `anthropic`. Default: `true`. |
|
|
536
|
+
| `supportsLongCacheRetention` | Whether the provider accepts long cache retention when cache retention is `long`: `prompt_cache_options.ttl: "30m"` for GPT-5.6+ Responses models, `prompt_cache_retention: "24h"` for earlier OpenAI models, or `cache_control.ttl: "1h"` when `cacheControlFormat` is `anthropic`. Default: `true`. |
|
|
483
537
|
| `openRouterRouting` | OpenRouter provider routing preferences. This object is sent as-is in the `provider` field of the [OpenRouter API request](https://openrouter.ai/docs/guides/routing/provider-selection). |
|
|
484
538
|
| `vercelGatewayRouting` | Vercel AI Gateway routing config for provider selection (`only`, `order`) |
|
|
485
539
|
|
package/docs/packages.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Apex Code packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `pi` key (Apex Code's retained package-manifest key), or use conventional directories.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A package is an ordinary directory or npm package. It can expose conventional resource directories, declare explicit paths under the `pi` key in `package.json`, and carry its own runtime dependencies.
|
|
8
8
|
|
|
9
9
|
- [Install and Manage](#install-and-manage)
|
|
10
10
|
- [Package Sources](#package-sources)
|
|
@@ -42,22 +42,34 @@ These commands manage Apex Code packages and `apex-code update` can update the A
|
|
|
42
42
|
|
|
43
43
|
By default, `install` and `remove` write to user settings (`~/.apex-code/agent/settings.json`). Use `-l` to write to project settings (`.apex-code/settings.json`) instead. Project settings can be shared with your team, and apex-code installs any missing packages automatically on startup after the project is trusted.
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Project packages are installed and loaded only after project trust is resolved. Packages can execute extension code and can include skills that instruct the model to run programs. Review third-party package source before installing it. Review project package declarations before granting project trust.
|
|
46
|
+
|
|
47
|
+
Use `--extension` or `-e` to try a package for one invocation without adding it to settings:
|
|
46
48
|
|
|
47
49
|
```bash
|
|
48
50
|
apex-code -e npm:@foo/bar
|
|
49
51
|
apex-code -e git:github.com/user/repo
|
|
50
52
|
```
|
|
51
53
|
|
|
52
|
-
##
|
|
54
|
+
## Choose a source
|
|
53
55
|
|
|
54
56
|
Apex Code accepts three source types in settings and `apex-code install`.
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
Versioned npm specifications are pinned. Git tags and commits are also pinned; package updates reconcile the checkout but do not move a configured ref.
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
Relative local paths resolve from the settings file that contains them. A file path loads one extension. A directory follows normal package discovery rules.
|
|
61
|
+
|
|
62
|
+
## Create a package
|
|
63
|
+
|
|
64
|
+
The simplest package uses conventional directories:
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
my-pi-package/
|
|
68
|
+
├── package.json
|
|
69
|
+
├── extensions/
|
|
70
|
+
├── skills/
|
|
71
|
+
├── prompts/
|
|
72
|
+
└── themes/
|
|
61
73
|
```
|
|
62
74
|
|
|
63
75
|
- Versioned specs are pinned and skipped by package updates (`apex-code update --extensions`, `apex-code update --all`).
|
|
@@ -65,7 +77,7 @@ npm:pkg
|
|
|
65
77
|
- Project installs go under `.apex-code/npm/`.
|
|
66
78
|
- Set `npmCommand` in `settings.json` to pin npm package lookup and install operations to a specific wrapper command such as `mise` or `asdf`.
|
|
67
79
|
|
|
68
|
-
|
|
80
|
+
Use an explicit manifest when resources live elsewhere or need filtering:
|
|
69
81
|
|
|
70
82
|
```json
|
|
71
83
|
{
|
|
@@ -122,44 +134,37 @@ Add a `pi` manifest to `package.json` or use conventional directories. `pi` is A
|
|
|
122
134
|
"name": "my-package",
|
|
123
135
|
"keywords": ["pi-package"],
|
|
124
136
|
"pi": {
|
|
125
|
-
"extensions": ["./
|
|
126
|
-
"skills": ["./skills"],
|
|
127
|
-
"prompts": ["./prompts"],
|
|
128
|
-
"themes": ["./themes"]
|
|
137
|
+
"extensions": ["./src/extension.ts"],
|
|
138
|
+
"skills": ["./resources/skills"],
|
|
139
|
+
"prompts": ["./resources/prompts/*.md"],
|
|
140
|
+
"themes": ["./resources/themes/*.json"]
|
|
129
141
|
}
|
|
130
142
|
}
|
|
131
143
|
```
|
|
132
144
|
|
|
133
|
-
Paths are relative to the package root. Arrays
|
|
145
|
+
Paths are relative to the package root. Arrays accept glob patterns and exclusions. List dot-prefixed or symlinked resource roots directly when traversal through a glob would not discover them.
|
|
134
146
|
|
|
135
|
-
|
|
147
|
+
The `pi-package` keyword is retained package metadata. Apex Code does not operate a hosted package gallery. Optional `pi.image` and `pi.video` fields have no effect within Apex Code.
|
|
136
148
|
|
|
137
149
|
Apex Code does not operate or depend on a hosted package gallery (see ADR 0013). The
|
|
138
|
-
`video`/`image` fields below are retained upstream vocabulary from Pi's
|
|
150
|
+
`video`/`image` fields below are retained upstream vocabulary from upstream Pi's package
|
|
139
151
|
gallery, kept for cross-compatibility if you publish the same package to both
|
|
140
152
|
ecosystems — they have no effect within Apex Code itself. Add them to show a preview
|
|
141
153
|
there:
|
|
142
154
|
|
|
143
|
-
|
|
144
|
-
{
|
|
145
|
-
"name": "my-package",
|
|
146
|
-
"keywords": ["pi-package"],
|
|
147
|
-
"pi": {
|
|
148
|
-
"extensions": ["./extensions"],
|
|
149
|
-
"video": "https://example.com/demo.mp4",
|
|
150
|
-
"image": "https://example.com/screenshot.png"
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
```
|
|
155
|
+
Put runtime packages imported by extensions in `dependencies`. Apex Code installs package dependencies when it installs an npm or git source.
|
|
154
156
|
|
|
155
|
-
|
|
156
|
-
- **image**: PNG, JPEG, GIF, or WebP. Displayed as a static preview.
|
|
157
|
+
Apex Code supplies these packages to extensions and skills:
|
|
157
158
|
|
|
158
|
-
|
|
159
|
+
- `@earendil-works/pi-ai`
|
|
160
|
+
- `@earendil-works/pi-agent-core`
|
|
161
|
+
- `@earendil-works/pi-coding-agent`
|
|
162
|
+
- `@earendil-works/pi-tui`
|
|
163
|
+
- `typebox`
|
|
159
164
|
|
|
160
|
-
|
|
165
|
+
Declare imported Apex Code packages in `peerDependencies` with a `"*"` range and do not bundle them. Other Apex Code packages used as dependencies must be included in the published tarball and referenced through their `node_modules` resource paths.
|
|
161
166
|
|
|
162
|
-
|
|
167
|
+
Installed packages load with separate module roots. Do not rely on two packages sharing one dependency instance or one package resolving another package’s undeclared dependency.
|
|
163
168
|
|
|
164
169
|
If no `pi` manifest is present, Apex Code auto-discovers resources from these directories:
|
|
165
170
|
|
|
@@ -198,35 +203,32 @@ Filter what a package loads using the object form in settings:
|
|
|
198
203
|
```json
|
|
199
204
|
{
|
|
200
205
|
"packages": [
|
|
201
|
-
"npm:simple-pkg",
|
|
202
206
|
{
|
|
203
|
-
"source": "npm
|
|
207
|
+
"source": "npm:@example/pi-tools",
|
|
204
208
|
"extensions": ["extensions/*.ts", "!extensions/legacy.ts"],
|
|
205
209
|
"skills": [],
|
|
206
|
-
"prompts": ["prompts/review.md"]
|
|
207
|
-
"themes": ["+themes/legacy.json"]
|
|
210
|
+
"prompts": ["prompts/review.md"]
|
|
208
211
|
}
|
|
209
212
|
]
|
|
210
213
|
}
|
|
211
214
|
```
|
|
212
215
|
|
|
213
|
-
|
|
216
|
+
For each resource type:
|
|
214
217
|
|
|
215
|
-
- Omit
|
|
218
|
+
- Omit the property to load everything allowed by the package.
|
|
216
219
|
- Use `[]` to load none of that type.
|
|
217
|
-
- `!pattern`
|
|
218
|
-
- `+path`
|
|
219
|
-
- `-path`
|
|
220
|
-
- Filters layer on top of the manifest. They narrow down what is already allowed.
|
|
220
|
+
- Use `!pattern` to exclude glob matches.
|
|
221
|
+
- Use `+path` to include one exact allowed path.
|
|
222
|
+
- Use `-path` to exclude one exact path.
|
|
221
223
|
|
|
222
|
-
|
|
224
|
+
Filters narrow the package manifest. They do not expose resources that the package itself did not declare.
|
|
223
225
|
|
|
224
226
|
Use `apex-code config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. `apex-code config` starts in global settings (`~/.apex-code/agent/settings.json`); press Tab to switch between global and project-local modes. Use `apex-code config -l` to start in project overrides (`.apex-code/settings.json`) with inherited global resources dimmed.
|
|
225
227
|
|
|
226
|
-
##
|
|
228
|
+
## Understand scope and identity
|
|
229
|
+
|
|
230
|
+
The same package can appear in personal and project settings. A project entry normally replaces the personal entry. With `autoload: false`, the project entry instead acts as a filtering delta over the personal package.
|
|
227
231
|
|
|
228
|
-
|
|
232
|
+
Apex Code identifies npm packages by package name, git packages by repository URL without the ref, and local packages by resolved absolute path. This prevents the same package from loading twice through equivalent declarations.
|
|
229
233
|
|
|
230
|
-
-
|
|
231
|
-
- git: repository URL without ref
|
|
232
|
-
- local: resolved absolute path
|
|
234
|
+
Use [Extensions](extensions.md), [Skills](skills.md), [Prompt Templates](prompt-templates.md), and [Themes](themes.md) to design each resource before packaging it.
|
package/docs/prompt-templates.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Prompt Templates
|
|
4
4
|
|
|
5
|
-
Prompt templates
|
|
5
|
+
Prompt templates turn Markdown files into reusable `/` commands. Use one when you want to reuse the same prompt without adding executable behavior or a larger set of supporting instructions.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A template can accept arguments and appear in command completion. Pi can load templates from personal configuration, project configuration, an explicit path, or a Pi package. Project configuration loads only after project trust is granted.
|
|
8
8
|
|
|
9
9
|
Apex Code loads prompt templates from:
|
|
10
10
|
|
|
@@ -21,76 +21,49 @@ Disable discovery with `--no-prompt-templates`.
|
|
|
21
21
|
```markdown
|
|
22
22
|
---
|
|
23
23
|
description: Review staged git changes
|
|
24
|
+
argument-hint: "[focus]"
|
|
24
25
|
---
|
|
25
|
-
Review the staged changes
|
|
26
|
-
- Bugs and logic errors
|
|
27
|
-
- Security issues
|
|
28
|
-
- Error handling gaps
|
|
26
|
+
Review the staged changes. Focus on ${1:-correctness, security, and error handling}.
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
- `description` is optional. If missing, the first non-empty line is used.
|
|
33
|
-
- `argument-hint` is optional. When set, the hint is displayed before the description in the autocomplete dropdown.
|
|
29
|
+
The filename becomes the command name, so this template is available as `/review`. The `description` appears in command completion. If it is omitted, Pi uses the first non-empty line.
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
`argument-hint` is optional. Use `<angle brackets>` for required arguments and `[square brackets]` for optional arguments.
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
Run `/reload` after adding or changing a template in an active session.
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
description: Review PRs from URLs with structured issue and code analysis
|
|
42
|
-
argument-hint: "<PR-URL>"
|
|
43
|
-
---
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
This renders in the autocomplete dropdown as:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
→ pr <PR-URL> — Review PRs from URLs with structured issue and code analysis
|
|
50
|
-
is <issue> — Analyze GitHub issues (bugs or feature requests)
|
|
51
|
-
wr [instructions] — Finish the current task end-to-end
|
|
52
|
-
cl — Audit changelog entries before release
|
|
53
|
-
```
|
|
35
|
+
<a id="invoke-a-template"></a>
|
|
54
36
|
|
|
55
|
-
##
|
|
37
|
+
## Use a template
|
|
56
38
|
|
|
57
|
-
Type
|
|
39
|
+
Type the template command in the editor:
|
|
58
40
|
|
|
41
|
+
```text
|
|
42
|
+
/review
|
|
43
|
+
/review concurrency
|
|
59
44
|
```
|
|
60
|
-
/review # Expands review.md
|
|
61
|
-
/component Button # Expands with argument
|
|
62
|
-
/component Button "click handler" # Multiple arguments
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Arguments
|
|
66
45
|
|
|
67
|
-
|
|
46
|
+
Pi expands the template before the resulting text enters the agent. Extensions receive the raw input first through the `input` event unless an extension command with the same name handles it.
|
|
68
47
|
|
|
69
|
-
|
|
70
|
-
- `$@` or `$ARGUMENTS` for all args joined
|
|
71
|
-
- `${1:-default}` uses arg 1 when present/non-empty, otherwise `default`
|
|
72
|
-
- `${@:-default}` or `${ARGUMENTS:-default}` uses all arguments when present/non-empty, otherwise `default`
|
|
73
|
-
- `${@:N}` for args from the Nth position (1-indexed)
|
|
74
|
-
- `${@:N:L}` for `L` args starting at N
|
|
48
|
+
Templates support these substitutions:
|
|
75
49
|
|
|
76
|
-
|
|
50
|
+
| Syntax | Result |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `$1`, `$2`, … | One positional argument |
|
|
53
|
+
| `$@` or `$ARGUMENTS` | All arguments joined with spaces |
|
|
54
|
+
| `${1:-default}` | First argument, or a default value |
|
|
55
|
+
| `${@:-default}` | All arguments, or a default value |
|
|
56
|
+
| `${@:N}` | Arguments starting at position `N` |
|
|
57
|
+
| `${@:N:L}` | `L` arguments starting at position `N` |
|
|
77
58
|
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
description: Create a component
|
|
81
|
-
---
|
|
82
|
-
Create a React component named $1 with features: $@
|
|
83
|
-
```
|
|
59
|
+
Arguments follow shell-like quoting, so `/review "API compatibility"` supplies one argument containing a space.
|
|
84
60
|
|
|
85
|
-
|
|
61
|
+
<a id="choose-where-it-loads"></a>
|
|
86
62
|
|
|
87
|
-
|
|
88
|
-
Summarize the current state in ${1:-7} bullet points.
|
|
89
|
-
```
|
|
63
|
+
## Add it to Pi
|
|
90
64
|
|
|
91
|
-
|
|
65
|
+
Place the template in your user or project prompt directory. Conventional prompt directories load direct `.md` children only.
|
|
92
66
|
|
|
93
|
-
|
|
67
|
+
Settings and packages can select nested Markdown files; a package manifest can narrow discovery with explicit paths and globs. See [Settings](settings.md#resources) and [Pi Packages](packages.md) for these options.
|
|
94
68
|
|
|
95
|
-
|
|
96
|
-
- If you want templates in subdirectories, add them explicitly via `prompts` settings or a package manifest.
|
|
69
|
+
Project templates become commands in the editor after trust is granted. Review their content before trusting an unfamiliar project. See [Security](security.md#understand-project-trust).
|