@north-light/cli 0.3.765 → 0.3.767
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/contract.d.ts +1 -1
- package/dist/api/contract.js +1 -1
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.js +1 -1
- package/dist/builtin-memory/internal/nodes-and-canvas.md +7 -8
- package/dist/builtin-memory/internal/storage-tiers.md +5 -4
- package/dist/builtin-memory/northlight-apps/guides/test-your-app.md +1 -1
- package/dist/clients/attach/viewer.js +416 -416
- package/dist/commands/sys/signin.d.ts +2 -0
- package/dist/commands/sys/signin.js +4 -2
- package/dist/commands/sys.js +1 -1
- package/dist/core/canvas/db.js +4 -4
- package/dist/core/directory/issuer.d.ts +1 -1
- package/dist/daemon/api/handlers/app-environments.d.ts +1 -0
- package/dist/daemon/api/handlers/app-environments.js +1 -1
- package/dist/daemon/api/handlers/environments.d.ts +1 -0
- package/dist/daemon/api/handlers/environments.js +1 -1
- package/dist/daemon/api/operations.js +1 -1
- package/dist/daemon/api/server.d.ts +1 -0
- package/dist/daemon/api/server.js +1 -1
- package/dist/daemon/cron/passes.d.ts +0 -2
- package/dist/daemon/cron-run.js +2 -2
- package/dist/daemon/crtrd-cli.js +1 -1
- package/dist/daemon/crtrd.d.ts +5 -5
- package/dist/daemon/crtrd.js +7 -19
- package/dist/daemon/due-sources.d.ts +1 -1
- package/dist/daemon/due-sources.js +1 -1
- package/dist/daemon/due.js +4 -4
- package/dist/daemon/machine-link/holder.js +5 -5
- package/dist/daemon/manage.d.ts +0 -12
- package/dist/daemon/manage.js +3 -3
- package/dist/daemon/postgres/index.d.ts +1 -1
- package/dist/daemon/postgres/index.js +1 -1
- package/dist/daemon/postgres/supervisor.d.ts +0 -62
- package/dist/daemon/postgres/supervisor.js +1 -2
- package/dist/daemon/reconcilers/broker-supervision.d.ts +0 -2
- package/dist/daemon/reconcilers/broker-supervision.js +1 -1
- package/dist/daemon/reconcilers/controller-death.d.ts +0 -2
- package/dist/daemon/reconcilers/controller-death.js +1 -1
- package/dist/daemon/reconcilers/cron-lane.d.ts +0 -1
- package/dist/daemon/reconcilers/cron-lane.js +1 -1
- package/dist/daemon/reconcilers/live-obligation.d.ts +1 -6
- package/dist/daemon/reconcilers/live-obligation.js +1 -1
- package/dist/daemon/reconcilers/machine-offline.js +4 -4
- package/dist/daemon/reconcilers/node-deadline.d.ts +1 -2
- package/dist/daemon/reconcilers/node-deadline.js +1 -1
- package/dist/daemon/reconcilers/storage-maintenance.d.ts +0 -2
- package/dist/daemon/reconcilers/storage-maintenance.js +1 -1
- package/dist/daemon/reconcilers/structured-request-lane.d.ts +1 -2
- package/dist/daemon/reconcilers/structured-request-lane.js +1 -1
- package/docs/apps/guides/test-your-app.md +1 -1
- package/docs/ci-runner.md +3 -3
- package/package.json +3 -3
- package/packages/crouter-api/dist/api/contract.js +1 -1
- package/packages/crouter-api/dist/api/index.js +0 -1
- package/packages/crouter-api/dist/daemon/manage.js +0 -12
- package/packages/crouter-api/package.json +1 -1
- package/packages/crouter-identity/package.json +1 -1
- package/packages/crouter-plugin/package.json +3 -3
- package/runtime.lock.json +14 -14
- package/dist/api/dto/imports.d.ts +0 -156
- package/dist/api/dto/imports.js +0 -0
- package/dist/commands/sys/import/move.d.ts +0 -29
- package/dist/commands/sys/import/move.js +0 -6
- package/dist/commands/sys/import/resume.d.ts +0 -1
- package/dist/commands/sys/import/resume.js +0 -1
- package/dist/commands/sys/import/start.d.ts +0 -1
- package/dist/commands/sys/import/start.js +0 -1
- package/dist/core/canvas/daemon-owner.d.ts +0 -75
- package/dist/core/canvas/daemon-owner.js +0 -1
- package/dist/core/import/bundle/blob-keys.d.ts +0 -12
- package/dist/core/import/bundle/blob-keys.js +0 -1
- package/dist/core/import/bundle/layout.d.ts +0 -89
- package/dist/core/import/bundle/layout.js +0 -4
- package/dist/core/import/export/archive.d.ts +0 -11
- package/dist/core/import/export/archive.js +0 -1
- package/dist/core/import/export/cloud.d.ts +0 -41
- package/dist/core/import/export/cloud.js +0 -1
- package/dist/core/import/export/dump.d.ts +0 -34
- package/dist/core/import/export/dump.js +0 -4
- package/dist/core/import/export/files.d.ts +0 -23
- package/dist/core/import/export/files.js +0 -1
- package/dist/core/import/export/inline.d.ts +0 -3
- package/dist/core/import/export/inline.js +0 -1
- package/dist/core/import/export/source.d.ts +0 -2
- package/dist/core/import/export/source.js +0 -1
- package/dist/core/import/export/stores.d.ts +0 -9
- package/dist/core/import/export/stores.js +0 -4
- package/dist/core/import/load/bind.d.ts +0 -42
- package/dist/core/import/load/bind.js +0 -20
- package/dist/core/import/load/blobs.d.ts +0 -27
- package/dist/core/import/load/blobs.js +0 -1
- package/dist/core/import/load/catalog.d.ts +0 -39
- package/dist/core/import/load/catalog.js +0 -9
- package/dist/core/import/load/copy.d.ts +0 -29
- package/dist/core/import/load/copy.js +0 -11
- package/dist/core/import/load/keys.d.ts +0 -5
- package/dist/core/import/load/keys.js +0 -8
- package/dist/core/import/load/open-grants.d.ts +0 -1
- package/dist/core/import/load/open-grants.js +0 -1
- package/dist/core/import/load/path-map.d.ts +0 -7
- package/dist/core/import/load/path-map.js +0 -1
- package/dist/core/import/load/prepare.d.ts +0 -70
- package/dist/core/import/load/prepare.js +0 -14
- package/dist/core/import/load/publish-plugins.d.ts +0 -10
- package/dist/core/import/load/publish-plugins.js +0 -1
- package/dist/core/import/load/rewrite.d.ts +0 -54
- package/dist/core/import/load/rewrite.js +0 -15
- package/dist/core/import/load/rollback.d.ts +0 -3
- package/dist/core/import/load/rollback.js +0 -7
- package/dist/core/import/load/run.d.ts +0 -26
- package/dist/core/import/load/run.js +0 -2
- package/dist/core/import/load/stage.d.ts +0 -15
- package/dist/core/import/load/stage.js +0 -1
- package/dist/core/import/load/stores.d.ts +0 -32
- package/dist/core/import/load/stores.js +0 -2
- package/dist/core/import/load/verify.d.ts +0 -4
- package/dist/core/import/load/verify.js +0 -13
- package/dist/daemon/api/handlers/imports.d.ts +0 -2
- package/dist/daemon/api/handlers/imports.js +0 -1
- package/dist/daemon/api/handlers/machine-credential.d.ts +0 -2
- package/dist/daemon/api/handlers/machine-credential.js +0 -1
- package/dist/daemon/api/import-auth.d.ts +0 -6
- package/dist/daemon/api/import-auth.js +0 -1
- package/dist/daemon/import-dump-run.d.ts +0 -1
- package/dist/daemon/import-dump-run.js +0 -5
- package/dist/daemon/reconcilers/import-lane.d.ts +0 -17
- package/dist/daemon/reconcilers/import-lane.js +0 -1
- package/packages/crouter-api/dist/api/dto/imports.js +0 -2
- package/packages/crouter-api/dist/build-root.js +0 -402
- package/packages/crouter-api/dist/clients/attach/ansi-cells.js +0 -137
- package/packages/crouter-api/dist/clients/attach/chrome/bash-jobs.js +0 -34
- package/packages/crouter-api/dist/clients/attach/chrome/canvas-panels.js +0 -285
- package/packages/crouter-api/dist/clients/attach/chrome/completion-bell.js +0 -89
- package/packages/crouter-api/dist/clients/attach/chrome/cron-wait.js +0 -34
- package/packages/crouter-api/dist/clients/attach/chrome/header.js +0 -30
- package/packages/crouter-api/dist/clients/attach/chrome/inbox-strip.js +0 -221
- package/packages/crouter-api/dist/clients/attach/chrome/key-hint.js +0 -16
- package/packages/crouter-api/dist/clients/attach/chrome/object-wait.js +0 -24
- package/packages/crouter-api/dist/clients/attach/chrome/recap.js +0 -19
- package/packages/crouter-api/dist/clients/attach/chrome/review-wait.js +0 -22
- package/packages/crouter-api/dist/clients/attach/chrome/roster.js +0 -283
- package/packages/crouter-api/dist/clients/attach/chrome/run-facts.js +0 -76
- package/packages/crouter-api/dist/clients/attach/chrome/status-line.js +0 -122
- package/packages/crouter-api/dist/clients/attach/chrome/ticket-panel.js +0 -261
- package/packages/crouter-api/dist/clients/attach/chrome/widgets.js +0 -60
- package/packages/crouter-api/dist/clients/attach/command.js +0 -107
- package/packages/crouter-api/dist/clients/attach/config.js +0 -280
- package/packages/crouter-api/dist/clients/attach/input/capabilities.js +0 -114
- package/packages/crouter-api/dist/clients/attach/input/clipboard-image.js +0 -237
- package/packages/crouter-api/dist/clients/attach/input/completion-frecency.js +0 -141
- package/packages/crouter-api/dist/clients/attach/input/controller.js +0 -432
- package/packages/crouter-api/dist/clients/attach/input/local-files.js +0 -113
- package/packages/crouter-api/dist/clients/attach/input/overlay-owner.js +0 -192
- package/packages/crouter-api/dist/clients/attach/input/ref-autocomplete.js +0 -176
- package/packages/crouter-api/dist/clients/attach/input/titled-editor.js +0 -859
- package/packages/crouter-api/dist/clients/attach/overlays/auth.js +0 -247
- package/packages/crouter-api/dist/clients/attach/overlays/dialogs.js +0 -102
- package/packages/crouter-api/dist/clients/attach/overlays/graph.js +0 -743
- package/packages/crouter-api/dist/clients/attach/overlays/help.js +0 -214
- package/packages/crouter-api/dist/clients/attach/overlays/mcp.js +0 -302
- package/packages/crouter-api/dist/clients/attach/overlays/pickers.js +0 -163
- package/packages/crouter-api/dist/clients/attach/render/activity-slot.js +0 -13
- package/packages/crouter-api/dist/clients/attach/render/assistant-message.js +0 -56
- package/packages/crouter-api/dist/clients/attach/render/card-presentation.js +0 -232
- package/packages/crouter-api/dist/clients/attach/render/chat-view.js +0 -1956
- package/packages/crouter-api/dist/clients/attach/render/context-message.js +0 -63
- package/packages/crouter-api/dist/clients/attach/render/crtr-output.js +0 -721
- package/packages/crouter-api/dist/clients/attach/render/diagram.js +0 -111
- package/packages/crouter-api/dist/clients/attach/render/doc-links.js +0 -78
- package/packages/crouter-api/dist/clients/attach/render/edit-diff.js +0 -304
- package/packages/crouter-api/dist/clients/attach/render/glyph-codepoints.js +0 -42
- package/packages/crouter-api/dist/clients/attach/render/group-activity.js +0 -276
- package/packages/crouter-api/dist/clients/attach/render/group-recap.js +0 -146
- package/packages/crouter-api/dist/clients/attach/render/markdown-source.js +0 -279
- package/packages/crouter-api/dist/clients/attach/render/measured-container.js +0 -322
- package/packages/crouter-api/dist/clients/attach/render/page-block.js +0 -187
- package/packages/crouter-api/dist/clients/attach/render/scroll-animation.js +0 -80
- package/packages/crouter-api/dist/clients/attach/render/tool-calls.js +0 -350
- package/packages/crouter-api/dist/clients/attach/render/transcript-copy.js +0 -81
- package/packages/crouter-api/dist/clients/attach/render/transcript-search.js +0 -152
- package/packages/crouter-api/dist/clients/attach/render/viewport.js +0 -184
- package/packages/crouter-api/dist/clients/attach/session/banner.js +0 -33
- package/packages/crouter-api/dist/clients/attach/session/bindings.js +0 -72
- package/packages/crouter-api/dist/clients/attach/session/chrome-refresh.js +0 -169
- package/packages/crouter-api/dist/clients/attach/session/connection.js +0 -185
- package/packages/crouter-api/dist/clients/attach/session/context.js +0 -16
- package/packages/crouter-api/dist/clients/attach/session/document-links.js +0 -48
- package/packages/crouter-api/dist/clients/attach/session/editor-frame.js +0 -161
- package/packages/crouter-api/dist/clients/attach/session/editor-inventory.js +0 -156
- package/packages/crouter-api/dist/clients/attach/session/file-links.js +0 -73
- package/packages/crouter-api/dist/clients/attach/session/focus-events.js +0 -12
- package/packages/crouter-api/dist/clients/attach/session/frame.js +0 -214
- package/packages/crouter-api/dist/clients/attach/session/frames.js +0 -203
- package/packages/crouter-api/dist/clients/attach/session/identity.js +0 -27
- package/packages/crouter-api/dist/clients/attach/session/input-wiring.js +0 -153
- package/packages/crouter-api/dist/clients/attach/session/invariant.js +0 -15
- package/packages/crouter-api/dist/clients/attach/session/keys.js +0 -84
- package/packages/crouter-api/dist/clients/attach/session/layout-record.js +0 -52
- package/packages/crouter-api/dist/clients/attach/session/layout.js +0 -59
- package/packages/crouter-api/dist/clients/attach/session/mouse.js +0 -78
- package/packages/crouter-api/dist/clients/attach/session/pane-focus.js +0 -42
- package/packages/crouter-api/dist/clients/attach/session/pane-tag.js +0 -118
- package/packages/crouter-api/dist/clients/attach/session/pi-assets.js +0 -24
- package/packages/crouter-api/dist/clients/attach/session/pi-oauth-flows.js +0 -21
- package/packages/crouter-api/dist/clients/attach/session/profile-files.js +0 -208
- package/packages/crouter-api/dist/clients/attach/session/readonly-popup.js +0 -25
- package/packages/crouter-api/dist/clients/attach/session/reconnect.js +0 -237
- package/packages/crouter-api/dist/clients/attach/session/selection.js +0 -108
- package/packages/crouter-api/dist/clients/attach/session/state-sync.js +0 -67
- package/packages/crouter-api/dist/clients/attach/session/surface-frame.js +0 -73
- package/packages/crouter-api/dist/clients/attach/session/surface-host.js +0 -239
- package/packages/crouter-api/dist/clients/attach/session/teardown.js +0 -102
- package/packages/crouter-api/dist/clients/attach/session/transcript-search.js +0 -151
- package/packages/crouter-api/dist/clients/attach/session/whip-achievements.js +0 -145
- package/packages/crouter-api/dist/clients/attach/session/whip.js +0 -362
- package/packages/crouter-api/dist/clients/attach/slash/dispatch.js +0 -759
- package/packages/crouter-api/dist/clients/attach/slash/prompt-preview.js +0 -121
- package/packages/crouter-api/dist/clients/attach/slash/recover.js +0 -133
- package/packages/crouter-api/dist/clients/attach/viewer.js +0 -1026
- package/packages/crouter-api/dist/clients/conversation/projection.js +0 -324
- package/packages/crouter-api/dist/clients/conversation/submit.js +0 -51
- package/packages/crouter-api/dist/clients/dashboard/app.js +0 -439
- package/packages/crouter-api/dist/clients/dashboard/model.js +0 -77
- package/packages/crouter-api/dist/clients/dashboard/render.js +0 -148
- package/packages/crouter-api/dist/clients/editor-roundtrip.js +0 -41
- package/packages/crouter-api/dist/clients/inbox/controller.js +0 -772
- package/packages/crouter-api/dist/clients/inbox/dto-adapt.js +0 -94
- package/packages/crouter-api/dist/clients/inbox/layout.js +0 -9
- package/packages/crouter-api/dist/clients/inbox/page-adapter.js +0 -56
- package/packages/crouter-api/dist/clients/inbox/resolve.js +0 -35
- package/packages/crouter-api/dist/clients/inbox/surface.js +0 -190
- package/packages/crouter-api/dist/clients/inbox/tui/ansi.js +0 -321
- package/packages/crouter-api/dist/clients/inbox/tui/input.js +0 -392
- package/packages/crouter-api/dist/clients/inbox/tui/keys.js +0 -104
- package/packages/crouter-api/dist/clients/inbox/tui/page-body.js +0 -62
- package/packages/crouter-api/dist/clients/inbox/tui/panel.js +0 -92
- package/packages/crouter-api/dist/clients/inbox/tui/render.js +0 -382
- package/packages/crouter-api/dist/clients/inbox/tui/slots.js +0 -134
- package/packages/crouter-api/dist/clients/inbox/tui/types.js +0 -1
- package/packages/crouter-api/dist/clients/inbox/tui.js +0 -91
- package/packages/crouter-api/dist/clients/open-browser.js +0 -6
- package/packages/crouter-api/dist/clients/surfaces/host.js +0 -1
- package/packages/crouter-api/dist/commands/api-client.js +0 -432
- package/packages/crouter-api/dist/commands/attention.js +0 -215
- package/packages/crouter-api/dist/commands/canvas/edges.js +0 -41
- package/packages/crouter-api/dist/commands/canvas/list.js +0 -81
- package/packages/crouter-api/dist/commands/canvas/read.js +0 -97
- package/packages/crouter-api/dist/commands/canvas/search.js +0 -51
- package/packages/crouter-api/dist/commands/canvas/share.js +0 -80
- package/packages/crouter-api/dist/commands/canvas/unwatch.js +0 -42
- package/packages/crouter-api/dist/commands/canvas/watch.js +0 -63
- package/packages/crouter-api/dist/commands/canvas-analytics/chart.js +0 -124
- package/packages/crouter-api/dist/commands/canvas-analytics/drilldown.js +0 -96
- package/packages/crouter-api/dist/commands/canvas-analytics/format.js +0 -106
- package/packages/crouter-api/dist/commands/canvas-analytics/graph-detail.js +0 -307
- package/packages/crouter-api/dist/commands/canvas-analytics/graphs.js +0 -365
- package/packages/crouter-api/dist/commands/canvas-analytics/memory.js +0 -211
- package/packages/crouter-api/dist/commands/canvas-analytics/overview.js +0 -189
- package/packages/crouter-api/dist/commands/canvas-analytics/shell.js +0 -416
- package/packages/crouter-api/dist/commands/canvas-analytics/time.js +0 -228
- package/packages/crouter-api/dist/commands/canvas-analytics/usage.js +0 -305
- package/packages/crouter-api/dist/commands/canvas-analytics/view.js +0 -102
- package/packages/crouter-api/dist/commands/canvas-analytics.js +0 -28
- package/packages/crouter-api/dist/commands/canvas-browse.js +0 -71
- package/packages/crouter-api/dist/commands/canvas-config.js +0 -192
- package/packages/crouter-api/dist/commands/canvas-history/grep.js +0 -85
- package/packages/crouter-api/dist/commands/canvas-history/read.js +0 -48
- package/packages/crouter-api/dist/commands/canvas-history/search.js +0 -99
- package/packages/crouter-api/dist/commands/canvas-history/shared.js +0 -135
- package/packages/crouter-api/dist/commands/canvas-history/stats.js +0 -68
- package/packages/crouter-api/dist/commands/canvas-history.js +0 -29
- package/packages/crouter-api/dist/commands/canvas-issue.js +0 -148
- package/packages/crouter-api/dist/commands/canvas-prune.js +0 -111
- package/packages/crouter-api/dist/commands/canvas-roster.js +0 -69
- package/packages/crouter-api/dist/commands/canvas-snapshot.js +0 -34
- package/packages/crouter-api/dist/commands/canvas-use.js +0 -61
- package/packages/crouter-api/dist/commands/canvas.js +0 -57
- package/packages/crouter-api/dist/commands/chord.js +0 -242
- package/packages/crouter-api/dist/commands/cron.js +0 -541
- package/packages/crouter-api/dist/commands/custom-object/ack.js +0 -30
- package/packages/crouter-api/dist/commands/custom-object/publish.js +0 -39
- package/packages/crouter-api/dist/commands/custom-object/receive.js +0 -69
- package/packages/crouter-api/dist/commands/custom-object/register.js +0 -69
- package/packages/crouter-api/dist/commands/custom-object/shared.js +0 -14
- package/packages/crouter-api/dist/commands/custom-object/unregister.js +0 -26
- package/packages/crouter-api/dist/commands/custom-object.js +0 -21
- package/packages/crouter-api/dist/commands/dashboard.js +0 -86
- package/packages/crouter-api/dist/commands/doc/delete.js +0 -30
- package/packages/crouter-api/dist/commands/doc/edit.js +0 -83
- package/packages/crouter-api/dist/commands/doc/history.js +0 -38
- package/packages/crouter-api/dist/commands/doc/lint.js +0 -36
- package/packages/crouter-api/dist/commands/doc/list.js +0 -19
- package/packages/crouter-api/dist/commands/doc/move.js +0 -37
- package/packages/crouter-api/dist/commands/doc/read.js +0 -19
- package/packages/crouter-api/dist/commands/doc/replace-blocks.js +0 -40
- package/packages/crouter-api/dist/commands/doc/shared.js +0 -156
- package/packages/crouter-api/dist/commands/doc/write.js +0 -53
- package/packages/crouter-api/dist/commands/doc.js +0 -27
- package/packages/crouter-api/dist/commands/human/components.js +0 -78
- package/packages/crouter-api/dist/commands/human/feedback.js +0 -112
- package/packages/crouter-api/dist/commands/human/prompts.js +0 -319
- package/packages/crouter-api/dist/commands/human/queue.js +0 -191
- package/packages/crouter-api/dist/commands/human/request.js +0 -269
- package/packages/crouter-api/dist/commands/human/review.js +0 -287
- package/packages/crouter-api/dist/commands/human/shared.js +0 -67
- package/packages/crouter-api/dist/commands/human.js +0 -63
- package/packages/crouter-api/dist/commands/node/bash.js +0 -398
- package/packages/crouter-api/dist/commands/node/create.js +0 -363
- package/packages/crouter-api/dist/commands/node/inspect.js +0 -305
- package/packages/crouter-api/dist/commands/node/lifecycle.js +0 -577
- package/packages/crouter-api/dist/commands/node/message.js +0 -170
- package/packages/crouter-api/dist/commands/node/outcome.js +0 -133
- package/packages/crouter-api/dist/commands/node/pyramid.js +0 -79
- package/packages/crouter-api/dist/commands/node/subscription.js +0 -78
- package/packages/crouter-api/dist/commands/node/wait.js +0 -157
- package/packages/crouter-api/dist/commands/node-context.js +0 -145
- package/packages/crouter-api/dist/commands/node-lifecycle-revive.js +0 -222
- package/packages/crouter-api/dist/commands/node-snapshot.js +0 -37
- package/packages/crouter-api/dist/commands/node-transcript.js +0 -59
- package/packages/crouter-api/dist/commands/node-worktree.js +0 -134
- package/packages/crouter-api/dist/commands/node.js +0 -29
- package/packages/crouter-api/dist/commands/person-settings.js +0 -30
- package/packages/crouter-api/dist/commands/pkg/app-installs.js +0 -125
- package/packages/crouter-api/dist/commands/pkg/browse/actions.js +0 -198
- package/packages/crouter-api/dist/commands/pkg/browse/catalog.js +0 -461
- package/packages/crouter-api/dist/commands/pkg/browse/command-view.js +0 -217
- package/packages/crouter-api/dist/commands/pkg/browse/detail-panel.js +0 -402
- package/packages/crouter-api/dist/commands/pkg/browse/doc-view.js +0 -84
- package/packages/crouter-api/dist/commands/pkg/browse/list-panel.js +0 -168
- package/packages/crouter-api/dist/commands/pkg/browse/model.js +0 -36
- package/packages/crouter-api/dist/commands/pkg/browse/shell.js +0 -640
- package/packages/crouter-api/dist/commands/pkg/browse.js +0 -27
- package/packages/crouter-api/dist/commands/pkg/market-inspect.js +0 -145
- package/packages/crouter-api/dist/commands/pkg/market-manage.js +0 -343
- package/packages/crouter-api/dist/commands/pkg/market.js +0 -14
- package/packages/crouter-api/dist/commands/pkg/plugin-env.js +0 -65
- package/packages/crouter-api/dist/commands/pkg/plugin-inspect.js +0 -178
- package/packages/crouter-api/dist/commands/pkg/plugin-manage.js +0 -1040
- package/packages/crouter-api/dist/commands/pkg/plugin.js +0 -14
- package/packages/crouter-api/dist/commands/pkg/shared.js +0 -62
- package/packages/crouter-api/dist/commands/pkg.js +0 -21
- package/packages/crouter-api/dist/commands/profile/daemon-profiles.js +0 -38
- package/packages/crouter-api/dist/commands/profile/default.js +0 -183
- package/packages/crouter-api/dist/commands/profile/delete.js +0 -66
- package/packages/crouter-api/dist/commands/profile/env.js +0 -188
- package/packages/crouter-api/dist/commands/profile/environment.js +0 -111
- package/packages/crouter-api/dist/commands/profile/kind.js +0 -27
- package/packages/crouter-api/dist/commands/profile/list.js +0 -45
- package/packages/crouter-api/dist/commands/profile/meta.js +0 -65
- package/packages/crouter-api/dist/commands/profile/new.js +0 -107
- package/packages/crouter-api/dist/commands/profile/pause.js +0 -59
- package/packages/crouter-api/dist/commands/profile/project.js +0 -147
- package/packages/crouter-api/dist/commands/profile/rename.js +0 -41
- package/packages/crouter-api/dist/commands/profile/show.js +0 -55
- package/packages/crouter-api/dist/commands/profile.js +0 -36
- package/packages/crouter-api/dist/commands/push.js +0 -357
- package/packages/crouter-api/dist/commands/revive.js +0 -183
- package/packages/crouter-api/dist/commands/surface/node/cycle.js +0 -83
- package/packages/crouter-api/dist/commands/surface/node/focus.js +0 -60
- package/packages/crouter-api/dist/commands/surface/node/id.js +0 -38
- package/packages/crouter-api/dist/commands/surface/node/pin.js +0 -42
- package/packages/crouter-api/dist/commands/surface/node/placement.js +0 -49
- package/packages/crouter-api/dist/commands/surface-dashboard.js +0 -138
- package/packages/crouter-api/dist/commands/surface-edit.js +0 -157
- package/packages/crouter-api/dist/commands/surface-inbox.js +0 -98
- package/packages/crouter-api/dist/commands/surface-inspect.js +0 -41
- package/packages/crouter-api/dist/commands/surface-node.js +0 -19
- package/packages/crouter-api/dist/commands/surface-tmux-spread.js +0 -214
- package/packages/crouter-api/dist/commands/surface.js +0 -28
- package/packages/crouter-api/dist/commands/sys/branch.js +0 -19
- package/packages/crouter-api/dist/commands/sys/config.js +0 -353
- package/packages/crouter-api/dist/commands/sys/context/admin/actions.js +0 -89
- package/packages/crouter-api/dist/commands/sys/context/admin/detail-panel.js +0 -233
- package/packages/crouter-api/dist/commands/sys/context/admin/docs-panel.js +0 -185
- package/packages/crouter-api/dist/commands/sys/context/admin/list-view.js +0 -170
- package/packages/crouter-api/dist/commands/sys/context/admin/model.js +0 -179
- package/packages/crouter-api/dist/commands/sys/context/admin/rail-panel.js +0 -229
- package/packages/crouter-api/dist/commands/sys/context/admin/read-view.js +0 -172
- package/packages/crouter-api/dist/commands/sys/context/admin/shell.js +0 -870
- package/packages/crouter-api/dist/commands/sys/context/admin.js +0 -148
- package/packages/crouter-api/dist/commands/sys/context/doc.js +0 -126
- package/packages/crouter-api/dist/commands/sys/context/expose.js +0 -66
- package/packages/crouter-api/dist/commands/sys/context/prompt-review.js +0 -244
- package/packages/crouter-api/dist/commands/sys/context/resolve.js +0 -326
- package/packages/crouter-api/dist/commands/sys/context/sysprompt.js +0 -95
- package/packages/crouter-api/dist/commands/sys/context.js +0 -21
- package/packages/crouter-api/dist/commands/sys/daemon.js +0 -354
- package/packages/crouter-api/dist/commands/sys/desktop.js +0 -201
- package/packages/crouter-api/dist/commands/sys/doctor.js +0 -650
- package/packages/crouter-api/dist/commands/sys/env.js +0 -39
- package/packages/crouter-api/dist/commands/sys/feedback.js +0 -238
- package/packages/crouter-api/dist/commands/sys/import/move.js +0 -205
- package/packages/crouter-api/dist/commands/sys/import/resume.js +0 -23
- package/packages/crouter-api/dist/commands/sys/import/start.js +0 -57
- package/packages/crouter-api/dist/commands/sys/join.js +0 -53
- package/packages/crouter-api/dist/commands/sys/limits.js +0 -133
- package/packages/crouter-api/dist/commands/sys/logs.js +0 -129
- package/packages/crouter-api/dist/commands/sys/machine/rotate.js +0 -49
- package/packages/crouter-api/dist/commands/sys/panels/broker-limits-panel.js +0 -110
- package/packages/crouter-api/dist/commands/sys/panels/dependencies-panel.js +0 -80
- package/packages/crouter-api/dist/commands/sys/panels/keybindings-panel.js +0 -703
- package/packages/crouter-api/dist/commands/sys/panels/models-panel.js +0 -1160
- package/packages/crouter-api/dist/commands/sys/panels/plugin-env-panel.js +0 -70
- package/packages/crouter-api/dist/commands/sys/panels/plugins-panel.js +0 -87
- package/packages/crouter-api/dist/commands/sys/panels/prefs-panel.js +0 -97
- package/packages/crouter-api/dist/commands/sys/panels/profiles-panel.js +0 -656
- package/packages/crouter-api/dist/commands/sys/panels/provider-panel.js +0 -534
- package/packages/crouter-api/dist/commands/sys/panels/terminal-panel.js +0 -67
- package/packages/crouter-api/dist/commands/sys/provider-login.js +0 -99
- package/packages/crouter-api/dist/commands/sys/retry-delivery.js +0 -33
- package/packages/crouter-api/dist/commands/sys/settings-shell.js +0 -400
- package/packages/crouter-api/dist/commands/sys/settings.js +0 -46
- package/packages/crouter-api/dist/commands/sys/setup-core.js +0 -882
- package/packages/crouter-api/dist/commands/sys/setup-settings-runner.js +0 -15
- package/packages/crouter-api/dist/commands/sys/setup-wizard.js +0 -351
- package/packages/crouter-api/dist/commands/sys/setup.js +0 -41
- package/packages/crouter-api/dist/commands/sys/shared.js +0 -81
- package/packages/crouter-api/dist/commands/sys/signin.js +0 -169
- package/packages/crouter-api/dist/commands/sys/spaces.js +0 -22
- package/packages/crouter-api/dist/commands/sys/spend.js +0 -144
- package/packages/crouter-api/dist/commands/sys/support/prepare.js +0 -239
- package/packages/crouter-api/dist/commands/sys/support/submit.js +0 -524
- package/packages/crouter-api/dist/commands/sys/support.js +0 -18
- package/packages/crouter-api/dist/commands/sys/sync-deps.js +0 -445
- package/packages/crouter-api/dist/commands/sys/sync-project-guidance.js +0 -320
- package/packages/crouter-api/dist/commands/sys/sync-shared.js +0 -139
- package/packages/crouter-api/dist/commands/sys/sync-skills.js +0 -297
- package/packages/crouter-api/dist/commands/sys/sync.js +0 -17
- package/packages/crouter-api/dist/commands/sys/terminal-option.js +0 -542
- package/packages/crouter-api/dist/commands/sys/tutorial/branch.js +0 -15
- package/packages/crouter-api/dist/commands/sys/tutorial/lessons.js +0 -107
- package/packages/crouter-api/dist/commands/sys/tutorial/scenario.js +0 -432
- package/packages/crouter-api/dist/commands/sys/tutorial/tracks.js +0 -96
- package/packages/crouter-api/dist/commands/sys/update.js +0 -158
- package/packages/crouter-api/dist/commands/sys/worktrees.js +0 -53
- package/packages/crouter-api/dist/commands/sys.js +0 -28
- package/packages/crouter-api/dist/core/activity-signal.js +0 -38
- package/packages/crouter-api/dist/core/async-array.js +0 -48
- package/packages/crouter-api/dist/core/auth-file.js +0 -89
- package/packages/crouter-api/dist/core/auth-interaction.js +0 -94
- package/packages/crouter-api/dist/core/bash-guard.js +0 -527
- package/packages/crouter-api/dist/core/bash-job-supervisor.js +0 -170
- package/packages/crouter-api/dist/core/bash-jobs.js +0 -460
- package/packages/crouter-api/dist/core/blobs/directory.js +0 -264
- package/packages/crouter-api/dist/core/blobs/fault.js +0 -6
- package/packages/crouter-api/dist/core/blobs/index.js +0 -30
- package/packages/crouter-api/dist/core/blobs/r2.js +0 -169
- package/packages/crouter-api/dist/core/broker-client/client.js +0 -186
- package/packages/crouter-api/dist/core/broker-client/index.js +0 -14
- package/packages/crouter-api/dist/core/broker-client/transport-relay.js +0 -256
- package/packages/crouter-api/dist/core/broker-client/transport-socket.js +0 -187
- package/packages/crouter-api/dist/core/broker-client/transport.js +0 -40
- package/packages/crouter-api/dist/core/canvas/app-run.js +0 -4
- package/packages/crouter-api/dist/core/canvas/attention.js +0 -47
- package/packages/crouter-api/dist/core/canvas/browse/app.js +0 -1050
- package/packages/crouter-api/dist/core/canvas/browse/model.js +0 -477
- package/packages/crouter-api/dist/core/canvas/browse/pins.js +0 -29
- package/packages/crouter-api/dist/core/canvas/browse/render.js +0 -1058
- package/packages/crouter-api/dist/core/canvas/canvas.js +0 -1260
- package/packages/crouter-api/dist/core/canvas/crons.js +0 -557
- package/packages/crouter-api/dist/core/canvas/daemon-actions.js +0 -99
- package/packages/crouter-api/dist/core/canvas/db.js +0 -442
- package/packages/crouter-api/dist/core/canvas/deliveries.js +0 -402
- package/packages/crouter-api/dist/core/canvas/delivery-contract.js +0 -30
- package/packages/crouter-api/dist/core/canvas/executions.js +0 -270
- package/packages/crouter-api/dist/core/canvas/extensions.js +0 -90
- package/packages/crouter-api/dist/core/canvas/focuses.js +0 -82
- package/packages/crouter-api/dist/core/canvas/history.js +0 -480
- package/packages/crouter-api/dist/core/canvas/index.js +0 -16
- package/packages/crouter-api/dist/core/canvas/install-id.js +0 -64
- package/packages/crouter-api/dist/core/canvas/labels.js +0 -43
- package/packages/crouter-api/dist/core/canvas/legacy-person.js +0 -4
- package/packages/crouter-api/dist/core/canvas/memory-reads.js +0 -37
- package/packages/crouter-api/dist/core/canvas/meta-file.js +0 -89
- package/packages/crouter-api/dist/core/canvas/nav-render.js +0 -224
- package/packages/crouter-api/dist/core/canvas/node-agent-paths.js +0 -30
- package/packages/crouter-api/dist/core/canvas/node-order.js +0 -37
- package/packages/crouter-api/dist/core/canvas/node-recap.js +0 -62
- package/packages/crouter-api/dist/core/canvas/node-tokens.js +0 -53
- package/packages/crouter-api/dist/core/canvas/outcome-actions.js +0 -71
- package/packages/crouter-api/dist/core/canvas/person.js +0 -239
- package/packages/crouter-api/dist/core/canvas/reconciler-leases.js +0 -44
- package/packages/crouter-api/dist/core/canvas/recovery.js +0 -715
- package/packages/crouter-api/dist/core/canvas/remote-canvas-source.js +0 -290
- package/packages/crouter-api/dist/core/canvas/remote-transport.js +0 -57
- package/packages/crouter-api/dist/core/canvas/render-source.js +0 -518
- package/packages/crouter-api/dist/core/canvas/schema-chain.js +0 -110
- package/packages/crouter-api/dist/core/canvas/schema-version.js +0 -58
- package/packages/crouter-api/dist/core/canvas/sessions.js +0 -128
- package/packages/crouter-api/dist/core/canvas/source.js +0 -57
- package/packages/crouter-api/dist/core/canvas/status-glyph.js +0 -147
- package/packages/crouter-api/dist/core/canvas/structured-requests.js +0 -176
- package/packages/crouter-api/dist/core/canvas/telemetry.js +0 -35
- package/packages/crouter-api/dist/core/canvas/tree.js +0 -150
- package/packages/crouter-api/dist/core/canvas/types.js +0 -6
- package/packages/crouter-api/dist/core/canvas/waits.js +0 -113
- package/packages/crouter-api/dist/core/canvas/worktrees.js +0 -97
- package/packages/crouter-api/dist/core/checkout-identities.js +0 -107
- package/packages/crouter-api/dist/core/clipboard-text.js +0 -57
- package/packages/crouter-api/dist/core/command-hooks/artifact.js +0 -145
- package/packages/crouter-api/dist/core/command-hooks/catalog.js +0 -38
- package/packages/crouter-api/dist/core/command-hooks/compose.js +0 -101
- package/packages/crouter-api/dist/core/command-hooks/discovery.js +0 -246
- package/packages/crouter-api/dist/core/command-hooks/help.js +0 -18
- package/packages/crouter-api/dist/core/command-hooks/lifecycle-catalog.js +0 -9
- package/packages/crouter-api/dist/core/command-hooks/lifecycle-create.js +0 -51
- package/packages/crouter-api/dist/core/command-hooks/report.js +0 -28
- package/packages/crouter-api/dist/core/command-hooks/schema.js +0 -157
- package/packages/crouter-api/dist/core/command-hooks/transport/exec-invoke.js +0 -315
- package/packages/crouter-api/dist/core/command-hooks/transport/exec-lifecycle.js +0 -248
- package/packages/crouter-api/dist/core/command-hooks/transport/plan.js +0 -30
- package/packages/crouter-api/dist/core/command-manifests/registry.js +0 -118
- package/packages/crouter-api/dist/core/command-plugins/caller-header.js +0 -15
- package/packages/crouter-api/dist/core/command-plugins/compose.js +0 -263
- package/packages/crouter-api/dist/core/command-plugins/discovery.js +0 -240
- package/packages/crouter-api/dist/core/command-plugins/extensions.js +0 -166
- package/packages/crouter-api/dist/core/command-plugins/help-addenda.js +0 -55
- package/packages/crouter-api/dist/core/command-plugins/presence.js +0 -36
- package/packages/crouter-api/dist/core/command-plugins/transport/exec-invoke.js +0 -138
- package/packages/crouter-api/dist/core/command-plugins/transport/http-fetch.js +0 -68
- package/packages/crouter-api/dist/core/command-plugins/transport/http-invoke.js +0 -333
- package/packages/crouter-api/dist/core/command-plugins/transport/http-plan.js +0 -349
- package/packages/crouter-api/dist/core/command-plugins/transport/sign.js +0 -115
- package/packages/crouter-api/dist/core/command.js +0 -896
- package/packages/crouter-api/dist/core/conversation-store/row-store.js +0 -420
- package/packages/crouter-api/dist/core/directory/issuer.js +0 -15
- package/packages/crouter-api/dist/core/directory/person-credential.js +0 -237
- package/packages/crouter-api/dist/core/directory/reach.js +0 -19
- package/packages/crouter-api/dist/core/document-lines.js +0 -6
- package/packages/crouter-api/dist/core/editor-resolver.js +0 -77
- package/packages/crouter-api/dist/core/environment-recipe.js +0 -62
- package/packages/crouter-api/dist/core/environment-starter-script.js +0 -64
- package/packages/crouter-api/dist/core/environments.js +0 -24
- package/packages/crouter-api/dist/core/events/outbound.js +0 -92
- package/packages/crouter-api/dist/core/events/read.js +0 -625
- package/packages/crouter-api/dist/core/fault-classifier.js +0 -101
- package/packages/crouter-api/dist/core/feed/feed.js +0 -190
- package/packages/crouter-api/dist/core/feed/inbox.js +0 -93
- package/packages/crouter-api/dist/core/feed/messages.js +0 -234
- package/packages/crouter-api/dist/core/feed/reports.js +0 -58
- package/packages/crouter-api/dist/core/frontmatter.js +0 -35
- package/packages/crouter-api/dist/core/git.js +0 -103
- package/packages/crouter-api/dist/core/grants/cover.js +0 -66
- package/packages/crouter-api/dist/core/grants/hosted-endpoint.js +0 -70
- package/packages/crouter-api/dist/core/grants/local.js +0 -26
- package/packages/crouter-api/dist/core/grants/mirror.js +0 -506
- package/packages/crouter-api/dist/core/grants/on-sync.js +0 -163
- package/packages/crouter-api/dist/core/grants/owner.js +0 -21
- package/packages/crouter-api/dist/core/grants/shadow.js +0 -138
- package/packages/crouter-api/dist/core/grants/sync.js +0 -220
- package/packages/crouter-api/dist/core/grants/terminal.js +0 -25
- package/packages/crouter-api/dist/core/graph/access.js +0 -37
- package/packages/crouter-api/dist/core/graph/bodies.js +0 -68
- package/packages/crouter-api/dist/core/graph/custom.js +0 -298
- package/packages/crouter-api/dist/core/graph/deletion.js +0 -115
- package/packages/crouter-api/dist/core/graph/documents.js +0 -666
- package/packages/crouter-api/dist/core/graph/edges.js +0 -83
- package/packages/crouter-api/dist/core/graph/events.js +0 -432
- package/packages/crouter-api/dist/core/graph/exposures.js +0 -164
- package/packages/crouter-api/dist/core/graph/jobs.js +0 -184
- package/packages/crouter-api/dist/core/graph/kinds/action.js +0 -20
- package/packages/crouter-api/dist/core/graph/kinds/custom.js +0 -23
- package/packages/crouter-api/dist/core/graph/kinds/document.js +0 -115
- package/packages/crouter-api/dist/core/graph/kinds/dto.js +0 -20
- package/packages/crouter-api/dist/core/graph/kinds/environment.js +0 -19
- package/packages/crouter-api/dist/core/graph/kinds/job.js +0 -22
- package/packages/crouter-api/dist/core/graph/kinds/kind.js +0 -15
- package/packages/crouter-api/dist/core/graph/kinds/node.js +0 -85
- package/packages/crouter-api/dist/core/graph/kinds/owner.js +0 -24
- package/packages/crouter-api/dist/core/graph/kinds/registry.js +0 -58
- package/packages/crouter-api/dist/core/graph/kinds/render.js +0 -17
- package/packages/crouter-api/dist/core/graph/names.js +0 -225
- package/packages/crouter-api/dist/core/graph/objects.js +0 -277
- package/packages/crouter-api/dist/core/graph/package-docs.js +0 -153
- package/packages/crouter-api/dist/core/graph/package-files.js +0 -146
- package/packages/crouter-api/dist/core/graph/package-publish.js +0 -165
- package/packages/crouter-api/dist/core/graph/package-reconcile.js +0 -99
- package/packages/crouter-api/dist/core/graph/reader.js +0 -315
- package/packages/crouter-api/dist/core/graph/receiver-url.js +0 -83
- package/packages/crouter-api/dist/core/graph/receivers.js +0 -66
- package/packages/crouter-api/dist/core/graph/repo-sync/identity.js +0 -147
- package/packages/crouter-api/dist/core/graph/repo-sync/repos.js +0 -134
- package/packages/crouter-api/dist/core/graph/rules.js +0 -144
- package/packages/crouter-api/dist/core/graph/types.js +0 -10
- package/packages/crouter-api/dist/core/graph/watches.js +0 -223
- package/packages/crouter-api/dist/core/human/action-binding.js +0 -41
- package/packages/crouter-api/dist/core/human/answer-text.js +0 -100
- package/packages/crouter-api/dist/core/human/answer.js +0 -119
- package/packages/crouter-api/dist/core/human/completion.js +0 -27
- package/packages/crouter-api/dist/core/human/component-docs.js +0 -442
- package/packages/crouter-api/dist/core/human/convention.js +0 -75
- package/packages/crouter-api/dist/core/human/feedback-companion.js +0 -92
- package/packages/crouter-api/dist/core/human/feedback.js +0 -88
- package/packages/crouter-api/dist/core/human/page-authoring.js +0 -19
- package/packages/crouter-api/dist/core/human/page-errors.js +0 -14
- package/packages/crouter-api/dist/core/human/page-eval.js +0 -125
- package/packages/crouter-api/dist/core/human/page-html-markdown.js +0 -260
- package/packages/crouter-api/dist/core/human/page-markdown.js +0 -291
- package/packages/crouter-api/dist/core/human/page-schema.js +0 -381
- package/packages/crouter-api/dist/core/human/page.js +0 -251
- package/packages/crouter-api/dist/core/human/request-files.js +0 -54
- package/packages/crouter-api/dist/core/human/requests.js +0 -647
- package/packages/crouter-api/dist/core/human/root.js +0 -11
- package/packages/crouter-api/dist/core/human/summary.js +0 -5
- package/packages/crouter-api/dist/core/human/tickets.js +0 -166
- package/packages/crouter-api/dist/core/human/types.js +0 -1
- package/packages/crouter-api/dist/core/human/visible-paths.js +0 -74
- package/packages/crouter-api/dist/core/human-actions.js +0 -101
- package/packages/crouter-api/dist/core/import/bundle/blob-keys.js +0 -25
- package/packages/crouter-api/dist/core/import/bundle/layout.js +0 -111
- package/packages/crouter-api/dist/core/import/export/archive.js +0 -22
- package/packages/crouter-api/dist/core/import/export/cloud.js +0 -175
- package/packages/crouter-api/dist/core/import/export/dump.js +0 -245
- package/packages/crouter-api/dist/core/import/export/files.js +0 -169
- package/packages/crouter-api/dist/core/import/export/inline.js +0 -15
- package/packages/crouter-api/dist/core/import/export/source.js +0 -5
- package/packages/crouter-api/dist/core/import/export/stores.js +0 -73
- package/packages/crouter-api/dist/core/import/load/catalog.js +0 -70
- package/packages/crouter-api/dist/core/import/load/copy.js +0 -173
- package/packages/crouter-api/dist/core/import/load/keys.js +0 -77
- package/packages/crouter-api/dist/core/import/load/prepare.js +0 -262
- package/packages/crouter-api/dist/core/import/load/rewrite.js +0 -314
- package/packages/crouter-api/dist/core/import/load/stage.js +0 -99
- package/packages/crouter-api/dist/core/inspector/chrome.js +0 -14
- package/packages/crouter-api/dist/core/inspector/contract.js +0 -1
- package/packages/crouter-api/dist/core/inspector/core.js +0 -296
- package/packages/crouter-api/dist/core/inspector/host.js +0 -538
- package/packages/crouter-api/dist/core/inspector/model.js +0 -225
- package/packages/crouter-api/dist/core/inspector/text.js +0 -45
- package/packages/crouter-api/dist/core/inspector/transport.js +0 -36
- package/packages/crouter-api/dist/core/inspector/tui.js +0 -295
- package/packages/crouter-api/dist/core/keybindings/background-bash.js +0 -33
- package/packages/crouter-api/dist/core/keybindings/inbox.js +0 -25
- package/packages/crouter-api/dist/core/keybindings/index.js +0 -7
- package/packages/crouter-api/dist/core/keybindings/match.js +0 -146
- package/packages/crouter-api/dist/core/keybindings/persistence.js +0 -47
- package/packages/crouter-api/dist/core/keybindings/resolve.js +0 -348
- package/packages/crouter-api/dist/core/ledger/account.js +0 -13
- package/packages/crouter-api/dist/core/ledger/charges.js +0 -44
- package/packages/crouter-api/dist/core/ledger/check.js +0 -40
- package/packages/crouter-api/dist/core/ledger/chunks.js +0 -47
- package/packages/crouter-api/dist/core/ledger/environment-payer.js +0 -15
- package/packages/crouter-api/dist/core/ledger/index.js +0 -11
- package/packages/crouter-api/dist/core/ledger/infra-allowance.js +0 -31
- package/packages/crouter-api/dist/core/ledger/limits.js +0 -35
- package/packages/crouter-api/dist/core/ledger/months.js +0 -19
- package/packages/crouter-api/dist/core/ledger/payer.js +0 -23
- package/packages/crouter-api/dist/core/ledger/read.js +0 -211
- package/packages/crouter-api/dist/core/ledger/totals.js +0 -34
- package/packages/crouter-api/dist/core/ledger/types.js +0 -2
- package/packages/crouter-api/dist/core/llm/app-rungs.js +0 -64
- package/packages/crouter-api/dist/core/llm/body-limits.js +0 -7
- package/packages/crouter-api/dist/core/llm/owner-candidates.js +0 -79
- package/packages/crouter-api/dist/core/llm/refusal.js +0 -22
- package/packages/crouter-api/dist/core/llm/run.js +0 -571
- package/packages/crouter-api/dist/core/logged-step-timings.js +0 -52
- package/packages/crouter-api/dist/core/manifest-stale.js +0 -39
- package/packages/crouter-api/dist/core/model-auth/api-credential-store.js +0 -49
- package/packages/crouter-api/dist/core/model-auth/daemon-login.js +0 -156
- package/packages/crouter-api/dist/core/model-auth/readiness.js +0 -83
- package/packages/crouter-api/dist/core/model-routes-pool.js +0 -57
- package/packages/crouter-api/dist/core/model-routes.js +0 -212
- package/packages/crouter-api/dist/core/northlight/previews.js +0 -87
- package/packages/crouter-api/dist/core/nvim-launch.js +0 -45
- package/packages/crouter-api/dist/core/output.js +0 -99
- package/packages/crouter-api/dist/core/packages/eligibility.js +0 -34
- package/packages/crouter-api/dist/core/packages/launch-kinds.js +0 -20
- package/packages/crouter-api/dist/core/packages/source-url.js +0 -17
- package/packages/crouter-api/dist/core/pagination.js +0 -88
- package/packages/crouter-api/dist/core/peer/client.js +0 -168
- package/packages/crouter-api/dist/core/peer/directory.js +0 -193
- package/packages/crouter-api/dist/core/peer/envelope.js +0 -99
- package/packages/crouter-api/dist/core/peer/names.js +0 -8
- package/packages/crouter-api/dist/core/peer/outbox-store.js +0 -84
- package/packages/crouter-api/dist/core/peer/receiver.js +0 -54
- package/packages/crouter-api/dist/core/peer/stubs.js +0 -212
- package/packages/crouter-api/dist/core/peer/token.js +0 -30
- package/packages/crouter-api/dist/core/peer/version.js +0 -23
- package/packages/crouter-api/dist/core/permissions/builtin.js +0 -29
- package/packages/crouter-api/dist/core/permissions/ceiling.js +0 -345
- package/packages/crouter-api/dist/core/permissions/compile.js +0 -175
- package/packages/crouter-api/dist/core/permissions/errors.js +0 -13
- package/packages/crouter-api/dist/core/permissions/evaluator.js +0 -139
- package/packages/crouter-api/dist/core/permissions/facts.js +0 -102
- package/packages/crouter-api/dist/core/permissions/schema-parser.js +0 -151
- package/packages/crouter-api/dist/core/permissions/schemas.js +0 -83
- package/packages/crouter-api/dist/core/permissions/sql.js +0 -31
- package/packages/crouter-api/dist/core/plugin-app.js +0 -58
- package/packages/crouter-api/dist/core/plugin-quarantine.js +0 -70
- package/packages/crouter-api/dist/core/pool-credential-store.js +0 -135
- package/packages/crouter-api/dist/core/predicate.js +0 -191
- package/packages/crouter-api/dist/core/preview-registry.js +0 -399
- package/packages/crouter-api/dist/core/profiles/default-binding.js +0 -29
- package/packages/crouter-api/dist/core/profiles/deletion-reservation.js +0 -42
- package/packages/crouter-api/dist/core/profiles/select.js +0 -750
- package/packages/crouter-api/dist/core/provider-credential.js +0 -17
- package/packages/crouter-api/dist/core/provider-error-recognition.js +0 -82
- package/packages/crouter-api/dist/core/provider-failure.js +0 -166
- package/packages/crouter-api/dist/core/provider-management.js +0 -9
- package/packages/crouter-api/dist/core/providers/approval.js +0 -146
- package/packages/crouter-api/dist/core/providers/audit.js +0 -52
- package/packages/crouter-api/dist/core/providers/bundles.js +0 -643
- package/packages/crouter-api/dist/core/providers/call.js +0 -503
- package/packages/crouter-api/dist/core/providers/description.js +0 -1
- package/packages/crouter-api/dist/core/providers/device-libs.js +0 -202
- package/packages/crouter-api/dist/core/providers/device.js +0 -95
- package/packages/crouter-api/dist/core/providers/errors.js +0 -137
- package/packages/crouter-api/dist/core/providers/files.js +0 -461
- package/packages/crouter-api/dist/core/providers/inflight.js +0 -14
- package/packages/crouter-api/dist/core/providers/mint.js +0 -248
- package/packages/crouter-api/dist/core/providers/receipts.js +0 -50
- package/packages/crouter-api/dist/core/providers/request.js +0 -173
- package/packages/crouter-api/dist/core/providers/roots.js +0 -118
- package/packages/crouter-api/dist/core/providers/token-cache.js +0 -203
- package/packages/crouter-api/dist/core/remote-canvas-target.js +0 -30
- package/packages/crouter-api/dist/core/review/anchors.js +0 -91
- package/packages/crouter-api/dist/core/review/comments.js +0 -277
- package/packages/crouter-api/dist/core/review/companion.js +0 -207
- package/packages/crouter-api/dist/core/review/document.js +0 -71
- package/packages/crouter-api/dist/core/review/project.js +0 -46
- package/packages/crouter-api/dist/core/review/store.js +0 -178
- package/packages/crouter-api/dist/core/review/types.js +0 -23
- package/packages/crouter-api/dist/core/runs/activity.js +0 -57
- package/packages/crouter-api/dist/core/runs/events.js +0 -179
- package/packages/crouter-api/dist/core/runs/initial-input.js +0 -27
- package/packages/crouter-api/dist/core/runs/node-sub.js +0 -10
- package/packages/crouter-api/dist/core/runs/operations.js +0 -800
- package/packages/crouter-api/dist/core/runs/questions.js +0 -151
- package/packages/crouter-api/dist/core/runtime/banner.js +0 -53
- package/packages/crouter-api/dist/core/runtime/bearings-render.js +0 -284
- package/packages/crouter-api/dist/core/runtime/bearings.js +0 -208
- package/packages/crouter-api/dist/core/runtime/bin-contributions.js +0 -186
- package/packages/crouter-api/dist/core/runtime/blaxel-environment.js +0 -17
- package/packages/crouter-api/dist/core/runtime/broker/bash-job-launch.js +0 -65
- package/packages/crouter-api/dist/core/runtime/broker/model-adapter.js +0 -453
- package/packages/crouter-api/dist/core/runtime/broker/read-ops.js +0 -174
- package/packages/crouter-api/dist/core/runtime/broker/turn-cause.js +0 -44
- package/packages/crouter-api/dist/core/runtime/broker-ownership.js +0 -6
- package/packages/crouter-api/dist/core/runtime/broker-protocol.js +0 -166
- package/packages/crouter-api/dist/core/runtime/broker-request.js +0 -86
- package/packages/crouter-api/dist/core/runtime/broker-sdk.js +0 -130
- package/packages/crouter-api/dist/core/runtime/broker-wedge.js +0 -97
- package/packages/crouter-api/dist/core/runtime/canvas-extensions.js +0 -100
- package/packages/crouter-api/dist/core/runtime/close.js +0 -266
- package/packages/crouter-api/dist/core/runtime/command-expansion.js +0 -104
- package/packages/crouter-api/dist/core/runtime/command-surface.js +0 -117
- package/packages/crouter-api/dist/core/runtime/crtr-theme.js +0 -146
- package/packages/crouter-api/dist/core/runtime/deliver-live.js +0 -85
- package/packages/crouter-api/dist/core/runtime/fault-recovery.js +0 -72
- package/packages/crouter-api/dist/core/runtime/fault.js +0 -17
- package/packages/crouter-api/dist/core/runtime/fleet.js +0 -75
- package/packages/crouter-api/dist/core/runtime/focus-viewer.js +0 -151
- package/packages/crouter-api/dist/core/runtime/front-door-env.js +0 -16
- package/packages/crouter-api/dist/core/runtime/headless-pi.js +0 -176
- package/packages/crouter-api/dist/core/runtime/host.js +0 -717
- package/packages/crouter-api/dist/core/runtime/interactive-deliver.js +0 -51
- package/packages/crouter-api/dist/core/runtime/invocation.js +0 -10
- package/packages/crouter-api/dist/core/runtime/kickoff.js +0 -263
- package/packages/crouter-api/dist/core/runtime/launch-prompt.js +0 -13
- package/packages/crouter-api/dist/core/runtime/launch-recipe.js +0 -45
- package/packages/crouter-api/dist/core/runtime/launch-target.js +0 -87
- package/packages/crouter-api/dist/core/runtime/launch.js +0 -505
- package/packages/crouter-api/dist/core/runtime/ledger.js +0 -55
- package/packages/crouter-api/dist/core/runtime/lifecycle.js +0 -286
- package/packages/crouter-api/dist/core/runtime/managed-provider-cooling.js +0 -62
- package/packages/crouter-api/dist/core/runtime/memory-admission.js +0 -68
- package/packages/crouter-api/dist/core/runtime/model-registry.js +0 -13
- package/packages/crouter-api/dist/core/runtime/model-selection.js +0 -135
- package/packages/crouter-api/dist/core/runtime/model-swap.js +0 -76
- package/packages/crouter-api/dist/core/runtime/naming.js +0 -300
- package/packages/crouter-api/dist/core/runtime/nerd-font.js +0 -162
- package/packages/crouter-api/dist/core/runtime/nodes.js +0 -506
- package/packages/crouter-api/dist/core/runtime/outcome-document.js +0 -86
- package/packages/crouter-api/dist/core/runtime/output-result.js +0 -32
- package/packages/crouter-api/dist/core/runtime/output-schema-refs.js +0 -100
- package/packages/crouter-api/dist/core/runtime/package-health.js +0 -100
- package/packages/crouter-api/dist/core/runtime/persona.js +0 -54
- package/packages/crouter-api/dist/core/runtime/pi-cli.js +0 -65
- package/packages/crouter-api/dist/core/runtime/pi-vendored.js +0 -63
- package/packages/crouter-api/dist/core/runtime/placement-tmux.js +0 -81
- package/packages/crouter-api/dist/core/runtime/placement.js +0 -418
- package/packages/crouter-api/dist/core/runtime/progress-bar.js +0 -50
- package/packages/crouter-api/dist/core/runtime/provider-credential-gate.js +0 -48
- package/packages/crouter-api/dist/core/runtime/recovery-hold.js +0 -46
- package/packages/crouter-api/dist/core/runtime/reopen.js +0 -165
- package/packages/crouter-api/dist/core/runtime/revive-all.js +0 -108
- package/packages/crouter-api/dist/core/runtime/revive.js +0 -762
- package/packages/crouter-api/dist/core/runtime/roadmap.js +0 -86
- package/packages/crouter-api/dist/core/runtime/runner/blaxel/client.js +0 -150
- package/packages/crouter-api/dist/core/runtime/runner/blaxel/image-build.js +0 -280
- package/packages/crouter-api/dist/core/runtime/runner/blaxel/release-image.js +0 -97
- package/packages/crouter-api/dist/core/runtime/runner/blaxel/runner.js +0 -214
- package/packages/crouter-api/dist/core/runtime/runner/delete-sandboxes.js +0 -88
- package/packages/crouter-api/dist/core/runtime/runner/index.js +0 -37
- package/packages/crouter-api/dist/core/runtime/runner/machine/call.js +0 -110
- package/packages/crouter-api/dist/core/runtime/runner/machine/environment.js +0 -7
- package/packages/crouter-api/dist/core/runtime/runner/machine/executor.js +0 -235
- package/packages/crouter-api/dist/core/runtime/runner/machine/ops.js +0 -37
- package/packages/crouter-api/dist/core/runtime/runner/machine/runner.js +0 -72
- package/packages/crouter-api/dist/core/runtime/runner/process.js +0 -70
- package/packages/crouter-api/dist/core/runtime/runner/types.js +0 -16
- package/packages/crouter-api/dist/core/runtime/session-branch.js +0 -16
- package/packages/crouter-api/dist/core/runtime/session-cycles.js +0 -144
- package/packages/crouter-api/dist/core/runtime/session-list-cache.js +0 -302
- package/packages/crouter-api/dist/core/runtime/session-visibility.js +0 -99
- package/packages/crouter-api/dist/core/runtime/setup-marker.js +0 -46
- package/packages/crouter-api/dist/core/runtime/situational-context.js +0 -54
- package/packages/crouter-api/dist/core/runtime/situational-live.js +0 -41
- package/packages/crouter-api/dist/core/runtime/spawn-env-rows.js +0 -15
- package/packages/crouter-api/dist/core/runtime/spawn-env.js +0 -260
- package/packages/crouter-api/dist/core/runtime/spawn.js +0 -867
- package/packages/crouter-api/dist/core/runtime/stamp/protocol.js +0 -113
- package/packages/crouter-api/dist/core/runtime/start-check.js +0 -43
- package/packages/crouter-api/dist/core/runtime/stop-guard.js +0 -150
- package/packages/crouter-api/dist/core/runtime/stop-signals.js +0 -46
- package/packages/crouter-api/dist/core/runtime/structured-output.js +0 -112
- package/packages/crouter-api/dist/core/runtime/surface-bg.js +0 -85
- package/packages/crouter-api/dist/core/runtime/tmux-bindings.js +0 -738
- package/packages/crouter-api/dist/core/runtime/tmux-chrome.js +0 -5
- package/packages/crouter-api/dist/core/runtime/tmux-driver.js +0 -706
- package/packages/crouter-api/dist/core/runtime/unsandboxed.js +0 -18
- package/packages/crouter-api/dist/core/runtime/view-socket.js +0 -195
- package/packages/crouter-api/dist/core/runtime/warm-pool.js +0 -479
- package/packages/crouter-api/dist/core/scoped-state/person-rows.js +0 -185
- package/packages/crouter-api/dist/core/scopes.js +0 -48
- package/packages/crouter-api/dist/core/secrets/blaxel-launch.js +0 -104
- package/packages/crouter-api/dist/core/secrets/env-rows.js +0 -40
- package/packages/crouter-api/dist/core/secrets/environment-owner.js +0 -31
- package/packages/crouter-api/dist/core/secrets/environment-secrets.js +0 -14
- package/packages/crouter-api/dist/core/secrets/index.js +0 -2
- package/packages/crouter-api/dist/core/secrets/key.js +0 -33
- package/packages/crouter-api/dist/core/secrets/seal.js +0 -43
- package/packages/crouter-api/dist/core/secrets.js +0 -137
- package/packages/crouter-api/dist/core/self-update.js +0 -77
- package/packages/crouter-api/dist/core/session-model/session-state.js +0 -180
- package/packages/crouter-api/dist/core/shell-segments.js +0 -169
- package/packages/crouter-api/dist/core/spaces/cache-env.js +0 -15
- package/packages/crouter-api/dist/core/spaces/file-root.js +0 -68
- package/packages/crouter-api/dist/core/spaces/mounts.js +0 -126
- package/packages/crouter-api/dist/core/spaces/permissions.js +0 -83
- package/packages/crouter-api/dist/core/spaces/process.js +0 -175
- package/packages/crouter-api/dist/core/spaces/runtime-home.js +0 -8
- package/packages/crouter-api/dist/core/spaces/space.js +0 -58
- package/packages/crouter-api/dist/core/spaces/stop.js +0 -138
- package/packages/crouter-api/dist/core/spaces/users.js +0 -43
- package/packages/crouter-api/dist/core/sqlite-statements.js +0 -17
- package/packages/crouter-api/dist/core/statements.js +0 -81
- package/packages/crouter-api/dist/core/step-timings.js +0 -63
- package/packages/crouter-api/dist/core/storage/attachments.js +0 -141
- package/packages/crouter-api/dist/core/storage/caller-file.js +0 -84
- package/packages/crouter-api/dist/core/storage/client.js +0 -220
- package/packages/crouter-api/dist/core/storage/media-types.js +0 -22
- package/packages/crouter-api/dist/core/storage/node-transfer.js +0 -100
- package/packages/crouter-api/dist/core/storage/purge.js +0 -55
- package/packages/crouter-api/dist/core/storage/tables.js +0 -129
- package/packages/crouter-api/dist/core/subscription-state.js +0 -470
- package/packages/crouter-api/dist/core/substrate/delivery/corpus.js +0 -239
- package/packages/crouter-api/dist/core/substrate/delivery/deliver.js +0 -370
- package/packages/crouter-api/dist/core/substrate/delivery/listings.js +0 -75
- package/packages/crouter-api/dist/core/substrate/delivery/match.js +0 -146
- package/packages/crouter-api/dist/core/substrate/delivery/plan.js +0 -132
- package/packages/crouter-api/dist/core/substrate/delivery/render-boot.js +0 -330
- package/packages/crouter-api/dist/core/substrate/delivery/render-event.js +0 -186
- package/packages/crouter-api/dist/core/substrate/delivery/sub-persona-menu.js +0 -24
- package/packages/crouter-api/dist/core/substrate/delivery/types.js +0 -1
- package/packages/crouter-api/dist/core/substrate/gate-explain.js +0 -397
- package/packages/crouter-api/dist/core/substrate/schema.js +0 -81
- package/packages/crouter-api/dist/core/substrate/subject-fields.js +0 -39
- package/packages/crouter-api/dist/core/substrate/subject.js +0 -60
- package/packages/crouter-api/dist/core/termrender/display.js +0 -56
- package/packages/crouter-api/dist/core/termrender/termrender.js +0 -719
- package/packages/crouter-api/dist/core/termrender/version.js +0 -1
- package/packages/crouter-api/dist/core/timing.js +0 -108
- package/packages/crouter-api/dist/core/tui/draw.js +0 -378
- package/packages/crouter-api/dist/core/tui/fuzzy.js +0 -38
- package/packages/crouter-api/dist/core/tui/markdown.js +0 -407
- package/packages/crouter-api/dist/core/tui/page-host.js +0 -74
- package/packages/crouter-api/dist/core/tui/panel.js +0 -142
- package/packages/crouter-api/dist/core/tui/terminal.js +0 -100
- package/packages/crouter-api/dist/core/wake.js +0 -296
- package/packages/crouter-api/dist/core/worktree-close.js +0 -205
- package/packages/crouter-api/dist/core/worktree-containment.js +0 -48
- package/packages/crouter-api/dist/core/worktree-landing.js +0 -8
- package/packages/crouter-api/dist/core/worktree-machine.js +0 -112
- package/packages/crouter-api/dist/core/worktree-mutation-async.js +0 -393
- package/packages/crouter-api/dist/core/worktree-remove.js +0 -84
- package/packages/crouter-api/dist/core/worktree-scripts.js +0 -72
- package/packages/crouter-api/dist/core/worktree-sweep.js +0 -448
- package/packages/crouter-api/dist/core/worktree.js +0 -844
- package/packages/crouter-api/dist/daemon/api/deferred-head.js +0 -117
- package/packages/crouter-api/dist/daemon/api/environment-of.js +0 -67
- package/packages/crouter-api/dist/daemon/api/handlers/bash-jobs.js +0 -352
- package/packages/crouter-api/dist/daemon/api/handlers/broker-ops.js +0 -705
- package/packages/crouter-api/dist/daemon/api/handlers/broker-recovery.js +0 -266
- package/packages/crouter-api/dist/daemon/api/handlers/execution-start.js +0 -120
- package/packages/crouter-api/dist/daemon/api/handlers/git-credential.js +0 -76
- package/packages/crouter-api/dist/daemon/api/handlers/node-records.js +0 -113
- package/packages/crouter-api/dist/daemon/api/handlers/providers.js +0 -290
- package/packages/crouter-api/dist/daemon/api/handlers/telemetry-record.js +0 -34
- package/packages/crouter-api/dist/daemon/api/handlers/validate.js +0 -58
- package/packages/crouter-api/dist/daemon/api/map.js +0 -750
- package/packages/crouter-api/dist/daemon/api/operations.js +0 -325
- package/packages/crouter-api/dist/daemon/api/principal.js +0 -166
- package/packages/crouter-api/dist/daemon/api/reader.js +0 -133
- package/packages/crouter-api/dist/daemon/api/router.js +0 -568
- package/packages/crouter-api/dist/daemon/api/sync-notice.js +0 -46
- package/packages/crouter-api/dist/daemon/api/viewer-presence.js +0 -100
- package/packages/crouter-api/dist/daemon/companion-retire.js +0 -44
- package/packages/crouter-api/dist/daemon/control.js +0 -22
- package/packages/crouter-api/dist/daemon/cron/armed-context.js +0 -140
- package/packages/crouter-api/dist/daemon/cron/authority.js +0 -101
- package/packages/crouter-api/dist/daemon/cron/capture.js +0 -50
- package/packages/crouter-api/dist/daemon/cron/closed.js +0 -108
- package/packages/crouter-api/dist/daemon/cron/disposition.js +0 -63
- package/packages/crouter-api/dist/daemon/cron/ended.js +0 -91
- package/packages/crouter-api/dist/daemon/cron/escalation.js +0 -136
- package/packages/crouter-api/dist/daemon/cron/held.js +0 -20
- package/packages/crouter-api/dist/daemon/cron/live-runs.js +0 -65
- package/packages/crouter-api/dist/daemon/cron/machine-fire.js +0 -240
- package/packages/crouter-api/dist/daemon/cron/narrowed.js +0 -34
- package/packages/crouter-api/dist/daemon/cron/recurrence.js +0 -38
- package/packages/crouter-api/dist/daemon/cron/run-socket.js +0 -170
- package/packages/crouter-api/dist/daemon/cron/run-token.js +0 -37
- package/packages/crouter-api/dist/daemon/cron/settle.js +0 -78
- package/packages/crouter-api/dist/daemon/cron/sinks.js +0 -70
- package/packages/crouter-api/dist/daemon/drain.js +0 -76
- package/packages/crouter-api/dist/daemon/http-dispatcher.js +0 -37
- package/packages/crouter-api/dist/daemon/human/finish.js +0 -179
- package/packages/crouter-api/dist/daemon/human/settle.js +0 -98
- package/packages/crouter-api/dist/daemon/machine-link/credential.js +0 -24
- package/packages/crouter-api/dist/daemon/machine-link/forward.js +0 -201
- package/packages/crouter-api/dist/daemon/machine-link/frames.js +0 -33
- package/packages/crouter-api/dist/daemon/machine-link/holder.js +0 -395
- package/packages/crouter-api/dist/daemon/park-activity.js +0 -33
- package/packages/crouter-api/dist/daemon/park-pending.js +0 -76
- package/packages/crouter-api/dist/daemon/postgres/binary.js +0 -193
- package/packages/crouter-api/dist/daemon/postgres/cluster.js +0 -111
- package/packages/crouter-api/dist/daemon/postgres/pins.js +0 -16
- package/packages/crouter-api/dist/daemon/postgres/supervisor.js +0 -177
- package/packages/crouter-api/dist/daemon/readiness.js +0 -37
- package/packages/crouter-api/dist/daemon/reconcilers/broker-supervision.js +0 -746
- package/packages/crouter-api/dist/daemon/reconcilers/ledger-sandbox.js +0 -249
- package/packages/crouter-api/dist/daemon/reconcilers/live-obligation.js +0 -125
- package/packages/crouter-api/dist/daemon/reconcilers/node-lifecycle/launch-failure.js +0 -8
- package/packages/crouter-api/dist/daemon/reconcilers/node-lifecycle/node-person.js +0 -40
- package/packages/crouter-api/dist/daemon/reconcilers/node-lifecycle/remote-wake.js +0 -166
- package/packages/crouter-api/dist/daemon/reconcilers/node-lifecycle/respawn-policy.js +0 -59
- package/packages/crouter-api/dist/daemon/reconcilers/recipe-image.js +0 -204
- package/packages/crouter-api/dist/daemon/reconcilers/throttled-lane.js +0 -63
- package/packages/crouter-api/dist/daemon/review/companion.js +0 -29
- package/packages/crouter-api/dist/daemon/review/deliver.js +0 -14
- package/packages/crouter-api/dist/daemon/review/finish.js +0 -149
- package/packages/crouter-api/dist/daemon/runs/append-section.js +0 -129
- package/packages/crouter-api/dist/daemon/runs/observer.js +0 -440
- package/packages/crouter-api/dist/daemon/runs/view-transport.js +0 -81
- package/packages/crouter-api/dist/daemon/structured-requests/sidecar.js +0 -5
- package/packages/crouter-api/dist/hook-authoring.js +0 -447
- package/packages/crouter-api/dist/hook-process.js +0 -34
- package/packages/crouter-api/dist/launcher/limits/settings.js +0 -94
- package/packages/crouter-api/dist/migrations/004-canvas-documents/fields.js +0 -52
- package/packages/crouter-api/dist/shared/git-status.js +0 -44
- package/packages/crouter-api/dist/shared/inline-ref-grammar.js +0 -99
- package/packages/crouter-api/dist/shared/shell-quote.js +0 -5
- package/packages/crouter-api/dist/shared/strip-cd-prefix.js +0 -13
- package/packages/crouter-api/dist/shared/tool-groups.js +0 -64
- package/packages/crouter-api/dist/shared/traceparent.js +0 -28
- package/packages/crouter-api/dist/shared/turn-replies.js +0 -66
package/dist/daemon/manage.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
`).at(-1)??"";return JSON.parse(u)}o(
|
|
3
|
-
${r}`),this.name="DaemonExitedBeforeReadyError",this.stderrTail=r}}class
|
|
1
|
+
var Y=Object.defineProperty;var o=(e,t)=>Y(e,"name",{value:t,configurable:!0});import{spawn as $,execFileSync as J}from"node:child_process";import{createRequire as q}from"node:module";import{dirname as N,join as T}from"node:path";import{fileURLToPath as Q,pathToFileURL as x}from"node:url";import{existsSync as K,lstatSync as Z,mkdirSync as ee,openSync as F,closeSync as H,fstatSync as G,readSync as te}from"node:fs";import{apiSocketPath as re,crtrHome as D}from"../core/canvas/paths.js";import{listProcessTable as ne}from"../core/canvas/pid.js";import{bindDaemonEventSource as oe,eventSource as ae}from"../core/events/source.js";import{hostExecPath as y}from"../core/runtime/branded-host.js";import{isDaemonRunning as se,readPidfile as w,isPidAlive as p}from"./pidfile.js";import{DAEMON_STARTUP_WINDOW_MS as W}from"./startup-policy.js";import{computerIsUnset as ie,readMachineConfig as ce}from"./machine-link/config.js";import{exclusiveLockOwnerPid as ue}from"../core/exclusive-lock.js";import{onDiskMigrationLockPath as le}from"../core/canvas/paths.js";import{envNoDaemonAutostart as _e}from"../shared/env.js";import{waitForDaemonAvailability as de}from"../api/index.js";import{localClient as Re}from"../api/node-transport.js";const pe=["TMUX","TMUX_PANE","NODE_OPTIONS"],fe=new Set(["CRTR_HOME","CRTR_RUNTIME_HOME","CRTR_PIDFILE","CRTR_RUNTIME","CRTR_INSTALL_ID","CRTR_LOG","CRTR_DEBUG","CRTR_DEBUG_PID_LIVENESS","CRTR_TIMING","CRTR_TIMING_PROC","CRTR_NO_DAEMON_AUTOSTART","CRTR_NO_AUTO_UPDATE","CRTR_NO_AUTO_INIT","CRTR_NO_EXPORTS","CRTR_POSTGRES_HOME","CRTR_DATABASE_URL","CRTR_DATABASE_SCHEMA","CRTR_DATABASE_POOL_MAX","CRTR_SCHEMA_DATABASE_URL","CRTR_DOCUMENT_PORT","CRTR_LAUNCHER_SOCKET","CRTR_API_ADDRESS","CRTR_DIRECTORY_URL","CRTR_PUBLIC_API_URL","CRTR_CANVAS_URL","CRTR_CANVAS_CLIENT_ID","CRTR_CANVAS_JWK_FILE","CRTR_SECRETS_KEY","CRTR_IMPORT_SERVICE_TOKEN","CRTR_PACKAGES_TOKEN","CRTR_FEEDBACK_ENDPOINT","CRTR_FEEDBACK_TOKEN","CRTR_SUPPORT_REPO","CRTR_BRANDED_HOST","CRTR_CODESIGN_IDENTITY","CRTR_PLUGIN_REVALIDATE_TTL_MS","CRTR_IMPORT_BLOB_WORKERS","CRTR_MAX_LIVE_BROKERS","CRTR_WARN_LIVE_BROKERS","CRTR_BROKER_RSS_CAP_MB","CRTR_UNATTENDED_PARK_MS","CRTR_WARM_POOL","CRTR_STREAM_WATCHDOG_MS","CRTR_CONVERSATION_COMMIT_DEADLINE_MS","CRTR_NAME_MODEL","CRTR_MODEL_PROVIDER","CRTR_BROKER_SIGNAL_LONG_PROOF"]),me=["CRTR_DB_","CRTR_BOOT_","CRTR_R2_","CRTR_LEDGER_","CRTR_BASH_","CRTR_WATCHER_","CRTR_RECAP_","CRTR_MODEL_AUTH_","CRTR_TEST_","CRTR_FAULT_"];function he(e){return pe.includes(e)?!1:e.startsWith("CRTR_")?fe.has(e)||me.some(t=>e.startsWith(t)):!0}o(he,"daemonKeepsEnv");function g(){const e={};for(const[t,r]of Object.entries(process.env))he(t)&&(e[t]=r);return e}o(g,"sanitizedDaemonEnv");function Ee(){for(let e=N(Q(import.meta.url));;e=N(e)){if(K(T(e,"bin","runtime-generation-manifest.mjs")))return e;if(N(e)===e)throw new Error(`cannot locate the crouter generation root from ${import.meta.url}`)}}o(Ee,"generationRoot");async function I(){const e=Ee(),t=x(T(e,"bin","runtime-generation-manifest.mjs")).href,{runtimeHome:r}=await import(t);try{Z(T(r(),"selected"))}catch(u){if(u.code!=="ENOENT")throw u;return["--conditions","crtr-src","--import",x(q(import.meta.url).resolve("tsx/esm")).href,T(e,"src","daemon","crtrd-cli.ts")]}const n=x(T(e,"bin","runtime-selector.mjs")).href,{tryResolveRuntime:a}=await import(n),i=a("daemon");if(!i.ok)throw new Error(`cannot resolve the selected runtime generation's daemon entry: ${i.error}`);return[i.runtime.entryPath]}o(I,"resolveDaemonLaunch");function Te(e,t){return e.includes(` --canvas-home ${t} `)||e.endsWith(` --canvas-home ${t}`)}o(Te,"daemonCommandDeclaresCanvasHome");function we(){const e=ne();if(e===null)return[];const t=D(),r=[];for(const{pid:n,command:a}of e)a.includes("daemon/crtrd")&&Te(a,t)&&n!==process.pid&&r.push(n);return r}o(we,"findDaemonPids");function Se(e){const t=we().filter(n=>n!==e);for(const n of t)try{process.kill(n,"SIGTERM")}catch{}if(t.length===0)return t;const r=Date.now()+2e3;for(;Date.now()<r&&t.some(n=>p(n));)J("sleep",["0.1"]);for(const n of t)if(p(n))try{process.kill(n,"SIGKILL")}catch{}return t}o(Se,"sweepStrayDaemons");async function Qe(){const e=process.execve;if(e===void 0)throw new Error(`this Node.js ${process.version} runtime cannot replace PID 1 with the successor daemon`);const t=y(),r=await I();return e(t,[t,...r,"--canvas-home",D()],g())}o(Qe,"execDaemon");async function Ze(e){const t=await I(),r=$(y(),[...t,...e],{stdio:["ignore","pipe","pipe"],env:g()});let n="",a="";r.stdout.setEncoding("utf8").on("data",c=>{n+=c}),r.stderr.setEncoding("utf8").on("data",c=>{a+=c});const i=await new Promise((c,d)=>{r.once("error",d),r.once("close",f=>c(f))});if(i!==0)throw new Error(a.trim()||`the ${e[0]} process exited with code ${i}`);const u=n.trim().split(`
|
|
2
|
+
`).at(-1)??"";return JSON.parse(u)}o(Ze,"runDaemonEntry");const V=2e4,P=10,L=1e3;async function v(e=L){const t=Math.min(e,L);return Re({autostart:!1,timeoutMs:t,socketPath:re()}).probeHealthz(t)}o(v,"probeDaemonHealth");function De(e){const t=e instanceof Error?e.message:String(e);if(typeof e!="object"||e===null)return t;const r=e.code,n=e.cause,a=typeof r=="string"?r:n?.code;return typeof a=="string"&&!t.includes(a)?`${t}: ${a}`:t}o(De,"probeErrorMessage");async function j(e=L){const t=await v(e);if(t.startup_phase==="blocked"){const r=w()??process.pid;throw new C(r,t.startup_blocked??"daemon startup is blocked")}if(!t.ok)throw new Error(t.startup_blocked??"crtrd health check reported not ready")}o(j,"probeDaemonServing");async function et(){try{return await j(),!0}catch{return!1}}o(et,"isDaemonServing");function b(e){return new Promise(t=>{setTimeout(t,e)})}o(b,"sleepMs");class k extends Error{static{o(this,"DaemonExitedBeforeReadyError")}stderrTail;constructor(t,r){super(r===""?t:`${t}
|
|
3
|
+
${r}`),this.name="DaemonExitedBeforeReadyError",this.stderrTail=r}}class X extends Error{static{o(this,"DaemonLaunchError")}constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="DaemonLaunchError"}}class C extends Error{static{o(this,"DaemonStartupBlockedError")}constructor(t,r){super(`daemon ${t} is running but normal startup is blocked: ${r}`),this.name="DaemonStartupBlockedError"}}class U extends Error{static{o(this,"DaemonNotPreparedError")}constructor(t,r){super(r===void 0?`daemon ${t} is serving but did not report the prepared startup phase`:`daemon ${t} reported startup phase ${r}, not prepared`),this.name="DaemonNotPreparedError"}}async function Ae(e,t=W,r={},n="ready"){const a=r.readPidfile??w,i=r.isPidAlive??p,u=r.childExited,c=r.isDaemonServing,d=r.probeDaemonServing??(async h=>{if(c!==void 0){if(await c())return;throw new Error("crtrd health check reported not ready")}await j(h)}),f=r.probeDaemonHealth??v,S=r.sleepMs??b,s=r.now??Date.now;let R=null,l=null;return await de({windowMs:t,pollIntervalMs:P,now:s,sleep:S,retry:o(h=>h!==l,"retry"),probe:o(async h=>{const m=a();if(m===null||!i(m)){const _=u?.();throw _!=null&&(_.signal!==null?l=new k(`daemon ${e} exited before becoming ready (by ${_.signal})`,r.childStderrTail?.()??""):_.code!==0&&(l=new k(`daemon ${e} exited before becoming ready (with exit code ${_.code??"?"})`,r.childStderrTail?.()??"")),l!==null)?l:new Error(`daemon ${e} has no live pidfile owner`)}if(n==="ready"){try{await d(h)}catch(_){throw _ instanceof C&&(l=_),_}R=m;return}const E=await f(h);if(E.startup_phase==="prepared"){R=m;return}throw E.startup_phase==="blocked"?(l=new C(m,E.startup_blocked??"on-disk migration is blocked"),l):E.startup_phase==="ready"?(l=new U(m,E.startup_phase),l):new Error(`daemon ${m} is ${E.startup_phase??"not reporting a startup phase"}; waiting for prepared`)},"probe")}),R===e?null:R}o(Ae,"verifyDaemonStartup");async function Ce(e,t=V,r={}){const n=r.readPidfile??w,a=r.isPidAlive??p,i=r.sleepMs??b,u=r.now??Date.now,c=u()+t;for(;u()<=c;){if(!a(e)&&n()!==e)return;await i(P)}throw new Error(`daemon ${e} did not exit and release its pidfile within ${t}ms`)}o(Ce,"waitForDaemonExit");const Oe=2e3,Me=5e3;async function z(e,t=V,r={}){const n=r.isPidAlive??p,a=r.sleepMs??b,i=r.now??Date.now;try{process.kill(e,"SIGTERM")}catch{}try{return await Ce(e,t,r),"terminated"}catch{}try{process.kill(e,"SIGKILL")}catch{}const u=i()+Oe;for(;i()<=u;){if(!n(e))return"killed";await a(P)}throw new Error(`daemon ${e} survived both SIGTERM and SIGKILL`)}o(z,"stopDaemonProcess");async function tt(){const e=w(),t=e!==null&&p(e),r=t&&await z(e)==="killed",n=Se(null);return{stopped:t||n.length>0,...t?{pid:e}:{},strays_killed:n,force_killed:r}}o(tt,"stopAllDaemons");function Ne(e,t,r=2048){let n;try{n=F(e,"r");const{size:a}=G(n),i=Math.max(t,a-r),u=a-i;if(u<=0)return"";const c=Buffer.alloc(u);return te(n,c,0,u,i),c.toString("utf8").trim()}catch{return""}finally{if(n!==void 0)try{H(n)}catch{}}}o(Ne,"readLogTailFrom");async function xe(e={}){if(process.platform==="linux"&&K("/run/crtr/launcher.sock")&&!p(w()??-1)&&ce()===void 0)throw new Error("crtrd is managed by the root launcher; it cannot self-daemonize");const t=e.targetPhase??"ready",r=w();if(r!==null&&p(r))try{const s=await v();if(t==="prepared"){if(s.startup_phase==="prepared")return{started:!1,existing_pid:r,startup_phase:s.startup_phase};throw new U(r,s.startup_phase)}return s.ok?{started:!1,existing_pid:r,...s.startup_phase===void 0?{}:{startup_phase:s.startup_phase}}:{started:!1,existing_pid:r,running:!0,serving:!1,probe_error:s.startup_blocked??"crtrd health check reported not ready",...s.startup_phase===void 0?{}:{startup_phase:s.startup_phase}}}catch(s){if(s instanceof U)throw s;return{started:!1,existing_pid:r,running:!0,serving:!1,probe_error:De(s)}}ee(D(),{recursive:!0});const n=await I().catch(s=>{throw new X(s)}),a=T(D(),"crtrd.err"),i=F(a,"a"),u=(()=>{try{return G(i).size}catch{return 0}})();ae()===void 0&&oe();const c=$(y(),[...n,"--canvas-home",D(),...t==="prepared"?["--prepare"]:[]],{detached:!0,stdio:["ignore",i,i],env:g()});H(i);const d=c.pid;if(d===void 0)throw new Error("daemon spawn did not return a pid");let f=null;c.once("exit",(s,R)=>{f={code:s,signal:R}}),c.unref();let S;try{S=await Ae(d,W,{childExited:o(()=>f,"childExited"),childStderrTail:o(()=>Ne(a,u),"childStderrTail")},t)}catch(s){const R=ue(le())===d;if(f===null&&!R&&!(s instanceof C))try{await z(d,Me)}catch{}throw s}return S!==null?{started:!1,existing_pid:S,startup_phase:t}:{started:!0,pid:d,startup_phase:t}}o(xe,"spawnDaemon");function ye(){return _e()||process.argv.includes("--no-autostart")}o(ye,"autostartDisabled");const ge=5e3,Ie=6e4;let B=!1,A,O=0,M=0;function Pe(e){return Math.min(ge*2**(e-1),Ie)}o(Pe,"autostartBackoffMs");function Le(){A=void 0,O=0,M=0}o(Le,"resetDaemonAutostart");function rt(){return A}o(rt,"daemonAutostartStartupFailure");function nt(e={}){const t=e.isDaemonRunning??se,r=e.spawnDaemon??xe,n=e.now??Date.now;if(!ye()&&!(!e.spawnDaemon&&ie())&&!B&&!(n()<M)){if(t()){Le();return}A=void 0,B=!0,r().then(()=>{A=void 0,O=0,M=0},a=>{(a instanceof k||a instanceof X)&&(A=a.message),O+=1,M=n()+Pe(O)}).finally(()=>{B=!1})}}o(nt,"ensureDaemon");export{pe as DAEMON_ENV_STRIP_KEYS,k as DaemonExitedBeforeReadyError,X as DaemonLaunchError,U as DaemonNotPreparedError,C as DaemonStartupBlockedError,ye as autostartDisabled,rt as daemonAutostartStartupFailure,Te as daemonCommandDeclaresCanvasHome,he as daemonKeepsEnv,nt as ensureDaemon,Qe as execDaemon,we as findDaemonPids,et as isDaemonServing,v as probeDaemonHealth,j as probeDaemonServing,De as probeErrorMessage,Le as resetDaemonAutostart,g as sanitizedDaemonEnv,xe as spawnDaemon,tt as stopAllDaemons,z as stopDaemonProcess,Se as sweepStrayDaemons,Ae as verifyDaemonStartup,Ce as waitForDaemonExit};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ensurePostgresBinaries } from './binary.js';
|
|
2
|
-
export {
|
|
2
|
+
export { startScratchCluster } from './supervisor.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ensurePostgresBinaries as
|
|
1
|
+
import{ensurePostgresBinaries as t}from"./binary.js";import{startScratchCluster as o}from"./supervisor.js";export{t as ensurePostgresBinaries,o as startScratchCluster};
|
|
@@ -1,68 +1,6 @@
|
|
|
1
|
-
/** Where the daemon's database is and whether this process started it. */
|
|
2
|
-
export interface PostgresEndpoint {
|
|
3
|
-
/** Connection string for `pg`. */
|
|
4
|
-
url: string;
|
|
5
|
-
/** True when this call started the postmaster; false when it adopted a running one (or the URL is external). */
|
|
6
|
-
started: boolean;
|
|
7
|
-
}
|
|
8
1
|
type Log = (message: string) => void;
|
|
9
2
|
/** The URL of an external Postgres, when `CRTR_DATABASE_URL` names one. */
|
|
10
3
|
export declare function externalDatabaseUrl(): string | null;
|
|
11
|
-
export interface PostgresPaths {
|
|
12
|
-
/** `<runtime root>/pg` */
|
|
13
|
-
dir: string;
|
|
14
|
-
dataDir: string;
|
|
15
|
-
/** Exclusive directory lock serializing start/adopt across processes. */
|
|
16
|
-
lockPath: string;
|
|
17
|
-
/** Holds the socket directory path; written at start for tools that read it without computing it. */
|
|
18
|
-
socketDirFile: string;
|
|
19
|
-
logFile: string;
|
|
20
|
-
/** Directory holding `.s.PGSQL.5432`: `<runtime root>/pg`, or a short `/tmp` directory when that path is too long. */
|
|
21
|
-
socketDir: string;
|
|
22
|
-
}
|
|
23
|
-
/** Pure path computation for a runtime root; touches no disk. */
|
|
24
|
-
export declare function postgresPaths(root?: string): PostgresPaths;
|
|
25
|
-
/**
|
|
26
|
-
* The URL the daemon connects to, computed without starting anything: `CRTR_DATABASE_URL` when set, otherwise the
|
|
27
|
-
* supervised cluster's socket for this runtime root. Valid once `ensurePostgres()` has returned.
|
|
28
|
-
*/
|
|
29
|
-
export declare function resolveDatabaseUrl(root?: string): string;
|
|
30
|
-
/**
|
|
31
|
-
* Make sure the database for this runtime root answers, and return how to reach it. With `CRTR_DATABASE_URL` set this
|
|
32
|
-
* does nothing. Otherwise: adopt a running postmaster on the runtime root's socket, or (under `runtime/pg/start.lock`)
|
|
33
|
-
* download the pinned binaries if needed, `initdb` on first need, start `postgres`, and wait up to 15 s for `SELECT 1`.
|
|
34
|
-
* Postgres is never stopped here; a handover leaves it running for the successor to adopt.
|
|
35
|
-
*/
|
|
36
|
-
export declare function ensurePostgres(options?: {
|
|
37
|
-
root?: string;
|
|
38
|
-
log?: Log;
|
|
39
|
-
startLockHeld?: boolean;
|
|
40
|
-
}): Promise<PostgresEndpoint>;
|
|
41
|
-
/**
|
|
42
|
-
* Run `operation` under `runtime/pg/start.lock`, the lock that orders starting or adopting the postmaster against
|
|
43
|
-
* stopping it. The daemon holds it across `ensurePostgres({ startLockHeld: true })` and its ownership claim, and
|
|
44
|
-
* `stopPostgres` holds it across its "no daemon has claimed the database" check and `pg_ctl stop`, so a successor
|
|
45
|
-
* can never adopt a postmaster that is about to be stopped. With `CRTR_DATABASE_URL` set it runs `operation` unlocked.
|
|
46
|
-
*/
|
|
47
|
-
export declare function withPostgresStartLock<T>(operation: () => Promise<T>, root?: string): Promise<T>;
|
|
48
|
-
/**
|
|
49
|
-
* The daemon's health tick. Returns when the database answers. If it does not, restart it once (WAL recovery handles
|
|
50
|
-
* the data); a second failure within a minute throws so the daemon's readiness fails.
|
|
51
|
-
*/
|
|
52
|
-
export declare function ensurePostgresHealthy(options?: {
|
|
53
|
-
root?: string;
|
|
54
|
-
log?: Log;
|
|
55
|
-
}): Promise<PostgresEndpoint>;
|
|
56
|
-
/**
|
|
57
|
-
* `crtr sys daemon stop`: `pg_ctl stop -m fast` for this runtime root's cluster, unless `claimed()` reports that
|
|
58
|
-
* another daemon already owns the database. Both run under the start lock, so no daemon can adopt the postmaster
|
|
59
|
-
* between the check and the stop. Call after this daemon's ownership claim is released. Never call on a handover.
|
|
60
|
-
* Returns whether it stopped the cluster; a no-op for an external URL or a stopped cluster.
|
|
61
|
-
*/
|
|
62
|
-
export declare function stopPostgres(options: {
|
|
63
|
-
root?: string;
|
|
64
|
-
claimed: () => Promise<boolean>;
|
|
65
|
-
}): Promise<boolean>;
|
|
66
4
|
export interface ScratchCluster {
|
|
67
5
|
/** Socket URL (superuser `crtr`, database `postgres`, trust authentication). */
|
|
68
6
|
url: string;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
`);const E=Date.now();return await S(n,c,a,e.logFile),r(`postgres started in ${Date.now()-E} ms`),{url:a,started:!0}})}o(I,"ensurePostgres");async function $(t,r){if(u()!==null)return t();const s=l(r);return d(s.dir),M(s.lockPath,t,{timeoutMs:45e3,staleMs:45e3,timeoutError:o(()=>new Error(`timed out waiting for another process to start or stop Postgres (lock ${s.lockPath})`),"timeoutError")})}o($,"withPostgresStartLock");let b=0;async function Z(t={}){const r=U(t.root);if(u()!==null||await m(r,2e3)===null)return{url:r,started:!1};const s=Date.now();if(s-b<6e4)throw new Error(`Postgres stopped answering twice within a minute; see ${l(t.root).logFile}`);(t.log??h)("postgres did not answer the 2 s health probe; restarting it unless it answers now");const e=await I(t);return e.started&&(b=s),e}o(Z,"ensurePostgresHealthy");async function tt(t){if(u()!==null)return!1;const r=l(t.root);return C(i(r.dataDir,"postmaster.pid"))?$(async()=>await t.claimed()?!1:(w(await f(),{dataDir:r.dataDir}),!0),t.root):!1}o(tt,"stopPostgres");async function rt(t){const r=t.log??h;t.asUser===void 0&&k("a scratch Postgres cluster");const s=await f(r);if(d(t.dir),t.asUser&&v(t.dir,t.asUser.uid,t.asUser.gid),Buffer.byteLength(i(t.dir,`.s.PGSQL.${t.tcp?.port??D}`))>g)throw new Error(`scratch directory ${t.dir} is too long for a Postgres socket path`);const e={dataDir:i(t.dir,"data"),socketDir:t.dir,maxConnections:t.maxConnections??100,...t.tcp?{tcp:t.tcp}:{},...t.asUser?{asUser:t.asUser}:{}},a=P("crtr",t.dir,t.tcp?.port);try{p(s,e,"crtr","trust"),await S(s,e,a,i(t.dir,"postgres.log"))}catch(n){try{w(s,e)}catch{}throw n}return{url:a,tcpUrl:t.tcp?z("crtr",t.tcp.host,t.tcp.port):null,dir:t.dir,stop:o(async(n={})=>{w(s,e),n.remove!==!1&&F(t.dir,{recursive:!0,force:!0})},"stop")}}o(rt,"startScratchCluster");export{I as ensurePostgres,Z as ensurePostgresHealthy,u as externalDatabaseUrl,l as postgresPaths,U as resolveDatabaseUrl,rt as startScratchCluster,tt as stopPostgres,$ as withPostgresStartLock};
|
|
1
|
+
var u=Object.defineProperty;var e=(r,t)=>u(r,"name",{value:t,configurable:!0});import{chownSync as d,chmodSync as f,lstatSync as l,mkdirSync as m,rmSync as g}from"node:fs";import{join as a}from"node:path";import{ensurePostgresBinaries as y}from"./binary.js";import{MAX_SOCKET_PATH_BYTES as h,POSTGRES_PORT as S,assertNotRoot as U,initCluster as w,socketUrl as P,startPostmaster as E,stopPostmaster as n,tcpUrl as T}from"./cluster.js";const k=e(()=>{},"noLog");function x(){return process.env.CRTR_DATABASE_URL||null}e(x,"externalDatabaseUrl");function C(r){m(r,{recursive:!0,mode:448});const t=l(r);if(!t.isDirectory()||t.isSymbolicLink())throw new Error(`${r} is not a directory`);if(typeof process.getuid=="function"&&t.uid!==process.getuid())throw new Error(`${r} is owned by uid ${t.uid}, not this process; refusing to put the Postgres socket there`);(t.mode&63)!==0&&f(r,448)}e(C,"ensurePrivateDir");async function A(r){const t=r.log??k;r.asUser===void 0&&U("a scratch Postgres cluster");const c=await y(t);if(C(r.dir),r.asUser&&d(r.dir,r.asUser.uid,r.asUser.gid),Buffer.byteLength(a(r.dir,`.s.PGSQL.${r.tcp?.port??S}`))>h)throw new Error(`scratch directory ${r.dir} is too long for a Postgres socket path`);const s={dataDir:a(r.dir,"data"),socketDir:r.dir,maxConnections:r.maxConnections??100,...r.tcp?{tcp:r.tcp}:{},...r.asUser?{asUser:r.asUser}:{}},o=P("crtr",r.dir,r.tcp?.port);try{w(c,s,"crtr","trust"),await E(c,s,o,a(r.dir,"postgres.log"))}catch(i){try{n(c,s)}catch{}throw i}return{url:o,tcpUrl:r.tcp?T("crtr",r.tcp.host,r.tcp.port):null,dir:r.dir,stop:e(async(i={})=>{n(c,s),i.remove!==!1&&g(r.dir,{recursive:!0,force:!0})},"stop")}}e(A,"startScratchCluster");export{x as externalDatabaseUrl,A as startScratchCluster};
|
|
@@ -10,8 +10,6 @@ export interface BrokerSupervisionContext {
|
|
|
10
10
|
rows: readonly NodeRow[];
|
|
11
11
|
fleet: FleetRegistry;
|
|
12
12
|
lifecycle: DetachedWorkLifecycle;
|
|
13
|
-
/** Nodes of a committed, not yet `done` import run: no fatal-fault notice or park for them. */
|
|
14
|
-
held: ReadonlySet<string>;
|
|
15
13
|
}
|
|
16
14
|
type TreeSample = {
|
|
17
15
|
cpuPercent: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var j=Object.defineProperty;var _=(i,e)=>j(i,"name",{value:e,configurable:!0});import{existsSync as J}from"node:fs";import{LAUNCHER_SOCKET as Q}from"../../launcher/spec.js";import{launcherRequest as X}from"../../launcher/client.js";import{execFile as Z}from"node:child_process";import{promisify as ee}from"node:util";import{getNode as S,isWarmSpare as te,subscribersOf as ne}from"../../core/canvas/index.js";import{isSafeNodeId as c}from"../../core/canvas/paths.js";import{fullName as x}from"../../core/canvas/labels.js";import{recordedPidLiveness as B}from"../../core/canvas/pid.js";import{transition as re}from"../../core/runtime/lifecycle.js";import{hasAdmittedTurn as ae,listUnnotifiedFatalFaultNodes as ie,markFaultNotified as oe,readFault as L,readLiveTurn as F,recordFault as se}from"../../core/canvas/recovery.js";import{errorClassFromFault as de}from"../../core/fault-classifier.js";import{describeVendorLimit as le}from"../../core/provider-failure.js";import{nextFaultRetry as ce}from"../../core/runtime/fault-recovery.js";import{publishNotice as W}from"../../core/runtime/close.js";import{openDb as $,withCanvasWrite as ue}from"../../core/canvas/db.js";import{getById as fe}from"../../core/graph/objects.js";import{watcherIdsOf as pe}from"../../core/graph/watches.js";import{headlessBrokerHost as me}from"../../core/runtime/host.js";import{endExecution as _e,liveExecutionForNode as N,requestExecutionStop as he}from"../../core/canvas/executions.js";import{runnerForExecution as we}from"../../core/runtime/runner/index.js";import{emitEvent as f}from"../../core/events/emit.js";import{operationIdContext as D}from"../../core/events/operation-id.js";import{hasUnseenWakeMail as ke,resetStaleExecutionMail as ge}from"../../core/canvas/deliveries.js";import{runningJobs as ve}from"../../core/graph/jobs.js";import{focusOf as ye}from"../../core/runtime/placement.js";import{hasAttachedBrokerViewers as be}from"../api/viewer-presence.js";import{deliverLive as Se}from"../../core/runtime/interactive-deliver.js";import{BrokerUnreachableError as Ae}from"../../core/runtime/broker-request.js";import{formatCard as Te,PARK_SUMMARY_PROMPT as Ie}from"../../shared/generated-context.js";import{brokerThresholdsForDaemon as Me}from"../../core/runtime/fleet.js";import{readConfig as Pe}from"../../core/config.js";import{beginPendingPark as Re,clearSupervisionMark as h,consumePendingPark as A,pendingParkIds as Ee,pendingParkStartedAt as xe,readSupervisionMark as T,writeSupervisionMark as I}from"../park-pending.js";import{shouldParkAfterSummary as Fe}from"../park-activity.js";import{applyParkEvent as M,noticeUnfinishedIdle as $e,parkVerdict as Ne}from"./live-obligation.js";import{readGoal as De}from"../../core/runtime/kickoff.js";import{memoryDeniedRecently as Oe}from"../../core/runtime/memory-admission.js";import{envNoDaemonAutostart as Ce,envTestUnattendedParkMs as Be,parkSummaryGraceMs as Le,envUnattendedParkMs as We}from"../../shared/env.js";import{KILL_ESCALATE_MS as G,sampleBrokerTree as Ge,wedgeVerdict as Ue,WEDGE_QUIET_MS as O,YIELD_STALL_GRACE_MS as U,yieldStallVerdict as q}from"../../core/runtime/broker-wedge.js";const C=ee(Z);async function qe(i){return!await ae(i)&&((await De(i))?.trim()??"")!==""}_(qe,"awaitsBirthTurn");async function Y(i){const e=await N(i);return e!==null&&e.runner!=="process"&&e.state==="running"?e:null}_(Y,"remoteExecutionOf");async function Ye(i){return(await F(i))?.busy===!0}_(Ye,"liveBusy");async function Dt(i){const e=(await F(i))?.progressAt;if(e==null)return null;const t=Date.parse(e);return Number.isNaN(t)?null:t}_(Dt,"liveTurnProgressMs");function V(i,e){return e===null?null:`${i}:${e}`}_(V,"incarnationOf");async function b(i){const e=await F(i.node_id),t=e?.busy===!0&&e.progressAt!==null?Date.parse(e.progressAt):Number.NaN,r=i.launched_at===null||i.launched_at===void 0?Number.NaN:Date.parse(i.launched_at);return!Number.isFinite(t)||!Number.isFinite(r)||t<r?null:t}_(b,"busySinceForIncarnation");const Ve=5*6e4;function He(i,e){return i===null||i.parent!=null?!1:i.lifecycle==="terminal"?!0:(e==="cap_exhausted"||e==="payment_refused"||e==="all_routes_exhausted")&&i.run_id===i.node_id}_(He,"settlesOnFatalProviderFault");function Ke(){const i=We();if(i!==void 0)return i;const e=Pe("user").lifecycle.unattendedParkMs;return Ce()?Be()??e:e}_(Ke,"unattendedParkMsForDaemon");function H(){return Le()}_(H,"parkSummaryGraceMsForDaemon");function ze(i,e,t,r,a){const n=`Child wedged \u2014 ${i} is alive and mid-turn but has shown NO engine progress for ${e}+ minutes and `;if(t)return n+"its process is near-idle. It will NOT recover on its own \u2014 read `crtr canvas read wedged-child-on-runaway-bash` and kill the runaway SUBPROCESS (not this node) so its turn can resume with no lost context.";const s="it has no subprocess to kill (the engine itself stalled). ";return r?n+s+"The daemon did not SIGTERM the broker because its PID identity cannot be confirmed alive.":a?n+s+"The daemon sent SIGTERM to the broker and will resume a cleanly aborted session with a continuation, or start a recovery cycle if the abort cannot settle.":n+s+"The daemon attempted SIGTERM to the broker, but the signal call failed."}_(ze,"wedgeLabel");async function K(i,e){f({level:"error",event:"broker.wedge.detected",...c(i)?{node_id:i}:{},fields:{...c(i)?{}:{affected_node_id:i},pid:e.pid,quiet_ms:e.quietForMs,cpu_percent:e.cpuPercent,has_descendants:e.hasDescendants,kick_attempted:e.kickAttempted,kicked:e.kicked,...e.kickSuppressionReason===null?{}:{kick_suppression_reason:e.kickSuppressionReason}}});try{await se(i,{link:"daemon\u2192node",op:"engine wedge",kind:"wedged",retry:{disposition:"manual"},message:e.label})}catch(t){f({level:"error",event:"broker.wedge.fault_record_failed",...c(i)?{node_id:i}:{fields:{affected_node_id:i}},error:t})}await W(i,"notice.crash",e.label,{reason:"child-wedged",child:i,quiet_ms:e.quietForMs,cpu_percent:e.cpuPercent,kick_attempted:e.kickAttempted,kicked:e.kicked,...e.kickSuppressionReason===null?{}:{kick_suppression_reason:e.kickSuppressionReason}})}_(K,"reportWedge");class Ot{static{_(this,"BrokerSupervisionReconciler")}yieldTermedAt=new Map;sampleTree;signal;lastOverCapWarnAt=Number.NEGATIVE_INFINITY;constructor(e={}){this.sampleTree=e.readTreeSample??Ge,this.signal=e.signal??((t,r)=>{if(process.platform==="linux"&&J(Q)){if(r!=="SIGTERM"&&r!=="SIGKILL")throw new Error(`unsupported launcher signal ${r}`);return X({operation:"stop",pid:t,signal:r}).then(()=>{})}process.kill(t,r)})}async runFleetPreamble(e){return Me()}warnIfSaturated(e){if(e.fleet.size()<e.thresholds.warning||!e.lifecycle.acceptsDetachedWork())return;const t=D.fresh(()=>this.warnOverCapInTmux(e.fleet.size(),e.thresholds,e.frozen));e.lifecycle.registerDetached(t)}async run(e,t){const r=Ke();for(const a of await ie())t.held.has(a)||await D.fresh(async()=>{try{await this.handleFatalFault(a)}catch(n){f({level:"error",event:"broker.supervision.failed",...c(a)?{node_id:a}:{fields:{affected_node_id:a}},error:n})}});for(const a of t.rows){const n=a.node_id,s=t.fleet.get(n),d=s===void 0?await Y(n):null;if(s===void 0&&d===null||a.status!=="active"&&a.status!=="idle"){await h(n,"unattended_since");continue}await D.fresh(async()=>{try{s!==void 0?(await this.handleYieldStall(a,s,t.fleet,e),await this.handleWedgeDetection(a,s,t.fleet,e)):d.runner==="blaxel"&&(await this.handleRemoteYieldStall(a,d,e),await this.handleRemoteWedge(a,d,e)),await this.handleUnattendedParking(n,await S(n),s?.pid??d.pid,d,e,t,r)}catch(l){await h(n,"unattended_since"),f({level:"error",event:"broker.supervision.failed",...c(n)?{node_id:n}:{fields:{affected_node_id:n}},error:l})}})}for(const a of await Ee())await t.fleet.has(a)||await A(a);await ge(e)}async parkResetCondition(e,t,r,a){if(t.pi_session_id==null||t.pi_pid!==r||t.status==="done"||t.status==="canceled"||t.status==="dead"||t.intent!==null||(await ve(await $(),e)).length>0||await ye(e)!==null||await be(e))return!0;const n=await L(e);return n!==null&&n.retry.disposition==="auto"&&n.retry.by==="daemon"&&(n.kind==="connection"||n.kind==="rate-limit"||n.kind==="overloaded")&&(n.retry.nextAt!==void 0||ce(n,a)!==null)?!0:await ke(e)}async handleUnattendedParking(e,t,r,a,n,s,d){if(await te(e)){await h(e,"unattended_since"),await A(e);return}if(t===null){await h(e,"unattended_since"),await A(e);return}const l=await this.parkResetCondition(e,t,r,n),o=await xe(e);if(o!==void 0){if(n-o<H())return;const v=await A(e);if(v===void 0||(await h(e,"unattended_since"),!await Fe(e,t,v)))return;f({level:"warn",event:"broker.park.summary_expired",...c(e)?{node_id:e}:{},fields:{...c(e)?{}:{affected_node_id:e},grace_ms:H()}}),await M(e,"park"),this.teardownBroker(e,a);return}if(l||await Ye(e)||await qe(e)){await h(e,"unattended_since");return}const p=await T(e,"unattended_since");if(p===void 0){await I(e,"unattended_since",n);return}const{event:u,heldOnlyBySubscriber:w}=await Ne(e,t.lifecycle),k=u!=="cancel"&&Oe(t.grantee??"app:terminal",n)?0:d;if(!(n-p<k)){if(await h(e,"unattended_since"),u==="release"){await M(e,u),w&&await $e(e),this.teardownBroker(e,a);return}if(u==="cancel"){await M(e,u),this.teardownBroker(e,a);return}if(t.grantee!==void 0&&t.grantee!=="app:terminal"){await M(e,"park"),this.teardownBroker(e,a);return}s.lifecycle.acceptsDetachedWork()&&(await Re(e,n),s.lifecycle.registerDetached(this.requestParkSummary(e,a)))}}async requestParkSummary(e,t){try{const r=await Se(e,Te("park",{},Ie),{origin:{type:"runtime",kind:"park"}});f({level:"info",event:"broker.park.summary_requested",...c(e)?{node_id:e}:{},fields:{...c(e)?{}:{affected_node_id:e},route:r}})}catch(r){if(await A(e)===void 0)return;if(r instanceof Ae){await M(e,"park"),this.teardownBroker(e,t);return}f({level:"error",event:"broker.park.summary_failed",...c(e)?{node_id:e}:{fields:{affected_node_id:e}},error:r})}}async warnOverCapInTmux(e,t,r){const a=Date.now();if(a-this.lastOverCapWarnAt<Ve)return;this.lastOverCapWarnAt=a;const{warning:n,automaticReviveCap:s}=t,d=r.stalled+r.waitingOnMail;f({level:"warn",event:"broker.capacity.warning",fields:{live_count:e,warning_threshold:n,hard_cap:s,frozen_stalled:r.stalled,frozen_waiting_on_mail:r.waitingOnMail}});const l=d===0?"":` \u2014 ${d} frozen (${r.stalled} stalled, ${r.waitingOnMail} waiting on mail)`,o=`\u26A0 crtrd: ${e} live brokers (warning ${n}; hard cap ${s})${l} \u2014 possible broker leak. ps -ax | grep broker-cli.js`;try{const p=await C("tmux",["list-clients","-F","#{client_name}"],{encoding:"utf8",timeout:2e3});if(typeof p.stdout!="string")return;await Promise.allSettled(p.stdout.split(`
|
|
1
|
+
var j=Object.defineProperty;var _=(i,e)=>j(i,"name",{value:e,configurable:!0});import{existsSync as J}from"node:fs";import{LAUNCHER_SOCKET as Q}from"../../launcher/spec.js";import{launcherRequest as X}from"../../launcher/client.js";import{execFile as Z}from"node:child_process";import{promisify as ee}from"node:util";import{getNode as S,isWarmSpare as te,subscribersOf as ne}from"../../core/canvas/index.js";import{isSafeNodeId as c}from"../../core/canvas/paths.js";import{fullName as x}from"../../core/canvas/labels.js";import{recordedPidLiveness as B}from"../../core/canvas/pid.js";import{transition as re}from"../../core/runtime/lifecycle.js";import{hasAdmittedTurn as ae,listUnnotifiedFatalFaultNodes as ie,markFaultNotified as oe,readFault as L,readLiveTurn as F,recordFault as se}from"../../core/canvas/recovery.js";import{errorClassFromFault as de}from"../../core/fault-classifier.js";import{describeVendorLimit as le}from"../../core/provider-failure.js";import{nextFaultRetry as ce}from"../../core/runtime/fault-recovery.js";import{publishNotice as W}from"../../core/runtime/close.js";import{openDb as $,withCanvasWrite as ue}from"../../core/canvas/db.js";import{getById as fe}from"../../core/graph/objects.js";import{watcherIdsOf as pe}from"../../core/graph/watches.js";import{headlessBrokerHost as me}from"../../core/runtime/host.js";import{endExecution as _e,liveExecutionForNode as N,requestExecutionStop as he}from"../../core/canvas/executions.js";import{runnerForExecution as we}from"../../core/runtime/runner/index.js";import{emitEvent as f}from"../../core/events/emit.js";import{operationIdContext as D}from"../../core/events/operation-id.js";import{hasUnseenWakeMail as ke,resetStaleExecutionMail as ge}from"../../core/canvas/deliveries.js";import{runningJobs as ve}from"../../core/graph/jobs.js";import{focusOf as ye}from"../../core/runtime/placement.js";import{hasAttachedBrokerViewers as be}from"../api/viewer-presence.js";import{deliverLive as Se}from"../../core/runtime/interactive-deliver.js";import{BrokerUnreachableError as Ae}from"../../core/runtime/broker-request.js";import{formatCard as Te,PARK_SUMMARY_PROMPT as Ie}from"../../shared/generated-context.js";import{brokerThresholdsForDaemon as Me}from"../../core/runtime/fleet.js";import{readConfig as Pe}from"../../core/config.js";import{beginPendingPark as Re,clearSupervisionMark as h,consumePendingPark as A,pendingParkIds as Ee,pendingParkStartedAt as xe,readSupervisionMark as T,writeSupervisionMark as I}from"../park-pending.js";import{shouldParkAfterSummary as Fe}from"../park-activity.js";import{applyParkEvent as M,noticeUnfinishedIdle as $e,parkVerdict as Ne}from"./live-obligation.js";import{readGoal as De}from"../../core/runtime/kickoff.js";import{memoryDeniedRecently as Oe}from"../../core/runtime/memory-admission.js";import{envNoDaemonAutostart as Ce,envTestUnattendedParkMs as Be,parkSummaryGraceMs as Le,envUnattendedParkMs as We}from"../../shared/env.js";import{KILL_ESCALATE_MS as G,sampleBrokerTree as Ge,wedgeVerdict as Ue,WEDGE_QUIET_MS as O,YIELD_STALL_GRACE_MS as U,yieldStallVerdict as q}from"../../core/runtime/broker-wedge.js";const C=ee(Z);async function qe(i){return!await ae(i)&&((await De(i))?.trim()??"")!==""}_(qe,"awaitsBirthTurn");async function Y(i){const e=await N(i);return e!==null&&e.runner!=="process"&&e.state==="running"?e:null}_(Y,"remoteExecutionOf");async function Ye(i){return(await F(i))?.busy===!0}_(Ye,"liveBusy");async function Dt(i){const e=(await F(i))?.progressAt;if(e==null)return null;const t=Date.parse(e);return Number.isNaN(t)?null:t}_(Dt,"liveTurnProgressMs");function V(i,e){return e===null?null:`${i}:${e}`}_(V,"incarnationOf");async function b(i){const e=await F(i.node_id),t=e?.busy===!0&&e.progressAt!==null?Date.parse(e.progressAt):Number.NaN,r=i.launched_at===null||i.launched_at===void 0?Number.NaN:Date.parse(i.launched_at);return!Number.isFinite(t)||!Number.isFinite(r)||t<r?null:t}_(b,"busySinceForIncarnation");const Ve=5*6e4;function He(i,e){return i===null||i.parent!=null?!1:i.lifecycle==="terminal"?!0:(e==="cap_exhausted"||e==="payment_refused"||e==="all_routes_exhausted")&&i.run_id===i.node_id}_(He,"settlesOnFatalProviderFault");function Ke(){const i=We();if(i!==void 0)return i;const e=Pe("user").lifecycle.unattendedParkMs;return Ce()?Be()??e:e}_(Ke,"unattendedParkMsForDaemon");function H(){return Le()}_(H,"parkSummaryGraceMsForDaemon");function ze(i,e,t,r,a){const n=`Child wedged \u2014 ${i} is alive and mid-turn but has shown NO engine progress for ${e}+ minutes and `;if(t)return n+"its process is near-idle. It will NOT recover on its own \u2014 read `crtr canvas read wedged-child-on-runaway-bash` and kill the runaway SUBPROCESS (not this node) so its turn can resume with no lost context.";const s="it has no subprocess to kill (the engine itself stalled). ";return r?n+s+"The daemon did not SIGTERM the broker because its PID identity cannot be confirmed alive.":a?n+s+"The daemon sent SIGTERM to the broker and will resume a cleanly aborted session with a continuation, or start a recovery cycle if the abort cannot settle.":n+s+"The daemon attempted SIGTERM to the broker, but the signal call failed."}_(ze,"wedgeLabel");async function K(i,e){f({level:"error",event:"broker.wedge.detected",...c(i)?{node_id:i}:{},fields:{...c(i)?{}:{affected_node_id:i},pid:e.pid,quiet_ms:e.quietForMs,cpu_percent:e.cpuPercent,has_descendants:e.hasDescendants,kick_attempted:e.kickAttempted,kicked:e.kicked,...e.kickSuppressionReason===null?{}:{kick_suppression_reason:e.kickSuppressionReason}}});try{await se(i,{link:"daemon\u2192node",op:"engine wedge",kind:"wedged",retry:{disposition:"manual"},message:e.label})}catch(t){f({level:"error",event:"broker.wedge.fault_record_failed",...c(i)?{node_id:i}:{fields:{affected_node_id:i}},error:t})}await W(i,"notice.crash",e.label,{reason:"child-wedged",child:i,quiet_ms:e.quietForMs,cpu_percent:e.cpuPercent,kick_attempted:e.kickAttempted,kicked:e.kicked,...e.kickSuppressionReason===null?{}:{kick_suppression_reason:e.kickSuppressionReason}})}_(K,"reportWedge");class Ot{static{_(this,"BrokerSupervisionReconciler")}yieldTermedAt=new Map;sampleTree;signal;lastOverCapWarnAt=Number.NEGATIVE_INFINITY;constructor(e={}){this.sampleTree=e.readTreeSample??Ge,this.signal=e.signal??((t,r)=>{if(process.platform==="linux"&&J(Q)){if(r!=="SIGTERM"&&r!=="SIGKILL")throw new Error(`unsupported launcher signal ${r}`);return X({operation:"stop",pid:t,signal:r}).then(()=>{})}process.kill(t,r)})}async runFleetPreamble(e){return Me()}warnIfSaturated(e){if(e.fleet.size()<e.thresholds.warning||!e.lifecycle.acceptsDetachedWork())return;const t=D.fresh(()=>this.warnOverCapInTmux(e.fleet.size(),e.thresholds,e.frozen));e.lifecycle.registerDetached(t)}async run(e,t){const r=Ke();for(const a of await ie())await D.fresh(async()=>{try{await this.handleFatalFault(a)}catch(n){f({level:"error",event:"broker.supervision.failed",...c(a)?{node_id:a}:{fields:{affected_node_id:a}},error:n})}});for(const a of t.rows){const n=a.node_id,s=t.fleet.get(n),d=s===void 0?await Y(n):null;if(s===void 0&&d===null||a.status!=="active"&&a.status!=="idle"){await h(n,"unattended_since");continue}await D.fresh(async()=>{try{s!==void 0?(await this.handleYieldStall(a,s,t.fleet,e),await this.handleWedgeDetection(a,s,t.fleet,e)):d.runner==="blaxel"&&(await this.handleRemoteYieldStall(a,d,e),await this.handleRemoteWedge(a,d,e)),await this.handleUnattendedParking(n,await S(n),s?.pid??d.pid,d,e,t,r)}catch(l){await h(n,"unattended_since"),f({level:"error",event:"broker.supervision.failed",...c(n)?{node_id:n}:{fields:{affected_node_id:n}},error:l})}})}for(const a of await Ee())await t.fleet.has(a)||await A(a);await ge(e)}async parkResetCondition(e,t,r,a){if(t.pi_session_id==null||t.pi_pid!==r||t.status==="done"||t.status==="canceled"||t.status==="dead"||t.intent!==null||(await ve(await $(),e)).length>0||await ye(e)!==null||await be(e))return!0;const n=await L(e);return n!==null&&n.retry.disposition==="auto"&&n.retry.by==="daemon"&&(n.kind==="connection"||n.kind==="rate-limit"||n.kind==="overloaded")&&(n.retry.nextAt!==void 0||ce(n,a)!==null)?!0:await ke(e)}async handleUnattendedParking(e,t,r,a,n,s,d){if(await te(e)){await h(e,"unattended_since"),await A(e);return}if(t===null){await h(e,"unattended_since"),await A(e);return}const l=await this.parkResetCondition(e,t,r,n),o=await xe(e);if(o!==void 0){if(n-o<H())return;const v=await A(e);if(v===void 0||(await h(e,"unattended_since"),!await Fe(e,t,v)))return;f({level:"warn",event:"broker.park.summary_expired",...c(e)?{node_id:e}:{},fields:{...c(e)?{}:{affected_node_id:e},grace_ms:H()}}),await M(e,"park"),this.teardownBroker(e,a);return}if(l||await Ye(e)||await qe(e)){await h(e,"unattended_since");return}const p=await T(e,"unattended_since");if(p===void 0){await I(e,"unattended_since",n);return}const{event:u,heldOnlyBySubscriber:w}=await Ne(e,t.lifecycle),k=u!=="cancel"&&Oe(t.grantee??"app:terminal",n)?0:d;if(!(n-p<k)){if(await h(e,"unattended_since"),u==="release"){await M(e,u),w&&await $e(e),this.teardownBroker(e,a);return}if(u==="cancel"){await M(e,u),this.teardownBroker(e,a);return}if(t.grantee!==void 0&&t.grantee!=="app:terminal"){await M(e,"park"),this.teardownBroker(e,a);return}s.lifecycle.acceptsDetachedWork()&&(await Re(e,n),s.lifecycle.registerDetached(this.requestParkSummary(e,a)))}}async requestParkSummary(e,t){try{const r=await Se(e,Te("park",{},Ie),{origin:{type:"runtime",kind:"park"}});f({level:"info",event:"broker.park.summary_requested",...c(e)?{node_id:e}:{},fields:{...c(e)?{}:{affected_node_id:e},route:r}})}catch(r){if(await A(e)===void 0)return;if(r instanceof Ae){await M(e,"park"),this.teardownBroker(e,t);return}f({level:"error",event:"broker.park.summary_failed",...c(e)?{node_id:e}:{fields:{affected_node_id:e}},error:r})}}async warnOverCapInTmux(e,t,r){const a=Date.now();if(a-this.lastOverCapWarnAt<Ve)return;this.lastOverCapWarnAt=a;const{warning:n,automaticReviveCap:s}=t,d=r.stalled+r.waitingOnMail;f({level:"warn",event:"broker.capacity.warning",fields:{live_count:e,warning_threshold:n,hard_cap:s,frozen_stalled:r.stalled,frozen_waiting_on_mail:r.waitingOnMail}});const l=d===0?"":` \u2014 ${d} frozen (${r.stalled} stalled, ${r.waitingOnMail} waiting on mail)`,o=`\u26A0 crtrd: ${e} live brokers (warning ${n}; hard cap ${s})${l} \u2014 possible broker leak. ps -ax | grep broker-cli.js`;try{const p=await C("tmux",["list-clients","-F","#{client_name}"],{encoding:"utf8",timeout:2e3});if(typeof p.stdout!="string")return;await Promise.allSettled(p.stdout.split(`
|
|
2
2
|
`).map(async u=>{if(u!=="")try{await C("tmux",["display-message","-C","-d","10000","-c",u,o],{encoding:"utf8",timeout:2e3})}catch{try{await C("tmux",["display-message","-c",u,o],{encoding:"utf8",timeout:2e3})}catch(w){f({level:"error",event:"broker.capacity.tmux_display_failed",error:w,fields:{client:u}})}}}))}catch(p){f({level:"error",event:"broker.capacity.tmux_list_clients_failed",error:p})}}async teardownBroker(e,t){return t===null?await me.teardown(e):await this.stopRemote(t,"teardown")}async stopRemote(e,t){await he(e.nodeId,{afterTurn:!1,reason:t});const r=await we(e.runner).stop(e,{reason:t});return r.confirmed?await _e(e.executionId,{reason:t}):f({level:"error",event:"broker.teardown.unconfirmed",node_id:e.nodeId,error:r.error}),r}async handleRemoteYieldStall(e,t,r){const a=e.node_id;if(e.intent!=="refresh"&&e.cycle_pending!==!0||await b(e)!==null){await h(a,"stall_noticed_at");return}const n=await T(a,"stall_noticed_at");if(n===void 0){await I(a,"stall_noticed_at",r);return}q(!0,!1,r-n)==="kill"&&(await N(a))?.executionId===t.executionId&&(f({level:"warn",event:"broker.yield_stall.remote_stop",...c(a)?{node_id:a}:{},fields:{...c(a)?{}:{affected_node_id:a},execution_id:t.executionId,elapsed_ms:r-n,grace_ms:U}}),await this.stopRemote(t,"yield_stall"))}async handleRemoteWedge(e,t,r){const a=e.node_id,n=await b(e);if(n===null){await h(a,"wedge_noticed_at");return}const s=r-n;if(s<O)return;const d=await S(a);if(d===null||(await N(a))?.executionId!==t.executionId||await b(d)!==n||await T(a,"wedge_noticed_at")===n)return;await I(a,"wedge_noticed_at",n);const l=Math.round(s/6e4);await K(a,{quietForMs:s,cpuPercent:null,hasDescendants:null,kickAttempted:!1,kicked:!1,kickSuppressionReason:"remote_no_process_evidence",pid:t.pid,label:`Child wedged \u2014 ${x(d)} (${a}) runs in a sandbox and is mid-turn but has shown NO engine progress for ${l}+ minutes. The daemon cannot see its processes there, so it did not stop the broker; if it is not running a long command, interrupt or close it.`})}async handleYieldStall(e,t,r,a){const n=e.node_id,s=V(t.pid,e.pi_pid_identity);if(e.intent!=="refresh"&&e.cycle_pending!==!0||await b(e)!==null||s===null){await h(n,"stall_noticed_at"),s!==null&&this.yieldTermedAt.delete(s);return}const d=await T(n,"stall_noticed_at");if(d===void 0){await I(n,"stall_noticed_at",a);return}const l={since:d,termedAt:this.yieldTermedAt.get(s)};if(q(!0,!1,a-l.since)!=="kill")return;const o=await S(n);if(!(r.get(n)!==t||o?.pi_pid!==t.pid||o.pi_pid_identity!==e.pi_pid_identity||B(t.pid,e.pi_pid_identity)!=="alive"))if(l.termedAt===void 0){if(!await this.signalYieldStall(n,t.pid,"SIGTERM"))return;this.yieldTermedAt.set(s,a),l.termedAt=a,f({level:"warn",event:"broker.yield_stall.sigterm",...c(n)?{node_id:n}:{},fields:{...c(n)?{}:{affected_node_id:n},pid:t.pid,elapsed_ms:a-l.since,grace_ms:U}})}else a-l.termedAt>=G&&await this.signalYieldStall(n,t.pid,"SIGKILL")&&f({level:"warn",event:"broker.yield_stall.sigkill",...c(n)?{node_id:n}:{},fields:{...c(n)?{}:{affected_node_id:n},pid:t.pid,elapsed_ms:a-l.termedAt,grace_ms:G,stall_elapsed_ms:a-l.since}})}async signalYieldStall(e,t,r){try{return await this.signal(t,r),!0}catch(a){return f({level:"error",event:"broker.yield_stall.signal_failed",...c(e)?{node_id:e}:{},error:a,fields:{...c(e)?{}:{affected_node_id:e},pid:t,signal:r}}),!1}}async handleWedgeDetection(e,t,r,a){const n=e.node_id,s=V(t.pid,e.pi_pid_identity),d=await b(e);if(d===null||s===null){await h(n,"wedge_noticed_at");return}const l=a-d,o=l>=O?await this.sampleTree(t.pid):null,p=await S(n),u=p===null?null:await b(p);if(r.get(n)!==t||p===null||p.pi_pid!==t.pid||p.pi_pid_identity!==e.pi_pid_identity||u!==d)return;const w=o?.cpuPercent??null,k=o?.hasDescendants??null;if(Ue({busy:!0,quietForMs:l,cpuPercent:w,hasDescendants:k})!=="wedged"||await T(n,"wedge_noticed_at")===d)return;await I(n,"wedge_noticed_at",d);const v=x(p),E=Math.round((l??O)/6e4),g=k??!0,y=!g&&B(t.pid,e.pi_pid_identity)!=="alive"?"pid_identity_unproven":null;let P=!1,m=!1;if(!g&&y===null){P=!0;try{await this.signal(t.pid,"SIGTERM"),m=!0}catch(z){f({level:"error",event:"broker.wedge.signal_failed",...c(n)?{node_id:n}:{},error:z,fields:{...c(n)?{}:{affected_node_id:n},pid:t.pid,signal:"SIGTERM"}})}}const R=ze(`${v} (${n})`,E,g,y!==null,m);await K(n,{quietForMs:l,cpuPercent:w,hasDescendants:g,kickAttempted:P,kicked:m,kickSuppressionReason:y,pid:t.pid,label:R})}async handleFatalFault(e,t=!0){const r=await L(e);if(r===null||r.retry.disposition!=="fatal"||r.link!=="pi\u2192provider"||r.notifiedSince===r.since)return;const a=await S(e),n=await Y(e),s=a!==null?x(a):e,d=r.kind==="auth",l=(r.message.split(`
|
|
3
3
|
`)[0]??"").slice(0,200),o=r.providerError,p=o===void 0?"":` Provider: ${o.provider}/${o.model}.`+(o.status===void 0?"":` HTTP status: ${o.status}.`)+(o.errno===void 0?"":` Errno: ${o.errno}.`)+(o.code===void 0?"":` Code: ${o.code}.`)+(o.body===void 0?"":` Body: ${o.body.slice(0,200)}.`)+(r.retry.nextAt===void 0?"":` Next router probe: ${r.retry.nextAt}.`)+le(o),u=r.kind==="context-overflow",w=He(a,typeof o?.code=="string"?o.code:void 0),k=u||w,v=u?`exceeded its model context window and is now dead. Shrink the task or loaded context, or choose a larger-context model before spawning it again. Error: ${l}`:`got a non-retryable ${r.kind} error and will NOT recover on its own; `+(w?"its terminal run has failed. ":"it stays alive, and waking it clears the fault as soon as one turn completes \u2014 a wake that hits the same cause fails again. "+(d?"Its provider credential is dead \u2014 re-authenticate (`/login`, or re-auth crtr); it recovers on its next wake once the auth reloads. ":""))+`Error: ${l}.${p}`,E=u?"failed":"hit a fatal provider fault",g=new Set((await ne(e)).map(m=>m.node_id)),y=await pe(await $(),await fe(await $(),e)),P=[{relation:"Child",recipients:y.filter(m=>g.has(m))},{relation:"Watched node",recipients:y.filter(m=>!g.has(m))}];f({level:"error",event:"fault.fatal.fanout",...c(e)?{node_id:e}:{},fields:{...c(e)?{}:{affected_node_id:e},kind:r.kind,link:r.link,terminal_overflow:u,terminal_provider_fault:w}}),await ue(async()=>{for(const{relation:m,recipients:R}of P)R.length!==0&&await W(e,"notice.crash",`${m} ${E} \u2014 ${s} (${e}) ${v}`,{reason:u?"child-context-overflow":"child-fault-fatal",child:e,kind:r.kind,message:l,...o===void 0?{}:{provider_error:o}},"normal",null,R);await oe(r.faultId),t&&k&&await re(e,"crash",{reason:u?"context_overflow":o?.code==="cap_exhausted"?"cap_exhausted":"provider_fatal",outcome:{detail:{schema:"crtr.node-outcome-detail/v1",message:r.message,fault_kind:r.kind,error_class:de(r).class,...typeof o?.code=="string"?{provider_code:o.code}:{},...o?.payment===void 0?{}:{payment:o.payment}}}})}),t&&k&&this.teardownBroker(e,n).then(m=>{m.confirmed||f({level:"error",event:"fault.fatal.teardown_failed",node_id:e,error:m.error??new Error("Broker teardown not confirmed")})},m=>f({level:"error",event:"fault.fatal.teardown_failed",node_id:e,error:m}))}}export{Ot as BrokerSupervisionReconciler,H as parkSummaryGraceMsForDaemon,K as reportWedge,He as settlesOnFatalProviderFault,Ke as unattendedParkMsForDaemon,ze as wedgeLabel};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { type NodeRow } from '../../core/canvas/index.js';
|
|
2
2
|
export interface ControllerDeathContext {
|
|
3
3
|
rows: readonly NodeRow[];
|
|
4
|
-
/** Nodes of a committed, not yet `done` import run: their waits are verified rows and stay as imported. */
|
|
5
|
-
held: ReadonlySet<string>;
|
|
6
4
|
}
|
|
7
5
|
export declare class ControllerDeathReconciler {
|
|
8
6
|
run(now: number, ctx: ControllerDeathContext): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var a=Object.defineProperty;var
|
|
1
|
+
var a=Object.defineProperty;var e=(t,o)=>a(t,"name",{value:o,configurable:!0});import{liveControllerWaits as i}from"../../core/canvas/waits.js";import{operationIdContext as n}from"../../core/events/operation-id.js";import{enqueueControllerDeathNotice as l}from"../../core/feed/messages.js";class p{static{e(this,"ControllerDeathReconciler")}async run(o,c){for(const r of await i())await n.fresh(async()=>{await l(r.nodeId,r.controllerId)})}}export{p as ControllerDeathReconciler};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { DetachedWorkLifecycle } from './broker-supervision.js';
|
|
2
2
|
export interface CronLaneContext {
|
|
3
3
|
lifecycle: DetachedWorkLifecycle;
|
|
4
|
-
held: ReadonlySet<string>;
|
|
5
4
|
}
|
|
6
5
|
export declare class CronLaneReconciler {
|
|
7
6
|
run(now: number, ctx: CronLaneContext): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var
|
|
1
|
+
var c=Object.defineProperty;var t=(i,e)=>c(i,"name",{value:e,configurable:!0});import{emitEvent as o}from"../../core/events/emit.js";import{operationIdContext as n}from"../../core/events/operation-id.js";import{sweepOrphanCronFolders as l}from"../cron/folders.js";import{reapRebuiltCronExecutions as s}from"../cron/run-socket.js";import{recoverStaleCronLeases as f,runDueCrons as p}from"../cron-run.js";import{isDrained as m}from"../drain.js";import{runThrottledLane as d}from"./throttled-lane.js";class g{static{t(this,"CronLaneReconciler")}async run(e,a){await n.fresh(async()=>{try{await f(e,{register:t(r=>a.lifecycle.registerDetached(r),"register")})}catch(r){o({level:"error",event:"cron.lease_recovery.failed",error:r})}});try{await s()}catch(r){o({level:"error",event:"cron.execution.reap_failed",error:r})}try{await d("cron-folder-sweep","",e,6e4,6e4,async()=>{await l()})}catch(r){o({level:"error",event:"cron.folder.sweep_failed",error:r})}if(a.lifecycle.acceptsDetachedWork()&&!await m())try{await p(e,{register:t(r=>a.lifecycle.registerDetached(r),"register")})}catch(r){o({level:"error",event:"cron.run.failed",error:r})}}}export{g as CronLaneReconciler};
|
|
@@ -13,17 +13,12 @@ export declare function hasLiveObligation(nodeId: string): Promise<boolean>;
|
|
|
13
13
|
* Deferred mail deliberately does not count: it rides the node's next natural
|
|
14
14
|
* cycle rather than causing one. */
|
|
15
15
|
export declare function hasPendingWake(nodeId: string): Promise<boolean>;
|
|
16
|
-
/** The nodes of an import run that has committed but is not `done` (see `nodesAwaitingVerify`). The fleet does nothing to them: the supervision tick drops them from every
|
|
17
|
-
* lane that reads node rows, and the lanes that read other tables (deadlines, controller waits, structured requests, fatal faults, placement residue, retention) test this set. */
|
|
18
|
-
export declare function importedNodesHeld(): Promise<ReadonlySet<string>>;
|
|
19
16
|
/** The retention sweep's hold: a node with a launch claim, durable work that
|
|
20
17
|
* must wake it, or a person looking at it is never pruned, whatever its age.
|
|
21
18
|
* Unseen mail is deliberately not a hold: it never wakes a terminal node, and
|
|
22
19
|
* children keep writing a finished manager's inbox, so it would retain most
|
|
23
20
|
* finished history forever. The stale sweep checks unseen mail itself.
|
|
24
|
-
|
|
25
|
-
* A node a committed import run inserted is also held until that run's verify has compared it. The import drops the waits on machine-homed
|
|
26
|
-
* objects, so an imported finished node can be past retention at once, and deleting a run root cascades its `run_events` under verify. */
|
|
21
|
+
*/
|
|
27
22
|
export declare function retentionHold(fleet: Pick<FleetRegistry, 'isClaimed'>): Promise<(nodeId: string) => Promise<boolean>>;
|
|
28
23
|
/** Whether a person is looking at this node right now: a focused viewer pane,
|
|
29
24
|
* or a broker client that declared itself attending. A client that hellos with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var w=Object.defineProperty;var
|
|
1
|
+
var w=Object.defineProperty;var a=(t,e)=>w(t,"name",{value:e,configurable:!0});import{getNode as h,hasActiveLiveSubscription as m,hasLiveSubscriber as y,hasPendingCronWake as g}from"../../core/canvas/index.js";import{fullName as l}from"../../core/canvas/labels.js";import{hasLiveControllerWait as k,hasLiveObjectWait as b}from"../../core/canvas/waits.js";import{newestReportName as v}from"../../core/feed/reports.js";import{countTickets as x}from"../../core/canvas/attention.js";import{hasUnseenWakeMail as s}from"../../core/canvas/deliveries.js";import{readOutputRequest as $}from"../../core/runtime/output-result.js";import{focusOf as O}from"../../core/runtime/placement.js";import{hasAttachedBrokerViewers as d}from"../api/viewer-presence.js";import{publishNotice as u}from"../../core/runtime/close.js";import{readFault as L}from"../../core/canvas/recovery.js";import{transition as f}from"../../core/runtime/lifecycle.js";async function o(t){return await m(t)||await k(t)||await b(t)||await g(t)||await x(t)>0||await $(t)!==null}a(o,"hasLiveObligation");async function F(t){return await o(t)||await s(t)?!0:await c(t)}a(F,"hasPendingWake");async function M(t){return async e=>await t.isClaimed(e)||await o(e)||await c(e)}a(M,"retentionHold");async function c(t,e){return(e!==void 0?e.live!==null:await O(t)!==null)||await d(t)}a(c,"hasHumanViewer");async function T(t,e,r){return(await W(t,e,r)).event}a(T,"parkEvent");async function W(t,e,r){const i=a(p=>({event:p,heldOnlyBySubscriber:!1}),"held");if(await c(t,r)||await o(t))return i("release");const n=await L(t);return n?.link==="pi\u2192provider"&&n.retry.disposition==="fatal"?i("release"):e==="resident"?i(await s(t)?"release":"park"):await s(t)?i("release"):await y(t)?{event:"release",heldOnlyBySubscriber:!0}:i("cancel")}a(W,"parkVerdict");async function z(t,e){const r=e==="cancel"?await f(t,e,{reason:"stranded"}):await f(t,e);if(e!=="park")return;const i=await v(t),n=i===null?`It left no report behind; \`crtr node inspect show ${t}\` shows where it stands.`:`Its latest report is where it left things: \`crtr canvas read ${i}\`.`;await u(t,"notice.close",`Resident concluded \u2014 ${l(r)} (${t}) had nothing left to wake it through its unattended grace, so its conversation was concluded. It submitted no final report. ${n} A message to it reopens it on a fresh cycle.`,{reason:"child-auto-done",child:t},"deferred")}a(z,"applyParkEvent");async function D(t){const e=await h(t);e!==null&&await u(t,"notice.crash",`Child went idle unfinished \u2014 ${l(e)} (${t}) stopped without pushing a final report and has no wait that will wake it. Its engine was released; the cause is not recorded. \`crtr node inspect show ${t}\` shows where it stands; a message to it revives it.`,{reason:"child-idle-unfinished",child:t},"urgent")}a(D,"noticeUnfinishedIdle");export{z as applyParkEvent,c as hasHumanViewer,o as hasLiveObligation,F as hasPendingWake,D as noticeUnfinishedIdle,T as parkEvent,W as parkVerdict,M as retentionHold};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var _=Object.defineProperty;var d=(o,e)=>_(o,"name",{value:e,configurable:!0});import{openDb as c}from"../../core/canvas/db.js";import{isCloudRole as N}from"../../core/canvas/person.js";import{subscribersOf as p}from"../../core/canvas/tree.js";import{enqueueNodeMail as m}from"../../core/feed/messages.js";import{operationIdContext as O}from"../../core/events/operation-id.js";import{emitEvent as
|
|
1
|
+
var _=Object.defineProperty;var d=(o,e)=>_(o,"name",{value:e,configurable:!0});import{openDb as c}from"../../core/canvas/db.js";import{isCloudRole as N}from"../../core/canvas/person.js";import{subscribersOf as p}from"../../core/canvas/tree.js";import{enqueueNodeMail as m}from"../../core/feed/messages.js";import{operationIdContext as O}from"../../core/events/operation-id.js";import{emitEvent as u}from"../../core/events/emit.js";const w=5*6e4;async function E(o){const e=await c(),a=new Map,t=d((n,s)=>{n!==null&&a.set(n,(a.get(n)??new Set).add(s))},"add"),i="JOIN profiles p ON p.id = n.profile_id WHERE p.environment_id = ?",r=await e.prepare(`SELECT DISTINCT x.node_id FROM executions x JOIN nodes n ON n.node_id = x.node_id ${i}
|
|
2
2
|
AND x.runner = 'machine' AND x.state IN ('launching', 'running')`).all(o);for(const{node_id:n}of r)for(const s of await p(n))t(s.node_id,`its report ${n} runs on it`);const l=await e.prepare(`SELECT DISTINCT m.sender_node_id, d.destination_id FROM deliveries d JOIN messages m ON m.message_id = d.message_id
|
|
3
3
|
JOIN nodes n ON n.node_id = d.destination_id ${i}
|
|
4
|
-
AND d.state IN ('pending', 'handed_off') AND d.canceled_at IS NULL AND m.sender_node_id IS NOT NULL`).all(o);for(const n of l)t(n.sender_node_id,`its message to ${n.destination_id} is waiting for delivery`);const f=await e.prepare(`SELECT c.created_by, c.name FROM crons c JOIN profiles p ON p.id = c.profile
|
|
5
|
-
WHERE p.environment_id = ? AND c.run_state = 'running' AND c.run_execution_id IS NOT NULL AND c.created_by IS NOT NULL`).all(o);for(const n of f)t(n.created_by,`its cron ${n.name} has a run waiting to start on it`);return new Map([...a].map(([n,s])=>[n,[...s]]))}d(
|
|
4
|
+
AND n.status IN ('active', 'idle') AND d.state IN ('pending', 'handed_off') AND d.canceled_at IS NULL AND m.sender_node_id IS NOT NULL`).all(o);for(const n of l)t(n.sender_node_id,`its message to ${n.destination_id} is waiting for delivery`);const f=await e.prepare(`SELECT c.created_by, c.name FROM crons c JOIN profiles p ON p.id = c.profile
|
|
5
|
+
WHERE p.environment_id = ? AND c.run_state = 'running' AND c.run_execution_id IS NOT NULL AND c.created_by IS NOT NULL`).all(o);for(const n of f)t(n.created_by,`its cron ${n.name} has a run waiting to start on it`);return new Map([...a].map(([n,s])=>[n,[...s]]))}d(E,"waitersOn");class T{static{d(this,"MachineOfflineReconciler")}async run(e){if(!N())return;const t=await(await c()).prepare(`SELECT e.object, e.last_seen_at, o.name FROM environments e JOIN objects o ON o.id = e.object
|
|
6
6
|
WHERE e.kind = 'machine' AND e.last_seen_at < ?
|
|
7
|
-
AND NOT EXISTS (SELECT 1 FROM machine_links l WHERE l.environment = e.object AND l.lease_expires_at > ?)`).all(new Date(e-
|
|
7
|
+
AND NOT EXISTS (SELECT 1 FROM machine_links l WHERE l.environment = e.object AND l.lease_expires_at > ?)`).all(new Date(e-w).toISOString(),new Date(e).toISOString());for(const i of t)try{await O.fresh(()=>this.notify(i))}catch(r){u({level:"warn",event:"machine.offline_notice_failed",fields:{environment:i.object},error:r})}}async notify(e){const a=await c();for(const[t,i]of await E(e.object))await a.prepare("SELECT 1 AS live FROM nodes WHERE node_id = ? AND status IN ('active', 'idle')").get(t)!==void 0&&await m(t,{kind:"update",label:"machine offline",urgency:"normal",wake:1,bodyJson:{body:`The Mac ${e.name??e.object} has been offline since ${e.last_seen_at}; ${i.join("; ")}. Nothing was stopped: everything resumes when it reconnects.`},idempotencyKey:`machine-offline:${e.object}:${e.last_seen_at}:${t}`})}}export{w as MACHINE_OFFLINE_NOTICE_MS,T as MachineOfflineReconciler};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type RowClaim } from './row-claim.js';
|
|
2
2
|
/** Enforce absolute spawn deadlines independently of the tick's live-row scan. */
|
|
3
3
|
export declare class NodeDeadlineReconciler {
|
|
4
|
-
|
|
5
|
-
run(now: number, held: ReadonlySet<string>): Promise<void>;
|
|
4
|
+
run(now: number): Promise<void>;
|
|
6
5
|
}
|
|
7
6
|
/** The one deadline terminalization path. Structured-request expiry reuses it
|
|
8
7
|
* even when a profile is paused, because its dedicated broker must not resume. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var m=Object.defineProperty;var
|
|
1
|
+
var m=Object.defineProperty;var s=(r,t)=>m(r,"name",{value:t,configurable:!0});import{dueNodeDeadlines as w,getNode as u}from"../../core/canvas/index.js";import{emitEvent as d}from"../../core/events/emit.js";import{isProfilePaused as p}from"../../core/profiles/manifest.js";import{operationIdContext as h}from"../../core/events/operation-id.js";import{errorClassFromFault as v}from"../../core/fault-classifier.js";import{publishNotice as x}from"../../core/runtime/close.js";import{readFault as y}from"../../core/canvas/recovery.js";import{requestBrokerTeardown as _}from"../../core/runtime/host.js";import{transition as D}from"../../core/runtime/lifecycle.js";import{withRowClaim as N}from"./row-claim.js";const O=6e4;class z{static{s(this,"NodeDeadlineReconciler")}async run(t){let i;try{i=await w(new Date(t).toISOString())}catch(e){d({level:"error",event:"node_deadline.scan_failed",error:e});return}for(const e of i)p(e.profile_id)||e.deadline_at===null||e.deadline_at===void 0||h.fresh(()=>{N("nodes",e.node_id,O,a=>k(e.node_id,e.deadline_at,t,a)).catch(a=>{d({level:"error",event:"node_deadline.expire_failed",node_id:e.node_id,error:a,fields:{deadline_at:e.deadline_at}})})})}}async function k(r,t,i,e){await e?.assertOwned();const a=await u(r);if(a===null||a.status==="done")return;if(a.status==="canceled"||a.status==="dead"){await e?.assertOwned();const o=await _(r);if(!o.confirmed)throw o.error??new Error("broker teardown was not confirmed");return}const c=await y(r),n=c?.retry.disposition==="fatal"?c:null;let l;await e?.assertOwned();try{l=await D(r,"cancel",{reason:"deadline_exceeded",outcome:{detail:{schema:"crtr.node-outcome-detail/v1",deadline:{deadline_at:t,elapsed_ms:i-Date.parse(t)},...n===null?{}:{message:n.message,fault_kind:n.kind,error_class:v(n).class}}}})}catch(o){throw d({level:"error",event:"node_deadline.terminalize_failed",node_id:r,error:o,fields:{deadline_at:t}}),o}if(l.status!=="canceled"||l.outcome_reason!=="deadline_exceeded")return;await e?.assertOwned();const f=await _(r);if(!f.confirmed)throw f.error??new Error("broker teardown was not confirmed");await e?.assertOwned();try{await x(r,"notice.deadline","child-deadline-exceeded",{reason:"child-deadline-exceeded",child:r})}catch(o){d({level:"error",event:"node_deadline.notify_failed",node_id:r,error:o,fields:{deadline_at:t}})}try{d({level:"error",event:"node_deadline.expired",node_id:r,fields:{deadline_at:t,elapsed_ms:i-Date.parse(t)}})}catch{}}s(k,"expireNodeDeadline");export{z as NodeDeadlineReconciler,k as expireNodeDeadline};
|
|
@@ -9,8 +9,6 @@ export interface StorageMaintenanceContext {
|
|
|
9
9
|
lifecycle: DetachedWorkLifecycle;
|
|
10
10
|
/** A live engine handle is the sweep's proof that a node is NOT disposable. */
|
|
11
11
|
fleet: FleetRegistry;
|
|
12
|
-
/** Nodes of a committed, not yet `done` import run: no residue reap, retention prune or context strip. */
|
|
13
|
-
held: ReadonlySet<string>;
|
|
14
12
|
}
|
|
15
13
|
/** Recurring storage cleanup. Each sweep's throttle and overlap guard is a `reconciler_leases` row (`runThrottledLane`),
|
|
16
14
|
* so two reconciler processes never run one sweep at once and a restart does not repeat a sweep early. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var I=Object.defineProperty;var u=(w,t)=>I(w,"name",{value:t,configurable:!0});import{rm as A}from"node:fs/promises";import{closeFocusRow as N,getFocusById as T,listFocuses as P,listNodes as C}from"../../core/canvas/index.js";import{pruneExpiredIdempotencyKeys as x}from"../../core/runs/operations.js";import{getNode as y,lastActivityMs as p,listTerminalPlacementResidue as D,pruneExpiredCreateRequests as F,pruneNodes as M}from"../../core/canvas/canvas.js";import{lastContextStripMs as b,stripContextDir as L}from"../../core/canvas/context-strip.js";import{isAppRun as W}from"../../core/canvas/app-run.js";import{isSafeNodeId as c}from"../../core/canvas/paths.js";import{emitEvent as n}from"../../core/events/emit.js";import{operationIdContext as i}from"../../core/events/operation-id.js";import{listLivePanesAsync as G,tearDownNode as V}from"../../core/runtime/placement.js";import{reapStaleSpares as k}from"../../core/runtime/warm-pool.js";import{GroveInstanceSweepReconciler as q}from"./grove-instance-sweep.js";import{ManagedWorktreeSweepReconciler as O}from"./managed-worktree-sweep.js";import{compactRunEvents as U}from"../../core/runs/events.js";import{archiveExpiredRunEvents as H}from"../../core/events/run-event-chunks.js";import{blobStore as Y}from"../../core/blobs/index.js";import{runThrottledLane as d}from"./throttled-lane.js";import{openDb as g}from"../../core/canvas/db.js";import{retentionHold as m}from"./live-obligation.js";import{deleteQuietNodeSandboxes as z}from"../../core/runtime/runner/delete-sandboxes.js";import{pruneMemoryReads as B}from"../../core/canvas/memory-reads.js";import{existsSync as K}from"node:fs";import{launcherRequest as Q}from"../../launcher/client.js";import{LAUNCHER_SOCKET as $}from"../../launcher/spec.js";import{cachePassDue as X}from"../../launcher/limits/policy.js";const Z=10*6e4,h=60*1e3,S=60*1e3,v=5*6e4,E=2,j=1440*6e4,J=2e3,ee=6e4;class Te{static{u(this,"StorageMaintenanceReconciler")}focusGcInFlight=!1;lastCachePassAt=null;cachePassInFlight=!1;worktreeSweep=new O;groveInstanceSweep=new q;async run(t,r){await this.reapDeadResidue(t),this.scheduleFocusGc(r),await this.gcWarmPool(t),await this.gcCreateRequests(t),await this.gcViewerAttachments(t);try{await d("run-event-maintenance","",t,J,ee,async e=>{await H(await Y(),t);const s=await U(t,e.state===null?0:Number(e.state));await e.save(String(s.cursor))})}catch(e){console.warn(`run event maintenance failed: ${String(e)}`)}await d("memory-read-prune","",t,60*6e4,10*6e4,async()=>{try{await B(t)}catch(e){console.warn(`memory-read log prune failed: ${String(e)}`)}}),await d("storage-analyze","",t,1440*6e4,10*6e4,async()=>{await(await g()).exec("ANALYZE")}),await this.sweepRetention(t,r),this.scheduleCachePass(t,r),this.scheduleContextStrip(t,r),this.worktreeSweep.run(t,r),this.groveInstanceSweep.run(t,r)}scheduleCachePass(t,r){this.cachePassInFlight||!X(this.lastCachePassAt,t)||process.platform!=="linux"||!K($)||r.lifecycle.acceptsDetachedWork()&&(this.lastCachePassAt=t,this.cachePassInFlight=!0,r.lifecycle.registerDetached(Q({operation:"cache.purge"}).then(()=>{}).catch(e=>{i.fresh(()=>{n({level:"warn",event:"app.cache.pass_failed",error:e})})}).then(()=>{this.cachePassInFlight=!1})))}msSinceTerminalActivity(t,r){const e=p(t);return e===0?Number.POSITIVE_INFINITY:r-e}async sweepRetention(t,r){r.lifecycle.acceptsDetachedWork()&&await d("retention-sweep","",t,v,v,()=>i.fresh(async()=>{try{const e=await M({ttlDays:E,held:await m(r.fleet),removeDirs:u(a=>{r.lifecycle.registerDetached(Promise.all(a.map(o=>A(o,{recursive:!0,force:!0}))).then(()=>{}).catch(o=>{i.fresh(()=>{n({level:"error",event:"canvas.retention.failed",error:o})})}))},"removeDirs")});e.pruned.length>0&&n({level:"info",event:"canvas.retention.pruned",outcome:"succeeded",fields:{pruned_count:e.pruned.length}});const s=await m(r.fleet),l=t-E*24*60*6e4,f=await z({now:t,held:s,quiet:u(async a=>{const o=await y(a);return o!==null&&p(o)<l},"quiet")});f>0&&n({level:"info",event:"canvas.retention.sandboxes_deleted",outcome:"succeeded",fields:{deleted_count:f}})}catch(e){n({level:"error",event:"canvas.retention.failed",error:e})}}))}scheduleContextStrip(t,r){r.lifecycle.acceptsDetachedWork()&&r.lifecycle.registerDetached(d("context-strip","",t,v,10*6e4,()=>this.stripFinishedContexts(t,r)).then(()=>{},e=>{n({level:"error",event:"canvas.context_strip.failed",error:e})}))}async stripFinishedContexts(t,r){const e=await m(r.fleet),s=u(async a=>a!==null&&["done","canceled","dead"].includes(a.status)&&(a.pi_pid??null)===null&&(a.frozen_at??null)===null&&!W(a)&&p(a)<t-j&&!await e(a.node_id),"eligible");let l=0,f=0;try{for(const a of await C({status:["done","canceled","dead"]})){if(!c(a.node_id)||!await s(a))continue;const o=await b(a.node_id);if(o!==null&&o>=p(a)||!await s(await y(a.node_id)))continue;let _;try{_=await L(a.node_id)}catch(R){i.fresh(()=>{n({level:"warn",event:"canvas.context_strip.node_failed",error:R,fields:{node_id:a.node_id}})});continue}_.removed.length>0&&(l+=1,f+=_.bytes)}}catch(a){i.fresh(()=>{n({level:"error",event:"canvas.context_strip.failed",error:a})})}l>0&&i.fresh(()=>{n({level:"info",event:"canvas.context_strip.completed",outcome:"succeeded",fields:{node_count:l,bytes:f}})})}async reapDeadResidue(t){let r;try{r=await D()}catch(e){i.fresh(()=>{n({level:"error",event:"residue.reap_scan.failed",error:e})});return}for(const e of r){try{if(this.msSinceTerminalActivity(e,t)<Z)continue}catch(s){i.fresh(()=>{n({level:"error",event:"residue.reap.failed",...c(e.node_id)?{node_id:e.node_id}:{},error:s,fields:{...c(e.node_id)?{}:{affected_node_id:e.node_id},pane:e.pane,window:e.window,tmux_session:e.tmux_session}})});continue}await i.fresh(async()=>{try{n({level:"info",event:"residue.reaped",...c(e.node_id)?{node_id:e.node_id}:{},fields:{...c(e.node_id)?{}:{affected_node_id:e.node_id},pane:e.pane,window:e.window,tmux_session:e.tmux_session}}),await V(e.node_id)}catch(s){n({level:"error",event:"residue.reap.failed",...c(e.node_id)?{node_id:e.node_id}:{},error:s,fields:{...c(e.node_id)?{}:{affected_node_id:e.node_id},pane:e.pane,window:e.window,tmux_session:e.tmux_session}})}})}}scheduleFocusGc(t){if(this.focusGcInFlight||!t.lifecycle.acceptsDetachedWork())return;this.focusGcInFlight=!0;const r=this.gcStaleFocuses().finally(()=>{this.focusGcInFlight=!1});t.lifecycle.registerDetached(r)}async gcStaleFocuses(){let t;try{t=await P()}catch(e){i.fresh(()=>{n({level:"error",event:"focus.gc.failed",error:e})});return}if(t.length===0)return;let r;try{r=await G()}catch(e){i.fresh(()=>{n({level:"error",event:"focus.gc.failed",error:e})});return}if(r!==null)for(const e of t){if(e.pane===null||r.has(e.pane))continue;if(!await i.fresh(async()=>{try{return(await T(e.focus_id))?.pane!==e.pane||(n({level:"info",event:"focus.gc.removed",...c(e.node_id)?{node_id:e.node_id}:{},fields:{focus_id:e.focus_id,focus_node_id:e.node_id,pane:e.pane}}),await N(e.focus_id)),!0}catch(l){return n({level:"error",event:"focus.gc.failed",error:l}),!1}}))return}}async gcCreateRequests(t){await d("create-request-gc","",t,S,S,()=>i.fresh(async()=>{const r=await F(t),e=await x(t);e>0&&n({level:"info",event:"canvas.idempotency_keys.reaped",outcome:"succeeded",fields:{reaped_count:e}}),r>0&&n({level:"info",event:"canvas.create_requests.reaped",outcome:"succeeded",fields:{reaped_count:r}})}))}async gcViewerAttachments(t){await d("viewer-attachment-gc","",t,h,h,()=>i.fresh(async()=>{const r=Number((await(await g()).prepare("DELETE FROM viewer_attachments WHERE expires_at <= ?").run(new Date(t).toISOString())).changes);r>0&&n({level:"info",event:"viewer_attachments.reaped",outcome:"succeeded",fields:{reaped_count:r}})}))}async gcWarmPool(t){await d("warm-pool-gc","",t,h,h,()=>i.fresh(async()=>{const r=await k();r.length>0&&n({level:"info",event:"warm_pool.spares_reaped",outcome:"succeeded",fields:{reaped_count:r.length}})}))}}export{j as CONTEXT_STRIP_GRACE_MS,Z as DEAD_REAP_GRACE_MS,v as RETENTION_SWEEP_INTERVAL_MS,E as RETENTION_TTL_DAYS,Te as StorageMaintenanceReconciler};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** Settles rows whose waiter disappeared and retries every incomplete durable effect. */
|
|
2
2
|
export declare class StructuredRequestReconciler {
|
|
3
|
-
|
|
4
|
-
run(now: number, held: ReadonlySet<string>): Promise<void>;
|
|
3
|
+
run(now: number): Promise<void>;
|
|
5
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var f=Object.defineProperty;var c=(t,r)=>f(t,"name",{value:r,configurable:!0});import{withCanvasWrite as w}from"../../core/canvas/db.js";import{incompleteStructuredRequestEffects as m,pendingStructuredRequestsPast as p,settleStructuredRequestIn as q}from"../../core/canvas/structured-requests.js";import{emitEvent as i}from"../../core/events/emit.js";import{applySettlementEffects as a}from"../structured-requests/effects.js";import{withRowClaim as u}from"./row-claim.js";const n=6e4,d=c(t=>{i({level:"error",event:"structured_request.reconcile_failed",error:t})},"reportFailure");class C{static{c(this,"StructuredRequestReconciler")}async run(r){try{for(const e of await p(r))u("structured_requests",e.request_id,n,async s=>{const o=await w(async l=>(await s.assertOwned(),await q(l,e.request_id,{intended:"expired",now:r})));o.changed&&o.row!==null&&await a(o.row,s)}).catch(d);for(const e of await m())u("structured_requests",e.request_id,n,async s=>{await a(e,s)}).catch(d)}catch(e){i({level:"error",event:"structured_request.reconcile_failed",error:e})}}}export{C as StructuredRequestReconciler};
|
|
@@ -40,7 +40,7 @@ Options: `new FakeCloud({clientId, issuer = 'https://directory.test', runtimeUrl
|
|
|
40
40
|
|
|
41
41
|
### Isolated runs
|
|
42
42
|
|
|
43
|
-
The fake stands in for a Northlight
|
|
43
|
+
The fake stands in for a Northlight sandbox, where the Linux root launcher always exists, so `runs.start({isolated: true})` starts a run by default and `run.params.isolated` is `true`. The checks `startRun` makes without the launcher are mirrored: `isolated` must be a boolean, `cwd` is accepted only with `isolated: true` and must be an absolute path inside the run's root folder, `/apps/<clientId>/nodes/<run id>` (else 400 `invalid_request`, `param: cwd`), and `worktree` is refused. Nothing in the fake enforces the sandbox itself (no network, no `files/` mount).
|
|
44
44
|
|
|
45
45
|
`isolatedRuns: 'unavailable'` models a runtime without the launcher, such as a runtime on a machine that cannot launch isolated runs: every isolated start answers 503 `isolated_unavailable` (`param: isolated`, retryable, so `runs.start` sends it three times before throwing). Use it to test your app's handling of that refusal.
|
|
46
46
|
|
package/docs/ci-runner.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# CI runners and the double-run gate
|
|
2
2
|
|
|
3
|
-
The suite runs on **GitHub-hosted Linux** (ubuntu, inside a root container
|
|
3
|
+
The suite runs on **GitHub-hosted Linux** (ubuntu, inside a root container with the Linux layout crouter uses in a container or sandbox), and only the tests tagged `laptopOnly` (a macOS-only code path, or an assertion that assumes a non-root user) run on **macOS** (the Mac mini runners). macOS minutes bill at 10x Linux, so the macOS job is deliberately small. The push to `main` does not re-run a tree that already passed.
|
|
4
4
|
|
|
5
5
|
## Why Linux, and why a container
|
|
6
6
|
|
|
7
|
-
On Linux crouter assumes it
|
|
7
|
+
On Linux crouter assumes it runs in a container or sandbox (`src/core/layout.ts`): sockets in `/run/crtr`, data under `/runtime`, `/user` and `/apps`, brokers started through a root launcher. A plain non-root runner has none of that (every lane failed with EACCES, which is why the suite once moved to macOS). The `linux` jobs of `test.yml` therefore run as root in a container built from `docker/ci.Dockerfile`:
|
|
8
8
|
|
|
9
|
-
- **Image.** `docker/ci.Dockerfile` is the
|
|
9
|
+
- **Image.** `docker/ci.Dockerfile` is built like the container runner stage (same pinned `node:24-alpine` digest, same apk list, users `crtrd` 10002 / `crtr-data` 10001, the `/run/crtr` `/runtime` `/user` `/apps` directories) plus `build-base`, `linux-headers` (native addon) and GNU `tar`. It does not contain crouter; the job checks the source out. Chosen over `hosting/guest/Dockerfile` (needs sandbox-api, chrony, the python stack and a packed crouter, so it rebuilds per commit) and `docker/unit.Dockerfile` (bakes a packed crouter). `scripts/ci-image.test.mjs` (in `test:contract`) fails when the apk list, ids, directories or node base drift from `docker/base.Dockerfile`; keep the two in step by hand when the guest changes.
|
|
10
10
|
- **Docker flags.** `--init --cgroupns=private --cap-add SYS_ADMIN --cap-add NET_ADMIN --security-opt seccomp=unconfined --security-opt apparmor=unconfined`, with the checkout mounted at `/opt/crouter` (where the guest has crouter, and the only crouter path a sandbox mounts). `--init` is tini as pid 1, which reaps the orphans the launcher and bubblewrap leave. The capabilities give mount namespaces per test file and bubblewrap's namespaces. `scripts/ci-linux-lane.sh` first delegates the memory and pids cgroup controllers as the guest entrypoint does and fails the job if it cannot, so the runner must be a cgroup2 host with `xt_owner`.
|
|
11
11
|
- **One `/run/crtr`, `/etc`, cgroup subtree and root launcher per test file.** All test files would otherwise share `/run/crtr/api.sock`, `store.sock` and `nodes/`. `scripts/ci-test-files.mjs` runs each file under `unshare -m` through `scripts/ci-file-setup.sh`, which mounts a tmpfs on `/run/crtr`, binds a private copy of `/etc` (the launcher rewrites `passwd` and `group`) and a private cgroup subtree, and starts the file's own root launcher (`scripts/ci-launcher.mjs`) before the test; each file also has its own `HOME`, `TMPDIR`, `CRTR_RUNTIME_HOME` and `CRTR_HOME`. The test process, running as root, plays the daemon: the CI launcher accepts a root peer and does not start `crtrd`. The log line of each file shows the milliseconds its launcher took to open its socket. A failing file is retried once and reported as flaky if the retry passes (as `scripts/test-retry.mjs` does on macOS).
|
|
12
12
|
- **Running a list of files.** `ci-test-files.mjs <lane> --files <list>` (and `scripts/ci-linux-lane.sh <lane> <shard> --files <list>`) runs exactly the files in a text file of repo paths, one per line (seam: the `dist/…/*.test.js` path); the format is in the script header. A path that is not a test file of that lane exits 2.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.767",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
},
|
|
158
158
|
"license": "UNLICENSED",
|
|
159
159
|
"dependencies": {
|
|
160
|
-
"@north-light/identity": "0.3.
|
|
161
|
-
"@north-light/plugin": "0.3.
|
|
160
|
+
"@north-light/identity": "0.3.767",
|
|
161
|
+
"@north-light/plugin": "0.3.767",
|
|
162
162
|
"@earendil-works/chord": "1.5.2",
|
|
163
163
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
164
164
|
"@earendil-works/pi-ai": "1.5.2",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
//
|
|
13
13
|
// PURITY (spec §3.1): Node built-ins + `src/api/*` only.
|
|
14
14
|
/** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
|
|
15
|
-
export const CONTRACT_LEVEL = '1.
|
|
15
|
+
export const CONTRACT_LEVEL = '1.83';
|
|
16
16
|
/** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
|
|
17
17
|
export const REQUIRED_CONTRACT_HEADER = 'Crouter-Required-Contract';
|
|
18
18
|
/** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
|