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,281 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync, } from 'node:fs';
|
|
3
|
+
import { createConnection } from 'node:net';
|
|
4
|
+
import { homedir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
7
|
+
import { assertBotCapabilityVersion, BOT_HOST_COMPONENT_CAPABILITY, BOT_HOST_COMPONENT_VERSION, } from '@agent-stack/contracts';
|
|
8
|
+
import { loadProjectHostConfig } from '../../preparation/config.js';
|
|
9
|
+
import { deploymentSystem, privateDeploymentFile, privateDirectory } from '../system.js';
|
|
10
|
+
import { withHostComponentLock } from './lock.js';
|
|
11
|
+
import { installedHostRelease, stageHostRelease } from './release.js';
|
|
12
|
+
import { isComponentRelease } from './verify.js';
|
|
13
|
+
import { ownedHostSupervisor } from './supervisor.js';
|
|
14
|
+
import { manageWindowsHostComponent } from './windows.js';
|
|
15
|
+
const localPorts = {
|
|
16
|
+
supervisor: ownedHostSupervisor,
|
|
17
|
+
stage: stageHostRelease,
|
|
18
|
+
verify: installedHostRelease,
|
|
19
|
+
home: () => realpathSync(homedir()),
|
|
20
|
+
};
|
|
21
|
+
/** 私有配置与原设备回执确定唯一组件,Supervisor 不接收任意 unit、系统路径或特权命令。 */
|
|
22
|
+
export async function manageHostComponent(input, ports = localPorts) {
|
|
23
|
+
const platform = process.platform;
|
|
24
|
+
const { action } = input;
|
|
25
|
+
// Windows 的受管组件已由 MSI 注册,直接沿固定的 SCM 入口操作。
|
|
26
|
+
if (platform === 'win32')
|
|
27
|
+
return manageWindowsHostComponent(input);
|
|
28
|
+
if ((platform !== 'darwin' && platform !== 'linux') || !process.getuid?.())
|
|
29
|
+
throw new Error('BOT_COMPONENT_USER_SUPERVISOR_UNAVAILABLE');
|
|
30
|
+
privateDeploymentFile(input.config);
|
|
31
|
+
const config = loadProjectHostConfig(input.config);
|
|
32
|
+
if (!config?.deviceLease || !/^device-[a-f0-9-]{36}$/.test(config.hostId))
|
|
33
|
+
throw new Error('BOT_COMPONENT_DEVICE_REQUIRED');
|
|
34
|
+
assertBotCapabilityVersion(BOT_HOST_COMPONENT_CAPABILITY, BOT_HOST_COMPONENT_VERSION, input.expected);
|
|
35
|
+
const component = join(config.root, 'managed-' + config.hostId), file = join(component, 'component.json'), runner = join(component, 'launcher.mjs'), releases = join(component, 'releases');
|
|
36
|
+
const home = ports.home();
|
|
37
|
+
const read = () => {
|
|
38
|
+
let state;
|
|
39
|
+
try {
|
|
40
|
+
privateDirectory(component, deploymentSystem);
|
|
41
|
+
state = privateDeploymentFile(file);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error.code === 'ENOENT')
|
|
45
|
+
return null;
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
if (state.config !== input.config ||
|
|
49
|
+
!isComponentRelease(state.selected) ||
|
|
50
|
+
(state.previous !== null && !isComponentRelease(state.previous)) ||
|
|
51
|
+
typeof state.node !== 'string' ||
|
|
52
|
+
!state.node.startsWith('/') ||
|
|
53
|
+
/[\r\n]/.test(state.node) ||
|
|
54
|
+
!isComponentRelease(state.launcher?.runner) ||
|
|
55
|
+
!isComponentRelease(state.launcher?.verifier))
|
|
56
|
+
throw new Error('BOT_COMPONENT_STATE_INVALID');
|
|
57
|
+
return state;
|
|
58
|
+
};
|
|
59
|
+
const supervisor = (state) => ports.supervisor(platform, home, config.hostId, state?.node ?? process.execPath, runner);
|
|
60
|
+
if (action === 'status') {
|
|
61
|
+
const state = read();
|
|
62
|
+
const native = state ? supervisor(state).status() : 'STOPPED';
|
|
63
|
+
return receipt(input.action, state, native, 'OBSERVED', native === 'FAILED'
|
|
64
|
+
? 'BOT_COMPONENT_NATIVE_FAILED'
|
|
65
|
+
: native === 'UNAVAILABLE'
|
|
66
|
+
? 'BOT_COMPONENT_SUPERVISOR_UNAVAILABLE'
|
|
67
|
+
: null);
|
|
68
|
+
}
|
|
69
|
+
if (action === 'install') {
|
|
70
|
+
mkdirSync(config.root, { recursive: true, mode: 0o700 });
|
|
71
|
+
privateDirectory(config.root, deploymentSystem);
|
|
72
|
+
mkdirSync(component, { recursive: true, mode: 0o700 });
|
|
73
|
+
}
|
|
74
|
+
privateDirectory(component, deploymentSystem);
|
|
75
|
+
// 锁与原生服务都按设备和当前用户定键;不同配置路径也不能并发覆盖同一 job。
|
|
76
|
+
const locks = join(home, '.config/agentxgo/owned-host-locks');
|
|
77
|
+
mkdirSync(locks, { recursive: true, mode: 0o700 });
|
|
78
|
+
privateDirectory(locks, deploymentSystem);
|
|
79
|
+
return withHostComponentLock(join(locks, config.hostId + '.lock'), async () => {
|
|
80
|
+
const state = read();
|
|
81
|
+
const service = supervisor(state);
|
|
82
|
+
if (!state && action !== 'install')
|
|
83
|
+
throw new Error('BOT_COMPONENT_NOT_INSTALLED');
|
|
84
|
+
let native = service.status();
|
|
85
|
+
let current = state;
|
|
86
|
+
if (native === 'UNAVAILABLE')
|
|
87
|
+
return receipt(input.action, state, native, 'DEGRADED', 'BOT_COMPONENT_SUPERVISOR_UNAVAILABLE');
|
|
88
|
+
if (action === 'install' || action === 'rollback') {
|
|
89
|
+
if (!isComponentRelease(input.sha))
|
|
90
|
+
throw new Error('BOT_COMPONENT_RELEASE_INVALID');
|
|
91
|
+
if (native !== 'STOPPED' && !(native === 'FAILED' && platform === 'linux'))
|
|
92
|
+
return receipt(input.action, state, native, 'DEGRADED', 'BOT_COMPONENT_STOP_REQUIRED');
|
|
93
|
+
if (action === 'install') {
|
|
94
|
+
if (!input.archive)
|
|
95
|
+
throw new Error('BOT_COMPONENT_RELEASE_INVALID');
|
|
96
|
+
mkdirSync(releases, { recursive: true, mode: 0o700 });
|
|
97
|
+
privateDirectory(releases, deploymentSystem);
|
|
98
|
+
ports.stage(releases, input.archive, input.sha);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
if (state.previous !== input.sha && state.selected !== input.sha)
|
|
102
|
+
throw new Error('BOT_COMPONENT_ROLLBACK_RELEASE_UNKNOWN');
|
|
103
|
+
ports.verify(releases, input.sha);
|
|
104
|
+
}
|
|
105
|
+
const launcher = verifyLauncher(component, state?.launcher);
|
|
106
|
+
current =
|
|
107
|
+
state?.selected === input.sha
|
|
108
|
+
? state
|
|
109
|
+
: {
|
|
110
|
+
config: input.config,
|
|
111
|
+
node: state?.node ?? process.execPath,
|
|
112
|
+
selected: input.sha,
|
|
113
|
+
previous: state?.selected ?? null,
|
|
114
|
+
launcher,
|
|
115
|
+
...(state?.lastFailure ? { lastFailure: state.lastFailure } : {}),
|
|
116
|
+
};
|
|
117
|
+
try {
|
|
118
|
+
service.register();
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
const problem = componentFailure(error);
|
|
122
|
+
if (state) {
|
|
123
|
+
state.lastFailure = { reasonCode: problem, atMs: Date.now() };
|
|
124
|
+
save(file, state);
|
|
125
|
+
}
|
|
126
|
+
return receipt(action, state, native, 'DEGRADED', problem);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
let problem = null;
|
|
131
|
+
try {
|
|
132
|
+
if (input.action !== 'stop') {
|
|
133
|
+
verifyLauncher(component, state.launcher);
|
|
134
|
+
ports.verify(releases, state.selected);
|
|
135
|
+
if ((native === 'STOPPED' || native === 'FAILED') &&
|
|
136
|
+
(await Promise.all([
|
|
137
|
+
config.port,
|
|
138
|
+
...Array.from({ length: config.parallelBots ?? 1 }, (_, slot) => config.childPort + slot),
|
|
139
|
+
].map(hasListener))).some(Boolean))
|
|
140
|
+
throw new Error('BOT_COMPONENT_PORT_IN_USE');
|
|
141
|
+
}
|
|
142
|
+
// 原生停止可能在作业排空后才有终态,持有原设备操作锁直到读回。
|
|
143
|
+
native = await service.operate(action);
|
|
144
|
+
let ready = native === 'STOPPED';
|
|
145
|
+
if (action !== 'stop') {
|
|
146
|
+
const reached = await observeStartup(service.status, native, config);
|
|
147
|
+
({ native, ready } = reached);
|
|
148
|
+
}
|
|
149
|
+
if (!ready)
|
|
150
|
+
problem =
|
|
151
|
+
native === 'FAILED' ? 'BOT_COMPONENT_NATIVE_FAILED' : 'BOT_COMPONENT_STATE_UNCONFIRMED';
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
problem = componentFailure(error);
|
|
155
|
+
native = service.status();
|
|
156
|
+
}
|
|
157
|
+
if (problem) {
|
|
158
|
+
current.lastFailure = { reasonCode: problem, atMs: Date.now() };
|
|
159
|
+
save(file, current);
|
|
160
|
+
return receipt(input.action, current, native, 'DEGRADED', problem);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
current.lastSuccess = {
|
|
164
|
+
reasonCode: 'BOT_COMPONENT_' + input.action.toUpperCase() + '_APPLIED',
|
|
165
|
+
atMs: Date.now(),
|
|
166
|
+
};
|
|
167
|
+
save(file, current);
|
|
168
|
+
return receipt(input.action, current, native, 'APPLIED', null);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/** 原生自动重启使用已核验的启动器,首装遇见旧文件时也不跳过核对。 */
|
|
172
|
+
function verifyLauncher(component, pinned) {
|
|
173
|
+
const hashes = {};
|
|
174
|
+
const digest = (value) => createHash('sha256').update(value).digest('hex');
|
|
175
|
+
for (const [part, source, name] of [
|
|
176
|
+
['runner', 'runner.js', 'launcher.mjs'],
|
|
177
|
+
['verifier', 'verify.js', 'verify.js'],
|
|
178
|
+
]) {
|
|
179
|
+
const path = join(component, name);
|
|
180
|
+
const seed = pinned ? undefined : readFileSync(new URL('./' + source, import.meta.url));
|
|
181
|
+
const expected = pinned?.[part] ?? digest(seed);
|
|
182
|
+
if (seed) {
|
|
183
|
+
try {
|
|
184
|
+
writeFileSync(path, seed, { flag: 'wx', mode: 0o600 });
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
if (error.code !== 'EEXIST')
|
|
188
|
+
throw error;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const info = lstatSync(path);
|
|
192
|
+
if (!info.isFile() ||
|
|
193
|
+
info.uid !== deploymentSystem.uid ||
|
|
194
|
+
info.mode & 0o077 ||
|
|
195
|
+
info.size > 65536 ||
|
|
196
|
+
digest(readFileSync(path)) !== expected)
|
|
197
|
+
throw new Error('BOT_COMPONENT_LAUNCHER_INVALID');
|
|
198
|
+
hashes[part] = expected;
|
|
199
|
+
}
|
|
200
|
+
return hashes;
|
|
201
|
+
}
|
|
202
|
+
/** 显式启动期间按固定预算确认原生状态和本机就绪,后台不增加监听或轮询。 */
|
|
203
|
+
async function observeStartup(status, native, config) {
|
|
204
|
+
const deadline = Date.now() + 12000;
|
|
205
|
+
while (Date.now() < deadline && (native === 'STARTING' || native === 'RUNNING')) {
|
|
206
|
+
if (native === 'RUNNING' && (await hostReady(config)))
|
|
207
|
+
return { native, ready: true };
|
|
208
|
+
await delay(250);
|
|
209
|
+
native = status();
|
|
210
|
+
}
|
|
211
|
+
return { native, ready: false };
|
|
212
|
+
}
|
|
213
|
+
function save(file, state) {
|
|
214
|
+
const tmp = file + '.' + randomUUID();
|
|
215
|
+
try {
|
|
216
|
+
writeFileSync(tmp, JSON.stringify(state) + '\n', { mode: 0o600, flag: 'wx' });
|
|
217
|
+
renameSync(tmp, file);
|
|
218
|
+
}
|
|
219
|
+
finally {
|
|
220
|
+
rmSync(tmp, { force: true });
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/** 仅查询本机原 Host 端口,读取也验证原配置的私有控制身份。 */
|
|
224
|
+
async function hostReady(config) {
|
|
225
|
+
const url = 'http://127.0.0.1:' + config.port;
|
|
226
|
+
const signal = AbortSignal.timeout(1000);
|
|
227
|
+
try {
|
|
228
|
+
const status = await fetch(url + '/status', {
|
|
229
|
+
signal,
|
|
230
|
+
redirect: 'error',
|
|
231
|
+
headers: { 'x-bot-host-control-token': config.controlToken },
|
|
232
|
+
});
|
|
233
|
+
await status.body?.cancel();
|
|
234
|
+
if (!status.ok)
|
|
235
|
+
return false;
|
|
236
|
+
const ready = await fetch(url + '/ready', { signal, redirect: 'error' });
|
|
237
|
+
await ready.body?.cancel();
|
|
238
|
+
return ready.ok;
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/** 原系统部署或同机其它服务占据配置端口时,仅拒绝本次启动。 */
|
|
245
|
+
function hasListener(port) {
|
|
246
|
+
return new Promise((resolve) => {
|
|
247
|
+
const socket = createConnection({ port, host: '127.0.0.1', timeout: 500 });
|
|
248
|
+
const finish = (found) => {
|
|
249
|
+
socket.destroy();
|
|
250
|
+
resolve(found);
|
|
251
|
+
};
|
|
252
|
+
socket.once('connect', () => finish(true));
|
|
253
|
+
socket.once('timeout', () => finish(true));
|
|
254
|
+
socket.once('error', (error) => finish(error.code !== 'ECONNREFUSED'));
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
export function componentFailure(error) {
|
|
258
|
+
return error instanceof Error && /^BOT_(?:COMPONENT|DEPLOYMENT)_[A-Z_]+$/.test(error.message)
|
|
259
|
+
? error.message
|
|
260
|
+
: 'BOT_COMPONENT_REQUEST_FAILED';
|
|
261
|
+
}
|
|
262
|
+
function receipt(action, record, native, outcome, reasonCode) {
|
|
263
|
+
return {
|
|
264
|
+
schemaVersion: 1,
|
|
265
|
+
action,
|
|
266
|
+
outcome,
|
|
267
|
+
reasonCode,
|
|
268
|
+
selectedRelease: record?.selected ?? null,
|
|
269
|
+
previousRelease: record?.previous ?? null,
|
|
270
|
+
status: {
|
|
271
|
+
component: 'host.owned',
|
|
272
|
+
state: !record ? 'UNINSTALLED' : native,
|
|
273
|
+
alive: native === 'RUNNING' ? true : native === 'UNAVAILABLE' ? null : false,
|
|
274
|
+
observedAtMs: Date.now(),
|
|
275
|
+
lastSuccess: record?.lastSuccess ?? null,
|
|
276
|
+
lastFailure: record?.lastFailure ?? null,
|
|
277
|
+
queue: null,
|
|
278
|
+
nextRetryAtMs: null,
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdtempSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { isAbsolute, join, relative } from 'node:path';
|
|
4
|
+
import { deploymentSystem, privateDirectory } from '../system.js';
|
|
5
|
+
import { approvedArchive, isComponentRelease, verifyHostRelease } from './verify.js';
|
|
6
|
+
/** 只离线安装已获权的 Host 归档,包脚本、仓库代码和额外 npm 包不参与启动。 */
|
|
7
|
+
export function stageHostRelease(directory, archive, sha) {
|
|
8
|
+
if (!isAbsolute(archive) || !archive.endsWith('.tgz') || !isComponentRelease(sha))
|
|
9
|
+
throw new Error('BOT_COMPONENT_RELEASE_INVALID');
|
|
10
|
+
const bytes = approvedArchive(archive, sha);
|
|
11
|
+
const final = join(directory, sha);
|
|
12
|
+
if (existsSync(final))
|
|
13
|
+
return installedHostRelease(directory, sha);
|
|
14
|
+
const staging = mkdtempSync(join(directory, '.install-'));
|
|
15
|
+
try {
|
|
16
|
+
const tgz = join(staging, 'host.tgz');
|
|
17
|
+
writeFileSync(tgz, bytes, { mode: 0o600, flag: 'wx' });
|
|
18
|
+
const result = spawnSync('npm', [
|
|
19
|
+
'install',
|
|
20
|
+
'--prefix',
|
|
21
|
+
staging,
|
|
22
|
+
'--offline',
|
|
23
|
+
'--ignore-scripts',
|
|
24
|
+
'--no-audit',
|
|
25
|
+
'--no-fund',
|
|
26
|
+
'--no-package-lock',
|
|
27
|
+
'--no-bin-links',
|
|
28
|
+
'--omit=dev',
|
|
29
|
+
tgz,
|
|
30
|
+
], { cwd: staging, timeout: 60000, stdio: 'ignore', killSignal: 'SIGKILL' });
|
|
31
|
+
if (result.status !== 0)
|
|
32
|
+
throw new Error('BOT_COMPONENT_INSTALL_FAILED');
|
|
33
|
+
// 保留用于独立验真的同一归档,不保存安装时的 npm 生成配置。
|
|
34
|
+
rmSync(join(staging, 'package.json'), { force: true });
|
|
35
|
+
// 原子移位后仍返回由归档回证校验的入口,兼容两个包名。
|
|
36
|
+
const entry = relative(staging, verifyHostRelease(staging, sha));
|
|
37
|
+
renameSync(staging, final);
|
|
38
|
+
return join(final, entry);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
rmSync(staging, { recursive: true, force: true });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export function installedHostRelease(directory, sha) {
|
|
45
|
+
if (!isComponentRelease(sha))
|
|
46
|
+
throw new Error('BOT_COMPONENT_RELEASE_INVALID');
|
|
47
|
+
const root = join(directory, sha);
|
|
48
|
+
privateDirectory(root, deploymentSystem);
|
|
49
|
+
return verifyHostRelease(root, sha);
|
|
50
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { isAbsolute } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { verifyHostRelease } from './verify.js';
|
|
5
|
+
// 独立入口只从自有组件的原子记录启动选中的 Host;原配置和业务目录由 Host 自己加载。
|
|
6
|
+
const state = JSON.parse(readFileSync(new URL('./component.json', import.meta.url), 'utf8'));
|
|
7
|
+
if (!/^[a-f0-9]{64}$/.test(state.selected) || !isAbsolute(state.config))
|
|
8
|
+
throw new Error('BOT_COMPONENT_STATE_INVALID');
|
|
9
|
+
process.env.BOT_HOST_CONFIG = state.config;
|
|
10
|
+
delete process.env.BOT_HOST_DEPLOYMENT;
|
|
11
|
+
const entry = verifyHostRelease(fileURLToPath(new URL('./releases/' + state.selected, import.meta.url)), state.selected);
|
|
12
|
+
// POSIX exec 保留原 supervisor PID 和退出语义,无额外常驻包装进程。
|
|
13
|
+
if (!process.execve)
|
|
14
|
+
throw new Error('BOT_COMPONENT_USER_SUPERVISOR_UNAVAILABLE');
|
|
15
|
+
process.execve(process.execPath, [process.execPath, '--max-old-space-size=192', entry]);
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { lstatSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, isAbsolute, join } from 'node:path';
|
|
5
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
6
|
+
import { deploymentSystem, trustedAncestors } from '../system.js';
|
|
7
|
+
import { MAC_HOST_DEFAULT_LIMITS } from '../macos/plan.js';
|
|
8
|
+
import { verifyManagedFile } from '../macos/install.js';
|
|
9
|
+
const systemdStates = {
|
|
10
|
+
active: 'RUNNING',
|
|
11
|
+
activating: 'STARTING',
|
|
12
|
+
deactivating: 'STOPPING',
|
|
13
|
+
failed: 'FAILED',
|
|
14
|
+
inactive: 'STOPPED',
|
|
15
|
+
};
|
|
16
|
+
const macExitTimeoutSeconds = 50;
|
|
17
|
+
const runNative = (file, args) => {
|
|
18
|
+
const result = spawnSync(file, args, {
|
|
19
|
+
encoding: 'utf8',
|
|
20
|
+
timeout: args.some((arg) => ['show', 'print', 'unit-paths', 'version'].includes(arg))
|
|
21
|
+
? 1500
|
|
22
|
+
: 48000,
|
|
23
|
+
maxBuffer: 65536,
|
|
24
|
+
killSignal: 'SIGKILL',
|
|
25
|
+
});
|
|
26
|
+
return { status: result.status, stdout: result.stdout ?? '', stderr: result.stderr ?? '' };
|
|
27
|
+
};
|
|
28
|
+
/** 用户域 supervisor 只接收由原设备产生的固定精确服务名。 */
|
|
29
|
+
export function ownedHostSupervisor(platform, home, hostId, node, runner, run = runNative) {
|
|
30
|
+
const linux = platform === 'linux';
|
|
31
|
+
const label = 'agentxgo-owned-' + hostId;
|
|
32
|
+
const name = linux ? label + '.service' : 'com.agentxgo.' + label;
|
|
33
|
+
const configHome = process.env.XDG_CONFIG_HOME;
|
|
34
|
+
const unitDirectory = isAbsolute(configHome ?? '')
|
|
35
|
+
? join(configHome, 'systemd/user')
|
|
36
|
+
: join(home, '.config/systemd/user');
|
|
37
|
+
const file = linux
|
|
38
|
+
? join(unitDirectory, name)
|
|
39
|
+
: join(home, 'Library/LaunchAgents', name + '.plist');
|
|
40
|
+
const domain = 'gui/' + process.getuid?.();
|
|
41
|
+
const target = domain + '/' + name;
|
|
42
|
+
const call = (args) => linux ? run('/usr/bin/systemctl', ['--user', ...args]) : run('/bin/launchctl', args);
|
|
43
|
+
const guard = '/Applications/AgentXGo Host.app/Contents/Resources/bin/agentxgo-guard';
|
|
44
|
+
const argv = linux
|
|
45
|
+
? [node, '--max-old-space-size=192', runner]
|
|
46
|
+
: [
|
|
47
|
+
guard,
|
|
48
|
+
'run-user',
|
|
49
|
+
...[
|
|
50
|
+
MAC_HOST_DEFAULT_LIMITS.rssMiB,
|
|
51
|
+
MAC_HOST_DEFAULT_LIMITS.processes,
|
|
52
|
+
MAC_HOST_DEFAULT_LIMITS.cpuSeconds,
|
|
53
|
+
MAC_HOST_DEFAULT_LIMITS.wallSeconds,
|
|
54
|
+
].map(String),
|
|
55
|
+
node,
|
|
56
|
+
'--max-old-space-size=192',
|
|
57
|
+
runner,
|
|
58
|
+
];
|
|
59
|
+
const checkGuard = () => {
|
|
60
|
+
if (linux || run !== runNative)
|
|
61
|
+
return;
|
|
62
|
+
try {
|
|
63
|
+
verifyManagedFile(guard);
|
|
64
|
+
const abi = run(guard, ['version']);
|
|
65
|
+
if (abi.status !== 0 || abi.stdout.trim() !== '2')
|
|
66
|
+
throw new Error('guard version');
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
throw new Error('BOT_COMPONENT_MACOS_GUARD_REQUIRED');
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const expected = linux ? systemdUnit(argv) : launchAgent(name, argv);
|
|
73
|
+
// 已登记的旧用户作业仍可读回和停止,卸载后原位替换为进程组守护合同。
|
|
74
|
+
const legacy = linux ? undefined : [guard, 'run', ...argv.slice(2)];
|
|
75
|
+
const legacyFile = legacy && launchAgent(name, legacy);
|
|
76
|
+
const ownFile = () => {
|
|
77
|
+
let info;
|
|
78
|
+
try {
|
|
79
|
+
info = lstatSync(file);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (error.code === 'ENOENT')
|
|
83
|
+
return undefined;
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
trustedAncestors(file, deploymentSystem, deploymentSystem.uid);
|
|
87
|
+
if (!info.isFile() ||
|
|
88
|
+
info.uid !== deploymentSystem.uid ||
|
|
89
|
+
info.mode & 0o077 ||
|
|
90
|
+
info.size > 16384)
|
|
91
|
+
throw new Error('BOT_COMPONENT_FOREIGN_SERVICE');
|
|
92
|
+
const contents = readFileSync(file, 'utf8');
|
|
93
|
+
if (contents === expected)
|
|
94
|
+
return argv;
|
|
95
|
+
if (legacy && contents === legacyFile)
|
|
96
|
+
return legacy;
|
|
97
|
+
throw new Error('BOT_COMPONENT_FOREIGN_SERVICE');
|
|
98
|
+
};
|
|
99
|
+
const observe = (installed = ownFile()) => {
|
|
100
|
+
if (linux) {
|
|
101
|
+
const result = call([
|
|
102
|
+
'show',
|
|
103
|
+
'--property=ActiveState,LoadState,FragmentPath,DropInPaths,ExecStart',
|
|
104
|
+
name,
|
|
105
|
+
]);
|
|
106
|
+
const data = Object.fromEntries(result.stdout
|
|
107
|
+
.trim()
|
|
108
|
+
.split('\n')
|
|
109
|
+
.map((line) => line.split(/=(.*)/s).slice(0, 2)));
|
|
110
|
+
if (data.LoadState === 'not-found' && data.ActiveState === 'inactive' && !data.FragmentPath)
|
|
111
|
+
return { state: 'STOPPED', loaded: false };
|
|
112
|
+
if (result.status !== 0)
|
|
113
|
+
return { state: 'UNAVAILABLE', loaded: false };
|
|
114
|
+
if (!installed || data.FragmentPath !== file)
|
|
115
|
+
throw new Error('BOT_COMPONENT_FOREIGN_SERVICE');
|
|
116
|
+
// 有效定义可能被 drop-in 或缓存覆写,磁盘文件相同也必须核对实际 argv。
|
|
117
|
+
if (data.DropInPaths ||
|
|
118
|
+
!data.ExecStart?.startsWith('{ path=' + argv[0] + ' ; argv[]=' + argv.join(' ') + ' ;'))
|
|
119
|
+
throw new Error('BOT_COMPONENT_FOREIGN_SERVICE');
|
|
120
|
+
return { state: systemdStates[data.ActiveState ?? ''] ?? 'UNAVAILABLE', loaded: true };
|
|
121
|
+
}
|
|
122
|
+
const result = call(['print', target]);
|
|
123
|
+
if (result.status !== 0)
|
|
124
|
+
return {
|
|
125
|
+
state: result.stderr.includes('Could not find service') ? 'STOPPED' : 'UNAVAILABLE',
|
|
126
|
+
loaded: false,
|
|
127
|
+
};
|
|
128
|
+
// 已加载路径也必须属于本组件,同名外部 job 不能被误停止。
|
|
129
|
+
if (!installed || /^\s*path = (.*)$/m.exec(result.stdout)?.[1] !== file)
|
|
130
|
+
throw new Error('BOT_COMPONENT_FOREIGN_SERVICE');
|
|
131
|
+
const args = /^\s*arguments = \{\n([\s\S]*?)^\s*\}/m
|
|
132
|
+
.exec(result.stdout)?.[1]
|
|
133
|
+
?.split('\n')
|
|
134
|
+
.map((arg) => arg.trim())
|
|
135
|
+
.filter(Boolean);
|
|
136
|
+
if (JSON.stringify(args) !== JSON.stringify(installed))
|
|
137
|
+
throw new Error('BOT_COMPONENT_FOREIGN_SERVICE');
|
|
138
|
+
return { state: launchdState(result.stdout), loaded: true };
|
|
139
|
+
};
|
|
140
|
+
const status = () => observe().state;
|
|
141
|
+
function checked(args) {
|
|
142
|
+
if (call(args).status !== 0)
|
|
143
|
+
throw new Error('BOT_COMPONENT_SUPERVISOR_ACTION_FAILED');
|
|
144
|
+
}
|
|
145
|
+
async function unload(installed) {
|
|
146
|
+
const deadline = performance.now() + macExitTimeoutSeconds * 1000;
|
|
147
|
+
checked(['bootout', target]);
|
|
148
|
+
// bootout 可以先返回。等作业移出原域后才确认停机或允许加载同名作业。
|
|
149
|
+
for (;;) {
|
|
150
|
+
const current = observe(installed);
|
|
151
|
+
if (!current.loaded && current.state === 'STOPPED')
|
|
152
|
+
return 'STOPPED';
|
|
153
|
+
const remaining = deadline - performance.now();
|
|
154
|
+
if (remaining <= 0)
|
|
155
|
+
return current.loaded ? 'STOPPING' : current.state;
|
|
156
|
+
await delay(Math.min(250, remaining));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function replaceLegacy() {
|
|
160
|
+
// 仅在原作业已卸载时发布新定义。文件与原 UID、服务名及资源档位一致。
|
|
161
|
+
const staged = file + '.' + randomUUID();
|
|
162
|
+
try {
|
|
163
|
+
writeFileSync(staged, expected, { flag: 'wx', mode: 0o600 });
|
|
164
|
+
renameSync(staged, file);
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
rmSync(staged, { force: true });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
status,
|
|
172
|
+
register() {
|
|
173
|
+
checkGuard();
|
|
174
|
+
if (linux) {
|
|
175
|
+
const unitPaths = run('/usr/bin/systemd-analyze', ['--user', 'unit-paths']);
|
|
176
|
+
if (unitPaths.status !== 0 || !unitPaths.stdout.trim().split('\n').includes(unitDirectory))
|
|
177
|
+
throw new Error('BOT_COMPONENT_UNIT_PATH_UNAVAILABLE');
|
|
178
|
+
}
|
|
179
|
+
const installed = ownFile();
|
|
180
|
+
if (installed) {
|
|
181
|
+
if (installed === legacy && !observe(installed).loaded)
|
|
182
|
+
replaceLegacy();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
mkdirSync(dirname(file), { recursive: true, mode: 0o700 });
|
|
186
|
+
trustedAncestors(file, deploymentSystem, deploymentSystem.uid);
|
|
187
|
+
writeFileSync(file, expected, { flag: 'wx', mode: 0o600 });
|
|
188
|
+
},
|
|
189
|
+
async operate(action) {
|
|
190
|
+
const installed = ownFile();
|
|
191
|
+
if (!installed)
|
|
192
|
+
throw new Error('BOT_COMPONENT_NOT_INSTALLED');
|
|
193
|
+
if (action !== 'stop')
|
|
194
|
+
checkGuard();
|
|
195
|
+
const { state: current, loaded } = observe(installed);
|
|
196
|
+
if (current === 'UNAVAILABLE')
|
|
197
|
+
throw new Error('BOT_COMPONENT_SUPERVISOR_UNAVAILABLE');
|
|
198
|
+
if (linux) {
|
|
199
|
+
if (action === 'stop')
|
|
200
|
+
checked(['disable', '--now', name]);
|
|
201
|
+
else if (action === 'start' || current === 'STOPPED')
|
|
202
|
+
checked(['enable', '--now', name]);
|
|
203
|
+
else
|
|
204
|
+
checked(['restart', name]);
|
|
205
|
+
}
|
|
206
|
+
else if (action === 'stop') {
|
|
207
|
+
checked(['disable', target]);
|
|
208
|
+
if (loaded)
|
|
209
|
+
return unload(installed);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
checked(['enable', target]);
|
|
213
|
+
if (!loaded) {
|
|
214
|
+
if (installed === legacy)
|
|
215
|
+
replaceLegacy();
|
|
216
|
+
checked(['bootstrap', domain, file]);
|
|
217
|
+
}
|
|
218
|
+
else if (action === 'restart' ||
|
|
219
|
+
(installed === legacy && (current === 'STOPPED' || current === 'FAILED'))) {
|
|
220
|
+
// 先按原 launchd 关闭路径交付 SIGTERM,再加载自己的同一配置。
|
|
221
|
+
if ((await unload(installed)) !== 'STOPPED')
|
|
222
|
+
throw new Error('BOT_COMPONENT_STATE_UNCONFIRMED');
|
|
223
|
+
if (installed === legacy)
|
|
224
|
+
replaceLegacy();
|
|
225
|
+
checked(['bootstrap', domain, file]);
|
|
226
|
+
}
|
|
227
|
+
else if (current === 'STOPPED' || current === 'FAILED') {
|
|
228
|
+
// 作业仍在用户域中,显式开工只启动原作业,不强制终止正在恢复的进程。
|
|
229
|
+
checked(['kickstart', target]);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return status();
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/** launchd 正常退出后可保持 active 注册,进程已停止时仍应如实回报。 */
|
|
237
|
+
function launchdState(output) {
|
|
238
|
+
const state = /^\s*state = (.+)$/m.exec(output)?.[1];
|
|
239
|
+
// launchd 可能在数字之后附带系统错误名。
|
|
240
|
+
const exit = /^\s*last exit code = (\d+)\b/m.exec(output)?.[1];
|
|
241
|
+
if (state === 'running')
|
|
242
|
+
return 'RUNNING';
|
|
243
|
+
if (exit && exit !== '0')
|
|
244
|
+
return 'FAILED';
|
|
245
|
+
if (state === 'not running' || (state === 'active' && exit === '0'))
|
|
246
|
+
return 'STOPPED';
|
|
247
|
+
return 'STARTING';
|
|
248
|
+
}
|
|
249
|
+
/** 官方用户 unit 复用现有 Host 内存、CPU、进程上限及最多三次启动退避。 */
|
|
250
|
+
function systemdUnit(argv) {
|
|
251
|
+
const quote = (value) => '"' + value.replace(/["\\]/g, '\\$&').replaceAll('%', '%%').replaceAll('$', '$$') + '"';
|
|
252
|
+
return `[Unit]
|
|
253
|
+
Description=AgentXGo device-owned Host
|
|
254
|
+
StartLimitIntervalSec=120
|
|
255
|
+
StartLimitBurst=3
|
|
256
|
+
[Service]
|
|
257
|
+
Type=exec
|
|
258
|
+
ExecStart=${argv.map(quote).join(' ')}
|
|
259
|
+
Environment=UV_THREADPOOL_SIZE=2
|
|
260
|
+
Restart=on-failure
|
|
261
|
+
RestartSec=10
|
|
262
|
+
KillMode=control-group
|
|
263
|
+
TimeoutStopSec=45
|
|
264
|
+
RuntimeMaxSec=1d
|
|
265
|
+
MemoryMax=384M
|
|
266
|
+
MemoryHigh=256M
|
|
267
|
+
MemorySwapMax=0
|
|
268
|
+
CPUQuota=50%
|
|
269
|
+
TasksMax=32
|
|
270
|
+
UMask=0077
|
|
271
|
+
NoNewPrivileges=true
|
|
272
|
+
[Install]
|
|
273
|
+
WantedBy=default.target
|
|
274
|
+
`;
|
|
275
|
+
}
|
|
276
|
+
/** 用户域 launchd 用 argv 传递固定入口,平台保留原重启与进程约束。 */
|
|
277
|
+
function launchAgent(label, argv) {
|
|
278
|
+
const xml = (value) => value.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>');
|
|
279
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
280
|
+
<plist version="1.0"><dict><key>Label</key><string>${label}</string>
|
|
281
|
+
<key>ProgramArguments</key><array>${argv.map((arg) => '<string>' + xml(arg) + '</string>').join('')}</array>
|
|
282
|
+
<key>Disabled</key><true/>
|
|
283
|
+
<key>RunAtLoad</key><true/><key>ThrottleInterval</key><integer>30</integer>
|
|
284
|
+
<key>ExitTimeOut</key><integer>${macExitTimeoutSeconds}</integer><key>Umask</key><integer>63</integer>
|
|
285
|
+
<key>KeepAlive</key><dict><key>SuccessfulExit</key><false/></dict>
|
|
286
|
+
<key>ProcessType</key><string>Background</string>
|
|
287
|
+
<key>EnvironmentVariables</key><dict><key>UV_THREADPOOL_SIZE</key><string>2</string></dict>
|
|
288
|
+
</dict></plist>\n`;
|
|
289
|
+
}
|