@turri-dev/cli 0.4.3-next.fd01774 โ†’ 0.5.1-next.4bafdf3

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/docs/config.md CHANGED
@@ -18,7 +18,7 @@ Amazon Bedrock asks three more things, from [pi](https://pi.dev)'s catalogue: wh
18
18
 
19
19
  `--harness-model` and `--coding-model` name the two models instead, for any vendor: provider/model-id without a thinking level - `turri init-config --harness-model amazon-bedrock/global.xai.grok-4.7 --coding-model amazon-bedrock/global.xai.grok-4.6`. They are written wherever the vendor's own would be - the two models with their thinking, the commented-out `judge-model` and `models:` examples - and the vendor, maker and geography are read from them. `--judge-model` names the strong one the judging examples use, the harness model unless given. Each is checked against [pi](https://pi.dev)'s catalogue first: one it does not have, or that is not a chat model, is named, with the closest it has, and nothing is written.
20
20
 
21
- Each is written with how hard it thinks - `harness-model: openai/gpt-6-astra:medium`, `coding-model: openai/gpt-6-luna:low` - so the file shows it. `init-config` also writes and prints the three active capture tiers. On an existing config it fills in missing capture entries and preserves explicit overrides. The reviews and judges of a regeneration run on the coding model but think medium (see [models per role](#models-per-role)).
21
+ Each is written with how hard it thinks - `harness-model: openai/gpt-6-astra:medium`, `coding-model: openai/gpt-6-luna:low` - so the file shows it. The reviews and judges of a regeneration run on the coding model but think medium (see [models per role](#models-per-role)).
22
22
 
23
23
  They are an example, not a requirement - any model [pi](https://pi.dev) supports works, signed in any way [pi](https://pi.dev) supports; `other` is the starting point for another provider. What we recommend is that split, a capable model to talk to and a smaller, cheaper one for the coding. Once written, it says what to do next: the key to set in your shell - or `/login` in turri, which [pi](https://pi.dev) keeps in `~/.pi/agent/auth.json` - and that the file belongs to that folder: turri reads the nearest `config.turri.yaml` upwards from where it starts, so one written anywhere else is not seen.
24
24
 
@@ -139,9 +139,6 @@ Keys are written with dashes; underscores are read the same (`mutation_testing`)
139
139
  | `chat` | `turri`'s model - the same as `harness-model`, which it wins over |
140
140
  | `sentinel` | [the sentinel](sentinel.md): checks every finished pulse, and tests what was launched. Unnamed, the chat's model |
141
141
  | `planner` | the conversation's side: the planner's agents. Unnamed, the chat's model |
142
- | `capture-exploration` | gathers the interface reference from the original code. Claude default: Haiku low |
143
- | `capture-analysis` | checks evidence and conventions, outlines areas and features, and trials scenarios on the original. Claude default: Sonnet low |
144
- | `capture` | reasons about requirements, writes and revises \*\*\*plain and writes custom runners. Claude default: Opus medium. `init-config` writes all three active [capture tiers](capture.md#models); setting one does not change the others |
145
142
  | `diagnosis` | the diagnosis of a job that failed for good: why it did not land, and what to do. Unnamed, the coding model the job ran on, thinking medium |
146
143
  | `launch` | the launch agent - the chat's `launch`, `turri launch` and launch-after-pulse's: it follows steps - a script, a start command - so it runs on the coding model, thinking low |
147
144
  | `coding` | the coding agent, the code fixer of a conformance run and the repair agent - the same as `coding-model`, which it wins over. `--model` on the command line, or a model a call to `regenerate` or `conform` names, wins over both |
@@ -155,7 +152,7 @@ Keys are written with dashes; underscores are read the same (`mutation_testing`)
155
152
 
156
153
  What an entry leaves out it takes from `default`: `reviewer: { thinking: low }` runs the default model, thinking little. A turn limit is the role's own, else `default`'s, else `turn-limit:`, else two minutes. A module's `config.turri.<module>.yaml` lays its own `models:` over the project's, role by role - all but `chat`, the project's alone.
157
154
 
158
- A role whose thinking nothing names - neither its entry, `default`'s, nor a `:level` on the model it runs on - thinks as its kind of work needs: **low** for `coding`, `conformance`, `explorer`, `launch` and `capture-analysis`, and **medium** for `reviewer`, `test-reviewer`, `judge`, `arbiter`, `debugger`, `planner`, `capture` and `diagnosis`. Capture analysis and a judging role that falls back on the coding model take its model alone, not its thinking. The conversation keeps its own level, as [pi](https://pi.dev) sets it.
155
+ A role whose thinking nothing names - neither its entry, `default`'s, nor a `:level` on the model it runs on - thinks as its kind of work needs: **low** for `coding`, `conformance`, `explorer` and `launch`, and **medium** for `reviewer`, `test-reviewer`, `judge`, `arbiter`, `debugger`, `planner` and `diagnosis`. A judging role that falls back on the coding model takes its model alone, not its thinking. The conversation keeps its own level, as [pi](https://pi.dev) sets it.
159
156
 
160
157
  The thinking level reaches the model as each provider takes it. OpenAI's models on Bedrock are sent it as their reasoning effort (`none`, `low`, `medium`, `high`, `xhigh`) by turri itself, as [pi](https://pi.dev) sends them none.
161
158
 
@@ -14,7 +14,7 @@ npm run typecheck
14
14
  npm test
15
15
  ```
16
16
 
17
- In PowerShell set `$env:NODE_OPTIONS = '--conditions=turri-source'`. The link helper also links the core's installed pi and pi-tui into the CLI: the terminal must patch the same pi classes that own its chats. It does not change either manifest or lockfile. `npm ci` restores the release dependencies once that version is on npm. Use the source condition only with a linked checkout: the npm packages ship compiled JS and declarations, not TypeScript sources.
17
+ In PowerShell set `$env:NODE_OPTIONS = '--conditions=turri-source'`. The link helper also links the core's installed pi and pi-tui into the CLI: the terminal must patch the same pi classes that own its chats. It does not change either manifest or lockfile. `npm ci` restores the release dependencies once that version is on npm. Use the source condition only with a linked checkout: the npm packages ship compiled JS and declarations, not TypeScript sources. The banner says which core runs, under turri's version: a released one by its version alone, a checkout by its commit, its folder and whether its sources run - in the warning colour when it runs its `dist/`, which is only as new as its last build.
18
18
 
19
19
  ## Checking a change
20
20
 
@@ -31,11 +31,11 @@ npm run test:package -- ../turri-core
31
31
  | Where | What it owns |
32
32
  | --- | --- |
33
33
  | `bin/turri.mjs`, `src/cli.ts`, `src/*-cli.ts` | Node checks, argument parsing, command dispatch, printing and exit status. `regenerate`, `conform`, `launch` and `cultivate` open a session with no front end; `loop-cli.ts` prints a run from its events. |
34
- | `src/cli-root.ts`, `src/turri-versions.ts`, `src/reopen.ts` | This turri: its identity for the core (`client`), its version line, update and PATH checks, and the handoff between `turri` and the chat process after a capture. |
34
+ | `src/cli-root.ts`, `src/turri-versions.ts` | This turri: its identity for the core (`client`), its version line, update and PATH checks. |
35
35
  | `src/pi-launch.ts`, `src/extension.ts` | Prepare terminal images, open the process's session before pi's `main` and build its extension into pi. The banner and themes come from this package; the genome comes from the core. |
36
36
  | `src/terminal-view.ts`, `src/banner.ts`, `src/entry-renderers.ts` | The terminal's `Frontend` - what it shows, how it asks, its surface - drawn from the session's events; the welcome screen and transcript rendering. |
37
37
  | `src/panel-view.ts`, `src/terminal-notifications.ts`, `src/regenerate/*-view.ts`, `src/regenerate/jobs-tree.ts` | The side panel: regen, pulses, the inbox of notifications and keyboard focus. |
38
- | `src/chat-*.ts`, `src/pi-settings.ts`, `src/skill-progress.ts`, `src/capture-view.ts` | The chats on pi's screen (`sessions: external`), their stand-in UI while hidden, tabs and keys, the settings menu and progress widgets. |
38
+ | `src/chat-*.ts`, `src/pi-settings.ts`, `src/skill-progress.ts` | The chats on pi's screen (`sessions: external`), their stand-in UI while hidden, tabs and keys, the settings menu and progress widgets. |
39
39
 
40
40
  ## Publishing
41
41
 
package/docs/using.md CHANGED
@@ -7,7 +7,7 @@ cd ~/my-project
7
7
  turri
8
8
  ```
9
9
 
10
- That is [pi](https://pi.dev), with turri's tools, skills and themes loaded - `turri` alone, or with [pi](https://pi.dev)'s options (`turri -c`, `turri --harness-model <m>`). It holds several chats side by side, each working while another is shown: `/chat new` or `alt+n` opens one, `alt+1` โ€ฆ `alt+9` switch, and `turri -c` opens them all again - see [chats](chats.md). It opens with turri's own banner - the jellyfish it is named after, regenerating until the conversation fills the screen: a pixel polyp on the sea floor grows into the jellyfish - a bell from pink down to indigo, an orange gut, neon tentacles - which swims a while, sinks back to the floor, and the polyp grows again, round and round - and once the conversation fills the screen, comes to rest swimming, whole: a picture in a terminal that shows images (Kitty, Ghostty, WezTerm, Warp, iTerm2), and drawn at a third of the size in half blocks in any other, tmux included (`src/jellyfish.ts` draws it, ported from the design system's pixel kit, `scripts/jellyfish-frames.mjs` writes the pictures) - turri's version (and, run from a clone, the commit it is on, and whether the clone has changes) and where its settings are changed - and only when something is wrong, skills that failed to load or agents' commands less fenced than they should be - rather than [pi](https://pi.dev)'s startup header and resource list; `turri --verbose` shows those too. [pi](https://pi.dev)'s "Update Available" notice is left out - turri's [pi](https://pi.dev) is a pinned dependency `pi update` never touches - and the terminal's tab reads `๐Ÿชผ turri - <folder>`, not [pi](https://pi.dev)'s `ฯ€`. Talk to it: ask it to add a feature to \*\*\*plain, regenerate a module, fix a module's \*\*\*plain. It decides which skill or tool applies - but not *how* a skill runs: `cultivate` hands the work to the gated runner, which owns the steps, the gates and the judges (see [skills and gates](skills-and-gates.md)).
10
+ That is [pi](https://pi.dev), with turri's tools, skills and themes loaded - `turri` alone, or with [pi](https://pi.dev)'s options (`turri -c`, `turri --harness-model <m>`). It holds several chats side by side, each working while another is shown: `/chat new` or `alt+n` opens one, `alt+1` โ€ฆ `alt+9` switch, and `turri -c` opens them all again - see [chats](chats.md). It opens with turri's own banner - the jellyfish it is named after, regenerating until the conversation fills the screen: a pixel polyp on the sea floor grows into the jellyfish - a bell from pink down to indigo, an orange gut, neon tentacles - which swims a while, sinks back to the floor, and the polyp grows again, round and round - and once the conversation fills the screen, comes to rest swimming, whole: a picture in a terminal that shows images (Kitty, Ghostty, WezTerm, Warp, iTerm2), and drawn at a third of the size in half blocks in any other, tmux included (`src/jellyfish.ts` draws it, ported from the design system's pixel kit, `scripts/jellyfish-frames.mjs` writes the pictures) - turri's version (and, run from a clone, the commit it is on, and whether the clone has changes), the core's under it (and, a core checkout linked in, its commit, its folder and whether its sources run - see [linked development](development.md#linked-development)) and where its settings are changed - and only when something is wrong, skills that failed to load or agents' commands less fenced than they should be - rather than [pi](https://pi.dev)'s startup header and resource list; `turri --verbose` shows those too. [pi](https://pi.dev)'s "Update Available" notice is left out - turri's [pi](https://pi.dev) is a pinned dependency `pi update` never touches - and the terminal's tab reads `๐Ÿชผ turri - <folder>`, not [pi](https://pi.dev)'s `ฯ€`. Talk to it: ask it to add a feature to \*\*\*plain, regenerate a module, fix a module's \*\*\*plain. It decides which skill or tool applies - but not *how* a skill runs: `cultivate` hands the work to the gated runner, which owns the steps, the gates and the judges (see [skills and gates](skills-and-gates.md)).
11
11
 
12
12
  To start a project, just say what you want - `create a small server in Java Spring Boot` - and turri starts it in the conversation, without asking how: it takes the stack you named, or chooses one this machine can build, and says it in a line; writes the module importing the stack from the standard library, `config.turri.yaml` (conformance tests off unless you ask for them) and the unit testing script (with `implement-unit-testing-script`, unless there is one - in the background, on the coding model, while the first pulse waits for it); then the smallest thing that runs, regenerated at once, and while it regenerates the main thing you described and at most one more, on their happy path - nothing you did not describe. You say `go on`, or what to change, and every change after is \*\*\*plain it writes and regenerates (`src/new-project.ts`).
13
13
 
@@ -15,7 +15,7 @@ Peeking is safe while a question is open - a skill's or the chat's: `ctrl+h` ope
15
15
 
16
16
  While a skill runs, a line above the input shows its phases, every one by name - those done ticked, the one it is in marked, the rest to come - and where it is: the skill's name at the left edge, `phase 2 of 4` at the right, and its phases centred between them, `โœ“ intent โ”โ”โ”โ” โ ‹ stack โ”€โ”€โ”€โ”€ โ—‹ testing โ”€โ”€โ”€โ”€ โ—‹ product`. Under it, dimmed, the phase it is in and what it does: `stack - the language, frameworks, storage and architecture`. The phases are the skill's own steps, read from its `SKILL.md`. A skill of one phase, or none, has nothing to be partway through: its line is the spinner and its name alone, `โ น analyze-func-specs`.
17
17
 
18
- To bring an existing codebase under \*\*\*plain instead, `/capture` captures it into `plain/`, in the background - nothing is asked, its progress shows above the input, and once it ends turri offers to open again in `plain/`, where its report is told and `/regenerate` builds it; only you start it (see [capture](capture.md)).
18
+ To bring an existing codebase under \*\*\*plain instead, `/capture` captures it into `plain/`: the chat's agent does it there in the chat, with sub-agents to study the code, and tells you when it is done - turri opened in `plain/` then regenerates it; only you start it (see [capture](capture.md)).
19
19
 
20
20
  `genome/skills/` holds the rest: adding a feature, a concept, a requirement, a resource; splitting a functional spec that is too big; resolving conflicts; checking the environment - see [authoring \*\*\*plain](authoring-plain.md#the-skills). A skill run that is interrupted can be resumed where it stopped. A project can have skills of its own, in `.turri/skills/` or `.agents/skills/` - see [skills and gates](skills-and-gates.md#a-projects-own-skills).
21
21
 
@@ -207,7 +207,7 @@ turri conform <file.plain> --from-scratch # its tests folder taken out and wri
207
207
  turri lineage <module> # what each regeneration changed in a module, and when
208
208
  turri cultivate debug-specs # run a skill directly - by name, the project's too, or by its folder
209
209
  turri launch <file.plain> # launch what is regenerated from dist/<module>, here
210
- turri capture [path] # capture an existing codebase into ***plain, in <path>/plain - offline
210
+ turri capture [path] # capture an existing codebase into ***plain, in <path>/plain - unattended
211
211
  ```
212
212
 
213
213
  `turri cultivate` runs a skill on the project's harness model, as the chat does, unless `--model` names another: its questions asked at the terminal, and each step, artifact, judge and gate decision printed as it is made. The ones that build take `--model provider/model-id`; `regenerate` also takes `--build-dir` and `--dry-run`, which looks ahead as `pulses` does in the chat - plans the work as `regenerate` would, prints the prompt of each codebase's next pulse from that plan, and starts and writes nothing - so not with `--from-scratch` or functional specs named, which change the code or its record before anything is planned. Template directories come from `PLAIN_TEMPLATE_DIRS`. `--help` on any of them lists the rest.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turri-dev/cli",
3
- "version": "0.4.3-next.fd01774",
3
+ "version": "0.5.1-next.4bafdf3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@earendil-works/pi-coding-agent": "1.6.0",
40
40
  "@earendil-works/pi-tui": "1.6.0",
41
- "@turri-dev/core": "0.2.0"
41
+ "@turri-dev/core": "0.3.1-next.26167ca"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^24.0.0",
@@ -1,99 +0,0 @@
1
- import { basename } from "node:path";
2
- import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
3
- import { capturePhases, captureStageText } from "@turri-dev/core";
4
- import { spinner } from "./terminal-marks.js";
5
- import { skillProgressLine } from "./skill-progress.js";
6
- /** The stages whose work is counted as they start - parts, concepts, modules, scripts - rather than from the features. */
7
- const COUNTED_STAGES = new Set(["checking", "extracting", "dividing", "filling", "gathering", "reconciling", "reading", "verifying", "trying", "scripts"]);
8
- /** The phase's work, for its strip: how much there is, how much is done, how much is at work - none while it is not counted. */
9
- export function workOf(status) {
10
- if (status.stage === "capturing") {
11
- const { outlined, done } = status.features;
12
- if (outlined === 0)
13
- return undefined;
14
- const running = status.agents.filter((agent) => agent.label.startsWith("feature ")).length;
15
- return { total: outlined, done, running: Math.min(running, outlined - done) };
16
- }
17
- if (!COUNTED_STAGES.has(status.stage))
18
- return undefined;
19
- const { total, done } = status.work;
20
- if (total === 0)
21
- return undefined;
22
- return { total, done, running: Math.min(status.agents.length, total - done) };
23
- }
24
- /** `40s`, `2m 10s`, `1h 05m`. */
25
- export function duration(ms) {
26
- const seconds = Math.max(0, Math.floor(ms / 1000));
27
- if (seconds < 60)
28
- return `${seconds}s`;
29
- const minutes = Math.floor(seconds / 60);
30
- if (minutes < 60)
31
- return `${minutes}m ${String(seconds % 60).padStart(2, "0")}s`;
32
- return `${Math.floor(minutes / 60)}h ${String(minutes % 60).padStart(2, "0")}m`;
33
- }
34
- const PLAIN = { heading: (t) => t, done: (t) => t, now: (t) => t, muted: (t) => t };
35
- /** How many agents get a line each; the rest are counted on one. */
36
- const AGENT_LINES = 6;
37
- /** The widest an agent's label is padded to. */
38
- const LABEL_WIDTH = 40;
39
- /** The cells of a phase's strip, as many as the regen panel's. */
40
- const STRIP_CELLS = 24;
41
- /** The status as lines across `width`, the spinner at `frame` and the clock at `now`. */
42
- export function captureStatusLines(status, at, style = PLAIN) {
43
- const phases = skillProgressLine({ skill: `capture ${basename(status.root)}`, ...capturePhases(status), attempt: 1, frame: at.frame }, at.width, style);
44
- const work = workOf(status);
45
- const cost = status.cost > 0 ? ` ยท $${status.cost.toFixed(2)}` : "";
46
- const phase = ` ${work !== undefined ? `${workStrip(work, style)} ` : `${style.now(at.frame)} `}${captureStageText(status, work)} ${style.muted(`ยท ${duration(at.now - status.started)}${cost}`)}`;
47
- const shown = status.agents.slice(0, AGENT_LINES);
48
- const pad = Math.min(LABEL_WIDTH, Math.max(0, ...shown.map((agent) => visibleWidth(agent.label))));
49
- const agents = shown.map((agent) => {
50
- const label = visibleWidth(agent.label) > pad ? truncateToWidth(agent.label, pad, "โ€ฆ") : agent.label.padEnd(pad);
51
- const what = [agent.did, agent.now !== undefined ? style.muted(agent.now) : undefined].filter((part) => part !== undefined).join(style.muted(" ยท "));
52
- return ` ${label} ${style.muted(duration(at.now - agent.since).padStart(6))} ${what || style.muted("starting")}`;
53
- });
54
- const more = status.agents.length > shown.length ? [style.muted(` and ${status.agents.length - shown.length} more agents`)] : [];
55
- const last = status.last !== undefined ? [style.muted(` ${status.last}`)] : [];
56
- return [phases, phase, ...agents, ...more, ...last].map((line) => truncateToWidth(line, at.width, "โ€ฆ"));
57
- }
58
- /** A phase's work as the regen panel's strip draws functional specs: done, at work, waiting - in their colours. */
59
- export function workStrip(work, style, cells = STRIP_CELLS) {
60
- const parts = [
61
- { count: work.done, glyph: "โ–ˆ", paint: style.done },
62
- { count: work.running, glyph: "โ–ˆ", paint: style.now },
63
- { count: Math.max(0, work.total - work.done - work.running), glyph: "โ–“", paint: style.muted },
64
- ];
65
- let used = 0;
66
- let counted = 0;
67
- let out = "";
68
- for (const part of parts) {
69
- counted += part.count;
70
- const upTo = Math.round((counted / Math.max(1, work.total)) * cells);
71
- if (upTo > used)
72
- out += part.paint(part.glyph.repeat(upTo - used));
73
- used = Math.max(used, upTo);
74
- }
75
- return out + style.muted("โ–‘".repeat(Math.max(0, cells - used)));
76
- }
77
- /** A capture's status above the chat's input, as its `captureProgress` events tell it, until it ends. */
78
- export function captureProgress(ui) {
79
- const CAPTURE_WIDGET = "turri-capture";
80
- let status;
81
- let redrawNow;
82
- ui.setWidget(CAPTURE_WIDGET, (tui, theme) => {
83
- const redraw = setInterval(() => tui.requestRender(), 1000);
84
- redraw.unref?.();
85
- redrawNow = () => tui.requestRender();
86
- const style = {
87
- heading: (text) => theme.bold(theme.fg("accent", text)),
88
- done: (text) => theme.fg("success", text),
89
- now: (text) => theme.bold(theme.fg("accent", text)),
90
- muted: (text) => theme.fg("muted", text),
91
- };
92
- return {
93
- render: (width) => (status === undefined ? [] : captureStatusLines(status, { frame: spinner(Date.now()), now: Date.now(), width }, style)),
94
- invalidate: () => { },
95
- dispose: () => { clearInterval(redraw); redrawNow = undefined; },
96
- };
97
- });
98
- return { update(next) { status = next; redrawNow?.(); }, close() { ui.setWidget(CAPTURE_WIDGET, undefined); } };
99
- }