@north-light/crouter 0.3.263 → 0.3.269
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/client.d.ts +5 -1
- package/dist/api/client.js +6 -0
- package/dist/api/dto/canvas.d.ts +53 -2
- package/dist/api/dto/nodes.d.ts +6 -2
- package/dist/api/routes.d.ts +1 -0
- package/dist/api/routes.js +1 -0
- package/dist/builtin-memory/05-kinds/advisor/advice-contract.md +2 -2
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/integration/provider-rotation.test.ts +50 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +46 -6
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.js +6 -2
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +7 -2
- package/dist/clients/attach/session/whip-achievements.d.ts +4 -0
- package/dist/clients/attach/session/whip-achievements.js +145 -0
- package/dist/clients/attach/slash/dispatch.js +5 -3
- package/dist/clients/attach/viewer.js +607 -606
- package/dist/commands/canvas-history/grep.js +3 -22
- package/dist/commands/canvas-history/read.js +5 -3
- package/dist/commands/canvas-history/search.js +3 -22
- package/dist/commands/canvas-history/shared.d.ts +8 -0
- package/dist/commands/canvas-history/shared.js +64 -1
- package/dist/commands/canvas-history/stats.d.ts +1 -0
- package/dist/commands/canvas-history/stats.js +68 -0
- package/dist/commands/canvas-history.js +4 -3
- package/dist/commands/node/create.js +2 -2
- package/dist/commands/sys/config.js +19 -2
- package/dist/commands/sys/panels/models-panel.js +3 -1
- package/dist/core/__tests__/integration/revive.test.js +4 -2
- package/dist/core/__tests__/model-pin-durability.test.js +25 -1
- package/dist/core/__tests__/relaunch-root.test.js +17 -0
- package/dist/core/__tests__/seam/broker-provider-retry.test.js +19 -4
- package/dist/core/__tests__/seam/memory-slash-node-relative-inventory.test.js +19 -2
- package/dist/core/broker-client/__tests__/transport-relay.test.js +3 -1
- package/dist/core/broker-client/transport-relay.js +5 -1
- package/dist/core/canvas/__tests__/history-transcript.test.d.ts +1 -0
- package/dist/core/canvas/__tests__/history-transcript.test.js +102 -0
- package/dist/core/canvas/browse/app.d.ts +1 -1
- package/dist/core/canvas/browse/app.js +13 -10
- package/dist/core/canvas/browse/model.js +16 -1
- package/dist/core/canvas/browse/render.d.ts +23 -3
- package/dist/core/canvas/browse/render.js +429 -64
- package/dist/core/canvas/canvas.js +12 -8
- package/dist/core/canvas/extensions.d.ts +1 -1
- package/dist/core/canvas/extensions.js +7 -1
- package/dist/core/canvas/history.d.ts +36 -1
- package/dist/core/canvas/history.js +328 -7
- package/dist/core/canvas/labels.d.ts +2 -2
- package/dist/core/canvas/migrations.js +32 -0
- package/dist/core/canvas/node-recap.d.ts +23 -0
- package/dist/core/canvas/node-recap.js +67 -0
- package/dist/core/canvas/render-source.d.ts +33 -1
- package/dist/core/canvas/render-source.js +80 -22
- package/dist/core/canvas/types.d.ts +9 -0
- package/dist/core/config.js +13 -5
- package/dist/core/keybindings/catalog.d.ts +2 -2
- package/dist/core/keybindings/catalog.js +2 -1
- package/dist/core/model-routes.js +1 -1
- package/dist/core/runtime/broker/auth-reload.js +4 -1
- package/dist/core/runtime/broker/fault-retry.js +7 -2
- package/dist/core/runtime/broker/frame-client.js +4 -0
- package/dist/core/runtime/broker/frame-dispatch.js +7 -0
- package/dist/core/runtime/broker/inbox.d.ts +12 -2
- package/dist/core/runtime/broker/inbox.js +68 -38
- package/dist/core/runtime/broker-protocol.d.ts +6 -0
- package/dist/core/runtime/broker.js +14 -0
- package/dist/core/runtime/canvas-extensions.d.ts +1 -0
- package/dist/core/runtime/canvas-extensions.js +2 -0
- package/dist/core/runtime/interactive-deliver.d.ts +8 -2
- package/dist/core/runtime/interactive-deliver.js +12 -3
- package/dist/core/runtime/launch-target.js +1 -1
- package/dist/core/runtime/launch.d.ts +12 -6
- package/dist/core/runtime/launch.js +19 -17
- package/dist/core/runtime/model-swap.d.ts +5 -4
- package/dist/core/runtime/model-swap.js +7 -5
- package/dist/core/runtime/promote.js +2 -1
- package/dist/core/runtime/reset.js +4 -2
- package/dist/core/runtime/revive.js +22 -0
- package/dist/core/runtime/spawn.d.ts +3 -3
- package/dist/core/runtime/spawn.js +20 -3
- package/dist/core/runtime/stamp/channel.d.ts +18 -0
- package/dist/core/runtime/stamp/channel.js +74 -0
- package/dist/core/runtime/stamp/protocol.d.ts +86 -0
- package/dist/core/runtime/stamp/protocol.js +113 -0
- package/dist/core/runtime/tmux-driver.d.ts +11 -1
- package/dist/core/runtime/tmux-driver.js +27 -11
- package/dist/core/self-update.js +2 -5
- package/dist/core/tui/draw.d.ts +1 -0
- package/dist/core/tui/draw.js +5 -1
- package/dist/core/tui/markdown.d.ts +17 -0
- package/dist/core/tui/markdown.js +407 -0
- package/dist/core/user-settings.d.ts +4 -0
- package/dist/core/user-settings.js +1 -0
- package/dist/daemon/api/__tests__/node-model-validation.test.js +21 -0
- package/dist/daemon/api/bridge.d.ts +3 -2
- package/dist/daemon/api/bridge.js +34 -9
- package/dist/daemon/api/handlers/canvas.js +62 -16
- package/dist/daemon/api/handlers/messages.js +12 -1
- package/dist/daemon/api/handlers/nodes.js +10 -3
- package/dist/daemon/api/map.js +2 -0
- package/dist/daemon/messaging/node-message.js +15 -1
- package/dist/daemon/reconcilers/broker-supervision.js +26 -9
- package/dist/daemon/reconcilers/live-obligation.d.ts +8 -1
- package/dist/daemon/reconcilers/live-obligation.js +17 -0
- package/dist/pi-extensions/canvas-inbox-watcher.js +27 -2
- package/dist/pi-extensions/canvas-recap.js +4 -0
- package/dist/pi-extensions/canvas-stamp.d.ts +14 -0
- package/dist/pi-extensions/canvas-stamp.js +77 -0
- package/dist/pi-extensions/canvas-stophook.js +3 -0
- package/dist/shared/__tests__/env-boundary.test.js +4 -2
- package/dist/shared/crtr-version.d.ts +2 -0
- package/dist/shared/crtr-version.js +18 -0
- package/dist/shared/env.d.ts +10 -0
- package/dist/shared/env.js +19 -4
- package/dist/types.d.ts +10 -0
- package/dist/types.js +4 -0
- package/package.json +1 -1
- package/runtime.lock.json +2 -2
package/dist/shared/env.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare function envNodeCwd(): string | undefined;
|
|
|
8
8
|
* undefined. Cleared (not read) via `delete process.env['CRTR_MODEL_INTENT']`
|
|
9
9
|
* in `runtime/broker.ts` — a mutation, not a read, so it stays there. */
|
|
10
10
|
export declare function envModelIntent(): string | undefined;
|
|
11
|
+
/** Whether the launch recipe requires this broker to keep its exact provider/model. */
|
|
12
|
+
export declare function envModelExact(): boolean;
|
|
11
13
|
/** The raw `CRTR_HOME` override, unresolved. Use `crtrHome()`
|
|
12
14
|
* (`core/canvas/paths.ts`) to get the resolved canvas-home path; use this
|
|
13
15
|
* only when a caller needs the override itself — to check whether one is
|
|
@@ -67,6 +69,14 @@ export declare function envWarnLiveBrokers(): number | undefined;
|
|
|
67
69
|
/** Test-only unattended-park interval override (`CRTR_TEST_UNATTENDED_PARK_MS`),
|
|
68
70
|
* gated by `envNoDaemonAutostart()` at the call site; no production default. */
|
|
69
71
|
export declare function envTestUnattendedParkMs(): number | undefined;
|
|
72
|
+
/** Production unattended-park interval override (`CRTR_UNATTENDED_PARK_MS`), in
|
|
73
|
+
* milliseconds; wins over the user-scope config value
|
|
74
|
+
* (`readConfig('user').lifecycle.unattendedParkMs`, itself defaulting to 15
|
|
75
|
+
* min) whenever set, autostart or not. Unlike `CRTR_TEST_UNATTENDED_PARK_MS`
|
|
76
|
+
* this is not gated on `envNoDaemonAutostart()`: it is the env escape hatch
|
|
77
|
+
* above the configured knob a deployment sets to tune how long an eligible
|
|
78
|
+
* resident idles before its parking turn. */
|
|
79
|
+
export declare function envUnattendedParkMs(): number | undefined;
|
|
70
80
|
/** Test-only park-summary grace-period override
|
|
71
81
|
* (`CRTR_TEST_PARK_SUMMARY_GRACE_MS`); no production default. */
|
|
72
82
|
export declare function envTestParkSummaryGraceMs(): number | undefined;
|
package/dist/shared/env.js
CHANGED
|
@@ -40,6 +40,10 @@ export function envNodeCwd() {
|
|
|
40
40
|
export function envModelIntent() {
|
|
41
41
|
return process.env['CRTR_MODEL_INTENT'];
|
|
42
42
|
}
|
|
43
|
+
/** Whether the launch recipe requires this broker to keep its exact provider/model. */
|
|
44
|
+
export function envModelExact() {
|
|
45
|
+
return process.env['CRTR_MODEL_EXACT'] === '1';
|
|
46
|
+
}
|
|
43
47
|
/** The raw `CRTR_HOME` override, unresolved. Use `crtrHome()`
|
|
44
48
|
* (`core/canvas/paths.ts`) to get the resolved canvas-home path; use this
|
|
45
49
|
* only when a caller needs the override itself — to check whether one is
|
|
@@ -140,10 +144,11 @@ export function envDebug() {
|
|
|
140
144
|
return process.env['CRTR_DEBUG'] === '1';
|
|
141
145
|
}
|
|
142
146
|
// Precedence — broker-supervision.ts's threshold/interval overrides. Each
|
|
143
|
-
// returns the raw parsed value with NO default: the caller
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
+
// returns the raw parsed value with NO default: the caller supplies the
|
|
148
|
+
// default (user config for the broker thresholds and the unattended-park
|
|
149
|
+
// interval, a hardcoded constant for the test-only park-summary grace), and
|
|
150
|
+
// env wins over it when set. Undefined, unparseable, or non-positive all mean
|
|
151
|
+
// "no override" — the caller's own default applies.
|
|
147
152
|
function parsePositiveInteger(raw) {
|
|
148
153
|
if (raw === undefined || raw === '')
|
|
149
154
|
return undefined;
|
|
@@ -171,6 +176,16 @@ function parsePositiveMsNoDefault(raw) {
|
|
|
171
176
|
export function envTestUnattendedParkMs() {
|
|
172
177
|
return parsePositiveMsNoDefault(process.env['CRTR_TEST_UNATTENDED_PARK_MS']);
|
|
173
178
|
}
|
|
179
|
+
/** Production unattended-park interval override (`CRTR_UNATTENDED_PARK_MS`), in
|
|
180
|
+
* milliseconds; wins over the user-scope config value
|
|
181
|
+
* (`readConfig('user').lifecycle.unattendedParkMs`, itself defaulting to 15
|
|
182
|
+
* min) whenever set, autostart or not. Unlike `CRTR_TEST_UNATTENDED_PARK_MS`
|
|
183
|
+
* this is not gated on `envNoDaemonAutostart()`: it is the env escape hatch
|
|
184
|
+
* above the configured knob a deployment sets to tune how long an eligible
|
|
185
|
+
* resident idles before its parking turn. */
|
|
186
|
+
export function envUnattendedParkMs() {
|
|
187
|
+
return parsePositiveMsNoDefault(process.env['CRTR_UNATTENDED_PARK_MS']);
|
|
188
|
+
}
|
|
174
189
|
/** Test-only park-summary grace-period override
|
|
175
190
|
* (`CRTR_TEST_PARK_SUMMARY_GRACE_MS`); no production default. */
|
|
176
191
|
export function envTestParkSummaryGraceMs() {
|
package/dist/types.d.ts
CHANGED
|
@@ -157,6 +157,14 @@ export interface BrokerThresholdsConfig {
|
|
|
157
157
|
/** Defer daemon-initiated revives once the live broker census reaches this count. */
|
|
158
158
|
automaticReviveCap: number;
|
|
159
159
|
}
|
|
160
|
+
/** Host-wide node-lifecycle timing. Read only from user scope by crtrd, like
|
|
161
|
+
* `brokerThresholds`: project configuration must not change another user's
|
|
162
|
+
* daemon. */
|
|
163
|
+
export interface LifecycleConfig {
|
|
164
|
+
/** How long an eligible resident idles before its unattended-parking turn
|
|
165
|
+
* begins, in milliseconds. `CRTR_UNATTENDED_PARK_MS` overrides this. */
|
|
166
|
+
unattendedParkMs: number;
|
|
167
|
+
}
|
|
160
168
|
export type KeybindingOverrides = Record<string, string[]>;
|
|
161
169
|
/** Compile-time seam for runtime consumers migrating to semantic binding IDs. */
|
|
162
170
|
export type CanvasAction = {
|
|
@@ -251,6 +259,8 @@ export interface ScopeConfig {
|
|
|
251
259
|
* Independent attended roots keep their normal viewer behavior. */
|
|
252
260
|
auto_open_child_viewers: boolean;
|
|
253
261
|
brokerThresholds: BrokerThresholdsConfig;
|
|
262
|
+
/** Host-wide node-lifecycle timing (user scope only). */
|
|
263
|
+
lifecycle: LifecycleConfig;
|
|
254
264
|
/** Ring a short completion sound in the attach viewer when the node you are
|
|
255
265
|
* watching finishes a turn and hands control back (the Claude-Code Stop-hook
|
|
256
266
|
* ding). Only ever fires inside a live viewer pane — a headless/background
|
package/dist/types.js
CHANGED
|
@@ -82,6 +82,10 @@ export function defaultScopeConfig() {
|
|
|
82
82
|
// sized as a backstop that actually engages before the machine does.
|
|
83
83
|
// Override per host with CRTR_MAX_LIVE_BROKERS / CRTR_WARN_LIVE_BROKERS.
|
|
84
84
|
brokerThresholds: { warning: 16, automaticReviveCap: 32 },
|
|
85
|
+
// The unattended-park idle-eligibility delay: how long an eligible resident
|
|
86
|
+
// idles before its parking turn begins. Override per host with
|
|
87
|
+
// CRTR_UNATTENDED_PARK_MS.
|
|
88
|
+
lifecycle: { unattendedParkMs: 15 * 60_000 },
|
|
85
89
|
completion_bell: true,
|
|
86
90
|
working_gerunds: [...DEFAULT_WORKING_GERUNDS],
|
|
87
91
|
whip_mode: false,
|
package/package.json
CHANGED
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.269",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/crouter",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.269",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|