@north-light/crouter 0.3.193 → 0.3.195
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/bash-jobs.d.ts +2 -0
- package/dist/builtin-memory/02-lifecycle/01-resident.md +1 -1
- package/dist/builtin-memory/internal/examples/imessage-assistant.md +1 -1
- package/dist/builtin-memory/internal/nodes-and-canvas.md +2 -2
- package/dist/clients/attach/viewer.js +377 -377
- package/dist/commands/node/bash.js +3 -2
- package/dist/commands/node/lifecycle.js +2 -2
- package/dist/core/__tests__/seam/dormancy-release.test.js +64 -10
- package/dist/core/bash-jobs.d.ts +11 -0
- package/dist/core/bash-jobs.js +24 -1
- package/dist/core/canvas/types.d.ts +2 -1
- package/dist/core/inspector/model.d.ts +5 -0
- package/dist/core/inspector/model.js +5 -0
- package/dist/core/inspector/text.js +2 -2
- package/dist/core/inspector/tui.js +10 -3
- package/dist/core/keybindings/catalog.d.ts +1 -1
- package/dist/core/keybindings/catalog.js +4 -2
- package/dist/core/runtime/persona.js +2 -1
- package/dist/core/runtime/tmux-bindings.js +8 -1
- package/dist/core/termrender/version.d.ts +1 -1
- package/dist/core/termrender/version.js +1 -1
- package/dist/daemon/api/handlers/bash-jobs.js +1 -0
- package/dist/daemon/reconcilers/broker-supervision.js +7 -1
- package/dist/daemon/reconcilers/dormant-inbox.js +8 -0
- package/dist/daemon/reconcilers/live-obligation.d.ts +2 -0
- package/dist/daemon/reconcilers/live-obligation.js +11 -0
- package/dist/pages/bundle.js +9 -9
- package/dist/pages/comments.d.ts +9 -0
- package/dist/pages/comments.js +53 -0
- package/dist/pages/elements/cards.js +19 -2
- package/dist/pages/elements/options.js +27 -2
- package/dist/pages/elements/table.js +31 -2
- package/dist/pages/elements/text.js +19 -2
- package/dist/pages/host.d.ts +26 -0
- package/dist/pages/host.js +33 -0
- package/dist/pi-extensions/canvas-bash-valve.d.ts +4 -2
- package/dist/pi-extensions/canvas-bash-valve.js +25 -7
- package/package.json +1 -1
- package/runtime.lock.json +2 -2
- package/scripts/install-runtime.mjs +172 -5
|
@@ -3,6 +3,8 @@ import type { IsoTime, NodeIdDTO } from './common.js';
|
|
|
3
3
|
export interface BashJobStatusDTO {
|
|
4
4
|
job_id: string;
|
|
5
5
|
command: string;
|
|
6
|
+
/** Human-readable label supplied with the bash call, or null when absent. */
|
|
7
|
+
purpose: string | null;
|
|
6
8
|
started_at: IsoTime;
|
|
7
9
|
elapsed_ms: number;
|
|
8
10
|
/** Persisted supervisor process group, or null for legacy jobs. */
|
|
@@ -7,4 +7,4 @@ gate: {lifecycle: resident}
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## How you end
|
|
10
|
-
You are **resident** and interactable: you are never forced to submit a final result. Stopping is legitimate —
|
|
10
|
+
You are **resident** and interactable: you are never forced to submit a final result. Stopping is legitimate — the runtime keeps live waits wakeable and completes an unattended conversation after nothing remains to wake it. Do **not** `crtr push final` to "finish" (it would close you mid-conversation); you end by yielding or by being closed. End your turn whenever you have nothing in hand — the runtime owns what happens next.
|
|
@@ -15,7 +15,7 @@ A standing assistant that lives on the canvas, sleeps for free, wakes when a tex
|
|
|
15
15
|
| Need | Primitive |
|
|
16
16
|
|---|---|
|
|
17
17
|
| Its own home | Dedicated dir (e.g. `~/assistants/imessage/`), node spawned with `--cwd` pinned there |
|
|
18
|
-
|
|
|
18
|
+
| Event-driven conversation | `--root` spawn → resident lifecycle; after unattended completion, the retained node revives on the next normal message |
|
|
19
19
|
| Hears incoming texts | launchd watcher on `chat.db-wal` → `crtr node message send <body> --to <id>` (event-driven; the message delivers and revives, the node never polls) |
|
|
20
20
|
| Reads messages | sqlite against `~/Library/Messages/chat.db`, cursored by ROWID |
|
|
21
21
|
| Sends replies | `osascript` → Messages.app |
|
|
@@ -38,7 +38,7 @@ A push fans a ~30-token **pointer** (a ref path), not the content; subscribers d
|
|
|
38
38
|
Two orthogonal axes:
|
|
39
39
|
|
|
40
40
|
- **mode**: base (a hands-on worker — finishes its own job, yielding mode-preservingly when a task needs another window) ↔ orchestrator (`node promote` — a long-lived, roadmap-holding coordinator that delegates independent work and survives context refresh via `node yield`). Promote only when worthwhile parallel work makes coordinating and integrating children the node's primary job; task duration, sequential phases, or one helper are not enough.
|
|
41
|
-
- **lifecycle**: terminal (owes a final up the spine, reaps when done) ↔ resident (`node config --lifecycle <value>` / interactable — stays
|
|
41
|
+
- **lifecycle**: terminal (owes a final up the spine, reaps when done) ↔ resident (`node config --lifecycle <value>` / interactable — never forced to submit; stays wakeable while attached or awaiting something live, then completes after 15 unattended minutes with no live obligation). `node lifecycle demote` is the friendly flip-to-terminal-in-place.
|
|
42
42
|
|
|
43
43
|
A dormant node wakes from an **inbox** message (a push, or `node message send`) or from a scheduled **cron** whose bash command performs the action (`node message send`, `node lifecycle revive`, or `node new`). A cron can gate its action on an external condition such as CI or a deploy; inspect or reap schedules with `cron list`/`cron cancel`. To monitor your own children you arm nothing — you auto-subscribe on spawn, so their finish/crash/close wakes you; a deadline to chase a delegate is a belt-and-suspenders the runtime makes redundant. A terminal node blocked on a one-off message from a parent or controller it holds no live subscription to declares that wait with `node wait controller` before going dormant, so the next inbox delivery from that sender clears the wait rather than the runtime treating the idle as finished. Use `node wait deadline` only for the atomic inbox-versus-deadline race.
|
|
44
44
|
|
|
@@ -48,4 +48,4 @@ Tear-down: `node lifecycle close` cascade-cancels a node + its exclusive subtree
|
|
|
48
48
|
|
|
49
49
|
Use `node lifecycle revive <id>` to reopen one dormant or terminal node. It resumes an existing saved conversation by default; `--fresh` starts a new cycle on its existing session file, or a truly fresh session if no file exists. A finalized node requires `--reopen` before it can take a new mandate. Mass-reconnecting every eligible disconnected node after a reboot or outage is `canvas revive --all` instead. `reviveNode()` is the **only** sanctioned launcher of a node's broker engine — it builds the pi invocation, sets `CRTR_NODE_ID` + canvas extensions, runs `transition('revive')`, and starts the headless broker host, keeping the db row and broker process in lockstep. Never spawn `pi --session` raw, and never open a node by spawning pi directly — UIs go through `surface node focus` / `node lifecycle revive`.
|
|
50
50
|
|
|
51
|
-
The daemon (`crtrd`, managed via `sys daemon start/stop/status`) supervises live broker exits. It applies a bounded respawn policy to interrupted nonterminal nodes: a cleanly aborted saved turn resumes with a continuation, while a dirty interrupted turn, pending refresh, or pending cycle starts a fresh cycle from the saved session. Repeated short-lived exits and boot failures terminalize the node as `dead`; no automatic recovery occurs after terminalization, so use an explicit lifecycle revive or an inbox wake. It does not host agents or open viewers. When activating source changes, build, run `npm run install-runtime`, then restart the daemon because new daemon/brokers select the atomically switched, immutable generation while live brokers retain their own. Restarting is safe: it never signals running nodes.
|
|
51
|
+
The daemon (`crtrd`, managed via `sys daemon start/stop/status`) supervises live broker exits. It releases an unattended broker after 15 minutes: residents with no live obligation become `done` and pruning-eligible, while terminal nodes and residents awaiting a live child, controller, human, deadline, or structured output become `idle` and remain wakeable. It applies a bounded respawn policy to interrupted nonterminal nodes: a cleanly aborted saved turn resumes with a continuation, while a dirty interrupted turn, pending refresh, or pending cycle starts a fresh cycle from the saved session. Repeated short-lived exits and boot failures terminalize the node as `dead`; no automatic recovery occurs after terminalization, so use an explicit lifecycle revive or an inbox wake. It does not host agents or open viewers. When activating source changes, build, run `npm run install-runtime`, then restart the daemon because new daemon/brokers select the atomically switched, immutable generation while live brokers retain their own. Restarting is safe: it never signals running nodes.
|