@north-light/cli 0.3.561 → 0.3.563
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/dist/api/client.d.ts +27 -4
- package/dist/api/client.js +3 -3
- package/dist/api/contract.d.ts +1 -1
- package/dist/api/contract.js +1 -1
- package/dist/api/dto/bash-jobs.d.ts +5 -1
- package/dist/api/dto/broker-ops.d.ts +25 -1
- package/dist/api/dto/charges.d.ts +9 -2
- package/dist/api/dto/delivery.d.ts +26 -2
- package/dist/api/dto/execution-start.d.ts +57 -0
- package/dist/api/dto/execution-start.js +0 -0
- package/dist/api/dto/modelauth.d.ts +5 -0
- package/dist/api/dto/node-records.d.ts +16 -0
- package/dist/api/dto/objects.d.ts +1 -1
- package/dist/api/dto/reports.d.ts +0 -3
- package/dist/api/dto/run-events.d.ts +7 -1
- package/dist/api/dto/settings.d.ts +55 -0
- package/dist/api/dto/settings.js +0 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +1 -1
- package/dist/api/routes.d.ts +11 -0
- package/dist/api/routes.js +1 -1
- package/dist/build-root.d.ts +1 -0
- package/dist/build-root.js +1 -1
- package/dist/builtin-memory/crouter-sdk/release-notes.md +4 -0
- package/dist/cli.js +7 -7
- package/dist/clients/attach/chrome/bash-jobs.d.ts +11 -1
- package/dist/clients/attach/chrome/bash-jobs.js +1 -1
- package/dist/clients/attach/chrome/canvas-panels.d.ts +1 -1
- package/dist/clients/attach/chrome/roster.js +6 -4
- package/dist/clients/attach/overlays/auth.js +2 -2
- package/dist/clients/attach/render/chat-view.js +1 -1
- package/dist/clients/attach/viewer.js +550 -567
- package/dist/commands/canvas-config.js +2 -2
- package/dist/commands/canvas-use.js +1 -1
- package/dist/commands/human.js +2 -2
- package/dist/commands/node/bash.js +3 -3
- package/dist/commands/node/create.js +2 -2
- package/dist/commands/person-settings.d.ts +1 -0
- package/dist/commands/person-settings.js +1 -0
- package/dist/commands/pkg/market-manage.d.ts +2 -2
- package/dist/commands/pkg/market-manage.js +1 -1
- package/dist/commands/pkg/plugin-manage.js +13 -13
- package/dist/commands/pkg/shared.js +1 -1
- package/dist/commands/profile/default.js +1 -1
- package/dist/commands/push.js +2 -3
- package/dist/commands/sys/config.js +1 -1
- package/dist/commands/sys/connect.js +1 -1
- package/dist/commands/sys/context/sysprompt.js +2 -2
- package/dist/commands/sys/doctor.js +1 -1
- package/dist/commands/sys/join.js +1 -1
- package/dist/commands/sys/panels/broker-limits-panel.js +1 -1
- package/dist/commands/sys/panels/keybindings-panel.js +1 -1
- package/dist/commands/sys/panels/models-panel.d.ts +8 -2
- package/dist/commands/sys/panels/models-panel.js +1 -1
- package/dist/commands/sys/panels/prefs-panel.d.ts +1 -0
- package/dist/commands/sys/panels/prefs-panel.js +1 -1
- package/dist/commands/sys/panels/profiles-panel.js +1 -1
- package/dist/commands/sys/panels/provider-panel.d.ts +4 -0
- package/dist/commands/sys/panels/provider-panel.js +1 -1
- package/dist/commands/sys/provider-login.js +5 -5
- package/dist/commands/sys/setup-core.js +3 -3
- package/dist/commands/sys/setup-settings-runner.js +1 -1
- package/dist/commands/sys/spend.js +3 -3
- package/dist/commands/sys/update.js +1 -1
- package/dist/core/auth-file.d.ts +11 -19
- package/dist/core/auth-file.js +1 -2
- package/dist/core/auto-update.d.ts +1 -1
- package/dist/core/auto-update.js +4 -4
- package/dist/core/bash-jobs.d.ts +29 -71
- package/dist/core/bash-jobs.js +9 -10
- package/dist/core/blobs/directory.d.ts +3 -0
- package/dist/core/blobs/directory.js +1 -0
- package/dist/core/blobs/fault.d.ts +3 -0
- package/dist/core/blobs/fault.js +1 -0
- package/dist/core/blobs/index.d.ts +21 -0
- package/dist/core/blobs/index.js +1 -0
- package/dist/core/blobs/r2.d.ts +9 -0
- package/dist/core/blobs/r2.js +4 -0
- package/dist/core/bootstrap.d.ts +1 -1
- package/dist/core/bootstrap.js +2 -2
- package/dist/core/canvas/canvas.d.ts +9 -7
- package/dist/core/canvas/canvas.js +8 -8
- package/dist/core/canvas/crons.d.ts +3 -2
- package/dist/core/canvas/crons.js +3 -3
- package/dist/core/canvas/daemon-owner.d.ts +5 -0
- package/dist/core/canvas/daemon-owner.js +1 -1
- package/dist/core/canvas/db.d.ts +10 -9
- package/dist/core/canvas/db.js +4 -4
- package/dist/core/canvas/executions.d.ts +100 -4
- package/dist/core/canvas/executions.js +1 -1
- package/dist/core/canvas/export-sqlite.js +1 -1
- package/dist/core/canvas/focuses.d.ts +4 -0
- package/dist/core/canvas/focuses.js +1 -1
- package/dist/core/canvas/history.js +9 -9
- package/dist/core/canvas/managed-worktree-sweep-candidates.d.ts +2 -1
- package/dist/core/canvas/managed-worktree-sweep-candidates.js +3 -2
- package/dist/core/canvas/node-tokens.d.ts +1 -4
- package/dist/core/canvas/node-tokens.js +3 -3
- package/dist/core/canvas/paths.d.ts +0 -1
- package/dist/core/canvas/paths.js +1 -1
- package/dist/core/canvas/person-state.d.ts +26 -0
- package/dist/core/canvas/person-state.js +1 -0
- package/dist/core/canvas/person.d.ts +3 -10
- package/dist/core/canvas/person.js +7 -7
- package/dist/core/canvas/reconciler-leases.d.ts +12 -0
- package/dist/core/canvas/reconciler-leases.js +8 -0
- package/dist/core/canvas/recovery.d.ts +4 -0
- package/dist/core/canvas/recovery.js +1 -1
- package/dist/core/canvas/schema-pg/003-fleet-removals.sql +1 -1
- package/dist/core/canvas/schema-pg/005-fleet-blobs.sql +13 -0
- package/dist/core/canvas/schema-pg/006-job-rows.sql +20 -0
- package/dist/core/canvas/schema-pg/007-ledger-check.sql +117 -0
- package/dist/core/canvas/schema-version.d.ts +1 -1
- package/dist/core/canvas/schema-version.js +1 -1
- package/dist/core/canvas/sessions.d.ts +8 -11
- package/dist/core/canvas/sessions.js +1 -4
- package/dist/core/canvas/tree.d.ts +4 -2
- package/dist/core/canvas/tree.js +6 -6
- package/dist/core/canvas/types.d.ts +7 -0
- package/dist/core/command-hooks/transport/exec-lifecycle.js +1 -1
- package/dist/core/command-plugins/bundle.d.ts +1 -1
- package/dist/core/command-plugins/bundle.js +1 -1
- package/dist/core/command-plugins/compose.d.ts +1 -1
- package/dist/core/command-plugins/discovery.d.ts +0 -1
- package/dist/core/command-plugins/discovery.js +1 -1
- package/dist/core/command-plugins/help-addenda.js +1 -1
- package/dist/core/command-plugins/presence.d.ts +2 -0
- package/dist/core/command-plugins/presence.js +1 -1
- package/dist/core/config.d.ts +16 -15
- package/dist/core/config.js +1 -1
- package/dist/core/conversation-store/client-worker.js +1 -1
- package/dist/core/conversation-store/client.js +2 -2
- package/dist/core/conversation-store/index.d.ts +9 -11
- package/dist/core/conversation-store/index.js +1 -1
- package/dist/core/conversation-store/patch.js +1 -1
- package/dist/core/conversation-store/row-store.d.ts +14 -0
- package/dist/core/conversation-store/row-store.js +13 -0
- package/dist/core/directory/join.d.ts +5 -3
- package/dist/core/directory/join.js +1 -1
- package/dist/core/env-name.d.ts +1 -0
- package/dist/core/env-name.js +1 -1
- package/dist/core/environment-recipe.d.ts +15 -0
- package/dist/core/environment-recipe.js +1 -0
- package/dist/core/environments.js +1 -1
- package/dist/core/events/emit.js +2 -2
- package/dist/core/events/run-event-chunks.d.ts +25 -0
- package/dist/core/events/run-event-chunks.js +5 -0
- package/dist/core/feed/messages.js +5 -5
- package/dist/core/grants/mirror.d.ts +15 -0
- package/dist/core/grants/mirror.js +15 -3
- package/dist/core/grants/on-sync.d.ts +9 -5
- package/dist/core/grants/on-sync.js +1 -1
- package/dist/core/grants/remove.d.ts +1 -6
- package/dist/core/grants/remove.js +1 -1
- package/dist/core/grants/sync.js +1 -1
- package/dist/core/grants/watch.d.ts +15 -9
- package/dist/core/grants/watch.js +1 -1
- package/dist/core/graph/custom.js +8 -8
- package/dist/core/graph/jobs.d.ts +83 -5
- package/dist/core/graph/jobs.js +11 -2
- package/dist/core/graph/kinds/job.js +2 -2
- package/dist/core/graph/names.js +7 -7
- package/dist/core/graph/objects.d.ts +5 -1
- package/dist/core/graph/objects.js +11 -11
- package/dist/core/graph/reader.d.ts +3 -0
- package/dist/core/graph/reader.js +3 -3
- package/dist/core/graph/repo-sync/identity.d.ts +3 -1
- package/dist/core/graph/repo-sync/identity.js +1 -1
- package/dist/core/graph/repo-sync/repos.d.ts +1 -1
- package/dist/core/graph/repo-sync/repos.js +2 -2
- package/dist/core/graph/repo-sync/sync.js +2 -2
- package/dist/core/installed-plugins.js +1 -1
- package/dist/core/keybindings/persistence.d.ts +1 -1
- package/dist/core/keybindings/persistence.js +1 -1
- package/dist/core/layout-migrate/loose-keys.d.ts +1 -1
- package/dist/core/layout-migrate/loose-keys.js +1 -1
- package/dist/core/ledger/account.d.ts +12 -0
- package/dist/core/ledger/account.js +2 -0
- package/dist/core/ledger/charges.d.ts +2 -2
- package/dist/core/ledger/charges.js +1 -1
- package/dist/core/ledger/check.d.ts +5 -1
- package/dist/core/ledger/check.js +1 -7
- package/dist/core/ledger/chunks.d.ts +8 -0
- package/dist/core/ledger/chunks.js +2 -0
- package/dist/core/ledger/index.d.ts +2 -1
- package/dist/core/ledger/index.js +1 -1
- package/dist/core/ledger/infra-allowance.d.ts +9 -0
- package/dist/core/ledger/infra-allowance.js +1 -0
- package/dist/core/ledger/limits.js +3 -3
- package/dist/core/ledger/payer.d.ts +1 -1
- package/dist/core/ledger/payer.js +1 -1
- package/dist/core/ledger/read.d.ts +14 -4
- package/dist/core/ledger/read.js +2 -3
- package/dist/core/ledger/totals.d.ts +5 -16
- package/dist/core/ledger/totals.js +4 -4
- package/dist/core/ledger/types.d.ts +12 -3
- package/dist/core/llm/run.js +2 -2
- package/dist/core/managed-providers.d.ts +72 -0
- package/dist/core/managed-providers.js +1 -0
- package/dist/core/model-auth/api-credential-store.d.ts +10 -0
- package/dist/core/model-auth/api-credential-store.js +1 -0
- package/dist/core/model-auth/daemon-login.d.ts +1 -1
- package/dist/core/model-auth/daemon-login.js +1 -1
- package/dist/core/model-auth/flows.d.ts +5 -4
- package/dist/core/model-auth/flows.js +1 -1
- package/dist/core/model-auth/handoff-jti.d.ts +3 -4
- package/dist/core/model-auth/handoff-jti.js +1 -1
- package/dist/core/model-auth/readiness.js +1 -1
- package/dist/core/model-config.d.ts +1 -1
- package/dist/core/model-config.js +1 -1
- package/dist/core/model-routes-pool.d.ts +14 -0
- package/dist/core/model-routes-pool.js +1 -0
- package/dist/core/model-routes.d.ts +11 -16
- package/dist/core/model-routes.js +1 -1
- package/dist/core/peer/ingest.d.ts +2 -0
- package/dist/core/peer/ingest.js +1 -1
- package/dist/core/peer/stubs.d.ts +8 -0
- package/dist/core/peer/stubs.js +1 -1
- package/dist/core/permissions/evaluator.d.ts +7 -2
- package/dist/core/permissions/evaluator.js +2 -2
- package/dist/core/plugin-env.js +1 -1
- package/dist/core/pool-credential-store.d.ts +2 -5
- package/dist/core/pool-credential-store.js +1 -1
- package/dist/core/profiles/app-env-store.d.ts +5 -5
- package/dist/core/profiles/app-env-store.js +1 -2
- package/dist/core/profiles/default-binding.d.ts +5 -5
- package/dist/core/profiles/default-binding.js +1 -1
- package/dist/core/profiles/env-store.d.ts +10 -21
- package/dist/core/profiles/env-store.js +1 -2
- package/dist/core/profiles/manifest.d.ts +14 -18
- package/dist/core/profiles/manifest.js +1 -1
- package/dist/core/profiles/relocate.js +1 -1
- package/dist/core/profiles/select.js +21 -21
- package/dist/core/provider-credential.d.ts +1 -1
- package/dist/core/provider-credential.js +1 -1
- package/dist/core/provider-management.d.ts +3 -4
- package/dist/core/provider-management.js +1 -1
- package/dist/core/providers/bundles.js +2 -2
- package/dist/core/providers/call.d.ts +3 -34
- package/dist/core/providers/description.d.ts +34 -0
- package/dist/core/providers/description.js +0 -0
- package/dist/core/providers/token-cache.d.ts +14 -14
- package/dist/core/providers/token-cache.js +1 -1
- package/dist/core/review/companion.js +1 -1
- package/dist/core/runs/activity.d.ts +1 -1
- package/dist/core/runs/activity.js +1 -1
- package/dist/core/runs/events.d.ts +7 -5
- package/dist/core/runs/events.js +2 -6
- package/dist/core/runs/operations.d.ts +1 -1
- package/dist/core/runs/operations.js +6 -6
- package/dist/core/runtime/bearings.js +1 -1
- package/dist/core/runtime/broker/attachments-fetch.d.ts +5 -0
- package/dist/core/runtime/broker/attachments-fetch.js +1 -0
- package/dist/core/runtime/broker/bash-job-launch.d.ts +4 -2
- package/dist/core/runtime/broker/bash-job-launch.js +1 -1
- package/dist/core/runtime/broker/boot-state.d.ts +9 -0
- package/dist/core/runtime/broker/boot-state.js +1 -0
- package/dist/core/runtime/broker/cli-relay.d.ts +2 -1
- package/dist/core/runtime/broker/cli-relay.js +1 -1
- package/dist/core/runtime/broker/client-registry.d.ts +3 -3
- package/dist/core/runtime/broker/daemon-ops.d.ts +10 -1
- package/dist/core/runtime/broker/daemon-ops.js +1 -1
- package/dist/core/runtime/broker/fault-retry.d.ts +2 -0
- package/dist/core/runtime/broker/fault-retry.js +1 -1
- package/dist/core/runtime/broker/frame-engine-control.js +1 -1
- package/dist/core/runtime/broker/held-deferred-inbox.d.ts +3 -0
- package/dist/core/runtime/broker/held-deferred-inbox.js +1 -1
- package/dist/core/runtime/broker/job-reporter.d.ts +18 -0
- package/dist/core/runtime/broker/job-reporter.js +2 -0
- package/dist/core/runtime/broker/model-adapter.d.ts +3 -0
- package/dist/core/runtime/broker/model-adapter.js +3 -2
- package/dist/core/runtime/broker/signal-stream.js +1 -1
- package/dist/core/runtime/broker/spilled-body.d.ts +5 -0
- package/dist/core/runtime/broker/spilled-body.js +1 -0
- package/dist/core/runtime/broker/summaries-post.d.ts +5 -0
- package/dist/core/runtime/broker/summaries-post.js +1 -0
- package/dist/core/runtime/broker/tool-groups.d.ts +3 -0
- package/dist/core/runtime/broker/tool-groups.js +1 -1
- package/dist/core/runtime/broker/turn-replies.d.ts +1 -0
- package/dist/core/runtime/broker/turn-replies.js +1 -1
- package/dist/core/runtime/broker-persona-guidance.js +2 -2
- package/dist/core/runtime/broker.js +1 -1
- package/dist/core/runtime/deliver-live.js +1 -1
- package/dist/core/runtime/first-boot-rows.d.ts +8 -0
- package/dist/core/runtime/first-boot-rows.js +2 -0
- package/dist/core/runtime/fleet.d.ts +13 -12
- package/dist/core/runtime/front-door-login.js +1 -1
- package/dist/core/runtime/front-door.js +6 -6
- package/dist/core/runtime/headless-pi.js +1 -1
- package/dist/core/runtime/host.d.ts +14 -3
- package/dist/core/runtime/host.js +3 -3
- package/dist/core/runtime/invocation.d.ts +6 -0
- package/dist/core/runtime/kickoff.d.ts +2 -14
- package/dist/core/runtime/kickoff.js +17 -19
- package/dist/core/runtime/launch-config-worker.js +1 -1
- package/dist/core/runtime/launch.js +2 -2
- package/dist/core/runtime/model-registry.js +1 -1
- package/dist/core/runtime/node-read.d.ts +4 -6
- package/dist/core/runtime/node-read.js +3 -3
- package/dist/core/runtime/nodes.js +1 -1
- package/dist/core/runtime/outcome-document.d.ts +0 -1
- package/dist/core/runtime/outcome-document.js +1 -1
- package/dist/core/runtime/output-result.d.ts +15 -0
- package/dist/core/runtime/output-result.js +5 -0
- package/dist/core/runtime/placement.d.ts +17 -1
- package/dist/core/runtime/placement.js +1 -1
- package/dist/core/runtime/provider-credential-gate.d.ts +6 -2
- package/dist/core/runtime/provider-credential-gate.js +2 -2
- package/dist/core/runtime/recovery-hold.d.ts +21 -2
- package/dist/core/runtime/recovery-hold.js +2 -1
- package/dist/core/runtime/recycle.js +1 -1
- package/dist/core/runtime/reset.js +1 -1
- package/dist/core/runtime/revive.d.ts +2 -2
- package/dist/core/runtime/revive.js +2 -2
- package/dist/core/runtime/runner/blaxel/client.d.ts +81 -0
- package/dist/core/runtime/runner/blaxel/client.js +1 -0
- package/dist/core/runtime/runner/blaxel/image-build.d.ts +74 -0
- package/dist/core/runtime/runner/blaxel/image-build.js +5 -0
- package/dist/core/runtime/runner/blaxel/runner.d.ts +41 -0
- package/dist/core/runtime/runner/blaxel/runner.js +3 -0
- package/dist/core/runtime/runner/index.d.ts +8 -0
- package/dist/core/runtime/runner/index.js +1 -0
- package/dist/core/runtime/runner/process.d.ts +11 -0
- package/dist/core/runtime/runner/process.js +1 -0
- package/dist/core/runtime/runner/types.d.ts +95 -0
- package/dist/core/runtime/runner/types.js +0 -0
- package/dist/core/runtime/situational-context.d.ts +3 -6
- package/dist/core/runtime/situational-context.js +2 -2
- package/dist/core/runtime/situational-live.js +1 -1
- package/dist/core/runtime/spawn-env-rows.d.ts +5 -0
- package/dist/core/runtime/spawn-env-rows.js +1 -0
- package/dist/core/runtime/spawn-env.d.ts +4 -18
- package/dist/core/runtime/spawn-env.js +1 -1
- package/dist/core/runtime/spawn.js +2 -2
- package/dist/core/runtime/stop-guard.d.ts +1 -1
- package/dist/core/runtime/stop-guard.js +2 -8
- package/dist/core/runtime/structured-output.d.ts +0 -67
- package/dist/core/runtime/structured-output.js +3 -8
- package/dist/core/runtime/tmux-driver.d.ts +8 -0
- package/dist/core/runtime/tmux-driver.js +6 -6
- package/dist/core/runtime/view-socket.d.ts +20 -0
- package/dist/core/runtime/view-socket.js +3 -1
- package/dist/core/runtime/warm-pool.d.ts +13 -1
- package/dist/core/runtime/warm-pool.js +1 -1
- package/dist/core/scoped-state/legacy-profiles.d.ts +11 -0
- package/dist/core/scoped-state/legacy-profiles.js +1 -0
- package/dist/core/scoped-state/materialized-plugins.d.ts +18 -0
- package/dist/core/scoped-state/materialized-plugins.js +1 -0
- package/dist/core/scoped-state/migrate.d.ts +8 -1
- package/dist/core/scoped-state/migrate.js +3 -3
- package/dist/core/scoped-state/person-rows.d.ts +10 -0
- package/dist/core/scoped-state/person-rows.js +6 -0
- package/dist/core/scoped-state/person-store.d.ts +72 -0
- package/dist/core/scoped-state/person-store.js +1 -0
- package/dist/core/secrets/blaxel-launch.d.ts +24 -0
- package/dist/core/secrets/blaxel-launch.js +4 -0
- package/dist/core/secrets/blaxel-register.d.ts +2 -0
- package/dist/core/secrets/blaxel-register.js +1 -0
- package/dist/core/secrets/env-rows.d.ts +17 -0
- package/dist/core/secrets/env-rows.js +4 -0
- package/dist/core/secrets/environment-owner.d.ts +8 -0
- package/dist/core/secrets/environment-owner.js +1 -0
- package/dist/core/secrets/environment-secrets.d.ts +14 -0
- package/dist/core/secrets/environment-secrets.js +1 -0
- package/dist/core/secrets/index.d.ts +2 -0
- package/dist/core/secrets/index.js +1 -0
- package/dist/core/secrets/key.d.ts +3 -0
- package/dist/core/secrets/key.js +2 -0
- package/dist/core/secrets/seal.d.ts +18 -0
- package/dist/core/secrets/seal.js +1 -0
- package/dist/core/spaces/mounts.d.ts +1 -1
- package/dist/core/spaces/mounts.js +1 -1
- package/dist/core/spaces/process.d.ts +1 -1
- package/dist/core/spaces/stop.d.ts +7 -5
- package/dist/core/spaces/stop.js +2 -2
- package/dist/core/spaces/users.d.ts +2 -1
- package/dist/core/spaces/users.js +1 -1
- package/dist/core/storage/attachments.d.ts +11 -8
- package/dist/core/storage/attachments.js +1 -1
- package/dist/core/storage/tables.d.ts +4 -0
- package/dist/core/storage/tables.js +3 -3
- package/dist/core/subscription-state.d.ts +34 -72
- package/dist/core/subscription-state.js +1 -4
- package/dist/core/substrate/delivery/plan.js +1 -1
- package/dist/core/user-settings.js +1 -1
- package/dist/daemon/api/app-listener.js +10 -10
- package/dist/daemon/api/auth/person-bearer.d.ts +14 -0
- package/dist/daemon/api/auth/person-bearer.js +1 -0
- package/dist/daemon/api/bridge.js +4 -4
- package/dist/daemon/api/document-listener.js +3 -3
- package/dist/daemon/api/environment-of.d.ts +18 -0
- package/dist/daemon/api/environment-of.js +5 -0
- package/dist/daemon/api/handlers/analytics.js +1 -1
- package/dist/daemon/api/handlers/app-profiles.d.ts +2 -2
- package/dist/daemon/api/handlers/app-profiles.js +1 -1
- package/dist/daemon/api/handlers/bash-jobs.js +1 -1
- package/dist/daemon/api/handlers/bash.js +1 -1
- package/dist/daemon/api/handlers/broker-ops.d.ts +3 -0
- package/dist/daemon/api/handlers/broker-ops.js +1 -1
- package/dist/daemon/api/handlers/broker-recovery.js +1 -1
- package/dist/daemon/api/handlers/broker-signals.d.ts +0 -3
- package/dist/daemon/api/handlers/broker-signals.js +2 -2
- package/dist/daemon/api/handlers/canvas.js +4 -4
- package/dist/daemon/api/handlers/charges.d.ts +1 -1
- package/dist/daemon/api/handlers/charges.js +1 -1
- package/dist/daemon/api/handlers/conversations.d.ts +2 -0
- package/dist/daemon/api/handlers/conversations.js +3 -0
- package/dist/daemon/api/handlers/crons.js +1 -1
- package/dist/daemon/api/handlers/daemon.js +1 -1
- package/dist/daemon/api/handlers/delivery.d.ts +1 -1
- package/dist/daemon/api/handlers/delivery.js +1 -1
- package/dist/daemon/api/handlers/docs.js +1 -1
- package/dist/daemon/api/handlers/exec.js +1 -1
- package/dist/daemon/api/handlers/execution-start.d.ts +2 -0
- package/dist/daemon/api/handlers/execution-start.js +2 -0
- package/dist/daemon/api/handlers/files.js +1 -1
- package/dist/daemon/api/handlers/git-credential.d.ts +11 -0
- package/dist/daemon/api/handlers/git-credential.js +1 -0
- package/dist/daemon/api/handlers/hook-exec.d.ts +1 -1
- package/dist/daemon/api/handlers/hook-exec.js +1 -1
- package/dist/daemon/api/handlers/human-requests.js +1 -1
- package/dist/daemon/api/handlers/inbox.js +1 -1
- package/dist/daemon/api/handlers/messages.js +1 -1
- package/dist/daemon/api/handlers/model-config.js +1 -1
- package/dist/daemon/api/handlers/modelauth.d.ts +1 -1
- package/dist/daemon/api/handlers/modelauth.js +1 -1
- package/dist/daemon/api/handlers/node-events.d.ts +6 -0
- package/dist/daemon/api/handlers/node-events.js +3 -3
- package/dist/daemon/api/handlers/node-outcomes.js +1 -1
- package/dist/daemon/api/handlers/node-records.js +3 -2
- package/dist/daemon/api/handlers/nodes.js +1 -1
- package/dist/daemon/api/handlers/objects.js +3 -3
- package/dist/daemon/api/handlers/profiles.js +1 -1
- package/dist/daemon/api/handlers/providers.js +1 -1
- package/dist/daemon/api/handlers/reports.js +9 -13
- package/dist/daemon/api/handlers/reviews.js +1 -1
- package/dist/daemon/api/handlers/runs.js +1 -1
- package/dist/daemon/api/handlers/settings.d.ts +2 -0
- package/dist/daemon/api/handlers/settings.js +1 -0
- package/dist/daemon/api/handlers/structured-requests.js +1 -1
- package/dist/daemon/api/handlers/vendor-status.d.ts +1 -1
- package/dist/daemon/api/handlers/vendor-status.js +1 -1
- package/dist/daemon/api/handlers/worktree.js +1 -1
- package/dist/daemon/api/map.d.ts +2 -2
- package/dist/daemon/api/map.js +2 -2
- package/dist/daemon/api/operations.js +1 -1
- package/dist/daemon/api/reader.d.ts +8 -1
- package/dist/daemon/api/reader.js +1 -1
- package/dist/daemon/api/router.d.ts +4 -2
- package/dist/daemon/api/router.js +1 -1
- package/dist/daemon/api/server.d.ts +15 -3
- package/dist/daemon/api/server.js +1 -1
- package/dist/daemon/api/vendor-signin.d.ts +2 -1
- package/dist/daemon/api/vendor-signin.js +19 -19
- package/dist/daemon/api/viewer-presence.d.ts +20 -6
- package/dist/daemon/api/viewer-presence.js +2 -1
- package/dist/daemon/boot-settings.d.ts +3 -0
- package/dist/daemon/boot-settings.js +1 -0
- package/dist/daemon/broker-signals/bus.d.ts +48 -11
- package/dist/daemon/broker-signals/bus.js +1 -1
- package/dist/daemon/cron/armed-context.js +1 -1
- package/dist/daemon/cron/lease-recovery.js +1 -1
- package/dist/daemon/cron/live-runs.d.ts +6 -0
- package/dist/daemon/cron/live-runs.js +1 -1
- package/dist/daemon/cron/run-socket.js +1 -1
- package/dist/daemon/cron-run.js +2 -2
- package/dist/daemon/crtrd-cli.js +1 -1
- package/dist/daemon/crtrd.d.ts +10 -0
- package/dist/daemon/crtrd.js +18 -17
- package/dist/daemon/delivery/run-delivery.d.ts +1 -1
- package/dist/daemon/delivery/run-delivery.js +1 -1
- package/dist/daemon/due-sources.d.ts +1 -1
- package/dist/daemon/due-sources.js +1 -1
- package/dist/daemon/due.js +7 -6
- package/dist/daemon/fleet.d.ts +6 -6
- package/dist/daemon/fleet.js +9 -9
- package/dist/daemon/park-activity.d.ts +2 -1
- package/dist/daemon/park-activity.js +1 -1
- package/dist/daemon/park-pending.d.ts +20 -13
- package/dist/daemon/park-pending.js +3 -1
- package/dist/daemon/profile-delete.js +1 -1
- package/dist/daemon/reconcilers/bash-deadline.d.ts +15 -10
- package/dist/daemon/reconcilers/bash-deadline.js +1 -3
- package/dist/daemon/reconcilers/broker-supervision.d.ts +13 -3
- package/dist/daemon/reconcilers/broker-supervision.js +4 -4
- package/dist/daemon/reconcilers/cron-lane.d.ts +0 -1
- package/dist/daemon/reconcilers/cron-lane.js +1 -1
- package/dist/daemon/reconcilers/fault-retry-backstop.d.ts +2 -9
- package/dist/daemon/reconcilers/fault-retry-backstop.js +1 -1
- package/dist/daemon/reconcilers/grant-effects.d.ts +8 -0
- package/dist/daemon/reconcilers/grant-effects.js +1 -0
- package/dist/daemon/reconcilers/grove-instance-sweep.d.ts +1 -3
- package/dist/daemon/reconcilers/grove-instance-sweep.js +1 -1
- package/dist/daemon/reconcilers/ledger-r2.d.ts +27 -0
- package/dist/daemon/reconcilers/ledger-r2.js +7 -0
- package/dist/daemon/reconcilers/ledger-sandbox.d.ts +55 -0
- package/dist/daemon/reconcilers/ledger-sandbox.js +9 -0
- package/dist/daemon/reconcilers/ledger-storage.d.ts +22 -0
- package/dist/daemon/reconcilers/ledger-storage.js +5 -0
- package/dist/daemon/reconcilers/live-obligation.d.ts +3 -2
- package/dist/daemon/reconcilers/live-obligation.js +1 -1
- package/dist/daemon/reconcilers/managed-worktree-sweep.d.ts +0 -5
- package/dist/daemon/reconcilers/managed-worktree-sweep.js +1 -1
- package/dist/daemon/reconcilers/node-deadline.d.ts +2 -1
- package/dist/daemon/reconcilers/node-deadline.js +1 -1
- package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.d.ts +1 -2
- package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.js +1 -1
- package/dist/daemon/reconcilers/node-lifecycle/remote-wake.d.ts +31 -0
- package/dist/daemon/reconcilers/node-lifecycle/remote-wake.js +1 -0
- package/dist/daemon/reconcilers/node-lifecycle/requested-stops.d.ts +5 -0
- package/dist/daemon/reconcilers/node-lifecycle/requested-stops.js +2 -0
- package/dist/daemon/reconcilers/node-lifecycle/tick.js +1 -1
- package/dist/daemon/reconcilers/pending-review-submit.js +1 -1
- package/dist/daemon/reconcilers/recipe-image.d.ts +49 -0
- package/dist/daemon/reconcilers/recipe-image.js +7 -0
- package/dist/daemon/reconcilers/row-claim.d.ts +19 -0
- package/dist/daemon/reconcilers/row-claim.js +2 -0
- package/dist/daemon/reconcilers/storage-due-work.d.ts +18 -3
- package/dist/daemon/reconcilers/storage-due-work.js +2 -1
- package/dist/daemon/reconcilers/storage-maintenance.d.ts +5 -13
- package/dist/daemon/reconcilers/storage-maintenance.js +1 -1
- package/dist/daemon/reconcilers/structured-request-lane.js +1 -1
- package/dist/daemon/reconcilers/throttled-lane.d.ts +11 -0
- package/dist/daemon/reconcilers/throttled-lane.js +1 -0
- package/dist/daemon/review/finish.js +1 -1
- package/dist/daemon/run-notices.d.ts +3 -0
- package/dist/daemon/run-notices.js +1 -1
- package/dist/daemon/runs/append-section.d.ts +4 -1
- package/dist/daemon/runs/append-section.js +2 -2
- package/dist/daemon/runs/observer.d.ts +3 -2
- package/dist/daemon/runs/observer.js +3 -2
- package/dist/daemon/runs/view-transport.d.ts +19 -0
- package/dist/daemon/runs/view-transport.js +1 -0
- package/dist/daemon/structured-requests/boot.d.ts +2 -1
- package/dist/daemon/structured-requests/boot.js +1 -1
- package/dist/daemon/structured-requests/effects.d.ts +4 -3
- package/dist/daemon/structured-requests/effects.js +1 -1
- package/dist/daemon/structured-requests/notifier.d.ts +2 -0
- package/dist/daemon/structured-requests/notifier.js +1 -1
- package/dist/daemon/structured-requests/sidecar.d.ts +4 -3
- package/dist/daemon/structured-requests/sidecar.js +1 -1
- package/dist/launcher/validate.js +1 -1
- package/dist/migrations/004-canvas-documents/index.js +2 -2
- package/dist/pi-extensions/broker-local.d.ts +3 -3
- package/dist/pi-extensions/broker-local.js +1 -2
- package/dist/pi-extensions/canvas-bash-valve.js +6 -6
- package/dist/pi-extensions/canvas-context-intro.js +2 -2
- package/dist/pi-extensions/canvas-elapsed.js +2 -2
- package/dist/pi-extensions/canvas-goal-capture.js +1 -1
- package/dist/pi-extensions/canvas-inbox-watcher.js +2 -2
- package/dist/pi-extensions/canvas-review-boundary.d.ts +11 -1
- package/dist/pi-extensions/canvas-review-boundary.js +3 -3
- package/dist/pi-extensions/canvas-stophook.js +1 -1
- package/dist/pi-extensions/canvas-structured-output.d.ts +5 -3
- package/dist/pi-extensions/canvas-structured-output.js +6 -11
- package/dist/pi-extensions/canvas-tool-guide.d.ts +9 -2
- package/dist/pi-extensions/canvas-tool-guide.js +6 -6
- package/dist/shared/inbox-entry-body.js +7 -7
- package/dist/types.d.ts +12 -0
- package/docs/sdk/release-notes.md +4 -0
- package/package.json +7 -4
- package/packages/crouter-identity/package.json +1 -1
- package/runtime.lock.json +13 -13
- package/scripts/git-credential-crtr +33 -0
- package/scripts/sandbox-bootstrap.sh +54 -0
- package/scripts/sandbox-start.mjs +320 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.d.ts +0 -78
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.js +0 -1179
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +0 -1406
- package/dist/core/conversation-store/file-store.d.ts +0 -37
- package/dist/core/conversation-store/file-store.js +0 -9
- package/dist/core/conversation-store/listener.d.ts +0 -4
- package/dist/core/conversation-store/listener.js +0 -8
- package/dist/core/scoped-state/profiles.d.ts +0 -27
- package/dist/core/scoped-state/profiles.js +0 -1
- package/dist/core/scoped-state/providers.d.ts +0 -24
- package/dist/core/scoped-state/providers.js +0 -1
- package/dist/core/scoped-state/settings.d.ts +0 -28
- package/dist/core/scoped-state/settings.js +0 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiError } from './errors.js';
|
|
2
|
+
import type { GitCredentialDTO, GitCredentialRequest, StartBundleDTO } from './dto/execution-start.js';
|
|
2
3
|
import type { ChargeListDTO, SpendLimitListDTO, SpendLimitRemovedDTO, SpendLimitSetRequest, LimitDTO } from './dto/charges.js';
|
|
3
4
|
import type { AppLimitsChangeDTO, LimitsDTO, SetAppLimitsRequest } from './dto/limits.js';
|
|
4
5
|
import type { DaemonAdmitDTO, DaemonRestartDTO, DueDTO, HealthDTO, ReadyDTO, MigrateStateDTO, MigrateStateRequest, StatusDTO } from './dto/health.js';
|
|
@@ -8,7 +9,7 @@ import type { NodeOutcomeResponseDTO, OutcomeDeliveryDTO, RegisterOutcomeDeliver
|
|
|
8
9
|
import type { AnalyticsDTO, AnalyticsQuery, MemoryReadsRequestDTO } from './dto/analytics.js';
|
|
9
10
|
import type { NodeEventsQuery } from './dto/node-events.js';
|
|
10
11
|
import type { BrokerSignalLineDTO } from './dto/broker-signals.js';
|
|
11
|
-
import type { NodeLogAppendRequest, NodeLogAppendResultDTO, NodeTelemetryRecordRequest, NodeRecapRecordRequest, NodeMessageBodyDTO, NodePushedFinalRequest, NodePushedFinalResultDTO } from './dto/node-records.js';
|
|
12
|
+
import type { NodeLogAppendRequest, NodeLogAppendResultDTO, NodeTelemetryRecordRequest, NodeSummariesRecordRequest, NodeRecapRecordRequest, NodeMessageBodyDTO, NodeAttachmentsDTO, NodePushedFinalRequest, NodePushedFinalResultDTO } from './dto/node-records.js';
|
|
12
13
|
import type { InterruptResultDTO, MessageResultDTO, SendMessageRequest } from './dto/messages.js';
|
|
13
14
|
import type { CreateStructuredRequest, CreateStructuredRequestResponse, StructuredRequestDTO } from './dto/structured-requests.js';
|
|
14
15
|
import type { PushReportRequest, PushReportResultDTO, ReportDTO, ReportsQuery, SubmitResultDTO, SubmitResultRequest } from './dto/reports.js';
|
|
@@ -24,16 +25,17 @@ import type { BashRunDTO, BashRunParams } from './dto/bash.js';
|
|
|
24
25
|
import type { EdgesDTO, EdgesQuery, ObjectListDTO, ObjectListRequest, ObjectReadDTO, ObjectReadQuery, ObjectSearchDTO, ObjectSearchRequest, UnwatchQuery, UnwatchResultDTO, WatchRequest, WatchResultDTO } from './dto/objects.js';
|
|
25
26
|
import type { DocDeletedDTO, DocEditRequest, DocEditedDTO, DocHistoryDTO, DocHistoryQuery, DocLintDTO, DocLintRequest, DocMoveRequest, DocMovedDTO, DocWriteRequest, DocWrittenDTO, ReconcilePackagesDTO, DocumentAccessDTO } from './dto/docs.js';
|
|
26
27
|
import type { PluginAppTokenDTO, PluginCallHeadersDTO, PluginCallHeadersRequestDTO } from './dto/plugins.js';
|
|
27
|
-
import type { BackgroundedJobDTO, BackgroundedJobRequest, DeliveryDryRunRequest, DeliveryRequest, DeliveryResponse } from './dto/delivery.js';
|
|
28
|
+
import type { BackgroundedJobDTO, BackgroundedJobRequest, JobPatchRequest, JobReportRequest, DeliveryDryRunRequest, DeliveryRequest, DeliveryResponse } from './dto/delivery.js';
|
|
28
29
|
import type { ChatInventoryDTO, ProspectiveChatInventoryDTO, ProspectiveChatInventoryQuery } from './dto/chat-inventory.js';
|
|
29
|
-
import type {
|
|
30
|
+
import type { PersonSettingsDTO, PutPersonSettingsRequest } from './dto/settings.js';
|
|
31
|
+
import type { CredentialRemovalResultDTO, CredentialResultDTO, InstallCredentialRequest, CompleteModelAuthFlowRequest, ModelAuthFlowCompletedDTO, ModelAuthFlowDTO, ModelAuthFlowStartedDTO, ModelAuthListDTO, ModelAuthProviderStatusDTO, PatchManagedAccountRequest, ModelAuthReadinessDTO, ModelAuthReadinessQuery, StartModelAuthFlowRequest } from './dto/modelauth.js';
|
|
30
32
|
import type { CancelReviewRequest, CreateReviewRequest, ListReviewsQuery, ReviewCancelResultDTO, ReviewDocumentBaseDTO, ReviewDTO, ReviewListDTO, ReviewSubmitResultDTO } from './dto/reviews.js';
|
|
31
33
|
import type { CreateReviewCommentRequest, EditReviewCommentRequest, ListReviewCommentsQuery, ReadReviewCommentEventsQuery, ReviewCommentActionRequest, ReviewCommentDetailDTO, ReviewCommentEventsDTO, ReviewCommentForkDTO, ReviewCommentListDTO, ReviewCommentMutationDTO, ReviewCommentRangeBatchRequest, ReviewCommentRangeBatchResultDTO } from './dto/review-comments.js';
|
|
32
34
|
import type { CancelInboxTicketRequest, CanceledTicketResultDTO, InboxListDTO, InboxPageDTO, InboxPageHistoryDTO, PageTicketSummaryDTO, InboxPageResponseDTO, InboxTicketIdDTO, PageFeedbackResolutionDTO, PageResponsesDTO, PageTicketResultDTO, RespondInboxPageRequest } from './dto/inbox.js';
|
|
33
35
|
import type { CreateHumanRequestDTO, CreateHumanRequestRequest, HumanRequestDTO, HumanRequestIdDTO, ReplaceHumanRequestRequest, RespondHumanRequestRequest, SettleHumanRequestRequest, PageComponentListDTO } from './dto/human-requests.js';
|
|
34
36
|
import type { AttentionCountsDTO, AttentionDTO, DashboardDTO, DashboardQuery, HistoryGrepQuery, HistoryGrepResultDTO, HistoryReadQuery, HistoryStatsQuery, HistoryStatsResultDTO, HistoryReadResultDTO, HistorySearchQuery, HistorySearchResultDTO, GraphDTO, PruneRequest, PruneResultDTO, LiveRootsDTO, RosterDTO, SnapshotDTO } from './dto/canvas.js';
|
|
35
37
|
import type { AbandonWorktreeRequest, AbandonWorktreeResultDTO, CloseWorktreeResultDTO, QuarantinedWorktreeDTO, SpaceListDTO } from './dto/worktree.js';
|
|
36
|
-
import type { BrokerExtensionStateDTO, BrokerExecutionRequest, BrokerGeneratedNameRequest, BrokerGeneratedNameResultDTO, BrokerModelCommitRequest, BrokerModelCommitResultDTO, BrokerParkActivityResultDTO, BrokerParkCompleteRequest, BrokerPersonaAckRequest, BrokerPersonaAckResultDTO, BrokerSessionBoundRequest, BrokerSessionBoundResultDTO, BrokerSettleDirective, BrokerSettleRequest, BrokerTelemetryRequest } from './dto/broker-ops.js';
|
|
38
|
+
import type { BrokerExtensionStateDTO, BrokerExecutionRequest, BrokerGeneratedNameRequest, BrokerGoalRequest, BrokerGoalResultDTO, BrokerStructuredRequestDTO, BrokerGeneratedNameResultDTO, BrokerModelCommitRequest, BrokerModelCommitResultDTO, BrokerParkActivityResultDTO, BrokerParkCompleteRequest, BrokerPersonaAckRequest, BrokerPersonaAckResultDTO, BrokerSessionBoundRequest, BrokerSessionBoundResultDTO, BrokerSettleDirective, BrokerSettleRequest, BrokerTelemetryRequest } from './dto/broker-ops.js';
|
|
37
39
|
import type { AcknowledgeMailRequest, AcknowledgeMailResultDTO, ClaimMailRequest, ClaimMailResultDTO } from './dto/mail.js';
|
|
38
40
|
import type { BrokerFaultInputDTO, BrokerFaultRequest, BrokerFaultResultDTO, BrokerProviderRetryRequest, BrokerProviderRetryResultDTO, BrokerTurnRequest, BrokerTurnResultDTO, NodeFaultClearResultDTO, RecoveryStateDTO } from './dto/recovery.js';
|
|
39
41
|
export interface CrtrClientOptions {
|
|
@@ -141,8 +143,12 @@ export declare class CrtrClient {
|
|
|
141
143
|
migrateState(req: MigrateStateRequest): Promise<MigrateStateDTO>;
|
|
142
144
|
appendNodeLog(id: string, req: NodeLogAppendRequest): Promise<NodeLogAppendResultDTO>;
|
|
143
145
|
putNodeTelemetry(id: string, req: NodeTelemetryRecordRequest): Promise<void>;
|
|
146
|
+
putNodeSummaries(id: string, req: NodeSummariesRecordRequest): Promise<void>;
|
|
144
147
|
putNodeRecap(id: string, req: NodeRecapRecordRequest): Promise<void>;
|
|
145
148
|
readNodeInboxReport(id: string, ref: string, executionId: string): Promise<NodeMessageBodyDTO>;
|
|
149
|
+
listNodeAttachments(id: string): Promise<NodeAttachmentsDTO>;
|
|
150
|
+
/** The bytes of one of the run's attachments (`GET /v1/nodes/:id/attachments/:sha256`). */
|
|
151
|
+
readNodeAttachment(id: string, sha256: string): Promise<Uint8Array>;
|
|
146
152
|
readNodePassiveMessage(id: string, ref: string): Promise<NodeMessageBodyDTO>;
|
|
147
153
|
nodePushedFinal(id: string, req: NodePushedFinalRequest): Promise<NodePushedFinalResultDTO>;
|
|
148
154
|
createNode(req: CreateNodeRequest): Promise<NodeDetailDTO>;
|
|
@@ -175,6 +181,10 @@ export declare class CrtrClient {
|
|
|
175
181
|
disarmOutcomeDelivery(id: string): Promise<void>;
|
|
176
182
|
listBashJobs(id: string): Promise<BashJobStatusDTO[]>;
|
|
177
183
|
stopBashJob(id: string, jobId: string): Promise<BashJobStopResultDTO>;
|
|
184
|
+
/** Claim, quiet or re-arm one running job (see `JobPatchRequest`). */
|
|
185
|
+
patchBashJob(id: string, jobId: string, request: JobPatchRequest): Promise<void>;
|
|
186
|
+
/** The broker's report on a job it runs. */
|
|
187
|
+
reportBashJob(id: string, jobId: string, request: JobReportRequest): Promise<void>;
|
|
178
188
|
sendMessage(id: string, req: SendMessageRequest): Promise<MessageResultDTO>;
|
|
179
189
|
/** First-class interrupt (the human Esc): cancels pending undelivered
|
|
180
190
|
* human-send inbox entries, then aborts a live in-flight turn. NEVER
|
|
@@ -187,6 +197,7 @@ export declare class CrtrClient {
|
|
|
187
197
|
relaunchRoot(id: string): Promise<RelaunchRootResultDTO>;
|
|
188
198
|
bindBrokerSession(id: string, req: BrokerSessionBoundRequest): Promise<BrokerSessionBoundResultDTO>;
|
|
189
199
|
settleBroker(id: string, req: BrokerSettleRequest): Promise<BrokerSettleDirective>;
|
|
200
|
+
postBrokerIdle(id: string, req: BrokerExecutionRequest): Promise<void>;
|
|
190
201
|
completeBrokerPark(id: string, req: BrokerParkCompleteRequest): Promise<BrokerSettleDirective>;
|
|
191
202
|
recordBrokerParkActivity(id: string, req: BrokerExecutionRequest): Promise<BrokerParkActivityResultDTO>;
|
|
192
203
|
recordBrokerTelemetry(id: string, req: BrokerTelemetryRequest): Promise<void>;
|
|
@@ -202,7 +213,13 @@ export declare class CrtrClient {
|
|
|
202
213
|
preserve_episode?: boolean;
|
|
203
214
|
}): Promise<NodeFaultClearResultDTO>;
|
|
204
215
|
commitBrokerModel(id: string, req: BrokerModelCommitRequest): Promise<BrokerModelCommitResultDTO>;
|
|
216
|
+
/** The sandbox's start bundle for an execution of the calling node. */
|
|
217
|
+
executionStart(executionId: string): Promise<StartBundleDTO>;
|
|
218
|
+
/** A GitHub token limited to the environment's recipe repositories, for the calling node's environment. */
|
|
219
|
+
gitCredential(environmentId: string, req: GitCredentialRequest): Promise<GitCredentialDTO>;
|
|
205
220
|
brokerExtensionState(id: string): Promise<BrokerExtensionStateDTO>;
|
|
221
|
+
brokerStructuredRequest(id: string): Promise<BrokerStructuredRequestDTO>;
|
|
222
|
+
captureBrokerGoal(id: string, req: BrokerGoalRequest): Promise<BrokerGoalResultDTO>;
|
|
206
223
|
commitBrokerGeneratedName(id: string, req: BrokerGeneratedNameRequest): Promise<BrokerGeneratedNameResultDTO>;
|
|
207
224
|
commitBrokerPersonaAck(id: string, req: BrokerPersonaAckRequest): Promise<BrokerPersonaAckResultDTO>;
|
|
208
225
|
closeNode(id: string, req?: CloseRequest): Promise<CloseResultDTO>;
|
|
@@ -357,10 +374,16 @@ export declare class CrtrClient {
|
|
|
357
374
|
updateProfileMetadata(name: string, req: UpdateProfileMetadataRequest): Promise<ProfileDTO>;
|
|
358
375
|
/** Force-delete or detach one profile by exact id or unique name. */
|
|
359
376
|
deleteProfile(name: string, req: DeleteProfileRequest): Promise<DeleteProfileResultDTO>;
|
|
377
|
+
getSettings(): Promise<PersonSettingsDTO>;
|
|
378
|
+
putSettings(req: PutPersonSettingsRequest): Promise<PersonSettingsDTO>;
|
|
360
379
|
listModelAuth(): Promise<ModelAuthListDTO>;
|
|
361
380
|
getModelAuthReadiness(query?: ModelAuthReadinessQuery): Promise<ModelAuthReadinessDTO>;
|
|
362
381
|
installCredential(provider: string, req: InstallCredentialRequest): Promise<CredentialResultDTO>;
|
|
363
382
|
removeCredential(provider: string): Promise<CredentialRemovalResultDTO>;
|
|
383
|
+
/** Rename a managed account and/or make it the preferred (first) one; answers the provider's sanitized status. */
|
|
384
|
+
patchModelAuthAccount(provider: string, label: string, req: PatchManagedAccountRequest): Promise<ModelAuthProviderStatusDTO>;
|
|
385
|
+
/** Remove one managed account; the provider's other accounts stay. */
|
|
386
|
+
removeModelAuthAccount(provider: string, label: string): Promise<ModelAuthProviderStatusDTO>;
|
|
364
387
|
/** `model_auth.start` — the daemon runs the vendor OAuth; the caller only shows `url`. */
|
|
365
388
|
startModelAuth(req: StartModelAuthFlowRequest): Promise<ModelAuthFlowStartedDTO>;
|
|
366
389
|
/** `model_auth.complete` — hand the daemon the code the vendor showed. */
|
package/dist/api/client.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var N=Object.defineProperty;var a=(i,e)=>N(i,"name",{value:e,configurable:!0});import{ApiError as
|
|
2
|
-
`))!==-1;){const P=c.slice(0,h);c=c.slice(h+1),P!==""&&(yield JSON.parse(P))}}if(c+=u.decode(),c.trim()!=="")throw new m(502,"invalid_response","broker signal stream ended mid-line")}finally{await o.cancel().catch(()=>{})}}createStructuredRequest(e,t){return e.mode==="sync"?this.sendOnce("POST","/v1/structured-requests",e,t):this.request("POST","/v1/structured-requests",e,t)}getStructuredRequest(e,{wait:t=0,budgetMs:n}={}){if(!Number.isInteger(t)||t<0||t>25)throw new RangeError("wait must be an integer between 0 and 25");return this.request("GET",d(`/v1/structured-requests/${this.requestPath(e)}`,{wait:t}),void 0,{budgetMs:n})}cancelStructuredRequest(e,t){return this.request("POST",`/v1/structured-requests/${this.requestPath(e)}/cancel`,{},t)}registerOutcomeDelivery(e,t){return this.request("PUT",r.nodeOutcomeDelivery(this.nodePath(e)),t)}getOutcomeDelivery(e){return this.request("GET",r.nodeOutcomeDelivery(this.nodePath(e)))}async disarmOutcomeDelivery(e){await this.request("DELETE",r.nodeOutcomeDelivery(this.nodePath(e)))}listBashJobs(e){return this.request("GET",r.nodeJobs(this.nodePath(e)))}stopBashJob(e,t){return this.request("DELETE",r.nodeJob(this.nodePath(e),this.jobPath(t)))}sendMessage(e,t){return this.request("POST",r.nodeMessages(this.nodePath(e)),t)}interruptNode(e){return this.request("POST",r.nodeInterrupt(this.nodePath(e)),{})}pushReport(e,t){return this.request("POST",r.nodeReports(this.nodePath(e)),t)}submitResult(e,t){return this.request("POST",r.nodeResult(this.nodePath(e)),t)}forkNode(e){return this.request("POST",r.nodeFork(this.nodePath(e)),{})}reviveNode(e,t){return this.request("POST",r.nodeRevive(this.nodePath(e)),t??{})}relaunchRoot(e){return this.request("POST",r.nodeRelaunchRoot(this.nodePath(e)),{})}bindBrokerSession(e,t){return this.request("POST",r.nodeBrokerSessionBound(this.nodePath(e)),t)}settleBroker(e,t){return this.request("POST",r.nodeBrokerSettle(this.nodePath(e)),t)}completeBrokerPark(e,t){return this.request("POST",r.nodeBrokerParkComplete(this.nodePath(e)),t)}recordBrokerParkActivity(e,t){return this.request("POST",r.nodeBrokerParkActivity(this.nodePath(e)),t)}async recordBrokerTelemetry(e,t){await this.request("POST",r.nodeBrokerTelemetry(this.nodePath(e)),t)}claimNodeMail(e,t){return this.request("POST",r.nodeMailClaim(this.nodePath(e)),t)}acknowledgeNodeMail(e,t){return this.request("POST",r.nodeMailAcknowledge(this.nodePath(e)),t)}recordBrokerTurn(e,t){return this.request("POST",r.brokerTurn(this.nodePath(e)),t)}mutateBrokerProviderRetry(e,t){return this.request("POST",r.brokerProviderRetry(this.nodePath(e)),t)}mutateBrokerFault(e,t){return this.request("POST",r.brokerFault(this.nodePath(e)),t)}getBrokerRecovery(e,t){return this.request("GET",`${r.brokerRecovery(this.nodePath(e))}?expected_execution_id=${encodeURIComponent(t)}`)}recordNodeFault(e,t){return this.request("POST",r.nodeFault(this.nodePath(e)),t)}clearNodeFault(e,t={}){const n=new URLSearchParams;t.link!==void 0&&n.set("link",t.link),t.preserve_episode!==void 0&&n.set("preserve_episode",String(t.preserve_episode));const s=n.size===0?"":`?${n.toString()}`;return this.request("DELETE",`${r.nodeFault(this.nodePath(e))}${s}`)}commitBrokerModel(e,t){return this.request("POST",r.nodeBrokerModel(this.nodePath(e)),t)}brokerExtensionState(e){return this.request("GET",r.nodeBrokerExtensionState(this.nodePath(e)))}commitBrokerGeneratedName(e,t){return this.request("POST",r.nodeBrokerGeneratedName(this.nodePath(e)),t)}commitBrokerPersonaAck(e,t){return this.request("POST",r.nodeBrokerPersonaAck(this.nodePath(e)),t)}closeNode(e,t){return this.request("POST",r.nodeClose(this.nodePath(e)),t??{})}async markNodeRead(e){await this.request("POST",r.nodeRead(this.nodePath(e)),{})}recycleNode(e){return this.request("POST",r.nodeRecycle(this.nodePath(e)),{})}demoteNode(e){return this.request("POST",r.nodeDemote(this.nodePath(e)),{})}promoteNode(e,t){return this.request("POST",r.nodePromote(this.nodePath(e)),t)}yieldNode(e,t){return this.request("POST",r.nodeYield(this.nodePath(e)),t)}waitNode(e,t){return this.request("POST",r.nodeWait(this.nodePath(e)),t)}listKinds(){return this.request("GET",r.kinds())}patchConfig(e,t){return this.request("PATCH",r.nodeConfig(this.nodePath(e)),t,t.model!==void 0?{timeout:45e3+this.timeoutMs}:void 0)}closeWorktree(e){return this.request("POST",r.nodeWorktreeClose(this.nodePath(e)),{})}abandonWorktree(e,t){return this.request("POST",r.nodeWorktreeAbandon(this.nodePath(e)),t)}retryDelivery(e){return this.request("POST",r.deliveryRetry(e),{})}listQuarantinedWorktrees(){return this.request("GET",r.quarantinedWorktrees())}showLimits(){return this.request("GET",r.limits())}setAppLimits(e,t){return this.request("PUT",r.limitsApp(e),t)}removeAppLimits(e,t){return this.request("DELETE",d(r.limitsApp(e),{fields:t.join(",")}))}listCharges(e={}){return this.request("GET",d(r.charges(),e))}listSpendLimits(){return this.request("GET",r.spendLimits())}setSpendLimit(e,t){return this.request("PUT",r.spendLimit(e),t)}removeSpendLimit(e){return this.request("DELETE",r.spendLimit(e))}listSpaces(){return this.request("GET",r.spaces())}subscribe(e,t){return this.request("POST",r.nodeSubscriptions(this.nodePath(e)),t)}listFocuses(){return this.request("GET",r.focuses())}focusOf(e){return this.request("GET",d(r.focusByNode(),{node_id:e}))}focusByPane(e){return this.request("GET",d(r.focusByPane(),{pane:e}))}registerFocus(e){return this.request("POST",r.focuses(),e)}async setFocusPane(e,t){await this.request("PATCH",r.focus(e),t)}async closeFocus(e){await this.request("DELETE",r.focus(e))}async unsubscribe(e,t){await this.request("DELETE",r.nodeSubscription(this.nodePath(e),this.nodePath(t)))}armCron(e){return this.request("POST",r.crons(),e)}listCrons(e){return this.request("GET",d(r.crons(),e))}showCron(e,t){return this.request("GET",d(r.cron(this.cronPath(e)),t))}pauseCron(e,t){return this.request("POST",d(r.cronPause(this.cronPath(e)),t),{})}resumeCron(e,t){return this.request("POST",d(r.cronResume(this.cronPath(e)),t),{})}runCron(e,t){return this.request("POST",d(r.cronRun(this.cronPath(e)),t),{})}async cancelCron(e,t){await this.request("DELETE",d(r.cron(this.cronPath(e)),t))}pokeCrons(){return this.request("POST",r.cronsPoke(),{})}ensureAttach(e,t){return this.request("POST",r.nodeAttach(this.nodePath(e)),t??{})}getReports(e,t){return this.request("GET",d(r.nodeReports(this.nodePath(e)),t))}getTranscript(e,t){return this.request("GET",d(r.nodeTranscript(this.nodePath(e)),t))}getSnapshot(e){return this.request("GET",r.nodeSnapshot(this.nodePath(e)))}nodeSubject(e){return this.request("GET",r.nodeSubject(this.nodePath(e)))}getNodeMessages(e,t){return this.request("GET",d(r.nodeMessages(this.nodePath(e)),t))}getSession(e){return this.request("GET",r.nodeSession(this.nodePath(e)))}getChatInventory(e){return this.request("GET",r.nodeChatInventory(this.nodePath(e)))}getProspectiveChatInventory(e){return this.request("GET",d(r.prospectiveChatInventory(),e))}getContext(e){return this.request("GET",r.nodeContext(this.nodePath(e)))}peekFile(e,t,n){return this.request("GET",d(r.filePeek(),{path:e,encoding:t}),void 0,n)}writeFile(e,t,n,s){return this.request("POST",r.fileWrite(),{path:e,content:t,encoding:n},s)}listFiles(e,t,n){return this.request("GET",d(r.fileList(),{path:e,limit:t}),void 0,n)}runBash(e,t){return this.request("POST",r.bash(),e,t)}objects={read:a((e,t)=>this.request("GET",d(r.object(e),t)),"read"),list:a(e=>this.request("GET",d(r.objects(),e)),"list"),search:a(e=>this.request("POST",r.objectsSearch(),e),"search"),watch:a((e,t={})=>this.request("POST",r.objectWatch(e),t),"watch"),unwatch:a((e,t)=>this.request("DELETE",d(r.objectWatch(e),t)),"unwatch"),edges:a((e,t)=>this.request("GET",d(r.objectEdges(e),t)),"edges")};docs={write:a(e=>this.request("POST",r.docs(),e),"write"),edit:a((e,t)=>this.request("PATCH",r.doc(e),t),"edit"),move:a((e,t)=>this.request("POST",r.docMove(e),t),"move"),delete:a(e=>this.request("DELETE",r.doc(e)),"delete"),history:a((e,t)=>this.request("GET",d(r.docHistory(e),t)),"history"),lint:a((e={})=>this.request("POST",r.docsLint(),e),"lint")};documents={browserAccess:a(()=>this.request("GET",r.documentsBrowserAccess()),"browserAccess"),reconcilePackages:a(()=>this.request("POST",r.documentsReconcilePackages()),"reconcilePackages")};plugins={appToken:a(e=>this.request("GET",r.pluginAppToken(e)),"appToken"),callHeaders:a((e,t)=>this.request("POST",r.pluginCallHeaders(e),t),"callHeaders")};nodeDelivery(e,t){return this.request("POST",r.nodeDelivery(this.nodePath(e)),t)}deliveryDryRun(e){return this.request("POST",r.deliveryDryRun(),e)}recordBackgroundedJob(e,t,n){return this.request("POST",r.nodeJobBackground(this.nodePath(e),this.jobPath(t)),n)}ensureProfile(e,t){return this.request("PUT",r.profile(e),t??{})}createProfile(e){return this.request("POST",r.profiles(),e)}listProfiles(){return this.request("GET",r.profiles())}updateProfile(e,t){return this.request("PATCH",r.profile(e),t)}listAppEnv(){return this.request("GET",r.appEnv())}setAppEnv(e,t){return this.request("PUT",r.appEnvVar(e),{value:t})}removeAppEnv(e){return this.request("DELETE",r.appEnvVar(e))}listProfileEnv(e){return this.request("GET",r.profileEnv(e))}setProfileEnv(e,t,n){return this.request("PUT",r.profileEnvVar(e,t),{value:n})}removeProfileEnv(e,t){return this.request("DELETE",r.profileEnvVar(e,t))}getProfile(e){return this.request("GET",r.profile(e))}pauseProfile(e){return this.request("POST",r.profilePause(e),{})}resumeProfile(e){return this.request("POST",r.profileResume(e),{})}updateProfileMetadata(e,t){return this.request("PATCH",r.profileMetadata(e),t)}deleteProfile(e,t){return this.request("DELETE",r.profile(e),t)}listModelAuth(){return this.request("GET",r.modelAuths())}getModelAuthReadiness(e){return this.request("GET",d(r.modelAuthReadiness(),e))}installCredential(e,t){return this.request("PUT",r.modelAuth(e),t)}removeCredential(e){return this.request("DELETE",r.modelAuth(e))}startModelAuth(e){return this.request("POST",r.modelAuthFlows(),e,{timeout:3e4+this.timeoutMs})}completeModelAuth(e,t){return this.request("POST",r.modelAuthFlowComplete(e),t,{timeout:35e3+this.timeoutMs})}cancelModelAuth(e){return this.request("POST",r.modelAuthFlowCancel(e),{})}getModelAuthFlow(e,t){return this.request("GET",d(r.modelAuthFlow(e),{wait:t}),void 0,{timeout:(t??0)*1e3+this.timeoutMs})}createReview(e){return this.request("POST",r.humanReviews(),e)}listReviews(e){return this.request("GET",d(r.humanReviews(),e))}getReview(e){return this.request("GET",r.humanReview(this.reviewPath(e)))}submitReview(e){return this.request("POST",r.humanReviewSubmit(this.reviewPath(e)),{})}cancelReview(e,t={}){return this.request("POST",r.humanReviewCancel(this.reviewPath(e)),t)}getReviewDocumentBase(e){return this.request("GET",r.humanReviewDocument(this.reviewPath(e)))}createReviewComment(e,t){const n=e===void 0?"self":this.reviewPath(e);return this.request("POST",r.humanReviewComments(n),t)}listReviewComments(e,t){const n=e===void 0?"self":this.reviewPath(e);return this.request("GET",d(r.humanReviewComments(n),t))}readReviewCommentEvents(e,t){return this.request("GET",d(r.humanReviewCommentEvents(this.reviewPath(e)),t))}updateReviewCommentRanges(e,t){return this.request("POST",r.humanReviewCommentRanges(this.reviewPath(e)),t)}getReviewComment(e){return this.request("GET",r.humanComment(this.commentPath(e)))}editReviewComment(e,t){return this.request("POST",r.humanCommentEdit(this.commentPath(e)),t)}resolveReviewComment(e,t={}){return this.request("POST",r.humanCommentResolve(this.commentPath(e)),t)}reopenReviewComment(e,t={}){return this.request("POST",r.humanCommentReopen(this.commentPath(e)),t)}deleteReviewComment(e,t={}){return this.request("POST",r.humanCommentDelete(this.commentPath(e)),t)}forkReviewComment(e){return this.request("POST",r.humanCommentFork(this.commentPath(e)),{})}listHumanInbox(){return this.request("GET",r.humanInbox())}getHumanInboxPage(e){return this.request("GET",r.humanInboxTicket(this.ticketId(e)))}getInboxHistory(e,t={}){if(e!==void 0&&(typeof e!="string"||e===""))throw new TypeError(`invalid node id: ${JSON.stringify(e)}`);return this.request("GET",d(r.humanInbox()+"/history",{node_id:e,state:t.state}))}respondHumanInboxPage(e,t){return this.request("POST",r.humanInboxRespond(this.ticketId(e)),t)}postInboxProgress(e,t){return this.request("POST",r.humanInboxProgress(this.ticketId(e)),{responses:t})}getInboxResponse(e){return this.request("GET",r.humanInboxResponse(this.ticketId(e)))}cancelHumanInboxTicket(e,t){return this.request("POST",r.humanInboxCancel(this.ticketId(e)),t??{})}createHumanRequest(e){return this.request("POST",r.humanRequests(),e)}listPageComponents(){return this.request("GET",r.humanComponents())}getHumanRequest(e){return this.request("GET",r.humanRequest(this.requestPath(e)))}replaceHumanRequest(e,t){return this.request("POST",r.humanRequestReplace(this.requestPath(e)),t)}respondHumanRequest(e,t){return this.request("POST",r.humanRequestRespond(this.requestPath(e)),t)}dismissHumanRequest(e,t={}){return this.request("POST",r.humanRequestDismiss(this.requestPath(e)),t)}cancelHumanRequest(e,t={}){return this.request("POST",r.humanRequestCancel(this.requestPath(e)),t)}resolvePageFeedbackComment(e,t,n){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(t))throw new TypeError(`invalid feedback comment id: ${JSON.stringify(t)}`);return this.request("POST",r.humanInboxFeedbackResolve(this.ticketId(e),t),{node_id:n})}async dashboard(e){const t=e?.under!==void 0?{under:e.under}:void 0,[n,s]=await Promise.all([this.listNodes(t),this.status()]);return{nodes:n,counts:s.node_counts,generated_at:new Date().toISOString()}}attention(){return this.request("GET",r.canvasAttention())}attentionCounts(e){const t={node_ids:e};return this.request("POST",r.canvasAttentionCounts(),t)}historySearch(e){return this.request("POST",r.canvasHistorySearch(),e)}historyGrep(e){return this.request("POST",r.canvasHistoryGrep(),e)}historyRead(e){return this.request("GET",d(r.canvasHistoryRead(),e))}historyStats(e){return this.request("POST",r.canvasHistoryStats(),e)}canvasSnapshot(){return this.request("GET",r.canvasSnapshot())}analytics(e){return this.request("GET",d(r.canvasAnalytics(),e),void 0,{timeout:6e4})}async recordMemoryReads(e,t){await this.request("POST",r.nodeMemoryReads(this.nodePath(e)),t)}liveRoots(e={}){return this.request("GET",d(r.canvasLiveRoots(),e))}canvasRoster(){return this.request("GET",r.canvasRoster())}async canvasBrowseCompressed(){const e=await this.send("GET",r.canvasBrowse());return e.ok||await E(e),new Uint8Array(await e.arrayBuffer())}canvasGraph(){return this.request("GET",r.canvasGraph())}prune(e){return this.request("POST",r.canvasPrune(),e)}async request(e,t,n,s){try{const o=s===void 0?void 0:this.resolveBudget(s),u=await this.send(e,t,n,o);return await E(u,o?.deadlineAt)}catch(o){throw w(o,s?.signal)}}async rawResponse(e,t,n){try{return await this.send(e,t,void 0,n)}catch(s){throw w(s,n?.signal)}}async send(e,t,n,s={}){const o=this.resolveBudget(s),u=e==="GET"||e==="HEAD"||e==="DELETE",c=o.maxRetries??this.maxRetries,l=Math.min(o.deadlineAt??1/0,Date.now()+j);for(let f=0;;f++){let h;try{h=await this.transport(e,t,n,o)}catch(P){if(this.isColdSocketError(P)||this.isInterruptedSocketError(P)){const T=this.availabilityFailure?.();if(T!==void 0)throw T}if(this.isColdSocketError(P))try{await this.handleColdSocket(P,o.deadlineAt),h=await this.transport(e,t,n,o)}catch(T){throw o.deadlineAt!==void 0&&Date.now()>=o.deadlineAt&&!M(T,o.signal)?S(o.deadlineAt):w(T,o.signal)}else{if(this.isInterruptedSocketError(P)&&this.localSocketTransport&&(!u||f<c))return await this.rideOutInterruptedRequest(e,t,n,o);if(u&&f<c&&!M(P,o.signal)&&(!this.localSocketTransport||!this.isInterruptedSocketError(P))){await R(G(f+1),o);continue}else throw w(P,o.signal)}}if(W(e)&&c>0&&h.status===503&&await J(h,o.deadlineAt)){const P=Math.max(250,(A(h)??0)*1e3)+Math.random()*250;if(Date.now()+P>=l)return h;await g(h,o.deadlineAt),await R(P,{signal:o.signal});continue}if(u&&f<c&&z(h.status)){await g(h,o.deadlineAt),await R(G(f+1),o,A(h));continue}return h}}resolveBudget(e){const{budgetMs:t,deadlineAt:n,...s}=e;if(t===void 0&&n===void 0)return s;if(t!==void 0&&(!Number.isFinite(t)||t<=0||t>v))throw new RangeError(`budgetMs must be a positive finite number of at most ${v}`);if(n!==void 0&&(!Number.isFinite(n)||n-Date.now()>v))throw new RangeError(`deadlineAt must be a finite epoch-millisecond instant at most ${v} ms from now`);return{...s,deadlineAt:Math.min(n??1/0,t===void 0?1/0:Date.now()+t)}}async awaitWithinBudget(e,t){if(t===void 0)return e;const n=t-Date.now();if(n<=0)throw p(t);let s;try{return await Promise.race([e,new Promise((o,u)=>{s=setTimeout(()=>u(p(t)),n)})])}finally{s!==void 0&&clearTimeout(s)}}async sendOnce(e,t,n,s={}){const o=this.resolveBudget(s);try{return await E(await this.transport(e,t,n,o))}catch(u){throw w(u,o.signal)}}nodePath(e){if(!b(e))throw new m(400,"invalid_node_id",`invalid node id: ${JSON.stringify(e)}`);return e}jobPath(e){if(!L(e))throw new m(400,"invalid_job_id",`invalid background job id: ${JSON.stringify(e)}`);return e}cronPath(e){if(!B(e))throw new m(400,"invalid_cron_id",`invalid cron id: ${JSON.stringify(e)}`);return e}requestPath(e){if(!b(e))throw new m(400,"invalid_request_id",`invalid request id: ${JSON.stringify(e)}`);return e}ticketId(e){if(!/^[a-f0-9]{64}$/.test(e))throw new TypeError(`invalid inbox ticket id: ${JSON.stringify(e)}`);return e}reviewPath(e){if(!b(e))throw new m(400,"invalid_review_id",`invalid review id: ${JSON.stringify(e)}`);return e}commentPath(e){if(!/^[a-f0-9]{32}$/.test(e))throw new m(400,"invalid_comment_id",`invalid comment id: ${JSON.stringify(e)}`);return e}transport(e,t,n,s={}){const o=s.deadlineAt===void 0?void 0:s.deadlineAt-Date.now();if(o!==void 0&&o<=0)return Promise.reject(p(s.deadlineAt));const u=n===void 0?void 0:JSON.stringify(n),c={accept:"application/json",...this.headers,...s.headers};u!==void 0&&(c["content-type"]="application/json");const l=s.timeout??this.timeoutMs,f=o===void 0?l:l>0?Math.min(l,o):o,h=new AbortController,P=o!==void 0&&(l<=0||o<=l),T=f>0?setTimeout(()=>h.abort(P?p(s.deadlineAt):new DOMException("request timed out","TimeoutError")),f):void 0,q=s.signal,k=a(()=>h.abort(q?.reason),"onExternalAbort");q!==void 0&&(q.aborted?h.abort(q.reason):q.addEventListener("abort",k,{once:!0}));const C=a(()=>{T!==void 0&&clearTimeout(T),q?.removeEventListener("abort",k)},"finish");return V(this.fetch(new URL(t,this.baseUrl),{method:e,headers:c,body:u,signal:h.signal}),h.signal).then(y=>this.retainRequestLifetime(y,C,()=>h.signal.aborted?h.signal.reason:void 0),y=>{throw C(),y})}retainRequestLifetime(e,t,n){if(e.body===null)return t(),e;const s=e.body.getReader();let o=!1;const u=a(()=>{o||(o=!0,t())},"close"),c=new ReadableStream({async pull(l){try{const{done:f,value:h}=await s.read();f?(u(),l.close()):l.enqueue(h)}catch(f){u(),l.error(n()??f)}},async cancel(l){u(),await s.cancel(l)}});return new Response(c,{status:e.status,statusText:e.statusText,headers:e.headers})}isColdSocketError(e){const t=O(e);return t==="ECONNREFUSED"||t==="ENOENT"||t==="ENOTSOCK"}isInterruptedSocketError(e){const t=O(e);return t==="ECONNRESET"||t==="EPIPE"}async rideOutInterruptedRequest(e,t,n,s={}){try{await this.awaitAvailability(void 0,s.deadlineAt)}catch(o){throw w(o,s.signal)}if(e!=="GET"&&e!=="HEAD")throw new m(503,"daemon_request_interrupted",`crtrd connection ended before this ${e} response; the request may or may not have been applied.`);try{return await this.transport(e,t,n,s)}catch(o){throw w(o,s.signal)}}async awaitAvailability(e,t){const n=t===void 0?void 0:t-Date.now();if(n!==void 0&&n<=0)throw p(t);let s,o;try{await U({windowMs:Math.min(this.coldStartPollWindowMs,n??this.coldStartPollWindowMs),initialError:e,retry:a(u=>u!==s&&u!==o,"retry"),probe:a(async u=>{const c=this.availabilityFailure?.();if(c!==void 0)throw o=c,c;const l=this.coldStartFailure?.();if(l!==void 0)throw s=new m(503,"daemon_unavailable",`crtrd failed to start: ${l}`),s;const f=await this.transport("GET",r.healthz(),void 0,{timeout:u});if(f.status>=200&&f.status<300){await g(f);return}const h=await f.text();try{if(typeof JSON.parse(h).startup_blocked=="string")return}catch{}throw new m(f.status,"daemon_health_unavailable",`crtrd health check returned HTTP ${f.status}: ${h.slice(0,500)}`)},"probe")})}catch(u){throw u===s&&(this.startupFailureReported=!0),u}}async handleColdSocket(e,t){const n=this.autostart&&this.onColdSocket!==void 0&&!this.coldStartAttempted;n&&(this.coldStartAttempted=!0,await this.awaitWithinBudget(this.onColdSocket(),t));try{await this.awaitAvailability(e,t)}catch(s){if(n&&!this.startupFailureReported){const o=K(this.coldStartDiagnostic);if(o!==void 0){const u=w(s);throw new m(u.status,u.code,`${u.message}
|
|
3
|
-
${o}`)}}throw s}}}function d(i,e){if(e===void 0)return i;const t=new URLSearchParams;for(const[s,o]of Object.entries(e))o!=null&&t.set(s,String(o));const n=t.toString();return n===""?i:`${i}?${n}`}a(d,"withQuery");async function
|
|
1
|
+
var N=Object.defineProperty;var a=(i,e)=>N(i,"name",{value:e,configurable:!0});import{ApiError as f,isErrorBody as x}from"./errors.js";import{routes as r}from"./routes.js";import{isSafeNodeId as b}from"./dto/common.js";import{isSafeBashJobId as B}from"./dto/bash-jobs.js";import{isSafeCronId as L}from"./dto/crons.js";const I=3e4,F=Symbol.for("@north-light/api/local-socket-fetch"),H=1e4,$=200;async function U({windowMs:i,probe:e,initialError:t,pollIntervalMs:n=$,retry:s=a(()=>!0,"retry"),now:o=Date.now,sleep:u=D}){const c=o()+i;let l=t;for(;;){const m=c-o();if(m<=0)throw l??new Error("crtrd availability window expired without a probe failure");try{await e(m);return}catch(P){if(l=P,!s(P))throw P}const h=c-o();if(h<=0)throw l;await u(Math.min(n,h))}}a(U,"waitForDaemonAvailability");const y=2147483647;function S(i,e="elapsed",t){const n=e==="retry_after"?`the server asked to retry after ${t}s, which is later than the call's deadline (${new Date(i).toISOString()}); not waiting`:`the call's deadline (${new Date(i).toISOString()}) passed`;return new f(504,"deadline_exceeded",n,{deadline_at:i,reason:e,...t===void 0?{}:{retry_after_s:t}})}a(S,"deadlineExceeded");const p=a(i=>S(i??Date.now()),"budgetExhausted");class re{static{a(this,"CrtrClient")}baseUrl;fetch;headers;autostart;timeoutMs;maxRetries;localSocketTransport;onColdSocket;coldStartDiagnostic;coldStartFailure;availabilityFailure;coldStartPollWindowMs;startupFailureReported=!1;coldStartAttempted=!1;constructor(e){if(e.baseUrl==="")throw new TypeError("CrtrClient requires baseUrl");this.baseUrl=new URL(e.baseUrl),this.fetch=e.fetch??globalThis.fetch,this.headers={...e.headers},this.autostart=e.autostart??!1,this.timeoutMs=e.timeoutMs??I,this.maxRetries=e.maxRetries??2,this.localSocketTransport=this.fetch[F]===!0,e.onColdSocket!==void 0&&(this.onColdSocket=e.onColdSocket),e.coldStartDiagnostic!==void 0&&(this.coldStartDiagnostic=e.coldStartDiagnostic),e.coldStartFailure!==void 0&&(this.coldStartFailure=e.coldStartFailure),e.availabilityFailure!==void 0&&(this.availabilityFailure=e.availabilityFailure),this.coldStartPollWindowMs=e.coldStartPollWindowMs??H}healthz(){return this.request("GET",r.healthz())}async probeHealthz(e){const t=await this.transport("GET",r.healthz(),void 0,{timeout:e});if(t.status===503)try{const n=await t.clone().json();if(typeof n.startup_blocked=="string")return n}catch{}return q(t)}async ready(){const e=await this.transport("GET",r.ready(),void 0,{});if(e.status===503)try{const t=await e.clone().json();if(t.ready===!1)return t}catch{}return q(e)}status(){return this.request("GET",r.status())}due(){return this.request("GET",r.due())}restartDaemon(){return this.request("POST",r.daemonRestart())}admitDaemon(){return this.request("POST",r.daemonAdmit())}migrateState(e){return this.request("POST",r.daemonMigrate(),e)}appendNodeLog(e,t){return this.request("POST",r.nodeLog(this.nodePath(e)),t)}async putNodeTelemetry(e,t){await this.request("PUT",r.nodeTelemetry(this.nodePath(e)),t)}async putNodeSummaries(e,t){await this.request("PUT",r.nodeSummaries(this.nodePath(e)),t)}async putNodeRecap(e,t){await this.request("PUT",r.nodeRecap(this.nodePath(e)),t)}readNodeInboxReport(e,t,n){return this.request("GET",d(r.nodeInboxReport(this.nodePath(e)),{ref:t,execution_id:n}))}listNodeAttachments(e){return this.request("GET",r.nodeAttachments(this.nodePath(e)))}async readNodeAttachment(e,t){const n=await this.send("GET",r.nodeAttachment(this.nodePath(e),t));return n.ok||await q(n),new Uint8Array(await n.arrayBuffer())}readNodePassiveMessage(e,t){return this.request("GET",d(r.nodePassiveMessage(this.nodePath(e)),{ref:t}))}nodePushedFinal(e,t){return this.request("POST",r.nodePushedFinal(this.nodePath(e)),t)}createNode(e){return this.request("POST",r.nodes(),e)}listNodes(e){return this.request("GET",d(r.nodes(),e))}getNode(e){return this.request("GET",r.node(this.nodePath(e)))}getNodeOutcome(e,{waitSeconds:t}={}){if(t!==void 0&&(!Number.isInteger(t)||t<0||t>25))throw new RangeError("waitSeconds must be an integer between 0 and 25");return this.request("GET",d(r.nodeOutcome(this.nodePath(e)),{wait:t}),void 0,{timeout:(t??0)*1e3+this.timeoutMs})}getNodeEvents(e,t={},n={}){if(t.after!==void 0&&(!Number.isSafeInteger(t.after)||t.after<0))throw new RangeError("after must be a non-negative safe integer");return this.transport("GET",d(r.nodeEvents(this.nodePath(e)),t),void 0,{...n,headers:{accept:"text/event-stream",...n.headers??{}},timeout:0})}async*getBrokerSignals(e,t,n={}){const s=await this.send("GET",d(r.nodeBrokerSignals(this.nodePath(e)),{execution_id:t}),void 0,{...n,headers:{accept:"application/x-ndjson",...n.headers??{}},timeout:0});if(!s.ok){await q(s);return}if(s.body===null)throw new f(s.status,"invalid_response","broker signal stream has no body");const o=s.body.getReader(),u=new TextDecoder;let c="";try{for(;;){const{done:l,value:m}=await o.read();if(l)break;c+=u.decode(m,{stream:!0});let h;for(;(h=c.indexOf(`
|
|
2
|
+
`))!==-1;){const P=c.slice(0,h);c=c.slice(h+1),P!==""&&(yield JSON.parse(P))}}if(c+=u.decode(),c.trim()!=="")throw new f(502,"invalid_response","broker signal stream ended mid-line")}finally{await o.cancel().catch(()=>{})}}createStructuredRequest(e,t){return e.mode==="sync"?this.sendOnce("POST","/v1/structured-requests",e,t):this.request("POST","/v1/structured-requests",e,t)}getStructuredRequest(e,{wait:t=0,budgetMs:n}={}){if(!Number.isInteger(t)||t<0||t>25)throw new RangeError("wait must be an integer between 0 and 25");return this.request("GET",d(`/v1/structured-requests/${this.requestPath(e)}`,{wait:t}),void 0,{budgetMs:n})}cancelStructuredRequest(e,t){return this.request("POST",`/v1/structured-requests/${this.requestPath(e)}/cancel`,{},t)}registerOutcomeDelivery(e,t){return this.request("PUT",r.nodeOutcomeDelivery(this.nodePath(e)),t)}getOutcomeDelivery(e){return this.request("GET",r.nodeOutcomeDelivery(this.nodePath(e)))}async disarmOutcomeDelivery(e){await this.request("DELETE",r.nodeOutcomeDelivery(this.nodePath(e)))}listBashJobs(e){return this.request("GET",r.nodeJobs(this.nodePath(e)))}stopBashJob(e,t){return this.request("DELETE",r.nodeJob(this.nodePath(e),this.jobPath(t)))}async patchBashJob(e,t,n){await this.request("PATCH",r.nodeJob(this.nodePath(e),this.jobPath(t)),n)}async reportBashJob(e,t,n){await this.request("POST",r.nodeJobReport(this.nodePath(e),this.jobPath(t)),n)}sendMessage(e,t){return this.request("POST",r.nodeMessages(this.nodePath(e)),t)}interruptNode(e){return this.request("POST",r.nodeInterrupt(this.nodePath(e)),{})}pushReport(e,t){return this.request("POST",r.nodeReports(this.nodePath(e)),t)}submitResult(e,t){return this.request("POST",r.nodeResult(this.nodePath(e)),t)}forkNode(e){return this.request("POST",r.nodeFork(this.nodePath(e)),{})}reviveNode(e,t){return this.request("POST",r.nodeRevive(this.nodePath(e)),t??{})}relaunchRoot(e){return this.request("POST",r.nodeRelaunchRoot(this.nodePath(e)),{})}bindBrokerSession(e,t){return this.request("POST",r.nodeBrokerSessionBound(this.nodePath(e)),t)}settleBroker(e,t){return this.request("POST",r.nodeBrokerSettle(this.nodePath(e)),t)}async postBrokerIdle(e,t){await this.request("POST",r.nodeBrokerIdle(this.nodePath(e)),t)}completeBrokerPark(e,t){return this.request("POST",r.nodeBrokerParkComplete(this.nodePath(e)),t)}recordBrokerParkActivity(e,t){return this.request("POST",r.nodeBrokerParkActivity(this.nodePath(e)),t)}async recordBrokerTelemetry(e,t){await this.request("POST",r.nodeBrokerTelemetry(this.nodePath(e)),t)}claimNodeMail(e,t){return this.request("POST",r.nodeMailClaim(this.nodePath(e)),t)}acknowledgeNodeMail(e,t){return this.request("POST",r.nodeMailAcknowledge(this.nodePath(e)),t)}recordBrokerTurn(e,t){return this.request("POST",r.brokerTurn(this.nodePath(e)),t)}mutateBrokerProviderRetry(e,t){return this.request("POST",r.brokerProviderRetry(this.nodePath(e)),t)}mutateBrokerFault(e,t){return this.request("POST",r.brokerFault(this.nodePath(e)),t)}getBrokerRecovery(e,t){return this.request("GET",`${r.brokerRecovery(this.nodePath(e))}?expected_execution_id=${encodeURIComponent(t)}`)}recordNodeFault(e,t){return this.request("POST",r.nodeFault(this.nodePath(e)),t)}clearNodeFault(e,t={}){const n=new URLSearchParams;t.link!==void 0&&n.set("link",t.link),t.preserve_episode!==void 0&&n.set("preserve_episode",String(t.preserve_episode));const s=n.size===0?"":`?${n.toString()}`;return this.request("DELETE",`${r.nodeFault(this.nodePath(e))}${s}`)}commitBrokerModel(e,t){return this.request("POST",r.nodeBrokerModel(this.nodePath(e)),t)}executionStart(e){return this.request("GET",r.executionStart(e))}gitCredential(e,t){return this.request("POST",r.environmentGitCredential(e),t)}brokerExtensionState(e){return this.request("GET",r.nodeBrokerExtensionState(this.nodePath(e)))}brokerStructuredRequest(e){return this.request("GET",r.nodeBrokerStructuredRequest(this.nodePath(e)))}captureBrokerGoal(e,t){return this.request("POST",r.nodeBrokerGoal(this.nodePath(e)),t)}commitBrokerGeneratedName(e,t){return this.request("POST",r.nodeBrokerGeneratedName(this.nodePath(e)),t)}commitBrokerPersonaAck(e,t){return this.request("POST",r.nodeBrokerPersonaAck(this.nodePath(e)),t)}closeNode(e,t){return this.request("POST",r.nodeClose(this.nodePath(e)),t??{})}async markNodeRead(e){await this.request("POST",r.nodeRead(this.nodePath(e)),{})}recycleNode(e){return this.request("POST",r.nodeRecycle(this.nodePath(e)),{})}demoteNode(e){return this.request("POST",r.nodeDemote(this.nodePath(e)),{})}promoteNode(e,t){return this.request("POST",r.nodePromote(this.nodePath(e)),t)}yieldNode(e,t){return this.request("POST",r.nodeYield(this.nodePath(e)),t)}waitNode(e,t){return this.request("POST",r.nodeWait(this.nodePath(e)),t)}listKinds(){return this.request("GET",r.kinds())}patchConfig(e,t){return this.request("PATCH",r.nodeConfig(this.nodePath(e)),t,t.model!==void 0?{timeout:45e3+this.timeoutMs}:void 0)}closeWorktree(e){return this.request("POST",r.nodeWorktreeClose(this.nodePath(e)),{})}abandonWorktree(e,t){return this.request("POST",r.nodeWorktreeAbandon(this.nodePath(e)),t)}retryDelivery(e){return this.request("POST",r.deliveryRetry(e),{})}listQuarantinedWorktrees(){return this.request("GET",r.quarantinedWorktrees())}showLimits(){return this.request("GET",r.limits())}setAppLimits(e,t){return this.request("PUT",r.limitsApp(e),t)}removeAppLimits(e,t){return this.request("DELETE",d(r.limitsApp(e),{fields:t.join(",")}))}listCharges(e={}){return this.request("GET",d(r.charges(),e))}listSpendLimits(){return this.request("GET",r.spendLimits())}setSpendLimit(e,t){return this.request("PUT",r.spendLimit(e),t)}removeSpendLimit(e){return this.request("DELETE",r.spendLimit(e))}listSpaces(){return this.request("GET",r.spaces())}subscribe(e,t){return this.request("POST",r.nodeSubscriptions(this.nodePath(e)),t)}listFocuses(){return this.request("GET",r.focuses())}focusOf(e){return this.request("GET",d(r.focusByNode(),{node_id:e}))}focusByPane(e){return this.request("GET",d(r.focusByPane(),{pane:e}))}registerFocus(e){return this.request("POST",r.focuses(),e)}async setFocusPane(e,t){await this.request("PATCH",r.focus(e),t)}async closeFocus(e){await this.request("DELETE",r.focus(e))}async unsubscribe(e,t){await this.request("DELETE",r.nodeSubscription(this.nodePath(e),this.nodePath(t)))}armCron(e){return this.request("POST",r.crons(),e)}listCrons(e){return this.request("GET",d(r.crons(),e))}showCron(e,t){return this.request("GET",d(r.cron(this.cronPath(e)),t))}pauseCron(e,t){return this.request("POST",d(r.cronPause(this.cronPath(e)),t),{})}resumeCron(e,t){return this.request("POST",d(r.cronResume(this.cronPath(e)),t),{})}runCron(e,t){return this.request("POST",d(r.cronRun(this.cronPath(e)),t),{})}async cancelCron(e,t){await this.request("DELETE",d(r.cron(this.cronPath(e)),t))}pokeCrons(){return this.request("POST",r.cronsPoke(),{})}ensureAttach(e,t){return this.request("POST",r.nodeAttach(this.nodePath(e)),t??{})}getReports(e,t){return this.request("GET",d(r.nodeReports(this.nodePath(e)),t))}getTranscript(e,t){return this.request("GET",d(r.nodeTranscript(this.nodePath(e)),t))}getSnapshot(e){return this.request("GET",r.nodeSnapshot(this.nodePath(e)))}nodeSubject(e){return this.request("GET",r.nodeSubject(this.nodePath(e)))}getNodeMessages(e,t){return this.request("GET",d(r.nodeMessages(this.nodePath(e)),t))}getSession(e){return this.request("GET",r.nodeSession(this.nodePath(e)))}getChatInventory(e){return this.request("GET",r.nodeChatInventory(this.nodePath(e)))}getProspectiveChatInventory(e){return this.request("GET",d(r.prospectiveChatInventory(),e))}getContext(e){return this.request("GET",r.nodeContext(this.nodePath(e)))}peekFile(e,t,n){return this.request("GET",d(r.filePeek(),{path:e,encoding:t}),void 0,n)}writeFile(e,t,n,s){return this.request("POST",r.fileWrite(),{path:e,content:t,encoding:n},s)}listFiles(e,t,n){return this.request("GET",d(r.fileList(),{path:e,limit:t}),void 0,n)}runBash(e,t){return this.request("POST",r.bash(),e,t)}objects={read:a((e,t)=>this.request("GET",d(r.object(e),t)),"read"),list:a(e=>this.request("GET",d(r.objects(),e)),"list"),search:a(e=>this.request("POST",r.objectsSearch(),e),"search"),watch:a((e,t={})=>this.request("POST",r.objectWatch(e),t),"watch"),unwatch:a((e,t)=>this.request("DELETE",d(r.objectWatch(e),t)),"unwatch"),edges:a((e,t)=>this.request("GET",d(r.objectEdges(e),t)),"edges")};docs={write:a(e=>this.request("POST",r.docs(),e),"write"),edit:a((e,t)=>this.request("PATCH",r.doc(e),t),"edit"),move:a((e,t)=>this.request("POST",r.docMove(e),t),"move"),delete:a(e=>this.request("DELETE",r.doc(e)),"delete"),history:a((e,t)=>this.request("GET",d(r.docHistory(e),t)),"history"),lint:a((e={})=>this.request("POST",r.docsLint(),e),"lint")};documents={browserAccess:a(()=>this.request("GET",r.documentsBrowserAccess()),"browserAccess"),reconcilePackages:a(()=>this.request("POST",r.documentsReconcilePackages()),"reconcilePackages")};plugins={appToken:a(e=>this.request("GET",r.pluginAppToken(e)),"appToken"),callHeaders:a((e,t)=>this.request("POST",r.pluginCallHeaders(e),t),"callHeaders")};nodeDelivery(e,t){return this.request("POST",r.nodeDelivery(this.nodePath(e)),t)}deliveryDryRun(e){return this.request("POST",r.deliveryDryRun(),e)}recordBackgroundedJob(e,t,n){return this.request("POST",r.nodeJobBackground(this.nodePath(e),this.jobPath(t)),n)}ensureProfile(e,t){return this.request("PUT",r.profile(e),t??{})}createProfile(e){return this.request("POST",r.profiles(),e)}listProfiles(){return this.request("GET",r.profiles())}updateProfile(e,t){return this.request("PATCH",r.profile(e),t)}listAppEnv(){return this.request("GET",r.appEnv())}setAppEnv(e,t){return this.request("PUT",r.appEnvVar(e),{value:t})}removeAppEnv(e){return this.request("DELETE",r.appEnvVar(e))}listProfileEnv(e){return this.request("GET",r.profileEnv(e))}setProfileEnv(e,t,n){return this.request("PUT",r.profileEnvVar(e,t),{value:n})}removeProfileEnv(e,t){return this.request("DELETE",r.profileEnvVar(e,t))}getProfile(e){return this.request("GET",r.profile(e))}pauseProfile(e){return this.request("POST",r.profilePause(e),{})}resumeProfile(e){return this.request("POST",r.profileResume(e),{})}updateProfileMetadata(e,t){return this.request("PATCH",r.profileMetadata(e),t)}deleteProfile(e,t){return this.request("DELETE",r.profile(e),t)}getSettings(){return this.request("GET",r.settings())}putSettings(e){return this.request("PUT",r.settings(),e)}listModelAuth(){return this.request("GET",r.modelAuths())}getModelAuthReadiness(e){return this.request("GET",d(r.modelAuthReadiness(),e))}installCredential(e,t){return this.request("PUT",r.modelAuth(e),t)}removeCredential(e){return this.request("DELETE",r.modelAuth(e))}patchModelAuthAccount(e,t,n){return this.request("PATCH",r.modelAuthAccount(e,t),n)}removeModelAuthAccount(e,t){return this.request("DELETE",r.modelAuthAccount(e,t))}startModelAuth(e){return this.request("POST",r.modelAuthFlows(),e,{timeout:3e4+this.timeoutMs})}completeModelAuth(e,t){return this.request("POST",r.modelAuthFlowComplete(e),t,{timeout:35e3+this.timeoutMs})}cancelModelAuth(e){return this.request("POST",r.modelAuthFlowCancel(e),{})}getModelAuthFlow(e,t){return this.request("GET",d(r.modelAuthFlow(e),{wait:t}),void 0,{timeout:(t??0)*1e3+this.timeoutMs})}createReview(e){return this.request("POST",r.humanReviews(),e)}listReviews(e){return this.request("GET",d(r.humanReviews(),e))}getReview(e){return this.request("GET",r.humanReview(this.reviewPath(e)))}submitReview(e){return this.request("POST",r.humanReviewSubmit(this.reviewPath(e)),{})}cancelReview(e,t={}){return this.request("POST",r.humanReviewCancel(this.reviewPath(e)),t)}getReviewDocumentBase(e){return this.request("GET",r.humanReviewDocument(this.reviewPath(e)))}createReviewComment(e,t){const n=e===void 0?"self":this.reviewPath(e);return this.request("POST",r.humanReviewComments(n),t)}listReviewComments(e,t){const n=e===void 0?"self":this.reviewPath(e);return this.request("GET",d(r.humanReviewComments(n),t))}readReviewCommentEvents(e,t){return this.request("GET",d(r.humanReviewCommentEvents(this.reviewPath(e)),t))}updateReviewCommentRanges(e,t){return this.request("POST",r.humanReviewCommentRanges(this.reviewPath(e)),t)}getReviewComment(e){return this.request("GET",r.humanComment(this.commentPath(e)))}editReviewComment(e,t){return this.request("POST",r.humanCommentEdit(this.commentPath(e)),t)}resolveReviewComment(e,t={}){return this.request("POST",r.humanCommentResolve(this.commentPath(e)),t)}reopenReviewComment(e,t={}){return this.request("POST",r.humanCommentReopen(this.commentPath(e)),t)}deleteReviewComment(e,t={}){return this.request("POST",r.humanCommentDelete(this.commentPath(e)),t)}forkReviewComment(e){return this.request("POST",r.humanCommentFork(this.commentPath(e)),{})}listHumanInbox(){return this.request("GET",r.humanInbox())}getHumanInboxPage(e){return this.request("GET",r.humanInboxTicket(this.ticketId(e)))}getInboxHistory(e,t={}){if(e!==void 0&&(typeof e!="string"||e===""))throw new TypeError(`invalid node id: ${JSON.stringify(e)}`);return this.request("GET",d(r.humanInbox()+"/history",{node_id:e,state:t.state}))}respondHumanInboxPage(e,t){return this.request("POST",r.humanInboxRespond(this.ticketId(e)),t)}postInboxProgress(e,t){return this.request("POST",r.humanInboxProgress(this.ticketId(e)),{responses:t})}getInboxResponse(e){return this.request("GET",r.humanInboxResponse(this.ticketId(e)))}cancelHumanInboxTicket(e,t){return this.request("POST",r.humanInboxCancel(this.ticketId(e)),t??{})}createHumanRequest(e){return this.request("POST",r.humanRequests(),e)}listPageComponents(){return this.request("GET",r.humanComponents())}getHumanRequest(e){return this.request("GET",r.humanRequest(this.requestPath(e)))}replaceHumanRequest(e,t){return this.request("POST",r.humanRequestReplace(this.requestPath(e)),t)}respondHumanRequest(e,t){return this.request("POST",r.humanRequestRespond(this.requestPath(e)),t)}dismissHumanRequest(e,t={}){return this.request("POST",r.humanRequestDismiss(this.requestPath(e)),t)}cancelHumanRequest(e,t={}){return this.request("POST",r.humanRequestCancel(this.requestPath(e)),t)}resolvePageFeedbackComment(e,t,n){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(t))throw new TypeError(`invalid feedback comment id: ${JSON.stringify(t)}`);return this.request("POST",r.humanInboxFeedbackResolve(this.ticketId(e),t),{node_id:n})}async dashboard(e){const t=e?.under!==void 0?{under:e.under}:void 0,[n,s]=await Promise.all([this.listNodes(t),this.status()]);return{nodes:n,counts:s.node_counts,generated_at:new Date().toISOString()}}attention(){return this.request("GET",r.canvasAttention())}attentionCounts(e){const t={node_ids:e};return this.request("POST",r.canvasAttentionCounts(),t)}historySearch(e){return this.request("POST",r.canvasHistorySearch(),e)}historyGrep(e){return this.request("POST",r.canvasHistoryGrep(),e)}historyRead(e){return this.request("GET",d(r.canvasHistoryRead(),e))}historyStats(e){return this.request("POST",r.canvasHistoryStats(),e)}canvasSnapshot(){return this.request("GET",r.canvasSnapshot())}analytics(e){return this.request("GET",d(r.canvasAnalytics(),e),void 0,{timeout:6e4})}async recordMemoryReads(e,t){await this.request("POST",r.nodeMemoryReads(this.nodePath(e)),t)}liveRoots(e={}){return this.request("GET",d(r.canvasLiveRoots(),e))}canvasRoster(){return this.request("GET",r.canvasRoster())}async canvasBrowseCompressed(){const e=await this.send("GET",r.canvasBrowse());return e.ok||await q(e),new Uint8Array(await e.arrayBuffer())}canvasGraph(){return this.request("GET",r.canvasGraph())}prune(e){return this.request("POST",r.canvasPrune(),e)}async request(e,t,n,s){try{const o=s===void 0?void 0:this.resolveBudget(s),u=await this.send(e,t,n,o);return await q(u,o?.deadlineAt)}catch(o){throw w(o,s?.signal)}}async rawResponse(e,t,n){try{return await this.send(e,t,void 0,n)}catch(s){throw w(s,n?.signal)}}async send(e,t,n,s={}){const o=this.resolveBudget(s),u=e==="GET"||e==="HEAD"||e==="DELETE",c=o.maxRetries??this.maxRetries,l=Math.min(o.deadlineAt??1/0,Date.now()+j);for(let m=0;;m++){let h;try{h=await this.transport(e,t,n,o)}catch(P){if(this.isColdSocketError(P)||this.isInterruptedSocketError(P)){const T=this.availabilityFailure?.();if(T!==void 0)throw T}if(this.isColdSocketError(P))try{await this.handleColdSocket(P,o.deadlineAt),h=await this.transport(e,t,n,o)}catch(T){throw o.deadlineAt!==void 0&&Date.now()>=o.deadlineAt&&!_(T,o.signal)?S(o.deadlineAt):w(T,o.signal)}else{if(this.isInterruptedSocketError(P)&&this.localSocketTransport&&(!u||m<c))return await this.rideOutInterruptedRequest(e,t,n,o);if(u&&m<c&&!_(P,o.signal)&&(!this.localSocketTransport||!this.isInterruptedSocketError(P))){await R(A(m+1),o);continue}else throw w(P,o.signal)}}if(J(e)&&c>0&&h.status===503&&await W(h,o.deadlineAt)){const P=Math.max(250,(M(h)??0)*1e3)+Math.random()*250;if(Date.now()+P>=l)return h;await g(h,o.deadlineAt),await R(P,{signal:o.signal});continue}if(u&&m<c&&z(h.status)){await g(h,o.deadlineAt),await R(A(m+1),o,M(h));continue}return h}}resolveBudget(e){const{budgetMs:t,deadlineAt:n,...s}=e;if(t===void 0&&n===void 0)return s;if(t!==void 0&&(!Number.isFinite(t)||t<=0||t>y))throw new RangeError(`budgetMs must be a positive finite number of at most ${y}`);if(n!==void 0&&(!Number.isFinite(n)||n-Date.now()>y))throw new RangeError(`deadlineAt must be a finite epoch-millisecond instant at most ${y} ms from now`);return{...s,deadlineAt:Math.min(n??1/0,t===void 0?1/0:Date.now()+t)}}async awaitWithinBudget(e,t){if(t===void 0)return e;const n=t-Date.now();if(n<=0)throw p(t);let s;try{return await Promise.race([e,new Promise((o,u)=>{s=setTimeout(()=>u(p(t)),n)})])}finally{s!==void 0&&clearTimeout(s)}}async sendOnce(e,t,n,s={}){const o=this.resolveBudget(s);try{return await q(await this.transport(e,t,n,o))}catch(u){throw w(u,o.signal)}}nodePath(e){if(!b(e))throw new f(400,"invalid_node_id",`invalid node id: ${JSON.stringify(e)}`);return e}jobPath(e){if(!B(e))throw new f(400,"invalid_job_id",`invalid background job id: ${JSON.stringify(e)}`);return e}cronPath(e){if(!L(e))throw new f(400,"invalid_cron_id",`invalid cron id: ${JSON.stringify(e)}`);return e}requestPath(e){if(!b(e))throw new f(400,"invalid_request_id",`invalid request id: ${JSON.stringify(e)}`);return e}ticketId(e){if(!/^[a-f0-9]{64}$/.test(e))throw new TypeError(`invalid inbox ticket id: ${JSON.stringify(e)}`);return e}reviewPath(e){if(!b(e))throw new f(400,"invalid_review_id",`invalid review id: ${JSON.stringify(e)}`);return e}commentPath(e){if(!/^[a-f0-9]{32}$/.test(e))throw new f(400,"invalid_comment_id",`invalid comment id: ${JSON.stringify(e)}`);return e}transport(e,t,n,s={}){const o=s.deadlineAt===void 0?void 0:s.deadlineAt-Date.now();if(o!==void 0&&o<=0)return Promise.reject(p(s.deadlineAt));const u=n===void 0?void 0:JSON.stringify(n),c={accept:"application/json",...this.headers,...s.headers};u!==void 0&&(c["content-type"]="application/json");const l=s.timeout??this.timeoutMs,m=o===void 0?l:l>0?Math.min(l,o):o,h=new AbortController,P=o!==void 0&&(l<=0||o<=l),T=m>0?setTimeout(()=>h.abort(P?p(s.deadlineAt):new DOMException("request timed out","TimeoutError")),m):void 0,E=s.signal,k=a(()=>h.abort(E?.reason),"onExternalAbort");E!==void 0&&(E.aborted?h.abort(E.reason):E.addEventListener("abort",k,{once:!0}));const C=a(()=>{T!==void 0&&clearTimeout(T),E?.removeEventListener("abort",k)},"finish");return V(this.fetch(new URL(t,this.baseUrl),{method:e,headers:c,body:u,signal:h.signal}),h.signal).then(v=>this.retainRequestLifetime(v,C,()=>h.signal.aborted?h.signal.reason:void 0),v=>{throw C(),v})}retainRequestLifetime(e,t,n){if(e.body===null)return t(),e;const s=e.body.getReader();let o=!1;const u=a(()=>{o||(o=!0,t())},"close"),c=new ReadableStream({async pull(l){try{const{done:m,value:h}=await s.read();m?(u(),l.close()):l.enqueue(h)}catch(m){u(),l.error(n()??m)}},async cancel(l){u(),await s.cancel(l)}});return new Response(c,{status:e.status,statusText:e.statusText,headers:e.headers})}isColdSocketError(e){const t=O(e);return t==="ECONNREFUSED"||t==="ENOENT"||t==="ENOTSOCK"}isInterruptedSocketError(e){const t=O(e);return t==="ECONNRESET"||t==="EPIPE"}async rideOutInterruptedRequest(e,t,n,s={}){try{await this.awaitAvailability(void 0,s.deadlineAt)}catch(o){throw w(o,s.signal)}if(e!=="GET"&&e!=="HEAD")throw new f(503,"daemon_request_interrupted",`crtrd connection ended before this ${e} response; the request may or may not have been applied.`);try{return await this.transport(e,t,n,s)}catch(o){throw w(o,s.signal)}}async awaitAvailability(e,t){const n=t===void 0?void 0:t-Date.now();if(n!==void 0&&n<=0)throw p(t);let s,o;try{await U({windowMs:Math.min(this.coldStartPollWindowMs,n??this.coldStartPollWindowMs),initialError:e,retry:a(u=>u!==s&&u!==o,"retry"),probe:a(async u=>{const c=this.availabilityFailure?.();if(c!==void 0)throw o=c,c;const l=this.coldStartFailure?.();if(l!==void 0)throw s=new f(503,"daemon_unavailable",`crtrd failed to start: ${l}`),s;const m=await this.transport("GET",r.healthz(),void 0,{timeout:u});if(m.status>=200&&m.status<300){await g(m);return}const h=await m.text();try{if(typeof JSON.parse(h).startup_blocked=="string")return}catch{}throw new f(m.status,"daemon_health_unavailable",`crtrd health check returned HTTP ${m.status}: ${h.slice(0,500)}`)},"probe")})}catch(u){throw u===s&&(this.startupFailureReported=!0),u}}async handleColdSocket(e,t){const n=this.autostart&&this.onColdSocket!==void 0&&!this.coldStartAttempted;n&&(this.coldStartAttempted=!0,await this.awaitWithinBudget(this.onColdSocket(),t));try{await this.awaitAvailability(e,t)}catch(s){if(n&&!this.startupFailureReported){const o=K(this.coldStartDiagnostic);if(o!==void 0){const u=w(s);throw new f(u.status,u.code,`${u.message}
|
|
3
|
+
${o}`)}}throw s}}}function d(i,e){if(e===void 0)return i;const t=new URLSearchParams;for(const[s,o]of Object.entries(e))o!=null&&t.set(s,String(o));const n=t.toString();return n===""?i:`${i}?${n}`}a(d,"withQuery");async function q(i,e){const t=i.status>=200&&i.status<300,n=(await G(i,e)).trim();let s;if(n!=="")try{s=JSON.parse(n)}catch{if(t)return;throw new f(i.status,"invalid_response",n.slice(0,500),void 0,i.headers)}if(t)return s;throw x(s)?new f(i.status,s.error.code,s.error.message,s.error.details,i.headers,s.error):new f(i.status,"internal",`request failed with status ${i.status}`,void 0,i.headers)}a(q,"parse");const j=6e4;function J(i){return i==="GET"||i==="HEAD"}a(J,"isRead");async function W(i,e){try{if(Number(i.headers.get("content-length")??0)>8192)return!1;const t=await G(i.clone(),Math.min(e??1/0,Date.now()+5e3)),n=JSON.parse(t).error;return n?.origin==="router"&&n.details?.forwarded===!1&&(n.details.runtime_state==="creating"||n.details.runtime_state==="recovering")}catch{return!1}}a(W,"isRefusedBeforeForwarding");function z(i){return i===429||i>=500}a(z,"isRetryableStatus");async function g(i,e){const t=(async()=>{try{await i.body?.cancel()}catch{}})();if(e===void 0)return t;let n;try{await Promise.race([t,new Promise(s=>{n=setTimeout(s,Math.max(0,e-Date.now()))})])}finally{n!==void 0&&clearTimeout(n)}}a(g,"drainResponseBody");async function G(i,e){if(e===void 0)return i.text();const t=e-Date.now(),n=i.text();if(n.catch(()=>{}),t<=0)throw i.body?.cancel().catch(()=>{}),S(e);let s;try{return await Promise.race([n,new Promise((o,u)=>{s=setTimeout(()=>{i.body?.cancel().catch(()=>{}),u(S(e))},t)})])}finally{s!==void 0&&clearTimeout(s)}}a(G,"readTextWithin");function A(i){return Math.min(2e3,250*2**(i-1))}a(A,"retryDelayMs");function O(i){if(typeof i!="object"||i===null)return;const e=i.code;if(typeof e=="string")return e;const t=i.cause;if(typeof t=="object"&&t!==null){const n=t.code;if(typeof n=="string")return n}}a(O,"transportErrorCode");function _(i,e){return e?.aborted?!0:i instanceof DOMException&&(i.name==="AbortError"||i.name==="TimeoutError")}a(_,"isAbortError");function w(i,e){if(e?.aborted)return new f(0,"request_aborted","request aborted by caller signal");if(i instanceof f)return i;if(i instanceof DOMException&&i.name==="TimeoutError")return new f(504,"request_timeout",`crtrd request timed out: ${i.message}`);if(i instanceof DOMException&&i.name==="AbortError")return new f(0,"request_aborted","request aborted by caller signal");const t=O(i),n=i instanceof Error?i.message:String(i);return t==="ECONNREFUSED"||t==="ENOENT"||t==="ENOTSOCK"?new f(503,"daemon_unavailable",`crtrd is not reachable: ${n}`):t==="ETIMEDOUT"?new f(504,"request_timeout",`crtrd request timed out: ${n}`):new f(503,"transport_error",n)}a(w,"toTransportApiError");function M(i){const e=Number(i.headers.get("retry-after"));return Number.isFinite(e)&&e>0?e:void 0}a(M,"retryAfterHeaderS");async function R(i,e,t,n){const{deadlineAt:s,signal:o}=e;if(o?.aborted)throw new f(0,"request_aborted","request aborted by caller signal");const u=s!==void 0&&t!==void 0?t*1e3:void 0,c=Math.max(i,u??0);if(s!==void 0&&Date.now()+c>=s){const l=S(s,u!==void 0&&u>=i?"retry_after":"elapsed",u===void 0?void 0:t);throw n!==void 0&&Object.defineProperty(l,"cause",{value:n,configurable:!0,writable:!0}),l}if(o===void 0)return D(c);await new Promise((l,m)=>{const h=a(()=>{clearTimeout(P),o.removeEventListener("abort",h),m(new f(0,"request_aborted","request aborted by caller signal"))},"onAbort"),P=setTimeout(()=>{o.removeEventListener("abort",h),l()},c);o.addEventListener("abort",h,{once:!0})})}a(R,"sleepWithin");function V(i,e){return new Promise((t,n)=>{const s=a(()=>n(e.reason),"onAbort");e.aborted?s():e.addEventListener("abort",s,{once:!0}),i.then(o=>{e.removeEventListener("abort",s),e.aborted?o.body?.cancel().catch(()=>{}):t(o)},o=>{e.removeEventListener("abort",s),n(o)})})}a(V,"abortable");function D(i){return new Promise(e=>setTimeout(e,i))}a(D,"sleepMs");function K(i){if(i!==void 0)try{return i()}catch{return}}a(K,"safeColdStartDiagnostic");export{re as CrtrClient,y as MAX_TIMER_MS,S as deadlineExceeded,K as safeColdStartDiagnostic,R as sleepWithin,U as waitForDaemonAvailability};
|
package/dist/api/contract.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
|
|
2
|
-
export declare const CONTRACT_LEVEL = "1.
|
|
2
|
+
export declare const CONTRACT_LEVEL = "1.35";
|
|
3
3
|
/** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
|
|
4
4
|
export declare const REQUIRED_CONTRACT_HEADER = "Crouter-Required-Contract";
|
|
5
5
|
/** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
|
package/dist/api/contract.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var e=(r,t)=>c(r,"name",{value:t,configurable:!0});const f="1.
|
|
1
|
+
var c=Object.defineProperty;var e=(r,t)=>c(r,"name",{value:t,configurable:!0});const f="1.35",i="Crouter-Required-Contract",p="Crouter-Contract";function l(r){const t=/^(\d+)\.(\d+)$/.exec(r.trim());return t===null?null:{major:Number(t[1]),minor:Number(t[2])}}e(l,"parseContractLevel");function a(r){return r==null?[]:r.split(",").map(t=>l(t)).filter(t=>t!==null)}e(a,"parseServedContracts");function s(r,t){const n=l(r);return n===null?!1:(typeof t=="string"||t===null||t===void 0?a(t):t).some(u=>u.major===n.major&&u.minor>=n.minor)}e(s,"contractSatisfies");function C(r,t,n={}){if(r===void 0)return null;if(l(r)===null)return{status:400,code:"invalid_request",param:i,message:`${i} must be a contract level like 1.0.`};if(s(r,t))return null;const o=r.trim();return{status:426,code:"runtime_version_unsupported",message:t===null||a(t).length===0?`The runtime did not name its contract level; the caller requires contract ${o} or later. Roll the runtime forward.`:`The runtime serves contract ${t}; the caller requires contract ${o} or later within the same major. Roll the runtime forward, or pin an SDK whose crouterContract the runtime serves.`,details:{sdk_version:(n.legacyMinimum??"").trim(),runtime_version:n.runtimeVersion??null,required_contract:o,runtime_contract:t}}}e(C,"contractRefusal");export{p as CONTRACT_HEADER,f as CONTRACT_LEVEL,i as REQUIRED_CONTRACT_HEADER,C as contractRefusal,s as contractSatisfies,l as parseContractLevel,a as parseServedContracts};
|
|
@@ -7,7 +7,11 @@ export interface BashJobStatusDTO {
|
|
|
7
7
|
purpose: string | null;
|
|
8
8
|
started_at: IsoTime;
|
|
9
9
|
elapsed_ms: number;
|
|
10
|
-
/**
|
|
10
|
+
/** Blob prefix of the job's output chunks. */
|
|
11
|
+
output_key: string;
|
|
12
|
+
/** ISO time the job is canceled unless claimed, or null for a job that runs to completion. */
|
|
13
|
+
deadline_at: IsoTime | null;
|
|
14
|
+
/** Reported supervisor process group, or null before the first report. */
|
|
11
15
|
pgid: number | null;
|
|
12
16
|
/** Whether the persisted process group currently exists. */
|
|
13
17
|
pgid_alive: boolean;
|
|
@@ -26,7 +26,6 @@ export interface BrokerExecutionRequest {
|
|
|
26
26
|
}
|
|
27
27
|
export interface BrokerSettleRequest extends BrokerExecutionRequest {
|
|
28
28
|
stopReason: string;
|
|
29
|
-
backgroundJobsRunning: boolean;
|
|
30
29
|
pushedFinal: boolean;
|
|
31
30
|
}
|
|
32
31
|
/** `POST /v1/nodes/{id}/broker/telemetry` body. Tokens are cumulative within
|
|
@@ -47,6 +46,11 @@ export type BrokerSettleDirective = {
|
|
|
47
46
|
prompt: string;
|
|
48
47
|
} | {
|
|
49
48
|
action: 'stay_dormant';
|
|
49
|
+
}
|
|
50
|
+
/** Blaxel only: the broker stays running with nothing holding it. It posts `broker/idle` and closes its signal stream so
|
|
51
|
+
* the sandbox freezes with it; a wake thaws it. */
|
|
52
|
+
| {
|
|
53
|
+
action: 'stay_resident';
|
|
50
54
|
} | {
|
|
51
55
|
action: 'shutdown';
|
|
52
56
|
};
|
|
@@ -122,6 +126,8 @@ export type BrokerExtensionSubjectDTO = NodeSubjectDTO;
|
|
|
122
126
|
export interface BrokerExtensionStateDTO {
|
|
123
127
|
node: BrokerExtensionNodeDTO;
|
|
124
128
|
warm_spare: boolean;
|
|
129
|
+
/** Latest already-rendered situational card, or null. */
|
|
130
|
+
situational_card: string | null;
|
|
125
131
|
ancestors: BrokerExtensionNodeDTO[];
|
|
126
132
|
children: BrokerExtensionNodeDTO[];
|
|
127
133
|
fork_source: BrokerExtensionNodeDTO | null;
|
|
@@ -150,6 +156,24 @@ export type BrokerGeneratedNameRequest = BrokerExecutionRequest & ({
|
|
|
150
156
|
kind: string;
|
|
151
157
|
};
|
|
152
158
|
});
|
|
159
|
+
/** `POST /v1/nodes/{id}/broker/goal` body: a bare root's first message. The server stores it as the
|
|
160
|
+
* node's initial prompt only when that is still empty. */
|
|
161
|
+
export interface BrokerGoalRequest extends BrokerExecutionRequest {
|
|
162
|
+
text: string;
|
|
163
|
+
}
|
|
164
|
+
/** `GET /v1/nodes/{id}/broker/structured-request`: the node's pending structured-output request, or null. */
|
|
165
|
+
export interface BrokerStructuredRequestDTO {
|
|
166
|
+
request: {
|
|
167
|
+
request_id: string;
|
|
168
|
+
mode: 'terminal' | 'oneoff';
|
|
169
|
+
schema: Record<string, unknown>;
|
|
170
|
+
requestMessageId?: string;
|
|
171
|
+
} | null;
|
|
172
|
+
}
|
|
173
|
+
export interface BrokerGoalResultDTO {
|
|
174
|
+
/** True when this call stored the goal; false when the node already had one or the text was blank. */
|
|
175
|
+
captured: boolean;
|
|
176
|
+
}
|
|
153
177
|
/** A daemon-selected Pi editor-label directive. No handler calls a broker.
|
|
154
178
|
* `description`/`title`/`icon` are the values as STORED (an empty title or icon
|
|
155
179
|
* is left unset), so the broker announces what the node now carries rather than
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type ChargeKindDTO = 'model' | 'tool' | 'sandbox' | 'job' | 'storage' | 'take';
|
|
2
2
|
export type FundingDTO = 'bill' | 'subscription' | 'key' | 'endpoint' | 'take' | 'legacy';
|
|
3
|
-
export type LimitSourceDTO = 'grant_sync' | 'person' | 'operator';
|
|
3
|
+
export type LimitSourceDTO = 'grant_sync' | 'person' | 'operator' | 'billing' | 'card';
|
|
4
4
|
/** One charge row. Every field of the ledger's `charges` table. */
|
|
5
5
|
export interface ChargeDTO {
|
|
6
6
|
/** `receipt:<provider>:<receipt id>` for a tool charge; `legacy:…` for a migrated aggregate; otherwise a fresh id. */
|
|
@@ -37,11 +37,18 @@ export interface ChargeDTO {
|
|
|
37
37
|
limit: string;
|
|
38
38
|
reason: string;
|
|
39
39
|
} | null;
|
|
40
|
+
/** The principal Northlight invoices for this row; null when none or house-paid. */
|
|
41
|
+
account: string | null;
|
|
42
|
+
/** What Northlight bills for this row; null on a row it does not bill. */
|
|
43
|
+
billed_usd: number | null;
|
|
40
44
|
}
|
|
41
45
|
/** One limit row. A null filter means any. */
|
|
42
46
|
export interface LimitDTO {
|
|
43
47
|
id: string;
|
|
44
|
-
|
|
48
|
+
/** Null when `account` is set. */
|
|
49
|
+
payer: string | null;
|
|
50
|
+
/** Counts the account's own charges and those of the apps it holds. */
|
|
51
|
+
account: string | null;
|
|
45
52
|
funding: FundingDTO | null;
|
|
46
53
|
grantee: string | null;
|
|
47
54
|
provider: string | null;
|
|
@@ -61,10 +61,34 @@ export interface DeliveryResponse {
|
|
|
61
61
|
names?: string[];
|
|
62
62
|
plan?: unknown;
|
|
63
63
|
}
|
|
64
|
+
/** The broker backgrounded a command: the job row's start. `deadline_at_ms` arms the claim-or-cancel deadline of an automatic handoff. */
|
|
64
65
|
export interface BackgroundedJobRequest {
|
|
65
66
|
command: string;
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
purpose?: string | null;
|
|
68
|
+
deadline_at_ms?: number | null;
|
|
69
|
+
}
|
|
70
|
+
/** What the broker's reporter says about a job it runs, any subset: process identity, activity sample, exit (`vanished` when the process is gone without an exit record), and one output chunk (`seq` = chunk index, 64 KiB aligned; a growing last chunk is sent again whole). */
|
|
71
|
+
export interface JobReportRequest {
|
|
72
|
+
expected_execution_id: string;
|
|
73
|
+
pgid?: number;
|
|
74
|
+
pgid_identity?: string;
|
|
75
|
+
exit_code?: number;
|
|
76
|
+
vanished?: boolean;
|
|
77
|
+
activity?: {
|
|
78
|
+
last_ms: number;
|
|
79
|
+
sampled_ms: number;
|
|
80
|
+
files: string[];
|
|
81
|
+
};
|
|
82
|
+
output?: {
|
|
83
|
+
seq: number;
|
|
84
|
+
data_base64: string;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** The node's change to a running job: declare it an expected wait, or arm (`deadline_at_ms`) or drop (`keep`) its cancel deadline. */
|
|
88
|
+
export interface JobPatchRequest {
|
|
89
|
+
quiet_ok?: true;
|
|
90
|
+
deadline_at_ms?: number;
|
|
91
|
+
keep?: true;
|
|
68
92
|
}
|
|
69
93
|
export interface BackgroundedJobDTO {
|
|
70
94
|
id: string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface StartBundleRepositoryDTO {
|
|
2
|
+
name: string;
|
|
3
|
+
github_full_name: string;
|
|
4
|
+
default_branch: string;
|
|
5
|
+
}
|
|
6
|
+
export interface StartBundleRecipeDTO {
|
|
7
|
+
revision: number;
|
|
8
|
+
repositories: StartBundleRepositoryDTO[];
|
|
9
|
+
setup_script: string | null;
|
|
10
|
+
pi_packages: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface StartBundlePluginDTO {
|
|
13
|
+
name: string;
|
|
14
|
+
source: {
|
|
15
|
+
marketplace: {
|
|
16
|
+
url: string | null;
|
|
17
|
+
ref: string | null;
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
path: string;
|
|
21
|
+
};
|
|
22
|
+
version: string | null;
|
|
23
|
+
}
|
|
24
|
+
/** `GET /v1/executions/{execution_id}/start`. Read-only; safe to repeat. */
|
|
25
|
+
export interface StartBundleDTO {
|
|
26
|
+
/** The execution row's `launch_json`, parsed. */
|
|
27
|
+
launch: unknown;
|
|
28
|
+
/** `environment_id` is the environment the node runs in: the id `POST /v1/environments/{id}/git-credential` takes. */
|
|
29
|
+
node: {
|
|
30
|
+
id: string;
|
|
31
|
+
app: string;
|
|
32
|
+
cwd: string;
|
|
33
|
+
profile: string | null;
|
|
34
|
+
isolated: boolean;
|
|
35
|
+
environment_id: string;
|
|
36
|
+
};
|
|
37
|
+
/** Null when the node's environment has no recipe. */
|
|
38
|
+
recipe: StartBundleRecipeDTO | null;
|
|
39
|
+
/** The person's GitHub login and noreply address from the GitHub app; null when the environment has no recipe repositories or the person has no GitHub link. */
|
|
40
|
+
git_identity: {
|
|
41
|
+
name: string;
|
|
42
|
+
email: string;
|
|
43
|
+
} | null;
|
|
44
|
+
plugins_revision: number;
|
|
45
|
+
plugins: StartBundlePluginDTO[];
|
|
46
|
+
}
|
|
47
|
+
/** `POST /v1/environments/{id}/git-credential` body: what git asked for. */
|
|
48
|
+
export interface GitCredentialRequest {
|
|
49
|
+
host: string;
|
|
50
|
+
path?: string;
|
|
51
|
+
}
|
|
52
|
+
/** The answer git's credential helper prints. */
|
|
53
|
+
export interface GitCredentialDTO {
|
|
54
|
+
username: string;
|
|
55
|
+
password: string;
|
|
56
|
+
expiry: string;
|
|
57
|
+
}
|
|
File without changes
|
|
@@ -87,6 +87,11 @@ export interface ModelAuthReadinessDTO {
|
|
|
87
87
|
reason?: 'invalid_grant';
|
|
88
88
|
rate_limited_until?: string | null;
|
|
89
89
|
}
|
|
90
|
+
/** `PATCH /v1/model-auth/{provider}/accounts/{label}` — `label` renames the account; `preferred` moves it to the front of the pool. */
|
|
91
|
+
export interface PatchManagedAccountRequest {
|
|
92
|
+
label?: string;
|
|
93
|
+
preferred?: true;
|
|
94
|
+
}
|
|
90
95
|
/** `DELETE /v1/model-auth/{provider}` — all user credentials removed for one provider. */
|
|
91
96
|
export interface CredentialRemovalResultDTO {
|
|
92
97
|
provider: string;
|
|
@@ -16,6 +16,13 @@ export interface NodeTelemetryRecordRequest {
|
|
|
16
16
|
updated_at: string;
|
|
17
17
|
expected_execution_id: string;
|
|
18
18
|
}
|
|
19
|
+
/** `PUT /v1/nodes/{id}/records/summaries` body: the broker's generated tool-group summaries and consolidated
|
|
20
|
+
* turn replies, each a whole-record replacement keyed as the broker keeps them. An omitted record is left as stored. */
|
|
21
|
+
export interface NodeSummariesRecordRequest {
|
|
22
|
+
tool_summaries?: Record<string, unknown>;
|
|
23
|
+
turn_replies?: Record<string, unknown>;
|
|
24
|
+
expected_execution_id: string;
|
|
25
|
+
}
|
|
19
26
|
/** `PUT /v1/nodes/{id}/records/recap` body. */
|
|
20
27
|
export interface NodeRecapRecordRequest {
|
|
21
28
|
briefing: string;
|
|
@@ -33,3 +40,12 @@ export interface NodePushedFinalRequest {
|
|
|
33
40
|
export interface NodePushedFinalResultDTO {
|
|
34
41
|
pushedFinal: boolean;
|
|
35
42
|
}
|
|
43
|
+
/** One file of a run's attachments: where the broker puts it (the path the run's prompt names) and its content hash. */
|
|
44
|
+
export interface NodeAttachmentDTO {
|
|
45
|
+
path: string;
|
|
46
|
+
sha256: string;
|
|
47
|
+
}
|
|
48
|
+
/** `GET /v1/nodes/{id}/attachments` result: every upload the node's run has fetched into the blob store. */
|
|
49
|
+
export interface NodeAttachmentsDTO {
|
|
50
|
+
attachments: NodeAttachmentDTO[];
|
|
51
|
+
}
|
|
@@ -62,9 +62,6 @@ export type SubmitResultRequest = {
|
|
|
62
62
|
export interface SubmitResultDTO {
|
|
63
63
|
/** Which request this answered: `terminal` finished the node; `oneoff` left it working. */
|
|
64
64
|
mode: 'terminal' | 'oneoff';
|
|
65
|
-
/** Absolute path of the recorded artifact: context/result.json for an
|
|
66
|
-
* answered request, context/declined.json for a declined one. */
|
|
67
|
-
result_path: string;
|
|
68
65
|
/** Present only when the request was declined. */
|
|
69
66
|
declined?: DeclinedResultDTO;
|
|
70
67
|
/** Ref of the report document pushed alongside the result, `<node-id>/reports/<name>`. */
|
|
@@ -216,6 +216,12 @@ export interface NodeStatusChangedEvent extends RunEventBaseDTO {
|
|
|
216
216
|
status: NodeStatusDTO | 'dormant';
|
|
217
217
|
reason: string | null;
|
|
218
218
|
}
|
|
219
|
+
/** The node waits to start in an environment whose recipe image failed to build (D95). It stays dormant with its mail pending until a build succeeds. */
|
|
220
|
+
export interface EnvironmentImageFailedEvent extends RunEventBaseDTO {
|
|
221
|
+
type: 'environment.image_failed';
|
|
222
|
+
environment_id: string;
|
|
223
|
+
error: string;
|
|
224
|
+
}
|
|
219
225
|
/** The run settled (the root only; a child's settlement is `child.settled`). */
|
|
220
226
|
export interface NodeSettledEvent extends RunEventBaseDTO {
|
|
221
227
|
type: 'node.settled';
|
|
@@ -224,7 +230,7 @@ export interface NodeSettledEvent extends RunEventBaseDTO {
|
|
|
224
230
|
result?: unknown;
|
|
225
231
|
}
|
|
226
232
|
/** Every run event. Its `type`s are exactly the Vocabulary table of contract 2. */
|
|
227
|
-
export type RunEvent = RunStartedEvent | NodeSystemPromptSetEvent | NodeMessageAcceptedEvent | NodeTurnStartedEvent | NodeThinkingDeltaEvent | NodeThinkingDoneEvent | NodeOutputTextDeltaEvent | NodeOutputTextDoneEvent | NodeToolCallStartedEvent | NodeToolCallCompletedEvent | NodeTurnCompletedEvent | RunUsageEvent | NodeReportPushedEvent | ChildStartedEvent | ChildSettledEvent | WaitingOnUserEvent | QuestionAnsweredEvent | NodeStatusChangedEvent | NodeSettledEvent;
|
|
233
|
+
export type RunEvent = RunStartedEvent | NodeSystemPromptSetEvent | NodeMessageAcceptedEvent | NodeTurnStartedEvent | NodeThinkingDeltaEvent | NodeThinkingDoneEvent | NodeOutputTextDeltaEvent | NodeOutputTextDoneEvent | NodeToolCallStartedEvent | NodeToolCallCompletedEvent | NodeTurnCompletedEvent | RunUsageEvent | NodeReportPushedEvent | ChildStartedEvent | ChildSettledEvent | WaitingOnUserEvent | QuestionAnsweredEvent | NodeStatusChangedEvent | EnvironmentImageFailedEvent | NodeSettledEvent;
|
|
228
234
|
export type RunEventType = RunEvent['type'];
|
|
229
235
|
/** The run event of one `type`. */
|
|
230
236
|
export type RunEventOf<T extends RunEventType> = Extract<RunEvent, {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** One scope's bookkeeping: marketplace and plugin check times, the last self check and the selected remote canvas. */
|
|
2
|
+
export interface SettingsScopeStateDTO {
|
|
3
|
+
marketplaces: Record<string, {
|
|
4
|
+
last_updated?: string;
|
|
5
|
+
}>;
|
|
6
|
+
plugins: Record<string, {
|
|
7
|
+
last_updated?: string;
|
|
8
|
+
etag?: string;
|
|
9
|
+
checked_at?: string;
|
|
10
|
+
}>;
|
|
11
|
+
last_self_check?: string;
|
|
12
|
+
activeCanvas?: string | null;
|
|
13
|
+
}
|
|
14
|
+
/** A stored profile: its id and manifest (name, projects, pause time, default kind, grantee, environment, delivery limits, metadata). */
|
|
15
|
+
export interface SettingsProfileDTO {
|
|
16
|
+
profileId: string;
|
|
17
|
+
manifest: object;
|
|
18
|
+
}
|
|
19
|
+
export interface PersonSettingsSnapshotDTO {
|
|
20
|
+
profiles: SettingsProfileDTO[];
|
|
21
|
+
/** Project directory → profile id. */
|
|
22
|
+
defaults: Record<string, string>;
|
|
23
|
+
/** Owner key (`user`, `profile:<id>`) → raw settings, with the `plugins` and `marketplaces` blocks rebuilt from their rows. */
|
|
24
|
+
settings: Record<string, Record<string, unknown>>;
|
|
25
|
+
state: Record<string, SettingsScopeStateDTO>;
|
|
26
|
+
}
|
|
27
|
+
export type SettingsOpDTO = {
|
|
28
|
+
op: 'settings.replace';
|
|
29
|
+
owner: string;
|
|
30
|
+
raw: Record<string, unknown>;
|
|
31
|
+
ifRevision: string;
|
|
32
|
+
} | {
|
|
33
|
+
op: 'state.write';
|
|
34
|
+
owner: string;
|
|
35
|
+
state: SettingsScopeStateDTO;
|
|
36
|
+
} | {
|
|
37
|
+
op: 'profile.insert';
|
|
38
|
+
profile: SettingsProfileDTO;
|
|
39
|
+
} | {
|
|
40
|
+
op: 'profile.update';
|
|
41
|
+
profile: SettingsProfileDTO;
|
|
42
|
+
} | {
|
|
43
|
+
op: 'profile.delete';
|
|
44
|
+
profileId: string;
|
|
45
|
+
} | {
|
|
46
|
+
op: 'defaults.replace';
|
|
47
|
+
defaults: Record<string, string>;
|
|
48
|
+
};
|
|
49
|
+
export interface PersonSettingsDTO {
|
|
50
|
+
person: string;
|
|
51
|
+
snapshot: PersonSettingsSnapshotDTO;
|
|
52
|
+
}
|
|
53
|
+
export interface PutPersonSettingsRequest {
|
|
54
|
+
ops: SettingsOpDTO[];
|
|
55
|
+
}
|
|
File without changes
|