@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
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O=Object.defineProperty;var o=(e,t)=>O(e,"name",{value:t,configurable:!0});import{assertLaunchKind as c}from"../../../core/runtime/launch-target.js";import{listNodesByProfile as v,shiftProfileNodeDeadlines as q}from"../../../core/canvas/canvas.js";import{liveExecutionForNode as L}from"../../../core/canvas/executions.js";import{shiftJobDeadlines as $}from"../../../core/graph/jobs.js";import{boundFleet as S}from"../../../core/runtime/fleet.js";import{recordedPidLiveness as V}from"../../../core/canvas/pid.js";import{withCanvasWrite as w}from"../../../core/canvas/db.js";import{reposForCwd as F,warmCheckoutIdentities as M}from"../../../core/graph/repo-sync/repos.js";import{renameProfileObject as C}from"../../../core/graph/objects.js";import{usage as l}from"../../../core/errors.js";import{ApiError as f}from"../../../api/errors.js";import{scopeAllowed as E}from"../../../core/scopes.js";import{validateEnvVarName as R}from"../../../core/env-name.js";import{listProfileEnvNames as G,removeProfileEnvVar as U,setProfileEnvVar as K}from"../../../core/profiles/env-store.js";import{isDeploymentName as H,listAppEnvNames as B,removeAppEnvVar as W,setAppEnvVar as J}from"../../../core/profiles/app-env-store.js";import{addProfileProject as z,assertDeliveryLimits as Q,setProfileDeliveryLimit as g,assertProfileProjects as y,createProfile as j,ensureRootProfile as X,listProfiles as u,loadProfileManifest as h,pauseProfile as Y,removeProfileProject as Z,renameProfile as x,resumeProfile as ee,setProfileDefaultKind as te,updateProfileMetadata as ae}from"../../../core/profiles/manifest.js";import{requestProfileDeletion as ne}from"../../profile-delete.js";import{brokerSignalBus as re}from"../../broker-signals/bus.js";import{toProfileDTO as ie}from"../map.js";import{machineEnvironmentId as oe}from"../../../core/environments.js";import{actsAsPerson as _,appOf as b,resolvedScopes as se}from"../router.js";const T="root";function d(e){return{...ie(e),environment_id:e.manifest.environment_id??oe()}}o(d,"toProfileDTO");function m(e){return b(e.principal)??"app:terminal"}o(m,"callerApp");function A(e,t,n=null){if(u().some(a=>a.manifest.name===t&&a.profileId!==n&&(a.manifest.grantee??"app:terminal")===e))throw new f(400,"invalid_request",`${e} already has a profile named ${t}`)}o(A,"assertNameFree");async function p(e,t){const n=await k(e,t),a=n.manifest.grantee??"app:terminal";if(!_(e.principal)&&a!==b(e.principal))throw new f(403,"permission_error",`profile ${n.profileId} belongs to ${a}; only that app changes it`);return n}o(p,"requireOwnProfile");async function de(e){const t=e.body??{};if(typeof t.name!="string"||t.name.trim()==="")throw l("a profile name is required",{field:"name"});t.projects!==void 0&&y(t.projects);const n=m(e),a=t.name.trim();A(n,a),t.default_kind!==void 0&&await c(t.default_kind,process.cwd(),null);const r=await j(a,t.projects??[],{defaultKind:t.default_kind,metadata:t.metadata,grantee:n});return{status:201,body:d(r)}}o(de,"handleCreate");async function le(e,t){const n=t.trim();if(n==="")throw l("profile name must not be empty");return await w(async a=>(await C(a,e,n),await x(e,n)))}o(le,"renameProfileAndHandle");async function fe(e,t,n){await M(n);const a=await w(async r=>(await F(r,n)).map(i=>i.name));await z(e,n);for(const r of a)t[r]===void 0&&t[`repo:${r}`]===void 0&&await g(e,r,"preview")}o(fe,"addProjectWithDefaultLimit");async function pe(e){const{profileId:t,manifest:n}=await p(e,e.params.name),a=e.body??{};return a.name!==void 0&&A(n.grantee??"app:terminal",a.name.trim(),t),a.default_kind!==void 0&&await c(a.default_kind,process.cwd(),t),a.add_project!==void 0&&y([a.add_project]),a.set_delivery_limit!==void 0&&Q({[a.set_delivery_limit.owner]:a.set_delivery_limit.level}),a.name!==void 0&&await le(t,a.name),a.default_kind!==void 0&&await te(t,a.default_kind),a.add_project!==void 0&&await fe(t,n.delivery_limits??{},a.add_project.path),a.set_delivery_limit!==void 0&&await g(t,a.set_delivery_limit.owner,a.set_delivery_limit.level),a.remove_project!==void 0&&await Z(t,a.remove_project),{status:200,body:d(h(t))}}o(pe,"handleUpdate");async function me(e){const{profileId:t}=await p(e,e.params.name);return{status:200,body:{profile_id:t,names:await G(t)}}}o(me,"handleEnvList");function P(e){const t=e.params.var,n=R(t);if(!n.isValid)throw l(`invalid env var name: ${n.errors.join("; ")}`,{field:"name",received:t});return t}o(P,"requireEnvVarName");function I(e){const t=P(e);if(H(t)&&!_(e.principal))throw new f(403,"permission_error",`${t} is deployment-wide; only a person changes it`);return t}o(I,"requireSelfEnvVarName");async function ue(e){const{profileId:t}=await p(e,e.params.name),n=P(e),{value:a}=e.body??{};if(typeof a!="string"||a==="")throw l("a non-empty env value is required",{field:"value"});return{status:200,body:{profile_id:t,changed:await K(t,n,a)}}}o(ue,"handleEnvSet");async function ce(e){const{profileId:t}=await p(e,e.params.name),n=P(e);return{status:200,body:{profile_id:t,changed:await U(t,n)}}}o(ce,"handleEnvRemove");async function ve(e){const t=e.params.name,n=e.body??{};n.projects!==void 0&&y(n.projects);const a=m(e);if(t===T&&a==="app:terminal")return{status:200,body:d(await X())};if(t===T)throw new f(403,"permission_error","root belongs to the terminal app");const r=u().find(s=>s.manifest.name===t&&(s.manifest.grantee??"app:terminal")===a);if(r!==void 0)return{status:200,body:d(r)};n.default_kind!==void 0&&await c(n.default_kind,process.cwd(),null);const i=await j(t,n.projects??[],{defaultKind:n.default_kind,metadata:n.metadata,grantee:a});return{status:200,body:d(i)}}o(ve,"handleEnsure");async function we(e){const t=await p(e,e.params.name),n=e.body??{};if(typeof n!="object"||n===null||Array.isArray(n))throw l("profile metadata body must be an object",{field:"body"});const a=n,r=a.unset===void 0?[]:a.unset;if(!Array.isArray(r)||r.some(N=>typeof N!="string"))throw l("profile metadata `unset` must be an array of strings",{field:"unset"});const i=a.set===void 0?{}:a.set,s=await ae(t.profileId,i,r);return{status:200,body:d(s)}}o(we,"handleSetMetadata");async function ye(e){const t=h(e.params.name),n=await Y(t.profileId),a=(await v(t.profileId)).filter(i=>i.status==="active"||i.status==="idle");if(a.length===0)return{status:200,body:{profile_id:t.profileId,paused_at:n.manifest.paused_at}};const r=S();for(const i of a){const s=r.get(i.node_id);if(s!==void 0){await r.interruptForProfilePause(i.node_id,s.pid);continue}i.pi_pid!=null&&V(i.pi_pid,i.pi_pid_identity)==="alive"&&await r.interruptForProfilePause(i.node_id,i.pi_pid)}return{status:200,body:{profile_id:t.profileId,paused_at:n.manifest.paused_at}}}o(ye,"handlePause");async function he(e){const t=h(e.params.name),n=await ee(t.profileId);for(const a of await v(t.profileId))(a.status==="active"||a.status==="idle"||await L(a.node_id)!==null)&&re.markMail(a.node_id);if(n.pausedAt!==null){const a=Date.parse(n.pausedAt);if(!Number.isNaN(a)){const r=Math.max(0,Date.now()-a);await q(t.profileId,r);for(const i of await v(t.profileId))i.status!=="dead"&&await w(s=>$(s,i.node_id,r))}}return{status:200,body:{profile_id:t.profileId,paused_at:n.manifest.paused_at}}}o(he,"handleResume");async function D(e){const t=e.principal;if(_(t))return u();const n=await se(t);return u().filter(({profileId:a,manifest:r})=>{const i=r.grantee??"app:terminal";if(i===b(t))return!0;const s=`crtr:memory:rw:${i}:profile:${a}`;return E(n,s)&&(t.class!=="broker"||E(t.scopes,s))})}o(D,"visibleProfiles");async function k(e,t){const n=await D(e),a=n.find(({profileId:i})=>i===t),r=a?[a]:n.filter(({manifest:i})=>i.name===t);if(r.length===0)throw new f(404,"not_found","profile not found");if(r.length>1)throw new f(400,"ambiguous","profile name matches multiple visible profiles; use an exact id");return r[0]}o(k,"requireUsableProfile");async function _e(e){return{status:200,body:(await D(e)).map(d)}}o(_e,"handleList");async function be(e){return{status:200,body:d(await k(e,e.params.name))}}o(be,"handleGet");async function Pe(e){return ne((await p(e,e.params.name)).profileId,e.body)}o(Pe,"handleDelete");const He=[{method:"GET",pattern:"/v1/apps/self/env",handler:o(async e=>({status:200,body:{names:await B(m(e))}}),"handler")},{method:"PUT",pattern:"/v1/apps/self/env/:var",handler:o(async e=>{const t=I(e),{value:n}=e.body??{};if(typeof n!="string"||!n)throw l("a non-empty env value is required",{field:"value"});return{status:200,body:{changed:await J(m(e),t,n)}}},"handler")},{method:"DELETE",pattern:"/v1/apps/self/env/:var",handler:o(async e=>({status:200,body:{changed:await W(m(e),I(e))}}),"handler")},{method:"PUT",pattern:"/v1/profiles/:name",handler:ve},{method:"POST",pattern:"/v1/profiles/:name/pause",ownerOnly:!0,handler:ye},{method:"POST",pattern:"/v1/profiles/:name/resume",ownerOnly:!0,handler:he},{method:"PATCH",pattern:"/v1/profiles/:name/metadata",handler:we},{method:"POST",pattern:"/v1/profiles",handler:de},{method:"PATCH",pattern:"/v1/profiles/:name",handler:pe},{method:"GET",pattern:"/v1/profiles/:name/env",handler:me},{method:"PUT",pattern:"/v1/profiles/:name/env/:var",handler:ue},{method:"DELETE",pattern:"/v1/profiles/:name/env/:var",handler:ce},{method:"DELETE",pattern:"/v1/profiles/:name",handler:Pe},{method:"GET",pattern:"/v1/profiles",handler:_e},{method:"GET",pattern:"/v1/profiles/:name",handler:be}];export{fe as addProjectWithDefaultLimit,He as profileRoutes,le as renameProfileAndHandle,k as requireUsableProfile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var R=Object.defineProperty;var i=(e,r)=>R(e,"name",{value:r,configurable:!0});import{randomUUID as I}from"node:crypto";import{readConfig as $}from"../../../core/config.js";import{activeGrantForApp as O,grantFor as q,localGrants as w}from"../../../core/grants/mirror.js";import{getNode as G}from"../../../core/canvas/canvas.js";import{scopeAllowed as N}from"../../../core/scopes.js";import{ProviderError as u,providerErrorBody as T,scopeMissing as F}from"../../../core/providers/errors.js";import{callProvider as x,providerTools as C}from"../../../core/providers/call.js";import{providerIdsFromGrants as j,providerInstallState as k}from"../../../core/providers/bundles.js";import{providerRootClaims as B,resolveProviderRef as D}from"../../../core/providers/roots.js";import{listInstalledPlugins as M}from"../../../core/resolver.js";import{listAudit as U,writeProviderAudit as z}from"../../../core/providers/audit.js";import{emitEvent as b}from"../../../core/events/emit.js";import{resolvedScopes as _}from"../router.js";const we=new Set(["provider.tools","provider.call","audit.list"]);async function L(e){if(e.class==="forwarded"){if(e.actor.kind==="person")return{class:"person",sub:null,grantee:null,client_id:null,resolved:null,nodeScopes:null,run_id:null,node_id:null,origin:{node:null,run:null,machine:e.via}};const r=await q(e.actor.app,e.sub);if(!r)throw new u("grant_revoked",`app ${e.actor.app} has no active grant`);return{class:"app",sub:e.sub,grantee:e.actor.app,client_id:null,resolved:r.resolved,nodeScopes:e.actor.node_scopes,run_id:null,node_id:null,origin:{node:e.actor.node,run:e.actor.place?.run??null,machine:e.via}}}if(e.class==="machine")throw new u("permission_error","this operation is not available to the caller");if(e.class==="person")return{class:"person",sub:null,grantee:null,client_id:null,resolved:null,nodeScopes:null,run_id:null,node_id:null};if(e.class==="app"){const r=await O(e.app);if(!r)throw new u("grant_revoked",`app ${e.app} has no active grant`);return{class:"app",sub:r.sub,grantee:e.app,client_id:null,resolved:r.resolved,nodeScopes:e.scopes,run_id:null,node_id:null}}return e.class==="cron"?{class:"app",sub:e.sub,grantee:e.app,client_id:null,resolved:await _(e),nodeScopes:e.scopes,run_id:e.origin_run,node_id:null}:{class:"broker",sub:e.sub,grantee:e.app,client_id:e.client_id,resolved:await _(e),nodeScopes:e.scopes,run_id:e.run??(await G(e.node))?.run_id??null,node_id:e.node}}i(L,"callerFromRequest");function be(e){return{class:"app",sub:e.sub,grantee:e.grantee,client_id:e.client_id,resolved:e.resolved,nodeScopes:null,run_id:null,node_id:null}}i(be,"callerFromApp");const V=/^([A-Za-z0-9_-]{1,64}):([A-Za-z0-9_-]{1,64})$/;function Z(e){const r=V.exec(e);return r!==null&&r[1]!=="crtr"}i(Z,"isProviderScope");const g=new WeakMap;function W(e){let r=g.get(e);return r===void 0&&(r=new Set(e),g.set(e,r)),r}i(W,"heldSet");function y(e,r){return e===null?!0:Z(r)?W(e).has(r):N(e,r)}i(y,"holds");function S(e,r){return e.class==="person"?!0:y(e.resolved??[],r)&&y(e.nodeScopes,r)}i(S,"callerAllows");function _e(e,r,t){const o=`${r}:${t}`;if(!S(e,o))throw F(o)}i(_e,"requireGroup");function J(){return!!$("user").runtime?.issuer}i(J,"providerOperationsEnabled");const X=/^[A-Za-z0-9_-]{1,64}$/;function m(e,r){return new u("invalid_request",e,{param:r})}i(m,"invalid");function A(e){if(typeof e!="string"||!X.test(e)||e==="crtr")throw m("provider must be a provider id","provider");return e}i(A,"parseProvider");function H(e){if(!e||typeof e!="object"||Array.isArray(e))throw new u("invalid_request","a JSON object is required");const r=e,t=A(r.provider),o=r.tool;if(typeof o!="string"||!o.trim())throw m("tool must be a non-empty string","tool");const a=r.arguments??{};if(!a||typeof a!="object"||Array.isArray(a))throw m("arguments must be an object","arguments");const d=r.version;if(d!==void 0&&(typeof d!="number"||!Number.isInteger(d)||d<1))throw m("version must be an integer >= 1","version");const n=r.approval;if(n!==void 0&&(typeof n!="string"||!n))throw m("approval must be a question id","approval");const l=r.machine;if(l!==void 0&&(typeof l!="string"||!l.trim()))throw m("machine must be a machine id","machine");return{provider:t,tool:o.trim(),arguments:a,...d===void 0?{}:{version:d},...n===void 0?{}:{approval:n},...l===void 0?{}:{machine:l.trim()}}}i(H,"parseCallInput");async function K(e,r=new URLSearchParams){const t=i((n,l,
|
|
1
|
+
var R=Object.defineProperty;var i=(e,r)=>R(e,"name",{value:r,configurable:!0});import{randomUUID as I}from"node:crypto";import{readConfig as $}from"../../../core/config.js";import{activeGrantForApp as O,grantFor as q,localGrants as w}from"../../../core/grants/mirror.js";import{getNode as G}from"../../../core/canvas/canvas.js";import{scopeAllowed as N}from"../../../core/scopes.js";import{ProviderError as u,providerErrorBody as T,scopeMissing as F}from"../../../core/providers/errors.js";import{callProvider as x,providerTools as C}from"../../../core/providers/call.js";import{providerIdsFromGrants as j,providerInstallState as k}from"../../../core/providers/bundles.js";import{providerRootClaims as B,resolveProviderRef as D}from"../../../core/providers/roots.js";import{listInstalledPlugins as M}from"../../../core/resolver.js";import{listAudit as U,writeProviderAudit as z}from"../../../core/providers/audit.js";import{emitEvent as b}from"../../../core/events/emit.js";import{resolvedScopes as _}from"../router.js";const we=new Set(["provider.tools","provider.call","audit.list"]);async function L(e){if(e.class==="forwarded"){if(e.actor.kind==="person")return{class:"person",sub:null,grantee:null,client_id:null,resolved:null,nodeScopes:null,run_id:null,node_id:null,origin:{node:null,run:null,machine:e.via}};const r=await q(e.actor.app,e.sub);if(!r)throw new u("grant_revoked",`app ${e.actor.app} has no active grant`);return{class:"app",sub:e.sub,grantee:e.actor.app,client_id:null,resolved:r.resolved,nodeScopes:e.actor.node_scopes,run_id:null,node_id:null,origin:{node:e.actor.node,run:e.actor.place?.run??null,machine:e.via}}}if(e.class==="machine")throw new u("permission_error","this operation is not available to the caller");if(e.class==="person"&&e.sub!==void 0)throw new u("permission_error","provider calls are made by the install's person, a node or an app");if(e.class==="person")return{class:"person",sub:null,grantee:null,client_id:null,resolved:null,nodeScopes:null,run_id:null,node_id:null};if(e.class==="app"){const r=await O(e.app);if(!r)throw new u("grant_revoked",`app ${e.app} has no active grant`);return{class:"app",sub:r.sub,grantee:e.app,client_id:null,resolved:r.resolved,nodeScopes:e.scopes,run_id:null,node_id:null}}return e.class==="cron"?{class:"app",sub:e.sub,grantee:e.app,client_id:null,resolved:await _(e),nodeScopes:e.scopes,run_id:e.origin_run,node_id:null}:{class:"broker",sub:e.sub,grantee:e.app,client_id:e.client_id,resolved:await _(e),nodeScopes:e.scopes,run_id:e.run??(await G(e.node))?.run_id??null,node_id:e.node}}i(L,"callerFromRequest");function be(e){return{class:"app",sub:e.sub,grantee:e.grantee,client_id:e.client_id,resolved:e.resolved,nodeScopes:null,run_id:null,node_id:null}}i(be,"callerFromApp");const V=/^([A-Za-z0-9_-]{1,64}):([A-Za-z0-9_-]{1,64})$/;function Z(e){const r=V.exec(e);return r!==null&&r[1]!=="crtr"}i(Z,"isProviderScope");const g=new WeakMap;function W(e){let r=g.get(e);return r===void 0&&(r=new Set(e),g.set(e,r)),r}i(W,"heldSet");function y(e,r){return e===null?!0:Z(r)?W(e).has(r):N(e,r)}i(y,"holds");function S(e,r){return e.class==="person"?!0:y(e.resolved??[],r)&&y(e.nodeScopes,r)}i(S,"callerAllows");function _e(e,r,t){const o=`${r}:${t}`;if(!S(e,o))throw F(o)}i(_e,"requireGroup");function J(){return!!$("user").runtime?.issuer}i(J,"providerOperationsEnabled");const X=/^[A-Za-z0-9_-]{1,64}$/;function m(e,r){return new u("invalid_request",e,{param:r})}i(m,"invalid");function A(e){if(typeof e!="string"||!X.test(e)||e==="crtr")throw m("provider must be a provider id","provider");return e}i(A,"parseProvider");function H(e){if(!e||typeof e!="object"||Array.isArray(e))throw new u("invalid_request","a JSON object is required");const r=e,t=A(r.provider),o=r.tool;if(typeof o!="string"||!o.trim())throw m("tool must be a non-empty string","tool");const a=r.arguments??{};if(!a||typeof a!="object"||Array.isArray(a))throw m("arguments must be an object","arguments");const d=r.version;if(d!==void 0&&(typeof d!="number"||!Number.isInteger(d)||d<1))throw m("version must be an integer >= 1","version");const n=r.approval;if(n!==void 0&&(typeof n!="string"||!n))throw m("approval must be a question id","approval");const l=r.machine;if(l!==void 0&&(typeof l!="string"||!l.trim()))throw m("machine must be a machine id","machine");return{provider:t,tool:o.trim(),arguments:a,...d===void 0?{}:{version:d},...n===void 0?{}:{approval:n},...l===void 0?{}:{machine:l.trim()}}}i(H,"parseCallInput");async function K(e,r=new URLSearchParams){const t=i((n,l,p)=>{const f=r.get(n);if(f===null)return l;if(!/^\d+$/.test(f)||Number(f)>p||Number(f)<1)throw m(`invalid ${n}`,n);return Number(f)},"numeric"),o=r.has("after")?t("after",0,Number.MAX_SAFE_INTEGER):void 0,a=t("limit",100,1e3),d=Object.fromEntries(["operation","outcome","run_id","since","until"].filter(n=>r.has(n)).map(n=>[n,r.get(n)]));return{status:200,body:await U(e.class==="person"?null:e.grantee,{after:o,limit:a,...d})}}i(K,"auditList");async function Q(e,r,t){let o=r;const a=performance.now(),d=M("user"),{skipped:n}=B(d),l=new Set(d.filter(s=>s.enabled&&s.manifest.provider?.id===s.name&&!n.has(s.name)).map(s=>s.name)),p=j(await w()).filter(s=>!n.has(s)),f=[...new Set([...l,...p])].sort();if(o!==void 0){const s=D(o);if(s===null)throw new u("not_found",`provider "${o}" is not available`);o=s}if(o!==void 0&&!f.includes(o))throw new u("not_found",`provider "${o}" is not available`);const E=o===void 0?f:[o],P=e.class==="person"?(await w()).flatMap(s=>s.status==="active"?s.resolved_scopes.map(({scope:c})=>c):[]):e.resolved??[],v=await Promise.all(E.map(async s=>{if(l.has(s))return C(e,s);if(!P.some(h=>h.startsWith(`${s}:`)&&S(e,h)))return null;const c=k(s);return{provider:s,display_name:s,status:c.status,...c.error?{error:c.error}:{},groups:[],commands:[]}})).then(s=>s.filter(c=>c!==null));if(b({level:"debug",event:"api.provider.tools",duration_ms:performance.now()-a,fields:{caller:e.class,provider:o??null,providers:v.length}}),o!==void 0){if(v.length===0)throw new u("not_found",`provider "${o}" is not available`);return{status:200,body:v[0]}}return{status:200,body:{providers:v}}}i(Q,"providerTools");async function Y(e,r,t){return x(e,r,t)}i(Y,"providerCall");async function ee(e,r,t,o){if(!J())throw new u("not_found","provider operations need a directory-connected runtime");if(e==="audit.list")return await K(r,t.query);if(e==="provider.tools")return Q(r,t.params.provider===void 0?void 0:A(t.params.provider),o);if(e==="provider.call"){let a;try{a=H(t.body)}catch(d){const n=t.body&&typeof t.body=="object"&&!Array.isArray(t.body)?t.body:{};throw await z({request_id:o.requestId,caller:r,provider:typeof n.provider=="string"?n.provider:"",tool:typeof n.tool=="string"?n.tool:"",outcome:`refused:${d instanceof u?d.code:"invalid_request"}`}),d}return Y(r,a,o)}throw new u("not_found","unknown operation")}i(ee,"handleProviderOperation");function re(e){const r=new AbortController,t=i(()=>{e.writableFinished||r.abort()},"abort");return e.on("close",t),{signal:r.signal,release:i(()=>e.off("close",t),"release")}}i(re,"abortOnClose");function oe(e,r,t,o){const a=T(e,r,t,o??void 0);return a.status>=500&&!(e instanceof u)&&b({event:"api.provider.failed",level:"error",error:e instanceof Error?e:new Error(String(e)),fields:{request_id:r}}),a}i(oe,"providerFailure");const ge=[{method:"GET",pattern:"/v1/audit",name:"audit.list"},{method:"GET",pattern:"/v1/providers/tools",name:"provider.tools"},{method:"GET",pattern:"/v1/providers/:provider/tools",name:"provider.tools"},{method:"POST",pattern:"/v1/provider/call",name:"provider.call"}].map(({method:e,pattern:r,name:t})=>({method:e,pattern:r,handler:i(async o=>{const a=I(),{signal:d,release:n}=re(o.res);let l=null;try{return l=await L(o.principal),{...await ee(t,l,{params:o.params,body:o.body,query:new URL(o.req.url??"/","http://runtime.local").searchParams},{requestId:a,signal:d,...o.causedBy===void 0?{}:{causedBy:o.causedBy}}),headers:{"Request-Id":a}}}catch(p){return oe(p,a,!1,l?.run_id)}finally{n()}},"handler")}));export{we as PROVIDER_OPERATIONS,re as abortOnClose,S as callerAllows,be as callerFromApp,L as callerFromRequest,ee as handleProviderOperation,H as parseCallInput,A as parseProvider,oe as providerFailure,J as providerOperationsEnabled,ge as providerRoutes,_e as requireGroup};
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
\u2026 (truncated \u2014 the full result is at the result path above)`:n;return`Structured output submitted.
|
|
3
|
-
|
|
4
|
-
Result path: ${t}
|
|
1
|
+
var P=Object.defineProperty;var a=(t,e)=>P(t,"name",{value:e,configurable:!0});import{existsSync as D}from"node:fs";import{getNode as d}from"../../../core/canvas/canvas.js";import{liveExecutionForNode as B}from"../../../core/canvas/executions.js";import{markStopSignal as M}from"../../../core/runtime/stop-signals.js";import{emitEvent as j}from"../../../core/events/emit.js";import{push as J,FinalizationError as k,StructuredRequestFinalizationError as z}from"../../../core/feed/feed.js";import{branchIsPushedAtCurrentTip as L,hasOpenManagedWorktree as W,missingWorktreeRecoveryHint as H}from"../../../core/worktree.js";import{autoDropCleanManagedWorktreeAsync as X}from"../../../core/worktree-mutation-async.js";import{withCanvasWrite as G,openDb as K}from"../../../core/canvas/db.js";import{get as U}from"../../../core/graph/bodies.js";import{heads as V}from"../../../core/graph/documents.js";import{listObjects as Y,nodeObject as Q}from"../../../core/graph/objects.js";import{readerFor as Z}from"../../../core/graph/reader.js";import{notFound as ee,usage as l}from"../../../core/errors.js";import{InputError as u}from"../../../core/io.js";import{toReportResultDTO as te}from"../map.js";import{validateStructuredResult as re}from"../../../core/runtime/structured-output.js";import{clearSchemaReprompts as ne}from"../../../core/runtime/output-result.js";import{getPendingStructuredRequestForNode as _,getStructuredRequest as S,settleStructuredRequestIn as ie}from"../../../core/canvas/structured-requests.js";import{ApiError as h}from"../../../api/errors.js";import{applySettlementEffects as R}from"../../structured-requests/effects.js";import{nodeEventStreams as x}from"./node-events.js";import{emitRunEvent as E}from"../../../core/runs/events.js";import{mapAsync as oe}from"../../../core/async-array.js";async function g(t){const e=await d(t);if(e===null)throw ee(`unknown node: ${t}`,{received:t});return e}a(g,"requireNode");function ae(t){if(typeof t!="object"||t===null)throw l("a push report requires a JSON body { tier, body }");const e=t.tier,i=t.delivery_tier,r=t.body;if(e!=="update"&&e!=="urgent"&&e!=="final")throw l(`invalid report tier: ${String(e)} (expected update|urgent|final)`);if(i!==void 0&&i!=="deferred"&&i!=="normal"&&i!=="urgent")throw l(`invalid delivery_tier: ${String(i)} (expected deferred|normal|urgent)`);if(e!=="update"&&i!==void 0)throw l("delivery_tier is only valid for update reports");if(typeof r!="string"||r.trim()==="")throw l("a push report requires a non-empty body");return{tier:e,...i===void 0?{}:{delivery_tier:i},body:r}}a(ae,"parsePushBody");async function se(t){const e=t.params.id;await g(e);const i=ae(t.body);if(i.tier==="final"&&await _(e)!==null)throw new u({error:"structured_result_pending",message:"This node owes a structured result \u2014 a plain `push final` would finish it without recording one.",next:'Submit the result with the `submit_result` tool instead (or `crtr push result`); it validates against the pending schema, records it, and pushes the final report for you. If the schema cannot be honestly satisfied, call `submit_result` with `decline` (or `crtr push result --decline "<reason>" --code <token>`) to record the decline and finish the node.'});const r=i.tier==="final"?(await d(e))?.status:void 0,n=i.tier==="final"?await O(e):void 0,o=await b(e,i);i.tier==="final"&&await A(e);const s=i.tier==="final"&&r!==void 0?{from:r,to:(await d(e))?.status??"done"}:void 0,f=te(o,s,n),m=(await q(e)).find(p=>p.id===o.reportId);if(m!==void 0){x.report(e,m);const p=(await d(e))?.run_id;p&&await E(p,e,"node.report.pushed",{body:m.body,kind:m.tier==="final"?"final":"update"})}return{status:200,body:f}}a(se,"handlePush");async function O(t){if(!W(await d(t)))return;const e=await X(t);if(e!==null)return e.worktree_path;if(!await L((await d(t)).managed_worktree))throw new u({error:"open_managed_worktree",message:"This node still owns an open managed worktree that is neither clean and locally landed nor clean with its exact tip on origin \u2014 `push final` cannot finish.",next:await(async()=>{const i=(await d(t))?.managed_worktree;return i!=null&&i.state==="open"&&!D(i.path)?H(i):"Make the recorded worktree clean, including untracked files: commit work to retain and remove or ignore only disposable generated files. With its recorded branch checked out and no rebase in progress, push its current tip to a branch on origin, then rerun `crtr push final`; or run `crtr node worktree close` to land the clean worktree into its recorded local base."})()})}a(O,"guardFinalWorktree");const $=2e3;function de(t){const e=JSON.stringify(t,null,2);return`Structured output submitted.
|
|
5
2
|
|
|
6
3
|
\`\`\`json
|
|
7
|
-
${
|
|
4
|
+
${e.length>$?`${e.slice(0,$)}
|
|
5
|
+
\u2026 (truncated \u2014 the full result is on the structured request)`:e}
|
|
8
6
|
\`\`\`
|
|
9
|
-
`}
|
|
10
|
-
|
|
11
|
-
Reason: ${e.reason}
|
|
12
|
-
Code: ${e.code}
|
|
13
|
-
Retryable: ${e.retryable?"yes":"no"}
|
|
7
|
+
`}a(de,"submitReportBody");function ue(t){return`Structured result declined.
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
Reason: ${t.reason}
|
|
10
|
+
Code: ${t.code}
|
|
11
|
+
Retryable: ${t.retryable?"yes":"no"}
|
|
12
|
+
`}a(ue,"declineReportBody");const I=1024,N=64;async function ce(t,e){if(typeof t!="object"||t===null)throw l("a result submission requires a JSON body { value } or { decline, code, retryable }");const i=t.request_id;if(typeof i!="string"||i.trim()===""){const o=await _(e);throw new u({error:"request_id_required",message:`a structured result requires request_id${o===null?"":` (pending request: ${o.request_id})`}`,next:"Pass `--request <request-id>` exactly as named in the structured-output instruction."})}const r=Object.hasOwn(t,"value"),n=Object.hasOwn(t,"decline");if(r&&n)throw l("a result submission carries either { value } or { decline, code, retryable }, not both");if(n){const{decline:o,code:s,retryable:f}=t;if(typeof o!="string"||o.trim()==="")throw new u({error:"missing_decline_reason",message:"A decline needs a reason.",next:'Rerun with `--decline "<one sentence on why the schema cannot be honestly satisfied>" --code <token>`.'});if(o.length>I)throw new u({error:"decline_reason_too_long",message:`A decline reason is at most ${I} characters (got ${o.length}).`,next:"Keep the reason to one plain sentence; put any detail in an artifact and name its path."});if(typeof s!="string"||s.trim()===""||/\s/.test(s.trim())||s.trim().length>N)throw new u({error:"invalid_decline_code",message:`A decline needs a code: one whitespace-free token of at most ${N} characters naming the decline class.`,next:"Rerun with `--code <token>` \u2014 the token your requester documented for this case."});if(typeof f!="boolean")throw l("a decline carries `retryable` as a boolean");return{requestId:i.trim(),declined:{reason:o.trim(),code:s.trim(),retryable:f}}}if(!r)throw l("a result submission requires a JSON body { value } or { decline, code, retryable }");return{requestId:i.trim(),value:t.value}}a(ce,"parseSubmitBody");const le=1024*1024;async function fe(t){const e=t.params.id,i=await g(e);await _(e)!==null&&await ne(e);const r=await ce(t.body,e),n=await S(r.requestId);if(n===null||n.node_id!==e)throw new h(404,"structured_request_not_found","the named structured request does not belong to this node");if(n.state!=="pending")throw new h(409,n.state==="expired"?"structured_request_expired":"structured_request_settled",`structured request ${n.request_id} is already ${n.state}`);let o;if("value"in r){if(Buffer.byteLength(JSON.stringify(r.value)??"")>le)throw new u({error:"result_too_large",message:"the submitted result is over 1 MiB serialized; nothing was recorded.",next:"Submit a smaller result \u2014 write bulky content to a file and put its path in the result."});try{o=await re(n.schema,r.value)}catch(c){throw new u({error:"result_schema_mismatch",message:`the submitted result does not match the requested schema: ${c.message}`,next:'Fix the listed fields and submit again; if the schema cannot be honestly satisfied, decline it (`submit_result` with `decline`, or `crtr push result --decline "<reason>" --code <token>`).'})}}const s="declined"in r?ue(r.declined):de(o);if(n.submission==="oneoff"){const c=await G(async C=>await ie(C,n.request_id,"declined"in r?{intended:"declined",declined:r.declined}:{intended:"completed",result:o}));if(!c.changed||c.row===null||c.row.state!=="completed"&&c.row.state!=="declined")throw new h(409,c.row?.state==="expired"?"structured_request_expired":"structured_request_settled",`structured request ${n.request_id} is already ${c.row?.state??"settled"}`);await R(c.row);const y=await b(e,{tier:"update",body:s},void 0,{requestMessageId:n.request_message_id});return await T(e,y.reportId),{status:200,body:{mode:n.submission,report:y.report,notified:[...y.deliveredTo],..."declined"in r?{declined:r.declined}:{}}}}const f=(await d(e))?.status,m=await O(e),p="declined"in r?{kind:"failure",reason:"declined",detailJson:JSON.stringify({schema:"crtr.node-outcome-detail/v1",message:r.declined.reason,declined:r.declined}),structured:{requestId:n.request_id,declined:r.declined,skipEffects:!0}}:{structured:{requestId:n.request_id,value:o,skipEffects:!0}},w=await b(e,{tier:"final",body:s},p);await A(e);const F=await S(n.request_id);await R(F),await T(e,w.reportId);const v=f===void 0?void 0:{from:f,to:(await d(e))?.status??"done"};return{status:200,body:{mode:n.submission,report:w.report,notified:[...w.deliveredTo],..."declined"in r?{declined:r.declined}:{},...v===void 0?{}:{transitioned:v},...m===void 0?{}:{worktree_auto_dropped:!0,worktree_auto_dropped_path:m}}}}a(fe,"handleSubmitResult");async function T(t,e){const i=(await q(t)).find(n=>n.id===e);if(i===void 0)return;x.report(t,i);const r=(await d(t))?.run_id;r&&await E(r,t,"node.report.pushed",{body:i.body,kind:i.tier==="final"?"final":"update"})}a(T,"emitReportEvents");async function A(t){try{const e=await B(t);e!==null&&M(t,"pushedFinal",e.executionId)}catch(e){try{j({event:"daemon.node.final-marker.failed",level:"error",node_id:t,error:e})||process.stderr.write(`final marker failed for ${t}: ${String(e)}
|
|
17
13
|
`)}catch{process.stderr.write(`final marker failed for ${t}: ${String(e)}
|
|
18
|
-
`)}}}
|
|
14
|
+
`)}}}a(A,"markCommittedFinal");async function b(t,e,i,r){try{return await J(t,{kind:e.tier,body:e.body,...e.delivery_tier===void 0?{}:{deliveryTier:e.delivery_tier},...i===void 0?{}:{outcome:i},...r===void 0?{}:{result:r}})}catch(n){throw n instanceof z?new h(409,n.message,n.message==="structured_request_expired"?"the named structured request expired before this submission committed":"the named structured request is already settled"):n instanceof k&&n.code==="already_finalized"?new u({error:"already_finalized",message:"This node already submitted its canonical final result.",next:"Push an update with the new information, then stop."}):n instanceof k&&n.code==="finalization_forbidden"?new u({error:"finalization_forbidden",message:"A canceled or dead node cannot submit a canonical final result.",next:"Do not push final from this node."}):n}}a(b,"pushOrRethrow");async function q(t){const e=await K(),i=await Y(e,await Z(e,{class:"person"},async()=>[]),{type:"document",kind:"report",owner:await Q(e,t)});return(await oe(i,async r=>{const n=r.name.match(/-(update|urgent|final)$/)?.[1]??"update",o=(await V(e,r))[0];return{name:r.name,id:r.id,tier:n,body:o===void 0?"":U(o.body_hash).trim(),created:r.created_at}})).sort((r,n)=>r.created<n.created?1:r.created>n.created?-1:n.name.localeCompare(r.name))}a(q,"reportsForNode");async function me(t){const e=t.params.id;await g(e);const i=t.query.get("tier"),r=t.query.get("limit"),n=r!==null?Number(r):void 0;let o=await q(e);return i!==null&&(o=o.filter(s=>s.tier===i)),n!==void 0&&Number.isFinite(n)&&n>=0&&(o=o.slice(0,n)),{status:200,body:o}}a(me,"handleList");const Me=[{method:"POST",pattern:"/v1/nodes/:id/reports",ownerOnly:!0,handler:se},{method:"GET",pattern:"/v1/nodes/:id/reports",handler:me},{method:"POST",pattern:"/v1/nodes/:id/result",handler:fe}];export{Me as reportRoutes,q as reportsForNode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var R=Object.defineProperty;var s=(t,e)=>R(t,"name",{value:e,configurable:!0});import{ApiError as m}from"../../../api/index.js";import{withCanvasWrite as k}from"../../../core/canvas/db.js";import{isSafeNodeId as p}from"../../../core/canvas/paths.js";import{readDocument as q}from"../../../core/graph/documents.js";import{getById as E}from"../../../core/graph/objects.js";import{checkoutsForCwd as S}from"../../../core/graph/repo-sync/repos.js";import{getNode as b}from"../../../core/canvas/canvas.js";import{assertScope as T}from"../../../core/scopes.js";import{createReview as $}from"../../../core/review/birth.js";import{readAnchorBase as C,listReviews as I,requireVisibleReview as y}from"../../../core/review/store.js";import{cancelReview as A,submitReviewApproval as D}from"../../review/finish.js";import{toFeedbackResultDTO as O,toReviewDTO as F}from"../map.js";import{readerFor as L,resolveRef as P,warmReaderRepos as B}from"../reader.js";import{actsAsPerson as N,canReadNode as j}from"../router.js";import{invalidRequest as G,objectBody as v,optionalString as c,requireParam as V,requiredString as g}from"./validate.js";import{filterAsync as W}from"../../../core/async-array.js";const K=new Set(["open","approved","canceled"]),M=["origin_kind","origin_node_id","document","file","idempotency_key","subtitle","output_path"],z=["reason","actor","disposition"];function l(t){G("review request",t)}s(l,"invalidRequest");function w(t,e){return V(t,"review_id","must be a safe review id",p,e)}s(w,"requireReviewId");function f(t){return{...F(t,t.state==="approved"?{result_path:`${t.review_dir}/result.json`}:{}),review_dir:t.review_dir}}s(f,"toReviewResponseDTO");function H(t){const e=[],n=v(t.body,M,e),o=n.origin_kind,i=o==="ticket"||o==="inline"?o:void 0;i===void 0&&e.push({field:"origin_kind",problem:"must be ticket or inline",...o===void 0?{}:{received:o}});const r=g(n,"origin_node_id",e);r!==void 0&&!p(r)&&e.push({field:"origin_node_id",problem:"must be a safe node id",received:r});const d=c(n,"document",e),u=c(n,"file",e);i==="ticket"&&(d===void 0||u!==void 0)&&e.push({field:"document",problem:"is required for ticket reviews, and file is not allowed"}),i==="inline"&&u===void 0==(d===void 0)&&e.push({field:"file",problem:"inline reviews take exactly one of file or document"});const a=g(n,"idempotency_key",e);a!==void 0&&a.length>128&&e.push({field:"idempotency_key",problem:"must be at most 128 characters",received:a});const h=c(n,"subtitle",e),_=c(n,"output_path",e);return i==="ticket"&&h===void 0&&n.subtitle===void 0&&e.push({field:"subtitle",problem:"is required for ticket reviews"}),i==="inline"&&n.subtitle!==void 0&&e.push({field:"subtitle",problem:"is only allowed for ticket reviews",received:n.subtitle}),i==="inline"&&n.output_path!==void 0&&e.push({field:"output_path",problem:"is only allowed for ticket reviews",received:n.output_path}),(e.length>0||i===void 0||r===void 0||!p(r)||a===void 0||a.length>128)&&l(e),{origin_kind:i,origin_node_id:r,...d===void 0?{}:{document:d},...u===void 0?{}:{file:u},idempotency_key:a,...h===void 0?{}:{subtitle:h},..._===void 0?{}:{output_path:_}}}s(H,"parseCreate");function J(t){const e=[],n={},o=new Set(["state","origin_node_id","file"]);for(const[i,r]of t.query.entries())o.has(i)||e.push({field:i,problem:"is not allowed",received:r});for(const i of o){const r=t.query.getAll(i);if(r.length>1){e.push({field:i,problem:"must appear at most once",received:r});continue}const d=r[0];d!==void 0&&(i==="state"?K.has(d)?n.state=d:e.push({field:i,problem:"must be open, approved, or canceled",received:d}):i==="origin_node_id"?p(d)?n.origin_node_id=d:e.push({field:i,problem:"must be a safe node id",received:d}):d===""?e.push({field:i,problem:"must be a non-empty string",received:d}):n.file=d)}return e.length>0&&l(e),n}s(J,"parseList");function Q(t,e){const n=t.body===void 0?{}:v(t.body,z,e),o=c(n,"reason",e),i=c(n,"actor",e),r=c(n,"disposition",e);return r!==void 0&&r!=="canceled"&&r!=="dismissed"&&e.push({field:"disposition",problem:'must be "canceled" or "dismissed"',received:r}),{...o===void 0?{}:{reason:o},...i===void 0?{}:{actor:i},...r==="canceled"||r==="dismissed"?{disposition:r}:{}}}s(Q,"parseCancel");function U(t,e){v(t.body,[],e)}s(U,"requireEmptyBody");async function X(t){const e=H(t),n=await b(e.origin_node_id);n!==null&&T(n,"crtr:act");const{document:o,file:i,...r}=e,d=await $({...r,...o===void 0?{file:i??""}:{document:await Y(t,o)}});return{status:200,body:f(d)}}s(X,"handleCreate");async function Y(t,e){return await B(t.principal),await k(async n=>{const o=await L(n,t),i=await P(n,o,e);if("remote"in i)throw new m(404,"not_found",`no document named ${i.remote} on this runtime`,{next:"Check the name with `crtr canvas search`."});if("deleted"in i)throw new m(404,"not_found",`${i.deleted.name} is deleted`,{id:i.deleted.id,deleted:!0});if(i.type!=="document")throw new m(400,"invalid_request",`${e} is a ${i.type}, not a document`);const r=await q(n,o,i,async a=>await S(n,a));if(r.needsMerge)throw new m(409,"needs_merge",`${i.name} has ${r.heads.length} heads; merge them before a review`,{id:i.id,next:`Read it with \`crtr canvas read ${i.id}\` and write the merged body with \`crtr doc edit\`.`});const d=i.owner===null?null:await E(n,i.owner),u=d===null?"":d.type==="node"?d.id:d.name;return{id:i.id,name:u===""?i.name:`${u}/${i.name}`,base:r.record.heads_key,body:r.heads[0].body}})}s(Y,"reviewedDocument");async function Z(t){const e=J(t);return{status:200,body:{reviews:(await W(await I(e),async o=>{if(N(t.principal))return!0;const i=await b(o.origin_node_id);return i!==null&&await j(t.principal,i.grantee??"app:terminal",i.node_id)})).map(f)}}}s(Z,"handleList");async function x(t){const e=[],n=w(t,e);return(e.length>0||n===void 0)&&l(e),{status:200,body:f(await y(n))}}s(x,"handleRead");async function ee(t){const e=[],n=w(t,e);U(t,e),(e.length>0||n===void 0)&&l(e);const o=await D(n);return{status:200,body:o.outcome==="awaiting_companion"?{review:f(o.record),outcome:o.outcome}:{review:f(o.record),result:O(o.result),outcome:o.outcome}}}s(ee,"handleSubmit");async function ie(t){const e=[],n=w(t,e),o=Q(t,e);(e.length>0||n===void 0)&&l(e);const i=await A(n,o);return{status:200,body:{review:f(i.record),outcome:i.outcome}}}s(ie,"handleCancel");async function ne(t){const e=[],n=w(t,e);(e.length>0||n===void 0)&&l(e);const o=await y(n),i=await C(o.review_id);if(i===null)throw new Error(`review anchor base is missing: ${o.review_id}`);return{status:200,body:{review_id:o.review_id,anchor_base_sha256:i.sha256,anchor_base_text:new TextDecoder("utf-8",{fatal:!0}).decode(i.bytes),file:o.file}}}s(ne,"handleDocument");const ye=[{method:"POST",pattern:"/v1/human/reviews",scope:"crtr:act",handler:X},{method:"GET",pattern:"/v1/human/reviews",handler:Z},{method:"GET",pattern:"/v1/human/reviews/:review_id",handler:x},{method:"POST",pattern:"/v1/human/reviews/:review_id/submit",handler:ee},{method:"POST",pattern:"/v1/human/reviews/:review_id/cancel",handler:ie},{method:"GET",pattern:"/v1/human/reviews/:review_id/document",handler:ne}];export{H as parseCreate,ye as reviewRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var S=Object.defineProperty;var
|
|
1
|
+
var S=Object.defineProperty;var c=(r,t)=>S(r,"name",{value:t,configurable:!0});import{callerGrant as g}from"../principal.js";import{grantVersion as b,payerOfGrant as O}from"../../../core/grants/mirror.js";import{holdGrant as $}from"../../../core/grants/watch.js";import{RunError as n,idempotencyKeyOf as v,cancelRun as N,deleteRun as A,interruptRun as j,listRuns as x,messageRun as B,renameRun as J,requestedScopes as z,startRun as D,traceRun as E,waitRun as G}from"../../../core/runs/operations.js";import{canReadRun as y,requireRun as f,runCallerApp as K}from"../router.js";import{waitSeconds as q}from"../long-poll-wait.js";import{outputSchemaProblem as M}from"../../../core/runtime/structured-output.js";function m(r){if(!r||typeof r!="object"||Array.isArray(r))throw new n(400,"invalid_request","a JSON object is required");return r}c(m,"object");function k(r,t,o,u,l){if(r===null)return l;if(!/^(0|[1-9]\d*)$/.test(r)||!Number.isSafeInteger(Number(r))||Number(r)<o||Number(r)>u)throw new n(400,"invalid_request",`invalid ${t}`,t);return Number(r)}c(k,"integer");const T=256*1024;async function X(r,t,o,u,l,_,h){switch(r.name){case"grant.get":{if("class"in t)throw new n(403,"permission_error","an app token is required");const e=q("grant.get",u),s=u.get("since");if(s!==null&&!/^[A-Za-z0-9_-]{1,64}$/.test(s))throw new n(400,"invalid_request","invalid since","since");const i=e&&s!==null?$(t.grant):void 0;let d;try{if(d=await g(t),i){const w=Date.now()+e*1e3;for(;b(d)===s&&Date.now()<w;)await i.changed(Math.max(0,(w-Date.now())/1e3)),d=await g(t)}}finally{i?.release()}return{status:200,body:{sub:t.sub,grantee:t.grantee,client_id:t.client_id,grant:t.grant,rev:d.rev,resolved_scopes:d.resolved_scopes,spend_cap:d.spend_cap,exp:t.exp,payer:await O(t.grant),dependencies:d.dependencies??{},version:b(d)}}}case"run.start":{if("class"in t)throw new n(403,"permission_error","an app token is required");const e=m(l),s=["mode","parent","fork_from","node_id","env","tools","system_prompt"];for(const a of s)if(e[a]!==void 0)throw new n(403,"owner_only",`${a} is owner-only`,a);const i=["payer","model_policy","kind"];for(const a of i)if(e[a]!==void 0)throw new n(400,"invalid_request",`${a} is not available`,a);for(const a of Object.keys(e))if(!["prompt","scopes","metadata","profile","isolated","cwd","worktree","output_schema","message","model","deadline"].includes(a))throw new n(400,"invalid_request",`unknown field ${a}`,a);if(e.model!==void 0&&(typeof e.model!="string"||!e.model.trim()))throw new n(400,"invalid_request","model must be a non-empty string","model");if(e.deadline!==void 0&&(typeof e.deadline!="string"||!e.deadline.trim()))throw new n(400,"invalid_request","deadline must be a duration string such as 10m","deadline");if(e.profile!==void 0&&(typeof e.profile!="string"||!e.profile))throw new n(400,"invalid_request","profile must be a profile id","profile");if(e.isolated!==void 0&&typeof e.isolated!="boolean")throw new n(400,"invalid_request","isolated must be a boolean","isolated");if(e.cwd!==void 0&&(e.isolated!==!0||typeof e.cwd!="string"||!e.cwd))throw new n(400,"invalid_request","cwd is available only for an isolated run and must be an absolute path inside its root folder","cwd");if(e.worktree!==void 0&&e.isolated!==!0)throw new n(400,"invalid_request","worktree is not available","worktree");if(e.isolated===!0&&e.worktree!==void 0)throw new n(400,"invalid_request","worktree is unavailable for an isolated run","worktree");if(typeof e.prompt!="string"||!e.prompt.trim())throw new n(400,"invalid_request","prompt is required","prompt");if(e.message!==void 0&&(typeof e.message!="string"||!e.message.trim()))throw new n(400,"invalid_request","message must be a non-empty string","message");const d=e.metadata===void 0?{}:m(e.metadata);if(Buffer.byteLength(JSON.stringify(d))>4096)throw new n(400,"invalid_request","metadata exceeds 4 KB","metadata");let w;if(e.output_schema!==void 0){const a=e.output_schema;if(!a||typeof a!="object"||Array.isArray(a))throw new n(400,"invalid_request","output_schema must be a JSON Schema object","output_schema");if(Buffer.byteLength(JSON.stringify(a))>T)throw new n(400,"invalid_request","output_schema exceeds 256 KB","output_schema");const p=await M(a);if(p!==null)throw new n(400,"invalid_request",`output_schema is not usable: ${p}`,"output_schema");w=a}const R=z(t.resolved,e.scopes,t.grantee);return{status:201,body:await D(t,{prompt:e.prompt,scopes:R,metadata:d,profile:e.profile,isolated:e.isolated,cwd:e.cwd,...e.model===void 0?{}:{model:e.model},...e.deadline===void 0?{}:{deadline:e.deadline},...w===void 0?{}:{output_schema:w},...e.message===void 0?{}:{message:e.message},...h===void 0?{}:{causedBy:h}},v(_))}}case"run.list":{const e=u.get("status")??void 0;if(e&&!["running","waiting_on_user","idle","settled"].includes(e))throw new n(400,"invalid_request","invalid status","status");const s=u.get("app");if(s!==null&&!/^(?:app:)?[a-z0-9][a-z0-9-]*$/.test(s))throw new n(400,"invalid_request","invalid app","app");const i=s===null?K(t):s.startsWith("app:")?s:`app:${s}`;if(i!==null&&!await y(t,i))throw new n(404,"not_found","run not found");return{status:200,body:await x(i,{status:e,after:u.get("after")??void 0,limit:k(u.get("limit"),"limit",1,100,50),..."class"in t&&(t.class==="broker"||t.class==="cron")&&i!==null?{visible:c(async d=>await y(t,i,d),"visible")}:{}})}}case"run.get":{const e=q("run.get",u),s=await f(t,o),i=await G(o,s.grantee,e);return await f(t,o),{status:200,body:i}}case"run.message":{const e=m(l);if(typeof e.message!="string"||!e.message.trim())throw new n(400,"invalid_request","message is required","message");if(e.start_turn!==void 0&&typeof e.start_turn!="boolean")throw new n(400,"invalid_request","start_turn must be a boolean","start_turn");return{status:202,body:await B(await f(t,o,!0),e.message,void 0,e.start_turn,v(_))}}case"run.interrupt":{const e=m(l===void 0?{}:l);if(e.children!==void 0&&e.children!=="stop"&&e.children!=="continue")throw new n(400,"invalid_request","invalid children","children");return{status:200,body:await j(await f(t,o,!0),e.children)}}case"run.cancel":{const e=m(l===void 0?{}:l);if(e.keep_schedules!==void 0&&typeof e.keep_schedules!="boolean")throw new n(400,"invalid_request","invalid keep_schedules","keep_schedules");return{status:200,body:await N(await f(t,o,!0),{keepSchedules:e.keep_schedules})}}case"run.rename":{const e=m(l);for(const s of Object.keys(e))if(s!=="name")throw new n(400,"invalid_request",`unknown field ${s}`,s);return{status:200,body:await J(await f(t,o,!0),e.name)}}case"run.delete":{const{uploads_pending:e}=await A(await f(t,o,!0,!0));return{status:200,body:{run_id:o,uploads_pending:e}}}case"trace.get":{const e=u.get("format")??void 0;if(e&&e!=="entries")throw new n(400,"invalid_request","unknown trace format","format");const s=await f(t,o);return{status:200,body:await E(o,s.grantee,e)}}default:throw new n(404,"not_found","unknown operation")}}c(X,"handleRunOperation");export{X as handleRunOperation,k as integer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var n=(t,r)=>a(t,"name",{value:r,configurable:!0});import{ApiError as o}from"../../../api/errors.js";import{personIdAsync as i}from"../../../core/canvas/person.js";import{SettingsRevisionConflictError as p,currentSnapshot as l,personHasSnapshot as c}from"../../../core/scoped-state/person-store.js";import{loadPersonSettings as f,rowsTransport as h}from"../../../core/scoped-state/person-rows.js";import{ownerOnly as u}from"../router.js";const m=new Set(["settings.replace","state.write","profile.insert","profile.update","profile.delete","defaults.replace"]);function w(t){const r=t?.ops;if(!Array.isArray(r)||r.length===0)throw new o(400,"invalid_request","ops must be a non-empty array");for(const e of r)if(e===null||typeof e!="object"||!m.has(e.op))throw new o(400,"invalid_request",`unknown settings op: ${String(e?.op)}`);return r}n(w,"parseOps");function d(t){if(t.principal.class==="broker"&&t.principal.app!=="app:terminal")throw new o(403,"permission_error","only the person's terminal nodes change the person's settings")}n(d,"requireTerminalWriter");async function y(){const t=await i();return{status:200,body:{person:t,snapshot:c()?l():await f(t)}}}n(y,"handleGet");async function g(t){d(t);const r=w(t.body),e=await i();try{return{status:200,body:{person:e,snapshot:await h(e,r)}}}catch(s){throw s instanceof p?new o(409,"conflict",s.message):s}}n(g,"handlePut");const q=u([{method:"GET",pattern:"/v1/settings",handler:y},{method:"PUT",pattern:"/v1/settings",handler:g}]);export{q as settingsRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O=Object.defineProperty;var u=(t,e)=>O(t,"name",{value:e,configurable:!0});import{isSafeNodeId as g}from"../../../core/canvas/paths.js";import{admitStructuredRequest as P,bindStructuredRequest as A,getPendingStructuredRequestForNode as D,getStructuredRequest as l,settleStructuredRequest as f,toStructuredRequestDTO as _}from"../../../core/canvas/structured-requests.js";import{getNode as k}from"../../../core/canvas/canvas.js";import{CanvasConstraintError as T}from"../../../core/canvas/db.js";import{ApiError as j}from"../../../api/errors.js";import{handleCreate as N}from"./nodes.js";import{handleMessage as $}from"./messages.js";import{outputSchemaProblem as C}from"../../../core/runtime/structured-output.js";import{requestBrokerTeardown as x}from"../../../core/runtime/host.js";import{transition as E}from"../../../core/runtime/lifecycle.js";import{subscribeStructuredRequest as F}from"../../structured-requests/notifier.js";import{SYNC_WORK_BUDGET_MS as S}from"../../../api/index.js";import{waitSeconds as M}from"../long-poll-wait.js";function n(t,e,r){throw new j(t,e,r)}u(n,"fail");function B(t){(typeof t!="object"||t===null||Array.isArray(t))&&n(400,"invalid_request","a structured request requires a JSON object");const e=t;(typeof e.request_id!="string"||!g(e.request_id))&&n(400,"request_id_invalid","request_id must use the node-id character rule"),e.mode!=="sync"&&e.mode!=="async"&&n(400,"invalid_request","mode must be sync or async"),typeof e.prompt!="string"&&n(400,"invalid_request","prompt must be a string"),(typeof e.output_schema!="object"||e.output_schema===null||Array.isArray(e.output_schema))&&n(400,"invalid_request","output_schema must be a JSON Schema object");const r=e.target;(typeof r!="object"||r===null)&&n(400,"invalid_request","target is required");const a=r;if(a.kind==="node")(typeof a.node_id!="string"||!g(a.node_id))&&n(400,"invalid_request","target.node_id must use the node-id character rule");else if(a.kind==="new"){(typeof a.create!="object"||a.create===null||Array.isArray(a.create))&&n(400,"invalid_request","target.create must be an object");for(const i of["prompt","output_schema","deadline","root_lifecycle","no_kickoff"])Object.hasOwn(a.create,i)&&n(400,"create_field_forbidden",`target.create may not carry ${i}`)}else n(400,"invalid_request","target.kind must be new or node");return e.work_budget_ms!==void 0&&(!Number.isInteger(e.work_budget_ms)||e.work_budget_ms<=0)&&n(400,"work_budget_invalid","work_budget_ms must be a positive integer"),e.deadline_at!==void 0&&(typeof e.deadline_at!="string"||Number.isNaN(Date.parse(e.deadline_at)))&&n(400,"invalid_request","deadline_at must be an ISO timestamp"),e}u(B,"parseCreate");function G(t,e){const r=t.deadline_at===void 0?null:Date.parse(t.deadline_at),a=t.work_budget_ms===void 0?null:e+t.work_budget_ms,i=r===null?a:a===null?r:Math.min(r,a);return t.mode==="sync"?Math.min(i??e+S,e+S):i}u(G,"deadlineFor");function v(t,e,r=""){return{...t,method:"POST",path:"",params:r===""?{}:{id:r},query:new URLSearchParams,body:e}}u(v,"context");async function p(t){return{status:200,body:{admitted:!0,request:_(t)}}}u(p,"terminalAdmission");function m(t){return t!==null&&Date.now()>=t}u(m,"deadlinePassed");async function q(t){return await p((await f(t,{intended:"expired"})).row)}u(q,"expireAdmission");async function R(t,e){let r;const a=new Promise(s=>{r=s}),i=F(t,r);try{return(await l(t)).state==="pending"&&e>0&&await Promise.race([a,new Promise(w=>setTimeout(w,e))]),_(await l(t))}finally{i()}}u(R,"waitForRequest");async function I(t,e){const r=await R(t,Math.max(0,e-Date.now()));return r.state==="pending"?_((await f(t,{intended:"expired"})).row):r}u(I,"waitForTerminal");async function J(t){const e=B(t.body),r=await C(e.output_schema);r!==null&&n(400,"invalid_request",`output_schema is not usable: ${r}`),e.mode==="sync"&&e.target.kind!=="new"&&n(400,"sync_requires_dedicated_node","sync requests require target.kind=new");const a=Date.now(),i=G(e,a);if(m(i))return{status:200,body:{admitted:!1,reason:"work_budget_exhausted"}};let s=null,w="terminal",y=!0;if(e.target.kind==="node"){s=e.target.node_id;const d=await k(s);d===null&&n(404,"node_not_found",`unknown node: ${s}`),(d.final_report!==null||d.status==="done"||d.status==="canceled"||d.status==="dead")&&n(409,"node_terminal",`node ${s} is terminal`),await D(s)!==null&&n(409,"structured_request_conflict",`node ${s} already has a pending structured request`),w="oneoff",y=!1}if(m(i))return{status:200,body:{admitted:!1,reason:"work_budget_exhausted"}};try{await P({requestId:e.request_id,mode:e.mode,submission:w,dedicated:y,schema:e.output_schema,deadlineAt:i,nodeId:s,now:Date.now()})}catch(d){throw d instanceof T&&(d.constraint==="structured_requests_pkey"&&n(409,"request_id_in_use",`request_id ${e.request_id} is already in use`),d.constraint==="idx_structured_requests_one_pending_node"&&n(409,"structured_request_conflict","the target node already has a pending structured request")),d}if(m(i))return await q(e.request_id);if(e.target.kind==="new")try{s=(await N(v(t,{...e.target.create,root:!0,root_lifecycle:"terminal",prompt:""}),{},{...i===null?{}:{deadlineAt:new Date(i).toISOString()},beforeBrokerLaunch:u(async o=>{if(s=o,m(i))throw new Error("structured request deadline expired before binding");const c=await A(e.request_id,o);if(!c.changed||c.row===null||c.row.state!=="pending")throw new Error("structured request bind did not remain pending");s=o},"beforeBrokerLaunch")})).body.node_id}catch{const o=await l(e.request_id),c=o.state==="pending"?(await f(e.request_id,{intended:"failed",failureReason:o.node_id===null?"node_create_failed":"bind_failed"})).row:o;if(s!==null&&c.node_id===null){const h=await k(s);(h?.status==="active"||h?.status==="idle")&&await E(s,"cancel",{reason:"stranded"}),await x(s)}return await p(c)}else if(m(i))return await q(e.request_id);const b=await l(e.request_id);if(b.state!=="pending")return await p(b);if(m(i))return await q(e.request_id);try{await $(v(t,{body:e.prompt,tier:"normal"},s))}catch{return await p((await f(e.request_id,{intended:"failed",failureReason:"prompt_delivery_failed"})).row)}return e.mode==="async"?{status:202,body:{admitted:!0,request:_(await l(e.request_id))}}:{status:200,body:{admitted:!0,request:await I(e.request_id,i)}}}u(J,"handleCreateStructuredRequest");async function L(t){const e=t.params.request_id,r=M("structured-request.get",t.query),a=await l(e);return a===null&&n(404,"structured_request_not_found",`unknown structured request: ${e}`),{status:200,body:r===0?_(a):await R(e,r*1e3)}}u(L,"handleReadStructuredRequest");async function U(t){const e=await f(t.params.request_id,{intended:"canceled"});return e.row===null&&n(404,"structured_request_not_found",`unknown structured request: ${t.params.request_id}`),{status:200,body:_(e.row)}}u(U,"handleCancelStructuredRequest");const ie=[{method:"POST",pattern:"/v1/structured-requests",handler:J},{method:"GET",pattern:"/v1/structured-requests/:request_id",handler:L},{method:"POST",pattern:"/v1/structured-requests/:request_id/cancel",handler:U}];export{ie as structuredRequestRoutes};
|
|
@@ -16,6 +16,6 @@ export interface VendorStatusAnswer {
|
|
|
16
16
|
openai: VendorAccountStatus[];
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export declare function vendorStatus(now?: number): VendorStatusAnswer
|
|
19
|
+
export declare function vendorStatus(now?: number): Promise<VendorStatusAnswer>;
|
|
20
20
|
/** Remove one account from a vendor's pool. Removing a vendor's last account leaves it `not_set_up`. Answers the status after the removal. */
|
|
21
21
|
export declare function removeVendorAccount(body: unknown): Promise<VendorStatusAnswer>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var
|
|
1
|
+
var p=Object.defineProperty;var a=(t,n)=>p(t,"name",{value:n,configurable:!0});import{ANTHROPIC_PROVIDER_ID as _,OPENAI_CODEX_PROVIDER_ID as m,readSubscriptionPoolRows as s,removeManagedAccountById as f}from"../../../core/subscription-state.js";import{RunError as c}from"../../../core/runs/operations.js";const u={anthropic:_,openai:m};function w(t,n,e){return n.authFailure?{id:t,label:n.label,state:"needs_reconnecting"}:n.rateLimitedUntil>e?{id:t,label:n.label,state:"rate_limited",cooling_until:new Date(n.rateLimitedUntil).toISOString()}:{id:t,label:n.label,state:"connected"}}a(w,"accountStatus");function d(t){return t.length===0?"not_set_up":t.some(n=>n.state!=="needs_reconnecting")?"connected":"needs_reconnecting"}a(d,"vendorState");async function h(t=Date.now()){const n=a(async i=>(await s(u[i])).map(({id:r,entry:l})=>w(r,l,t)),"accounts"),e=await n("anthropic"),o=await n("openai");return{vendors:{anthropic:d(e),openai:d(o)},accounts:{anthropic:e,openai:o}}}a(h,"vendorStatus");async function O(t){const n=t,e=n?.vendor;if(e!=="anthropic"&&e!=="openai")throw new c(400,"invalid_request",'vendor must be "anthropic" or "openai"',"vendor");const o=n?.account_id;if(typeof o!="string"||o==="")throw new c(400,"invalid_request","account_id must be a non-empty string","account_id");const i=u[e];if(!(await s(i)).some(r=>r.id===o))throw new c(404,"not_found","no such account");return await f(i,o),h()}a(O,"removeVendorAccount");export{O as removeVendorAccount,h as vendorStatus};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var i=Object.defineProperty;var a=(e,t)=>i(e,"name",{value:t,configurable:!0});import{closeManagedWorktreeAsync as d}from"../../../core/worktree-close.js";import{abandonManagedWorktreeAsync as p}from"../../../core/worktree-mutation-async.js";import{listQuarantinedManagedWorktrees as m}from"../../../core/worktree-quarantine.js";import{usage as c}from"../../../core/errors.js";import{ApiError as l}from"../../../api/errors.js";import{getNode as u}from"../../../core/canvas/canvas.js";import{runsOnBlaxel as y}from"../environment-of.js";import{directorySizeBytes as f}from"../../../core/disk-usage.js";import{appsRoot as n,userRoot as h}from"../../../core/layout.js";import{existsSync as w,readdirSync as b}from"node:fs";import{join as k}from"node:path";import{ownerOnly as g}from"../router.js";async function s(e){const t=await u(e);if(t!==null&&await y(t.profile_id??null))throw new l(409,"worktree_not_available",`${e} runs in a sandbox, whose clone is its worktree; push a branch from it instead`)}a(s,"refuseOnBlaxel");async function v(e){const t=e.params.id;return await s(t),{status:200,body:await d(t)}}a(v,"handleWorktreeClose");async function S(e){const t=e.body?.by,o=typeof t=="string"?t.trim():"";if(o==="")throw c("abandon requires a non-empty invoking identity",{received:e.body,next:"Pass the invoking node id or human identity."});return await s(e.params.id),{status:200,body:await p(e.params.id,o)}}a(S,"handleWorktreeAbandon");async function W(){return{status:200,body:await m()}}a(W,"handleQuarantinedWorktrees");async function O(){const e=w(n())?b(n(),{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>r.name).sort():[],t=[{space:"user",path:h()},...e.map(r=>({space:`app:${r}`,path:k(n(),r)}))];return{status:200,body:{spaces:await Promise.all(t.map(async r=>({...r,size_bytes:await f(r.path)})))}}}a(O,"handleSpaces");const $=g([{method:"GET",pattern:"/v1/spaces",handler:O},{method:"POST",pattern:"/v1/nodes/:id/worktree/close",handler:v},{method:"POST",pattern:"/v1/nodes/:id/worktree/abandon",handler:S},{method:"GET",pattern:"/v1/worktrees/quarantined",handler:W}]);export{$ as worktreeRoutes};
|
package/dist/daemon/api/map.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export declare function toMigrateStateDTO(result: CanvasImportResult, options: {
|
|
|
15
15
|
/** Project the list-row outcome, or null while this node remains unsettled. */
|
|
16
16
|
export declare function toNodeOutcomeSummaryDTO(node: NodeRuntime): NodeOutcomeSummaryDTO | null;
|
|
17
17
|
/** Project the full outcome, or null while this node remains unsettled. */
|
|
18
|
-
export declare function toNodeOutcomeDTO(node: Pick<NodeMeta, 'node_id' | 'final_report'
|
|
19
|
-
export declare function toRunOutcomeDTO(node: Pick<NodeMeta, 'node_id' | 'final_report'> & NodeRuntime): RunOutcomeDTO | null
|
|
18
|
+
export declare function toNodeOutcomeDTO(node: Pick<NodeMeta, 'node_id' | 'final_report'> & NodeRuntime): Promise<NodeOutcomeDTO | null>;
|
|
19
|
+
export declare function toRunOutcomeDTO(node: Pick<NodeMeta, 'node_id' | 'final_report'> & NodeRuntime): Promise<RunOutcomeDTO | null>;
|
|
20
20
|
/** The outcome-delivery fields exposed by the API. The delivery store supplies this projection directly. */
|
|
21
21
|
export interface OutcomeDeliveryDTOInput {
|
|
22
22
|
nodeId: string;
|
package/dist/daemon/api/map.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var g=Object.defineProperty;var r=(e,t)=>g(e,"name",{value:t,configurable:!0});import{join as b}from"node:path";import{readOutputResult as y}from"../../core/runtime/structured-output.js";import{ReviewOperationError as _}from"../../core/review/types.js";import{cronSinkDisplay as x}from"../../core/canvas/crons.js";import{isProfilePaused as c,profileDir as O,sanitizeProfileMetadata as D}from"../../core/profiles/manifest.js";import{nodeMetaPath as T,transcriptPath as E,viewSocketPath as S}from"../../core/canvas/paths.js";import{appForNode as f,contextDir as A,nodeAgentDir as R}from"../../core/canvas/node-agent-paths.js";import{readControllerWait as p}from"../../core/canvas/waits.js";import{FinalizationError as z}from"../../core/feed/feed.js";import{NodeIdConflictError as N}from"../../core/runtime/nodes.js";import{ScopeDeniedError as C}from"../../core/scopes.js";import{isBeneathRefusal as j}from"../../core/spaces/open-beneath.js";import{CrtrError as a}from"../../core/errors.js";import{WorktreeError as q}from"../../core/worktree.js";import{ApiError as I}from"../../api/errors.js";import{RunError as s}from"../../core/runs/operations.js";import{ExitCode as o}from"../../types.js";function pe(e,t){const{report:n}=e;return{stores:n.stores.map(i=>({root:i.root,owner:{...i.owner},docs:i.docs,...i.skipped===void 0?{}:{skipped:i.skipped}})),counts:n.counts,rewrites:n.rewrites,dropped_fields:n.droppedFields,skipped:n.skipped,resolutions:n.resolutions.map(i=>({kind:i.kind,message:i.message,paths:i.paths})),blockers:e.blockers.map(i=>({kind:i.kind,message:i.message,paths:i.paths})),dryRun:e.dryRun,pending:e.pending,resumed:t.resumed,...t.resumeError===void 0?{}:{resume_error:t.resumeError}}}r(pe,"toMigrateStateDTO");function F(e,t){try{return y(e,t)??null}catch{return null}}r(F,"readStructuredResult");function P(e){return e.outcome_at===null||e.outcome_at===void 0||e.outcome_kind===null||e.outcome_kind===void 0||e.outcome_reason===null||e.outcome_reason===void 0?null:{kind:e.outcome_kind,reason:e.outcome_reason,settled_at:e.outcome_at}}r(P,"toNodeOutcomeSummaryDTO");function m(e){if(e.outcome_at===null||e.outcome_at===void 0||e.outcome_kind===null||e.outcome_kind===void 0||e.outcome_reason===null||e.outcome_reason===void 0)return null;let t=null;if(e.outcome_detail_json!==null&&e.outcome_detail_json!==void 0)try{t=JSON.parse(e.outcome_detail_json)}catch{t=null}const n=e.final_report??null,i={node_id:e.node_id,revision:e.outcome_revision??1,settled_at:e.outcome_at,final_report:n===null?null:`${e.node_id}/${n}`,structured_result:e.outcome_kind==="result"?F(e.node_id,e.grantee):null,detail:t};return e.outcome_kind==="result"?{...i,kind:"result",reason:e.outcome_reason,declined:null}:e.outcome_reason==="declined"?{...i,kind:"failure",reason:"declined",declined:t?.declined??null}:{...i,kind:"failure",reason:e.outcome_reason,declined:null}}r(m,"toNodeOutcomeDTO");function me(e){const t=m(e);return t===null||t.reason==="parked"?null:t.kind==="result"||t.reason==="finished"?{...t,kind:"result",reason:"finalized",declined:null}:t.reason==="declined"?{...t,reason:"declined",details:t.declined}:t.reason==="deadline_exceeded"?{...t,reason:"deadline_exceeded",declined:null}:t.reason==="cap_exhausted"?{...t,reason:"cap_exhausted",declined:null}:t.reason==="closed"||t.reason==="stranded"||t.reason==="retired"?{...t,reason:"canceled",declined:null}:{...t,reason:"runtime_error",declined:null,details:{crouter_reason:t.reason}}}r(me,"toRunOutcomeDTO");function ve(e){const t=e.lastFailure;return{node_id:e.nodeId,state:e.state,action:e.actionName,attempt:e.attempt,next_attempt_at:e.nextAttemptAt===0?null:new Date(e.nextAttemptAt).toISOString(),accepted_at:e.acceptedAt===null?null:new Date(e.acceptedAt).toISOString(),permanent_failed_at:e.permanentFailedAt===null?null:new Date(e.permanentFailedAt).toISOString(),last_failure:t===null?null:{kind:t.kind,...t.exitCode===void 0?{}:{exit_code:t.exitCode},...t.signal===void 0?{}:{signal:t.signal},...t.message===void 0?{}:{message:t.message}},created_at:new Date(e.createdAt).toISOString(),updated_at:new Date(e.updatedAt).toISOString()}}r(ve,"toOutcomeDeliveryDTO");function ke(e){return{node_id:e.node_id,name:e.name,description:e.description,cycles:e.cycles,kind:e.kind,status:e.status,frozen_at:e.frozen_at,pi_pid:e.pi_pid,telemetry_context_tokens:e.telemetry_context_tokens,telemetry_last_activity:e.telemetry_last_activity,fault:e.fault&&e.fault.link!=="broker\u2194crtrd"?{...e.fault,link:e.fault.link}:null,streaming:e.streaming}}r(ke,"toGraphNodeDTO");async function he(e,t=c(e.profile_id)){return{node_id:e.node_id,name:e.name,description:e.description,cycles:e.cycles,kind:e.kind,mode:e.mode,lifecycle:e.lifecycle,status:e.status,cwd:e.cwd,host_kind:e.host_kind,profile_id:e.profile_id,scopes:e.scopes,isolated:e.isolated,grantee:e.grantee??await f(e.node_id),profile_paused:t,parent:e.parent,created:e.created,intent:e.intent,waiting_for:(await p(e.node_id))?.controllerId??null,frozen_at:e.frozen_at??null,terminal_reason:e.terminal_reason??null,pi_pid:e.pi_pid,pi_pid_identity:e.pi_pid_identity,window:e.window,tmux_session:e.tmux_session,pane:e.pane,final_report:e.final_report??null,finalized_at:e.finalized_at??null,deadline_at:e.deadline_at??null,telemetry_tokens_in:e.telemetry_tokens_in??null,telemetry_context_tokens:e.telemetry_context_tokens??null,telemetry_last_activity:e.telemetry_last_activity??null,telemetry_updated_at:e.telemetry_updated_at??null,outcome:P(e),fault:e.fault&&e.fault.link!=="broker\u2194crtrd"?{...e.fault,link:e.fault.link}:null,streaming:e.streaming??!1}}r(he,"toNodeSummaryDTO");function U(e,t){return{parent:e.parent??null,spawned_by:e.spawned_by??null,subscribes_to:t.subscribesTo.map(n=>n.node_id),subscribers:t.subscribers.map(n=>n.node_id),children:[...t.children]}}r(U,"toNodeEdgesDTO");async function G(e,t){return{node_dir:await R(e,t),context_dir:await A(e,t),meta_path:T(e),transcript_path:E(e),view_socket:S(e)}}r(G,"toNodePathsDTO");function M(e){const t={state:e.state,path:e.path,branch:e.branch,repo_root:e.repo_root,base_ref:e.base_ref,base_sha:e.base_sha,created:e.created};return e.cleanup!==void 0&&(t.cleanup=e.cleanup),e.closed!==void 0&&(t.closed=e.closed),e.abandoned!==void 0&&(t.abandoned={...e.abandoned}),t}r(M,"toNodeWorktreeDTO");async function ge(e,t){const n=await f(e.node_id),i={node_id:e.node_id,name:e.name,kind:e.kind,mode:e.mode,lifecycle:e.lifecycle,status:e.status,cwd:e.cwd,host_kind:e.host_kind??null,profile_id:e.profile_id??null,scopes:e.scopes??null,isolated:e.isolated===!0,grantee:n,profile_paused:c(e.profile_id),parent:e.parent??null,created:e.created,intent:e.intent??null,waiting_for:(await p(e.node_id))?.controllerId??null,frozen_at:e.frozen_at??null,terminal_reason:e.terminal_reason??null,pi_pid:e.pi_pid??null,pi_pid_identity:e.pi_pid_identity??null,window:e.window??null,tmux_session:e.tmux_session??null,pane:e.pane??null,final_report:e.final_report??null,finalized_at:e.finalized_at??null,deadline_at:e.deadline_at??null,telemetry_tokens_in:e.telemetry_tokens_in??null,telemetry_context_tokens:e.telemetry_context_tokens??null,telemetry_last_activity:e.telemetry_last_activity??null,telemetry_updated_at:e.telemetry_updated_at??null,outcome:m(e),fault:e.fault&&e.fault.link!=="broker\u2194crtrd"?{...e.fault,link:e.fault.link}:null,streaming:e.streaming??!1,creator:e.creator??null,edges:U(e,t),paths:await G(e.node_id,n)};return e.description!==void 0&&(i.description=e.description),e.title!==void 0&&(i.title=e.title),e.icon!==void 0&&(i.icon=e.icon),e.cycles!==void 0&&(i.cycles=e.cycles),i.context_tokens=e.telemetry_context_tokens??e.telemetry_tokens_in??null,e.pi_session_id!==void 0&&(i.pi_session_id=e.pi_session_id??null),i.model_override=e.model_override??null,e.pi_session_file!==void 0&&(i.pi_session_file=e.pi_session_file??null),e.review_binding!==void 0&&(i.review_binding=e.review_binding===null?null:{...e.review_binding.kind===void 0?{}:{kind:e.review_binding.kind},review_id:e.review_binding.review_id,origin_node_id:e.review_binding.origin_node_id,branch_file:e.review_binding.branch_file,target_file:e.review_binding.target_file}),e.managed_worktree!=null&&(i.worktree=M(e.managed_worktree)),i}r(ge,"toNodeDetailDTO");function be(e,t,n,i){return{node_id:e,revived:t.launch!==void 0,resumed:t.resumed,status:n,outcome:t.outcome,ready:i}}r(be,"toReviveResultDTO");function ye(e){return{root:e.root,closed:[...e.closed],spared:[...e.spared]}}r(ye,"toCloseResultDTO");function xe(e,t,n){const i={report:e.report,notified:[...e.deliveredTo]};return t!==void 0&&(i.transitioned=t),n!==void 0&&(i.worktree_auto_dropped=!0,i.worktree_auto_dropped_path=n),i}r(xe,"toReportResultDTO");function Oe(e){return{node_id:e.node_id,active:e.active,created:e.created}}r(Oe,"toSubscriptionDTO");function W(e){if(e===null||e==="")return[];try{const t=JSON.parse(e);return typeof t=="object"&&t!==null&&!Array.isArray(t)?Object.keys(t):[]}catch{return[]}}r(W,"envKeys");function De(e,t){return{cron_id:e.cron_id,name:e.name,created_by:e.created_by,command:e.command,grant_id:e.grant_id,scopes:e.scopes,origin_run_id:e.origin_run_id,isolated:e.isolated,fire_at:e.fire_at,recur:e.recur,tz:e.tz,expires_at:e.expires_at,anchor_node:e.anchor_node,cancel_on_wake:e.cancel_on_wake,cwd:e.cwd,profile:e.profile,scope:e.scope,env_keys:W(e.env_json),run_timeout_s:e.run_timeout_s,overlap:e.overlap,on_output:e.on_output,sink:x(e.sink),tier:e.tier,state:e.state,held:e.held,run_state:e.run_state,last_run:t==null?null:{finished:t.finished,exit_code:t.exit_code,delivered:t.delivered},created:e.created,updated:e.updated}}r(De,"toCronDTO");function Te(e){return{run_id:e.run_id,started:e.started,finished:e.finished,duration_ms:e.duration_ms,exit_code:e.exit_code,stdout_head:e.stdout_head,stderr_head:e.stderr_head,delivered:e.delivered}}r(Te,"toCronRunDTO");function Ee(e){return{id:e.profileId,app:e.manifest.grantee??"app:terminal",name:e.manifest.name,projects:e.manifest.projects.map(t=>({...t})),delivery_limits:{...e.manifest.delivery_limits},paused_at:e.manifest.paused_at,default_kind:e.manifest.default_kind??"general",metadata:D(e.manifest.metadata),default_dir:null,created_at:e.manifest.created_at,last_used_at:e.manifest.last_used_at,profile_path:O(e.profileId)}}r(Ee,"toProfileDTO");function v(e,t={}){const n={review_id:e.review_id,origin_kind:e.origin_kind,origin_node_id:e.origin_node_id,review_dir:e.review_dir,companion_node_id:e.companion_node_id,file:e.file,state:e.state,created:e.created,source_missing:e.source_missing,anchor_base_sha256:e.anchor_base_sha256};return e.document_name!==null&&(n.document=e.document_name),e.opened_at!==null&&(n.opened_at=e.opened_at),e.submit_requested_at!==null&&(n.submit_requested_at=e.submit_requested_at),e.approved_at!==null&&(n.approved_at=e.approved_at),e.changed!==null&&(n.changed=e.changed),e.comments_total!==null&&(n.comments_total=e.comments_total),e.comments_unresolved!==null&&(n.comments_unresolved=e.comments_unresolved),e.canceled_at!==null&&(n.canceled_at=e.canceled_at),e.cancel_reason!==null&&(n.cancel_reason=e.cancel_reason),e.cancel_actor!==null&&(n.cancel_actor=e.cancel_actor),t.result_path!==void 0&&(n.result_path=t.result_path),e.delivery_error!==null&&(n.delivery_error=e.delivery_error),e.projection_error!==null&&(n.projection_error=e.projection_error),n}r(v,"toReviewDTO");function Se(e){return{comment_id:e.comment_id,review_id:e.review_id,status:e.status,revision:e.revision,text:e.text,anchor:{...e.anchor},anchor_state:e.anchor_state,anchor_line_text:e.anchor_line_text,anchor_doc_hash:e.anchor_doc_hash,author:{kind:e.author.kind,...e.author.node_id===null?{}:{node_id:e.author.node_id}},updated_by:{kind:e.updated_by.kind,...e.updated_by.node_id===null?{}:{node_id:e.updated_by.node_id}},created_at:e.created_at,updated_at:e.updated_at,...e.resolved_at===null?{}:{resolved_at:e.resolved_at},...e.deleted_at===null?{}:{deleted_at:e.deleted_at},created_seq:e.created_seq}}r(Se,"toReviewCommentDTO");function B(e){return{id:e.id,quote:e.quote,...e.context===void 0?{}:{context:e.context},note:e.note,status:e.status,created_at:e.createdAt,...e.resolvedAt===void 0?{}:{resolved_at:e.resolvedAt}}}r(B,"toPageFeedbackCommentDTO");function Ae(e){return{companion_node_id:e.companionNodeId??null,open_count:e.comments.filter(t=>t.status==="open").length,comments:e.comments.map(B)}}r(Ae,"toPageFeedbackDTO");function Re(e){return{seq:e.seq,review_id:e.review_id,comment_id:e.comment_id,kind:e.kind,state_change:e.state_change===1,revision_after:e.revision_after,actor:{kind:e.actor.kind,...e.actor.node_id===null?{}:{node_id:e.actor.node_id}},at:e.at,operation_id:e.operation_id,...e.payload===void 0?{}:{payload:e.payload}}}r(Re,"toReviewCommentEventDTO");function ze(e){return{file:e.file,submitted:e.submitted,approved:e.approved,comments:e.comments.map(n=>({...n})),submittedAt:e.submittedAt,savedAt:e.savedAt,reviewId:e.review_id,changed:e.changed,baselineSha256:e.baseline_sha256,approvedSha256:e.approved_sha256,companionNodeId:e.companion_node_id,commentsTotal:e.comments_total,commentsUnresolved:e.comments_unresolved}}r(ze,"toFeedbackResultDTO");const L=!0,$=Object.freeze({review_origin_missing:{status:400,code:"review_origin_unavailable"},review_origin_unforkable:{status:400,code:"review_origin_unavailable"},review_branch_unavailable:{status:409,code:"review_branch_unavailable"},branch_lost:{status:409,code:"review_branch_unavailable"},review_companion_unbound:{status:409,code:"review_companion_unbound"},review_bridge_unsubscribed:{status:409,code:"review_bridge_unavailable"},review_target_unreviewable:{status:400,code:"review_file_unreadable"},source_unreadable:{status:409,code:"review_source_unreadable"},delivery_unroutable:{status:409,code:"review_delivery_unroutable"},unknown_review:{status:404,code:"unknown_review"},review_terminal:{status:409,code:"review_terminal_conflict"},review_required:{status:400,code:"review_required"},stale_document:{status:409,code:"stale_document"},stale_revision:{status:409,code:"stale_revision"},unknown_comment:{status:404,code:"unknown_comment"},comment_deleted:{status:409,code:"comment_deleted"},invalid_anchor:{status:400,code:"invalid_anchor"},anchor_out_of_range:{status:400,code:"anchor_out_of_range"},text_too_long:{status:400,code:"text_too_long"},comment_limit_reached:{status:409,code:"comment_limit_reached"},stale_comment:{status:409,code:"stale_comment"},range_batch_incomplete:{status:409,code:"range_batch_incomplete"},range_batch_stale:{status:409,code:"range_batch_stale"}});function K(e){const t=k(e);if(typeof t=="object"&&t!==null&&typeof t.status=="number"&&typeof t.code=="string")return{status:t.status,code:t.code};if(t instanceof z)return t.code==="unknown_node"?{status:404,code:"node_not_found"}:t.code==="already_finalized"?{status:409,code:"already_finalized"}:{status:409,code:"finalization_forbidden"};if(t instanceof N)return{status:409,code:"node_id_exists"};if(t instanceof C)return{status:403,code:"scope_denied"};if(j(t))return{status:400,code:"invalid_request"};if(t instanceof _)return $[t.code];if(t instanceof a)return["kind_owned","name_taken","hop_limit","not_a_queue"].includes(t.code)?{status:409,code:t.code}:t.code==="invalid_publish_token"?{status:401,code:t.code}:t.code==="forbidden"||t.code==="argv_forbidden"||t.code==="scope_missing"?{status:403,code:t.code}:{status:J(t.exitCode),code:t.code};if(t instanceof Error){const n=t.message;if(/unknown node/i.test(n))return{status:404,code:"node_not_found"};if(/finalization latch/i.test(n))return{status:409,code:"already_finalized"};if(/illegal lifecycle transition/i.test(n))return{status:409,code:"illegal_transition"}}return{status:500,code:"internal"}}r(K,"errorToStatus");function k(e){if(!(e instanceof q))return e;const t=e.code==="unknown_node"?o.NOT_FOUND:o.GENERAL,n={error:e.code,message:e.message,next:e.next};return e.detail!==void 0&&(n.received=e.detail),new a(e.code,e.message,t,n)}r(k,"normalizeThrow");function V(e){if(e.code!=="review_terminal")return e.detail;const{review:t,...n}=e.detail;return{...n,review:H(t)}}r(V,"reviewErrorDetails");function H(e){return e.state!=="approved"?v(e):v(e,{result_path:b(e.review_dir,"result.json")})}r(H,"terminalConflictReviewDTO");function J(e){switch(e){case o.NOT_FOUND:return 404;case o.USAGE:return 400;case o.AMBIGUOUS:return 400;case o.NETWORK:return 503;case o.GENERAL:return 400;default:return 500}}r(J,"statusForExitCode");function Q(e){const n=(e instanceof Error?e.message:String(e)).split(`
|
|
2
|
-
`,1)[0].trim();return n===""?"internal error":n.length>500?`${n.slice(0,497)}\u2026`:n}r(
|
|
1
|
+
var g=Object.defineProperty;var r=(e,t)=>g(e,"name",{value:t,configurable:!0});import{join as b}from"node:path";import{readOutputResult as y}from"../../core/runtime/output-result.js";import{ReviewOperationError as _}from"../../core/review/types.js";import{cronSinkDisplay as x}from"../../core/canvas/crons.js";import{isProfilePaused as c,profileDir as O,sanitizeProfileMetadata as D}from"../../core/profiles/manifest.js";import{nodeMetaPath as T,transcriptPath as E,viewSocketPath as S}from"../../core/canvas/paths.js";import{appForNode as f,contextDir as A,nodeAgentDir as R}from"../../core/canvas/node-agent-paths.js";import{readControllerWait as p}from"../../core/canvas/waits.js";import{FinalizationError as z}from"../../core/feed/feed.js";import{NodeIdConflictError as N}from"../../core/runtime/nodes.js";import{ScopeDeniedError as C}from"../../core/scopes.js";import{isBeneathRefusal as j}from"../../core/spaces/open-beneath.js";import{CrtrError as a}from"../../core/errors.js";import{WorktreeError as q}from"../../core/worktree.js";import{ApiError as I}from"../../api/errors.js";import{RunError as s}from"../../core/runs/operations.js";import{ExitCode as o}from"../../types.js";function pe(e,t){const{report:n}=e;return{stores:n.stores.map(i=>({root:i.root,owner:{...i.owner},docs:i.docs,...i.skipped===void 0?{}:{skipped:i.skipped}})),counts:n.counts,rewrites:n.rewrites,dropped_fields:n.droppedFields,skipped:n.skipped,resolutions:n.resolutions.map(i=>({kind:i.kind,message:i.message,paths:i.paths})),blockers:e.blockers.map(i=>({kind:i.kind,message:i.message,paths:i.paths})),dryRun:e.dryRun,pending:e.pending,resumed:t.resumed,...t.resumeError===void 0?{}:{resume_error:t.resumeError}}}r(pe,"toMigrateStateDTO");async function F(e){try{return await y(e)??null}catch{return null}}r(F,"readStructuredResult");function P(e){return e.outcome_at===null||e.outcome_at===void 0||e.outcome_kind===null||e.outcome_kind===void 0||e.outcome_reason===null||e.outcome_reason===void 0?null:{kind:e.outcome_kind,reason:e.outcome_reason,settled_at:e.outcome_at}}r(P,"toNodeOutcomeSummaryDTO");async function m(e){if(e.outcome_at===null||e.outcome_at===void 0||e.outcome_kind===null||e.outcome_kind===void 0||e.outcome_reason===null||e.outcome_reason===void 0)return null;let t=null;if(e.outcome_detail_json!==null&&e.outcome_detail_json!==void 0)try{t=JSON.parse(e.outcome_detail_json)}catch{t=null}const n=e.final_report??null,i={node_id:e.node_id,revision:e.outcome_revision??1,settled_at:e.outcome_at,final_report:n===null?null:`${e.node_id}/${n}`,structured_result:e.outcome_kind==="result"?await F(e.node_id):null,detail:t};return e.outcome_kind==="result"?{...i,kind:"result",reason:e.outcome_reason,declined:null}:e.outcome_reason==="declined"?{...i,kind:"failure",reason:"declined",declined:t?.declined??null}:{...i,kind:"failure",reason:e.outcome_reason,declined:null}}r(m,"toNodeOutcomeDTO");async function me(e){const t=await m(e);return t===null||t.reason==="parked"?null:t.kind==="result"||t.reason==="finished"?{...t,kind:"result",reason:"finalized",declined:null}:t.reason==="declined"?{...t,reason:"declined",details:t.declined}:t.reason==="deadline_exceeded"?{...t,reason:"deadline_exceeded",declined:null}:t.reason==="cap_exhausted"?{...t,reason:"cap_exhausted",declined:null}:t.reason==="closed"||t.reason==="stranded"||t.reason==="retired"?{...t,reason:"canceled",declined:null}:{...t,reason:"runtime_error",declined:null,details:{crouter_reason:t.reason}}}r(me,"toRunOutcomeDTO");function ve(e){const t=e.lastFailure;return{node_id:e.nodeId,state:e.state,action:e.actionName,attempt:e.attempt,next_attempt_at:e.nextAttemptAt===0?null:new Date(e.nextAttemptAt).toISOString(),accepted_at:e.acceptedAt===null?null:new Date(e.acceptedAt).toISOString(),permanent_failed_at:e.permanentFailedAt===null?null:new Date(e.permanentFailedAt).toISOString(),last_failure:t===null?null:{kind:t.kind,...t.exitCode===void 0?{}:{exit_code:t.exitCode},...t.signal===void 0?{}:{signal:t.signal},...t.message===void 0?{}:{message:t.message}},created_at:new Date(e.createdAt).toISOString(),updated_at:new Date(e.updatedAt).toISOString()}}r(ve,"toOutcomeDeliveryDTO");function ke(e){return{node_id:e.node_id,name:e.name,description:e.description,cycles:e.cycles,kind:e.kind,status:e.status,frozen_at:e.frozen_at,pi_pid:e.pi_pid,telemetry_context_tokens:e.telemetry_context_tokens,telemetry_last_activity:e.telemetry_last_activity,fault:e.fault&&e.fault.link!=="broker\u2194crtrd"?{...e.fault,link:e.fault.link}:null,streaming:e.streaming}}r(ke,"toGraphNodeDTO");async function he(e,t=c(e.profile_id)){return{node_id:e.node_id,name:e.name,description:e.description,cycles:e.cycles,kind:e.kind,mode:e.mode,lifecycle:e.lifecycle,status:e.status,cwd:e.cwd,host_kind:e.host_kind,profile_id:e.profile_id,scopes:e.scopes,isolated:e.isolated,grantee:e.grantee??await f(e.node_id),profile_paused:t,parent:e.parent,created:e.created,intent:e.intent,waiting_for:(await p(e.node_id))?.controllerId??null,frozen_at:e.frozen_at??null,terminal_reason:e.terminal_reason??null,pi_pid:e.pi_pid,pi_pid_identity:e.pi_pid_identity,window:e.window,tmux_session:e.tmux_session,pane:e.pane,final_report:e.final_report??null,finalized_at:e.finalized_at??null,deadline_at:e.deadline_at??null,telemetry_tokens_in:e.telemetry_tokens_in??null,telemetry_context_tokens:e.telemetry_context_tokens??null,telemetry_last_activity:e.telemetry_last_activity??null,telemetry_updated_at:e.telemetry_updated_at??null,outcome:P(e),fault:e.fault&&e.fault.link!=="broker\u2194crtrd"?{...e.fault,link:e.fault.link}:null,streaming:e.streaming??!1}}r(he,"toNodeSummaryDTO");function U(e,t){return{parent:e.parent??null,spawned_by:e.spawned_by??null,subscribes_to:t.subscribesTo.map(n=>n.node_id),subscribers:t.subscribers.map(n=>n.node_id),children:[...t.children]}}r(U,"toNodeEdgesDTO");async function G(e,t){return{node_dir:await R(e,t),context_dir:await A(e,t),meta_path:T(e),transcript_path:E(e),view_socket:S(e)}}r(G,"toNodePathsDTO");function M(e){const t={state:e.state,path:e.path,branch:e.branch,repo_root:e.repo_root,base_ref:e.base_ref,base_sha:e.base_sha,created:e.created};return e.cleanup!==void 0&&(t.cleanup=e.cleanup),e.closed!==void 0&&(t.closed=e.closed),e.abandoned!==void 0&&(t.abandoned={...e.abandoned}),t}r(M,"toNodeWorktreeDTO");async function ge(e,t){const n=await f(e.node_id),i={node_id:e.node_id,name:e.name,kind:e.kind,mode:e.mode,lifecycle:e.lifecycle,status:e.status,cwd:e.cwd,host_kind:e.host_kind??null,profile_id:e.profile_id??null,scopes:e.scopes??null,isolated:e.isolated===!0,grantee:n,profile_paused:c(e.profile_id),parent:e.parent??null,created:e.created,intent:e.intent??null,waiting_for:(await p(e.node_id))?.controllerId??null,frozen_at:e.frozen_at??null,terminal_reason:e.terminal_reason??null,pi_pid:e.pi_pid??null,pi_pid_identity:e.pi_pid_identity??null,window:e.window??null,tmux_session:e.tmux_session??null,pane:e.pane??null,final_report:e.final_report??null,finalized_at:e.finalized_at??null,deadline_at:e.deadline_at??null,telemetry_tokens_in:e.telemetry_tokens_in??null,telemetry_context_tokens:e.telemetry_context_tokens??null,telemetry_last_activity:e.telemetry_last_activity??null,telemetry_updated_at:e.telemetry_updated_at??null,outcome:await m(e),fault:e.fault&&e.fault.link!=="broker\u2194crtrd"?{...e.fault,link:e.fault.link}:null,streaming:e.streaming??!1,creator:e.creator??null,edges:U(e,t),paths:await G(e.node_id,n)};return e.description!==void 0&&(i.description=e.description),e.title!==void 0&&(i.title=e.title),e.icon!==void 0&&(i.icon=e.icon),e.cycles!==void 0&&(i.cycles=e.cycles),i.context_tokens=e.telemetry_context_tokens??e.telemetry_tokens_in??null,e.pi_session_id!==void 0&&(i.pi_session_id=e.pi_session_id??null),i.model_override=e.model_override??null,e.pi_session_file!==void 0&&(i.pi_session_file=e.pi_session_file??null),e.review_binding!==void 0&&(i.review_binding=e.review_binding===null?null:{...e.review_binding.kind===void 0?{}:{kind:e.review_binding.kind},review_id:e.review_binding.review_id,origin_node_id:e.review_binding.origin_node_id,branch_file:e.review_binding.branch_file,target_file:e.review_binding.target_file}),e.managed_worktree!=null&&(i.worktree=M(e.managed_worktree)),i}r(ge,"toNodeDetailDTO");function be(e,t,n,i){return{node_id:e,revived:t.launch!==void 0,resumed:t.resumed,status:n,outcome:t.outcome,ready:i}}r(be,"toReviveResultDTO");function ye(e){return{root:e.root,closed:[...e.closed],spared:[...e.spared]}}r(ye,"toCloseResultDTO");function xe(e,t,n){const i={report:e.report,notified:[...e.deliveredTo]};return t!==void 0&&(i.transitioned=t),n!==void 0&&(i.worktree_auto_dropped=!0,i.worktree_auto_dropped_path=n),i}r(xe,"toReportResultDTO");function Oe(e){return{node_id:e.node_id,active:e.active,created:e.created}}r(Oe,"toSubscriptionDTO");function W(e){if(e===null||e==="")return[];try{const t=JSON.parse(e);return typeof t=="object"&&t!==null&&!Array.isArray(t)?Object.keys(t):[]}catch{return[]}}r(W,"envKeys");function De(e,t){return{cron_id:e.cron_id,name:e.name,created_by:e.created_by,command:e.command,grant_id:e.grant_id,scopes:e.scopes,origin_run_id:e.origin_run_id,isolated:e.isolated,fire_at:e.fire_at,recur:e.recur,tz:e.tz,expires_at:e.expires_at,anchor_node:e.anchor_node,cancel_on_wake:e.cancel_on_wake,cwd:e.cwd,profile:e.profile,scope:e.scope,env_keys:W(e.env_json),run_timeout_s:e.run_timeout_s,overlap:e.overlap,on_output:e.on_output,sink:x(e.sink),tier:e.tier,state:e.state,held:e.held,run_state:e.run_state,last_run:t==null?null:{finished:t.finished,exit_code:t.exit_code,delivered:t.delivered},created:e.created,updated:e.updated}}r(De,"toCronDTO");function Te(e){return{run_id:e.run_id,started:e.started,finished:e.finished,duration_ms:e.duration_ms,exit_code:e.exit_code,stdout_head:e.stdout_head,stderr_head:e.stderr_head,delivered:e.delivered}}r(Te,"toCronRunDTO");function Ee(e){return{id:e.profileId,app:e.manifest.grantee??"app:terminal",name:e.manifest.name,projects:e.manifest.projects.map(t=>({...t})),delivery_limits:{...e.manifest.delivery_limits},paused_at:e.manifest.paused_at,default_kind:e.manifest.default_kind??"general",metadata:D(e.manifest.metadata),default_dir:null,created_at:e.manifest.created_at,last_used_at:e.manifest.last_used_at,profile_path:O(e.profileId)}}r(Ee,"toProfileDTO");function v(e,t={}){const n={review_id:e.review_id,origin_kind:e.origin_kind,origin_node_id:e.origin_node_id,review_dir:e.review_dir,companion_node_id:e.companion_node_id,file:e.file,state:e.state,created:e.created,source_missing:e.source_missing,anchor_base_sha256:e.anchor_base_sha256};return e.document_name!==null&&(n.document=e.document_name),e.opened_at!==null&&(n.opened_at=e.opened_at),e.submit_requested_at!==null&&(n.submit_requested_at=e.submit_requested_at),e.approved_at!==null&&(n.approved_at=e.approved_at),e.changed!==null&&(n.changed=e.changed),e.comments_total!==null&&(n.comments_total=e.comments_total),e.comments_unresolved!==null&&(n.comments_unresolved=e.comments_unresolved),e.canceled_at!==null&&(n.canceled_at=e.canceled_at),e.cancel_reason!==null&&(n.cancel_reason=e.cancel_reason),e.cancel_actor!==null&&(n.cancel_actor=e.cancel_actor),t.result_path!==void 0&&(n.result_path=t.result_path),e.delivery_error!==null&&(n.delivery_error=e.delivery_error),e.projection_error!==null&&(n.projection_error=e.projection_error),n}r(v,"toReviewDTO");function Se(e){return{comment_id:e.comment_id,review_id:e.review_id,status:e.status,revision:e.revision,text:e.text,anchor:{...e.anchor},anchor_state:e.anchor_state,anchor_line_text:e.anchor_line_text,anchor_doc_hash:e.anchor_doc_hash,author:{kind:e.author.kind,...e.author.node_id===null?{}:{node_id:e.author.node_id}},updated_by:{kind:e.updated_by.kind,...e.updated_by.node_id===null?{}:{node_id:e.updated_by.node_id}},created_at:e.created_at,updated_at:e.updated_at,...e.resolved_at===null?{}:{resolved_at:e.resolved_at},...e.deleted_at===null?{}:{deleted_at:e.deleted_at},created_seq:e.created_seq}}r(Se,"toReviewCommentDTO");function B(e){return{id:e.id,quote:e.quote,...e.context===void 0?{}:{context:e.context},note:e.note,status:e.status,created_at:e.createdAt,...e.resolvedAt===void 0?{}:{resolved_at:e.resolvedAt}}}r(B,"toPageFeedbackCommentDTO");function Ae(e){return{companion_node_id:e.companionNodeId??null,open_count:e.comments.filter(t=>t.status==="open").length,comments:e.comments.map(B)}}r(Ae,"toPageFeedbackDTO");function Re(e){return{seq:e.seq,review_id:e.review_id,comment_id:e.comment_id,kind:e.kind,state_change:e.state_change===1,revision_after:e.revision_after,actor:{kind:e.actor.kind,...e.actor.node_id===null?{}:{node_id:e.actor.node_id}},at:e.at,operation_id:e.operation_id,...e.payload===void 0?{}:{payload:e.payload}}}r(Re,"toReviewCommentEventDTO");function ze(e){return{file:e.file,submitted:e.submitted,approved:e.approved,comments:e.comments.map(n=>({...n})),submittedAt:e.submittedAt,savedAt:e.savedAt,reviewId:e.review_id,changed:e.changed,baselineSha256:e.baseline_sha256,approvedSha256:e.approved_sha256,companionNodeId:e.companion_node_id,commentsTotal:e.comments_total,commentsUnresolved:e.comments_unresolved}}r(ze,"toFeedbackResultDTO");const L=!0,$=Object.freeze({review_origin_missing:{status:400,code:"review_origin_unavailable"},review_origin_unforkable:{status:400,code:"review_origin_unavailable"},review_branch_unavailable:{status:409,code:"review_branch_unavailable"},branch_lost:{status:409,code:"review_branch_unavailable"},review_companion_unbound:{status:409,code:"review_companion_unbound"},review_bridge_unsubscribed:{status:409,code:"review_bridge_unavailable"},review_target_unreviewable:{status:400,code:"review_file_unreadable"},source_unreadable:{status:409,code:"review_source_unreadable"},delivery_unroutable:{status:409,code:"review_delivery_unroutable"},unknown_review:{status:404,code:"unknown_review"},review_terminal:{status:409,code:"review_terminal_conflict"},review_required:{status:400,code:"review_required"},stale_document:{status:409,code:"stale_document"},stale_revision:{status:409,code:"stale_revision"},unknown_comment:{status:404,code:"unknown_comment"},comment_deleted:{status:409,code:"comment_deleted"},invalid_anchor:{status:400,code:"invalid_anchor"},anchor_out_of_range:{status:400,code:"anchor_out_of_range"},text_too_long:{status:400,code:"text_too_long"},comment_limit_reached:{status:409,code:"comment_limit_reached"},stale_comment:{status:409,code:"stale_comment"},range_batch_incomplete:{status:409,code:"range_batch_incomplete"},range_batch_stale:{status:409,code:"range_batch_stale"}});function K(e){const t=k(e);if(typeof t=="object"&&t!==null&&typeof t.status=="number"&&typeof t.code=="string")return{status:t.status,code:t.code};if(t instanceof z)return t.code==="unknown_node"?{status:404,code:"node_not_found"}:t.code==="already_finalized"?{status:409,code:"already_finalized"}:{status:409,code:"finalization_forbidden"};if(t instanceof N)return{status:409,code:"node_id_exists"};if(t instanceof C)return{status:403,code:"scope_denied"};if(j(t))return{status:400,code:"invalid_request"};if(t instanceof _)return $[t.code];if(t instanceof a)return["kind_owned","name_taken","hop_limit","not_a_queue"].includes(t.code)?{status:409,code:t.code}:t.code==="invalid_publish_token"?{status:401,code:t.code}:t.code==="forbidden"||t.code==="argv_forbidden"||t.code==="scope_missing"?{status:403,code:t.code}:{status:H(t.exitCode),code:t.code};if(t instanceof Error){const n=t.message;if(/unknown node/i.test(n))return{status:404,code:"node_not_found"};if(/finalization latch/i.test(n))return{status:409,code:"already_finalized"};if(/illegal lifecycle transition/i.test(n))return{status:409,code:"illegal_transition"}}return{status:500,code:"internal"}}r(K,"errorToStatus");function k(e){if(!(e instanceof q))return e;const t=e.code==="unknown_node"?o.NOT_FOUND:o.GENERAL,n={error:e.code,message:e.message,next:e.next};return e.detail!==void 0&&(n.received=e.detail),new a(e.code,e.message,t,n)}r(k,"normalizeThrow");function w(e){if(e.code!=="review_terminal")return e.detail;const{review:t,...n}=e.detail;return{...n,review:V(t)}}r(w,"reviewErrorDetails");function V(e){return e.state!=="approved"?v(e):v(e,{result_path:b(e.review_dir,"result.json")})}r(V,"terminalConflictReviewDTO");function H(e){switch(e){case o.NOT_FOUND:return 404;case o.USAGE:return 400;case o.AMBIGUOUS:return 400;case o.NETWORK:return 503;case o.GENERAL:return 400;default:return 500}}r(H,"statusForExitCode");function J(e){const n=(e instanceof Error?e.message:String(e)).split(`
|
|
2
|
+
`,1)[0].trim();return n===""?"internal error":n.length>500?`${n.slice(0,497)}\u2026`:n}r(J,"boundedCause");function Ne(e){const t=k(e),{status:n,code:i}=K(t);if(n>=500){const u={error:{code:i,message:J(t),origin:"runtime"}};return t instanceof s&&(u.error.retryable=t.retryable),{status:n,body:u}}const h=t instanceof Error?t.message:String(t),l=t instanceof _?w(t):(t instanceof a||t instanceof I||t instanceof s)&&t.details!==void 0?t.details:void 0,d={error:{code:i,message:h,origin:"runtime"}};return l!==void 0&&(d.error.details=l),t instanceof s&&(t.param&&(d.error.param=t.param),t.scope&&(d.error.scope=t.scope),d.error.retryable=t.retryable),{status:n,body:d}}r(Ne,"toErrorBody");export{$ as REVIEW_ERROR_MAP,K as errorToStatus,ye as toCloseResultDTO,De as toCronDTO,Te as toCronRunDTO,Ne as toErrorBody,ze as toFeedbackResultDTO,ke as toGraphNodeDTO,pe as toMigrateStateDTO,ge as toNodeDetailDTO,U as toNodeEdgesDTO,m as toNodeOutcomeDTO,P as toNodeOutcomeSummaryDTO,G as toNodePathsDTO,he as toNodeSummaryDTO,M as toNodeWorktreeDTO,ve as toOutcomeDeliveryDTO,B as toPageFeedbackCommentDTO,Ae as toPageFeedbackDTO,Ee as toProfileDTO,xe as toReportResultDTO,Se as toReviewCommentDTO,Re as toReviewCommentEventDTO,v as toReviewDTO,be as toReviveResultDTO,me as toRunOutcomeDTO,Oe as toSubscriptionDTO};
|