agentxgo 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/adapters/codex/client.js +6 -0
- package/dist/adapters/dsh/client.js +6 -0
- package/dist/adapters/runtime-http/client.js +101 -0
- package/dist/adapters/runtime-http/endpoint.js +15 -0
- package/dist/bootstrap.js +161 -0
- package/dist/cli.js +134 -0
- package/dist/communication/assembly.js +172 -0
- package/dist/communication/calls.js +107 -0
- package/dist/communication/config.js +33 -0
- package/dist/communication/pump.js +136 -0
- package/dist/computer/authority.js +67 -0
- package/dist/computer/automatic.js +163 -0
- package/dist/computer/automation-main.js +59 -0
- package/dist/computer/automation.js +229 -0
- package/dist/computer/backend.js +160 -0
- package/dist/computer/clipboard.js +72 -0
- package/dist/computer/config.js +66 -0
- package/dist/computer/controller.js +378 -0
- package/dist/computer/desktop.js +225 -0
- package/dist/computer/job-main.js +114 -0
- package/dist/computer/main.js +9 -0
- package/dist/computer/native.js +28 -0
- package/dist/computer/processes.js +165 -0
- package/dist/computer/release.js +40 -0
- package/dist/computer/scratch.js +171 -0
- package/dist/computer/service.js +46 -0
- package/dist/computer/worker.js +70 -0
- package/dist/config.js +156 -0
- package/dist/continuation/checkpoints.js +98 -0
- package/dist/continuation/commands.js +81 -0
- package/dist/continuation/coordinator.js +490 -0
- package/dist/continuation/corrections.js +154 -0
- package/dist/continuation/events.js +171 -0
- package/dist/continuation/failure.js +93 -0
- package/dist/continuation/listening.js +24 -0
- package/dist/continuation/local-wait.js +67 -0
- package/dist/continuation/observations.js +100 -0
- package/dist/continuation/parking.js +190 -0
- package/dist/continuation/reading.js +77 -0
- package/dist/conversations/pump.js +158 -0
- package/dist/conversations/runtime-http.js +88 -0
- package/dist/deployment/cold-qualification.js +119 -0
- package/dist/deployment/cold-release.js +56 -0
- package/dist/deployment/components/cli.js +45 -0
- package/dist/deployment/components/lock.js +38 -0
- package/dist/deployment/components/manager.js +281 -0
- package/dist/deployment/components/release.js +50 -0
- package/dist/deployment/components/runner.js +15 -0
- package/dist/deployment/components/supervisor.js +289 -0
- package/dist/deployment/components/verify.js +66 -0
- package/dist/deployment/components/windows.js +70 -0
- package/dist/deployment/config.js +89 -0
- package/dist/deployment/failure.js +24 -0
- package/dist/deployment/kernel.js +85 -0
- package/dist/deployment/macos/activate.js +140 -0
- package/dist/deployment/macos/attachment.js +42 -0
- package/dist/deployment/macos/handoff.js +140 -0
- package/dist/deployment/macos/install.js +223 -0
- package/dist/deployment/macos/plan.js +155 -0
- package/dist/deployment/macos/proof.js +24 -0
- package/dist/deployment/main.js +16 -0
- package/dist/deployment/members.js +58 -0
- package/dist/deployment/preflight.js +41 -0
- package/dist/deployment/recovery-route.js +18 -0
- package/dist/deployment/runtime.js +114 -0
- package/dist/deployment/system.js +112 -0
- package/dist/deployment/windows-state.js +32 -0
- package/dist/doctor/config.js +155 -0
- package/dist/doctor/probe.js +212 -0
- package/dist/doctor/process.js +31 -0
- package/dist/doctor/run.js +105 -0
- package/dist/enrollment/cli.js +57 -0
- package/dist/enrollment/defaults.js +54 -0
- package/dist/enrollment/device.js +314 -0
- package/dist/enrollment/login.js +107 -0
- package/dist/enrollment/setup.js +164 -0
- package/dist/enrollment/terminal.js +55 -0
- package/dist/execution/artifact.js +157 -0
- package/dist/execution/codex/authority.js +356 -0
- package/dist/execution/codex/catalog.js +24 -0
- package/dist/execution/codex/config.js +77 -0
- package/dist/execution/codex/directories.js +67 -0
- package/dist/execution/codex/main.js +17 -0
- package/dist/execution/codex/read.js +35 -0
- package/dist/execution/codex/record.js +121 -0
- package/dist/execution/codex/role.js +2 -0
- package/dist/execution/codex/stream.js +2 -0
- package/dist/execution/codex/window-receipts.js +73 -0
- package/dist/execution/codex/wire.js +56 -0
- package/dist/execution/codex/worker.js +143 -0
- package/dist/execution/config.js +215 -0
- package/dist/execution/environment.js +61 -0
- package/dist/execution/gateway.js +212 -0
- package/dist/execution/lease-watchdog.js +172 -0
- package/dist/execution/local.js +159 -0
- package/dist/execution/main.js +71 -0
- package/dist/execution/native/config.js +45 -0
- package/dist/execution/native/input.js +7 -0
- package/dist/execution/native/main.js +9 -0
- package/dist/execution/native/records.js +168 -0
- package/dist/execution/native/worker.js +128 -0
- package/dist/execution/native-job-gate.js +63 -0
- package/dist/execution/process-types.js +1 -0
- package/dist/execution/process.js +246 -0
- package/dist/execution/results.js +111 -0
- package/dist/execution/role.js +210 -0
- package/dist/execution/runner.js +338 -0
- package/dist/execution/scope.js +415 -0
- package/dist/execution/scratch-files.js +352 -0
- package/dist/execution/scratch-paths.js +56 -0
- package/dist/execution/scratch.js +126 -0
- package/dist/execution/stdio.js +83 -0
- package/dist/execution/stream.js +159 -0
- package/dist/execution/watchdog.js +181 -0
- package/dist/execution/work.js +76 -0
- package/dist/execution/worker.js +106 -0
- package/dist/help.js +21 -0
- package/dist/lifecycle/http.js +178 -0
- package/dist/lifecycle/runtime.js +263 -0
- package/dist/lifecycle/status-command.js +78 -0
- package/dist/lifecycle/status.js +37 -0
- package/dist/lifecycle/wake-hints.js +68 -0
- package/dist/main.js +59 -0
- package/dist/ports/reports.js +1 -0
- package/dist/ports/runtime.js +1 -0
- package/dist/preparation/backend.js +44 -0
- package/dist/preparation/binding.js +47 -0
- package/dist/preparation/bootstrap.js +165 -0
- package/dist/preparation/config.js +143 -0
- package/dist/preparation/coordinator.js +251 -0
- package/dist/preparation/main.js +58 -0
- package/dist/preparation/runtime.js +122 -0
- package/dist/receptions/pump.js +109 -0
- package/dist/receptions/runtime-http.js +115 -0
- package/dist/recovery/activation.js +178 -0
- package/dist/recovery/admission.js +95 -0
- package/dist/recovery/automatic-preparation.js +194 -0
- package/dist/recovery/automatic-recovery.js +210 -0
- package/dist/recovery/confirmed-binding.js +45 -0
- package/dist/recovery/coordinator.js +351 -0
- package/dist/recovery/execution-policy.js +26 -0
- package/dist/recovery/preparation-policy.js +30 -0
- package/dist/recovery/prestart.js +62 -0
- package/dist/recovery/quarantine.js +153 -0
- package/dist/recovery/service-restart-view.js +32 -0
- package/dist/recovery/service-restart.js +368 -0
- package/dist/reports/pump.js +98 -0
- package/dist/resources/admission.js +25 -0
- package/dist/resources/guard.js +14 -0
- package/node_modules/@agent-stack/adapter-agentim/dist/account.js +42 -0
- package/node_modules/@agent-stack/adapter-agentim/dist/connection-file.js +32 -0
- package/node_modules/@agent-stack/adapter-agentim/dist/direct.js +114 -0
- package/node_modules/@agent-stack/adapter-agentim/dist/local.js +238 -0
- package/node_modules/@agent-stack/adapter-agentim/dist/operations-arguments.js +20 -0
- package/node_modules/@agent-stack/adapter-agentim/dist/operations-communication.js +56 -0
- package/node_modules/@agent-stack/adapter-agentim/dist/operations-operator.js +40 -0
- package/node_modules/@agent-stack/adapter-agentim/package.json +15 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/automatic-activation.js +94 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/automatic-preparation.js +90 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/checkpoint-seal.js +89 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/communication.js +238 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/computer-scratch.js +56 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/computer.js +183 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/database.js +174 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/index.js +4 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/input.js +55 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/journal.js +396 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/models.js +35 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/native-calls.js +123 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/native-window.js +12 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/observations.js +237 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/preparation.js +117 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/recovery-history.js +30 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/recovery-record.js +32 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/recovery.js +256 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/reports.js +105 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/runtime-events.js +246 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/runtime-settings.js +95 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/target-actions.js +355 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/target-local.js +210 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/target-scratch.js +207 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/terminal-checkpoints.js +286 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/terminal-store.js +136 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/trace-inputs.js +104 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/upgrade.js +25 -0
- package/node_modules/@agent-stack/bot-host-journal/dist/waits.js +213 -0
- package/node_modules/@agent-stack/bot-host-journal/package.json +10 -0
- package/node_modules/@agent-stack/bridge-client/dist/bot-transport.js +339 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/agents.js +22 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/bots/assistant.js +26 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/bots/auth.js +9 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/bots/client.js +160 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/bots/inventory.js +55 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/bots/native-events.js +52 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/bots/owner-route.js +21 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/bots/reports.js +41 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/bots/runtime.js +190 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/bridge-client.js +37 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/core.js +123 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/deployments.js +57 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/integrations.js +45 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/knowledge.js +33 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/management.js +112 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/platform-events.js +59 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/platform.js +82 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/public-runtime.js +94 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/run-work-acknowledgement.js +54 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/run-work-errors.js +34 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/runtime.js +46 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/tenant/authorization.js +7 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/tenant/management.js +59 -0
- package/node_modules/@agent-stack/bridge-client/dist/client/workspace.js +109 -0
- package/node_modules/@agent-stack/bridge-client/dist/index.js +9 -0
- package/node_modules/@agent-stack/bridge-client/package.json +11 -0
- package/node_modules/@agent-stack/contracts/dist/api-credentials.js +103 -0
- package/node_modules/@agent-stack/contracts/dist/bots/assistant-path.js +24 -0
- package/node_modules/@agent-stack/contracts/dist/bots/assistant.js +2 -0
- package/node_modules/@agent-stack/contracts/dist/bots/capabilities.js +66 -0
- package/node_modules/@agent-stack/contracts/dist/bots/capability-migration.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/bots/capability-version.js +48 -0
- package/node_modules/@agent-stack/contracts/dist/bots/codex-policy.js +22 -0
- package/node_modules/@agent-stack/contracts/dist/bots/command-evidence.js +101 -0
- package/node_modules/@agent-stack/contracts/dist/bots/command-inventory.js +74 -0
- package/node_modules/@agent-stack/contracts/dist/bots/command-receipt.js +78 -0
- package/node_modules/@agent-stack/contracts/dist/bots/communication-native.js +33 -0
- package/node_modules/@agent-stack/contracts/dist/bots/communication-stream.js +13 -0
- package/node_modules/@agent-stack/contracts/dist/bots/communication.js +154 -0
- package/node_modules/@agent-stack/contracts/dist/bots/component-status.js +38 -0
- package/node_modules/@agent-stack/contracts/dist/bots/components.js +10 -0
- package/node_modules/@agent-stack/contracts/dist/bots/computer-validation.js +320 -0
- package/node_modules/@agent-stack/contracts/dist/bots/computer.js +10 -0
- package/node_modules/@agent-stack/contracts/dist/bots/conversations.js +31 -0
- package/node_modules/@agent-stack/contracts/dist/bots/corrections.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/bots/delegation-renewal.js +17 -0
- package/node_modules/@agent-stack/contracts/dist/bots/delegation.js +35 -0
- package/node_modules/@agent-stack/contracts/dist/bots/delivery-history.js +115 -0
- package/node_modules/@agent-stack/contracts/dist/bots/delivery-read.js +121 -0
- package/node_modules/@agent-stack/contracts/dist/bots/elicitation.js +83 -0
- package/node_modules/@agent-stack/contracts/dist/bots/entries.js +65 -0
- package/node_modules/@agent-stack/contracts/dist/bots/event-exchanges.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/bots/goal-window.js +84 -0
- package/node_modules/@agent-stack/contracts/dist/bots/host-actions.js +191 -0
- package/node_modules/@agent-stack/contracts/dist/bots/identities.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/bots/index.js +72 -0
- package/node_modules/@agent-stack/contracts/dist/bots/installation.js +9 -0
- package/node_modules/@agent-stack/contracts/dist/bots/interaction-validation.js +227 -0
- package/node_modules/@agent-stack/contracts/dist/bots/interactions.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/bots/lifecycle.js +13 -0
- package/node_modules/@agent-stack/contracts/dist/bots/local-execution.js +72 -0
- package/node_modules/@agent-stack/contracts/dist/bots/mcp-capabilities.js +53 -0
- package/node_modules/@agent-stack/contracts/dist/bots/mission.js +3 -0
- package/node_modules/@agent-stack/contracts/dist/bots/model-routing.js +43 -0
- package/node_modules/@agent-stack/contracts/dist/bots/native-events-validation.js +229 -0
- package/node_modules/@agent-stack/contracts/dist/bots/native-events.js +4 -0
- package/node_modules/@agent-stack/contracts/dist/bots/native-fact.js +32 -0
- package/node_modules/@agent-stack/contracts/dist/bots/native-host.js +10 -0
- package/node_modules/@agent-stack/contracts/dist/bots/observation.js +42 -0
- package/node_modules/@agent-stack/contracts/dist/bots/owner-progress.js +85 -0
- package/node_modules/@agent-stack/contracts/dist/bots/owner-transition.js +169 -0
- package/node_modules/@agent-stack/contracts/dist/bots/parking.js +75 -0
- package/node_modules/@agent-stack/contracts/dist/bots/preferences.js +39 -0
- package/node_modules/@agent-stack/contracts/dist/bots/preparations.js +2 -0
- package/node_modules/@agent-stack/contracts/dist/bots/project-oauth.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/bots/quarantine-installation.js +117 -0
- package/node_modules/@agent-stack/contracts/dist/bots/quarantine.js +186 -0
- package/node_modules/@agent-stack/contracts/dist/bots/read-recovery.js +10 -0
- package/node_modules/@agent-stack/contracts/dist/bots/receptions.js +7 -0
- package/node_modules/@agent-stack/contracts/dist/bots/recovery-admission.js +163 -0
- package/node_modules/@agent-stack/contracts/dist/bots/recovery-errors.js +51 -0
- package/node_modules/@agent-stack/contracts/dist/bots/recovery-history.js +90 -0
- package/node_modules/@agent-stack/contracts/dist/bots/recovery-source.js +164 -0
- package/node_modules/@agent-stack/contracts/dist/bots/recovery-validation.js +160 -0
- package/node_modules/@agent-stack/contracts/dist/bots/recovery.js +13 -0
- package/node_modules/@agent-stack/contracts/dist/bots/relay.js +21 -0
- package/node_modules/@agent-stack/contracts/dist/bots/report-status.js +99 -0
- package/node_modules/@agent-stack/contracts/dist/bots/reports.js +8 -0
- package/node_modules/@agent-stack/contracts/dist/bots/restart-source.js +151 -0
- package/node_modules/@agent-stack/contracts/dist/bots/runtime-command.js +59 -0
- package/node_modules/@agent-stack/contracts/dist/bots/runtime-input.js +80 -0
- package/node_modules/@agent-stack/contracts/dist/bots/runtime-provider.js +12 -0
- package/node_modules/@agent-stack/contracts/dist/bots/runtime-settings.js +63 -0
- package/node_modules/@agent-stack/contracts/dist/bots/runtime-validation.js +35 -0
- package/node_modules/@agent-stack/contracts/dist/bots/runtime.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/bots/same-native.js +44 -0
- package/node_modules/@agent-stack/contracts/dist/bots/service-restart.js +80 -0
- package/node_modules/@agent-stack/contracts/dist/bots/status.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/bots/sync.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/bots/targets.js +95 -0
- package/node_modules/@agent-stack/contracts/dist/bots/validation.js +82 -0
- package/node_modules/@agent-stack/contracts/dist/bots/versions.js +6 -0
- package/node_modules/@agent-stack/contracts/dist/bots/wake-hints.js +20 -0
- package/node_modules/@agent-stack/contracts/dist/bots/work-brief.js +120 -0
- package/node_modules/@agent-stack/contracts/dist/bots/work-control.js +47 -0
- package/node_modules/@agent-stack/contracts/dist/bots/work-events.js +38 -0
- package/node_modules/@agent-stack/contracts/dist/browser-chat-attachment.js +66 -0
- package/node_modules/@agent-stack/contracts/dist/business-outcomes.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/chat-attachment.js +70 -0
- package/node_modules/@agent-stack/contracts/dist/chat-stream.js +105 -0
- package/node_modules/@agent-stack/contracts/dist/contracts/agent-ui.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/contracts/base.js +6 -0
- package/node_modules/@agent-stack/contracts/dist/contracts/deployments.js +6 -0
- package/node_modules/@agent-stack/contracts/dist/contracts/index.js +8 -0
- package/node_modules/@agent-stack/contracts/dist/contracts/integrations.js +13 -0
- package/node_modules/@agent-stack/contracts/dist/contracts/knowledge.js +69 -0
- package/node_modules/@agent-stack/contracts/dist/contracts/live.js +56 -0
- package/node_modules/@agent-stack/contracts/dist/contracts/runtime.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/contracts/workspace.js +9 -0
- package/node_modules/@agent-stack/contracts/dist/delivery-targets.js +139 -0
- package/node_modules/@agent-stack/contracts/dist/desktop-mcp.js +105 -0
- package/node_modules/@agent-stack/contracts/dist/employee-association.js +31 -0
- package/node_modules/@agent-stack/contracts/dist/event-links.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/execution-oauth-callback.js +61 -0
- package/node_modules/@agent-stack/contracts/dist/host-page-context.js +156 -0
- package/node_modules/@agent-stack/contracts/dist/index.js +115 -0
- package/node_modules/@agent-stack/contracts/dist/installation-lifecycle.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/installation-mcp.js +5 -0
- package/node_modules/@agent-stack/contracts/dist/installations.js +7 -0
- package/node_modules/@agent-stack/contracts/dist/integration-context.js +22 -0
- package/node_modules/@agent-stack/contracts/dist/integration-oauth.js +23 -0
- package/node_modules/@agent-stack/contracts/dist/integration-runtime.js +107 -0
- package/node_modules/@agent-stack/contracts/dist/interactive-run-wake.js +78 -0
- package/node_modules/@agent-stack/contracts/dist/interactive-work-acknowledgement.js +74 -0
- package/node_modules/@agent-stack/contracts/dist/interactive-work-events.js +131 -0
- package/node_modules/@agent-stack/contracts/dist/interactive-work-sources.js +142 -0
- package/node_modules/@agent-stack/contracts/dist/knowledge-attachment.js +50 -0
- package/node_modules/@agent-stack/contracts/dist/knowledge-catalog.js +94 -0
- package/node_modules/@agent-stack/contracts/dist/knowledge-organization.js +87 -0
- package/node_modules/@agent-stack/contracts/dist/live-audio.js +46 -0
- package/node_modules/@agent-stack/contracts/dist/live-business.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/live-human.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/live-transport.js +2 -0
- package/node_modules/@agent-stack/contracts/dist/mcp-directory.js +7 -0
- package/node_modules/@agent-stack/contracts/dist/mcp-refresh.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/mcp-scopes.js +24 -0
- package/node_modules/@agent-stack/contracts/dist/native-studio-installation.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/oauth-authorization.js +19 -0
- package/node_modules/@agent-stack/contracts/dist/platform-events.js +182 -0
- package/node_modules/@agent-stack/contracts/dist/reply-presentation.js +59 -0
- package/node_modules/@agent-stack/contracts/dist/reply.js +129 -0
- package/node_modules/@agent-stack/contracts/dist/request-body.js +38 -0
- package/node_modules/@agent-stack/contracts/dist/schedules.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/task-work-events.js +107 -0
- package/node_modules/@agent-stack/contracts/dist/tasks.js +200 -0
- package/node_modules/@agent-stack/contracts/dist/templates.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/access-schemas.js +149 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/access-views.js +17 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/access.js +132 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/actions.js +173 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/attachments.js +68 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/authorization.js +160 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/capabilities.js +98 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/connections.js +31 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/conversation-work-events.js +72 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/conversation-work-schemas.js +136 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/conversations.js +31 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/deliveries.js +120 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/delivery-views.js +38 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/deployment-catalog.js +50 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/descriptor.js +50 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/events.js +39 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/feedback.js +161 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/guidance.js +284 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/host-enrollment.js +51 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/identity.js +31 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/installation-schemas.js +350 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/installation-views.js +69 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/installations.js +217 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/integration-configuration.js +96 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/integration-oauth.js +85 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/integrations.js +75 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/json.js +96 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-management-input.js +211 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-management-results.js +145 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-management-schemas.js +139 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-management.js +32 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-organization.js +96 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-program-input.js +111 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-program-results.js +234 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-programs.js +15 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/live.js +63 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/marketplace-schemas.js +110 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/marketplaces.js +51 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/mcp-directory.js +98 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/native-operations.js +113 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/operations.js +36 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/outcome-schemas.js +121 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/outcomes.js +87 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/queries.js +24 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/resource-views.js +463 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/resources.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/schedule-schemas.js +122 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/schedule-views.js +22 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/schedules.js +109 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/schemas.js +117 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/settings.js +34 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/sse.js +58 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/task-schemas.js +89 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/task-views.js +34 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/tasks.js +41 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/tests.js +1 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/transport.js +2 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/usage.js +61 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/views.js +52 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/widgets.js +215 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/work-changes.js +71 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/work-materials.js +102 -0
- package/node_modules/@agent-stack/contracts/dist/tenant/workspace-resources.js +87 -0
- package/node_modules/@agent-stack/contracts/dist/widget-authorization.js +55 -0
- package/node_modules/@agent-stack/contracts/dist/widget-avatar.js +24 -0
- package/node_modules/@agent-stack/contracts/dist/widget-context.js +57 -0
- package/node_modules/@agent-stack/contracts/dist/widget-conversation.js +13 -0
- package/node_modules/@agent-stack/contracts/dist/widget-host-auth.js +142 -0
- package/node_modules/@agent-stack/contracts/dist/widget-origin.js +16 -0
- package/node_modules/@agent-stack/contracts/dist/widget-turn.js +84 -0
- package/node_modules/@agent-stack/contracts/package.json +8 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/authority.js +64 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/bot/bootstrap.js +81 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/bot/codex-record.js +37 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/bot/codex-target.js +56 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/bot/conversation.js +1 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/bot/index.js +7 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/bot/process-identity.js +18 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/bot/quarantine-material.js +9 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/bot/recovery-inspection.js +103 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/bot/service.js +3 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/execution/index.js +7 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/execution/json.js +169 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/execution/observation.js +40 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/execution/runtime.js +1 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/execution/trace.js +1 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/execution/types.js +32 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/execution/wire.js +167 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/execution/wire.schema.json +1 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/index.js +31 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/interactive-run-wake.js +190 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/legacy.js +1 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/mcp.js +53 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/native-studio-connection.js +46 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/native-studio-execution.js +100 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/native-studio-registration.js +193 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/oauth-context.js +38 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/personal-mcp.js +1 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/signing.js +1 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/source-reply.js +153 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/storage.js +1 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/target-environment.js +45 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/tenant-management.js +57 -0
- package/node_modules/@agent-stack/runtime-contracts/dist/tool-trace.js +1 -0
- package/node_modules/@agent-stack/runtime-contracts/package.json +13 -0
- package/node_modules/@agentims/adapter/dist/authority/binding.js +40 -0
- package/node_modules/@agentims/adapter/dist/delivery/coordinator.js +202 -0
- package/node_modules/@agentims/adapter/dist/delivery/decision.js +51 -0
- package/node_modules/@agentims/adapter/dist/delivery/record.js +24 -0
- package/node_modules/@agentims/adapter/dist/delivery/types.js +1 -0
- package/node_modules/@agentims/adapter/dist/errors.js +40 -0
- package/node_modules/@agentims/adapter/dist/index.js +5 -0
- package/node_modules/@agentims/adapter/dist/lifecycle/budget.js +30 -0
- package/node_modules/@agentims/adapter/dist/receipts/send.js +24 -0
- package/node_modules/@agentims/adapter/dist/source/event-source.js +153 -0
- package/node_modules/@agentims/adapter/dist/source/types.js +1 -0
- package/node_modules/@agentims/adapter/dist/status/adapter-status.js +46 -0
- package/node_modules/@agentims/adapter/package.json +10 -0
- package/node_modules/@agentims/runtime/dist/accounts/backup.js +39 -0
- package/node_modules/@agentims/runtime/dist/accounts/communication.js +14 -0
- package/node_modules/@agentims/runtime/dist/accounts/context.js +36 -0
- package/node_modules/@agentims/runtime/dist/accounts/credential-lifecycle.js +57 -0
- package/node_modules/@agentims/runtime/dist/accounts/errors.js +13 -0
- package/node_modules/@agentims/runtime/dist/accounts/login.js +32 -0
- package/node_modules/@agentims/runtime/dist/accounts/password.js +18 -0
- package/node_modules/@agentims/runtime/dist/accounts/register.js +30 -0
- package/node_modules/@agentims/runtime/dist/accounts/selection.js +93 -0
- package/node_modules/@agentims/runtime/dist/accounts/types.js +1 -0
- package/node_modules/@agentims/runtime/dist/authentication/intent.js +15 -0
- package/node_modules/@agentims/runtime/dist/authentication/journals.js +39 -0
- package/node_modules/@agentims/runtime/dist/authentication/methods.js +42 -0
- package/node_modules/@agentims/runtime/dist/authentication/selection.js +20 -0
- package/node_modules/@agentims/runtime/dist/authentication/status.js +42 -0
- package/node_modules/@agentims/runtime/dist/cli/account-commands.js +72 -0
- package/node_modules/@agentims/runtime/dist/cli/arguments.js +120 -0
- package/node_modules/@agentims/runtime/dist/cli/authentication.js +22 -0
- package/node_modules/@agentims/runtime/dist/cli/command-names.js +9 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/account-authorization.js +12 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/cache-inspection.js +8 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/cache.js +14 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/catalog.js +40 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/contacts.js +5 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/conversations.js +15 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/definition.js +9 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/deliveries-native.js +6 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/deliveries.js +10 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/devices-native.js +7 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/discovery.js +4 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/drafts.js +6 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/encryption-dehydration.js +13 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/encryption-native.js +9 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/encryption-recovery.js +11 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/encryption-reset.js +9 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/encryption-secrets.js +9 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/encryption.js +12 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/identity.js +10 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/location.js +7 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/matrix-capabilities.js +38 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/matrix-identity.js +12 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/matrix-rooms.js +23 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/media.js +12 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/messages-native.js +8 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/messages.js +10 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/native-inspection.js +24 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/native-preferences.js +11 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/native-requests.js +6 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/oauth.js +15 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/outbox.js +10 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/pairing.js +8 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/profiles.js +6 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/qr-authorization.js +6 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/reliability.js +8 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/room-management.js +17 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/rtc.js +14 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/search.js +11 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/sync-qr.js +9 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/timeline-native.js +10 -0
- package/node_modules/@agentims/runtime/dist/cli/commands/verification-native.js +7 -0
- package/node_modules/@agentims/runtime/dist/cli/errors.js +83 -0
- package/node_modules/@agentims/runtime/dist/cli/help.js +74 -0
- package/node_modules/@agentims/runtime/dist/cli/history-commands.js +13 -0
- package/node_modules/@agentims/runtime/dist/cli/input.js +82 -0
- package/node_modules/@agentims/runtime/dist/cli/main.js +19 -0
- package/node_modules/@agentims/runtime/dist/cli/output.js +71 -0
- package/node_modules/@agentims/runtime/dist/cli/password-input.js +36 -0
- package/node_modules/@agentims/runtime/dist/cli/run.js +90 -0
- package/node_modules/@agentims/runtime/dist/cli/update-commands.js +76 -0
- package/node_modules/@agentims/runtime/dist/configuration/account-credential.js +30 -0
- package/node_modules/@agentims/runtime/dist/configuration/connection-descriptor.js +18 -0
- package/node_modules/@agentims/runtime/dist/configuration/device-binding.js +41 -0
- package/node_modules/@agentims/runtime/dist/configuration/environment.js +43 -0
- package/node_modules/@agentims/runtime/dist/configuration/executable.js +49 -0
- package/node_modules/@agentims/runtime/dist/configuration/http.js +4 -0
- package/node_modules/@agentims/runtime/dist/configuration/native-settings.js +13 -0
- package/node_modules/@agentims/runtime/dist/configuration/node-version.js +8 -0
- package/node_modules/@agentims/runtime/dist/configuration/private-state.js +115 -0
- package/node_modules/@agentims/runtime/dist/configuration/service-origin.js +48 -0
- package/node_modules/@agentims/runtime/dist/configuration/windows-command.js +14 -0
- package/node_modules/@agentims/runtime/dist/configuration/windows-security.js +13 -0
- package/node_modules/@agentims/runtime/dist/history/backup.js +45 -0
- package/node_modules/@agentims/runtime/dist/history/online.js +48 -0
- package/node_modules/@agentims/runtime/dist/history/recovery-file.js +19 -0
- package/node_modules/@agentims/runtime/dist/history/restore.js +19 -0
- package/node_modules/@agentims/runtime/dist/index.js +31 -0
- package/node_modules/@agentims/runtime/dist/lifecycle/communication.js +66 -0
- package/node_modules/@agentims/runtime/dist/lifecycle/embedded.js +24 -0
- package/node_modules/@agentims/runtime/dist/lifecycle/foreground-connection.js +61 -0
- package/node_modules/@agentims/runtime/dist/lifecycle/foreground.js +47 -0
- package/node_modules/@agentims/runtime/dist/lifecycle/identity.js +46 -0
- package/node_modules/@agentims/runtime/dist/lifecycle/process-priority.js +22 -0
- package/node_modules/@agentims/runtime/dist/lifecycle/process.js +60 -0
- package/node_modules/@agentims/runtime/dist/lifecycle/shutdown-lease.js +90 -0
- package/node_modules/@agentims/runtime/dist/lifecycle/start.js +69 -0
- package/node_modules/@agentims/runtime/dist/managed/connection.js +29 -0
- package/node_modules/@agentims/runtime/dist/managed/control.js +134 -0
- package/node_modules/@agentims/runtime/dist/managed/directory.js +19 -0
- package/node_modules/@agentims/runtime/dist/managed/errors.js +9 -0
- package/node_modules/@agentims/runtime/dist/managed/lease.js +32 -0
- package/node_modules/@agentims/runtime/dist/managed/shutdown.js +63 -0
- package/node_modules/@agentims/runtime/dist/managed/state.js +82 -0
- package/node_modules/@agentims/runtime/dist/storage/archive.js +89 -0
- package/node_modules/@agentims/runtime/dist/supervision/command.js +13 -0
- package/node_modules/@agentims/runtime/dist/supervision/launchd.js +64 -0
- package/node_modules/@agentims/runtime/dist/supervision/select.js +13 -0
- package/node_modules/@agentims/runtime/dist/supervision/service.js +4 -0
- package/node_modules/@agentims/runtime/dist/supervision/systemd.js +34 -0
- package/node_modules/@agentims/runtime/dist/supervision/windows.js +20 -0
- package/node_modules/@agentims/runtime/dist/updates/activation.js +65 -0
- package/node_modules/@agentims/runtime/dist/updates/admission.js +15 -0
- package/node_modules/@agentims/runtime/dist/updates/archive.js +45 -0
- package/node_modules/@agentims/runtime/dist/updates/binding-preflight.js +25 -0
- package/node_modules/@agentims/runtime/dist/updates/continuity.js +45 -0
- package/node_modules/@agentims/runtime/dist/updates/device-archive.js +43 -0
- package/node_modules/@agentims/runtime/dist/updates/discovery.js +91 -0
- package/node_modules/@agentims/runtime/dist/updates/download.js +66 -0
- package/node_modules/@agentims/runtime/dist/updates/embedded.js +143 -0
- package/node_modules/@agentims/runtime/dist/updates/host-continuation.js +43 -0
- package/node_modules/@agentims/runtime/dist/updates/inspection-config.js +18 -0
- package/node_modules/@agentims/runtime/dist/updates/installation-integrity.js +35 -0
- package/node_modules/@agentims/runtime/dist/updates/installation.js +134 -0
- package/node_modules/@agentims/runtime/dist/updates/ledger.js +75 -0
- package/node_modules/@agentims/runtime/dist/updates/locking.js +17 -0
- package/node_modules/@agentims/runtime/dist/updates/managed.js +271 -0
- package/node_modules/@agentims/runtime/dist/updates/manifest.js +97 -0
- package/node_modules/@agentims/runtime/dist/updates/offline.js +56 -0
- package/node_modules/@agentims/runtime/dist/updates/owner.js +14 -0
- package/node_modules/@agentims/runtime/dist/updates/pending.js +20 -0
- package/node_modules/@agentims/runtime/dist/updates/policy.js +73 -0
- package/node_modules/@agentims/runtime/dist/updates/records.js +33 -0
- package/node_modules/@agentims/runtime/dist/updates/restart.js +80 -0
- package/node_modules/@agentims/runtime/dist/updates/shutdown-owner.js +74 -0
- package/node_modules/@agentims/runtime/dist/updates/shutdown-proof.js +35 -0
- package/node_modules/@agentims/runtime/dist/updates/types.js +16 -0
- package/node_modules/@agentims/runtime/dist/updates/version.js +40 -0
- package/node_modules/@agentims/runtime/dist/updates/watch.js +87 -0
- package/node_modules/@agentims/runtime/package.json +11 -0
- package/node_modules/@agentims/sdk/dist/api/client.js +15 -0
- package/node_modules/@agentims/sdk/dist/api/embedded-options.js +1 -0
- package/node_modules/@agentims/sdk/dist/api/embedded.js +28 -0
- package/node_modules/@agentims/sdk/dist/api/errors.js +43 -0
- package/node_modules/@agentims/sdk/dist/api/facade.js +92 -0
- package/node_modules/@agentims/sdk/dist/api/json-value.js +1 -0
- package/node_modules/@agentims/sdk/dist/api/options.js +1 -0
- package/node_modules/@agentims/sdk/dist/api/request-data.js +43 -0
- package/node_modules/@agentims/sdk/dist/api/sdk-info.js +9 -0
- package/node_modules/@agentims/sdk/dist/features/account/client.js +57 -0
- package/node_modules/@agentims/sdk/dist/features/account/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/account/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/cache/client.js +40 -0
- package/node_modules/@agentims/sdk/dist/features/cache/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/cache/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/configuration/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/configuration/schema.js +8 -0
- package/node_modules/@agentims/sdk/dist/features/configuration/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/contacts/client.js +12 -0
- package/node_modules/@agentims/sdk/dist/features/contacts/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/contacts/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/conversations/client.js +54 -0
- package/node_modules/@agentims/sdk/dist/features/conversations/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/conversations/matrix.js +61 -0
- package/node_modules/@agentims/sdk/dist/features/conversations/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/deliveries/client.js +41 -0
- package/node_modules/@agentims/sdk/dist/features/deliveries/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/deliveries/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/devices/client.js +36 -0
- package/node_modules/@agentims/sdk/dist/features/devices/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/devices/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/directory/client.js +36 -0
- package/node_modules/@agentims/sdk/dist/features/directory/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/directory/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/discovery/client.js +9 -0
- package/node_modules/@agentims/sdk/dist/features/discovery/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/discovery/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/drafts/client.js +16 -0
- package/node_modules/@agentims/sdk/dist/features/drafts/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/drafts/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/encryption/client.js +105 -0
- package/node_modules/@agentims/sdk/dist/features/encryption/dehydration.js +36 -0
- package/node_modules/@agentims/sdk/dist/features/encryption/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/encryption/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/events/client.js +45 -0
- package/node_modules/@agentims/sdk/dist/features/events/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/events/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/identity/client.js +77 -0
- package/node_modules/@agentims/sdk/dist/features/identity/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/identity/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/location/client.js +18 -0
- package/node_modules/@agentims/sdk/dist/features/location/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/location/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/media/client.js +34 -0
- package/node_modules/@agentims/sdk/dist/features/media/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/media/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/messages/client.js +43 -0
- package/node_modules/@agentims/sdk/dist/features/messages/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/messages/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/notifications/client.js +42 -0
- package/node_modules/@agentims/sdk/dist/features/notifications/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/notifications/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/oauth/client.js +52 -0
- package/node_modules/@agentims/sdk/dist/features/oauth/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/oauth/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/operations/client.js +16 -0
- package/node_modules/@agentims/sdk/dist/features/operations/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/operations/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/outbox/client.js +25 -0
- package/node_modules/@agentims/sdk/dist/features/outbox/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/outbox/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/pairing/client.js +48 -0
- package/node_modules/@agentims/sdk/dist/features/pairing/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/pairing/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/presence/client.js +15 -0
- package/node_modules/@agentims/sdk/dist/features/presence/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/presence/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/profiles/client.js +15 -0
- package/node_modules/@agentims/sdk/dist/features/profiles/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/profiles/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/reliability/client.js +32 -0
- package/node_modules/@agentims/sdk/dist/features/reliability/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/reliability/observe.js +48 -0
- package/node_modules/@agentims/sdk/dist/features/reliability/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/rooms/client.js +76 -0
- package/node_modules/@agentims/sdk/dist/features/rooms/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/rooms/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/rtc/client.js +39 -0
- package/node_modules/@agentims/sdk/dist/features/rtc/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/rtc/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/search/client.js +31 -0
- package/node_modules/@agentims/sdk/dist/features/search/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/search/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/sync/client.js +16 -0
- package/node_modules/@agentims/sdk/dist/features/sync/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/sync/types.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/timeline/client.js +27 -0
- package/node_modules/@agentims/sdk/dist/features/timeline/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/timeline/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/features/verification/client.js +33 -0
- package/node_modules/@agentims/sdk/dist/features/verification/index.js +1 -0
- package/node_modules/@agentims/sdk/dist/features/verification/types.js +3 -0
- package/node_modules/@agentims/sdk/dist/index.js +7 -0
- package/node_modules/@agentims/sdk/dist/internal/native/binding.js +85 -0
- package/node_modules/@agentims/sdk/dist/internal/native/platform-resource.js +15 -0
- package/node_modules/@agentims/sdk/dist/internal/native/secrets-export.js +27 -0
- package/node_modules/@agentims/sdk/dist/internal/native/transport.js +92 -0
- package/node_modules/@agentims/sdk/dist/internal/protocol/codec.js +69 -0
- package/node_modules/@agentims/sdk/dist/internal/protocol/input.js +38 -0
- package/node_modules/@agentims/sdk/dist/internal/protocol/native-settings.js +48 -0
- package/node_modules/@agentims/sdk/dist/internal/protocol/operations.json +1 -0
- package/node_modules/@agentims/sdk/dist/internal/protocol/registry.js +72 -0
- package/node_modules/@agentims/sdk/dist/internal/protocol/schema.js +133 -0
- package/node_modules/@agentims/sdk/dist/internal/transport/client.js +102 -0
- package/node_modules/@agentims/sdk/dist/internal/transport/error-diagnostics.js +50 -0
- package/node_modules/@agentims/sdk/dist/internal/transport/request.js +59 -0
- package/node_modules/@agentims/sdk/dist/internal/transport/response.js +94 -0
- package/node_modules/@agentims/sdk/dist/internal/transport/retry-after.js +21 -0
- package/node_modules/@agentims/sdk/dist/internal/transport/stream-diagnostics.js +19 -0
- package/node_modules/@agentims/sdk/dist/internal/transport/types.js +1 -0
- package/node_modules/@agentims/sdk/package.json +8 -0
- package/package.json +31 -4
- package/release.json +746 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { botCommandInventory, botId, } from '@agent-stack/contracts';
|
|
2
|
+
/** 只沿同 Owner 和原命令核对终态;确认时补原绑定,未开工交给正式恢复。 */
|
|
3
|
+
export async function restoreCreateOutcome(config, bridge, journal, snapshot, required, heldCommand) {
|
|
4
|
+
const inventory = botCommandInventory(await bridge.commandInventory(config.project, config.executionId, config.bridgeCredential));
|
|
5
|
+
if (inventory.executionId !== snapshot.binding.executionId ||
|
|
6
|
+
inventory.ownerEpoch !== snapshot.binding.ownerEpoch ||
|
|
7
|
+
inventory.missionRevision !== snapshot.mission.revision ||
|
|
8
|
+
inventory.nativeSessionRef !== null ||
|
|
9
|
+
inventory.pendingOnly ||
|
|
10
|
+
(inventory.history && inventory.history.count !== inventory.commands.length))
|
|
11
|
+
throw new Error('BOT_RECOVERY_INVENTORY_CHANGED');
|
|
12
|
+
const local = journal.recovery.history(config.executionId);
|
|
13
|
+
const matchingDispatch = (c) => (!heldCommand ||
|
|
14
|
+
(c.commandId === heldCommand.commandId && c.fingerprint === heldCommand.fingerprint)) &&
|
|
15
|
+
(!snapshot.runtimeOriginId || c.runtimeInstanceId === snapshot.runtimeOriginId) &&
|
|
16
|
+
local.find((entry) => entry.commandId === c.commandId &&
|
|
17
|
+
entry.fingerprint === c.fingerprint &&
|
|
18
|
+
(['SENDING', 'UNKNOWN'].includes(entry.phase) ||
|
|
19
|
+
(c.state === 'CONFIRMED' &&
|
|
20
|
+
entry.phase === 'BOUND' &&
|
|
21
|
+
entry.nativeSessionRef === c.nativeSessionRef)));
|
|
22
|
+
const creates = inventory.commands.filter((c) => c.operation === 'create');
|
|
23
|
+
const [original, ...other] = creates.filter((c) => c.state !== 'NOT_STARTED');
|
|
24
|
+
if (heldCommand &&
|
|
25
|
+
!original &&
|
|
26
|
+
creates.some((c) => c.state === 'NOT_STARTED' && matchingDispatch(c)))
|
|
27
|
+
return 'NOT_STARTED';
|
|
28
|
+
const dispatch = original?.state === 'CONFIRMED' && matchingDispatch(original);
|
|
29
|
+
if (!original || other.length || !dispatch) {
|
|
30
|
+
if (required)
|
|
31
|
+
throw new Error('BOT_RECOVERY_CONFIRMED_BINDING_UNAVAILABLE');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const nativeSessionRef = botId(original.nativeSessionRef);
|
|
35
|
+
// 先保存可补传的绑定观察;断电时至少可以通过原命令证明或原观察继续。
|
|
36
|
+
journal.recordObservation(config.executionId, {
|
|
37
|
+
observationId: original.commandId,
|
|
38
|
+
kind: 'native-bound',
|
|
39
|
+
missionRevision: original.missionRevision,
|
|
40
|
+
payload: { nativeSessionRef },
|
|
41
|
+
});
|
|
42
|
+
if (dispatch.phase !== 'BOUND')
|
|
43
|
+
journal.bindNative(config.executionId, original.commandId, nativeSessionRef);
|
|
44
|
+
return 'BOUND';
|
|
45
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { BotServiceRestart } from './service-restart.js';
|
|
2
|
+
import { BotAutomaticRecovery } from './automatic-recovery.js';
|
|
3
|
+
import { BotAutomaticPreparation } from './automatic-preparation.js';
|
|
4
|
+
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { canonicalBotJson, botCommandInventory, } from '@agent-stack/contracts';
|
|
6
|
+
import { isBotControlUnavailable } from '@agent-stack/bridge-client';
|
|
7
|
+
import { botNativeRecoveryInspection, } from '@agent-stack/runtime-contracts';
|
|
8
|
+
import { quarantineHostNative, installHostQuarantine } from './quarantine.js';
|
|
9
|
+
import { verifyHostAdmission } from './admission.js';
|
|
10
|
+
import { restoreCreateOutcome } from './confirmed-binding.js';
|
|
11
|
+
import { restoreColdDshCreate } from './prestart.js';
|
|
12
|
+
import { bridgeRecovery, recoveryFailure, readRuntimeReconciliation, } from '../continuation/reading.js';
|
|
13
|
+
import { restoredOriginalWriter } from './service-restart-view.js';
|
|
14
|
+
export class BotHostRecovery {
|
|
15
|
+
config;
|
|
16
|
+
bridge;
|
|
17
|
+
journal;
|
|
18
|
+
runtime;
|
|
19
|
+
ownerPending;
|
|
20
|
+
service;
|
|
21
|
+
automatic;
|
|
22
|
+
automaticRecovery;
|
|
23
|
+
/** 冷启动的路由尚未核明时,仅回读同一正式 Owner 链,不触及 Native 命令。 */
|
|
24
|
+
async startupOwner(guard) {
|
|
25
|
+
if (!this.ownerPending)
|
|
26
|
+
return true;
|
|
27
|
+
try {
|
|
28
|
+
const id = await this.bridge.resolveOwnerExecution(this.config.project, this.config.executionId, this.config.bridgeCredential, this.config.hostId);
|
|
29
|
+
guard();
|
|
30
|
+
this.config.executionId = id;
|
|
31
|
+
this.ownerPending = false;
|
|
32
|
+
this.failure = null;
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (!isBotControlUnavailable(error))
|
|
37
|
+
throw error;
|
|
38
|
+
this.recordFailure(error);
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
get checkingSource() {
|
|
43
|
+
return this.service.checkingSource || Boolean(this.config.automaticPreparation);
|
|
44
|
+
}
|
|
45
|
+
async prepareAutomatically(stopping, observed) {
|
|
46
|
+
const guard = () => {
|
|
47
|
+
if (stopping())
|
|
48
|
+
throw new Error('BOT_HOST_STOPPING');
|
|
49
|
+
};
|
|
50
|
+
// 退避期间也保留暂时断连的原因,执行准入依然关闭。
|
|
51
|
+
if (await this.service.tick(guard, observed))
|
|
52
|
+
return this.service.reconnecting ? 'RECONNECTING' : 'HELD';
|
|
53
|
+
return (await this.automaticRecovery.tick(guard)) ? 'HELD' : false;
|
|
54
|
+
}
|
|
55
|
+
resetExecution() {
|
|
56
|
+
this.intent = undefined;
|
|
57
|
+
this.localResume = undefined;
|
|
58
|
+
this.confirmedReadPending = false;
|
|
59
|
+
this.prestartRestorePending = false;
|
|
60
|
+
this.nextCreateCheckAtMs = null;
|
|
61
|
+
this.sourceReady = false;
|
|
62
|
+
this.failure = null;
|
|
63
|
+
this.firstFailure = null;
|
|
64
|
+
}
|
|
65
|
+
get serviceCapabilities() {
|
|
66
|
+
return this.service.capabilities;
|
|
67
|
+
}
|
|
68
|
+
/** 逻辑 Runtime 身份可复用。新的实际装回才重置意图,回包丢失沿本轮原 ID。 */
|
|
69
|
+
observeLocalResume(s, cap) {
|
|
70
|
+
if (!this.config.serviceRecovery || this.config.recoveryMode !== 'qualified')
|
|
71
|
+
return false;
|
|
72
|
+
if (!restoredOriginalWriter(cap, s, this.config.executionId)) {
|
|
73
|
+
// 旧 Native 无装回标识,以待确认信号的下降沿结束已确认的一轮。
|
|
74
|
+
if (!cap.serviceRecovery?.sameOwnerPending &&
|
|
75
|
+
this.localResume?.confirmed &&
|
|
76
|
+
!this.localResume.ref)
|
|
77
|
+
this.localResume = undefined;
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
const ref = cap.serviceRecovery?.sameOwnerResumeRef;
|
|
81
|
+
if (this.localResume && this.localResume.ref === ref)
|
|
82
|
+
return false;
|
|
83
|
+
this.localResume = { ref, confirmed: false };
|
|
84
|
+
this.intent = undefined;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
quarantine(requestId, install = false, assertPreparing) {
|
|
88
|
+
return (install === 'admit'
|
|
89
|
+
? verifyHostAdmission
|
|
90
|
+
: install
|
|
91
|
+
? installHostQuarantine
|
|
92
|
+
: quarantineHostNative)(this.config, this.bridge, this.runtime, this.journal.incarnationId, requestId, assertPreparing);
|
|
93
|
+
}
|
|
94
|
+
intent;
|
|
95
|
+
localResume;
|
|
96
|
+
sourceReady = false;
|
|
97
|
+
failure = null;
|
|
98
|
+
firstFailure = null;
|
|
99
|
+
confirmedReadPending = false;
|
|
100
|
+
prestartRestorePending = false;
|
|
101
|
+
nextCreateCheckAtMs = null;
|
|
102
|
+
/** 重新核对原派发的正式终态,保留落盘的命令和会话。 */
|
|
103
|
+
reconcileCommand(error) {
|
|
104
|
+
this.intent = undefined;
|
|
105
|
+
this.confirmedReadPending = error.message === 'BOT_COMMAND_CONFIRMED_READ_PENDING';
|
|
106
|
+
// Host 已经补过原绑定也可能尚未装回 Native,保留同一首轮前接续资格。
|
|
107
|
+
this.prestartRestorePending ||= this.confirmedReadPending;
|
|
108
|
+
this.journal.recoverDispatches(this.config.executionId);
|
|
109
|
+
this.recordFailure(error);
|
|
110
|
+
}
|
|
111
|
+
/** 晚到的原 create 终态先只读对账,状态未变时沿既有 HELD 记录等待。 */
|
|
112
|
+
async repairCreateOutcome(snapshot, coldStart, held) {
|
|
113
|
+
if (snapshot.binding.nativeSessionRef) {
|
|
114
|
+
this.confirmedReadPending = false;
|
|
115
|
+
this.nextCreateCheckAtMs = null;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const current = snapshot.mission.state === 'OPEN' && !snapshot.binding.fencedRef;
|
|
119
|
+
// 重启后以内存之外的原 dispatch 为线索,只允许正式已确认的原 create 补绑定。
|
|
120
|
+
const coldPending = coldStart &&
|
|
121
|
+
this.config.recoveryMode === 'qualified' &&
|
|
122
|
+
current &&
|
|
123
|
+
this.journal.recovery
|
|
124
|
+
.history(this.config.executionId)
|
|
125
|
+
.some(({ phase }) => ['SENDING', 'UNKNOWN', 'BOUND'].includes(phase));
|
|
126
|
+
const receipt = held && current && this.journal.recovery.inspect(this.config.executionId)?.receipt;
|
|
127
|
+
const command = receipt ? receipt.commands[0] : undefined;
|
|
128
|
+
const checkHeld = receipt &&
|
|
129
|
+
receipt.state === 'HELD' &&
|
|
130
|
+
receipt.reason === 'ORIGINAL_COMMAND_UNKNOWN' &&
|
|
131
|
+
receipt.nativeSessionRef === null &&
|
|
132
|
+
receipt.ownerEpoch === snapshot.binding.ownerEpoch &&
|
|
133
|
+
receipt.missionRevision === snapshot.mission.revision &&
|
|
134
|
+
receipt.commands.length === 1 &&
|
|
135
|
+
command?.state === 'UNKNOWN';
|
|
136
|
+
const now = Date.now();
|
|
137
|
+
if (!checkHeld)
|
|
138
|
+
this.nextCreateCheckAtMs = null;
|
|
139
|
+
if (!this.confirmedReadPending &&
|
|
140
|
+
!coldPending &&
|
|
141
|
+
(!checkHeld || (this.nextCreateCheckAtMs ?? 0) > now))
|
|
142
|
+
return;
|
|
143
|
+
// 只有一个待查创建时取原账本。低频补读不新增恢复意图、报文或定时器。
|
|
144
|
+
if (checkHeld)
|
|
145
|
+
this.nextCreateCheckAtMs = now + Math.max(15000, this.config.pollIntervalMs);
|
|
146
|
+
const outcome = await restoreCreateOutcome(this.config, this.bridge, this.journal, snapshot, this.confirmedReadPending, checkHeld ? command : undefined);
|
|
147
|
+
if (outcome) {
|
|
148
|
+
this.intent = undefined;
|
|
149
|
+
this.prestartRestorePending = true;
|
|
150
|
+
this.nextCreateCheckAtMs = null;
|
|
151
|
+
}
|
|
152
|
+
this.confirmedReadPending = false;
|
|
153
|
+
return outcome;
|
|
154
|
+
}
|
|
155
|
+
constructor(config, bridge, journal, runtime, qualify, ownerPending = false) {
|
|
156
|
+
this.config = config;
|
|
157
|
+
this.bridge = bridge;
|
|
158
|
+
this.journal = journal;
|
|
159
|
+
this.runtime = runtime;
|
|
160
|
+
this.ownerPending = ownerPending;
|
|
161
|
+
this.service = new BotServiceRestart(config, bridge, journal, runtime);
|
|
162
|
+
this.automatic = new BotAutomaticPreparation(config, bridge, journal, runtime);
|
|
163
|
+
this.automaticRecovery = new BotAutomaticRecovery(config, bridge, journal, runtime, this.automatic, qualify);
|
|
164
|
+
}
|
|
165
|
+
/** 补读完成只更新诊断,不再兑换恢复或普通执行许可。 */
|
|
166
|
+
recordReplay(complete) {
|
|
167
|
+
this.sourceReady ||= complete;
|
|
168
|
+
}
|
|
169
|
+
async inspectNative() {
|
|
170
|
+
if (!this.runtime.inspectNativeRecovery ||
|
|
171
|
+
!(await this.runtime.capabilities()).nativeRecoveryInspection)
|
|
172
|
+
throw new Error('BOT_NATIVE_INSPECTION_UNSUPPORTED');
|
|
173
|
+
// 冷恢复围栏不应封住只读诊断;复用已有获权恢复入口,仍在 Native 读取前后核对同一权威。
|
|
174
|
+
const load = () => this.config.serviceRecovery
|
|
175
|
+
? this.bridge.quarantineSnapshot(this.config.project, this.config.executionId, this.config.bridgeCredential)
|
|
176
|
+
: this.bridge.snapshot(this.config.project, this.config.executionId, this.config.bridgeCredential);
|
|
177
|
+
const s = await load();
|
|
178
|
+
if (s.binding.executionId !== this.config.executionId ||
|
|
179
|
+
s.binding.hostId !== this.config.hostId ||
|
|
180
|
+
s.binding.provider !== (this.config.runtimeProvider ?? 'codex'))
|
|
181
|
+
throw new Error('BOT_NATIVE_INSPECTION_CONTEXT');
|
|
182
|
+
const result = botNativeRecoveryInspection(await this.runtime.inspectNativeRecovery({
|
|
183
|
+
schemaVersion: 1,
|
|
184
|
+
executionId: this.config.executionId,
|
|
185
|
+
hostId: this.config.hostId,
|
|
186
|
+
project: this.config.project,
|
|
187
|
+
missionRevision: s.mission.revision,
|
|
188
|
+
controllerId: this.journal.incarnationId,
|
|
189
|
+
}), {
|
|
190
|
+
provider: s.binding.provider,
|
|
191
|
+
executionId: this.config.executionId,
|
|
192
|
+
nativeSessionRef: s.binding.nativeSessionRef,
|
|
193
|
+
});
|
|
194
|
+
const stamp = (v) => canonicalBotJson([
|
|
195
|
+
v.mission.revision,
|
|
196
|
+
v.binding.ownerEpoch,
|
|
197
|
+
v.binding.nativeSessionRef,
|
|
198
|
+
v.runtimeOriginId ?? null,
|
|
199
|
+
]);
|
|
200
|
+
if (stamp(s) !== stamp(await load()))
|
|
201
|
+
throw new Error('BOT_NATIVE_INSPECTION_CHANGED');
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
inspectHost(status, admissionHeld, stopRequested) {
|
|
205
|
+
return { status, admissionHeld, stopRequested, ...this.inspect() };
|
|
206
|
+
}
|
|
207
|
+
/** 最近的活动恢复故障和原退避来自恢复协调器,不读取历史或启动一次尝试。 */
|
|
208
|
+
get componentProgress() {
|
|
209
|
+
const { lastFailure, retryAtMs } = this.service.inspect();
|
|
210
|
+
return {
|
|
211
|
+
failures: [
|
|
212
|
+
this.failure && { reasonCode: this.failure.code, atMs: this.failure.observedAtMs },
|
|
213
|
+
lastFailure && { reasonCode: lastFailure.code, atMs: lastFailure.atMs },
|
|
214
|
+
],
|
|
215
|
+
retryAtMs: retryAtMs ?? this.nextCreateCheckAtMs,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
inspect() {
|
|
219
|
+
const record = this.journal.recovery.inspect(this.config.executionId);
|
|
220
|
+
return {
|
|
221
|
+
schemaVersion: 1,
|
|
222
|
+
automaticPreparation: this.automatic.inspect(),
|
|
223
|
+
automaticRecovery: this.automaticRecovery.inspect(),
|
|
224
|
+
serviceRecovery: this.service.inspect(),
|
|
225
|
+
executionId: this.config.executionId,
|
|
226
|
+
controllerId: this.journal.incarnationId,
|
|
227
|
+
observedAtMs: Date.now(),
|
|
228
|
+
sourceReplay: {
|
|
229
|
+
required: false,
|
|
230
|
+
complete: this.sourceReady,
|
|
231
|
+
},
|
|
232
|
+
lastFailure: this.failure,
|
|
233
|
+
firstFailure: this.firstFailure,
|
|
234
|
+
recovery: record
|
|
235
|
+
? {
|
|
236
|
+
stage: record.stage,
|
|
237
|
+
recordedAtMs: record.recordedAtMs,
|
|
238
|
+
recoveryId: record.intent.recoveryId,
|
|
239
|
+
controllerId: record.intent.controllerId,
|
|
240
|
+
missionRevision: record.intent.missionRevision,
|
|
241
|
+
ownerEpoch: record.intent.ownerEpoch,
|
|
242
|
+
nativeSessionRef: record.intent.nativeSessionRef,
|
|
243
|
+
mode: record.intent.mode,
|
|
244
|
+
currentController: record.intent.controllerId === this.journal.incarnationId,
|
|
245
|
+
state: record.receipt?.state ?? null,
|
|
246
|
+
reason: record.receipt?.reason ?? null,
|
|
247
|
+
effectsClear: record.receipt?.effectsClear ?? false,
|
|
248
|
+
commandCount: record.commandCount,
|
|
249
|
+
}
|
|
250
|
+
: null,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
async reconcile(s, mode = 'reconcile') {
|
|
254
|
+
try {
|
|
255
|
+
const receipt = await this.perform(s, mode);
|
|
256
|
+
this.failure = null;
|
|
257
|
+
return receipt;
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
this.recordFailure(error);
|
|
261
|
+
throw error;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
recordFailure(error) {
|
|
265
|
+
this.failure = recoveryFailure(error);
|
|
266
|
+
this.firstFailure ??= this.failure;
|
|
267
|
+
}
|
|
268
|
+
async perform(s, mode) {
|
|
269
|
+
const reconcile = this.runtime.reconcile?.bind(this.runtime);
|
|
270
|
+
if (!reconcile)
|
|
271
|
+
throw new Error('BOT_RECOVERY_UNQUALIFIED');
|
|
272
|
+
if (mode === 'reconcile') {
|
|
273
|
+
await restoreColdDshCreate(this.config, this.bridge, this.runtime, this.journal.incarnationId, s, this.prestartRestorePending);
|
|
274
|
+
this.prestartRestorePending = false;
|
|
275
|
+
}
|
|
276
|
+
if (this.intent?.mode !== mode)
|
|
277
|
+
this.intent = undefined;
|
|
278
|
+
this.intent ??= {
|
|
279
|
+
recoveryId: randomUUID(),
|
|
280
|
+
controllerId: this.journal.incarnationId,
|
|
281
|
+
missionRevision: s.mission.revision,
|
|
282
|
+
ownerEpoch: s.binding.ownerEpoch,
|
|
283
|
+
nativeSessionRef: s.binding.nativeSessionRef,
|
|
284
|
+
mode,
|
|
285
|
+
};
|
|
286
|
+
const intent = this.intent;
|
|
287
|
+
if (intent.mode !== mode ||
|
|
288
|
+
intent.missionRevision !== s.mission.revision ||
|
|
289
|
+
intent.ownerEpoch !== s.binding.ownerEpoch ||
|
|
290
|
+
intent.nativeSessionRef !== s.binding.nativeSessionRef)
|
|
291
|
+
throw new Error('BOT_RECOVERY_REVISION_CHANGED');
|
|
292
|
+
const local = mode === 'reconcile' && this.localResume && !this.localResume.confirmed;
|
|
293
|
+
const inventory = local
|
|
294
|
+
? undefined
|
|
295
|
+
: botCommandInventory(await bridgeRecovery('inventory', () => this.bridge.commandInventory(this.config.project, this.config.executionId, this.config.bridgeCredential, {
|
|
296
|
+
pendingOnly: true,
|
|
297
|
+
})));
|
|
298
|
+
if (inventory &&
|
|
299
|
+
(inventory.executionId !== s.binding.executionId ||
|
|
300
|
+
inventory.missionRevision !== intent.missionRevision ||
|
|
301
|
+
inventory.ownerEpoch !== intent.ownerEpoch ||
|
|
302
|
+
inventory.nativeSessionRef !== intent.nativeSessionRef))
|
|
303
|
+
throw new Error('BOT_RECOVERY_INVENTORY_CHANGED');
|
|
304
|
+
const commands = this.journal.recovery.begin(this.config.executionId, intent, inventory?.commands.map(({ commandId, fingerprint }) => ({ commandId, fingerprint })));
|
|
305
|
+
if (!local) {
|
|
306
|
+
const accepted = await bridgeRecovery('prepare', () => this.bridge.prepareRecovery(this.config.project, this.config.executionId, this.config.bridgeCredential, intent));
|
|
307
|
+
if (canonicalBotJson(accepted) !== canonicalBotJson(intent))
|
|
308
|
+
throw new Error('BOT_RECOVERY_INTENT_MISMATCH');
|
|
309
|
+
}
|
|
310
|
+
// 外接原生对账及其活动读回独立标记断线,Bridge 验证与拒绝沿原规则。
|
|
311
|
+
const context = {
|
|
312
|
+
schemaVersion: 1,
|
|
313
|
+
project: this.config.project,
|
|
314
|
+
executionId: this.config.executionId,
|
|
315
|
+
hostId: this.config.hostId,
|
|
316
|
+
missionRevision: s.mission.revision,
|
|
317
|
+
controllerId: this.journal.incarnationId,
|
|
318
|
+
};
|
|
319
|
+
const receipt = this.journal.recovery.validate(await readRuntimeReconciliation(() => reconcile({ context, intent, commands })));
|
|
320
|
+
if (receipt.executionId !== this.config.executionId ||
|
|
321
|
+
receipt.nativeSessionRef !== s.binding.nativeSessionRef ||
|
|
322
|
+
receipt.commands.length !== commands.length)
|
|
323
|
+
throw new Error('BOT_RECOVERY_RECEIPT_INVALID');
|
|
324
|
+
if (receipt.state === 'ATTACHED') {
|
|
325
|
+
const live = await readRuntimeReconciliation(() => this.runtime.execute({
|
|
326
|
+
context,
|
|
327
|
+
commandId: intent.recoveryId + '-read',
|
|
328
|
+
operation: 'read',
|
|
329
|
+
}));
|
|
330
|
+
if (live.schemaVersion !== 1 ||
|
|
331
|
+
live.provider !== (this.config.runtimeProvider ?? 'codex') ||
|
|
332
|
+
live.executionId !== this.config.executionId ||
|
|
333
|
+
live.nativeSessionRef !== s.binding.nativeSessionRef)
|
|
334
|
+
throw new Error('BOT_RECOVERY_NATIVE_CHANGED');
|
|
335
|
+
// 身份、活动形状与准入分别给固定原因,首次失败可与后续 connection-stop 的 held 区分。
|
|
336
|
+
if (!live.activity || !['ACTIVE', 'IDLE', 'HELD'].includes(live.activity.state))
|
|
337
|
+
throw new Error('BOT_RECOVERY_NATIVE_ACTIVITY_INVALID');
|
|
338
|
+
if (live.activity.state === 'ACTIVE' &&
|
|
339
|
+
(typeof live.activity.turnRef !== 'string' || !live.activity.turnRef))
|
|
340
|
+
throw new Error('BOT_RECOVERY_NATIVE_TURN_MISSING');
|
|
341
|
+
if (live.activity.state !== 'ACTIVE' && live.activity.turnRef !== null)
|
|
342
|
+
throw new Error('BOT_RECOVERY_NATIVE_TURN_UNEXPECTED');
|
|
343
|
+
if (live.activity.state === 'HELD' && (!s.correction || s.correction.state === 'ADOPTED'))
|
|
344
|
+
throw new Error('BOT_RECOVERY_NATIVE_HELD');
|
|
345
|
+
}
|
|
346
|
+
this.journal.recovery.confirm(receipt);
|
|
347
|
+
if (local && this.localResume)
|
|
348
|
+
this.localResume.confirmed = true;
|
|
349
|
+
return receipt;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { isAbsolute } from 'node:path';
|
|
2
|
+
import { botChoice, botId, botObject, botText } from '@agent-stack/contracts';
|
|
3
|
+
export function automaticRecoveryPolicy(raw, preparation) {
|
|
4
|
+
const v = botObject(raw, [
|
|
5
|
+
'mode',
|
|
6
|
+
'requestId',
|
|
7
|
+
'deploymentPath',
|
|
8
|
+
'qualificationPath',
|
|
9
|
+
'releasePath',
|
|
10
|
+
]);
|
|
11
|
+
if (!preparation || preparation.requestId !== v.requestId)
|
|
12
|
+
throw new Error('BOT_AUTO_RECOVERY_PREPARATION_REQUIRED');
|
|
13
|
+
const path = (raw) => {
|
|
14
|
+
const value = botText(raw);
|
|
15
|
+
if (!isAbsolute(value))
|
|
16
|
+
throw new Error('BOT_AUTO_RECOVERY_ABSOLUTE_PATH_REQUIRED');
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
mode: botChoice(v.mode, ['qualified']),
|
|
21
|
+
requestId: botId(v.requestId),
|
|
22
|
+
deploymentPath: path(v.deploymentPath),
|
|
23
|
+
qualificationPath: path(v.qualificationPath),
|
|
24
|
+
releasePath: path(v.releasePath),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { botChoice, botId, botInteger, botObject, isBotNativeVersion, } from '@agent-stack/contracts';
|
|
2
|
+
export function automaticPreparationPolicy(raw) {
|
|
3
|
+
const v = botObject(raw, [
|
|
4
|
+
'mode',
|
|
5
|
+
'requestId',
|
|
6
|
+
'executionId',
|
|
7
|
+
'provider',
|
|
8
|
+
'nativeVersion',
|
|
9
|
+
'platform',
|
|
10
|
+
'notBeforeMs',
|
|
11
|
+
'expiresAtMs',
|
|
12
|
+
]);
|
|
13
|
+
const provider = botChoice(v.provider, ['codex', 'dsh']);
|
|
14
|
+
const notBeforeMs = botInteger(v.notBeforeMs, 1), expiresAtMs = botInteger(v.expiresAtMs, 1);
|
|
15
|
+
if (!isBotNativeVersion(v.nativeVersion) ||
|
|
16
|
+
expiresAtMs <= notBeforeMs ||
|
|
17
|
+
expiresAtMs - notBeforeMs > 86400000)
|
|
18
|
+
throw new Error('BOT_AUTO_PREPARATION_POLICY_INVALID');
|
|
19
|
+
return {
|
|
20
|
+
mode: botChoice(v.mode, ['prepare']),
|
|
21
|
+
requestId: botId(v.requestId),
|
|
22
|
+
executionId: botId(v.executionId),
|
|
23
|
+
provider,
|
|
24
|
+
// 固定目标由部署者决定;采用时继续与 capabilities 精确匹配,不能用旧常量覆盖。
|
|
25
|
+
nativeVersion: v.nativeVersion,
|
|
26
|
+
platform: botChoice(v.platform, ['linux', 'darwin', 'win32']),
|
|
27
|
+
notBeforeMs,
|
|
28
|
+
expiresAtMs,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { botCommandInventory, botObject } from '@agent-stack/contracts';
|
|
2
|
+
/** 首轮前恢复原实例或已确认的 Session,开工仍由正式 reconcile 授权。 */
|
|
3
|
+
export async function restoreColdDshCreate(config, bridge, runtime, controllerId, snapshot, restorePending) {
|
|
4
|
+
const { binding: b, mission: m, runtimeOriginId } = snapshot;
|
|
5
|
+
if ((b.nativeSessionRef && config.serviceRecovery && !restorePending) ||
|
|
6
|
+
b.provider !== 'dsh' ||
|
|
7
|
+
!runtime.restartService ||
|
|
8
|
+
!runtimeOriginId ||
|
|
9
|
+
m.state !== 'OPEN' ||
|
|
10
|
+
b.adoptedRevision !== null ||
|
|
11
|
+
b.fencedRef ||
|
|
12
|
+
b.quiescenceRef ||
|
|
13
|
+
b.recoveryRef ||
|
|
14
|
+
snapshot.recovery?.checkpoint?.goalRef ||
|
|
15
|
+
snapshot.correction ||
|
|
16
|
+
snapshot.preservedGoal ||
|
|
17
|
+
snapshot.inheritedCheckpoint)
|
|
18
|
+
return;
|
|
19
|
+
const cap = await runtime.capabilities();
|
|
20
|
+
if (!cap.durableCommands ||
|
|
21
|
+
(!b.nativeSessionRef && !cap.createPreflight) ||
|
|
22
|
+
(!restorePending && cap.runtimeInstanceId === runtimeOriginId))
|
|
23
|
+
return;
|
|
24
|
+
const context = {
|
|
25
|
+
schemaVersion: 1,
|
|
26
|
+
executionId: b.executionId,
|
|
27
|
+
hostId: config.hostId,
|
|
28
|
+
project: config.project,
|
|
29
|
+
missionRevision: m.revision,
|
|
30
|
+
controllerId,
|
|
31
|
+
};
|
|
32
|
+
if (b.nativeSessionRef && cap.runtimeInstanceId === runtimeOriginId) {
|
|
33
|
+
// 回包丢失可能只影响 Host;仍在运行的原写者继续使用,不调用重启。
|
|
34
|
+
const native = await runtime.execute({
|
|
35
|
+
context,
|
|
36
|
+
operation: 'read',
|
|
37
|
+
commandId: 'prestart-read-' + b.executionId,
|
|
38
|
+
});
|
|
39
|
+
if (native.nativeSessionRef === b.nativeSessionRef && botObject(native.native).held === false)
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const inventory = botCommandInventory(await bridge.commandInventory(config.project, config.executionId, config.bridgeCredential));
|
|
43
|
+
// 只有曾进入原生创建的命令参与旧会话接续。
|
|
44
|
+
const [create, ...other] = inventory.commands.filter((c) => c.state !== 'NOT_STARTED');
|
|
45
|
+
if (inventory.executionId !== b.executionId ||
|
|
46
|
+
inventory.ownerEpoch !== b.ownerEpoch ||
|
|
47
|
+
inventory.missionRevision !== m.revision ||
|
|
48
|
+
inventory.nativeSessionRef !== b.nativeSessionRef ||
|
|
49
|
+
other.length > 0 ||
|
|
50
|
+
(inventory.history && inventory.history.count !== inventory.commands.length) ||
|
|
51
|
+
(b.nativeSessionRef
|
|
52
|
+
? create?.operation !== 'create' ||
|
|
53
|
+
create.state !== 'CONFIRMED' ||
|
|
54
|
+
create.runtimeInstanceId !== runtimeOriginId ||
|
|
55
|
+
create.nativeSessionRef !== b.nativeSessionRef
|
|
56
|
+
: create !== undefined))
|
|
57
|
+
return;
|
|
58
|
+
// 晚到的未开工终态也要重新装回原逻辑实例,旧同名 Runtime 可能已封存。
|
|
59
|
+
const restored = botObject(await runtime.restartService(context), ['state']);
|
|
60
|
+
if (restored.state !== 'PRESTART_ATTACHED')
|
|
61
|
+
throw new Error('BOT_RECOVERY_CONFIRMED_BINDING_UNAVAILABLE');
|
|
62
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { nativeBotGoalWindowStopped, ongoingBotGoalWindow, botId, botQuarantineRecord, botQuarantineTicket, botQuarantineReceipt, botQuarantineInstallationReceipt, canonicalBotJson, isBotNativeVersion, } from '@agent-stack/contracts';
|
|
2
|
+
import { botNativeRecoveryInspection } from '@agent-stack/runtime-contracts';
|
|
3
|
+
/** Held quarantine only. No SQLite grants, command dispatches or Runtime activation. */
|
|
4
|
+
export async function quarantineHostNative(config, bridge, runtime, controllerId, requestId, assertPreparing = () => { }) {
|
|
5
|
+
assertPreparing();
|
|
6
|
+
botId(requestId);
|
|
7
|
+
// Native 叶子声明真实能力;Host 只核对协议和候选一致性,不复制发行号白名单。
|
|
8
|
+
const cap = await runtime.capabilities();
|
|
9
|
+
if (cap.schemaVersion !== 1 ||
|
|
10
|
+
cap.mode !== 'bot' ||
|
|
11
|
+
!isBotNativeVersion(cap.nativeVersion) ||
|
|
12
|
+
cap.automaticResume !== false ||
|
|
13
|
+
cap.provider !== (config.runtimeProvider ?? 'codex') ||
|
|
14
|
+
cap.nativeRecoveryQuarantine !== true ||
|
|
15
|
+
!runtime.quarantineNativeRecovery ||
|
|
16
|
+
!runtime.inspectNativeRecovery ||
|
|
17
|
+
!cap.runtimeInstanceId)
|
|
18
|
+
throw new Error('BOT_NATIVE_QUARANTINE_UNSUPPORTED');
|
|
19
|
+
botId(cap.runtimeInstanceId);
|
|
20
|
+
const load = () => bridge.quarantineSnapshot(config.project, config.executionId, config.bridgeCredential);
|
|
21
|
+
assertPreparing();
|
|
22
|
+
const current = await load(), b = current.binding;
|
|
23
|
+
if (b.executionId !== config.executionId ||
|
|
24
|
+
b.hostId !== config.hostId ||
|
|
25
|
+
b.provider !== (config.runtimeProvider ?? 'codex') ||
|
|
26
|
+
!b.fencedRef ||
|
|
27
|
+
current.recovery?.state !== 'FENCED' ||
|
|
28
|
+
b.ownerEpoch !== current.mission.ownerEpoch)
|
|
29
|
+
throw new Error('BOT_QUARANTINE_FENCE_REQUIRED');
|
|
30
|
+
const read = await bridge.quarantine(config.project, config.executionId, config.bridgeCredential, { operation: 'read', requestId });
|
|
31
|
+
const existing = botQuarantineRecord(read);
|
|
32
|
+
let ticket = existing?.ticket;
|
|
33
|
+
if (!ticket) {
|
|
34
|
+
assertPreparing();
|
|
35
|
+
const inspection = botNativeRecoveryInspection(await runtime.inspectNativeRecovery({
|
|
36
|
+
schemaVersion: 1,
|
|
37
|
+
executionId: config.executionId,
|
|
38
|
+
hostId: config.hostId,
|
|
39
|
+
project: config.project,
|
|
40
|
+
missionRevision: current.mission.revision,
|
|
41
|
+
controllerId,
|
|
42
|
+
}), {
|
|
43
|
+
provider: config.runtimeProvider ?? 'codex',
|
|
44
|
+
executionId: config.executionId,
|
|
45
|
+
nativeSessionRef: b.nativeSessionRef,
|
|
46
|
+
});
|
|
47
|
+
if (inspection.state !== 'OBSERVED' ||
|
|
48
|
+
inspection.nativeVersion !== cap.nativeVersion ||
|
|
49
|
+
!inspection.recordDigest ||
|
|
50
|
+
inspection.latestTurn?.state !== 'CLOSED' ||
|
|
51
|
+
!inspection.goal ||
|
|
52
|
+
(inspection.goal?.status !== 'paused' &&
|
|
53
|
+
!nativeBotGoalWindowStopped(inspection.goal, ongoingBotGoalWindow(current))))
|
|
54
|
+
throw new Error('BOT_QUARANTINE_NATIVE_NOT_READY');
|
|
55
|
+
assertPreparing();
|
|
56
|
+
ticket = botQuarantineTicket(await bridge.quarantine(config.project, config.executionId, config.bridgeCredential, {
|
|
57
|
+
operation: 'prepare',
|
|
58
|
+
input: {
|
|
59
|
+
requestId,
|
|
60
|
+
controllerId,
|
|
61
|
+
runtimeInstanceId: cap.runtimeInstanceId,
|
|
62
|
+
missionRevision: current.mission.revision,
|
|
63
|
+
ownerEpoch: b.ownerEpoch,
|
|
64
|
+
inspection: {
|
|
65
|
+
nativeVersion: inspection.nativeVersion,
|
|
66
|
+
recordDigest: inspection.recordDigest,
|
|
67
|
+
goalRef: inspection.goal.ref,
|
|
68
|
+
goalLimit: inspection.goal.limit,
|
|
69
|
+
goalUsed: inspection.goal.used,
|
|
70
|
+
...(inspection.goal.goalWindow ? { goalWindow: inspection.goal.goalWindow } : {}),
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
const check = (s) => {
|
|
76
|
+
assertPreparing();
|
|
77
|
+
if (ticket.runtimeInstanceId !== cap.runtimeInstanceId ||
|
|
78
|
+
ticket.nativeVersion !== cap.nativeVersion ||
|
|
79
|
+
ticket.executionId !== config.executionId ||
|
|
80
|
+
ticket.requestId !== requestId ||
|
|
81
|
+
ticket.runtimeOriginId !== s.runtimeOriginId ||
|
|
82
|
+
ticket.missionRevision !== s.mission.revision ||
|
|
83
|
+
ticket.ownerEpoch !== s.binding.ownerEpoch ||
|
|
84
|
+
ticket.nativeSessionRef !== s.binding.nativeSessionRef ||
|
|
85
|
+
ticket.fenceRef !== s.binding.fencedRef ||
|
|
86
|
+
s.mission.state !== 'OPEN' ||
|
|
87
|
+
s.recovery?.state !== 'FENCED' ||
|
|
88
|
+
canonicalBotJson(ticket.checkpoint) !== canonicalBotJson(s.recovery.checkpoint) ||
|
|
89
|
+
ticket.expiresAtMs <= Date.now())
|
|
90
|
+
throw new Error('BOT_QUARANTINE_TICKET_STALE');
|
|
91
|
+
};
|
|
92
|
+
check(await load());
|
|
93
|
+
const receipt = botQuarantineReceipt(await runtime.quarantineNativeRecovery({
|
|
94
|
+
schemaVersion: 1,
|
|
95
|
+
executionId: config.executionId,
|
|
96
|
+
hostId: config.hostId,
|
|
97
|
+
project: config.project,
|
|
98
|
+
missionRevision: ticket.missionRevision,
|
|
99
|
+
controllerId: ticket.controllerId,
|
|
100
|
+
}, ticket), ticket);
|
|
101
|
+
check(await load());
|
|
102
|
+
if (receipt.ticket.runtimeInstanceId === current.runtimeOriginId)
|
|
103
|
+
throw new Error('BOT_QUARANTINE_RUNTIME_UNCHANGED');
|
|
104
|
+
assertPreparing();
|
|
105
|
+
return receipt;
|
|
106
|
+
}
|
|
107
|
+
/** Material and credentials are installed by Native and never pass through this Host. */
|
|
108
|
+
export async function installHostQuarantine(config, bridge, runtime, controllerId, requestId, assertPreparing = () => { }) {
|
|
109
|
+
assertPreparing();
|
|
110
|
+
const cap = await runtime.capabilities();
|
|
111
|
+
assertPreparing();
|
|
112
|
+
if (cap.nativeQuarantineContextInstallation !== true || !runtime.installQuarantineContext)
|
|
113
|
+
throw new Error('BOT_QUARANTINE_INSTALL_UNSUPPORTED');
|
|
114
|
+
const sealed = await quarantineHostNative(config, bridge, runtime, controllerId, requestId, assertPreparing), ticket = sealed.ticket;
|
|
115
|
+
assertPreparing();
|
|
116
|
+
const receipt = botQuarantineInstallationReceipt(await runtime.installQuarantineContext({
|
|
117
|
+
schemaVersion: 1,
|
|
118
|
+
executionId: config.executionId,
|
|
119
|
+
hostId: config.hostId,
|
|
120
|
+
project: config.project,
|
|
121
|
+
missionRevision: ticket.missionRevision,
|
|
122
|
+
controllerId: ticket.controllerId,
|
|
123
|
+
}, ticket));
|
|
124
|
+
assertPreparing();
|
|
125
|
+
const m = receipt.manifest;
|
|
126
|
+
if (m.requestId !== requestId ||
|
|
127
|
+
m.executionId !== config.executionId ||
|
|
128
|
+
m.runtimeInstanceId !== ticket.runtimeInstanceId ||
|
|
129
|
+
m.writerRef !== sealed.writerRef ||
|
|
130
|
+
m.missionRevision !== ticket.missionRevision ||
|
|
131
|
+
m.expiresAtMs !== ticket.expiresAtMs ||
|
|
132
|
+
m.ownerEpoch !== ticket.ownerEpoch ||
|
|
133
|
+
receipt.nativeRecordDigest !== sealed.loadedRecordDigest ||
|
|
134
|
+
ticket.expiresAtMs <= Date.now())
|
|
135
|
+
throw new Error('BOT_QUARANTINE_INSTALLATION_STALE');
|
|
136
|
+
const formal = botQuarantineInstallationReceipt(await bridge.quarantine(config.project, config.executionId, config.bridgeCredential, {
|
|
137
|
+
operation: 'installation',
|
|
138
|
+
requestId,
|
|
139
|
+
}), m);
|
|
140
|
+
if (canonicalBotJson(formal) !== canonicalBotJson(receipt))
|
|
141
|
+
throw new Error('BOT_QUARANTINE_INSTALLATION_MISMATCH');
|
|
142
|
+
const latest = await bridge.quarantineSnapshot(config.project, config.executionId, config.bridgeCredential);
|
|
143
|
+
if (latest.mission.revision !== ticket.missionRevision ||
|
|
144
|
+
latest.mission.ownerEpoch !== ticket.ownerEpoch ||
|
|
145
|
+
latest.mission.state !== 'OPEN' ||
|
|
146
|
+
latest.binding.fencedRef !== ticket.fenceRef ||
|
|
147
|
+
latest.runtimeOriginId !== ticket.runtimeOriginId ||
|
|
148
|
+
latest.binding.nativeSessionRef !== ticket.nativeSessionRef ||
|
|
149
|
+
latest.recovery?.state !== 'FENCED')
|
|
150
|
+
throw new Error('BOT_QUARANTINE_INSTALLATION_STALE');
|
|
151
|
+
assertPreparing();
|
|
152
|
+
return receipt;
|
|
153
|
+
}
|