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,352 @@
|
|
|
1
|
+
import { constants } from 'node:fs';
|
|
2
|
+
import { lstat, mkdir, open, opendir, rename, rmdir, unlink, } from 'node:fs/promises';
|
|
3
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
4
|
+
import { botId, botInteger } from '@agent-stack/contracts';
|
|
5
|
+
import { deploymentSystem, trustedAncestors } from '../deployment/system.js';
|
|
6
|
+
import { scratchName, scratchPaths, scratchMountPoints, TargetScratchReview, } from './scratch-paths.js';
|
|
7
|
+
export { TargetScratchReview } from './scratch-paths.js';
|
|
8
|
+
const stagingName = '.action-cleanup';
|
|
9
|
+
const maxEntries = 4096;
|
|
10
|
+
const maxDepth = 32;
|
|
11
|
+
const maxMountBytes = 1024 * 1024;
|
|
12
|
+
const directoryFlags = constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW;
|
|
13
|
+
const exactUtf8 = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
|
|
14
|
+
const review = (reason) => {
|
|
15
|
+
throw new TargetScratchReview(reason);
|
|
16
|
+
};
|
|
17
|
+
const errno = (error, code) => error instanceof Error && 'code' in error && error.code === code;
|
|
18
|
+
const linux = {
|
|
19
|
+
platform: process.platform,
|
|
20
|
+
supervisorUid: process.geteuid?.() ?? -1,
|
|
21
|
+
directoryPath: (fd) => `/proc/self/fd/${fd}`,
|
|
22
|
+
async mountInfo() {
|
|
23
|
+
const file = await open('/proc/self/mountinfo', constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
24
|
+
try {
|
|
25
|
+
const buffer = Buffer.alloc(maxMountBytes + 1);
|
|
26
|
+
let length = 0;
|
|
27
|
+
while (length < buffer.length) {
|
|
28
|
+
const { bytesRead } = await file.read(buffer, length, buffer.length - length, null);
|
|
29
|
+
if (!bytesRead)
|
|
30
|
+
break;
|
|
31
|
+
length += bytesRead;
|
|
32
|
+
}
|
|
33
|
+
if (length > maxMountBytes)
|
|
34
|
+
review('MOUNT_INFO_LIMIT');
|
|
35
|
+
return exactUtf8.decode(buffer.subarray(0, length));
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
await file.close();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
mountId(fd) {
|
|
42
|
+
const content = deploymentSystem.read(`/proc/self/fdinfo/${fd}`);
|
|
43
|
+
const matches = [...content.matchAll(/^mnt_id:[\t ]+(\d+)$/gm)];
|
|
44
|
+
const id = matches[0]?.[1];
|
|
45
|
+
return matches.length === 1 && id ? id : review('MOUNT_ID_INVALID');
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
const sameInode = (left, right) => left.dev === right.dev && left.ino === right.ino;
|
|
49
|
+
function original(root, staging, child) {
|
|
50
|
+
return {
|
|
51
|
+
rootDevice: root.stat.dev.toString(),
|
|
52
|
+
rootInode: root.stat.ino.toString(),
|
|
53
|
+
stagingDevice: staging.stat.dev.toString(),
|
|
54
|
+
stagingInode: staging.stat.ino.toString(),
|
|
55
|
+
device: child.stat.dev.toString(),
|
|
56
|
+
inode: child.stat.ino.toString(),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** 仅移动登记的动作目录;在同一可信文件系统内暂存和回收原 inode。 */
|
|
60
|
+
export class TargetScratchFiles {
|
|
61
|
+
root;
|
|
62
|
+
uid;
|
|
63
|
+
gid;
|
|
64
|
+
system;
|
|
65
|
+
work = Promise.resolve();
|
|
66
|
+
constructor(root, uid, gid, system = linux) {
|
|
67
|
+
this.root = root;
|
|
68
|
+
this.uid = uid;
|
|
69
|
+
this.gid = gid;
|
|
70
|
+
this.system = system;
|
|
71
|
+
botInteger(uid);
|
|
72
|
+
botInteger(gid);
|
|
73
|
+
if (!isAbsolute(root) || root === '/' || resolve(root) !== root || root.includes('\0'))
|
|
74
|
+
review('ROOT_INVALID');
|
|
75
|
+
if (system === linux && (uid === 0 || uid === system.supervisorUid))
|
|
76
|
+
review('EXECUTION_IDENTITY_INVALID');
|
|
77
|
+
}
|
|
78
|
+
create(rawActionId) {
|
|
79
|
+
const id = botId(rawActionId);
|
|
80
|
+
return this.serial(() => this.withRoot((root) => this.withStage(root, null, async (staging) => {
|
|
81
|
+
const name = scratchName(id), path = join(root.path, name), visible = join(root.visible, name);
|
|
82
|
+
// 旧目录仍保留原名;live/staged 任一新旧名称存在,都禁止复用现成目录。
|
|
83
|
+
const prior = await Promise.all([
|
|
84
|
+
...new Set([join(root.path, id), join(staging.path, name), join(staging.path, id)]),
|
|
85
|
+
].map((path) => this.maybeStat(path)));
|
|
86
|
+
if (prior.some(Boolean))
|
|
87
|
+
review('DIRECTORY_NAME_COLLISION');
|
|
88
|
+
await mkdir(path, { mode: 0o700 }).catch((error) => {
|
|
89
|
+
if (errno(error, 'EEXIST'))
|
|
90
|
+
review('DIRECTORY_NAME_COLLISION');
|
|
91
|
+
throw error;
|
|
92
|
+
});
|
|
93
|
+
return this.withDirectory(path, visible, async (child) => {
|
|
94
|
+
this.sameMount(root, child);
|
|
95
|
+
await child.file.chown(this.uid, this.gid);
|
|
96
|
+
await child.file.chmod(0o700);
|
|
97
|
+
const after = await child.file.stat({ bigint: true });
|
|
98
|
+
if (!sameInode(after, child.stat) ||
|
|
99
|
+
Number(after.uid) !== this.uid ||
|
|
100
|
+
Number(after.gid) !== this.gid ||
|
|
101
|
+
(after.mode & 511n) !== 448n)
|
|
102
|
+
review('DIRECTORY_OWNER_INVALID');
|
|
103
|
+
await child.file.sync();
|
|
104
|
+
await staging.file.sync();
|
|
105
|
+
await root.file.sync();
|
|
106
|
+
return { path: visible, identity: original(root, staging, child) };
|
|
107
|
+
});
|
|
108
|
+
})));
|
|
109
|
+
}
|
|
110
|
+
stage(rawActionId, identity) {
|
|
111
|
+
const id = botId(rawActionId);
|
|
112
|
+
return this.serial(() => this.withRoot(async (root) => {
|
|
113
|
+
this.checkRoot(root, identity);
|
|
114
|
+
await this.withStage(root, identity, async (staging) => {
|
|
115
|
+
const { live, staged, liveVisible, stagedVisible, liveStat, stagedStat } = await scratchPaths(id, root, staging, identity);
|
|
116
|
+
const check = (path, visible) => this.withDirectory(path, visible, (dir) => this.checkIdentity(root, dir, identity));
|
|
117
|
+
await this.noMounts(liveVisible, stagedVisible);
|
|
118
|
+
if (liveStat && stagedStat)
|
|
119
|
+
review('DUPLICATE_PATH');
|
|
120
|
+
if (!liveStat && !stagedStat)
|
|
121
|
+
review('ORIGINAL_MISSING');
|
|
122
|
+
if (liveStat) {
|
|
123
|
+
await check(live, liveVisible);
|
|
124
|
+
await rename(live, staged);
|
|
125
|
+
}
|
|
126
|
+
// rename 已成功但账本确认丢失时,只认暂存位置的同一 inode。
|
|
127
|
+
await check(staged, stagedVisible);
|
|
128
|
+
await staging.file.sync();
|
|
129
|
+
await root.file.sync();
|
|
130
|
+
});
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
remove(rawActionId, identity) {
|
|
134
|
+
const id = botId(rawActionId);
|
|
135
|
+
return this.serial(() => this.withRoot(async (root) => {
|
|
136
|
+
this.checkRoot(root, identity);
|
|
137
|
+
await this.withStage(root, identity, async (staging) => {
|
|
138
|
+
const { liveStat, stagedStat, staged: entry, stagedVisible: visible, } = await scratchPaths(id, root, staging, identity);
|
|
139
|
+
if (liveStat)
|
|
140
|
+
review('LIVE_PATH_PRESENT');
|
|
141
|
+
await this.noMounts(visible);
|
|
142
|
+
if (stagedStat) {
|
|
143
|
+
await this.withDirectory(entry, visible, async (dir) => {
|
|
144
|
+
this.checkIdentity(root, dir, identity);
|
|
145
|
+
// 先核对整棵树,避免遇到不安全条目时已经删除了其它内容。
|
|
146
|
+
const entries = await this.scan(root, dir, 0, { entries: 0 });
|
|
147
|
+
await this.noMounts(visible);
|
|
148
|
+
await this.erase(root, dir, entries);
|
|
149
|
+
await this.checkedRmdir(entry, dir.stat);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
// 调用方已持久记录 STAGED;只有该目录下的明确缺失才是幂等完成。
|
|
153
|
+
await staging.file.sync();
|
|
154
|
+
});
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
serial(operation) {
|
|
158
|
+
const next = this.work.then(operation);
|
|
159
|
+
this.work = next.then(() => undefined, () => undefined);
|
|
160
|
+
return next;
|
|
161
|
+
}
|
|
162
|
+
async withRoot(run) {
|
|
163
|
+
if (this.system.platform !== 'linux' || this.system.supervisorUid < 0)
|
|
164
|
+
review('LINUX_REQUIRED');
|
|
165
|
+
try {
|
|
166
|
+
if (deploymentSystem.realpath(this.root) !== this.root)
|
|
167
|
+
review('ROOT_REPLACED');
|
|
168
|
+
trustedAncestors(this.root, deploymentSystem, this.system.supervisorUid);
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
if (error instanceof TargetScratchReview)
|
|
172
|
+
throw error;
|
|
173
|
+
if (errno(error, 'ENOENT') ||
|
|
174
|
+
(error instanceof Error && error.message.startsWith('BOT_DEPLOYMENT_')))
|
|
175
|
+
review('ROOT_UNTRUSTED');
|
|
176
|
+
throw error;
|
|
177
|
+
}
|
|
178
|
+
return this.withDirectory(this.root, this.root, (root) => {
|
|
179
|
+
if (Number(root.stat.uid) !== this.system.supervisorUid || (root.stat.mode & 18n) !== 0n)
|
|
180
|
+
review('ROOT_UNTRUSTED');
|
|
181
|
+
return run(root);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
async withStage(root, identity, run) {
|
|
185
|
+
const path = join(root.path, stagingName), visible = join(root.visible, stagingName);
|
|
186
|
+
if (identity === null) {
|
|
187
|
+
await mkdir(path, { mode: 0o700 }).catch((error) => {
|
|
188
|
+
if (!errno(error, 'EEXIST'))
|
|
189
|
+
throw error;
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return this.withDirectory(path, visible, (dir) => {
|
|
193
|
+
this.sameMount(root, dir);
|
|
194
|
+
if (Number(dir.stat.uid) !== this.system.supervisorUid || (dir.stat.mode & 511n) !== 448n)
|
|
195
|
+
review('STAGING_UNTRUSTED');
|
|
196
|
+
// 只有登记过的暂存父目录能证明子目录确实不存在。
|
|
197
|
+
if (identity &&
|
|
198
|
+
(dir.stat.dev.toString() !== identity.stagingDevice ||
|
|
199
|
+
dir.stat.ino.toString() !== identity.stagingInode))
|
|
200
|
+
review('STAGING_REPLACED');
|
|
201
|
+
return run(dir);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/** 目录句柄将后续路径操作固定在同一个内核对象上。 */
|
|
205
|
+
async withDirectory(path, visible, run) {
|
|
206
|
+
const dir = await this.pin(path, visible);
|
|
207
|
+
try {
|
|
208
|
+
return await run(dir);
|
|
209
|
+
}
|
|
210
|
+
finally {
|
|
211
|
+
await dir.file.close();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
async pin(path, visible) {
|
|
215
|
+
const file = await open(path, directoryFlags).catch((error) => {
|
|
216
|
+
if (errno(error, 'ELOOP') || errno(error, 'ENOTDIR') || errno(error, 'ENOENT'))
|
|
217
|
+
return review('DIRECTORY_REPLACED');
|
|
218
|
+
throw error;
|
|
219
|
+
});
|
|
220
|
+
try {
|
|
221
|
+
return {
|
|
222
|
+
file,
|
|
223
|
+
visible,
|
|
224
|
+
path: this.system.directoryPath(file.fd, visible),
|
|
225
|
+
stat: await file.stat({ bigint: true }),
|
|
226
|
+
mountId: this.system.mountId(file.fd),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
await file.close();
|
|
231
|
+
throw error;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
maybeStat(path) {
|
|
235
|
+
return lstat(path, { bigint: true }).catch((error) => {
|
|
236
|
+
if (errno(error, 'ENOENT'))
|
|
237
|
+
return null;
|
|
238
|
+
throw error;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
async noMounts(...paths) {
|
|
242
|
+
let info;
|
|
243
|
+
try {
|
|
244
|
+
info = await this.system.mountInfo();
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
if (error instanceof TypeError)
|
|
248
|
+
return review('MOUNT_INFO_INVALID');
|
|
249
|
+
throw error;
|
|
250
|
+
}
|
|
251
|
+
if (scratchMountPoints(info, maxMountBytes).some((mount) => paths.some((path) => mount === path || mount.startsWith(path + '/'))))
|
|
252
|
+
review('MOUNT_PRESENT');
|
|
253
|
+
}
|
|
254
|
+
sameMount(root, child) {
|
|
255
|
+
if (!child.stat.isDirectory() ||
|
|
256
|
+
root.stat.dev !== child.stat.dev ||
|
|
257
|
+
root.mountId !== child.mountId)
|
|
258
|
+
review('MOUNT_PRESENT');
|
|
259
|
+
}
|
|
260
|
+
checkRoot(root, identity) {
|
|
261
|
+
if (identity.rootDevice !== root.stat.dev.toString() ||
|
|
262
|
+
identity.rootInode !== root.stat.ino.toString())
|
|
263
|
+
review('ROOT_REPLACED');
|
|
264
|
+
}
|
|
265
|
+
checkIdentity(root, child, identity) {
|
|
266
|
+
this.sameMount(root, child);
|
|
267
|
+
if (child.stat.dev.toString() !== identity.device ||
|
|
268
|
+
child.stat.ino.toString() !== identity.inode ||
|
|
269
|
+
Number(child.stat.uid) !== this.uid)
|
|
270
|
+
review('ACTION_DIRECTORY_REPLACED');
|
|
271
|
+
}
|
|
272
|
+
safeEntry(root, stat) {
|
|
273
|
+
if (stat.dev !== root.stat.dev ||
|
|
274
|
+
Number(stat.uid) !== this.uid ||
|
|
275
|
+
(!stat.isDirectory() && (!stat.isFile() || stat.nlink !== 1n)))
|
|
276
|
+
review('UNSAFE_ENTRY');
|
|
277
|
+
}
|
|
278
|
+
async scan(root, dir, depth, budget) {
|
|
279
|
+
if (depth >= maxDepth)
|
|
280
|
+
review('DEPTH_LIMIT');
|
|
281
|
+
// Node 支持读取原始文件名字节,当前类型声明仍将编码收窄为文本。
|
|
282
|
+
const listing = await opendir(dir.path, {
|
|
283
|
+
encoding: 'buffer',
|
|
284
|
+
bufferSize: 16,
|
|
285
|
+
});
|
|
286
|
+
const entries = [];
|
|
287
|
+
try {
|
|
288
|
+
for (let item = await listing.read(); item; item = await listing.read()) {
|
|
289
|
+
if (++budget.entries > maxEntries)
|
|
290
|
+
review('ENTRY_LIMIT');
|
|
291
|
+
let name;
|
|
292
|
+
try {
|
|
293
|
+
if (!Buffer.isBuffer(item.name))
|
|
294
|
+
return review('INVALID_ENTRY_NAME');
|
|
295
|
+
name = exactUtf8.decode(item.name);
|
|
296
|
+
}
|
|
297
|
+
catch {
|
|
298
|
+
return review('INVALID_ENTRY_NAME');
|
|
299
|
+
}
|
|
300
|
+
if (!name || name === '.' || name === '..' || /[/\x00]/.test(name))
|
|
301
|
+
review('INVALID_ENTRY_NAME');
|
|
302
|
+
const path = join(dir.path, name);
|
|
303
|
+
const stat = (await this.maybeStat(path)) ?? review('ENTRY_REPLACED');
|
|
304
|
+
this.safeEntry(root, stat);
|
|
305
|
+
const entry = { name, stat };
|
|
306
|
+
if (stat.isDirectory()) {
|
|
307
|
+
entry.children = await this.withDirectory(path, join(dir.visible, name), (child) => {
|
|
308
|
+
this.sameMount(root, child);
|
|
309
|
+
if (!sameInode(stat, child.stat))
|
|
310
|
+
review('ENTRY_REPLACED');
|
|
311
|
+
return this.scan(root, child, depth + 1, budget);
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
entries.push(entry);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
finally {
|
|
318
|
+
await listing.close();
|
|
319
|
+
}
|
|
320
|
+
return entries;
|
|
321
|
+
}
|
|
322
|
+
async erase(root, dir, entries) {
|
|
323
|
+
for (const { name, stat, children } of entries) {
|
|
324
|
+
const path = join(dir.path, name);
|
|
325
|
+
const current = (await this.maybeStat(path)) ?? review('ENTRY_REPLACED');
|
|
326
|
+
this.safeEntry(root, current);
|
|
327
|
+
if (!sameInode(stat, current) || stat.mode !== current.mode)
|
|
328
|
+
review('ENTRY_REPLACED');
|
|
329
|
+
if (children) {
|
|
330
|
+
await this.withDirectory(path, join(dir.visible, name), async (child) => {
|
|
331
|
+
this.sameMount(root, child);
|
|
332
|
+
if (!sameInode(stat, child.stat))
|
|
333
|
+
review('ENTRY_REPLACED');
|
|
334
|
+
await this.erase(root, child, children);
|
|
335
|
+
await this.checkedRmdir(path, child.stat);
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
else
|
|
339
|
+
await unlink(path);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
async checkedRmdir(path, originalStat) {
|
|
343
|
+
const current = (await this.maybeStat(path)) ?? review('ENTRY_REPLACED');
|
|
344
|
+
if (!current.isDirectory() || !sameInode(originalStat, current))
|
|
345
|
+
review('ENTRY_REPLACED');
|
|
346
|
+
await rmdir(path).catch((error) => {
|
|
347
|
+
if (errno(error, 'ENOTEMPTY') || errno(error, 'EBUSY'))
|
|
348
|
+
review('ENTRY_REPLACED');
|
|
349
|
+
throw error;
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { lstat } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
/** 结构不可信时保留原目录,普通 I/O 故障仍交由原清理队列重试。 */
|
|
5
|
+
export class TargetScratchReview extends Error {
|
|
6
|
+
reason;
|
|
7
|
+
code = 'BOT_TARGET_SCRATCH_REVIEW';
|
|
8
|
+
constructor(reason) {
|
|
9
|
+
super('BOT_TARGET_SCRATCH_REVIEW');
|
|
10
|
+
this.reason = reason;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** 完整 ID 仍是账本/动作身份;96 位短名只限制真实 TMPDIR 的字节长度。 */
|
|
14
|
+
export const scratchName = (id) => createHash('sha256').update(id).digest('base64url').slice(0, 16);
|
|
15
|
+
// 仅明确 ENOENT 表示候选缺失;I/O 或权限失败不能被当作清理完成。
|
|
16
|
+
const maybeStat = (path) => lstat(path, { bigint: true }).catch((error) => {
|
|
17
|
+
if (error instanceof Error && 'code' in error && error.code === 'ENOENT')
|
|
18
|
+
return null;
|
|
19
|
+
throw error;
|
|
20
|
+
});
|
|
21
|
+
/** 新短名与旧全名都只按原 dev/inode 识别;异物保留,不能凭名字移除或覆盖。 */
|
|
22
|
+
export async function scratchPaths(id, root, staging, identity) {
|
|
23
|
+
const candidates = await Promise.all([...new Set([scratchName(id), id])].map(async (name) => ({
|
|
24
|
+
live: join(root.path, name),
|
|
25
|
+
staged: join(staging.path, name),
|
|
26
|
+
liveVisible: join(root.visible, name),
|
|
27
|
+
stagedVisible: join(staging.visible, name),
|
|
28
|
+
liveStat: await maybeStat(join(root.path, name)),
|
|
29
|
+
stagedStat: await maybeStat(join(staging.path, name)),
|
|
30
|
+
})));
|
|
31
|
+
const original = (value) => value?.dev.toString() === identity.device && value.ino.toString() === identity.inode;
|
|
32
|
+
const matches = candidates.flatMap((candidate) => [candidate.liveStat, candidate.stagedStat].filter(original).map(() => candidate));
|
|
33
|
+
if (matches.length > 1)
|
|
34
|
+
throw new TargetScratchReview('DUPLICATE_PATH');
|
|
35
|
+
if (!matches.length && candidates.some((value) => value.liveStat || value.stagedStat))
|
|
36
|
+
throw new TargetScratchReview('ACTION_DIRECTORY_REPLACED');
|
|
37
|
+
return matches[0] ?? candidates[0];
|
|
38
|
+
}
|
|
39
|
+
/** mountinfo 按内核转义解码,绑定挂载即使设备号相同也不能纳入清理。 */
|
|
40
|
+
export function scratchMountPoints(raw, maxBytes) {
|
|
41
|
+
if (!raw || Buffer.byteLength(raw) > maxBytes)
|
|
42
|
+
throw new TargetScratchReview('MOUNT_INFO_INVALID');
|
|
43
|
+
return raw
|
|
44
|
+
.trimEnd()
|
|
45
|
+
.split('\n')
|
|
46
|
+
.map((line) => {
|
|
47
|
+
const sep = line.indexOf(' - '), fields = line.slice(0, sep).split(' '), encoded = fields[4];
|
|
48
|
+
if (sep < 0 ||
|
|
49
|
+
fields.length < 6 ||
|
|
50
|
+
!/^\d+$/.test(fields[0]) ||
|
|
51
|
+
!encoded?.startsWith('/') ||
|
|
52
|
+
/\\(?!040|011|012|134)/.test(encoded))
|
|
53
|
+
throw new TargetScratchReview('MOUNT_INFO_INVALID');
|
|
54
|
+
return encoded.replace(/\\(040|011|012|134)/g, (_, code) => String.fromCharCode(Number.parseInt(code, 8)));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { canonicalBotJson, } from '@agent-stack/contracts';
|
|
2
|
+
import { TargetScratchReview } from './scratch-files.js';
|
|
3
|
+
/** 临时回收与原动作结算分开,按已登记 inode 和进程空闲回证重试。 */
|
|
4
|
+
export class TargetScratchMaintenance {
|
|
5
|
+
files;
|
|
6
|
+
journal;
|
|
7
|
+
runnerId;
|
|
8
|
+
failedRetentionMs;
|
|
9
|
+
idle;
|
|
10
|
+
verifyIdle;
|
|
11
|
+
verifyEmpty;
|
|
12
|
+
clock;
|
|
13
|
+
work;
|
|
14
|
+
closed = false;
|
|
15
|
+
qualificationCursor;
|
|
16
|
+
cleanupCursor;
|
|
17
|
+
constructor(files, journal, runnerId, failedRetentionMs, idle, verifyIdle, verifyEmpty, clock = Date.now) {
|
|
18
|
+
this.files = files;
|
|
19
|
+
this.journal = journal;
|
|
20
|
+
this.runnerId = runnerId;
|
|
21
|
+
this.failedRetentionMs = failedRetentionMs;
|
|
22
|
+
this.idle = idle;
|
|
23
|
+
this.verifyIdle = verifyIdle;
|
|
24
|
+
this.verifyEmpty = verifyEmpty;
|
|
25
|
+
this.clock = clock;
|
|
26
|
+
}
|
|
27
|
+
async create(actionId) {
|
|
28
|
+
// 回收已经开始时,新动作等到文件操作收尾才获得实际进程的临时路径。
|
|
29
|
+
await this.work;
|
|
30
|
+
if (this.closed)
|
|
31
|
+
throw new Error('BOT_TARGET_SCRATCH_CLOSED');
|
|
32
|
+
const created = await this.files.create(actionId);
|
|
33
|
+
this.journal.registerScratch(actionId, this.runnerId, created.identity);
|
|
34
|
+
return created.path;
|
|
35
|
+
}
|
|
36
|
+
sweep() {
|
|
37
|
+
if (this.closed || !this.idle())
|
|
38
|
+
return;
|
|
39
|
+
this.work ??= this.collect()
|
|
40
|
+
.catch(() => console.warn('BOT_TARGET_SCRATCH_SWEEP_PENDING'))
|
|
41
|
+
.finally(() => {
|
|
42
|
+
this.work = undefined;
|
|
43
|
+
});
|
|
44
|
+
return this.work;
|
|
45
|
+
}
|
|
46
|
+
async close() {
|
|
47
|
+
this.closed = true;
|
|
48
|
+
await this.work;
|
|
49
|
+
}
|
|
50
|
+
/** 对外只回读清理状态,设备、inode 和真实路径留在目标端。 */
|
|
51
|
+
status(identity) {
|
|
52
|
+
const action = this.journal.read(identity.actionId);
|
|
53
|
+
if (!action)
|
|
54
|
+
return null;
|
|
55
|
+
if (canonicalBotJson(action.identity) !== canonicalBotJson(identity))
|
|
56
|
+
throw new Error('BOT_TARGET_ACTION_CONFLICT');
|
|
57
|
+
const entry = this.journal.readScratch(identity.actionId);
|
|
58
|
+
if (!entry)
|
|
59
|
+
return null;
|
|
60
|
+
if (entry.state !== 'CLEANED' && entry.state !== 'REVIEW')
|
|
61
|
+
void this.sweep();
|
|
62
|
+
return {
|
|
63
|
+
actionId: entry.actionId,
|
|
64
|
+
state: entry.state,
|
|
65
|
+
eligibleAtMs: entry.eligibleAtMs,
|
|
66
|
+
reason: entry.reason,
|
|
67
|
+
retryAfterMs: entry.retryAfterMs,
|
|
68
|
+
lastError: entry.lastError,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async collect() {
|
|
72
|
+
try {
|
|
73
|
+
// 重启后递归核对整棵目标进程树,避免另一条旧动作仍以同一系统身份访问暂存目录。
|
|
74
|
+
this.verifyIdle();
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// 游标轮转,无法确认的老目录不会挡住之后的其他动作。
|
|
80
|
+
const batch = 16;
|
|
81
|
+
const terminal = this.journal.activeTerminalScratch(batch, this.qualificationCursor);
|
|
82
|
+
this.qualificationCursor = terminal.length === batch ? terminal.at(-1)?.actionId : undefined;
|
|
83
|
+
for (const entry of terminal) {
|
|
84
|
+
const action = this.journal.read(entry.actionId);
|
|
85
|
+
if (!action?.outcome)
|
|
86
|
+
continue;
|
|
87
|
+
try {
|
|
88
|
+
this.verifyEmpty(entry.actionId);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// 未能核对原内核范围时继续保留原目录及取证材料。
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const retain = action.state === 'SUCCEEDED' ? 0 : this.failedRetentionMs;
|
|
95
|
+
this.journal.qualifyScratch(entry.actionId, action.updatedAtMs + retain);
|
|
96
|
+
}
|
|
97
|
+
const due = this.journal.dueScratch(this.clock(), batch, this.cleanupCursor);
|
|
98
|
+
this.cleanupCursor = due.length === batch ? due.at(-1)?.actionId : undefined;
|
|
99
|
+
for (const entry of due) {
|
|
100
|
+
if (this.closed)
|
|
101
|
+
break;
|
|
102
|
+
let phase = entry.state === 'STAGED' ? 'STAGED' : 'ELIGIBLE';
|
|
103
|
+
try {
|
|
104
|
+
this.verifyEmpty(entry.actionId);
|
|
105
|
+
if (phase === 'ELIGIBLE') {
|
|
106
|
+
await this.files.stage(entry.actionId, entry.identity);
|
|
107
|
+
this.journal.updateScratch(entry.actionId, 'ELIGIBLE', 'STAGED');
|
|
108
|
+
phase = 'STAGED';
|
|
109
|
+
}
|
|
110
|
+
await this.files.remove(entry.actionId, entry.identity);
|
|
111
|
+
this.journal.updateScratch(entry.actionId, 'STAGED', 'CLEANED');
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (error instanceof TargetScratchReview)
|
|
115
|
+
this.journal.updateScratch(entry.actionId, phase, 'REVIEW', error.reason);
|
|
116
|
+
else {
|
|
117
|
+
// 暂态 I/O 故障沿原阶段退避,避免轮询反复扫盘或重跑实际动作。
|
|
118
|
+
const code = error instanceof Error && 'code' in error ? error.code : undefined;
|
|
119
|
+
this.journal.deferScratch(entry.actionId, phase, this.clock() + 30_000, typeof code === 'string' && /^[A-Z][A-Z0-9_]{1,40}$/.test(code)
|
|
120
|
+
? code
|
|
121
|
+
: 'SCRATCH_IO_RETRY');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { botChoice, botHostActionIdentity, botId, botObject, botTargetLocalCaller, } from '@agent-stack/contracts';
|
|
2
|
+
const maxRequest = 196608;
|
|
3
|
+
async function handle(gateway, raw) {
|
|
4
|
+
let requestId = null;
|
|
5
|
+
try {
|
|
6
|
+
const request = botObject(JSON.parse(raw));
|
|
7
|
+
requestId = botId(request.requestId);
|
|
8
|
+
const operation = botChoice(request.operation, [
|
|
9
|
+
'start',
|
|
10
|
+
'status',
|
|
11
|
+
'cancel',
|
|
12
|
+
'result',
|
|
13
|
+
'scratch', // 临时文件收尾与原动作状态分开回读。
|
|
14
|
+
'describe',
|
|
15
|
+
'reserve',
|
|
16
|
+
'lookup',
|
|
17
|
+
]);
|
|
18
|
+
const caller = request.caller === undefined ? undefined : botTargetLocalCaller(request.caller);
|
|
19
|
+
const payload = operation === 'start' || operation === 'reserve'
|
|
20
|
+
? 'action'
|
|
21
|
+
: operation === 'lookup'
|
|
22
|
+
? 'actionId'
|
|
23
|
+
: 'identity';
|
|
24
|
+
const expected = operation === 'describe'
|
|
25
|
+
? ['requestId', 'operation', 'caller']
|
|
26
|
+
: ['requestId', 'operation', payload, ...(caller ? ['caller'] : [])];
|
|
27
|
+
if (Object.keys(request).length !== expected.length ||
|
|
28
|
+
!expected.every((key) => Object.hasOwn(request, key)))
|
|
29
|
+
throw new Error('BOT_TARGET_COMMAND_SHAPE_INVALID');
|
|
30
|
+
if (operation === 'describe') {
|
|
31
|
+
if (!gateway.describe)
|
|
32
|
+
throw new Error('BOT_TARGET_LOCAL_NOT_CONFIGURED');
|
|
33
|
+
return { requestId, result: gateway.describe(caller) };
|
|
34
|
+
}
|
|
35
|
+
if (operation === 'reserve' || operation === 'lookup') {
|
|
36
|
+
if (!gateway.reserve || !gateway.lookup)
|
|
37
|
+
throw new Error('BOT_TARGET_LOCAL_NOT_CONFIGURED');
|
|
38
|
+
return {
|
|
39
|
+
requestId,
|
|
40
|
+
result: operation === 'reserve'
|
|
41
|
+
? await gateway.reserve(request.action, caller)
|
|
42
|
+
: await gateway.lookup(botId(request.actionId), caller),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const result = operation === 'start'
|
|
46
|
+
? await gateway.start(request.action, caller)
|
|
47
|
+
: await gateway[operation](botHostActionIdentity(request.identity), caller);
|
|
48
|
+
return { requestId, result };
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
const code = error instanceof Error && /^BOT_TARGET_[A-Z_]+$/.test(error.message)
|
|
52
|
+
? error.message
|
|
53
|
+
: 'BOT_TARGET_REQUEST_REJECTED';
|
|
54
|
+
return { requestId, error: code };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** 私有父进程管道按原请求返回有界 JSON,不监听网络端口。 */
|
|
58
|
+
export async function serveTargetStdio(gateway, input, output) {
|
|
59
|
+
let pending = [];
|
|
60
|
+
let length = 0;
|
|
61
|
+
for await (const chunk of input) {
|
|
62
|
+
let from = 0;
|
|
63
|
+
for (;;) {
|
|
64
|
+
const newline = chunk.indexOf(10, from);
|
|
65
|
+
const last = newline < 0 ? chunk.length : newline;
|
|
66
|
+
const piece = chunk.subarray(from, last);
|
|
67
|
+
length += piece.length;
|
|
68
|
+
if (length > maxRequest)
|
|
69
|
+
throw new Error('BOT_TARGET_REQUEST_TOO_LARGE');
|
|
70
|
+
if (piece.length)
|
|
71
|
+
pending.push(piece);
|
|
72
|
+
if (newline < 0)
|
|
73
|
+
break;
|
|
74
|
+
const line = Buffer.concat(pending, length).toString('utf8');
|
|
75
|
+
await output(JSON.stringify(await handle(gateway, line)) + '\n');
|
|
76
|
+
pending = [];
|
|
77
|
+
length = 0;
|
|
78
|
+
from = newline + 1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (length)
|
|
82
|
+
throw new Error('BOT_TARGET_REQUEST_INCOMPLETE');
|
|
83
|
+
}
|