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,32 @@
|
|
|
1
|
+
import { listeningStatus } from '../continuation/listening.js';
|
|
2
|
+
/** 本机独占装回只允许原逻辑 Runtime 继续,正式写权仍取本轮回执。 */
|
|
3
|
+
export function restoredOriginalWriter(cap, source, executionId) {
|
|
4
|
+
return Boolean(cap.serviceRecovery?.protocol === 'native-exclusive-v1' &&
|
|
5
|
+
cap.serviceRecovery.state === 'LIVE' &&
|
|
6
|
+
cap.serviceRecovery.sameOwnerPending &&
|
|
7
|
+
source?.binding.executionId === executionId &&
|
|
8
|
+
source.binding.provider === cap.provider &&
|
|
9
|
+
source.mission.state === 'OPEN' &&
|
|
10
|
+
source.binding.ownerEpoch === source.mission.ownerEpoch &&
|
|
11
|
+
source.runtimeOriginId === cap.runtimeInstanceId &&
|
|
12
|
+
source.binding.nativeSessionRef &&
|
|
13
|
+
!source.binding.fencedRef);
|
|
14
|
+
}
|
|
15
|
+
/** 只投影原观测回证,诊断读取不申请 Owner 或恢复资格。 */
|
|
16
|
+
export function serviceRecoveryEvidence(evidence, state) {
|
|
17
|
+
if (!evidence)
|
|
18
|
+
return null;
|
|
19
|
+
const listening = listeningStatus(evidence, state);
|
|
20
|
+
return {
|
|
21
|
+
executionId: evidence.binding.executionId,
|
|
22
|
+
observedAtMs: evidence.observedAtMs,
|
|
23
|
+
recoveryState: evidence.recovery?.state ?? null,
|
|
24
|
+
recoveryReason: evidence.recovery?.reason ?? null,
|
|
25
|
+
effectsClear: evidence.recovery?.effectsClear ?? false,
|
|
26
|
+
listening: {
|
|
27
|
+
state: listening.state,
|
|
28
|
+
observedAtMs: listening.observedAtMs,
|
|
29
|
+
...('eventState' in listening ? { eventState: listening.eventState } : {}),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { canonicalBotJson, isBotNativeVersion, hasSameNativeMcpResume, } from '@agent-stack/contracts';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { isBotControlUnavailable } from '@agent-stack/bridge-client';
|
|
4
|
+
import { bridgeRecovery, readCapabilities } from '../continuation/reading.js';
|
|
5
|
+
import { restoredOriginalWriter, serviceRecoveryEvidence, } from './service-restart-view.js';
|
|
6
|
+
import { prepareHostAdmission } from './admission.js';
|
|
7
|
+
import { activateHostNative, activatePreparedHostNative, canReplaceExpiredServiceOwner, readHostOwnerProgress, recordInheritedWait, } from './activation.js';
|
|
8
|
+
const digest = (x) => createHash('sha256').update(canonicalBotJson(x)).digest('hex');
|
|
9
|
+
/** 同机接续复用已取得独占锁的原写者,Owner 变更沿正式围栏。 */
|
|
10
|
+
export class BotServiceRestart {
|
|
11
|
+
config;
|
|
12
|
+
bridge;
|
|
13
|
+
journal;
|
|
14
|
+
runtime;
|
|
15
|
+
source;
|
|
16
|
+
firstFailure = null;
|
|
17
|
+
lastFailure = null;
|
|
18
|
+
observedRequestId = null;
|
|
19
|
+
progressEvidence = null;
|
|
20
|
+
reason = null;
|
|
21
|
+
evidence;
|
|
22
|
+
state = 'DISABLED';
|
|
23
|
+
retryAt = 0;
|
|
24
|
+
retryDelay = 0;
|
|
25
|
+
preparationFailed = false;
|
|
26
|
+
capabilities;
|
|
27
|
+
constructor(config, bridge, journal, runtime) {
|
|
28
|
+
this.config = config;
|
|
29
|
+
this.bridge = bridge;
|
|
30
|
+
this.journal = journal;
|
|
31
|
+
this.runtime = runtime;
|
|
32
|
+
}
|
|
33
|
+
/** 正式阶段、最近一次故障与原请求分别显示,避免历史失败冒充当前阻塞原因。 */
|
|
34
|
+
inspect() {
|
|
35
|
+
return {
|
|
36
|
+
state: this.state,
|
|
37
|
+
reason: this.reason,
|
|
38
|
+
requestId: this.source?.requestId ?? this.observedRequestId,
|
|
39
|
+
progress: this.progressEvidence,
|
|
40
|
+
sourceEvidence: serviceRecoveryEvidence(this.evidence, this.state),
|
|
41
|
+
firstFailure: this.firstFailure,
|
|
42
|
+
lastFailure: this.lastFailure,
|
|
43
|
+
retryAtMs: Date.now() < this.retryAt ? this.retryAt : null,
|
|
44
|
+
executionAllowed: false,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
get reconnecting() {
|
|
48
|
+
return this.state === 'RECONNECTING';
|
|
49
|
+
}
|
|
50
|
+
get checkingSource() {
|
|
51
|
+
return this.config.serviceRecovery && this.state !== 'LIVE';
|
|
52
|
+
}
|
|
53
|
+
recordFailure(error) {
|
|
54
|
+
const message = error instanceof Error ? error.message : '';
|
|
55
|
+
const code = /^(BOT|JOURNAL)_[A-Z0-9_]{1,100}$/.test(message)
|
|
56
|
+
? message
|
|
57
|
+
: 'BOT_SERVICE_RESTART_UNRESOLVED';
|
|
58
|
+
this.lastFailure = { code, atMs: Date.now() };
|
|
59
|
+
this.firstFailure ??= this.lastFailure;
|
|
60
|
+
return code;
|
|
61
|
+
}
|
|
62
|
+
live() {
|
|
63
|
+
this.source = undefined;
|
|
64
|
+
this.observedRequestId = null;
|
|
65
|
+
this.progressEvidence = null;
|
|
66
|
+
this.evidence = undefined;
|
|
67
|
+
this.reason = null;
|
|
68
|
+
this.firstFailure = null;
|
|
69
|
+
this.lastFailure = null;
|
|
70
|
+
this.retryDelay = 0;
|
|
71
|
+
this.state = 'LIVE';
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
async tick(guard, observed) {
|
|
75
|
+
this.capabilities = undefined;
|
|
76
|
+
if (!this.config.serviceRecovery)
|
|
77
|
+
return false;
|
|
78
|
+
if (Date.now() < this.retryAt)
|
|
79
|
+
return true;
|
|
80
|
+
this.state = 'OBSERVING';
|
|
81
|
+
this.reason = null;
|
|
82
|
+
this.observedRequestId = null;
|
|
83
|
+
try {
|
|
84
|
+
guard();
|
|
85
|
+
if (this.source) {
|
|
86
|
+
const progress = await this.progress();
|
|
87
|
+
if (progress)
|
|
88
|
+
return await this.route(progress, guard);
|
|
89
|
+
const old = this.journal.automaticActivation.read(this.source.requestId);
|
|
90
|
+
if (old) {
|
|
91
|
+
const expired = await this.bridge.quarantine(this.config.project, this.source.executionId, this.config.bridgeCredential, { operation: 'owner-expired', requestId: this.source.requestId });
|
|
92
|
+
if (expired !== true)
|
|
93
|
+
return this.uncertain();
|
|
94
|
+
if (old.phase !== 'HALTED')
|
|
95
|
+
this.journal.automaticActivation.update(this.source.requestId, 'HALTED');
|
|
96
|
+
this.source = undefined;
|
|
97
|
+
this.preparationFailed = true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
let cap = (this.capabilities = await readCapabilities(this.runtime));
|
|
101
|
+
// 专用恢复协议和 writer 所有权由叶子负责,Host 不因兼容新发行号重复拒绝。
|
|
102
|
+
if (cap.provider !== (this.config.runtimeProvider ?? 'codex') ||
|
|
103
|
+
!isBotNativeVersion(cap.nativeVersion) ||
|
|
104
|
+
cap.serviceRecovery?.protocol !== 'native-exclusive-v1' ||
|
|
105
|
+
!this.runtime.restartService ||
|
|
106
|
+
!cap.runtimeInstanceId)
|
|
107
|
+
throw new Error('BOT_SERVICE_RESTART_UNSUPPORTED');
|
|
108
|
+
if (cap.serviceRecovery.state === 'LIVE' &&
|
|
109
|
+
!this.source &&
|
|
110
|
+
(!cap.serviceRecovery.sameOwnerControllerId ||
|
|
111
|
+
cap.serviceRecovery.sameOwnerControllerId === this.journal.incarnationId))
|
|
112
|
+
return this.live();
|
|
113
|
+
const sourceId = this.source?.executionId ?? this.config.executionId;
|
|
114
|
+
let s = await this.snapshot(sourceId, observed);
|
|
115
|
+
const pending = s.pendingInheritedActivation;
|
|
116
|
+
// 进程重启会生成新 incarnation;只凭同一持久化尝试继续使用正式原 controller。
|
|
117
|
+
if (pending) {
|
|
118
|
+
this.observedRequestId = pending.requestId;
|
|
119
|
+
const attempt = this.matchingAttempt(pending.requestId, pending.sourceExecutionId, pending.runtimeInstanceId);
|
|
120
|
+
if (!attempt || attempt.phase === 'ROUTED') {
|
|
121
|
+
this.state = 'HELD';
|
|
122
|
+
this.reason = 'ORIGINAL_ACTIVATION_EVIDENCE_REQUIRED';
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
const source = { executionId: pending.sourceExecutionId, requestId: pending.requestId };
|
|
126
|
+
if (attempt.phase !== 'HALTED') {
|
|
127
|
+
this.source = source;
|
|
128
|
+
const progress = await this.progress();
|
|
129
|
+
if (progress)
|
|
130
|
+
return await this.route(progress, guard);
|
|
131
|
+
return this.uncertain();
|
|
132
|
+
}
|
|
133
|
+
// 进程重启后,沿同一本机退休回证和正式到期事实继续独占替换。
|
|
134
|
+
const progress = await this.progress(source);
|
|
135
|
+
if (!progress ||
|
|
136
|
+
progress.owner.commit.executionId !== sourceId ||
|
|
137
|
+
!canReplaceExpiredServiceOwner(progress, cap)) {
|
|
138
|
+
this.state = 'HELD';
|
|
139
|
+
this.reason = 'EXPIRED_ACTIVATION_EVIDENCE_REQUIRED';
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (s.mission.state !== 'OPEN') {
|
|
144
|
+
this.state = 'PAUSED';
|
|
145
|
+
this.reason = 'MISSION_NOT_OPEN';
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
if (!s.binding.nativeSessionRef)
|
|
149
|
+
return false;
|
|
150
|
+
const context = {
|
|
151
|
+
schemaVersion: 1,
|
|
152
|
+
executionId: sourceId,
|
|
153
|
+
hostId: this.config.hostId,
|
|
154
|
+
project: this.config.project,
|
|
155
|
+
missionRevision: s.mission.revision,
|
|
156
|
+
controllerId: this.journal.incarnationId,
|
|
157
|
+
};
|
|
158
|
+
if (!s.binding.fencedRef || this.preparationFailed) {
|
|
159
|
+
guard();
|
|
160
|
+
this.state = 'FENCING';
|
|
161
|
+
const result = await this.runtime.restartService(context);
|
|
162
|
+
const resumed = result && typeof result === 'object' && 'state' in result ? result.state : undefined;
|
|
163
|
+
cap = this.capabilities = await readCapabilities(this.runtime);
|
|
164
|
+
// Native 已独占装回;当前写权由下一次正式 confirm 核验,省掉重复读。
|
|
165
|
+
if (resumed === 'SAME_OWNER_ATTACHED' && restoredOriginalWriter(cap, s, sourceId))
|
|
166
|
+
return this.live();
|
|
167
|
+
s = await this.snapshot(sourceId);
|
|
168
|
+
// 尚未开工的独占恢复沿原逻辑实例。普通 reconcile 仍须确认后才允许首轮。
|
|
169
|
+
if (resumed === 'PRESTART_ATTACHED' &&
|
|
170
|
+
cap.serviceRecovery?.state === 'LIVE' &&
|
|
171
|
+
cap.runtimeInstanceId === s.runtimeOriginId &&
|
|
172
|
+
s.binding.nativeSessionRef &&
|
|
173
|
+
!s.binding.fencedRef) {
|
|
174
|
+
return this.live();
|
|
175
|
+
}
|
|
176
|
+
this.preparationFailed = false;
|
|
177
|
+
}
|
|
178
|
+
this.requireFence(s);
|
|
179
|
+
const requestId = 'service-' + cap.runtimeInstanceId;
|
|
180
|
+
if (requestId !== this.source?.requestId)
|
|
181
|
+
this.progressEvidence = null;
|
|
182
|
+
this.source = { executionId: sourceId, requestId };
|
|
183
|
+
const sourceConfig = { ...this.config, executionId: sourceId };
|
|
184
|
+
this.state = 'PREPARING';
|
|
185
|
+
const prepared = await prepareHostAdmission(sourceConfig, this.bridge, this.runtime, this.journal.incarnationId, requestId, guard, s);
|
|
186
|
+
this.source.prepared = prepared;
|
|
187
|
+
guard();
|
|
188
|
+
// 准备期间可能换代,以正式准入回执绑定已核验的实例。
|
|
189
|
+
const instance = prepared.ticket.runtimeInstanceId;
|
|
190
|
+
const attempt = this.journal.automaticActivation.claim({
|
|
191
|
+
requestId,
|
|
192
|
+
sourceId,
|
|
193
|
+
runtimeInstanceId: instance,
|
|
194
|
+
policyDigest: digest(['same-host', this.config.hostId]),
|
|
195
|
+
qualificationDigest: digest([s.recovery, instance]),
|
|
196
|
+
});
|
|
197
|
+
if (attempt.fresh) {
|
|
198
|
+
this.state = 'ACTIVATING';
|
|
199
|
+
try {
|
|
200
|
+
await activatePreparedHostNative(sourceConfig, this.runtime, prepared, guard);
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
// 返回不明时只回查同一 Owner 请求,不能将原激活重新派发。
|
|
204
|
+
this.recordFailure(error);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const progress = await this.progress();
|
|
208
|
+
if (!progress)
|
|
209
|
+
return this.uncertain();
|
|
210
|
+
return await this.route(progress, guard);
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
this.reason = this.recordFailure(error);
|
|
214
|
+
const busy = this.reason === 'BOT_RUNTIME_BUSY' ||
|
|
215
|
+
this.reason === 'BOT_SERVICE_RESTART_AUTHORITY_CHANGED';
|
|
216
|
+
const unavailable = isBotControlUnavailable(error);
|
|
217
|
+
this.state = unavailable ? 'RECONNECTING' : busy ? 'OBSERVING' : 'HELD';
|
|
218
|
+
// 暂态先短退避,连续故障有上限并服从服务端给出的 Retry-After。
|
|
219
|
+
this.retryDelay = unavailable ? Math.min(10_000, this.retryDelay * 2 || 1000) : 0;
|
|
220
|
+
const retryAfter = error instanceof Error && 'retryAfterMs' in error && error.retryAfterMs;
|
|
221
|
+
this.retryAt =
|
|
222
|
+
Date.now() +
|
|
223
|
+
Math.max(this.retryDelay || 10_000, typeof retryAfter === 'number' ? retryAfter : 0);
|
|
224
|
+
// 控制在途、权威变化或暂时失联时继续观察原执行,避免重复装载。
|
|
225
|
+
if (this.state === 'HELD')
|
|
226
|
+
this.preparationFailed =
|
|
227
|
+
this.reason !== 'BOT_QUARANTINE_CAPACITY' &&
|
|
228
|
+
this.source !== undefined &&
|
|
229
|
+
!this.journal.automaticActivation.read(this.source.requestId);
|
|
230
|
+
throw error;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
uncertain() {
|
|
234
|
+
this.state = 'UNCERTAIN';
|
|
235
|
+
this.reason = 'ORIGINAL_ACTIVATION_RECEIPT_UNCONFIRMED';
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
/** Host 未进入正常同步时,仍能读到原恢复和监听的获权证据。 */
|
|
239
|
+
async snapshot(executionId, observed) {
|
|
240
|
+
const s = observed?.binding.executionId === executionId
|
|
241
|
+
? observed
|
|
242
|
+
: await bridgeRecovery('snapshot', () => this.bridge.quarantineSnapshot(this.config.project, executionId, this.config.bridgeCredential));
|
|
243
|
+
const { binding, mission, eventContinuity, recovery, observedAtMs } = s;
|
|
244
|
+
if (binding.executionId !== executionId ||
|
|
245
|
+
binding.hostId !== this.config.hostId ||
|
|
246
|
+
binding.provider !== this.config.runtimeProvider ||
|
|
247
|
+
binding.missionId !== mission.missionId)
|
|
248
|
+
throw new Error('BOT_SERVICE_RESTART_SCOPE_MISMATCH');
|
|
249
|
+
this.evidence = {
|
|
250
|
+
binding,
|
|
251
|
+
mission,
|
|
252
|
+
observedAtMs,
|
|
253
|
+
...(eventContinuity ? { eventContinuity } : {}),
|
|
254
|
+
recovery: recovery ?? null,
|
|
255
|
+
};
|
|
256
|
+
return s;
|
|
257
|
+
}
|
|
258
|
+
requireFence(s) {
|
|
259
|
+
if (!s.binding.fencedRef ||
|
|
260
|
+
s.recovery?.state !== 'FENCED' ||
|
|
261
|
+
s.recovery.reason !== 'EXCLUSIVE_NATIVE_SERVICE_RESTART' ||
|
|
262
|
+
s.recovery.recoveryId !== s.binding.fencedRef ||
|
|
263
|
+
// 只承接同DSH正式栅栏;未知审计事实不等于通用效果已清。
|
|
264
|
+
(!s.recovery.effectsClear &&
|
|
265
|
+
!(s.binding.provider === 'dsh' && hasSameNativeMcpResume(s.recovery))) ||
|
|
266
|
+
s.binding.ownerEpoch !== s.mission.ownerEpoch)
|
|
267
|
+
throw new Error('BOT_SERVICE_RESTART_FENCE_REQUIRED');
|
|
268
|
+
}
|
|
269
|
+
/** 只承接本机同一服务重启尝试,禁止借用手工或其他恢复策略的记录。 */
|
|
270
|
+
matchingAttempt(requestId, sourceId, instanceId) {
|
|
271
|
+
const a = this.journal.automaticActivation.read(requestId);
|
|
272
|
+
return a?.sourceId === sourceId &&
|
|
273
|
+
(instanceId === undefined || a.runtimeInstanceId === instanceId) &&
|
|
274
|
+
a.policyDigest === digest(['same-host', this.config.hostId])
|
|
275
|
+
? a
|
|
276
|
+
: null;
|
|
277
|
+
}
|
|
278
|
+
async progress(source = this.source) {
|
|
279
|
+
const p = await readHostOwnerProgress(this.config, this.bridge, source.executionId, source.requestId);
|
|
280
|
+
this.progressEvidence = p
|
|
281
|
+
? { phase: p.phase, reason: p.reason, observedAtMs: p.observedAtMs }
|
|
282
|
+
: null;
|
|
283
|
+
return p;
|
|
284
|
+
}
|
|
285
|
+
async route(p, guard) {
|
|
286
|
+
guard();
|
|
287
|
+
const source = this.source;
|
|
288
|
+
const c = p.owner.commit;
|
|
289
|
+
if (source.prepared &&
|
|
290
|
+
canonicalBotJson(source.prepared.receipt) !== canonicalBotJson(c.admission))
|
|
291
|
+
throw new Error('BOT_OWNER_ACTIVATION_RECEIPT_MISMATCH');
|
|
292
|
+
this.state = p.phase;
|
|
293
|
+
this.reason = p.reason;
|
|
294
|
+
const activationPending = p.phase === 'WAITING_NATIVE_READY' ||
|
|
295
|
+
(c.deferTransfer && (p.phase === 'WAITING_PUBLICATION' || p.reason === 'ACTIVATION_EXPIRED'));
|
|
296
|
+
// 路由沿当前 Owner、实际发布与停止事实;采用缺失只记录,不等待模型补票。
|
|
297
|
+
const canRoute = p.owner.current &&
|
|
298
|
+
p.owner.publication &&
|
|
299
|
+
p.missionState === 'OPEN' &&
|
|
300
|
+
!p.correctionPending &&
|
|
301
|
+
p.runtimeState === 'ATTACHED' &&
|
|
302
|
+
(!p.quiescenceRef || p.phase === 'QUIESCENT');
|
|
303
|
+
// 原请求已正式发布并接续时,只补原路由,兼容历史账本保存的准备前实例号。
|
|
304
|
+
const published = !activationPending &&
|
|
305
|
+
canRoute &&
|
|
306
|
+
c.sourceExecutionId === source.executionId &&
|
|
307
|
+
c.admission.ticket.requestId === source.requestId;
|
|
308
|
+
const attempt = this.matchingAttempt(source.requestId, source.executionId, published ? undefined : c.runtimeInstanceId);
|
|
309
|
+
if (!attempt || attempt.phase === 'HALTED') {
|
|
310
|
+
this.state = 'HELD';
|
|
311
|
+
this.reason = 'ORIGINAL_ACTIVATION_EVIDENCE_REQUIRED';
|
|
312
|
+
return true;
|
|
313
|
+
}
|
|
314
|
+
if (activationPending && p.owner.current) {
|
|
315
|
+
const cap = await this.runtime.capabilities();
|
|
316
|
+
guard();
|
|
317
|
+
// 到期只退休本次激活尝试,下一轮仍走正式 Native 围栏。
|
|
318
|
+
if (canReplaceExpiredServiceOwner(p, cap) && attempt.phase !== 'ROUTED') {
|
|
319
|
+
this.journal.automaticActivation.update(source.requestId, 'HALTED');
|
|
320
|
+
this.config.executionId = c.executionId;
|
|
321
|
+
this.source = undefined;
|
|
322
|
+
this.state = 'OBSERVING';
|
|
323
|
+
this.reason = 'ORIGINAL_ACTIVATION_EXPIRED';
|
|
324
|
+
return true;
|
|
325
|
+
}
|
|
326
|
+
if (cap.runtimeInstanceId !== c.runtimeInstanceId) {
|
|
327
|
+
this.reason = 'ORIGINAL_NATIVE_INSTANCE_UNAVAILABLE';
|
|
328
|
+
return true;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (p.phase === 'WAITING_NATIVE_READY' ||
|
|
332
|
+
(p.phase === 'WAITING_PUBLICATION' && p.owner.commit.deferTransfer)) {
|
|
333
|
+
// 发布或就绪回执丢失时,只重读并重试原 Native 激活请求。
|
|
334
|
+
if (attempt.phase === 'ROUTED') {
|
|
335
|
+
this.state = 'HELD';
|
|
336
|
+
this.reason = 'ORIGINAL_ACTIVATION_EVIDENCE_REQUIRED';
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
await activateHostNative({ ...this.config, executionId: source.executionId }, this.bridge, this.runtime, p.owner.commit.controllerId, source.requestId, {
|
|
340
|
+
preparedOnly: true,
|
|
341
|
+
guard: () => {
|
|
342
|
+
guard();
|
|
343
|
+
return Promise.resolve();
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
if (!canRoute)
|
|
349
|
+
return true;
|
|
350
|
+
// 进程仍在发布原 Native 时,正式 Owner 回证不能抢先开始常规 reconcile。
|
|
351
|
+
if (p.owner.publication?.state === 'PUBLISHED_ADOPTION_REQUIRED' &&
|
|
352
|
+
p.observedAtMs < c.activationDeadlineMs) {
|
|
353
|
+
const cap = await this.runtime.capabilities();
|
|
354
|
+
if (cap.runtimeInstanceId === c.runtimeInstanceId && cap.serviceRecovery?.state === 'HELD') {
|
|
355
|
+
this.state = 'WAITING_NATIVE_READY';
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (p.phase === 'QUIESCENT')
|
|
360
|
+
await recordInheritedWait(this.config, this.bridge, this.journal, p.owner);
|
|
361
|
+
guard();
|
|
362
|
+
this.journal.automaticActivation.update(source.requestId, 'ROUTED', p.owner.commit.executionId, digest(p.owner.commit));
|
|
363
|
+
this.journal.recoverDispatches(source.executionId);
|
|
364
|
+
this.journal.releaseExecution(source.executionId);
|
|
365
|
+
this.config.executionId = p.owner.commit.executionId;
|
|
366
|
+
return this.live();
|
|
367
|
+
}
|
|
368
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { HostResourceGuard } from '../resources/guard.js';
|
|
2
|
+
/** Independent H5. It never invokes Runtime execute/reconcile or decides business work. */
|
|
3
|
+
export class BotReportPump {
|
|
4
|
+
config;
|
|
5
|
+
bridge;
|
|
6
|
+
journal;
|
|
7
|
+
source;
|
|
8
|
+
busy = false;
|
|
9
|
+
closed = false;
|
|
10
|
+
next = 0;
|
|
11
|
+
state = 'STARTING';
|
|
12
|
+
resources;
|
|
13
|
+
feeds;
|
|
14
|
+
constructor(config, bridge, journal, source) {
|
|
15
|
+
this.config = config;
|
|
16
|
+
this.bridge = bridge;
|
|
17
|
+
this.journal = journal;
|
|
18
|
+
this.source = source;
|
|
19
|
+
this.feeds = [
|
|
20
|
+
{
|
|
21
|
+
executionId: config.executionId,
|
|
22
|
+
runtimeUrl: config.runtimeUrl,
|
|
23
|
+
runtimeToken: config.runtimeToken,
|
|
24
|
+
runtimeProvider: config.runtimeProvider ?? 'codex',
|
|
25
|
+
},
|
|
26
|
+
...(config.reportSources ?? []),
|
|
27
|
+
];
|
|
28
|
+
if (new Set(this.feeds.map((f) => f.executionId)).size !== this.feeds.length)
|
|
29
|
+
throw new Error('BOT_REPORT_SOURCE_DUPLICATE');
|
|
30
|
+
this.resources = config.maxRssBytes
|
|
31
|
+
? new HostResourceGuard({
|
|
32
|
+
maxRssBytes: config.maxRssBytes,
|
|
33
|
+
maxConcurrent: 1,
|
|
34
|
+
hold: () => {
|
|
35
|
+
this.state = 'RESOURCE_HELD';
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
: undefined;
|
|
39
|
+
}
|
|
40
|
+
get status() {
|
|
41
|
+
return this.state;
|
|
42
|
+
}
|
|
43
|
+
stop() {
|
|
44
|
+
this.closed = true;
|
|
45
|
+
}
|
|
46
|
+
async tick() {
|
|
47
|
+
if (this.closed || this.busy)
|
|
48
|
+
return;
|
|
49
|
+
this.busy = true;
|
|
50
|
+
let sourceFailed = false;
|
|
51
|
+
try {
|
|
52
|
+
this.resources?.check();
|
|
53
|
+
const feeds = [
|
|
54
|
+
{ ...this.feeds[0], executionId: this.config.executionId },
|
|
55
|
+
...this.feeds.slice(1).filter((f) => f.executionId !== this.config.executionId),
|
|
56
|
+
];
|
|
57
|
+
const feed = feeds[this.next++ % feeds.length];
|
|
58
|
+
try {
|
|
59
|
+
const s = await this.bridge.authority(this.config.project, feed.executionId, this.config.bridgeCredential);
|
|
60
|
+
if (this.closed)
|
|
61
|
+
return;
|
|
62
|
+
const pending = this.journal.reports.pending(feed.executionId);
|
|
63
|
+
if (pending.length) {
|
|
64
|
+
const r = await this.bridge.submit(this.config.project, feed.executionId, this.config.bridgeCredential, pending);
|
|
65
|
+
if (r.persisted !== true ||
|
|
66
|
+
JSON.stringify([...r.reportIds].sort()) !==
|
|
67
|
+
JSON.stringify(pending.map((e) => e.eventId).sort()))
|
|
68
|
+
throw new Error('BOT_REPORT_RECEIPT_MISMATCH');
|
|
69
|
+
this.journal.reports.acknowledge(feed.executionId, r.reportIds);
|
|
70
|
+
}
|
|
71
|
+
if (this.closed)
|
|
72
|
+
return;
|
|
73
|
+
const page = await this.source(feed).reports({
|
|
74
|
+
schemaVersion: 1,
|
|
75
|
+
executionId: feed.executionId,
|
|
76
|
+
hostId: s.binding.hostId,
|
|
77
|
+
project: this.config.project,
|
|
78
|
+
missionRevision: s.mission.revision,
|
|
79
|
+
}, this.journal.reports.cursor(feed.executionId));
|
|
80
|
+
this.journal.reports.ingest(s, page);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
sourceFailed = true;
|
|
84
|
+
}
|
|
85
|
+
if (this.closed)
|
|
86
|
+
return;
|
|
87
|
+
await this.bridge.dispatch(this.config.project, this.config.executionId, this.config.bridgeCredential);
|
|
88
|
+
this.state = sourceFailed ? 'SOURCE_PENDING' : 'CONNECTED';
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
if (this.state !== 'RESOURCE_HELD')
|
|
92
|
+
this.state = 'DELIVERY_PENDING';
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
this.busy = false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** 只核对原有限离线合同;真正交接或待纠正状态不能借本地等待继续。 */
|
|
2
|
+
export function canRemainOffline(journal, s, qualified) {
|
|
3
|
+
if (!s ||
|
|
4
|
+
!qualified ||
|
|
5
|
+
(s.correction && s.correction.state !== 'ADOPTED') ||
|
|
6
|
+
s.binding.quiescenceRef ||
|
|
7
|
+
s.binding.fencedRef ||
|
|
8
|
+
(s.continuation &&
|
|
9
|
+
s.continuation.receipt.state !== 'CONSUMED' &&
|
|
10
|
+
s.continuation.receipt.state !== 'SUPERSEDED'))
|
|
11
|
+
return false;
|
|
12
|
+
try {
|
|
13
|
+
journal.recovery.offline({
|
|
14
|
+
executionId: s.binding.executionId,
|
|
15
|
+
controllerId: journal.incarnationId,
|
|
16
|
+
ownerEpoch: s.binding.ownerEpoch,
|
|
17
|
+
missionRevision: s.mission.revision,
|
|
18
|
+
nativeSessionRef: s.binding.nativeSessionRef,
|
|
19
|
+
});
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class HostResourceGuard {
|
|
2
|
+
options;
|
|
3
|
+
constructor(options) {
|
|
4
|
+
this.options = options;
|
|
5
|
+
if (!Number.isSafeInteger(options.maxRssBytes) || options.maxRssBytes < 64 * 1024 * 1024)
|
|
6
|
+
throw new Error('BOT_RESOURCE_LIMIT_INVALID');
|
|
7
|
+
}
|
|
8
|
+
check() {
|
|
9
|
+
if (process.memoryUsage().rss > this.options.maxRssBytes) {
|
|
10
|
+
this.options.hold();
|
|
11
|
+
throw new Error('BOT_HOST_RSS_LIMIT');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AgentIMClient } from '@agentims/sdk';
|
|
2
|
+
import { attachAgentAccount } from '@agentims/runtime';
|
|
3
|
+
import { readAgentIMConnection } from './connection-file.js';
|
|
4
|
+
/** 使用实际官方设备核对授权,重连不会新注册、登录或接管另一设备。 */
|
|
5
|
+
export async function verifyLocalAgentIM(client, binding, options = {}) {
|
|
6
|
+
const { homeserver, user_id, device_id } = binding.identity;
|
|
7
|
+
const actual = await client.identity.status(options);
|
|
8
|
+
if (actual.homeserver !== homeserver ||
|
|
9
|
+
actual.user_id !== user_id ||
|
|
10
|
+
actual.device_id !== device_id)
|
|
11
|
+
throw new Error('AGENTIM_IDENTITY_MISMATCH');
|
|
12
|
+
return actual;
|
|
13
|
+
}
|
|
14
|
+
export async function attachLocalAgentIM(binding, existing) {
|
|
15
|
+
const { identity } = binding;
|
|
16
|
+
const { client, close } = existing
|
|
17
|
+
? await fileClient(existing.connectionFile)
|
|
18
|
+
: await attachAgentAccount({ homeserverUrl: identity.homeserver, agentId: identity.user_id });
|
|
19
|
+
try {
|
|
20
|
+
const options = { timeoutMs: 4000 };
|
|
21
|
+
const status = await verifyLocalAgentIM(client, binding, options);
|
|
22
|
+
if (!status.crypto_ready)
|
|
23
|
+
throw new Error('AGENTIM_DEVICE_NOT_READY');
|
|
24
|
+
const stream = await client.timeline.streamInfo(options);
|
|
25
|
+
if (stream.identity.homeserver !== identity.homeserver ||
|
|
26
|
+
stream.identity.user_id !== identity.user_id ||
|
|
27
|
+
stream.identity.device_id !== identity.device_id ||
|
|
28
|
+
!stream.floor_checkpoint)
|
|
29
|
+
throw new Error('AGENTIM_STREAM_IDENTITY_MISMATCH');
|
|
30
|
+
// 本地账本如有确认位置会覆盖初始位置。新绑定从官方下界补读。
|
|
31
|
+
return { client, close, checkpoint: existing?.initialCheckpoint ?? stream.floor_checkpoint };
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
await close();
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** 手工部署继续读取本用户持有的私有官方描述符。 */
|
|
39
|
+
async function fileClient(file) {
|
|
40
|
+
const client = new AgentIMClient(await readAgentIMConnection(file));
|
|
41
|
+
return { client, close: () => client.close() };
|
|
42
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { readFile, lstat } from 'node:fs/promises';
|
|
2
|
+
import { isAbsolute } from 'node:path';
|
|
3
|
+
/** 仅读取本用户持有的私有连接文件,任何错误均不得暴露文件中的凭据。 */
|
|
4
|
+
export async function readAgentIMConnection(path) {
|
|
5
|
+
if (!isAbsolute(path))
|
|
6
|
+
throw new Error('AGENTIM_PRIVATE_CONNECTION_REQUIRED');
|
|
7
|
+
const s = await lstat(path);
|
|
8
|
+
if (!s.isFile() ||
|
|
9
|
+
s.isSymbolicLink() ||
|
|
10
|
+
s.size > 4096 ||
|
|
11
|
+
(s.mode & 0o077) !== 0 ||
|
|
12
|
+
s.uid !== process.getuid?.())
|
|
13
|
+
throw new Error('AGENTIM_PRIVATE_CONNECTION_REQUIRED');
|
|
14
|
+
const c = JSON.parse(await readFile(path, 'utf8'));
|
|
15
|
+
if (c.version !== 1 ||
|
|
16
|
+
typeof c.base_url !== 'string' ||
|
|
17
|
+
typeof c.api_token !== 'string' ||
|
|
18
|
+
// 凭据语义沿SDK;本机只保护文件/运输边界,不另造token长度准入。
|
|
19
|
+
!c.api_token ||
|
|
20
|
+
/[^\x21-\x7e]/.test(c.api_token))
|
|
21
|
+
throw new Error('AGENTIM_CONNECTION_INVALID');
|
|
22
|
+
const url = new URL(c.base_url);
|
|
23
|
+
if (url.protocol !== 'http:' ||
|
|
24
|
+
!['127.0.0.1', '[::1]'].includes(url.hostname) ||
|
|
25
|
+
url.pathname !== '/' ||
|
|
26
|
+
url.username ||
|
|
27
|
+
url.password ||
|
|
28
|
+
url.search ||
|
|
29
|
+
url.hash)
|
|
30
|
+
throw new Error('AGENTIM_CONNECTION_INVALID');
|
|
31
|
+
return { baseUrl: c.base_url, apiToken: c.api_token };
|
|
32
|
+
}
|