@north-light/cli 0.3.560 → 0.3.562
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/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/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.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 +20 -20
- package/dist/daemon/api/viewer-presence.d.ts +20 -6
- package/dist/daemon/api/viewer-presence.js +2 -1
- 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 O=Object.defineProperty;var h=(r,t)=>O(r,"name",{value:t,configurable:!0});import{updateRawConfigAtomically as j}from"./config.js";const b=["ultra","strong","medium","light"],R=/^[^/\s]+\/(ultra|strong|medium|light)$/;function
|
|
1
|
+
var O=Object.defineProperty;var h=(r,t)=>O(r,"name",{value:t,configurable:!0});import{updateRawConfigAtomically as j}from"./config.js";const b=["ultra","strong","medium","light"],R=/^[^/\s]+\/(ultra|strong|medium|light)$/;function a(r,t){if(r===null||typeof r!="object"||Array.isArray(r))throw new Error(`${t} must be an object`);return r}h(a,"object");function c(r,t){if(typeof r!="string"||r.trim()==="")throw new Error(`${t} must be a non-empty string`);return r}h(c,"nonempty");function M(r){const t=a(r,"model config"),g=a(t.modelRoutes,"modelRoutes"),s={};for(const[e,u]of Object.entries(g)){c(e,"route id");const i=a(u,`modelRoutes.${e}`),l=c(i.providerId,`modelRoutes.${e}.providerId`),d=a(i.models,`modelRoutes.${e}.models`),p={};for(const m of b){const y=c(d[m],`modelRoutes.${e}.models.${m}`),k=y.indexOf("/");if(k<=0||k===y.length-1||y.slice(0,k)!==l)throw new Error(`modelRoutes.${e}.models.${m} must be a ${l}/id ref`);p[m]=y}for(const m of Object.keys(d))if(!b.includes(m))throw new Error(`modelRoutes.${e}.models.${m} is not a model strength`);s[e]={family:c(i.family,`modelRoutes.${e}.family`),credentialSource:c(i.credentialSource,`modelRoutes.${e}.credentialSource`),providerId:l,models:p}}const o=a(t.modelRouting,"modelRouting");for(const e of["credentialSourceOrder","familyOrder"])if(o[e]!==void 0&&(!Array.isArray(o[e])||!o[e].every(u=>typeof u=="string"&&u.trim()!=="")))throw new Error(`modelRouting.${e} must be an array of non-empty strings`);if(o.strengthFallback!==void 0&&(!Array.isArray(o.strengthFallback)||!o.strengthFallback.every(e=>b.includes(e))))throw new Error("modelRouting.strengthFallback must be an array of model strengths");const n=new Set(Object.values(s).map(e=>e.family)),f=new Set(Object.values(s).map(e=>e.credentialSource));for(const e of o.familyOrder??[])if(!n.has(e))throw new Error(`modelRouting.familyOrder names unknown route family ${e}`);for(const e of o.credentialSourceOrder??[])if(!f.has(e))throw new Error(`modelRouting.credentialSourceOrder names unknown credential source ${e}`);const $=a(t.kinds,"kinds"),w={};for(const[e,u]of Object.entries($)){c(e,"kind");const i=a(u,`kinds.${e}`),l=c(i.model,`kinds.${e}.model`);if(!R.test(l))throw new Error(`kinds.${e}.model must be family/strength`);if(!n.has(l.slice(0,l.lastIndexOf("/"))))throw new Error(`kinds.${e}.model names unknown route family`);const d=i.orchestratorModel===void 0?void 0:c(i.orchestratorModel,`kinds.${e}.orchestratorModel`);if(d!==void 0&&!R.test(d))throw new Error(`kinds.${e}.orchestratorModel must be family/strength`);if(d!==void 0&&!n.has(d.slice(0,d.lastIndexOf("/"))))throw new Error(`kinds.${e}.orchestratorModel names unknown route family`);w[e]={model:l,...d===void 0?{}:{orchestratorModel:d}}}return{modelRoutes:s,modelRouting:structuredClone(o),kinds:w}}h(M,"validateCoreModelConfig");async function S(r){await j("user",t=>{const g=t.kinds!==null&&typeof t.kinds=="object"&&!Array.isArray(t.kinds)?t.kinds:{},s=Object.fromEntries(Object.entries(g).map(([o,n])=>{const f=n!==null&&typeof n=="object"&&!Array.isArray(n)?n:{},{model:$,orchestratorModel:w,...e}=f;return[o,e]}));for(const[o,n]of Object.entries(r.kinds)){const f=s[o]!==null&&typeof s[o]=="object"&&!Array.isArray(s[o])?s[o]:{};s[o]={...f,model:n.model,orchestratorModel:n.orchestratorModel??n.model}}return{...t,modelRoutes:structuredClone(r.modelRoutes),modelRouting:structuredClone(r.modelRouting),kinds:s}})}h(S,"replaceCoreModelConfig");export{S as replaceCoreModelConfig,M as validateCoreModelConfig};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type InitialModelRegistryLike, type InitialModelRouteSelection, type ModelRegistryLike, type ModelRequest, type RouteAvailability, type RoutedCandidate } from './model-routes.js';
|
|
2
|
+
/** Probe the common availability facts consumed unchanged by resolveProviderCandidates. Reads the person's credential rows: daemon-side callers only. */
|
|
3
|
+
export declare function probeRouteAvailability(candidate: RoutedCandidate, registry: ModelRegistryLike, now?: number): Promise<RouteAvailability>;
|
|
4
|
+
/** Select the first viable route for a new SDK session. Route declarations own
|
|
5
|
+
* preference order; logical requests append registered models not declared by a
|
|
6
|
+
* route. The caller owns broker faults/events and the no-viable outcome. */
|
|
7
|
+
export declare function selectInitialModelRoute<Model extends {
|
|
8
|
+
provider: string;
|
|
9
|
+
id: string;
|
|
10
|
+
}>(request: ModelRequest, registry: InitialModelRegistryLike<Model>, options?: {
|
|
11
|
+
cwd?: string;
|
|
12
|
+
profileId?: string | null;
|
|
13
|
+
now?: number;
|
|
14
|
+
}): Promise<InitialModelRouteSelection<Model>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var m=Object.defineProperty;var c=(t,r)=>m(t,"name",{value:r,configurable:!0});import{isManagedProvider as l,resolveProviderCandidates as w}from"./managed-providers.js";import{readSubscriptionPool as y}from"./subscription-state.js";import{expandModelCandidates as b,routeAvailability as h}from"./model-routes.js";async function $(t,r,i=Date.now()){return h(t,r,l(t.providerId)?await y(t.providerId):void 0,i)}c($,"probeRouteAvailability");async function P(t,r,i={}){const n=await b(t,i.cwd,i.profileId),f=new Set(n.map(e=>`${e.providerId}/${e.modelId}`)),I=t.kind==="logical"?r.getAll().filter(e=>!f.has(`${e.provider}/${e.id}`)).map((e,d)=>({routeId:`registry:${e.provider}/${e.id}`,credentialSource:"registry",family:e.provider,strength:"strong",providerId:e.provider,modelId:e.id,rank:n.length+d})):[],a=[...n,...I],p=i.now??Date.now(),s=new Map;for(const e of a)s.set(e,await $(e,r,p));const g=a.some(e=>{const d=s.get(e);return l(e.providerId)&&d.registered&&d.authenticated}),u=w(a.map(e=>({...e,...s.get(e),automaticFallback:e.routeId.startsWith("registry:")?l(e.providerId)||!g:!0})),p,{pinnedToFirst:t.kind==="exact"}),o=u.candidates[0],v=o===void 0?void 0:r.find(o.providerId,o.modelId);return{...o!==void 0&&v!==void 0?{selected:{model:v,candidate:o}}:{},rejected:u.rejected}}c(P,"selectInitialModelRoute");export{$ as probeRouteAvailability,P as selectInitialModelRoute};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelStrength } from '../types.js';
|
|
2
|
-
import { type ProviderCandidate, type ProviderCandidateRejection } from './
|
|
2
|
+
import { type ProviderCandidate, type ProviderCandidateRejection, type SubscriptionCredential } from './managed-providers.js';
|
|
3
3
|
export type ModelRequest = {
|
|
4
4
|
kind: 'logical';
|
|
5
5
|
family: string;
|
|
@@ -66,8 +66,13 @@ export declare function parseModelSpec(spec: string): {
|
|
|
66
66
|
modelId: string;
|
|
67
67
|
thinkingLevel?: string;
|
|
68
68
|
} | undefined;
|
|
69
|
+
type RotationReader = () => Promise<{
|
|
70
|
+
defaultFallbackStrength?: ModelStrength;
|
|
71
|
+
}>;
|
|
72
|
+
/** The process that owns the person's rows (daemon, API) registers how to read their rotation settings; a broker reads its launch snapshot, and a CLI process has neither and gets the default. */
|
|
73
|
+
export declare function registerRotationReader(reader: RotationReader): void;
|
|
69
74
|
/** Expand config-derived route order only. Availability never affects rank. */
|
|
70
|
-
export declare function expandModelCandidates(request: ModelRequest, cwd?: string, profileId?: string | null): RoutedCandidate[]
|
|
75
|
+
export declare function expandModelCandidates(request: ModelRequest, cwd?: string, profileId?: string | null): Promise<RoutedCandidate[]>;
|
|
71
76
|
/** Identify the one permanently invalid recipe shape: a concrete/exact request
|
|
72
77
|
* whose requested provider/model is absent from the serving registry. Auth and
|
|
73
78
|
* cooldown are deliberately outside this discriminator so callers retain their
|
|
@@ -75,18 +80,8 @@ export declare function expandModelCandidates(request: ModelRequest, cwd?: strin
|
|
|
75
80
|
export declare function unregisteredConcreteModel(request: ModelRequest | undefined, registry: ModelRegistryLike, options?: {
|
|
76
81
|
cwd?: string;
|
|
77
82
|
profileId?: string | null;
|
|
78
|
-
}): UnregisteredConcreteModel | undefined
|
|
79
|
-
/**
|
|
80
|
-
export declare function
|
|
81
|
-
/** Select the first viable route for a new SDK session. Route declarations own
|
|
82
|
-
* preference order; logical requests append registered models not declared by a
|
|
83
|
-
* route. The caller owns broker faults/events and the no-viable outcome. */
|
|
84
|
-
export declare function selectInitialModelRoute<Model extends {
|
|
85
|
-
provider: string;
|
|
86
|
-
id: string;
|
|
87
|
-
}>(request: ModelRequest, registry: InitialModelRegistryLike<Model>, options?: {
|
|
88
|
-
cwd?: string;
|
|
89
|
-
profileId?: string | null;
|
|
90
|
-
now?: number;
|
|
91
|
-
}): InitialModelRouteSelection<Model>;
|
|
83
|
+
}): Promise<UnregisteredConcreteModel | undefined>;
|
|
84
|
+
/** The availability facts of one route given the managed pool already read for its provider (undefined for a provider that has no pool). */
|
|
85
|
+
export declare function routeAvailability(candidate: RoutedCandidate, registry: ModelRegistryLike, pool: readonly SubscriptionCredential[] | undefined, now?: number): RouteAvailability;
|
|
92
86
|
export declare function modelRequestFromConfig(model: string | undefined, modelIntent: string | undefined, exact: boolean): ModelRequest | undefined;
|
|
87
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var E=Object.defineProperty;var
|
|
1
|
+
var E=Object.defineProperty;var s=(e,t)=>E(e,"name",{value:t,configurable:!0});import{readMergedLaunchConfig as U}from"./config.js";import{brokerConfigSnapshot as G}from"./config.js";import{coolingUntilFor as L}from"./managed-providers.js";const I="app",y=["ultra","strong","medium","light"],M=new Set(["off","minimal","low","medium","high","xhigh","max"]);function p(e){const t=e.indexOf("/");if(t<=0||t===e.length-1)return;const o=e.slice(0,t),r=e.slice(t+1),d=r.lastIndexOf(":"),a=d>0?r.slice(d+1).toLowerCase():void 0;return{providerId:o,modelId:a!==void 0&&M.has(a)?r.slice(0,d):r,...a!==void 0&&M.has(a)&&a!=="off"?{thinkingLevel:a}:{}}}s(p,"parseModelSpec");function H(e){const t=s(o=>{const r=e[o].strong.slice(0,e[o].strong.indexOf("/"));return{family:o,credentialSource:"default",providerId:r,models:e[o]}},"route");return{anthropic:t("anthropic"),openai:t("openai")}}s(H,"synthesizeRoutes");function A(e,t){return[e,...t.filter(o=>o!==e)]}s(A,"ordered");function P(e,t){return A(e,t).filter((o,r,d)=>d.indexOf(o)===r)}s(P,"strengths");let v;function Y(e){v=e}s(Y,"registerRotationReader");async function _(){const e=G();return e?e.rotation:v?v():{}}s(_,"rotationConfig");async function z(e,t,o){if(e.kind==="exact"){const n=p(e.spec);return n?[{routeId:"exact",credentialSource:"exact",family:n.providerId,strength:"strong",...n,rank:0}]:[]}if(e.kind==="logical"&&e.family===I){const n=p(e.spec);return n?[{routeId:I,credentialSource:I,family:I,strength:e.strength,...n,rank:0}]:[]}const r=U(t,o??null),d={...r.modelRoutes??{},...r.legacyModelRoutes??{}},a=Object.keys(d).length>0?d:H(r.modelLadders),u=Object.entries(a),g=r.modelRouting?.strengthFallback??[(await _()).defaultFallbackStrength??"strong"],N=u.map(([,n])=>n.family).filter((n,i,c)=>c.indexOf(n)===i),O=u.map(([,n])=>n.credentialSource).filter((n,i,c)=>c.indexOf(n)===i),f=e.kind==="concrete"?p(e.spec):void 0,R=e.kind==="logical"?e:void 0,C=s((n,i)=>{const c=p(n);return c!==void 0&&f!==void 0&&c.providerId===f.providerId&&c.modelId===f.modelId&&(!i||c.thinkingLevel===f.thinkingLevel)},"matchesConcrete"),F=f===void 0?void 0:u.find(([,n])=>Object.values(n.models).some(i=>C(i,!1))),x=R?.strength??(()=>{if(!f)return"strong";for(const n of[!0,!1])for(const i of n?y:[...y].reverse())if(u.some(([,c])=>{const m=c.models[i];return m!==void 0&&C(m,n)}))return i;return"strong"})(),k=R?.family??F?.[1].family??f?.providerId??"anthropic",T=f?O:r.modelRouting?.credentialSourceOrder??O,j=f?[k]:r.modelRouting?.familyOrder??N,S=[],b=new Set,w=s((n,i,c,m)=>{const l=p(m);if(!l||f&&l.modelId!==f.modelId)return;const h=JSON.stringify([n,l.providerId,l.modelId,l.thinkingLevel]);b.has(h)||(b.add(h),S.push({routeId:n,credentialSource:i.credentialSource,family:i.family,strength:c,...l,rank:S.length}))},"append");if(f){const[n,i]=F??["concrete",{family:k,credentialSource:"default"}];w(n,i,x,e.spec)}for(const n of T)for(const i of f?[x]:P(x,g))for(const c of A(k,j))for(const[m,l]of u){if(l.credentialSource!==n||l.family!==c)continue;const h=l.models[i];h&&w(m,l,i,h)}return S.map((n,i)=>({...n,rank:i}))}s(z,"expandModelCandidates");async function B(e,t,o={}){if(e===void 0||e.kind==="logical")return;const r=(await z(e,o.cwd,o.profileId))[0];if(!(r===void 0||t.find(r.providerId,r.modelId)!==void 0))return{request:e,candidate:r,reason:"unregistered"}}s(B,"unregisteredConcreteModel");function Q(e,t,o,r=Date.now()){const d=t.find(e.providerId,e.modelId);if(d===void 0)return{registered:!1,authenticated:!1};if(o===void 0)return{registered:!0,authenticated:t.hasConfiguredAuth(d)};const a=o.filter(g=>g.authFailure===void 0),u=a.length>0&&a.every(g=>L(g,e.modelId)>r);return{registered:!0,authenticated:a.length>0||t.hasConfiguredAuth(d),...u?{coolingUntil:Math.min(...a.map(g=>L(g,e.modelId)))}:{}}}s(Q,"routeAvailability");function V(e,t,o){if(e){if(o)return{kind:"exact",spec:e};if(t){const r=t.lastIndexOf("/"),d=r>0?t.slice(r+1):"";if(y.includes(d))return{kind:"logical",family:t.slice(0,r),strength:d,spec:e}}return{kind:"concrete",spec:e}}}s(V,"modelRequestFromConfig");export{I as APP_FAMILY,z as expandModelCandidates,V as modelRequestFromConfig,p as parseModelSpec,Y as registerRotationReader,Q as routeAvailability,B as unregisteredConcreteModel};
|
|
@@ -19,6 +19,8 @@ export interface IngestResult {
|
|
|
19
19
|
export declare const isCatalogLag: (code: string) => boolean;
|
|
20
20
|
/** The delivery key prefix of one sender's message; a delivery's full key adds `:<destination>`. */
|
|
21
21
|
export declare const ingestKey: (via: string, messageId: string) => string;
|
|
22
|
+
/** Postgres `deadlock_detected` (40P01) or `serialization_failure` (40001). */
|
|
23
|
+
export declare const isTransientDbError: (error: unknown) => boolean;
|
|
22
24
|
/** Apply a batch from machine `via`. One event's failure rejects only that event. Runs in the caller's write transaction.
|
|
23
25
|
*
|
|
24
26
|
* The home sends one row per destination while the receipt is per message, so the destination's half is handled for every row:
|
package/dist/core/peer/ingest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _=Object.defineProperty;var o=(e,t)=>_(e,"name",{value:t,configurable:!0});import{CrtrError as O}from"../errors.js";import{getById as w}from"../graph/objects.js";import{publish as h}from"../graph/events.js";import{markLinkWatch as L,recordWatch as R}from"../graph/watches.js";import{armObjectWaitForWatch as T}from"../graph/object-waits.js";import{ackRows as N,claimRows as C}from"./outbox-store.js";import{actorLockKeys as S,ensureStub as f,localOwnerActor as $,lockInOrder as F,stubLockKeys as I,stubOf as m}from"./stubs.js";import{withCanvasWrite as j}from"../canvas/db.js";const z=100,J=o(e=>e==="unknown_event"||e==="unknown_kind","isCatalogLag"),y=o((e,t)=>`peer:${e}:${t}`,"ingestKey");async function x(e,t){return await e.prepare("SELECT 1 FROM peer_ingested WHERE key = ?").get(t)!==void 0?!0:await e.prepare("SELECT 1 FROM deliveries WHERE idempotency_key >= ? AND idempotency_key < ? LIMIT 1").get(`${t}:`,`${t};`)!==void 0}o(x,"applied");const E=o(async(e,t,n)=>{await e.prepare("INSERT INTO peer_ingested_destinations (key, ingested_at) VALUES (?, ?) ON CONFLICT DO NOTHING").run(`${t}:${n}`,Date.now())},"markDestination");async function D(e,t,n){return await e.prepare("SELECT 1 FROM peer_ingested_destinations WHERE key = ?").get(`${t}:${n}`)!==void 0||await e.prepare("SELECT 1 FROM deliveries WHERE idempotency_key = ?").get(`${t}:${n}`)!==void 0}o(D,"destinationDone");async function W(e,t,n){return await $(e,t)??await f(e,t.id,t.type,n,void 0,t)}o(W,"actorFor");async function k(e,t,n,r,l){const i=n.actor===null?null:await W(e,n.actor,t),s=n.body_text,p=n.body===void 0&&s===void 0?void 0:{...n.body??{},...s===void 0?{}:{body:s}};await h(e,{event:n.event,object:r,actor:i,level:n.level,attrs:n.attrs,...p===void 0?{}:{messageBody:p},idempotencyKey:y(t,n.message_id),...l===void 0?{}:{onlyWatchers:l}})}o(k,"apply");async function A(e,t){const n=`ev:${t.message_id}:`;if(!t.key.startsWith(n)||t.key.length===n.length)return null;const r=await w(e,t.key.slice(n.length));return r!==null&&r.type==="node"&&r.deleted_at===null&&await m(e,r)===null?r:null}o(A,"localDestination");const H=o(e=>{const t=e?.code;return t==="40P01"||t==="40001"},"isTransientDbError");async function Q(e,t,n){const r={accepted:[],rejected:[]},l=[];for(const i of n)l.push(`ingest:${y(t,i.message_id)}`,...await I(e,i.object.id,i.object.type,null,i.object)),i.actor!==null&&l.push(...await S(e,i.actor));await F(e,l);for(const i of n){const s=y(t,i.message_id),p=await x(e,s);try{await j(async()=>{const a=await A(e,i);if(p&&a===null)return;const c=await f(e,i.object.id,i.object.type,t,void 0,i.object),d=i.linked===!0&&a!==null&&c.owner!==null?await w(e,c.owner):null,u=d!==null&&d.type==="app"?d:null;if(a!==null&&await e.prepare("SELECT 1 FROM watches WHERE watcher = ? AND object = ?").get(a.id,c.id)===void 0?(await R(e,a,c,"act",{patterns:[">"],...u===null?{}:{linkApp:u}}),await T(e,a,c)):a!==null&&u!==null&&await L(e,a,c,u),p)await D(e,s,a.id)||await k(e,t,i,c,[a.id]);else{await k(e,t,i,c),await e.prepare("INSERT INTO peer_ingested (key, ingested_at) VALUES (?, ?) ON CONFLICT DO NOTHING").run(s,Date.now());for(const g of await e.prepare("SELECT destination_id FROM deliveries WHERE idempotency_key >= ? AND idempotency_key < ?").all(`${s}:`,`${s};`))await E(e,s,g.destination_id)}a!==null&&await E(e,s,a.id)},{savepoint:!0}),r.accepted.push(i.key)}catch(a){if(H(a))throw a;const c=a instanceof O?a.code:"invalid_event";r.rejected.push({key:i.key,code:c,message:a instanceof Error?a.message:String(a)})}}return r}o(Q,"ingestPeerEvents");const Y=o(async(e,t,n)=>(await m(e,t))?.home_machine===n,"isStubOf"),Z=o(async(e,t,n)=>await C(e,t,n),"claimFor"),v=o(async(e,t,n)=>await N(e,t,n),"ackFor");export{z as MAX_EVENTS_PER_CALL,v as ackFor,Z as claimFor,y as ingestKey,Q as ingestPeerEvents,J as isCatalogLag,Y as isStubOf,H as isTransientDbError};
|
|
@@ -56,6 +56,14 @@ export declare const isStub: (db: CanvasDb, object: ObjectRow) => Promise<boolea
|
|
|
56
56
|
* owner, not a thing that lives on one machine: it is the same object here as there, so it is never given a stub (a stub would collide
|
|
57
57
|
* with the local owner object of the same handle, as with an installed plugin's app). */
|
|
58
58
|
export declare function localOwnerActor(db: CanvasDb, ref: ObjectRef): Promise<ObjectRow | null>;
|
|
59
|
+
/** Lock every key in `keys` in one global order (family rank, then lock hash), so no two transactions that lock overlapping sets can wait on
|
|
60
|
+
* each other. Locks are held to the end of the transaction, and taking one again is free. */
|
|
61
|
+
export declare function lockInOrder(db: CanvasDb, keys: readonly string[]): Promise<void>;
|
|
62
|
+
/** Every advisory lock `ensureStub` takes for this object: the stub, the custom kind its reference declares, and each owner it may create.
|
|
63
|
+
* A caller that touches several stubs locks the union with `lockInOrder` first, so the order never depends on which stub comes first. */
|
|
64
|
+
export declare function stubLockKeys(db: CanvasDb, id: string, type: string, identity: StubIdentity | null, ref: ObjectRef | undefined): Promise<string[]>;
|
|
65
|
+
/** The advisory locks `actorFor` takes for an event's actor. */
|
|
66
|
+
export declare function actorLockKeys(db: CanvasDb, ref: ObjectRef): Promise<string[]>;
|
|
59
67
|
/**
|
|
60
68
|
* The stub of the object `id` that lives on `machine`, created on first sight. Idempotent: a second
|
|
61
69
|
* call returns the same row and, given an `envelope`, replaces the identity it stores. Refuses
|
package/dist/core/peer/stubs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var T=Object.defineProperty;var
|
|
1
|
+
var T=Object.defineProperty;var r=(n,e)=>T(n,"name",{value:e,configurable:!0});import{createObject as A,getById as s,ownerForGrantee as f,ownerLockKey as L}from"../graph/objects.js";import{readLegacyPrivacy as N}from"../graph/types.js";import{upsertKind as g}from"../graph/custom.js";import{CrtrError as y}from"../errors.js";import{ExitCode as m}from"../../types.js";import{normalizeMachineId as W}from"./names.js";import{personId as d,personIdAsync as $}from"../canvas/person.js";import{writeActsFor as b}from"../permissions/facts.js";const I=["public","private"],H=r(n=>{const e=n.act.act;return e===void 0?{sub:n.sub,app:null,node:null,node_scopes:null,place:null}:{sub:n.sub,app:e.sub,node:e.node,node_scopes:e.node_scopes,place:e.place}},"identityOfEnvelope");async function S(n,e){const t=typeof e=="string"?await s(n,e):e;if(t===null)return null;const i=await n.prepare("SELECT home_machine, envelope_json FROM peer_stubs WHERE object = ?").get(t.id);return i?{object:t,home_machine:i.home_machine,identity:i.envelope_json===null?null:JSON.parse(i.envelope_json)}:null}r(S,"stubOf");const Q=r(async(n,e)=>await n.prepare("SELECT 1 FROM peer_stubs WHERE object = ?").get(e.id)!==void 0,"isStub");async function C(n){return await f(n,d())}r(C,"localPerson");async function D(n,e){return await f(n,e)}r(D,"localApp");async function X(n,e){return e.type==="app"?await D(n,`app:${e.name}`):e.type==="person"?await C(n):null}r(X,"localOwnerActor");function h(n,e){return n!==null?n.app===null?d():n.app:e?.type==="app"?e.external_id??`app:${e.handle}`:d()}r(h,"ownerGrantee");async function k(n,e,t){return await f(n,h(e,t?.owner))}r(k,"ownerFor");const P=["ingest:","stub:","owner:","kind:"],v=r(n=>{const e=P.findIndex(t=>n.startsWith(t));if(e<0)throw new Error(`lockInOrder: ${JSON.stringify(n)} is not a known lock key`);return e},"rankOf");async function U(n,e){const t=[...new Set(e)];if(t.length===0)return;const p=(await n.prepareUncached(t.map((a,o)=>`SELECT ${o} AS i, hashtext(?) AS h`).join(" UNION ALL ")).all(...t)).map(a=>({key:t[Number(a.i)],hash:Number(a.h)})).sort((a,o)=>v(a.key)-v(o.key)||a.hash-o.hash);for(const{key:a}of p)await n.prepare("SELECT pg_advisory_xact_lock(hashtext(?))").get(a)}r(U,"lockInOrder");async function E(n,e){const[t,i]=e.startsWith("app:")?["app",e]:["user",e];return await n.prepare("SELECT 1 FROM identities WHERE scheme = ? AND external_id = ?").get(t,i)===void 0?[L(t,i)]:[]}r(E,"missingOwnerKey");async function O(n,e,t,i,p){const a=[`stub:${e}`],o=p?.kind_decl;return o!==void 0&&o.name===t&&a.push(`kind:${t}`,...await E(n,h(null,o.owner))),await s(n,e)===null&&a.push(...await E(n,h(i,p?.owner))),a}r(O,"stubLockKeys");async function Z(n,e){return e.type==="app"?await E(n,`app:${e.name}`):e.type==="person"?await E(n,d()):await O(n,e.id,e.type,null,e)}r(Z,"actorLockKeys");async function K(n,e,t,i,p,a){const o=p===void 0?null:H(p),u=N(a?.privacy??"public");if(!I.includes(u))throw new y("invalid_event",`invalid privacy ${JSON.stringify(u)}`,m.GENERAL,{id:e});await U(n,await O(n,e,t,o,a));const c=await s(n,e);if(c!==null){const w=await S(n,c);if(w===null)throw new y("conflict",`${e} is a local ${c.type}, not a stub of ${i}`,m.GENERAL,{id:e});if(w.home_machine!==i)throw new y("conflict",`${e} is already a stub of ${w.home_machine}, not ${i}`,m.GENERAL,{id:e,home_machine:w.home_machine});return o!==null&&(await n.prepare("UPDATE peer_stubs SET envelope_json = ? WHERE object = ?").run(JSON.stringify(o),c.id),await n.prepare("UPDATE objects SET reception = 2 WHERE id = ?").run(c.id)),a!==void 0&&(await x(n,t,a),a.privacy!==void 0&&c.privacy!==u)?(await n.prepare("UPDATE objects SET privacy = ? WHERE id = ?").run(u,c.id),await s(n,c.id)):c}const _=await k(n,o,a);await x(n,t,a);const l=await A(n,{id:e,type:t,kind:a?.kind??null,owner:_.id,privacy:u,name:a?.name??e,preview:a?.preview??"",home_machine:i});return await n.prepare("INSERT INTO peer_stubs (object, home_machine, envelope_json, created_at) VALUES (?, ?, ?, ?)").run(l.id,i,o===null?null:JSON.stringify(o),new Date().toISOString()),_.type==="app"&&await b(n,l.id,await $()),o!==null&&await n.prepare("UPDATE objects SET reception = 2 WHERE id = ?").run(l.id),await s(n,l.id)}r(K,"ensureStub");async function x(n,e,t){const i=t?.kind_decl;i===void 0||i.name!==e||await g(n,{name:i.name,owner:await k(n,null,{...t,owner:i.owner}),description:i.description,events:i.events,read:null,source:"peer"})}r(x,"holdKind");async function ee(n,e,t){const i=await K(n,e,"node",W(t));return await n.prepare("UPDATE objects SET reception = 2 WHERE id = ?").run(i.id),await s(n,i.id)}r(ee,"ensureNodeStub");async function ne(n,e,t){const i=await S(n,e);i===null||i.home_machine===t||(await n.prepare("UPDATE peer_stubs SET home_machine = ? WHERE object = ?").run(t,i.object.id),await n.prepare("UPDATE objects SET home_machine = ? WHERE id = ?").run(t,i.object.id))}r(ne,"rehomeStub");async function te(n,e){const t=await R(n,e.owner===null?null:await s(n,e.owner)),i=await j(n,e.type);return{id:e.id,type:e.type,kind:e.kind,name:e.name,preview:e.preview,owner:t,privacy:e.privacy,...i===null?{}:{kind_decl:i}}}r(te,"describeObject");async function R(n,e){if(e===null||e.type!=="person"&&e.type!=="app"&&e.type!=="repo"&&e.type!=="profile")return null;const t=await n.prepare("SELECT scheme, external_id FROM identities WHERE object = ?").get(e.id);return{id:e.id,type:e.type,scheme:t?.scheme??null,external_id:t?.external_id??null,handle:e.name}}r(R,"ownerRefOf");async function j(n,e){const t=await n.prepare("SELECT owner, description, events_json FROM object_kinds WHERE name = ?").get(e),i=t===void 0?null:await R(n,await s(n,t.owner));return t===void 0||i===null?null:{name:e,description:t.description,events:JSON.parse(t.events_json),owner:i}}r(j,"kindDeclarationOf");async function ie(n,e,t){const i=await j(n,e.type);return i===null?t:{...t,kind_decl:i}}r(ie,"withKindDecl");export{Z as actorLockKeys,te as describeObject,ee as ensureNodeStub,K as ensureStub,H as identityOfEnvelope,Q as isStub,j as kindDeclarationOf,X as localOwnerActor,U as lockInOrder,ne as rehomeStub,O as stubLockKeys,S as stubOf,ie as withKindDecl};
|
|
@@ -5,14 +5,19 @@ import { type SubjectSet } from './compile.js';
|
|
|
5
5
|
import { type Frag } from './sql.js';
|
|
6
6
|
export type Permission = 'read' | 'edit' | 'message' | 'use' | 'share';
|
|
7
7
|
export declare const PERMISSIONS: readonly Permission[];
|
|
8
|
-
/** A reader with its user and subject set resolved: build once, pass to many `permits`/`check` calls.
|
|
8
|
+
/** A reader with its user and subject set resolved: build once, pass to many `permits`/`check` calls. `userId` is null for a reader
|
|
9
|
+
* that acts for no person (see `readerUser`): its subjects are `*` alone. */
|
|
9
10
|
export interface EvalReader {
|
|
10
11
|
reader: Reader;
|
|
11
|
-
userId: string;
|
|
12
|
+
userId: string | null;
|
|
12
13
|
subjects: SubjectSet;
|
|
13
14
|
}
|
|
14
15
|
/** The user a reader acts for: a person's own identity; an app call's `sub`; a node's `sub`; otherwise the install's person. */
|
|
15
16
|
export declare function userOf(db: CanvasDb, reader: Reader): Promise<string>;
|
|
17
|
+
/** The user a reader reads as: `userOf`, except that on a cloud role an app reader with no `sub` (a runtime-owned call, such as
|
|
18
|
+
* package link derivation at boot) acts for no person and answers null. `userOf` itself keeps throwing there, so no write path
|
|
19
|
+
* records an object as kept for a person that is not there. */
|
|
20
|
+
export declare function readerUser(db: CanvasDb, reader: Reader): Promise<string | null>;
|
|
16
21
|
/** The user ids a subject stands for (the user and `*`) and every group it reaches, directly or through nested groups. */
|
|
17
22
|
export declare function subjectSet(db: CanvasDb, userId: string): Promise<SubjectSet>;
|
|
18
23
|
export declare function resolveReader(db: CanvasDb, reader: Reader): Promise<EvalReader>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
1
|
+
var j=Object.defineProperty;var o=(e,t)=>j(e,"name",{value:t,configurable:!0});import{isCloudRole as C,personIdAsync as m}from"../canvas/person.js";import{OBJECT_TYPE as I,GROUP_TYPE as w}from"./builtin.js";import{ceilingFrag as L,resolveCeiling as O}from"./ceiling.js";import{compilePermission as f}from"./compile.js";import{PermissionError as $}from"./errors.js";import{loadDefinitions as A}from"./schemas.js";import{TRUE as x,and as H,f as E,or as U,raw as p}from"./sql.js";const D=["read","edit","message","use","share"],W={read:"read",use:"read",edit:"write",share:"write",message:"message"},l=o(e=>e.replace(/^user:/,""),"bareUser");async function F(e,t){if(t.class==="person"){const c=await e.prepare("SELECT external_id FROM identities WHERE object = ? AND scheme = 'user'").get(t.person.id);return l(c?.external_id??await m())}if(t.class==="app")return l(t.sub??await m());const s=t.class==="node"?t.node.id:t.object.id,r=await e.prepare("SELECT sub FROM nodes WHERE node_id = ?").get(s);return l(r?.sub??await m())}o(F,"userOf");async function M(e,t){return t.class==="app"&&t.sub===void 0&&C()?null:await F(e,t)}o(M,"readerUser");async function _(e,t){const s=[t,"*"],r=await e.prepareUncached(`WITH RECURSIVE g(id) AS (
|
|
2
2
|
SELECT resource_id FROM relations WHERE resource_type = ? AND relation = 'member' AND subject_type = 'user' AND subject_id = ANY(?::text[])
|
|
3
3
|
UNION
|
|
4
4
|
SELECT r.resource_id FROM relations r JOIN g ON r.subject_type = ? AND r.subject_id = g.id AND r.subject_relation = 'member'
|
|
5
5
|
WHERE r.resource_type = ? AND r.relation = 'member')
|
|
6
|
-
SELECT id FROM g`).all(w,s,w,w);return{userIds:s,groupIds:r.map(c=>c.id)}}
|
|
6
|
+
SELECT id FROM g`).all(w,s,w,w);return{userIds:s,groupIds:r.map(c=>c.id)}}o(_,"subjectSet");async function k(e,t){const s=await M(e,t);return{reader:t,userId:s,subjects:s===null?{userIds:["*"],groupIds:[]}:await _(e,s)}}o(k,"resolveReader");const P=o(e=>"subjects"in e,"isEval");async function v(e,t,s,r="o",c={}){if(!D.includes(s))throw new $(400,"unknown_permission",`unknown permission ${s}`);const n=P(t)?t:await k(e,t),i=await A(e),d=p(`${r}.id`),N=f(i,n.subjects,I,s,d),S=s==="read"?U([N,p(`${r}.type = 'app'`)]):N,R=n.reader.class==="person"?null:n.reader.app.id,T=n.reader.class==="app"&&n.reader.place===void 0&&R!==null?await q(e,R):new Set,u=[];for(const[a,y]of i){if(a.startsWith("crtr/")||a==="user"||a==="app"||!(s in y.permissions)&&!(s in y.relations))continue;const b=a.split("/")[0];u.push(E`WHEN ${p(r)}.schema_type = ${a} THEN ${T.has(b)?x:f(i,n.subjects,a,s,d)}`)}const g=u.length===0?E`(CASE WHEN ${p(r)}.schema_type IS NULL THEN ${S} ELSE FALSE END)`:E`(CASE WHEN ${p(r)}.schema_type IS NULL THEN ${S} ${{sql:u.map(a=>a.sql).join(" "),params:u.flatMap(a=>a.params)}} ELSE FALSE END)`,h=await O(e,n.reader,W[s],c);return h===null?g:H([L(h,r),g])}o(v,"permits");async function q(e,t){const s=await e.prepare("SELECT s.namespace FROM schemas s JOIN identities i ON i.external_id = s.app AND i.scheme = 'app' WHERE i.object = ?").all(t);return new Set(s.map(r=>r.namespace))}o(q,"ownNamespaceTypes");async function Z(e,t,s,r,c={}){const n=await v(e,t,s,"o",c);return(await e.prepareUncached(`SELECT ${n.sql} AS ok FROM objects o WHERE o.id = ?`).get(...n.params,r))?.ok===!0}o(Z,"check");async function ee(e,t,s,r){const c=await _(e,l(t)),n=await A(e),i=f(n,c,r.type,s,E`${r.id}::text`);return(await e.prepareUncached(`SELECT ${i.sql} AS ok`).get(...i.params))?.ok===!0}o(ee,"checkUser");export{D as PERMISSIONS,Z as check,ee as checkUser,v as permits,M as readerUser,k as resolveReader,_ as subjectSet,F as userOf};
|
package/dist/core/plugin-env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var s=(t,e)=>u(t,"name",{value:e,configurable:!0});import{
|
|
1
|
+
var u=Object.defineProperty;var s=(t,e)=>u(t,"name",{value:e,configurable:!0});import{isReservedEnvName as a,validateEnvVarName as f}from"./env-name.js";function d(t){if(!t||typeof t!="object"||Array.isArray(t))return["env must be an object mapping variable names to declarations"];const e=[];for(const[r,i]of Object.entries(t)){if((!f(r).isValid||a(r))&&e.push(`env.${r} has an invalid or reserved name`),!i||typeof i!="object"||Array.isArray(i)){e.push(`env.${r} must be an object`);continue}const n=i;(typeof n.description!="string"||!n.description.trim())&&e.push(`env.${r}.description must be a non-empty string`),n.required!==void 0&&typeof n.required!="boolean"&&e.push(`env.${r}.required must be boolean`),n.secret!==void 0&&typeof n.secret!="boolean"&&e.push(`env.${r}.secret must be boolean`),n.url!==void 0&&(typeof n.url!="string"||!/^https:\/\/[^\s]+$/.test(n.url))&&e.push(`env.${r}.url must be an https URL`);for(const o of Object.keys(n))["description","required","secret","url"].includes(o)||e.push(`env.${r}.${o} is unknown`)}return e}s(d,"invalidPluginEnvReasons");function l(t){return Object.entries(t??{}).filter(([,e])=>e.required!==!1).map(([e])=>e)}s(l,"requiredPluginEnv");export{d as invalidPluginEnvReasons,l as requiredPluginEnv};
|
|
@@ -11,17 +11,14 @@ import { type ManagedProviderId, type SubscriptionCredential } from './subscript
|
|
|
11
11
|
* nothing: deciding a turn is unservable belongs to the rotation loop, and an `undefined` here
|
|
12
12
|
* would make pi's eager launch gate FATAL a node that rotation could still have serviced.
|
|
13
13
|
*/
|
|
14
|
-
export declare function electPoolCredential(providerId: ManagedProviderId, now?: number): SubscriptionCredential | undefined
|
|
14
|
+
export declare function electPoolCredential(providerId: ManagedProviderId, now?: number): Promise<SubscriptionCredential | undefined>;
|
|
15
15
|
export declare class PoolCredentialStore implements CredentialStore {
|
|
16
|
-
private readonly authPath;
|
|
17
16
|
private readonly auth;
|
|
18
|
-
constructor(authPath?: string);
|
|
19
17
|
read(providerId: string): Promise<Credential | undefined>;
|
|
20
18
|
list(): Promise<readonly CredentialInfo[]>;
|
|
21
19
|
/**
|
|
22
20
|
* pi's locked read-modify-write, chiefly its OAuth refresh. The whole transaction — electing
|
|
23
|
-
* the account, running pi's `fn`, committing the result — happens under the
|
|
24
|
-
* cross-process lock, because a refresh token is single-use: two brokers electing the same
|
|
21
|
+
* the account, running pi's `fn`, committing the result — happens under the account row locks, because a refresh token is single-use: two brokers electing the same
|
|
25
22
|
* expired account outside a lock would both spend it and the loser would get a genuine
|
|
26
23
|
* `invalid_grant`. Electing under the lock is also what guarantees the refreshed token lands
|
|
27
24
|
* back on exactly the account whose token was spent.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var l=Object.defineProperty;var s=(
|
|
1
|
+
var l=Object.defineProperty;var s=(i,t)=>l(i,"name",{value:t,configurable:!0});import{CrouterCredentialStore as w}from"./auth-file.js";import{MANAGED_PROVIDER_IDS as m,getProviderLabel as g,isManagedProvider as u,modifyElectedSubscription as x,readSubscriptionPool as f,removeManagedAccount as y}from"./subscription-state.js";import{registerGateCredentialStore as p}from"./runtime/provider-credential-gate.js";async function c(i,t=Date.now()){return h(await f(i),t)}s(c,"electPoolCredential");function h(i,t=Date.now()){return i.find(e=>!e.authFailure&&(!e.rateLimitedUntil||e.rateLimitedUntil<=t))??i[0]}s(h,"electFrom");function d(i){return{type:"oauth",refresh:i.refresh,access:i.access,expires:i.expires,...i.accountId?{accountId:i.accountId}:{},...i.clientId?{clientId:i.clientId}:{}}}s(d,"toCredential");class C{static{s(this,"PoolCredentialStore")}auth=new w;async read(t){if(!u(t))return this.auth.read(t);const e=await c(t);if(e!==void 0)return d(e);const a=await this.auth.read(t);return a?.type==="oauth"?void 0:a}async list(){const t=(await this.auth.list()).filter(e=>!(u(e.providerId)&&e.type==="oauth"));for(const e of m)t.some(a=>a.providerId===e)||(await f(e)).length>0&&t.push({providerId:e,type:"oauth"});return t}async modify(t,e){if(!u(t))return this.auth.modify(t,e);if(await c(t)===void 0){if(await this.read(t)!==void 0)return this.auth.modify(t,e);throw new Error(`${g(t)} has no account to update \u2014 add one with \`crtr sys settings\` or \`/provider-sub ${t} add\`.`)}const a=await x(t,r=>h(r),async r=>{const n=await e(d(r));if(n===void 0||n.type!=="oauth")return;const o=n.clientId;return{refresh:n.refresh,access:n.access,expires:n.expires,...typeof o=="string"&&o?{clientId:o}:{}}});return a===void 0?void 0:d(a)}async delete(t){if(!u(t))return this.auth.delete(t);const e=await c(t);e!==void 0&&await y(t,e.label),await this.auth.read(t)!==void 0&&await this.auth.delete(t)}}p(new C);export{C as PoolCredentialStore,c as electPoolCredential};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const isDeploymentName: (name: string) => boolean;
|
|
2
|
-
/** Every var an app's processes receive: its own
|
|
3
|
-
export declare function readAppEnvVars(app: string): Record<string, string
|
|
4
|
-
export declare function listAppEnvNames(app: string): string[]
|
|
5
|
-
export declare function setAppEnvVar(app: string, name: string, value: string): boolean
|
|
6
|
-
export declare function removeAppEnvVar(app: string, name: string): boolean
|
|
2
|
+
/** Every var an app's processes receive: its own rows plus the deployment-wide ones. */
|
|
3
|
+
export declare function readAppEnvVars(app: string, person?: string): Promise<Record<string, string>>;
|
|
4
|
+
export declare function listAppEnvNames(app: string, person?: string): Promise<string[]>;
|
|
5
|
+
export declare function setAppEnvVar(app: string, name: string, value: string, person?: string): Promise<boolean>;
|
|
6
|
+
export declare function removeAppEnvVar(app: string, name: string, person?: string): Promise<boolean>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
`,{mode:384}),A(n,384),b(n,e)}o(R,"write");function F(t){if(!d(t).isValid||!(v(t)||s(t)))throw l(`invalid or reserved env var name: ${t}`,{field:"name"})}o(F,"validate");function y(t,r,e){F(r);const n=V(t,r);return m(p(n.path())),j(`${n.path()}.lock`,()=>{const i=a(n),c=e(i);return c!==null&&R(n,i),c})}o(y,"update");function $(t){return{...a(h(t)),...a(E)}}o($,"readAppEnvVars");function Y(t){return Object.keys($(t)).sort()}o(Y,"listAppEnvNames");function q(t,r,e){if(!e||e.includes("\0"))throw l("a non-empty env value without NUL bytes is required",{field:"value"});return y(t,r,n=>{const i=!Object.hasOwn(n,r);return n[r]=e,i})}o(q,"setAppEnvVar");function I(t,r){return y(t,r,e=>Object.hasOwn(e,r)?(delete e[r],!0):null)??!1}o(I,"removeAppEnvVar");export{s as isDeploymentName,Y as listAppEnvNames,$ as readAppEnvVars,I as removeAppEnvVar,q as setAppEnvVar};
|
|
1
|
+
var u=Object.defineProperty;var a=(t,e)=>u(t,"name",{value:e,configurable:!0});import{isReservedEnvName as N,validateEnvVarName as c}from"../env-name.js";import{usage as E}from"../errors.js";import{personIdAsync as y}from"../canvas/person.js";import{listEnvRowNames as w,putEnvRow as R,readEnvRows as d,removeEnvRow as A}from"../secrets/env-rows.js";import{DEPLOYMENT_ID as O}from"../secrets/environment-secrets.js";const D=new Set(["CRTR_FEEDBACK_ENDPOINT","CRTR_FEEDBACK_TOKEN"]),i=a(t=>D.has(t),"isDeploymentName"),o=a(t=>!N(t),"isAppName"),s={person:null,kind:"deployment",id:O},p=a(async(t,e)=>({person:e??await y(),kind:"app",id:t}),"appOwner"),v=a(async(t,e,n)=>i(e)?s:await p(t,n),"ownerFor");function m(t){if(!c(t).isValid||!(o(t)||i(t)))throw E(`invalid or reserved env var name: ${t}`,{field:"name"})}a(m,"validate");const f=a((t,e)=>{const n=Object.create(null);for(const[r,l]of Object.entries(t))c(r).isValid&&e(r)&&(n[r]=l);return n},"admitted");async function L(t,e){return{...f(await d(await p(t,e)),o),...f(await d(s),i)}}a(L,"readAppEnvVars");async function M(t,e){return[...(await w(await p(t,e))).filter(o),...(await w(s)).filter(i)].sort()}a(M,"listAppEnvNames");async function P(t,e,n,r){if(!n||n.includes("\0"))throw E("a non-empty env value without NUL bytes is required",{field:"value"});return m(e),await R(await v(t,e,r),e,n)}a(P,"setAppEnvVar");async function b(t,e,n){return m(e),await A(await v(t,e,n),e)}a(b,"removeAppEnvVar");export{i as isDeploymentName,M as listAppEnvNames,L as readAppEnvVars,b as removeAppEnvVar,P as setAppEnvVar};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare function resolveBindingCwd(cwd: string): string;
|
|
2
2
|
export declare function getDefaultProfileId(cwd: string): string | null;
|
|
3
|
-
export declare function setDefaultProfileId(cwd: string, profileId: string): void
|
|
4
|
-
export declare function clearDefaultProfile(cwd: string): void
|
|
3
|
+
export declare function setDefaultProfileId(cwd: string, profileId: string): Promise<void>;
|
|
4
|
+
export declare function clearDefaultProfile(cwd: string): Promise<void>;
|
|
5
5
|
export declare function defaultProfileDirs(profileId: string): string[];
|
|
6
|
-
export declare function clearDefaultProfileId(profileId: string): string[]
|
|
6
|
+
export declare function clearDefaultProfileId(profileId: string): Promise<string[]>;
|
|
7
7
|
export declare function listDefaultPins(): Array<{
|
|
8
8
|
dir: string;
|
|
9
9
|
profileId: string;
|
|
10
10
|
}>;
|
|
11
11
|
/** Drop every pin whose directory no longer exists; returns what was removed. */
|
|
12
|
-
export declare function clearMissingDefaultDirs(): Array<{
|
|
12
|
+
export declare function clearMissingDefaultDirs(): Promise<Array<{
|
|
13
13
|
dir: string;
|
|
14
14
|
profile_id: string;
|
|
15
|
-
}
|
|
15
|
+
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var f=Object.defineProperty;var n=(t,e)=>f(t,"name",{value:e,configurable:!0});import{existsSync as l,realpathSync as u}from"node:fs";import{resolve as d}from"node:path";import{cachedDefaults as p,writeSettings as m}from"../scoped-state/person-store.js";function s(t){const e=d(t);if(!l(e))return e;try{return u(e)}catch{return e}}n(s,"resolveBindingCwd");function c(){return p()}n(c,"bindings");function w(t){return c()[s(t)]??null}n(w,"getDefaultProfileId");async function a(t){await m(e=>[{op:"defaults.replace",defaults:t({...e.defaults})}])}n(a,"replaceDefaults");async function P(t,e){const i=s(t);await a(r=>({...r,[i]:e}))}n(P,"setDefaultProfileId");async function g(t){const e=s(t);await a(i=>{const r={...i};return delete r[e],r})}n(g,"clearDefaultProfile");function j(t){return Object.entries(c()).filter(([,e])=>e===t).map(([e])=>e).sort()}n(j,"defaultProfileDirs");async function O(t){let e=[];return await a(i=>{e=Object.entries(i).filter(([,o])=>o===t).map(([o])=>o).sort();const r={...i};for(const o of e)delete r[o];return r}),e}n(O,"clearDefaultProfileId");function h(){return Object.entries(c()).map(([t,e])=>({dir:t,profileId:e})).sort((t,e)=>t.dir.localeCompare(e.dir))}n(h,"listDefaultPins");async function v(){let t=[];return await a(e=>{t=Object.entries(e).filter(([r])=>!l(r)).map(([r,o])=>({dir:r,profile_id:o})).sort((r,o)=>r.dir.localeCompare(o.dir));const i=new Set(t.map(r=>r.dir));return Object.fromEntries(Object.entries(e).filter(([r])=>!i.has(r)))}),t}n(v,"clearMissingDefaultDirs");export{g as clearDefaultProfile,O as clearDefaultProfileId,v as clearMissingDefaultDirs,j as defaultProfileDirs,w as getDefaultProfileId,h as listDefaultPins,s as resolveBindingCwd,P as setDefaultProfileId};
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* so a concurrent `profile delete` can never race a write into an
|
|
7
|
-
* about-to-vanish profile dir — whichever runs first wins the lock, and the
|
|
8
|
-
* loser either sees `not_found` (delete-then-set) or removes the file right
|
|
9
|
-
* back out from under a just-written value (set-then-delete, via
|
|
10
|
-
* `deleteProfile`'s recursive rm of the whole profile root). Returns whether
|
|
11
|
-
* the name was newly added (`true`) or replaced an existing value (`false`). */
|
|
12
|
-
export declare function setProfileEnvVar(profileId: string, name: string, value: string): boolean;
|
|
1
|
+
/** Every stored variable NAME for a profile, sorted. Never opens or returns values. */
|
|
2
|
+
export declare function listProfileEnvNames(profileId: string, person?: string): Promise<string[]>;
|
|
3
|
+
/** Set one variable, replacing any prior value under the same name. Returns whether the name was newly added (`true`) or replaced an
|
|
4
|
+
* existing value (`false`). One upsert on the sealed row; the profile must exist. */
|
|
5
|
+
export declare function setProfileEnvVar(profileId: string, name: string, value: string, person?: string): Promise<boolean>;
|
|
13
6
|
/** Remove one variable. Returns whether it was present. */
|
|
14
|
-
export declare function removeProfileEnvVar(profileId: string, name: string): boolean
|
|
15
|
-
/** Every stored `{name: value}` for a profile — the ONLY function that
|
|
16
|
-
*
|
|
17
|
-
* (
|
|
18
|
-
|
|
19
|
-
* hot-path no-op (mirrors `readRawProfileConfig` in `core/config.ts`),
|
|
20
|
-
* because broker-env resolution must never fail a launch over a bad profile
|
|
21
|
-
* id. */
|
|
22
|
-
export declare function readProfileEnvVars(profileId: string | null): Record<string, string>;
|
|
7
|
+
export declare function removeProfileEnvVar(profileId: string, name: string, person?: string): Promise<boolean>;
|
|
8
|
+
/** Every stored `{name: value}` for a profile — the ONLY function that returns raw values, called by `buildBrokerEnv`
|
|
9
|
+
* (`core/runtime/spawn-env.ts`), the bash handler and cron. A null or empty profile id is `{}`. A row that fails to open
|
|
10
|
+
* (another key, altered bytes) throws: a launch never proceeds with a silently empty environment. */
|
|
11
|
+
export declare function readProfileEnvVars(profileId: string | null, person?: string): Promise<Record<string, string>>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
`,{mode:384}),b(o,384),S(o,r)}n(d,"writeStoreAtomic");function h(e){try{c(e)}catch(t){throw t instanceof Error&&t.message.startsWith("profile not found:")?N(`profile not found: ${e}`,{received:e}):t}}n(h,"requireProfileExists");function F(e){return Object.keys(s(e).vars).sort()}n(F,"listProfileEnvNames");function A(e,t,r){if(v(t))throw f(`env var name is reserved by crtr: ${t}`,{received:t,field:"name",next:"crtr identity/routing names (CRTR_* and HOME) cannot be stored in a profile env store \u2014 a stored value under one of these names could redirect a broker to a different canvas home. Choose a different name."});if(m(r))throw f("env var value contains a NUL byte, which no OS accepts in an environment variable",{field:"value",next:"Remove NUL bytes from the piped value and retry."});return u(e,()=>{h(e);const o=s(e),i=!Object.hasOwn(o.vars,t);return o.vars[t]=r,d(e,o),i})}n(A,"setProfileEnvVar");function D(e,t){return u(e,()=>{h(e);const r=s(e);return Object.hasOwn(r.vars,t)?(delete r.vars[t],d(e,r),!0):!1})}n(D,"removeProfileEnvVar");function L(e){if(e===null||e==="")return{};try{return{...s(e).vars}}catch{return{}}}n(L,"readProfileEnvVars");export{v as isReservedEnvName,F as listProfileEnvNames,L as readProfileEnvVars,D as removeProfileEnvVar,A as setProfileEnvVar};
|
|
1
|
+
var c=Object.defineProperty;var n=(e,r)=>c(e,"name",{value:r,configurable:!0});import{loadExactProfileManifest as v}from"./manifest.js";import{notFound as u,usage as s}from"../errors.js";import{isReservedEnvName as i}from"../env-name.js";import{personIdAsync as m}from"../canvas/person.js";import{listEnvRowNames as d,putEnvRow as l,readEnvRows as w,removeEnvRow as y}from"../secrets/env-rows.js";function h(e){return e.includes("\0")}n(h,"hasNulByte");const a=n(async(e,r)=>({person:r??await m(),kind:"profile",id:e}),"ownerOf");function f(e){try{v(e)}catch(r){throw r instanceof Error&&r.message.startsWith("profile not found:")?u(`profile not found: ${e}`,{received:e}):r}}n(f,"requireProfileExists");async function P(e,r){return(await d(await a(e,r))).filter(t=>!i(t))}n(P,"listProfileEnvNames");async function O(e,r,t,o){if(i(r))throw s(`env var name is reserved by crtr: ${r}`,{received:r,field:"name",next:"crtr identity/routing names (CRTR_* and HOME) cannot be stored in a profile env store \u2014 a stored value under one of these names could redirect a broker to a different canvas home. Choose a different name."});if(h(t))throw s("env var value contains a NUL byte, which no OS accepts in an environment variable",{field:"value",next:"Remove NUL bytes from the piped value and retry."});return f(e),await l(await a(e,o),r,t)}n(O,"setProfileEnvVar");async function g(e,r,t){return f(e),await y(await a(e,t),r)}n(g,"removeProfileEnvVar");async function k(e,r){if(e===null||e==="")return{};const t=await w(await a(e,r));for(const o of Object.keys(t))i(o)&&delete t[o];return t}n(k,"readProfileEnvVars");export{P as listProfileEnvNames,k as readProfileEnvVars,g as removeProfileEnvVar,O as setProfileEnvVar};
|
|
@@ -55,11 +55,7 @@ export declare function resolveProfileOperand(operand: string): ProfileEntry;
|
|
|
55
55
|
/** `resolveProfileOperand` over any candidate list — the CLI passes the
|
|
56
56
|
* profiles the daemon lists for its caller. */
|
|
57
57
|
export declare function matchProfileOperand<T>(all: readonly T[], operand: string, key: CandidateOf<T>): T;
|
|
58
|
-
|
|
59
|
-
* mutations (create/rename/add-project/remove-project/delete/last-used)
|
|
60
|
-
* below run inside this. */
|
|
61
|
-
export declare function withProfileManifestLock<T>(profileId: string, fn: () => T): T;
|
|
62
|
-
export declare function ensureRootProfile(): ProfileEntry;
|
|
58
|
+
export declare function ensureRootProfile(): Promise<ProfileEntry>;
|
|
63
59
|
/** The env name a metadata entry surfaces as (spawn-env source F). Also the
|
|
64
60
|
* uniqueness domain for keys: the fold is lossy (`a-b`, `a_b`, `A_B` →
|
|
65
61
|
* `CRTR_PROFILE_META_A_B`), so two stored keys may not share a fold. */
|
|
@@ -77,9 +73,9 @@ export declare function createProfile(name: string, projects?: ProfileProject[],
|
|
|
77
73
|
defaultKind?: string;
|
|
78
74
|
metadata?: Record<string, string>;
|
|
79
75
|
grantee?: string;
|
|
80
|
-
}): ProfileEntry
|
|
81
|
-
export declare function ensureAppProfile(grantee: string): ProfileEntry
|
|
82
|
-
export declare function updateProfileLastUsed(profileId: string): ProfileEntry
|
|
76
|
+
}): Promise<ProfileEntry>;
|
|
77
|
+
export declare function ensureAppProfile(grantee: string): Promise<ProfileEntry>;
|
|
78
|
+
export declare function updateProfileLastUsed(profileId: string): Promise<ProfileEntry>;
|
|
83
79
|
/** Paused check for an ALREADY-RESOLVED durable id (a canvas row's `profile_id`,
|
|
84
80
|
* `CRTR_PROFILE_ID`) — exact-id only, no name matching, so it costs one small
|
|
85
81
|
* read on the hot delivery paths that call it every poll. Fails OPEN: an id
|
|
@@ -92,14 +88,14 @@ export declare function pausedCanvasProfiles(): Set<string>;
|
|
|
92
88
|
* every gate that already holds a loaded manifest. */
|
|
93
89
|
export declare function assertProfileEntryActive(entry: ProfileEntry): void;
|
|
94
90
|
export declare function assertProfileActive(profileId: string | null | undefined): ProfileEntry | null;
|
|
95
|
-
export declare function pauseProfile(profileId: string): ProfileEntry
|
|
96
|
-
export declare function resumeProfile(profileId: string): ProfileEntry & {
|
|
91
|
+
export declare function pauseProfile(profileId: string): Promise<ProfileEntry>;
|
|
92
|
+
export declare function resumeProfile(profileId: string): Promise<ProfileEntry & {
|
|
97
93
|
pausedAt: string | null;
|
|
98
|
-
}
|
|
99
|
-
export declare function setProfileDefaultKind(profileId: string, defaultKind: string): ProfileEntry
|
|
94
|
+
}>;
|
|
95
|
+
export declare function setProfileDefaultKind(profileId: string, defaultKind: string): Promise<ProfileEntry>;
|
|
100
96
|
/** Merge `set` entries over the stored map and drop `unset` keys; the
|
|
101
97
|
* `metadata` field is omitted entirely when the result is empty. */
|
|
102
|
-
export declare function updateProfileMetadata(profileId: string, set: Record<string, string>, unset?: string[]): ProfileEntry
|
|
98
|
+
export declare function updateProfileMetadata(profileId: string, set: Record<string, string>, unset?: string[]): Promise<ProfileEntry>;
|
|
103
99
|
/** A profile's stored metadata for broker-env injection — sanitized entry by
|
|
104
100
|
* entry (a manifest is hand-editable, so a bad key/value is dropped rather
|
|
105
101
|
* than trusted) and never throwing: a stale/invalid/absent profile id is a
|
|
@@ -109,12 +105,12 @@ export declare function readProfileMetadata(profileId: string | null): Record<st
|
|
|
109
105
|
/** Change the manifest `name` only. Callers that own the canvas (the daemon's
|
|
110
106
|
* `PATCH /v1/profiles/:name`) must also rename the profile's canvas handle —
|
|
111
107
|
* use `renameProfileAndHandle` there; the CLI and panels go through that route. */
|
|
112
|
-
export declare function renameProfile(profileId: string, name: string): ProfileEntry
|
|
108
|
+
export declare function renameProfile(profileId: string, name: string): Promise<ProfileEntry>;
|
|
113
109
|
/** A new path appends; a path already listed keeps its position. */
|
|
114
|
-
export declare function addProfileProject(profileId: string, dir: string): ProfileEntry
|
|
110
|
+
export declare function addProfileProject(profileId: string, dir: string): Promise<ProfileEntry>;
|
|
115
111
|
/** Set one owner's automatic delivery limit. `content` is the uncapped level,
|
|
116
112
|
* so it removes the owner's entry instead of storing it. */
|
|
117
|
-
export declare function setProfileDeliveryLimit(profileId: string, owner: string, level: ProfileProjectMemory): ProfileEntry
|
|
118
|
-
export declare function removeProfileProject(profileId: string, dir: string): ProfileEntry
|
|
119
|
-
export declare function deleteProfile(profileId: string): void
|
|
113
|
+
export declare function setProfileDeliveryLimit(profileId: string, owner: string, level: ProfileProjectMemory): Promise<ProfileEntry>;
|
|
114
|
+
export declare function removeProfileProject(profileId: string, dir: string): Promise<ProfileEntry>;
|
|
115
|
+
export declare function deleteProfile(profileId: string): Promise<void>;
|
|
120
116
|
export {};
|