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,339 @@
|
|
|
1
|
+
import { BOT_RECOVERY_PUBLIC_ERRORS, isNativeConversationAdmissionError, readBotCapabilityVersionMismatch, } from '@agent-stack/contracts';
|
|
2
|
+
/** Bounded service JSON transport. Writes are never retried after an unknown outcome. */
|
|
3
|
+
export class BotServiceTransport {
|
|
4
|
+
timeoutMs;
|
|
5
|
+
headers;
|
|
6
|
+
fetcher;
|
|
7
|
+
base;
|
|
8
|
+
publicHost;
|
|
9
|
+
constructor(baseUrl, timeoutMs, headers = {}, fetcher = fetch) {
|
|
10
|
+
this.timeoutMs = timeoutMs;
|
|
11
|
+
this.headers = headers;
|
|
12
|
+
this.fetcher = fetcher;
|
|
13
|
+
this.base = new URL(baseUrl);
|
|
14
|
+
this.publicHost = /^\/host\/v1\/?$/.test(this.base.pathname);
|
|
15
|
+
if (!['http:', 'https:'].includes(this.base.protocol) ||
|
|
16
|
+
this.base.username ||
|
|
17
|
+
this.base.password ||
|
|
18
|
+
this.base.search ||
|
|
19
|
+
this.base.hash ||
|
|
20
|
+
(this.base.pathname !== '/' && !this.publicHost) ||
|
|
21
|
+
(this.base.protocol === 'http:' &&
|
|
22
|
+
!['127.0.0.1', '[::1]', 'localhost'].includes(this.base.hostname)) ||
|
|
23
|
+
!Number.isInteger(timeoutMs) ||
|
|
24
|
+
timeoutMs < 1 ||
|
|
25
|
+
timeoutMs > 120000)
|
|
26
|
+
throw new Error('BOT_SERVICE_CONFIGURATION_INVALID');
|
|
27
|
+
}
|
|
28
|
+
get(path, headers) {
|
|
29
|
+
return this.request('GET', path, undefined, this.timeoutMs, headers);
|
|
30
|
+
}
|
|
31
|
+
post(path, body, timeoutMs = this.timeoutMs, headers, signal) {
|
|
32
|
+
// Host 关闭可提前取消发送或读取。普通 JSON 请求仍受原 HTTP 时限约束。
|
|
33
|
+
const bounded = signal ? AbortSignal.any([signal, AbortSignal.timeout(timeoutMs)]) : undefined;
|
|
34
|
+
return this.request('POST', path, body, timeoutMs, headers, false, bounded);
|
|
35
|
+
}
|
|
36
|
+
/** 私有AgentIM沿SDK时限与原生取消;不为长调用叠加AS固定时限或自动重试。 */
|
|
37
|
+
postAgentIM(body, signal) {
|
|
38
|
+
return this.request('POST', '/agentim', body, undefined, undefined, false, signal);
|
|
39
|
+
}
|
|
40
|
+
/** 仅material与delivery-read可重读;不从HTTP状态、远端文本或工具注解推断幂等性。 */
|
|
41
|
+
postRead(path, body, timeoutMs = this.timeoutMs, headers) {
|
|
42
|
+
if (!/^\/internal\/runtime\/bots\/t\/[^/?#]+\/w\/[^/?#]+\/p\/[^/?#]+\/executions\/[^/?#]+\/(?:material|delivery-read)$/.test(path))
|
|
43
|
+
return Promise.reject(new Error('BOT_SERVICE_READ_PATH_INVALID'));
|
|
44
|
+
return this.request('POST', path, body, timeoutMs, headers, true);
|
|
45
|
+
}
|
|
46
|
+
patch(path, body, timeoutMs = this.timeoutMs, headers) {
|
|
47
|
+
return this.request('PATCH', path, body, timeoutMs, headers);
|
|
48
|
+
}
|
|
49
|
+
async request(method, path, body, timeoutMs, headers, socketRead = false, nativeSignal) {
|
|
50
|
+
if (!path.startsWith('/') || path.startsWith('//') || path.includes('\\'))
|
|
51
|
+
throw new Error('BOT_SERVICE_PATH_INVALID');
|
|
52
|
+
const deliveryRead = socketRead && path.endsWith('/delivery-read');
|
|
53
|
+
const readResponse = socketRead || isReadResponse(method, path, body);
|
|
54
|
+
const nativeResult = method === 'POST' && ['/bot-runtime/v1/commands', '/bot-runtime/v1/reconcile'].includes(path);
|
|
55
|
+
// 产品入口仅改写两种受限机器路径,旧内网部署继续使用原私有地址。
|
|
56
|
+
let outgoing = path;
|
|
57
|
+
if (this.publicHost) {
|
|
58
|
+
const match = /^\/internal\/(bot-host|runtime\/bots)(\/t\/[a-z0-9_-]+\/w\/[a-z0-9_-]+\/p\/[a-z0-9_-]+(?:\/[A-Za-z0-9_-]+)+(?:\?[^#]*)?)$/.exec(path);
|
|
59
|
+
if (!match)
|
|
60
|
+
throw new Error('BOT_SERVICE_PATH_INVALID');
|
|
61
|
+
// 产品入口只暴露现有目标协议的产物子集,Bridge 再核实际动作类型。
|
|
62
|
+
const suffix = match[1] === 'runtime/bots' && path.endsWith('/host-execution')
|
|
63
|
+
? match[2].replace(/host-execution$/, 'artifact-action')
|
|
64
|
+
: match[2];
|
|
65
|
+
outgoing = '/host/v1/' + (match[1] === 'bot-host' ? 'host' : 'runtime') + suffix;
|
|
66
|
+
}
|
|
67
|
+
const url = new URL(outgoing, this.base);
|
|
68
|
+
if (url.origin !== this.base.origin)
|
|
69
|
+
throw new Error('BOT_SERVICE_PATH_INVALID');
|
|
70
|
+
// 两次读取共享同一取消信号与原始预算;其他网络错误、HTTP 拒绝和响应体故障均不重试。
|
|
71
|
+
const signal = nativeSignal ?? AbortSignal.timeout(timeoutMs ?? this.timeoutMs);
|
|
72
|
+
signal.throwIfAborted();
|
|
73
|
+
const init = {
|
|
74
|
+
method,
|
|
75
|
+
redirect: 'error',
|
|
76
|
+
signal,
|
|
77
|
+
headers: { ...this.headers, ...headers, 'content-type': 'application/json' },
|
|
78
|
+
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
|
79
|
+
};
|
|
80
|
+
let response;
|
|
81
|
+
for (let attempt = 0; attempt < (socketRead ? 2 : 1); attempt++) {
|
|
82
|
+
try {
|
|
83
|
+
response = await this.fetcher(url, init);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
const cause = error instanceof TypeError ? error.cause : undefined;
|
|
88
|
+
if (socketRead &&
|
|
89
|
+
attempt === 0 &&
|
|
90
|
+
!signal.aborted &&
|
|
91
|
+
cause &&
|
|
92
|
+
typeof cause === 'object' &&
|
|
93
|
+
'code' in cause &&
|
|
94
|
+
cause.code === 'UND_ERR_SOCKET')
|
|
95
|
+
continue;
|
|
96
|
+
throw new Error('BOT_SERVICE_NETWORK_UNAVAILABLE');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!response)
|
|
100
|
+
throw new Error('BOT_SERVICE_NETWORK_UNAVAILABLE');
|
|
101
|
+
// Stream with a hard bound: Content-Length alone is not trusted.
|
|
102
|
+
const reader = response.body?.getReader();
|
|
103
|
+
const chunks = [];
|
|
104
|
+
let size = 0;
|
|
105
|
+
let bodyFailed = false;
|
|
106
|
+
try {
|
|
107
|
+
while (reader) {
|
|
108
|
+
const next = await reader.read();
|
|
109
|
+
if (next.done)
|
|
110
|
+
break;
|
|
111
|
+
size += next.value.byteLength;
|
|
112
|
+
// AgentIM 私有冻结文件只供官方协调器恢复;普通服务和模型 JSON 仍沿原上限。
|
|
113
|
+
if (size > (agentimPath(path) ? 10 * 1048576 : 1048576))
|
|
114
|
+
throw new Error('BOT_SERVICE_RESPONSE_TOO_LARGE');
|
|
115
|
+
chunks.push(next.value);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
bodyFailed = true;
|
|
120
|
+
// 已派发的原生命令正文断流表示结果未知,与纯读断流分开;两者都不在这里重发。
|
|
121
|
+
if ((readResponse || nativeResult) &&
|
|
122
|
+
(error instanceof TypeError || (error instanceof DOMException && signal.aborted))) {
|
|
123
|
+
// 已收到的明确拒绝仍有效,尤其不能把 401/403 的断流降成离线资格。
|
|
124
|
+
if (!response.ok)
|
|
125
|
+
throw responseError(response, readResponse);
|
|
126
|
+
throw new Error(readResponse ? 'BOT_SERVICE_NETWORK_UNAVAILABLE' : 'BOT_RUNTIME_RESULT_INTERRUPTED');
|
|
127
|
+
}
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
try {
|
|
132
|
+
await reader?.cancel();
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
// 取消可重抛断流或另一个错误;不能覆盖原先的传输/响应页额首因。
|
|
136
|
+
if (!bodyFailed && !deliveryRead)
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// Do not expose remote diagnostics, credentials or model text in service errors.
|
|
141
|
+
const bytes = new Uint8Array(size);
|
|
142
|
+
let offset = 0;
|
|
143
|
+
for (const chunk of chunks) {
|
|
144
|
+
bytes.set(chunk, offset);
|
|
145
|
+
offset += chunk.length;
|
|
146
|
+
}
|
|
147
|
+
if (!response.ok) {
|
|
148
|
+
// 1033 只证明受配公网隧道暂不可达。由现有只读流程回查,HTTP 请求本身仍只发一次。
|
|
149
|
+
if (this.publicHost &&
|
|
150
|
+
this.base.protocol === 'https:' &&
|
|
151
|
+
readResponse &&
|
|
152
|
+
response.status === 530 &&
|
|
153
|
+
response.headers.get('server')?.toLowerCase() === 'cloudflare' &&
|
|
154
|
+
bytes.length <= 32 &&
|
|
155
|
+
/^error code: 1033\s*$/.test(new TextDecoder().decode(bytes)))
|
|
156
|
+
throw Object.assign(new Error('BOT_SERVICE_PUBLIC_TUNNEL_UNAVAILABLE'), {
|
|
157
|
+
retryAfterMs: readRetryAfter(response.headers.get('retry-after')),
|
|
158
|
+
});
|
|
159
|
+
const code = readServiceCode(bytes);
|
|
160
|
+
// 计量出箱只跳过已明确拒绝的单条回执。Owner 拒绝和其它 409 仍保留原处置。
|
|
161
|
+
if (method === 'POST' &&
|
|
162
|
+
response.status === 409 &&
|
|
163
|
+
(code === 'BOT_MODEL_RECEIPT_CONFLICT' || code === 'BOT_MODEL_APPLIED_RECEIPT_REQUIRED') &&
|
|
164
|
+
body?.operation === 'observed' &&
|
|
165
|
+
/^\/internal\/runtime\/bots\/t\/[^/?#]+\/w\/[^/?#]+\/p\/[^/?#]+\/executions\/[^/?#]+\/model-routing$/.test(path))
|
|
166
|
+
throw new Error(code);
|
|
167
|
+
if (method === 'POST' &&
|
|
168
|
+
path === '/bot-runtime/v1/commands' &&
|
|
169
|
+
response.status === 409 &&
|
|
170
|
+
code === 'CAPABILITY_VERSION_MISMATCH') {
|
|
171
|
+
const { error } = JSON.parse(new TextDecoder().decode(bytes));
|
|
172
|
+
const mismatch = readBotCapabilityVersionMismatch(error, 'runtime.commands', body?.expectedCapabilityVersion);
|
|
173
|
+
if (mismatch)
|
|
174
|
+
throw mismatch;
|
|
175
|
+
}
|
|
176
|
+
// 明确未开始仅触发原命令回查;客户端不将普通 409 当作无副作用。
|
|
177
|
+
if (method === 'POST' &&
|
|
178
|
+
path === '/bot-runtime/v1/commands' &&
|
|
179
|
+
response.status === 409 &&
|
|
180
|
+
code === 'BOT_COMMAND_CREATE_NOT_STARTED')
|
|
181
|
+
throw new Error(code);
|
|
182
|
+
// 只投影本机 Native 提交的容量拒绝,下一轮仍须读取原派发才能继续。
|
|
183
|
+
if (method === 'POST' &&
|
|
184
|
+
response.status === 409 &&
|
|
185
|
+
(path === '/bot-receptions/submit' || path === '/bot-conversations/submit') &&
|
|
186
|
+
isNativeConversationAdmissionError(code))
|
|
187
|
+
throw new Error(code);
|
|
188
|
+
// 专用Runtime已正式确认原动作;Host只重查原回证,不据此重发命令或推断业务成功。
|
|
189
|
+
if (method === 'POST' &&
|
|
190
|
+
response.status === 503 &&
|
|
191
|
+
['/bot-runtime/v1/commands', '/bot-runtime/v1/reconcile'].includes(path) &&
|
|
192
|
+
code === 'BOT_COMMAND_CONFIRMED_READ_PENDING')
|
|
193
|
+
throw new Error(code);
|
|
194
|
+
// 只保留自有 AgentIM 合同的稳定码,不传远端 message/正文,也不据此重发写入。
|
|
195
|
+
if (agentimPath(path) && code && /^BOT_AGENTIM_[A-Z0-9_]{1,100}$/.test(code))
|
|
196
|
+
throw Object.assign(new Error(code), { code, status: response.status });
|
|
197
|
+
// 外接适配直接报告通用忙碌状态,旧 DSH 固定码继续投影为同一只读等待语义。
|
|
198
|
+
if (response.status === 409 &&
|
|
199
|
+
path.startsWith('/bot-runtime/v1/') &&
|
|
200
|
+
(code === 'DSH_BOT_BUSY' || code === 'BOT_RUNTIME_BUSY'))
|
|
201
|
+
throw Object.assign(new Error('BOT_RUNTIME_BUSY'), { code });
|
|
202
|
+
// 原恢复请求仅透传固定拒绝原因,不扩展重试或把它归类成可执行状态。
|
|
203
|
+
if (code &&
|
|
204
|
+
recoveryErrors.get(code) === response.status &&
|
|
205
|
+
(/^\/internal\/(?:runtime\/bots|bot-host)\/t\/[^/?#]+\/w\/[^/?#]+\/p\/[^/?#]+\/executions\/[^/?#]+\/recovery-quarantine$/.test(path) ||
|
|
206
|
+
/^\/bot-runtime\/v1\/recovery(?:\/[a-z-]+)*$/.test(path)))
|
|
207
|
+
throw Object.assign(new Error(code), { code });
|
|
208
|
+
if (response.status === 409 && code === 'BOT_RELAY_AUTHORITY_EXPIRED')
|
|
209
|
+
throw Object.assign(new Error('BOT_RELAY_PENDING'), { code });
|
|
210
|
+
if (response.status === 409 && code === 'BOT_CORRECTION_REQUIRED')
|
|
211
|
+
throw Object.assign(new Error('BOT_CORRECTION_PENDING'), { code });
|
|
212
|
+
if (response.status === 409 &&
|
|
213
|
+
code &&
|
|
214
|
+
[
|
|
215
|
+
'BOT_DELEGATION_PARENT_HELD',
|
|
216
|
+
'BOT_DELEGATION_PARENT_NOT_ADOPTED',
|
|
217
|
+
'BOT_DELEGATION_CHILD_HELD',
|
|
218
|
+
].includes(code))
|
|
219
|
+
throw Object.assign(new Error('BOT_DELEGATION_PENDING'), { code });
|
|
220
|
+
if (deliveryRead && code && deliveryReadErrors.get(code) === response.status)
|
|
221
|
+
throw new Error(code);
|
|
222
|
+
const error = responseError(response, readResponse);
|
|
223
|
+
// 同机接续只认 Bridge 的固定兼容性拒绝;其余 409 保留原写权语义。
|
|
224
|
+
const sameHostMaterial = path.endsWith('/material') &&
|
|
225
|
+
body?.sameHostResume === true;
|
|
226
|
+
if (socketRead &&
|
|
227
|
+
!deliveryRead &&
|
|
228
|
+
((response.status === 409 &&
|
|
229
|
+
(code === 'BOT_OWNER_FENCED' ||
|
|
230
|
+
code === 'BOT_EXECUTION_HELD' ||
|
|
231
|
+
(sameHostMaterial && code === 'BOT_SAME_HOST_RESUME_INELIGIBLE'))) ||
|
|
232
|
+
(response.status === 400 && sameHostMaterial && code === 'INVALID_BOT_INPUT')))
|
|
233
|
+
throw Object.assign(error, { code });
|
|
234
|
+
throw error;
|
|
235
|
+
}
|
|
236
|
+
try {
|
|
237
|
+
return JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
if (deliveryRead)
|
|
241
|
+
throw new Error('BOT_DELIVERY_READ_RESPONSE_INVALID');
|
|
242
|
+
throw error;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** 只认 GET 与自有固定纯读路由/操作;不从任意正文声明或工具注解推断幂等性。 */
|
|
247
|
+
function isReadResponse(method, path, body) {
|
|
248
|
+
if (method === 'GET')
|
|
249
|
+
return true;
|
|
250
|
+
if (method !== 'POST')
|
|
251
|
+
return false;
|
|
252
|
+
if (/^\/internal\/runtime\/bots\/t\/[^/?#]+\/w\/[^/?#]+\/p\/[^/?#]+\/executions\/[^/?#]+\/recovery-receipt$/.test(path))
|
|
253
|
+
return true;
|
|
254
|
+
if ([
|
|
255
|
+
'/bot-runtime/v1/events/poll',
|
|
256
|
+
'/bot-runtime/v1/reports/poll',
|
|
257
|
+
'/bot-runtime/v1/recovery/inspect',
|
|
258
|
+
].includes(path))
|
|
259
|
+
return true;
|
|
260
|
+
if (!body || typeof body !== 'object' || Array.isArray(body))
|
|
261
|
+
return false;
|
|
262
|
+
const { operation, action } = body;
|
|
263
|
+
return ((agentimPath(path) &&
|
|
264
|
+
['context', 'stream-load', 'stream-lookup'].includes(String(operation))) ||
|
|
265
|
+
(path === '/bot-runtime/v1/commands' && (operation === 'read' || operation === 'history')) ||
|
|
266
|
+
// 只回读原接续或材料。发布材料可记录幂等的签发观察,断流也不触发传输层重发。
|
|
267
|
+
(typeof operation === 'string' &&
|
|
268
|
+
[
|
|
269
|
+
'snapshot',
|
|
270
|
+
'owner-current',
|
|
271
|
+
'owner-progress',
|
|
272
|
+
'owner-state',
|
|
273
|
+
'owner-route',
|
|
274
|
+
'owner-material',
|
|
275
|
+
'material',
|
|
276
|
+
'source-context',
|
|
277
|
+
'source-read',
|
|
278
|
+
'admission-read',
|
|
279
|
+
'read',
|
|
280
|
+
'installation',
|
|
281
|
+
].includes(operation) &&
|
|
282
|
+
/^\/internal\/(?:runtime\/bots|bot-host)\/t\/[^/?#]+\/w\/[^/?#]+\/p\/[^/?#]+\/executions\/[^/?#]+\/recovery-quarantine$/.test(path)) ||
|
|
283
|
+
// 登记续期沿原设备幂等身份;入口未建立连接时与准备目录读取走同一恢复循环。
|
|
284
|
+
((action === 'pending' || action === 'renew') &&
|
|
285
|
+
/^\/internal\/bot-host\/t\/[^/?#]+\/w\/[^/?#]+\/p\/[^/?#]+\/preparations$/.test(path)));
|
|
286
|
+
}
|
|
287
|
+
/** 保留服务端的秒数或绝对时间;过大、畸形或非整数等待不能被缩短成默认重试。 */
|
|
288
|
+
function readRetryAfter(raw) {
|
|
289
|
+
if (raw === null)
|
|
290
|
+
return 0;
|
|
291
|
+
const wait = /^\d+$/.test(raw)
|
|
292
|
+
? Number(raw) * 1000
|
|
293
|
+
: /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), /.test(raw)
|
|
294
|
+
? Math.max(0, Date.parse(raw) - Date.now())
|
|
295
|
+
: NaN;
|
|
296
|
+
return Number.isSafeInteger(wait) && wait >= 0 && wait <= 2147483647 ? wait : undefined;
|
|
297
|
+
}
|
|
298
|
+
/** 响应正文断流也保留已收到的 HTTP 拒绝和退避,不在运输层重试任何请求。 */
|
|
299
|
+
function responseError(response, readResponse) {
|
|
300
|
+
const error = new Error(`BOT_SERVICE_HTTP_${response.status}`);
|
|
301
|
+
if (readResponse && [429, 502, 503, 504].includes(response.status))
|
|
302
|
+
Object.assign(error, { retryAfterMs: readRetryAfter(response.headers.get('retry-after')) });
|
|
303
|
+
return error;
|
|
304
|
+
}
|
|
305
|
+
/** 仅原正式交付及目录读取可携带匹配 HTTP 状态的白名单错误码。 */
|
|
306
|
+
const deliveryReadErrors = new Map([
|
|
307
|
+
['BOT_DELIVERY_READ_RANGE_INVALID', 400],
|
|
308
|
+
['BOT_DELIVERY_NOT_FOUND', 404],
|
|
309
|
+
['BOT_DELIVERY_READ_CONTEXT_MISMATCH', 409],
|
|
310
|
+
['BOT_DELIVERY_READ_REFERENCE_STALE', 409],
|
|
311
|
+
['BOT_DELIVERY_READ_SOURCE_CHANGED', 409],
|
|
312
|
+
['BOT_ADOPTED_HISTORY_REFERENCE_STALE', 409],
|
|
313
|
+
['BOT_OWNER_FENCED', 409],
|
|
314
|
+
['BOT_OWNER_PUBLICATION_REQUIRED', 409],
|
|
315
|
+
['BOT_OWNER_EVIDENCE_CONFLICT', 409],
|
|
316
|
+
]);
|
|
317
|
+
const recoveryErrors = new Map(BOT_RECOVERY_PUBLIC_ERRORS);
|
|
318
|
+
/** 较大私有冻结成果和结构化错误只属于正式 AgentIM 运行接缝。 */
|
|
319
|
+
function agentimPath(path) {
|
|
320
|
+
return /^\/internal\/runtime\/bots\/t\/[^/?#]+\/w\/[^/?#]+\/p\/[^/?#]+\/executions\/[^/?#]+\/agentim$/.test(path);
|
|
321
|
+
}
|
|
322
|
+
/** 只提取错误码,远端消息、当前引用及响应正文不进入异常。 */
|
|
323
|
+
function readServiceCode(bytes) {
|
|
324
|
+
try {
|
|
325
|
+
const value = JSON.parse(new TextDecoder().decode(bytes));
|
|
326
|
+
if (value?.error === 'DSH_BOT_REQUEST_REJECTED' && typeof value.failureCode === 'string')
|
|
327
|
+
return value.failureCode;
|
|
328
|
+
// 旧 Native 会用字符串错误信封,只识别固定的资源拒绝码。
|
|
329
|
+
if (isNativeConversationAdmissionError(value?.error))
|
|
330
|
+
return value.error;
|
|
331
|
+
return value?.error && typeof value.error === 'object' && typeof value.error.code === 'string'
|
|
332
|
+
? value.error.code
|
|
333
|
+
: undefined;
|
|
334
|
+
}
|
|
335
|
+
catch {
|
|
336
|
+
return undefined;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
export { isBotControlUnavailable } from '@agent-stack/contracts';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WorkspaceBridgeClient } from './workspace.js';
|
|
2
|
+
export class AgentsBridgeClient extends WorkspaceBridgeClient {
|
|
3
|
+
/** 旧 REST 在启用管理授权后也发布准确预览,返回结构仍由原投影负责。 */
|
|
4
|
+
publishBusinessAgentVersionPreview(tenantId, workspaceId, projectId, businessAgentId, input, principal) {
|
|
5
|
+
return this.http.post(`/management/tenants/${encodeURIComponent(tenantId)}/workspaces/${encodeURIComponent(workspaceId)}/projects/${encodeURIComponent(projectId)}/business-agents/${encodeURIComponent(businessAgentId)}/versions`, input, this.commandTimeoutMs, this.serviceHeaders(principal));
|
|
6
|
+
}
|
|
7
|
+
listProjectBusinessAgents(tenantId, workspaceId, projectId, principal) {
|
|
8
|
+
return this.http.get(`/management/tenants/${encodeURIComponent(tenantId)}/workspaces/${encodeURIComponent(workspaceId)}/projects/${encodeURIComponent(projectId)}/business-agents`, this.serviceHeaders(principal));
|
|
9
|
+
}
|
|
10
|
+
createProjectBusinessAgent(tenantId, workspaceId, projectId, input, principal) {
|
|
11
|
+
return this.http.post(`/management/tenants/${encodeURIComponent(tenantId)}/workspaces/${encodeURIComponent(workspaceId)}/projects/${encodeURIComponent(projectId)}/business-agents`, input, this.commandTimeoutMs, this.serviceHeaders(principal));
|
|
12
|
+
}
|
|
13
|
+
listBusinessAgentVersions(tenantId, workspaceId, projectId, businessAgentId, principal) {
|
|
14
|
+
return this.http.get(`/management/tenants/${encodeURIComponent(tenantId)}/workspaces/${encodeURIComponent(workspaceId)}/projects/${encodeURIComponent(projectId)}/business-agents/${encodeURIComponent(businessAgentId)}/versions`, this.serviceHeaders(principal));
|
|
15
|
+
}
|
|
16
|
+
createBusinessAgentVersion(tenantId, workspaceId, projectId, businessAgentId, input, principal) {
|
|
17
|
+
return this.http.post(`/management/tenants/${encodeURIComponent(tenantId)}/workspaces/${encodeURIComponent(workspaceId)}/projects/${encodeURIComponent(projectId)}/business-agents/${encodeURIComponent(businessAgentId)}/versions`, input, this.commandTimeoutMs, this.serviceHeaders(principal));
|
|
18
|
+
}
|
|
19
|
+
getBusinessAgentVersion(tenantId, workspaceId, projectId, businessAgentId, versionId, principal) {
|
|
20
|
+
return this.http.get(`/management/tenants/${encodeURIComponent(tenantId)}/workspaces/${encodeURIComponent(workspaceId)}/projects/${encodeURIComponent(projectId)}/business-agents/${encodeURIComponent(businessAgentId)}/versions/${encodeURIComponent(versionId)}`, this.serviceHeaders(principal));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** 项目助理复用 BotBridgeClient 的人类 Control 请求和授权。 */
|
|
2
|
+
export class BotAssistantClient {
|
|
3
|
+
bots;
|
|
4
|
+
constructor(bots) {
|
|
5
|
+
this.bots = bots;
|
|
6
|
+
}
|
|
7
|
+
/** 打开或回查该用户在项目的原接待记录。 */
|
|
8
|
+
openReception(scope, actor, args = {}) {
|
|
9
|
+
return this.bots.onboarding(scope, actor, {
|
|
10
|
+
action: 'reception',
|
|
11
|
+
args: args.deviceId === undefined ? {} : { deviceId: args.deviceId },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/** 打开已有 Bot 的正式任务对话,支持沿已转交的原消息定位。 */
|
|
15
|
+
openConversation(scope, actor, { botId, businessAgentVersionId, missionId, messageId }) {
|
|
16
|
+
return this.bots.onboarding(scope, actor, {
|
|
17
|
+
action: 'existing',
|
|
18
|
+
args: {
|
|
19
|
+
botId,
|
|
20
|
+
businessAgentVersionId,
|
|
21
|
+
missionId,
|
|
22
|
+
...(messageId === undefined ? {} : { messageId }),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Host 凭据仍用于原执行业务准入,不与 Native 调用者身份合并。 */
|
|
2
|
+
export function botRuntimeHeaders(authentication, hostCredential) {
|
|
3
|
+
return {
|
|
4
|
+
...(typeof authentication === 'string'
|
|
5
|
+
? { 'x-agentsim-service-token': authentication }
|
|
6
|
+
: { authorization: `Bearer ${authentication.apiCredential}` }),
|
|
7
|
+
'x-agentxgo-api-credential': hostCredential,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { parseBotNativeAgentIMBinding } from '@agent-stack/contracts';
|
|
2
|
+
import { BotAssistantClient } from './assistant.js';
|
|
3
|
+
import { resolveOwnerRoute } from './owner-route.js';
|
|
4
|
+
import { readBotCommandInventory } from './inventory.js';
|
|
5
|
+
import { BOT_WAKE_SYNC_HEADER, botOwnerProgress, botWakeHint, } from '@agent-stack/contracts';
|
|
6
|
+
import { BRIDGE_SERVICE_TOKEN_HEADER, bridgePrincipalHeaders, } from '../core.js';
|
|
7
|
+
export class BotBridgeClient {
|
|
8
|
+
http;
|
|
9
|
+
timeoutMs;
|
|
10
|
+
controlToken;
|
|
11
|
+
assistant = new BotAssistantClient(this);
|
|
12
|
+
async waitForWake(scope, id, secret, after, waitMs, signal) {
|
|
13
|
+
// 本机复查只取消旧观察,不改变中央唤醒游标或执行权。
|
|
14
|
+
const reply = await this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(id)}/wake-hints`, { after, waitMs }, 15000, { 'x-agentxgo-api-credential': secret }, signal);
|
|
15
|
+
return botWakeHint(reply).token;
|
|
16
|
+
}
|
|
17
|
+
async ownerProgress(scope, id, secret, requestId) {
|
|
18
|
+
const raw = await this.quarantine(scope, id, secret, {
|
|
19
|
+
operation: 'owner-progress',
|
|
20
|
+
requestId,
|
|
21
|
+
});
|
|
22
|
+
if (raw === null)
|
|
23
|
+
return null;
|
|
24
|
+
const progress = botOwnerProgress(raw), c = progress.owner.commit;
|
|
25
|
+
if (c.sourceExecutionId !== id || c.admission.ticket.requestId !== requestId)
|
|
26
|
+
throw new Error('BOT_OWNER_PROGRESS_MISMATCH');
|
|
27
|
+
return progress;
|
|
28
|
+
}
|
|
29
|
+
/** Follow formal execution identity only. Never resumes a Native or creates work. */
|
|
30
|
+
async resolveOwnerExecution(scope, id, secret, hostId) {
|
|
31
|
+
return resolveOwnerRoute(id, hostId, (current) => this.quarantine(scope, current, secret, { operation: 'owner-current' }));
|
|
32
|
+
}
|
|
33
|
+
push(scope, actor, request) {
|
|
34
|
+
return this.controlPost(scope, actor, 'push', request);
|
|
35
|
+
}
|
|
36
|
+
/** Control 使用现有项目管理身份登记目标机和任务授信。 */
|
|
37
|
+
executionTargets(scope, actor, request) {
|
|
38
|
+
return this.controlPost(scope, actor, 'execution-targets', request);
|
|
39
|
+
}
|
|
40
|
+
/** 聊天接手沿同一 Control 主体和任务关联,回执查询不触发模型。 */
|
|
41
|
+
computer(scope, actor, request) {
|
|
42
|
+
return this.controlPost(scope, actor, 'computer', request);
|
|
43
|
+
}
|
|
44
|
+
/** 已登记机器直接搬运正式命令,源 Host 暂停时仍可交回物理输入权。 */
|
|
45
|
+
computerTarget(scope, targetId, secret, request) {
|
|
46
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/computer-targets/${encodeURIComponent(targetId)}`, request, this.timeoutMs, { 'x-agentxgo-api-credential': secret });
|
|
47
|
+
}
|
|
48
|
+
runtimePreparation(scope, actor, request) {
|
|
49
|
+
return this.controlPost(scope, actor, 'runtime-preparation', request);
|
|
50
|
+
}
|
|
51
|
+
/** 首用入口沿 Control 用户身份,空请求保持原移动端合同。 */
|
|
52
|
+
onboarding(scope, actor, request = {}) {
|
|
53
|
+
return this.controlPost(scope, actor, 'onboarding', request);
|
|
54
|
+
}
|
|
55
|
+
identities(scope, actor, request) {
|
|
56
|
+
return this.controlPost(scope, actor, 'identities', request);
|
|
57
|
+
}
|
|
58
|
+
agentLogin(tenantKey, credential) {
|
|
59
|
+
if (!/^[a-z0-9_-]+$/.test(tenantKey))
|
|
60
|
+
throw new Error('BOT_PROJECT_KEY_INVALID');
|
|
61
|
+
return this.http.post(`/internal/control/bots/agent-session/t/${tenantKey}`, { credential }, this.timeoutMs, this.controlToken ? { [BRIDGE_SERVICE_TOKEN_HEADER]: this.controlToken } : undefined);
|
|
62
|
+
}
|
|
63
|
+
projectGrants(scope, actor, request) {
|
|
64
|
+
return this.controlPost(scope, actor, 'project-grants', request);
|
|
65
|
+
}
|
|
66
|
+
/** 透传 Host 维护请求的关闭信号,继续使用原设备入口。 */
|
|
67
|
+
projectHost(scope, secret, operation, request, signal) {
|
|
68
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/${operation}`, request, this.timeoutMs, { 'x-agentxgo-api-credential': secret }, signal);
|
|
69
|
+
}
|
|
70
|
+
lifecycle(scope, actor, request) {
|
|
71
|
+
return this.controlPost(scope, actor, 'lifecycle', request);
|
|
72
|
+
}
|
|
73
|
+
conversation(scope, actor, request) {
|
|
74
|
+
return this.controlPost(scope, actor, 'conversations', request);
|
|
75
|
+
}
|
|
76
|
+
conversationHost(scope, executionId, secret, op, body) {
|
|
77
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(executionId)}/conversations/${op}`, body, this.timeoutMs, { 'x-agentxgo-api-credential': secret });
|
|
78
|
+
}
|
|
79
|
+
constructor(http, timeoutMs, controlToken) {
|
|
80
|
+
this.http = http;
|
|
81
|
+
this.timeoutMs = timeoutMs;
|
|
82
|
+
this.controlToken = controlToken;
|
|
83
|
+
}
|
|
84
|
+
root(scope, surface) {
|
|
85
|
+
return `/internal/${surface}/t/${encodeURIComponent(scope.tenantKey)}/w/${encodeURIComponent(scope.workspaceKey)}/p/${encodeURIComponent(scope.projectKey)}`;
|
|
86
|
+
}
|
|
87
|
+
/** 同一正式Control通道只复用运输装配,不新增权限名单或任务流程。 */
|
|
88
|
+
controlPost(scope, actor, path, request) {
|
|
89
|
+
return this.http.post(`${this.root(scope, 'control/bots')}/${path}`, request, this.timeoutMs, this.human(actor));
|
|
90
|
+
}
|
|
91
|
+
human(actor) {
|
|
92
|
+
if (!this.controlToken)
|
|
93
|
+
throw new Error('BOT_CONTROL_TOKEN_REQUIRED');
|
|
94
|
+
return { [BRIDGE_SERVICE_TOKEN_HEADER]: this.controlToken, ...bridgePrincipalHeaders(actor) };
|
|
95
|
+
}
|
|
96
|
+
entries(scope, actor, request) {
|
|
97
|
+
return this.controlPost(scope, actor, 'entries', request);
|
|
98
|
+
}
|
|
99
|
+
status(scope, actor, missionId) {
|
|
100
|
+
return this.http.get(`${this.root(scope, 'control/bots')}/missions/${encodeURIComponent(missionId)}/status`, this.human(actor));
|
|
101
|
+
}
|
|
102
|
+
create(scope, actor, request) {
|
|
103
|
+
return this.http.post(`${this.root(scope, 'control/bots')}/missions`, request, this.timeoutMs, this.human(actor));
|
|
104
|
+
}
|
|
105
|
+
revise(scope, actor, missionId, request) {
|
|
106
|
+
return this.http.post(`${this.root(scope, 'control/bots')}/missions/${encodeURIComponent(missionId)}/revisions`, request, this.timeoutMs, this.human(actor));
|
|
107
|
+
}
|
|
108
|
+
input(scope, actor, missionId, request) {
|
|
109
|
+
return this.http.post(`${this.root(scope, 'control/bots')}/missions/${encodeURIComponent(missionId)}/inputs`, request, this.timeoutMs, this.human(actor));
|
|
110
|
+
}
|
|
111
|
+
inputProgress(scope, actor, missionId, inputId) {
|
|
112
|
+
return this.http.get(`${this.root(scope, 'control/bots')}/missions/${encodeURIComponent(missionId)}/inputs/${encodeURIComponent(inputId)}`, this.human(actor));
|
|
113
|
+
}
|
|
114
|
+
bind(scope, actor, missionId, request) {
|
|
115
|
+
return this.http.post(`${this.root(scope, 'control/bots')}/missions/${encodeURIComponent(missionId)}/bindings`, request, this.timeoutMs, this.human(actor));
|
|
116
|
+
}
|
|
117
|
+
commandInventory(scope, id, secret, options = {}) {
|
|
118
|
+
return readBotCommandInventory(this.http, `${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(id)}/command-inventory`, secret, options.pendingOnly);
|
|
119
|
+
}
|
|
120
|
+
quarantineSnapshot(scope, id, secret) {
|
|
121
|
+
return this.quarantine(scope, id, secret, {
|
|
122
|
+
operation: 'snapshot',
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
quarantine(scope, id, secret, call) {
|
|
126
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(id)}/recovery-quarantine`, call, this.timeoutMs, { 'x-agentxgo-api-credential': secret });
|
|
127
|
+
}
|
|
128
|
+
prepareRecovery(scope, id, secret, intent) {
|
|
129
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(id)}/recovery-prepare`, intent, this.timeoutMs, { 'x-agentxgo-api-credential': secret });
|
|
130
|
+
}
|
|
131
|
+
/** 原 Host 凭据只读本执行当前通信授权,响应必须保留完整正式绑定。 */
|
|
132
|
+
async nativeAgentIMBinding(scope, executionId, secret) {
|
|
133
|
+
const reply = await this.http.get(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(executionId)}/agentim-binding`, { 'x-agentxgo-api-credential': secret });
|
|
134
|
+
return reply.binding === null ? null : parseBotNativeAgentIMBinding(reply.binding);
|
|
135
|
+
}
|
|
136
|
+
snapshot(scope, executionId, secret, incarnationId, replayAfter) {
|
|
137
|
+
return this.http.get(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(executionId)}/snapshot?${new URLSearchParams({ ...(incarnationId ? { incarnationId } : {}), ...(replayAfter !== undefined ? { replayAfter: replayAfter ?? '' } : {}) })}`, { 'x-agentxgo-api-credential': secret });
|
|
138
|
+
}
|
|
139
|
+
acknowledge(scope, executionId, secret, ack) {
|
|
140
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(executionId)}/acks`, ack, this.timeoutMs, { 'x-agentxgo-api-credential': secret });
|
|
141
|
+
}
|
|
142
|
+
observe(scope, executionId, secret, observation) {
|
|
143
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(executionId)}/observations`, observation, this.timeoutMs, { 'x-agentxgo-api-credential': secret });
|
|
144
|
+
}
|
|
145
|
+
/** 历史观察也必须按原执行核权;返回指纹而非正文。 */
|
|
146
|
+
observationReceipts(scope, id, secret, observationIds) {
|
|
147
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(id)}/observation-receipts`, { observationIds }, this.timeoutMs, { 'x-agentxgo-api-credential': secret });
|
|
148
|
+
}
|
|
149
|
+
prepare(scope, executionId, secret, continuation) {
|
|
150
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(executionId)}/continuations`, continuation, this.timeoutMs, { 'x-agentxgo-api-credential': secret });
|
|
151
|
+
}
|
|
152
|
+
activate(scope, executionId, secret, continuationId) {
|
|
153
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(executionId)}/continuations/${encodeURIComponent(continuationId)}/activate`, {}, this.timeoutMs, { 'x-agentxgo-api-credential': secret });
|
|
154
|
+
}
|
|
155
|
+
wake(scope, id, secret, continuationId, request) {
|
|
156
|
+
return this.http.post(`${this.root(scope, 'bot-host')}/executions/${encodeURIComponent(id)}/continuations/${encodeURIComponent(continuationId)}/wake`, request, this.timeoutMs,
|
|
157
|
+
// 头部只扩展响应能力,保留旧 Bridge 认识的请求体。
|
|
158
|
+
{ 'x-agentxgo-api-credential': secret, [BOT_WAKE_SYNC_HEADER]: '1' });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { botCommandInventory, botCommandInventoryPage, canonicalBotJson, } from '@agent-stack/contracts';
|
|
2
|
+
/** 目录页回到原授权端点;只读分页核验同一历史,跨页变化不被当成完整来源。 */
|
|
3
|
+
export async function readBotCommandInventory(http, path, secret, pendingOnly = false) {
|
|
4
|
+
let after = null, stamp, result;
|
|
5
|
+
for (;;) {
|
|
6
|
+
const query = new URLSearchParams({
|
|
7
|
+
page: '1',
|
|
8
|
+
...(pendingOnly ? { pending: '1' } : {}),
|
|
9
|
+
...(after ? { after } : {}),
|
|
10
|
+
});
|
|
11
|
+
const raw = await http.get(`${path}?${query}`, {
|
|
12
|
+
'x-agentxgo-api-credential': secret,
|
|
13
|
+
});
|
|
14
|
+
const page = botCommandInventoryPage(raw);
|
|
15
|
+
const current = canonicalBotJson([
|
|
16
|
+
page.executionId,
|
|
17
|
+
page.missionRevision,
|
|
18
|
+
page.ownerEpoch,
|
|
19
|
+
page.nativeSessionRef,
|
|
20
|
+
page.history,
|
|
21
|
+
page.pendingOnly,
|
|
22
|
+
]);
|
|
23
|
+
if (page.after !== after ||
|
|
24
|
+
page.pendingOnly !== pendingOnly ||
|
|
25
|
+
(stamp !== undefined && stamp !== current))
|
|
26
|
+
throw new Error('BOT_COMMAND_INVENTORY_CHANGED');
|
|
27
|
+
stamp = current;
|
|
28
|
+
result ??= {
|
|
29
|
+
schemaVersion: 1,
|
|
30
|
+
executionId: page.executionId,
|
|
31
|
+
missionRevision: page.missionRevision,
|
|
32
|
+
ownerEpoch: page.ownerEpoch,
|
|
33
|
+
nativeSessionRef: page.nativeSessionRef,
|
|
34
|
+
commands: [],
|
|
35
|
+
history: page.history,
|
|
36
|
+
pendingOnly,
|
|
37
|
+
};
|
|
38
|
+
for (const command of page.commands) {
|
|
39
|
+
result.commands.push(command);
|
|
40
|
+
}
|
|
41
|
+
const count = pendingOnly ? page.history.pending : page.history.count;
|
|
42
|
+
if (result.commands.length > count || (pendingOnly && count > 256))
|
|
43
|
+
throw new Error('BOT_COMMAND_INVENTORY_INVALID');
|
|
44
|
+
if (page.nextCursor === null) {
|
|
45
|
+
const hash = Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(canonicalBotJson(result.commands)))))
|
|
46
|
+
.map((n) => n.toString(16).padStart(2, '0'))
|
|
47
|
+
.join('');
|
|
48
|
+
if (result.commands.length !== count ||
|
|
49
|
+
hash !== (pendingOnly ? page.history.pendingDigest : page.history.digest))
|
|
50
|
+
throw new Error('BOT_COMMAND_INVENTORY_CHANGED');
|
|
51
|
+
return botCommandInventory(result);
|
|
52
|
+
}
|
|
53
|
+
after = page.nextCursor;
|
|
54
|
+
}
|
|
55
|
+
}
|