@turri-dev/cli 0.2.4-next.bc1fc47 → 0.2.4-next.d779410
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/README.md +5 -6
- package/dist/bedrock-region.js +3 -3
- package/dist/chat-models.d.ts +1 -1
- package/dist/chat-models.js +1 -1
- package/dist/chat-scope.d.ts +1 -3
- package/dist/chat-skills.d.ts +1 -1
- package/dist/chat-skills.js +1 -1
- package/dist/chats.d.ts +44 -10
- package/dist/chats.js +125 -41
- package/dist/cli.js +7 -24
- package/dist/config-edit.d.ts +20 -8
- package/dist/config-edit.js +32 -24
- package/dist/config.d.ts +90 -60
- package/dist/config.js +224 -117
- package/dist/conform-cli.js +1 -1
- package/dist/conformance-switch.d.ts +7 -6
- package/dist/conformance-switch.js +16 -16
- package/dist/extension.d.ts +10 -1
- package/dist/extension.js +263 -306
- package/dist/genome.js +1 -1
- package/dist/host-session.d.ts +8 -7
- package/dist/host-session.js +4 -4
- package/dist/host.d.ts +3 -1
- package/dist/host.js +3 -3
- package/dist/identity.js +2 -2
- package/dist/init-config.d.ts +1 -1
- package/dist/init-config.js +8 -8
- package/dist/launch-agent.d.ts +51 -0
- package/dist/launch-agent.js +267 -0
- package/dist/{release-cli.js → launch-cli.js} +41 -24
- package/dist/launch-session.d.ts +68 -0
- package/dist/launch-session.js +217 -0
- package/dist/launch-tools.d.ts +28 -0
- package/dist/launch-tools.js +69 -0
- package/dist/launch-track.d.ts +125 -0
- package/dist/launch-track.js +320 -0
- package/dist/loop-cli.js +4 -4
- package/dist/loop-tools.d.ts +17 -16
- package/dist/loop-tools.js +69 -69
- package/dist/notice.d.ts +7 -6
- package/dist/parse-cli.js +2 -2
- package/dist/pi-launch.js +3 -0
- package/dist/pi-settings.d.ts +4 -0
- package/dist/pi-settings.js +39 -0
- package/dist/pi.js +3 -3
- package/dist/plain/check.d.ts +1 -1
- package/dist/plain/check.js +3 -1
- package/dist/plain-files.d.ts +2 -2
- package/dist/plain-files.js +7 -7
- package/dist/regenerate/agent-env.d.ts +1 -1
- package/dist/regenerate/agent-env.js +3 -3
- package/dist/regenerate/agent-shell.js +2 -2
- package/dist/regenerate/base-folder.d.ts +2 -2
- package/dist/regenerate/base-folder.js +1 -1
- package/dist/regenerate/command-check.d.ts +7 -1
- package/dist/regenerate/command-check.js +43 -1
- package/dist/regenerate/delivery.d.ts +1 -1
- package/dist/regenerate/delivery.js +3 -3
- package/dist/regenerate/jobs.d.ts +2 -2
- package/dist/regenerate/jobs.js +10 -10
- package/dist/regenerate/launch.d.ts +154 -0
- package/dist/regenerate/{release.js → launch.js} +195 -51
- package/dist/regenerate/ledger.d.ts +33 -2
- package/dist/regenerate/lineage.d.ts +2 -0
- package/dist/regenerate/lineage.js +8 -0
- package/dist/regenerate/loop.d.ts +9 -8
- package/dist/regenerate/loop.js +43 -40
- package/dist/regenerate/model-names.d.ts +33 -0
- package/dist/regenerate/{engine.js → model-names.js} +2 -28
- package/dist/regenerate/paths.d.ts +3 -3
- package/dist/regenerate/paths.js +4 -4
- package/dist/regenerate/scripts-being-written.d.ts +4 -4
- package/dist/regenerate/scripts-being-written.js +3 -3
- package/dist/regenerate/test-scripts.d.ts +2 -1
- package/dist/regenerate/test-scripts.js +33 -23
- package/dist/regenerate/testing-steps.d.ts +6 -6
- package/dist/regenerate/testing-steps.js +8 -8
- package/dist/self-invocation.js +7 -7
- package/dist/sentinel-check.d.ts +3 -3
- package/dist/sentinel-check.js +3 -3
- package/dist/sentinel.d.ts +18 -12
- package/dist/sentinel.js +68 -42
- package/dist/{config-command.d.ts → settings.d.ts} +13 -8
- package/dist/{config-command.js → settings.js} +155 -24
- package/dist/setup.d.ts +2 -2
- package/dist/setup.js +7 -7
- package/docs/README.md +4 -4
- package/docs/chats.md +5 -6
- package/docs/claude-subscription.md +2 -2
- package/docs/config.md +58 -46
- package/docs/development.md +2 -2
- package/docs/headless.md +2 -3
- package/docs/hosting.md +20 -19
- package/docs/launch.md +67 -0
- package/docs/parser.md +2 -2
- package/docs/regenerating.md +12 -12
- package/docs/sandbox.md +3 -3
- package/docs/sentinel.md +26 -14
- package/docs/skills-and-gates.md +4 -5
- package/docs/using.md +15 -24
- package/genome/rules/project-model.md +2 -1
- package/genome/rules/turri-regeneration.md +3 -2
- package/genome/skills/implement-conformance-testing-script/SKILL.md +2 -2
- package/genome/skills/implement-unit-testing-script/SKILL.md +3 -3
- package/package.json +1 -1
- package/dist/regenerate/engine.d.ts +0 -52
- package/dist/regenerate/release.d.ts +0 -121
- package/dist/release-agent.d.ts +0 -43
- package/dist/release-agent.js +0 -130
- package/dist/release-tools.d.ts +0 -44
- package/dist/release-tools.js +0 -170
- package/dist/stacks.d.ts +0 -13
- package/dist/stacks.js +0 -96
- package/docs/deploy.md +0 -48
- /package/dist/{release-cli.d.ts → launch-cli.d.ts} +0 -0
package/docs/using.md
CHANGED
|
@@ -25,13 +25,13 @@ While a skill runs, a line above the input shows its phases, every one by name -
|
|
|
25
25
|
| `drift` | what is left to regenerate: how far the code and its conformance tests have drifted from \*\*\*plain, starting nothing |
|
|
26
26
|
| `steer` | say how the work is planned - which functional specs go together, what first - for the project or one module, for the session; the next plan follows it, beside what AGENTS.md says under a heading naming the queue |
|
|
27
27
|
| `conform` | write and run conformance tests for functional specs - now, or ahead of their code: every one tested in one conformance pulse, as far as a size guardrail lets (or one a functional spec, or a pulse each of groups you name - 1-3 and 4-6 - when you ask for that), started once every one named is regenerated. Refused while conformance tests are off: turning them on is yours, with `/conform`, and the chat tells you why it wants them |
|
|
28
|
-
| `parse` | parse \*\*\*plain - its syntax and structure, never its code or tests - regenerating nothing - a module whose functional specs have scenarios but which has no test reqs, or no conformance testing script
|
|
29
|
-
| `
|
|
28
|
+
| `parse` | parse \*\*\*plain - its syntax and structure, never its code or tests - regenerating nothing - a module whose functional specs have scenarios but which has no test reqs, or no conformance testing script, passes with a warning naming the next step (see [the steps of adding tests](regenerating.md#the-steps-of-adding-tests)) |
|
|
29
|
+
| `settings` | read the project's settings, or change one when you ask - "regenerate with gpt 5.5 from now on" sets `coding-model` - see [below](#choosing-a-model) and [changing it from the chat](config.md#changing-it-from-the-chat) |
|
|
30
30
|
| `pulses` | pulses in every tense: this session's - finished, running and planned - and the last runs of earlier sessions (`runs` for more), or one of them - a finished one with what the [ledger](#the-ledger) recorded of it: its rounds, test runs, verdicts, healers and commits; one that did not land says why besides, from its transcript: its diagnosis, the stages that went wrong, the last failing test run, the last review, the tool calls that failed. With a module's `plain_file`, a look ahead: its work planned as `regenerate` plans it - the steering with it - and kept, nothing started, its pulses waiting for `regenerate`, `conform` or `/regenerate`, which runs that plan as it is unless the \*\*\*plain or the steering changed since. A planned row's id (`planned-<module>-1`) then gives its cases and - the next pulse of its codebase - the whole prompt its coding agent will get |
|
|
31
|
-
| `halt` | halt a pulse, a module's planned pulses, or what
|
|
31
|
+
| `halt` | halt a pulse, a module's planned pulses, a launch, or what a launch started |
|
|
32
32
|
| `doctor` | turri's self check, as `turri doctor` runs it: Node, bash, git, the OS sandbox, a model provider, and the project's toolchains and testing scripts - against the PATH turri's pulses run with, not the agent's shell's. The project's models are asked for a word only when you ask (a request a model); it changes nothing |
|
|
33
33
|
| `cultivate` | run a gated skill, its steps and review gates enforced |
|
|
34
|
-
| `
|
|
34
|
+
| `launch` | try what is regenerated: launched in the background from `dist/<module>` - or as the project's guidance says - on this machine, installing what it needs; told when it is up - see [launch](launch.md) |
|
|
35
35
|
| `ask_user` | put a question to you as a dialog to pick from - several at once, each a box you tick and untick, "Something else…" to type, or "Chat about this" to talk it over first; Esc in either goes back to the options |
|
|
36
36
|
| `web_search`, `web_fetch` | search the web and read a page as text - documentation, an API, an error; `curl` and the like run in its `bash` |
|
|
37
37
|
|
|
@@ -76,18 +76,17 @@ A regeneration takes minutes, so in the TUI every tool that regenerates starts t
|
|
|
76
76
|
|
|
77
77
|
`ctrl+h` again, or `esc`, closes it and goes back to the chat. Beside the chat, one side has the keys and the other is drawn faint: `ctrl+h` switches sides - from the chat to the panel, from the panel to the chat, the panel staying and following the pulses - `esc` gives the chat the keys too, and a click gives them to the side clicked. `ctrl+c` closes the panel; so do `s`, over the whole screen, then `esc`. ([pi](https://pi.dev)'s regular screen, `--tui-mode regular`, reads no mouse: there it is the keys alone.) While the panel has the keys, every key is the panel's, whatever else happens: a question the chat model asks in the background (`ask_user`) waits in the chat, unanswered - an `enter` in the panel never answers it - and the panel's top line says "the chat is waiting for your answer". Back in the chat, the question is there, with the keys.
|
|
78
78
|
- `turri` runs [pi](https://pi.dev) in fullscreen mode, so the conversation stays where you scroll it while the pulses redraw (PgUp/PgDn, the wheel); `--tui-mode regular` goes back to the terminal's own scrollback.
|
|
79
|
-
- **`/
|
|
79
|
+
- **`/settings`** changes a setting of the project's `config.turri.yaml` - the models, review, conformance tests, any key - and says when it takes effect: now, at your next message, or at the next pulse; never only after a restart. It takes [pi](https://pi.dev)'s own `/settings` over, pi's menu the last entry of its list. See [changing it from the chat](config.md#changing-it-from-the-chat).
|
|
80
80
|
- **`/sentinel`** says whether the [sentinel](sentinel.md) checks every pulse that finishes: `ask` - you are asked before it first opens in a session - `on`, or `off`; written to `config.turri.yaml`.
|
|
81
|
-
- **`/
|
|
82
|
-
- **`/regenerate [module | file.plain] [module:func-id ...] [from scratch [whole chain]] [how to cut the work]`** regenerates a module from its \*\*\*plain as it is now, as the `regenerate` tool does: what is left to regenerate is planned into pulses - one functional spec at a time, a few together or the whole module in one, as the planner judges - and the first starts. Words after the module are guidance for that plan (`/regenerate app models first`). A module's name typed with spaces for its underscores is that module - `/regenerate d365_function executor` is `d365_function_executor`. With no module named: the one `module:` in `config.turri.yaml` names, else the folder's top modules, to pick from. Asked for from scratch - `from scratch`, `start over`, `delete the module` - it starts at once, with nothing to confirm: it deletes the module's code and conformance tests in every codebase where they live, committed so `/lineage` keeps them, and regenerates the whole module from its \*\*\*plain, built though nothing in it changed: `/regenerate shorty from scratch`. The modules below it keep their code, and the module starts again from a copy of the code below it. Asked for its chain too - `/regenerate shorty from scratch, the whole chain` - the code of every module of its requires chain is deleted, the base's included, and the whole chain is regenerated from the bottom: what to do after modules were split, merged or moved, when the code below was laid out for modules that are no more. The chat's `regenerate` does the same with `from_scratch: "module"` or `"chain"`, when you ask for it; `turri regenerate --from-scratch` or `--from-scratch-chain` on the command line, not with `--dry-run`. Functional specs named after the module, each as `<module>:<func-id>` - `/regenerate shorty shorty:shorten shorty:expand` - are regenerated though their \*\*\*plain did not change, on the model chosen for functionalities: as `turri regenerate shorty.plain shorty:shorten shorty:expand` does, and the chat's `regenerate` with `funcIds`. A bare func-id is refused: the module is always named. Code built before functional specs had func-ids - its record numbers them - is never built on: the module's whole chain has to be regenerated from scratch, and the chat asks you first, as for a start over.
|
|
81
|
+
- **`/regenerate [module | file.plain] [module:func-id ...] [from scratch [whole chain]] [how to cut the work]`** regenerates a module from its \*\*\*plain as it is now, as the `regenerate` tool does: what is left to regenerate is planned into pulses - one functional spec at a time, a few together or the whole module in one, as the planner judges - and the first starts. Words after the module are guidance for that plan (`/regenerate app models first`). A module's name typed with spaces for its underscores is that module - `/regenerate d365_function executor` is `d365_function_executor`. With no module named: the one `module:` in `config.turri.yaml` names, else the folder's top modules, to pick from. Asked for from scratch - `from scratch`, `start over`, `delete the module` - it starts at once, with nothing to confirm: it deletes the module's code and conformance tests in every codebase where they live, committed so `/lineage` keeps them, and regenerates the whole module from its \*\*\*plain, built though nothing in it changed: `/regenerate shorty from scratch`. The modules below it keep their code, and the module starts again from a copy of the code below it. Asked for its chain too - `/regenerate shorty from scratch, the whole chain` - the code of every module of its requires chain is deleted, the base's included, and the whole chain is regenerated from the bottom: what to do after modules were split, merged or moved, when the code below was laid out for modules that are no more. The chat's `regenerate` does the same with `from_scratch: "module"` or `"chain"`, when you ask for it; `turri regenerate --from-scratch` or `--from-scratch-chain` on the command line, not with `--dry-run`. Functional specs named after the module, each as `<module>:<func-id>` - `/regenerate shorty shorty:shorten shorty:expand` - are regenerated though their \*\*\*plain did not change, on the coding model: as `turri regenerate shorty.plain shorty:shorten shorty:expand` does, and the chat's `regenerate` with `funcIds`. A bare func-id is refused: the module is always named. Code built before functional specs had func-ids - its record numbers them - is never built on: the module's whole chain has to be regenerated from scratch, and the chat asks you first, as for a start over.
|
|
83
82
|
- **`/conform [module | file.plain] [module:func-id ...] [from scratch [whole chain]] [one by one]`** writes and runs a module's conformance tests now, as the `conform` tool does: those of the functional specs named, each as `<module>:<func-id>` - `/conform shorty shorty:shorten shorty:expand` - or, with none named, of every functional spec with scenarios. A functional spec named whose tests are written has them written again, deleted and written anew from its scenarios; `from scratch` takes out the tests folder where the module's code lives - the tip of its chain, never a module in the middle - its lineage keeping it, and writes the tests again from a copy of the tests of the module the tip requires; `from scratch, whole chain`, from nothing. None of it touches the code ([written again](regenerating.md#conformance-tests-in-the-work-loop)). They go in one pulse, as far as a size guardrail lets; `one by one` (or `separately`, `one at a time`) has a pulse a functional spec. No other words are taken: there is no plan to guide. The module is found as `/regenerate` finds it. Asking for them is asking for them on: with conformance tests off, `/conform` turns them on first - `conformance-tests: true`, written where the module's value comes from - and says so: the one way the chat's work has them turned on, as the `conform` tool is refused while they are off. What would start nothing is found from the \*\*\*plain before anything is said - no scenarios, a functional spec named that is not there or has none, a step of adding tests skipped (no test reqs, no conformance testing script) - and turri answers it at once in the chat. What is missing that turri can write - the test reqs, the conformance testing script, the scenarios of the functional specs named, or of each one that needs them - it writes at once, without asking again: your `/conform` was the yes. Then it regenerates the module, and says what it wrote and why. What is yours to settle - a functional spec named that is not there - it tells you, starting nothing. Its tests come before anything is built on it: a codebase built on the module is stopped and deleted, and regenerated from it once they pass. Tests written already for the scenarios as built are said to be, and nothing starts.
|
|
84
|
-
- **`/halt <id>`** halts a pulse - a queued one never starts - **`/halt <module>`** (or a planned row's id) halts a module's planned pulses until you ask for it again, a \*\*\*plain change not starting it, and **`/halt
|
|
85
|
-
- **What these commands show you, the chat knows.** What `/regenerate`, `/conform` and `/halt
|
|
83
|
+
- **`/halt <id>`** halts a pulse - a queued one never starts - **`/halt <module>`** (or a planned row's id) halts a module's planned pulses until you ask for it again, a \*\*\*plain change not starting it, and **`/halt launched <name>`** halts a server a launch started - **`/halt launched <module>`** the module's launch under way, the one waiting, and what it started; it lists them all when no id is given.
|
|
84
|
+
- **What these commands show you, the chat knows.** What `/regenerate`, `/conform` and `/halt launched` tell you - \*\*\*plain that does not parse, the pulses planned, a server halted - stays in the chat under the command, and since a slash command runs outside the conversation, it is put in the conversation as well: say "fix it" next and turri knows what you are looking at. When `/conform` starts nothing, turri answers it at once - writing what it can of what is missing, and saying why for the rest. Once `/regenerate` or `/conform` has started pulses, turri says so in the chat too - what runs and what is planned, and that you need not wait for it - without starting anything more for it; a module already up to date gets the plan's answer alone. A halted pulse reaches it as every pulse's end does.
|
|
86
85
|
- **Nothing is queued.** What is left to build is worked out from what each codebase is built from and \*\*\*plain as it is now - again whenever a pulse ends or \*\*\*plain changes - and the first pulse of it runs; see [a whole module](regenerating.md#a-whole-module). Changes that overlap never pile up: the next pulse builds \*\*\*plain as it is. The pulses planned after the one running are listed behind it, as queued, and so is each module waiting for the one it is built on - "waits for base" - until it can be planned. A change inside what the running pulse regenerates - a functional spec it regenerates reworded or given a sub-bullet, a definition or req it is given, a file they link - steers it: its agent is told, and it lands \*\*\*plain as it is now there, twice a pulse at most. Otherwise a pulse building something \*\*\*plain no longer wants is stopped and rolled back - unless `allow-to-stop-jobs: false` in `config.turri.yaml`, which has it land first and the change regenerated on top. To drop something, take it out of \*\*\*plain - one \*\*\*plain diff. Stopping a pulse leaves its change in \*\*\*plain: the codebase waits until its \*\*\*plain changes or it is asked for again.
|
|
87
86
|
- **A change to a module below** is made in the codebase at the tip of the chain, where its code lives; the codebase below is left as it was, and is brought up to its own \*\*\*plain only when a new module is to start from it. \*\*\*plain moved into a module the code was not built on stops the codebase: no change to its code brings that module in, so it has to be started over - its code and conformance tests taken out, kept in its history, and built again from the bottom of the chain. That is never done unasked: the chat asks you, saying why, and regenerates it from scratch once you agree; on the command line `turri regenerate` asks at the terminal, and `--start-over` agrees in advance.
|
|
88
87
|
- **Conformance tests are a track of their own.** A code pulse lands once its unit tests pass and are reviewed. Then, before the next one builds on it, a conformance pulse writes and runs the tests of what it built - the scenarios of its functional specs, by the test reqs - with the whole suite the module inherits, and, where one fails, fixes the test or the code, whichever is wrong; what they are written for is recorded in `tests/.turri.json`. A functional spec with no test plain file, or an empty one, gets none: to have it tested, ask for conformance tests - or, with them on, the chat writes scenarios itself for a functional spec it judges needs them (when an incorrect implementation could give output that looks right but is wrong, when two reasonable readings of its text answer some input differently, or when a bug would be costly - money, security, data, users' trust) - either way the chat writes its scenarios with its file tools and calls `regenerate`, and the loop tests them once the code is built. `conform` runs them now, for a module or some of its functional specs. A conformance pulse that does not pass is undone whole and halts the conformance tests alone: the code goes on being built.
|
|
89
88
|
- **A pulse that fails** - its work errors, or it does not pass - is run once more; one stopped on what only you can fix - the machine lacks something, a testing script no code could pass - is not. Failing again, it stops, and so does every pulse queued behind it on the same module, without running - the other modules' pulses go on. The harness then works out why: an agent that can read the project's \*\*\*plain, code, tests, testing scripts and logs, and turri's own source, skills and rules, says what happened, why, whether the fix belongs in \*\*\*plain, the environment, the code or turri itself, and exactly what to do.
|
|
90
|
-
- **When a pulse finishes** the transcript shows its line - `✓`, `✗` or `■`, its module, kind and number, how long it took and what it cost, never what it regenerated - `✓ shorty · conformance pulse 4 finished after 3m 47s · 488.6k tok · $0.02` - and the chat, which gets its whole report, reacts then and there, whatever else is running or queued, without waiting for you to speak: at once when it is idle, else as soon as the reply it is in ends. It does what the project's guidance says to do when a pulse finishes -
|
|
89
|
+
- **When a pulse finishes** the transcript shows its line - `✓`, `✗` or `■`, its module, kind and number, how long it took and what it cost, never what it regenerated - `✓ shorty · conformance pulse 4 finished after 3m 47s · 488.6k tok · $0.02` - and the chat, which gets its whole report, reacts then and there, whatever else is running or queued, without waiting for you to speak: at once when it is idle, else as soon as the reply it is in ends. It does what the project's guidance says to do when a pulse finishes - launch what was built, say - or tells you what finished and what it means. Ask to try it ("let me try it") and the chat launches what is built: in the background, from `dist/<module>`, on your machine, even while other pulses run - you are told where it runs once it is up. See [launch](launch.md). The chat reacts to it then and there, whatever else is running or queued, without waiting for you to speak - at once when it is idle, else as soon as the reply it is in ends: it does what the project's guidance says to do when a pulse finishes (launch what was built, say), or tells you in a line or two what finished.
|
|
91
90
|
- **When a pulse stops** - a gate still failing after 20 attempts - it says where it stopped, why in plain words, and what to change in \*\*\*plain - which section, and how. Running the same build again picks up from there.
|
|
92
91
|
|
|
93
92
|
In `print`, `json` and `rpc` modes the process ends when the answer is written, so the tools wait for the work there instead. Pulses live in memory for the session; the work itself is on disk.
|
|
@@ -96,7 +95,7 @@ In `print`, `json` and `rpc` modes the process ends when the answer is written,
|
|
|
96
95
|
|
|
97
96
|
The chat reads the project's `config.turri.yaml` afresh every turn and follows it: its agent is told what it sets, and the tools that regenerate default to it - `module` when you ask to build without naming one, `coding-model` for what regenerations run on, and the testing scripts. `harness-model` is what `turri` starts on. What you ask for in the conversation wins. Every key, what happens without it, and how the models inherit: [the project config](config.md).
|
|
98
97
|
|
|
99
|
-
A project whose parts are on different stacks gives
|
|
98
|
+
A project whose parts are on different stacks gives a module its own `config.turri.<module>.yaml` beside `config.turri.yaml` - `config.turri.backend.yaml`, `config.turri.frontend.yaml` - with its testing scripts, models and conformance over the project's, for that module and every module built on it that has no file of its own. Nobody chooses it: a backend and a frontend are each built with their own, side by side. The chat is told each module's file. See [a module's own config](config.md#a-modules-own-config).
|
|
100
99
|
|
|
101
100
|
A project with only a `config.yaml` - turri's file before it had its own name, or another tool's - is read from it until turri first writes a setting, which copies it to `config.turri.yaml`; see [the old config.yaml](config.md#the-old-configyaml).
|
|
102
101
|
|
|
@@ -117,19 +116,11 @@ judge-model:
|
|
|
117
116
|
|
|
118
117
|
Each may leave out either part, and a bare string (`coding-model: provider/id`, or `provider/id:high`) is a model alone. What one leaves out it takes from the one it inherits from: the judge model from the coding model, the coding model from the harness model - so with only a harness model, everything runs on it.
|
|
119
118
|
|
|
120
|
-
On the command line, `turri --harness-model <m> --coding-model <m>` wins over them ([pi](https://pi.dev)'s own `--model` works for the harness model too), and in the conversation [pi](https://pi.dev)'s `/model` changes the harness model and `
|
|
119
|
+
On the command line, `turri --harness-model <m> --coding-model <m>` wins over them ([pi](https://pi.dev)'s own `--model` works for the harness model too), and in the conversation [pi](https://pi.dev)'s `/model` changes the harness model and the `settings` tool, below, the coding model. `model:`, from before there were two, is read as `coding-model`. With neither, regenerations run on the conversation's model.
|
|
121
120
|
|
|
122
|
-
Every regeneration runs on the coding model unless you say otherwise. Say it in words - "regenerate
|
|
121
|
+
Every regeneration runs on the coding model unless you say otherwise. Say it in words - "regenerate with gpt 5.5 from now on", "use Claude for the code" - and the agent's `settings` tool writes `coding-model` into `config.turri.yaml`, from the next pulse on, in every [chat](chats.md) and the sessions after; a module's own model goes in its own file. Pulses already queued keep the model they were queued with. For one regeneration alone - "regenerate this on Gemini 3.6 Flash" - the agent passes the model to `regenerate` or `conform` instead, and the config stays as it was.
|
|
123
122
|
|
|
124
|
-
|
|
125
|
-
| --- | --- |
|
|
126
|
-
| \*\*\*plain changes | \*\*\*plain diff pulses |
|
|
127
|
-
| functionalities | a functionality or a whole module regenerated, functionalities regenerated again, conformance |
|
|
128
|
-
| everything | both |
|
|
129
|
-
|
|
130
|
-
It works mid-interview as well: the skill's agent has the same tool. Pulses already queued keep the model they were queued with; `"chat"` drops the session's choice, back to the default coding model - `--coding-model`, `config.turri.yaml`, or the conversation's. `/engine` shows what each kind of work runs on. A tool that regenerates can also be given a model for one call.
|
|
131
|
-
|
|
132
|
-
Names are resolved strictly, because [pi](https://pi.dev)'s own matching guesses and says nothing ("gpt-5" can land on a Bedrock model you have no key for). An exact `provider/model-id` is taken as it is. A looser name is taken when it fits exactly one model you have credentials for, or is exactly one model's id in other words ("gpt 5.5" is `openai/gpt-5.5`, not `gpt-5.5-pro`). Anything else comes back as a short list and the agent asks you which one; a model whose provider has no credentials is never picked.
|
|
123
|
+
Names are resolved strictly, because [pi](https://pi.dev)'s own matching guesses and says nothing ("gpt-5" can land on a Bedrock model you have no key for). An exact `provider/model-id` is taken as it is. A looser name is taken when it fits exactly one model you have credentials for, or is exactly one model's id in other words ("gpt 5.5" is `openai/gpt-5.5`, not `gpt-5.5-pro`). Anything else comes back as a short list and the agent asks you which one - nothing is written meanwhile; a model whose provider has no credentials is never picked.
|
|
133
124
|
|
|
134
125
|
To change [pi](https://pi.dev)'s own default, in `~/.pi/agent/settings.json`:
|
|
135
126
|
|
|
@@ -141,7 +132,7 @@ A provider failure - no credits, bad key, rate limit - is raised with the provid
|
|
|
141
132
|
|
|
142
133
|
### Models from a pi extension
|
|
143
134
|
|
|
144
|
-
A provider a [pi](https://pi.dev) extension registers - a Claude subscription through Claude Code ([pi-claude-code](https://github.com/earendil-works/pi-claude-code), `claude-code/...`, see [a Claude subscription](claude-subscription.md)), your company's own LLM gateway - works everywhere turri needs a model. Install the extension with `turri install <source>` - pi's own `install`, run by the pi inside turri, so no `pi` of your own is needed; `turri list`, `turri update <source>` and `turri remove <source>` are pi's too - and name its models in `config.turri.yaml` as any. In the chat, pi loads it, and every agent the conversation starts is given the providers the conversation's extensions registered, as they are when it starts - the agents themselves load no extensions, which would load a second copy of turri. A run with no conversation - `turri regenerate`, `turri conform`, `turri
|
|
135
|
+
A provider a [pi](https://pi.dev) extension registers - a Claude subscription through Claude Code ([pi-claude-code](https://github.com/earendil-works/pi-claude-code), `claude-code/...`, see [a Claude subscription](claude-subscription.md)), your company's own LLM gateway - works everywhere turri needs a model. Install the extension with `turri install <source>` - pi's own `install`, run by the pi inside turri, so no `pi` of your own is needed; `turri list`, `turri update <source>` and `turri remove <source>` are pi's too - and name its models in `config.turri.yaml` as any. In the chat, pi loads it, and every agent the conversation starts is given the providers the conversation's extensions registered, as they are when it starts - the agents themselves load no extensions, which would load a second copy of turri. A run with no conversation - `turri regenerate`, `turri conform`, `turri launch` and the rest - loads the installed extensions itself, once, as pi loads them, and keeps only the providers they register; so do `turri doctor` and `turri init-config`, which check a model against them. An older turri that installed itself into every pi is among them, and is loaded as nothing.
|
|
145
136
|
|
|
146
137
|
## Module history
|
|
147
138
|
|
|
@@ -209,7 +200,7 @@ turri conform <file.plain> app:add-task # black-box tests for one functional s
|
|
|
209
200
|
turri conform <file.plain> --from-scratch # its tests folder taken out and written again; --from-scratch-chain, from nothing
|
|
210
201
|
turri lineage <module> # what each regeneration changed in a module, and when
|
|
211
202
|
turri cultivate debug-specs # run a skill directly - by name, the project's too, or by its folder
|
|
212
|
-
turri
|
|
203
|
+
turri launch <file.plain> # launch what is regenerated from dist/<module>, here
|
|
213
204
|
```
|
|
214
205
|
|
|
215
206
|
`turri cultivate` runs a skill on the project's harness model, as the chat does, unless `--model` names another. 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.
|
|
@@ -33,7 +33,8 @@ Follow `module-structure.md`, `import-modules.md` and `linked-resources.md` for
|
|
|
33
33
|
|
|
34
34
|
- Settle a decision, write it into the config in the same step - never leave it to be inferred from what is on disk. A testing script you write or keep is named by its key, by path from the root (`unittests-script: test_scripts/run_unittests_python.sh`)
|
|
35
35
|
- Change only the keys you settled. Where the file has a key's example commented out, uncomment that line and set it; keep every other line and comment as it is
|
|
36
|
-
- A project whose parts are on different stacks
|
|
36
|
+
- A project whose parts are on different stacks gives a module its own `config.turri.<module>.yaml` beside it, with that module's scripts - it builds the module and every module built on it that has no file of its own; what they share stays in `config.turri.yaml`. Name the file after the module at the bottom of the chain it builds - two files among the modules one requires is an error
|
|
37
|
+
- In the conversation, a setting is changed with the `settings` tool, which checks what it writes; an agent without it writes the key in the file itself
|
|
37
38
|
- A project with only a `config.yaml` has it copied to `config.turri.yaml` first, and each `config.<name>.yaml` to `config.turri.<name>.yaml`; `config.yaml` may be another tool's, and is never written
|
|
38
39
|
- Say in your summary which lines you wrote
|
|
39
40
|
|
|
@@ -31,7 +31,8 @@ The other rules say what a spec means. This one says what turri does with a chan
|
|
|
31
31
|
- Test reqs and scenarios - a functional spec's conformance and acceptance scenarios, in its test plain file - reach the conformance tests only, never the code. A scenario changed alone regenerates no code
|
|
32
32
|
- A functional spec regenerated again by name has its code taken out and built anew - never left as it was, even where it already does what the spec says; a pulse that changes nothing does not land. Its conformance tests, when it has them, are run on its new code once it lands: those that pass are kept as they are; one that fails is judged against the spec - what it checks that the spec leaves open, a path, a field, a message the old code chose, goes by the new code
|
|
33
33
|
- What is conformance tested is the scenarios: each conformance and acceptance scenario of a functional spec gets at least one test, and nothing else is tested - a functional spec with no test plain file, or an empty one, has no conformance tests. Its tests are written or changed once its code lands, whenever a scenario is added, changed or taken out, its text changes, it is regenerated again or taken out; one whose scenarios are all taken out loses its tests. It goes scenario by scenario, by scenario-id: a scenario added gets its tests, one changed has them rewritten, one taken out loses them, and an unchanged one keeps them - run on the new code when the functional spec's code changed. A scenario-id renamed with its text as it was has its tests relabelled, nothing rewritten; renamed with any other change, or moved between conformance and acceptance, it is one taken out and one added. To have something checked end to end, write it as a scenario
|
|
34
|
-
- Scenarios are tested only once the module has test reqs - its own, or the stack's conformance template imported - and the project has a conformance testing script for
|
|
34
|
+
- Scenarios are tested only once the module has test reqs - its own, or the stack's conformance template imported - and the project has a conformance testing script for it. For a module another requires, that is the tip of the chain: its conformance tests are written there, from the tip's test reqs, so the template goes into the tip. Without either, turri starts no conformance pulse there, by itself or from `conform`: it refuses, naming the step missing, the module waits on it until the `.plain` files or the scripts change, and `turri parse` warns. Take the steps in order - test reqs, the script, then the scenarios - and a module with no scenarios needs neither
|
|
35
|
+
- A module is built with `config.turri.yaml` and, laid over it, its own `config.turri.<module>.yaml` - else the one of a module it requires, all the way down: a module is built on their code, with their testing scripts. Nobody chooses it. Two modules it requires with a file of their own, and none of its own, is an error `turri parse` reports and `regenerate` refuses: give the module its own file, or keep one of theirs. Only `requires` counts, not `import`
|
|
35
36
|
- Definitions moved to a common module and reqs reordered are recorded, not regenerated
|
|
36
37
|
- A functional spec written on its happy path and hardened later - its validation, edge cases and errors added to it - is patched in place each time: growing a spec a step at a time costs no more than writing it whole up front
|
|
37
38
|
- A module's first pulse, when it builds one functional spec - the project set up and the smallest thing that runs - lands on its unit tests with no review
|
|
@@ -55,7 +56,7 @@ The other rules say what a spec means. This one says what turri does with a chan
|
|
|
55
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
|
|
56
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
|
|
57
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
|
|
58
|
-
- 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
|
|
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
60
|
|
|
60
61
|
## Where the cost is
|
|
61
62
|
|
|
@@ -212,7 +212,7 @@ The harness never runs `.ps1` scripts. These notes apply only to an optional cop
|
|
|
212
212
|
4. Pick the right row from the [Dependency isolation](#dependency-isolation) table — use the same flag/env var in steps 7, 7b and 8 — and the checks from [Static checks of the tests](#static-checks-of-the-tests).
|
|
213
213
|
5. Add the language-appropriate "no tests discovered" guard from [No tests discovered detection](#no-tests-discovered-detection), and the guard against conformance tests in the build folder from [Tests in the build folder](#tests-in-the-build-folder).
|
|
214
214
|
6. Save the new script as `test_scripts/run_conformance_tests_<lang>.sh` and `chmod +x` it. Write a `.ps1` copy only if the user wants to run it by hand on Windows.
|
|
215
|
-
7. **Make sure turri finds the script.** Do not link it from the ***plain - turri finds the conformance testing script in the project root (the folder that holds `plain_modules/`) and puts it, whole, into the prompts of the agents that write and review the conformance tests itself, whenever conformance tests are written for a build; a link to it from the ***plain is ignored. It looks, in order, at `config.turri.yaml` in the root (`conformance-tests-script: <path relative to the root>`) - with the
|
|
215
|
+
7. **Make sure turri finds the script.** Do not link it from the ***plain - turri finds the conformance testing script in the project root (the folder that holds `plain_modules/`) and puts it, whole, into the prompts of the agents that write and review the conformance tests itself, whenever conformance tests are written for a build; a link to it from the ***plain is ignored. It looks, in order, at `config.turri.yaml` in the root (`conformance-tests-script: <path relative to the root>`) - with the module's own `config.turri.<module>.yaml` over it - or the one of a module it requires - then for the one `run_conformance_tests*.sh` in the root, then for the one in `test_scripts/`. Saving the script in `test_scripts/` (or the root) is enough when it is the only one there. If the project keeps it elsewhere, name it in `config.turri.yaml` as `conformance-tests-script:` - and when the project has only a `config.yaml`, copy it to `config.turri.yaml` first (and each `config.<name>.yaml` to `config.turri.<name>.yaml`) and edit the copy; `config.yaml` may be another tool's, and is never written. If the project has modules on different stacks - e.g. a Python backend and a React frontend side by side, sharing only an imported module - each part names its own script in a file of its own beside `config.turri.yaml`: `conformance-tests-script:` in `config.turri.backend.yaml` for `backend.plain`, in `config.turri.frontend.yaml` for `frontend.plain`. A module's file builds it and every module built on it that has no file of its own, so name it after the module at the bottom of the chain - `config.turri.backend.yaml` builds `backend_auth.plain`, which requires `backend.plain`, too - and turri works it out with nothing to choose; two files among the modules one requires is an error. turri never guesses between two. The script is required: without one, no conformance or acceptance test is written or run. The `***test reqs***` still describe the conformance framework and command in words; do not paraphrase the script into them.
|
|
216
216
|
|
|
217
217
|
## Anti-Patterns
|
|
218
218
|
|
|
@@ -235,5 +235,5 @@ The harness never runs `.ps1` scripts. These notes apply only to an optional cop
|
|
|
235
235
|
- **Don't ship only a `.ps1`.** The harness runs `.sh` scripts only; a project with just a PowerShell runner has no conformance testing script as far as turri is concerned.
|
|
236
236
|
- **Don't install dependencies into the user's global location** (`~/.m2`, system-wide `pip`, `~/.cargo`, etc.). Always isolate inside `$WORKING_FOLDER` so concurrent runs and other projects can't interfere.
|
|
237
237
|
- **Don't run the test command without first verifying the install succeeded.** A failed install followed by a "test" run produces misleading errors that look like test failures.
|
|
238
|
-
- **Don't link the script from the ***plain, and don't leave turri guessing.** turri finds the script in `config.turri.yaml`, the project root, or `test_scripts/`, shows it to the agents that write the conformance tests itself, and writes or runs no conformance test without it; a link to it from the ***plain is ignored. Put it where it is found, and when there are two conformance testing scripts in one folder, name the one to use as `conformance-tests-script:` - in each
|
|
238
|
+
- **Don't link the script from the ***plain, and don't leave turri guessing.** turri finds the script in `config.turri.yaml`, the project root, or `test_scripts/`, shows it to the agents that write the conformance tests itself, and writes or runs no conformance test without it; a link to it from the ***plain is ignored. Put it where it is found, and when there are two conformance testing scripts in one folder, name the one to use as `conformance-tests-script:` - in each module's own `config.turri.<module>.yaml` when they are for parts on different stacks (see Workflow step 7).
|
|
239
239
|
- **Don't write a terse script.** Silent steps, `>/dev/null` redirects on the install output, missing `--version` prints, absent step banners, an un-logged resolved `$2`, and a missing final summary all make the script harder to debug than the tests it is running. Follow the *Logging — be as verbose as possible* rule under [Conventions](#conventions) literally: every step announces itself, every command is echoed, the resolved `$CONFORMANCE_TESTS_FOLDER` is printed, every failure prints what was about to run and where, and the final summary names the test command, exit code, and working folder.
|
|
@@ -138,12 +138,12 @@ Notes:
|
|
|
138
138
|
|
|
139
139
|
## Workflow
|
|
140
140
|
|
|
141
|
-
1. Take the target **language**, **test framework** and **dependency manifest** (`pom.xml`, `requirements.txt` / `pyproject.toml`, `package.json`, `go.mod`, `Cargo.toml`, ...) from the module the script is for: its stack - the `stdlib/...` template it imports - its implementation reqs, and the project. You run in the background, with nobody to ask: decide what they leave open, the choice most consistent with them, and say what you decided in your result. The script is Bash; a PowerShell copy only when the context asks for one. When `config.turri.yaml` - or the
|
|
141
|
+
1. Take the target **language**, **test framework** and **dependency manifest** (`pom.xml`, `requirements.txt` / `pyproject.toml`, `package.json`, `go.mod`, `Cargo.toml`, ...) from the module the script is for: its stack - the `stdlib/...` template it imports - its implementation reqs, and the project. You run in the background, with nobody to ask: decide what they leave open, the choice most consistent with them, and say what you decided in your result. The script is Bash; a PowerShell copy only when the context asks for one. When `config.turri.yaml` - or the module's own `config.turri.<module>.yaml` - names a `base-folder:`, the module's code starts as a copy of that folder: an existing codebase to build on, or only files to use. Read it. When it holds code with its own test setup - a `pytest.ini` or `pyproject.toml` test section, `package.json` test scripts, a `pom.xml`, a `go.mod` - the script runs that setup's tests as they run there, beside the tests the coding agents write, so they keep passing; its existing dependency manifest is the one to install from. A folder of assets alone changes nothing.
|
|
142
142
|
2. Read [assets/run_unittests_java.sh](assets/run_unittests_java.sh) to refresh the exact structure.
|
|
143
143
|
3. Translate each of the eight steps above into the equivalent commands for the target language **and** shell. The toolchain check, dependency install, static checks and test invocation are the language-specific parts; the rest is mechanical translation between Bash and PowerShell syntax.
|
|
144
144
|
4. Pick the dependency-isolation mechanism from the [Dependency isolation](#dependency-isolation) table and use it consistently in steps 6, 7 and 8, and the checks from the [Static checks](#static-checks) table.
|
|
145
145
|
5. Save the new script as `test_scripts/run_unittests_<lang>.sh` (a `.ps1` copy next to it only if the user wants to run it by hand on Windows). For Bash, `chmod +x` it.
|
|
146
|
-
6. **Make sure turri finds the script.** Do not link it from the ***plain - turri finds the unit testing script in the project root (the folder that holds `plain_modules/`) and puts it, whole, into the prompt of the coding agent itself; a link to it from the ***plain is ignored. It looks, in order, at `config.turri.yaml` in the root (`unittests-script: <path relative to the root>`) - with the
|
|
146
|
+
6. **Make sure turri finds the script.** Do not link it from the ***plain - turri finds the unit testing script in the project root (the folder that holds `plain_modules/`) and puts it, whole, into the prompt of the coding agent itself; a link to it from the ***plain is ignored. It looks, in order, at `config.turri.yaml` in the root (`unittests-script: <path relative to the root>`) - with the module's own `config.turri.<module>.yaml` over it - or the one of a module it requires - then for the one `run_unittests*.sh` in the root, then for the one in `test_scripts/`. Saving the script in `test_scripts/` (or the root) is enough when it is the only one there. If the project keeps it elsewhere, name it in `config.turri.yaml` as `unittests-script:` - and when the project has only a `config.yaml`, copy it to `config.turri.yaml` first (and each `config.<name>.yaml` to `config.turri.<name>.yaml`) and edit the copy; `config.yaml` may be another tool's, and is never written. If the project has modules on different stacks - e.g. a Python backend and a React frontend side by side, sharing only an imported module - each part names its own script in a file of its own beside `config.turri.yaml`: `unittests-script:` in `config.turri.backend.yaml` for `backend.plain`, in `config.turri.frontend.yaml` for `frontend.plain`. A module's file builds it and every module built on it that has no file of its own, so name it after the module at the bottom of the chain - `config.turri.backend.yaml` builds `backend_auth.plain`, which requires `backend.plain`, too - and turri works it out with nothing to choose; two files among the modules one requires is an error. turri never guesses between two. The script is required: a build without one stops before it starts.
|
|
147
147
|
|
|
148
148
|
## Anti-Patterns
|
|
149
149
|
|
|
@@ -159,5 +159,5 @@ Notes:
|
|
|
159
159
|
- Don't write a cross-shell hybrid (e.g. a `.sh` that detects PowerShell, or vice versa). Ship one script per shell, named with the appropriate extension.
|
|
160
160
|
- Don't install dependencies into the user's global location (`~/.m2`, system-wide `pip`, `~/.cargo`, etc.). Always isolate inside `$WORKING_FOLDER` so concurrent runs and other projects can't interfere.
|
|
161
161
|
- Don't run the test command without first verifying the install step succeeded. A failed install followed by a "test" run produces misleading errors that look like test failures.
|
|
162
|
-
- **Don't link the script from the ***plain, and don't leave turri guessing.** turri finds the script in `config.turri.yaml`, the project root, or `test_scripts/`, and shows it to the coding agent itself; a link to it from the ***plain is ignored. Put it where it is found, and when there are two unit testing scripts in one folder, name the one to use as `unittests-script:` - in each
|
|
162
|
+
- **Don't link the script from the ***plain, and don't leave turri guessing.** turri finds the script in `config.turri.yaml`, the project root, or `test_scripts/`, and shows it to the coding agent itself; a link to it from the ***plain is ignored. Put it where it is found, and when there are two unit testing scripts in one folder, name the one to use as `unittests-script:` - in each module's own `config.turri.<module>.yaml` when they are for parts on different stacks (see Workflow step 6).
|
|
163
163
|
- **Don't write a terse script.** Silent steps, `>/dev/null` redirects on the install output, missing `--version` prints, and absent failure banners all make the script harder to debug than the code it is testing. Follow the *Logging — be as verbose as possible* rule under [Conventions](#conventions) literally: every step announces itself, every command is echoed, every failure prints what was about to run and where.
|
package/package.json
CHANGED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Which model the agents of a job run on.
|
|
3
|
-
*
|
|
4
|
-
* By default, whatever the conversation is using. The person can say otherwise - "render spec
|
|
5
|
-
* changes with Gemini Flash" - for one kind of work or for all of it, and that holds for the
|
|
6
|
-
* rest of the session, for jobs started from a tool call and for jobs a skill queues alike. A
|
|
7
|
-
* single tool call can also name a model for itself alone.
|
|
8
|
-
*
|
|
9
|
-
* A name is resolved strictly. pi's own pattern matching picks its best guess and says nothing
|
|
10
|
-
* - "gpt-5" becomes a Bedrock model with no credentials, "flash" a GLM one - and a job on a
|
|
11
|
-
* guessed model is worse than a question. So an exact id is taken as it is, a looser name is
|
|
12
|
-
* taken only when it fits exactly one model that has credentials, and anything else comes back
|
|
13
|
-
* as a short list to ask the person about.
|
|
14
|
-
*/
|
|
15
|
-
/** The part of pi's model registry this needs. */
|
|
16
|
-
export interface ModelCatalog {
|
|
17
|
-
getAll(): ReadonlyArray<CatalogModel>;
|
|
18
|
-
hasConfiguredAuth(model: CatalogModel): boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface CatalogModel {
|
|
21
|
-
provider: string;
|
|
22
|
-
id: string;
|
|
23
|
-
name?: string;
|
|
24
|
-
}
|
|
25
|
-
export type ModelResolution = {
|
|
26
|
-
ok: true;
|
|
27
|
-
model: string;
|
|
28
|
-
name: string;
|
|
29
|
-
} | {
|
|
30
|
-
ok: false;
|
|
31
|
-
message: string;
|
|
32
|
-
candidates: string[];
|
|
33
|
-
};
|
|
34
|
-
/** Resolve what the person called a model to one this machine can run, or say why not. */
|
|
35
|
-
export declare function resolveModel(query: string, catalog: ModelCatalog): ModelResolution;
|
|
36
|
-
/** The resolution as text for the agent: the model, or why not and what to ask. */
|
|
37
|
-
export declare function describeResolution(resolution: ModelResolution): string;
|
|
38
|
-
/** Kinds of work a model can be chosen for. */
|
|
39
|
-
export type RenderWork = "spec_changes" | "functionalities";
|
|
40
|
-
export declare const WORK_LABEL: Record<RenderWork | "all", string>;
|
|
41
|
-
/** The models chosen in this session, by kind of work. Unset: the project's, or the conversation's model. */
|
|
42
|
-
export type ModelChoices = Partial<Record<RenderWork | "all", string>>;
|
|
43
|
-
/** The model a job of this kind runs on: chosen for it, chosen for everything, or the chat's. */
|
|
44
|
-
export declare function modelFor(choices: ModelChoices, work: RenderWork, chat: string | undefined): string | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Where each kind of work runs now, in a line each: chosen in this session, or the default coding
|
|
47
|
-
* model - from `--coding-model` or config.turri.yaml, said which - or the conversation's.
|
|
48
|
-
*/
|
|
49
|
-
export declare function describeChoices(choices: ModelChoices, chat: string | undefined, project?: {
|
|
50
|
-
model: string;
|
|
51
|
-
from: string;
|
|
52
|
-
}): string;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { type ChainEntry } from "./requires.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Deploy: a module's code, as its last commit has it, put out in `dist/<module>` for the person to try.
|
|
4
|
-
*
|
|
5
|
-
* A render works in `plain_modules/<module>/code` while the person asks to try what is there, so what
|
|
6
|
-
* is there is half-written. Its last commit is not: every unit of work starts from one and ends with
|
|
7
|
-
* one, and both are runnable. So the commit is exported - git's own list of what it tracks, and
|
|
8
|
-
* nothing else - which is a copy of the working tree with every unstaged and untracked change put
|
|
9
|
-
* back, without a list of what each stack leaves lying around (`node_modules`, `.venv`, `target`). The
|
|
10
|
-
* working tree itself is never read or touched.
|
|
11
|
-
*
|
|
12
|
-
* What starts it runs here, on the person's machine, unfenced: a server the person opens in their
|
|
13
|
-
* browser, with their toolchains. The agent that releases it installs and runs what it needs itself,
|
|
14
|
-
* as any agent with a shell would - nothing is put to the person - and everything started is the
|
|
15
|
-
* harness's to stop: on a redeploy, on /halt, and when turri exits.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* How a module is released - always from its last commit, exported to `dist/<module>` first. `dist`, the default: started
|
|
19
|
-
* from there. `guided`: taken on from there as there is guidance to - the person's, the project's AGENTS.md, a skill -
|
|
20
|
-
* into the host codebase, say.
|
|
21
|
-
*/
|
|
22
|
-
export type ReleaseWay = "dist" | "guided";
|
|
23
|
-
export interface Deployment {
|
|
24
|
-
moduleName: string;
|
|
25
|
-
plainFile: string;
|
|
26
|
-
way: ReleaseWay;
|
|
27
|
-
/** `dist/<module>`, in the project: the module's last commit, exported. */
|
|
28
|
-
dir: string;
|
|
29
|
-
/** Guided: the host codebase the guidance takes the code into, and what release runs and starts runs from. */
|
|
30
|
-
hostDir?: string;
|
|
31
|
-
/** Where the module's code is built: `plain_modules/<module>/code`. */
|
|
32
|
-
buildDir: string;
|
|
33
|
-
commit: string;
|
|
34
|
-
/** The commit's subject: what the last unit of work that landed did. */
|
|
35
|
-
subject: string;
|
|
36
|
-
/** When, as git says it: "3 minutes ago". */
|
|
37
|
-
when: string;
|
|
38
|
-
/** Work under way in the module - changes nobody committed yet - left out. */
|
|
39
|
-
unfinished: boolean;
|
|
40
|
-
/** The module the spec's code lives in had nothing committed yet: the nearest one below it that had, instead. */
|
|
41
|
-
instead?: string;
|
|
42
|
-
/** When the release tool shipped it: what it started since is this release's. */
|
|
43
|
-
at?: number;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Which module to deploy for a spec: the tip of its codebase - code accumulates up a requires chain, so
|
|
47
|
-
* the top module holds everything below it. Before the tip has anything committed, the nearest module
|
|
48
|
-
* below it that has.
|
|
49
|
-
*/
|
|
50
|
-
export declare function deployTarget(plainFile: string, inModule?: string): {
|
|
51
|
-
entry: ChainEntry;
|
|
52
|
-
commit: string;
|
|
53
|
-
instead?: string;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Export the module's code at its last commit into `dist/<module>` - or `into`, `turri regenerate --build-dir` -
|
|
57
|
-
* replacing whatever was there, the harness's own files (what the code is built from, the agents' notes) left out.
|
|
58
|
-
*/
|
|
59
|
-
export declare function exportModule(plainFile: string, inModule?: string, into?: string): Deployment;
|
|
60
|
-
/**
|
|
61
|
-
* The host codebase a guided release works in: the git repository the project is in - an embedded project's host -
|
|
62
|
-
* or else `fallback`, where turri runs.
|
|
63
|
-
*/
|
|
64
|
-
export declare function hostDirOf(plainFile: string, fallback: string): string;
|
|
65
|
-
/** Where a path is, said from the current directory when it is below it. */
|
|
66
|
-
export declare function shortPath(path: string): string;
|
|
67
|
-
/** What was deployed, in a line or three. */
|
|
68
|
-
export declare function describeDeployment(deployment: Deployment): string;
|
|
69
|
-
export interface DeployedProcess {
|
|
70
|
-
name: string;
|
|
71
|
-
moduleName: string;
|
|
72
|
-
command: string;
|
|
73
|
-
/** Where it runs. */
|
|
74
|
-
dir: string;
|
|
75
|
-
url?: string;
|
|
76
|
-
/** Its output, both streams. */
|
|
77
|
-
log: string;
|
|
78
|
-
pid: number;
|
|
79
|
-
startedAt: number;
|
|
80
|
-
/** Set once it has ended. */
|
|
81
|
-
exited?: {
|
|
82
|
-
code: number | null;
|
|
83
|
-
signal: string | null;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
/** Everything deploy started, running or ended, oldest first. */
|
|
87
|
-
export declare function listDeployed(): DeployedProcess[];
|
|
88
|
-
/** The ones still running. */
|
|
89
|
-
export declare function runningDeployed(moduleName?: string): DeployedProcess[];
|
|
90
|
-
/** Where a project's deployed processes write their output: its scratch, not the code in dist. */
|
|
91
|
-
export declare function deployLogDir(projectDir: string): string;
|
|
92
|
-
/** The end of a log, for when something did not come up. */
|
|
93
|
-
export declare function logTail(log: string, lines?: number, chars?: number): string;
|
|
94
|
-
/** Stop one deployed process, or every one of a module, or every one: politely, then not. Returns the names stopped. */
|
|
95
|
-
export declare function stopDeployed(which?: {
|
|
96
|
-
name?: string;
|
|
97
|
-
moduleName?: string;
|
|
98
|
-
}): Promise<string[]>;
|
|
99
|
-
/** Stop everything at once, without waiting: for when turri itself is going. */
|
|
100
|
-
export declare function stopAllDeployedNow(): void;
|
|
101
|
-
/** How long a server is given to answer at its URL, and to stay up when it has none. */
|
|
102
|
-
export declare const READY_TIMEOUT_MS: number;
|
|
103
|
-
export interface StartResult {
|
|
104
|
-
ok: boolean;
|
|
105
|
-
/** What happened, for the agent and the person. */
|
|
106
|
-
text: string;
|
|
107
|
-
process?: DeployedProcess;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Start what keeps running, in `dir` - the deployed folder `root`, or one inside it. A folder that is not there starts
|
|
111
|
-
* nothing: said, with what the deployed folder holds, so the agent can name the right one.
|
|
112
|
-
*/
|
|
113
|
-
export declare function startDeployed(input: {
|
|
114
|
-
name: string;
|
|
115
|
-
command: string;
|
|
116
|
-
dir: string;
|
|
117
|
-
moduleName: string;
|
|
118
|
-
logDir: string;
|
|
119
|
-
url?: string;
|
|
120
|
-
root?: string;
|
|
121
|
-
}): Promise<StartResult>;
|
package/dist/release-agent.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { type DeployState } from "./release-tools.ts";
|
|
3
|
-
/**
|
|
4
|
-
* The agent that releases a module on its own - `turri release`'s, and a pulse's last stage under
|
|
5
|
-
* `release-after-pulse: true`, which is the word to release: the guidance it finds as the chat does - what it was told,
|
|
6
|
-
* the project's AGENTS.md, its skills - says only how. It passes it to `release`, and does what it says, asking no one.
|
|
7
|
-
*/
|
|
8
|
-
type AnyTool = ToolDefinition<any, any, any>;
|
|
9
|
-
/**
|
|
10
|
-
* The person's own shell, in the deployed folder: it installs what the release needs into the project, and runs it. It
|
|
11
|
-
* changes nothing of the machine's - no toolchain installed, no system setting changed: a command that would is refused.
|
|
12
|
-
*/
|
|
13
|
-
export declare function releaseShell(dir: string): AnyTool;
|
|
14
|
-
/**
|
|
15
|
-
* What the project says of itself, for the agent to find release guidance in: its AGENTS.md and its skills
|
|
16
|
-
* (`.agents/skills`, `.pi/skills`, `.claude/skills`), where turri runs and in the host codebase - once each, whole.
|
|
17
|
-
*/
|
|
18
|
-
export declare function projectNotes(dirs: string[]): string[];
|
|
19
|
-
export interface ReleaseAgentInput {
|
|
20
|
-
plainFile: string;
|
|
21
|
-
/** Where turri runs. */
|
|
22
|
-
cwd: string;
|
|
23
|
-
/** The agent's model: the harness model. */
|
|
24
|
-
model?: string;
|
|
25
|
-
/** What release has shipped and been told this conversation - shared with the chat's release. */
|
|
26
|
-
state: DeployState;
|
|
27
|
-
inModule?: string;
|
|
28
|
-
/** What the person said of how to release it. */
|
|
29
|
-
guidance?: string;
|
|
30
|
-
/** Released as a pulse's last stage: what the pulse landed. The setting has said to release it; the guidance says how. */
|
|
31
|
-
afterPulse?: {
|
|
32
|
-
moduleName: string;
|
|
33
|
-
subject: string;
|
|
34
|
-
};
|
|
35
|
-
/** Released for the sentinel to check functional specs of the module in: asked for, so released; the guidance says how. */
|
|
36
|
-
forCheck?: {
|
|
37
|
-
moduleName: string;
|
|
38
|
-
};
|
|
39
|
-
onDelta?: (delta: string) => void;
|
|
40
|
-
}
|
|
41
|
-
/** Run the release agent to its end; its last reply. */
|
|
42
|
-
export declare function runReleaseAgent(input: ReleaseAgentInput): Promise<string>;
|
|
43
|
-
export {};
|