apex-code 0.0.1-alpha.8 → 0.0.4
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 +231 -0
- package/README.md +9 -8
- package/dist/cli/args.d.ts +26 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +72 -10
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +2 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/mcp-command.d.ts +9 -0
- package/dist/cli/mcp-command.d.ts.map +1 -0
- package/dist/cli/mcp-command.js +53 -0
- package/dist/cli/mcp-command.js.map +1 -0
- package/dist/cli/project-trust.d.ts.map +1 -1
- package/dist/cli/project-trust.js +3 -1
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +2 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +94 -5
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +3 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +45 -18
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +3 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +183 -15
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +728 -117
- 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 -7
- 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 +7 -0
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/checkpoints/git-checkpoints.d.ts +39 -0
- package/dist/core/checkpoints/git-checkpoints.d.ts.map +1 -0
- package/dist/core/checkpoints/git-checkpoints.js +251 -0
- package/dist/core/checkpoints/git-checkpoints.js.map +1 -0
- package/dist/core/checkpoints/session-checkpoints.d.ts +23 -0
- package/dist/core/checkpoints/session-checkpoints.d.ts.map +1 -0
- package/dist/core/checkpoints/session-checkpoints.js +36 -0
- package/dist/core/checkpoints/session-checkpoints.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +7 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +9 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +59 -36
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/defaults.d.ts +1 -0
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js +9 -0
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/delegation/runtime.d.ts +6 -5
- package/dist/core/delegation/runtime.d.ts.map +1 -1
- package/dist/core/delegation/runtime.js +4 -3
- package/dist/core/delegation/runtime.js.map +1 -1
- package/dist/core/durable-state/sqlite.d.ts.map +1 -1
- package/dist/core/durable-state/sqlite.js +26 -2
- package/dist/core/durable-state/sqlite.js.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +5 -2
- package/dist/core/exec.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +123 -50
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +45 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/source-runtime.d.ts +14 -0
- package/dist/core/extensions/source-runtime.d.ts.map +1 -0
- package/dist/core/extensions/source-runtime.js +56 -0
- package/dist/core/extensions/source-runtime.js.map +1 -0
- package/dist/core/extensions/types.d.ts +60 -11
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +3 -0
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/formatter-lifecycle.d.ts +69 -0
- package/dist/core/formatter-lifecycle.d.ts.map +1 -0
- package/dist/core/formatter-lifecycle.js +360 -0
- package/dist/core/formatter-lifecycle.js.map +1 -0
- package/dist/core/hooks/command-handler.d.ts +19 -0
- package/dist/core/hooks/command-handler.d.ts.map +1 -0
- package/dist/core/hooks/command-handler.js +112 -0
- package/dist/core/hooks/command-handler.js.map +1 -0
- package/dist/core/hooks/http-handler.d.ts +10 -0
- package/dist/core/hooks/http-handler.d.ts.map +1 -0
- package/dist/core/hooks/http-handler.js +36 -0
- package/dist/core/hooks/http-handler.js.map +1 -0
- package/dist/core/hooks/loader.d.ts +29 -0
- package/dist/core/hooks/loader.d.ts.map +1 -0
- package/dist/core/hooks/loader.js +139 -0
- package/dist/core/hooks/loader.js.map +1 -0
- package/dist/core/hooks/runtime.d.ts +13 -0
- package/dist/core/hooks/runtime.d.ts.map +1 -0
- package/dist/core/hooks/runtime.js +63 -0
- package/dist/core/hooks/runtime.js.map +1 -0
- package/dist/core/hooks/types.d.ts +83 -0
- package/dist/core/hooks/types.d.ts.map +1 -0
- package/dist/core/hooks/types.js +24 -0
- package/dist/core/hooks/types.js.map +1 -0
- package/dist/core/keybindings.d.ts +20 -19
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +26 -5
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp/config.d.ts +16 -0
- package/dist/core/mcp/config.d.ts.map +1 -0
- package/dist/core/mcp/config.js +166 -0
- package/dist/core/mcp/config.js.map +1 -0
- package/dist/core/mcp/connector.d.ts +35 -0
- package/dist/core/mcp/connector.d.ts.map +1 -0
- package/dist/core/mcp/connector.js +105 -0
- package/dist/core/mcp/connector.js.map +1 -0
- package/dist/core/mcp/contract.d.ts +19 -0
- package/dist/core/mcp/contract.d.ts.map +1 -0
- package/dist/core/mcp/contract.js +89 -0
- package/dist/core/mcp/contract.js.map +1 -0
- package/dist/core/mcp/mcp-tool.d.ts +32 -0
- package/dist/core/mcp/mcp-tool.d.ts.map +1 -0
- package/dist/core/mcp/mcp-tool.js +171 -0
- package/dist/core/mcp/mcp-tool.js.map +1 -0
- package/dist/core/mcp/metadata-cache.d.ts +29 -0
- package/dist/core/mcp/metadata-cache.d.ts.map +1 -0
- package/dist/core/mcp/metadata-cache.js +99 -0
- package/dist/core/mcp/metadata-cache.js.map +1 -0
- package/dist/core/mcp/oauth/authorize.d.ts +21 -0
- package/dist/core/mcp/oauth/authorize.d.ts.map +1 -0
- package/dist/core/mcp/oauth/authorize.js +32 -0
- package/dist/core/mcp/oauth/authorize.js.map +1 -0
- package/dist/core/mcp/oauth/discover.d.ts +27 -0
- package/dist/core/mcp/oauth/discover.d.ts.map +1 -0
- package/dist/core/mcp/oauth/discover.js +116 -0
- package/dist/core/mcp/oauth/discover.js.map +1 -0
- package/dist/core/mcp/oauth/flow.d.ts +31 -0
- package/dist/core/mcp/oauth/flow.d.ts.map +1 -0
- package/dist/core/mcp/oauth/flow.js +175 -0
- package/dist/core/mcp/oauth/flow.js.map +1 -0
- package/dist/core/mcp/oauth/mcp-token.d.ts +51 -0
- package/dist/core/mcp/oauth/mcp-token.d.ts.map +1 -0
- package/dist/core/mcp/oauth/mcp-token.js +129 -0
- package/dist/core/mcp/oauth/mcp-token.js.map +1 -0
- package/dist/core/mcp/oauth/pkce.d.ts +12 -0
- package/dist/core/mcp/oauth/pkce.d.ts.map +1 -0
- package/dist/core/mcp/oauth/pkce.js +11 -0
- package/dist/core/mcp/oauth/pkce.js.map +1 -0
- package/dist/core/mcp/oauth/register.d.ts +16 -0
- package/dist/core/mcp/oauth/register.d.ts.map +1 -0
- package/dist/core/mcp/oauth/register.js +42 -0
- package/dist/core/mcp/oauth/register.js.map +1 -0
- package/dist/core/mcp/oauth/token-client.d.ts +33 -0
- package/dist/core/mcp/oauth/token-client.d.ts.map +1 -0
- package/dist/core/mcp/oauth/token-client.js +65 -0
- package/dist/core/mcp/oauth/token-client.js.map +1 -0
- package/dist/core/mcp/runtime.d.ts +20 -0
- package/dist/core/mcp/runtime.d.ts.map +1 -0
- package/dist/core/mcp/runtime.js +37 -0
- package/dist/core/mcp/runtime.js.map +1 -0
- package/dist/core/mcp/schema.d.ts +22 -0
- package/dist/core/mcp/schema.d.ts.map +1 -0
- package/dist/core/mcp/schema.js +20 -0
- package/dist/core/mcp/schema.js.map +1 -0
- package/dist/core/mcp/server-manager.d.ts +43 -0
- package/dist/core/mcp/server-manager.d.ts.map +1 -0
- package/dist/core/mcp/server-manager.js +142 -0
- package/dist/core/mcp/server-manager.js.map +1 -0
- package/dist/core/mcp/types.d.ts +100 -0
- package/dist/core/mcp/types.d.ts.map +1 -0
- package/dist/core/mcp/types.js +8 -0
- package/dist/core/mcp/types.js.map +1 -0
- package/dist/core/model-config.d.ts +5 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +3 -1
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +14 -8
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js +2 -1
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +22 -14
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permissions/gate.d.ts.map +1 -1
- package/dist/core/permissions/gate.js +45 -4
- package/dist/core/permissions/gate.js.map +1 -1
- package/dist/core/permissions/operations.d.ts +20 -0
- package/dist/core/permissions/operations.d.ts.map +1 -0
- package/dist/core/permissions/operations.js +9 -0
- package/dist/core/permissions/operations.js.map +1 -0
- package/dist/core/permissions/policy-command.d.ts +42 -0
- package/dist/core/permissions/policy-command.d.ts.map +1 -0
- package/dist/core/permissions/policy-command.js +44 -0
- package/dist/core/permissions/policy-command.js.map +1 -0
- package/dist/core/permissions/responder.d.ts +49 -2
- package/dist/core/permissions/responder.d.ts.map +1 -1
- package/dist/core/permissions/responder.js +20 -8
- package/dist/core/permissions/responder.js.map +1 -1
- package/dist/core/permissions/rules.d.ts.map +1 -1
- package/dist/core/permissions/rules.js +11 -1
- package/dist/core/permissions/rules.js.map +1 -1
- package/dist/core/permissions/store.d.ts +18 -0
- package/dist/core/permissions/store.d.ts.map +1 -1
- package/dist/core/permissions/store.js +89 -8
- package/dist/core/permissions/store.js.map +1 -1
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js +2 -1
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/policy-executor.d.ts +47 -0
- package/dist/core/policy-executor.d.ts.map +1 -0
- package/dist/core/policy-executor.js +228 -0
- package/dist/core/policy-executor.js.map +1 -0
- package/dist/core/policy-loader.d.ts +72 -0
- package/dist/core/policy-loader.d.ts.map +1 -0
- package/dist/core/policy-loader.js +195 -0
- package/dist/core/policy-loader.js.map +1 -0
- package/dist/core/project-trust.d.ts +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +2 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +3 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sandbox/bwrap-arguments.d.ts +41 -0
- package/dist/core/sandbox/bwrap-arguments.d.ts.map +1 -0
- package/dist/core/sandbox/bwrap-arguments.js +136 -0
- package/dist/core/sandbox/bwrap-arguments.js.map +1 -0
- package/dist/core/sandbox/child-entry.d.ts.map +1 -1
- package/dist/core/sandbox/child-entry.js +3 -1
- package/dist/core/sandbox/child-entry.js.map +1 -1
- package/dist/core/sandbox/cli-launch.d.ts +84 -4
- package/dist/core/sandbox/cli-launch.d.ts.map +1 -1
- package/dist/core/sandbox/cli-launch.js +115 -16
- package/dist/core/sandbox/cli-launch.js.map +1 -1
- package/dist/core/sandbox/cli-supervisor.d.ts +2 -0
- package/dist/core/sandbox/cli-supervisor.d.ts.map +1 -1
- package/dist/core/sandbox/cli-supervisor.js +50 -2
- package/dist/core/sandbox/cli-supervisor.js.map +1 -1
- package/dist/core/sandbox/full-access.d.ts +28 -0
- package/dist/core/sandbox/full-access.d.ts.map +1 -0
- package/dist/core/sandbox/full-access.js +63 -0
- package/dist/core/sandbox/full-access.js.map +1 -0
- package/dist/core/sandbox/git-identity.d.ts +57 -0
- package/dist/core/sandbox/git-identity.d.ts.map +1 -0
- package/dist/core/sandbox/git-identity.js +78 -0
- package/dist/core/sandbox/git-identity.js.map +1 -0
- package/dist/core/sandbox/host-approval.d.ts +42 -0
- package/dist/core/sandbox/host-approval.d.ts.map +1 -0
- package/dist/core/sandbox/host-approval.js +99 -0
- package/dist/core/sandbox/host-approval.js.map +1 -0
- package/dist/core/sandbox/linux-backend.d.ts +14 -0
- package/dist/core/sandbox/linux-backend.d.ts.map +1 -1
- package/dist/core/sandbox/linux-backend.js +158 -80
- package/dist/core/sandbox/linux-backend.js.map +1 -1
- package/dist/core/sandbox/macos-backend.d.ts +5 -0
- package/dist/core/sandbox/macos-backend.d.ts.map +1 -1
- package/dist/core/sandbox/macos-backend.js +164 -5
- package/dist/core/sandbox/macos-backend.js.map +1 -1
- package/dist/core/sandbox/network-proxy.d.ts +19 -0
- package/dist/core/sandbox/network-proxy.d.ts.map +1 -1
- package/dist/core/sandbox/network-proxy.js +93 -19
- package/dist/core/sandbox/network-proxy.js.map +1 -1
- package/dist/core/sandbox/policy.d.ts +8 -0
- package/dist/core/sandbox/policy.d.ts.map +1 -1
- package/dist/core/sandbox/policy.js +29 -12
- package/dist/core/sandbox/policy.js.map +1 -1
- package/dist/core/sandbox/profiles.d.ts +25 -0
- package/dist/core/sandbox/profiles.d.ts.map +1 -0
- package/dist/core/sandbox/profiles.js +23 -0
- package/dist/core/sandbox/profiles.js.map +1 -0
- package/dist/core/sandbox/rpc/command-client.d.ts +28 -0
- package/dist/core/sandbox/rpc/command-client.d.ts.map +1 -0
- package/dist/core/sandbox/rpc/command-client.js +86 -0
- package/dist/core/sandbox/rpc/command-client.js.map +1 -0
- package/dist/core/sandbox/rpc/command-proxy.d.ts +48 -0
- package/dist/core/sandbox/rpc/command-proxy.d.ts.map +1 -0
- package/dist/core/sandbox/rpc/command-proxy.js +120 -0
- package/dist/core/sandbox/rpc/command-proxy.js.map +1 -0
- package/dist/core/sandbox/rpc/credential-proxy.d.ts.map +1 -1
- package/dist/core/sandbox/rpc/credential-proxy.js +2 -96
- package/dist/core/sandbox/rpc/credential-proxy.js.map +1 -1
- package/dist/core/sandbox/rpc/framing.d.ts +35 -0
- package/dist/core/sandbox/rpc/framing.d.ts.map +1 -0
- package/dist/core/sandbox/rpc/framing.js +114 -0
- package/dist/core/sandbox/rpc/framing.js.map +1 -0
- package/dist/core/sandbox/rpc/git-credential-helper.d.ts +47 -0
- package/dist/core/sandbox/rpc/git-credential-helper.d.ts.map +1 -0
- package/dist/core/sandbox/rpc/git-credential-helper.js +222 -0
- package/dist/core/sandbox/rpc/git-credential-helper.js.map +1 -0
- package/dist/core/sandbox/rpc/git-credential-proxy.d.ts +66 -0
- package/dist/core/sandbox/rpc/git-credential-proxy.d.ts.map +1 -0
- package/dist/core/sandbox/rpc/git-credential-proxy.js +209 -0
- package/dist/core/sandbox/rpc/git-credential-proxy.js.map +1 -0
- package/dist/core/sandbox/supervisor-temp.d.ts +18 -0
- package/dist/core/sandbox/supervisor-temp.d.ts.map +1 -0
- package/dist/core/sandbox/supervisor-temp.js +21 -0
- package/dist/core/sandbox/supervisor-temp.js.map +1 -0
- package/dist/core/sandbox/supervisor.d.ts +12 -1
- package/dist/core/sandbox/supervisor.d.ts.map +1 -1
- package/dist/core/sandbox/supervisor.js +15 -1
- package/dist/core/sandbox/supervisor.js.map +1 -1
- package/dist/core/sandbox/terminal-handoff.d.ts +68 -0
- package/dist/core/sandbox/terminal-handoff.d.ts.map +1 -0
- package/dist/core/sandbox/terminal-handoff.js +221 -0
- package/dist/core/sandbox/terminal-handoff.js.map +1 -0
- package/dist/core/sandbox/terminal-size.d.ts +13 -0
- package/dist/core/sandbox/terminal-size.d.ts.map +1 -1
- package/dist/core/sandbox/terminal-size.js +23 -2
- package/dist/core/sandbox/terminal-size.js.map +1 -1
- package/dist/core/sdk.d.ts +24 -2
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +63 -4
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-export.d.ts +4 -0
- package/dist/core/session-export.d.ts.map +1 -0
- package/dist/core/session-export.js +32 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-manager.d.ts +13 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +34 -6
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-diagnostics.d.ts +9 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +21 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager.d.ts +172 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +160 -11
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +51 -33
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +8 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/background-shell.d.ts +39 -0
- package/dist/core/tools/background-shell.d.ts.map +1 -0
- package/dist/core/tools/background-shell.js +81 -0
- package/dist/core/tools/background-shell.js.map +1 -0
- package/dist/core/tools/bash-command-segments.d.ts.map +1 -1
- package/dist/core/tools/bash-command-segments.js +2 -0
- package/dist/core/tools/bash-command-segments.js.map +1 -1
- package/dist/core/tools/bash.d.ts +44 -16
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +264 -32
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/contract-snapshot.d.ts +58 -0
- package/dist/core/tools/contract-snapshot.d.ts.map +1 -0
- package/dist/core/tools/contract-snapshot.js +51 -0
- package/dist/core/tools/contract-snapshot.js.map +1 -0
- package/dist/core/tools/contract.d.ts +53 -5
- package/dist/core/tools/contract.d.ts.map +1 -1
- package/dist/core/tools/contract.js +22 -2
- package/dist/core/tools/contract.js.map +1 -1
- package/dist/core/tools/delegate.d.ts +6 -4
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +21 -11
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +48 -5
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +217 -8
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +8 -0
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +72 -10
- 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 +5 -2
- 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 +5 -2
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +14 -2
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +12 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +5 -2
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/lsp.d.ts +19 -1
- package/dist/core/tools/lsp.d.ts.map +1 -1
- package/dist/core/tools/lsp.js +163 -10
- package/dist/core/tools/lsp.js.map +1 -1
- package/dist/core/tools/path-permission.d.ts +3 -0
- package/dist/core/tools/path-permission.d.ts.map +1 -1
- package/dist/core/tools/path-permission.js +16 -4
- package/dist/core/tools/path-permission.js.map +1 -1
- package/dist/core/tools/path-utils.d.ts +27 -2
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js +221 -4
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +39 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +20 -11
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/test.d.ts +54 -9
- package/dist/core/tools/test.d.ts.map +1 -1
- package/dist/core/tools/test.js +239 -19
- package/dist/core/tools/test.js.map +1 -1
- package/dist/core/tools/write.d.ts +7 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +64 -9
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +2 -1
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/verification-lifecycle.d.ts +77 -0
- package/dist/core/verification-lifecycle.d.ts.map +1 -0
- package/dist/core/verification-lifecycle.js +146 -0
- package/dist/core/verification-lifecycle.js.map +1 -0
- package/dist/core/workspace/artifacts.d.ts +45 -0
- package/dist/core/workspace/artifacts.d.ts.map +1 -0
- package/dist/core/workspace/artifacts.js +165 -0
- package/dist/core/workspace/artifacts.js.map +1 -0
- package/dist/core/workspace/comparison.d.ts +27 -0
- package/dist/core/workspace/comparison.d.ts.map +1 -0
- package/dist/core/workspace/comparison.js +94 -0
- package/dist/core/workspace/comparison.js.map +1 -0
- package/dist/core/workspace/git-observer.d.ts +48 -0
- package/dist/core/workspace/git-observer.d.ts.map +1 -0
- package/dist/core/workspace/git-observer.js +346 -0
- package/dist/core/workspace/git-observer.js.map +1 -0
- package/dist/core/workspace/projection.d.ts +3 -0
- package/dist/core/workspace/projection.d.ts.map +1 -0
- package/dist/core/workspace/projection.js +56 -0
- package/dist/core/workspace/projection.js.map +1 -0
- package/dist/core/workspace/state.d.ts +133 -0
- package/dist/core/workspace/state.d.ts.map +1 -0
- package/dist/core/workspace/state.js +96 -0
- package/dist/core/workspace/state.js.map +1 -0
- package/dist/extensions/llama/client.d.ts +6 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +7 -0
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.js +2 -0
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +3 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +29 -4
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +6 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +58 -23
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +4 -3
- package/dist/migrations.js.map +1 -1
- package/dist/modes/acp/server.d.ts +55 -0
- package/dist/modes/acp/server.d.ts.map +1 -0
- package/dist/modes/acp/server.js +244 -0
- package/dist/modes/acp/server.js.map +1 -0
- package/dist/modes/acp/translate.d.ts +37 -0
- package/dist/modes/acp/translate.d.ts.map +1 -0
- package/dist/modes/acp/translate.js +50 -0
- package/dist/modes/acp/translate.js.map +1 -0
- package/dist/modes/index.d.ts +1 -0
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js +1 -0
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +29 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +182 -23
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +7 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +20 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +9 -4
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +20 -9
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +7 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +7 -3
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +19 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +70 -10
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +10 -3
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +56 -14
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/permission-preview.d.ts +15 -0
- package/dist/modes/interactive/components/permission-preview.d.ts.map +1 -0
- package/dist/modes/interactive/components/permission-preview.js +33 -0
- package/dist/modes/interactive/components/permission-preview.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +2 -2
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +9 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +128 -56
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.js +165 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +74 -17
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +23 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +64 -10
- 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 +2 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +45 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +395 -43
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +12 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +20 -9
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/json-event.d.ts +16 -13
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js +20 -6
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +27 -12
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +7 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +7 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +3 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +12 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts +1 -0
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +196 -10
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +2 -1
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/management-http.d.ts +5 -3
- package/dist/utils/management-http.d.ts.map +1 -1
- package/dist/utils/management-http.js +14 -10
- package/dist/utils/management-http.js.map +1 -1
- package/dist/utils/shell.d.ts +3 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +23 -9
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +1 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +60 -1
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +6 -4
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +19 -0
- package/docs/custom-provider.md +12 -9
- package/docs/environment-variables.md +1 -1
- package/docs/extensions.md +35 -7
- package/docs/json.md +7 -2
- package/docs/keybindings.md +9 -9
- package/docs/llama-cpp.md +2 -0
- package/docs/models.md +8 -2
- package/docs/packages.md +2 -2
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +32 -3
- package/docs/sdk.md +32 -2
- package/docs/settings.md +23 -7
- package/docs/skills.md +4 -3
- package/docs/terminal-setup.md +23 -7
- package/docs/usage.md +10 -5
- package/docs/windows.md +24 -2
- package/examples/extensions/border-status-editor.ts +1 -1
- package/examples/extensions/built-in-tool-renderer.ts +8 -4
- 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/package.json +1 -1
- package/examples/extensions/git-checkpoint.ts +24 -36
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/minimal-mode.ts +2 -2
- package/examples/extensions/notify.ts +3 -1
- package/examples/extensions/permission-gate.ts +1 -1
- package/examples/extensions/plan-mode/index.ts +1 -1
- package/examples/extensions/rpc-demo.ts +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/subagent/README.md +1 -1
- package/examples/extensions/subagent/index.ts +6 -1
- package/examples/extensions/titlebar-spinner.ts +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/rpc-extension-ui.ts +1 -1
- package/examples/sdk/06-extensions.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +439 -405
- package/package.json +17 -17
- package/dist/server/create-harness.d.ts +0 -26
- package/dist/server/create-harness.d.ts.map +0 -1
- package/dist/server/create-harness.js +0 -107
- package/dist/server/create-harness.js.map +0 -1
|
@@ -13,24 +13,35 @@
|
|
|
13
13
|
* Modes use this class and add their own I/O layer on top.
|
|
14
14
|
*/
|
|
15
15
|
import type { ImageContent, Model, TextContent } from "@earendil-works/pi-ai/compat";
|
|
16
|
-
import type { Agent, AgentEvent, AgentMessage, AgentState, AgentTool, ThinkingLevel } from "apex-code-agent-core";
|
|
16
|
+
import type { Agent, AgentEvent, AgentMessage, AgentState, AgentStopReason, AgentTool, ThinkingLevel } from "apex-code-agent-core";
|
|
17
17
|
import { type BashResult } from "./bash-executor.ts";
|
|
18
|
+
import type { CheckpointSettings } from "./checkpoints/git-checkpoints.ts";
|
|
19
|
+
import { type SessionCheckpoints } from "./checkpoints/session-checkpoints.ts";
|
|
18
20
|
import { type CompactionResult } from "./compaction/index.ts";
|
|
19
21
|
import { type ContextUsage, type ExtensionCommandContextActions, type ExtensionErrorListener, type ExtensionMode, ExtensionRunner, type ExtensionUIContext, type InputSource, type ReplacedSessionContext, type SessionStartEvent, type ShutdownHandler, type ToolDefinition, type ToolInfo } from "./extensions/index.ts";
|
|
22
|
+
import { type FormatterRunOutcome } from "./formatter-lifecycle.ts";
|
|
23
|
+
import type { HookRuntime } from "./hooks/types.ts";
|
|
24
|
+
import type { McpRuntime } from "./mcp/runtime.ts";
|
|
20
25
|
import type { CustomMessage } from "./messages.ts";
|
|
21
26
|
import type { ModelRuntime } from "./model-runtime.ts";
|
|
22
27
|
import { type PermissionGateOptions } from "./permissions/gate.ts";
|
|
28
|
+
import type { PermissionResponder } from "./permissions/responder.ts";
|
|
23
29
|
import { type EffectiveModeResolution } from "./permissions/startup.ts";
|
|
24
30
|
import type { PermissionMode } from "./permissions/store.ts";
|
|
25
31
|
import { type PromptTemplate } from "./prompt-templates.ts";
|
|
26
32
|
import type { ResourceLoader } from "./resource-loader.ts";
|
|
27
33
|
import type { BranchSummaryEntry, SessionEntry, SessionManager } from "./session-manager.ts";
|
|
28
34
|
import type { SettingsManager } from "./settings-manager.ts";
|
|
35
|
+
import type { BackgroundShellRegistry } from "./tools/background-shell.ts";
|
|
29
36
|
import { type BashOperations } from "./tools/bash.ts";
|
|
30
37
|
import type { EvidenceSink } from "./tools/contract.ts";
|
|
38
|
+
import { type ToolContractSnapshotEntry } from "./tools/contract-snapshot.ts";
|
|
31
39
|
import type { DiagnosticsOperations } from "./tools/diagnostics.ts";
|
|
32
40
|
import type { LspOperations } from "./tools/lsp.ts";
|
|
33
41
|
import type { WebSearchOperations } from "./tools/web-search.ts";
|
|
42
|
+
import { type VerificationCompletionStatus, type VerificationRecord } from "./verification-lifecycle.ts";
|
|
43
|
+
import { type GitObserveOptions } from "./workspace/git-observer.ts";
|
|
44
|
+
import { type WorkspaceStateRecord } from "./workspace/state.ts";
|
|
34
45
|
/** Parsed skill block from a user message */
|
|
35
46
|
export interface ParsedSkillBlock {
|
|
36
47
|
name: string;
|
|
@@ -50,6 +61,8 @@ export type AgentSessionEvent = Exclude<AgentEvent, {
|
|
|
50
61
|
type: "agent_end";
|
|
51
62
|
messages: AgentMessage[];
|
|
52
63
|
willRetry: boolean;
|
|
64
|
+
/** Structured terminal outcome of the run (budget exhaustion, abort, error, completion). */
|
|
65
|
+
stopReason?: AgentStopReason;
|
|
53
66
|
} | {
|
|
54
67
|
type: "agent_settled";
|
|
55
68
|
} | {
|
|
@@ -172,12 +185,38 @@ export interface AgentSessionConfig {
|
|
|
172
185
|
* `baseToolsOverride` is set.
|
|
173
186
|
*/
|
|
174
187
|
lspOperations?: LspOperations;
|
|
188
|
+
/** Assembled MCP subsystem, present only when at least one server is configured. */
|
|
189
|
+
mcpRuntime?: McpRuntime;
|
|
175
190
|
/**
|
|
176
191
|
* Optional `web_search` backend. Absent leaves the tool on its unconfigured
|
|
177
192
|
* operations, which throw a model-readable "not configured" error rather than
|
|
178
193
|
* returning zero results. Ignored when `baseToolsOverride` is set.
|
|
179
194
|
*/
|
|
180
195
|
webSearchOperations?: WebSearchOperations;
|
|
196
|
+
/**
|
|
197
|
+
* Git-backed worktree checkpoints. Absent, or present with `enabled` unset, captures
|
|
198
|
+
* nothing and runs no `git` subprocess.
|
|
199
|
+
*/
|
|
200
|
+
checkpointSettings?: CheckpointSettings;
|
|
201
|
+
/**
|
|
202
|
+
* Declarative hooks (spec 2026-08-31-declarative-hooks). Absent constructs
|
|
203
|
+
* nothing: no subprocess, no behavior change. Assembled by `createAgentSession`
|
|
204
|
+
* from the merged settings -- project-scope entries only appear once trusted,
|
|
205
|
+
* because untrusted project settings are not loaded at all.
|
|
206
|
+
*/
|
|
207
|
+
hookRuntime?: HookRuntime;
|
|
208
|
+
/**
|
|
209
|
+
* Background-shell registry (spec 2026-08-31-background-shell.md). Absent
|
|
210
|
+
* constructs nothing. Created by `createAgentSession` when not supplied and
|
|
211
|
+
* disposed with the session, so background children never outlive it.
|
|
212
|
+
*/
|
|
213
|
+
backgroundShellRegistry?: BackgroundShellRegistry;
|
|
214
|
+
/**
|
|
215
|
+
* Optional headless permission bridge (ACP, spec 2026-08-31-acp-adapter.md):
|
|
216
|
+
* consulted before the interactive TUI responder. Absent keeps today's
|
|
217
|
+
* behavior -- asks without a responder fail closed.
|
|
218
|
+
*/
|
|
219
|
+
permissionResponderFactory?: () => PermissionResponder | undefined;
|
|
181
220
|
}
|
|
182
221
|
export interface ExtensionBindings {
|
|
183
222
|
uiContext?: ExtensionUIContext;
|
|
@@ -200,6 +239,11 @@ export interface PromptOptions {
|
|
|
200
239
|
/** Internal hook used by RPC mode to observe prompt preflight acceptance or rejection. */
|
|
201
240
|
preflightResult?: (success: boolean) => void;
|
|
202
241
|
}
|
|
242
|
+
/** Options for model/thinking mutations. */
|
|
243
|
+
export interface ModelMutationOptions {
|
|
244
|
+
/** Persist the new value to global defaults. Defaults to session-only. */
|
|
245
|
+
persist?: boolean;
|
|
246
|
+
}
|
|
203
247
|
/** Result from cycleModel() */
|
|
204
248
|
export interface ModelCycleResult {
|
|
205
249
|
model: Model<any>;
|
|
@@ -226,6 +270,26 @@ export interface SessionStats {
|
|
|
226
270
|
cost: number;
|
|
227
271
|
contextUsage?: ContextUsage;
|
|
228
272
|
}
|
|
273
|
+
/** Explicit workspace policy for `/tree` and `/fork`-family navigation (spec § 4). */
|
|
274
|
+
export type TreeWorkspacePolicy = "keep" | "restore" | "fail-if-drifted" | "cancel";
|
|
275
|
+
/** What the navigation did to the workspace, reported separately from the conversation move. */
|
|
276
|
+
export interface TreeWorkspaceOutcome {
|
|
277
|
+
policy: TreeWorkspacePolicy;
|
|
278
|
+
outcome: "unchanged" | "restored" | "refused-drifted" | "missing-checkpoint" | "failed";
|
|
279
|
+
/** Checkpoint of the pre-restore state; present when a restore overwrote anything. */
|
|
280
|
+
preRestoreCheckpoint?: {
|
|
281
|
+
entryId: string;
|
|
282
|
+
commit: string;
|
|
283
|
+
};
|
|
284
|
+
warnings: string[];
|
|
285
|
+
}
|
|
286
|
+
export interface TreeNavigationResult {
|
|
287
|
+
editorText?: string;
|
|
288
|
+
cancelled: boolean;
|
|
289
|
+
aborted?: boolean;
|
|
290
|
+
summaryEntry?: BranchSummaryEntry;
|
|
291
|
+
workspace?: TreeWorkspaceOutcome;
|
|
292
|
+
}
|
|
229
293
|
export declare class AgentSession {
|
|
230
294
|
readonly agent: Agent;
|
|
231
295
|
readonly sessionManager: SessionManager;
|
|
@@ -242,9 +306,12 @@ export declare class AgentSession {
|
|
|
242
306
|
private _followUpMessages;
|
|
243
307
|
/** Messages queued to be included with the next user prompt as context ("asides"). */
|
|
244
308
|
private _pendingNextTurnMessages;
|
|
309
|
+
/** Context-only custom messages queued during a run, flushed once the current turn's tool results are in. */
|
|
310
|
+
private _pendingCustomMessages;
|
|
245
311
|
private _compactionAbortController;
|
|
246
312
|
private _autoCompactionAbortController;
|
|
247
313
|
private _overflowRecoveryAttempted;
|
|
314
|
+
private _midRunCompactionNeeded;
|
|
248
315
|
private _branchSummaryAbortController;
|
|
249
316
|
private _retryAbortController;
|
|
250
317
|
private _retryAttempt;
|
|
@@ -256,6 +323,21 @@ export declare class AgentSession {
|
|
|
256
323
|
private _customTools;
|
|
257
324
|
private _baseToolDefinitions;
|
|
258
325
|
private _cwd;
|
|
326
|
+
/**
|
|
327
|
+
* Workspace observation adapter for compaction capture (WS.4). Injectable
|
|
328
|
+
* so tests can force capture outcomes without a real repository.
|
|
329
|
+
*/
|
|
330
|
+
_workspaceObserver: (root: string, options?: GitObserveOptions) => Promise<WorkspaceStateRecord>;
|
|
331
|
+
/**
|
|
332
|
+
* WS.5: one workspace comparison is due at the next model-turn boundary.
|
|
333
|
+
* Set after a compaction stored an observation, or on construction when
|
|
334
|
+
* the session's latest observation has no later comparison (resume).
|
|
335
|
+
*/
|
|
336
|
+
private _workspaceComparePending;
|
|
337
|
+
/** VF.4: verification lifecycle state, built lazily from policy settings. */
|
|
338
|
+
private _verificationTracker;
|
|
339
|
+
/** The workspace observation a verification result described, for staleness. */
|
|
340
|
+
private _verificationBaseline;
|
|
259
341
|
private _extensionRunnerRef?;
|
|
260
342
|
private _initialActiveToolNames?;
|
|
261
343
|
private _allowedToolNames?;
|
|
@@ -266,6 +348,15 @@ export declare class AgentSession {
|
|
|
266
348
|
private _evidenceSink?;
|
|
267
349
|
private _diagnosticsOperations?;
|
|
268
350
|
private _lspOperations?;
|
|
351
|
+
private _mcpRuntime?;
|
|
352
|
+
/** Configured MCP subsystem, or undefined when no server is configured. */
|
|
353
|
+
get mcpRuntime(): McpRuntime | undefined;
|
|
354
|
+
private readonly _checkpoints;
|
|
355
|
+
private readonly _hookRuntime;
|
|
356
|
+
private readonly _backgroundShellRegistry;
|
|
357
|
+
private readonly _permissionResponderFactory;
|
|
358
|
+
/** Worktree checkpoints for this session. Inert unless `checkpoints.enabled` is set. */
|
|
359
|
+
get checkpoints(): SessionCheckpoints;
|
|
269
360
|
private _webSearchOperations?;
|
|
270
361
|
private _extensionUIContext?;
|
|
271
362
|
private _extensionMode;
|
|
@@ -296,7 +387,11 @@ export declare class AgentSession {
|
|
|
296
387
|
* happens here instead of in wrappers.
|
|
297
388
|
*/
|
|
298
389
|
private _installAgentToolHooks;
|
|
390
|
+
private _compactBeforeNextAssistantResponse;
|
|
299
391
|
private _installAgentNextTurnRefresh;
|
|
392
|
+
/** Stop an over-threshold tool loop before it sends another provider request. */
|
|
393
|
+
private _installMidRunCompactionHook;
|
|
394
|
+
private _shouldStopForMidRunCompaction;
|
|
300
395
|
/**
|
|
301
396
|
* Installs the context pipeline settled in `docs/architecture/contracts.md` § 2:
|
|
302
397
|
* deferred-schema resolution → tool-result eviction → compaction. Compaction
|
|
@@ -330,6 +425,7 @@ export declare class AgentSession {
|
|
|
330
425
|
/** Emit an event to all listeners */
|
|
331
426
|
private _emit;
|
|
332
427
|
private _emitQueueUpdate;
|
|
428
|
+
private _emitSessionCompactFailed;
|
|
333
429
|
private _getIdleWaitPromise;
|
|
334
430
|
private _resolveIdleWaitIfIdle;
|
|
335
431
|
private _emitAgentSettled;
|
|
@@ -376,6 +472,11 @@ export declare class AgentSession {
|
|
|
376
472
|
/**
|
|
377
473
|
* Get all configured tools with name, description, parameter schema, prompt guidelines, and source metadata.
|
|
378
474
|
*/
|
|
475
|
+
/**
|
|
476
|
+
* The ADR 0010 projection over this session's registry: the one read every surface
|
|
477
|
+
* that *describes* the tool set consumes. Never an authorization input.
|
|
478
|
+
*/
|
|
479
|
+
getToolContractSnapshot(): ToolContractSnapshotEntry[];
|
|
379
480
|
getAllTools(): ToolInfo[];
|
|
380
481
|
getToolDefinition(name: string): ToolDefinition | undefined;
|
|
381
482
|
/**
|
|
@@ -459,8 +560,9 @@ export declare class AgentSession {
|
|
|
459
560
|
/**
|
|
460
561
|
* Send a custom message to the session. Creates a CustomMessageEntry.
|
|
461
562
|
*
|
|
462
|
-
* Handles
|
|
563
|
+
* Handles four cases:
|
|
463
564
|
* - Streaming: queues message, processed when loop pulls from queue
|
|
565
|
+
* - Streaming + triggerTurn false: appended to state/session once the current turn ends
|
|
464
566
|
* - Not streaming + triggerTurn: appends to state/session, starts new turn
|
|
465
567
|
* - Not streaming + no trigger: appends to state/session, no turn
|
|
466
568
|
*
|
|
@@ -472,6 +574,12 @@ export declare class AgentSession {
|
|
|
472
574
|
triggerTurn?: boolean;
|
|
473
575
|
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
474
576
|
}): Promise<void>;
|
|
577
|
+
private _appendCustomMessage;
|
|
578
|
+
/**
|
|
579
|
+
* Append custom messages queued while the agent was running.
|
|
580
|
+
* Called once the current turn's tool results are in agent state and session history.
|
|
581
|
+
*/
|
|
582
|
+
private _flushPendingCustomMessages;
|
|
475
583
|
/**
|
|
476
584
|
* Send a user message to the agent. Always triggers a turn.
|
|
477
585
|
* When the agent is streaming, use deliverAs to specify how to queue the message.
|
|
@@ -523,30 +631,33 @@ export declare class AgentSession {
|
|
|
523
631
|
setPermissionMode(mode: PermissionMode): Promise<EffectiveModeResolution | undefined>;
|
|
524
632
|
/**
|
|
525
633
|
* Set model directly.
|
|
526
|
-
* Validates that auth is configured
|
|
634
|
+
* Validates that auth is configured and saves to the session transcript.
|
|
635
|
+
* Persists to global defaults only when options.persist is true.
|
|
527
636
|
* @throws Error if no auth is configured for the model
|
|
528
637
|
*/
|
|
529
|
-
setModel(model: Model<any
|
|
638
|
+
setModel(model: Model<any>, options?: ModelMutationOptions): Promise<void>;
|
|
639
|
+
private _addPersistedDefaultToNonEmptyScope;
|
|
530
640
|
/**
|
|
531
641
|
* Cycle to next/previous model.
|
|
532
642
|
* Uses scoped models (from --models flag) if available, otherwise all available models.
|
|
533
643
|
* @param direction - "forward" (default) or "backward"
|
|
534
644
|
* @returns The new model info, or undefined if only one model available
|
|
535
645
|
*/
|
|
536
|
-
cycleModel(direction?: "forward" | "backward"): Promise<ModelCycleResult | undefined>;
|
|
646
|
+
cycleModel(direction?: "forward" | "backward", options?: ModelMutationOptions): Promise<ModelCycleResult | undefined>;
|
|
537
647
|
private _cycleScopedModel;
|
|
538
648
|
private _cycleAvailableModel;
|
|
539
649
|
/**
|
|
540
650
|
* Set thinking level.
|
|
541
651
|
* Clamps to model capabilities based on available thinking levels.
|
|
542
|
-
* Saves to session
|
|
652
|
+
* Saves the clamped level to the session transcript only if the level actually changes.
|
|
653
|
+
* Persists the requested level to global defaults only when options.persist is true.
|
|
543
654
|
*/
|
|
544
|
-
setThinkingLevel(level: ThinkingLevel): void;
|
|
655
|
+
setThinkingLevel(level: ThinkingLevel, options?: ModelMutationOptions): void;
|
|
545
656
|
/**
|
|
546
657
|
* Cycle to next thinking level.
|
|
547
658
|
* @returns New level, or undefined if model doesn't support thinking
|
|
548
659
|
*/
|
|
549
|
-
cycleThinkingLevel(): ThinkingLevel | undefined;
|
|
660
|
+
cycleThinkingLevel(options?: ModelMutationOptions): ThinkingLevel | undefined;
|
|
550
661
|
/**
|
|
551
662
|
* Get available thinking levels for current model.
|
|
552
663
|
* The provider will clamp to what the specific model supports internally.
|
|
@@ -569,9 +680,69 @@ export declare class AgentSession {
|
|
|
569
680
|
* Saves to settings.
|
|
570
681
|
*/
|
|
571
682
|
setFollowUpMode(mode: "all" | "one-at-a-time"): void;
|
|
683
|
+
/** Generate Pi's built-in compaction summary for manual and automatic compaction. */
|
|
684
|
+
/**
|
|
685
|
+
* Attempt exactly one workspace observation for a compaction (spec
|
|
686
|
+
* 2026-09-01-harness-correctness-and-workspace-state.md § 3 step 1).
|
|
687
|
+
* Returns undefined when observation is impossible; never throws and
|
|
688
|
+
* never fails the surrounding compaction.
|
|
689
|
+
*/
|
|
690
|
+
_captureWorkspaceObservation(signal: AbortSignal | undefined): Promise<WorkspaceStateRecord | undefined>;
|
|
691
|
+
/** Session/artifact directories inside the workspace, relative paths. */
|
|
692
|
+
private _sessionExclusionPaths;
|
|
693
|
+
/**
|
|
694
|
+
* Build (once) and refresh the tracker from the raw per-source policy
|
|
695
|
+
* settings. ADR 0028: the loader consumes the sources separately and the
|
|
696
|
+
* trust gate decides whether the project source exists at all.
|
|
697
|
+
*/
|
|
698
|
+
/**
|
|
699
|
+
* PS.1. Configured commands reach the same permission authority tool calls
|
|
700
|
+
* use. Undefined only when the session has no gate at all, which is the
|
|
701
|
+
* documented SDK default; a gated session always authorizes.
|
|
702
|
+
*/
|
|
703
|
+
private _authorizeConfiguredCommand;
|
|
704
|
+
private _ensureVerificationTracker;
|
|
705
|
+
/**
|
|
706
|
+
* Run one configured verification policy now and report the resulting
|
|
707
|
+
* completion status. Unavailable when nothing is configured; the
|
|
708
|
+
* workspace observation after the run becomes the staleness baseline.
|
|
709
|
+
*/
|
|
710
|
+
requestVerification(options?: {
|
|
711
|
+
policyId?: string;
|
|
712
|
+
signal?: AbortSignal;
|
|
713
|
+
}): Promise<VerificationCompletionStatus>;
|
|
714
|
+
/**
|
|
715
|
+
* VF.5: run one configured formatter policy now and report what it
|
|
716
|
+
* actually mutated. Undefined when no formatter policy matches. Any real
|
|
717
|
+
* mutation retires a prior verification record: the workspace the
|
|
718
|
+
* verification described no longer exists.
|
|
719
|
+
*/
|
|
720
|
+
runConfiguredFormatter(options?: {
|
|
721
|
+
policyId?: string;
|
|
722
|
+
signal?: AbortSignal;
|
|
723
|
+
}): Promise<FormatterRunOutcome | undefined>;
|
|
724
|
+
/** The current completion status: verified, failed, unavailable, interrupted, or continued-unverified. */
|
|
725
|
+
verificationStatus(): VerificationCompletionStatus;
|
|
726
|
+
/** The live verification record with its bounded evidence, if any. */
|
|
727
|
+
verificationRecord(): VerificationRecord | undefined;
|
|
728
|
+
/** Record that the user chose to finish without verification. */
|
|
729
|
+
continueWithoutVerification(): void;
|
|
730
|
+
private _runVerificationTurnBoundary;
|
|
731
|
+
private _runWorkspaceComparisonBoundary;
|
|
732
|
+
private _runDefaultCompaction;
|
|
572
733
|
/**
|
|
573
734
|
* Manually compact the session context.
|
|
574
|
-
*
|
|
735
|
+
*
|
|
736
|
+
* This is the manual entry point used by `/compact`, RPC, and extensions. It is
|
|
737
|
+
* separate from automatic threshold/overflow compaction, which enters through
|
|
738
|
+
* `_checkCompaction()` and `_runAutoCompaction()`. After preparation and the
|
|
739
|
+
* `session_before_compact` hook, both paths call the lower-level `compact()`
|
|
740
|
+
* function imported from `./compaction/index.ts`, unless the hook cancels or
|
|
741
|
+
* supplies a custom result.
|
|
742
|
+
*
|
|
743
|
+
* Aborts the current agent operation first. Manual compaction never retries or
|
|
744
|
+
* continues the interrupted agent turn.
|
|
745
|
+
*
|
|
575
746
|
* @param customInstructions Optional instructions for the compaction summary
|
|
576
747
|
*/
|
|
577
748
|
compact(customInstructions?: string): Promise<CompactionResult>;
|
|
@@ -682,12 +853,9 @@ export declare class AgentSession {
|
|
|
682
853
|
customInstructions?: string;
|
|
683
854
|
replaceInstructions?: boolean;
|
|
684
855
|
label?: string;
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
aborted?: boolean;
|
|
689
|
-
summaryEntry?: BranchSummaryEntry;
|
|
690
|
-
}>;
|
|
856
|
+
workspacePolicy?: TreeWorkspacePolicy;
|
|
857
|
+
}): Promise<TreeNavigationResult>;
|
|
858
|
+
private _resolveTreeWorkspaceStep;
|
|
691
859
|
/**
|
|
692
860
|
* Get all user messages from session for fork selector.
|
|
693
861
|
*/
|