apex-code 0.0.1-alpha.1 → 0.0.1-alpha.2
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 +24 -0
- package/README.md +66 -681
- package/dist/cli/args.d.ts +5 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +45 -6
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +3 -3
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/cost-command.d.ts +19 -0
- package/dist/cli/cost-command.d.ts.map +1 -0
- package/dist/cli/cost-command.js +107 -0
- package/dist/cli/cost-command.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +1 -2
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +45 -16
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -7
- 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 +2 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +9 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +30 -4
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +46 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +137 -19
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +6 -6
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +1 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/context/deferred-schemas.d.ts +92 -0
- package/dist/core/context/deferred-schemas.d.ts.map +1 -0
- package/dist/core/context/deferred-schemas.js +74 -0
- package/dist/core/context/deferred-schemas.js.map +1 -0
- package/dist/core/context/eviction.d.ts +47 -0
- package/dist/core/context/eviction.d.ts.map +1 -0
- package/dist/core/context/eviction.js +83 -0
- package/dist/core/context/eviction.js.map +1 -0
- package/dist/core/context/pipeline.d.ts +90 -0
- package/dist/core/context/pipeline.d.ts.map +1 -0
- package/dist/core/context/pipeline.js +109 -0
- package/dist/core/context/pipeline.js.map +1 -0
- package/dist/core/credential-failover.d.ts +30 -0
- package/dist/core/credential-failover.d.ts.map +1 -0
- package/dist/core/credential-failover.js +46 -0
- package/dist/core/credential-failover.js.map +1 -0
- package/dist/core/credential-pool.d.ts +60 -0
- package/dist/core/credential-pool.d.ts.map +1 -0
- package/dist/core/credential-pool.js +84 -0
- package/dist/core/credential-pool.js.map +1 -0
- package/dist/core/delegation/agents.d.ts +15 -0
- package/dist/core/delegation/agents.d.ts.map +1 -0
- package/dist/core/delegation/agents.js +55 -0
- package/dist/core/delegation/agents.js.map +1 -0
- package/dist/core/delegation/ceiling.d.ts +29 -0
- package/dist/core/delegation/ceiling.d.ts.map +1 -0
- package/dist/core/delegation/ceiling.js +34 -0
- package/dist/core/delegation/ceiling.js.map +1 -0
- package/dist/core/delegation/runtime.d.ts +94 -0
- package/dist/core/delegation/runtime.d.ts.map +1 -0
- package/dist/core/delegation/runtime.js +117 -0
- package/dist/core/delegation/runtime.js.map +1 -0
- package/dist/core/durable-state/daemon.d.ts +37 -0
- package/dist/core/durable-state/daemon.d.ts.map +1 -0
- package/dist/core/durable-state/daemon.js +62 -0
- package/dist/core/durable-state/daemon.js.map +1 -0
- package/dist/core/durable-state/provenance.d.ts +7 -0
- package/dist/core/durable-state/provenance.d.ts.map +1 -0
- package/dist/core/durable-state/provenance.js +24 -0
- package/dist/core/durable-state/provenance.js.map +1 -0
- package/dist/core/durable-state/sqlite.d.ts +84 -0
- package/dist/core/durable-state/sqlite.d.ts.map +1 -0
- package/dist/core/durable-state/sqlite.js +331 -0
- package/dist/core/durable-state/sqlite.js.map +1 -0
- package/dist/core/environment.d.ts +12 -0
- package/dist/core/environment.d.ts.map +1 -0
- package/dist/core/environment.js +69 -0
- package/dist/core/environment.js.map +1 -0
- package/dist/core/evidence-policy.d.ts +17 -0
- package/dist/core/evidence-policy.d.ts.map +1 -0
- package/dist/core/evidence-policy.js +25 -0
- package/dist/core/evidence-policy.js.map +1 -0
- package/dist/core/evidence.d.ts +16 -0
- package/dist/core/evidence.d.ts.map +1 -0
- package/dist/core/evidence.js +51 -0
- package/dist/core/evidence.js.map +1 -0
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js +2 -1
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/extensions/types.d.ts +2 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/model-config.d.ts +8 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +21 -5
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts +20 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +59 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +73 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +225 -8
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/observability/aggregate.d.ts +21 -0
- package/dist/core/observability/aggregate.d.ts.map +1 -0
- package/dist/core/observability/aggregate.js +36 -0
- package/dist/core/observability/aggregate.js.map +1 -0
- package/dist/core/observability/otlp.d.ts +66 -0
- package/dist/core/observability/otlp.d.ts.map +1 -0
- package/dist/core/observability/otlp.js +95 -0
- package/dist/core/observability/otlp.js.map +1 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +3 -2
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permissions/gate.d.ts +35 -0
- package/dist/core/permissions/gate.d.ts.map +1 -0
- package/dist/core/permissions/gate.js +72 -0
- package/dist/core/permissions/gate.js.map +1 -0
- package/dist/core/permissions/modes.d.ts +18 -0
- package/dist/core/permissions/modes.d.ts.map +1 -0
- package/dist/core/permissions/modes.js +57 -0
- package/dist/core/permissions/modes.js.map +1 -0
- package/dist/core/permissions/responder.d.ts +30 -0
- package/dist/core/permissions/responder.d.ts.map +1 -0
- package/dist/core/permissions/responder.js +32 -0
- package/dist/core/permissions/responder.js.map +1 -0
- package/dist/core/permissions/rules.d.ts +34 -0
- package/dist/core/permissions/rules.d.ts.map +1 -0
- package/dist/core/permissions/rules.js +74 -0
- package/dist/core/permissions/rules.js.map +1 -0
- package/dist/core/permissions/startup.d.ts +33 -0
- package/dist/core/permissions/startup.d.ts.map +1 -0
- package/dist/core/permissions/startup.js +55 -0
- package/dist/core/permissions/startup.js.map +1 -0
- package/dist/core/permissions/store.d.ts +114 -0
- package/dist/core/permissions/store.d.ts.map +1 -0
- package/dist/core/permissions/store.js +229 -0
- package/dist/core/permissions/store.js.map +1 -0
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js +6 -7
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +2 -2
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +20 -16
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/sandbox/child-entry.d.ts +2 -0
- package/dist/core/sandbox/child-entry.d.ts.map +1 -0
- package/dist/core/sandbox/child-entry.js +11 -0
- package/dist/core/sandbox/child-entry.js.map +1 -0
- package/dist/core/sandbox/cli-launch.d.ts +27 -0
- package/dist/core/sandbox/cli-launch.d.ts.map +1 -0
- package/dist/core/sandbox/cli-launch.js +133 -0
- package/dist/core/sandbox/cli-launch.js.map +1 -0
- package/dist/core/sandbox/cli-supervisor.d.ts +25 -0
- package/dist/core/sandbox/cli-supervisor.d.ts.map +1 -0
- package/dist/core/sandbox/cli-supervisor.js +57 -0
- package/dist/core/sandbox/cli-supervisor.js.map +1 -0
- package/dist/core/sandbox/linux-backend.d.ts +18 -0
- package/dist/core/sandbox/linux-backend.d.ts.map +1 -0
- package/dist/core/sandbox/linux-backend.js +186 -0
- package/dist/core/sandbox/linux-backend.js.map +1 -0
- package/dist/core/sandbox/macos-backend.d.ts +18 -0
- package/dist/core/sandbox/macos-backend.d.ts.map +1 -0
- package/dist/core/sandbox/macos-backend.js +195 -0
- package/dist/core/sandbox/macos-backend.js.map +1 -0
- package/dist/core/sandbox/network-proxy.d.ts +19 -0
- package/dist/core/sandbox/network-proxy.d.ts.map +1 -0
- package/dist/core/sandbox/network-proxy.js +79 -0
- package/dist/core/sandbox/network-proxy.js.map +1 -0
- package/dist/core/sandbox/policy.d.ts +32 -0
- package/dist/core/sandbox/policy.d.ts.map +1 -0
- package/dist/core/sandbox/policy.js +38 -0
- package/dist/core/sandbox/policy.js.map +1 -0
- package/dist/core/sandbox/supervisor.d.ts +31 -0
- package/dist/core/sandbox/supervisor.d.ts.map +1 -0
- package/dist/core/sandbox/supervisor.js +18 -0
- package/dist/core/sandbox/supervisor.js.map +1 -0
- package/dist/core/sandbox/violations.d.ts +23 -0
- package/dist/core/sandbox/violations.d.ts.map +1 -0
- package/dist/core/sandbox/violations.js +30 -0
- package/dist/core/sandbox/violations.js.map +1 -0
- package/dist/core/sdk.d.ts +20 -36
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +129 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +41 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +57 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-share.d.ts +16 -0
- package/dist/core/session-share.d.ts.map +1 -0
- package/dist/core/session-share.js +22 -0
- package/dist/core/session-share.js.map +1 -0
- package/dist/core/settings-manager.d.ts +38 -9
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +39 -24
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -5
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/timings.d.ts +1 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +3 -2
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/ask-user.d.ts +25 -0
- package/dist/core/tools/ask-user.d.ts.map +1 -0
- package/dist/core/tools/ask-user.js +49 -0
- package/dist/core/tools/ask-user.js.map +1 -0
- package/dist/core/tools/bash-command-segments.d.ts +22 -0
- package/dist/core/tools/bash-command-segments.d.ts.map +1 -0
- package/dist/core/tools/bash-command-segments.js +128 -0
- package/dist/core/tools/bash-command-segments.js.map +1 -0
- package/dist/core/tools/bash.d.ts +26 -3
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +105 -16
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/contract.d.ts +156 -0
- package/dist/core/tools/contract.d.ts.map +1 -0
- package/dist/core/tools/contract.js +48 -0
- package/dist/core/tools/contract.js.map +1 -0
- package/dist/core/tools/delegate.d.ts +38 -0
- package/dist/core/tools/delegate.d.ts.map +1 -0
- package/dist/core/tools/delegate.js +66 -0
- package/dist/core/tools/delegate.js.map +1 -0
- package/dist/core/tools/edit.d.ts +2 -2
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +24 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +12 -0
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +2 -2
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +12 -0
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +29 -4
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +118 -2
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +2 -2
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +12 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +1 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/path-permission.d.ts +18 -0
- package/dist/core/tools/path-permission.d.ts.map +1 -0
- package/dist/core/tools/path-permission.js +28 -0
- package/dist/core/tools/path-permission.js.map +1 -0
- package/dist/core/tools/plan-present.d.ts +27 -0
- package/dist/core/tools/plan-present.d.ts.map +1 -0
- package/dist/core/tools/plan-present.js +55 -0
- package/dist/core/tools/plan-present.js.map +1 -0
- package/dist/core/tools/read.d.ts +2 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +12 -0
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/test.d.ts +34 -0
- package/dist/core/tools/test.d.ts.map +1 -0
- package/dist/core/tools/test.js +75 -0
- package/dist/core/tools/test.js.map +1 -0
- package/dist/core/tools/todo-write.d.ts +31 -0
- package/dist/core/tools/todo-write.d.ts.map +1 -0
- package/dist/core/tools/todo-write.js +51 -0
- package/dist/core/tools/todo-write.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +13 -2
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +11 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/tool-schema.d.ts +22 -0
- package/dist/core/tools/tool-schema.d.ts.map +1 -0
- package/dist/core/tools/tool-schema.js +45 -0
- package/dist/core/tools/tool-schema.js.map +1 -0
- package/dist/core/tools/web-fetch.d.ts +26 -0
- package/dist/core/tools/web-fetch.d.ts.map +1 -0
- package/dist/core/tools/web-fetch.js +62 -0
- package/dist/core/tools/web-fetch.js.map +1 -0
- package/dist/core/tools/web-search.d.ts +26 -0
- package/dist/core/tools/web-search.d.ts.map +1 -0
- package/dist/core/tools/web-search.js +53 -0
- package/dist/core/tools/web-search.js.map +1 -0
- package/dist/core/tools/write.d.ts +6 -2
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +32 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-performance-store.d.ts +56 -0
- package/dist/core/usage-performance-store.d.ts.map +1 -0
- package/dist/core/usage-performance-store.js +85 -0
- package/dist/core/usage-performance-store.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +48 -6
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +2 -2
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +9 -6
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +1 -4
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +11 -39
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +8 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +49 -20
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +6 -6
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +58 -9
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -3
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +92 -104
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +2 -2
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +15 -10
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/rpc-entry.d.ts.map +1 -1
- package/dist/rpc-entry.js +2 -1
- package/dist/rpc-entry.js.map +1 -1
- package/dist/server/create-harness.d.ts +1 -1
- package/dist/server/create-harness.d.ts.map +1 -1
- package/dist/server/create-harness.js +6 -5
- package/dist/server/create-harness.js.map +1 -1
- package/dist/testing/replay/metrics.d.ts +24 -0
- package/dist/testing/replay/metrics.d.ts.map +1 -0
- package/dist/testing/replay/metrics.js +35 -0
- package/dist/testing/replay/metrics.js.map +1 -0
- package/dist/testing/replay/recorded-provider.d.ts +10 -0
- package/dist/testing/replay/recorded-provider.d.ts.map +1 -0
- package/dist/testing/replay/recorded-provider.js +108 -0
- package/dist/testing/replay/recorded-provider.js.map +1 -0
- package/dist/testing/replay/runner.d.ts +56 -0
- package/dist/testing/replay/runner.d.ts.map +1 -0
- package/dist/testing/replay/runner.js +406 -0
- package/dist/testing/replay/runner.js.map +1 -0
- package/dist/utils/apex-code-user-agent.d.ts +2 -0
- package/dist/utils/apex-code-user-agent.d.ts.map +1 -0
- package/dist/utils/apex-code-user-agent.js +5 -0
- package/dist/utils/apex-code-user-agent.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +32 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +198 -100
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +5 -5
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +23 -14
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/windows-self-update.d.ts.map +1 -1
- package/dist/utils/windows-self-update.js +1 -1
- package/dist/utils/windows-self-update.js.map +1 -1
- package/docs/compaction.md +21 -21
- package/docs/containerization.md +24 -21
- package/docs/custom-provider.md +9 -9
- package/docs/development.md +11 -11
- package/docs/environment-variables.md +36 -77
- package/docs/extensions.md +47 -47
- package/docs/index.md +12 -24
- package/docs/json.md +6 -6
- package/docs/keybindings.md +3 -3
- package/docs/llama-cpp.md +7 -7
- package/docs/models.md +11 -11
- package/docs/packages.md +46 -42
- package/docs/prompt-templates.md +3 -3
- package/docs/providers.md +10 -10
- package/docs/quickstart.md +49 -32
- package/docs/rpc.md +11 -11
- package/docs/sdk.md +4 -4
- package/docs/security.md +18 -18
- package/docs/session-format.md +9 -9
- package/docs/sessions.md +13 -13
- package/docs/settings.md +10 -14
- package/docs/shell-aliases.md +1 -1
- package/docs/skills.md +8 -8
- package/docs/terminal-setup.md +12 -12
- package/docs/termux.md +4 -4
- package/docs/themes.md +8 -8
- package/docs/tmux.md +4 -4
- package/docs/tui.md +3 -3
- package/docs/usage.md +54 -51
- package/docs/windows.md +1 -1
- package/npm-shrinkwrap.json +5 -5
- package/package.json +2 -3
- package/dist/core/telemetry.d.ts +0 -3
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/telemetry.js +0 -9
- package/dist/core/telemetry.js.map +0 -1
- package/dist/utils/pi-user-agent.d.ts +0 -2
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js +0 -5
- package/dist/utils/pi-user-agent.js.map +0 -1
package/docs/containerization.md
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
# Containerization
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Apex Code has its own permission gate and, on Linux and macOS, an OS-level sandbox (see
|
|
4
|
+
[Security](security.md)); Windows has no supported sandbox backend, and even where the
|
|
5
|
+
built-in sandbox applies, you may want stronger or environment-level control over what
|
|
6
|
+
directories Apex Code can write to and which accesses it has.
|
|
4
7
|
|
|
5
8
|
There are two general options. You can either
|
|
6
|
-
1. run the whole `
|
|
7
|
-
2. run `
|
|
9
|
+
1. run the whole `apex-code` process inside an isolated environment, or
|
|
10
|
+
2. run `apex-code` on the host and route tool execution into an isolated environment.
|
|
8
11
|
|
|
9
12
|
## Choose a pattern
|
|
10
13
|
|
|
11
14
|
| Pattern | What is isolated | Best for | Notes |
|
|
12
15
|
| --- | --- | --- | --- |
|
|
13
16
|
| Gondolin extension | Built-in tools and `!` commands | Local micro-VM isolation while keeping auth on host | See [`examples/extensions/gondolin/`](../examples/extensions/gondolin/). |
|
|
14
|
-
| Plain Docker | Whole `
|
|
15
|
-
| OpenShell | Whole `
|
|
17
|
+
| Plain Docker | Whole `apex-code` process in a local container | Simple local isolation | Provider API keys enter the container. |
|
|
18
|
+
| OpenShell | Whole `apex-code` process in a policy-controlled sandbox | Local or remote managed sandbox | Requires an OpenShell gateway |
|
|
16
19
|
|
|
17
|
-
Extensions run wherever the `
|
|
20
|
+
Extensions run wherever the `apex-code` process runs. If you run host `apex-code` with a tool-routing extension, other custom extension tools still run on the host unless they also delegate their operations.
|
|
18
21
|
|
|
19
22
|
## Gondolin
|
|
20
23
|
|
|
21
24
|
[Gondolin](https://github.com/earendil-works/gondolin) is a local Linux micro-VM.
|
|
22
|
-
Use the [example extension](../examples/extensions/gondolin) when you want `
|
|
25
|
+
Use the [example extension](../examples/extensions/gondolin) when you want `apex-code` on the host but all built-in tools routed into the VM.
|
|
23
26
|
|
|
24
27
|
Setup:
|
|
25
28
|
|
|
@@ -33,7 +36,7 @@ Run from the project you want mounted:
|
|
|
33
36
|
|
|
34
37
|
```bash
|
|
35
38
|
cd /path/to/project
|
|
36
|
-
|
|
39
|
+
apex-code -e ~/.apex-code/agent/extensions/gondolin
|
|
37
40
|
```
|
|
38
41
|
|
|
39
42
|
The extension mounts the host cwd at `/workspace` in the VM and overrides `read`, `write`, `edit`, `bash`, `grep`, `find`, and `ls`.
|
|
@@ -44,9 +47,9 @@ Requirements: Node.js >= 23.6.0 for `@earendil-works/gondolin`, plus QEMU (requi
|
|
|
44
47
|
|
|
45
48
|
## Plain Docker
|
|
46
49
|
|
|
47
|
-
Run the whole `
|
|
50
|
+
Run the whole `apex-code` process in Docker when you want the simplest local container boundary.
|
|
48
51
|
|
|
49
|
-
`Dockerfile.
|
|
52
|
+
`Dockerfile.apex-code`:
|
|
50
53
|
|
|
51
54
|
```dockerfile
|
|
52
55
|
FROM node:24-bookworm-slim
|
|
@@ -57,24 +60,24 @@ RUN apt-get update \
|
|
|
57
60
|
RUN npm install -g --ignore-scripts apex-code
|
|
58
61
|
|
|
59
62
|
WORKDIR /workspace
|
|
60
|
-
ENTRYPOINT ["
|
|
63
|
+
ENTRYPOINT ["apex-code"]
|
|
61
64
|
```
|
|
62
65
|
|
|
63
66
|
Build and run:
|
|
64
67
|
|
|
65
68
|
```bash
|
|
66
|
-
docker build -t
|
|
69
|
+
docker build -t apex-code-sandbox -f Dockerfile.apex-code .
|
|
67
70
|
|
|
68
71
|
docker run --rm -it \
|
|
69
72
|
-e ANTHROPIC_API_KEY \
|
|
70
73
|
-v "$PWD:/workspace" \
|
|
71
|
-
-v
|
|
72
|
-
|
|
74
|
+
-v apex-code-agent-home:/root/.apex-code/agent \
|
|
75
|
+
apex-code-sandbox
|
|
73
76
|
```
|
|
74
77
|
|
|
75
78
|
The `-v "$PWD:/workspace"` mounts your current directory into the container at /workspace such that reads and writes in `/workspace` inside Docker directly affect your host files, like in the Gondolin example.
|
|
76
79
|
|
|
77
|
-
Use a named volume for `/root/.
|
|
80
|
+
Use a named volume for `/root/.apex-code/agent` if you want container-local settings and sessions. Mounting your host `~/.apex-code/agent` exposes host auth and session files to the container.
|
|
78
81
|
|
|
79
82
|
## OpenShell
|
|
80
83
|
|
|
@@ -89,23 +92,23 @@ openshell gateway add <gateway-url> --name <name>
|
|
|
89
92
|
openshell gateway select <name>
|
|
90
93
|
```
|
|
91
94
|
|
|
92
|
-
Launch `
|
|
95
|
+
Launch `apex-code` inside an OpenShell sandbox:
|
|
93
96
|
|
|
94
97
|
```bash
|
|
95
|
-
openshell sandbox create --name
|
|
98
|
+
openshell sandbox create --name apex-code-sandbox --from apex-code -- apex-code
|
|
96
99
|
```
|
|
97
100
|
|
|
98
|
-
In this pattern, the whole `
|
|
101
|
+
In this pattern, the whole `apex-code` process runs inside the sandbox.
|
|
99
102
|
Built-in tools, `!` commands, and extension tools execute inside the OpenShell boundary.
|
|
100
103
|
|
|
101
104
|
If the gateway is remote, project files are not bind-mounted from the host, meaning writes in the sandbox are not reflected on your machine.
|
|
102
105
|
Clone the repository inside the sandbox or use OpenShell file transfer commands:
|
|
103
106
|
|
|
104
107
|
```bash
|
|
105
|
-
openshell sandbox upload
|
|
106
|
-
openshell sandbox download
|
|
108
|
+
openshell sandbox upload apex-code-sandbox ./repo /workspace
|
|
109
|
+
openshell sandbox download apex-code-sandbox /workspace/repo ./repo-out
|
|
107
110
|
```
|
|
108
111
|
|
|
109
112
|
OpenShell providers can keep raw model API keys outside the sandbox.
|
|
110
113
|
When inference routing is configured, code inside the sandbox can call `https://inference.local`, and the gateway injects the configured provider credentials upstream.
|
|
111
|
-
Configure
|
|
114
|
+
Configure Apex Code to use the corresponding OpenAI-compatible or Anthropic-compatible endpoint if you want model traffic to use this route.
|
package/docs/custom-provider.md
CHANGED
|
@@ -30,7 +30,7 @@ See these complete provider examples:
|
|
|
30
30
|
|
|
31
31
|
## Quick Reference
|
|
32
32
|
|
|
33
|
-
Extensions can register either a complete pi-ai `Provider` or use the legacy provider-config form. Prefer a complete provider when custom authentication, filtering, refresh, or streaming behavior is required.
|
|
33
|
+
Extensions can register either a complete pi-ai `Provider` or use the legacy provider-config form. Prefer a complete provider when custom authentication, filtering, refresh, or streaming behavior is required. Apex Code composes `models.json` overrides above registered native providers.
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
36
|
import { createProvider, openAICompletionsApi } from "@earendil-works/pi-ai";
|
|
@@ -88,7 +88,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
88
88
|
}
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
The extension factory can also be `async`. For dynamic model discovery, fetch and register models in the factory instead of `session_start`.
|
|
91
|
+
The extension factory can also be `async`. For dynamic model discovery, fetch and register models in the factory instead of `session_start`. Apex Code waits for the factory before startup continues, so the provider is available during interactive startup and to `apex-code --list-models`.
|
|
92
92
|
|
|
93
93
|
## Override Existing Provider
|
|
94
94
|
|
|
@@ -239,7 +239,7 @@ models: [{
|
|
|
239
239
|
id: "custom-model",
|
|
240
240
|
// ...
|
|
241
241
|
reasoning: true,
|
|
242
|
-
thinkingLevelMap: { // map
|
|
242
|
+
thinkingLevelMap: { // map Apex Code levels to provider values; null hides unsupported levels
|
|
243
243
|
minimal: null,
|
|
244
244
|
low: null,
|
|
245
245
|
medium: null,
|
|
@@ -566,14 +566,14 @@ calculateCost(model, output.usage);
|
|
|
566
566
|
|
|
567
567
|
### Context Overflow Errors
|
|
568
568
|
|
|
569
|
-
When a request exceeds the model's context window,
|
|
569
|
+
When a request exceeds the model's context window, Apex Code can recover automatically by compacting the conversation and retrying. This recovery only kicks in if Apex Code recognizes the failure as an overflow.
|
|
570
570
|
|
|
571
571
|
Detection runs on the finalized assistant message:
|
|
572
572
|
|
|
573
573
|
- `stopReason === "error"`
|
|
574
|
-
- `errorMessage` matches one of
|
|
574
|
+
- `errorMessage` matches one of Apex Code's known overflow patterns (see [`packages/ai/src/utils/overflow.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/utils/overflow.ts))
|
|
575
575
|
|
|
576
|
-
If your provider returns overflow errors with a message
|
|
576
|
+
If your provider returns overflow errors with a message Apex Code does not recognize, normalize the error from the same extension that registers the provider. Use a `message_end` handler to rewrite the assistant message so its `errorMessage` starts with a phrase Apex Code recognizes. The generic fallback `context_length_exceeded` is the safest choice.
|
|
577
577
|
|
|
578
578
|
```typescript
|
|
579
579
|
const MY_PROVIDER_OVERFLOW_PATTERN = /your provider's overflow phrase/i;
|
|
@@ -605,7 +605,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
605
605
|
}
|
|
606
606
|
```
|
|
607
607
|
|
|
608
|
-
`message_end` runs before
|
|
608
|
+
`message_end` runs before Apex Code tracks the assistant message for auto-compaction, so the rewritten `errorMessage` is what Apex Code checks. With this in place, Apex Code will:
|
|
609
609
|
|
|
610
610
|
1. Detect the overflow from `errorMessage`.
|
|
611
611
|
2. Drop the failed assistant message from live context.
|
|
@@ -615,7 +615,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
615
615
|
Guard the rewrite carefully:
|
|
616
616
|
|
|
617
617
|
- Scope it to your provider (`message.provider` and `ctx.model?.provider`) so unrelated errors from other providers are untouched.
|
|
618
|
-
- Match a provider-specific pattern, not
|
|
618
|
+
- Match a provider-specific pattern, not Apex Code's generic overflow patterns. Rewriting rate-limit or throttling errors (`rate limit`, `too many requests`) would falsely trigger compaction instead of Apex Code's normal retry-with-backoff path.
|
|
619
619
|
- Skip when `errorMessage` already includes `context_length_exceeded` so the handler is idempotent.
|
|
620
620
|
|
|
621
621
|
### Registration
|
|
@@ -713,7 +713,7 @@ interface ProviderModelConfig {
|
|
|
713
713
|
/** Whether the model supports extended thinking. */
|
|
714
714
|
reasoning: boolean;
|
|
715
715
|
|
|
716
|
-
/** Maps
|
|
716
|
+
/** Maps Apex Code thinking levels to provider/model-specific values; null marks a level unsupported. */
|
|
717
717
|
thinkingLevelMap?: Partial<Record<"off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", string | null>>;
|
|
718
718
|
|
|
719
719
|
/** Supported input types. */
|
package/docs/development.md
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
# Development
|
|
2
2
|
|
|
3
|
-
See [AGENTS.md](https://github.com/
|
|
3
|
+
See [AGENTS.md](https://github.com/Fchery87/apex-code/blob/main/AGENTS.md) for additional guidelines.
|
|
4
4
|
|
|
5
5
|
## Setup
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
git clone https://github.com/
|
|
9
|
-
cd
|
|
8
|
+
git clone https://github.com/Fchery87/apex-code
|
|
9
|
+
cd apex-code
|
|
10
10
|
npm install
|
|
11
11
|
npm run build
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Run from source:
|
|
14
|
+
Run tests from source:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
/path/to/
|
|
17
|
+
/path/to/apex-code/test.sh
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
The script can be run from any directory.
|
|
20
|
+
The script can be run from any directory. Apex Code keeps the caller's current working directory.
|
|
21
21
|
|
|
22
22
|
## Forking / Rebranding
|
|
23
23
|
|
|
24
|
-
Configure via `package.json`:
|
|
24
|
+
Apex Code itself is a fork of Pi configured this way. Configure via `package.json`:
|
|
25
25
|
|
|
26
26
|
```json
|
|
27
27
|
{
|
|
28
28
|
"piConfig": {
|
|
29
|
-
"name": "
|
|
30
|
-
"configDir": ".
|
|
29
|
+
"name": "apex-code",
|
|
30
|
+
"configDir": ".apex-code"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Change `name`, `configDir`, and `bin` field for your fork. Affects CLI banner, config paths, and environment variable names.
|
|
35
|
+
Change `name`, `configDir`, and `bin` field for your own fork. Affects CLI banner, config paths, and environment variable names. `piConfig` is the retained upstream key name for this mechanism, not a reference to a running "pi" product.
|
|
36
36
|
|
|
37
37
|
## Path Resolution
|
|
38
38
|
|
|
@@ -48,7 +48,7 @@ Never use `__dirname` directly for package assets.
|
|
|
48
48
|
|
|
49
49
|
## Debug Command
|
|
50
50
|
|
|
51
|
-
`/debug` (hidden) writes to `~/.apex-code/agent/
|
|
51
|
+
`/debug` (hidden) writes to `~/.apex-code/agent/apex-code-debug.log`:
|
|
52
52
|
- Rendered TUI lines with ANSI codes
|
|
53
53
|
- Last messages sent to the LLM
|
|
54
54
|
|
|
@@ -1,88 +1,47 @@
|
|
|
1
|
-
# Environment
|
|
1
|
+
# Environment variables
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Apex Code uses canonical `APEX_CODE_*` variables for its owned runtime controls and
|
|
4
|
+
subprocess metadata. Provider API-key variables remain documented in
|
|
5
|
+
[Providers](providers.md#environment-variables-or-auth-file).
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
- Pi sets `PI_CODING_AGENT` so child processes can detect that they run inside Pi.
|
|
7
|
-
- Commands run by the LLM-callable bash tool receive `PI_*` variables describing the current session.
|
|
8
|
-
|
|
9
|
-
Provider API-key variables are documented separately in [Providers](providers.md#environment-variables-or-auth-file).
|
|
10
|
-
|
|
11
|
-
## Process Marker
|
|
12
|
-
|
|
13
|
-
The CLI and RPC entry points set `PI_CODING_AGENT=true`. Child processes inherit it and can use it to detect that they run inside Pi. It is not session-specific and is not set automatically when Pi is embedded through the SDK.
|
|
14
|
-
|
|
15
|
-
## Bash Tool Session Environment
|
|
16
|
-
|
|
17
|
-
Commands run by the bash tool receive the current Pi session state:
|
|
7
|
+
## Runtime controls
|
|
18
8
|
|
|
19
9
|
| Variable | Description |
|
|
20
|
-
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `APEX_CODE_CODING_AGENT_DIR` | Config root; defaults to `~/.apex-code/agent` |
|
|
12
|
+
| `APEX_CODE_CODING_AGENT_SESSION_DIR` | Override session storage |
|
|
13
|
+
| `APEX_CODE_PACKAGE_DIR` | Override package assets (for Nix/Guix paths) |
|
|
14
|
+
| `APEX_CODE_OFFLINE` | Disable startup network operations |
|
|
15
|
+
| `APEX_CODE_SKIP_VERSION_CHECK` | Disable the npm `apex-code@next` version request |
|
|
16
|
+
| `APEX_CODE_EXPERIMENTAL` | Enable experimental features when set to `1` |
|
|
17
|
+
| `APEX_CODE_STARTUP_BENCHMARK` | Enable startup benchmarking |
|
|
18
|
+
| `APEX_CODE_TIMING` | Enable timing diagnostics when set to `1` |
|
|
19
|
+
| `APEX_CODE_CLEAR_ON_SHRINK` | Clear context on shrink when set to `1` |
|
|
20
|
+
| `APEX_CODE_HARDWARE_CURSOR` | Show the hardware cursor when set to `1` |
|
|
21
|
+
| `APEX_CODE_MODEL_CATALOG_URL` | Optional base URL for remote model catalog overlays; unset uses bundled catalogs only |
|
|
22
|
+
| `APEX_CODE_SHARE_VIEWER_URL` | Optional base URL for preview links after `/share`; unset returns the GitHub Gist URL only |
|
|
23
|
+
| `VISUAL`, `EDITOR` | External editor fallback |
|
|
24
|
+
| `HTTP_PROXY`, `HTTPS_PROXY` | Proxy outbound HTTP requests |
|
|
35
25
|
|
|
36
|
-
The
|
|
26
|
+
The CLI and RPC entry points set `APEX_CODE_CODING_AGENT=true`. Commands run through
|
|
27
|
+
the built-in bash tool receive `APEX_CODE_SESSION_ID`, `APEX_CODE_SESSION_FILE`,
|
|
28
|
+
`APEX_CODE_PROVIDER`, `APEX_CODE_MODEL`, and `APEX_CODE_REASONING_LEVEL`. Values are
|
|
29
|
+
resolved when each command starts. User-entered `!` and `!!` commands do not receive
|
|
30
|
+
this session metadata.
|
|
37
31
|
|
|
38
32
|
```bash
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
fi
|
|
33
|
+
printf '%s/%s\n' "$APEX_CODE_PROVIDER" "$APEX_CODE_MODEL"
|
|
34
|
+
printf 'reasoning=%s session=%s\n' "$APEX_CODE_REASONING_LEVEL" "$APEX_CODE_SESSION_ID"
|
|
42
35
|
```
|
|
43
36
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Custom Bash Tools
|
|
37
|
+
## Temporary legacy aliases
|
|
47
38
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
spawnHook: (ctx) => ({
|
|
53
|
-
...ctx,
|
|
54
|
-
env: { ...ctx.env, CI: "1" },
|
|
55
|
-
}),
|
|
56
|
-
});
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Disable session metadata independently of the spawn hook:
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
const bashTool = createBashTool(cwd, {
|
|
63
|
-
exposeSessionEnvironment: false,
|
|
64
|
-
spawnHook: (ctx) => ctx,
|
|
65
|
-
});
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
When disabled, Pi removes inherited values for these variables so nested Pi processes do not expose stale parent-session metadata.
|
|
69
|
-
|
|
70
|
-
## Pi Process Configuration
|
|
71
|
-
|
|
72
|
-
These variables are read by Pi itself:
|
|
73
|
-
|
|
74
|
-
| Variable | Description |
|
|
75
|
-
|----------|-------------|
|
|
76
|
-
| `PI_CODING_AGENT_DIR` | Override the config directory; default is `~/.apex-code/agent` |
|
|
77
|
-
| `PI_CODING_AGENT_SESSION_DIR` | Override session storage; overridden by `--session-dir` |
|
|
78
|
-
| `PI_PACKAGE_DIR` | Override the package directory, useful for Nix/Guix store paths |
|
|
79
|
-
| `PI_OFFLINE` | Disable startup network operations, including update checks, package updates, and install/update telemetry |
|
|
80
|
-
| `PI_SKIP_VERSION_CHECK` | Disable the `pi.dev` latest-version request |
|
|
81
|
-
| `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no` |
|
|
82
|
-
| `PI_CACHE_RETENTION` | Set to `long` for extended provider prompt caching where supported |
|
|
83
|
-
| `PI_SHARE_VIEWER_URL` | Override the base URL used by `/share` |
|
|
84
|
-
| `PI_HARDWARE_CURSOR` | Set to `1` to show the hardware cursor; see [Terminal setup](terminal-setup.md) |
|
|
85
|
-
| `VISUAL`, `EDITOR` | External editor fallback when `externalEditor` is unset |
|
|
86
|
-
| `HTTP_PROXY`, `HTTPS_PROXY` | Proxy outbound HTTP requests |
|
|
39
|
+
The equivalent `PI_*` names remain aliases during the compatibility window. Apex Code
|
|
40
|
+
reads the canonical name first; when both are set, the canonical value wins. A
|
|
41
|
+
legacy-only read emits one deprecation diagnostic per process. Apex Code exports both
|
|
42
|
+
forms to child processes during this window so existing scripts continue working.
|
|
87
43
|
|
|
88
|
-
|
|
44
|
+
Legacy aliases will be removed no earlier than Apex Code 1.0.0 and no earlier than
|
|
45
|
+
2027-02-16. Removal requires release notes and an intentional compatibility-test
|
|
46
|
+
change. Consumed dependency variables, provider API-key variables, and extension API
|
|
47
|
+
vocabulary are not part of this rename.
|