@turri-dev/cli 0.2.4-next.240620d → 0.2.4-next.359b847
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 +6 -7
- 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 +10 -26
- package/dist/config-edit.d.ts +20 -8
- package/dist/config-edit.js +32 -24
- package/dist/config.d.ts +101 -58
- package/dist/config.js +265 -118
- package/dist/conform-cli.js +14 -3
- package/dist/conformance-switch.d.ts +7 -6
- package/dist/conformance-switch.js +19 -16
- package/dist/extension.d.ts +29 -3
- package/dist/extension.js +375 -351
- package/dist/genome.js +5 -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 +45 -21
- package/dist/loop-tools.js +152 -82
- 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 +6 -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 +5 -3
- package/dist/regenerate/audit.js +9 -0
- package/dist/regenerate/base-folder.d.ts +2 -2
- package/dist/regenerate/base-folder.js +1 -1
- package/dist/regenerate/cases.js +7 -0
- package/dist/regenerate/chunk-plan.d.ts +5 -0
- package/dist/regenerate/chunk-plan.js +16 -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/drift.d.ts +4 -0
- package/dist/regenerate/drift.js +26 -6
- package/dist/regenerate/job-panel.js +3 -1
- 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 +30 -10
- package/dist/regenerate/loop.js +166 -59
- 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/records.d.ts +11 -0
- package/dist/regenerate/records.js +15 -0
- package/dist/regenerate/regenerate.js +4 -1
- package/dist/regenerate/renames.js +4 -4
- package/dist/regenerate/requires.d.ts +7 -0
- package/dist/regenerate/requires.js +24 -18
- package/dist/regenerate/scripts-being-written.d.ts +4 -4
- package/dist/regenerate/scripts-being-written.js +3 -3
- package/dist/regenerate/spec-map.js +3 -3
- package/dist/regenerate/submit-work.d.ts +2 -0
- package/dist/regenerate/submit-work.js +8 -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/regenerate-cli.js +1 -1
- package/dist/self-invocation.d.ts +11 -0
- package/dist/self-invocation.js +36 -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 +72 -43
- 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/dist/turri-versions.js +2 -1
- 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 +4 -4
- package/docs/hosting.md +20 -19
- package/docs/launch.md +67 -0
- package/docs/parser.md +2 -2
- package/docs/regenerating.md +21 -15
- package/docs/sandbox.md +3 -3
- package/docs/sentinel.md +26 -14
- package/docs/skills-and-gates.md +4 -4
- package/docs/using.md +19 -28
- package/genome/rules/project-model.md +2 -1
- package/genome/rules/turri-regeneration.md +5 -3
- 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/dist/config-edit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `/
|
|
2
|
+
* `/settings`' and the chat's settings tool's side of config.turri.yaml: every setting turri reads, what it takes - a yes or no, one of a few words, a
|
|
3
3
|
* number, a model, a list - and when a change to it takes effect, so the person knows whether to wait for the next
|
|
4
4
|
* pulse or not at all. A change is written into the file line by line, its comments and the commented-out examples
|
|
5
5
|
* kept; `models:` and `agent-env:`, which nest, are written again whole, their own comments lost.
|
|
@@ -20,14 +20,20 @@ export interface Setting {
|
|
|
20
20
|
options?: string[];
|
|
21
21
|
/** The least a number may be. */
|
|
22
22
|
min?: number;
|
|
23
|
-
/** Set in the project's config.turri.yaml only: a
|
|
23
|
+
/** Set in the project's config.turri.yaml only: a module's config.turri.<module>.yaml does not change it. */
|
|
24
24
|
projectOnly?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Changed by the person alone, with /settings: the chat's settings tool refuses it. What it decides is theirs - turning
|
|
27
|
+
* conformance tests on doubles each change - or it widens what the agents reach (credentials, folders past the
|
|
28
|
+
* sandbox), or it is a check on the chat's own work (the sentinel, the ***plain rules, the ledger).
|
|
29
|
+
*/
|
|
30
|
+
personOnly?: boolean;
|
|
25
31
|
}
|
|
26
32
|
/** What each effect is, said to the person. */
|
|
27
33
|
export declare const EFFECT_TEXT: Record<Effect, string>;
|
|
28
34
|
/** Every setting, in the order the list shows them. */
|
|
29
35
|
export declare function settings(rules?: string[]): Setting[];
|
|
30
|
-
/** Every setting, as a host is given them: rules-off offering turri's own rules, as /
|
|
36
|
+
/** Every setting, as a host is given them: rules-off offering turri's own rules, as /settings offers them. */
|
|
31
37
|
export declare function configSettings(): Setting[];
|
|
32
38
|
/** A setting by its key - `review`, `models.coding` - or nothing. */
|
|
33
39
|
export declare function settingOf(key: string, rules?: string[]): Setting | undefined;
|
|
@@ -58,13 +64,19 @@ export declare function currentValue(text: string, key: string): unknown;
|
|
|
58
64
|
export declare function shownValue(value: unknown): string;
|
|
59
65
|
/** The project's config.turri.yaml - or the config.yaml it is read from until it has one - its text, empty when there is neither. */
|
|
60
66
|
export declare function readConfigText(dir: string): string;
|
|
61
|
-
/** What a change does beside setting the value: the files and settings that win over it, said to the person. */
|
|
62
|
-
export declare function overriddenBy(dir: string, text: string, setting: Setting): string[];
|
|
63
67
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
68
|
+
* What a change does beside setting the value: the files and settings that win over it, said to the person. `module`:
|
|
69
|
+
* written into that module's own file - the project's file is the one it wins over, and nothing over it is said.
|
|
66
70
|
*/
|
|
67
|
-
export declare function
|
|
71
|
+
export declare function overriddenBy(dir: string, text: string, setting: Setting, module?: string): string[];
|
|
72
|
+
/**
|
|
73
|
+
* Write a setting into the project's config.turri.yaml - or, with `module`, that module's config.turri.<module>.yaml -
|
|
74
|
+
* made when it is not there, from config.yaml and each module's file in the old naming when they are what the project
|
|
75
|
+
* is read from - and give back the file as written.
|
|
76
|
+
*/
|
|
77
|
+
export declare function writeSetting(dir: string, key: string, value: unknown, module?: string): string;
|
|
78
|
+
/** A module's own config.turri.<module>.yaml - or the config.<module>.yaml it is read from until the project has turri's files - its text, empty when there is none. */
|
|
79
|
+
export declare function readModuleConfigText(dir: string, module: string): string;
|
|
68
80
|
/** The files a path setting is offered: the testing scripts in the root and test_scripts/, the .plain files of the folder, or - the test folder - its folders. */
|
|
69
81
|
export declare function pathOptions(dir: string, key: string): string[];
|
|
70
82
|
/** The dotenv files of the project root, for agent-env.files. */
|
package/dist/config-edit.js
CHANGED
|
@@ -3,7 +3,7 @@ import { join } from "node:path";
|
|
|
3
3
|
import { dump as dumpYaml, load as loadYaml } from "js-yaml";
|
|
4
4
|
import { PACKAGE_ROOT } from "./environment.js";
|
|
5
5
|
import { loadRules } from "./rules.js";
|
|
6
|
-
import { adoptLegacyConfig, AGENT_ROLES, CONFIG_FILE,
|
|
6
|
+
import { adoptLegacyConfig, AGENT_ROLES, CONFIG_FILE, moduleConfigFile, moduleConfigFileIn, moduleConfigsOf, projectConfigFile, splitModelSpec, THINKING_LEVELS } from "./config.js";
|
|
7
7
|
/** What each effect is, said to the person. */
|
|
8
8
|
export const EFFECT_TEXT = {
|
|
9
9
|
now: "in effect now",
|
|
@@ -20,10 +20,10 @@ const SECONDS = ["0", "60", "120", "180", "300"];
|
|
|
20
20
|
const ROLE_ABOUT = {
|
|
21
21
|
default: "every role not named",
|
|
22
22
|
chat: "the conversation - as harness-model, which it wins over",
|
|
23
|
-
sentinel: "the sentinel: checks every finished pulse and tests
|
|
23
|
+
sentinel: "the sentinel: checks every finished pulse and tests what is launched",
|
|
24
24
|
planner: "cuts the work into pulses",
|
|
25
25
|
diagnosis: "looks into a pulse that failed for good",
|
|
26
|
-
|
|
26
|
+
launch: "the launch agent",
|
|
27
27
|
coding: "writes the code - as coding-model, which it wins over",
|
|
28
28
|
conformance: "writes the conformance tests",
|
|
29
29
|
explorer: "explores the code for a conformance run",
|
|
@@ -62,9 +62,9 @@ export function settings(rules = []) {
|
|
|
62
62
|
{ key: "review", about: "whether the code and its tests are reviewed once they pass", kind: "boolean", unset: "true", effect: "next-pulse" },
|
|
63
63
|
{ key: "mutation-testing", about: "whether the coding agent and the reviewer can put a bug in the code for one test run (can_it_fail)", kind: "boolean", unset: "true", effect: "next-pulse" },
|
|
64
64
|
{ key: "allow-to-stop-jobs", about: "whether turri stops a running pulse the ***plain has moved on from", kind: "boolean", unset: "true", effect: "now" },
|
|
65
|
-
{ key: "
|
|
66
|
-
{ key: "sentinel", about: "whether a chat of its own checks every finished pulse, tests
|
|
67
|
-
{ key: "conformance-tests", about: "whether functional specs' scenarios are written and conformance tested - false: none, and the chat's conform refused", kind: "boolean", unset: "false", effect: "now" },
|
|
65
|
+
{ key: "launch-after-pulse", about: "whether every pulse that lands code is launched, in the background", kind: "boolean", unset: "false", effect: "next-landing" },
|
|
66
|
+
{ key: "sentinel", about: "whether a chat of its own checks every finished pulse, tests what is launched, and tells you what is wrong - ask: you are asked before it first opens", kind: "choice", options: ["ask", "true", "false"], unset: "ask", effect: "next-landing", personOnly: true },
|
|
67
|
+
{ key: "conformance-tests", about: "whether functional specs' scenarios are written and conformance tested - false: none, and the chat's conform refused", kind: "boolean", unset: "false", effect: "now", personOnly: true },
|
|
68
68
|
{ key: "test-dir", about: "the folder of the test plain files, a folder per module in it, by path from the project root", kind: "path", unset: "tests", effect: "now" },
|
|
69
69
|
{ key: "base-folder", about: "a folder a codebase that requires no other module starts from, by path from the project root - code to build on, files to use, copied in once", kind: "path", unset: "none: it starts empty", effect: "next-pulse" },
|
|
70
70
|
{ key: "unittests-script", about: "the unit testing script, by path from the project root", kind: "path", unset: "the one run_unittests*.sh found", effect: "next-test-run" },
|
|
@@ -76,17 +76,17 @@ export function settings(rules = []) {
|
|
|
76
76
|
{ key: "max-lines-per-pulse", about: "the most lines of ***plain in one pulse before a group is split", kind: "number", options: ["60", "120", "200", "300"], min: 1, unset: "120", effect: "next-plan" },
|
|
77
77
|
{ key: "turn-limit", about: "seconds each agent turn has, for every role without its own - 0 for none", kind: "number", options: SECONDS, min: 0, unset: "120", effect: "next-pulse" },
|
|
78
78
|
{ key: "compact-at", about: "tokens of work an agent holds before it is compacted between turns", kind: "number", options: ["50000", "100000", "150000", "200000"], min: 1000, unset: "100000", effect: "next-pulse", projectOnly: true },
|
|
79
|
-
{ key: "rules-off", about: "***plain rules left out of the prompts of the agents that write ***plain", kind: "list", options: rules, unset: "none", effect: "next-message", projectOnly: true },
|
|
80
|
-
{ key: "agent-env.files", about: "dotenv files whose variables the agents' commands get", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true },
|
|
81
|
-
{ key: "agent-env.vars", about: "variables from turri's environment the agents' commands get, by name", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true },
|
|
82
|
-
{ key: "toolchains", about: "folders of this machine an agent's commands may read beside the usual ones", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true },
|
|
79
|
+
{ key: "rules-off", about: "***plain rules left out of the prompts of the agents that write ***plain", kind: "list", options: rules, unset: "none", effect: "next-message", projectOnly: true, personOnly: true },
|
|
80
|
+
{ key: "agent-env.files", about: "dotenv files whose variables the agents' commands get", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true, personOnly: true },
|
|
81
|
+
{ key: "agent-env.vars", about: "variables from turri's environment the agents' commands get, by name", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true, personOnly: true },
|
|
82
|
+
{ key: "toolchains", about: "folders of this machine an agent's commands may read beside the usual ones", kind: "list", unset: "none", effect: "next-pulse", projectOnly: true, personOnly: true },
|
|
83
83
|
{ key: "debug", about: "whether turri keeps what it writes for debugging it - agents' logs and sessions, pulse logs, outputs", kind: "boolean", unset: "false", effect: "next-pulse", projectOnly: true },
|
|
84
84
|
{ key: "cache-keep", about: "megabytes of package caches the project keeps; 0 keeps none", kind: "number", options: ["0", "1024", "4096", "16384"], min: 0, unset: "4096", effect: "next-start", projectOnly: true },
|
|
85
|
-
{ key: "ledger-keep", about: "megabytes of the ledger - what turri did, as facts - the project keeps; 0 keeps none", kind: "number", options: ["0", "50", "100", "500"], min: 0, unset: "100", effect: "next-start", projectOnly: true },
|
|
85
|
+
{ key: "ledger-keep", about: "megabytes of the ledger - what turri did, as facts - the project keeps; 0 keeps none", kind: "number", options: ["0", "50", "100", "500"], min: 0, unset: "100", effect: "next-start", projectOnly: true, personOnly: true },
|
|
86
86
|
...roles,
|
|
87
87
|
];
|
|
88
88
|
}
|
|
89
|
-
/** Every setting, as a host is given them: rules-off offering turri's own rules, as /
|
|
89
|
+
/** Every setting, as a host is given them: rules-off offering turri's own rules, as /settings offers them. */
|
|
90
90
|
export function configSettings() {
|
|
91
91
|
return settings(loadRules(join(PACKAGE_ROOT, "genome", "rules")).map((rule) => rule.name));
|
|
92
92
|
}
|
|
@@ -307,21 +307,24 @@ export function readConfigText(dir) {
|
|
|
307
307
|
const path = join(dir, projectConfigFile(dir));
|
|
308
308
|
return existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
309
309
|
}
|
|
310
|
-
/**
|
|
311
|
-
|
|
310
|
+
/**
|
|
311
|
+
* What a change does beside setting the value: the files and settings that win over it, said to the person. `module`:
|
|
312
|
+
* written into that module's own file - the project's file is the one it wins over, and nothing over it is said.
|
|
313
|
+
*/
|
|
314
|
+
export function overriddenBy(dir, text, setting, module) {
|
|
312
315
|
const notes = [];
|
|
313
316
|
const wins = { "harness-model": "models.chat", "coding-model": "models.coding", "judge-model": "models.judge" };
|
|
314
317
|
const over = wins[setting.key];
|
|
315
318
|
if (over !== undefined && currentValue(text, over) !== undefined)
|
|
316
|
-
notes.push(`${over} is set too, and wins over ${setting.key} - change it with /
|
|
317
|
-
if (setting.projectOnly === true)
|
|
319
|
+
notes.push(`${over} is set too, and wins over ${setting.key} - change it with /settings ${over}.`);
|
|
320
|
+
if (setting.projectOnly === true || module !== undefined)
|
|
318
321
|
return notes;
|
|
319
322
|
const top = setting.key.split(".")[0];
|
|
320
|
-
for (const
|
|
321
|
-
const file =
|
|
323
|
+
for (const each of moduleConfigsOf(dir)) {
|
|
324
|
+
const file = moduleConfigFileIn(dir, each);
|
|
322
325
|
const own = loadMapping(safeRead(join(dir, file)))[top];
|
|
323
326
|
if (own !== undefined)
|
|
324
|
-
notes.push(`${file} sets ${top} too, and wins
|
|
327
|
+
notes.push(`${file} sets ${top} too, and wins for ${each}.plain and the modules built on it.`);
|
|
325
328
|
}
|
|
326
329
|
return notes;
|
|
327
330
|
}
|
|
@@ -334,15 +337,20 @@ function safeRead(path) {
|
|
|
334
337
|
}
|
|
335
338
|
}
|
|
336
339
|
/**
|
|
337
|
-
* Write a setting into the project's config.turri.yaml -
|
|
338
|
-
* file in the old naming when they are what the project
|
|
340
|
+
* Write a setting into the project's config.turri.yaml - or, with `module`, that module's config.turri.<module>.yaml -
|
|
341
|
+
* made when it is not there, from config.yaml and each module's file in the old naming when they are what the project
|
|
342
|
+
* is read from - and give back the file as written.
|
|
339
343
|
*/
|
|
340
|
-
export function writeSetting(dir, key, value) {
|
|
344
|
+
export function writeSetting(dir, key, value, module) {
|
|
341
345
|
adoptLegacyConfig(dir);
|
|
342
|
-
const text = withSetting(readConfigText(dir), key, value);
|
|
343
|
-
writeFileSync(join(dir, CONFIG_FILE), text);
|
|
346
|
+
const text = withSetting(module !== undefined ? safeRead(join(dir, moduleConfigFile(module))) : readConfigText(dir), key, value);
|
|
347
|
+
writeFileSync(join(dir, module !== undefined ? moduleConfigFile(module) : CONFIG_FILE), text);
|
|
344
348
|
return text;
|
|
345
349
|
}
|
|
350
|
+
/** A module's own config.turri.<module>.yaml - or the config.<module>.yaml it is read from until the project has turri's files - its text, empty when there is none. */
|
|
351
|
+
export function readModuleConfigText(dir, module) {
|
|
352
|
+
return safeRead(join(dir, moduleConfigFileIn(dir, module)));
|
|
353
|
+
}
|
|
346
354
|
/** The files a path setting is offered: the testing scripts in the root and test_scripts/, the .plain files of the folder, or - the test folder - its folders. */
|
|
347
355
|
export function pathOptions(dir, key) {
|
|
348
356
|
const list = (folder, test) => {
|
package/dist/config.d.ts
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* review: false # review the code and its tests once they pass (default: true)
|
|
20
20
|
* mutation-testing: false # give the coding agent and the reviewer can_it_fail (default: true)
|
|
21
21
|
* allow-to-stop-jobs: false # stop a running job the spec moved on from (default: true)
|
|
22
|
-
*
|
|
23
|
-
* sentinel: true # a chat of its own every finished pulse goes to, which tests
|
|
22
|
+
* launch-after-pulse: true # launch what each pulse lands, in the background, the newest commit winning (default: false)
|
|
23
|
+
* sentinel: true # a chat of its own every finished pulse goes to, which tests what is launched and tells you what is wrong: true, false, or ask - the person asked before it first opens in a session (default: ask)
|
|
24
24
|
* rules-off: [integrations] # ***plain rules to leave out of the prompts, by name (default: none)
|
|
25
25
|
* unittests-script: test_scripts/run_unittests.sh # the testing scripts - see test-scripts.ts
|
|
26
26
|
* conformance-tests-script: test_scripts/run_conformance_tests.sh
|
|
@@ -43,79 +43,93 @@
|
|
|
43
43
|
* either of which may be left out; a bare string is the model alone. What a model leaves out it takes
|
|
44
44
|
* from the one it inherits: judge-model from coding-model, coding-model from harness-model. They are
|
|
45
45
|
* defaults: `--harness-model` / `--coding-model` / `--judge-model` on the command line win over them,
|
|
46
|
-
* and so does a model chosen during the conversation (pi's /model
|
|
46
|
+
* and so does a model chosen during the conversation (pi's /model) or named on a call. `model:` is read
|
|
47
47
|
* as `coding-model`, which it was before there were two.
|
|
48
48
|
*
|
|
49
49
|
* Keys are written with dashes; underscores are read the same (`conformance_tests`). Keys it
|
|
50
50
|
* does not know - another tool's `config.yaml`, read while it is the old file, may carry several - are ignored, and so is a value of
|
|
51
51
|
* the wrong type. Everything is optional, and what is given on the command line wins.
|
|
52
52
|
*
|
|
53
|
-
* A
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* from the
|
|
59
|
-
*
|
|
60
|
-
* stack's file.
|
|
53
|
+
* A module can have settings of its own in `config.turri.<module>.yaml` beside `config.turri.yaml`:
|
|
54
|
+
* `config.turri.backend.yaml` for `backend.plain` - its testing scripts, its toolchains, its models - laid over
|
|
55
|
+
* `config.turri.yaml` key by key, a model it names taking what it leaves out from the project's. A module with no file
|
|
56
|
+
* of its own takes the one of a module it requires - `config.turri.backend.yaml` builds `backend_auth.plain`, which
|
|
57
|
+
* requires `backend.plain` - and two among the modules it requires is an error (`configModuleFor`). Nobody chooses it:
|
|
58
|
+
* it is worked out from the module, and a pulse keeps the one it started with. `module:`, `harness-model:` and the
|
|
59
|
+
* other settings of the whole project are read from `config.turri.yaml` alone.
|
|
61
60
|
*/
|
|
62
61
|
/** turri's settings for a project, in a file of its own: a `config.yaml` beside it may be another tool's. */
|
|
63
62
|
export declare const CONFIG_FILE = "config.turri.yaml";
|
|
64
63
|
/**
|
|
65
64
|
* Where turri's settings were before they had a file of their own. A project with no `config.turri*.yaml` yet is read
|
|
66
|
-
* from it - and a `config.<name>.yaml` beside it as the
|
|
65
|
+
* from it - and a `config.<name>.yaml` beside it as the module `<name>`'s - and turri never writes it: the first setting
|
|
67
66
|
* turri writes copies them to the new names (`adoptLegacyConfig`), and from then on the old files are not read.
|
|
68
67
|
*/
|
|
69
68
|
export declare const LEGACY_CONFIG_FILE = "config.yaml";
|
|
70
|
-
/** A
|
|
71
|
-
export declare function
|
|
72
|
-
/** Whether a folder's settings are still in the old files: a config.yaml or a config.<
|
|
69
|
+
/** A module's config file's name: `config.turri.backend.yaml` for `backend.plain`. */
|
|
70
|
+
export declare function moduleConfigFile(module: string): string;
|
|
71
|
+
/** Whether a folder's settings are still in the old files: a config.yaml or a config.<module>.yaml, and no config.turri*.yaml. */
|
|
73
72
|
export declare function usesLegacyConfig(root: string): boolean;
|
|
74
73
|
/** The file the project's settings are read from, by name: config.turri.yaml, or config.yaml while the folder has only the old files. */
|
|
75
74
|
export declare function projectConfigFile(root: string): string;
|
|
76
|
-
/** The file a
|
|
77
|
-
export declare function
|
|
78
|
-
/** Whether a folder holds a project's settings: a config.turri.yaml, a
|
|
75
|
+
/** The file a module's own settings are read from, by name - the old name while the folder has only the old files. */
|
|
76
|
+
export declare function moduleConfigFileIn(root: string, module: string): string;
|
|
77
|
+
/** Whether a folder holds a project's settings: a config.turri.yaml, a module's file, or the old files. */
|
|
79
78
|
export declare function hasProjectConfig(root: string): boolean;
|
|
80
|
-
/** The
|
|
81
|
-
export declare function
|
|
79
|
+
/** The modules a project folder has config files for, by name. */
|
|
80
|
+
export declare function moduleConfigsOf(root: string): string[];
|
|
82
81
|
/**
|
|
83
82
|
* Before turri first writes a setting in a folder whose settings are still in the old files: config.yaml copied to
|
|
84
|
-
* config.turri.yaml, and each config.<
|
|
83
|
+
* config.turri.yaml, and each config.<module>.yaml to config.turri.<module>.yaml, so nothing is lost when the old files
|
|
85
84
|
* stop being read. The old files are left as they are. Gives back the files written, by name.
|
|
86
85
|
*/
|
|
87
|
-
export declare function adoptLegacyConfig(root: string, options?: {
|
|
88
|
-
projectFile?: boolean;
|
|
89
|
-
}): string[];
|
|
90
86
|
/**
|
|
91
|
-
*
|
|
92
|
-
* it
|
|
87
|
+
* Keys turri has renamed, old to new - no alias: a project's config.turri.yaml or config.turri.<module>.yaml that still has
|
|
88
|
+
* the old one has it renamed as turri first reads or writes the project's config (`renameOldKeys`), its value and its
|
|
89
|
+
* comment kept. One that sets the new one too is left as it is, the old one said in the banner as doing nothing.
|
|
93
90
|
*/
|
|
94
|
-
export declare
|
|
91
|
+
export declare const RENAMED_KEYS: Readonly<Record<string, string>>;
|
|
92
|
+
/** A key renamed in a config file. */
|
|
93
|
+
export interface RenamedKey {
|
|
94
|
+
file: string;
|
|
95
|
+
from: string;
|
|
96
|
+
to: string;
|
|
97
|
+
}
|
|
95
98
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
99
|
+
* Rename the old keys of `RENAMED_KEYS` in the project's config.turri*.yaml files - once a process, or again with `again`
|
|
100
|
+
* (a file just copied from its old name). A top-level key alone, its line kept but for the key's name; a file that also
|
|
101
|
+
* sets the new key, one that does not parse, or one that cannot be written is left as it is. Returns every key renamed
|
|
102
|
+
* in the project this process.
|
|
98
103
|
*/
|
|
99
|
-
export declare function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
export declare function renameOldKeys(root: string, options?: {
|
|
105
|
+
again?: boolean;
|
|
106
|
+
}): RenamedKey[];
|
|
107
|
+
export declare function adoptLegacyConfig(root: string, options?: {
|
|
108
|
+
projectFile?: boolean;
|
|
109
|
+
}): string[];
|
|
110
|
+
/** Inside a pulse - or work pinned like one - the module whose config file it runs with; none outside. */
|
|
111
|
+
export declare function pinnedConfigModule(): string | undefined;
|
|
112
|
+
/** Run `work` with `module`'s config file over the project's, whatever the files say meanwhile: a pulse keeps the one it started with. */
|
|
113
|
+
export declare function withConfigModule<T>(module: string | undefined, work: () => T): T;
|
|
114
|
+
/** Whether a module's config file is pinned here - by the pulse it runs in, or the work that plans it. */
|
|
115
|
+
export declare function configModulePinned(): boolean;
|
|
104
116
|
/**
|
|
105
|
-
* The
|
|
106
|
-
*
|
|
107
|
-
*
|
|
117
|
+
* The module whose config file builds a module - its `config.turri.<module>.yaml` laid over `config.turri.yaml` - or
|
|
118
|
+
* none, `config.turri.yaml` alone. The one pinned, inside a pulse; else the module's own file; else the one file among
|
|
119
|
+
* the modules it requires, all the way down - a module is built on their code, in one codebase, with their testing
|
|
120
|
+
* scripts. Two among them is an error: which one builds it cannot be told. Only `requires` counts, not imports.
|
|
108
121
|
*/
|
|
109
|
-
export declare function
|
|
110
|
-
/**
|
|
111
|
-
export declare
|
|
122
|
+
export declare function configModuleFor(plainFile: string): string | undefined;
|
|
123
|
+
/** Why a module's config cannot be told: two or more of the modules it requires have a config file of their own. */
|
|
124
|
+
export declare function moduleConfigClash(module: string, below: string[], root: string): string;
|
|
112
125
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
126
|
+
* Every module a module requires, all the way down, by name - read from each file's frontmatter alone, found as the
|
|
127
|
+
* parser finds them (the module's folder, its template/ folder, PLAIN_TEMPLATE_DIRS). One that is not there, or does
|
|
128
|
+
* not read, ends its branch: the parse says what is wrong with it.
|
|
115
129
|
*/
|
|
116
|
-
export declare function
|
|
117
|
-
/** The
|
|
118
|
-
export declare function
|
|
130
|
+
export declare function requiredModulesOf(plainFile: string): string[];
|
|
131
|
+
/** The module whose config file is pinned here, when the project folder has that file. */
|
|
132
|
+
export declare function configModuleOf(root: string): string | undefined;
|
|
119
133
|
export declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
120
134
|
export type ThinkingLevel = (typeof THINKING_LEVELS)[number];
|
|
121
135
|
/** A model, and how hard it thinks - either may be left to the one it inherits from. */
|
|
@@ -129,11 +143,11 @@ export interface ModelChoice {
|
|
|
129
143
|
* The code fixer of a conformance run and the repair agent are coding agents; the unit-test and conformance arbiters
|
|
130
144
|
* are both `arbiter`.
|
|
131
145
|
*/
|
|
132
|
-
export declare const AGENT_ROLES: readonly ["chat", "sentinel", "planner", "diagnosis", "
|
|
146
|
+
export declare const AGENT_ROLES: readonly ["chat", "sentinel", "planner", "diagnosis", "launch", "coding", "conformance", "explorer", "reviewer", "test-reviewer", "judge", "arbiter", "debugger"];
|
|
133
147
|
export type AgentRole = (typeof AGENT_ROLES)[number];
|
|
134
148
|
/**
|
|
135
149
|
* How hard each role thinks when nothing names a level - not the config's `models:`, nor a `:level` on the model it is
|
|
136
|
-
* given. The agents that do the work - write the code and the tests, explore,
|
|
150
|
+
* given. The agents that do the work - write the code and the tests, explore, launch - think little: they work from a
|
|
137
151
|
* spec that leaves little to guess, and every turn of theirs is many. The ones that judge - review, weigh, plan, find a
|
|
138
152
|
* cause - think more: a wrong call there costs pulses. The conversation keeps its own level, pi's.
|
|
139
153
|
*/
|
|
@@ -213,12 +227,12 @@ export interface ProjectConfig {
|
|
|
213
227
|
*/
|
|
214
228
|
allowToStopJobs?: boolean;
|
|
215
229
|
/**
|
|
216
|
-
* Whether every pulse that lands code
|
|
217
|
-
*
|
|
230
|
+
* Whether every pulse that lands code is launched (docs/launch.md): in the background, on the launch track - the newest
|
|
231
|
+
* commit winning, no pulse waiting on it - by an agent that follows the project's launch guidance. Unset: false.
|
|
218
232
|
*/
|
|
219
|
-
|
|
233
|
+
launchAfterPulse?: boolean;
|
|
220
234
|
/**
|
|
221
|
-
* Whether the session has a sentinel: a chat of its own that every finished pulse goes to - checked,
|
|
235
|
+
* Whether the session has a sentinel: a chat of its own that every finished pulse goes to - checked, what is launched tested,
|
|
222
236
|
* and what is wrong put to the person - instead of the chat that asked for it (docs/sentinel.md). `ask`: the person is
|
|
223
237
|
* asked, before it first opens in a session, whether to start it. Unset: ask.
|
|
224
238
|
*/
|
|
@@ -263,7 +277,7 @@ export interface ProjectConfig {
|
|
|
263
277
|
* session through a job is compacted between turns. The project's alone. Unset: 100k.
|
|
264
278
|
*/
|
|
265
279
|
compactAt?: number;
|
|
266
|
-
/** The most functional specs the planner puts in one pulse. Unset: 3. A
|
|
280
|
+
/** The most functional specs the planner puts in one pulse. Unset: 3. A module's own file wins. */
|
|
267
281
|
maxSpecsPerPulse?: number;
|
|
268
282
|
/** The most lines of spec - its functional specs and the definitions they bring - in one pulse; past it, split. Unset: 120. */
|
|
269
283
|
maxLinesPerPulse?: number;
|
|
@@ -312,7 +326,7 @@ export declare const CONFIG_KEYS: {
|
|
|
312
326
|
readonly review: "review";
|
|
313
327
|
readonly mutationTesting: "mutation-testing";
|
|
314
328
|
readonly allowToStopJobs: "allow-to-stop-jobs";
|
|
315
|
-
readonly
|
|
329
|
+
readonly launchAfterPulse: "launch-after-pulse";
|
|
316
330
|
readonly sentinel: "sentinel";
|
|
317
331
|
readonly testDir: "test-dir";
|
|
318
332
|
readonly conformanceTests: "conformance-tests";
|
|
@@ -335,10 +349,10 @@ export declare const CONFIG_KEYS: {
|
|
|
335
349
|
readonly turnLimit: "turn-limit";
|
|
336
350
|
};
|
|
337
351
|
/**
|
|
338
|
-
* The project's config - with a
|
|
352
|
+
* The project's config - with a module's own file over it, when one is named - or nothing of it when there is no file or it does
|
|
339
353
|
* not parse.
|
|
340
354
|
*/
|
|
341
|
-
export declare function readProjectConfig(root: string,
|
|
355
|
+
export declare function readProjectConfig(root: string, module?: string): ProjectConfig;
|
|
342
356
|
/**
|
|
343
357
|
* What a command's own options say of the config's keys - `turri regenerate --harness-model`, `--coding-model`,
|
|
344
358
|
* `--judge-model`, `--review`, `--mutation-testing` - read as if the file had them: each takes its key's value, and
|
|
@@ -360,13 +374,42 @@ export declare function overrideConfig(overrides: RunOverrides): void;
|
|
|
360
374
|
export declare function booleanOption(value: string): boolean | undefined;
|
|
361
375
|
/** Where the test plain files are when `test-dir:` does not say. */
|
|
362
376
|
export declare const DEFAULT_TEST_DIR = "tests";
|
|
363
|
-
/** The folder of a module's project's test plain files: `test-dir:` - its
|
|
377
|
+
/** The folder of a module's project's test plain files: `test-dir:` - its own file's over the project's - from the project's folder. */
|
|
364
378
|
export declare function testDirOf(plainFile: string): string;
|
|
365
|
-
/** The config a spec is built with: its project's, with its module's
|
|
379
|
+
/** The config a spec is built with: its project's, with its module's own file over it - or a required module's (`configModuleFor`). */
|
|
366
380
|
export declare function configForSpec(plainFile: string): ProjectConfig;
|
|
367
381
|
/**
|
|
368
382
|
* One config file, read, or nothing of it when it is not there or does not parse. Parsed again only once the file has
|
|
369
|
-
* changed - its size or its modification time - and each caller given its own copy.
|
|
383
|
+
* changed - its size or its modification time - and each caller given its own copy. A file modified less than a second
|
|
384
|
+
* before it was read is read again each time, as git treats a racily clean file: written again within the same tick of
|
|
385
|
+
* the file system's clock - milliseconds on Linux - and to the same size, its stamp would not change.
|
|
370
386
|
*/
|
|
371
387
|
export declare function readConfigFile(path: string): ProjectConfig;
|
|
388
|
+
/**
|
|
389
|
+
* The keys of the project's own config files - config.turri.yaml and each module's - that turri reads nothing of: a setting
|
|
390
|
+
* turri no longer has (`test-advisor`), or one misspelt. Said as turri starts, so a setting the person thinks is on is
|
|
391
|
+
* not silently ignored. config.yaml is left out: it may be another tool's, with keys of its own.
|
|
392
|
+
*/
|
|
393
|
+
export declare function unknownConfigKeys(root: string): Array<{
|
|
394
|
+
file: string;
|
|
395
|
+
keys: string[];
|
|
396
|
+
}>;
|
|
397
|
+
/**
|
|
398
|
+
* What a line under the banner about a config file is, for a host that draws them without reading their text: `renamed`,
|
|
399
|
+
* a key turri renamed in the file - information, nothing to do; `old-beside-new`, an old name left beside its new one,
|
|
400
|
+
* doing nothing - take it out; `unknown`, keys turri does not read - take them out, or fix their spelling.
|
|
401
|
+
*/
|
|
402
|
+
export type ConfigLineKind = "renamed" | "old-beside-new" | "unknown";
|
|
403
|
+
export interface ConfigLine {
|
|
404
|
+
kind: ConfigLineKind;
|
|
405
|
+
/** The file, from the project: `config.turri.yaml`, `config.turri.<module>.yaml`. */
|
|
406
|
+
file: string;
|
|
407
|
+
/** The line, as the terminal shows it. */
|
|
408
|
+
text: string;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* The banner's lines for the project's config files: each key turri renamed in them this process, each old name left
|
|
412
|
+
* beside its new one - doing nothing - and each file with keys turri does not read.
|
|
413
|
+
*/
|
|
414
|
+
export declare function configLines(root: string): ConfigLine[];
|
|
372
415
|
export {};
|