@zvada/agent-server 0.3.18 → 0.3.19
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/AGENTS.md +11 -26
- package/CHANGELOG.md +1005 -1
- package/README.md +35 -39
- package/dist/types/accounts/chatgpt.d.ts +34 -0
- package/dist/types/accounts/chatgpt.d.ts.map +1 -0
- package/dist/types/accounts/check.d.ts +24 -0
- package/dist/types/accounts/check.d.ts.map +1 -0
- package/dist/types/accounts/claude.d.ts +21 -0
- package/dist/types/accounts/claude.d.ts.map +1 -0
- package/dist/types/accounts/endpoint.d.ts +50 -0
- package/dist/types/accounts/endpoint.d.ts.map +1 -0
- package/dist/types/accounts/http.d.ts +38 -0
- package/dist/types/accounts/http.d.ts.map +1 -0
- package/dist/types/accounts/index.d.ts +6 -0
- package/dist/types/accounts/index.d.ts.map +1 -0
- package/dist/types/client/client.d.ts +272 -0
- package/dist/types/client/client.d.ts.map +1 -0
- package/dist/types/client/connection.d.ts +160 -0
- package/dist/types/client/connection.d.ts.map +1 -0
- package/dist/types/client/history.d.ts +8 -0
- package/dist/types/client/history.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +5 -0
- package/dist/types/client/index.d.ts.map +1 -0
- package/dist/types/client/listeners.d.ts +8 -0
- package/dist/types/client/listeners.d.ts.map +1 -0
- package/dist/types/client/logins.d.ts +35 -0
- package/dist/types/client/logins.d.ts.map +1 -0
- package/dist/types/client/rpc.d.ts +46 -0
- package/dist/types/client/rpc.d.ts.map +1 -0
- package/dist/types/client/streams.d.ts +150 -0
- package/dist/types/client/streams.d.ts.map +1 -0
- package/dist/types/client/transports.d.ts +35 -0
- package/dist/types/client/transports.d.ts.map +1 -0
- package/dist/types/client/turns.d.ts +81 -0
- package/dist/types/client/turns.d.ts.map +1 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts +68 -0
- package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -0
- package/dist/types/core/agents/acp/adapter.d.ts +39 -0
- package/dist/types/core/agents/acp/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/acp/client.d.ts +90 -0
- package/dist/types/core/agents/acp/client.d.ts.map +1 -0
- package/dist/types/core/agents/acp/known-agents.d.ts +35 -0
- package/dist/types/core/agents/acp/known-agents.d.ts.map +1 -0
- package/dist/types/core/agents/acp/mappings.d.ts +46 -0
- package/dist/types/core/agents/acp/mappings.d.ts.map +1 -0
- package/dist/types/core/agents/acp/requests.d.ts +26 -0
- package/dist/types/core/agents/acp/requests.d.ts.map +1 -0
- package/dist/types/core/agents/attachments.d.ts +11 -0
- package/dist/types/core/agents/attachments.d.ts.map +1 -0
- package/dist/types/core/agents/base.d.ts +227 -0
- package/dist/types/core/agents/base.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/adapter.d.ts +58 -0
- package/dist/types/core/agents/claude-code/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/approvals.d.ts +26 -0
- package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/claude-agent.d.ts +70 -0
- package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/credentials.d.ts +54 -0
- package/dist/types/core/agents/claude-code/credentials.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/events.d.ts +42 -0
- package/dist/types/core/agents/claude-code/events.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/login.d.ts +61 -0
- package/dist/types/core/agents/claude-code/login.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/mcp.d.ts +52 -0
- package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/models.d.ts +30 -0
- package/dist/types/core/agents/claude-code/models.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/options.d.ts +183 -0
- package/dist/types/core/agents/claude-code/options.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/outcome.d.ts +50 -0
- package/dist/types/core/agents/claude-code/outcome.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/session-pool.d.ts +36 -0
- package/dist/types/core/agents/claude-code/session-pool.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/session.d.ts +148 -0
- package/dist/types/core/agents/claude-code/session.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/spawn.d.ts +29 -0
- package/dist/types/core/agents/claude-code/spawn.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/spend.d.ts +58 -0
- package/dist/types/core/agents/claude-code/spend.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/tools.d.ts +4 -0
- package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/turn-usage.d.ts +52 -0
- package/dist/types/core/agents/claude-code/turn-usage.d.ts.map +1 -0
- package/dist/types/core/agents/claude-code/turn.d.ts +121 -0
- package/dist/types/core/agents/claude-code/turn.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/adapter.d.ts +59 -0
- package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/client.d.ts +116 -0
- package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +113 -0
- package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/commands.d.ts +66 -0
- package/dist/types/core/agents/codex-app-server/commands.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/credentials.d.ts +49 -0
- package/dist/types/core/agents/codex-app-server/credentials.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/effort.d.ts +12 -0
- package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/events.d.ts +45 -0
- package/dist/types/core/agents/codex-app-server/events.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/homes.d.ts +20 -0
- package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/input.d.ts +26 -0
- package/dist/types/core/agents/codex-app-server/input.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/items.d.ts +31 -0
- package/dist/types/core/agents/codex-app-server/items.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/login.d.ts +38 -0
- package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/mcp.d.ts +62 -0
- package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/models.d.ts +67 -0
- package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/options.d.ts +40 -0
- package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/plan-approval.d.ts +19 -0
- package/dist/types/core/agents/codex-app-server/plan-approval.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/protocol.d.ts +99 -0
- package/dist/types/core/agents/codex-app-server/protocol.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/requests.d.ts +42 -0
- package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/session.d.ts +96 -0
- package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/subagents.d.ts +53 -0
- package/dist/types/core/agents/codex-app-server/subagents.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts +87 -0
- package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/turn-items.d.ts +33 -0
- package/dist/types/core/agents/codex-app-server/turn-items.d.ts.map +1 -0
- package/dist/types/core/agents/codex-app-server/turn.d.ts +163 -0
- package/dist/types/core/agents/codex-app-server/turn.d.ts.map +1 -0
- package/dist/types/core/agents/config-fingerprint.d.ts +5 -0
- package/dist/types/core/agents/config-fingerprint.d.ts.map +1 -0
- package/dist/types/core/agents/credentials.d.ts +28 -0
- package/dist/types/core/agents/credentials.d.ts.map +1 -0
- package/dist/types/core/agents/elicitation.d.ts +37 -0
- package/dist/types/core/agents/elicitation.d.ts.map +1 -0
- package/dist/types/core/agents/inherit-config.d.ts +18 -0
- package/dist/types/core/agents/inherit-config.d.ts.map +1 -0
- package/dist/types/core/agents/login.d.ts +67 -0
- package/dist/types/core/agents/login.d.ts.map +1 -0
- package/dist/types/core/agents/mcp-config.d.ts +57 -0
- package/dist/types/core/agents/mcp-config.d.ts.map +1 -0
- package/dist/types/core/agents/plan.d.ts +16 -0
- package/dist/types/core/agents/plan.d.ts.map +1 -0
- package/dist/types/core/agents/registry.d.ts +30 -0
- package/dist/types/core/agents/registry.d.ts.map +1 -0
- package/dist/types/core/agents/session-agent.d.ts +48 -0
- package/dist/types/core/agents/session-agent.d.ts.map +1 -0
- package/dist/types/core/agents/session-pool.d.ts +41 -0
- package/dist/types/core/agents/session-pool.d.ts.map +1 -0
- package/dist/types/core/agents/stderr-tail.d.ts +28 -0
- package/dist/types/core/agents/stderr-tail.d.ts.map +1 -0
- package/dist/types/core/agents/thinking-levels.d.ts +4 -0
- package/dist/types/core/agents/thinking-levels.d.ts.map +1 -0
- package/dist/types/core/agents/types.d.ts +124 -0
- package/dist/types/core/agents/types.d.ts.map +1 -0
- package/dist/types/core/diagnostics.d.ts +36 -0
- package/dist/types/core/diagnostics.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +29 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/presets.d.ts +80 -0
- package/dist/types/core/presets.d.ts.map +1 -0
- package/dist/types/core/processes/identity.d.ts +31 -0
- package/dist/types/core/processes/identity.d.ts.map +1 -0
- package/dist/types/core/processes/lifeline.d.ts +47 -0
- package/dist/types/core/processes/lifeline.d.ts.map +1 -0
- package/dist/types/core/processes/native-processes.d.ts +130 -0
- package/dist/types/core/processes/native-processes.d.ts.map +1 -0
- package/dist/types/core/processes/process-table.d.ts +43 -0
- package/dist/types/core/processes/process-table.d.ts.map +1 -0
- package/dist/types/core/provision/cache-trust.d.ts +13 -0
- package/dist/types/core/provision/cache-trust.d.ts.map +1 -0
- package/dist/types/core/provision/cache-usage.d.ts +14 -0
- package/dist/types/core/provision/cache-usage.d.ts.map +1 -0
- package/dist/types/core/provision/checksums.d.ts +46 -0
- package/dist/types/core/provision/checksums.d.ts.map +1 -0
- package/dist/types/core/provision/extract.d.ts +7 -0
- package/dist/types/core/provision/extract.d.ts.map +1 -0
- package/dist/types/core/provision/index.d.ts +5 -0
- package/dist/types/core/provision/index.d.ts.map +1 -0
- package/dist/types/core/provision/install-build.d.ts +36 -0
- package/dist/types/core/provision/install-build.d.ts.map +1 -0
- package/dist/types/core/provision/npm.d.ts +40 -0
- package/dist/types/core/provision/npm.d.ts.map +1 -0
- package/dist/types/core/provision/pins.d.ts +24 -0
- package/dist/types/core/provision/pins.d.ts.map +1 -0
- package/dist/types/core/provision/platform.d.ts +28 -0
- package/dist/types/core/provision/platform.d.ts.map +1 -0
- package/dist/types/core/provision/provisioner.d.ts +189 -0
- package/dist/types/core/provision/provisioner.d.ts.map +1 -0
- package/dist/types/core/provision/releases.d.ts +8 -0
- package/dist/types/core/provision/releases.d.ts.map +1 -0
- package/dist/types/core/provision/tools.d.ts +81 -0
- package/dist/types/core/provision/tools.d.ts.map +1 -0
- package/dist/types/core/proxy/anthropic-proxy.d.ts +52 -0
- package/dist/types/core/proxy/anthropic-proxy.d.ts.map +1 -0
- package/dist/types/core/proxy/api-key-store.d.ts +37 -0
- package/dist/types/core/proxy/api-key-store.d.ts.map +1 -0
- package/dist/types/core/proxy/index.d.ts +3 -0
- package/dist/types/core/proxy/index.d.ts.map +1 -0
- package/dist/types/core/proxy/loopback.d.ts +14 -0
- package/dist/types/core/proxy/loopback.d.ts.map +1 -0
- package/dist/types/core/runtime/agent-runtime.d.ts +181 -0
- package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -0
- package/dist/types/core/runtime/event-processor.d.ts +87 -0
- package/dist/types/core/runtime/event-processor.d.ts.map +1 -0
- package/dist/types/core/runtime/event-sink.d.ts +44 -0
- package/dist/types/core/runtime/event-sink.d.ts.map +1 -0
- package/dist/types/core/runtime/harness-clis.d.ts +10 -0
- package/dist/types/core/runtime/harness-clis.d.ts.map +1 -0
- package/dist/types/core/runtime/harness-logins.d.ts +68 -0
- package/dist/types/core/runtime/harness-logins.d.ts.map +1 -0
- package/dist/types/core/runtime/login-reads.d.ts +28 -0
- package/dist/types/core/runtime/login-reads.d.ts.map +1 -0
- package/dist/types/core/runtime/model-lists.d.ts +37 -0
- package/dist/types/core/runtime/model-lists.d.ts.map +1 -0
- package/dist/types/core/runtime/permission-policy.d.ts +61 -0
- package/dist/types/core/runtime/permission-policy.d.ts.map +1 -0
- package/dist/types/core/runtime/request-broker.d.ts +49 -0
- package/dist/types/core/runtime/request-broker.d.ts.map +1 -0
- package/dist/types/core/runtime/steering.d.ts +38 -0
- package/dist/types/core/runtime/steering.d.ts.map +1 -0
- package/dist/types/core/runtime/turn-outcome.d.ts +21 -0
- package/dist/types/core/runtime/turn-outcome.d.ts.map +1 -0
- package/dist/types/core/runtime/turn.d.ts +121 -0
- package/dist/types/core/runtime/turn.d.ts.map +1 -0
- package/dist/types/core/utils/bounded.d.ts +6 -0
- package/dist/types/core/utils/bounded.d.ts.map +1 -0
- package/dist/types/core/utils/deadline.d.ts +14 -0
- package/dist/types/core/utils/deadline.d.ts.map +1 -0
- package/dist/types/core/utils/errors.d.ts +104 -0
- package/dist/types/core/utils/errors.d.ts.map +1 -0
- package/dist/types/core/utils/is-record.d.ts +3 -0
- package/dist/types/core/utils/is-record.d.ts.map +1 -0
- package/dist/types/core/utils/loopback.d.ts +6 -0
- package/dist/types/core/utils/loopback.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/protocol/account.d.ts +26 -0
- package/dist/types/protocol/account.d.ts.map +1 -0
- package/dist/types/protocol/async-queue.d.ts +21 -0
- package/dist/types/protocol/async-queue.d.ts.map +1 -0
- package/dist/types/protocol/auth.d.ts +228 -0
- package/dist/types/protocol/auth.d.ts.map +1 -0
- package/dist/types/protocol/canonical.d.ts +9 -0
- package/dist/types/protocol/canonical.d.ts.map +1 -0
- package/dist/types/protocol/clis.d.ts +74 -0
- package/dist/types/protocol/clis.d.ts.map +1 -0
- package/dist/types/protocol/config.d.ts +200 -0
- package/dist/types/protocol/config.d.ts.map +1 -0
- package/dist/types/protocol/conversation.d.ts +942 -0
- package/dist/types/protocol/conversation.d.ts.map +1 -0
- package/dist/types/protocol/credentials.d.ts +145 -0
- package/dist/types/protocol/credentials.d.ts.map +1 -0
- package/dist/types/protocol/errors.d.ts +36 -0
- package/dist/types/protocol/errors.d.ts.map +1 -0
- package/dist/types/protocol/execution.d.ts +28 -0
- package/dist/types/protocol/execution.d.ts.map +1 -0
- package/dist/types/protocol/factories.d.ts +94 -0
- package/dist/types/protocol/factories.d.ts.map +1 -0
- package/dist/types/protocol/guards.d.ts +55 -0
- package/dist/types/protocol/guards.d.ts.map +1 -0
- package/dist/types/protocol/harness.d.ts +70 -0
- package/dist/types/protocol/harness.d.ts.map +1 -0
- package/dist/types/protocol/history.d.ts +318 -0
- package/dist/types/protocol/history.d.ts.map +1 -0
- package/dist/types/protocol/ids.d.ts +9 -0
- package/dist/types/protocol/ids.d.ts.map +1 -0
- package/dist/types/protocol/index.d.ts +35 -0
- package/dist/types/protocol/index.d.ts.map +1 -0
- package/dist/types/protocol/lifecycle.d.ts +1190 -0
- package/dist/types/protocol/lifecycle.d.ts.map +1 -0
- package/dist/types/protocol/meta-keys.d.ts +17 -0
- package/dist/types/protocol/meta-keys.d.ts.map +1 -0
- package/dist/types/protocol/meta.d.ts +13 -0
- package/dist/types/protocol/meta.d.ts.map +1 -0
- package/dist/types/protocol/model-catalog.d.ts +11 -0
- package/dist/types/protocol/model-catalog.d.ts.map +1 -0
- package/dist/types/protocol/models.d.ts +107 -0
- package/dist/types/protocol/models.d.ts.map +1 -0
- package/dist/types/protocol/part-input.d.ts +101 -0
- package/dist/types/protocol/part-input.d.ts.map +1 -0
- package/dist/types/protocol/parts.d.ts +357 -0
- package/dist/types/protocol/parts.d.ts.map +1 -0
- package/dist/types/protocol/reduce.d.ts +26 -0
- package/dist/types/protocol/reduce.d.ts.map +1 -0
- package/dist/types/protocol/selectors.d.ts +64 -0
- package/dist/types/protocol/selectors.d.ts.map +1 -0
- package/dist/types/protocol/seq-cursor.d.ts +66 -0
- package/dist/types/protocol/seq-cursor.d.ts.map +1 -0
- package/dist/types/protocol/stop-reasons.d.ts +33 -0
- package/dist/types/protocol/stop-reasons.d.ts.map +1 -0
- package/dist/types/protocol/thinking.d.ts +28 -0
- package/dist/types/protocol/thinking.d.ts.map +1 -0
- package/dist/types/protocol/time.d.ts +21 -0
- package/dist/types/protocol/time.d.ts.map +1 -0
- package/dist/types/protocol/tokens.d.ts +29 -0
- package/dist/types/protocol/tokens.d.ts.map +1 -0
- package/dist/types/protocol/tool-closure.d.ts +25 -0
- package/dist/types/protocol/tool-closure.d.ts.map +1 -0
- package/dist/types/protocol/tool-state.d.ts +209 -0
- package/dist/types/protocol/tool-state.d.ts.map +1 -0
- package/dist/types/protocol/verify.d.ts +52 -0
- package/dist/types/protocol/verify.d.ts.map +1 -0
- package/dist/types/protocol/vocabulary.d.ts +19 -0
- package/dist/types/protocol/vocabulary.d.ts.map +1 -0
- package/dist/types/protocol/wire-api.d.ts +1983 -0
- package/dist/types/protocol/wire-api.d.ts.map +1 -0
- package/dist/types/protocol/wire.d.ts +1758 -0
- package/dist/types/protocol/wire.d.ts.map +1 -0
- package/dist/types/server/acp/binding.d.ts +33 -0
- package/dist/types/server/acp/binding.d.ts.map +1 -0
- package/dist/types/server/acp/session-records.d.ts +17 -0
- package/dist/types/server/acp/session-records.d.ts.map +1 -0
- package/dist/types/server/acp/translate.d.ts +48 -0
- package/dist/types/server/acp/translate.d.ts.map +1 -0
- package/dist/types/server/agent-server.d.ts +121 -0
- package/dist/types/server/agent-server.d.ts.map +1 -0
- package/dist/types/server/feedback.d.ts +37 -0
- package/dist/types/server/feedback.d.ts.map +1 -0
- package/dist/types/server/history.d.ts +15 -0
- package/dist/types/server/history.d.ts.map +1 -0
- package/dist/types/server/index.d.ts +7 -0
- package/dist/types/server/index.d.ts.map +1 -0
- package/dist/types/server/install.d.ts +42 -0
- package/dist/types/server/install.d.ts.map +1 -0
- package/dist/types/server/open-parts.d.ts +27 -0
- package/dist/types/server/open-parts.d.ts.map +1 -0
- package/dist/types/server/routes.d.ts +61 -0
- package/dist/types/server/routes.d.ts.map +1 -0
- package/dist/types/server/secrets.d.ts +11 -0
- package/dist/types/server/secrets.d.ts.map +1 -0
- package/dist/types/server/session-gate.d.ts +32 -0
- package/dist/types/server/session-gate.d.ts.map +1 -0
- package/dist/types/server/session-log.d.ts +39 -0
- package/dist/types/server/session-log.d.ts.map +1 -0
- package/dist/types/server/session-store.d.ts +119 -0
- package/dist/types/server/session-store.d.ts.map +1 -0
- package/dist/types/server/subscriptions.d.ts +74 -0
- package/dist/types/server/subscriptions.d.ts.map +1 -0
- package/dist/types/server/transports.d.ts +74 -0
- package/dist/types/server/transports.d.ts.map +1 -0
- package/dist/types/server/wire-error.d.ts +9 -0
- package/dist/types/server/wire-error.d.ts.map +1 -0
- package/dist/types/sync/event-log.d.ts +45 -0
- package/dist/types/sync/event-log.d.ts.map +1 -0
- package/dist/types/sync/fit.d.ts +40 -0
- package/dist/types/sync/fit.d.ts.map +1 -0
- package/dist/types/sync/history-reader.d.ts +8 -0
- package/dist/types/sync/history-reader.d.ts.map +1 -0
- package/dist/types/sync/history-sqlite.d.ts +37 -0
- package/dist/types/sync/history-sqlite.d.ts.map +1 -0
- package/dist/types/sync/history.d.ts +70 -0
- package/dist/types/sync/history.d.ts.map +1 -0
- package/dist/types/sync/index.d.ts +4 -0
- package/dist/types/sync/index.d.ts.map +1 -0
- package/dist/types/sync/journal-sqlite.d.ts +51 -0
- package/dist/types/sync/journal-sqlite.d.ts.map +1 -0
- package/dist/types/sync/journal.d.ts +107 -0
- package/dist/types/sync/journal.d.ts.map +1 -0
- package/dist/types/sync/live-tails.d.ts +30 -0
- package/dist/types/sync/live-tails.d.ts.map +1 -0
- package/dist/types/sync/node-sqlite.d.ts +7 -0
- package/dist/types/sync/node-sqlite.d.ts.map +1 -0
- package/dist/types/sync/projection.d.ts +10 -0
- package/dist/types/sync/projection.d.ts.map +1 -0
- package/dist/types/sync/recovery.d.ts +25 -0
- package/dist/types/sync/recovery.d.ts.map +1 -0
- package/dist/types/sync/retry.d.ts +25 -0
- package/dist/types/sync/retry.d.ts.map +1 -0
- package/dist/types/sync/schema.d.ts +4 -0
- package/dist/types/sync/schema.d.ts.map +1 -0
- package/dist/types/sync/sql.d.ts +38 -0
- package/dist/types/sync/sql.d.ts.map +1 -0
- package/dist/types/sync/sqlite-file.d.ts +9 -0
- package/dist/types/sync/sqlite-file.d.ts.map +1 -0
- package/dist/types/sync/sqlite.d.ts +6 -0
- package/dist/types/sync/sqlite.d.ts.map +1 -0
- package/dist/types/sync/worker.d.ts +63 -0
- package/dist/types/sync/worker.d.ts.map +1 -0
- package/docs/consuming.md +452 -53
- package/docs/deploy.md +218 -47
- package/docs/{sync-experiment.md → durable-sessions.md} +77 -72
- package/docs/feedback.md +116 -0
- package/docs/harnesses.md +212 -88
- package/docs/sync-history.md +29 -13
- package/docs/sync-integration.md +52 -66
- package/package.json +43 -25
- package/src/accounts/chatgpt.ts +194 -0
- package/src/accounts/check.ts +112 -0
- package/src/accounts/claude.ts +111 -0
- package/src/accounts/endpoint.ts +151 -0
- package/src/accounts/http.ts +97 -0
- package/src/accounts/index.ts +19 -0
- package/src/client/client.ts +604 -670
- package/src/client/connection.ts +371 -0
- package/src/client/history.ts +29 -52
- package/src/client/index.ts +11 -2
- package/src/client/listeners.ts +20 -0
- package/src/client/logins.ts +105 -0
- package/src/client/rpc.ts +144 -0
- package/src/client/streams.ts +488 -0
- package/src/client/transports.ts +62 -8
- package/src/client/turns.ts +171 -0
- package/src/core/agents/acp/acp-agent.ts +94 -118
- package/src/core/agents/acp/adapter.ts +20 -9
- package/src/core/agents/acp/client.ts +125 -47
- package/src/core/agents/acp/known-agents.ts +36 -4
- package/src/core/agents/acp/mappings.ts +64 -18
- package/src/core/agents/acp/requests.ts +125 -0
- package/src/core/agents/attachments.ts +18 -0
- package/src/core/agents/base.ts +120 -42
- package/src/core/agents/claude-code/adapter.ts +177 -238
- package/src/core/agents/claude-code/approvals.ts +270 -0
- package/src/core/agents/claude-code/claude-agent.ts +175 -158
- package/src/core/agents/claude-code/credentials.ts +171 -0
- package/src/core/agents/claude-code/events.ts +55 -0
- package/src/core/agents/claude-code/login.ts +269 -0
- package/src/core/agents/claude-code/mcp.ts +206 -0
- package/src/core/agents/claude-code/models.ts +15 -9
- package/src/core/agents/claude-code/options.ts +326 -39
- package/src/core/agents/claude-code/outcome.ts +209 -0
- package/src/core/agents/claude-code/session-pool.ts +136 -0
- package/src/core/agents/claude-code/session.ts +513 -0
- package/src/core/agents/claude-code/spawn.ts +144 -0
- package/src/core/agents/claude-code/spend.ts +160 -0
- package/src/core/agents/claude-code/tools.ts +47 -0
- package/src/core/agents/claude-code/turn-usage.ts +135 -0
- package/src/core/agents/claude-code/turn.ts +232 -0
- package/src/core/agents/codex-app-server/adapter.ts +314 -117
- package/src/core/agents/codex-app-server/client.ts +186 -84
- package/src/core/agents/codex-app-server/codex-agent.ts +343 -0
- package/src/core/agents/codex-app-server/commands.ts +228 -0
- package/src/core/agents/codex-app-server/credentials.ts +126 -0
- package/src/core/agents/codex-app-server/effort.ts +29 -0
- package/src/core/agents/codex-app-server/events.ts +47 -0
- package/src/core/agents/codex-app-server/homes.ts +64 -0
- package/src/core/agents/codex-app-server/input.ts +60 -0
- package/src/core/agents/codex-app-server/items.ts +149 -0
- package/src/core/agents/codex-app-server/login.ts +180 -0
- package/src/core/agents/codex-app-server/mcp.ts +182 -37
- package/src/core/agents/codex-app-server/models.ts +99 -46
- package/src/core/agents/codex-app-server/options.ts +146 -0
- package/src/core/agents/codex-app-server/plan-approval.ts +135 -0
- package/src/core/agents/codex-app-server/protocol.ts +117 -0
- package/src/core/agents/codex-app-server/requests.ts +332 -0
- package/src/core/agents/codex-app-server/session.ts +285 -0
- package/src/core/agents/codex-app-server/subagents.ts +108 -42
- package/src/core/agents/codex-app-server/thread-settings.ts +279 -0
- package/src/core/agents/codex-app-server/turn-items.ts +88 -0
- package/src/core/agents/codex-app-server/turn.ts +463 -0
- package/src/core/agents/config-fingerprint.ts +7 -14
- package/src/core/agents/credentials.ts +98 -0
- package/src/core/agents/elicitation.ts +75 -0
- package/src/core/agents/inherit-config.ts +21 -0
- package/src/core/agents/login.ts +116 -0
- package/src/core/agents/mcp-config.ts +112 -8
- package/src/core/agents/plan.ts +25 -0
- package/src/core/agents/registry.ts +21 -4
- package/src/core/agents/session-agent.ts +96 -4
- package/src/core/agents/{session-store.ts → session-pool.ts} +11 -5
- package/src/core/agents/stderr-tail.ts +75 -0
- package/src/core/agents/types.ts +40 -5
- package/src/core/index.ts +58 -48
- package/src/core/presets.ts +100 -39
- package/src/core/processes/identity.ts +113 -0
- package/src/core/processes/lifeline.ts +170 -0
- package/src/core/processes/native-processes.ts +379 -0
- package/src/core/processes/process-table.ts +174 -0
- package/src/core/provision/cache-trust.ts +121 -0
- package/src/core/provision/cache-usage.ts +69 -0
- package/src/core/provision/checksums.ts +64 -0
- package/src/core/provision/extract.ts +11 -2
- package/src/core/provision/index.ts +4 -1
- package/src/core/provision/install-build.ts +136 -0
- package/src/core/provision/npm.ts +112 -17
- package/src/core/provision/pins.ts +9 -33
- package/src/core/provision/platform.ts +12 -1
- package/src/core/provision/provisioner.ts +329 -397
- package/src/core/provision/releases.ts +86 -0
- package/src/core/provision/tools.ts +329 -0
- package/src/core/proxy/anthropic-proxy.ts +55 -25
- package/src/core/proxy/api-key-store.ts +2 -12
- package/src/core/proxy/loopback.ts +106 -0
- package/src/core/runtime/agent-runtime.ts +327 -498
- package/src/core/runtime/event-processor.ts +197 -70
- package/src/core/runtime/harness-clis.ts +61 -0
- package/src/core/runtime/harness-logins.ts +328 -0
- package/src/core/runtime/login-reads.ts +78 -0
- package/src/core/runtime/model-lists.ts +33 -48
- package/src/core/runtime/permission-policy.ts +113 -0
- package/src/core/runtime/request-broker.ts +204 -0
- package/src/core/runtime/steering.ts +112 -0
- package/src/core/runtime/turn-outcome.ts +30 -0
- package/src/core/runtime/turn.ts +360 -0
- package/src/core/utils/bounded.ts +12 -0
- package/src/core/utils/deadline.ts +38 -0
- package/src/core/utils/errors.ts +113 -21
- package/src/core/utils/is-record.ts +4 -0
- package/src/core/utils/loopback.ts +10 -0
- package/src/protocol/account.ts +104 -0
- package/src/protocol/auth.ts +199 -0
- package/src/protocol/canonical.ts +16 -0
- package/src/protocol/clis.ts +69 -0
- package/src/protocol/config.ts +60 -6
- package/src/protocol/conversation.ts +272 -0
- package/src/protocol/credentials.ts +145 -0
- package/src/protocol/errors.ts +78 -20
- package/src/protocol/execution.ts +5 -2
- package/src/protocol/factories.ts +55 -7
- package/src/protocol/guards.ts +55 -2
- package/src/protocol/harness.ts +56 -6
- package/src/protocol/history.ts +72 -64
- package/src/protocol/ids.ts +0 -12
- package/src/protocol/index.ts +9 -0
- package/src/protocol/lifecycle.ts +250 -79
- package/src/protocol/meta-keys.ts +17 -0
- package/src/protocol/meta.ts +3 -3
- package/src/protocol/models.ts +2 -43
- package/src/protocol/part-input.ts +2 -1
- package/src/protocol/parts.ts +12 -3
- package/src/protocol/reduce.ts +302 -413
- package/src/protocol/selectors.ts +1 -20
- package/src/protocol/seq-cursor.ts +14 -0
- package/src/protocol/stop-reasons.ts +1 -1
- package/src/protocol/thinking.ts +1 -30
- package/src/protocol/time.ts +2 -2
- package/src/protocol/tool-closure.ts +93 -0
- package/src/protocol/tool-state.ts +19 -4
- package/src/protocol/verify.ts +222 -92
- package/src/protocol/vocabulary.ts +21 -5
- package/src/protocol/wire-api.ts +232 -0
- package/src/protocol/wire.ts +351 -64
- package/src/server/acp/binding.ts +63 -103
- package/src/server/acp/session-records.ts +53 -0
- package/src/server/acp/translate.ts +129 -20
- package/src/server/agent-server.ts +223 -387
- package/src/server/bin.ts +280 -78
- package/src/server/feedback.ts +204 -14
- package/src/server/history.ts +116 -122
- package/src/server/index.ts +3 -8
- package/src/server/install.ts +107 -8
- package/src/server/open-parts.ts +95 -0
- package/src/server/routes.ts +391 -0
- package/src/server/secrets.ts +24 -0
- package/src/server/session-gate.ts +69 -0
- package/src/server/session-log.ts +14 -2
- package/src/server/session-store.ts +136 -72
- package/src/server/subscriptions.ts +232 -0
- package/src/server/transports.ts +125 -25
- package/src/server/wire-error.ts +31 -45
- package/src/sync/event-log.ts +31 -3
- package/src/sync/fit.ts +27 -11
- package/src/sync/history-reader.ts +10 -5
- package/src/sync/history-sqlite.ts +37 -42
- package/src/sync/history.ts +9 -15
- package/src/sync/index.ts +17 -5
- package/src/sync/journal-sqlite.ts +162 -76
- package/src/sync/journal.ts +91 -32
- package/src/sync/live-tails.ts +107 -0
- package/src/sync/projection.ts +35 -0
- package/src/sync/recovery.ts +80 -51
- package/src/sync/schema.ts +27 -6
- package/docs/rfds/0001-deterministic-echo-ids.md +0 -44
- package/docs/rfds/0002-native-subagents.md +0 -197
- package/src/client/request.ts +0 -19
- package/src/core/agents/claude-code/generator-session.ts +0 -572
- package/src/core/agents/claude-code/session-manager.ts +0 -166
- package/src/core/agents/codex-app-server/codex-app-server-agent.ts +0 -962
- package/src/core/agents/codex-items.ts +0 -149
- package/src/core/agents/codex-sdk/adapter.ts +0 -237
- package/src/core/agents/codex-sdk/codex-sdk-agent.ts +0 -330
- package/src/core/agents/tool-meta.ts +0 -68
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { ErrorCategory, LimitStatus, LimitWindow, Part, PermissionMode, StopReason, TokenUsage } from "../../protocol/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The normalized intermediate an adapter emits while consuming raw harness
|
|
4
|
+
* events. The engine's EventProcessor turns these into wire `LifecycleEvent`s,
|
|
5
|
+
* assigning message/part indices and ids. Keeping deltas here (rather than
|
|
6
|
+
* diffing snapshots downstream) lets each adapter express its harness's exact
|
|
7
|
+
* streaming granularity — token-level for Claude and Codex app-server,
|
|
8
|
+
* chunk-level for ACP agents.
|
|
9
|
+
*/
|
|
10
|
+
export type AdapterEvent =
|
|
11
|
+
/** `model`: the model that produced the message, when the harness names it per message. */
|
|
12
|
+
{
|
|
13
|
+
kind: "message-start";
|
|
14
|
+
role: "assistant" | "user";
|
|
15
|
+
model?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The model that writes what follows, until another says otherwise: a
|
|
19
|
+
* sub-agent's messages when `parentToolCallId` is set, else the turn's (a
|
|
20
|
+
* Codex reroute). A message's own named model wins.
|
|
21
|
+
*/
|
|
22
|
+
| {
|
|
23
|
+
kind: "model";
|
|
24
|
+
model: string;
|
|
25
|
+
parentToolCallId?: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "message-end";
|
|
28
|
+
}
|
|
29
|
+
/** A new part appears (streaming text begins, a tool call opens, etc.). */
|
|
30
|
+
| {
|
|
31
|
+
kind: "part-open";
|
|
32
|
+
part: Part;
|
|
33
|
+
}
|
|
34
|
+
/** A full new snapshot of an existing part (tool -> running/completed, text finalized). */
|
|
35
|
+
| {
|
|
36
|
+
kind: "part-update";
|
|
37
|
+
part: Part;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "text-delta";
|
|
40
|
+
partId: string;
|
|
41
|
+
text: string;
|
|
42
|
+
} | {
|
|
43
|
+
kind: "reasoning-delta";
|
|
44
|
+
partId: string;
|
|
45
|
+
text: string;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "tool-input-delta";
|
|
48
|
+
partId: string;
|
|
49
|
+
toolCallId: string;
|
|
50
|
+
toolName: string;
|
|
51
|
+
input: string;
|
|
52
|
+
}
|
|
53
|
+
/** Context-window gauge snapshot (→ `session.usage`). */
|
|
54
|
+
| {
|
|
55
|
+
kind: "usage";
|
|
56
|
+
used: number;
|
|
57
|
+
size?: number;
|
|
58
|
+
cost?: number;
|
|
59
|
+
}
|
|
60
|
+
/** History-compaction boundary (→ the `session.compaction` entity). */
|
|
61
|
+
| {
|
|
62
|
+
kind: "compacted";
|
|
63
|
+
trigger?: string;
|
|
64
|
+
preTokens?: number;
|
|
65
|
+
postTokens?: number;
|
|
66
|
+
}
|
|
67
|
+
/** The account's plan usage (→ `session.limits`). */
|
|
68
|
+
| {
|
|
69
|
+
kind: "limits";
|
|
70
|
+
windows: LimitWindow[];
|
|
71
|
+
status?: LimitStatus;
|
|
72
|
+
planType?: string;
|
|
73
|
+
}
|
|
74
|
+
/** The agent switched the session's permission mode (→ `session.mode` when it changed). */
|
|
75
|
+
| {
|
|
76
|
+
kind: "mode";
|
|
77
|
+
permissionMode: PermissionMode;
|
|
78
|
+
}
|
|
79
|
+
/** The harness is retrying a failed request; the turn goes on (→ a recoverable `error`). */
|
|
80
|
+
| {
|
|
81
|
+
kind: "retry";
|
|
82
|
+
category: ErrorCategory;
|
|
83
|
+
message: string;
|
|
84
|
+
attempt?: number;
|
|
85
|
+
maxAttempts?: number;
|
|
86
|
+
delayMs?: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The agent read a steer here, at its next step (→ the steer's user
|
|
90
|
+
* message). An id the turn did not accept is ignored.
|
|
91
|
+
*/
|
|
92
|
+
| {
|
|
93
|
+
kind: "steer-inserted";
|
|
94
|
+
steerId: string;
|
|
95
|
+
};
|
|
96
|
+
/** Terminal result of a turn, surfaced on `turn.ended`. */
|
|
97
|
+
export interface TransformResult {
|
|
98
|
+
/** This turn's usage. Absent when the harness cannot tell it apart from earlier turns. */
|
|
99
|
+
usage?: TokenUsage;
|
|
100
|
+
/** Models observed on the primary run, excluding subagents and configured defaults. */
|
|
101
|
+
reportedModels?: string[];
|
|
102
|
+
/** Normalized terminal status, when the harness reported one. The engine
|
|
103
|
+
* overrides with `cancelled`/`error` based on what it observed. */
|
|
104
|
+
stopReason?: StopReason;
|
|
105
|
+
/** Raw provider finish string, passed through untouched. */
|
|
106
|
+
finishReason?: string;
|
|
107
|
+
cost?: number;
|
|
108
|
+
error?: string;
|
|
109
|
+
/** The harness's own classification of `error`, from a typed code (beats matching its text). */
|
|
110
|
+
errorCategory?: ErrorCategory;
|
|
111
|
+
cancelled?: boolean;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Per-turn stateful translator from one harness's raw events to AdapterEvents.
|
|
115
|
+
* Created fresh per turn (it holds streaming part state).
|
|
116
|
+
*/
|
|
117
|
+
export interface EventTransformer<TEvent = unknown> {
|
|
118
|
+
process(event: TEvent): AdapterEvent[];
|
|
119
|
+
finish(): TransformResult;
|
|
120
|
+
}
|
|
121
|
+
export type AdapterFactory = (ctx: {
|
|
122
|
+
sessionId: string;
|
|
123
|
+
}) => EventTransformer;
|
|
124
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/agents/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The engine's diagnostics port: operational signals the engine used to
|
|
3
|
+
* swallow (best-effort paths that must not fail a turn) surfaced to the host
|
|
4
|
+
* instead. Products log/metric these; the engine never does its own logging.
|
|
5
|
+
* Handler errors are always swallowed — a diagnostics sink must never be able
|
|
6
|
+
* to break a turn.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Known diagnostic kinds (open set — new kinds may appear in minor versions;
|
|
10
|
+
* the `(string & {})` arm keeps the union open without losing autocomplete):
|
|
11
|
+
* - `interruptTimeout` — a cancel's SDK interrupt round-trip timed out
|
|
12
|
+
* (the turn was reported `confirmed: false`; the agent may still run).
|
|
13
|
+
* - `sinkError` — an EventSink emit threw; the event was dropped for that
|
|
14
|
+
* sink and the turn continued.
|
|
15
|
+
* - `proxyUpstreamAuth` — the BYOK proxy's upstream rejected the real key
|
|
16
|
+
* (401/403): the stored key is invalid/expired, not the placeholder.
|
|
17
|
+
*/
|
|
18
|
+
export type DiagnosticKind = "interruptTimeout" | "sinkError" | "proxyUpstreamAuth" | (string & {});
|
|
19
|
+
export interface EngineDiagnostic {
|
|
20
|
+
type: DiagnosticKind;
|
|
21
|
+
sessionId?: string;
|
|
22
|
+
message: string;
|
|
23
|
+
detail?: unknown;
|
|
24
|
+
timestamp: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Declared `=> void` so any callback shape is assignable (TS's void-return
|
|
28
|
+
* exemption covers `() => diagnostics.push(d)` AND async handlers); a
|
|
29
|
+
* returned promise is still detected at runtime and its rejection swallowed.
|
|
30
|
+
*/
|
|
31
|
+
export type DiagnosticHandler = (diagnostic: EngineDiagnostic) => void;
|
|
32
|
+
/** Invoke a handler without letting it break the calling path — sync throws
|
|
33
|
+
* AND async rejections are swallowed (the diagnostics sink owns its own
|
|
34
|
+
* reliability). Stamps the timestamp so call sites don't repeat it. */
|
|
35
|
+
export declare function emitDiagnostic(handler: DiagnosticHandler | undefined, diagnostic: Omit<EngineDiagnostic, "timestamp">): void;
|
|
36
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/core/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,WAAW,GAAG,mBAAmB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEpG,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEvE;;uEAEuE;AACvE,wBAAgB,cAAc,CAC7B,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,UAAU,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,GAC7C,IAAI,CAUN"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { AgentRuntime, type TurnAdmission } from "./runtime/agent-runtime.ts";
|
|
2
|
+
export type { RunSummary } from "./runtime/turn.ts";
|
|
3
|
+
export type { DiagnosticHandler, EngineDiagnostic } from "./diagnostics.ts";
|
|
4
|
+
export { type EventSink, EventSinkError, callbackSink, CollectingSink, serialSink, teeSink, } from "./runtime/event-sink.ts";
|
|
5
|
+
export { type Agent, type AgentExecuteOptions, type AppliedExecution, type CancelResult, type ChosenOption, type ElicitationRequest, type ElicitationRequestHandler, type ListModelsOptions, type PermissionDecision, type PermissionRequestHandler, type RawAgentEvent, type SteerOutcome, type SteerRequest, BaseAgent, } from "./agents/base.ts";
|
|
6
|
+
export { AgentRegistry } from "./agents/registry.ts";
|
|
7
|
+
export { type CredentialSource, credentialsFromUrl } from "./agents/credentials.ts";
|
|
8
|
+
export type { LoginOptions, LoginStatus, CliLogin, NativeLogin, } from "./agents/login.ts";
|
|
9
|
+
export { INHERIT_CONFIGS, type InheritConfig, isInheritConfig, } from "./agents/inherit-config.ts";
|
|
10
|
+
export { DEFAULT_GRACE_MS, NativeProcess, NativeProcesses, type NativeExit, type NativeProcessEvent, type NativeProcessOptions, type NativeSpawn, type OrphanOutcome, } from "./processes/native-processes.ts";
|
|
11
|
+
export type { NativeRecord } from "./processes/identity.ts";
|
|
12
|
+
export { PLAN_OPTIONS, PLAN_TITLE, approvedPlanMode } from "./agents/plan.ts";
|
|
13
|
+
export type { AdapterEvent, AdapterFactory, EventTransformer, TransformResult, } from "./agents/types.ts";
|
|
14
|
+
export { CLI_TOOLS, type CliProgress, type CliStatus, type CliTool, CliProvisioner, DEFAULT_PINS, type PlatformInfo, type ProvisionMode, type ProvisionOptions, type ResolvedCli, toolForHarness, } from "./provision/index.ts";
|
|
15
|
+
export { ClaudeCodeAgent } from "./agents/claude-code/claude-agent.ts";
|
|
16
|
+
export type { ClaudeCodeAgentOptions, ClaudeHooksFactory, ClaudeSdkOptionOverrides, ClaudeSessionEndReason, ClaudeSessionExtras, ClaudeToolPolicy, SdkMcpServers, } from "./agents/claude-code/options.ts";
|
|
17
|
+
export { createClaudeCodeTransformer } from "./agents/claude-code/adapter.ts";
|
|
18
|
+
export { CodexAppServerAgent, type CodexAppServerAgentOptions, } from "./agents/codex-app-server/codex-agent.ts";
|
|
19
|
+
export { createCodexAppServerTransformer } from "./agents/codex-app-server/adapter.ts";
|
|
20
|
+
export type { CodexConnection } from "./agents/codex-app-server/client.ts";
|
|
21
|
+
export type { CodexNotification } from "./agents/codex-app-server/protocol.ts";
|
|
22
|
+
export { AcpAgent, type AcpAgentOptions, } from "./agents/acp/acp-agent.ts";
|
|
23
|
+
export { createAcpTransformer } from "./agents/acp/adapter.ts";
|
|
24
|
+
export type { AcpClientOptions, AcpLaunch } from "./agents/acp/client.ts";
|
|
25
|
+
export { KNOWN_ACP_AGENTS, resolveAcpLaunch, resolveHarnessName, } from "./agents/acp/known-agents.ts";
|
|
26
|
+
export { type CreateRegistryOptions, createAgentRegistry, createAgentRuntime, } from "./presets.ts";
|
|
27
|
+
export { AgentServerError, McpUnavailableError, SessionResumeError, CliNotFoundError, CliProvisionError, HarnessNotAvailableError, InvalidRequestError, TurnConflictError, UnknownLoginError, TurnActiveError, UnsupportedAttachmentError, } from "./utils/errors.ts";
|
|
28
|
+
export * from "../protocol/index.ts";
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type AgentHarness } from "../protocol/index.ts";
|
|
2
|
+
import { type AcpAgentOptions } from "./agents/acp/acp-agent.ts";
|
|
3
|
+
import type { ClaudeCodeAgentOptions } from "./agents/claude-code/options.ts";
|
|
4
|
+
import { type CodexAppServerAgentOptions } from "./agents/codex-app-server/codex-agent.ts";
|
|
5
|
+
import type { CredentialSource } from "./agents/credentials.ts";
|
|
6
|
+
import type { InheritConfig } from "./agents/inherit-config.ts";
|
|
7
|
+
import { AgentRegistry } from "./agents/registry.ts";
|
|
8
|
+
import type { DiagnosticHandler } from "./diagnostics.ts";
|
|
9
|
+
import { type NativeProcessOptions } from "./processes/native-processes.ts";
|
|
10
|
+
import { type ProvisionOptions } from "./provision/provisioner.ts";
|
|
11
|
+
import { AgentRuntime } from "./runtime/agent-runtime.ts";
|
|
12
|
+
export interface CreateRegistryOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Which harnesses to register. Defaults to `claude-code` and
|
|
15
|
+
* `codex-app-server`, plus `acp` when `acp` config is provided (it has no
|
|
16
|
+
* default launch).
|
|
17
|
+
*/
|
|
18
|
+
harnesses?: AgentHarness[];
|
|
19
|
+
/**
|
|
20
|
+
* CLI provisioning policy — how the native `claude`/`codex` binaries are
|
|
21
|
+
* found or downloaded (see `CliProvisioner`). Defaults to `auto`.
|
|
22
|
+
*/
|
|
23
|
+
provision?: ProvisionOptions;
|
|
24
|
+
/**
|
|
25
|
+
* ACP harness configuration. Required to enable `acp`: the harness needs an
|
|
26
|
+
* operator-supplied launch command for the target agent (never wire-driven).
|
|
27
|
+
*/
|
|
28
|
+
acp?: Omit<AcpAgentOptions, "processes">;
|
|
29
|
+
/**
|
|
30
|
+
* Claude harness embed-tier options (e.g. in-process `sdkMcpServers`).
|
|
31
|
+
* `resolveCliPath` stays provisioner-wired here.
|
|
32
|
+
*/
|
|
33
|
+
claudeCode?: Omit<ClaudeCodeAgentOptions, "resolveCliPath" | "processes" | "inheritConfig">;
|
|
34
|
+
/**
|
|
35
|
+
* Credentials the product holds (LLP 0012), asked before each turn of
|
|
36
|
+
* every harness that takes them, and again with a token the harness
|
|
37
|
+
* refused: Claude Code runs on them through the engine's own proxy, Codex
|
|
38
|
+
* holds them in memory. `undefined` from it runs a turn on the CLI's own
|
|
39
|
+
* login. `credentialsFromUrl` asks a product's credential endpoint. A
|
|
40
|
+
* harness's own `credentials` win.
|
|
41
|
+
* Operator-level only.
|
|
42
|
+
*/
|
|
43
|
+
credentials?: CredentialSource;
|
|
44
|
+
/** Codex embed-tier authentication and process options; CLI resolution stays provisioner-owned. */
|
|
45
|
+
codexAppServer?: Omit<CodexAppServerAgentOptions, "resolveCliPath" | "processes" | "inheritConfig">;
|
|
46
|
+
/**
|
|
47
|
+
* What ambient configuration a turn loads by itself when it starts
|
|
48
|
+
* (LLP 0001, D17): `all` (the default) the host user's and the
|
|
49
|
+
* repository's settings, MCP servers, hooks and memory; `project` the
|
|
50
|
+
* repository's only; `none` neither. It never changes where the agent may
|
|
51
|
+
* read or run: the permission mode, the sandbox and the product's policy
|
|
52
|
+
* decide that. At `project` and `none` a Codex turn must name a
|
|
53
|
+
* `CODEX_HOME` of its session's own. An ACP agent loads what its launch
|
|
54
|
+
* command says. `all` and `project` load the repository's configuration,
|
|
55
|
+
* which can run code as this user: give a repository you do not trust
|
|
56
|
+
* `none`. Operator-level only.
|
|
57
|
+
*/
|
|
58
|
+
inheritConfig?: InheritConfig;
|
|
59
|
+
/**
|
|
60
|
+
* Operational diagnostics port (see `EngineDiagnostic`): interrupt
|
|
61
|
+
* timeouts and sink failures — signals the engine must not
|
|
62
|
+
* fail a turn over, surfaced for the host to log/metric. Applied to the
|
|
63
|
+
* runtime and every harness that emits them; a harness-level
|
|
64
|
+
* `claudeCode.onDiagnostic` overrides for that harness.
|
|
65
|
+
*/
|
|
66
|
+
onDiagnostic?: DiagnosticHandler;
|
|
67
|
+
/**
|
|
68
|
+
* How the native CLIs the harnesses start are owned: each in a process
|
|
69
|
+
* group of its own, held by this OS process's lifeline (`lifeline: false`
|
|
70
|
+
* opts out), stopped with its tool sessions (`graceMs` between SIGTERM and
|
|
71
|
+
* SIGKILL), and recorded (`onRecord`) for a host that sweeps them at its
|
|
72
|
+
* next start (`runtime.stopOrphans`). Operator-level only.
|
|
73
|
+
*/
|
|
74
|
+
nativeProcesses?: NativeProcessOptions;
|
|
75
|
+
}
|
|
76
|
+
/** Build a registry with the standard harnesses wired to their adapters. */
|
|
77
|
+
export declare function createAgentRegistry(opts?: CreateRegistryOptions): AgentRegistry;
|
|
78
|
+
/** Convenience: a ready-to-use runtime with the standard harnesses. */
|
|
79
|
+
export declare function createAgentRuntime(opts?: CreateRegistryOptions): AgentRuntime;
|
|
80
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/core/presets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAK3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,EAEN,KAAK,0BAA0B,EAC/B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,KAAK,oBAAoB,EAAmB,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,WAAW,qBAAqB;IACrC;;;;OAIG;IACH,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;OAGG;IACH,GAAG,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IACzC;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,gBAAgB,GAAG,WAAW,GAAG,eAAe,CAAC,CAAC;IAC5F;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,mGAAmG;IACnG,cAAc,CAAC,EAAE,IAAI,CACpB,0BAA0B,EAC1B,gBAAgB,GAAG,WAAW,GAAG,eAAe,CAChD,CAAC;IACF;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACvC;AA8CD,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,IAAI,GAAE,qBAA0B,GAAG,aAAa,CAgBnF;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,qBAA0B,GAAG,YAAY,CAEjF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AgentHarness } from "../../protocol/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* A native process the engine started for a session, as a host keeps it so
|
|
4
|
+
* that its next start can stop what this one left running: what a recycled
|
|
5
|
+
* pid cannot fake. Never accepted from the wire: every field comes from what
|
|
6
|
+
* the engine itself spawned (LLP 0000, the RCE rule).
|
|
7
|
+
*/
|
|
8
|
+
export interface NativeRecord {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
harness: AgentHarness;
|
|
11
|
+
/** Its pid, which is also its process group. Null: a host's own spawner started it. */
|
|
12
|
+
pid: number | null;
|
|
13
|
+
/** The boot it ran in: `kern.bootsessionuuid` (macOS), `/proc/sys/kernel/random/boot_id` (Linux). */
|
|
14
|
+
boot: string | null;
|
|
15
|
+
/** When it started: `ps -o lstart=` in UTC (macOS, 1 s), `/proc/<pid>/stat` starttime (Linux, ticks since boot). */
|
|
16
|
+
started: string | null;
|
|
17
|
+
/** What the engine launched: chosen by the operator or the provisioner, never the wire. */
|
|
18
|
+
executable: string;
|
|
19
|
+
}
|
|
20
|
+
/** This boot's id, read once: a record from another boot names a process that is gone. */
|
|
21
|
+
export declare function bootId(): string | null;
|
|
22
|
+
/** When `pid` started, as its record keeps it; null when it cannot be read. */
|
|
23
|
+
export declare function startToken(pid: number): string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Whether a record still names a process this machine runs. `gone`: another
|
|
26
|
+
* boot, no such process, a zombie, or a process that is not the one recorded
|
|
27
|
+
* (its pid was reused; it is left alone). `ours`: the process recorded, still
|
|
28
|
+
* running. `not_verified`: nothing here can tell.
|
|
29
|
+
*/
|
|
30
|
+
export declare function verifyRecord(record: NativeRecord): "gone" | "ours" | "not_verified";
|
|
31
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../src/core/processes/identity.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC;IACtB,uFAAuF;IACvF,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,qGAAqG;IACrG,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,oHAAoH;IACpH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2FAA2F;IAC3F,UAAU,EAAE,MAAM,CAAC;CACnB;AAMD,0FAA0F;AAC1F,wBAAgB,MAAM,IAAI,MAAM,GAAG,IAAI,CAetC;AA4CD,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,CAYnF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The lifeline: a `/bin/sh` that holds a pipe from this process and, when the
|
|
3
|
+
* pipe closes (this process died, SIGKILL included), stops every process group
|
|
4
|
+
* registered on it. Kept as a string, not a file: nothing to ship, and it runs
|
|
5
|
+
* from a `bun build --compile` binary.
|
|
6
|
+
*
|
|
7
|
+
* Its input, one line each: `+g<pgid>` registers a group, `-g<pgid>` forgets
|
|
8
|
+
* it. It ignores the signals a terminal or Ctrl-C sends a whole group: only
|
|
9
|
+
* the pipe decides. At EOF it walks the table (`ps`, or `/proc` on Linux) for
|
|
10
|
+
* what runs under each group, sends SIGTERM to the groups, to every tool
|
|
11
|
+
* session it finds (both CLIs start their commands with `setsid`) and to
|
|
12
|
+
* anything else under them alone, waits up to its grace, walks again and
|
|
13
|
+
* sends SIGKILL to what is left. `$1` is the grace in tenths of a second.
|
|
14
|
+
* The walk is `treeTargets`'s, in awk: a root that leads its group is reached
|
|
15
|
+
* as it, a descendant leading its own as that group, any other descendant in
|
|
16
|
+
* a group the tree does not lead alone.
|
|
17
|
+
*/
|
|
18
|
+
export declare const LIFELINE_SCRIPT: string;
|
|
19
|
+
/** How the lifeline names itself (`$0`), so a process listing shows whose it is. */
|
|
20
|
+
export declare const LIFELINE_NAME = "agent-server-lifeline";
|
|
21
|
+
/**
|
|
22
|
+
* The lifeline of this OS process: one per process, shared by every runtime
|
|
23
|
+
* in it, started at the first registration. If it dies while this process
|
|
24
|
+
* lives, it is started again with the groups still registered.
|
|
25
|
+
*/
|
|
26
|
+
declare class Lifeline {
|
|
27
|
+
private readonly graceMs;
|
|
28
|
+
private child;
|
|
29
|
+
private readonly groups;
|
|
30
|
+
private lastSpawn;
|
|
31
|
+
/** No `/bin/sh` here, or it keeps dying: the restart sweep is all that is left. */
|
|
32
|
+
private broken;
|
|
33
|
+
constructor(graceMs: number);
|
|
34
|
+
/** The lifeline's pid while one runs (a drill loses it on purpose). */
|
|
35
|
+
get pid(): number | undefined;
|
|
36
|
+
register(pgid: number): void;
|
|
37
|
+
forget(pgid: number): void;
|
|
38
|
+
/** Start one when none runs; true when it was started now, with every group sent. */
|
|
39
|
+
private ensure;
|
|
40
|
+
private write;
|
|
41
|
+
}
|
|
42
|
+
/** This process's lifeline, made on first use with the grace of the runtime that needed it first. */
|
|
43
|
+
export declare function lifeline(graceMs: number): Lifeline;
|
|
44
|
+
/** The pid of this process's lifeline while one runs. */
|
|
45
|
+
export declare function lifelinePid(): number | undefined;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=lifeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifeline.d.ts","sourceRoot":"","sources":["../../../../src/core/processes/lifeline.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,QAwD3B,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,aAAa,0BAA0B,CAAC;AAKrD;;;;GAIG;AACH,cAAM,QAAQ;IAOD,OAAO,CAAC,QAAQ,CAAC,OAAO;IANpC,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,SAAS,CAAK;IACtB,mFAAmF;IACnF,OAAO,CAAC,MAAM,CAAS;gBAEM,OAAO,EAAE,MAAM;IAE5C,uEAAuE;IACvE,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;IAED,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAM5B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI1B,qFAAqF;IACrF,OAAO,CAAC,MAAM;IAkCd,OAAO,CAAC,KAAK;CAQb;AAID,qGAAqG;AACrG,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAGlD;AAED,yDAAyD;AACzD,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAEhD"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { type ChildProcess, type SpawnOptions } from "node:child_process";
|
|
2
|
+
import type { AgentHarness, RecoveryReason } from "../../protocol/index.ts";
|
|
3
|
+
import { StderrTail } from "../agents/stderr-tail.ts";
|
|
4
|
+
import { type NativeRecord } from "./identity.ts";
|
|
5
|
+
/** How long a stopped process has between SIGTERM and SIGKILL: Claude's own shutdown took up to 2.7 s. */
|
|
6
|
+
export declare const DEFAULT_GRACE_MS = 3000;
|
|
7
|
+
/** A native CLI to start: chosen by the operator or the provisioner, never by the wire. */
|
|
8
|
+
export interface NativeSpawn {
|
|
9
|
+
command: string;
|
|
10
|
+
args: readonly string[];
|
|
11
|
+
cwd?: string;
|
|
12
|
+
env?: NodeJS.ProcessEnv;
|
|
13
|
+
harness: AgentHarness;
|
|
14
|
+
/** The logical session it runs: its record is reported for it. Absent: it is not recorded (a model listing). */
|
|
15
|
+
sessionId?: string;
|
|
16
|
+
/** Stops the process, its group and its tool sessions when it aborts. */
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
}
|
|
19
|
+
/** A recorded process started, or was seen gone: what a host keeps for the restart sweep. */
|
|
20
|
+
export interface NativeProcessEvent {
|
|
21
|
+
type: "started" | "stopped";
|
|
22
|
+
record: NativeRecord;
|
|
23
|
+
}
|
|
24
|
+
/** What a runtime does with the native processes it starts. */
|
|
25
|
+
export interface NativeProcessOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Hold a lifeline (POSIX; on by default): a `/bin/sh` that stops what this
|
|
28
|
+
* process started when it dies in any way, SIGKILL included. Off for a host
|
|
29
|
+
* whose supervisor already owns the process tree (a systemd unit, a
|
|
30
|
+
* container whose PID 1 is the host).
|
|
31
|
+
*/
|
|
32
|
+
lifeline?: boolean;
|
|
33
|
+
/** Between SIGTERM and SIGKILL when a process is stopped (default 3 s). */
|
|
34
|
+
graceMs?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Each session process's record when it starts, and again once it is gone:
|
|
37
|
+
* what a host with its own store keeps, to call `stopOrphans` with at its
|
|
38
|
+
* next start. Throwing at `started` fails the spawn: a process nobody
|
|
39
|
+
* recorded must not get work.
|
|
40
|
+
*/
|
|
41
|
+
onRecord?: (event: NativeProcessEvent) => void;
|
|
42
|
+
/** The child-process boundary: `node:child_process`'s `spawn` by default (a test's stand-in). */
|
|
43
|
+
spawn?: (command: string, args: readonly string[], options: SpawnOptions) => ChildProcess;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* What the restart sweep did with a record. `gone` (another boot, no such
|
|
47
|
+
* process, or its pid reused) and `stopped` count as stopped; the reasons a
|
|
48
|
+
* fence names leave its session to the host: `not_owned` (a host's spawner
|
|
49
|
+
* started it), `not_verified` (nothing here could tell, or it may not be
|
|
50
|
+
* signalled) and `not_stopped` (still there after SIGKILL).
|
|
51
|
+
*/
|
|
52
|
+
export type OrphanOutcome = "gone" | "stopped" | RecoveryReason;
|
|
53
|
+
/** How a process ended: once it exited and its stdout and stderr closed (or 200 ms after the exit). */
|
|
54
|
+
export interface NativeExit {
|
|
55
|
+
code: number | null;
|
|
56
|
+
signal: NodeJS.Signals | null;
|
|
57
|
+
}
|
|
58
|
+
/** One native process the engine started: the child itself, its stderr tail, its record and its stop. */
|
|
59
|
+
export declare class NativeProcess {
|
|
60
|
+
readonly child: ChildProcess;
|
|
61
|
+
readonly record: NativeRecord | undefined;
|
|
62
|
+
private readonly tail;
|
|
63
|
+
private readonly stopper;
|
|
64
|
+
/**
|
|
65
|
+
* Settles once it exited and its stdout and stderr closed, at most 200 ms
|
|
66
|
+
* after the exit: what it wrote just before its exit is read first (Codex's
|
|
67
|
+
* last response), and its stderr's last words are in the tail.
|
|
68
|
+
*/
|
|
69
|
+
readonly exited: Promise<NativeExit>;
|
|
70
|
+
/** The stop under way, once one began: whether everything under it is gone. */
|
|
71
|
+
private stopping;
|
|
72
|
+
constructor(child: ChildProcess, record: NativeRecord | undefined, tail: StderrTail, stopper: (native: NativeProcess, graceMs?: number) => Promise<boolean>);
|
|
73
|
+
get pid(): number | undefined;
|
|
74
|
+
/** The end of its stderr (2 KB): complete once `exited` settles. */
|
|
75
|
+
get stderrTail(): string;
|
|
76
|
+
/**
|
|
77
|
+
* Stop it and everything under it: SIGTERM to its group and its tool
|
|
78
|
+
* sessions, SIGKILL to what is left after the grace. Whether all of it is
|
|
79
|
+
* gone. Every call shares one stop.
|
|
80
|
+
*/
|
|
81
|
+
stop(options?: {
|
|
82
|
+
graceMs?: number;
|
|
83
|
+
}): Promise<boolean>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The native processes a runtime starts, and how it stops them. Each CLI
|
|
87
|
+
* starts in a session and process group of its own, registered with this OS
|
|
88
|
+
* process's lifeline before it is sent any input, and its identity is read at
|
|
89
|
+
* once, so a crash cannot leave a CLI with work and no record. Stopping one
|
|
90
|
+
* reaches its whole tree: its group, the tool sessions under it, and anything
|
|
91
|
+
* else under it alone, SIGTERM first (both CLIs stop their own tools on it),
|
|
92
|
+
* SIGKILL after the grace.
|
|
93
|
+
*/
|
|
94
|
+
export declare class NativeProcesses {
|
|
95
|
+
private readonly live;
|
|
96
|
+
private readonly observers;
|
|
97
|
+
private readonly graceMs;
|
|
98
|
+
private readonly lifeline;
|
|
99
|
+
private readonly spawnChild;
|
|
100
|
+
constructor(options?: NativeProcessOptions);
|
|
101
|
+
/** Watch records start and stop (what a journal writes); returns the unsubscribe. */
|
|
102
|
+
observe(observer: (event: NativeProcessEvent) => void): () => void;
|
|
103
|
+
/** Start a native CLI the engine owns. Throws when its record cannot be kept. */
|
|
104
|
+
spawn(spec: NativeSpawn): NativeProcess;
|
|
105
|
+
/**
|
|
106
|
+
* A session's process a host started with its own spawner: recorded with no
|
|
107
|
+
* pid, so a restart leaves its session to the host (`not_owned`). Call what
|
|
108
|
+
* this returns once it exited.
|
|
109
|
+
*/
|
|
110
|
+
hosted(spec: {
|
|
111
|
+
sessionId: string;
|
|
112
|
+
harness: AgentHarness;
|
|
113
|
+
executable: string;
|
|
114
|
+
}): () => void;
|
|
115
|
+
/** Stop every process this runtime started and has not seen gone. */
|
|
116
|
+
stopAll(): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* The restart sweep: for each record a previous owner left, verify that it
|
|
119
|
+
* still names a running process (boot, start time, executable), and stop it
|
|
120
|
+
* when it does. A record that names another process leaves it untouched.
|
|
121
|
+
*/
|
|
122
|
+
stopOrphans<R extends NativeRecord>(records: readonly R[]): Promise<Map<R, OrphanOutcome>>;
|
|
123
|
+
private stopNative;
|
|
124
|
+
/** SIGTERM the tree under `roots`, SIGKILL what is left after the grace, walking it again. */
|
|
125
|
+
private stopTree;
|
|
126
|
+
private report;
|
|
127
|
+
}
|
|
128
|
+
/** The native processes of a harness made without a runtime's (a test, a custom registry). */
|
|
129
|
+
export declare function sharedNativeProcesses(): NativeProcesses;
|
|
130
|
+
//# sourceMappingURL=native-processes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-processes.d.ts","sourceRoot":"","sources":["../../../../src/core/processes/native-processes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAsB,MAAM,oBAAoB,CAAC;AAC9F,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAoC,MAAM,eAAe,CAAC;AAYpF,0GAA0G;AAC1G,eAAO,MAAM,gBAAgB,OAAQ,CAAC;AAStC,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,OAAO,EAAE,YAAY,CAAC;IACtB,gHAAgH;IAChH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,6FAA6F;AAC7F,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,YAAY,CAAC;CACrB;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,iGAAiG;IACjG,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,YAAY,KAAK,YAAY,CAAC;CAC1F;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,CAAC;AAEhE,uGAAuG;AACvG,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED,yGAAyG;AACzG,qBAAa,aAAa;IAWxB,QAAQ,CAAC,KAAK,EAAE,YAAY;IAC5B,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAbzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,+EAA+E;IAC/E,OAAO,CAAC,QAAQ,CAA+B;gBAGrC,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,GAAG,SAAS,EACxB,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC;IAgCxF,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;IAED,oEAAoE;IACpE,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;;;OAIG;IACH,IAAI,CAAC,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAI1D;AASD;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4B;IACjD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkD;IAC5E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6C;gBAE5D,OAAO,GAAE,oBAAyB;IAO9C,qFAAqF;IACrF,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,GAAG,MAAM,IAAI;IAKlE,iFAAiF;IACjF,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa;IAgDvC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,IAAI;IAW1F,qEAAqE;IAC/D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;;;OAIG;IACG,WAAW,CAAC,CAAC,SAAS,YAAY,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;YA2BlF,UAAU;IAaxB,8FAA8F;YAChF,QAAQ;IAiCtB,OAAO,CAAC,MAAM;CAYd;AA4BD,8FAA8F;AAC9F,wBAAgB,qBAAqB,IAAI,eAAe,CAGvD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** One process, as the machine's process table shows it. */
|
|
2
|
+
export interface ProcessRow {
|
|
3
|
+
pid: number;
|
|
4
|
+
ppid: number;
|
|
5
|
+
pgid: number;
|
|
6
|
+
/** Dead, though still listed until its parent reaps it: it takes no signal. */
|
|
7
|
+
zombie: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Something to signal: a process group (negative, as `kill(2)` takes it) or
|
|
11
|
+
* one process. Never 0, 1 or -1, which name the caller's own group, init and
|
|
12
|
+
* every process the caller may signal.
|
|
13
|
+
*/
|
|
14
|
+
export type KillTarget = number;
|
|
15
|
+
/** Whether this platform has process groups, sessions and a table to walk. */
|
|
16
|
+
export declare const POSIX: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The fields of `/proc/<pid>/stat` after its command, which may hold spaces
|
|
19
|
+
* and parentheses: state first, then ppid, pgrp, session, … starttime (the
|
|
20
|
+
* 22nd field overall) at index 19.
|
|
21
|
+
*/
|
|
22
|
+
export declare function statFields(pid: number): string[] | undefined;
|
|
23
|
+
/** Every process on the machine; undefined where none can be read (Windows, no `ps`). */
|
|
24
|
+
export declare function readProcessTable(): ProcessRow[] | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* What to signal to reach each root and everything under it.
|
|
27
|
+
*
|
|
28
|
+
* A root that leads its own group (a CLI spawned detached leads a new
|
|
29
|
+
* session) is reached as that group, which also holds what it started
|
|
30
|
+
* without a session of its own (Claude's MCP servers); a root that does not
|
|
31
|
+
* is reached alone. Below them, a process that leads its own group (a tool:
|
|
32
|
+
* both CLIs start each command with `setsid`) is reached as that group, one
|
|
33
|
+
* in a group the tree leads is covered by it, and one in anyone else's group
|
|
34
|
+
* is reached alone. Never by a group the tree does not lead: with the SDK's
|
|
35
|
+
* own spawner Claude's MCP servers share their owner's group, which can hold
|
|
36
|
+
* the owner's parent.
|
|
37
|
+
*/
|
|
38
|
+
export declare function treeTargets(table: readonly ProcessRow[], roots: Iterable<number>): KillTarget[];
|
|
39
|
+
/** The targets something still answers for: a live process, or a group with a live member. */
|
|
40
|
+
export declare function aliveTargets(table: readonly ProcessRow[], targets: readonly KillTarget[]): KillTarget[];
|
|
41
|
+
/** Send `signal` to each target. Returns those the system would not let this process signal. */
|
|
42
|
+
export declare function signalTargets(targets: readonly KillTarget[], signal: NodeJS.Signals): KillTarget[];
|
|
43
|
+
//# sourceMappingURL=process-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-table.d.ts","sourceRoot":"","sources":["../../../../src/core/processes/process-table.ts"],"names":[],"mappings":"AAGA,4DAA4D;AAC5D,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,MAAM,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,8EAA8E;AAC9E,eAAO,MAAM,KAAK,SAA+B,CAAC;AAKlD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAO5D;AAsCD,yFAAyF;AACzF,wBAAgB,gBAAgB,IAAI,UAAU,EAAE,GAAG,SAAS,CAO3D;AASD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,UAAU,EAAE,CAoC/F;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAC3B,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,OAAO,EAAE,SAAS,UAAU,EAAE,GAC5B,UAAU,EAAE,CASd;AAED,gGAAgG;AAChG,wBAAgB,aAAa,CAC5B,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,MAAM,EAAE,MAAM,CAAC,OAAO,GACpB,UAAU,EAAE,CAWd"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Stats } from "node:fs";
|
|
2
|
+
/** Check each parent before creating its child; trusted sticky parents permit /tmp. */
|
|
3
|
+
export declare function trustedCacheDirectory(path: string, ownLeaf: boolean): string;
|
|
4
|
+
/** Managed descendants cannot be aliases or outsider-writable, even under a repaired root. */
|
|
5
|
+
export declare function managedDirectory(root: string, path: string, create: boolean): boolean;
|
|
6
|
+
export declare function trustedBinary(path: string, stat: Stats): void;
|
|
7
|
+
/**
|
|
8
|
+
* The first of `binaries` under a managed `dir` that is a trusted regular
|
|
9
|
+
* file. A symlink here could redirect the spawn — and the post-install
|
|
10
|
+
* `chmod` — at a path outside the tree we verified.
|
|
11
|
+
*/
|
|
12
|
+
export declare function trustedBinaryIn(root: string, dir: string, binaries: readonly string[]): string | undefined;
|
|
13
|
+
//# sourceMappingURL=cache-trust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-trust.d.ts","sourceRoot":"","sources":["../../../../src/core/provision/cache-trust.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAiD,MAAM,SAAS,CAAC;AAyCpF,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAyB5E;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAkBrF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI,CAK7D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,MAAM,EAAE,GACzB,MAAM,GAAG,SAAS,CAcpB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Record that a cached build was used now. Best effort: a read-only cache still runs. */
|
|
2
|
+
export declare function markUsed(root: string, tool: string, entry: string): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Remove the cached builds of `tools` whose recorded last use is 14 days old,
|
|
5
|
+
* never one `keep` names (`<tool>/<entry>`), and what dead installs left in
|
|
6
|
+
* `.tmp`. Several products may share one cache with their own pins: each
|
|
7
|
+
* keeps its builds by using them. A build no use was ever recorded for was
|
|
8
|
+
* written by an agent-server that records none (0.3.18 and earlier, which
|
|
9
|
+
* share the default cache and may be running it): only `unrecorded` removes
|
|
10
|
+
* those, by when they were installed (`install --prune`). Returns the builds
|
|
11
|
+
* removed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function pruneCache(root: string, tools: readonly string[], keep: ReadonlySet<string>, unrecorded: boolean): Promise<string[]>;
|
|
14
|
+
//# sourceMappingURL=cache-usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-usage.d.ts","sourceRoot":"","sources":["../../../../src/core/provision/cache-usage.ts"],"names":[],"mappings":"AAaA,0FAA0F;AAC1F,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASvF;AAMD;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EACzB,UAAU,EAAE,OAAO,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAwBnB"}
|