@north-light/cli 0.3.668 → 0.3.670
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 +8 -0
- 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/docs.d.ts +1 -1
- package/dist/api/dto/imports.d.ts +5 -1
- package/dist/api/dto/objects.d.ts +2 -2
- package/dist/api/dto/profiles.d.ts +6 -2
- package/dist/api/dto/profiles.js +1 -1
- package/dist/api/dto/repo-import.d.ts +25 -0
- package/dist/api/dto/repo-import.js +0 -0
- package/dist/api/routes.d.ts +2 -0
- package/dist/api/routes.js +1 -1
- package/dist/builtin-memory/crouter-concepts/documents.md +1 -1
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/claude-plugin-commands.ts +2 -1
- package/dist/clients/attach/session/profile-files.js +1 -1
- package/dist/clients/attach/viewer.js +479 -479
- package/dist/clients/dashboard/app.js +2 -2
- package/dist/commands/canvas/share.js +2 -2
- package/dist/commands/doc/shared.d.ts +1 -1
- package/dist/commands/doc/shared.js +1 -1
- package/dist/commands/node-lifecycle-revive.d.ts +10 -0
- package/dist/commands/node-lifecycle-revive.js +1 -1
- package/dist/commands/pkg/plugin-inspect.js +1 -1
- package/dist/commands/profile/list.js +1 -1
- package/dist/commands/profile/project.js +1 -1
- package/dist/commands/profile/show.js +1 -1
- package/dist/commands/sys/panels/profiles-panel.js +1 -1
- package/dist/commands/sys/repo-docs.d.ts +1 -0
- package/dist/commands/sys/repo-docs.js +2 -0
- package/dist/commands/sys/sync-project-guidance.js +5 -5
- package/dist/commands/sys.js +1 -1
- package/dist/core/broker-client/transport-relay.d.ts +3 -0
- package/dist/core/broker-client/transport-relay.js +1 -1
- package/dist/core/canvas/db.js +4 -4
- package/dist/core/canvas/export-sqlite.js +1 -1
- package/dist/core/canvas/schema-pg/021-repo-docs.sql +38 -0
- package/dist/core/canvas/schema-version.d.ts +1 -1
- package/dist/core/canvas/schema-version.js +1 -1
- package/dist/core/checkout-identities.d.ts +15 -0
- package/dist/core/checkout-identities.js +3 -0
- package/dist/core/graph/bodies-boot-copy.d.ts +1 -1
- package/dist/core/graph/bodies-boot-copy.js +1 -1
- package/dist/core/graph/custom.js +9 -9
- package/dist/core/graph/documents.d.ts +1 -1
- package/dist/core/graph/documents.js +11 -11
- package/dist/core/graph/events.js +1 -1
- package/dist/core/graph/group-invites.d.ts +10 -0
- package/dist/core/graph/group-invites.js +1 -0
- package/dist/core/graph/groups.d.ts +27 -0
- package/dist/core/graph/groups.js +3 -0
- package/dist/core/graph/kinds/owner.js +2 -2
- package/dist/core/graph/names.d.ts +2 -2
- package/dist/core/graph/names.js +10 -10
- package/dist/core/graph/objects.d.ts +4 -1
- package/dist/core/graph/objects.js +10 -10
- package/dist/core/graph/package-publish.js +3 -3
- package/dist/core/graph/package-reconcile.js +2 -2
- package/dist/core/graph/reader.d.ts +19 -8
- package/dist/core/graph/reader.js +3 -3
- package/dist/core/graph/repo-sync/exchange.d.ts +0 -11
- package/dist/core/graph/repo-sync/exchange.js +1 -2
- package/dist/core/graph/repo-sync/identity.d.ts +4 -0
- package/dist/core/graph/repo-sync/ref-format.d.ts +0 -29
- package/dist/core/graph/repo-sync/ref-format.js +1 -2
- package/dist/core/graph/repo-sync/repos.d.ts +12 -2
- package/dist/core/graph/repo-sync/repos.js +4 -3
- package/dist/core/graph/types.d.ts +2 -2
- package/dist/core/human/page-schema.d.ts +1 -1
- package/dist/core/import/export/stores.js +4 -1
- package/dist/core/import/load/stores.js +2 -2
- package/dist/core/peer/stubs.d.ts +1 -1
- package/dist/core/peer/stubs.js +1 -1
- package/dist/core/permissions/builtin.d.ts +1 -1
- package/dist/core/permissions/builtin.js +4 -2
- package/dist/core/permissions/ceiling.js +9 -9
- package/dist/core/profiles/manifest.d.ts +7 -2
- package/dist/core/profiles/manifest.js +1 -1
- package/dist/core/profiles/select.js +21 -21
- package/dist/core/runtime/bearings-render.js +8 -8
- package/dist/core/runtime/broker/bash-job-launch.d.ts +4 -0
- package/dist/core/runtime/broker/bash-job-launch.js +1 -1
- package/dist/core/runtime/deliver-live.js +1 -1
- package/dist/core/runtime/resume-root.d.ts +1 -0
- package/dist/core/runtime/resume-root.js +7 -7
- package/dist/core/runtime/runner/blaxel/runner.js +2 -2
- package/dist/core/runtime/runner/machine/call.js +2 -2
- package/dist/core/runtime/runner/machine/executor.d.ts +1 -1
- package/dist/core/runtime/runner/machine/ops.d.ts +11 -1
- package/dist/core/runtime/runner/machine/ops.js +1 -1
- package/dist/core/runtime/runner/types.d.ts +2 -1
- package/dist/core/scope.js +1 -1
- package/dist/core/scoped-state/db.js +2 -2
- package/dist/core/scoped-state/legacy-profiles.js +2 -1
- package/dist/core/scoped-state/person-rows.js +6 -3
- package/dist/core/scoped-state/schema.d.ts +4 -0
- package/dist/core/scoped-state/schema.js +5 -4
- package/dist/core/substrate/delivery/deliver.js +2 -2
- package/dist/core/substrate/delivery/plan.js +2 -3
- package/dist/core/substrate/subject.js +1 -1
- package/dist/daemon/api/canvas-host.d.ts +1 -0
- package/dist/daemon/api/canvas-host.js +1 -1
- package/dist/daemon/api/document-page.js +5 -5
- package/dist/daemon/api/handlers/broker-ops.js +1 -1
- package/dist/daemon/api/handlers/delivery.js +1 -1
- package/dist/daemon/api/handlers/docs.d.ts +1 -12
- package/dist/daemon/api/handlers/docs.js +2 -2
- package/dist/daemon/api/handlers/memory.js +1 -1
- package/dist/daemon/api/handlers/messages.js +2 -2
- package/dist/daemon/api/handlers/objects.js +1 -1
- package/dist/daemon/api/handlers/profiles.d.ts +1 -1
- package/dist/daemon/api/handlers/profiles.js +1 -1
- package/dist/daemon/api/handlers/repo-import.d.ts +2 -0
- package/dist/daemon/api/handlers/repo-import.js +2 -0
- package/dist/daemon/api/handlers/reviews.js +1 -1
- package/dist/daemon/api/handlers/shares.js +1 -1
- package/dist/daemon/api/operations.js +1 -1
- package/dist/daemon/api/reader.js +1 -1
- package/dist/daemon/api/repo-plugin.d.ts +12 -0
- package/dist/daemon/api/repo-plugin.js +1 -0
- package/dist/daemon/api/server.js +1 -1
- package/dist/daemon/boot-migrations.js +1 -1
- package/dist/daemon/crtrd.js +13 -13
- package/dist/daemon/due-sources.d.ts +1 -1
- package/dist/daemon/due-sources.js +1 -1
- package/dist/daemon/due.js +7 -7
- package/dist/daemon/machine-daemon.js +1 -1
- package/dist/daemon/reconcilers/group-invite-expiry.d.ts +9 -0
- package/dist/daemon/reconcilers/group-invite-expiry.js +1 -0
- package/dist/daemon/reconcilers/node-lifecycle/remote-wake.js +2 -1
- package/dist/daemon/review/finish.js +1 -1
- package/dist/migrations/004-canvas-documents/index.js +2 -2
- package/dist/pi-extensions/canvas-structured-output.js +6 -6
- package/dist/pi-extensions/canvas-tool-guide.d.ts +3 -1
- package/dist/pi-extensions/canvas-tool-guide.js +4 -4
- package/docs/concepts/documents.md +1 -1
- package/package.json +10 -2
- package/packages/crouter-api/dist/api/client.js +1585 -0
- package/packages/crouter-api/dist/api/command-manifest/index.js +4 -0
- package/packages/crouter-api/dist/api/command-manifest/manifest.js +332 -0
- package/packages/crouter-api/dist/api/command-manifest/object-kinds.js +100 -0
- package/packages/crouter-api/dist/api/command-manifest/result.js +166 -0
- package/packages/crouter-api/dist/api/command-manifest/schema.js +934 -0
- package/packages/crouter-api/dist/api/contract.js +57 -0
- package/packages/crouter-api/dist/api/dto/analytics.js +3 -0
- package/packages/crouter-api/dist/api/dto/attach.js +13 -0
- package/packages/crouter-api/dist/api/dto/bash-jobs.js +11 -0
- package/packages/crouter-api/dist/api/dto/bash.js +1 -0
- package/packages/crouter-api/dist/api/dto/broker-ops.js +6 -0
- package/packages/crouter-api/dist/api/dto/broker-signals.js +1 -0
- package/packages/crouter-api/dist/api/dto/broker.js +20 -0
- package/packages/crouter-api/dist/api/dto/canvas.js +2 -0
- package/packages/crouter-api/dist/api/dto/charges.js +4 -0
- package/packages/crouter-api/dist/api/dto/chat-inventory.js +11 -0
- package/packages/crouter-api/dist/api/dto/common.js +15 -0
- package/packages/crouter-api/dist/api/dto/config.js +3 -0
- package/packages/crouter-api/dist/api/dto/crons.js +10 -0
- package/packages/crouter-api/dist/api/dto/custom-objects.js +1 -0
- package/packages/crouter-api/dist/api/dto/delivery.js +7 -0
- package/packages/crouter-api/dist/api/dto/docs.js +8 -0
- package/packages/crouter-api/dist/api/dto/environments.js +2 -0
- package/packages/crouter-api/dist/api/dto/exec.js +1 -0
- package/packages/crouter-api/dist/api/dto/execution-start.js +2 -0
- package/packages/crouter-api/dist/api/dto/files.js +1 -0
- package/packages/crouter-api/dist/api/dto/focus.js +10 -0
- package/packages/crouter-api/dist/api/dto/grants.js +1 -0
- package/packages/crouter-api/dist/api/dto/health.js +2 -0
- package/packages/crouter-api/dist/api/dto/human-requests.js +4 -0
- package/packages/crouter-api/dist/api/dto/human.js +4 -0
- package/packages/crouter-api/dist/api/dto/imports.js +2 -0
- package/packages/crouter-api/dist/api/dto/inbox.js +4 -0
- package/packages/crouter-api/dist/api/dto/lifecycle.js +3 -0
- package/packages/crouter-api/dist/api/dto/limits.js +2 -0
- package/packages/crouter-api/dist/api/dto/mail.js +1 -0
- package/packages/crouter-api/dist/api/dto/messages.js +2 -0
- package/packages/crouter-api/dist/api/dto/model-config.js +1 -0
- package/packages/crouter-api/dist/api/dto/modelauth.js +4 -0
- package/packages/crouter-api/dist/api/dto/node-events.js +4 -0
- package/packages/crouter-api/dist/api/dto/node-outcomes.js +2 -0
- package/packages/crouter-api/dist/api/dto/node-records.js +5 -0
- package/packages/crouter-api/dist/api/dto/nodes.js +3 -0
- package/packages/crouter-api/dist/api/dto/objects.js +5 -0
- package/packages/crouter-api/dist/api/dto/permissions.js +5 -0
- package/packages/crouter-api/dist/api/dto/plugins.js +5 -0
- package/packages/crouter-api/dist/api/dto/profiles.js +8 -0
- package/packages/crouter-api/dist/api/dto/recovery.js +1 -0
- package/packages/crouter-api/dist/api/dto/repo-import.js +5 -0
- package/packages/crouter-api/dist/api/dto/reports.js +2 -0
- package/packages/crouter-api/dist/api/dto/review-comments.js +5 -0
- package/packages/crouter-api/dist/api/dto/reviews.js +5 -0
- package/packages/crouter-api/dist/api/dto/run-events.js +6 -0
- package/packages/crouter-api/dist/api/dto/settings.js +4 -0
- package/packages/crouter-api/dist/api/dto/structured-requests.js +5 -0
- package/packages/crouter-api/dist/api/dto/subscriptions.js +2 -0
- package/packages/crouter-api/dist/api/dto/usage.js +1 -0
- package/packages/crouter-api/dist/api/dto/worktree.js +6 -0
- package/packages/crouter-api/dist/api/error-codes.js +86 -0
- package/packages/crouter-api/dist/api/errors.js +72 -0
- package/packages/crouter-api/dist/api/index.js +55 -0
- package/packages/crouter-api/dist/api/long-poll.js +67 -0
- package/packages/crouter-api/dist/api/node-transport.js +105 -0
- package/packages/crouter-api/dist/api/plugin-manifest-schema.js +23 -0
- package/packages/crouter-api/dist/api/routes.js +233 -0
- package/packages/crouter-api/dist/api/runtime-version.js +50 -0
- package/packages/crouter-api/dist/build-root.js +411 -0
- package/packages/crouter-api/dist/clients/attach/ansi-cells.js +137 -0
- package/packages/crouter-api/dist/clients/attach/chrome/bash-jobs.js +34 -0
- package/packages/crouter-api/dist/clients/attach/chrome/canvas-panels.js +267 -0
- package/packages/crouter-api/dist/clients/attach/chrome/completion-bell.js +89 -0
- package/packages/crouter-api/dist/clients/attach/chrome/cron-wait.js +34 -0
- package/packages/crouter-api/dist/clients/attach/chrome/git-info.js +44 -0
- package/packages/crouter-api/dist/clients/attach/chrome/header.js +30 -0
- package/packages/crouter-api/dist/clients/attach/chrome/inbox-strip.js +219 -0
- package/packages/crouter-api/dist/clients/attach/chrome/key-hint.js +16 -0
- package/packages/crouter-api/dist/clients/attach/chrome/object-wait.js +24 -0
- package/packages/crouter-api/dist/clients/attach/chrome/recap.js +19 -0
- package/packages/crouter-api/dist/clients/attach/chrome/review-wait.js +22 -0
- package/packages/crouter-api/dist/clients/attach/chrome/roster.js +293 -0
- package/packages/crouter-api/dist/clients/attach/chrome/status-line.js +127 -0
- package/packages/crouter-api/dist/clients/attach/chrome/ticket-panel.js +261 -0
- package/packages/crouter-api/dist/clients/attach/chrome/widgets.js +51 -0
- package/packages/crouter-api/dist/clients/attach/command.js +107 -0
- package/packages/crouter-api/dist/clients/attach/config.js +275 -0
- package/packages/crouter-api/dist/clients/attach/input/capabilities.js +112 -0
- package/packages/crouter-api/dist/clients/attach/input/clipboard-image.js +237 -0
- package/packages/crouter-api/dist/clients/attach/input/completion-frecency.js +141 -0
- package/packages/crouter-api/dist/clients/attach/input/controller.js +383 -0
- package/packages/crouter-api/dist/clients/attach/input/overlay-owner.js +199 -0
- package/packages/crouter-api/dist/clients/attach/input/ref-autocomplete.js +176 -0
- package/packages/crouter-api/dist/clients/attach/input/titled-editor.js +859 -0
- package/packages/crouter-api/dist/clients/attach/overlays/auth.js +247 -0
- package/packages/crouter-api/dist/clients/attach/overlays/dialogs.js +102 -0
- package/packages/crouter-api/dist/clients/attach/overlays/file-review.js +146 -0
- package/packages/crouter-api/dist/clients/attach/overlays/graph.js +725 -0
- package/packages/crouter-api/dist/clients/attach/overlays/help.js +214 -0
- package/packages/crouter-api/dist/clients/attach/overlays/mcp.js +302 -0
- package/packages/crouter-api/dist/clients/attach/overlays/pickers.js +163 -0
- package/packages/crouter-api/dist/clients/attach/render/activity-slot.js +13 -0
- package/packages/crouter-api/dist/clients/attach/render/assistant-message.js +56 -0
- package/packages/crouter-api/dist/clients/attach/render/card-presentation.js +232 -0
- package/packages/crouter-api/dist/clients/attach/render/chat-view.js +2091 -0
- package/packages/crouter-api/dist/clients/attach/render/condensed-history.js +60 -0
- package/packages/crouter-api/dist/clients/attach/render/context-message.js +63 -0
- package/packages/crouter-api/dist/clients/attach/render/crtr-output.js +721 -0
- package/packages/crouter-api/dist/clients/attach/render/diagram.js +111 -0
- package/packages/crouter-api/dist/clients/attach/render/doc-links.js +78 -0
- package/packages/crouter-api/dist/clients/attach/render/edit-diff.js +304 -0
- package/packages/crouter-api/dist/clients/attach/render/glyph-codepoints.js +42 -0
- package/packages/crouter-api/dist/clients/attach/render/group-activity.js +276 -0
- package/packages/crouter-api/dist/clients/attach/render/group-recap.js +146 -0
- package/packages/crouter-api/dist/clients/attach/render/markdown-source.js +279 -0
- package/packages/crouter-api/dist/clients/attach/render/measured-container.js +322 -0
- package/packages/crouter-api/dist/clients/attach/render/page-block.js +187 -0
- package/packages/crouter-api/dist/clients/attach/render/scroll-animation.js +80 -0
- package/packages/crouter-api/dist/clients/attach/render/tool-calls.js +350 -0
- package/packages/crouter-api/dist/clients/attach/render/transcript-copy.js +81 -0
- package/packages/crouter-api/dist/clients/attach/render/transcript-search.js +152 -0
- package/packages/crouter-api/dist/clients/attach/render/viewport.js +184 -0
- package/packages/crouter-api/dist/clients/attach/session/banner.js +33 -0
- package/packages/crouter-api/dist/clients/attach/session/bindings.js +72 -0
- package/packages/crouter-api/dist/clients/attach/session/chrome-refresh.js +154 -0
- package/packages/crouter-api/dist/clients/attach/session/connection.js +204 -0
- package/packages/crouter-api/dist/clients/attach/session/context.js +16 -0
- package/packages/crouter-api/dist/clients/attach/session/document-links.js +48 -0
- package/packages/crouter-api/dist/clients/attach/session/editor-frame.js +142 -0
- package/packages/crouter-api/dist/clients/attach/session/editor-inventory.js +156 -0
- package/packages/crouter-api/dist/clients/attach/session/file-links.js +73 -0
- package/packages/crouter-api/dist/clients/attach/session/focus-events.js +12 -0
- package/packages/crouter-api/dist/clients/attach/session/frame.js +214 -0
- package/packages/crouter-api/dist/clients/attach/session/frames.js +203 -0
- package/packages/crouter-api/dist/clients/attach/session/identity.js +26 -0
- package/packages/crouter-api/dist/clients/attach/session/input-wiring.js +150 -0
- package/packages/crouter-api/dist/clients/attach/session/invariant.js +15 -0
- package/packages/crouter-api/dist/clients/attach/session/keys.js +77 -0
- package/packages/crouter-api/dist/clients/attach/session/layout.js +59 -0
- package/packages/crouter-api/dist/clients/attach/session/mouse.js +78 -0
- package/packages/crouter-api/dist/clients/attach/session/pane-focus.js +42 -0
- package/packages/crouter-api/dist/clients/attach/session/pane-tag.js +112 -0
- package/packages/crouter-api/dist/clients/attach/session/pi-assets.js +24 -0
- package/packages/crouter-api/dist/clients/attach/session/pi-oauth-flows.js +21 -0
- package/packages/crouter-api/dist/clients/attach/session/profile-files.js +208 -0
- package/packages/crouter-api/dist/clients/attach/session/readonly-popup.js +25 -0
- package/packages/crouter-api/dist/clients/attach/session/reconnect.js +195 -0
- package/packages/crouter-api/dist/clients/attach/session/selection.js +108 -0
- package/packages/crouter-api/dist/clients/attach/session/state-sync.js +67 -0
- package/packages/crouter-api/dist/clients/attach/session/surface-frame.js +73 -0
- package/packages/crouter-api/dist/clients/attach/session/surface-host.js +256 -0
- package/packages/crouter-api/dist/clients/attach/session/teardown.js +94 -0
- package/packages/crouter-api/dist/clients/attach/session/transcript-search.js +151 -0
- package/packages/crouter-api/dist/clients/attach/session/whip-achievements.js +145 -0
- package/packages/crouter-api/dist/clients/attach/session/whip.js +362 -0
- package/packages/crouter-api/dist/clients/attach/slash/dispatch.js +747 -0
- package/packages/crouter-api/dist/clients/attach/slash/prompt-preview.js +121 -0
- package/packages/crouter-api/dist/clients/attach/viewer.js +881 -0
- package/packages/crouter-api/dist/clients/conversation/projection.js +324 -0
- package/packages/crouter-api/dist/clients/conversation/submit.js +51 -0
- package/packages/crouter-api/dist/clients/dashboard/app.js +439 -0
- package/packages/crouter-api/dist/clients/dashboard/model.js +77 -0
- package/packages/crouter-api/dist/clients/dashboard/render.js +148 -0
- package/packages/crouter-api/dist/clients/inbox/controller.js +791 -0
- package/packages/crouter-api/dist/clients/inbox/dto-adapt.js +93 -0
- package/packages/crouter-api/dist/clients/inbox/layout.js +9 -0
- package/packages/crouter-api/dist/clients/inbox/page-adapter.js +56 -0
- package/packages/crouter-api/dist/clients/inbox/resolve.js +35 -0
- package/packages/crouter-api/dist/clients/inbox/review/anchors.js +89 -0
- package/packages/crouter-api/dist/clients/inbox/review/comments-client.js +103 -0
- package/packages/crouter-api/dist/clients/inbox/review/companion-pane.js +109 -0
- package/packages/crouter-api/dist/clients/inbox/review/document-surface.js +1268 -0
- package/packages/crouter-api/dist/clients/inbox/review/frame.js +309 -0
- package/packages/crouter-api/dist/clients/inbox/review/keys.js +133 -0
- package/packages/crouter-api/dist/clients/inbox/review/launch.js +170 -0
- package/packages/crouter-api/dist/clients/inbox/review/live-source.js +160 -0
- package/packages/crouter-api/dist/clients/inbox/review/nvim.js +43 -0
- package/packages/crouter-api/dist/clients/inbox/review/remap.js +157 -0
- package/packages/crouter-api/dist/clients/inbox/review/review-client.js +123 -0
- package/packages/crouter-api/dist/clients/inbox/review/roundtrip.js +41 -0
- package/packages/crouter-api/dist/clients/inbox/review/state.js +315 -0
- package/packages/crouter-api/dist/clients/inbox/review-adapter.js +43 -0
- package/packages/crouter-api/dist/clients/inbox/surface.js +190 -0
- package/packages/crouter-api/dist/clients/inbox/tui/ansi.js +321 -0
- package/packages/crouter-api/dist/clients/inbox/tui/input.js +392 -0
- package/packages/crouter-api/dist/clients/inbox/tui/keys.js +104 -0
- package/packages/crouter-api/dist/clients/inbox/tui/page-body.js +69 -0
- package/packages/crouter-api/dist/clients/inbox/tui/panel.js +92 -0
- package/packages/crouter-api/dist/clients/inbox/tui/render.js +389 -0
- package/packages/crouter-api/dist/clients/inbox/tui/slots.js +134 -0
- package/packages/crouter-api/dist/clients/inbox/tui/types.js +1 -0
- package/packages/crouter-api/dist/clients/inbox/tui.js +91 -0
- package/packages/crouter-api/dist/clients/surfaces/host.js +1 -0
- package/packages/crouter-api/dist/commands/api-client.js +438 -0
- package/packages/crouter-api/dist/commands/attention.js +215 -0
- package/packages/crouter-api/dist/commands/canvas/edges.js +41 -0
- package/packages/crouter-api/dist/commands/canvas/list.js +79 -0
- package/packages/crouter-api/dist/commands/canvas/read.js +95 -0
- package/packages/crouter-api/dist/commands/canvas/search.js +49 -0
- package/packages/crouter-api/dist/commands/canvas/share.js +80 -0
- package/packages/crouter-api/dist/commands/canvas/unwatch.js +42 -0
- package/packages/crouter-api/dist/commands/canvas/watch.js +63 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/chart.js +124 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/drilldown.js +96 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/format.js +106 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/graph-detail.js +307 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/graphs.js +365 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/memory.js +211 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/overview.js +189 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/shell.js +416 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/time.js +228 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/usage.js +305 -0
- package/packages/crouter-api/dist/commands/canvas-analytics/view.js +102 -0
- package/packages/crouter-api/dist/commands/canvas-analytics.js +28 -0
- package/packages/crouter-api/dist/commands/canvas-browse.js +71 -0
- package/packages/crouter-api/dist/commands/canvas-config.js +192 -0
- package/packages/crouter-api/dist/commands/canvas-history/grep.js +85 -0
- package/packages/crouter-api/dist/commands/canvas-history/read.js +48 -0
- package/packages/crouter-api/dist/commands/canvas-history/search.js +99 -0
- package/packages/crouter-api/dist/commands/canvas-history/shared.js +135 -0
- package/packages/crouter-api/dist/commands/canvas-history/stats.js +68 -0
- package/packages/crouter-api/dist/commands/canvas-history.js +29 -0
- package/packages/crouter-api/dist/commands/canvas-issue.js +148 -0
- package/packages/crouter-api/dist/commands/canvas-prune.js +111 -0
- package/packages/crouter-api/dist/commands/canvas-roster.js +69 -0
- package/packages/crouter-api/dist/commands/canvas-snapshot.js +34 -0
- package/packages/crouter-api/dist/commands/canvas-use.js +61 -0
- package/packages/crouter-api/dist/commands/canvas.js +57 -0
- package/packages/crouter-api/dist/commands/chord.js +242 -0
- package/packages/crouter-api/dist/commands/cron.js +541 -0
- package/packages/crouter-api/dist/commands/custom-object/ack.js +30 -0
- package/packages/crouter-api/dist/commands/custom-object/publish.js +39 -0
- package/packages/crouter-api/dist/commands/custom-object/receive.js +69 -0
- package/packages/crouter-api/dist/commands/custom-object/register.js +69 -0
- package/packages/crouter-api/dist/commands/custom-object/shared.js +14 -0
- package/packages/crouter-api/dist/commands/custom-object/unregister.js +26 -0
- package/packages/crouter-api/dist/commands/custom-object.js +21 -0
- package/packages/crouter-api/dist/commands/dashboard.js +86 -0
- package/packages/crouter-api/dist/commands/doc/delete.js +30 -0
- package/packages/crouter-api/dist/commands/doc/edit.js +83 -0
- package/packages/crouter-api/dist/commands/doc/history.js +38 -0
- package/packages/crouter-api/dist/commands/doc/lint.js +36 -0
- package/packages/crouter-api/dist/commands/doc/list.js +19 -0
- package/packages/crouter-api/dist/commands/doc/move.js +37 -0
- package/packages/crouter-api/dist/commands/doc/read.js +19 -0
- package/packages/crouter-api/dist/commands/doc/replace-blocks.js +40 -0
- package/packages/crouter-api/dist/commands/doc/shared.js +156 -0
- package/packages/crouter-api/dist/commands/doc/write.js +53 -0
- package/packages/crouter-api/dist/commands/doc.js +27 -0
- package/packages/crouter-api/dist/commands/human/components.js +78 -0
- package/packages/crouter-api/dist/commands/human/feedback.js +112 -0
- package/packages/crouter-api/dist/commands/human/prompts.js +326 -0
- package/packages/crouter-api/dist/commands/human/queue.js +191 -0
- package/packages/crouter-api/dist/commands/human/request.js +266 -0
- package/packages/crouter-api/dist/commands/human/review.js +288 -0
- package/packages/crouter-api/dist/commands/human/shared.js +67 -0
- package/packages/crouter-api/dist/commands/human.js +63 -0
- package/packages/crouter-api/dist/commands/node/bash.js +395 -0
- package/packages/crouter-api/dist/commands/node/create.js +363 -0
- package/packages/crouter-api/dist/commands/node/inspect.js +288 -0
- package/packages/crouter-api/dist/commands/node/lifecycle.js +577 -0
- package/packages/crouter-api/dist/commands/node/message.js +170 -0
- package/packages/crouter-api/dist/commands/node/outcome.js +133 -0
- package/packages/crouter-api/dist/commands/node/pyramid.js +79 -0
- package/packages/crouter-api/dist/commands/node/subscription.js +78 -0
- package/packages/crouter-api/dist/commands/node/wait.js +165 -0
- package/packages/crouter-api/dist/commands/node-context.js +145 -0
- package/packages/crouter-api/dist/commands/node-lifecycle-revive.js +224 -0
- package/packages/crouter-api/dist/commands/node-snapshot.js +37 -0
- package/packages/crouter-api/dist/commands/node-transcript.js +59 -0
- package/packages/crouter-api/dist/commands/node-worktree.js +138 -0
- package/packages/crouter-api/dist/commands/node.js +29 -0
- package/packages/crouter-api/dist/commands/person-settings.js +23 -0
- package/packages/crouter-api/dist/commands/pkg/app-installs.js +125 -0
- package/packages/crouter-api/dist/commands/pkg/browse/actions.js +198 -0
- package/packages/crouter-api/dist/commands/pkg/browse/catalog.js +461 -0
- package/packages/crouter-api/dist/commands/pkg/browse/command-view.js +217 -0
- package/packages/crouter-api/dist/commands/pkg/browse/detail-panel.js +402 -0
- package/packages/crouter-api/dist/commands/pkg/browse/doc-view.js +84 -0
- package/packages/crouter-api/dist/commands/pkg/browse/list-panel.js +168 -0
- package/packages/crouter-api/dist/commands/pkg/browse/model.js +36 -0
- package/packages/crouter-api/dist/commands/pkg/browse/shell.js +640 -0
- package/packages/crouter-api/dist/commands/pkg/browse.js +27 -0
- package/packages/crouter-api/dist/commands/pkg/market-inspect.js +145 -0
- package/packages/crouter-api/dist/commands/pkg/market-manage.js +340 -0
- package/packages/crouter-api/dist/commands/pkg/market.js +14 -0
- package/packages/crouter-api/dist/commands/pkg/plugin-env.js +65 -0
- package/packages/crouter-api/dist/commands/pkg/plugin-inspect.js +178 -0
- package/packages/crouter-api/dist/commands/pkg/plugin-manage.js +1039 -0
- package/packages/crouter-api/dist/commands/pkg/plugin.js +14 -0
- package/packages/crouter-api/dist/commands/pkg/shared.js +62 -0
- package/packages/crouter-api/dist/commands/pkg.js +21 -0
- package/packages/crouter-api/dist/commands/profile/daemon-profiles.js +38 -0
- package/packages/crouter-api/dist/commands/profile/default.js +183 -0
- package/packages/crouter-api/dist/commands/profile/delete.js +66 -0
- package/packages/crouter-api/dist/commands/profile/env.js +188 -0
- package/packages/crouter-api/dist/commands/profile/environment.js +88 -0
- package/packages/crouter-api/dist/commands/profile/kind.js +27 -0
- package/packages/crouter-api/dist/commands/profile/list.js +45 -0
- package/packages/crouter-api/dist/commands/profile/meta.js +65 -0
- package/packages/crouter-api/dist/commands/profile/new.js +107 -0
- package/packages/crouter-api/dist/commands/profile/pause.js +59 -0
- package/packages/crouter-api/dist/commands/profile/project.js +146 -0
- package/packages/crouter-api/dist/commands/profile/rename.js +41 -0
- package/packages/crouter-api/dist/commands/profile/show.js +55 -0
- package/packages/crouter-api/dist/commands/profile.js +36 -0
- package/packages/crouter-api/dist/commands/push.js +357 -0
- package/packages/crouter-api/dist/commands/revive.js +183 -0
- package/packages/crouter-api/dist/commands/surface/node/cycle.js +83 -0
- package/packages/crouter-api/dist/commands/surface/node/focus.js +60 -0
- package/packages/crouter-api/dist/commands/surface/node/id.js +38 -0
- package/packages/crouter-api/dist/commands/surface/node/pin.js +42 -0
- package/packages/crouter-api/dist/commands/surface/node/placement.js +49 -0
- package/packages/crouter-api/dist/commands/surface-dashboard.js +138 -0
- package/packages/crouter-api/dist/commands/surface-edit.js +157 -0
- package/packages/crouter-api/dist/commands/surface-inbox.js +98 -0
- package/packages/crouter-api/dist/commands/surface-inspect.js +41 -0
- package/packages/crouter-api/dist/commands/surface-node.js +19 -0
- package/packages/crouter-api/dist/commands/surface-reload.js +129 -0
- package/packages/crouter-api/dist/commands/surface-tmux-spread.js +214 -0
- package/packages/crouter-api/dist/commands/surface.js +29 -0
- package/packages/crouter-api/dist/commands/sys/branch.js +19 -0
- package/packages/crouter-api/dist/commands/sys/config.js +353 -0
- package/packages/crouter-api/dist/commands/sys/connect.js +185 -0
- package/packages/crouter-api/dist/commands/sys/context/admin/actions.js +89 -0
- package/packages/crouter-api/dist/commands/sys/context/admin/detail-panel.js +233 -0
- package/packages/crouter-api/dist/commands/sys/context/admin/docs-panel.js +185 -0
- package/packages/crouter-api/dist/commands/sys/context/admin/list-view.js +170 -0
- package/packages/crouter-api/dist/commands/sys/context/admin/model.js +179 -0
- package/packages/crouter-api/dist/commands/sys/context/admin/rail-panel.js +229 -0
- package/packages/crouter-api/dist/commands/sys/context/admin/read-view.js +172 -0
- package/packages/crouter-api/dist/commands/sys/context/admin/shell.js +870 -0
- package/packages/crouter-api/dist/commands/sys/context/admin.js +148 -0
- package/packages/crouter-api/dist/commands/sys/context/doc.js +126 -0
- package/packages/crouter-api/dist/commands/sys/context/expose.js +66 -0
- package/packages/crouter-api/dist/commands/sys/context/prompt-review.js +244 -0
- package/packages/crouter-api/dist/commands/sys/context/resolve.js +326 -0
- package/packages/crouter-api/dist/commands/sys/context/sysprompt.js +95 -0
- package/packages/crouter-api/dist/commands/sys/context.js +21 -0
- package/packages/crouter-api/dist/commands/sys/daemon.js +351 -0
- package/packages/crouter-api/dist/commands/sys/db.js +69 -0
- package/packages/crouter-api/dist/commands/sys/desktop.js +201 -0
- package/packages/crouter-api/dist/commands/sys/doctor.js +633 -0
- package/packages/crouter-api/dist/commands/sys/env.js +39 -0
- package/packages/crouter-api/dist/commands/sys/feedback.js +228 -0
- package/packages/crouter-api/dist/commands/sys/import/move.js +393 -0
- package/packages/crouter-api/dist/commands/sys/import/resume.js +23 -0
- package/packages/crouter-api/dist/commands/sys/import/start.js +92 -0
- package/packages/crouter-api/dist/commands/sys/join.js +85 -0
- package/packages/crouter-api/dist/commands/sys/limits.js +133 -0
- package/packages/crouter-api/dist/commands/sys/logs.js +129 -0
- package/packages/crouter-api/dist/commands/sys/machine/rotate.js +49 -0
- package/packages/crouter-api/dist/commands/sys/migrate.js +79 -0
- package/packages/crouter-api/dist/commands/sys/panels/broker-limits-panel.js +110 -0
- package/packages/crouter-api/dist/commands/sys/panels/dependencies-panel.js +80 -0
- package/packages/crouter-api/dist/commands/sys/panels/keybindings-panel.js +703 -0
- package/packages/crouter-api/dist/commands/sys/panels/models-panel.js +1160 -0
- package/packages/crouter-api/dist/commands/sys/panels/plugin-env-panel.js +70 -0
- package/packages/crouter-api/dist/commands/sys/panels/plugins-panel.js +87 -0
- package/packages/crouter-api/dist/commands/sys/panels/prefs-panel.js +97 -0
- package/packages/crouter-api/dist/commands/sys/panels/profiles-panel.js +656 -0
- package/packages/crouter-api/dist/commands/sys/panels/provider-panel.js +534 -0
- package/packages/crouter-api/dist/commands/sys/panels/terminal-panel.js +67 -0
- package/packages/crouter-api/dist/commands/sys/provider-login.js +99 -0
- package/packages/crouter-api/dist/commands/sys/repo-docs.js +96 -0
- package/packages/crouter-api/dist/commands/sys/retry-delivery.js +33 -0
- package/packages/crouter-api/dist/commands/sys/settings-shell.js +400 -0
- package/packages/crouter-api/dist/commands/sys/settings.js +46 -0
- package/packages/crouter-api/dist/commands/sys/setup-core.js +890 -0
- package/packages/crouter-api/dist/commands/sys/setup-settings-runner.js +15 -0
- package/packages/crouter-api/dist/commands/sys/setup-wizard.js +351 -0
- package/packages/crouter-api/dist/commands/sys/setup.js +41 -0
- package/packages/crouter-api/dist/commands/sys/shared.js +81 -0
- package/packages/crouter-api/dist/commands/sys/signin.js +149 -0
- package/packages/crouter-api/dist/commands/sys/spaces.js +22 -0
- package/packages/crouter-api/dist/commands/sys/spend.js +144 -0
- package/packages/crouter-api/dist/commands/sys/support/prepare.js +239 -0
- package/packages/crouter-api/dist/commands/sys/support/submit.js +524 -0
- package/packages/crouter-api/dist/commands/sys/support.js +18 -0
- package/packages/crouter-api/dist/commands/sys/sync-deps.js +445 -0
- package/packages/crouter-api/dist/commands/sys/sync-project-guidance.js +320 -0
- package/packages/crouter-api/dist/commands/sys/sync-shared.js +139 -0
- package/packages/crouter-api/dist/commands/sys/sync-skills.js +297 -0
- package/packages/crouter-api/dist/commands/sys/sync.js +17 -0
- package/packages/crouter-api/dist/commands/sys/terminal-option.js +542 -0
- package/packages/crouter-api/dist/commands/sys/tutorial/branch.js +15 -0
- package/packages/crouter-api/dist/commands/sys/tutorial/lessons.js +107 -0
- package/packages/crouter-api/dist/commands/sys/tutorial/scenario.js +431 -0
- package/packages/crouter-api/dist/commands/sys/tutorial/tracks.js +96 -0
- package/packages/crouter-api/dist/commands/sys/update.js +157 -0
- package/packages/crouter-api/dist/commands/sys/worktrees.js +53 -0
- package/packages/crouter-api/dist/commands/sys.js +32 -0
- package/packages/crouter-api/dist/core/activity-signal.js +38 -0
- package/packages/crouter-api/dist/core/asset-root.js +18 -0
- package/packages/crouter-api/dist/core/async-array.js +48 -0
- package/packages/crouter-api/dist/core/auth-file.js +89 -0
- package/packages/crouter-api/dist/core/auth-interaction.js +94 -0
- package/packages/crouter-api/dist/core/bash-guard.js +527 -0
- package/packages/crouter-api/dist/core/bash-job-supervisor.js +157 -0
- package/packages/crouter-api/dist/core/bash-jobs.js +460 -0
- package/packages/crouter-api/dist/core/blobs/directory.js +264 -0
- package/packages/crouter-api/dist/core/blobs/fault.js +6 -0
- package/packages/crouter-api/dist/core/blobs/index.js +30 -0
- package/packages/crouter-api/dist/core/blobs/r2.js +169 -0
- package/packages/crouter-api/dist/core/broker-client/client.js +184 -0
- package/packages/crouter-api/dist/core/broker-client/index.js +14 -0
- package/packages/crouter-api/dist/core/broker-client/transport-relay.js +186 -0
- package/packages/crouter-api/dist/core/broker-client/transport-socket.js +187 -0
- package/packages/crouter-api/dist/core/broker-client/transport.js +40 -0
- package/packages/crouter-api/dist/core/canvas/app-run.js +4 -0
- package/packages/crouter-api/dist/core/canvas/attention.js +47 -0
- package/packages/crouter-api/dist/core/canvas/boot-id.js +26 -0
- package/packages/crouter-api/dist/core/canvas/browse/app.js +1050 -0
- package/packages/crouter-api/dist/core/canvas/browse/model.js +477 -0
- package/packages/crouter-api/dist/core/canvas/browse/pins.js +29 -0
- package/packages/crouter-api/dist/core/canvas/browse/render.js +1058 -0
- package/packages/crouter-api/dist/core/canvas/canvas.js +1225 -0
- package/packages/crouter-api/dist/core/canvas/crons.js +541 -0
- package/packages/crouter-api/dist/core/canvas/daemon-actions.js +98 -0
- package/packages/crouter-api/dist/core/canvas/db.js +429 -0
- package/packages/crouter-api/dist/core/canvas/deliveries.js +398 -0
- package/packages/crouter-api/dist/core/canvas/delivery-contract.js +30 -0
- package/packages/crouter-api/dist/core/canvas/executions.js +279 -0
- package/packages/crouter-api/dist/core/canvas/extensions.js +90 -0
- package/packages/crouter-api/dist/core/canvas/focuses.js +82 -0
- package/packages/crouter-api/dist/core/canvas/history.js +480 -0
- package/packages/crouter-api/dist/core/canvas/index.js +16 -0
- package/packages/crouter-api/dist/core/canvas/install-id.js +64 -0
- package/packages/crouter-api/dist/core/canvas/labels.js +43 -0
- package/packages/crouter-api/dist/core/canvas/legacy-person.js +4 -0
- package/packages/crouter-api/dist/core/canvas/memory-reads.js +37 -0
- package/packages/crouter-api/dist/core/canvas/meta-file.js +89 -0
- package/packages/crouter-api/dist/core/canvas/nav-render.js +224 -0
- package/packages/crouter-api/dist/core/canvas/node-agent-paths.js +30 -0
- package/packages/crouter-api/dist/core/canvas/node-order.js +37 -0
- package/packages/crouter-api/dist/core/canvas/node-recap.js +62 -0
- package/packages/crouter-api/dist/core/canvas/node-tokens.js +53 -0
- package/packages/crouter-api/dist/core/canvas/outcome-actions.js +71 -0
- package/packages/crouter-api/dist/core/canvas/paths.js +167 -0
- package/packages/crouter-api/dist/core/canvas/person-state.js +41 -0
- package/packages/crouter-api/dist/core/canvas/person.js +251 -0
- package/packages/crouter-api/dist/core/canvas/pid.js +977 -0
- package/packages/crouter-api/dist/core/canvas/reconciler-leases.js +40 -0
- package/packages/crouter-api/dist/core/canvas/recovery.js +715 -0
- package/packages/crouter-api/dist/core/canvas/remote-canvas-source.js +290 -0
- package/packages/crouter-api/dist/core/canvas/remote-transport.js +57 -0
- package/packages/crouter-api/dist/core/canvas/render-source.js +518 -0
- package/packages/crouter-api/dist/core/canvas/schema-chain.js +110 -0
- package/packages/crouter-api/dist/core/canvas/schema-version.js +58 -0
- package/packages/crouter-api/dist/core/canvas/sessions.js +128 -0
- package/packages/crouter-api/dist/core/canvas/source.js +57 -0
- package/packages/crouter-api/dist/core/canvas/status-glyph.js +132 -0
- package/packages/crouter-api/dist/core/canvas/structured-requests.js +176 -0
- package/packages/crouter-api/dist/core/canvas/telemetry.js +35 -0
- package/packages/crouter-api/dist/core/canvas/tree.js +128 -0
- package/packages/crouter-api/dist/core/canvas/types.js +6 -0
- package/packages/crouter-api/dist/core/canvas/waits.js +113 -0
- package/packages/crouter-api/dist/core/canvas/worktrees.js +97 -0
- package/packages/crouter-api/dist/core/checkout-identities.js +88 -0
- package/packages/crouter-api/dist/core/clipboard-text.js +57 -0
- package/packages/crouter-api/dist/core/command-hooks/artifact.js +145 -0
- package/packages/crouter-api/dist/core/command-hooks/catalog.js +38 -0
- package/packages/crouter-api/dist/core/command-hooks/compose.js +101 -0
- package/packages/crouter-api/dist/core/command-hooks/discovery.js +246 -0
- package/packages/crouter-api/dist/core/command-hooks/help.js +18 -0
- package/packages/crouter-api/dist/core/command-hooks/lifecycle-catalog.js +9 -0
- package/packages/crouter-api/dist/core/command-hooks/lifecycle-create.js +51 -0
- package/packages/crouter-api/dist/core/command-hooks/report.js +28 -0
- package/packages/crouter-api/dist/core/command-hooks/schema.js +157 -0
- package/packages/crouter-api/dist/core/command-hooks/transport/exec-invoke.js +315 -0
- package/packages/crouter-api/dist/core/command-hooks/transport/exec-lifecycle.js +248 -0
- package/packages/crouter-api/dist/core/command-hooks/transport/plan.js +30 -0
- package/packages/crouter-api/dist/core/command-manifests/registry.js +118 -0
- package/packages/crouter-api/dist/core/command-plugins/bundle.js +604 -0
- package/packages/crouter-api/dist/core/command-plugins/caller-header.js +15 -0
- package/packages/crouter-api/dist/core/command-plugins/compose.js +243 -0
- package/packages/crouter-api/dist/core/command-plugins/discovery.js +240 -0
- package/packages/crouter-api/dist/core/command-plugins/endpoint.js +60 -0
- package/packages/crouter-api/dist/core/command-plugins/extensions.js +166 -0
- package/packages/crouter-api/dist/core/command-plugins/help-addenda.js +55 -0
- package/packages/crouter-api/dist/core/command-plugins/presence.js +36 -0
- package/packages/crouter-api/dist/core/command-plugins/transport/exec-invoke.js +138 -0
- package/packages/crouter-api/dist/core/command-plugins/transport/http-fetch.js +68 -0
- package/packages/crouter-api/dist/core/command-plugins/transport/http-invoke.js +333 -0
- package/packages/crouter-api/dist/core/command-plugins/transport/http-plan.js +349 -0
- package/packages/crouter-api/dist/core/command-plugins/transport/sign.js +115 -0
- package/packages/crouter-api/dist/core/command.js +848 -0
- package/packages/crouter-api/dist/core/config.js +1154 -0
- package/packages/crouter-api/dist/core/conversation-store/client.js +111 -0
- package/packages/crouter-api/dist/core/conversation-store/index.js +62 -0
- package/packages/crouter-api/dist/core/conversation-store/patch.js +192 -0
- package/packages/crouter-api/dist/core/conversation-store/repair.js +84 -0
- package/packages/crouter-api/dist/core/conversation-store/row-store.js +365 -0
- package/packages/crouter-api/dist/core/directory/issuer.js +15 -0
- package/packages/crouter-api/dist/core/directory/join-lock.js +61 -0
- package/packages/crouter-api/dist/core/directory/join.js +218 -0
- package/packages/crouter-api/dist/core/directory/person-credential.js +220 -0
- package/packages/crouter-api/dist/core/directory/reach.js +19 -0
- package/packages/crouter-api/dist/core/document-lines.js +6 -0
- package/packages/crouter-api/dist/core/editor-resolver.js +77 -0
- package/packages/crouter-api/dist/core/env-name.js +25 -0
- package/packages/crouter-api/dist/core/environment-recipe.js +59 -0
- package/packages/crouter-api/dist/core/environments.js +59 -0
- package/packages/crouter-api/dist/core/errors.js +90 -0
- package/packages/crouter-api/dist/core/events/emit.js +44 -0
- package/packages/crouter-api/dist/core/events/envelope.js +84 -0
- package/packages/crouter-api/dist/core/events/errors.js +69 -0
- package/packages/crouter-api/dist/core/events/operation-id.js +24 -0
- package/packages/crouter-api/dist/core/events/outbound.js +92 -0
- package/packages/crouter-api/dist/core/events/read.js +625 -0
- package/packages/crouter-api/dist/core/events/serialize.js +199 -0
- package/packages/crouter-api/dist/core/events/source.js +31 -0
- package/packages/crouter-api/dist/core/events/types.js +11 -0
- package/packages/crouter-api/dist/core/exclusive-lock.js +197 -0
- package/packages/crouter-api/dist/core/fault-classifier.js +101 -0
- package/packages/crouter-api/dist/core/feed/feed.js +190 -0
- package/packages/crouter-api/dist/core/feed/inbox.js +93 -0
- package/packages/crouter-api/dist/core/feed/messages.js +219 -0
- package/packages/crouter-api/dist/core/feed/reports.js +58 -0
- package/packages/crouter-api/dist/core/frontmatter.js +35 -0
- package/packages/crouter-api/dist/core/fs-utils.js +263 -0
- package/packages/crouter-api/dist/core/git.js +103 -0
- package/packages/crouter-api/dist/core/grants/cover.js +66 -0
- package/packages/crouter-api/dist/core/grants/hosted-endpoint.js +70 -0
- package/packages/crouter-api/dist/core/grants/local.js +26 -0
- package/packages/crouter-api/dist/core/grants/mirror.js +464 -0
- package/packages/crouter-api/dist/core/grants/on-sync.js +163 -0
- package/packages/crouter-api/dist/core/grants/sandboxes.js +24 -0
- package/packages/crouter-api/dist/core/grants/sync.js +216 -0
- package/packages/crouter-api/dist/core/grants/terminal.js +25 -0
- package/packages/crouter-api/dist/core/graph/access.js +37 -0
- package/packages/crouter-api/dist/core/graph/bodies.js +68 -0
- package/packages/crouter-api/dist/core/graph/custom.js +298 -0
- package/packages/crouter-api/dist/core/graph/deletion.js +115 -0
- package/packages/crouter-api/dist/core/graph/documents.js +675 -0
- package/packages/crouter-api/dist/core/graph/edges.js +83 -0
- package/packages/crouter-api/dist/core/graph/events.js +432 -0
- package/packages/crouter-api/dist/core/graph/exposures.js +164 -0
- package/packages/crouter-api/dist/core/graph/jobs.js +184 -0
- package/packages/crouter-api/dist/core/graph/kinds/action.js +20 -0
- package/packages/crouter-api/dist/core/graph/kinds/custom.js +25 -0
- package/packages/crouter-api/dist/core/graph/kinds/document.js +132 -0
- package/packages/crouter-api/dist/core/graph/kinds/dto.js +20 -0
- package/packages/crouter-api/dist/core/graph/kinds/environment.js +21 -0
- package/packages/crouter-api/dist/core/graph/kinds/job.js +24 -0
- package/packages/crouter-api/dist/core/graph/kinds/kind.js +15 -0
- package/packages/crouter-api/dist/core/graph/kinds/live-read.js +11 -0
- package/packages/crouter-api/dist/core/graph/kinds/node.js +87 -0
- package/packages/crouter-api/dist/core/graph/kinds/owner.js +26 -0
- package/packages/crouter-api/dist/core/graph/kinds/registry.js +58 -0
- package/packages/crouter-api/dist/core/graph/kinds/render.js +17 -0
- package/packages/crouter-api/dist/core/graph/names.js +239 -0
- package/packages/crouter-api/dist/core/graph/objects.js +292 -0
- package/packages/crouter-api/dist/core/graph/package-docs.js +148 -0
- package/packages/crouter-api/dist/core/graph/package-files.js +146 -0
- package/packages/crouter-api/dist/core/graph/package-publish.js +158 -0
- package/packages/crouter-api/dist/core/graph/package-reconcile.js +99 -0
- package/packages/crouter-api/dist/core/graph/reader.js +284 -0
- package/packages/crouter-api/dist/core/graph/receiver-url.js +83 -0
- package/packages/crouter-api/dist/core/graph/receivers.js +66 -0
- package/packages/crouter-api/dist/core/graph/repo-sync/identity.js +147 -0
- package/packages/crouter-api/dist/core/graph/repo-sync/repos.js +94 -0
- package/packages/crouter-api/dist/core/graph/rules.js +144 -0
- package/packages/crouter-api/dist/core/graph/types.js +10 -0
- package/packages/crouter-api/dist/core/graph/watches.js +223 -0
- package/packages/crouter-api/dist/core/help.js +445 -0
- package/packages/crouter-api/dist/core/human/action-binding.js +41 -0
- package/packages/crouter-api/dist/core/human/answer-text.js +100 -0
- package/packages/crouter-api/dist/core/human/answer.js +119 -0
- package/packages/crouter-api/dist/core/human/completion.js +27 -0
- package/packages/crouter-api/dist/core/human/component-docs.js +442 -0
- package/packages/crouter-api/dist/core/human/convention.js +75 -0
- package/packages/crouter-api/dist/core/human/feedback-companion.js +92 -0
- package/packages/crouter-api/dist/core/human/feedback.js +88 -0
- package/packages/crouter-api/dist/core/human/page-authoring.js +19 -0
- package/packages/crouter-api/dist/core/human/page-catalog.js +172 -0
- package/packages/crouter-api/dist/core/human/page-errors.js +14 -0
- package/packages/crouter-api/dist/core/human/page-eval.js +125 -0
- package/packages/crouter-api/dist/core/human/page-html-markdown.js +260 -0
- package/packages/crouter-api/dist/core/human/page-markdown.js +295 -0
- package/packages/crouter-api/dist/core/human/page-schema.js +381 -0
- package/packages/crouter-api/dist/core/human/page.js +251 -0
- package/packages/crouter-api/dist/core/human/request-files.js +54 -0
- package/packages/crouter-api/dist/core/human/requests.js +647 -0
- package/packages/crouter-api/dist/core/human/root.js +11 -0
- package/packages/crouter-api/dist/core/human/summary.js +5 -0
- package/packages/crouter-api/dist/core/human/tickets.js +175 -0
- package/packages/crouter-api/dist/core/human/types.js +1 -0
- package/packages/crouter-api/dist/core/human/visible-paths.js +74 -0
- package/packages/crouter-api/dist/core/human-actions.js +101 -0
- package/packages/crouter-api/dist/core/import/bundle/blob-keys.js +25 -0
- package/packages/crouter-api/dist/core/import/bundle/layout.js +111 -0
- package/packages/crouter-api/dist/core/import/export/archive.js +22 -0
- package/packages/crouter-api/dist/core/import/export/cloud.js +164 -0
- package/packages/crouter-api/dist/core/import/export/dump.js +245 -0
- package/packages/crouter-api/dist/core/import/export/files.js +169 -0
- package/packages/crouter-api/dist/core/import/export/inline.js +15 -0
- package/packages/crouter-api/dist/core/import/export/source.js +5 -0
- package/packages/crouter-api/dist/core/import/export/stores.js +73 -0
- package/packages/crouter-api/dist/core/import/load/catalog.js +70 -0
- package/packages/crouter-api/dist/core/import/load/copy.js +132 -0
- package/packages/crouter-api/dist/core/import/load/prepare.js +211 -0
- package/packages/crouter-api/dist/core/import/load/rewrite.js +310 -0
- package/packages/crouter-api/dist/core/import/load/stage.js +99 -0
- package/packages/crouter-api/dist/core/inspector/chrome.js +14 -0
- package/packages/crouter-api/dist/core/inspector/contract.js +1 -0
- package/packages/crouter-api/dist/core/inspector/core.js +296 -0
- package/packages/crouter-api/dist/core/inspector/host.js +538 -0
- package/packages/crouter-api/dist/core/inspector/model.js +225 -0
- package/packages/crouter-api/dist/core/inspector/text.js +45 -0
- package/packages/crouter-api/dist/core/inspector/transport.js +36 -0
- package/packages/crouter-api/dist/core/inspector/tui.js +295 -0
- package/packages/crouter-api/dist/core/installed-plugins.js +82 -0
- package/packages/crouter-api/dist/core/io.js +470 -0
- package/packages/crouter-api/dist/core/keybindings/attach-control.js +42 -0
- package/packages/crouter-api/dist/core/keybindings/background-bash.js +33 -0
- package/packages/crouter-api/dist/core/keybindings/catalog.js +288 -0
- package/packages/crouter-api/dist/core/keybindings/inbox.js +25 -0
- package/packages/crouter-api/dist/core/keybindings/index.js +7 -0
- package/packages/crouter-api/dist/core/keybindings/match.js +146 -0
- package/packages/crouter-api/dist/core/keybindings/persistence.js +49 -0
- package/packages/crouter-api/dist/core/keybindings/resolve.js +348 -0
- package/packages/crouter-api/dist/core/keybindings/types.js +1 -0
- package/packages/crouter-api/dist/core/layout-migrate/index.js +523 -0
- package/packages/crouter-api/dist/core/layout-migrate/paths.js +118 -0
- package/packages/crouter-api/dist/core/layout-migrate/stored-paths.js +424 -0
- package/packages/crouter-api/dist/core/layout-migrate/stores.js +543 -0
- package/packages/crouter-api/dist/core/layout.js +143 -0
- package/packages/crouter-api/dist/core/ledger/account.js +13 -0
- package/packages/crouter-api/dist/core/ledger/charges.js +44 -0
- package/packages/crouter-api/dist/core/ledger/check.js +40 -0
- package/packages/crouter-api/dist/core/ledger/chunks.js +43 -0
- package/packages/crouter-api/dist/core/ledger/index.js +10 -0
- package/packages/crouter-api/dist/core/ledger/infra-allowance.js +31 -0
- package/packages/crouter-api/dist/core/ledger/limits.js +35 -0
- package/packages/crouter-api/dist/core/ledger/months.js +19 -0
- package/packages/crouter-api/dist/core/ledger/payer.js +14 -0
- package/packages/crouter-api/dist/core/ledger/rates.js +64 -0
- package/packages/crouter-api/dist/core/ledger/read.js +194 -0
- package/packages/crouter-api/dist/core/ledger/totals.js +34 -0
- package/packages/crouter-api/dist/core/ledger/types.js +2 -0
- package/packages/crouter-api/dist/core/llm/app-rungs.js +64 -0
- package/packages/crouter-api/dist/core/llm/body-limits.js +7 -0
- package/packages/crouter-api/dist/core/llm/owner-candidates.js +79 -0
- package/packages/crouter-api/dist/core/llm/refusal.js +22 -0
- package/packages/crouter-api/dist/core/llm/run.js +558 -0
- package/packages/crouter-api/dist/core/locked-file.js +121 -0
- package/packages/crouter-api/dist/core/log.js +91 -0
- package/packages/crouter-api/dist/core/managed-providers.js +61 -0
- package/packages/crouter-api/dist/core/manifest-stale.js +39 -0
- package/packages/crouter-api/dist/core/manifest.js +37 -0
- package/packages/crouter-api/dist/core/model-auth/api-credential-store.js +49 -0
- package/packages/crouter-api/dist/core/model-auth/daemon-login.js +156 -0
- package/packages/crouter-api/dist/core/model-auth/readiness.js +83 -0
- package/packages/crouter-api/dist/core/model-routes-pool.js +57 -0
- package/packages/crouter-api/dist/core/model-routes.js +212 -0
- package/packages/crouter-api/dist/core/northlight/previews.js +87 -0
- package/packages/crouter-api/dist/core/nvim-launch.js +45 -0
- package/packages/crouter-api/dist/core/output.js +99 -0
- package/packages/crouter-api/dist/core/packages/eligibility.js +34 -0
- package/packages/crouter-api/dist/core/packages/launch-kinds.js +20 -0
- package/packages/crouter-api/dist/core/packages/source-url.js +17 -0
- package/packages/crouter-api/dist/core/pagination.js +88 -0
- package/packages/crouter-api/dist/core/peer/client.js +168 -0
- package/packages/crouter-api/dist/core/peer/directory.js +193 -0
- package/packages/crouter-api/dist/core/peer/envelope.js +98 -0
- package/packages/crouter-api/dist/core/peer/names.js +8 -0
- package/packages/crouter-api/dist/core/peer/outbox-store.js +84 -0
- package/packages/crouter-api/dist/core/peer/receiver.js +54 -0
- package/packages/crouter-api/dist/core/peer/stubs.js +208 -0
- package/packages/crouter-api/dist/core/peer/token.js +30 -0
- package/packages/crouter-api/dist/core/peer/version.js +23 -0
- package/packages/crouter-api/dist/core/permissions/builtin.js +29 -0
- package/packages/crouter-api/dist/core/permissions/ceiling.js +332 -0
- package/packages/crouter-api/dist/core/permissions/compile.js +175 -0
- package/packages/crouter-api/dist/core/permissions/errors.js +13 -0
- package/packages/crouter-api/dist/core/permissions/evaluator.js +98 -0
- package/packages/crouter-api/dist/core/permissions/facts.js +102 -0
- package/packages/crouter-api/dist/core/permissions/schema-parser.js +151 -0
- package/packages/crouter-api/dist/core/permissions/schemas.js +83 -0
- package/packages/crouter-api/dist/core/permissions/sql.js +31 -0
- package/packages/crouter-api/dist/core/plugin-app.js +58 -0
- package/packages/crouter-api/dist/core/plugin-env.js +30 -0
- package/packages/crouter-api/dist/core/plugin-extensions.js +191 -0
- package/packages/crouter-api/dist/core/plugin-objects-manifest.js +86 -0
- package/packages/crouter-api/dist/core/plugin-quarantine.js +70 -0
- package/packages/crouter-api/dist/core/plugin-swap-lock.js +31 -0
- package/packages/crouter-api/dist/core/pool-credential-store.js +116 -0
- package/packages/crouter-api/dist/core/predicate.js +191 -0
- package/packages/crouter-api/dist/core/preview-registry.js +403 -0
- package/packages/crouter-api/dist/core/preview-result-path.js +26 -0
- package/packages/crouter-api/dist/core/profiles/default-binding.js +29 -0
- package/packages/crouter-api/dist/core/profiles/deletion-reservation.js +42 -0
- package/packages/crouter-api/dist/core/profiles/fuzzy-match.js +92 -0
- package/packages/crouter-api/dist/core/profiles/manifest.js +574 -0
- package/packages/crouter-api/dist/core/profiles/select.js +740 -0
- package/packages/crouter-api/dist/core/provider-credential.js +17 -0
- package/packages/crouter-api/dist/core/provider-error-recognition.js +82 -0
- package/packages/crouter-api/dist/core/provider-failure.js +157 -0
- package/packages/crouter-api/dist/core/provider-management.js +9 -0
- package/packages/crouter-api/dist/core/providers/approval.js +146 -0
- package/packages/crouter-api/dist/core/providers/audit.js +52 -0
- package/packages/crouter-api/dist/core/providers/bundles.js +643 -0
- package/packages/crouter-api/dist/core/providers/call.js +497 -0
- package/packages/crouter-api/dist/core/providers/description.js +1 -0
- package/packages/crouter-api/dist/core/providers/device-libs.js +202 -0
- package/packages/crouter-api/dist/core/providers/device.js +95 -0
- package/packages/crouter-api/dist/core/providers/errors.js +136 -0
- package/packages/crouter-api/dist/core/providers/files.js +390 -0
- package/packages/crouter-api/dist/core/providers/inflight.js +14 -0
- package/packages/crouter-api/dist/core/providers/mint.js +219 -0
- package/packages/crouter-api/dist/core/providers/receipts.js +61 -0
- package/packages/crouter-api/dist/core/providers/request.js +173 -0
- package/packages/crouter-api/dist/core/providers/roots.js +118 -0
- package/packages/crouter-api/dist/core/providers/token-cache.js +203 -0
- package/packages/crouter-api/dist/core/rate-limit-scope.js +64 -0
- package/packages/crouter-api/dist/core/remote-canvas-target.js +30 -0
- package/packages/crouter-api/dist/core/render.js +146 -0
- package/packages/crouter-api/dist/core/resolver.js +111 -0
- package/packages/crouter-api/dist/core/review/comments.js +296 -0
- package/packages/crouter-api/dist/core/review/companion.js +211 -0
- package/packages/crouter-api/dist/core/review/signal.js +12 -0
- package/packages/crouter-api/dist/core/review/store.js +178 -0
- package/packages/crouter-api/dist/core/review/types.js +23 -0
- package/packages/crouter-api/dist/core/runs/activity.js +57 -0
- package/packages/crouter-api/dist/core/runs/events.js +179 -0
- package/packages/crouter-api/dist/core/runs/initial-input.js +27 -0
- package/packages/crouter-api/dist/core/runs/operations.js +793 -0
- package/packages/crouter-api/dist/core/runs/questions.js +151 -0
- package/packages/crouter-api/dist/core/runtime/banner.js +53 -0
- package/packages/crouter-api/dist/core/runtime/bearings-render.js +273 -0
- package/packages/crouter-api/dist/core/runtime/bearings.js +199 -0
- package/packages/crouter-api/dist/core/runtime/bin-contributions.js +186 -0
- package/packages/crouter-api/dist/core/runtime/blaxel-environment.js +17 -0
- package/packages/crouter-api/dist/core/runtime/branded-host.js +485 -0
- package/packages/crouter-api/dist/core/runtime/broker/attachments-fetch.js +20 -0
- package/packages/crouter-api/dist/core/runtime/broker/bash-job-launch.js +65 -0
- package/packages/crouter-api/dist/core/runtime/broker/daemon-ops.js +232 -0
- package/packages/crouter-api/dist/core/runtime/broker/model-adapter.js +431 -0
- package/packages/crouter-api/dist/core/runtime/broker/node-token.js +16 -0
- package/packages/crouter-api/dist/core/runtime/broker/read-ops.js +173 -0
- package/packages/crouter-api/dist/core/runtime/broker/signal-stream.js +149 -0
- package/packages/crouter-api/dist/core/runtime/broker/turn-cause.js +44 -0
- package/packages/crouter-api/dist/core/runtime/broker-protocol.js +152 -0
- package/packages/crouter-api/dist/core/runtime/broker-request.js +86 -0
- package/packages/crouter-api/dist/core/runtime/broker-sdk.js +130 -0
- package/packages/crouter-api/dist/core/runtime/canvas-extensions.js +100 -0
- package/packages/crouter-api/dist/core/runtime/close.js +266 -0
- package/packages/crouter-api/dist/core/runtime/command-expansion.js +104 -0
- package/packages/crouter-api/dist/core/runtime/command-surface.js +117 -0
- package/packages/crouter-api/dist/core/runtime/crtr-theme.js +146 -0
- package/packages/crouter-api/dist/core/runtime/deliver-live.js +84 -0
- package/packages/crouter-api/dist/core/runtime/fault-recovery.js +83 -0
- package/packages/crouter-api/dist/core/runtime/fault.js +17 -0
- package/packages/crouter-api/dist/core/runtime/fleet.js +75 -0
- package/packages/crouter-api/dist/core/runtime/focus-viewer.js +151 -0
- package/packages/crouter-api/dist/core/runtime/front-door-env.js +16 -0
- package/packages/crouter-api/dist/core/runtime/headless-pi.js +176 -0
- package/packages/crouter-api/dist/core/runtime/host.js +701 -0
- package/packages/crouter-api/dist/core/runtime/interactive-deliver.js +51 -0
- package/packages/crouter-api/dist/core/runtime/invocation.js +10 -0
- package/packages/crouter-api/dist/core/runtime/kickoff.js +263 -0
- package/packages/crouter-api/dist/core/runtime/launch-prompt.js +13 -0
- package/packages/crouter-api/dist/core/runtime/launch-target.js +87 -0
- package/packages/crouter-api/dist/core/runtime/launch.js +505 -0
- package/packages/crouter-api/dist/core/runtime/ledger.js +55 -0
- package/packages/crouter-api/dist/core/runtime/lifecycle.js +283 -0
- package/packages/crouter-api/dist/core/runtime/managed-provider-cooling.js +62 -0
- package/packages/crouter-api/dist/core/runtime/memory-admission.js +68 -0
- package/packages/crouter-api/dist/core/runtime/model-registry.js +13 -0
- package/packages/crouter-api/dist/core/runtime/model-selection.js +135 -0
- package/packages/crouter-api/dist/core/runtime/model-swap.js +75 -0
- package/packages/crouter-api/dist/core/runtime/naming.js +300 -0
- package/packages/crouter-api/dist/core/runtime/nerd-font.js +162 -0
- package/packages/crouter-api/dist/core/runtime/nodes.js +506 -0
- package/packages/crouter-api/dist/core/runtime/outcome-document.js +86 -0
- package/packages/crouter-api/dist/core/runtime/output-result.js +32 -0
- package/packages/crouter-api/dist/core/runtime/output-schema-refs.js +100 -0
- package/packages/crouter-api/dist/core/runtime/package-health.js +100 -0
- package/packages/crouter-api/dist/core/runtime/persona.js +54 -0
- package/packages/crouter-api/dist/core/runtime/pi-cli.js +65 -0
- package/packages/crouter-api/dist/core/runtime/pi-vendored.js +63 -0
- package/packages/crouter-api/dist/core/runtime/placement-tmux.js +81 -0
- package/packages/crouter-api/dist/core/runtime/placement.js +418 -0
- package/packages/crouter-api/dist/core/runtime/progress-bar.js +50 -0
- package/packages/crouter-api/dist/core/runtime/provider-credential-gate.js +48 -0
- package/packages/crouter-api/dist/core/runtime/recovery-hold.js +46 -0
- package/packages/crouter-api/dist/core/runtime/reopen.js +160 -0
- package/packages/crouter-api/dist/core/runtime/revive.js +748 -0
- package/packages/crouter-api/dist/core/runtime/roadmap.js +86 -0
- package/packages/crouter-api/dist/core/runtime/runner/blaxel/client.js +140 -0
- package/packages/crouter-api/dist/core/runtime/runner/blaxel/image-build.js +233 -0
- package/packages/crouter-api/dist/core/runtime/runner/delete-sandboxes.js +24 -0
- package/packages/crouter-api/dist/core/runtime/runner/index.js +37 -0
- package/packages/crouter-api/dist/core/runtime/runner/machine/call.js +94 -0
- package/packages/crouter-api/dist/core/runtime/runner/machine/environment.js +7 -0
- package/packages/crouter-api/dist/core/runtime/runner/machine/ops.js +42 -0
- package/packages/crouter-api/dist/core/runtime/runner/machine/runner.js +90 -0
- package/packages/crouter-api/dist/core/runtime/runner/process.js +70 -0
- package/packages/crouter-api/dist/core/runtime/runner/types.js +16 -0
- package/packages/crouter-api/dist/core/runtime/session-branch.js +16 -0
- package/packages/crouter-api/dist/core/runtime/session-cycles.js +110 -0
- package/packages/crouter-api/dist/core/runtime/session-list-cache.js +302 -0
- package/packages/crouter-api/dist/core/runtime/session-visibility.js +99 -0
- package/packages/crouter-api/dist/core/runtime/setup-marker.js +46 -0
- package/packages/crouter-api/dist/core/runtime/situational-context.js +54 -0
- package/packages/crouter-api/dist/core/runtime/situational-live.js +41 -0
- package/packages/crouter-api/dist/core/runtime/spawn-env-rows.js +15 -0
- package/packages/crouter-api/dist/core/runtime/spawn-env.js +260 -0
- package/packages/crouter-api/dist/core/runtime/spawn.js +717 -0
- package/packages/crouter-api/dist/core/runtime/stamp/protocol.js +113 -0
- package/packages/crouter-api/dist/core/runtime/start-check.js +43 -0
- package/packages/crouter-api/dist/core/runtime/stop-guard.js +150 -0
- package/packages/crouter-api/dist/core/runtime/structured-output.js +112 -0
- package/packages/crouter-api/dist/core/runtime/surface-bg.js +85 -0
- package/packages/crouter-api/dist/core/runtime/tmux-bindings.js +743 -0
- package/packages/crouter-api/dist/core/runtime/tmux-chrome.js +5 -0
- package/packages/crouter-api/dist/core/runtime/tmux-driver.js +713 -0
- package/packages/crouter-api/dist/core/runtime/unsandboxed.js +18 -0
- package/packages/crouter-api/dist/core/runtime/view-socket.js +195 -0
- package/packages/crouter-api/dist/core/runtime/warm-pool.js +479 -0
- package/packages/crouter-api/dist/core/scope.js +184 -0
- package/packages/crouter-api/dist/core/scoped-state/db.js +271 -0
- package/packages/crouter-api/dist/core/scoped-state/legacy-profiles.js +65 -0
- package/packages/crouter-api/dist/core/scoped-state/migrate.js +332 -0
- package/packages/crouter-api/dist/core/scoped-state/paths.js +27 -0
- package/packages/crouter-api/dist/core/scoped-state/person-rows.js +185 -0
- package/packages/crouter-api/dist/core/scoped-state/person-store.js +116 -0
- package/packages/crouter-api/dist/core/scoped-state/schema.js +52 -0
- package/packages/crouter-api/dist/core/scopes.js +48 -0
- package/packages/crouter-api/dist/core/secrets/env-rows.js +40 -0
- package/packages/crouter-api/dist/core/secrets/environment-owner.js +31 -0
- package/packages/crouter-api/dist/core/secrets/environment-secrets.js +14 -0
- package/packages/crouter-api/dist/core/secrets/index.js +2 -0
- package/packages/crouter-api/dist/core/secrets/key.js +33 -0
- package/packages/crouter-api/dist/core/secrets/seal.js +43 -0
- package/packages/crouter-api/dist/core/secrets.js +147 -0
- package/packages/crouter-api/dist/core/self-update.js +77 -0
- package/packages/crouter-api/dist/core/session-model/session-state.js +180 -0
- package/packages/crouter-api/dist/core/shell-segments.js +169 -0
- package/packages/crouter-api/dist/core/spaces/cache-env.js +15 -0
- package/packages/crouter-api/dist/core/spaces/file-root.js +68 -0
- package/packages/crouter-api/dist/core/spaces/mounts.js +126 -0
- package/packages/crouter-api/dist/core/spaces/open-beneath.js +581 -0
- package/packages/crouter-api/dist/core/spaces/permissions.js +77 -0
- package/packages/crouter-api/dist/core/spaces/process.js +172 -0
- package/packages/crouter-api/dist/core/spaces/runtime-home.js +8 -0
- package/packages/crouter-api/dist/core/spaces/space.js +58 -0
- package/packages/crouter-api/dist/core/spaces/stop.js +138 -0
- package/packages/crouter-api/dist/core/spaces/users.js +43 -0
- package/packages/crouter-api/dist/core/sqlite-statements.js +17 -0
- package/packages/crouter-api/dist/core/statements.js +81 -0
- package/packages/crouter-api/dist/core/storage/attachments.js +141 -0
- package/packages/crouter-api/dist/core/storage/caller-file.js +84 -0
- package/packages/crouter-api/dist/core/storage/client.js +220 -0
- package/packages/crouter-api/dist/core/storage/media-types.js +22 -0
- package/packages/crouter-api/dist/core/storage/purge.js +55 -0
- package/packages/crouter-api/dist/core/storage/tables.js +129 -0
- package/packages/crouter-api/dist/core/subscription-state.js +449 -0
- package/packages/crouter-api/dist/core/substrate/delivery/corpus.js +206 -0
- package/packages/crouter-api/dist/core/substrate/delivery/deliver.js +336 -0
- package/packages/crouter-api/dist/core/substrate/delivery/listings.js +75 -0
- package/packages/crouter-api/dist/core/substrate/delivery/match.js +146 -0
- package/packages/crouter-api/dist/core/substrate/delivery/plan.js +130 -0
- package/packages/crouter-api/dist/core/substrate/delivery/render-boot.js +330 -0
- package/packages/crouter-api/dist/core/substrate/delivery/render-event.js +186 -0
- package/packages/crouter-api/dist/core/substrate/delivery/sub-persona-menu.js +24 -0
- package/packages/crouter-api/dist/core/substrate/delivery/types.js +1 -0
- package/packages/crouter-api/dist/core/substrate/gate-explain.js +397 -0
- package/packages/crouter-api/dist/core/substrate/schema.js +81 -0
- package/packages/crouter-api/dist/core/substrate/subject-fields.js +39 -0
- package/packages/crouter-api/dist/core/substrate/subject.js +60 -0
- package/packages/crouter-api/dist/core/termrender/code-doc.js +92 -0
- package/packages/crouter-api/dist/core/termrender/display.js +56 -0
- package/packages/crouter-api/dist/core/termrender/termrender.js +719 -0
- package/packages/crouter-api/dist/core/termrender/version.js +1 -0
- package/packages/crouter-api/dist/core/timing.js +94 -0
- package/packages/crouter-api/dist/core/tui/draw.js +378 -0
- package/packages/crouter-api/dist/core/tui/fuzzy.js +38 -0
- package/packages/crouter-api/dist/core/tui/markdown.js +407 -0
- package/packages/crouter-api/dist/core/tui/page-host.js +74 -0
- package/packages/crouter-api/dist/core/tui/panel.js +142 -0
- package/packages/crouter-api/dist/core/tui/terminal.js +100 -0
- package/packages/crouter-api/dist/core/user-settings.js +478 -0
- package/packages/crouter-api/dist/core/wake.js +296 -0
- package/packages/crouter-api/dist/core/worktree-close.js +251 -0
- package/packages/crouter-api/dist/core/worktree-containment.js +48 -0
- package/packages/crouter-api/dist/core/worktree-landing.js +56 -0
- package/packages/crouter-api/dist/core/worktree-machine.js +92 -0
- package/packages/crouter-api/dist/core/worktree-mutation-async.js +385 -0
- package/packages/crouter-api/dist/core/worktree-remove.js +84 -0
- package/packages/crouter-api/dist/core/worktree.js +909 -0
- package/packages/crouter-api/dist/daemon/api/deferred-head.js +117 -0
- package/packages/crouter-api/dist/daemon/api/environment-of.js +64 -0
- package/packages/crouter-api/dist/daemon/api/handlers/bash-jobs.js +341 -0
- package/packages/crouter-api/dist/daemon/api/handlers/broker-recovery.js +266 -0
- package/packages/crouter-api/dist/daemon/api/handlers/git-credential.js +64 -0
- package/packages/crouter-api/dist/daemon/api/handlers/providers.js +284 -0
- package/packages/crouter-api/dist/daemon/api/handlers/validate.js +58 -0
- package/packages/crouter-api/dist/daemon/api/map.js +768 -0
- package/packages/crouter-api/dist/daemon/api/operations.js +316 -0
- package/packages/crouter-api/dist/daemon/api/principal.js +147 -0
- package/packages/crouter-api/dist/daemon/api/reader.js +125 -0
- package/packages/crouter-api/dist/daemon/api/router.js +542 -0
- package/packages/crouter-api/dist/daemon/api/sync-notice.js +46 -0
- package/packages/crouter-api/dist/daemon/api/viewer-presence.js +100 -0
- package/packages/crouter-api/dist/daemon/broker-signals/bus.js +203 -0
- package/packages/crouter-api/dist/daemon/companion-retire.js +44 -0
- package/packages/crouter-api/dist/daemon/control.js +22 -0
- package/packages/crouter-api/dist/daemon/cron/authority.js +101 -0
- package/packages/crouter-api/dist/daemon/cron/live-runs.js +66 -0
- package/packages/crouter-api/dist/daemon/cron/run-socket.js +170 -0
- package/packages/crouter-api/dist/daemon/drain.js +76 -0
- package/packages/crouter-api/dist/daemon/http-dispatcher.js +37 -0
- package/packages/crouter-api/dist/daemon/human/finish.js +178 -0
- package/packages/crouter-api/dist/daemon/human/settle.js +103 -0
- package/packages/crouter-api/dist/daemon/machine-link/config.js +63 -0
- package/packages/crouter-api/dist/daemon/machine-link/credential.js +24 -0
- package/packages/crouter-api/dist/daemon/machine-link/forward.js +181 -0
- package/packages/crouter-api/dist/daemon/machine-link/frames.js +29 -0
- package/packages/crouter-api/dist/daemon/machine-link/holder.js +317 -0
- package/packages/crouter-api/dist/daemon/machine-link/move-notify.js +15 -0
- package/packages/crouter-api/dist/daemon/manage.js +736 -0
- package/packages/crouter-api/dist/daemon/park-activity.js +33 -0
- package/packages/crouter-api/dist/daemon/park-pending.js +76 -0
- package/packages/crouter-api/dist/daemon/pidfile.js +37 -0
- package/packages/crouter-api/dist/daemon/postgres/binary.js +193 -0
- package/packages/crouter-api/dist/daemon/postgres/cluster.js +111 -0
- package/packages/crouter-api/dist/daemon/postgres/pins.js +16 -0
- package/packages/crouter-api/dist/daemon/postgres/supervisor.js +177 -0
- package/packages/crouter-api/dist/daemon/readiness.js +37 -0
- package/packages/crouter-api/dist/daemon/reconcilers/broker-supervision.js +846 -0
- package/packages/crouter-api/dist/daemon/reconcilers/ledger-sandbox.js +249 -0
- package/packages/crouter-api/dist/daemon/reconcilers/live-obligation.js +125 -0
- package/packages/crouter-api/dist/daemon/reconcilers/node-lifecycle/launch-failure.js +8 -0
- package/packages/crouter-api/dist/daemon/reconcilers/node-lifecycle/node-person.js +40 -0
- package/packages/crouter-api/dist/daemon/reconcilers/node-lifecycle/remote-wake.js +151 -0
- package/packages/crouter-api/dist/daemon/reconcilers/node-lifecycle/respawn-policy.js +59 -0
- package/packages/crouter-api/dist/daemon/reconcilers/recipe-image.js +196 -0
- package/packages/crouter-api/dist/daemon/reconcilers/throttled-lane.js +63 -0
- package/packages/crouter-api/dist/daemon/runs/append-section.js +135 -0
- package/packages/crouter-api/dist/daemon/runs/observer.js +441 -0
- package/packages/crouter-api/dist/daemon/runs/view-transport.js +81 -0
- package/packages/crouter-api/dist/daemon/startup-policy.js +1 -0
- package/packages/crouter-api/dist/daemon/structured-requests/sidecar.js +5 -0
- package/packages/crouter-api/dist/hook-authoring.js +447 -0
- package/packages/crouter-api/dist/hook-process.js +34 -0
- package/packages/crouter-api/dist/launcher/client.js +52 -0
- package/packages/crouter-api/dist/launcher/limits/policy.js +142 -0
- package/packages/crouter-api/dist/launcher/limits/settings.js +94 -0
- package/packages/crouter-api/dist/launcher/spec.js +10 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/apply.js +113 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/fields.js +52 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/index.js +89 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/legacy/discover.js +251 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/legacy/history.js +37 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/legacy/nested.js +37 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/legacy/parse.js +24 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/legacy/types.js +3 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/plan.js +410 -0
- package/packages/crouter-api/dist/migrations/004-canvas-documents/pointers.js +95 -0
- package/packages/crouter-api/dist/migrations/activation.js +46 -0
- package/packages/crouter-api/dist/native/linux.js +20 -0
- package/packages/crouter-api/dist/shared/crtr-version.js +18 -0
- package/packages/crouter-api/dist/shared/env.js +335 -0
- package/packages/crouter-api/dist/shared/generated-context.js +240 -0
- package/packages/crouter-api/dist/shared/inbox-entry-body.js +124 -0
- package/packages/crouter-api/dist/shared/inline-ref-grammar.js +99 -0
- package/packages/crouter-api/dist/shared/predicates.js +4 -0
- package/packages/crouter-api/dist/shared/shell-quote.js +5 -0
- package/packages/crouter-api/dist/shared/strip-cd-prefix.js +13 -0
- package/packages/crouter-api/dist/shared/tool-groups.js +64 -0
- package/packages/crouter-api/dist/shared/traceparent.js +28 -0
- package/packages/crouter-api/dist/shared/turn-replies.js +71 -0
- package/packages/crouter-api/dist/shared/working-activity.js +27 -0
- package/packages/crouter-api/dist/types.js +193 -0
- package/packages/crouter-api/package.json +49 -0
- package/packages/crouter-identity/package.json +1 -1
- package/packages/crouter-plugin/dist/approval.js +12 -0
- package/packages/crouter-plugin/dist/bundle.js +203 -0
- package/packages/crouter-plugin/dist/caller.js +23 -0
- package/packages/crouter-plugin/dist/client/index.js +338 -0
- package/packages/crouter-plugin/dist/compare.js +314 -0
- package/packages/crouter-plugin/dist/define.js +531 -0
- package/packages/crouter-plugin/dist/errors.js +150 -0
- package/packages/crouter-plugin/dist/fields.js +83 -0
- package/packages/crouter-plugin/dist/index.js +15 -0
- package/packages/crouter-plugin/dist/manifest.js +111 -0
- package/packages/crouter-plugin/dist/node.js +153 -0
- package/packages/crouter-plugin/dist/params.js +85 -0
- package/packages/crouter-plugin/dist/receipts.js +234 -0
- package/packages/crouter-plugin/dist/serve.js +630 -0
- package/packages/crouter-plugin/dist/verify.js +84 -0
- package/packages/crouter-plugin/dist/watchable.js +14 -0
- package/packages/crouter-plugin/package.json +42 -0
- package/runtime.lock.json +14 -13
- package/scripts/sandbox-bootstrap.sh +4 -0
- package/dist/core/graph/repo-sync/index.d.ts +0 -4
- package/dist/core/graph/repo-sync/index.js +0 -1
- package/dist/core/graph/repo-sync/mirror.d.ts +0 -30
- package/dist/core/graph/repo-sync/mirror.js +0 -6
- package/dist/core/graph/repo-sync/sync.d.ts +0 -40
- package/dist/core/graph/repo-sync/sync.js +0 -2
|
@@ -3,6 +3,10 @@ import { type BashJobPaths } from '../../bash-jobs.js';
|
|
|
3
3
|
* launcher. A sandbox broker (`CRTR_API_URL` set) runs on another machine, so it spawns its supervisor itself
|
|
4
4
|
* and reports the job through `report`. */
|
|
5
5
|
export declare function bashJobsUseLauncher(): boolean;
|
|
6
|
+
/** The supervisor's optional notify arguments: the machine daemon's socket, the node and the job, only where a machine daemon runs beside the broker — an
|
|
7
|
+
* install with `machine.json`, i.e. a Mac that is a machine environment. That Mac's brokers also have `CRTR_API_URL` set, so it says nothing about the
|
|
8
|
+
* machine daemon. A sandbox has no `machine.json`, so it passes none and the supervisor skips the notice. */
|
|
9
|
+
export declare function exitNotifyArgs(nodeId: string, jobId: string): string[];
|
|
6
10
|
/** Start the supervisor for a job whose `cmd.sh` and `job.log` are already written.
|
|
7
11
|
* Resolves with the supervisor's process group and its launch-time identity, which
|
|
8
12
|
* lets a later cancellation reject a stale pid; it is not a containment guarantee. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p=Object.defineProperty;var n=(o,r)=>p(o,"name",{value:r,configurable:!0});import{spawn as h}from"node:child_process";import{writeFileSync as s}from"node:fs";import{BASH_JOB_SUPERVISOR_SCRIPT as l}from"../../bash-job-supervisor.js";import{readBashNiceness as j}from"../../bash-jobs.js";import{capturePidIdentities as g}from"../../canvas/pid.js";import{apiSocketPath as S}from"../../canvas/paths.js";import{readMachineConfig as y}from"../../../daemon/machine-link/config.js";import{freshChildNodeExecPath as P}from"../branded-host.js";import{resolveAdmittedHostCommand as I}from"../spawn-env.js";import{brokerApiUrl as w,startBrokerBashJob as x}from"./daemon-ops.js";function B(){return process.platform==="linux"&&w()===void 0}n(B,"bashJobsUseLauncher");function A(o,r){try{if(y()===void 0)return[]}catch{return[]}return[S(),o,r]}n(A,"exitNotifyArgs");async function $(o,r,a,d,c){const u=await P();if(B()){const{pid:e}=await x(o,{job_id:r.jobId,cwd:d,env:c});return{pgid:e,identity:`launcher:${e}`}}const m=I("bash",c,d),t=h(m,["-c",l,"--",r.cmdSh,r.jobLog,r.jobExit,r.jobRun,r.jobDone,m,String(j(a)),u,r.jobActivity,...A(o,r.jobId)],{cwd:d,detached:!0,stdio:"ignore",env:c}),i=await new Promise((e,b)=>{t.once("error",b),t.pid!==void 0&&e(t.pid)});t.unref();const f=g([i])?.get(i);if(f===void 0){try{process.kill(-i,"SIGKILL")}catch{}throw new Error(`bash job ${r.jobId} started without a process identity`)}return s(r.jobPgid,String(i)),s(r.jobPgidIdentity,f),{pgid:i,identity:f}}n($,"launchBashJobSupervisor");export{B as bashJobsUseLauncher,A as exitNotifyArgs,$ as launchBashJobSupervisor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var n=Object.defineProperty;var o=(e,t)=>n(e,"name",{value:t,configurable:!0});import{getNode as m}from"../canvas/index.js";import{openDb as s,withCanvasWrite as c}from"../canvas/db.js";import{readerForNode as l,warmNodeRepos as u}from"../graph/reader.js";import{checkoutsForCwd as f}from"../graph/repo-sync/repos.js";import{deliver as p}from"../substrate/delivery/deliver.js";import{oneShotControllerRequest as v}from"./broker-request.js";import{isBrokerLive as w}from"./model-swap.js";import{CONTEXT_INTRO_CUSTOM_TYPE as d}from"./bearings.js";import{formatCard as y}from"../../shared/generated-context.js";async function T(e,t){const r=await m(e);if(r===null)throw new Error(`deliverCustomMessageLive: unknown node ${e}`);w(r)&&await v({nodeId:e,what:`the ${t.customType} delivery`,ackFor:"deliver_custom_message",frame:o(()=>({type:"deliver_custom_message",customType:t.customType,content:t.content,...t.deliverAs!==void 0?{deliverAs:t.deliverAs}:{},...t.details!==void 0?{details:t.details}:{}}),"frame"),result:o(()=>{},"result")})}o(T,"deliverCustomMessageLive");async function O(e){await u(await s(),e);const{content:t}=await c(async r=>await p(r,await l(r,e,async(i,a)=>await f(r,i,a)),{activity:"boot"}));await T(e,{customType:d,content:y("bearings",{},t),details:{nodeId:e}})}o(O,"deliverBearingsLive");export{O as deliverBearingsLive,T as deliverCustomMessageLive};
|
|
@@ -5,6 +5,7 @@ import type { NodeSummaryDTO } from '../../api/dto/nodes.js';
|
|
|
5
5
|
* here → caller boots a fresh one) or `'aborted'` (the picker was dismissed →
|
|
6
6
|
* caller exits without surprise-booting). */
|
|
7
7
|
export declare function resumeRoot(cwd: string, pick: boolean): Promise<'empty' | 'aborted'>;
|
|
8
|
+
export declare function isResumable(n: NodeSummaryDTO): boolean;
|
|
8
9
|
/** Match `idOrPrefix` against a node list: an exact id, else a unique id prefix.
|
|
9
10
|
* The 8-character short id the pickers and Find node show is the canvas-install
|
|
10
11
|
* stamp every node of this install shares, so a prefix is first narrowed to the
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)}}if(i.length===1)return{node:i[0]};if(r.length>1)return{error:`${n} matches ${r.length} nodes, none of them a running conversation. \`crtr -r\` lists the ones started in this directory.`};const c=r[0];return{error:`${c.node_id} is finished (${c.status}), so there is no running conversation to reopen. Read it with \`crtr node inspect transcript ${c.node_id}\`.`}}
|
|
3
|
-
`),r=e.length-1;let i=0;for(let c=0;c<r;c++){const
|
|
4
|
-
`).map(e=>e.trim()).find(e=>e!=="")??"";return n.length>72?n.slice(0,71)+"\u2026":n}
|
|
5
|
-
${
|
|
1
|
+
var C=Object.defineProperty;var o=(t,n)=>C(t,"name",{value:n,configurable:!0});import{spawn as F}from"node:child_process";import{emitKeypressEvents as I}from"node:readline";import{readFileSync as L}from"node:fs";import{join as S}from"node:path";import{isPidAlive as j}from"../canvas/pid.js";import{contextDir as q}from"../canvas/paths.js";import{installTmuxBindings as B}from"./tmux-chrome.js";import{currentTmux as D,inTmux as W,viewerSplitEnv as H}from"./placement-tmux.js";import{cliClient as h}from"../../commands/api-client.js";import{stdoutColor as $}from"../output.js";import{printComeBackNote as K}from"./come-back-note.js";const g=$.dim,Y=$.bold,b=$.cyan;async function G(t){return(await h().listNodes()).filter(e=>e.parent===null&&e.kind!=="human"&&v(e)&&e.cwd===t).sort((e,r)=>e.created<r.created?1:e.created>r.created?-1:0)}o(G,"listResumableRoots");async function pt(t,n){const e=await G(t);if(e.length===0)return"empty";let r;if(n&&e.length>1){if(r=await et(e,t),r===null)return"aborted"}else r=e[0];return await R(r.node_id),"aborted"}o(pt,"resumeRoot");function v(t){return t.status==="active"||t.status==="idle"||t.status==="done"&&t.intent==="parked"}o(v,"isResumableStatus");function J(t){return t.kind!=="human"&&v(t)}o(J,"isResumable");function U(t,n){const e=t.filter(s=>s.node_id===n),r=e.length>0?e:t.filter(s=>s.node_id.startsWith(n));if(r.length===0)return{none:!0};const i=r.filter(J);if(i.length>1){const s=i.slice(0,8).map(m=>` crtr -r ${m.node_id} ${m.name}`),a=i.length>s.length?[` \u2026 and ${i.length-s.length} more`]:[];return{error:[`${n} matches ${i.length} conversations \u2014 use the full id of one:`,...s,...a].join(`
|
|
2
|
+
`)}}if(i.length===1)return{node:i[0]};if(r.length>1)return{error:`${n} matches ${r.length} nodes, none of them a running conversation. \`crtr -r\` lists the ones started in this directory.`};const c=r[0];return{error:`${c.node_id} is finished (${c.status}), so there is no running conversation to reopen. Read it with \`crtr node inspect transcript ${c.node_id}\`.`}}o(U,"matchResumeTarget");function gt(t){return`No conversation matches ${t}. \`crtr -r\` lists the ones started in this directory; \`crtr\` then Alt+C \u2192 Find node searches all of them.`}o(gt,"noResumeTargetMessage");async function wt(t){return U(await h().listNodes(),t)}o(wt,"resolveResumeTarget");async function $t(t){return R(t)}o($t,"resumeNodeById");async function R(t){if(!W())throw new Error("crtr must be resumed from inside a tmux session \u2014 start tmux first (e.g. `tmux new -s work`), then run `crtr -c` there.");try{B()}catch{}const n=D();if(n!==null){try{const c=await h().focusOf(t);if(c!==null)try{await h().closeFocus(c.focus_id)}catch{}}catch{}try{await h().registerFocus({node_id:t,pane:n.pane,session:n.session,window:n.window})}catch{}}const e={...process.env,...H(),CRTR_ATTACH_WAIT_MS:"30000"},r=F("crtr",["surface","attach","to",t],{stdio:"inherit",env:e}),i=await new Promise(c=>{r.once("exit",s=>c(s??0)),r.once("error",()=>c(1))});await K(t,i),process.exit(i)}o(R,"attachInline");const z=b("\u25B8"),_=o(t=>t>0?`\x1B[${t}A\r`:"","cursorUp"),x="\x1B[0J",T=/\u001b\[[0-9;]*m/g;function P(t){const n=process.stdout.columns??80,e=t.split(`
|
|
3
|
+
`),r=e.length-1;let i=0;for(let c=0;c<r;c++){const s=e[c].replace(T,"").length;n>0&&s>n&&(i+=Math.ceil(s/n)-1)}return r+i}o(P,"blockRows");function Q(t,n){if(n<=0)return t;let e="",r=0;for(let i=0;i<t.length;){if(t[i]==="\x1B"){const c=/^\u001b\[[0-9;]*m/.exec(t.slice(i));if(c!==null){e+=c[0],i+=c[0].length;continue}}if(r>=n-1&&t.replace(T,"").length>n){e+="\u2026";break}e+=t[i],r++,i++}return e}o(Q,"fitWidth");function V(t){const n=j(t.pi_pid??null)?b("\u25CF live"):g("\u25CB dormant");let e=t.name;if(e===t.kind){const r=Z(X(t.node_id));r!==""&&(e=r)}return`${e} ${n}`}o(V,"label");function X(t){try{return L(S(q(t),"initial-prompt.md"),"utf8")}catch{return null}}o(X,"readGoalBody");function Z(t){if(t===null)return"";const n=t.split(`
|
|
4
|
+
`).map(e=>e.trim()).find(e=>e!=="")??"";return n.length>72?n.slice(0,71)+"\u2026":n}o(Z,"firstLine");function O(t,n){const e=tt(t.created),r=t.cwd===n?"":` ${t.cwd}`;return`${e}${r} ${t.node_id.slice(0,8)}`}o(O,"detail");function tt(t){const n=Date.now()-new Date(t).getTime();if(!Number.isFinite(n)||n<0)return"";const e=Math.floor(n/6e4);if(e<1)return"just now";if(e<60)return`${e}m ago`;const r=Math.floor(e/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}o(tt,"ago");function et(t,n){const e="Resume a session here",r=`${t.length} roots pinned to ${n}`;return new Promise(i=>{const c=process.stdout,s=process.stdin;let a=0,m=0;const k=o(()=>{const f=process.stdout.columns??80;let d=`
|
|
5
|
+
${Y(e)}
|
|
6
6
|
${g(r)}
|
|
7
7
|
|
|
8
|
-
`;return t.forEach((u,l)=>{const
|
|
8
|
+
`;return t.forEach((u,l)=>{const M=l===a?z:" ",A=l<9?nt(`${l+1}`):" ",E=` ${M} ${A} ${V(u)} ${g(O(u,n))}`;d+=Q(E,f)+`
|
|
9
9
|
`}),d+=`
|
|
10
10
|
${g("\u2191/\u2193 move enter resume q quit")}
|
|
11
|
-
`,d},"render"),w=
|
|
11
|
+
`,d},"render"),w=o(()=>{const f=k();c.write((m>0?_(m)+x:"")+f),m=P(f)},"draw");I(s);const N=s.isRaw??!1;s.isTTY&&s.setRawMode(!0),s.resume();const p=o(f=>{s.removeListener("keypress",y),s.isTTY&&s.setRawMode(N),s.pause(),c.write(_(m)+x),i(f)},"finish"),y=o((f,d)=>{const u=d.name??"";if(d.ctrl&&u==="c"&&(p(null),process.exit(130)),u==="q"||u==="escape")return p(null);if(u==="up"||u==="k")return a=(a-1+t.length)%t.length,w();if(u==="down"||u==="j")return a=(a+1)%t.length,w();if(u==="return"||u==="enter")return p(t[a]);const l=Number.parseInt(d.sequence??"",10);if(Number.isInteger(l)&&l>=1&&l<=Math.min(9,t.length))return a=l-1,p(t[a])},"onKey");s.on("keypress",y),w()})}o(et,"pickRoot");function nt(t){return b(t)}o(nt,"key");export{J as isResumable,U as matchResumeTarget,gt as noResumeTargetMessage,wt as resolveResumeTarget,$t as resumeNodeById,pt as resumeRoot};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var $=Object.defineProperty;var i=(n,a)=>$(n,"name",{value:a,configurable:!0});import{openDb as k}from"../../../canvas/db.js";import{mintExecutionToken as S}from"../../../canvas/node-tokens.js";import{BlaxelApiError as
|
|
1
|
+
var $=Object.defineProperty;var i=(n,a)=>$(n,"name",{value:a,configurable:!0});import{openDb as k}from"../../../canvas/db.js";import{mintExecutionToken as S}from"../../../canvas/node-tokens.js";import{BlaxelApiError as T,isWorkloadUnavailable as m}from"./client.js";const f=4180,w="view",I="node /opt/crtr/current/scripts/sandbox-start.mjs --wake",y=3,C=/^crtr-sandbox-start: failed (\S+)/m,h=2e3,p=i(n=>`broker-${n}`,"brokerProcessName"),d=i(n=>n.sandboxName??`${n.nodeId}-${n.attempt}`,"sandboxNameFor");async function A(n){const a=await(await k()).prepare("SELECT execution_id, attempt, sandbox_name FROM executions WHERE node_id = ? AND runner = 'blaxel'").all(n);return[...new Set(a.map(c=>d({executionId:c.execution_id,nodeId:n,attempt:Number(c.attempt),sandboxName:c.sandbox_name})))]}i(A,"defaultSandboxNames");function N(n){const a=`${n.logs}
|
|
2
2
|
${n.stderr}
|
|
3
|
-
${n.stdout}
|
|
3
|
+
${n.stdout}`,c=(n.stderr||n.logs||n.stdout||"").trim().slice(-h);return{state:"failed",reason:C.exec(a)?.[1]??"start_failed",code:n.exitCode,...c===""?{}:{output:c}}}i(N,"failureOf");function L(n){const{client:a}=n,c=(n.stopGraceS??10)*1e3,E=new Map;async function u(t){return await a.getSandbox(d(t))}i(u,"sandboxOf");async function g(t,r){if(!/^[A-Za-z0-9_-]+$/.test(r))throw new Error(`execution id ${JSON.stringify(r)} is not safe to name in a command`);const e=Math.max(1,Math.ceil(c/1e3)),o=`p='[b]roker-cli\\.js .*--epoch ${r}( |$)'; pkill -TERM -f "$p"; i=0; while pgrep -f "$p" >/dev/null && [ $i -lt ${e*5} ]; do sleep 0.2; i=$((i+1)); done; pkill -KILL -f "$p"; sleep 0.3; ! pgrep -f "$p"`;return(await a.exec(t,`stop-${r}-${Date.now()}`,o,e+20)).exitCode===0}return i(g,"brokerGone"),{kind:"blaxel",async start(t){const r=await n.launchContext(t),e=d(t),o=await a.createSandbox({name:e,image:r.image,memoryMb:r.memoryMb,ports:[{name:w,target:f}]}),s=p(t.executionId);if((await a.getProcess(o,s))?.status==="running")return{pid:null,exited:null};await a.ensurePreview(e,w,f);const x=await(n.mintToken??(b=>S(b.executionId,b.nodeId)))(t),R={...r.secrets,CRTR_API_URL:r.apiUrl,CRTR_EXECUTION_ID:t.executionId,CRTR_NODE_TOKEN:x,CRTR_RELEASE:t.release,CRTR_RELEASE_URL:r.releaseUrl,CRTR_RELEASE_SHA256:r.releaseSha256};return await a.startProcess(o,{name:s,command:n.bootstrap(),env:R,waitForCompletion:!1}),{pid:null,exited:null}},async wake(t){const r=await u(t);if(r===null)return"no_broker";try{const e=await a.exec(r,`wake-${t.executionId}-${Date.now()}`,`${I} ${t.executionId}`,30);if(e.exitCode===0)return"signalled";if(e.exitCode===y)return"no_broker";throw new Error(`wake of ${t.executionId} failed (exit ${e.exitCode}): ${(e.stderr||e.logs).slice(0,300)}`)}catch(e){if(m(e))return"no_broker";throw e}},async stop(t,r){try{const e=await u(t);if(e===null)return{confirmed:!0};const o=p(t.executionId),s=i(async()=>(await a.getProcess(e,o))?.status==="running","running");if(await s()){await a.stopProcess(e,o);const l=Date.now()+c;for(;Date.now()<l&&await s();)await new Promise(x=>setTimeout(x,250));if(await s()&&await a.killProcess(e,o),await s())return{confirmed:!1}}return{confirmed:await g(e,t.executionId)}}catch(e){return m(e)?{confirmed:!0}:{confirmed:!1,error:e instanceof Error?e:new Error(String(e))}}},async status(t,r){try{const e=await u(t);if(e===null)return{state:"gone"};if(r?.idle===!0)return{state:"running",pid:null};const o=await a.getProcess(e,p(t.executionId));return o===null?{state:"gone"}:o.status==="running"?{state:"running",pid:null}:o.status==="failed"||o.status==="completed"&&o.exitCode!==0?N(o):{state:"gone"}}catch(e){return m(e)?{state:"gone"}:{state:"unknown",error:e instanceof Error?e.message:String(e)}}},async delete(t){for(const r of await(n.sandboxNamesForNode??A)(t))await a.deleteSandbox(r)},async deleteExecution(t){await a.deleteSandbox(d(t))},async viewerAddress(t){const r=d(t),e=E.get(r);if(e&&e.expiresAt-Date.now()>5*6e4)return _(e.url,e.token);const o=await a.ensurePreview(r,w,f),s=new Date(Date.now()+60*6e4),{token:l}=await a.createPreviewToken(r,w,s);return E.set(r,{url:o,token:l,expiresAt:s.getTime()}),_(o,l)},async sandboxState(t){return(await u(t))?.state??null}}}i(L,"createBlaxelRunner");function _(n,a){return{kind:"wss",url:`${n.replace(/^https:/,"wss:")}/view`,headers:{"x-blaxel-preview-token":a}}}i(_,"viewer");export{f as BROKER_VIEW_PORT,T as BlaxelApiError,y as EXIT_NO_BROKER,C as FAILURE_LINE,I as WAKE_COMMAND,p as brokerProcessName,L as createBlaxelRunner,d as sandboxNameFor};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var S=Object.defineProperty;var o=(e,n)=>S(e,"name",{value:n,configurable:!0});import{randomUUID as g}from"node:crypto";import{openDb as E,withCanvasWrite as N}from"../../../canvas/db.js";import{brokerSignalBus as k}from"../../../../daemon/broker-signals/bus.js";import{MachineCallFailedError as O,MachineLostError as _,MachineOfflineError as d}from"./ops.js";const D={start:60,wake:15,stop:15,status:15,"status.all":15,delete:15,viewer:15,"cron.run":15,"cron.cancel":15,"worktree.create":60,"worktree.rollback":60,"worktree.close":60,"worktree.abandon":60,"worktree.finalize":60},M=1e3;async function x(e,n,
|
|
1
|
+
var S=Object.defineProperty;var o=(e,n)=>S(e,"name",{value:n,configurable:!0});import{randomUUID as g}from"node:crypto";import{openDb as E,withCanvasWrite as N}from"../../../canvas/db.js";import{brokerSignalBus as k}from"../../../../daemon/broker-signals/bus.js";import{MachineCallFailedError as O,MachineLostError as _,MachineOfflineError as d}from"./ops.js";const D={start:60,wake:15,stop:15,status:15,"status.all":15,delete:15,viewer:15,"cron.run":15,"cron.cancel":15,"worktree.create":60,"worktree.rollback":60,"worktree.close":60,"worktree.abandon":60,"worktree.finalize":60,"repo.identify":15},M=1e3;async function x(e,n,t,l={}){const s=g(),c=new Date().toISOString();if(!await N(async r=>await r.prepare("SELECT 1 AS live FROM machine_links WHERE environment = ? AND lease_expires_at > ?").get(e,c)===void 0?!1:(await r.prepare("INSERT INTO machine_calls (call_id, environment, op, args_json, created_at) VALUES (?, ?, ?, ?, ?)").run(s,e,n,JSON.stringify(t),c),await r.prepare("SELECT pg_notify(?, ?)").get("crtr_signal",`machine:${e}`),!0)))throw new d(e,"no live link");const i=Date.now()+(l.timeoutMs??D[n]*1e3);let u,f=!1;const h=await k.subscribe(r=>{r===s&&(f=!0,u?.())},{kinds:["machine_call"]});try{return await T(e,n,s,i,l.rereadMs??M,r=>new Promise(w=>{if(f){f=!1,w();return}const p=setTimeout(()=>{u=void 0,w()},r);u=o(()=>{clearTimeout(p),u=void 0,f=!1,w()},"wake")}))}finally{h()}}o(x,"callMachine");async function T(e,n,t,l,s,c){for(;;){const a=await(await E()).prepare("SELECT state, result_json, lease_expires_at, claimed_generation FROM machine_calls WHERE call_id = ?").get(t);if(a===void 0)throw new _(e,t);if(a.state==="done")return a.result_json===null?null:JSON.parse(a.result_json);if(a.state==="failed"){const i=a.result_json===null?{}:JSON.parse(a.result_json);throw i.code==="machine_offline"?new d(e,i.message,i.sent===!0):i.code==="machine_lost"?new _(e,t):new O(e,n,i.message??"unknown")}if(a.claimed_generation!==null&&a.lease_expires_at!==null&&a.lease_expires_at<=new Date().toISOString()){if(await m(t,"lease expired")===void 0)continue;throw new _(e,t)}if(Date.now()>=l){const i=await m(t,"timed out");if(i===void 0)continue;throw i===null?new d(e,"no holder claimed the call"):new _(e,t)}await c(Math.min(s,Math.max(0,l-Date.now())))}}o(T,"waitForCall");async function m(e,n){const t=await(await E()).prepare(`UPDATE machine_calls SET state = 'failed', finished_at = ?,
|
|
2
2
|
result_json = CASE WHEN claimed_generation IS NULL THEN ? ELSE ? END
|
|
3
|
-
WHERE call_id = ? AND state IN ('pending', 'sent') RETURNING claimed_generation`).get(new Date().toISOString(),JSON.stringify({code:"machine_offline",message:n,sent:!1}),JSON.stringify({code:"machine_lost",message:n}),e);return
|
|
3
|
+
WHERE call_id = ? AND state IN ('pending', 'sent') RETURNING claimed_generation`).get(new Date().toISOString(),JSON.stringify({code:"machine_offline",message:n,sent:!1}),JSON.stringify({code:"machine_lost",message:n}),e);return t===void 0?void 0:t.claimed_generation===null?null:Number(t.claimed_generation)}o(m,"failOpenCall");export{D as MACHINE_CALL_TIMEOUT_S,x as callMachine};
|
|
@@ -45,5 +45,5 @@ export declare function machineBrokerEnv(bundle: StartBundleDTO, deps: Pick<Mach
|
|
|
45
45
|
* SIGKILL, so the caller never reports stopped while something of this home may still run. */
|
|
46
46
|
export declare function stopAllBrokers(graceMs?: number): Promise<void>;
|
|
47
47
|
export declare function createMachineExecutor(deps: MachineExecutorDeps): {
|
|
48
|
-
[O in Exclude<keyof MachineOpTable, 'cron.run' | 'cron.cancel' | `worktree.${string}
|
|
48
|
+
[O in Exclude<keyof MachineOpTable, 'cron.run' | 'cron.cancel' | `worktree.${string}` | 'repo.identify'>]: (args: MachineOpTable[O]['args'], signal?: AbortSignal) => Promise<MachineOpTable[O]['result']>;
|
|
49
49
|
};
|
|
@@ -2,8 +2,9 @@ import type { ManagedWorktree } from '../../../canvas/types.js';
|
|
|
2
2
|
import type { AutoDroppedWorktree, AbandonManagedWorktreeResult } from '../../../worktree.js';
|
|
3
3
|
import type { CloseOnHostOutcome } from '../../../worktree-close.js';
|
|
4
4
|
import type { AbandonOutcome, FinalizeWorktreeOutcome } from '../../../worktree-mutation-async.js';
|
|
5
|
+
import type { CheckoutChainEntry } from '../../../graph/repo-sync/identity.js';
|
|
5
6
|
import type { RunnerExecution, RunnerStartInput, RunnerStatus, RunnerStopOptions, RunnerStopResult, RunnerViewerAddress, RunnerWakeResult } from '../types.js';
|
|
6
|
-
export declare const MACHINE_OPS: readonly ["start", "wake", "stop", "status", "status.all", "delete", "viewer", "cron.run", "cron.cancel", "worktree.create", "worktree.rollback", "worktree.close", "worktree.abandon", "worktree.finalize"];
|
|
7
|
+
export declare const MACHINE_OPS: readonly ["start", "wake", "stop", "status", "status.all", "delete", "viewer", "cron.run", "cron.cancel", "worktree.create", "worktree.rollback", "worktree.close", "worktree.abandon", "worktree.finalize", "repo.identify"];
|
|
7
8
|
export type MachineOp = (typeof MACHINE_OPS)[number];
|
|
8
9
|
/** A `start` call carries the whole start input and the node token the control plane minted: the Mac has no database, so it cannot mint one.
|
|
9
10
|
* The token sits in `machine_calls.args_json` until the row is deleted a day after it finishes; the execution's token row holds its hash. */
|
|
@@ -108,6 +109,11 @@ export interface MachineWorktreeFinalizeArgs {
|
|
|
108
109
|
worktree: ManagedWorktree;
|
|
109
110
|
}
|
|
110
111
|
export type { AutoDroppedWorktree, AbandonManagedWorktreeResult };
|
|
112
|
+
/** The Mac's git lookup for each directory: the enclosing checkouts, innermost first. A directory in no repo, or whose lookup failed, answers `[]`. */
|
|
113
|
+
export interface MachineRepoIdentifyArgs {
|
|
114
|
+
dirs: string[];
|
|
115
|
+
}
|
|
116
|
+
export type MachineRepoIdentifyResult = Record<string, CheckoutChainEntry[]>;
|
|
111
117
|
export interface MachineOpTable {
|
|
112
118
|
start: {
|
|
113
119
|
args: MachineStartArgs;
|
|
@@ -167,6 +173,10 @@ export interface MachineOpTable {
|
|
|
167
173
|
args: MachineWorktreeFinalizeArgs;
|
|
168
174
|
result: MachineWorktreeAnswer<FinalizeWorktreeOutcome>;
|
|
169
175
|
};
|
|
176
|
+
'repo.identify': {
|
|
177
|
+
args: MachineRepoIdentifyArgs;
|
|
178
|
+
result: MachineRepoIdentifyResult;
|
|
179
|
+
};
|
|
170
180
|
}
|
|
171
181
|
/** No live link row for the environment: the caller leaves its work pending and retries on its own backoff. */
|
|
172
182
|
export declare class MachineOfflineError extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var s=Object.defineProperty;var n=(t,e)=>s(t,"name",{value:e,configurable:!0});const i=["start","wake","stop","status","status.all","delete","viewer","cron.run","cron.cancel","worktree.create","worktree.rollback","worktree.close","worktree.abandon","worktree.finalize"];class c extends Error{static{n(this,"MachineOfflineError")}environmentId;sent;code="machine_offline";constructor(e,r,o=!1){super(`machine ${e} is offline${r?`: ${r}`:""}`),this.environmentId=e,this.sent=o}}class l extends c{static{n(this,"MachineLaunchUncertainError")}uncertain=!0;constructor(e,r){super(e,r,!0)}}class h extends Error{static{n(this,"MachineLostError")}environmentId;callId;code="machine_lost";constructor(e,r){super(`call ${r} to machine ${e} was lost`),this.environmentId=e,this.callId=r}}class d extends Error{static{n(this,"MachineCallFailedError")}environmentId;op;code="machine_call_failed";constructor(e,r,o){super(`${r} on machine ${e} failed: ${o}`),this.environmentId=e,this.op=r}}export{i as MACHINE_OPS,d as MachineCallFailedError,l as MachineLaunchUncertainError,h as MachineLostError,c as MachineOfflineError};
|
|
1
|
+
var s=Object.defineProperty;var n=(t,e)=>s(t,"name",{value:e,configurable:!0});const i=["start","wake","stop","status","status.all","delete","viewer","cron.run","cron.cancel","worktree.create","worktree.rollback","worktree.close","worktree.abandon","worktree.finalize","repo.identify"];class c extends Error{static{n(this,"MachineOfflineError")}environmentId;sent;code="machine_offline";constructor(e,r,o=!1){super(`machine ${e} is offline${r?`: ${r}`:""}`),this.environmentId=e,this.sent=o}}class l extends c{static{n(this,"MachineLaunchUncertainError")}uncertain=!0;constructor(e,r){super(e,r,!0)}}class h extends Error{static{n(this,"MachineLostError")}environmentId;callId;code="machine_lost";constructor(e,r){super(`call ${r} to machine ${e} was lost`),this.environmentId=e,this.callId=r}}class d extends Error{static{n(this,"MachineCallFailedError")}environmentId;op;code="machine_call_failed";constructor(e,r,o){super(`${r} on machine ${e} failed: ${o}`),this.environmentId=e,this.op=r}}export{i as MACHINE_OPS,d as MachineCallFailedError,l as MachineLaunchUncertainError,h as MachineLostError,c as MachineOfflineError};
|
|
@@ -43,7 +43,8 @@ export type RunnerStatus = {
|
|
|
43
43
|
| {
|
|
44
44
|
state: 'failed';
|
|
45
45
|
reason: string;
|
|
46
|
-
code: number | null;
|
|
46
|
+
code: number | null; /** The tail of the process's stderr (or its log), so a failure with no `crtr-sandbox-start: failed` line of its own still says why. */
|
|
47
|
+
output?: string;
|
|
47
48
|
}
|
|
48
49
|
/** The runner could not tell (a Blaxel API error). The caller leaves everything as it is and retries on the next claim. */
|
|
49
50
|
| {
|
package/dist/core/scope.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var D=Object.defineProperty;var
|
|
1
|
+
var D=Object.defineProperty;var t=(o,r)=>D(o,"name",{value:r,configurable:!0});import{envProfileId as $,isSandboxedNode as S}from"../shared/env.js";import{projectPaths as g}from"../api/dto/profiles.js";import{homedir as j}from"node:os";import{existsSync as k,statSync as M}from"node:fs";import{join as n,resolve as a,dirname as C,sep as h}from"node:path";import{CRTR_DIR_NAME as p}from"../types.js";import{assetRoot as P}from"./asset-root.js";import{usage as b}from"./errors.js";import{loadProfileManifest as N}from"./profiles/manifest.js";import{realpathOrSelf as i}from"./fs-utils.js";import{appsRoot as W,layoutRoot as _,runtimeRoot as x}from"./layout.js";function X(){return n(P(),"builtin-memory")}t(X,"builtinMemoryRoot");function q(){return n(P(),"builtin-pi-packages")}t(q,"builtinPiPackagesDir");function Y(o){return n(q(),o)}t(Y,"builtinPiPackageDir");function d(){return n(x(),"scope")}t(d,"userScopeRoot");function A(o,r){if(!k(o)||i(o)===i(n(j(),p))||i(o).startsWith(`${i(W())}${h}`)&&o.endsWith(`${h}home${h}${p}`)||!S()&&(i(o)===i(r)||i(o)===i(_())))return!1;try{return M(o).isDirectory()}catch{return!1}}t(A,"isProjectScopeDir");function y(o=process.cwd()){return v(o)[0]??null}t(y,"findProjectScopeRoot");function E(o,r){const e=[],f=i(j());let u=a(o);for(;;){const s=n(u,p);if(A(s,r)&&e.push(s),i(u)===f)return e;const c=C(u);if(c===u)return e;u=c}}t(E,"collectAncestorScopeRoots");function v(o=process.cwd(),r=$()||null){return L(o,r)}t(v,"findProjectScopeRoots");function L(o,r){const e=a(o),f=d(),u=[e];if(!S()&&r!==null&&r!=="")try{const{manifest:l}=N(r);u.push(...g(l.projects))}catch{}const s=new Set,c=[];for(const l of u)for(const m of E(l,f))s.has(m)||(s.add(m),c.push(m));return c}t(L,"resolveProjectScopeRoots");function w(o){return y(o)}t(w,"projectScopeRoot");function Z(o,r){return v(o,r)}t(Z,"projectScopeRoots");function R(o){return o==="builtin"?null:o==="user"?d():w()}t(R,"scopeRoot");function oo(o){const r=R(o);if(!r)throw b(`no ${o} scope available \u2014 run \`crtr init\` here or use --scope user`);return r}t(oo,"requireScopeRoot");function ro(o=process.cwd()){const r=y(o);return r||n(a(o),p)}t(ro,"ensureProjectScopeRoot");function to(o){const r=o==="user"?x():R(o);return r?n(r,"plugins"):null}t(to,"pluginsDir");function eo(o){const r=o==="user"?x():R(o);return r?n(r,"marketplaces"):null}t(eo,"marketplacesDir");function no(o){return n(o.root,"memory")}t(no,"pluginMemoryDir");function O(o){if(o===void 0)return"all";const r=o.toLowerCase();if(r==="user"||r==="project"||r==="builtin"||r==="all")return r;throw b(`invalid --scope: ${o} (expected user|project|builtin|all)`)}t(O,"resolveScopeArg");function io(o){const r=O(o);if(r==="all"){const e=[];return w()&&e.push("project"),e.push("user"),e.push("builtin"),e}return[r]}t(io,"listScopes");export{X as builtinMemoryRoot,Y as builtinPiPackageDir,q as builtinPiPackagesDir,ro as ensureProjectScopeRoot,y as findProjectScopeRoot,v as findProjectScopeRoots,io as listScopes,eo as marketplacesDir,no as pluginMemoryDir,to as pluginsDir,w as projectScopeRoot,Z as projectScopeRoots,oo as requireScopeRoot,O as resolveScopeArg,R as scopeRoot,d as userScopeRoot};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
ALTER TABLE profile_projects DROP COLUMN memory;`),e.exec(`PRAGMA user_version = ${p}`)),c(e)===p&&!
|
|
1
|
+
var P=Object.defineProperty;var i=(e,o)=>P(e,"name",{value:o,configurable:!0});import{DatabaseSync as f}from"node:sqlite";import{forgetPrepared as I}from"../sqlite-statements.js";import{chmodSync as m,existsSync as a,mkdirSync as _,readdirSync as C,rmSync as j,statSync as v,writeFileSync as D}from"node:fs";import{join as n}from"node:path";import k from"proper-lockfile";import{CONFIG_FILE as y,PROFILE_DIR as G,STATE_FILE as l}from"../../types.js";import{withExclusiveDirectoryLock as L}from"../exclusive-lock.js";import{syncDirectory as $,syncFile as g}from"../fs-utils.js";import{layoutNeedsMigration as U}from"../layout.js";import{providerStore as F,projectStore as B,userStore as X}from"./paths.js";import{createScopedSchema as H,ensureProviderModelCooldowns as K,PROFILE_ENVIRONMENT_COLUMN as R,PROFILE_PROJECT_REPO_COLUMN as A,PROVIDER_SCHEMA_VERSION as S,SCOPED_SCHEMA_VERSION as p}from"./schema.js";const u=new Map,z=/^[a-z0-9]+(?:-[a-z0-9]+)*-[0-9a-f]{8}$/;function Q(e,o,r){e.prepare("UPDATE scope_owners SET root=? WHERE owner_key=?").run(r,o)}i(Q,"writeOwnerRoot");function c(e){return Number(e.prepare("PRAGMA user_version").get().user_version)}i(c,"version");function M(e,o){const r=c(e);if(r===0)throw new Error(`scoped SQL store is uninitialized: ${o.path}; crtr was updated and \`crtr sys daemon restart\` converts local state`);const t=o.kind==="provider"?S:p;if(r>t)throw new Error(`scoped SQL store ${o.path} uses unsupported schema version ${r}`);if(r!==t)throw new Error(`scoped SQL store ${o.path} requires an explicit conversion`)}i(M,"assertVersion");function w(e){return e.prepare("PRAGMA table_info(profiles)").all().some(({name:o})=>o===R)}i(w,"profilesHaveEnvironmentColumn");function x(e,o,r){return e.prepare(`PRAGMA table_info(${o})`).all().some(({name:t})=>t===r)}i(x,"hasColumn");function V(e){x(e,"profile_projects",A)||e.exec(`ALTER TABLE profile_projects ADD COLUMN ${A} TEXT`),e.exec("CREATE TABLE IF NOT EXISTS profile_project_repos (profile_id TEXT NOT NULL REFERENCES profiles(id) ON DELETE CASCADE, repo TEXT NOT NULL, position INTEGER NOT NULL, PRIMARY KEY(profile_id,repo))")}i(V,"addProfileProjectRepos");function O(e,o){if(o.kind==="provider"){c(e)===S&&(e.exec("PRAGMA busy_timeout = 5000"),K(e));return}if(!(c(e)>p)&&(e.exec("PRAGMA busy_timeout = 5000"),!(c(e)===p&&w(e)&&x(e,"profile_projects",A)))){e.exec("BEGIN IMMEDIATE");try{c(e)===1&&(e.prepare("PRAGMA table_info(profiles)").all().some(({name:t})=>t==="grantee")||e.exec("ALTER TABLE profiles ADD COLUMN grantee TEXT"),e.exec("PRAGMA user_version = 2")),c(e)===2&&(e.prepare("PRAGMA table_info(profiles)").all().some(({name:t})=>t==="home")&&e.exec("ALTER TABLE profiles DROP COLUMN home"),e.exec("PRAGMA user_version = 3")),c(e)===3&&(e.exec("ALTER TABLE profiles ADD COLUMN delivery_limits_json TEXT NOT NULL DEFAULT '{}' CHECK(json_valid(delivery_limits_json))"),e.exec("PRAGMA user_version = 4")),c(e)===4&&(e.exec("CREATE TABLE IF NOT EXISTS legacy_project_caps (profile_id TEXT NOT NULL, path TEXT NOT NULL, memory TEXT NOT NULL CHECK(memory IN ('none','name','preview')), PRIMARY KEY(profile_id,path))"),e.prepare("PRAGMA table_info(profile_projects)").all().some(({name:t})=>t==="memory")&&e.exec(`INSERT INTO legacy_project_caps SELECT profile_id, path, memory FROM profile_projects WHERE memory != 'content';
|
|
2
|
+
ALTER TABLE profile_projects DROP COLUMN memory;`),e.exec(`PRAGMA user_version = ${p}`)),c(e)===p&&!w(e)&&e.exec(`ALTER TABLE profiles ADD COLUMN ${R} TEXT`),c(e)===p&&V(e),e.exec("COMMIT")}catch(r){throw e.exec("ROLLBACK"),r}}}i(O,"upgradeScopedStore");function ue(e){const o=new f(e.path);try{O(o,e),M(o,e)}finally{o.close()}}i(ue,"assertScopedStoreReady");function W(e){if(!N(e))return;const o=new f(e.path,{readOnly:!0});let r;try{r=c(o)}finally{o.close()}if(r===0)for(const t of[e.path,`${e.path}-wal`,`${e.path}-shm`])j(t,{force:!0})}i(W,"discardIncompleteScopedStore");function Y(e,o){return L(n(e,".init.lock"),()=>{const r=n(e,l),t=Date.now()+5e3;let s=10;for(;;){let h;try{h=k.lockSync(r,{realpath:!1,retries:0,stale:3e4,update:1e4})}catch(E){if(E.code!=="ELOCKED")throw E;const T=t-Date.now();if(T<=0)throw new Error(`timed out waiting for project state conversion lock: ${r}`,{cause:E});Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,Math.min(s,T)),s=Math.min(s*2,250);continue}try{return o()}finally{h()}}})}i(Y,"withProjectStateLock");function d(e){a(e)&&m(e,384);for(const o of["-wal","-shm"])a(`${e}${o}`)&&m(`${e}${o}`,384)}i(d,"secure");function N(e){return a(e.path)}i(N,"scopedStoreExists");function q(e){if(e.kind==="project")return[n(e.root,l)];if(e.kind==="provider")return[n(e.root,"anthropic-subscriptions.json"),n(e.root,"openai-codex-subscriptions.json"),n(e.root,"provider-rotation.json")];const o=[n(e.root,y),n(e.root,l),n(e.root,"profile-defaults.json")],r=n(e.root,G);if(a(r))for(const t of C(r,{withFileTypes:!0}))t.isDirectory()&&z.test(t.name)&&o.push(n(r,t.name,"profile.json"),n(r,t.name,y),n(r,t.name,l));return o}i(q,"legacyScopedStorePaths");function J(e){const o=e.kind==="user"?X(e.root):e.kind==="project"?B(e.root):F(e.root);o.kind!=="project"&&_(o.root,{recursive:!0,mode:448});const r=i(()=>{if(o.kind==="project"&&W(o),N(o))return;const t=q(o).find(a);if(t!==void 0)throw new Error(`legacy scoped state exists at ${t}; crtr was updated and \`crtr sys daemon restart\` converts local state`);b(o,s=>{H(s,o.kind),o.kind!=="provider"&&Q(s,o.kind,o.root)})},"initialize");o.kind==="project"?Y(o.root,r):L(n(o.root,".init.lock"),r)}i(J,"initializeFreshScopedStore");function Z(e){if(U())throw new Error("layout_migration_required");const o=u.get(e.path);if(o!==void 0)return o;J(e);const r=new f(e.path);try{return r.exec("PRAGMA busy_timeout = 5000; PRAGMA journal_mode = WAL; PRAGMA foreign_keys = ON;"),O(r,e),M(r,e),d(e.path),u.set(e.path,r),r}catch(t){throw r.close(),t}}i(Z,"openScopedStore");function b(e,o){if(a(e.path))throw new Error(`scoped SQL store already exists: ${e.path}`);if(e.kind!=="project"&&_(e.root,{recursive:!0,mode:448}),!v(e.root).isDirectory())throw new Error(`scoped SQL root is not a directory: ${e.root}`);(e.kind!=="project"||process.platform!=="linux")&&m(e.root,448),D(e.path,"",{mode:384});const r=new f(e.path);try{r.exec("PRAGMA busy_timeout = 5000; PRAGMA journal_mode = WAL; PRAGMA foreign_keys = ON; BEGIN IMMEDIATE;"),o(r),r.exec("COMMIT")}catch(t){try{r.exec("ROLLBACK")}catch{}throw t}finally{d(e.path),r.close()}g(e.path),$(e.root)}i(b,"createScopedStore");function Ee(e,o){const r=Z(e);if(r.isTransaction)return o(r);r.exec("BEGIN IMMEDIATE");try{const t=o(r);return r.exec("COMMIT"),d(e.path),t}catch(t){try{r.exec("ROLLBACK")}catch{}throw t}}i(Ee,"withScopedWrite");function me(){for(const e of u.values())I(e),e.close();u.clear()}i(me,"closeScopedStores");export{z as PROFILE_ID_SHAPE,ue as assertScopedStoreReady,me as closeScopedStores,b as createScopedStore,W as discardIncompleteScopedStore,J as initializeFreshScopedStore,q as legacyScopedStorePaths,Z as openScopedStore,N as scopedStoreExists,Y as withProjectStateLock,Ee as withScopedWrite,Q as writeOwnerRoot};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
var y=Object.defineProperty;var
|
|
1
|
+
var y=Object.defineProperty;var n=(r,a)=>y(r,"name",{value:a,configurable:!0});import{prepared as o}from"../sqlite-statements.js";import{userStore as i}from"./paths.js";import{openScopedStore as u,scopedStoreExists as _,withScopedWrite as R}from"./db.js";function L(r){const a=i(r);if(!_(a))return null;const t=u(a),m=t.prepare("PRAGMA table_info(profile_projects)").all().some(({name:e})=>e==="repo")?t.prepare(`SELECT profile_id, path, repo, position FROM (SELECT profile_id, path, repo, position FROM profile_projects
|
|
2
|
+
UNION ALL SELECT profile_id, NULL, repo, position FROM profile_project_repos) ORDER BY profile_id, position`).all():t.prepare("SELECT profile_id, path, NULL AS repo, position FROM profile_projects ORDER BY profile_id, position").all(),E=o(t,"SELECT id, name, created_at, last_used_at, paused_at, default_kind, grantee, metadata_json, delivery_limits_json, environment_id FROM profiles ORDER BY rowid").all().map(e=>{const p=JSON.parse(e.metadata_json),f=JSON.parse(e.delivery_limits_json);return{profileId:e.id,manifest:{schema_version:1,name:e.name,projects:m.filter(s=>s.profile_id===e.id).map(s=>({...s.repo===null?{}:{repo:s.repo},...s.path===null?{}:{path:s.path}})),paused_at:e.paused_at,...e.default_kind===null?{}:{default_kind:e.default_kind},...e.grantee===null?{}:{grantee:e.grantee},...e.environment_id===null?{}:{environment_id:e.environment_id},...Object.keys(f).length===0?{}:{delivery_limits:f},...Object.keys(p).length===0?{}:{metadata:p},created_at:e.created_at,last_used_at:e.last_used_at}}}),k=Object.fromEntries(o(t,"SELECT directory, profile_id FROM profile_defaults").all().map(e=>[e.directory,e.profile_id])),c={};for(const e of o(t,"SELECT owner_key, raw_json FROM scope_settings WHERE owner_key != 'project'").all())c[e.owner_key]=JSON.parse(e.raw_json);const d={},l=n(e=>d[e]??={marketplaces:{},plugins:{},activeCanvas:null},"stateOf");for(const e of o(t,"SELECT owner_key, last_self_check, active_canvas FROM scope_bookkeeping WHERE owner_key != 'project'").all()){const p=l(e.owner_key);e.last_self_check!==null&&(p.last_self_check=e.last_self_check),p.activeCanvas=e.active_canvas}for(const e of o(t,"SELECT owner_key, name, last_updated FROM scope_marketplaces WHERE owner_key != 'project'").all())l(e.owner_key).marketplaces[e.name]=e.last_updated===null?{}:{last_updated:e.last_updated};for(const e of o(t,"SELECT owner_key, name, last_updated, etag, checked_at FROM scope_plugins WHERE owner_key != 'project'").all())l(e.owner_key).plugins[e.name]={...e.last_updated===null?{}:{last_updated:e.last_updated},...e.etag===null?{}:{etag:e.etag},...e.checked_at===null?{}:{checked_at:e.checked_at}};return{profiles:E,defaults:k,settings:c,state:d,apps:{}}}n(L,"readLegacyUserSnapshot");function v(r){const a=i(r);return _(a)?o(u(a),"SELECT profile_id, path, memory FROM legacy_project_caps ORDER BY profile_id, path").all().map(t=>({profileId:t.profile_id,path:t.path,memory:t.memory})):[]}n(v,"listLegacyProjectCaps");function w(r){const a=i(r);_(a)&&R(a,t=>{o(t,"DELETE FROM legacy_project_caps").run()})}n(w,"deleteLegacyProjectCaps");export{w as deleteLegacyProjectCaps,v as listLegacyProjectCaps,L as readLegacyUserSnapshot};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var y=Object.defineProperty;var c=(t,a)=>y(t,"name",{value:a,configurable:!0});import{openDb as D,withCanvasWrite as v}from"../canvas/db.js";import{appRevisionOf as w,revisionOf as L,setPersonSnapshot as I,setSettingsReloader as h,setSettingsTransport as j,SettingsRevisionConflictError as S}from"./person-store.js";const s=c(t=>typeof t=="string"?t:void 0,"s");async function k(t,a){const o=await t.prepare("SELECT * FROM profiles WHERE person = ? AND deleting_since IS NULL ORDER BY created_at, id").all(a),l=await t.prepare(`SELECT profile_id, path, repo, position FROM (
|
|
2
|
+
SELECT p.profile_id, p.path, p.repo, p.position FROM profile_projects p JOIN profiles f ON f.id = p.profile_id WHERE f.person = ?
|
|
3
|
+
UNION ALL SELECT r.profile_id, NULL AS path, r.repo, r.position FROM profile_project_repos r JOIN profiles f ON f.id = r.profile_id WHERE f.person = ?) e
|
|
4
|
+
ORDER BY profile_id, position`).all(a,a),n=new Map;for(const e of l)(n.get(e.profile_id)??n.set(e.profile_id,[]).get(e.profile_id)).push({...e.repo===null?{}:{repo:e.repo},...e.path===null?{}:{path:e.path}});const r=o.map(e=>{const p=JSON.parse(String(e.metadata_json)),_=JSON.parse(String(e.delivery_limits_json));return{profileId:String(e.id),manifest:{schema_version:1,name:String(e.name),projects:n.get(String(e.id))??[],paused_at:s(e.paused_at)??null,...s(e.default_kind)===void 0?{}:{default_kind:s(e.default_kind)},...s(e.grantee)===void 0?{}:{grantee:s(e.grantee)},...s(e.environment_id)===void 0?{}:{environment_id:s(e.environment_id)},...Object.keys(_).length===0?{}:{delivery_limits:_},...Object.keys(p).length===0?{}:{metadata:p},created_at:String(e.created_at),last_used_at:s(e.last_used_at)??null}}}),i=Object.fromEntries((await t.prepare("SELECT directory, profile_id FROM profile_defaults WHERE person = ?").all(a)).map(e=>[e.directory,e.profile_id])),f={};for(const e of await t.prepare("SELECT owner_key, raw_json FROM scope_settings WHERE person = ?").all(a))f[e.owner_key]=JSON.parse(e.raw_json);const E={},u={},d=c(e=>u[e]??={plugins:{},marketplaces:{},revision:""},"appOf"),m=c(e=>E[e]??={marketplaces:{},plugins:{},activeCanvas:null},"stateOf");for(const e of await t.prepare("SELECT owner_key, last_self_check, active_canvas FROM scope_bookkeeping WHERE person = ?").all(a)){const p=m(e.owner_key);e.last_self_check!==null&&(p.last_self_check=e.last_self_check),p.activeCanvas=e.active_canvas}for(const e of await t.prepare("SELECT * FROM scope_marketplaces WHERE person = ? ORDER BY owner_key, name").all(a)){const p=String(e.owner_key),_=String(e.name);if(p.startsWith("app:")){d(p).marketplaces[_]={url:s(e.url),ref:s(e.ref)??"",installed_at:s(e.installed_at)??""};continue}if(m(p).marketplaces[_]=s(e.last_updated)===void 0?{}:{last_updated:s(e.last_updated)},s(e.url)!==void 0){const g=f[p]??={},O=g.marketplaces??={};O[_]={url:s(e.url),ref:s(e.ref)??"",installed_at:s(e.installed_at)??""}}}for(const e of await t.prepare("SELECT * FROM scope_plugins WHERE person = ? ORDER BY owner_key, name").all(a)){const p=String(e.owner_key),_=String(e.name);if(p.startsWith("app:")){d(p).plugins[_]={enabled:Number(e.enabled)===1,...s(e.source_marketplace)===void 0?{}:{source_marketplace:s(e.source_marketplace)},...s(e.version)===void 0?{}:{version:s(e.version)}};continue}m(p).plugins[_]={...s(e.last_updated)===void 0?{}:{last_updated:s(e.last_updated)},...s(e.etag)===void 0?{}:{etag:s(e.etag)},...s(e.checked_at)===void 0?{}:{checked_at:s(e.checked_at)}};const g=f[p]??={},O=g.plugins??={};O[_]={enabled:Number(e.enabled)===1,...s(e.source_marketplace)===void 0?{}:{source_marketplace:s(e.source_marketplace)},...s(e.version)===void 0?{}:{version:s(e.version)}}}for(const e of Object.values(u))e.revision=w(e);return{profiles:r,defaults:i,settings:f,state:E,apps:u}}c(k,"readSnapshotFromRows");async function N(t){const a=await D(),o=await k(a,t);return I(t,o),o}c(N,"loadPersonSettings");async function C(t,a,o){return(await k(t,a)).settings[o]}c(C,"currentRaw");async function A(t,a,o){let l=!1;for(const n of o)if(n.op==="settings.replace"){const r=await C(t,a,n.owner);if(n.ifRevision!==L(r))throw new S;const{plugins:i,marketplaces:f,...E}=n.raw,u=JSON.stringify(E);await t.prepare("INSERT INTO scope_settings (person, owner_key, raw_json) VALUES (?, ?, ?) ON CONFLICT (person, owner_key) DO UPDATE SET raw_json = EXCLUDED.raw_json").run(a,n.owner,u);const d=JSON.stringify([r?.plugins,r?.marketplaces]);d!==JSON.stringify([i,f])&&!(d==="[null,null]"&&i===void 0&&f===void 0)&&(l=!0),await T(t,a,n.owner,i??{},f??{})}else if(n.op==="app-plugins.replace"){await t.prepare("SELECT pg_advisory_xact_lock(hashtext(?))").get(`app-plugins|${a}|${n.app}`);const r=(await k(t,a)).apps[n.app];if(n.ifRevision!==w(r))throw new S;w(n)!==w(r)&&(l=!0),await T(t,a,n.app,n.plugins,n.marketplaces)}else if(n.op==="state.write"){await t.prepare(`INSERT INTO scope_bookkeeping (person, owner_key, last_self_check, active_canvas) VALUES (?, ?, ?, ?)
|
|
5
|
+
ON CONFLICT (person, owner_key) DO UPDATE SET last_self_check = EXCLUDED.last_self_check, active_canvas = EXCLUDED.active_canvas`).run(a,n.owner,n.state.last_self_check??null,n.state.activeCanvas??null);for(const[r,i]of Object.entries(n.state.marketplaces))await t.prepare("UPDATE scope_marketplaces SET last_updated = ? WHERE person = ? AND owner_key = ? AND name = ?").run(i.last_updated??null,a,n.owner,r);for(const[r,i]of Object.entries(n.state.plugins))await t.prepare("UPDATE scope_plugins SET last_updated = ?, etag = ?, checked_at = ? WHERE person = ? AND owner_key = ? AND name = ?").run(i.last_updated??null,i.etag??null,i.checked_at??null,a,n.owner,r)}else if(n.op==="profile.insert"){const r=n.profile.manifest;await t.prepare("INSERT INTO profiles (id, person, name, created_at, last_used_at, paused_at, default_kind, grantee, metadata_json, delivery_limits_json, environment_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)").run(n.profile.profileId,a,r.name,r.created_at,r.last_used_at,r.paused_at,r.default_kind??null,r.grantee??null,JSON.stringify(r.metadata??{}),JSON.stringify(r.delivery_limits??{}),r.environment_id??null),await R(t,n.profile)}else if(n.op==="profile.update"){const r=n.profile.manifest;if((await t.prepare("UPDATE profiles SET name = ?, last_used_at = ?, paused_at = ?, default_kind = ?, grantee = ?, metadata_json = ?, delivery_limits_json = ?, environment_id = ? WHERE id = ? AND person = ?").run(r.name,r.last_used_at,r.paused_at,r.default_kind??null,r.grantee??null,JSON.stringify(r.metadata??{}),JSON.stringify(r.delivery_limits??{}),r.environment_id??null,n.profile.profileId,a)).changes!==1)throw new Error(`no stored profile ${n.profile.profileId}`);await R(t,n.profile)}else if(n.op==="profile.delete"){const r=`profile:${n.profileId}`;for(const i of["scope_settings","scope_bookkeeping","scope_marketplaces","scope_plugins"])await t.prepare(`DELETE FROM ${i} WHERE person = ? AND owner_key = ?`).run(a,r);await t.prepare("DELETE FROM profiles WHERE id = ? AND person = ?").run(n.profileId,a)}else{await t.prepare("DELETE FROM profile_defaults WHERE person = ?").run(a);for(const[r,i]of Object.entries(n.defaults))await t.prepare("INSERT INTO profile_defaults (person, directory, profile_id) VALUES (?, ?, ?)").run(a,r,i)}l&&await t.prepare("INSERT INTO person_settings (person, plugins_revision) VALUES (?, 1) ON CONFLICT (person) DO UPDATE SET plugins_revision = person_settings.plugins_revision + 1").run(a),await t.prepare("SELECT pg_notify('crtr_signal', ?)").get(`settings:${a}`)}c(A,"applyOpsToRows");async function T(t,a,o,l,n){await t.prepare("DELETE FROM scope_plugins WHERE person = ? AND owner_key = ? AND NOT (name IN (SELECT jsonb_array_elements_text(?::jsonb)))").run(a,o,JSON.stringify(Object.keys(l)));for(const[r,i]of Object.entries(l))await t.prepare(`INSERT INTO scope_plugins (person, owner_key, name, enabled, source_marketplace, version) VALUES (?, ?, ?, ?, ?, ?)
|
|
3
6
|
ON CONFLICT (person, owner_key, name) DO UPDATE SET enabled = EXCLUDED.enabled, source_marketplace = EXCLUDED.source_marketplace, version = EXCLUDED.version`).run(a,o,r,i.enabled===!1?0:1,i.source_marketplace??null,i.version??null);await t.prepare("DELETE FROM scope_marketplaces WHERE person = ? AND owner_key = ? AND NOT (name IN (SELECT jsonb_array_elements_text(?::jsonb)))").run(a,o,JSON.stringify(Object.keys(n)));for(const[r,i]of Object.entries(n))await t.prepare(`INSERT INTO scope_marketplaces (person, owner_key, name, url, ref, installed_at) VALUES (?, ?, ?, ?, ?, ?)
|
|
4
|
-
ON CONFLICT (person, owner_key, name) DO UPDATE SET url = EXCLUDED.url, ref = EXCLUDED.ref, installed_at = EXCLUDED.installed_at`).run(a,o,r,i.url??null,i.ref??null,i.installed_at??null)}
|
|
7
|
+
ON CONFLICT (person, owner_key, name) DO UPDATE SET url = EXCLUDED.url, ref = EXCLUDED.ref, installed_at = EXCLUDED.installed_at`).run(a,o,r,i.url??null,i.ref??null,i.installed_at??null)}c(T,"writeInstallRows");async function R(t,a){await t.prepare("DELETE FROM profile_projects WHERE profile_id = ?").run(a.profileId),await t.prepare("DELETE FROM profile_project_repos WHERE profile_id = ?").run(a.profileId);let o=0;for(const l of a.manifest.projects)l.path!==void 0?await t.prepare("INSERT INTO profile_projects (profile_id, path, repo, position) VALUES (?, ?, ?, ?)").run(a.profileId,l.path,l.repo??null,o++):await t.prepare("INSERT INTO profile_project_repos (profile_id, repo, position) VALUES (?, ?, ?)").run(a.profileId,l.repo,o++)}c(R,"replaceProjects");const U=c(async(t,a)=>(await v(o=>A(o,t,a)),await N(t)),"rowsTransport");j(U),h(N);export{A as applyOpsToRows,N as loadPersonSettings,k as readSnapshotFromRows,U as rowsTransport};
|
|
@@ -5,6 +5,10 @@ export declare const PROVIDER_SCHEMA_VERSION = 1;
|
|
|
5
5
|
* column on open (`upgradeScopedStore`), and an older generation sharing the store names its columns and never reads it, so
|
|
6
6
|
* the version stays 5 and a runtime rollback keeps opening the store. */
|
|
7
7
|
export declare const PROFILE_ENVIRONMENT_COLUMN = "environment_id";
|
|
8
|
+
/** `profile_projects.repo` and the `profile_project_repos` table (a repo with no folder) are additive to version 5, like `PROFILE_ENVIRONMENT_COLUMN`:
|
|
9
|
+
* a store written before them gains both on open (`upgradeScopedStore`), and an older generation never reads them. One position
|
|
10
|
+
* counter covers both tables. */
|
|
11
|
+
export declare const PROFILE_PROJECT_REPO_COLUMN = "repo";
|
|
8
12
|
/** Adds the model-cooldown table to a provider store that predates it; a no-op (no write) once present. */
|
|
9
13
|
export declare function ensureProviderModelCooldowns(db: DatabaseSync): void;
|
|
10
14
|
export declare function createScopedSchema(db: DatabaseSync, kind: 'user' | 'project' | 'provider'): void;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
var t=Object.defineProperty;var T=(e,E)=>t(e,"name",{value:E,configurable:!0});import{prepared as o}from"../sqlite-statements.js";const
|
|
1
|
+
var t=Object.defineProperty;var T=(e,E)=>t(e,"name",{value:E,configurable:!0});import{prepared as o}from"../sqlite-statements.js";const _=5,n=1,p="environment_id",R="repo",N=`
|
|
2
2
|
CREATE TABLE scope_owners (owner_key TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK(kind IN ('user','profile','project')), root TEXT NOT NULL UNIQUE, profile_id TEXT UNIQUE);
|
|
3
3
|
CREATE TABLE profiles (id TEXT PRIMARY KEY, name TEXT NOT NULL, created_at TEXT NOT NULL, last_used_at TEXT, paused_at TEXT, default_kind TEXT, grantee TEXT, metadata_json TEXT NOT NULL CHECK(json_valid(metadata_json)), delivery_limits_json TEXT NOT NULL DEFAULT '{}' CHECK(json_valid(delivery_limits_json)), environment_id TEXT);
|
|
4
|
-
CREATE TABLE profile_projects (profile_id TEXT NOT NULL REFERENCES profiles(id) ON DELETE CASCADE, path TEXT NOT NULL, position INTEGER NOT NULL, PRIMARY KEY(profile_id,path), UNIQUE(profile_id,position));
|
|
4
|
+
CREATE TABLE profile_projects (profile_id TEXT NOT NULL REFERENCES profiles(id) ON DELETE CASCADE, path TEXT NOT NULL, position INTEGER NOT NULL, repo TEXT, PRIMARY KEY(profile_id,path), UNIQUE(profile_id,position));
|
|
5
|
+
CREATE TABLE profile_project_repos (profile_id TEXT NOT NULL REFERENCES profiles(id) ON DELETE CASCADE, repo TEXT NOT NULL, position INTEGER NOT NULL, PRIMARY KEY(profile_id,repo));
|
|
5
6
|
-- Pre-canvas per-project memory caps awaiting the canvas import, which turns them into delivery_limits and deletes the rows.
|
|
6
7
|
CREATE TABLE legacy_project_caps (profile_id TEXT NOT NULL, path TEXT NOT NULL, memory TEXT NOT NULL CHECK(memory IN ('none','name','preview')), PRIMARY KEY(profile_id,path));
|
|
7
8
|
CREATE TABLE profile_defaults (directory TEXT PRIMARY KEY, profile_id TEXT NOT NULL REFERENCES profiles(id) ON DELETE CASCADE);
|
|
8
9
|
CREATE TABLE scope_settings (owner_key TEXT PRIMARY KEY REFERENCES scope_owners(owner_key), raw_json TEXT NOT NULL CHECK(json_valid(raw_json)));
|
|
9
10
|
CREATE TABLE scope_bookkeeping (owner_key TEXT PRIMARY KEY REFERENCES scope_owners(owner_key), last_self_check TEXT, active_canvas TEXT);
|
|
10
11
|
CREATE TABLE scope_marketplaces (owner_key TEXT NOT NULL REFERENCES scope_owners(owner_key), name TEXT NOT NULL, last_updated TEXT, PRIMARY KEY(owner_key,name));
|
|
11
|
-
CREATE TABLE scope_plugins (owner_key TEXT NOT NULL REFERENCES scope_owners(owner_key), name TEXT NOT NULL, last_updated TEXT, etag TEXT, checked_at TEXT, PRIMARY KEY(owner_key,name));`,r="CREATE TABLE IF NOT EXISTS managed_account_model_cooldowns (provider_id TEXT NOT NULL, account_id TEXT NOT NULL, family TEXT NOT NULL, rate_limited_until INTEGER NOT NULL, last_rate_limited_at INTEGER NOT NULL, PRIMARY KEY(provider_id,account_id,family));";function l(e){e.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='managed_account_model_cooldowns'").get()===void 0&&e.exec(r)}T(l,"ensureProviderModelCooldowns");const
|
|
12
|
+
CREATE TABLE scope_plugins (owner_key TEXT NOT NULL REFERENCES scope_owners(owner_key), name TEXT NOT NULL, last_updated TEXT, etag TEXT, checked_at TEXT, PRIMARY KEY(owner_key,name));`,r="CREATE TABLE IF NOT EXISTS managed_account_model_cooldowns (provider_id TEXT NOT NULL, account_id TEXT NOT NULL, family TEXT NOT NULL, rate_limited_until INTEGER NOT NULL, last_rate_limited_at INTEGER NOT NULL, PRIMARY KEY(provider_id,account_id,family));";function l(e){e.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='managed_account_model_cooldowns'").get()===void 0&&e.exec(r)}T(l,"ensureProviderModelCooldowns");const a=`
|
|
12
13
|
CREATE TABLE managed_accounts (provider_id TEXT NOT NULL, id TEXT NOT NULL, label TEXT NOT NULL, label_key TEXT NOT NULL, position INTEGER NOT NULL, last_attempt_at INTEGER NOT NULL, last_rate_limited_at INTEGER NOT NULL, rate_limited_until INTEGER NOT NULL, auth_failure TEXT CHECK(auth_failure IS NULL OR auth_failure='invalid_grant'), PRIMARY KEY(provider_id,id), UNIQUE(provider_id,label_key));
|
|
13
14
|
CREATE INDEX managed_accounts_order ON managed_accounts(provider_id,position);
|
|
14
15
|
CREATE TABLE rotation_settings (singleton INTEGER PRIMARY KEY CHECK(singleton=1), default_fallback_strength TEXT, revert_when_available INTEGER CHECK(revert_when_available IN (0,1)));
|
|
15
16
|
CREATE TABLE provider_revision (singleton INTEGER PRIMARY KEY CHECK(singleton=1), revision INTEGER NOT NULL);
|
|
16
|
-
${r}`;function d(e,E){if(e.exec(E==="provider"?N
|
|
17
|
+
${r}`;function d(e,E){if(e.exec(E==="provider"?a:N),E!=="provider"){const i=E==="user"?"user":"project";o(e,"INSERT INTO scope_owners(owner_key, kind, root, profile_id) VALUES (?, ?, ?, NULL)").run(i,E,"")}else o(e,"INSERT INTO provider_revision(singleton, revision) VALUES (1, 0)").run();e.exec(`PRAGMA user_version = ${E==="provider"?n:_}`)}T(d,"createScopedSchema");export{p as PROFILE_ENVIRONMENT_COLUMN,R as PROFILE_PROJECT_REPO_COLUMN,n as PROVIDER_SCHEMA_VERSION,_ as SCOPED_SCHEMA_VERSION,d as createScopedSchema,l as ensureProviderModelCooldowns};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var L=Object.defineProperty;var l=(t,e)=>L(t,"name",{value:e,configurable:!0});import{dirname as F}from"node:path";import{clearLedger as $,demoteTranscript as M,freezePreferences as g,loadLedger as P,saveLedger as T}from"../../graph/exposures.js";import{recordWatches as H}from"../../graph/watches.js";import{publishMany as x}from"../../graph/events.js";import{checkoutsForCwd as y}from"../../graph/repo-sync/repos.js";import{liveLookups as W,profileObject as Y,viewRepos as B}from"../../graph/reader.js";import{ownerForGrantee as U}from"../../graph/objects.js";import{resolveName as J}from"../../graph/names.js";import{SCOPE_VOCABULARY as K}from"../../scopes.js";import{getNode as V}from"../../canvas/index.js";import{recordMemoryReadsIn as G}from"../../canvas/memory-reads.js";import{lookupProfile as X}from"../../profiles/manifest.js";import{getDefaultProfileId as z}from"../../profiles/default-binding.js";import{effectiveScopes as Q,profileNameFor as Z,scopeForCwd as q}from"../subject-fields.js";import{spineDepth as ee}from"../subject.js";import{appForNode as te}from"../../canvas/node-agent-paths.js";import{interpolateNodePaths as ne}from"../../canvas/paths.js";import{readableProjectForScopes as oe}from"../../spaces/permissions.js";import{ApiError as
|
|
2
|
-
`),delivered:[...e.delivered,...n.delivered]}}l(ve,"hypotheticalBearings");async function I(t,e,n){const o=await J(t,e,n);if("object"in o&&o.object.type==="document")return o.object;throw"ambiguous"in o?new
|
|
1
|
+
var L=Object.defineProperty;var l=(t,e)=>L(t,"name",{value:e,configurable:!0});import{dirname as F}from"node:path";import{clearLedger as $,demoteTranscript as M,freezePreferences as g,loadLedger as P,saveLedger as T}from"../../graph/exposures.js";import{recordWatches as H}from"../../graph/watches.js";import{publishMany as x}from"../../graph/events.js";import{checkoutsForCwd as y}from"../../graph/repo-sync/repos.js";import{liveLookups as W,profileObject as Y,viewRepos as B}from"../../graph/reader.js";import{ownerForGrantee as U}from"../../graph/objects.js";import{resolveName as J}from"../../graph/names.js";import{SCOPE_VOCABULARY as K}from"../../scopes.js";import{getNode as V}from"../../canvas/index.js";import{recordMemoryReadsIn as G}from"../../canvas/memory-reads.js";import{lookupProfile as X}from"../../profiles/manifest.js";import{getDefaultProfileId as z}from"../../profiles/default-binding.js";import{effectiveScopes as Q,profileNameFor as Z,scopeForCwd as q}from"../subject-fields.js";import{spineDepth as ee}from"../subject.js";import{appForNode as te}from"../../canvas/node-agent-paths.js";import{interpolateNodePaths as ne}from"../../canvas/paths.js";import{readableProjectForScopes as oe}from"../../spaces/permissions.js";import{ApiError as m}from"../../../api/errors.js";import{buildContextBearings as re}from"../../runtime/bearings.js";import{deliveryDocOf as b,listingCorpora as ae,loadCorpus as w,nodeSubject as j,primeBodies as ie,viewOwners as se}from"./corpus.js";import{listingPrefixes as ce}from"./listings.js";import{planDelivery as de}from"./plan.js";import{renderEvent as N,renderExplicitRead as k}from"./render-event.js";import{renderConfigDelta as le,renderKnowledge as pe,renderPreferences as O,renderWorkspaceOpen as _}from"./render-boot.js";import{mapAsync as S}from"../../async-array.js";function f(t){if(t.class!=="node")throw new Error(`delivery needs a node reader, got ${t.class}`);return t}l(f,"nodeOf");const R="hypothetical";function v(t){return t.node.id===R}l(v,"isHypothetical");async function E(t,e){if(!v(e))return await te(e.node.id);const n=await t.prepare("SELECT external_id FROM identities WHERE object = ?").get(e.app.id);if(!n)throw new Error(`app object ${e.app.id} has no identity`);return n.external_id}l(E,"granteeOf");async function ue(t,e,n,o=async(a,d)=>await y(t,a,d)){const a=f(e).node,d=new Set,r=new Date().toISOString(),s=[],i=[];for(const{doc:c,level:p}of n)p!=="content"||d.has(c.object.id)||(d.add(c.object.id),i.push({watcher:a,object:c.object,start:"deliver",opts:{readHeadsKey:c.headsKey}}),s.push({name:c.name,scope:c.ownerHandle,at:r,type:"loaded"}));await H(t,i),await x(t,i.map(c=>({event:"read",object:c.object,actor:a,attrs:{}})),o),v(f(e))||await G(t,a.id,s)}l(ue,"recordContentDelivery");async function D(t,e,n){const o=(await y(t,F(n))).filter(a=>!e.repos.some(d=>d.id===a.repo.id));return o.length===0?e:{...e,repos:[...e.repos,...o.map(a=>a.repo)],checkouts:[...e.checkouts,...o]}}l(D,"fileReadReader");async function me(t,e,n){const o=await E(t,e);if(!(n.startsWith("/")&&(process.platform!=="linux"&&o==="app:terminal"||oe(n,o,e.scopes??[],null))))throw new m(403,"scope_missing","read file is outside the run mounts")}l(me,"assertReadableFile");async function fe(t){const e=f(t.reader),n=e.node,o=await E(t.db,e),a=await w(t.db,t.reader,["slash-command"]);await ie(t.db,a);const d=await S(a,async r=>{const s=await r.body();return{name:r.displayName,command_name:r.displayName,description:r.preview,canonical_body:s,execution_body:ne(s,n.id,o)}});return{docs:a,commands:d}}l(fe,"slashCommands");function we(t){if(t.shipped)return"builtin";switch(t.owner.type){case"node":return"node";case"repo":return"project";case"profile":return"profile";default:return"user"}}l(we,"scopeOf");async function ye(t,e){const n=[],o=new Set,a=await se(t,e),d=await ae(t,e,a);for(const r of a){const s=d.get(r.id);for(const i of s){n.push({name:i.displayName,kind:i.kind,scope:we(i),shortForm:i.preview,gatewayVisible:!i.shipped}),o.add(i.displayName);const c=i.displayName===i.name?"":`${i.ownerHandle}/`;for(const p of ce(s,i.name))o.add(`${c}${p}`)}}return{refs:n,names:[...o]}}l(ye,"composerNames");async function C(t,e){const n=f(t.reader),{db:o,ledger:a}=t,d=l(()=>{if(typeof e.subject!="string"||e.subject==="")throw new m(400,"usage",`delivery activity ${e.activity} requires a subject`);return e.subject},"requireSubject");switch(e.activity){case"boot":{if(e.inherited===!0){for(const[i,c]of a.objects)if(c.transcript===void 0)a.objects.delete(i);else{const{system:p,...u}=c;a.objects.set(i,u)}for(const[i,c]of a.listed)c.transcript===void 0?a.listed.delete(i):a.listed.set(i,{transcript:c.transcript});return a.preferenceSnapshot=null,{result:{content:"",inherited:!0},delivered:[]}}const r=v(n)?await ve(t):await re(n.node.id,t),s=await O({...t,channel:"system"});return g(a,s.content),{result:{content:r.content},delivered:[...r.delivered,...s.delivered]}}case"system-prompt":{if(a.preferenceSnapshot!==null)return{result:{content:a.preferenceSnapshot},delivered:[]};const r=await O({...t,channel:"system"});return{result:{content:g(a,r.content)},delivered:r.delivered}}case"compact":{for(const r of await w(o,n,["pre-command"]))M(a,r.object.id);return{result:{content:""},delivered:[]}}case"persona":{const r=await le(t);return{result:{content:r.content},delivered:r.delivered}}case"file-read":{const r=d();await me(o,n,r);const s=await D(o,n,r),i={...t,reader:s},c=await N(i,"file-read",{absoluteFile:r},await w(o,s,["file-read"]));return{result:{content:c.content},delivered:c.delivered}}case"command":case"pre-command":{const r=await N(t,e.activity,{command:d()});return{result:{content:r.content},delivered:r.delivered}}case"slash-command":{const{docs:r,commands:s}=await fe(t);if(e.subject===void 0||e.subject==="")return{result:{content:"",commands:s},delivered:[]};const i=r.findIndex(u=>u.displayName===e.subject||u.name===e.subject);if(i<0)throw new m(404,"not_found",`no slash command named ${e.subject}`);const c=r[i],p=await k(t,c,!0);return{result:{content:"",execution_body:s[i].execution_body,blocks:p.attachments===""?[]:[p.attachments]},delivered:[{doc:c,level:"content"},...p.delivered]}}case"workspace-open":{const r=await _(t);return{result:{content:r.content},delivered:r.delivered}}case"document-read":{const r=await I(o,n,d()),s=await k(t,await b(o,n,r),!0);return{result:{content:s.attachments},delivered:s.delivered}}case"names":return{result:{content:"",...await ye(o,n)},delivered:[]};default:throw new m(400,"usage",`unknown delivery activity ${String(e.activity)}`)}}l(C,"render");async function ve(t){const e=await pe(t),n=await _(t);return{content:[e.content,n.content].filter(o=>o!=="").join(`
|
|
2
|
+
`),delivered:[...e.delivered,...n.delivered]}}l(ve,"hypotheticalBearings");async function I(t,e,n){const o=await J(t,e,n);if("object"in o&&o.object.type==="document")return o.object;throw"ambiguous"in o?new m(409,"ambiguous",`${n} names ${o.ambiguous.length} documents; name one as <type>:<owner>/<name>`):new m(404,"not_found",`no document ${n} the reader can read`)}l(I,"readDocument");const he=["workspace-open","document-read"];async function Ge(t,e,n){if(he.includes(n.activity))throw new m(400,"usage",`delivery activity ${n.activity} is available to a dry run only`);const o=f(e).node;n.activity==="boot"&&n.inherited!==!0&&await $(t,o.id);const a=await P(t,o.id),d={db:t,reader:e,subject:await j(t,e),ledger:a,channel:"transcript"},{result:r,delivered:s}=await C(d,n);return await ue(t,e,s),await T(t,a),r}l(Ge,"deliver");const ge={boot:"boot","workspace-open":"workspace-open","file-read":"file-read","document-read":"document-read",command:"command","pre-command":"pre-command","slash-command":"slash-command"};async function Xe(t,e){const n=await V(t);if(n===null)throw new m(404,"not_found",`no node ${t}`);return{cwd:e.cwd??n.cwd,profile:e.profile!==void 0?e.profile:n.profile_id,grantee:e.grantee??n.grantee,kind:e.kind??n.kind,mode:e.mode??n.mode,lifecycle:e.lifecycle??n.lifecycle,hasManager:e.hasManager??(n.parent??null)!==null,depth:e.depth??await ee(t)}}l(Xe,"hypotheticalFrom");function be(t,e){if(t===null)return null;if(t===void 0||t==="")return z(e);const n=X(t);if(n.kind!=="resolved"){const o=`no profile ${t}`;throw new m(404,"not_found",o,{error:"not_found",message:o,next:"List profile ids and names with `crtr profile list`."})}return n.entry.profileId}l(be,"resolveProfileId");async function ze(t,e){const n=await U(t,e.grantee??"app:terminal"),o=be(e.profile,e.cwd),a=await B(t,e.cwd,o,async(p,u)=>await y(t,p,u),W(t)),{repos:d}=a,r=e.mode??"base",i={class:"node",node:{id:R,seq:0,type:"node",kind:e.kind??"general",owner:n.id,privacy:"private",name:"hypothetical",preview:"",created_at:new Date(0).toISOString(),deleted_at:null},app:n,scopes:[...K],cwd:e.cwd,...a,profile:o===null?null:await Y(t,o,n)},c={kind:e.kind??"general",mode:r,lifecycle:e.lifecycle??(r==="orchestrator"?"resident":"terminal"),hasManager:e.hasManager??!0,cwd:e.cwd,scope:q(e.cwd),orchestration:{depth:e.depth??0},profile:Z(o),app:e.grantee??"app:terminal",scopes:Q(null),repo:[...d,...a.projectRepos].map(p=>p.name)};return{reader:i,subject:c}}l(ze,"hypotheticalReader");async function Qe(t,e,n,o,a){const r={node:f(e).node.id,preferenceSnapshot:null,objects:new Map,listed:new Map},s={...a??await j(t,e),...o},i={db:t,reader:e,subject:s,ledger:r,channel:"transcript"},{result:c}=await C(i,n),p=ge[n.activity];let u=null;if(p!==void 0){const A=n.activity==="file-read"?{absoluteFile:n.subject}:n.activity==="command"||n.activity==="pre-command"?{command:n.subject}:n.activity==="document-read"&&n.subject!==void 0?{doc:await b(t,e,await I(t,e,n.subject))}:{},h=n.activity==="file-read"&&n.subject!==void 0?await D(t,f(e),n.subject):e;u=await de(t,s,h,await w(t,h,[p]),p,A)}return{result:c,plan:u}}l(Qe,"inspect");async function Ze(t,e,n){const o=await t.prepare(`SELECT o.*, MAX(r.number) AS to_seq, string_agg(DISTINCT a.id, ',') AS authors
|
|
3
3
|
FROM watches w JOIN objects o ON o.id = w.object AND o.type = 'document' AND o.deleted_at IS NULL
|
|
4
4
|
JOIN revisions r ON r.document = o.id LEFT JOIN objects a ON a.id = r.author
|
|
5
5
|
WHERE w.watcher = ? AND r.created_at > ? AND (r.author IS NULL OR r.author != ?)
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
WHERE o.type = 'repo' AND i.
|
|
3
|
-
WHERE o.type = 'repo' AND i.scheme = 'local-path'`).all();for(const{id:s,path:a,person:l}of c)!t.has(s)&&o.startsWith(a.endsWith("/")?a:`${a}/`)&&l===await n()&&t.set(s,a);return t}u(x,"repoRootsOf");function j(e,o,t,r){const n=e.rules.filter(d=>d.on===t).map(d=>{const f=F(d,o);return{rule:d,gate:f,matched:f.pass&&O(d,e,t,r)}});let i=null;for(const{rule:d,matched:f}of n)f&&(i===null||p(d.deliver)>p(i.deliver))&&(i=d);const c=i?.deliver??"none",s=(t==="boot"||t==="workspace-open")&&!e.ownNode?e.limit:null,a=s===null?c:N(c,s),l=t==="boot"&&e.ownNode&&n.length===0?"name":a;return{doc:e,authoredRules:n,matchedRule:i,authoredRung:c,limit:s,cappedRung:a,ruleGate:n.length===0?null:i!==null?{pass:!0}:n.find(d=>!d.gate.pass)?.gate??{pass:!0},finalRung:l,winner:!1,shadowedBy:null}}u(j,"decide");function D(e,o){if(o==="boot"){const t=e.authoredRules.length>0&&e.authoredRules.every(r=>!r.gate.pass);return e.limit!=="none"&&!t}return k(e.finalRung,"name")}u(D,"holdsName");function S(e,o){const t=e==="boot"||e==="workspace-open",r=new Map;for(const n of o){if(!D(n,e))continue;if(!t){n.winner=!0;continue}const i=e==="boot"?`${A(n)}:${n.doc.name}`:n.doc.name,c=r.get(i);c===void 0?(r.set(i,n),n.winner=!0):n.shadowedBy=c.doc}}u(S,"resolveWinners");export{A as bootPartitionOf,B as planDelivery};
|
|
1
|
+
var p=Object.defineProperty;var u=(e,r)=>p(e,"name",{value:r,configurable:!0});import{dirname as h}from"node:path";import{parseFrontmatterGeneric as w}from"../../frontmatter.js";import{readText as g,realpathOrSelf as R}from"../../fs-utils.js";import{checkoutChainOf as b}from"../../checkout-identities.js";import{readableRepos as k}from"../../graph/repo-sync/repos.js";import{minRung as O,rungAtLeast as F,rungRank as m}from"../schema.js";import{ruleConstraintsFit as v,ruleGate as y}from"./match.js";import{personIdAsync as N}from"../../canvas/person.js";function x(e){return e.doc.ownNode?"knowledge":e.doc.kind}u(x,"bootPartitionOf");async function H(e,r,n,i,t,a={}){const o=await A(e,t,a),d=(t==="document-read"&&a.doc!==void 0?i.filter(l=>l.object.id!==a.doc.object.id):i).map(l=>W(l,r,t,o));return j(t,d),{on:t,subject:r,reader:n,docs:d}}u(H,"planDelivery");async function A(e,r,n){if(r!=="file-read"||n.absoluteFile===void 0)return n;const i=R(n.absoluteFile);return{...n,absoluteFile:i,readFrontmatter:n.readFrontmatter??E(i),repoRoots:await S(e,i)}}u(A,"resolvePayload");function E(e){if(!/\.(md|mdx|markdown)$/i.test(e))return{};try{return w(g(e)).data??{}}catch{return{}}}u(E,"readFileFrontmatter");async function S(e,r){const n=new Map;let i;const t=u(async()=>i??=await N(),"personOf");for(const o of await b(e,h(r),t)){if(!o.ok)break;for(const s of(await k(e,await t(),o.scheme,o.externalId)).readable)n.has(s.id)||n.set(s.id,o.root)}const a=await e.prepare(`SELECT o.id, i.external_id AS path, i.person AS person FROM identities i JOIN objects o ON o.id = i.object
|
|
2
|
+
WHERE o.type = 'repo' AND i.scheme = 'local-path'`).all();for(const{id:o,path:s,person:d}of a)!n.has(o)&&r.startsWith(s.endsWith("/")?s:`${s}/`)&&d===await t()&&n.set(o,s);return n}u(S,"repoRootsOf");function W(e,r,n,i){const t=e.rules.filter(c=>c.on===n).map(c=>{const f=y(c,r);return{rule:c,gate:f,matched:f.pass&&v(c,e,n,i)}});let a=null;for(const{rule:c,matched:f}of t)f&&(a===null||m(c.deliver)>m(a.deliver))&&(a=c);const o=a?.deliver??"none",s=(n==="boot"||n==="workspace-open")&&!e.ownNode?e.limit:null,d=s===null?o:O(o,s),l=n==="boot"&&e.ownNode&&t.length===0?"name":d;return{doc:e,authoredRules:t,matchedRule:a,authoredRung:o,limit:s,cappedRung:d,ruleGate:t.length===0?null:a!==null?{pass:!0}:t.find(c=>!c.gate.pass)?.gate??{pass:!0},finalRung:l,winner:!1,shadowedBy:null}}u(W,"decide");function $(e,r){if(r==="boot"){const n=e.authoredRules.length>0&&e.authoredRules.every(i=>!i.gate.pass);return e.limit!=="none"&&!n}return F(e.finalRung,"name")}u($,"holdsName");function j(e,r){const n=e==="boot"||e==="workspace-open",i=new Map;for(const t of r){if(!$(t,e))continue;if(!n){t.winner=!0;continue}const a=e==="boot"?`${x(t)}:${t.doc.name}`:t.doc.name,o=i.get(a);o===void 0?(i.set(a,t),t.winner=!0):t.shadowedBy=o.doc}}u(j,"resolveWinners");export{x as bootPartitionOf,H as planDelivery};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var n=Object.defineProperty;var a=(r,o)=>n(r,"name",{value:o,configurable:!0});import{getNode as c,getRow as s}from"../canvas/index.js";import{appForNode as l}from"../canvas/node-agent-paths.js";import{openDb as f}from"../canvas/db.js";import{checkoutsForCwd as m}from"../graph/repo-sync/repos.js";import{liveLookups as w,viewRepos as u}from"../graph/reader.js";import{effectiveScopes as d,scopeForCwd as b,profileNameFor as h}from"./subject-fields.js";import{effectiveScopes as _,scopeForCwd as L,profileNameFor as M}from"./subject-fields.js";async function k(r){let o=r;const e=new Set;let t=0;for(;!e.has(o);){e.add(o);const p=await s(o);if(p===null||p.parent==null)break;o=p.parent,t++}return t}a(k,"spineDepth");async function y(r,o){const e=await f(),t=await u(e,r,o,async(p,i)=>await m(e,p,i),w(e));return[...t.repos,...t.projectRepos]}a(y,"eligibleRepos");async function C(r,o){const e=await c(r);return e===null?null:{kind:e.kind,mode:e.mode,lifecycle:e.lifecycle,hasManager:(e.parent??null)!==null,cwd:e.cwd,scope:b(e.cwd),orchestration:{depth:await k(r)},profile:h(e.profile_id),app:e.grantee??await l(r),scopes:d(e.scopes),repo:(o??await y(e.cwd,e.profile_id??null)).map(t=>t.name)}}a(C,"assembleNodeSubject");export{C as assembleNodeSubject,_ as effectiveScopes,M as profileNameFor,L as scopeForCwd,k as spineDepth};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
export declare const CANVAS_CALLBACK_PATH = "/auth/callback";
|
|
3
|
+
export declare const CANVAS_JOIN_PATH = "/join-group";
|
|
3
4
|
/** The configured canvas origin, from `CRTR_CANVAS_URL` alone, on a cloud role; undefined otherwise. Never reads the key, so a
|
|
4
5
|
* half-configured canvas cannot fail requests for any other host. */
|
|
5
6
|
export declare function canvasOrigin(): string | undefined;
|