@crouton-kit/crouter 0.3.14 → 0.3.16

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.
Files changed (224) hide show
  1. package/dist/build-root.d.ts +8 -0
  2. package/dist/build-root.js +30 -0
  3. package/dist/builtin-personas/design/base.md +3 -7
  4. package/dist/builtin-personas/design/orchestrator.md +4 -3
  5. package/dist/builtin-personas/developer/base.md +3 -7
  6. package/dist/builtin-personas/developer/orchestrator.md +5 -4
  7. package/dist/builtin-personas/explore/base.md +3 -7
  8. package/dist/builtin-personas/explore/orchestrator.md +1 -5
  9. package/dist/builtin-personas/general/base.md +2 -4
  10. package/dist/builtin-personas/general/orchestrator.md +2 -4
  11. package/dist/builtin-personas/lifecycle/resident.md +2 -0
  12. package/dist/builtin-personas/lifecycle/terminal.md +6 -0
  13. package/dist/builtin-personas/orchestration-kernel.md +42 -3
  14. package/dist/builtin-personas/plan/base.md +3 -5
  15. package/dist/builtin-personas/plan/orchestrator.md +5 -4
  16. package/dist/builtin-personas/plan/reviewers/architecture-fit/base.md +9 -0
  17. package/dist/builtin-personas/plan/reviewers/code-smells/base.md +9 -0
  18. package/dist/builtin-personas/plan/reviewers/pattern-consistency/base.md +9 -0
  19. package/dist/builtin-personas/plan/reviewers/requirements-coverage/base.md +9 -0
  20. package/dist/builtin-personas/plan/reviewers/security/base.md +9 -0
  21. package/dist/builtin-personas/review/base.md +3 -5
  22. package/dist/builtin-personas/review/orchestrator.md +2 -6
  23. package/dist/builtin-personas/runtime-base.md +3 -19
  24. package/dist/builtin-personas/spec/base.md +3 -5
  25. package/dist/builtin-personas/spec/orchestrator.md +4 -3
  26. package/dist/builtin-personas/spine/has-manager.md +10 -0
  27. package/dist/builtin-personas/spine/no-manager.md +2 -0
  28. package/dist/builtin-skills/skills/crouter-development/personas/SKILL.md +96 -0
  29. package/dist/builtin-skills/skills/crouter-development/personas/base-prompt/SKILL.md +49 -0
  30. package/dist/builtin-skills/skills/crouter-development/personas/orchestrator-prompt/SKILL.md +49 -0
  31. package/dist/builtin-skills/skills/planning/SKILL.md +1 -1
  32. package/dist/builtin-skills/skills/spec/SKILL.md +2 -2
  33. package/dist/cli.js +6 -29
  34. package/dist/commands/attention.js +76 -7
  35. package/dist/commands/canvas-prune.d.ts +2 -0
  36. package/dist/commands/canvas-prune.js +66 -0
  37. package/dist/commands/canvas.js +5 -8
  38. package/dist/commands/chord.d.ts +2 -0
  39. package/dist/commands/chord.js +143 -0
  40. package/dist/commands/daemon.js +8 -5
  41. package/dist/commands/dashboard.js +2 -0
  42. package/dist/commands/human/prompts.js +28 -27
  43. package/dist/commands/human/queue.js +30 -14
  44. package/dist/commands/human/shared.d.ts +26 -21
  45. package/dist/commands/human/shared.js +45 -67
  46. package/dist/commands/human.js +4 -14
  47. package/dist/commands/node.d.ts +11 -0
  48. package/dist/commands/node.js +221 -99
  49. package/dist/commands/pkg/market-inspect.js +6 -4
  50. package/dist/commands/pkg/market-manage.js +10 -6
  51. package/dist/commands/pkg/market.js +2 -4
  52. package/dist/commands/pkg/plugin-inspect.js +6 -4
  53. package/dist/commands/pkg/plugin-manage.js +12 -7
  54. package/dist/commands/pkg/plugin.js +2 -4
  55. package/dist/commands/pkg.js +0 -4
  56. package/dist/commands/push.js +178 -15
  57. package/dist/commands/revive.js +5 -3
  58. package/dist/commands/skill/author.js +6 -4
  59. package/dist/commands/skill/find.js +8 -5
  60. package/dist/commands/skill/read.js +2 -0
  61. package/dist/commands/skill/state.js +6 -4
  62. package/dist/commands/skill.js +0 -6
  63. package/dist/commands/sys/config.js +21 -7
  64. package/dist/commands/sys/doctor.js +2 -0
  65. package/dist/commands/sys/update.js +4 -0
  66. package/dist/commands/sys.js +0 -6
  67. package/dist/commands/tmux-spread.d.ts +2 -0
  68. package/dist/commands/tmux-spread.js +129 -0
  69. package/dist/core/__tests__/canvas-inbox-watcher.test.js +25 -0
  70. package/dist/core/__tests__/child-followup.test.d.ts +1 -0
  71. package/dist/core/__tests__/child-followup.test.js +83 -0
  72. package/dist/core/__tests__/close.test.d.ts +1 -0
  73. package/dist/core/__tests__/close.test.js +148 -0
  74. package/dist/core/__tests__/context-intro.test.d.ts +1 -0
  75. package/dist/core/__tests__/context-intro.test.js +196 -0
  76. package/dist/core/__tests__/daemon-boot.test.d.ts +1 -0
  77. package/dist/core/__tests__/daemon-boot.test.js +93 -0
  78. package/dist/core/__tests__/daemon-liveness.test.d.ts +1 -0
  79. package/dist/core/__tests__/daemon-liveness.test.js +223 -0
  80. package/dist/core/__tests__/focuses.test.d.ts +1 -0
  81. package/dist/core/__tests__/focuses.test.js +196 -0
  82. package/dist/core/__tests__/fork.test.d.ts +1 -0
  83. package/dist/core/__tests__/fork.test.js +91 -0
  84. package/dist/core/__tests__/home-session.test.d.ts +1 -0
  85. package/dist/core/__tests__/home-session.test.js +153 -0
  86. package/dist/core/__tests__/human-cancel-guard.test.d.ts +1 -0
  87. package/dist/core/__tests__/human-cancel-guard.test.js +49 -0
  88. package/dist/core/__tests__/keystone.test.d.ts +1 -0
  89. package/dist/core/__tests__/keystone.test.js +185 -0
  90. package/dist/core/__tests__/kickoff.test.d.ts +1 -0
  91. package/dist/core/__tests__/kickoff.test.js +89 -0
  92. package/dist/core/__tests__/lifecycle.test.d.ts +1 -0
  93. package/dist/core/__tests__/lifecycle.test.js +178 -0
  94. package/dist/core/__tests__/listing-completeness.test.d.ts +1 -0
  95. package/dist/core/__tests__/listing-completeness.test.js +31 -0
  96. package/dist/core/__tests__/memory.test.d.ts +1 -0
  97. package/dist/core/__tests__/memory.test.js +152 -0
  98. package/dist/core/__tests__/migration.test.d.ts +1 -0
  99. package/dist/core/__tests__/migration.test.js +238 -0
  100. package/dist/core/__tests__/pane-column.test.d.ts +1 -0
  101. package/dist/core/__tests__/pane-column.test.js +153 -0
  102. package/dist/core/__tests__/passive-subscription.test.js +24 -1
  103. package/dist/core/__tests__/persona-compose.test.d.ts +1 -0
  104. package/dist/core/__tests__/persona-compose.test.js +53 -0
  105. package/dist/core/__tests__/persona-subkind.test.d.ts +1 -0
  106. package/dist/core/__tests__/persona-subkind.test.js +62 -0
  107. package/dist/core/__tests__/persona.test.d.ts +1 -0
  108. package/dist/core/__tests__/persona.test.js +107 -0
  109. package/dist/core/__tests__/placement-focus.test.d.ts +1 -0
  110. package/dist/core/__tests__/placement-focus.test.js +266 -0
  111. package/dist/core/__tests__/placement-reconcile.test.d.ts +1 -0
  112. package/dist/core/__tests__/placement-reconcile.test.js +212 -0
  113. package/dist/core/__tests__/placement-revive.test.d.ts +1 -0
  114. package/dist/core/__tests__/placement-revive.test.js +238 -0
  115. package/dist/core/__tests__/placement-teardown.test.d.ts +1 -0
  116. package/dist/core/__tests__/placement-teardown.test.js +178 -0
  117. package/dist/core/__tests__/prune.test.d.ts +1 -0
  118. package/dist/core/__tests__/prune.test.js +116 -0
  119. package/dist/core/__tests__/push-final-guard.test.d.ts +1 -0
  120. package/dist/core/__tests__/push-final-guard.test.js +71 -0
  121. package/dist/core/__tests__/relaunch.test.d.ts +1 -0
  122. package/dist/core/__tests__/relaunch.test.js +334 -0
  123. package/dist/core/__tests__/reset.test.js +26 -7
  124. package/dist/core/__tests__/revive.test.d.ts +1 -0
  125. package/dist/core/__tests__/revive.test.js +217 -0
  126. package/dist/core/__tests__/spawn-root.test.d.ts +1 -0
  127. package/dist/core/__tests__/spawn-root.test.js +73 -0
  128. package/dist/core/__tests__/steer-note.test.d.ts +1 -0
  129. package/dist/core/__tests__/steer-note.test.js +39 -0
  130. package/dist/core/__tests__/stop-guard.test.d.ts +1 -0
  131. package/dist/core/__tests__/stop-guard.test.js +82 -0
  132. package/dist/core/__tests__/subcommand-tier.test.js +35 -33
  133. package/dist/core/__tests__/tmux-surface.test.d.ts +1 -0
  134. package/dist/core/__tests__/tmux-surface.test.js +105 -0
  135. package/dist/core/__tests__/unknown-path.test.js +8 -2
  136. package/dist/core/canvas/attention.d.ts +10 -0
  137. package/dist/core/canvas/attention.js +40 -0
  138. package/dist/core/canvas/canvas.d.ts +66 -7
  139. package/dist/core/canvas/canvas.js +209 -21
  140. package/dist/core/canvas/db.d.ts +8 -0
  141. package/dist/core/canvas/db.js +205 -4
  142. package/dist/core/canvas/focuses.d.ts +22 -0
  143. package/dist/core/canvas/focuses.js +81 -0
  144. package/dist/core/canvas/index.d.ts +3 -0
  145. package/dist/core/canvas/index.js +3 -0
  146. package/dist/core/canvas/labels.d.ts +27 -0
  147. package/dist/core/canvas/labels.js +36 -0
  148. package/dist/core/canvas/render.js +25 -10
  149. package/dist/core/canvas/telemetry.d.ts +14 -0
  150. package/dist/core/canvas/telemetry.js +35 -0
  151. package/dist/core/canvas/types.d.ts +115 -12
  152. package/dist/core/command.d.ts +25 -1
  153. package/dist/core/command.js +23 -15
  154. package/dist/core/config.js +36 -2
  155. package/dist/core/feed/feed.js +3 -3
  156. package/dist/core/feed/inbox.d.ts +3 -1
  157. package/dist/core/feed/inbox.js +45 -5
  158. package/dist/core/feed/passive.js +24 -11
  159. package/dist/core/help.d.ts +26 -13
  160. package/dist/core/help.js +44 -37
  161. package/dist/core/personas/index.d.ts +1 -1
  162. package/dist/core/personas/index.js +1 -1
  163. package/dist/core/personas/loader.d.ts +40 -1
  164. package/dist/core/personas/loader.js +63 -1
  165. package/dist/core/personas/resolve.d.ts +13 -6
  166. package/dist/core/personas/resolve.js +46 -34
  167. package/dist/core/runtime/bearings.d.ts +20 -0
  168. package/dist/core/runtime/bearings.js +92 -0
  169. package/dist/core/runtime/close.d.ts +14 -0
  170. package/dist/core/runtime/close.js +151 -0
  171. package/dist/core/runtime/demote.js +24 -12
  172. package/dist/core/runtime/front-door.js +1 -1
  173. package/dist/core/runtime/kickoff.d.ts +23 -6
  174. package/dist/core/runtime/kickoff.js +92 -36
  175. package/dist/core/runtime/launch.d.ts +26 -12
  176. package/dist/core/runtime/launch.js +78 -19
  177. package/dist/core/runtime/lifecycle.d.ts +13 -0
  178. package/dist/core/runtime/lifecycle.js +86 -0
  179. package/dist/core/runtime/memory.d.ts +43 -0
  180. package/dist/core/runtime/memory.js +165 -0
  181. package/dist/core/runtime/naming.d.ts +22 -0
  182. package/dist/core/runtime/naming.js +166 -0
  183. package/dist/core/runtime/nodes.d.ts +39 -1
  184. package/dist/core/runtime/nodes.js +69 -10
  185. package/dist/core/runtime/persona.d.ts +25 -0
  186. package/dist/core/runtime/persona.js +139 -0
  187. package/dist/core/runtime/placement.d.ts +299 -0
  188. package/dist/core/runtime/placement.js +688 -0
  189. package/dist/core/runtime/promote.d.ts +14 -7
  190. package/dist/core/runtime/promote.js +57 -67
  191. package/dist/core/runtime/reset.d.ts +47 -4
  192. package/dist/core/runtime/reset.js +223 -52
  193. package/dist/core/runtime/revive.d.ts +26 -2
  194. package/dist/core/runtime/revive.js +166 -39
  195. package/dist/core/runtime/spawn.d.ts +20 -5
  196. package/dist/core/runtime/spawn.js +163 -43
  197. package/dist/core/runtime/stop-guard.d.ts +1 -1
  198. package/dist/core/runtime/stop-guard.js +18 -8
  199. package/dist/core/runtime/tmux-chrome.d.ts +1 -0
  200. package/dist/core/runtime/tmux-chrome.js +4 -0
  201. package/dist/core/runtime/tmux.d.ts +113 -20
  202. package/dist/core/runtime/tmux.js +221 -39
  203. package/dist/core/spawn.js +15 -0
  204. package/dist/daemon/crtrd.d.ts +12 -1
  205. package/dist/daemon/crtrd.js +152 -34
  206. package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.d.ts +1 -0
  207. package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +266 -0
  208. package/dist/pi-extensions/canvas-commands.js +16 -13
  209. package/dist/pi-extensions/canvas-context-intro.d.ts +70 -0
  210. package/dist/pi-extensions/canvas-context-intro.js +164 -0
  211. package/dist/pi-extensions/canvas-goal-capture.d.ts +3 -0
  212. package/dist/pi-extensions/canvas-goal-capture.js +15 -1
  213. package/dist/pi-extensions/canvas-inbox-watcher.js +11 -0
  214. package/dist/pi-extensions/canvas-nav.d.ts +12 -4
  215. package/dist/pi-extensions/canvas-nav.js +594 -262
  216. package/dist/pi-extensions/canvas-resume.d.ts +22 -0
  217. package/dist/pi-extensions/canvas-resume.js +173 -0
  218. package/dist/pi-extensions/canvas-stophook.d.ts +16 -0
  219. package/dist/pi-extensions/canvas-stophook.js +340 -228
  220. package/dist/types.d.ts +28 -0
  221. package/dist/types.js +16 -0
  222. package/package.json +2 -2
  223. package/dist/core/runtime/presence.d.ts +0 -38
  224. package/dist/core/runtime/presence.js +0 -154
@@ -0,0 +1,22 @@
1
+ interface CommandUI {
2
+ select(title: string, options: string[]): Promise<string | undefined>;
3
+ notify(message: string, type?: 'info' | 'warning' | 'error'): void;
4
+ }
5
+ interface CommandCtx {
6
+ mode: string;
7
+ ui: CommandUI;
8
+ }
9
+ interface PiLike {
10
+ registerCommand?(name: string, options: {
11
+ description?: string;
12
+ handler: (args: string, ctx: CommandCtx) => void | Promise<void>;
13
+ }): void;
14
+ }
15
+ /**
16
+ * Register the /resume-node command on `pi`.
17
+ *
18
+ * Returns immediately when CRTR_NODE_ID is absent — the extension is fully
19
+ * inert in a non-canvas pi session.
20
+ */
21
+ export declare function registerCanvasResume(pi: PiLike): void;
22
+ export default registerCanvasResume;
@@ -0,0 +1,173 @@
1
+ // canvas-resume.ts — pi extension registering the /resume-node canvas command.
2
+ //
3
+ // /resume-node — open a TREE-SHAPED picker over the WHOLE canvas (every root,
4
+ // INCLUDING DORMANT nodes: done / idle / dead / canceled) rendered with tree
5
+ // glyphs (├─ / └─) + a status tag + name + short id, then revive the chosen
6
+ // node by shelling `crtr node focus <id>` (fire-and-forget). Reviving dormant
7
+ // nodes is the entire point, so — unlike the BASE/GRAPH chrome and
8
+ // renderForest()'s live-only (active|idle) filter — this walks ALL roots
9
+ // and ALL statuses.
10
+ //
11
+ // The name is literally `resume-node`, NOT `resume`, to avoid clashing with
12
+ // pi's built-in /resume.
13
+ //
14
+ // ⚠ DESYNC — why `crtr node focus` is the ONLY sanctioned open
15
+ // `crtr node focus <id>` routes through reviveNode() (src/core/runtime/
16
+ // revive.ts), the ONLY sanctioned launcher of `pi --session <file>`: it sets
17
+ // CRTR_NODE_ID + the `-e` canvas extensions and runs transition('revive').
18
+ // A RAW `pi --session <file>` has NEITHER → every canvas hook is inert: the
19
+ // stophook never records pi_pid / clears intent / marks done, no inbox-watcher
20
+ // wakes it, and transition('revive') never runs so the row stays dormant.
21
+ // Worst case (idle + intent=idle-release) the daemon can't see the raw pi (no
22
+ // pi_pid) and DOUBLE-SPAWNS a second pi on the same .jsonl, corrupting the
23
+ // conversation. A UI must therefore NEVER spawn `pi --session` directly — it
24
+ // opens nodes via `crtr node focus` / `crtr canvas revive`.
25
+ //
26
+ // INERT when CRTR_NODE_ID is absent (a plain pi session, not a canvas node).
27
+ //
28
+ // Plain TS-with-types — no imports from @earendil-works/* so this compiles
29
+ // inside crouter's own tsc build without a dep on the pi packages (mirrors
30
+ // canvas-nav.ts / canvas-commands.ts).
31
+ import { execFile } from 'node:child_process';
32
+ import { getNode, listNodes, subscriptionsOf, fullName } from '../core/canvas/index.js';
33
+ // ---------------------------------------------------------------------------
34
+ // Forest rendering — one line per node across the WHOLE canvas, with a parallel
35
+ // ids[] array so the chosen line maps back to its node_id. Plain unicode glyphs
36
+ // (no ANSI) so the line renders cleanly inside pi's select dialog.
37
+ // ---------------------------------------------------------------------------
38
+ const STATUS_GLYPH = {
39
+ active: '●',
40
+ idle: '○',
41
+ done: '✓',
42
+ dead: '✗',
43
+ canceled: '⊘',
44
+ };
45
+ function shortId(id) {
46
+ return id.slice(0, 8);
47
+ }
48
+ /** `<glyph> <status> <name> [<kind>/<mode>] (<shortid>)` — a status TAG + name
49
+ * + short id, prefixed with the tree branch. Best-effort on a missing meta. */
50
+ function nodeLabel(nodeId, branch) {
51
+ const node = getNode(nodeId);
52
+ if (node === null)
53
+ return `${branch}? <missing ${shortId(nodeId)}>`;
54
+ const glyph = STATUS_GLYPH[node.status] ?? '?';
55
+ return `${branch}${glyph} ${node.status} ${fullName(node)} [${node.kind}/${node.mode}] (${shortId(nodeId)})`;
56
+ }
57
+ /** Sort rank for roots — live first (active, then idle), dormant after. Keeps
58
+ * the picker oriented while still listing every dormant root. */
59
+ function statusRank(status) {
60
+ switch (status) {
61
+ case 'active': return 0;
62
+ case 'idle': return 1;
63
+ case 'done': return 2;
64
+ case 'canceled': return 3;
65
+ case 'dead': return 4;
66
+ default: return 5;
67
+ }
68
+ }
69
+ /** Recursively render the subscription subtree rooted at `nodeId` into the
70
+ * parallel lines/ids arrays. Mirrors render.ts walkTree but keeps lines and
71
+ * ids strictly 1:1 (a cycle back-ref still maps to its real node, so selecting
72
+ * it just focuses that node — harmless). Cycle-safe via `visited`. */
73
+ function walkSubtree(nodeId, indent, connector, visited, out) {
74
+ if (visited.has(nodeId)) {
75
+ out.lines.push(`${indent}${connector}↺ ${shortId(nodeId)} (cycle)`);
76
+ out.ids.push(nodeId);
77
+ return;
78
+ }
79
+ visited.add(nodeId);
80
+ out.lines.push(nodeLabel(nodeId, `${indent}${connector}`));
81
+ out.ids.push(nodeId);
82
+ const children = subscriptionsOf(nodeId);
83
+ // Root rows carry no connector; children of a last-child get clear space, of a
84
+ // mid-child a continued spine — exactly render.ts walkTree's prefix math.
85
+ const childIndent = indent + (connector === '' ? '' : connector === '└─ ' ? ' ' : '│ ');
86
+ for (let i = 0; i < children.length; i++) {
87
+ const isLast = i === children.length - 1;
88
+ walkSubtree(children[i].node_id, childIndent, isLast ? '└─ ' : '├─ ', visited, out);
89
+ }
90
+ }
91
+ /** The whole-canvas forest: EVERY root (parent === null, ANY status) and its
92
+ * subtree, flattened to parallel label/id arrays. */
93
+ function buildForest() {
94
+ const out = { lines: [], ids: [] };
95
+ const visited = new Set();
96
+ const roots = listNodes()
97
+ .filter((n) => n.parent === null)
98
+ .sort((a, b) => statusRank(a.status) - statusRank(b.status));
99
+ for (const r of roots)
100
+ walkSubtree(r.node_id, '', '', visited, out);
101
+ return out;
102
+ }
103
+ // ---------------------------------------------------------------------------
104
+ // Extension
105
+ // ---------------------------------------------------------------------------
106
+ /**
107
+ * Register the /resume-node command on `pi`.
108
+ *
109
+ * Returns immediately when CRTR_NODE_ID is absent — the extension is fully
110
+ * inert in a non-canvas pi session.
111
+ */
112
+ export function registerCanvasResume(pi) {
113
+ const nodeId = process.env['CRTR_NODE_ID'];
114
+ if (nodeId === undefined || nodeId.trim() === '')
115
+ return; // not a canvas node
116
+ if (typeof pi.registerCommand !== 'function')
117
+ return;
118
+ pi.registerCommand('resume-node', {
119
+ description: 'Resume a node — pick from the whole canvas (incl. dormant) and revive it',
120
+ handler: async (_args, ctx) => {
121
+ // select() is a terminal-only dialog — guard the run mode before it.
122
+ if (ctx.mode !== 'tui') {
123
+ try {
124
+ ctx.ui.notify('/resume-node needs the interactive TUI', 'warning');
125
+ }
126
+ catch { /* best-effort */ }
127
+ return;
128
+ }
129
+ let forest;
130
+ try {
131
+ forest = buildForest();
132
+ }
133
+ catch {
134
+ try {
135
+ ctx.ui.notify('resume: could not read the canvas', 'error');
136
+ }
137
+ catch { /* best-effort */ }
138
+ return;
139
+ }
140
+ if (forest.lines.length === 0) {
141
+ try {
142
+ ctx.ui.notify('No nodes on the canvas to resume.', 'info');
143
+ }
144
+ catch { /* best-effort */ }
145
+ return;
146
+ }
147
+ const choice = await ctx.ui.select('Resume which node?', forest.lines);
148
+ if (choice === undefined)
149
+ return; // cancelled / timed out
150
+ const idx = forest.lines.indexOf(choice);
151
+ const targetId = idx >= 0 ? forest.ids[idx] : undefined;
152
+ if (targetId === undefined)
153
+ return;
154
+ // The ONLY sync-safe open: route through reviveNode via `crtr node focus`.
155
+ // Fire-and-forget — `node focus` swaps the target into THIS pane, replacing
156
+ // the current pi, so the callback may never run (best-effort notify only).
157
+ try {
158
+ execFile('crtr', ['node', 'focus', targetId], (err) => {
159
+ if (err != null) {
160
+ try {
161
+ ctx.ui.notify(`resume failed: focus ${shortId(targetId)}`, 'error');
162
+ }
163
+ catch { /* best-effort */ }
164
+ }
165
+ });
166
+ }
167
+ catch {
168
+ /* best-effort */
169
+ }
170
+ },
171
+ });
172
+ }
173
+ export default registerCanvasResume;
@@ -5,6 +5,22 @@ interface PiLike {
5
5
  deliverAs?: 'steer' | 'followUp';
6
6
  }) => void;
7
7
  }
8
+ /** The nudge text for a crossed band, specialized to the node's (mode,
9
+ * lifecycle) persona + how far along the escalation it is.
10
+ *
11
+ * - orchestrator (terminal OR resident): checkpoint its roadmap and yield
12
+ * (gently → firmly → pushy). It has a context/roadmap.md to yield against.
13
+ * - resident/base (root conversation): never promoted, so NO roadmap exists —
14
+ * steer it to PROMOTE if the chat is growing into a multi-phase job (which
15
+ * seeds a roadmap), else wrap up / start fresh. Never points at roadmap.md or
16
+ * a bare `node yield`, which for a roadmap-less root just drops context.
17
+ * - terminal/base (worker): PROMOTE itself — become an orchestrator — when
18
+ * work remains, with an "ignore if nearly done, finish with push final" once
19
+ * it's deeper in.
20
+ *
21
+ * At/past 185k every persona goes PUSHY: the context is long enough that
22
+ * drifting further risks an overflow. */
23
+ export declare function steerNote(at: number, lifecycle: string, mode: string): string;
8
24
  /**
9
25
  * Register the canvas turn_end / agent_end handlers on `pi`.
10
26
  *