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,111 @@
|
|
|
1
|
+
import { constants } from 'node:fs';
|
|
2
|
+
import { link, open, unlink } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { botId, canonicalBotJson } from '@agent-stack/contracts';
|
|
6
|
+
/** 已读到原文件,但其目录提交尚未得到持久化确认。 */
|
|
7
|
+
export class TargetResultDurabilityPending extends Error {
|
|
8
|
+
constructor(cause) {
|
|
9
|
+
super('BOT_TARGET_RESULT_DURABILITY_PENDING', { cause });
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/** 退出回证与结果先持久提交,重启时只读确切原动作的稳定产物。 */
|
|
13
|
+
export class TargetResults {
|
|
14
|
+
root;
|
|
15
|
+
constructor(root) {
|
|
16
|
+
this.root = root;
|
|
17
|
+
}
|
|
18
|
+
async store(identity, runnerId, process, outcome, output) {
|
|
19
|
+
const id = botId(identity.actionId);
|
|
20
|
+
const evidence = canonicalBotJson({
|
|
21
|
+
identity,
|
|
22
|
+
runnerId,
|
|
23
|
+
process,
|
|
24
|
+
outcome,
|
|
25
|
+
output: {
|
|
26
|
+
exitCode: output.exitCode,
|
|
27
|
+
signal: output.signal,
|
|
28
|
+
truncated: output.truncated,
|
|
29
|
+
stdoutBase64: Buffer.from(output.stdout).toString('base64'),
|
|
30
|
+
stderrBase64: Buffer.from(output.stderr).toString('base64'),
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const directory = await this.openDirectory();
|
|
34
|
+
const destination = this.relativeTo(directory, id + '.json');
|
|
35
|
+
const pending = this.relativeTo(directory, '.' + id + '-' + randomUUID());
|
|
36
|
+
try {
|
|
37
|
+
const file = await open(pending, 'wx', 0o600);
|
|
38
|
+
try {
|
|
39
|
+
await file.writeFile(evidence);
|
|
40
|
+
await file.sync();
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
await file.close();
|
|
44
|
+
}
|
|
45
|
+
// 不替换已存在的原动作结果,文件本身的提交先于终态账本回证。
|
|
46
|
+
await link(pending, destination);
|
|
47
|
+
await this.sync(directory);
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
await unlink(pending).catch(() => undefined);
|
|
51
|
+
await directory.close();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async read(actionId, validate, recover) {
|
|
55
|
+
const id = botId(actionId);
|
|
56
|
+
const directory = await this.openDirectory();
|
|
57
|
+
try {
|
|
58
|
+
const file = await open(this.relativeTo(directory, id + '.json'), constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK).catch((error) => {
|
|
59
|
+
if (error instanceof Error && 'code' in error && error.code === 'ENOENT')
|
|
60
|
+
return null;
|
|
61
|
+
throw error;
|
|
62
|
+
});
|
|
63
|
+
if (!file)
|
|
64
|
+
return null;
|
|
65
|
+
try {
|
|
66
|
+
const stat = await file.stat();
|
|
67
|
+
if (!stat.isFile() || stat.uid !== process.getuid?.() || stat.size > 2 * 1024 * 1024)
|
|
68
|
+
throw new Error('BOT_TARGET_RESULT_FILE_INVALID');
|
|
69
|
+
const saved = validate(JSON.parse(await file.readFile('utf8')));
|
|
70
|
+
// 上一次 link 成功但目录同步失败时,重启只能在两个原句柄同步后结算。
|
|
71
|
+
if (recover) {
|
|
72
|
+
try {
|
|
73
|
+
await this.sync(directory, file);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
throw new TargetResultDurabilityPending(error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return saved;
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
await file.close();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
await directory.close();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async openDirectory() {
|
|
90
|
+
const directory = await open(this.root, constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW);
|
|
91
|
+
try {
|
|
92
|
+
const stat = await directory.stat();
|
|
93
|
+
if (!stat.isDirectory() || stat.uid !== process.getuid?.() || (stat.mode & 0o077) !== 0)
|
|
94
|
+
throw new Error('BOT_TARGET_RESULT_DIRECTORY_INVALID');
|
|
95
|
+
return directory;
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
await directory.close();
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Linux 在核对结果与 fsync 的全过程固定同一个私有父目录。 */
|
|
103
|
+
relativeTo(directory, name) {
|
|
104
|
+
return join(process.platform === 'linux' ? `/proc/self/fd/${directory.fd}` : this.root, name);
|
|
105
|
+
}
|
|
106
|
+
async sync(directory, file) {
|
|
107
|
+
if (file)
|
|
108
|
+
await file.sync();
|
|
109
|
+
await directory.sync();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { closeSync, constants, fstatSync, lstatSync, openSync, readlinkSync, readSync, realpathSync, statSync, } from 'node:fs';
|
|
3
|
+
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
4
|
+
import { botProcessStartTicks } from '@agent-stack/runtime-contracts';
|
|
5
|
+
const setpriv = '/usr/bin/setpriv';
|
|
6
|
+
const maxId = 0x7fff_ffff;
|
|
7
|
+
const maxProcBytes = 65_536;
|
|
8
|
+
const elfPrefix = 20;
|
|
9
|
+
const flags = constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK;
|
|
10
|
+
const fileIdentity = (value) => `${value.dev}:${value.ino}`;
|
|
11
|
+
const fail = (code, cause) => new Error('BOT_CODEX_TASK_ROLE_' + code, { cause });
|
|
12
|
+
/** 读取有界内核资料;验证 ELF 时保持同一文件句柄和预期 inode。 */
|
|
13
|
+
function readBounded(path, size, identity) {
|
|
14
|
+
const fd = openSync(path, flags);
|
|
15
|
+
try {
|
|
16
|
+
const stat = fstatSync(fd, { bigint: true });
|
|
17
|
+
if (!stat.isFile() || (identity && fileIdentity(stat) !== identity))
|
|
18
|
+
throw fail('FILE_IDENTITY_MISMATCH');
|
|
19
|
+
const buffer = Buffer.alloc(size);
|
|
20
|
+
let length = 0;
|
|
21
|
+
while (length < buffer.length) {
|
|
22
|
+
const n = readSync(fd, buffer, length, buffer.length - length, null);
|
|
23
|
+
if (!n)
|
|
24
|
+
break;
|
|
25
|
+
length += n;
|
|
26
|
+
}
|
|
27
|
+
return buffer.subarray(0, length);
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
closeSync(fd);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const linux = {
|
|
34
|
+
platform: process.platform,
|
|
35
|
+
get uid() {
|
|
36
|
+
return process.geteuid?.() ?? -1;
|
|
37
|
+
},
|
|
38
|
+
get gid() {
|
|
39
|
+
return process.getegid?.() ?? -1;
|
|
40
|
+
},
|
|
41
|
+
pid: process.pid,
|
|
42
|
+
canonical: realpathSync,
|
|
43
|
+
metadata(path) {
|
|
44
|
+
const stat = lstatSync(path, { bigint: true });
|
|
45
|
+
return {
|
|
46
|
+
uid: Number(stat.uid),
|
|
47
|
+
gid: Number(stat.gid),
|
|
48
|
+
mode: Number(stat.mode),
|
|
49
|
+
identity: fileIdentity(stat),
|
|
50
|
+
kind: stat.isDirectory() ? 'directory' : stat.isFile() ? 'file' : 'other',
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
header: (path, identity) => readBounded(path, elfPrefix, identity),
|
|
54
|
+
read(path) {
|
|
55
|
+
const buffer = readBounded(path, maxProcBytes + 1);
|
|
56
|
+
if (buffer.length > maxProcBytes)
|
|
57
|
+
throw fail('PROC_READ_LIMIT');
|
|
58
|
+
return buffer.toString('utf8');
|
|
59
|
+
},
|
|
60
|
+
processPath(pid, kind) {
|
|
61
|
+
const entry = `/proc/${pid}/${kind}`;
|
|
62
|
+
return {
|
|
63
|
+
path: readlinkSync(entry),
|
|
64
|
+
identity: fileIdentity(statSync(entry, { bigint: true })),
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
const validId = (value) => Number.isSafeInteger(value) && value > 0 && value <= maxId;
|
|
69
|
+
function isElf(header) {
|
|
70
|
+
if (header.length < elfPrefix ||
|
|
71
|
+
header[0] !== 0x7f ||
|
|
72
|
+
header[1] !== 0x45 ||
|
|
73
|
+
header[2] !== 0x4c ||
|
|
74
|
+
header[3] !== 0x46 ||
|
|
75
|
+
(header[4] !== 1 && header[4] !== 2) ||
|
|
76
|
+
(header[5] !== 1 && header[5] !== 2) ||
|
|
77
|
+
header[6] !== 1)
|
|
78
|
+
return false;
|
|
79
|
+
const view = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
80
|
+
const type = view.getUint16(16, header[5] === 1);
|
|
81
|
+
return type === 2 || type === 3;
|
|
82
|
+
}
|
|
83
|
+
const canonicalPath = (system, path) => isAbsolute(path) &&
|
|
84
|
+
resolve(path) === path &&
|
|
85
|
+
path.length <= 4096 &&
|
|
86
|
+
!/[\x00-\x1f\x7f]/.test(path) &&
|
|
87
|
+
system.canonical(path) === path;
|
|
88
|
+
/** 只有 root 可改写启动链,任务身份仍须能穿过部署目录并执行 Native。 */
|
|
89
|
+
function qualifyExecutable(system, path, taskGid) {
|
|
90
|
+
if (!canonicalPath(system, path))
|
|
91
|
+
throw fail('PATH_INVALID');
|
|
92
|
+
const executable = system.metadata(path);
|
|
93
|
+
const executeBit = (entry) => taskGid === undefined ? 0o100 : entry.gid === taskGid ? 0o010 : 0o001;
|
|
94
|
+
if (executable.kind !== 'file' ||
|
|
95
|
+
executable.uid !== 0 ||
|
|
96
|
+
(executable.mode & 0o7022) !== 0 ||
|
|
97
|
+
(executable.mode & executeBit(executable)) === 0 ||
|
|
98
|
+
!isElf(system.header(path, executable.identity)))
|
|
99
|
+
throw fail('BINARY_INVALID');
|
|
100
|
+
for (let parent = dirname(path), depth = 0;; parent = dirname(parent)) {
|
|
101
|
+
const entry = system.metadata(parent);
|
|
102
|
+
if (++depth > 64 ||
|
|
103
|
+
entry.kind !== 'directory' ||
|
|
104
|
+
entry.uid !== 0 ||
|
|
105
|
+
(entry.mode & 0o022) !== 0 ||
|
|
106
|
+
(entry.mode & executeBit(entry)) === 0)
|
|
107
|
+
throw fail('BINARY_ANCESTOR_INVALID');
|
|
108
|
+
if (parent === '/')
|
|
109
|
+
return executable.identity;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function startTicks(system, pid) {
|
|
113
|
+
const stat = system.read(`/proc/${pid}/stat`);
|
|
114
|
+
const [state, parent] = stat
|
|
115
|
+
.slice(stat.lastIndexOf(')') + 1)
|
|
116
|
+
.trim()
|
|
117
|
+
.split(/\s+/, 2);
|
|
118
|
+
if (!state || ['Z', 'X', 'x'].includes(state) || parent !== String(system.pid))
|
|
119
|
+
throw fail('CHILD_INVALID');
|
|
120
|
+
return botProcessStartTicks(stat, pid);
|
|
121
|
+
}
|
|
122
|
+
/** real、effective、saved 和 filesystem 身份一致,任务进程不得通过 exec 继承或获取额外权限。 */
|
|
123
|
+
export function verifyNativeTaskCredentials(status, role) {
|
|
124
|
+
const field = (name) => {
|
|
125
|
+
const matches = [...status.matchAll(new RegExp(`^${name}:([^\\n]*)$`, 'gm'))];
|
|
126
|
+
if (matches.length !== 1)
|
|
127
|
+
throw fail('CREDENTIAL_FIELD_INVALID');
|
|
128
|
+
return matches[0]?.[1]?.trim() ?? '';
|
|
129
|
+
};
|
|
130
|
+
const ids = (name, expected) => {
|
|
131
|
+
const observed = field(name).split(/[\t ]+/);
|
|
132
|
+
return observed.length === 4 && observed.every((value) => value === String(expected));
|
|
133
|
+
};
|
|
134
|
+
if (!ids('Uid', role.uid) ||
|
|
135
|
+
!ids('Gid', role.gid) ||
|
|
136
|
+
field('Groups') !== '' ||
|
|
137
|
+
field('NoNewPrivs') !== '1' ||
|
|
138
|
+
!['CapInh', 'CapPrm', 'CapEff', 'CapBnd', 'CapAmb'].every((name) => /^0+$/.test(field(name))))
|
|
139
|
+
throw fail('CREDENTIAL_MISMATCH');
|
|
140
|
+
}
|
|
141
|
+
/** 装配固定 setpriv 调用,握手后只接受这次启动的原子进程和内核执行身份。 */
|
|
142
|
+
export function prepareNativeTaskLaunch(role, binary, cwd, system = linux) {
|
|
143
|
+
if (system.platform !== 'linux' || system.uid !== 0)
|
|
144
|
+
throw fail('LINUX_ROOT_REQUIRED');
|
|
145
|
+
const { uid, gid } = role;
|
|
146
|
+
if (!validId(uid) || !validId(gid) || uid === system.uid || gid === system.gid)
|
|
147
|
+
throw fail('IDENTITY_INVALID');
|
|
148
|
+
let binaryIdentity;
|
|
149
|
+
try {
|
|
150
|
+
qualifyExecutable(system, setpriv);
|
|
151
|
+
binaryIdentity = qualifyExecutable(system, binary, gid);
|
|
152
|
+
}
|
|
153
|
+
catch (cause) {
|
|
154
|
+
throw fail('EXECUTABLE_UNTRUSTED', cause);
|
|
155
|
+
}
|
|
156
|
+
let cwdIdentity;
|
|
157
|
+
try {
|
|
158
|
+
if (!canonicalPath(system, cwd))
|
|
159
|
+
throw fail('PATH_INVALID');
|
|
160
|
+
const directory = system.metadata(cwd);
|
|
161
|
+
if (directory.kind !== 'directory')
|
|
162
|
+
throw fail('CWD_INVALID');
|
|
163
|
+
cwdIdentity = directory.identity;
|
|
164
|
+
}
|
|
165
|
+
catch (cause) {
|
|
166
|
+
throw fail('CWD_UNTRUSTED', cause);
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
program: setpriv,
|
|
170
|
+
args: [
|
|
171
|
+
`--reuid=${uid}`,
|
|
172
|
+
`--regid=${gid}`,
|
|
173
|
+
'--clear-groups',
|
|
174
|
+
'--no-new-privs',
|
|
175
|
+
'--inh-caps=-all',
|
|
176
|
+
'--ambient-caps=-all',
|
|
177
|
+
'--bounding-set=-all',
|
|
178
|
+
'--',
|
|
179
|
+
binary,
|
|
180
|
+
],
|
|
181
|
+
verify(pid) {
|
|
182
|
+
try {
|
|
183
|
+
if (!validId(pid))
|
|
184
|
+
throw fail('CHILD_INVALID');
|
|
185
|
+
const ticks = startTicks(system, pid);
|
|
186
|
+
verifyNativeTaskCredentials(system.read(`/proc/${pid}/status`), { uid, gid });
|
|
187
|
+
const executable = system.processPath(pid, 'exe');
|
|
188
|
+
if (executable.path !== binary || executable.identity !== binaryIdentity)
|
|
189
|
+
throw fail('EXECUTABLE_MISMATCH');
|
|
190
|
+
// 工作目录同名替换时,原有启动资格不能覆盖新的目录对象。
|
|
191
|
+
const directory = system.processPath(pid, 'cwd');
|
|
192
|
+
if (directory.path !== cwd || directory.identity !== cwdIdentity)
|
|
193
|
+
throw fail('CWD_MISMATCH');
|
|
194
|
+
const boot = system.read('/proc/sys/kernel/random/boot_id').trim();
|
|
195
|
+
if (!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/.test(boot) ||
|
|
196
|
+
startTicks(system, pid) !== ticks)
|
|
197
|
+
throw fail('START_IDENTITY_MISMATCH');
|
|
198
|
+
return {
|
|
199
|
+
pid,
|
|
200
|
+
uid,
|
|
201
|
+
gid,
|
|
202
|
+
startRef: createHash('sha256').update(`${boot}:${pid}:${ticks}`).digest('hex'),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
catch (cause) {
|
|
206
|
+
throw fail('PROCESS_UNCONFIRMED', cause);
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { chown, mkdir } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { botHostActionIdentity, botHostActionOutcome, botHostActionProcess, botObject, canonicalBotJson, } from '@agent-stack/contracts';
|
|
4
|
+
import { TargetResultDurabilityPending, TargetResults } from './results.js';
|
|
5
|
+
import { targetActionRequest, targetCommand } from './work.js';
|
|
6
|
+
import { settleArtifact, verifyArtifactOutput } from './artifact.js';
|
|
7
|
+
/** 只协调目标上的原动作、进程和回证,正式授权由调用方核对。 */
|
|
8
|
+
export class TargetRunner {
|
|
9
|
+
options;
|
|
10
|
+
journal;
|
|
11
|
+
scope;
|
|
12
|
+
launch;
|
|
13
|
+
admission;
|
|
14
|
+
active = new Map();
|
|
15
|
+
results;
|
|
16
|
+
closed = false;
|
|
17
|
+
constructor(options, journal, scope, launch, admission = {}) {
|
|
18
|
+
this.options = options;
|
|
19
|
+
this.journal = journal;
|
|
20
|
+
this.scope = scope;
|
|
21
|
+
this.launch = launch;
|
|
22
|
+
this.admission = admission;
|
|
23
|
+
if (!Number.isInteger(options.uid) ||
|
|
24
|
+
options.uid <= 0 ||
|
|
25
|
+
options.uid === process.getuid?.() ||
|
|
26
|
+
!Number.isInteger(options.gid) ||
|
|
27
|
+
options.gid <= 0)
|
|
28
|
+
throw new Error('BOT_TARGET_EXECUTION_IDENTITY_NOT_SEPARATE');
|
|
29
|
+
this.results = new TargetResults(options.resultRoot);
|
|
30
|
+
}
|
|
31
|
+
/** 整个任务执行身份空闲时才允许开始清理暂存路径。 */
|
|
32
|
+
get idle() {
|
|
33
|
+
return this.active.size === 0;
|
|
34
|
+
}
|
|
35
|
+
/** 已核对正式预留后先保留本地原身份,响应丢失仍能分清尚未派发。 */
|
|
36
|
+
reserve(raw) {
|
|
37
|
+
if (this.closed)
|
|
38
|
+
throw new Error('BOT_TARGET_RUNNER_CLOSED');
|
|
39
|
+
const { identity, work } = targetActionRequest(raw);
|
|
40
|
+
this.workspace(work);
|
|
41
|
+
return this.journal.reserve(identity);
|
|
42
|
+
}
|
|
43
|
+
workspace(work) {
|
|
44
|
+
const cwd = this.options.workspaces.get(work.workspaceRef);
|
|
45
|
+
if (!cwd || work.timeoutMs > this.options.maxRuntimeMs)
|
|
46
|
+
throw new Error('BOT_TARGET_ACTION_PROFILE_MISMATCH');
|
|
47
|
+
return cwd;
|
|
48
|
+
}
|
|
49
|
+
/** 可安全重读终态;只有尚未越过启动边界的当前授信动作能创建新进程。 */
|
|
50
|
+
start(raw, authorizeBeforeGate, onSettled) {
|
|
51
|
+
if (this.closed)
|
|
52
|
+
throw new Error('BOT_TARGET_RUNNER_CLOSED');
|
|
53
|
+
const action = targetActionRequest(raw);
|
|
54
|
+
const { identity, work } = action;
|
|
55
|
+
if (this.journal.read(identity.actionId)) {
|
|
56
|
+
const existing = this.journal.reserve(identity);
|
|
57
|
+
if (existing.state !== 'RESERVED')
|
|
58
|
+
return existing;
|
|
59
|
+
}
|
|
60
|
+
const cwd = this.workspace(work);
|
|
61
|
+
if (this.active.size >= this.options.maxConcurrent)
|
|
62
|
+
throw new Error('BOT_TARGET_ACTION_CAPACITY');
|
|
63
|
+
this.admission.beforeStart?.();
|
|
64
|
+
this.journal.reserve(identity);
|
|
65
|
+
const admitted = this.journal.begin(identity.actionId, this.options.runnerId);
|
|
66
|
+
if (!admitted.launch)
|
|
67
|
+
return admitted.record;
|
|
68
|
+
const task = { timedOut: false };
|
|
69
|
+
this.active.set(identity.actionId, task);
|
|
70
|
+
task.done = this.run(action, cwd, task, authorizeBeforeGate, onSettled).finally(() => {
|
|
71
|
+
this.active.delete(identity.actionId);
|
|
72
|
+
if (this.idle)
|
|
73
|
+
this.admission.onIdle?.();
|
|
74
|
+
});
|
|
75
|
+
// 目标事实仍能回查,错误正文和命令参数不会进入进程日志。
|
|
76
|
+
void task.done.catch(() => console.warn('BOT_TARGET_ACTION_RECEIPT_UNAVAILABLE'));
|
|
77
|
+
return admitted.record;
|
|
78
|
+
}
|
|
79
|
+
async status(actionId) {
|
|
80
|
+
const record = this.journal.read(actionId);
|
|
81
|
+
if (record?.state !== 'UNKNOWN' || !record.runnerId || !record.process)
|
|
82
|
+
return record;
|
|
83
|
+
try {
|
|
84
|
+
const saved = await this.readResult(record);
|
|
85
|
+
if (!saved)
|
|
86
|
+
return record;
|
|
87
|
+
return this.journal.finish(actionId, record.runnerId, record.process, saved.outcome);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (error instanceof TargetResultDurabilityPending)
|
|
91
|
+
return record;
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async readResult(record) {
|
|
96
|
+
const id = record.identity.actionId;
|
|
97
|
+
return this.results.read(id, (saved) => {
|
|
98
|
+
const value = botObject(saved, ['identity', 'runnerId', 'process', 'outcome', 'output']);
|
|
99
|
+
const outcome = botHostActionOutcome(value.outcome);
|
|
100
|
+
if (value.runnerId !== record.runnerId ||
|
|
101
|
+
outcome.resultRef !== id ||
|
|
102
|
+
canonicalBotJson(botHostActionIdentity(value.identity)) !==
|
|
103
|
+
canonicalBotJson(record.identity) ||
|
|
104
|
+
canonicalBotJson(botHostActionProcess(value.process)) !==
|
|
105
|
+
canonicalBotJson(record.process) ||
|
|
106
|
+
(record.outcome && canonicalBotJson(outcome) !== canonicalBotJson(record.outcome)))
|
|
107
|
+
throw new Error('BOT_TARGET_RESULT_IDENTITY_MISMATCH');
|
|
108
|
+
if (outcome.artifact)
|
|
109
|
+
verifyArtifactOutput(outcome.artifact, value.output);
|
|
110
|
+
else if (outcome.reason === 'ARTIFACT_PUBLISHED')
|
|
111
|
+
throw new Error('BOT_TARGET_ARTIFACT_RESULT_INVALID');
|
|
112
|
+
return { outcome, output: value.output };
|
|
113
|
+
}, record.state === 'UNKNOWN');
|
|
114
|
+
}
|
|
115
|
+
/** 取消的提交与真实进程退出分开,回执依旧沿原动作读取。 */
|
|
116
|
+
cancel(actionId) {
|
|
117
|
+
const record = this.journal.requestCancel(actionId);
|
|
118
|
+
const task = this.active.get(actionId);
|
|
119
|
+
if (task && !record.outcome)
|
|
120
|
+
this.stopTask(actionId, task);
|
|
121
|
+
return record;
|
|
122
|
+
}
|
|
123
|
+
async result(actionId) {
|
|
124
|
+
const record = await this.status(actionId);
|
|
125
|
+
if (record?.outcome?.resultRef !== actionId)
|
|
126
|
+
return null;
|
|
127
|
+
return this.readResult(record);
|
|
128
|
+
}
|
|
129
|
+
stopTask(actionId, task) {
|
|
130
|
+
if (task.process && !task.cancelling)
|
|
131
|
+
task.cancelling = task.process.cancel().catch(() => {
|
|
132
|
+
this.journal.uncertain(actionId, this.options.runnerId);
|
|
133
|
+
});
|
|
134
|
+
void task.cancelling?.catch(() => console.warn('BOT_TARGET_CANCEL_RECEIPT_UNAVAILABLE'));
|
|
135
|
+
}
|
|
136
|
+
async prepareScratch(actionId) {
|
|
137
|
+
const scratch = join(this.options.scratchRoot, actionId);
|
|
138
|
+
await mkdir(scratch, { mode: 0o700 });
|
|
139
|
+
await chown(scratch, this.options.uid, this.options.gid);
|
|
140
|
+
return scratch;
|
|
141
|
+
}
|
|
142
|
+
async run(action, cwd, task, authorizeBeforeGate, onSettled) {
|
|
143
|
+
const { identity, work } = action;
|
|
144
|
+
const { actionId } = identity;
|
|
145
|
+
const p = this.options;
|
|
146
|
+
let scope;
|
|
147
|
+
let timer;
|
|
148
|
+
let releaseWatchdog;
|
|
149
|
+
let settled;
|
|
150
|
+
let completed = false, activated = false;
|
|
151
|
+
try {
|
|
152
|
+
// 先绑定配置中的原工作区身份,再建立可能需要恢复的执行范围。
|
|
153
|
+
const command = targetCommand(work, p.outputLimit, cwd, p.nativeShell && { ...p.nativeShell, actionId });
|
|
154
|
+
const scratch = await (this.admission.scratch?.(actionId) ?? this.prepareScratch(actionId));
|
|
155
|
+
scope = await this.scope(actionId, p.limits);
|
|
156
|
+
const child = await this.launch({
|
|
157
|
+
...command,
|
|
158
|
+
...('native' in command
|
|
159
|
+
? {
|
|
160
|
+
nativeJob: {
|
|
161
|
+
authorize: authorizeBeforeGate ??
|
|
162
|
+
(() => Promise.reject(new Error('BOT_TARGET_ACTION_GATE_UNCONFIRMED'))),
|
|
163
|
+
...(p.nativeShell?.rolePrefix ? { rolePrefix: p.nativeShell.rolePrefix } : {}),
|
|
164
|
+
},
|
|
165
|
+
}
|
|
166
|
+
: {}),
|
|
167
|
+
cwd,
|
|
168
|
+
uid: p.uid,
|
|
169
|
+
gid: p.gid,
|
|
170
|
+
env: {
|
|
171
|
+
...p.sessionEnvironment,
|
|
172
|
+
HOME: p.home,
|
|
173
|
+
PATH: p.path,
|
|
174
|
+
TMPDIR: scratch,
|
|
175
|
+
LANG: 'C.UTF-8',
|
|
176
|
+
},
|
|
177
|
+
outputLimit: p.outputLimit,
|
|
178
|
+
}, scope);
|
|
179
|
+
task.process = child;
|
|
180
|
+
const running = this.journal.running(actionId, p.runnerId, child.identity);
|
|
181
|
+
if (!running.cancelRequested) {
|
|
182
|
+
// 两个计时器均先于放行,监督端失联时看门进程仍可回收整个动作。
|
|
183
|
+
timer = setTimeout(() => {
|
|
184
|
+
task.timedOut = true;
|
|
185
|
+
this.stopTask(actionId, task);
|
|
186
|
+
}, work.timeoutMs);
|
|
187
|
+
try {
|
|
188
|
+
releaseWatchdog = await scope.protect(work.timeoutMs);
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
// 没有放行原命令,确认受信子进程已退出后可以给出确定失败。
|
|
192
|
+
clearTimeout(timer);
|
|
193
|
+
await child.cancel();
|
|
194
|
+
await child.wait;
|
|
195
|
+
settled = this.journal.finish(actionId, p.runnerId, child.identity, {
|
|
196
|
+
state: 'FAILED',
|
|
197
|
+
reason: 'SUPERVISION_UNAVAILABLE',
|
|
198
|
+
});
|
|
199
|
+
completed = true;
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (authorizeBeforeGate && !task.timedOut && !this.journal.read(actionId)?.cancelRequested) {
|
|
204
|
+
try {
|
|
205
|
+
// 以目标凭据紧贴最后放行点再次核对原 Owner、任务和许可。
|
|
206
|
+
await authorizeBeforeGate();
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
clearTimeout(timer);
|
|
210
|
+
await child.cancel();
|
|
211
|
+
await child.wait;
|
|
212
|
+
settled = this.journal.finish(actionId, p.runnerId, child.identity, {
|
|
213
|
+
state: 'FAILED',
|
|
214
|
+
reason: 'TARGET_AUTHORIZATION_LOST',
|
|
215
|
+
});
|
|
216
|
+
completed = true;
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (task.timedOut || this.journal.read(actionId)?.cancelRequested)
|
|
221
|
+
this.stopTask(actionId, task);
|
|
222
|
+
else {
|
|
223
|
+
child.activate();
|
|
224
|
+
activated = true;
|
|
225
|
+
}
|
|
226
|
+
const result = await child.wait;
|
|
227
|
+
clearTimeout(timer);
|
|
228
|
+
const cancelled = this.journal.read(actionId)?.cancelRequested ?? false;
|
|
229
|
+
const exited = 'native' in command
|
|
230
|
+
? this.nativeOutcome(actionId, result, cancelled, task.timedOut)
|
|
231
|
+
: this.outcome(actionId, result, cancelled, activated, task.timedOut);
|
|
232
|
+
const { outcome, output } = work.operation === 'PUBLISH_ARTIFACT'
|
|
233
|
+
? settleArtifact(exited, result, work, actionId, p.outputLimit)
|
|
234
|
+
: {
|
|
235
|
+
outcome: exited,
|
|
236
|
+
// 公开输出只能复述已核对的业务退出码,包装进程退出码留在监督端。
|
|
237
|
+
output: 'native' in command
|
|
238
|
+
? {
|
|
239
|
+
...result,
|
|
240
|
+
exitCode: exited.exitCode ?? null,
|
|
241
|
+
signal: exited.exitCode === undefined ? result.signal : null,
|
|
242
|
+
}
|
|
243
|
+
: result,
|
|
244
|
+
};
|
|
245
|
+
await this.results.store(identity, p.runnerId, child.identity, outcome, output);
|
|
246
|
+
settled = this.journal.finish(actionId, p.runnerId, child.identity, outcome);
|
|
247
|
+
completed = true;
|
|
248
|
+
}
|
|
249
|
+
catch (error) {
|
|
250
|
+
if (task.process) {
|
|
251
|
+
this.stopTask(actionId, task);
|
|
252
|
+
await task.cancelling;
|
|
253
|
+
settled = this.journal.uncertain(actionId, p.runnerId);
|
|
254
|
+
}
|
|
255
|
+
else if (!scope ||
|
|
256
|
+
(error instanceof Error && error.message === 'BOT_TARGET_PROCESS_NOT_DISPATCHED')) {
|
|
257
|
+
settled = this.journal.finish(actionId, p.runnerId, null, {
|
|
258
|
+
state: 'FAILED',
|
|
259
|
+
reason: 'SPAWN_FAILED',
|
|
260
|
+
});
|
|
261
|
+
completed = true;
|
|
262
|
+
}
|
|
263
|
+
else
|
|
264
|
+
settled = this.journal.uncertain(actionId, p.runnerId);
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
clearTimeout(timer);
|
|
268
|
+
// 只在本地账本提交后通知原回证;Bridge 传输失败不影响物理收尾。
|
|
269
|
+
try {
|
|
270
|
+
if (settled && (settled.outcome || settled.state === 'UNKNOWN'))
|
|
271
|
+
onSettled?.(settled);
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
console.warn('BOT_TARGET_ACTION_RECEIPT_UNAVAILABLE');
|
|
275
|
+
}
|
|
276
|
+
// 看门进程自行核实旧执行域为空,输出或账本异常也不能让它长期空转。
|
|
277
|
+
await releaseWatchdog?.().catch(() => console.warn('BOT_TARGET_WATCHDOG_CLEANUP_PENDING'));
|
|
278
|
+
if (completed && scope)
|
|
279
|
+
await scope.dispose().catch(() => console.warn('BOT_TARGET_SCOPE_CLEANUP_PENDING'));
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
outcome(resultRef, result, cancelRequested, activated, timedOut) {
|
|
283
|
+
const exit = result.exitCode === null ? {} : { exitCode: result.exitCode };
|
|
284
|
+
if (result.exitCode === 0)
|
|
285
|
+
return { state: 'SUCCEEDED', reason: 'EXITED', exitCode: 0, resultRef };
|
|
286
|
+
if (cancelRequested && (!activated || result.signal))
|
|
287
|
+
return { state: 'CANCELLED', reason: 'PROCESS_EXIT_CONFIRMED', ...exit, resultRef };
|
|
288
|
+
return {
|
|
289
|
+
state: 'FAILED',
|
|
290
|
+
reason: timedOut && (!activated || result.signal)
|
|
291
|
+
? 'TIMEOUT'
|
|
292
|
+
: result.signal
|
|
293
|
+
? 'SIGNALLED'
|
|
294
|
+
: 'EXITED',
|
|
295
|
+
...exit,
|
|
296
|
+
resultRef,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
/** 包装进程退出与业务命令退出分别取证,缺少原生回证时不会重发原动作。 */
|
|
300
|
+
nativeOutcome(resultRef, result, cancelled, timedOut) {
|
|
301
|
+
const code = result.nativeExitCode;
|
|
302
|
+
const verified = result.nativeDispatch === true && code !== undefined;
|
|
303
|
+
if (verified && code === 0)
|
|
304
|
+
return { state: 'SUCCEEDED', reason: 'EXITED', exitCode: code, resultRef };
|
|
305
|
+
const exit = verified ? { exitCode: code } : {};
|
|
306
|
+
// 原生终态先于监督端收尾时保留原结果,即使随后包装进程被强制回收。
|
|
307
|
+
const interrupted = !verified || result.nativeInterrupted === true;
|
|
308
|
+
if (cancelled && interrupted)
|
|
309
|
+
return { state: 'CANCELLED', reason: 'PROCESS_EXIT_CONFIRMED', ...exit, resultRef };
|
|
310
|
+
if (timedOut && interrupted)
|
|
311
|
+
return { state: 'FAILED', reason: 'TIMEOUT', ...exit, resultRef };
|
|
312
|
+
if (verified)
|
|
313
|
+
return { state: 'FAILED', reason: 'EXITED', ...exit, resultRef };
|
|
314
|
+
if (result.nativeDispatch === false)
|
|
315
|
+
return { state: 'FAILED', reason: 'CODEX_JOB_NOT_DISPATCHED', resultRef };
|
|
316
|
+
throw new Error('BOT_CODEX_JOB_OUTCOME_UNKNOWN');
|
|
317
|
+
}
|
|
318
|
+
/** 关闭接收后尽力取消原动作,等待各自退出回证。 */
|
|
319
|
+
async close() {
|
|
320
|
+
this.closed = true;
|
|
321
|
+
const active = [...this.active.entries()];
|
|
322
|
+
let failed = false;
|
|
323
|
+
for (const [id, task] of active) {
|
|
324
|
+
try {
|
|
325
|
+
this.cancel(id);
|
|
326
|
+
}
|
|
327
|
+
catch {
|
|
328
|
+
// 即使 SQLite 暂时无法记取消,也继续关闭其余目标进程。
|
|
329
|
+
failed = true;
|
|
330
|
+
this.stopTask(id, task);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
const pending = active.flatMap(([, item]) => (item.done ? [item.done] : []));
|
|
334
|
+
const settled = await Promise.allSettled(pending);
|
|
335
|
+
if (failed || settled.some((item) => item.status === 'rejected'))
|
|
336
|
+
throw new Error('BOT_TARGET_SHUTDOWN_RECEIPT_UNAVAILABLE');
|
|
337
|
+
}
|
|
338
|
+
}
|