@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/sentinel-check.js
CHANGED
|
@@ -12,7 +12,7 @@ export function prepareCheck(project, request) {
|
|
|
12
12
|
if (name === "" || file === undefined)
|
|
13
13
|
return { refused: `There is no module ${name === "" ? "named" : name} in the project: no .plain file of its folder is ${name || "<module>"}.plain.` };
|
|
14
14
|
if (isImportModule(file))
|
|
15
|
-
return { refused: `${name} is an import module: it has no codebase of its own to
|
|
15
|
+
return { refused: `${name} is an import module: it has no codebase of its own to launch. Check a module that imports it.` };
|
|
16
16
|
let chain;
|
|
17
17
|
try {
|
|
18
18
|
chain = resolveRequiresChain(file, [], undefined, { allowNoFunctionalities: true });
|
|
@@ -31,13 +31,13 @@ export function prepareCheck(project, request) {
|
|
|
31
31
|
const id = colon === -1 ? funcId : funcId.slice(colon + 1).trim();
|
|
32
32
|
return { module, id, label: `${module}:${id}` };
|
|
33
33
|
});
|
|
34
|
-
// Only what its
|
|
34
|
+
// Only what its codebase holds: the module and the modules its requires chain builds on.
|
|
35
35
|
const inChain = new Map(chain.map((entry) => [entry.moduleName, entry]));
|
|
36
36
|
const outside = named.filter(({ module }) => !inChain.has(module));
|
|
37
37
|
if (outside.length > 0) {
|
|
38
38
|
const below = chain.slice(0, -1).map((entry) => entry.moduleName);
|
|
39
39
|
return {
|
|
40
|
-
refused: `Not in ${whose(name)}
|
|
40
|
+
refused: `Not in ${whose(name)} codebase: ${outside.map((spec) => spec.label).join(", ")} - ${[...new Set(outside.map((spec) => spec.module))].join(", ")} ${new Set(outside.map((spec) => spec.module)).size === 1 ? "is" : "are"} not ${name} or a module its requires chain builds on` +
|
|
41
41
|
`${below.length > 0 ? ` (${below.join(", ")})` : ` - it builds on none`}.`,
|
|
42
42
|
};
|
|
43
43
|
}
|
package/dist/sentinel.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { type SentinelSetting } from "./config.ts";
|
|
3
3
|
import { type Job } from "./regenerate/jobs.ts";
|
|
4
|
-
import type {
|
|
4
|
+
import type { LaunchedProcess } from "./regenerate/launch.ts";
|
|
5
|
+
import { type PulseLaunch } from "./launch-session.ts";
|
|
5
6
|
import { type Conclusion, type Notice, type NoticeInput, type SentinelCheck } from "./notice.ts";
|
|
6
7
|
import type { CheckedSpec } from "./sentinel-check.ts";
|
|
7
8
|
export * from "./notice.ts";
|
|
8
9
|
/**
|
|
9
10
|
* The sentinel: a chat of the session's own that every finished pulse goes to (docs/sentinel.md). It checks how each
|
|
10
|
-
* pulse went - and, with `
|
|
11
|
+
* pulse went - and, with `launch-after-pulse` on, tests what was launched - finds out why when something is wrong, and
|
|
11
12
|
* puts it to the person as a notice in the chat they look at, with what they can do about it. It changes nothing: its
|
|
12
13
|
* file tools only read, its shell runs with the project read only, and it has none of the tools that change ***plain or
|
|
13
14
|
* start work. The chat the person talks to is never interrupted for a pulse that went well.
|
|
@@ -32,38 +33,43 @@ export declare function keepGuidance(cwd: string, text: string): void;
|
|
|
32
33
|
export declare function pulseEndsBlock(sentinel: boolean): string;
|
|
33
34
|
/**
|
|
34
35
|
* What the chat the person is in is told of a pulse that landed, with the sentinel on: that it landed, what the sentinel
|
|
35
|
-
* does with it - and to tell the person so, and do nothing else about it.
|
|
36
|
+
* does with it - and to tell the person so, and do nothing else about it. `launching`: launch-after-pulse is on - it is
|
|
37
|
+
* launched in the background, and the sentinel tests it once it runs.
|
|
36
38
|
*/
|
|
37
|
-
export declare function landedNote(job: Job,
|
|
39
|
+
export declare function landedNote(job: Job, options?: {
|
|
38
40
|
shown?: boolean;
|
|
41
|
+
launching?: boolean;
|
|
39
42
|
}): string;
|
|
40
43
|
/**
|
|
41
44
|
* Its identity and its task, in its system prompt in place of the conversation's. A host's `surface` - where the person
|
|
42
|
-
* watches it, in the host's words - stands in place of their not watching, and has it try
|
|
45
|
+
* watches it, in the host's words - stands in place of their not watching, and has it try what is launched with the host's tools.
|
|
43
46
|
*/
|
|
44
47
|
export declare function sentinelPrompt(cwd: string, options?: {
|
|
45
48
|
extraTools?: string[];
|
|
46
49
|
surface?: string;
|
|
47
50
|
}): string;
|
|
48
|
-
/** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what
|
|
51
|
+
/** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what runs of it. */
|
|
49
52
|
export declare function sentinelBrief(job: Job, context: {
|
|
50
53
|
project: string;
|
|
51
54
|
asked?: string;
|
|
52
55
|
focused?: string;
|
|
53
|
-
|
|
54
|
-
releaseAfterPulse: boolean;
|
|
56
|
+
launch: PulseLaunch;
|
|
55
57
|
reaction: string;
|
|
56
58
|
}): string;
|
|
57
59
|
/**
|
|
58
|
-
* What the sentinel is told of a host's check:
|
|
59
|
-
* specs to test, with what each says and its scenarios, as turri reads them now.
|
|
60
|
+
* What the sentinel is told of a host's check: what is launched of the module - what runs, and where - and the
|
|
61
|
+
* functional specs to test, with what each says and its scenarios, as turri reads them now.
|
|
60
62
|
*/
|
|
61
63
|
export declare function sentinelCheckBrief(check: SentinelCheck, context: {
|
|
62
64
|
specs: CheckedSpec[];
|
|
63
|
-
|
|
65
|
+
running: LaunchedProcess[];
|
|
64
66
|
commit?: string;
|
|
65
|
-
|
|
67
|
+
failed?: {
|
|
68
|
+
id: string;
|
|
69
|
+
summary?: string;
|
|
70
|
+
};
|
|
66
71
|
focused?: string;
|
|
72
|
+
dir?: string;
|
|
67
73
|
}): string;
|
|
68
74
|
/**
|
|
69
75
|
* The tools the sentinel's agent may call: what reads, write and edit for the project's tooling alone, resume, its
|
package/dist/sentinel.js
CHANGED
|
@@ -11,11 +11,12 @@ import { formatDuration, pulseName } from "./regenerate/jobs.js";
|
|
|
11
11
|
import { readLedger } from "./regenerate/ledger.js";
|
|
12
12
|
import { describePulseView, pulseView } from "./regenerate/ledger-view.js";
|
|
13
13
|
import { MODULES_DIR, ensureInScratch } from "./regenerate/paths.js";
|
|
14
|
+
import { LAUNCHED_ONLY, launchedDir, whatRuns } from "./launch-session.js";
|
|
14
15
|
import { SENTINEL, SENTINEL_START, wentWrong } from "./notice.js";
|
|
15
16
|
export * from "./notice.js";
|
|
16
17
|
/**
|
|
17
18
|
* The sentinel: a chat of the session's own that every finished pulse goes to (docs/sentinel.md). It checks how each
|
|
18
|
-
* pulse went - and, with `
|
|
19
|
+
* pulse went - and, with `launch-after-pulse` on, tests what was launched - finds out why when something is wrong, and
|
|
19
20
|
* puts it to the person as a notice in the chat they look at, with what they can do about it. It changes nothing: its
|
|
20
21
|
* file tools only read, its shell runs with the project read only, and it has none of the tools that change ***plain or
|
|
21
22
|
* start work. The chat the person talks to is never interrupted for a pulse that went well.
|
|
@@ -35,14 +36,14 @@ export function sentinelSetting(cwd) {
|
|
|
35
36
|
* - and whether to start it.
|
|
36
37
|
*/
|
|
37
38
|
export function sentinelStartNotice(about, cwd) {
|
|
38
|
-
let
|
|
39
|
+
let launched = false;
|
|
39
40
|
try {
|
|
40
|
-
|
|
41
|
+
launched = readProjectConfig(cwd).launchAfterPulse === true;
|
|
41
42
|
}
|
|
42
43
|
catch {
|
|
43
|
-
/* a config that cannot be read
|
|
44
|
+
/* a config that cannot be read launches nothing */
|
|
44
45
|
}
|
|
45
|
-
const what = `a background tab that reviews each finished pulse${
|
|
46
|
+
const what = `a background tab that reviews each finished pulse${launched ? " and tries to use what was launched" : ""}`;
|
|
46
47
|
if (!("kind" in about)) {
|
|
47
48
|
return {
|
|
48
49
|
kind: "sentinel-start",
|
|
@@ -119,7 +120,7 @@ export function pulseEndsBlock(sentinel) {
|
|
|
119
120
|
return sentinel
|
|
120
121
|
? [
|
|
121
122
|
"<pulse-ends>",
|
|
122
|
-
"The sentinel - a chat of my own, beside this one - checks every pulse that finishes and tests what was
|
|
123
|
+
"The sentinel - a chat of my own, beside this one - checks every pulse that finishes and tests what was launched.",
|
|
123
124
|
"When a pulse lands, the chat the person is in is told, to tell them it landed and what the sentinel does with it -",
|
|
124
125
|
"and nothing more: the pulse is the sentinel's. A pulse that went wrong you are not told of. What needs the person, the",
|
|
125
126
|
"sentinel puts to them as a notice in the chat they are in: what is wrong, and what can be done. When they accept",
|
|
@@ -130,11 +131,11 @@ export function pulseEndsBlock(sentinel) {
|
|
|
130
131
|
}
|
|
131
132
|
/**
|
|
132
133
|
* What the chat the person is in is told of a pulse that landed, with the sentinel on: that it landed, what the sentinel
|
|
133
|
-
* does with it - and to tell the person so, and do nothing else about it.
|
|
134
|
+
* does with it - and to tell the person so, and do nothing else about it. `launching`: launch-after-pulse is on - it is
|
|
135
|
+
* launched in the background, and the sentinel tests it once it runs.
|
|
134
136
|
*/
|
|
135
|
-
export function landedNote(job,
|
|
136
|
-
const
|
|
137
|
-
const where = released.map((item) => `${item.name} at ${item.url ?? item.command}`).join(", ");
|
|
137
|
+
export function landedNote(job, options = {}) {
|
|
138
|
+
const launching = options.launching === true;
|
|
138
139
|
// The host showed the person the pulse's end itself: what happened, for when they ask - nobody is told anything now.
|
|
139
140
|
if (options.shown === true) {
|
|
140
141
|
return [
|
|
@@ -142,7 +143,7 @@ export function landedNote(job, released, options = {}) {
|
|
|
142
143
|
"",
|
|
143
144
|
(job.report ?? "").trim(),
|
|
144
145
|
"",
|
|
145
|
-
`The sentinel - a chat of my own beside this one -
|
|
146
|
+
`The sentinel - a chat of my own beside this one - checks it${launching ? ", once it is launched, in the background, and tests what runs" : ""}; the person was shown that it landed. The pulse is the sentinel's: nothing is to be tested, launched, opened or run for it here.`,
|
|
146
147
|
].join("\n");
|
|
147
148
|
}
|
|
148
149
|
return [
|
|
@@ -150,14 +151,14 @@ export function landedNote(job, released, options = {}) {
|
|
|
150
151
|
"",
|
|
151
152
|
(job.report ?? "").trim(),
|
|
152
153
|
"",
|
|
153
|
-
|
|
154
|
+
`${launching ? "It is being launched in the background, and the sentinel" : "The sentinel"} - a chat of my own beside this one - checks it${launching ? " and tests what runs once it is up" : " now"}. If it finds something wrong, it puts it to the person in the chat they are in, with what can be done; when it is done, you are told.`,
|
|
154
155
|
"",
|
|
155
|
-
`Tell the person, in a line or two, what landed and that the sentinel is checking it${
|
|
156
|
+
`Tell the person, in a line or two, what landed and that the sentinel is checking it${launching ? " - and tests it once it is launched" : ""}. Do nothing else about it: the pulse is the sentinel's now. Do not test it, launch it, open it, run anything for it, or start other work because of it - whatever the project's guidance says to do when a pulse finishes.`,
|
|
156
157
|
].join("\n");
|
|
157
158
|
}
|
|
158
159
|
/**
|
|
159
160
|
* Its identity and its task, in its system prompt in place of the conversation's. A host's `surface` - where the person
|
|
160
|
-
* watches it, in the host's words - stands in place of their not watching, and has it try
|
|
161
|
+
* watches it, in the host's words - stands in place of their not watching, and has it try what is launched with the host's tools.
|
|
161
162
|
*/
|
|
162
163
|
export function sentinelPrompt(cwd, options = {}) {
|
|
163
164
|
const guidance = readGuidance(cwd);
|
|
@@ -171,19 +172,24 @@ export function sentinelPrompt(cwd, options = {}) {
|
|
|
171
172
|
"asks you to check. This conversation is for the pulse, or the check, in the message turri writes first. For a pulse:",
|
|
172
173
|
"what it was, how it ended,",
|
|
173
174
|
...(surface === ""
|
|
174
|
-
? ["its ***plain diff, its log, and what was
|
|
175
|
+
? ["its ***plain diff, its log, and what was launched. The person does not watch you: they are in another chat, and", "hear from you only through notify_person."]
|
|
175
176
|
: [
|
|
176
|
-
"its ***plain diff, its log, and what was
|
|
177
|
+
"its ***plain diff, its log, and what was launched. The person can watch you try it, where the host shows it;",
|
|
177
178
|
"they talk to you in another chat, and hear what you find only through notify_person.",
|
|
178
179
|
]),
|
|
179
180
|
"",
|
|
180
181
|
"For the pulse:",
|
|
181
182
|
"1. Check how it went, from what turri tells you - and, when that is not enough, the pulse in full (pulses with its id),",
|
|
182
183
|
" its log, and the code and the ***plain, which you read.",
|
|
183
|
-
"2. When it was
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
184
|
+
"2. When it was launched (the message says so - launch-after-pulse is on), test it: it is running where the message",
|
|
185
|
+
" says - a launch that holds the pulse's commit, and the pulses after it the message names. Test what the message",
|
|
186
|
+
" says this pulse changed - what a later pulse changed again is that pulse's to test. How far you test is yours to",
|
|
187
|
+
" judge, from what the pulse changed and what the ***plain says",
|
|
188
|
+
" it should do: that it came up, answers, and does what its ***plain diff says it now does. Where the ***plain picks",
|
|
189
|
+
" one way among several - which of a tie comes first, how a default is chosen - try an input on which the ways give",
|
|
190
|
+
" different answers, so a pass shows the ***plain's way and no other: a tie whose first word is also first",
|
|
191
|
+
" alphabetically tells \"first in the file\" from nothing.",
|
|
192
|
+
"3. When something is wrong - the pulse failed or stopped, it did not pass, the launch did not come up, the software",
|
|
187
193
|
" does not do what its ***plain says - find out why. Then:",
|
|
188
194
|
" - When it is the project's tooling - a testing script, or where config.turri.yaml says the scripts are and which",
|
|
189
195
|
" toolchain folders the agents may read (toolchains:) - fix it yourself, with edit: a script calling python3 where",
|
|
@@ -198,19 +204,19 @@ export function sentinelPrompt(cwd, options = {}) {
|
|
|
198
204
|
" the person runs themselves (`brew install node`), and make the action resuming once they have.",
|
|
199
205
|
" When it is a gap in the ***plain the build settled with an assumption - something the person may reasonably leave",
|
|
200
206
|
" as it is - say so with ignorable: the gap in the summary, what the build does in the evidence. Never for",
|
|
201
|
-
" something broken, a pulse that went wrong, or a
|
|
207
|
+
" something broken, a pulse that went wrong, or a launch that did not come up.",
|
|
202
208
|
"4. When all is well, notify no one.",
|
|
203
209
|
"5. Last, call conclude once for it - holds or wrong, and in a line or two what you checked and what you found:",
|
|
204
210
|
" the chat the person is in is told, whether all is well or not. Then say the same here, in a line or two.",
|
|
205
211
|
"",
|
|
206
|
-
"For a check: the person picked functional specs of a module for you to test in
|
|
212
|
+
"For a check: the person picked functional specs of a module for you to test in what is launched of it, which runs where the",
|
|
207
213
|
"message says. Test those - what each says and its scenarios - not the module's other functional specs. Notify the",
|
|
208
214
|
"person of what does not do what its ***plain says, as for a pulse, and call conclude once for the check, by its id.",
|
|
209
215
|
"",
|
|
210
216
|
"You fix the project's tooling and nothing else. Your file tools read the whole project; write and edit reach only the",
|
|
211
217
|
"testing scripts and config.turri.yaml - and in it only where the scripts are, and toolchains:. Your shell runs with",
|
|
212
|
-
"the project read only. You never change ***plain - it is the person's intent, never yours to fix - and never steer,",
|
|
213
|
-
"
|
|
218
|
+
"the project read only; the files you try a launch with go in $TMPDIR - /tmp is outside what it may write. You never change ***plain - it is the person's intent, never yours to fix - and never steer,",
|
|
219
|
+
"launch, or regenerate but by resume after a fix of yours. You install nothing on this machine and change none of",
|
|
214
220
|
"its settings, nor the person's shell - under no circumstances: that is always the person's, said in a notice. You",
|
|
215
221
|
"never ask the person questions - a notice is how you reach them.",
|
|
216
222
|
"",
|
|
@@ -225,7 +231,7 @@ export function sentinelPrompt(cwd, options = {}) {
|
|
|
225
231
|
"<surface>",
|
|
226
232
|
surface,
|
|
227
233
|
"</surface>",
|
|
228
|
-
`Try
|
|
234
|
+
`Try what is launched with ${theirs}, where the person can watch. Keep your shell for what those cannot show - logs, exit`,
|
|
229
235
|
"codes, files.",
|
|
230
236
|
]
|
|
231
237
|
: tools.length > 0
|
|
@@ -235,7 +241,7 @@ export function sentinelPrompt(cwd, options = {}) {
|
|
|
235
241
|
...(guidance !== "" ? ["", "<guidance>", "What the person told you to keep in mind:", guidance, "</guidance>"] : []),
|
|
236
242
|
].join("\n");
|
|
237
243
|
}
|
|
238
|
-
/** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what
|
|
244
|
+
/** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what runs of it. */
|
|
239
245
|
export function sentinelBrief(job, context) {
|
|
240
246
|
const view = (() => {
|
|
241
247
|
try {
|
|
@@ -266,13 +272,8 @@ export function sentinelBrief(job, context) {
|
|
|
266
272
|
lines.push("", "Its ***plain diff:", job.diff.trimEnd());
|
|
267
273
|
if (job.logFile !== undefined)
|
|
268
274
|
lines.push("", `Its log: ${job.logFile}`);
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
lines.push("", "It was released, as its last stage (release-after-pulse). What runs now:", ...whatRuns(context.released), "Test it.");
|
|
272
|
-
}
|
|
273
|
-
else if (job.status === "succeeded" && !didNotPass(job)) {
|
|
274
|
-
lines.push("", context.releaseAfterPulse ? "Nothing was released after it." : "release-after-pulse is off: nothing was released, and you test nothing running - check the pulse alone.");
|
|
275
|
-
}
|
|
275
|
+
if (job.status === "succeeded" && !didNotPass(job))
|
|
276
|
+
lines.push("", ...launchLines(job, context.launch));
|
|
276
277
|
if (job.specConflict !== undefined) {
|
|
277
278
|
lines.push("", "It stopped on two functional specs that contradict each other: turri has put that to the person itself. Notify no one about it.");
|
|
278
279
|
}
|
|
@@ -282,23 +283,51 @@ export function sentinelBrief(job, context) {
|
|
|
282
283
|
lines.push("", `When you are done with it, call conclude for ${job.id} - whether all is well or not.`);
|
|
283
284
|
return lines.join("\n");
|
|
284
285
|
}
|
|
285
|
-
/** What runs
|
|
286
|
-
function
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
/** What runs for a pulse that landed, as the sentinel is told it: the launch that holds its commit, or why there is none to test. */
|
|
287
|
+
function launchLines(job, launch) {
|
|
288
|
+
const spec = (each) => `${each.module}:${each.funcId}`;
|
|
289
|
+
if (launch.off === true)
|
|
290
|
+
return [`${launch.commit !== undefined ? `Its commit is ${launch.commit.slice(0, 7)}. ` : ""}launch-after-pulse is off: nothing was launched, and you test nothing running - check the pulse alone.`, LAUNCHED_ONLY];
|
|
291
|
+
if (launch.commit === undefined)
|
|
292
|
+
return ["Nothing was launched for it: turri has no commit it landed - check the pulse alone.", LAUNCHED_ONLY];
|
|
293
|
+
const commit = launch.commit.slice(0, 7);
|
|
294
|
+
if (launch.notAsked !== undefined)
|
|
295
|
+
return [`Its commit is ${commit}. Its launch could not be asked for: ${launch.notAsked}`, "That is what you find out about: the launch did not come up.", LAUNCHED_ONLY];
|
|
296
|
+
if (launch.stopped === true || launch.launch === undefined)
|
|
297
|
+
return [`Its commit is ${commit}. The person stopped its launch: nothing of it runs - check the pulse alone.`, LAUNCHED_ONLY];
|
|
298
|
+
const what = launch.launch;
|
|
299
|
+
const later = launch.later.map((other) => `${other.id} (${pulseName(other)})`);
|
|
300
|
+
const lines = [
|
|
301
|
+
`Its commit is ${commit}. It was launched in the background (launch-after-pulse): what runs is ${what.codebase} at ${what.short} (${what.id}), which holds it${later.length > 0 ? ` and the pulses that landed after it - ${later.join(", ")}` : ""}.`,
|
|
302
|
+
];
|
|
303
|
+
if (what.status === "failed") {
|
|
304
|
+
lines.push(`That launch did not come up: ${what.summary ?? "the launch agent did not say why"}`, "That is what you find out about: the launch did not come up. Test nothing in its place.", LAUNCHED_ONLY);
|
|
305
|
+
return lines;
|
|
306
|
+
}
|
|
307
|
+
lines.push("What runs now:", ...whatRuns(launch.running, launchedDir(what)), LAUNCHED_ONLY);
|
|
308
|
+
if (launch.laterSpecs.length > 0) {
|
|
309
|
+
lines.push(`Test what this pulse changed - but not ${launch.laterSpecs.map(spec).join(", ")}: a later pulse changed ${launch.laterSpecs.length === 1 ? "it" : "them"} again, and its check tests ${launch.laterSpecs.length === 1 ? "it" : "them"}.`);
|
|
310
|
+
}
|
|
311
|
+
else
|
|
312
|
+
lines.push("Test what this pulse changed.");
|
|
313
|
+
return lines;
|
|
290
314
|
}
|
|
291
315
|
/**
|
|
292
|
-
* What the sentinel is told of a host's check:
|
|
293
|
-
* specs to test, with what each says and its scenarios, as turri reads them now.
|
|
316
|
+
* What the sentinel is told of a host's check: what is launched of the module - what runs, and where - and the
|
|
317
|
+
* functional specs to test, with what each says and its scenarios, as turri reads them now.
|
|
294
318
|
*/
|
|
295
319
|
export function sentinelCheckBrief(check, context) {
|
|
296
320
|
const lines = [
|
|
297
|
-
`Check ${check.id}: the person asked you to check ${check.funcIds.length === 1 ? "a functional spec" : `${check.funcIds.length} functional specs`} of ${check.module}, in
|
|
321
|
+
`Check ${check.id}: the person asked you to check ${check.funcIds.length === 1 ? "a functional spec" : `${check.funcIds.length} functional specs`} of ${check.module}, in what is launched of it.`,
|
|
298
322
|
];
|
|
299
323
|
if (context.focused !== undefined)
|
|
300
324
|
lines.push(`The person is in the chat "${context.focused}": a notice goes there.`);
|
|
301
|
-
lines.push("",
|
|
325
|
+
lines.push("", `What is launched of ${check.module} holds its code and that of every module its requires chain builds on${context.commit !== undefined ? `, at its commit ${context.commit}` : ""} - a commit that landed whole, never what a pulse is writing now.${context.failed !== undefined ? "" : " What runs now:"}`, ...(context.failed !== undefined
|
|
326
|
+
? [
|
|
327
|
+
`Its last launch, ${context.failed.id}, did not come up: ${context.failed.summary ?? "the launch agent did not say why"}`,
|
|
328
|
+
"That is what you find out about: the launch did not come up. Test nothing in its place.",
|
|
329
|
+
]
|
|
330
|
+
: whatRuns(context.running, context.dir)), LAUNCHED_ONLY, "", `Test these functional specs of ${check.module} - only these, not its others, though they run too:`);
|
|
302
331
|
for (const spec of context.specs) {
|
|
303
332
|
lines.push("", `# ${spec.funcId}`, spec.text);
|
|
304
333
|
for (const [title, scenarios] of [["Conformance scenarios", spec.conformance], ["Acceptance scenarios", spec.acceptance]]) {
|
|
@@ -439,7 +468,7 @@ export function notifyTool(notify) {
|
|
|
439
468
|
ignorable: Type.Optional(Type.Boolean({
|
|
440
469
|
description: "true when the person may reasonably leave it as the build has it, for good: chiefly a gap in the ***plain the build settled with an " +
|
|
441
470
|
"assumption - then say the gap in the summary and what the build does in the evidence (the ***plain does not say what happens to " +
|
|
442
|
-
"passwords over 72 bytes; the build refuses them with 422). Never for something broken, a pulse that went wrong, or a
|
|
471
|
+
"passwords over 72 bytes; the build refuses them with 422). Never for something broken, a pulse that went wrong, or a launch that did not come up.",
|
|
443
472
|
})),
|
|
444
473
|
}),
|
|
445
474
|
async execute(_id, params) {
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ExtensionAPI, type ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { type Setting } from "./config-edit.ts";
|
|
3
3
|
/**
|
|
4
|
-
* `/
|
|
5
|
-
* `/
|
|
4
|
+
* `/settings`: every setting of the project's config.turri.yaml from the chat - `/settings` alone lists them,
|
|
5
|
+
* `/settings review` asks for review's value, `/settings review false` sets it. Each is written into the file
|
|
6
6
|
* and takes effect as it says - now, at your next message, at the next pulse - never only once turri starts again:
|
|
7
|
-
* what turri fixes at its start is changed live here (live).
|
|
7
|
+
* what turri fixes at its start is changed live here (live). It takes pi's own /settings over (pi-settings.ts), whose
|
|
8
|
+
* menu is its last entry.
|
|
9
|
+
*
|
|
10
|
+
* The chat's `settings` tool reads them and changes them as the person asks - into config.turri.yaml, or a module's
|
|
11
|
+
* own config.turri.<module>.yaml - a model checked as it is written, by the name the person said. What is the person's
|
|
12
|
+
* alone (`personOnly`) it refuses, and points to /settings.
|
|
8
13
|
*/
|
|
9
14
|
/** What a change does to turri as it runs, beside the file: each says what it did, or nothing. */
|
|
10
15
|
export interface LiveHooks {
|
|
11
16
|
/** The chat's model is now this - provider/id:thinking - or, undefined, no longer set in the file. */
|
|
12
17
|
chatModel(spec: string | undefined, ctx: ExtensionContext): Promise<string | undefined>;
|
|
13
|
-
/** The coding model changed in the file: one
|
|
18
|
+
/** The coding model changed in the file: one given for this session - --coding-model - gives way to it. */
|
|
14
19
|
codingModel(): string | undefined;
|
|
15
20
|
/** How many pulses run at once: the number, or the machine's default. */
|
|
16
21
|
parallelJobs(count: number | undefined): string | undefined;
|
|
17
22
|
}
|
|
18
|
-
export interface
|
|
23
|
+
export interface SettingsOptions {
|
|
19
24
|
/** The folder whose config.turri.yaml the chat reads. */
|
|
20
25
|
cwd: string;
|
|
21
26
|
/** The ***plain rules there are, by name - what rules-off takes. */
|
|
@@ -27,7 +32,7 @@ export interface TurriConfigOptions {
|
|
|
27
32
|
/** The models pi can reach here, signed in: provider/id - from a chat's context, the model registry the chats use. */
|
|
28
33
|
export declare function reachable(ctx: ExtensionContext | undefined): string[];
|
|
29
34
|
/**
|
|
30
|
-
* Every value /
|
|
35
|
+
* Every value /settings offers for a setting after what is typed, in its order - "unset" left out, and uncapped: what
|
|
31
36
|
* its completions show, the first of them, and what a host's settings list shows (host-session.ts `settingChoices`).
|
|
32
37
|
* A model setting's are every model pi can reach, signed in - `models` - and after a colon, that model's thinking levels.
|
|
33
38
|
*/
|
|
@@ -37,4 +42,4 @@ export declare function settingCandidates(setting: Setting, typed: string, where
|
|
|
37
42
|
}): string[];
|
|
38
43
|
/** The ***plain rules there are, by name - what rules-off takes, and its values. */
|
|
39
44
|
export declare function ruleNames(): string[];
|
|
40
|
-
export declare function
|
|
45
|
+
export declare function registerSettings(pi: ExtensionAPI, options: SettingsOptions): void;
|