@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.
Files changed (115) hide show
  1. package/README.md +5 -6
  2. package/dist/bedrock-region.js +3 -3
  3. package/dist/chat-models.d.ts +1 -1
  4. package/dist/chat-models.js +1 -1
  5. package/dist/chat-scope.d.ts +1 -3
  6. package/dist/chat-skills.d.ts +1 -1
  7. package/dist/chat-skills.js +1 -1
  8. package/dist/chats.d.ts +44 -10
  9. package/dist/chats.js +125 -41
  10. package/dist/cli.js +7 -24
  11. package/dist/config-edit.d.ts +20 -8
  12. package/dist/config-edit.js +32 -24
  13. package/dist/config.d.ts +90 -60
  14. package/dist/config.js +224 -117
  15. package/dist/conform-cli.js +1 -1
  16. package/dist/conformance-switch.d.ts +7 -6
  17. package/dist/conformance-switch.js +16 -16
  18. package/dist/extension.d.ts +10 -1
  19. package/dist/extension.js +263 -306
  20. package/dist/genome.js +1 -1
  21. package/dist/host-session.d.ts +8 -7
  22. package/dist/host-session.js +4 -4
  23. package/dist/host.d.ts +3 -1
  24. package/dist/host.js +3 -3
  25. package/dist/identity.js +2 -2
  26. package/dist/init-config.d.ts +1 -1
  27. package/dist/init-config.js +8 -8
  28. package/dist/launch-agent.d.ts +51 -0
  29. package/dist/launch-agent.js +267 -0
  30. package/dist/{release-cli.js → launch-cli.js} +41 -24
  31. package/dist/launch-session.d.ts +68 -0
  32. package/dist/launch-session.js +217 -0
  33. package/dist/launch-tools.d.ts +28 -0
  34. package/dist/launch-tools.js +69 -0
  35. package/dist/launch-track.d.ts +125 -0
  36. package/dist/launch-track.js +320 -0
  37. package/dist/loop-cli.js +4 -4
  38. package/dist/loop-tools.d.ts +17 -16
  39. package/dist/loop-tools.js +69 -69
  40. package/dist/notice.d.ts +7 -6
  41. package/dist/parse-cli.js +2 -2
  42. package/dist/pi-launch.js +3 -0
  43. package/dist/pi-settings.d.ts +4 -0
  44. package/dist/pi-settings.js +39 -0
  45. package/dist/pi.js +3 -3
  46. package/dist/plain/check.d.ts +1 -1
  47. package/dist/plain/check.js +3 -1
  48. package/dist/plain-files.d.ts +2 -2
  49. package/dist/plain-files.js +7 -7
  50. package/dist/regenerate/agent-env.d.ts +1 -1
  51. package/dist/regenerate/agent-env.js +3 -3
  52. package/dist/regenerate/agent-shell.js +2 -2
  53. package/dist/regenerate/base-folder.d.ts +2 -2
  54. package/dist/regenerate/base-folder.js +1 -1
  55. package/dist/regenerate/command-check.d.ts +7 -1
  56. package/dist/regenerate/command-check.js +43 -1
  57. package/dist/regenerate/delivery.d.ts +1 -1
  58. package/dist/regenerate/delivery.js +3 -3
  59. package/dist/regenerate/jobs.d.ts +2 -2
  60. package/dist/regenerate/jobs.js +10 -10
  61. package/dist/regenerate/launch.d.ts +154 -0
  62. package/dist/regenerate/{release.js → launch.js} +195 -51
  63. package/dist/regenerate/ledger.d.ts +33 -2
  64. package/dist/regenerate/lineage.d.ts +2 -0
  65. package/dist/regenerate/lineage.js +8 -0
  66. package/dist/regenerate/loop.d.ts +9 -8
  67. package/dist/regenerate/loop.js +43 -40
  68. package/dist/regenerate/model-names.d.ts +33 -0
  69. package/dist/regenerate/{engine.js → model-names.js} +2 -28
  70. package/dist/regenerate/paths.d.ts +3 -3
  71. package/dist/regenerate/paths.js +4 -4
  72. package/dist/regenerate/scripts-being-written.d.ts +4 -4
  73. package/dist/regenerate/scripts-being-written.js +3 -3
  74. package/dist/regenerate/test-scripts.d.ts +2 -1
  75. package/dist/regenerate/test-scripts.js +33 -23
  76. package/dist/regenerate/testing-steps.d.ts +6 -6
  77. package/dist/regenerate/testing-steps.js +8 -8
  78. package/dist/self-invocation.js +7 -7
  79. package/dist/sentinel-check.d.ts +3 -3
  80. package/dist/sentinel-check.js +3 -3
  81. package/dist/sentinel.d.ts +18 -12
  82. package/dist/sentinel.js +68 -42
  83. package/dist/{config-command.d.ts → settings.d.ts} +13 -8
  84. package/dist/{config-command.js → settings.js} +155 -24
  85. package/dist/setup.d.ts +2 -2
  86. package/dist/setup.js +7 -7
  87. package/docs/README.md +4 -4
  88. package/docs/chats.md +5 -6
  89. package/docs/claude-subscription.md +2 -2
  90. package/docs/config.md +58 -46
  91. package/docs/development.md +2 -2
  92. package/docs/headless.md +2 -3
  93. package/docs/hosting.md +20 -19
  94. package/docs/launch.md +67 -0
  95. package/docs/parser.md +2 -2
  96. package/docs/regenerating.md +12 -12
  97. package/docs/sandbox.md +3 -3
  98. package/docs/sentinel.md +26 -14
  99. package/docs/skills-and-gates.md +4 -5
  100. package/docs/using.md +15 -24
  101. package/genome/rules/project-model.md +2 -1
  102. package/genome/rules/turri-regeneration.md +3 -2
  103. package/genome/skills/implement-conformance-testing-script/SKILL.md +2 -2
  104. package/genome/skills/implement-unit-testing-script/SKILL.md +3 -3
  105. package/package.json +1 -1
  106. package/dist/regenerate/engine.d.ts +0 -52
  107. package/dist/regenerate/release.d.ts +0 -121
  108. package/dist/release-agent.d.ts +0 -43
  109. package/dist/release-agent.js +0 -130
  110. package/dist/release-tools.d.ts +0 -44
  111. package/dist/release-tools.js +0 -170
  112. package/dist/stacks.d.ts +0 -13
  113. package/dist/stacks.js +0 -96
  114. package/docs/deploy.md +0 -48
  115. /package/dist/{release-cli.d.ts → launch-cli.d.ts} +0 -0
@@ -15,7 +15,7 @@ const TOOL_FOR = {
15
15
  regenerate: "regenerate",
16
16
  conform: "conform",
17
17
  cultivate: "cultivate",
18
- release: "release",
18
+ launch: "launch",
19
19
  chat: "nothing - you are the conversation already",
20
20
  ask: "nothing - you are the conversation already",
21
21
  };
@@ -32,7 +32,7 @@ const ENTRY = {
32
32
  "regenerate-cli": "regenerate",
33
33
  "conform-cli": "conform",
34
34
  "cultivate-cli": "cultivate",
35
- "release-cli": "release",
35
+ "launch-cli": "launch",
36
36
  };
37
37
  /** Where a command starts: the start of the string, or after a separator. */
38
38
  const AT_COMMAND = String.raw `(?:^|[\s;&|()\x60$])`;
@@ -42,10 +42,10 @@ const AT_COMMAND = String.raw `(?:^|[\s;&|()\x60$])`;
42
42
  * agent - and neither are setup and doctor.
43
43
  */
44
44
  export function selfInvocation(command) {
45
- const cli = new RegExp(`${AT_COMMAND}(?:npx\\s+)?turri\\s+(regenerate|conform|cultivate|release)\\b`).exec(command);
45
+ const cli = new RegExp(`${AT_COMMAND}(?:npx\\s+)?turri\\s+(regenerate|conform|cultivate|launch)\\b`).exec(command);
46
46
  if (cli)
47
47
  return cli[1];
48
- const launcher = new RegExp(`(?:bin/turri\\.mjs|src/cli\\.ts)\\s+(regenerate|conform|cultivate|release)\\b`).exec(command);
48
+ const launcher = new RegExp(`(?:bin/turri\\.mjs|src/cli\\.ts)\\s+(regenerate|conform|cultivate|launch)\\b`).exec(command);
49
49
  if (launcher)
50
50
  return launcher[1];
51
51
  // turri alone, or with options, is the conversation - where a command starts, not a word an argument names (`which turri`).
@@ -82,7 +82,7 @@ const PI_CONFIGURES = new Set([
82
82
  export function askedForCommandLine(message) {
83
83
  const text = message.toLowerCase();
84
84
  return (/\b(headless|command[ -]line|cli|terminal|shell|in bash|via bash|through bash|npm run|nohup)\b/.test(text) ||
85
- /\bturri\s+(regenerate|conform|cultivate|release)\b/.test(text) ||
85
+ /\bturri\s+(regenerate|conform|cultivate|launch)\b/.test(text) ||
86
86
  /(^|\s)turri\s+-p\b/.test(text) ||
87
87
  /(^|\s)pi\s+-p\b/.test(text));
88
88
  }
@@ -100,8 +100,8 @@ export function refusal(what, surface) {
100
100
  export const TOOLS_NOT_CLI = [
101
101
  "<turri-tools>",
102
102
  "In this conversation, you do your work with your tools - regenerate, conform, cultivate and the rest - which run as",
103
- "background jobs the user can watch and halt. To try what is regenerated, release it - never by hand in plain_modules. Never",
104
- "run your own command line (turri regenerate, conform, cultivate, release, turri itself; npm run",
103
+ "background jobs the user can watch and halt. To try what is regenerated, launch it - never by hand in plain_modules. Never",
104
+ "run your own command line (turri regenerate, conform, cultivate, launch, turri itself; npm run",
105
105
  "regenerate and the like) or start another pi through bash:",
106
106
  "that is a separate headless run the user cannot see or stop. Only when the user explicitly asks for the",
107
107
  "command line, run it. Configuring pi itself - turri install, update, remove, list; pi install, update, list, config, auth; or its settings files -",
@@ -1,7 +1,7 @@
1
1
  import type { SentinelCheck } from "./notice.ts";
2
2
  /**
3
- * A check a host asks the sentinel for (docs/sentinel.md): functional specs of one module, tested in the module's release -
4
- * its own codebase's last commit, which holds the code of every module its requires chain builds on. Refused before it is
3
+ * A check a host asks the sentinel for (docs/sentinel.md): functional specs of one module, tested in what is launched of
4
+ * it - its own codebase's code, which holds the code of every module its requires chain builds on. Refused before it is
5
5
  * queued when there is nothing to test: a module that is not there or does not parse, a func-id it does not have, one
6
6
  * not built in its codebase as its ***plain has it now.
7
7
  */
@@ -10,7 +10,7 @@ export interface CheckRequest {
10
10
  module: string;
11
11
  /**
12
12
  * The functional specs to test, each `module:func-id` - of the module, or of any module its requires chain builds on,
13
- * whose code its release holds. A bare func-id is the module's own.
13
+ * whose code its codebase holds. A bare func-id is the module's own.
14
14
  */
15
15
  funcIds: string[];
16
16
  }
@@ -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 release. Check a module that imports it.` };
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 release holds: the module and the modules its requires chain builds on.
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)} release: ${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` +
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
  }
@@ -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 { DeployedProcess } from "./regenerate/release.ts";
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 `release-after-pulse` on, tests what was released - finds out why when something is wrong, and
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, released: DeployedProcess[], options?: {
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 a release with the host's tools.
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 was released. */
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
- released: DeployedProcess[];
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: the module and its release - what runs, and where - and the functional
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
- released: DeployedProcess[];
65
+ running: LaunchedProcess[];
64
66
  commit?: string;
65
- releasedNow: boolean;
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 `release-after-pulse` on, tests what was released - finds out why when something is wrong, and
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 released = false;
39
+ let launched = false;
39
40
  try {
40
- released = readProjectConfig(cwd).releaseAfterPulse === true;
41
+ launched = readProjectConfig(cwd).launchAfterPulse === true;
41
42
  }
42
43
  catch {
43
- /* a config that cannot be read releases nothing */
44
+ /* a config that cannot be read launches nothing */
44
45
  }
45
- const what = `a background tab that reviews each finished pulse${released ? " and tries to use what was released" : ""}`;
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 released.",
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, released, options = {}) {
136
- const wasReleased = job.details?.released === true;
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 - checked it after it landed${wasReleased ? `, and tested what was released${where !== "" ? ` (${where})` : ""}` : ""}; the person was shown that it landed. The pulse is the sentinel's: nothing is to be tested, released, opened or run for it here.`,
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
- `The sentinel - a chat of my own beside this one - is checking it now${wasReleased ? `, and testing what was released${where !== "" ? ` (${where})` : ""}` : ""}. 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
+ `${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${wasReleased ? " and testing the release" : ""}. Do nothing else about it: the pulse is the sentinel's now. Do not test it, release 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
+ `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 a release with the host's tools.
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,22 +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 released. The person does not watch you: they are in another chat, and", "hear from you only through notify_person."]
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 released. The person can watch you try a release, where the host shows it;",
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 released (the message says so - release-after-pulse is on), test what was released: it is running",
184
- " where the message says. How far you test is yours to judge, from what the pulse changed and what the ***plain says",
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",
185
188
  " it should do: that it came up, answers, and does what its ***plain diff says it now does. Where the ***plain picks",
186
189
  " one way among several - which of a tie comes first, how a default is chosen - try an input on which the ways give",
187
190
  " different answers, so a pass shows the ***plain's way and no other: a tie whose first word is also first",
188
191
  " alphabetically tells \"first in the file\" from nothing.",
189
- "3. When something is wrong - the pulse failed or stopped, it did not pass, the release did not come up, the software",
192
+ "3. When something is wrong - the pulse failed or stopped, it did not pass, the launch did not come up, the software",
190
193
  " does not do what its ***plain says - find out why. Then:",
191
194
  " - When it is the project's tooling - a testing script, or where config.turri.yaml says the scripts are and which",
192
195
  " toolchain folders the agents may read (toolchains:) - fix it yourself, with edit: a script calling python3 where",
@@ -201,19 +204,19 @@ export function sentinelPrompt(cwd, options = {}) {
201
204
  " the person runs themselves (`brew install node`), and make the action resuming once they have.",
202
205
  " When it is a gap in the ***plain the build settled with an assumption - something the person may reasonably leave",
203
206
  " as it is - say so with ignorable: the gap in the summary, what the build does in the evidence. Never for",
204
- " something broken, a pulse that went wrong, or a release that did not come up.",
207
+ " something broken, a pulse that went wrong, or a launch that did not come up.",
205
208
  "4. When all is well, notify no one.",
206
209
  "5. Last, call conclude once for it - holds or wrong, and in a line or two what you checked and what you found:",
207
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.",
208
211
  "",
209
- "For a check: the person picked functional specs of a module for you to test in its release, which runs where the",
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",
210
213
  "message says. Test those - what each says and its scenarios - not the module's other functional specs. Notify the",
211
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.",
212
215
  "",
213
216
  "You fix the project's tooling and nothing else. Your file tools read the whole project; write and edit reach only the",
214
217
  "testing scripts and config.turri.yaml - and in it only where the scripts are, and toolchains:. Your shell runs with",
215
- "the project read only; the files you try a release 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,",
216
- "release, or regenerate but by resume after a fix of yours. You install nothing on this machine and change none of",
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",
217
220
  "its settings, nor the person's shell - under no circumstances: that is always the person's, said in a notice. You",
218
221
  "never ask the person questions - a notice is how you reach them.",
219
222
  "",
@@ -228,7 +231,7 @@ export function sentinelPrompt(cwd, options = {}) {
228
231
  "<surface>",
229
232
  surface,
230
233
  "</surface>",
231
- `Try a release with ${theirs}, where the person can watch. Keep your shell for what those cannot show - logs, exit`,
234
+ `Try what is launched with ${theirs}, where the person can watch. Keep your shell for what those cannot show - logs, exit`,
232
235
  "codes, files.",
233
236
  ]
234
237
  : tools.length > 0
@@ -238,7 +241,7 @@ export function sentinelPrompt(cwd, options = {}) {
238
241
  ...(guidance !== "" ? ["", "<guidance>", "What the person told you to keep in mind:", guidance, "</guidance>"] : []),
239
242
  ].join("\n");
240
243
  }
241
- /** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what was released. */
244
+ /** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what runs of it. */
242
245
  export function sentinelBrief(job, context) {
243
246
  const view = (() => {
244
247
  try {
@@ -269,13 +272,8 @@ export function sentinelBrief(job, context) {
269
272
  lines.push("", "Its ***plain diff:", job.diff.trimEnd());
270
273
  if (job.logFile !== undefined)
271
274
  lines.push("", `Its log: ${job.logFile}`);
272
- const released = job.details?.released === true;
273
- if (released) {
274
- lines.push("", "It was released, as its last stage (release-after-pulse). What runs now:", ...whatRuns(context.released), "Test it.");
275
- }
276
- else if (job.status === "succeeded" && !didNotPass(job)) {
277
- 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.");
278
- }
275
+ if (job.status === "succeeded" && !didNotPass(job))
276
+ lines.push("", ...launchLines(job, context.launch));
279
277
  if (job.specConflict !== undefined) {
280
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.");
281
279
  }
@@ -285,23 +283,51 @@ export function sentinelBrief(job, context) {
285
283
  lines.push("", `When you are done with it, call conclude for ${job.id} - whether all is well or not.`);
286
284
  return lines.join("\n");
287
285
  }
288
- /** What runs of a release, a line each: where, from where, its output - or that nothing was left running. */
289
- function whatRuns(released) {
290
- if (released.length === 0)
291
- return [" nothing is running for it: the release did not leave anything running."];
292
- return released.map((item) => ` ${item.name}: ${item.url ?? item.command} - in ${item.dir}, its output in ${item.log}`);
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;
293
314
  }
294
315
  /**
295
- * What the sentinel is told of a host's check: the module and its release - what runs, and where - and the functional
296
- * 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.
297
318
  */
298
319
  export function sentinelCheckBrief(check, context) {
299
320
  const lines = [
300
- `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 its release.`,
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.`,
301
322
  ];
302
323
  if (context.focused !== undefined)
303
324
  lines.push(`The person is in the chat "${context.focused}": a notice goes there.`);
304
- lines.push("", `${check.module}'s release holds its code and that of every module its requires chain builds on: its last commit${context.commit !== undefined ? `, ${context.commit}` : ""}, which landed whole - never what a pulse is writing now.`, context.releasedNow ? "It was released for this check. What runs now:" : "What runs was released from that commit already, and is left as it is. What runs now:", ...whatRuns(context.released), "", `Test these functional specs of ${check.module} - only these, not its others, though they are in the release too:`);
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:`);
305
331
  for (const spec of context.specs) {
306
332
  lines.push("", `# ${spec.funcId}`, spec.text);
307
333
  for (const [title, scenarios] of [["Conformance scenarios", spec.conformance], ["Acceptance scenarios", spec.acceptance]]) {
@@ -442,7 +468,7 @@ export function notifyTool(notify) {
442
468
  ignorable: Type.Optional(Type.Boolean({
443
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 " +
444
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 " +
445
- "passwords over 72 bytes; the build refuses them with 422). Never for something broken, a pulse that went wrong, or a release that did not come up.",
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.",
446
472
  })),
447
473
  }),
448
474
  async execute(_id, params) {
@@ -1,21 +1,26 @@
1
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
1
+ import { type ExtensionAPI, type ExtensionContext } from "@earendil-works/pi-coding-agent";
2
2
  import { type Setting } from "./config-edit.ts";
3
3
  /**
4
- * `/turri-config`: every setting of the project's config.turri.yaml from the chat - `/turri-config` alone lists them,
5
- * `/turri-config review` asks for review's value, `/turri-config review false` sets it. Each is written into the file
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 chosen this session - --coding-model, engine - gives way to it. */
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 TurriConfigOptions {
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 /turri-config offers for a setting after what is typed, in its order - "unset" left out, and uncapped: what
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 registerTurriConfig(pi: ExtensionAPI, options: TurriConfigOptions): void;
45
+ export declare function registerSettings(pi: ExtensionAPI, options: SettingsOptions): void;