@turri-dev/cli 0.4.3-next.8482fed → 0.4.3-next.a60ada5

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.
@@ -37,14 +37,19 @@ export function createSidePanel(options) {
37
37
  const controls = (width) => {
38
38
  if (width <= 0 || (!options.map && !options.dock))
39
39
  return [];
40
- const close = width >= 30 ? " × close " : width >= 3 ? " × " : "×";
40
+ const compact = options.notifications && width < 54;
41
+ const close = width >= 30 && !compact ? " × close " : width >= 3 ? " × " : "×";
41
42
  const right = width - visibleWidth(close);
42
43
  const buttons = [];
43
44
  let x = 0;
44
45
  if (options.map) {
45
- for (const [action, label] of [["map", "***plain"], ["pulses", "pulses"]]) {
46
- const marker = width >= 30 ? (map.view === action ? "▸ " : " ") : "";
47
- const text = truncateToWidth(` ${marker}${label} `, Math.max(0, right - x - 1), "");
46
+ const labels = [["map", "***plain"], ["pulses", "pulses"]];
47
+ if (options.notifications) {
48
+ const count = options.notifications.count();
49
+ labels.push(["notifications", `${width < 36 ? "notices" : "notifications"}${count ? ` ${count}` : ""}`]);
50
+ }
51
+ for (const [action, label] of labels) {
52
+ const text = truncateToWidth(` ${label} `, Math.max(0, right - x - 1), "");
48
53
  if (!text)
49
54
  break;
50
55
  buttons.push({ action, text, x });
@@ -282,10 +287,14 @@ export function createSidePanel(options) {
282
287
  bar += " ".repeat(x - end) + tabLabel(text, map.view === action, options.pointer?.target === `panel:${action}`, action === "close" ? "close" : "tab");
283
288
  end = x + visibleWidth(text);
284
289
  }
285
- const header = bar ? [bar] : [];
290
+ const header = bar ? [bar, ""] : [];
286
291
  headerHeight = header.length;
287
292
  const rows = Math.max(8, options.rows()) - header.length;
288
293
  try {
294
+ if (map.view === "notifications" && options.notifications) {
295
+ const lines = options.notifications.render(width, rows).slice(0, rows);
296
+ return [...header, ...lines, ...new Array(rows - lines.length).fill("")];
297
+ }
289
298
  return [...header, ...(map.view === "map" && options.map !== undefined ? renderMap(width, rows) : renderPulses(width, rows))];
290
299
  }
291
300
  catch (error) {
@@ -303,6 +312,17 @@ export function createSidePanel(options) {
303
312
  }
304
313
  },
305
314
  handleInput(data) {
315
+ if (map.view === "notifications" && options.notifications) {
316
+ if (!options.notifications.inDetail() && data === "p")
317
+ return toPulses();
318
+ if (!options.notifications.inDetail() && data === "s" && options.dock)
319
+ return options.dock.toggle();
320
+ return options.notifications.handleInput(data);
321
+ }
322
+ if (data === "n" && options.notifications) {
323
+ map.view = "notifications";
324
+ return;
325
+ }
306
326
  if (matchesKey(data, Key.escape)) {
307
327
  options.back();
308
328
  return;
@@ -366,6 +386,8 @@ export function createSidePanel(options) {
366
386
  else if (action === down && action !== map.view) {
367
387
  if (action === "close")
368
388
  options.close();
389
+ else if (action === "notifications")
390
+ map.view = "notifications";
369
391
  else if (action === "map")
370
392
  toMap();
371
393
  else
@@ -375,6 +397,11 @@ export function createSidePanel(options) {
375
397
  }
376
398
  }
377
399
  }
400
+ if (map.view === "notifications" && options.notifications) {
401
+ if (event.y < headerHeight)
402
+ return;
403
+ return options.notifications.handleMouse({ ...event, y: event.y - headerHeight, height: event.height - headerHeight });
404
+ }
378
405
  if (event.button === "left" && (event.type === "press" || event.type === "click")) {
379
406
  const target = hits.get(event.y)?.find(({ x, end }) => event.x >= x && event.x < end);
380
407
  if (target) {
@@ -12,8 +12,8 @@ import type { TranscriptStyle } from "./transcript-view.ts";
12
12
  * folded block each. A chain of many modules nested one in another was too deep to read, and too much to draw.
13
13
  */
14
14
  export interface SpecMapState {
15
- /** Which view the side panel shows: the map, or the pulse list. */
16
- view: "map" | "pulses";
15
+ /** Which tab the side panel shows. */
16
+ view: "map" | "pulses" | "notifications";
17
17
  /** The row the cursor is on, and the key of what is there - it stays on the item when rows move. */
18
18
  cursor: number;
19
19
  cursorKey?: string;
@@ -177,6 +177,8 @@ export function noticeDialogs(pi, session, link, context) {
177
177
  pi.on("agent_settled", () => void ask());
178
178
  return {
179
179
  put(notice) {
180
+ if (session.terminal)
181
+ return; // The terminal centre received it, including the question whether to start.
180
182
  try {
181
183
  pi.appendEntry(NOTICE_ENTRY, notice);
182
184
  }
@@ -191,13 +193,14 @@ export function noticeDialogs(pi, session, link, context) {
191
193
  },
192
194
  concluded(conclusion) {
193
195
  try {
194
- pi.appendEntry(CONCLUDED_ENTRY, conclusion);
196
+ if (!session.terminal)
197
+ pi.appendEntry(CONCLUDED_ENTRY, conclusion);
195
198
  }
196
199
  catch {
197
200
  /* the agent is still told */
198
201
  }
199
202
  // A host that shows the person the conclusion itself: the chat knows of it - in order, with no turn of its own.
200
- const shown = session.host.pulseEndsShown === true;
203
+ const shown = session.terminal || session.host.pulseEndsShown === true;
201
204
  void pi.sendMessage({
202
205
  customType: "turri_sentinel_concluded",
203
206
  content: concludedNote(conclusion, { shown }),
@@ -206,6 +209,8 @@ export function noticeDialogs(pi, session, link, context) {
206
209
  }, shown ? { triggerTurn: false } : { triggerTurn: true, deliverAs: "followUp" });
207
210
  },
208
211
  over(notice) {
212
+ if (session.terminal)
213
+ return;
209
214
  asking.get(notice.id)?.abort();
210
215
  const at = waiting.indexOf(notice);
211
216
  if (at !== -1)
@@ -30,7 +30,7 @@ export declare function keepGuidance(cwd: string, text: string): void;
30
30
  * What a chat of the person's is told of the pulses that end: told itself, of those asked for in it - or, with the
31
31
  * sentinel on, nothing, the sentinel telling the person what needs them.
32
32
  */
33
- export declare function pulseEndsBlock(sentinel: boolean): string;
33
+ export declare function pulseEndsBlock(sentinel: boolean, terminal?: boolean): string;
34
34
  /**
35
35
  * What the chat the person is in is told of a pulse that landed, with the sentinel on: that it landed, what the sentinel
36
36
  * does with it - and to tell the person so, and do nothing else about it. `launching`: launch-after-pulse is on - it is
package/dist/sentinel.js CHANGED
@@ -119,7 +119,9 @@ export function keepGuidance(cwd, text) {
119
119
  * What a chat of the person's is told of the pulses that end: told itself, of those asked for in it - or, with the
120
120
  * sentinel on, nothing, the sentinel telling the person what needs them.
121
121
  */
122
- export function pulseEndsBlock(sentinel) {
122
+ export function pulseEndsBlock(sentinel, terminal = false) {
123
+ if (sentinel && terminal)
124
+ return "<pulse-ends>\nThe sentinel checks finished pulses. Their results, its conclusions and its notices go to the notification centre (/notifications). Do not announce them here. Answer if the person asks; when they accept a notice's action, do the task you are given.\n</pulse-ends>";
123
125
  return sentinel
124
126
  ? [
125
127
  "<pulse-ends>",
@@ -0,0 +1,31 @@
1
+ import { type TuiMouseEvent } from "@earendil-works/pi-tui";
2
+ import type { TurriCore } from "./chats.ts";
3
+ import type { Conclusion, Notice } from "./notice.ts";
4
+ import { type DialogStyle } from "./question-dialog.ts";
5
+ /** The terminal session's inbox. A notice keeps its identity and live state from the session that answers it. */
6
+ export interface TerminalNotification {
7
+ title: string;
8
+ detail: string;
9
+ conclusion?: string;
10
+ notice?: Notice;
11
+ seen: boolean;
12
+ }
13
+ export declare class TerminalNotifications {
14
+ readonly items: TerminalNotification[];
15
+ private readonly reviews;
16
+ get count(): number;
17
+ needsAnswer(item: TerminalNotification): boolean;
18
+ add(title: string, detail: string, notice?: Notice): void;
19
+ /** Only the sentinel's review shares a row. The pulse result and the question whether to start it are independent. */
20
+ private review;
21
+ put(notice: Notice, work?: Pick<Conclusion, "job" | "check">): void;
22
+ concluded(result: Conclusion): void;
23
+ }
24
+ /** The notifications tab. Opening or leaving a detail never answers its notice. Only an explicit choice does. */
25
+ export declare function notificationView(session: TurriCore, style: DialogStyle, leave: () => void): {
26
+ count: () => number;
27
+ inDetail: () => boolean;
28
+ render(width: number, available: number): readonly string[];
29
+ handleInput(data: string): void;
30
+ handleMouse: (event: TuiMouseEvent) => import("@earendil-works/pi-tui").TuiMouseEventResult | undefined;
31
+ };
@@ -0,0 +1,134 @@
1
+ import { Container, SelectList, Text } from "@earendil-works/pi-tui";
2
+ import { QuestionDialog } from "./question-dialog.js";
3
+ export class TerminalNotifications {
4
+ items = [];
5
+ reviews = new Map();
6
+ get count() {
7
+ return this.items.filter((item) => !item.seen || this.needsAnswer(item)).length;
8
+ }
9
+ needsAnswer(item) {
10
+ return item.notice?.state === "open" && item.notice.kind !== "fixed";
11
+ }
12
+ add(title, detail, notice) {
13
+ this.items.unshift({ title, detail, seen: false, notice });
14
+ }
15
+ /** Only the sentinel's review shares a row. The pulse result and the question whether to start it are independent. */
16
+ review(about, title) {
17
+ const key = about.check ? `check:${about.check}` : about.job ? `pulse:${about.job}` : undefined;
18
+ const known = key && this.reviews.get(key);
19
+ if (known)
20
+ return known;
21
+ const item = { title, detail: "", seen: false };
22
+ this.items.unshift(item);
23
+ if (key)
24
+ this.reviews.set(key, item);
25
+ return item;
26
+ }
27
+ put(notice, work) {
28
+ const about = [notice.module, notice.pulse !== undefined ? `pulse ${notice.pulse}` : undefined].filter(Boolean).join(" · ");
29
+ const heading = notice.kind === "fixed" ? "Fixed" : "Sentinel";
30
+ const title = [heading, about, notice.summary].filter(Boolean).join(" · ");
31
+ const detail = notice.evidence.join("\n\n");
32
+ if (notice.kind === "sentinel-start")
33
+ return this.add(title, detail, notice);
34
+ const item = this.review(work ?? notice, title);
35
+ Object.assign(item, { title, detail, notice, seen: false });
36
+ }
37
+ concluded(result) {
38
+ const what = result.pulse !== undefined ? `pulse ${result.pulse}` : result.job ?? result.check;
39
+ const verdict = result.verdict === "holds" ? "it holds" : result.verdict === "wrong" ? "found something wrong" : "not checked";
40
+ const item = this.review(result, ["Sentinel", result.module, what, verdict].filter(Boolean).join(" · "));
41
+ item.conclusion = `${verdict}: ${result.summary}`;
42
+ }
43
+ }
44
+ /** The notifications tab. Opening or leaving a detail never answers its notice. Only an explicit choice does. */
45
+ export function notificationView(session, style, leave) {
46
+ const inbox = session.notifications;
47
+ const { accent, muted } = style;
48
+ const listBox = new Container();
49
+ let list;
50
+ let rows = [];
51
+ let labels = [];
52
+ let visible = 0;
53
+ let detail;
54
+ let selectedNotice;
55
+ let detailState;
56
+ let height = 20;
57
+ const back = () => { detail = undefined; selectedNotice = undefined; };
58
+ const show = (item, steering = false) => {
59
+ item.seen = true;
60
+ const notice = item.notice;
61
+ selectedNotice = notice;
62
+ detailState = notice?.state;
63
+ const open = notice?.state === "open";
64
+ const actions = open && notice.kind !== "fixed" ? notice.actions.map((action, index) => `${index + 1}. ${action.label}`) : [];
65
+ const steer = "Say what to do instead…";
66
+ const ignore = "Ignore - leave it as the build has it";
67
+ const options = [...actions, ...(open && notice.ignorable ? [ignore] : []), ...(open && notice.kind === undefined ? [steer] : []), ...(open ? ["Dismiss"] : []), "Back"];
68
+ const target = notice && session.chats().find((chat) => chat.id === notice.chat);
69
+ detail = new QuestionDialog({
70
+ question: steering ? "What should be done about it?" : "Notifications",
71
+ context: [item.title, item.detail, item.conclusion, ...(open && notice.kind === undefined && target ? [`Accepted work goes to ${target.title}.`] : [])].filter(Boolean).join("\n\n"),
72
+ ...(steering ? {} : { options, clickable: true }), rows: () => height,
73
+ style, requestRender: () => { },
74
+ done(answer) {
75
+ if (!answer || !notice || notice.state !== "open" || (!steering && answer === "Back"))
76
+ return back();
77
+ if (!steering && answer === steer)
78
+ return show(item, true);
79
+ if (steering)
80
+ session.answer(notice.id, { steer: answer });
81
+ else if (answer === "Dismiss")
82
+ session.answer(notice.id, { dismiss: true });
83
+ else if (answer === ignore)
84
+ session.answer(notice.id, { ignore: true });
85
+ else
86
+ session.answer(notice.id, { action: actions.indexOf(answer) });
87
+ back();
88
+ },
89
+ });
90
+ session.changed();
91
+ };
92
+ return {
93
+ count: () => inbox.count,
94
+ inDetail: () => detail !== undefined,
95
+ render(width, available) {
96
+ height = available;
97
+ if (selectedNotice && selectedNotice.state !== detailState)
98
+ back();
99
+ if (detail)
100
+ return detail.render(width);
101
+ const next = inbox.items;
102
+ const lines = next.map((item) => `${inbox.needsAnswer(item) ? "? " : item.seen ? " " : "• "}${item.notice && item.notice.state !== "open" ? `[${item.notice.state}] ` : ""}${item.title.replace(/\s+/g, " ")}`);
103
+ const room = Math.max(1, available - 4);
104
+ if (!list || room !== visible || next.length !== rows.length || next.some((item, i) => item !== rows[i] || lines[i] !== labels[i])) {
105
+ // Keep the same item selected when a pulse finishes while the person is reading the list.
106
+ const selected = rows[Number(list?.getSelectedItem()?.value)];
107
+ rows = next.slice();
108
+ labels = lines;
109
+ visible = room;
110
+ list = new SelectList(rows.map((_item, i) => ({ value: String(i), label: labels[i] })), room, { selectedPrefix: accent, selectedText: accent, description: muted, scrollInfo: muted, noMatch: muted });
111
+ list.setSelectedIndex(selected ? rows.indexOf(selected) : 0);
112
+ list.onSelect = ({ value }) => show(rows[Number(value)]);
113
+ list.onCancel = leave;
114
+ listBox.clear();
115
+ listBox.addChild(new Text(style.bold(accent("Notifications")), 0, 0));
116
+ listBox.addChild(rows.length ? list : new Text("No notifications this session.", 0, 0));
117
+ listBox.addChild(new Text(muted(rows.length ? "↑↓ select · enter open · r mark all read · esc back" : "esc back"), 0, 0));
118
+ }
119
+ return listBox.render(width);
120
+ },
121
+ handleInput(data) {
122
+ if (detail)
123
+ detail.handleInput(data);
124
+ else if (data === "r") {
125
+ for (const item of inbox.items)
126
+ item.seen = true;
127
+ session.changed();
128
+ }
129
+ else
130
+ list?.handleInput(data);
131
+ },
132
+ handleMouse: (event) => detail ? detail.handleMouse(event) : listBox.handleMouse(event),
133
+ };
134
+ }
package/docs/chats.md CHANGED
@@ -19,7 +19,7 @@ The session's, shared by every chat:
19
19
  - **what launches started** - it runs until turri ends or `/halt launched <name>`, whatever chats are opened or closed - and the launch track;
20
20
  - **the ledger** - one run, each event with the id of the chat its work was asked for in (`chat`), and `chat.opened` and `chat.closed` as they happen.
21
21
 
22
- A pulse's end goes to the [sentinel](sentinel.md) - a chat of turri's own, opened in the background with the first pulse that finishes, once you said to start it under `sentinel: ask` - which checks it, tests what was launched, and puts what needs you as a notice in the chat you are in. That chat shows the pulse's end; its agent is told of a pulse that landed, to tell you so and what the sentinel is doing with it - and when the sentinel is done with any pulse, what it found - and nothing more - and not of one that went wrong: the sentinel's notice is what it hears of that. With `sentinel: false`, a pulse's end is told to the chat that asked for it instead, shown or not - its agent reacts to it there; the chat's mark in the strip says it has something new. When that chat has been closed, the chat shown is told. Closing a chat stops its turn, never its pulses.
22
+ Each finished pulse appears in the session's notifications. When the [sentinel](sentinel.md) is on, it checks the pulse in the background and puts its findings and conclusion there too. Your conversation stays on what you asked; accepting a notice's action starts work in the chat it names. Closing a chat stops its turn, never its pulses.
23
23
 
24
24
  ## In the terminal
25
25
 
@@ -30,6 +30,7 @@ A pulse's end goes to the [sentinel](sentinel.md) - a chat of turri's own, opene
30
30
  | Click a tab's `×`, `/chat close 3` | close that chat; closing a background chat leaves the one shown in place |
31
31
  | `/chat close`, `alt+w` | close the chat shown and switch to the next one |
32
32
  | `/chat` | a list of the chats, to pick one - or a new one |
33
+ | `***plain ›` → `notifications`, `/notifications` | finished pulses and sentinel findings across this session; open a notice to read its evidence and answer it |
33
34
  | `/new` | the same as `/chat new` |
34
35
  | `/resume` | a saved chat, opened as a chat of its own beside the others - or shown, when it is open |
35
36
  | `ctrl+c` | what the chat shown is doing, stopped - its turn, a skill or a tool in it, a `!` command, a compaction; in a chat doing nothing, a draft in the editor cleared, else turri left, every chat with it |
@@ -41,7 +42,7 @@ A message you send while a chat's agent works is shown under the chat at once, s
41
42
  On macOS, `alt` is Option (⌥), and reaches turri only when the terminal sends Option as Meta - otherwise ⌥N is the dead key for ñ and ⌥1 types `¡`, and nothing reaches turri. turri says so as a session's second chat opens. To turn it on: Ghostty, `macos-option-as-alt = true` in its config; iTerm2, Profiles → Keys → Left Option key: Esc+; Terminal.app, Profiles → Keyboard → Use Option as Meta key; Kitty, `macos_option_as_alt yes`; WezTerm, `send_composed_key_when_left_alt_is_pressed = false`. `/chat` works without it.
42
43
 
43
44
  - **A hidden chat's questions** wait until you show it, then come up one after another. What it says in passing is said as you show it; what it keeps on the screen - a skill's progress, the job panel - is put back each time; what you had typed in its editor and not sent is still there.
44
- - **The side panel** belongs to the session and stays open when you switch chats. Click `***plain ›` at the right end of the chat tabs to open the spec beside the chat. Click `***plain` or `pulses` at the top of the panel to switch views, or `× close` at the top right to close the panel. `ctrl+h` and `p` are the keyboard controls. A terminal under 104 columns shows the panel full screen.
45
+ - **The side panel** belongs to the session and stays open when you switch chats. Click `***plain ›` at the right end of the chat tabs to open it; click `***plain ‹` to close it. The button turns pink and spins while turri plans or runs pulses. Its tabs are `***plain`, `pulses` and `notifications`; `× close` also closes it. From the keyboard, `ctrl+h` opens the panel, `p` switches between the map and pulses, and `n` opens notifications. A terminal under 104 columns shows the panel full screen.
45
46
  - **A long command** - `/regenerate`, planning a module from scratch - does its work in the background once it is under way: the chat, and switching to another, stay free while the planner plans.
46
47
  - **`ctrl+c`** reaches the chat shown and nothing else: another chat's turn and skill go on, and so do the pulses - `/halt` stops one. A skill stopped keeps its run, for the model to continue with `resume`. At a question - the chat's `ask_user`, a skill's interview - `ctrl+c` declines it, and the asker is told so and goes on - each question it is pressed at, however many in a row. A skill is stopped by `ctrl+c` with no question open. A second press straight after one that stopped something does nothing, so pressing twice to be sure does not leave turri; once the chat is doing nothing, the next one does - with what every other chat is doing. A host has the same as `interrupt(id)`, and `decline(id)` for a question ([hosting](hosting.md)).
47
48
  - **The sentinel** is a chat in the strip like the others, `sentinel`, and never shown by itself: it closes like any chat, and the next pulse that finishes opens it again. Each pulse it checks in a fresh conversation, replacing the one in its tab. With it on, you open up to eight chats - the ninth slot is its. See [the sentinel](sentinel.md).
package/docs/config.md CHANGED
@@ -107,7 +107,7 @@ models: # each agent role's model, thinking and tur
107
107
  | `rules-off` | a list of rule names - `integrations`, `concise-specs`, the files of `genome/rules/` without `.md` - left out of the conversation's prompt and every \*\*\*plain-writing agent's: a rule this project's own skills or AGENTS.md replace, such as one that says to probe a live API before any \*\*\*plain is written. `turri init-config` writes it with `integration-embedded`, `integration-embedded-testing` and `integration-standalone` - take them out when the project writes an integration against a REST API. The project's alone | none |
108
108
  | `allow-to-stop-jobs` | `true` or `false`: whether turri stops a running job \*\*\*plain has moved on from - a functional spec it regenerates changed, or a file one links was edited - rolls it back and regenerates \*\*\*plain as it now is. `false`: the job runs to its end and lands, and what changed since is regenerated on top of it by the next job - see [regenerating the code](regenerating.md). Your own `halt` stops a job either way | `true` |
109
109
  | `launch-after-pulse` | `true` or `false`: whether every pulse that lands code is launched, in the chat, in the background - the pulse ends as it lands, and the codebase's next pulse does not wait: the commit it landed goes on the [launch track](launch.md#the-launch-track), one launch of a codebase at a time, the newest commit winning. An agent on the coding model launches it, following the project's launch guidance (what was passed to `launch` this session, AGENTS.md, the project's skills) for how, or from `dist/<module>` without any - see [launch](launch.md#after-every-pulse). The sentinel tests each pulse in a launch that holds its commit; with it off, the chat is told how each launch went. `turri init-config` writes `true`. Formerly `release-after-pulse`: a file that still has it has it renamed as turri first reads it | `false` |
110
- | `sentinel` | `ask`, `true` or `false`: whether a chat of turri's own, the sentinel, gets every pulse that finishes - checks it, tests what was launched under `launch-after-pulse`, and puts what needs you as a notice in the chat you are in - instead of the chat that asked for it. `ask`: you are asked, with what it does, before it first opens in a session - see [starting it](sentinel.md#starting-it); `true`: it opens without asking. `/sentinel` sets it from the chat. `turri init-config` writes `ask` | `ask` |
110
+ | `sentinel` | `ask`, `true` or `false`: whether the sentinel checks each finished pulse, tests what was launched under `launch-after-pulse`, and reports findings in notifications. `ask`: answer the start question in notifications before it first opens in a session - see [starting it](sentinel.md#starting-it); `true`: it opens without asking. `/sentinel` sets it from the chat. `turri init-config` writes `ask` | `ask` |
111
111
  | `conformance-tests` | whether functional specs are conformance tested - black-box tests of the built software against the scenarios of their test plain files, run with the whole suite as more lands. `false`: none - no scenarios written or tested, no conformance testing script, and the chat's `conform` refused. Off by default for fast iteration - they make each change take about twice as long - and turned on by the person, with `/conform` - see [conformance tests](#conformance-tests). A module's `config.turri.<module>.yaml` can set its own | `false` |
112
112
  | `test-dir` | the folder of the test plain files, by path from the project root: a module's are every `.plain` file in `<test-dir>/<module>/`, each a functional spec's conformance and acceptance scenarios - see [test plain files](parser.md#test-plain-files). A module's `config.turri.<module>.yaml` can set its own | `tests` |
113
113
  | `base-folder` | a folder, by path from the project root, that a codebase requiring no other module starts from instead of nothing - an existing codebase to build on, files to use (images, animations, fonts), or both. It is copied in once, before the codebase's first pulse, and never written to: from a git repo what git sees, else every file but `.git` and installed dependencies. The \*\*\*plain may refer to it, and link into it; a codebase built on another starts from that one's code, base folder and all. A module's `config.turri.<module>.yaml` can name its own - see [the base folder](regenerating.md#the-base-folder) | none: the codebase starts empty |
package/docs/hosting.md CHANGED
@@ -171,11 +171,11 @@ The [sentinel](sentinel.md) is one of the host's chats: turri opens it with the
171
171
  - **A conversation a pulse.** The sentinel checks each pulse from scratch, in a conversation of its own - one pulse at a time, the others waiting their turn. The chat keeps its id; its session is replaced. As it starts on a pulse, the session it had is stopped and let go (`abort`, `dispose`), a new one is made in its place, and `onChatSession(chat, session)` comes with it - before the pulse is put to it - then `onChats`; `session(id)` returns the new one from then on. A host that follows the sentinel's chat subscribes to that session in place of the old - an `onChats` listener that follows only the ids it has not seen would hear nothing more of it. The first pulse goes to the session the chat was opened with: there is no `onChatSession` for it. Each conversation's first message is the hidden brief of its pulse - `customType: "turri_sentinel_pulse"`, `details.jobId` - so a host that splits the sentinel's work by pulse on it still can; the conversations before are not in the new session, and what the host showed of them is its own to keep.
172
172
 
173
173
  - **Notices.** What it finds wrong comes as `onNotice(notice)`: `{ id, chat, severity: "error" | "warning" | "info", summary, evidence: string[], actions: [{ label, task }], module?, pulse?, job?, ignorable?, state: "open" }`. Draw it in the chat `chat` names - the one `focus` last named, or, while that is the sentinel, the chat that asked for the pulse. It is drawn there as a card in the transcript too. A host given `onNotice` answers it itself - the terminal's dialog is not opened - with `answer(id, …)`: `{ action: index | label }` starts that chat's agent on the action's task, `{ steer: text }` on the person's words, `{ dismiss: true }` on nothing, this once. A notice with `ignorable: true` - a gap in the \*\*\*plain the build settled with an assumption, which the person may leave as it is - takes `{ ignore: true }` too: offer it as its own button beside the actions. Nothing is done in the chat, the notice ends `state: "ignored"` (`"ignored"`), and turri writes it to the sentinel's guidance, so it is not raised again in this session or the next; on a notice without `ignorable`, `{ ignore: true }` is `"refused"` and the notice stays open. `onNoticeOver(notice)` comes as it is answered - and when a newer notice about its module supersedes it (`state: "superseded"`) - for the host to take the card down. `notices()` lists the open ones.
174
- - **Fixes it made.** The sentinel fixes the project's testing scripts and their config itself ([what it may do](sentinel.md#what-it-may-do)), and says so as a notice with `kind: "fixed"`, `severity: "info"`, no actions, the lines before and after in `evidence`: a note, with nothing to answer. Draw it as one - its card with a way to put it away (`answer(id, { dismiss: true })`), no "say what to do instead". It never supersedes a notice about its module. The terminal draws its card and puts no dialog.
174
+ - **Fixes it made.** The sentinel fixes the project's testing scripts and their config itself ([what it may do](sentinel.md#what-it-may-do)), and says so as a notice with `kind: "fixed"`, `severity: "info"`, no actions, the lines before and after in `evidence`: a note, with nothing to answer. Draw it as one - its card with a way to put it away (`answer(id, { dismiss: true })`), no "say what to do instead". It never supersedes a notice about its module. The terminal puts it in notifications.
175
175
  - **The machine is the person's.** turri installs nothing and changes no setting of the machine's or the person's shell, in any chat, the sentinel's included - and through a host's tools as through its own: a tool call whose input has a `command` string - a host's `terminal_run` - is refused when the command would (`machineChange`), with what to do instead (`machineChangeReason`), as turri's own `bash` is; and the sentinel's, also when it writes a `.plain` file, or starts or runs the code in `plain_modules` - what nobody launched: it tests what is launched. A tool that types into what already runs - a terminal's `terminal_type` at a shell prompt - is the host's to check: `machineChange(text)` says whether a line would change the machine, and why.
176
176
  - **Starting it.** Under `sentinel: ask` - as it is unset - the person is asked before it first opens in the session: a notice with `kind: "sentinel-start"`, `severity: "info"`, in the chat `chat` names, its `summary` the question in one sentence, no `evidence`, and its actions the answers - `Start the sentinel`, `Start it, and don't ask again`, `Not this session`, `Turn it off for this project`. Draw it as a question rather than as something wrong. `answer(id, { action })` answers it, by index or label - `"done"` - and `{ dismiss: true }` is not this session; turri writes `sentinel:` itself for the two that choose for the project. Until it is answered, the pulses that finish are held: neither the sentinel nor the chat hears of them. A host that offers the setting too writes it as `/settings` does - `ask`, `true` or `false` (see `configSettings`).
177
177
  - **Conclusions.** As the sentinel is done with each pulse - all well or not - `onConcluded({ job, verdict: "holds" | "wrong", summary, module, pulse, chat })` comes, and the chat `chat` names - the one `focus` last named, as for a notice - shows it and its agent says so in a line. A pulse turri cannot brief it on - what runs cannot hold the pulse's commit, turri's own error - ends `verdict: "unchecked"`, with an error shown in that chat as well.
178
- - **A host that shows them itself.** With the sentinel on, the chat the person is in is told of each pulse that lands - to say it landed and what the sentinel does with it - and of each conclusion, each in a turn of its own: its agent says it in the conversation, as the terminal has it. A host that shows both itself - its own notifications, from `onJobChange` and `onConcluded` - passes `pulseEndsShown: true`, and the chat then says neither. Both still reach it - `customType: "turri_job_landed"` and `"turri_sentinel_concluded"`, hidden - put in its conversation in order and starting no turn: its agent has them in its next turn, and knows what landed and what the sentinel found when the person asks. Their words say what happened, and ask nothing of it. The rest is as it was: the sentinel's briefs and checks, its notices, a pulse that stopped on \*\*\*plain that contradicts itself (a notice of turri's own), `onConcluded` itself - and, with the sentinel off, the turn in the chat that asked for a pulse, which does what the project's guidance says once a pulse finishes.
178
+ - **A host that shows them itself.** With the sentinel on, the default host has the chat report each landed pulse and each conclusion in a turn of its own. A host with a notification centre passes `pulseEndsShown: true` and presents them from `onJobChange` and `onConcluded`. Both still reach the chat - `customType: "turri_job_landed"` and `"turri_sentinel_concluded"`, hidden and starting no turn - so it can answer when asked. The terminal uses this quiet delivery with its own notifications tab. Host notice actions, the sentinel's briefs and checks, and delivery with the sentinel off are unchanged.
179
179
  - **Checks.** `check({ module, funcIds })` asks the sentinel to test functional specs of one module - the person picked them on a list of its built ones, say - in the background, on its own judgement, reported as a pulse is. `module` is the module whose launch is checked, by name; `funcIds` the functional specs to test, each `module:func-id` - of that module, or of any module its requires chain builds on, whose code its codebase holds: `check({ module: "predators", funcIds: ["depths:gene-fragments"] })`. A bare func-id is the module's own. The check and its brief name each as `module:func-id`. It returns `{ check: id }` at once, or `{ refused: why }`, saying which: the sentinel off (`sentinel: false`), or not started this session; a module not in the project's folder, an import module, one that does not parse; a name outside its chain - `Not in predators' codebase: arena:waves - arena is not predators or a module its requires chain builds on (depths, ocean).`; a func-id its module does not have; one not built in the module's own codebase as its \*\*\*plain has it now - with where the module's code is built on instead, when it is. What is tested is what is launched of the module - its own codebase's code, which holds the code of every module its requires chain builds on - never what a pulse is writing, and never another module's: turri does not choose one for it. Under `sentinel: ask`, a check asked before the sentinel was started puts the start question first, as a pulse does - `check` set on the notice - and waits for the answer.
180
180
  - **Queued with the pulses.** It waits its turn behind the sentinel's work, and is taken in a conversation of its own: `onChatSession`, then the conversation's first message, the hidden brief of the check - `customType: "turri_sentinel_check"`, `details: { checkId, module, funcIds }`. A pulse of its module that lands meanwhile waits for it, rather than stopping it.
181
181
  - **In what is launched.** The sentinel launches nothing. Once the module's launches are settled - nothing launching, nothing waiting to - it is told what runs and where, as for a pulse, and each functional spec's text and scenarios, as turri reads them, to test those and not the module's others. With nothing of the module launched - never, or halted - the check ends unchecked, its summary saying so in the person's words - `Not checked: nothing of app is launched to test it in - ask the chat to try it first, which launches it.` - and with no notice: it is an answer, not an error. When the module's last launch did not come up, the sentinel is told why, and that is its finding.
package/docs/launch.md CHANGED
@@ -73,8 +73,8 @@ With `launch-after-pulse: true` in `config.turri.yaml`, turri launches what each
73
73
 
74
74
  The launch agent finds the guidance as for any launch: what the chat passed to `launch` earlier for the codebase, the project's AGENTS.md and its skills. The setting is the word to launch; the guidance says only how - without any, the code goes to `dist/<module>` and is started from there.
75
75
 
76
- - **With the [sentinel](sentinel.md) on** - the default - the chat you are in is told that the pulse landed, is being launched in the background, and that the sentinel tests it once it is up; the sentinel is told the pulse once what runs holds its commit, and tests it there. A launch that did not come up is told to it, and is a finding of its own like any other. A host hears every launch as it is asked for, starts and ends (`onLaunch`) - one out already once, as launched.
77
- - **With `sentinel: false`**, the chat that asked for the pulse - or the one shown - is told as the pulse lands that its commit is being launched in the background, and says so in a line, offering nothing else for it. It is told again once the launch ends, as a turn of its own: where it runs, or why it did not come up - unless a newer launch replaced it, whose end is told instead. It then does what it was told to do once something is launched - a host such as a desktop app tells it, in its `surface`, to open it where the person can watch and say what to test.
76
+ - **With the [sentinel](sentinel.md) on**, the terminal puts the finished pulse in notifications. Once the launch holds its commit, the sentinel tests it and adds its conclusion there. A launch that did not come up is a finding like any other. A host hears every launch as it is asked for, starts and ends (`onLaunch`) - one out already once, as launched.
77
+ - **With `sentinel: false`**, finished pulses still appear in the terminal's notifications. The chat that asked for the pulse hears when the launch ends: where it runs, or why it did not come up - unless a newer launch replaced it, whose end is told instead. It then does what it was told to do once something is launched - a host such as a desktop app tells it, in its `surface`, to open it where the person can watch and say what to test.
78
78
 
79
79
  Off without the key: launching after a pulse is then the chat's, when its guidance says so. `turri init-config` writes `launch-after-pulse: true`.
80
80
 
package/docs/sentinel.md CHANGED
@@ -1,33 +1,33 @@
1
1
  # The sentinel
2
2
 
3
- The sentinel is a chat of turri's own, beside the chats you talk to. Every pulse that finishes goes to it: it checks how the pulse went - and, with `launch-after-pulse` on, tests what was launched - and when something needs you, it says so in the chat you are in, with what can be done about it. You go on talking about the software, and building it, while it watches what lands.
3
+ The sentinel is a chat of turri's own, beside the chats you talk to. It checks each finished pulse and, with `launch-after-pulse` on, tests what was launched. You can keep working and read its findings in notifications when you're ready.
4
4
 
5
5
  `sentinel:` in `config.turri.yaml` says whether there is one: `ask`, as it is unset - you are asked before it first opens in a session (below); `true` - it opens without asking; `false` - none. It is there in the terminal and in a host such as turri-desktop - wherever turri holds [chats](chats.md) - and not in pi's print, json or rpc modes, nor on the command line (`turri regenerate`, `turri conform`), which have no chat to tell: there a pulse is told as it is without it.
6
6
 
7
7
  ## Starting it
8
8
 
9
- Under `sentinel: ask`, a tab that starts working on its own is not sprung on you. When the first pulse of a session finishes, turri asks first - a notice of its own in the chat you are in, before the sentinel opens, in one sentence: `app · regenerate pulse 3 finished - start the sentinel, a background tab that reviews each finished pulse and tries to use what was launched?` - the launch left out with `launch-after-pulse` off. In the terminal it is a dialog once that chat is not mid-turn, with how to switch to the sentinel once it is open - `Use "/chat 2" to open the sentinel.`, the number the one it will have in the strip; in a host, a notice with `kind: "sentinel-start"` (see [in a host](#in-a-host)). You answer:
9
+ Under `sentinel: ask`, the first finished pulse adds a question to notifications: start the sentinel for this session? Open `***plain ›` and choose **notifications**, beside **pulses**, or use `/notifications`. A host receives this question as a `sentinel-start` notice. You can choose:
10
10
 
11
11
  - **Start the sentinel** - it opens, and checks this pulse and each after it this session;
12
12
  - **Start it, and don't ask again** - the same, and `sentinel: true` is written to `config.turri.yaml`;
13
- - **Not this session**, or `esc` - no sentinel until turri starts again: each pulse is told to the chat that asked for it, as without one;
13
+ - **Not this session**, or **Dismiss** - no sentinel until turri starts again;
14
14
  - **Turn it off for this project** - `sentinel: false` is written.
15
15
 
16
- Nothing goes to the sentinel, or to your chat, until you answer: the pulses that finish meanwhile are held, and go to it - or to their chats - as you say. You are asked once a session: a sentinel closed and opened again by the next pulse is not asked for again, nor one `turri --continue` reopened. Close the chat it was asked in, and it is asked again in the one you look at.
16
+ Finished pulses appear in notifications immediately. Their reviews wait until you answer. Leaving the tab or pressing `esc` keeps the question open. Once you answer, turri does not ask again in the same session.
17
17
 
18
18
  `/sentinel` sets it from the chat - `/sentinel ask`, `/sentinel on`, `/sentinel off`, or `/sentinel` alone to pick - written to `config.turri.yaml` as `/settings sentinel` does.
19
19
 
20
20
  ## What you see
21
21
 
22
- - **In the chat you are in**, a pulse that finishes shows as it always has - `✓ app · regenerate pulse 3 finished after 4m 10s`, and for one that went wrong, where to see why. A pulse that landed is told to the chat's agent, which tells you in a line or two what landed and what the sentinel is doing with it - and again, in a line, when the sentinel is done with it - checking it, testing what was launched - and does nothing else about it: it does not test, launch or open it, nor do what the project's guidance says to do once a pulse finishes. The pulse is the sentinel's. A pulse that went wrong is not told to it: the sentinel looks into it, and you hear of it as a notice.
22
+ - **Notifications** is shared by all chats in the terminal session. Each finished pulse has a completion entry, even with the sentinel off. Each sentinel review has one entry: its conclusion is added to the finding or fix, alongside the evidence and actions. A conclusion does not reopen a dismissed notice or mark it unread again. The count beside `***plain` and on the notifications tab includes unread items and notices waiting for an answer. Open an item for its details; `r` in the list marks everything read without answering anything.
23
23
  - **The sentinel** opens with the first pulse that finishes - once you said to start it, under `sentinel: ask` - in the background: it never takes the screen, and you stay in your chat. It is a tab in the strip like any other chat - `sentinel` - marked while it works and when it has something new. Switch to it to read what it checked: it shows the pulse it is on, or the last one it checked - each pulse has a conversation of its own (below).
24
- - **A notice**, when something needs you: a card in the chat you are in - what is wrong, what shows it, and what can be done, numbered - and, in the terminal, once that chat is not mid-turn, a dialog on it:
24
+ - **A notice**, when something needs you: open its `?` entry in notifications to read what is wrong, the evidence and the choices:
25
25
  - `enter` on an action accepts it: the chat's agent is started on it - a change to the \*\*\*plain, a pulse regenerated again, a credential to provide, a setting to change;
26
26
  - **Ignore - leave it as the build has it**, on a notice the sentinel marked ignorable: nothing is done, and it is not raised again - in this session or the next (below);
27
27
  - **Say what to do instead…** - your own words, and the agent does that;
28
- - **Dismiss**, or `esc`: nothing is done, this once - the next pulse may raise it again.
28
+ - **Dismiss**: nothing is done, this once - the next pulse may raise it again. `esc` goes back without dismissing.
29
29
 
30
- Nothing is done without your answer. A notice goes to the chat you are in; while you are in the sentinel's, to the chat that asked for the pulse. There is one open notice a module: a newer one about the same module supersedes the older one, whose call to action would be stale, and the card says so.
30
+ Accepted work goes to the chat the notice was addressed to. A newer finding about the same module supersedes the old one; the old entry stays in the list but can no longer be acted on.
31
31
 
32
32
  ## What it does
33
33
 
@@ -37,7 +37,7 @@ Each pulse it checks from scratch, in a conversation of its own: its prompt, you
37
37
  2. **tests what was launched**, with `launch-after-pulse` on: what runs is where it is told, and it tries it - in the terminal with its shell (`curl`, the program itself, the logs), in a host also with what the host gives it, a browser say. How far it tests is its own judgement, from what the pulse changed and what the \*\*\*plain says it now does - but not what a later pulse in the same launch changed again: that is the later pulse's check. Where the \*\*\*plain picks one way among several - which of a tie comes first, how a default is chosen - it tries an input on which the ways give different answers, so a pass shows the \*\*\*plain's way and no other. With `launch-after-pulse` off nothing is running, and it checks the pulse alone;
38
38
  3. **finds out why**, when something is wrong - the pulse failed or stopped, it did not pass, the launch did not come up, the software does not do what its \*\*\*plain says. A testing script, or where the config says the scripts are, it fixes itself, resumes the module, and tells you what it changed (below). Anything else it puts to you as a notice, each action a task your chat's agent can carry out once you accept it - and what the machine lacks, the exact command for you to run;
39
39
  4. **notifies no one** when all is well;
40
- 5. **concludes**, last, whether all is well or not: what it checked and what it found, in a line or two. The chat you are in shows it - `✓ sentinel · app · pulse 3 · checked, it holds` - and its agent tells you so in a line, and does nothing more; when something was wrong, that its notice says what.
40
+ 5. **concludes**, last, whether all is well or not: what it checked and what it found, in a line or two. Read the conclusion in notifications, or ask your chat about it.
41
41
 
42
42
  A host can ask it to check too: functional specs the person picks in a module - its own, or those of any module its requires chain builds on (`depths:gene-fragments` in predators') - in turri-desktop, on the preview's list of a module's built ones. It tests those, on its own judgement, in what is launched of the module - its own codebase's code - once the codebase's launches are settled, and reports as for a pulse: a notice when something is wrong, and its conclusion. The sentinel launches nothing: with nothing of the module launched - never, or you halted it - the check ends unchecked, its conclusion saying so - "ask the chat to try it first, which launches it" - and nothing else: it is an answer, not an error; when its last launch did not come up, that is what the sentinel finds out about, as for a pulse. It is refused with the sentinel off, and for a module that does not parse, a functional spec it does not have, or one not built; see [in a host](hosting.md#the-sentinel).
43
43
 
@@ -51,7 +51,7 @@ With `launch-after-pulse` on, a pulse is launched in the background on the [laun
51
51
  - **The launch did not come up**: it is told why, and that is what it finds out about - a finding like any other. It tests nothing in its place: never the code in `plain_modules`, where a pulse may be writing, nor a server of its own.
52
52
  - **You stopped the launch** (`/halt launched <module>`, or every server it started): nothing runs, and it checks the pulse alone.
53
53
  - **Whichever it is**, it is told never to run the code in `plain_modules`, where a pulse may be writing, nor to start a server of its own - not in its shell, not with a host's terminal: what would pass there is not what you try. A server that should run and does not is its finding. A host's terminal command that starts or runs the code there - `cd plain_modules/shorty/code && .venv/bin/uvicorn …`, a program or a path there, an environment variable pointing there - is refused it, saying why; reading there is not.
54
- - **What runs cannot hold it** - turri got it wrong: it is not told of the pulse. The error is shown in the chat you are in, recorded in the ledger (`sentinel.refused`), and the pulse is concluded unchecked; the next is taken.
54
+ - **What runs cannot hold it** - turri got it wrong: it is not told of the pulse. The reason appears in notifications with the unchecked conclusion and in the ledger (`sentinel.refused`); the next pulse is taken.
55
55
 
56
56
  When its codebase is launched again while it checks a pulse - a newer pulse landed, of it or of a module built on it - or what runs of it is stopped for another module's launch that needed what it held, its turn is stopped where it is, its conversation kept: what it was testing is being replaced. It takes nothing else meanwhile. Once the codebase's launches have settled - one, or several in a row - turri checks again that what runs holds the pulse's commit, and tells it, in the same conversation, to carry on: what runs now, and to do again what it was doing as the servers restarted. What runs no longer holding it, it is refused as above - for one stopped for another module's launch, saying which. A launch of another codebase that stops nothing of its own leaves it alone.
57
57
 
@@ -63,7 +63,7 @@ Two functional specs that contradict each other stop a pulse in a way only you c
63
63
 
64
64
  It fixes the project's tooling itself, and nothing else:
65
65
 
66
- - **It fixes** the testing scripts - `test_scripts/`, a `run_*.sh` or `prepare_environment*.sh` at the project's root, each script `config.turri.yaml` names - and, in `config.turri*.yaml`, where the scripts are (`unittests-script`, `conformance-tests-script`, `prepare-environment-script`) and `toolchains:`. A script that runs `python3` where this machine has `python` of the version the \*\*\*plain names, a path that moved, a flag this machine's version of a tool does not take: it checks what it relies on in its shell (`command -v python`, `python --version`), edits the script, and calls `resume` - the module is brought up again, as when you ask for it, and the scripts run for real. Then it tells you, as a note in your chat (`kind: "fixed"`) with nothing to answer: what it changed and why, the lines before and after. Any other key of the config it changes is put back, and its edit refused.
66
+ - **It fixes** the testing scripts - `test_scripts/`, a `run_*.sh` or `prepare_environment*.sh` at the project's root, each script `config.turri.yaml` names - and, in `config.turri*.yaml`, where the scripts are (`unittests-script`, `conformance-tests-script`, `prepare-environment-script`) and `toolchains:`. For example, if a script calls `python3` but this machine has the required version as `python`, it verifies the version, edits the script and calls `resume` to run the module again. A `fixed` notification shows what changed and why, with nothing to answer. Any other config key it changes is put back and its edit refused.
67
67
  - **It never changes \*\*\*plain.** The \*\*\*plain is your intent: what needs it changed is a notice, its action a task for your chat's agent once you accept it.
68
68
  - **It installs nothing, and changes no setting of the machine's or your shell's** - not a toolchain, not a package, not a PATH line in your profile - under no circumstances: its shell refuses it, as every shell turri runs does. What the machine lacks is a notice with the exact command for you to run, and resuming as its action once you have.
69
69
 
package/docs/theming.md CHANGED
@@ -10,7 +10,7 @@ turri --use-theme dark # pi's own
10
10
 
11
11
  The second form follows your terminal's light/dark appearance. The default is for `turri` only: [pi](https://pi.dev)'s settings are left alone, so a plain `pi` keeps its theme. With the themes copied to `~/.pi/agent/themes/` (`cp .pi/themes/*.json ~/.pi/agent/themes/`), `{"theme": "turri-dark"}` in `~/.pi/agent/settings.json` gives a plain `pi` the same one.
12
12
 
13
- Bad input fails quietly - an unknown `--use-theme` name and a malformed theme file both run without complaint - so if the colours do not change, suspect a typo rather than the mechanism.
13
+ If the same turri theme is installed in both places, the project's `.pi/themes/` copy takes precedence over the one in `~/.pi/agent/themes/`. turri does not warn about these expected copies. Theme files that fail to load and name clashes with other themes still appear in pi's startup diagnostics.
14
14
 
15
15
  ## The palette
16
16
 
@@ -36,7 +36,7 @@ Both themes, the command line's colours, the \*\*\*plain diff's, the banner's je
36
36
  | indigo | `#5b57d9` | the jellyfish's bell, at its rim - nowhere else |
37
37
  | orange | `#ff7a3d` | the jellyfish's gut, the `$` of bash mode, and everything that asks for you - what failed (`✗`), what works with limits, what needs you (the \*\*\*plain map's `!`): `error`, `warning` |
38
38
 
39
- In the chat header, the `+` is the one pink button. Tabs use the theme's `selectedBg` for their padded surfaces and `accent` for the active tab. Hover underlines the target; `×` takes the warning colour on hover to distinguish closing from switching. The side panel uses the same treatment. In the transcript, pink carries what is done and orange everything that asks for you - what failed, what works with limits, what waits on you - the mark (`✗`, `!`, `■`) telling them apart. The palette has no red.
39
+ In the chat header the `+` button uses the theme's success colour. The `***plain` toggle takes a brand-pink fill and a spinner while regeneration is active; its arrow points left when the panel is open and right when closed. Tabs use the theme's `selectedBg` for their padded surfaces and `accent` for the active tab. Hover underlines the target; `×` takes the warning colour on hover to distinguish closing from switching. The side panel uses the same treatment. In the transcript, pink carries what is done and orange everything that asks for you - what failed, what works with limits, what waits on you - the mark (`✗`, `!`, `■`) telling them apart. The palette has no red.
40
40
 
41
41
  ## Why there are two
42
42
 
package/docs/using.md CHANGED
@@ -44,7 +44,7 @@ The agent does this work with these tools, never by running turri's command line
44
44
 
45
45
  ## Pulses
46
46
 
47
- In the fullscreen TUI, click `***plain ›` at the right end of the chat tabs to open the spec map on the right. The panel has two clickable tabs: `***plain` for the spec and `pulses` for the work regenerating it. The filled tab marked `▸` is the current view. Click `× close` in the panel's upper-right corner to return to the full-width chat. Below 104 terminal columns the same controls open and close a full-screen panel.
47
+ In the fullscreen TUI, click `***plain ›` at the right end of the chat tabs to open the spec map on the right. The button then points back into the chat (`***plain ‹`); click it again to close the panel, from any of its tabs. Choose `***plain` for the spec, `pulses` for the work regenerating it or `notifications` for results and notices. The selected tab is highlighted; its label stays in place. Below 104 terminal columns the panel fills the screen; `× close` returns to the chat.
48
48
 
49
49
  Click a spec's heading or summary, or an imported file's name, to select it and toggle its details. A wrapped summary is clickable on any of its lines. Click a module tab to switch modules. In `pulses`, click a section, a pulse or a file in its diff to expand or collapse it. The arrow keys and Enter continue from the row you clicked.
50
50
 
@@ -52,7 +52,7 @@ A pulse is one unit of work regenerating the code. It was called a job, and stil
52
52
 
53
53
  A regeneration takes minutes, so in the TUI every tool that regenerates starts the work as a pulse and returns straight away. The conversation carries on, and you need not wait for a pulse to finish: go on shaping the \*\*\*plain and writing its next change, ask questions, try what has landed - turri says so as each pulse starts, and never waits for one itself. A \*\*\*plain change made meanwhile steers the running pulse or is planned again around it (see below); pulses on the same module - or on modules of one `requires` chain - queue behind each other, in the order they were asked for, from the first pulse on: one queued while the module's \*\*\*plain is only a scaffold, with no functional specs yet, or while it does not parse, still holds its module, so nothing on the module runs beside it. Pulses on modules that share nothing run side by side, each with its own progress panel - two modules or ten. How many run at once is capped by what the machine has room for: past `parallel-jobs` (see [the project config](config.md#how-many-jobs-at-once)), a pulse whose turn has come waits for a free slot, and says so.
54
54
 
55
- - **The panel** above the input, while something runs, shows on top what finished - a line a module, the module that finished last on top, its pulses newest first, each with its mark (green, red or amber, as in the side panel), number and kind - what it regenerated is in the side panel - `cognio ✓ 4 conformance · ✓ 3 regenerate · … 2 earlier`, the newest that fit the width - then a rule, and under it each running pulse, the newest first - `cognio · regenerate pulse 5`, `cognio · conformance pulse 6` - its time and cost, and what its agents are doing. A module whose work is being planned into pulses shows at once, before any pulse runs - `shorty · planning the pulses · 12s` - from the moment it is asked for: while its code is deleted for a start from scratch and what is left to regenerate is worked out, as well as while the planner, an agent, cuts it into pulses; a `/regenerate` says it began the moment it is sent. A \*\*\*plain change is looked at quietly, and shows only once the planner runs. Pulses are numbered within their module, as regen numbers them. `ctrl+o` expands the agents' trace alone; what finished stays a line a module. The line of keys under it - `ctrl+o to expand the trace · ctrl+h to peek at regen` - has each key breathing, fully there to a little faint and back, until it is first pressed: once `ctrl+o` has opened the trace, or the side panel has been opened, that key is still for the rest of the session and the other breathes on. What waits is not in it, and it shows no \*\*\*plain diff - the side panel has both. With nothing running it is gone.
55
+ - **The `***plain` button** turns pink and shows a spinner while turri is preparing or planning pulses, regenerating code, or running conformance. It returns to its idle colour when that work stops. Open `pulses` for progress and `notifications` for finished work; neither takes space above the editor.
56
56
  - **A pulse's change** is what its agent works from, not a text diff of the module's file: the items `<spec change>` gives the agent - only what the pulse's functional specs use, an import's items as well as the module's own, a code pulse's without the test reqs - each in the file it is written in, under its section, in the file's order (`change-view.ts`).
57
57
  - **\*\*\*plain in the chat** - a block an agent fences as ` ```plain `, or with no language around a section's header - is highlighted as a \*\*\*plain diff is, by turri's own grammar in the same colours (`src/plain-code-blocks.ts`).
58
58
  - **A \*\*\*plain diff**, in the side panel, reads as an editor shows a diff: its [\*\*\*plain](https://plainlang.org/docs/) highlighted by turri's own grammar, which started from [plyn](https://github.com/plainlang/plyn)'s - section headers, the `# <id>` heading of a functional spec or a scenario, concepts, names in backticks, text in quotes, links, the front matter - each added line filled green and each removed one red, the text on top, the fill the width of the panel ([colours](theming.md#plain-diffs)). It is shown file by file, each file's lines together under its name, with what it adds and takes out - the module being regenerated first, the rest by name, and none the diff does not change. Each line has its number in that file: a \*\*\*plain diff is of \*\*\*plain as read, with what it imports laid in, so a line is placed in the file it is written in - its links read as the parser renders them - and a removed line, in no file now, goes with the change it is part of and has no number. A line is never put in a file on a guess: one that cannot be placed is listed last, under "not found in the spec's files". Where lines of a file are not in the diff, `↕ 28 lines` says how many, as GitHub does - `↑` above the first - and names the section the lines under it are in when it is another than the one above, `↕ 28 lines · ***functional specs***`, as GitHub names a hunk's function: each section is named once.
@@ -56,7 +56,7 @@ The other rules say what a spec means. This one says what turri does with a chan
56
56
  - Bad conformance tests are fixed the same way, their code untouched: `conform` naming a functional spec whose tests are written writes them again, anew from its scenarios; `conform` from scratch takes out the tests folder at the tip of the module's chain and writes them again - from the tests of the module the tip requires, or, its whole chain, from nothing - only when the person asks for it
57
57
  - Pulses regenerate in the background: the spec can be changed while they run, and need not wait for them. A change inside what a running pulse regenerates steers it; the rest is planned again around it
58
58
  - A pulse that does not land is rolled back whole - code, tests and record together - and its module waits until the spec changes or the module is asked for again. Running it again unchanged usually ends the same way: look at why it did not land first
59
- - A finished pulse goes to the sentinel, a chat of turri's own - unless `sentinel: false`; under `sentinel: ask`, the default, only once the person said to start it, asked by turri before it first opens in a session (declined, a pulse goes to the chat that asked for it, as with `false`): it checks every pulse, in order, tests it in what was launched - a launch whose commit holds the pulse's - fixes a testing script - or where the config says the scripts are - itself and regenerates the module again, and puts anything else that is wrong to the person as a notice with what can be done. It never changes ***plain. turri installs nothing on the machine and changes none of its settings - not the sentinel, the chat, a launch or any agent: a toolchain the machine lacks is the person's to install, told the exact command. A pulse that landed is told to the chat the person is in too, only to say it landed and what the sentinel does with it, and when the sentinel is done with a pulse, what it found - the chat does nothing else about either; a pulse that went wrong is not told to it - the chat's agent is given a notice's task once the person accepts it, and does that
59
+ - A finished pulse goes to the sentinel, a chat of turri's own - unless `sentinel: false`; under `sentinel: ask`, the default, only once the person said to start it. It checks every pulse in order and tests it in a launch whose commit holds the pulse's. It can fix a testing script or its configuration and resume the module. Anything else that is wrong goes to the person as a notice with evidence and actions. The sentinel never changes ***plain. turri installs nothing on the machine and changes none of its settings: a missing toolchain is the person's to install, told the exact command. Where the surface shows notifications, finished pulses, findings and conclusions are for the person to read there. The chat does not repeat them; it answers when asked and carries out a notice's task once the person accepts it
60
60
 
61
61
  ## Where the cost is
62
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turri-dev/cli",
3
- "version": "0.4.3-next.8482fed",
3
+ "version": "0.4.3-next.a60ada5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {