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,72 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { ProtocolError } from "../../api/errors.js";
|
|
3
|
+
import { parseJSON } from "./codec.js";
|
|
4
|
+
import { isRecord } from "./schema.js";
|
|
5
|
+
// Local generated metadata is loaded losslessly, including exact u64 schema bounds.
|
|
6
|
+
function loadRegistry() {
|
|
7
|
+
const value = parseJSON(readFileSync(new URL("./operations.json", import.meta.url), "utf8"));
|
|
8
|
+
if (!isRecord(value) || value.version !== 1 || !isRecord(value.operations)) {
|
|
9
|
+
throw new ProtocolError("Unsupported generated operation registry");
|
|
10
|
+
}
|
|
11
|
+
for (const operation of Object.values(value.operations)) {
|
|
12
|
+
if (!isRecord(operation) || typeof operation.method !== "string"
|
|
13
|
+
|| typeof operation.path !== "string" || !Array.isArray(operation.parameters)
|
|
14
|
+
|| typeof operation.status !== "number" || typeof operation.binary !== "boolean"
|
|
15
|
+
|| !(operation.request === null || isRecord(operation.request))
|
|
16
|
+
|| !(operation.response === null || isRecord(operation.response))) {
|
|
17
|
+
throw new ProtocolError("Invalid generated operation metadata");
|
|
18
|
+
}
|
|
19
|
+
if (!["GET", "POST", "PUT"].includes(operation.method)
|
|
20
|
+
|| !/^\/v[123]\//.test(operation.path) || !Number.isSafeInteger(operation.status)
|
|
21
|
+
|| operation.status < 200 || operation.status >= 300) {
|
|
22
|
+
throw new ProtocolError("Unsupported generated operation semantics");
|
|
23
|
+
}
|
|
24
|
+
for (const parameter of operation.parameters) {
|
|
25
|
+
if (!isRecord(parameter) || typeof parameter.name !== "string"
|
|
26
|
+
|| !["path", "query"].includes(String(parameter.in))
|
|
27
|
+
|| typeof parameter.required !== "boolean" || !isRecord(parameter.schema)) {
|
|
28
|
+
throw new ProtocolError("Invalid generated parameter metadata");
|
|
29
|
+
}
|
|
30
|
+
checkSchema(parameter.schema);
|
|
31
|
+
}
|
|
32
|
+
if (operation.request !== null)
|
|
33
|
+
checkSchema(operation.request);
|
|
34
|
+
if (operation.response !== null)
|
|
35
|
+
checkSchema(operation.response);
|
|
36
|
+
}
|
|
37
|
+
// Trusted generated data has been checked above; network data is checked per call.
|
|
38
|
+
return value.operations;
|
|
39
|
+
}
|
|
40
|
+
function checkSchema(schema) {
|
|
41
|
+
const annotations = ["$id", "$schema", "title", "description", "default", "examples", "writeOnly", "contentEncoding"];
|
|
42
|
+
const assertions = ["type", "const", "enum", "anyOf", "properties", "required", "additionalProperties",
|
|
43
|
+
"items", "minItems", "maxItems", "uniqueItems", "minLength", "maxLength", "pattern", "minimum", "maximum", "format"];
|
|
44
|
+
for (const [key, value] of Object.entries(schema)) {
|
|
45
|
+
if (!annotations.includes(key) && !assertions.includes(key) && !key.startsWith("x-")) {
|
|
46
|
+
throw new ProtocolError("Unsupported generated schema assertion");
|
|
47
|
+
}
|
|
48
|
+
if (key === "format" && value !== "uri" && value !== "binary") {
|
|
49
|
+
throw new ProtocolError("Unsupported generated schema format");
|
|
50
|
+
}
|
|
51
|
+
if (key === "properties" && isRecord(value)) {
|
|
52
|
+
for (const child of Object.values(value))
|
|
53
|
+
if (isRecord(child))
|
|
54
|
+
checkSchema(child);
|
|
55
|
+
}
|
|
56
|
+
else if (key === "anyOf" && Array.isArray(value)) {
|
|
57
|
+
for (const child of value)
|
|
58
|
+
if (isRecord(child))
|
|
59
|
+
checkSchema(child);
|
|
60
|
+
}
|
|
61
|
+
else if (["items", "additionalProperties"].includes(key) && isRecord(value)) {
|
|
62
|
+
checkSchema(value);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const operations = loadRegistry();
|
|
67
|
+
export function operationFor(id) {
|
|
68
|
+
const operation = operations[id];
|
|
69
|
+
if (!operation)
|
|
70
|
+
throw new ProtocolError("Unknown local API operation");
|
|
71
|
+
return operation;
|
|
72
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { stringifyJSON } from "./codec.js";
|
|
2
|
+
export function isRecord(value) {
|
|
3
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
/** Implements the assertions actually used by the canonical expanded schemas. */
|
|
6
|
+
export function schemaIssue(value, schema, path = "$") {
|
|
7
|
+
if (schema["x-matrix-json"])
|
|
8
|
+
return matrixJSONIssue(value, path);
|
|
9
|
+
if (schema.anyOf && !schema.anyOf.some((part) => schemaIssue(value, part) === null)) {
|
|
10
|
+
return `${path}: does not match any allowed schema`;
|
|
11
|
+
}
|
|
12
|
+
if ("const" in schema && value !== schema.const)
|
|
13
|
+
return `${path}: invalid constant`;
|
|
14
|
+
if (schema.enum && !schema.enum.includes(value))
|
|
15
|
+
return `${path}: invalid enum value`;
|
|
16
|
+
const types = typeof schema.type === "string" ? [schema.type] : schema.type;
|
|
17
|
+
if (types && !types.some((type) => matchesType(value, type))) {
|
|
18
|
+
return `${path}: invalid type`;
|
|
19
|
+
}
|
|
20
|
+
if (typeof value === "number" || typeof value === "bigint") {
|
|
21
|
+
if (typeof value === "number") {
|
|
22
|
+
if (!Number.isFinite(value))
|
|
23
|
+
return `${path}: expected finite number`;
|
|
24
|
+
if (Number.isInteger(value) && !Number.isSafeInteger(value)) {
|
|
25
|
+
return `${path}: use bigint for integers outside the safe Number range`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (schema.minimum !== undefined && value < schema.minimum)
|
|
29
|
+
return `${path}: below minimum`;
|
|
30
|
+
if (schema.maximum !== undefined && value > schema.maximum)
|
|
31
|
+
return `${path}: above maximum`;
|
|
32
|
+
}
|
|
33
|
+
if (typeof value === "string") {
|
|
34
|
+
for (const character of value) {
|
|
35
|
+
const point = character.codePointAt(0);
|
|
36
|
+
if (point !== undefined && point >= 0xd800 && point <= 0xdfff)
|
|
37
|
+
return `${path}: invalid Unicode scalar`;
|
|
38
|
+
}
|
|
39
|
+
const length = [...value].length;
|
|
40
|
+
if (schema.minLength !== undefined && length < schema.minLength)
|
|
41
|
+
return `${path}: too short`;
|
|
42
|
+
if (schema.maxLength !== undefined && length > schema.maxLength)
|
|
43
|
+
return `${path}: too long`;
|
|
44
|
+
if (schema.pattern && !new RegExp(schema.pattern, "u").test(value))
|
|
45
|
+
return `${path}: invalid pattern`;
|
|
46
|
+
if (schema.format === "uri") {
|
|
47
|
+
// WHATWG URL normalizes whitespace/non-ASCII and accepts malformed escapes.
|
|
48
|
+
// Canonical URI values must already use URI characters and valid %HH tokens.
|
|
49
|
+
if (!/^[A-Za-z0-9._~:/?#\[\]@!$&'()*+,;=%-]+$/.test(value)
|
|
50
|
+
|| /%(?![0-9A-Fa-f]{2})/.test(value))
|
|
51
|
+
return `${path}: invalid URI`;
|
|
52
|
+
try {
|
|
53
|
+
new URL(value);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return `${path}: invalid URI`;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (Array.isArray(value)) {
|
|
61
|
+
if (schema.minItems !== undefined && value.length < schema.minItems)
|
|
62
|
+
return `${path}: too few items`;
|
|
63
|
+
if (schema.maxItems !== undefined && value.length > schema.maxItems)
|
|
64
|
+
return `${path}: too many items`;
|
|
65
|
+
if (schema.uniqueItems && new Set(value.map(stringifyJSON)).size !== value.length) {
|
|
66
|
+
return `${path}: duplicate items`;
|
|
67
|
+
}
|
|
68
|
+
if (schema.items) {
|
|
69
|
+
for (const [index, item] of value.entries()) {
|
|
70
|
+
const issue = schemaIssue(item, schema.items, `${path}[${index}]`);
|
|
71
|
+
if (issue)
|
|
72
|
+
return issue;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (isRecord(value)) {
|
|
77
|
+
for (const name of schema.required ?? []) {
|
|
78
|
+
if (!Object.hasOwn(value, name))
|
|
79
|
+
return `${path}.${name}: required`;
|
|
80
|
+
}
|
|
81
|
+
for (const [name, field] of Object.entries(value)) {
|
|
82
|
+
const child = schema.properties && Object.hasOwn(schema.properties, name) ? schema.properties[name] : undefined;
|
|
83
|
+
if (child) {
|
|
84
|
+
const issue = schemaIssue(field, child, `${path}.${name}`);
|
|
85
|
+
if (issue)
|
|
86
|
+
return issue;
|
|
87
|
+
}
|
|
88
|
+
else if (schema.additionalProperties === false) {
|
|
89
|
+
return `${path}: unknown property`;
|
|
90
|
+
}
|
|
91
|
+
else if (isRecord(schema.additionalProperties)) {
|
|
92
|
+
const issue = schemaIssue(field, schema.additionalProperties, `${path}.${name}`);
|
|
93
|
+
if (issue)
|
|
94
|
+
return issue;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
function matrixJSONIssue(value, path) {
|
|
101
|
+
if (!isRecord(value))
|
|
102
|
+
return `${path}: expected Matrix JSON object`;
|
|
103
|
+
let remaining = 100000;
|
|
104
|
+
const walk = (item, depth) => {
|
|
105
|
+
if (--remaining < 0 || depth > 64)
|
|
106
|
+
return false;
|
|
107
|
+
if (item === null || typeof item === "boolean")
|
|
108
|
+
return true;
|
|
109
|
+
if (typeof item === "bigint")
|
|
110
|
+
return item >= -(1n << 63n) && item < (1n << 64n);
|
|
111
|
+
if (typeof item === "number")
|
|
112
|
+
return Number.isFinite(item) && (!Number.isInteger(item) || Number.isSafeInteger(item));
|
|
113
|
+
if (typeof item === "string")
|
|
114
|
+
return !/[\uD800-\uDFFF]/u.test(item);
|
|
115
|
+
if (Array.isArray(item))
|
|
116
|
+
return item.every(child => walk(child, depth + 1));
|
|
117
|
+
return isRecord(item) && [null, Object.prototype].includes(Object.getPrototypeOf(item))
|
|
118
|
+
&& Object.getOwnPropertySymbols(item).length === 0 && Object.entries(item).every(([key, child]) => walk(key, depth + 1) && walk(child, depth + 1));
|
|
119
|
+
};
|
|
120
|
+
return walk(value, 0) ? null : `${path}: invalid or oversized Matrix JSON`;
|
|
121
|
+
}
|
|
122
|
+
function matchesType(value, type) {
|
|
123
|
+
if (type === "null")
|
|
124
|
+
return value === null;
|
|
125
|
+
if (type === "object")
|
|
126
|
+
return isRecord(value);
|
|
127
|
+
if (type === "array")
|
|
128
|
+
return Array.isArray(value);
|
|
129
|
+
if (type === "integer") {
|
|
130
|
+
return typeof value === "bigint" || (typeof value === "number" && Number.isSafeInteger(value));
|
|
131
|
+
}
|
|
132
|
+
return typeof value === type;
|
|
133
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { AgentIMError, ClientClosedError, RequestCancelledError, RequestTimeoutError, TransportError, ValidationError, } from "../../api/errors.js";
|
|
2
|
+
import { operationFor } from "../protocol/registry.js";
|
|
3
|
+
import { requestBody, requestURL } from "./request.js";
|
|
4
|
+
import { readResponse } from "./response.js";
|
|
5
|
+
export class Transport {
|
|
6
|
+
#origin;
|
|
7
|
+
#token;
|
|
8
|
+
#timeoutMs;
|
|
9
|
+
#maxResponseBytes;
|
|
10
|
+
#pending = new Map();
|
|
11
|
+
#closed = false;
|
|
12
|
+
constructor(options) {
|
|
13
|
+
let url;
|
|
14
|
+
try {
|
|
15
|
+
url = new URL(options.baseUrl);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
throw new ValidationError("Invalid local daemon URL");
|
|
19
|
+
}
|
|
20
|
+
if (url.protocol !== "http:" || !["127.0.0.1", "[::1]"].includes(url.hostname)
|
|
21
|
+
|| url.username || url.password || url.pathname !== "/" || url.search || url.hash) {
|
|
22
|
+
throw new ValidationError("Daemon URL must be a loopback HTTP origin");
|
|
23
|
+
}
|
|
24
|
+
if (typeof options.apiToken !== "string" || !options.apiToken
|
|
25
|
+
|| /[^\x21-\x7e]/.test(options.apiToken)) {
|
|
26
|
+
throw new ValidationError("A local daemon bearer token is required");
|
|
27
|
+
}
|
|
28
|
+
this.#origin = url.origin;
|
|
29
|
+
this.#token = options.apiToken;
|
|
30
|
+
this.#timeoutMs = positiveInteger(options.timeoutMs ?? 45_000, "timeoutMs");
|
|
31
|
+
this.#maxResponseBytes = positiveInteger(options.maxResponseBytes ?? 64 * 1024 * 1024, "maxResponseBytes");
|
|
32
|
+
}
|
|
33
|
+
call(id, options = {}) {
|
|
34
|
+
if (this.#closed)
|
|
35
|
+
return Promise.reject(new ClientClosedError("SDK client is closed"));
|
|
36
|
+
let operation;
|
|
37
|
+
let url;
|
|
38
|
+
let body;
|
|
39
|
+
let timeoutMs;
|
|
40
|
+
try {
|
|
41
|
+
operation = operationFor(id);
|
|
42
|
+
url = requestURL(this.#origin, operation, options);
|
|
43
|
+
body = requestBody(operation, options.body);
|
|
44
|
+
timeoutMs = positiveInteger(options.timeoutMs ?? this.#timeoutMs, "timeoutMs");
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return Promise.reject(error);
|
|
48
|
+
}
|
|
49
|
+
const controller = new AbortController();
|
|
50
|
+
const cancel = () => controller.abort(new RequestCancelledError("SDK request cancelled"));
|
|
51
|
+
if (options.signal?.aborted)
|
|
52
|
+
cancel();
|
|
53
|
+
else
|
|
54
|
+
options.signal?.addEventListener("abort", cancel, { once: true });
|
|
55
|
+
const timer = setTimeout(() => {
|
|
56
|
+
controller.abort(new RequestTimeoutError("SDK request timed out; write outcome may be unknown"));
|
|
57
|
+
}, timeoutMs);
|
|
58
|
+
const run = async () => {
|
|
59
|
+
try {
|
|
60
|
+
const headers = { Authorization: `Bearer ${this.#token}` };
|
|
61
|
+
if (body !== undefined)
|
|
62
|
+
headers["Content-Type"] = "application/json";
|
|
63
|
+
const response = await fetch(url, {
|
|
64
|
+
method: operation.method, headers, redirect: "error", signal: controller.signal,
|
|
65
|
+
...(body === undefined ? {} : { body }),
|
|
66
|
+
});
|
|
67
|
+
return await readResponse(response, operation, this.#maxResponseBytes, this.#token);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (controller.signal.aborted) {
|
|
71
|
+
const reason = controller.signal.reason;
|
|
72
|
+
if (reason instanceof AgentIMError)
|
|
73
|
+
throw reason;
|
|
74
|
+
throw new RequestCancelledError("SDK request cancelled");
|
|
75
|
+
}
|
|
76
|
+
if (error instanceof AgentIMError)
|
|
77
|
+
throw error;
|
|
78
|
+
throw new TransportError("Local daemon connection failed; write outcome may be unknown");
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const pending = run().finally(() => {
|
|
82
|
+
clearTimeout(timer);
|
|
83
|
+
options.signal?.removeEventListener("abort", cancel);
|
|
84
|
+
this.#pending.delete(pending);
|
|
85
|
+
});
|
|
86
|
+
this.#pending.set(pending, controller);
|
|
87
|
+
return pending;
|
|
88
|
+
}
|
|
89
|
+
async close() {
|
|
90
|
+
this.#closed = true;
|
|
91
|
+
for (const controller of this.#pending.values()) {
|
|
92
|
+
controller.abort(new ClientClosedError("SDK client closed; write outcome may be unknown"));
|
|
93
|
+
}
|
|
94
|
+
await Promise.allSettled(this.#pending.keys());
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function positiveInteger(value, name) {
|
|
98
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > 2_147_483_647) {
|
|
99
|
+
throw new ValidationError(`${name} must be a positive bounded integer`);
|
|
100
|
+
}
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ProtocolError } from "../../api/errors.js";
|
|
2
|
+
/** Identity evidence stays scoped; known v3 operations also admit a bounded continuation action. */
|
|
3
|
+
export function errorDiagnostics(value, enabled, token, continuation = false) {
|
|
4
|
+
const keys = ["code", "message", ...(enabled ? ["request_id", "retry_after_ms", "server_code", "next_action", "edge_request_id", "stage", "transport", "upstream_status", "safe_to_retry", "attempt_id", "device_created"] : continuation ? ["next_action"] : [])];
|
|
5
|
+
if (Object.keys(value).some((key) => !keys.includes(key)))
|
|
6
|
+
throw new ProtocolError("Invalid error envelope");
|
|
7
|
+
const requestId = value.request_id;
|
|
8
|
+
const retryAfterMs = value.retry_after_ms;
|
|
9
|
+
const serverCode = value.server_code;
|
|
10
|
+
const nextAction = value.next_action;
|
|
11
|
+
const edgeRequestId = value.edge_request_id;
|
|
12
|
+
if (edgeRequestId !== undefined && (typeof edgeRequestId !== "string" || !/^[A-Za-z0-9_-]{1,80}$/.test(edgeRequestId)))
|
|
13
|
+
throw new ProtocolError("Invalid edge correlation");
|
|
14
|
+
if (requestId !== undefined && (typeof requestId !== "string" || !/^[a-f0-9]{32}$/.test(requestId)))
|
|
15
|
+
throw new ProtocolError("Invalid request correlation");
|
|
16
|
+
if (retryAfterMs !== undefined && (typeof retryAfterMs !== "number" || !Number.isSafeInteger(retryAfterMs) || retryAfterMs < 0 || retryAfterMs > 86_400_000))
|
|
17
|
+
throw new ProtocolError("Invalid retry time");
|
|
18
|
+
if (serverCode !== undefined && (typeof serverCode !== "string" || !/^[A-Z0-9_]{1,64}$/.test(serverCode)))
|
|
19
|
+
throw new ProtocolError("Invalid server error code");
|
|
20
|
+
if (nextAction !== undefined && (typeof nextAction !== "string" || !/^[a-z_]{1,64}$/.test(nextAction)))
|
|
21
|
+
throw new ProtocolError("Invalid next action");
|
|
22
|
+
const more = {};
|
|
23
|
+
const strings = [["stage", "stage", ["matrix_login", "account_exchange", "restore_session", "persist_session", "matrix_password_login", "password_reauth", "password_authentication", "login_discovery"]],
|
|
24
|
+
["transport", "transport", ["http", "connect", "timeout", "non_json", "sdk", "unknown"]],
|
|
25
|
+
["device_created", "deviceCreated", ["yes", "no", "unknown"]]];
|
|
26
|
+
for (const [wire, field, allowed] of strings) {
|
|
27
|
+
const item = value[wire];
|
|
28
|
+
if (item !== undefined && (typeof item !== "string" || !allowed.includes(item)))
|
|
29
|
+
throw new ProtocolError("Invalid login diagnostic");
|
|
30
|
+
if (typeof item === "string")
|
|
31
|
+
Object.assign(more, { [field]: item });
|
|
32
|
+
}
|
|
33
|
+
if (value.upstream_status !== undefined && (typeof value.upstream_status !== "number" || !Number.isInteger(value.upstream_status) || value.upstream_status < 100 || value.upstream_status > 599))
|
|
34
|
+
throw new ProtocolError("Invalid upstream status");
|
|
35
|
+
if (value.safe_to_retry !== undefined && typeof value.safe_to_retry !== "boolean")
|
|
36
|
+
throw new ProtocolError("Invalid retry classification");
|
|
37
|
+
if (value.attempt_id !== undefined && (typeof value.attempt_id !== "string" || !/^[A-Za-z0-9_-]{43}$/.test(value.attempt_id)))
|
|
38
|
+
throw new ProtocolError("Invalid login attempt");
|
|
39
|
+
return {
|
|
40
|
+
...more,
|
|
41
|
+
...(typeof value.upstream_status === "number" ? { upstreamStatus: value.upstream_status } : {}),
|
|
42
|
+
...(typeof value.safe_to_retry === "boolean" ? { safeToRetry: value.safe_to_retry } : {}),
|
|
43
|
+
...(typeof value.attempt_id === "string" && (!token || !value.attempt_id.includes(token)) ? { attemptId: value.attempt_id } : {}),
|
|
44
|
+
...(typeof edgeRequestId === "string" && (!token || !edgeRequestId.includes(token)) ? { edgeRequestId } : {}),
|
|
45
|
+
...(typeof requestId === "string" && (!token || !requestId.includes(token)) ? { requestId } : {}),
|
|
46
|
+
...(typeof retryAfterMs === "number" ? { retryAfterMs } : {}),
|
|
47
|
+
...(typeof serverCode === "string" && (!token || !serverCode.includes(token)) ? { serverCode } : {}),
|
|
48
|
+
...(typeof nextAction === "string" && (!token || !nextAction.includes(token)) ? { nextAction } : {}),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ValidationError } from "../../api/errors.js";
|
|
2
|
+
import { stringifyJSON } from "../protocol/codec.js";
|
|
3
|
+
import { snapshotInput } from "../protocol/input.js";
|
|
4
|
+
import { isRecord, schemaIssue } from "../protocol/schema.js";
|
|
5
|
+
export function requestTarget(operation, options) {
|
|
6
|
+
let path = operation.path;
|
|
7
|
+
const query = snapshotInput(options.query === undefined ? {} : options.query);
|
|
8
|
+
const pathValues = snapshotInput(options.path ?? {});
|
|
9
|
+
for (const [location, values] of [["path", pathValues], ["query", query]]) {
|
|
10
|
+
if (!isRecord(values)) {
|
|
11
|
+
throw new ValidationError(`Invalid ${location} parameters`);
|
|
12
|
+
}
|
|
13
|
+
const entries = Object.entries(values);
|
|
14
|
+
const expected = operation.parameters.filter((parameter) => parameter.in === location);
|
|
15
|
+
if (entries.some(([name]) => !expected.some((parameter) => parameter.name === name))) {
|
|
16
|
+
throw new ValidationError(`Unknown ${location} parameter`);
|
|
17
|
+
}
|
|
18
|
+
for (const parameter of expected) {
|
|
19
|
+
const value = values[parameter.name];
|
|
20
|
+
if (value === undefined && !Object.hasOwn(values, parameter.name) && !parameter.required)
|
|
21
|
+
continue;
|
|
22
|
+
const issue = schemaIssue(value, parameter.schema);
|
|
23
|
+
if (issue)
|
|
24
|
+
throw new ValidationError(`Invalid ${location} parameter ${parameter.name}: ${issue}`);
|
|
25
|
+
if (location === "path") {
|
|
26
|
+
path = path.replace(`{${parameter.name}}`, encodeURIComponent(String(value)));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (/[{}]/.test(path))
|
|
31
|
+
throw new ValidationError("Missing path parameter");
|
|
32
|
+
const parameters = new URLSearchParams();
|
|
33
|
+
if (!isRecord(query))
|
|
34
|
+
throw new ValidationError("Invalid query parameters");
|
|
35
|
+
for (const [key, value] of Object.entries(query))
|
|
36
|
+
parameters.set(key, String(value));
|
|
37
|
+
const search = parameters.toString();
|
|
38
|
+
return path + (search ? `?${search}` : "");
|
|
39
|
+
}
|
|
40
|
+
export function requestBody(operation, body) {
|
|
41
|
+
if (operation.request === null) {
|
|
42
|
+
if (body !== undefined)
|
|
43
|
+
throw new ValidationError("Operation has no request body");
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const snapshot = snapshotInput(body);
|
|
47
|
+
const issue = schemaIssue(snapshot, operation.request);
|
|
48
|
+
if (issue)
|
|
49
|
+
throw new ValidationError(`Invalid request body: ${issue}`);
|
|
50
|
+
const encoded = stringifyJSON(snapshot);
|
|
51
|
+
const limit = Math.min(24 * 1024 * 1024, Number(operation.request["x-max-body-bytes"] ?? 8 * 1024 * 1024));
|
|
52
|
+
if (new TextEncoder().encode(encoded).byteLength > limit) {
|
|
53
|
+
throw new ValidationError("Request body exceeds the local API byte limit");
|
|
54
|
+
}
|
|
55
|
+
return encoded;
|
|
56
|
+
}
|
|
57
|
+
export function requestURL(origin, operation, options) {
|
|
58
|
+
return new URL(requestTarget(operation, options), origin);
|
|
59
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { AuthenticationError, OperationError, ProtocolError, ResponseTooLargeError } from "../../api/errors.js";
|
|
2
|
+
import { parseJSON } from "../protocol/codec.js";
|
|
3
|
+
import { isRecord, schemaIssue } from "../protocol/schema.js";
|
|
4
|
+
import { errorDiagnostics } from "./error-diagnostics.js";
|
|
5
|
+
import { streamDiagnostics } from "./stream-diagnostics.js";
|
|
6
|
+
import { retryAfterMs } from "./retry-after.js";
|
|
7
|
+
async function readBounded(response, limit) {
|
|
8
|
+
const length = response.headers.get("content-length");
|
|
9
|
+
if (length !== null && (!/^\d+$/.test(length) || BigInt(length) > BigInt(limit))) {
|
|
10
|
+
await response.body?.cancel();
|
|
11
|
+
throw new ResponseTooLargeError("Response exceeds the configured byte budget");
|
|
12
|
+
}
|
|
13
|
+
if (!response.body)
|
|
14
|
+
return new Uint8Array();
|
|
15
|
+
const reader = response.body.getReader();
|
|
16
|
+
const chunks = [];
|
|
17
|
+
let total = 0;
|
|
18
|
+
try {
|
|
19
|
+
while (true) {
|
|
20
|
+
const { done, value } = await reader.read();
|
|
21
|
+
if (done)
|
|
22
|
+
break;
|
|
23
|
+
total += value.byteLength;
|
|
24
|
+
if (total > limit) {
|
|
25
|
+
await reader.cancel();
|
|
26
|
+
throw new ResponseTooLargeError("Response exceeds the configured byte budget");
|
|
27
|
+
}
|
|
28
|
+
chunks.push(value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
reader.releaseLock();
|
|
33
|
+
}
|
|
34
|
+
const result = new Uint8Array(total);
|
|
35
|
+
let offset = 0;
|
|
36
|
+
for (const chunk of chunks) {
|
|
37
|
+
result.set(chunk, offset);
|
|
38
|
+
offset += chunk.length;
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
export async function readResponse(response, operation, limit, token) {
|
|
43
|
+
const bytes = await readBounded(response, limit);
|
|
44
|
+
const contentType = response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase();
|
|
45
|
+
if (response.status === operation.status && operation.binary) {
|
|
46
|
+
if (contentType !== "application/octet-stream")
|
|
47
|
+
throw new ProtocolError("Expected attachment bytes");
|
|
48
|
+
return bytes;
|
|
49
|
+
}
|
|
50
|
+
if (contentType !== "application/json")
|
|
51
|
+
throw new ProtocolError("Expected a JSON response");
|
|
52
|
+
let text;
|
|
53
|
+
try {
|
|
54
|
+
text = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
throw new ProtocolError("Invalid UTF-8 response");
|
|
58
|
+
}
|
|
59
|
+
const value = parseJSON(text);
|
|
60
|
+
if (response.status !== operation.status) {
|
|
61
|
+
if (response.status >= 200 && response.status < 300) {
|
|
62
|
+
throw new ProtocolError("Unexpected success status");
|
|
63
|
+
}
|
|
64
|
+
if (!isRecord(value) || Object.keys(value).length !== 1 || !isRecord(value.error)
|
|
65
|
+
|| typeof value.error.code !== "string"
|
|
66
|
+
|| value.error.code.length < 1 || value.error.code.length > 64
|
|
67
|
+
|| typeof value.error.message !== "string" || [...value.error.message].length > 512) {
|
|
68
|
+
throw new ProtocolError("Invalid error envelope");
|
|
69
|
+
}
|
|
70
|
+
const code = /^[A-Za-z0-9._:-]+$/.test(value.error.code) && (!token || !value.error.code.includes(token))
|
|
71
|
+
? value.error.code : "remote_error";
|
|
72
|
+
const streamEnabled = operation.path.startsWith("/v3/timeline/") && Object.hasOwn(value.error, "stream");
|
|
73
|
+
const stream = streamEnabled ? streamDiagnostics(value.error.stream, token) : undefined;
|
|
74
|
+
const errorFields = streamEnabled ? Object.fromEntries(Object.entries(value.error).filter(([key]) => key !== "stream")) : value.error;
|
|
75
|
+
const continuation = operation.path.startsWith("/v3/oauth/") || operation.path.startsWith("/v3/encryption/") || operation.path === "/v3/reliability/quiesce";
|
|
76
|
+
const bodyDiagnostics = { ...errorDiagnostics(errorFields, operation.path.startsWith("/v2/identity/") || continuation, token, operation.path.startsWith("/v3/")), ...(stream ? { stream } : {}) };
|
|
77
|
+
const requestId = response.headers.get("x-agentim-request-id");
|
|
78
|
+
const headerRetry = retryAfterMs(response.headers.get("retry-after"));
|
|
79
|
+
if (headerRetry !== undefined)
|
|
80
|
+
Object.assign(bodyDiagnostics, { retryAfterMs: Math.max(headerRetry, bodyDiagnostics.retryAfterMs ?? 0) });
|
|
81
|
+
const diagnostics = !bodyDiagnostics.requestId && requestId && (!token || !requestId.includes(token)) && /^[a-f0-9]{32}$/.test(requestId)
|
|
82
|
+
? { ...bodyDiagnostics, requestId } : bodyDiagnostics;
|
|
83
|
+
// A daemon may reflect input in its message; retain only bounded status/code.
|
|
84
|
+
const ErrorClass = response.status === 401 ? AuthenticationError : OperationError;
|
|
85
|
+
throw new ErrorClass(response.status, code, `Local API rejected request (HTTP ${response.status})`, diagnostics);
|
|
86
|
+
}
|
|
87
|
+
if (operation.response === null)
|
|
88
|
+
throw new ProtocolError("Missing response schema");
|
|
89
|
+
const issue = schemaIssue(value, operation.response);
|
|
90
|
+
if (issue)
|
|
91
|
+
throw new ProtocolError(`Response does not match the local API contract: ${issue}`);
|
|
92
|
+
// Narrow only after checking the canonical operation response at the boundary.
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ProtocolError } from "../../api/errors.js";
|
|
2
|
+
/** Honor either standard seconds or an HTTP date without retaining header text. */
|
|
3
|
+
export function retryAfterMs(header) {
|
|
4
|
+
if (header === null)
|
|
5
|
+
return undefined;
|
|
6
|
+
const value = header.trim();
|
|
7
|
+
let delay;
|
|
8
|
+
if (/^\d{1,8}$/.test(value))
|
|
9
|
+
delay = Number(value) * 1000;
|
|
10
|
+
else {
|
|
11
|
+
if (!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{2} [A-Za-z]{3} \d{4} \d{2}:\d{2}:\d{2} GMT$/.test(value))
|
|
12
|
+
throw new ProtocolError("Invalid retry delay");
|
|
13
|
+
const instant = Date.parse(value);
|
|
14
|
+
if (!Number.isFinite(instant))
|
|
15
|
+
throw new ProtocolError("Invalid retry delay");
|
|
16
|
+
delay = Math.max(0, Math.ceil(instant - Date.now()));
|
|
17
|
+
}
|
|
18
|
+
if (!Number.isSafeInteger(delay) || delay < 0 || delay > 86400000)
|
|
19
|
+
throw new ProtocolError("Retry delay exceeds the supported budget");
|
|
20
|
+
return delay;
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ProtocolError } from "../../api/errors.js";
|
|
2
|
+
import { operationFor } from "../protocol/registry.js";
|
|
3
|
+
import { schemaIssue } from "../protocol/schema.js";
|
|
4
|
+
/** Only a v3 error may carry canonical stream evidence; arbitrary error payloads stay rejected. */
|
|
5
|
+
export function streamDiagnostics(value, token) {
|
|
6
|
+
const schema = operationFor("readTimelineStream").response;
|
|
7
|
+
if (!schema || schemaIssue(value, schema) || containsSecret(value, token))
|
|
8
|
+
throw new ProtocolError("Invalid stream error evidence");
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
function containsSecret(value, token) {
|
|
12
|
+
if (typeof value === "string")
|
|
13
|
+
return Boolean(token) && value.includes(token);
|
|
14
|
+
if (Array.isArray(value))
|
|
15
|
+
return value.some(field => containsSecret(field, token));
|
|
16
|
+
if (value !== null && typeof value === "object")
|
|
17
|
+
return Object.values(value).some(field => containsSecret(field, token));
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentxgo",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=24.22.2 <25"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"agentxgo-bot-host": "./dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"release.json"
|
|
15
|
+
],
|
|
16
|
+
"bundledDependencies": [
|
|
17
|
+
"@agent-stack/contracts",
|
|
18
|
+
"@agent-stack/runtime-contracts",
|
|
19
|
+
"@agent-stack/bridge-client",
|
|
20
|
+
"@agent-stack/bot-host-journal",
|
|
21
|
+
"@agent-stack/adapter-agentim",
|
|
22
|
+
"@agentims/sdk",
|
|
23
|
+
"@agentims/adapter",
|
|
24
|
+
"@agentims/runtime"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@agent-stack/contracts": "0.2.2",
|
|
28
|
+
"@agent-stack/runtime-contracts": "0.1.0",
|
|
29
|
+
"@agent-stack/bridge-client": "0.1.0",
|
|
30
|
+
"@agent-stack/bot-host-journal": "0.1.0",
|
|
31
|
+
"@agent-stack/adapter-agentim": "0.1.0"
|
|
32
|
+
}
|
|
33
|
+
}
|