@north-light/crouter 0.3.233 → 0.3.235
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/client.js +16 -15
- package/dist/api/dto/nodes.d.ts +11 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/integration/provider-rotation.test.ts +1 -1
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/claude-plugin-commands.ts +14 -17
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crtr-commands/index.ts +7 -11
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/frontmatter-rules/index.ts +8 -8
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +10 -11
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/pi-shell-runner.ts +2 -2
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.d.ts +3 -3
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.js +7 -7
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +8 -8
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/statusline.ts +6 -6
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/sysprompt-window.ts +3 -3
- package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.ts +1 -1
- package/dist/clients/attach/chrome/ticket-panel.js +15 -2
- package/dist/clients/attach/overlays/graph.js +0 -3
- package/dist/clients/attach/overlays/mcp.js +1 -2
- package/dist/clients/attach/render/chat-view.js +0 -12
- package/dist/clients/attach/render/crtr-output.js +0 -2
- package/dist/clients/attach/render/tool-calls.js +0 -6
- package/dist/clients/attach/slash/dispatch.js +8 -11
- package/dist/clients/attach/viewer.js +535 -537
- package/dist/clients/conversation/projection.js +0 -2
- package/dist/clients/inbox/controller.js +22 -3
- package/dist/clients/inbox/review/companion-pane.js +0 -4
- package/dist/clients/inbox/review-adapter.js +0 -7
- package/dist/clients/inbox/tui/slots.d.ts +3 -3
- package/dist/clients/inbox/tui/types.d.ts +2 -2
- package/dist/commands/api-client.js +0 -8
- package/dist/commands/attention.js +1 -9
- package/dist/commands/canvas-browse.js +2 -1
- package/dist/commands/canvas-config.js +0 -10
- package/dist/commands/canvas-history.js +2 -1
- package/dist/commands/cron.js +10 -23
- package/dist/commands/dashboard.js +0 -2
- package/dist/commands/human/feedback.js +2 -1
- package/dist/commands/human/prompts.js +2 -5
- package/dist/commands/human/queue.js +2 -7
- package/dist/commands/human/request.js +0 -14
- package/dist/commands/human/review.js +2 -1
- package/dist/commands/human.js +1 -1
- package/dist/commands/memory/__tests__/command-selector-and-mutation-guards.test.js +4 -4
- package/dist/commands/memory/__tests__/memory-list-and-lint-ignore.test.d.ts +1 -0
- package/dist/commands/memory/__tests__/memory-list-and-lint-ignore.test.js +96 -0
- package/dist/commands/memory/delete.js +1 -1
- package/dist/commands/memory/edit.js +6 -3
- package/dist/commands/memory/find.js +2 -2
- package/dist/commands/memory/lint.js +2 -1
- package/dist/commands/memory/list.d.ts +4 -0
- package/dist/commands/memory/list.js +20 -14
- package/dist/commands/memory/move.js +1 -1
- package/dist/commands/memory/read.d.ts +2 -7
- package/dist/commands/memory/read.js +5 -16
- package/dist/commands/memory/shared.d.ts +1 -0
- package/dist/commands/memory/shared.js +17 -8
- package/dist/commands/memory/write.js +8 -4
- package/dist/commands/node/bash.js +2 -1
- package/dist/commands/node/create.js +2 -1
- package/dist/commands/node/inspect.js +11 -10
- package/dist/commands/node/lifecycle.js +5 -13
- package/dist/commands/node/message.js +11 -6
- package/dist/commands/node/subscription.js +7 -2
- package/dist/commands/node/wait.js +9 -4
- package/dist/commands/node-context.js +2 -1
- package/dist/commands/node-lifecycle-revive.js +0 -2
- package/dist/commands/node-worktree.js +2 -1
- package/dist/commands/pkg/browse/actions.d.ts +1 -1
- package/dist/commands/pkg/browse/actions.js +4 -4
- package/dist/commands/pkg/browse/catalog.d.ts +1 -1
- package/dist/commands/pkg/browse/catalog.js +15 -15
- package/dist/commands/pkg/browse/command-view.d.ts +1 -1
- package/dist/commands/pkg/browse/command-view.js +3 -3
- package/dist/commands/pkg/browse/detail-panel.d.ts +1 -1
- package/dist/commands/pkg/browse/detail-panel.js +8 -8
- package/dist/commands/pkg/browse/doc-view.d.ts +1 -1
- package/dist/commands/pkg/browse/doc-view.js +3 -3
- package/dist/commands/pkg/browse/list-panel.d.ts +1 -1
- package/dist/commands/pkg/browse/list-panel.js +3 -3
- package/dist/commands/pkg/browse/model.d.ts +3 -3
- package/dist/commands/pkg/browse/shell.d.ts +2 -2
- package/dist/commands/pkg/browse/shell.js +13 -13
- package/dist/commands/pkg/plugin-manage.js +3 -2
- package/dist/commands/pkg/shared.js +0 -2
- package/dist/commands/pkg.js +1 -0
- package/dist/commands/profile/delete.js +2 -1
- package/dist/commands/profile/rename.js +1 -1
- package/dist/commands/push.js +2 -3
- package/dist/commands/revive.js +0 -2
- package/dist/commands/surface/node/placement.js +2 -1
- package/dist/commands/surface-edit.js +2 -1
- package/dist/commands/sys/config.js +1 -4
- package/dist/commands/sys/daemon.js +0 -10
- package/dist/commands/sys/doctor.js +3 -2
- package/dist/commands/sys/panels/broker-limits-panel.d.ts +2 -2
- package/dist/commands/sys/panels/broker-limits-panel.js +4 -4
- package/dist/commands/sys/panels/dependencies-panel.d.ts +2 -2
- package/dist/commands/sys/panels/dependencies-panel.js +2 -2
- package/dist/commands/sys/panels/keybindings-panel.d.ts +1 -1
- package/dist/commands/sys/panels/keybindings-panel.js +5 -5
- package/dist/commands/sys/panels/models-panel.d.ts +4 -4
- package/dist/commands/sys/panels/models-panel.js +11 -10
- package/dist/commands/sys/panels/plugins-panel.d.ts +2 -2
- package/dist/commands/sys/panels/plugins-panel.js +2 -2
- package/dist/commands/sys/panels/prefs-panel.d.ts +2 -2
- package/dist/commands/sys/panels/prefs-panel.js +4 -4
- package/dist/commands/sys/panels/profiles-panel.d.ts +1 -1
- package/dist/commands/sys/panels/profiles-panel.js +14 -13
- package/dist/commands/sys/panels/provider-panel.d.ts +3 -3
- package/dist/commands/sys/panels/provider-panel.js +8 -8
- package/dist/commands/sys/settings-shell.d.ts +3 -3
- package/dist/commands/sys/settings-shell.js +15 -15
- package/dist/commands/sys/setup-settings-runner.d.ts +3 -3
- package/dist/commands/sys/setup-settings-runner.js +5 -5
- package/dist/commands/sys/setup-wizard.d.ts +4 -4
- package/dist/commands/sys/setup-wizard.js +8 -8
- package/dist/commands/sys/support/prepare.js +4 -4
- package/dist/commands/sys/support/submit.js +2 -2
- package/dist/commands/sys/sync-deps.js +0 -2
- package/dist/commands/sys/sync-project-guidance.js +2 -1
- package/dist/commands/sys/sysprompt.js +2 -1
- package/dist/commands/sys.js +1 -0
- package/dist/core/__tests__/boot.test.js +0 -8
- package/dist/core/__tests__/broker-extension-canvas-db-boundary.test.js +23 -1
- package/dist/core/__tests__/canvas-db-boundary.test.d.ts +1 -0
- package/dist/core/__tests__/canvas-db-boundary.test.js +46 -0
- package/dist/core/__tests__/canvas.test.js +1 -1
- package/dist/core/__tests__/child-death-wake.test.js +0 -2
- package/dist/core/__tests__/cli-help-contract.test.d.ts +1 -0
- package/dist/core/__tests__/cli-help-contract.test.js +150 -0
- package/dist/core/__tests__/cron-armed-context-failure.test.d.ts +1 -0
- package/dist/core/__tests__/cron-armed-context-failure.test.js +145 -0
- package/dist/core/__tests__/daemon-wedge.test.js +0 -4
- package/dist/core/__tests__/dead-node-policy-table.test.js +0 -4
- package/dist/core/__tests__/fixtures/fake-engine.js +4 -14
- package/dist/core/__tests__/fixtures/fake-pi-host.js +5 -5
- package/dist/core/__tests__/focuses.test.js +0 -6
- package/dist/core/__tests__/fs-utils.test.d.ts +1 -0
- package/dist/core/__tests__/fs-utils.test.js +50 -0
- package/dist/core/__tests__/helpers/harness.js +1 -1
- package/dist/core/__tests__/inline-memory-refs.test.js +0 -2
- package/dist/core/__tests__/integration/broker-fork-seam.test.js +0 -2
- package/dist/core/__tests__/integration/broker-sdk-wiring.test.js +3 -16
- package/dist/core/__tests__/integration/command-plugins.test.js +21 -24
- package/dist/core/__tests__/integration/deferred-no-wake.test.js +0 -6
- package/dist/core/__tests__/integration/flagship-lifecycle.test.js +0 -26
- package/dist/core/__tests__/integration/live-mutation-verbs.test.js +0 -4
- package/dist/core/__tests__/integration/live-mutation.test.js +1 -5
- package/dist/core/__tests__/integration/refresh-stall-recycle.test.js +1 -5
- package/dist/core/__tests__/integration/revive.test.js +0 -12
- package/dist/core/__tests__/integration/subscription-delivery.test.js +0 -6
- package/dist/core/__tests__/integration/tmux-surface.test.js +24 -8
- package/dist/core/__tests__/integration/worktree-reap.test.js +0 -6
- package/dist/core/__tests__/lifecycle.test.js +0 -18
- package/dist/core/__tests__/memory-resolver-precedence.test.js +1 -1
- package/dist/core/__tests__/migration.test.js +2 -2
- package/dist/core/__tests__/on-read-dedup-resume.test.js +3 -3
- package/dist/core/__tests__/pid-identity-match.test.js +1 -1
- package/dist/core/__tests__/plugin-kinds.test.js +1 -1
- package/dist/core/__tests__/plugin-page-components.test.js +1 -1
- package/dist/core/__tests__/preview-registry-sync.test.js +42 -1
- package/dist/core/__tests__/respawn-throttle.test.js +0 -4
- package/dist/core/__tests__/revive-all.test.js +5 -5
- package/dist/core/__tests__/revive-parked-fresh.test.js +62 -11
- package/dist/core/__tests__/seam/broker-attach-multiclient.test.js +0 -8
- package/dist/core/__tests__/seam/broker-attach-stream.test.js +0 -8
- package/dist/core/__tests__/seam/broker-crash-teardown.test.js +0 -2
- package/dist/core/__tests__/tmux-driver-boundary.test.d.ts +1 -0
- package/dist/core/__tests__/tmux-driver-boundary.test.js +50 -0
- package/dist/core/__tests__/watchdog-abort-arms-retry.test.js +11 -6
- package/dist/core/activity-signal.d.ts +7 -0
- package/dist/core/activity-signal.js +38 -0
- package/dist/core/auto-update.js +2 -1
- package/dist/core/bootstrap.js +2 -1
- package/dist/core/canvas/__tests__/remote-canvas-source.test.js +1 -1
- package/dist/core/canvas/__tests__/remote-transport.test.js +1 -1
- package/dist/core/canvas/__tests__/render-remote.test.js +1 -1
- package/dist/core/canvas/browse/app.js +3 -2
- package/dist/core/canvas/browse/model.d.ts +1 -1
- package/dist/core/canvas/browse/model.js +0 -4
- package/dist/core/canvas/canvas.d.ts +22 -0
- package/dist/core/canvas/canvas.js +61 -19
- package/dist/core/canvas/crons.js +0 -6
- package/dist/core/canvas/db.d.ts +14 -20
- package/dist/core/canvas/db.js +30 -1332
- package/dist/core/canvas/focuses.js +0 -4
- package/dist/core/canvas/history.js +2 -1
- package/dist/core/canvas/meta-file.js +18 -27
- package/dist/core/canvas/migrations.d.ts +20 -0
- package/dist/core/canvas/migrations.js +1339 -0
- package/dist/core/canvas/nav-model.js +1 -11
- package/dist/core/canvas/nav-render.js +0 -8
- package/dist/core/canvas/remote-canvas-source.d.ts +8 -0
- package/dist/core/canvas/remote-canvas-source.js +9 -3
- package/dist/core/canvas/render-source.js +31 -13
- package/dist/core/command-manifests/manifest.js +0 -10
- package/dist/core/command-manifests/registry.d.ts +2 -0
- package/dist/core/command-manifests/schema.js +0 -4
- package/dist/core/command-plugins/compose.js +4 -2
- package/dist/core/command-plugins/discovery.d.ts +1 -0
- package/dist/core/command-plugins/discovery.js +1 -1
- package/dist/core/command-plugins/transport/http-invoke.js +0 -14
- package/dist/core/command.js +2 -6
- package/dist/core/config.js +2 -1
- package/dist/core/fault-classifier.js +8 -0
- package/dist/core/feed/inbox.d.ts +10 -0
- package/dist/core/feed/inbox.js +18 -12
- package/dist/core/fs-utils.d.ts +9 -2
- package/dist/core/fs-utils.js +7 -15
- package/dist/core/help.js +0 -8
- package/dist/core/host-exports/export.d.ts +2 -2
- package/dist/core/host-exports/export.js +9 -12
- package/dist/core/human/answer.d.ts +2 -2
- package/dist/core/human/convention.d.ts +2 -5
- package/dist/core/human/convention.js +3 -13
- package/dist/core/human/page-schema.d.ts +2 -2
- package/dist/core/human/page-schema.js +2 -2
- package/dist/core/human/root.js +6 -23
- package/dist/core/human/scan.js +24 -7
- package/dist/core/human/tickets.d.ts +4 -1
- package/dist/core/human/tickets.js +20 -6
- package/dist/core/io.js +0 -12
- package/dist/core/memory/identity.js +0 -4
- package/dist/core/memory/inline-ref-inventory.js +3 -2
- package/dist/core/memory/lint.js +3 -6
- package/dist/core/memory-resolver.d.ts +5 -0
- package/dist/core/memory-resolver.js +14 -12
- package/dist/core/pagination.d.ts +2 -0
- package/dist/core/pagination.js +2 -3
- package/dist/core/preview-registry.d.ts +14 -0
- package/dist/core/preview-registry.js +2 -4
- package/dist/core/preview-result-path.js +2 -1
- package/dist/core/profiles/manifest.d.ts +37 -5
- package/dist/core/profiles/manifest.js +44 -24
- package/dist/core/profiles/select.js +0 -4
- package/dist/core/review/signal.js +4 -23
- package/dist/core/review/ticket-filter.d.ts +3 -3
- package/dist/core/review/ticket-filter.js +4 -9
- package/dist/core/runtime/__tests__/engine-route.test.js +1 -1
- package/dist/core/runtime/__tests__/spawn-env.test.js +0 -8
- package/dist/core/runtime/bearings-render.d.ts +56 -0
- package/dist/core/runtime/bearings-render.js +241 -0
- package/dist/core/runtime/bearings.d.ts +2 -17
- package/dist/core/runtime/bearings.js +12 -198
- package/dist/core/runtime/broker/auth-reload.d.ts +39 -0
- package/dist/core/runtime/broker/auth-reload.js +149 -0
- package/dist/core/runtime/broker/engine-drive.d.ts +26 -0
- package/dist/core/runtime/broker/engine-drive.js +257 -0
- package/dist/core/runtime/broker/engine-routing.d.ts +143 -0
- package/dist/core/runtime/broker/engine-routing.js +211 -0
- package/dist/core/runtime/broker/event-projection.js +3 -2
- package/dist/core/runtime/broker/fault-retry.js +11 -4
- package/dist/core/runtime/broker/frame-client.d.ts +38 -0
- package/dist/core/runtime/broker/frame-client.js +129 -0
- package/dist/core/runtime/broker/frame-dispatch.d.ts +12 -189
- package/dist/core/runtime/broker/frame-dispatch.js +89 -1476
- package/dist/core/runtime/broker/frame-engine-control.d.ts +20 -0
- package/dist/core/runtime/broker/frame-engine-control.js +231 -0
- package/dist/core/runtime/broker/frame-memory-refs.d.ts +19 -0
- package/dist/core/runtime/broker/frame-memory-refs.js +41 -0
- package/dist/core/runtime/broker/frame-model-query.d.ts +13 -0
- package/dist/core/runtime/broker/frame-model-query.js +69 -0
- package/dist/core/runtime/broker/frame-read.d.ts +19 -0
- package/dist/core/runtime/broker/frame-read.js +116 -0
- package/dist/core/runtime/broker/frame-replies.d.ts +24 -0
- package/dist/core/runtime/broker/frame-replies.js +64 -0
- package/dist/core/runtime/broker/frame-session.d.ts +34 -0
- package/dist/core/runtime/broker/frame-session.js +203 -0
- package/dist/core/runtime/broker/rebind.js +50 -0
- package/dist/core/runtime/broker/turn-ignition.d.ts +42 -0
- package/dist/core/runtime/broker/turn-ignition.js +74 -0
- package/dist/core/runtime/broker-extension-render.js +9 -85
- package/dist/core/runtime/broker-protocol.js +0 -4
- package/dist/core/runtime/broker-sdk.js +2 -1
- package/dist/core/runtime/broker.d.ts +1 -1
- package/dist/core/runtime/broker.js +5 -23
- package/dist/core/runtime/fault.js +3 -2
- package/dist/core/runtime/headless-pi.js +3 -2
- package/dist/core/runtime/host.js +2 -3
- package/dist/core/runtime/kickoff.js +0 -4
- package/dist/core/runtime/launch-target.js +2 -1
- package/dist/core/runtime/launch.d.ts +2 -2
- package/dist/core/runtime/launch.js +20 -10
- package/dist/core/runtime/lifecycle.js +17 -26
- package/dist/core/runtime/managed-provider-cooling.d.ts +1 -1
- package/dist/core/runtime/naming.js +0 -2
- package/dist/core/runtime/nodes.js +2 -1
- package/dist/core/runtime/persona.js +0 -6
- package/dist/core/runtime/placement-tmux.js +2 -5
- package/dist/core/runtime/placement.js +4 -11
- package/dist/core/runtime/recap.js +4 -3
- package/dist/core/runtime/reopen.js +4 -7
- package/dist/core/runtime/reset.js +0 -4
- package/dist/core/runtime/resume-root.js +0 -2
- package/dist/core/runtime/revive.js +17 -13
- package/dist/core/runtime/session-list-cache.js +2 -2
- package/dist/core/runtime/shell-expansion.js +0 -2
- package/dist/core/runtime/spawn.js +0 -2
- package/dist/core/runtime/stop-guard.js +28 -16
- package/dist/core/runtime/stream-watchdog.d.ts +0 -1
- package/dist/core/runtime/stream-watchdog.js +13 -18
- package/dist/core/runtime/tmux-bindings.js +0 -2
- package/dist/core/runtime/tmux-driver.d.ts +12 -0
- package/dist/core/runtime/tmux-driver.js +18 -13
- package/dist/core/runtime/warm-pool.js +0 -4
- package/dist/core/scope.js +4 -3
- package/dist/core/spawn.js +2 -3
- package/dist/core/subscription-state.js +10 -17
- package/dist/core/substrate/__tests__/surface-match-pre-command.test.js +3 -3
- package/dist/core/substrate/frontmatter-validation.d.ts +1 -0
- package/dist/core/substrate/frontmatter-validation.js +1 -1
- package/dist/core/substrate/render.js +0 -12
- package/dist/core/substrate/schema.js +0 -12
- package/dist/core/substrate/surface-match.js +0 -2
- package/dist/core/termrender/display.js +2 -1
- package/dist/core/tui/page-host.d.ts +3 -3
- package/dist/core/tui/page-host.js +4 -4
- package/dist/core/tui/panel.js +3 -3
- package/dist/core/wake.js +0 -12
- package/dist/core/worktree.js +0 -2
- package/dist/daemon/__tests__/reconciler-signature.test.d.ts +1 -0
- package/dist/daemon/__tests__/reconciler-signature.test.js +36 -0
- package/dist/daemon/api/__tests__/error-seam.test.js +27 -0
- package/dist/daemon/api/__tests__/seam/api-server.test.js +2 -16
- package/dist/daemon/api/__tests__/seam/b10-attach-modelauth.test.js +3 -11
- package/dist/daemon/api/__tests__/seam/leaf-api-parity.test.js +0 -6
- package/dist/daemon/api/handlers/attach.js +2 -1
- package/dist/daemon/api/handlers/broker-ops.js +3 -6
- package/dist/daemon/api/handlers/canvas.js +12 -18
- package/dist/daemon/api/handlers/feedback-comments.js +0 -8
- package/dist/daemon/api/handlers/health.js +3 -2
- package/dist/daemon/api/handlers/human-requests.js +0 -10
- package/dist/daemon/api/handlers/human.js +1 -5
- package/dist/daemon/api/handlers/inbox.js +0 -18
- package/dist/daemon/api/handlers/memory.js +1 -1
- package/dist/daemon/api/handlers/messages.js +16 -20
- package/dist/daemon/api/handlers/nodes.js +23 -22
- package/dist/daemon/api/handlers/reports.js +1 -1
- package/dist/daemon/api/handlers/reviews.js +1 -6
- package/dist/daemon/api/handlers/worktree.js +6 -22
- package/dist/daemon/api/map.d.ts +4 -2
- package/dist/daemon/api/map.js +22 -8
- package/dist/daemon/api/router.js +0 -4
- package/dist/daemon/api/server.js +2 -5
- package/dist/daemon/boot-migrations.d.ts +14 -0
- package/dist/daemon/boot-migrations.js +31 -0
- package/dist/daemon/cron/armed-context.d.ts +21 -0
- package/dist/daemon/cron/armed-context.js +100 -0
- package/dist/daemon/cron/capture.d.ts +20 -0
- package/dist/daemon/cron/capture.js +45 -0
- package/dist/daemon/cron/disposition.d.ts +19 -0
- package/dist/daemon/cron/disposition.js +52 -0
- package/dist/daemon/cron/escalation.d.ts +12 -0
- package/dist/daemon/cron/escalation.js +124 -0
- package/dist/daemon/cron/held.d.ts +4 -0
- package/dist/daemon/cron/held.js +20 -0
- package/dist/daemon/cron/lease-recovery.d.ts +3 -0
- package/dist/daemon/cron/lease-recovery.js +119 -0
- package/dist/daemon/cron/live-runs.d.ts +11 -0
- package/dist/daemon/cron/live-runs.js +23 -0
- package/dist/daemon/cron/passes.d.ts +11 -0
- package/dist/daemon/cron/passes.js +78 -0
- package/dist/daemon/cron/settle.d.ts +28 -0
- package/dist/daemon/cron/settle.js +37 -0
- package/dist/daemon/cron/sinks.d.ts +2 -0
- package/dist/daemon/cron/sinks.js +100 -0
- package/dist/daemon/cron-run.d.ts +5 -41
- package/dist/daemon/cron-run.js +193 -882
- package/dist/daemon/crtrd-cli.js +2 -1
- package/dist/daemon/crtrd.js +22 -22
- package/dist/daemon/fleet.js +0 -4
- package/dist/daemon/human/deliver-action.js +2 -1
- package/dist/daemon/human/sweep.js +15 -4
- package/dist/daemon/manage.d.ts +2 -2
- package/dist/daemon/manage.js +4 -13
- package/dist/daemon/pidfile.js +2 -2
- package/dist/daemon/reconcilers/broker-supervision.js +27 -30
- package/dist/daemon/reconcilers/dormant-inbox.d.ts +1 -1
- package/dist/daemon/reconcilers/dormant-inbox.js +2 -1
- package/dist/daemon/reconcilers/live-obligation.js +2 -2
- package/dist/daemon/reconcilers/pending-review-submit.d.ts +1 -1
- package/dist/daemon/reconcilers/pending-review-submit.js +2 -1
- package/dist/daemon/reconcilers/storage-maintenance.d.ts +2 -1
- package/dist/daemon/reconcilers/storage-maintenance.js +2 -1
- package/dist/daemon/review/companion.js +2 -2
- package/dist/daemon/review/sweep.js +8 -3
- package/dist/migrations/001-surfaces-frontmatter.js +0 -6
- package/dist/migrations/corpus.js +2 -5
- package/dist/migrations/registry.js +15 -2
- package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +0 -4
- package/dist/pi-extensions/broker-local.js +2 -1
- package/dist/pi-extensions/canvas-bash-valve.js +7 -20
- package/dist/pi-extensions/canvas-context-intro.js +2 -7
- package/dist/pi-extensions/canvas-doc-substrate.js +2 -3
- package/dist/pi-extensions/canvas-goal-capture.js +2 -1
- package/dist/pi-extensions/canvas-inbox-watcher.js +5 -12
- package/dist/pi-extensions/canvas-passive-context.js +2 -5
- package/dist/pi-extensions/canvas-preview-result.js +2 -1
- package/dist/pi-extensions/canvas-prompt-scrub.js +2 -1
- package/dist/pi-extensions/canvas-recap.js +3 -16
- package/dist/pi-extensions/canvas-review-boundary.js +2 -5
- package/dist/pi-extensions/canvas-stophook.js +2 -26
- package/dist/pi-extensions/canvas-structured-output.js +2 -1
- package/dist/pi-extensions/canvas-tool-guide.js +2 -1
- package/dist/shared/__tests__/env-boundary.test.d.ts +1 -0
- package/dist/shared/__tests__/env-boundary.test.js +93 -0
- package/dist/shared/env.d.ts +68 -0
- package/dist/shared/env.js +171 -0
- package/package.json +3 -1
- package/runtime.lock.json +2 -2
- package/dist/core/canvas/render.d.ts +0 -47
- package/dist/core/canvas/render.js +0 -245
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { envProfileId } from '../../shared/env.js';
|
|
1
2
|
import { dirname, join, resolve, isAbsolute, relative, sep } from 'node:path';
|
|
2
3
|
import { renameSync, writeFileSync } from 'node:fs';
|
|
3
4
|
import { createHash } from 'node:crypto';
|
|
@@ -106,7 +107,7 @@ function assertManifestRequiresValid(manifest, where) {
|
|
|
106
107
|
function missingRequirementWarnings(manifest) {
|
|
107
108
|
if (manifest.requires === undefined)
|
|
108
109
|
return [];
|
|
109
|
-
const env = buildBrokerEnv({ argv: [], env: { CRTR_NODE_CWD: process.cwd(), CRTR_PROFILE_ID:
|
|
110
|
+
const env = buildBrokerEnv({ argv: [], env: { CRTR_NODE_CWD: process.cwd(), CRTR_PROFILE_ID: envProfileId() ?? '' } });
|
|
110
111
|
return Object.entries(normalizeRequires(manifest.requires))
|
|
111
112
|
.filter(([name]) => resolvePathExecutable(name, env, process.cwd()) === null)
|
|
112
113
|
.map(([name, hint]) => `Warning: plugin "${manifest.name}" requires "${name}" on PATH — ${hint}`);
|
|
@@ -790,7 +791,7 @@ export const pluginRemove = defineLeaf({
|
|
|
790
791
|
summary: 'remove a plugin and its directory from the given scope',
|
|
791
792
|
params: [
|
|
792
793
|
{ kind: 'positional', name: 'name', type: 'string', required: true, constraint: 'Plugin name to remove.' },
|
|
793
|
-
{ kind: 'flag', name: 'scope', type: 'enum', choices: ['user', 'project'], required: false, constraint: 'Default: searches
|
|
794
|
+
{ kind: 'flag', name: 'scope', type: 'enum', choices: ['user', 'project'], required: false, constraint: 'Default: searches every scope.' },
|
|
794
795
|
],
|
|
795
796
|
output: [
|
|
796
797
|
{ name: 'scopes', type: 'string[]', required: true, constraint: 'Scopes the plugin was removed from.' },
|
|
@@ -3,9 +3,7 @@ import { notFound, usage } from '../../core/errors.js';
|
|
|
3
3
|
import { resolveScopeArg, pluginsDir, projectScopeRoot } from '../../core/scope.js';
|
|
4
4
|
import { updateConfig } from '../../core/config.js';
|
|
5
5
|
import { pathExists } from '../../core/fs-utils.js';
|
|
6
|
-
// ---------------------------------------------------------------------------
|
|
7
6
|
// Helpers
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
7
|
export const GIT_URL_RE = /^(https?:\/\/|git@|ssh:\/\/|file:\/\/)/;
|
|
10
8
|
export function isGitUrl(arg) {
|
|
11
9
|
return GIT_URL_RE.test(arg) || arg.endsWith('.git');
|
package/dist/commands/pkg.js
CHANGED
|
@@ -14,6 +14,7 @@ export function registerPkg() {
|
|
|
14
14
|
help: {
|
|
15
15
|
name: 'pkg',
|
|
16
16
|
summary: 'manage plugins and marketplace sources',
|
|
17
|
+
model: 'Marketplaces are configured source catalogs; plugins are installed extensions resolved from those catalogs or direct HTTP endpoints. Browsing searches the configured catalogs without changing source or install state.',
|
|
17
18
|
},
|
|
18
19
|
children: [pkgBrowseLeaf, pluginBranch, marketBranch],
|
|
19
20
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { envNodeId } from '../../shared/env.js';
|
|
1
2
|
import { defineLeaf } from '../../core/command.js';
|
|
2
3
|
import { cliClient, rethrowAsCliError } from '../api-client.js';
|
|
3
4
|
export const deleteLeaf = defineLeaf({
|
|
@@ -53,7 +54,7 @@ export const deleteLeaf = defineLeaf({
|
|
|
53
54
|
const result = await cliClient().deleteProfile(input['profile'], {
|
|
54
55
|
force: input['force'],
|
|
55
56
|
detach: input['detach'],
|
|
56
|
-
caller_node_id:
|
|
57
|
+
caller_node_id: envNodeId() ?? null,
|
|
57
58
|
}).catch(rethrowAsCliError);
|
|
58
59
|
return {
|
|
59
60
|
...result,
|
|
@@ -3,7 +3,7 @@ import { resolveProfileOperand, renameProfile } from '../../core/profiles/manife
|
|
|
3
3
|
export const renameLeaf = defineLeaf({
|
|
4
4
|
name: 'rename',
|
|
5
5
|
description: "change a profile's display name",
|
|
6
|
-
whenToUse: "you want to
|
|
6
|
+
whenToUse: "you want the profile to appear under a new name in bearings, listings, and `profile` subject gates. The profile id (its directory) never changes.",
|
|
7
7
|
help: {
|
|
8
8
|
name: 'profile rename',
|
|
9
9
|
summary: "change a profile's manifest `name` only — the profile_id is stable and never changes",
|
package/dist/commands/push.js
CHANGED
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
// server-side inside feed `push()` (spec §7.4). This file reaches ZERO canvas
|
|
16
16
|
// state-store code — no `core/feed`, no `core/canvas` accessors, no
|
|
17
17
|
// `core/worktree`. The only node identity read is `CRTR_NODE_ID` (client-side).
|
|
18
|
+
import { envNodeId } from '../shared/env.js';
|
|
18
19
|
import { defineBranch, defineLeaf } from '../core/command.js';
|
|
19
20
|
import { InputError, readStdinRaw } from '../core/io.js';
|
|
20
21
|
import { ApiError } from '../api/index.js';
|
|
21
22
|
import { cliClient, rethrowAsCliError } from './api-client.js';
|
|
22
23
|
import { markStopSignal } from '../core/runtime/stop-signals.js';
|
|
23
24
|
function requireCallerNode() {
|
|
24
|
-
const id =
|
|
25
|
+
const id = envNodeId();
|
|
25
26
|
if (id === undefined || id.trim() === '') {
|
|
26
27
|
throw new InputError({
|
|
27
28
|
error: 'no_node_context',
|
|
@@ -145,9 +146,7 @@ function makeTierLeaf(tier) {
|
|
|
145
146
|
},
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
|
-
// ---------------------------------------------------------------------------
|
|
149
149
|
// Registration
|
|
150
|
-
// ---------------------------------------------------------------------------
|
|
151
150
|
export function registerPush() {
|
|
152
151
|
return defineBranch({
|
|
153
152
|
name: 'push',
|
package/dist/commands/revive.js
CHANGED
|
@@ -23,9 +23,7 @@ import { routes } from '../api/index.js';
|
|
|
23
23
|
// server-side).
|
|
24
24
|
import { fullName } from '../core/canvas/labels.js';
|
|
25
25
|
import { recordedPidLiveness } from '../core/canvas/pid.js';
|
|
26
|
-
// ---------------------------------------------------------------------------
|
|
27
26
|
// revive --all
|
|
28
|
-
// ---------------------------------------------------------------------------
|
|
29
27
|
export const reviveLeaf = defineLeaf({
|
|
30
28
|
name: 'revive',
|
|
31
29
|
description: 'mass-reconnect every disconnected node',
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// `crtr surface node` — pure tmux placement for node viewers.
|
|
2
|
+
import { envHomeOverride } from '../../../shared/env.js';
|
|
2
3
|
import { closePane, currentTmux, displayPopup, ensureSession, getPaneOption, listLivePanes, openNodeWindow, paneCurrentPath, paneExists, paneLocation, panePid, paneStartCommand, renameWindow, respawnPaneInPlace, respawnPaneSync, selectLayout, selectPane, selectWindow, setPaneOption, shellQuote, splitWindow, switchClient, viewerSplitEnv, windowOfPane, } from '../../../core/runtime/placement-tmux.js';
|
|
3
4
|
import { cliClient, rethrowAsCliError } from '../../api-client.js';
|
|
4
5
|
export { closePane, currentTmux, displayPopup, paneCurrentPath, paneExists, panePid, paneStartCommand, respawnPaneInPlace, respawnPaneSync, shellQuote, viewerSplitEnv };
|
|
5
6
|
export function viewerEnv() {
|
|
6
|
-
const crtrHome =
|
|
7
|
+
const crtrHome = envHomeOverride();
|
|
7
8
|
return crtrHome !== undefined ? { CRTR_HOME: crtrHome } : {};
|
|
8
9
|
}
|
|
9
10
|
/** The live viewer pane for `nodeId` (the pane a surface-attach viewer tagged
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
// inherited tmux server env (like every crtr chrome pane) — no broker-side env
|
|
29
29
|
// read, no host assumption. tmux-native throughout: a web-only surface has no
|
|
30
30
|
// pane to split and resolves to the no_pane error, never a caller of this.
|
|
31
|
+
import { envNodeId } from '../shared/env.js';
|
|
31
32
|
import { existsSync, statSync } from 'node:fs';
|
|
32
33
|
import { isAbsolute, resolve } from 'node:path';
|
|
33
34
|
import { defineLeaf } from '../core/command.js';
|
|
@@ -50,7 +51,7 @@ function resolveTargetPane(explicit) {
|
|
|
50
51
|
// Agent path: split beside the pane where THIS node is being watched. Resolve
|
|
51
52
|
// it by the authoritative @crtr_node tag (set by any viewer) — NOT the focus
|
|
52
53
|
// table, which a bare `surface attach` never writes.
|
|
53
|
-
const nodeId =
|
|
54
|
+
const nodeId = envNodeId();
|
|
54
55
|
if (nodeId !== undefined && nodeId !== '') {
|
|
55
56
|
const pane = paneOfNode(nodeId);
|
|
56
57
|
if (pane !== null)
|
|
@@ -4,9 +4,7 @@ import { usage, notFound } from '../../core/errors.js';
|
|
|
4
4
|
import { scopeRoot, requireScopeRoot, listScopes } from '../../core/scope.js';
|
|
5
5
|
import { resolveScope } from './shared.js';
|
|
6
6
|
import { SCOPE_CONFIG_KEYS, USER_SETTINGS, findUserSetting } from '../../core/user-settings.js';
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
7
|
// Config helpers (ported from commands/config.ts)
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
8
|
const CONFIG_TOP_LEVEL_HELP = SCOPE_CONFIG_KEYS.join(', ');
|
|
11
9
|
const SCALAR_SETTING_HELP = USER_SETTINGS.map((setting) => `${setting.key} (${setting.valueConstraint})`).join(', ');
|
|
12
10
|
const MODEL_PROVIDERS = new Set(['anthropic', 'openai']);
|
|
@@ -136,9 +134,7 @@ function setNestedValue(cfg, key, rawValue, value) {
|
|
|
136
134
|
}
|
|
137
135
|
throw usage(`unsupported key path for set: ${key}`);
|
|
138
136
|
}
|
|
139
|
-
// ---------------------------------------------------------------------------
|
|
140
137
|
// Leaf definitions
|
|
141
|
-
// ---------------------------------------------------------------------------
|
|
142
138
|
const configGet = defineLeaf({
|
|
143
139
|
name: 'get',
|
|
144
140
|
description: 'read a config value by key',
|
|
@@ -261,6 +257,7 @@ export const configBranch = defineBranch({
|
|
|
261
257
|
help: {
|
|
262
258
|
name: 'sys config',
|
|
263
259
|
summary: 'read and write crtr configuration, including model ladders; edit humanActions maps directly in ~/.crouter/config.json or <repo>/.crouter/config.json',
|
|
260
|
+
model: 'Configuration resolves through ordered scopes. Reads can resolve the effective value, writes target one writable scope, and path inspection reveals the backing files without reading values.',
|
|
264
261
|
},
|
|
265
262
|
children: [configGet, configSet, configPath],
|
|
266
263
|
});
|
|
@@ -11,9 +11,7 @@ import { InputError } from '../../core/io.js';
|
|
|
11
11
|
import { spawnDaemon, stopDaemonProcess, sweepStrayDaemons } from '../../daemon/manage.js';
|
|
12
12
|
import { isDaemonRunning, readPidfile, isPidAlive } from '../../daemon/pidfile.js';
|
|
13
13
|
import { cliClient } from '../api-client.js';
|
|
14
|
-
// ---------------------------------------------------------------------------
|
|
15
14
|
// daemon start
|
|
16
|
-
// ---------------------------------------------------------------------------
|
|
17
15
|
const daemonStart = defineLeaf({
|
|
18
16
|
name: 'start',
|
|
19
17
|
description: 'start the daemon in the background',
|
|
@@ -38,9 +36,7 @@ const daemonStart = defineLeaf({
|
|
|
38
36
|
return result;
|
|
39
37
|
},
|
|
40
38
|
});
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
39
|
// daemon status
|
|
43
|
-
// ---------------------------------------------------------------------------
|
|
44
40
|
const daemonStatus = defineLeaf({
|
|
45
41
|
name: 'status',
|
|
46
42
|
description: 'check whether the daemon is running',
|
|
@@ -64,9 +60,7 @@ const daemonStatus = defineLeaf({
|
|
|
64
60
|
: { running: false };
|
|
65
61
|
},
|
|
66
62
|
});
|
|
67
|
-
// ---------------------------------------------------------------------------
|
|
68
63
|
// daemon restart
|
|
69
|
-
// ---------------------------------------------------------------------------
|
|
70
64
|
const daemonRestart = defineLeaf({
|
|
71
65
|
name: 'restart',
|
|
72
66
|
description: 'put the selected runtime generation in service via a daemon-owned handover',
|
|
@@ -119,9 +113,7 @@ const daemonRestart = defineLeaf({
|
|
|
119
113
|
}
|
|
120
114
|
},
|
|
121
115
|
});
|
|
122
|
-
// ---------------------------------------------------------------------------
|
|
123
116
|
// daemon stop
|
|
124
|
-
// ---------------------------------------------------------------------------
|
|
125
117
|
const daemonStop = defineLeaf({
|
|
126
118
|
name: 'stop',
|
|
127
119
|
description: 'stop the running daemon',
|
|
@@ -173,9 +165,7 @@ const daemonStop = defineLeaf({
|
|
|
173
165
|
}
|
|
174
166
|
},
|
|
175
167
|
});
|
|
176
|
-
// ---------------------------------------------------------------------------
|
|
177
168
|
// Export — mounted under `crtr sys`
|
|
178
|
-
// ---------------------------------------------------------------------------
|
|
179
169
|
export const daemonBranch = defineBranch({
|
|
180
170
|
name: 'daemon',
|
|
181
171
|
description: 'manage the crtrd supervisor process',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { envProfileId } from '../../shared/env.js';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { lstat, readFile, readdir, readlink } from 'node:fs/promises';
|
|
3
4
|
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
@@ -183,7 +184,7 @@ async function runHookPluginChecks(scopes) {
|
|
|
183
184
|
*/
|
|
184
185
|
function runBinContributionChecks(scopes) {
|
|
185
186
|
const inScope = new Set(scopes);
|
|
186
|
-
const { bins, issues } = resolveBinContributions(process.cwd(),
|
|
187
|
+
const { bins, issues } = resolveBinContributions(process.cwd(), envProfileId() || null);
|
|
187
188
|
const results = [];
|
|
188
189
|
for (const issue of issues) {
|
|
189
190
|
if (!inScope.has(issue.scope))
|
|
@@ -253,7 +254,7 @@ function runHumanActionChecks(scopes) {
|
|
|
253
254
|
* broker environment a node launched from this cwd/profile receives. */
|
|
254
255
|
function runRequiresChecks(scopes) {
|
|
255
256
|
const inScope = new Set(scopes);
|
|
256
|
-
const env = buildBrokerEnv({ argv: [], env: { CRTR_NODE_CWD: process.cwd(), CRTR_PROFILE_ID:
|
|
257
|
+
const env = buildBrokerEnv({ argv: [], env: { CRTR_NODE_CWD: process.cwd(), CRTR_PROFILE_ID: envProfileId() ?? '' } });
|
|
257
258
|
const results = [];
|
|
258
259
|
for (const plugin of listAllPlugins()) {
|
|
259
260
|
if (!inScope.has(plugin.scope) || !plugin.enabled || plugin.manifest.requires === undefined)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Input } from
|
|
2
|
-
import { type SetupPanel } from
|
|
1
|
+
import { Input } from '@earendil-works/pi-tui';
|
|
2
|
+
import { type SetupPanel } from '../../../core/tui/panel.js';
|
|
3
3
|
export declare class BrokerLimitsPanel implements SetupPanel {
|
|
4
4
|
private readonly onChange;
|
|
5
5
|
readonly warningInput: Input;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Input, truncateToWidth } from
|
|
2
|
-
import { readConfig, updateRawConfigAtomically } from
|
|
3
|
-
import { BROKER_LIMIT_OVERRIDE_PRECEDENCE } from
|
|
4
|
-
import { padAnsi, theme, wrapText } from
|
|
1
|
+
import { Input, truncateToWidth } from '@earendil-works/pi-tui';
|
|
2
|
+
import { readConfig, updateRawConfigAtomically } from '../../../core/config.js';
|
|
3
|
+
import { BROKER_LIMIT_OVERRIDE_PRECEDENCE } from '../setup.js';
|
|
4
|
+
import { padAnsi, theme, wrapText } from '../../../core/tui/panel.js';
|
|
5
5
|
function positive(value) {
|
|
6
6
|
return /^\d+$/.test(value) &&
|
|
7
7
|
Number.isSafeInteger(Number(value)) &&
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SetupSystemInstallPlan } from
|
|
2
|
-
import { type SetupPanel } from
|
|
1
|
+
import type { SetupSystemInstallPlan } from '../setup-core.js';
|
|
2
|
+
import { type SetupPanel } from '../../../core/tui/panel.js';
|
|
3
3
|
export declare class DependenciesPanel implements SetupPanel {
|
|
4
4
|
private readonly plans;
|
|
5
5
|
private readonly onChange;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { truncateToWidth } from
|
|
2
|
-
import { theme } from
|
|
1
|
+
import { truncateToWidth } from '@earendil-works/pi-tui';
|
|
2
|
+
import { theme } from '../../../core/tui/panel.js';
|
|
3
3
|
function toolLabel(tool) {
|
|
4
4
|
return tool === "nvim" ? "nvim" : tool === "nerd-font" ? "Nerd Font" : "tmux";
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BindingId, type BindingResolution } from
|
|
1
|
+
import { type BindingId, type BindingResolution } from '../../../core/keybindings/index.js';
|
|
2
2
|
export declare class KeybindingsPanel {
|
|
3
3
|
private readonly openingBindings;
|
|
4
4
|
private readonly terminalRows;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Input, matchesKey, truncateToWidth, visibleWidth, } from
|
|
2
|
-
import { BINDING_CATALOG, formatBinding, formatGesture, isAttachPaneBinding, matchesPiTuiInput, persistUserKeybindings, KeybindingConcurrentEditError, KeybindingValidationError, } from
|
|
3
|
-
import { installTmuxBindings, occupiedTmuxRootGestures, } from
|
|
4
|
-
import { SetupKeybindingsDraft } from
|
|
5
|
-
import { padAnsi, theme } from
|
|
1
|
+
import { Input, matchesKey, truncateToWidth, visibleWidth, } from '@earendil-works/pi-tui';
|
|
2
|
+
import { BINDING_CATALOG, formatBinding, formatGesture, isAttachPaneBinding, matchesPiTuiInput, persistUserKeybindings, KeybindingConcurrentEditError, KeybindingValidationError, } from '../../../core/keybindings/index.js';
|
|
3
|
+
import { installTmuxBindings, occupiedTmuxRootGestures, } from '../../../core/runtime/tmux-chrome.js';
|
|
4
|
+
import { SetupKeybindingsDraft } from '../setup-core.js';
|
|
5
|
+
import { padAnsi, theme } from '../../../core/tui/panel.js';
|
|
6
6
|
/** Collapse explicitly-paired catalog definitions into one setup action row.
|
|
7
7
|
* Pair membership and field roles come only from catalog metadata; neither
|
|
8
8
|
* rendering nor installation guesses from binding ID names. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ModelRegistry, ModelRuntime } from
|
|
2
|
-
import { type TUI } from
|
|
3
|
-
import type { BindingId } from
|
|
4
|
-
import { type SetupPanel } from
|
|
1
|
+
import { ModelRegistry, ModelRuntime } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import { type TUI } from '@earendil-works/pi-tui';
|
|
3
|
+
import type { BindingId } from '../../../core/keybindings/index.js';
|
|
4
|
+
import { type SetupPanel } from '../../../core/tui/panel.js';
|
|
5
5
|
export declare class ModelsPanel implements SetupPanel {
|
|
6
6
|
private readonly tui;
|
|
7
7
|
private readonly runtime;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { envProfileId } from '../../../shared/env.js';
|
|
2
|
+
import { ModelSelectorComponent, SettingsManager, ThinkingSelectorComponent, } from '@earendil-works/pi-coding-agent';
|
|
3
|
+
import { truncateToWidth } from '@earendil-works/pi-tui';
|
|
4
|
+
import { basename, dirname, join } from 'node:path';
|
|
5
|
+
import { ANTHROPIC_PROVIDER_ID, OPENAI_CODEX_PROVIDER_ID, isManagedProvider, readSubscriptionPool, } from '../../../core/subscription-state.js';
|
|
6
|
+
import { readRawConfigAtRoot, persistDefaultKindModel, persistModelLadders, readMergedLaunchConfig, } from '../../../core/config.js';
|
|
7
|
+
import { findProjectScopeRoots, userScopeRoot } from '../../../core/scope.js';
|
|
8
|
+
import { loadProfileManifest, profileRoot, } from '../../../core/profiles/manifest.js';
|
|
9
|
+
import { configuredLadderProviders, inferPortableModelSelection, MODEL_PROVIDER_KEYS, MODEL_STRENGTHS, THINKING_SUFFIXES, } from '../../../core/runtime/model-selection.js';
|
|
10
|
+
import { fitTail, padAnsi, renderRows, theme, } from '../../../core/tui/panel.js';
|
|
10
11
|
const MODELS_CHROME_LINES = 3;
|
|
11
12
|
const RUNTIME_PROVIDER_ID = {
|
|
12
13
|
anthropic: ANTHROPIC_PROVIDER_ID,
|
|
@@ -24,7 +25,7 @@ const KIND_COLUMNS = [
|
|
|
24
25
|
];
|
|
25
26
|
function modelConfigTargets() {
|
|
26
27
|
const userRoot = userScopeRoot();
|
|
27
|
-
const profileId =
|
|
28
|
+
const profileId = envProfileId() || null;
|
|
28
29
|
let profileTarget;
|
|
29
30
|
if (profileId !== null) {
|
|
30
31
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SetupPackageId, SetupPackageManifestEntry } from
|
|
2
|
-
import { type SetupPanel } from
|
|
1
|
+
import type { SetupPackageId, SetupPackageManifestEntry } from '../setup-core.js';
|
|
2
|
+
import { type SetupPanel } from '../../../core/tui/panel.js';
|
|
3
3
|
export declare class PluginsPanel implements SetupPanel {
|
|
4
4
|
private readonly manifest;
|
|
5
5
|
private readonly installedPackageIds;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { truncateToWidth } from
|
|
2
|
-
import { theme, wrapText } from
|
|
1
|
+
import { truncateToWidth } from '@earendil-works/pi-tui';
|
|
2
|
+
import { theme, wrapText } from '../../../core/tui/panel.js';
|
|
3
3
|
export class PluginsPanel {
|
|
4
4
|
manifest;
|
|
5
5
|
installedPackageIds;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type UserSettingGroup } from
|
|
2
|
-
import { type SetupPanel } from
|
|
1
|
+
import { type UserSettingGroup } from '../../../core/user-settings.js';
|
|
2
|
+
import { type SetupPanel } from '../../../core/tui/panel.js';
|
|
3
3
|
/**
|
|
4
4
|
* One destination's worth of user-scope preference rows. The old single
|
|
5
5
|
* "Settings" tab listed every row flat with a permanent description under each,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { truncateToWidth } from
|
|
2
|
-
import { readConfig, updateConfig } from
|
|
3
|
-
import { userSettingsInGroup, } from
|
|
4
|
-
import { padAnsi, theme, visibleRange, wrapText, } from
|
|
1
|
+
import { truncateToWidth } from '@earendil-works/pi-tui';
|
|
2
|
+
import { readConfig, updateConfig } from '../../../core/config.js';
|
|
3
|
+
import { userSettingsInGroup, } from '../../../core/user-settings.js';
|
|
4
|
+
import { padAnsi, theme, visibleRange, wrapText, } from '../../../core/tui/panel.js';
|
|
5
5
|
const LABEL_WIDTH = 26;
|
|
6
6
|
/**
|
|
7
7
|
* One destination's worth of user-scope preference rows. The old single
|
|
@@ -11,14 +11,15 @@
|
|
|
11
11
|
// `default-binding.ts`, exactly as the `crtr profile` leaves do. Deletion is
|
|
12
12
|
// the one exception: it cascades across nodes, crons, tickets and reviews, so
|
|
13
13
|
// it routes through crtrd like `crtr profile delete`.
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
14
|
+
import { envNodeId } from '../../../shared/env.js';
|
|
15
|
+
import { Input, matchesKey, truncateToWidth } from '@earendil-works/pi-tui';
|
|
16
|
+
import { basename } from 'node:path';
|
|
17
|
+
import { PROFILE_PROJECT_MEMORY_VALUES } from '../../../api/dto/profiles.js';
|
|
18
|
+
import { cliClient } from '../../api-client.js';
|
|
19
|
+
import { clearDefaultProfile, defaultProfileDirs, getDefaultProfileId, setDefaultProfileId, } from '../../../core/profiles/default-binding.js';
|
|
20
|
+
import { ROOT_PROFILE_ID, addProfileProject, createProfile, listProfiles, pauseProfile, removeProfileProject, renameProfile, resumeProfile, } from '../../../core/profiles/manifest.js';
|
|
21
|
+
import { profileCoversCwd, tildify } from '../../../core/profiles/select.js';
|
|
22
|
+
import { padAnsi, theme, visibleRange, wrapText, } from '../../../core/tui/panel.js';
|
|
22
23
|
/** Coarse "used ..." for telling otherwise-alike profiles apart. */
|
|
23
24
|
function relativeUsed(iso) {
|
|
24
25
|
if (iso === null)
|
|
@@ -97,7 +98,7 @@ export class ProfilesPanel {
|
|
|
97
98
|
return matchesKey(data, "escape") || matchesKey(data, "left");
|
|
98
99
|
return true;
|
|
99
100
|
}
|
|
100
|
-
//
|
|
101
|
+
// state
|
|
101
102
|
/** Profiles covering cwd first (most recently used within), then the rest by
|
|
102
103
|
* recency, with root last — the ones a startup pick is deciding between sit
|
|
103
104
|
* at the top, where the eye starts. */
|
|
@@ -157,7 +158,7 @@ export class ProfilesPanel {
|
|
|
157
158
|
this.say(messageOf(error), "warning");
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
|
-
//
|
|
161
|
+
// input
|
|
161
162
|
handleInput(data, matches) {
|
|
162
163
|
const handled = this.route(data, matches);
|
|
163
164
|
if (handled)
|
|
@@ -295,7 +296,7 @@ export class ProfilesPanel {
|
|
|
295
296
|
this.dirIndex = (this.dirIndex + delta + count) % count;
|
|
296
297
|
this.notice = undefined;
|
|
297
298
|
}
|
|
298
|
-
//
|
|
299
|
+
// actions
|
|
299
300
|
addCwdTo(entry) {
|
|
300
301
|
if (entry === null)
|
|
301
302
|
return true;
|
|
@@ -428,7 +429,7 @@ export class ProfilesPanel {
|
|
|
428
429
|
try {
|
|
429
430
|
const result = await cliClient().deleteProfile(open.profileId, {
|
|
430
431
|
force: true,
|
|
431
|
-
caller_node_id:
|
|
432
|
+
caller_node_id: envNodeId() ?? null,
|
|
432
433
|
});
|
|
433
434
|
this.openId = null;
|
|
434
435
|
this.reload();
|
|
@@ -442,7 +443,7 @@ export class ProfilesPanel {
|
|
|
442
443
|
this.onChange();
|
|
443
444
|
}
|
|
444
445
|
}
|
|
445
|
-
//
|
|
446
|
+
// rendering
|
|
446
447
|
footerHint() {
|
|
447
448
|
switch (this.mode) {
|
|
448
449
|
case "new-name":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModelRegistry, ModelRuntime } from
|
|
2
|
-
import { type TUI } from
|
|
3
|
-
import { type SetupPanel } from
|
|
1
|
+
import { ModelRegistry, ModelRuntime } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import { type TUI } from '@earendil-works/pi-tui';
|
|
3
|
+
import { type SetupPanel } from '../../../core/tui/panel.js';
|
|
4
4
|
type AuthStatus = ReturnType<ModelRegistry["getProviderAuthStatus"]>;
|
|
5
5
|
type ProviderAuthType = "oauth" | "api_key";
|
|
6
6
|
type ProviderRow = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LoginDialogComponent, } from
|
|
2
|
-
import { Input, matchesKey, truncateToWidth, } from
|
|
3
|
-
import { execFile } from
|
|
4
|
-
import { dialogAuthInteraction } from
|
|
5
|
-
import { isManagedProvider, promoteSubscription, readSubscriptionPool, renameSubscription, } from
|
|
6
|
-
import { removeProviderRow } from
|
|
7
|
-
import { cliClient } from
|
|
8
|
-
import { fitTail, theme, visibleRange, } from
|
|
1
|
+
import { LoginDialogComponent, } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import { Input, matchesKey, truncateToWidth, } from '@earendil-works/pi-tui';
|
|
3
|
+
import { execFile } from 'node:child_process';
|
|
4
|
+
import { dialogAuthInteraction } from '../../../core/auth-interaction.js';
|
|
5
|
+
import { isManagedProvider, promoteSubscription, readSubscriptionPool, renameSubscription, } from '../../../core/subscription-state.js';
|
|
6
|
+
import { removeProviderRow } from '../../../core/provider-management.js';
|
|
7
|
+
import { cliClient } from '../../api-client.js';
|
|
8
|
+
import { fitTail, theme, visibleRange, } from '../../../core/tui/panel.js';
|
|
9
9
|
/** Curated setup-catalog view over pi's OAuth providers + the model registry. */
|
|
10
10
|
export function buildProviderCatalog(runtime, registry) {
|
|
11
11
|
const oauth = runtime
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModelRegistry, ModelRuntime } from
|
|
2
|
-
import { TUI, type Component, type Focusable } from
|
|
3
|
-
import { type BindingId, type BindingResolution } from
|
|
1
|
+
import { ModelRegistry, ModelRuntime } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import { TUI, type Component, type Focusable } from '@earendil-works/pi-tui';
|
|
3
|
+
import { type BindingId, type BindingResolution } from '../../core/keybindings/index.js';
|
|
4
4
|
export type DestinationId = "providers" | "models" | "keybindings" | "display" | "profiles" | "panes" | "broker-limits" | "updates";
|
|
5
5
|
export declare class SettingsShell implements Component, Focusable {
|
|
6
6
|
private readonly tui;
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
//
|
|
3
3
|
// This is the persistent settings editor. The first-run installer lives in
|
|
4
4
|
// setup-wizard.ts; both surfaces reuse only the panels they actually share.
|
|
5
|
-
import { matchesKey, truncateToWidth, visibleWidth, } from
|
|
6
|
-
import { configPath } from
|
|
7
|
-
import { formatGesture, matchesPiTuiInput, } from
|
|
8
|
-
import { reconcileInboxFrontDoor } from
|
|
9
|
-
import { runSetupSettingsProcess } from
|
|
10
|
-
import { BrokerLimitsPanel } from
|
|
11
|
-
import { KeybindingsPanel } from
|
|
12
|
-
import { ModelsPanel } from
|
|
13
|
-
import { PAGE_CHROME_ROWS, columns, padAnsi, pageFrame, theme, } from
|
|
14
|
-
import { PrefsPanel } from
|
|
15
|
-
import { ProfilesPanel } from
|
|
16
|
-
import { ProviderPanel } from
|
|
5
|
+
import { matchesKey, truncateToWidth, visibleWidth, } from '@earendil-works/pi-tui';
|
|
6
|
+
import { configPath } from '../../core/config.js';
|
|
7
|
+
import { formatGesture, matchesPiTuiInput, } from '../../core/keybindings/index.js';
|
|
8
|
+
import { reconcileInboxFrontDoor } from './setup-core.js';
|
|
9
|
+
import { runSetupSettingsProcess } from './setup-settings-runner.js';
|
|
10
|
+
import { BrokerLimitsPanel } from './panels/broker-limits-panel.js';
|
|
11
|
+
import { KeybindingsPanel } from './panels/keybindings-panel.js';
|
|
12
|
+
import { ModelsPanel } from './panels/models-panel.js';
|
|
13
|
+
import { PAGE_CHROME_ROWS, columns, padAnsi, pageFrame, theme, } from '../../core/tui/panel.js';
|
|
14
|
+
import { PrefsPanel } from './panels/prefs-panel.js';
|
|
15
|
+
import { ProfilesPanel } from './panels/profiles-panel.js';
|
|
16
|
+
import { ProviderPanel } from './panels/provider-panel.js';
|
|
17
17
|
/** Rail column width, including its badge gutter. */
|
|
18
18
|
const RAIL_WIDTH = 22;
|
|
19
19
|
/** Below this the rail costs more than it explains; the page falls back to a
|
|
@@ -114,7 +114,7 @@ export class SettingsShell {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
//
|
|
117
|
+
// focus and navigation
|
|
118
118
|
set focused(value) {
|
|
119
119
|
this._focused = value;
|
|
120
120
|
this.syncFocus();
|
|
@@ -164,7 +164,7 @@ export class SettingsShell {
|
|
|
164
164
|
? "disabled"
|
|
165
165
|
: formatGesture(gestures[0].split(" > ").pop());
|
|
166
166
|
}
|
|
167
|
-
//
|
|
167
|
+
// input
|
|
168
168
|
/** Panels that have taken over the keyboard — a live text field, a modal, an
|
|
169
169
|
* open picker — keep every key including Escape until they release it. */
|
|
170
170
|
panelOwnsKeyboard(data) {
|
|
@@ -270,7 +270,7 @@ export class SettingsShell {
|
|
|
270
270
|
this.keybindings.focused = false;
|
|
271
271
|
this.brokerLimits.focused = false;
|
|
272
272
|
}
|
|
273
|
-
//
|
|
273
|
+
// rendering
|
|
274
274
|
renderRail(height) {
|
|
275
275
|
const out = [];
|
|
276
276
|
let group;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModelRegistry, ModelRuntime } from
|
|
2
|
-
import type { BindingId, BindingResolution } from
|
|
3
|
-
import { type TuiPageContext, type TuiPageControl, type TuiPageSurface } from
|
|
1
|
+
import { ModelRegistry, ModelRuntime } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import type { BindingId, BindingResolution } from '../../core/keybindings/index.js';
|
|
3
|
+
import { type TuiPageContext, type TuiPageControl, type TuiPageSurface } from '../../core/tui/page-host.js';
|
|
4
4
|
/** Setup and settings both edit pi's model configuration, so their host adds
|
|
5
5
|
* the model runtime to the shared page context. Every other page concern —
|
|
6
6
|
* theme, keybindings, terminal lifecycle — belongs to `runTuiPage`. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ModelRegistry, ModelRuntime } from
|
|
2
|
-
import { join } from
|
|
3
|
-
import { defaultAgentDir } from
|
|
4
|
-
import { PoolCredentialStore } from
|
|
5
|
-
import { runTuiPage, } from
|
|
1
|
+
import { ModelRegistry, ModelRuntime } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { defaultAgentDir } from '../../clients/attach/config.js';
|
|
4
|
+
import { PoolCredentialStore } from '../../core/pool-credential-store.js';
|
|
5
|
+
import { runTuiPage, } from '../../core/tui/page-host.js';
|
|
6
6
|
export async function runSetupSettingsProcess(createSurface, interceptCancel) {
|
|
7
7
|
const agentDir = defaultAgentDir();
|
|
8
8
|
const runtime = await ModelRuntime.create({
|