@north-light/crouter 0.3.214 → 0.3.216
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/dto/nodes.d.ts +2 -1
- package/dist/api/dto/profiles.d.ts +13 -1
- package/dist/builtin-memory/00-runtime-base.md +12 -11
- package/dist/builtin-memory/01-spine/00-has-manager.md +1 -11
- package/dist/builtin-memory/02-lifecycle/00-terminal.md +4 -10
- package/dist/builtin-memory/04-orchestration-kernel.md +9 -35
- package/dist/builtin-memory/05-kinds/advisor/{00-base.md → advice-contract.md} +1 -1
- package/dist/builtin-memory/05-kinds/design/00-base.md +2 -2
- package/dist/builtin-memory/05-kinds/design/01-orchestrator.md +1 -1
- package/dist/builtin-memory/05-kinds/developer/00-base.md +2 -2
- package/dist/builtin-memory/05-kinds/explore/00-base.md +1 -1
- package/dist/builtin-memory/05-kinds/general/00-base.md +2 -0
- package/dist/builtin-memory/05-kinds/plan/00-base.md +1 -1
- package/dist/builtin-memory/05-kinds/plan/reviewers/{00-base.md → lens-contract.md} +1 -1
- package/dist/builtin-memory/05-kinds/plan/reviewers/security.md +1 -1
- package/dist/builtin-memory/05-kinds/review/00-base.md +1 -3
- package/dist/builtin-memory/05-kinds/review/01-orchestrator.md +1 -1
- package/dist/builtin-memory/05-kinds/review/security-findings.md +12 -0
- package/dist/builtin-memory/05-kinds/spec/00-base.md +1 -1
- package/dist/clients/attach/__tests__/context-message.test.js +28 -1
- package/dist/clients/attach/chrome/canvas-panels.d.ts +0 -4
- package/dist/clients/attach/chrome/canvas-panels.js +5 -7
- package/dist/clients/attach/chrome/inbox-strip.d.ts +31 -0
- package/dist/clients/attach/chrome/inbox-strip.js +187 -0
- package/dist/clients/attach/chrome/roster.d.ts +6 -2
- package/dist/clients/attach/chrome/roster.js +13 -52
- package/dist/clients/attach/chrome/ticket-panel.d.ts +29 -0
- package/dist/clients/attach/chrome/ticket-panel.js +236 -0
- package/dist/clients/attach/render/card-presentation.d.ts +8 -3
- package/dist/clients/attach/render/card-presentation.js +48 -10
- package/dist/clients/attach/render/context-message.d.ts +5 -0
- package/dist/clients/attach/render/context-message.js +20 -14
- package/dist/clients/attach/session/context.d.ts +3 -0
- package/dist/clients/attach/session/frame.d.ts +4 -0
- package/dist/clients/attach/session/frame.js +8 -3
- package/dist/clients/attach/session/keys.d.ts +7 -0
- package/dist/clients/attach/session/keys.js +7 -0
- package/dist/clients/attach/session/layout.js +6 -3
- package/dist/clients/attach/session/pane-focus.d.ts +8 -0
- package/dist/clients/attach/session/pane-focus.js +42 -0
- package/dist/clients/attach/viewer.js +793 -789
- package/dist/clients/inbox/controller.d.ts +9 -0
- package/dist/clients/inbox/controller.js +57 -2
- package/dist/clients/inbox/surface.d.ts +2 -0
- package/dist/clients/inbox/surface.js +18 -3
- package/dist/clients/inbox/tui.d.ts +2 -0
- package/dist/clients/inbox/tui.js +11 -1
- package/dist/commands/node/create.js +3 -3
- package/dist/commands/profile/kind.d.ts +1 -0
- package/dist/commands/profile/kind.js +39 -0
- package/dist/commands/profile/list.js +5 -1
- package/dist/commands/profile/meta.d.ts +4 -0
- package/dist/commands/profile/meta.js +69 -0
- package/dist/commands/profile/new.js +34 -4
- package/dist/commands/profile/pause.d.ts +2 -0
- package/dist/commands/profile/pause.js +60 -0
- package/dist/commands/profile/show.js +10 -2
- package/dist/commands/profile.js +5 -8
- package/dist/core/__tests__/canvas-inbox-watcher-hold.test.js +40 -0
- package/dist/core/__tests__/parse-argv-stdin-secret.test.js +28 -0
- package/dist/core/__tests__/seam/dormancy-release.test.js +7 -0
- package/dist/core/command.js +23 -23
- package/dist/core/config.d.ts +5 -0
- package/dist/core/config.js +15 -0
- package/dist/core/help.d.ts +1 -1
- package/dist/core/keybindings/attach-control.d.ts +3 -0
- package/dist/core/keybindings/attach-control.js +1 -0
- package/dist/core/keybindings/catalog.js +1 -0
- package/dist/core/profiles/deletion-reservation.d.ts +7 -3
- package/dist/core/profiles/deletion-reservation.js +9 -5
- package/dist/core/profiles/manifest.d.ts +39 -1
- package/dist/core/profiles/manifest.js +171 -4
- package/dist/core/runtime/boot-root.js +3 -3
- package/dist/core/runtime/close.js +10 -5
- package/dist/core/runtime/revive.js +2 -0
- package/dist/core/runtime/spawn-env.d.ts +9 -1
- package/dist/core/runtime/spawn-env.js +17 -1
- package/dist/core/termrender/termrender.d.ts +7 -2
- package/dist/core/termrender/termrender.js +11 -6
- package/dist/core/termrender/version.d.ts +1 -1
- package/dist/core/termrender/version.js +1 -1
- package/dist/daemon/api/__tests__/profile-launch-gates.test.d.ts +1 -0
- package/dist/daemon/api/__tests__/profile-launch-gates.test.js +111 -0
- package/dist/daemon/api/handlers/messages.js +9 -2
- package/dist/daemon/api/handlers/nodes.d.ts +2 -0
- package/dist/daemon/api/handlers/nodes.js +15 -8
- package/dist/daemon/api/handlers/profiles.js +12 -2
- package/dist/daemon/api/map.js +4 -0
- package/dist/daemon/fleet.js +1 -6
- package/dist/daemon/reconcilers/broker-supervision.js +15 -25
- package/dist/daemon/reconcilers/dormant-inbox.js +10 -10
- package/dist/daemon/reconcilers/live-obligation.d.ts +5 -1
- package/dist/daemon/reconcilers/live-obligation.js +11 -19
- package/dist/pi-extensions/canvas-inbox-watcher.js +15 -0
- package/dist/types.d.ts +9 -0
- package/package.json +1 -1
- package/runtime.lock.json +2 -2
- package/dist/builtin-memory/01-spine/01-no-manager.md +0 -11
- package/dist/builtin-memory/05-kinds/general/01-orchestrator.md +0 -8
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { hasActiveLiveSubscription, hasLiveMessageWait, hasLiveSubscriber, hasPendingCancelOnWakeCron, } from '../../core/canvas/index.js';
|
|
1
|
+
import { hasActiveLiveSubscription, hasLiveMessageWait, hasLiveSubscriber, hasPendingCancelOnWakeCron, subscribersOf, } from '../../core/canvas/index.js';
|
|
2
|
+
import { fullName } from '../../core/canvas/labels.js';
|
|
2
3
|
import { countTickets } from '../../core/canvas/attention.js';
|
|
3
4
|
import { readCursor, readInboxSince } from '../../core/feed/inbox.js';
|
|
4
5
|
import { readOutputRequest } from '../../core/runtime/structured-output.js';
|
|
5
6
|
import { focusOf } from '../../core/runtime/placement.js';
|
|
6
7
|
import { hasAttachedBrokerViewers } from '../../core/runtime/broker/client-registry.js';
|
|
8
|
+
import { fanDoctrineWake } from '../../core/runtime/close.js';
|
|
9
|
+
import { transition } from '../../core/runtime/lifecycle.js';
|
|
7
10
|
/** Durable work that requires a node to remain automatically wakeable. */
|
|
8
11
|
export function hasLiveObligation(nodeId) {
|
|
9
12
|
return hasActiveLiveSubscription(nodeId)
|
|
@@ -27,24 +30,6 @@ export function hasPendingWake(nodeId) {
|
|
|
27
30
|
return true;
|
|
28
31
|
return focusOf(nodeId) !== null || hasAttachedBrokerViewers(nodeId);
|
|
29
32
|
}
|
|
30
|
-
/** What parking an unattended node actually amounts to — the one rule both the
|
|
31
|
-
* live-broker park clock (broker-supervision) and the already-parked
|
|
32
|
-
* reconciliation (dormant-inbox) apply.
|
|
33
|
-
*
|
|
34
|
-
* `release` — something can still wake it, so parking is a pause.
|
|
35
|
-
* `finish` — a resident with nothing left to wake it has completed its
|
|
36
|
-
* conversation, and the row becomes prunable history.
|
|
37
|
-
* `cancel` — a terminal node that never pushed a final was torn down before
|
|
38
|
-
* finishing, which is what `canceled` records; it stays revivable
|
|
39
|
-
* and becomes prunable. A live subscriber still awaiting its
|
|
40
|
-
* report is an outstanding deliverable, so such a node keeps its
|
|
41
|
-
* wakeable idle row instead of being written off.
|
|
42
|
-
*
|
|
43
|
-
* Undelivered mail of ANY tier also holds the row. A deferred-only unseen set
|
|
44
|
-
* never wakes a node on its own — it rides the next natural cycle — but a
|
|
45
|
-
* terminalized row no longer takes that cycle, so writing one off would drop
|
|
46
|
-
* content the sender already handed over.
|
|
47
|
-
*/
|
|
48
33
|
export function parkEvent(nodeId, lifecycle) {
|
|
49
34
|
if (hasLiveObligation(nodeId))
|
|
50
35
|
return 'release';
|
|
@@ -54,3 +39,10 @@ export function parkEvent(nodeId, lifecycle) {
|
|
|
54
39
|
return 'finish';
|
|
55
40
|
return hasLiveSubscriber(nodeId) ? 'release' : 'cancel';
|
|
56
41
|
}
|
|
42
|
+
/** Apply an unattended decision and notify subscribers of automatic completion. */
|
|
43
|
+
export function applyParkEvent(nodeId, event) {
|
|
44
|
+
const node = transition(nodeId, event);
|
|
45
|
+
if (event !== 'finish')
|
|
46
|
+
return;
|
|
47
|
+
fanDoctrineWake(nodeId, subscribersOf(nodeId), `Child done — ${fullName(node)} (${nodeId}) was automatically marked done after its unattended grace with nothing left to wake it. It sent no final report.`, { reason: 'child-auto-done', child: nodeId });
|
|
48
|
+
}
|
|
@@ -17,6 +17,7 @@ import { emitEvent } from '../core/events/emit.js';
|
|
|
17
17
|
import { errorClassFromError } from '../core/events/errors.js';
|
|
18
18
|
import { operationIdContext } from '../core/events/operation-id.js';
|
|
19
19
|
import { situationalContextEnvelope, SITUATIONAL_CONTEXT_CUSTOM_TYPE } from '../core/runtime/situational-context.js';
|
|
20
|
+
import { isProfilePaused } from '../core/profiles/manifest.js';
|
|
20
21
|
const DEFAULT_TICK_MS = 800;
|
|
21
22
|
const DEFAULT_DEBOUNCE_MS = 1000;
|
|
22
23
|
const MAX_PENDING_HANDOFFS = 64;
|
|
@@ -45,6 +46,13 @@ function currentNodeId() {
|
|
|
45
46
|
const nodeId = process.env['CRTR_NODE_ID'];
|
|
46
47
|
return nodeId === undefined || nodeId.trim() === '' ? undefined : nodeId;
|
|
47
48
|
}
|
|
49
|
+
/** The node's profile, read fresh each poll: `crtr profile pause` mutates the
|
|
50
|
+
* manifest file directly, so a live broker sees the flip on its next tick with
|
|
51
|
+
* no daemon round-trip. '' is the historical no-profile row. */
|
|
52
|
+
function profilePaused() {
|
|
53
|
+
const profileId = process.env['CRTR_PROFILE_ID'];
|
|
54
|
+
return profileId !== undefined && profileId !== '' && isProfilePaused(profileId);
|
|
55
|
+
}
|
|
48
56
|
function isFilesystemError(error) {
|
|
49
57
|
if (typeof error !== 'object' || error === null)
|
|
50
58
|
return false;
|
|
@@ -529,6 +537,13 @@ class CanvasInboxWatcher {
|
|
|
529
537
|
this.retryPendingCommitOnTick(nodeId);
|
|
530
538
|
return;
|
|
531
539
|
}
|
|
540
|
+
// A paused profile is inert: read nothing, send nothing, leave the cursor
|
|
541
|
+
// where it is, so every queued entry — critical included, since aborting the
|
|
542
|
+
// live turn is exactly the punch-through pause forbids — is still there to
|
|
543
|
+
// deliver on resume. Pause is not a kill: the turn already running finishes,
|
|
544
|
+
// and an in-flight handoff still commits above.
|
|
545
|
+
if (profilePaused())
|
|
546
|
+
return;
|
|
532
547
|
if (this.buffer.length === 0 && this.pendingHandoffs.length >= MAX_PENDING_HANDOFFS)
|
|
533
548
|
return;
|
|
534
549
|
if (this.buffer.length > 0) {
|
package/dist/types.d.ts
CHANGED
|
@@ -397,6 +397,15 @@ export interface ProfileManifest {
|
|
|
397
397
|
* `profileHome`). Normalized on read to the first project when the manifest
|
|
398
398
|
* carries none, so a profile written before homes existed still has one. */
|
|
399
399
|
home: string | null;
|
|
400
|
+
/** ISO timestamp while the profile is inert; null (or absent on older manifests) means active. */
|
|
401
|
+
paused_at: string | null;
|
|
402
|
+
/** Persona kind for creates that omit kind; absent means `general`. */
|
|
403
|
+
default_kind?: string;
|
|
404
|
+
/** Optional string map of profile facts (identity, role, description).
|
|
405
|
+
* Not secrets — readable back from every projection, and surfaced to
|
|
406
|
+
* every broker launched under the profile as `CRTR_PROFILE_META_<KEY>`
|
|
407
|
+
* env (see `core/runtime/spawn-env.ts`). Absent means none. */
|
|
408
|
+
metadata?: Record<string, string>;
|
|
400
409
|
created_at: string;
|
|
401
410
|
last_used_at: string | null;
|
|
402
411
|
}
|
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.216",
|
|
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.216",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
kind: preference
|
|
3
|
-
when-and-why-to-read: When a node has no parent, this preference should be read so its results reach the user instead of disappearing into a nonexistent manager feed.
|
|
4
|
-
gate: {hasManager: false}
|
|
5
|
-
surfaces:
|
|
6
|
-
- on: boot
|
|
7
|
-
at: content
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Top of your spine
|
|
11
|
-
Nobody subscribes to you — you sit at the top of your spine. There is no manager to report to and no feed to push upward.
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
kind: preference
|
|
3
|
-
when-and-why-to-read: When a node is spawned as kind general in orchestrator mode, this preference should be read so mixed goals are decomposed to the right specialists instead of being handled shallowly by a catch-all.
|
|
4
|
-
gate: {kind: general, mode: orchestrator}
|
|
5
|
-
surfaces:
|
|
6
|
-
- on: boot
|
|
7
|
-
at: content
|
|
8
|
-
---
|