@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/loop-tools.js
CHANGED
|
@@ -3,11 +3,14 @@ import { refuseTestPlainFile } from "./test-plain-files.js";
|
|
|
3
3
|
import { basename, relative, resolve } from "node:path";
|
|
4
4
|
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
5
5
|
import { Type } from "typebox";
|
|
6
|
-
import { CONFIG_FILE, readProjectConfig,
|
|
6
|
+
import { CONFIG_FILE, readProjectConfig, moduleConfigFile, configModuleFor, moduleConfigsOf, withConfigModule } from "./config.js";
|
|
7
7
|
import { checkPlainFile, formatCheckResults } from "./plain/check.js";
|
|
8
8
|
import { describeDrift, describeModules } from "./regenerate/loop.js";
|
|
9
|
-
import { pulseName } from "./regenerate/jobs.js";
|
|
10
|
-
import {
|
|
9
|
+
import { describeJob, pulseName } from "./regenerate/jobs.js";
|
|
10
|
+
import { currentChat } from "./chat-scope.js";
|
|
11
|
+
import { whyFailed } from "./regenerate/diagnose-job.js";
|
|
12
|
+
import { didNotLand } from "./regenerate/failure-reports.js";
|
|
13
|
+
import { runningLaunched, stopLaunched } from "./regenerate/launch.js";
|
|
11
14
|
import { projectDirOf } from "./regenerate/paths.js";
|
|
12
15
|
import { findTestScripts } from "./regenerate/test-scripts.js";
|
|
13
16
|
import { surfaceOf } from "./surface.js";
|
|
@@ -23,43 +26,42 @@ export const WORKING_DIR_PARAM = Type.Optional(Type.String({
|
|
|
23
26
|
}));
|
|
24
27
|
export const MODEL_PARAM = Type.Optional(Type.String({
|
|
25
28
|
description: "The model for the agents of this one call: a provider/model-id, or its name as the user said it. " +
|
|
26
|
-
"Omitted: the model
|
|
27
|
-
"To change it for every later pulse,
|
|
28
|
-
}));
|
|
29
|
-
export const STACK_PARAM = Type.Optional(Type.String({
|
|
30
|
-
description: "In a project of stacks: the stack that builds this module - its config.turri.<stack>.yaml over config.turri.yaml, " +
|
|
31
|
-
"its testing scripts, toolchains and models - for every pulse of it, whatever stack is chosen later. \"none\": " +
|
|
32
|
-
"config.turri.yaml alone. Omitted: the stack named after the module - config.turri.backend.yaml for backend.plain - " +
|
|
33
|
-
"else the one chosen now.",
|
|
29
|
+
"Omitted: the coding model the module's config names, else the conversation's. " +
|
|
30
|
+
"To change it for every later pulse, set coding-model with settings instead.",
|
|
34
31
|
}));
|
|
35
32
|
/**
|
|
36
|
-
* Why a module
|
|
37
|
-
*
|
|
38
|
-
*
|
|
33
|
+
* Why a module cannot be built with the config it would be built with: two of the modules it requires have a config
|
|
34
|
+
* file of their own (`configModuleFor`); or, in a project where modules have their own files, it has none - nor any
|
|
35
|
+
* module it requires - and config.turri.yaml alone names no unit testing script, so every pulse would stop for want of
|
|
36
|
+
* one. The files there are and the script each names, and what to do. Undefined when it can be built.
|
|
39
37
|
*/
|
|
40
|
-
export function
|
|
38
|
+
export function unbuildableConfig(plainFile) {
|
|
41
39
|
const root = projectDirOf(plainFile);
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
let own;
|
|
41
|
+
try {
|
|
42
|
+
own = configModuleFor(plainFile);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
return error instanceof Error ? error.message : String(error);
|
|
46
|
+
}
|
|
47
|
+
const files = moduleConfigsOf(root);
|
|
48
|
+
if (files.length === 0 || own !== undefined || findTestScripts(root).unit !== undefined)
|
|
44
49
|
return undefined;
|
|
45
|
-
const scripts =
|
|
46
|
-
const unit =
|
|
47
|
-
return `${each}${unit !== undefined ? ` (${
|
|
50
|
+
const scripts = files.map((each) => {
|
|
51
|
+
const unit = withConfigModule(each, () => findTestScripts(root).unit);
|
|
52
|
+
return `${moduleConfigFile(each)}${unit !== undefined ? ` (${relative(root, unit)})` : ""}`;
|
|
48
53
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
`
|
|
54
|
+
const name = basename(plainFile, ".plain");
|
|
55
|
+
return (`${basename(plainFile)} would be built with ${CONFIG_FILE} alone - it has no ${moduleConfigFile(name)}, and none of the ` +
|
|
56
|
+
`modules it requires has one - and that names no unit testing script, so every pulse would stop. The modules' own ` +
|
|
57
|
+
`files: ${scripts.join(", ")}. Name its testing scripts in its own file - the settings tool, with module ${basename(plainFile)} - ` +
|
|
58
|
+
`or ask the user which, when the ***plain does not make it plain.`);
|
|
52
59
|
}
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (named !== undefined)
|
|
59
|
-
return withStack(stackNamed(projectDirOf(plainFile), named), work);
|
|
60
|
-
const stackless = stacklessBuild(plainFile);
|
|
61
|
-
if (stackless !== undefined)
|
|
62
|
-
throw new Error(`Nothing was started: ${stackless}`);
|
|
60
|
+
/** `work`, once the module asked for can be built with the config it would be built with - refused before anything is planned otherwise (`unbuildableConfig`). */
|
|
61
|
+
export function whenBuildable(plainFile, work) {
|
|
62
|
+
const unbuildable = unbuildableConfig(plainFile);
|
|
63
|
+
if (unbuildable !== undefined)
|
|
64
|
+
throw new Error(`Nothing was started: ${unbuildable}`);
|
|
63
65
|
return work();
|
|
64
66
|
}
|
|
65
67
|
export const WAIT_PARAM = Type.Optional(Type.Boolean({
|
|
@@ -90,13 +92,69 @@ export function fromWorkingDir(cwd, params) {
|
|
|
90
92
|
...(params.build_dir !== undefined ? { build_dir: resolve(base, params.build_dir) } : {}),
|
|
91
93
|
};
|
|
92
94
|
}
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
/** The calls waiting now, by registry. */
|
|
96
|
+
const waits = new WeakMap();
|
|
97
|
+
/** A call in this chat starts waiting, from the pulses there are now. */
|
|
98
|
+
export function startWait(jobs) {
|
|
99
|
+
const wait = { chat: currentChat()?.id, before: new Set(jobs.list().map((job) => job.id)) };
|
|
100
|
+
const set = waits.get(jobs) ?? new Set();
|
|
101
|
+
set.add(wait);
|
|
102
|
+
waits.set(jobs, set);
|
|
103
|
+
return wait;
|
|
104
|
+
}
|
|
105
|
+
/** A call is done waiting: what ends now is told as any pulse's end is. */
|
|
106
|
+
export function endWait(jobs, wait) {
|
|
107
|
+
waits.get(jobs)?.delete(wait);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Whether a pulse that ended is told by a call still waiting in its chat - its agent is told it in that call's reply, so
|
|
111
|
+
* a turn of its own to say it again would only repeat it.
|
|
112
|
+
*/
|
|
113
|
+
export function toldByWaitingCall(jobs, job) {
|
|
114
|
+
for (const wait of waits.get(jobs) ?? [])
|
|
115
|
+
if (wait.chat === job.chat && !wait.before.has(job.id))
|
|
116
|
+
return true;
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
/** A module's why while it waits for a testing script being written (loop.ts SCRIPT_BEING_WRITTEN). */
|
|
120
|
+
const SCRIPT_WAIT = /, which is being written$/;
|
|
121
|
+
/** How often a waiting call looks again while its module waits for a testing script. */
|
|
122
|
+
const SCRIPT_POLL_MS = 500;
|
|
123
|
+
/** How much of each pulse that ran while a call waited is told: the rest is pulses' with its id. */
|
|
124
|
+
const RAN_CHARS = 3_000;
|
|
125
|
+
/**
|
|
126
|
+
* What the loop is doing for a spec's modules, for the conversation - and, waiting, the pulses that ran meanwhile and how
|
|
127
|
+
* each ended, then how each module stands: `ran` is the registry and the call's wait (startWait).
|
|
128
|
+
*/
|
|
129
|
+
export async function loopReply(loop, statuses, wait, ran) {
|
|
130
|
+
try {
|
|
131
|
+
if (wait) {
|
|
132
|
+
await loop.drain();
|
|
133
|
+
// A module held for a testing script being written - beside this call, by a skill run - starts once it is: a call
|
|
134
|
+
// that waits waits for that too, rather than say it waits and end before its pulse runs.
|
|
135
|
+
while (loop.status().some((status) => statuses.some((asked) => asked.plainFile === status.plainFile) && SCRIPT_WAIT.test(status.why ?? ""))) {
|
|
136
|
+
await new Promise((resolve) => setTimeout(resolve, SCRIPT_POLL_MS));
|
|
137
|
+
await loop.drain();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
finally {
|
|
142
|
+
if (ran !== undefined)
|
|
143
|
+
endWait(ran.jobs, ran.wait);
|
|
144
|
+
}
|
|
97
145
|
const now = wait ? loop.status().filter((status) => statuses.some((asked) => asked.plainFile === status.plainFile)) : statuses;
|
|
98
146
|
const jobIds = now.flatMap((status) => (status.running !== undefined ? [status.running.jobId] : []));
|
|
147
|
+
const pulses = wait && ran !== undefined ? ran.jobs.list().filter((job) => job.chat === ran.wait.chat && !ran.wait.before.has(job.id)).sort((a, b) => a.sequence - b.sequence) : [];
|
|
148
|
+
const cut = (text) => (text.length > RAN_CHARS ? `${text.slice(0, RAN_CHARS)}\n… cut short: pulses with its id tells the whole of it` : text);
|
|
99
149
|
const text = [
|
|
150
|
+
...(pulses.length > 0
|
|
151
|
+
? [
|
|
152
|
+
`What ran while you waited - ${pulses.length} pulse${pulses.length === 1 ? "" : "s"}:`,
|
|
153
|
+
...pulses.map((job) => `\n<pulse id="${job.id}" landed="${didNotLand(job) ? "no" : "yes"}">\n${cut(didNotLand(job) ? whyFailed(job) : describeJob(job))}\n</pulse>`),
|
|
154
|
+
"",
|
|
155
|
+
"How each module stands now:",
|
|
156
|
+
]
|
|
157
|
+
: []),
|
|
100
158
|
describeModules(now),
|
|
101
159
|
"",
|
|
102
160
|
wait
|
|
@@ -149,11 +207,11 @@ function plainFileOf(cwd, given, what) {
|
|
|
149
207
|
refuseTestPlainFile(plainFile);
|
|
150
208
|
return plainFile;
|
|
151
209
|
}
|
|
152
|
-
/** Whether a /regenerate's words ask for the module from scratch
|
|
210
|
+
/** Whether a /regenerate's words ask for the module from scratch - its code deleted, and all of it regenerated again - or a /conform's, for its conformance tests written again. */
|
|
153
211
|
export function asksFromScratch(words) {
|
|
154
212
|
return FROM_SCRATCH.test(words);
|
|
155
213
|
}
|
|
156
|
-
/** Whether a /regenerate asking for its module from scratch asks for its whole requires chain with it. */
|
|
214
|
+
/** Whether a /regenerate or /conform asking for its module from scratch asks for its whole requires chain with it. */
|
|
157
215
|
export function asksWholeChain(words) {
|
|
158
216
|
return /\bchain\b|\bevery module\b|\ball (the )?modules\b/i.test(words);
|
|
159
217
|
}
|
|
@@ -178,7 +236,6 @@ export function regenerateTool(options) {
|
|
|
178
236
|
"A change to a file the spec links - an API surface, a mapping document - is a change to the spec: regenerate sees it by itself, and regenerates every functional spec that uses what links it.",
|
|
179
237
|
"Never stop pulses and start them again yourself to follow a spec change: regenerate does it.",
|
|
180
238
|
"Set from_scratch only when the user asks for the module to be regenerated from scratch - started over, its code deleted - in this conversation, or agrees to it when a module's status says it has to start over: never to fix a pulse that did not land.",
|
|
181
|
-
"In a project of stacks - a backend and a frontend, each with its config.turri.<stack>.yaml - a module is built with the stack named after it by itself: backend.plain with config.turri.backend.yaml. Pass stack only for a module whose stack has another name. It is pinned to the module's pulses: a backend and a frontend regenerate side by side, each with its own, without switching the stack chosen. What it says back names the stack each module is built with.",
|
|
182
239
|
'from_scratch "module" takes out the code where the module is built; the modules below keep theirs, and the module starts from a copy of the code below it. "chain" takes out every codebase of its requires chain, the base\'s too, and builds all of it again from the bottom: use it after modules were split, merged or moved (refactor-module), or when the user asks for the whole chain.',
|
|
183
240
|
],
|
|
184
241
|
parameters: Type.Object({
|
|
@@ -192,13 +249,12 @@ export function regenerateTool(options) {
|
|
|
192
249
|
description: "Only when the user asks for it: the module's code and conformance tests deleted - committed first, so its lineage keeps them - and the whole module regenerated from its spec. " +
|
|
193
250
|
'"chain": every module of its requires chain too, built again from the bottom',
|
|
194
251
|
})),
|
|
195
|
-
stack: STACK_PARAM,
|
|
196
252
|
model: MODEL_PARAM,
|
|
197
253
|
wait: WAIT_PARAM,
|
|
198
254
|
}),
|
|
199
255
|
async execute(_id, given, _signal, _onUpdate, ctx) {
|
|
200
256
|
const plainFile = plainFileOf(options.cwd, given, "regenerate");
|
|
201
|
-
return
|
|
257
|
+
return whenBuildable(plainFile, async () => {
|
|
202
258
|
const check = checkPlainFile(plainFile);
|
|
203
259
|
// The parser's message as it gives it, a test plain file out of place, and turri's next step for the old syntax.
|
|
204
260
|
if (!check.ok)
|
|
@@ -206,17 +262,26 @@ export function regenerateTool(options) {
|
|
|
206
262
|
const again = given.funcIds ?? [];
|
|
207
263
|
if (again.length > 0 && given.from_scratch !== undefined)
|
|
208
264
|
throw new Error("Name funcIds or set from_scratch, not both: from scratch regenerates every one of them.");
|
|
209
|
-
|
|
210
|
-
const work = again.length > 0 ? "functionalities" : "spec_changes";
|
|
211
|
-
const model = options.model !== undefined ? options.model(ctx, plainFile, given.model, work) : given.model;
|
|
265
|
+
const model = options.model !== undefined ? options.model(ctx, plainFile, given.model) : given.model;
|
|
212
266
|
const loop = options.loop(ctx);
|
|
213
267
|
const request = { ...(model !== undefined ? { model } : {}), ...(given.guidance !== undefined ? { guidance: given.guidance } : {}) };
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
268
|
+
const wait = options.wait !== undefined ? options.wait(ctx, given.wait) : given.wait === true;
|
|
269
|
+
const waiting = wait && options.jobs !== undefined ? { jobs: options.jobs, wait: startWait(options.jobs) } : undefined;
|
|
270
|
+
let statuses;
|
|
271
|
+
try {
|
|
272
|
+
statuses =
|
|
273
|
+
given.from_scratch !== undefined
|
|
274
|
+
? await loop.fromScratch(plainFile, { ...request, chain: given.from_scratch === "chain" })
|
|
275
|
+
: again.length > 0
|
|
276
|
+
? await loop.regenerateAgain(plainFile, again, request)
|
|
277
|
+
: await loop.bringUp(plainFile, request);
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
if (waiting !== undefined)
|
|
281
|
+
endWait(waiting.jobs, waiting.wait);
|
|
282
|
+
throw error;
|
|
283
|
+
}
|
|
284
|
+
return loopReply(loop, statuses, wait, waiting);
|
|
220
285
|
});
|
|
221
286
|
},
|
|
222
287
|
});
|
|
@@ -244,49 +309,54 @@ export function driftTool(options) {
|
|
|
244
309
|
},
|
|
245
310
|
});
|
|
246
311
|
}
|
|
247
|
-
const
|
|
248
|
-
const HALT_PULSE_PARAMS = Type.Object({
|
|
312
|
+
const HALT_PARAMS = Type.Object({
|
|
249
313
|
job_id: Type.Optional(Type.String({ description: "The pulse's id, or the start of it; a planned row's id (planned-<module>-...), or a module's name, halts the module" })),
|
|
250
314
|
reason: Type.Optional(Type.String({ description: "Why it is halted, kept with it - what the spec now says that it did not, say" })),
|
|
251
|
-
|
|
315
|
+
launched: Type.Optional(Type.String({ description: 'What a launch started, by name; a module\'s name for its launch under way and what it started; or "all"' })),
|
|
252
316
|
});
|
|
253
|
-
/**
|
|
254
|
-
const HALT_ACTIVATED_PARAMS = Type.Object({ activated: ACTIVATED_PARAM });
|
|
255
|
-
/** halt: stop a pulse, or what activate started. */
|
|
317
|
+
/** halt: stop a pulse, a module's planned pulses, a launch under way, or what a launch started. */
|
|
256
318
|
export function haltTool(options) {
|
|
257
319
|
const { jobs } = options;
|
|
258
320
|
return defineTool({
|
|
259
321
|
name: "halt",
|
|
260
322
|
label: "Halt",
|
|
261
|
-
description:
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
"A planned row for a module that is no longer in the project is halted the same way, and dropped.",
|
|
275
|
-
]
|
|
276
|
-
: [],
|
|
277
|
-
parameters: (jobs !== undefined ? HALT_PULSE_PARAMS : HALT_ACTIVATED_PARAMS),
|
|
323
|
+
description: "Halt a pulse, a module's planned pulses, or a launch. A pulse: a queued one never starts, a running one has its " +
|
|
324
|
+
"agent stopped at once, and the pulses queued behind it move up - what a running pulse already changed is rolled back, and what " +
|
|
325
|
+
"it was regenerating counts as not regenerated. A planned row (planned-<module>-...) or a module's name halts the module: its " +
|
|
326
|
+
"running pulse stopped, none of its planned pulses started, and the modules built on it waiting - until it is asked for again " +
|
|
327
|
+
"with regenerate; a spec change does not start it. A module whose .plain file is gone is dropped. launched: what a launch " +
|
|
328
|
+
"started, by name; a module's name, its launch under way and what it started; or all.",
|
|
329
|
+
promptSnippet: "halt a pulse, or a launch and what it started",
|
|
330
|
+
promptGuidelines: [
|
|
331
|
+
"Halt a pulse only when the user asks, or your instructions say to. Name which one, and say which pulses were queued behind it - they will now run.",
|
|
332
|
+
"Halting a planned row halts its whole module - one planned pulse cannot be taken out alone, as the plan is made again from the spec. To build some of it later, or cut it differently, use steer; to drop work, change the spec.",
|
|
333
|
+
"A planned row for a module that is no longer in the project is halted the same way, and dropped.",
|
|
334
|
+
],
|
|
335
|
+
parameters: HALT_PARAMS,
|
|
278
336
|
async execute(_id, params) {
|
|
279
|
-
if (params.job_id === undefined && params.
|
|
280
|
-
throw new Error(
|
|
281
|
-
}
|
|
337
|
+
if (params.job_id === undefined && params.launched === undefined)
|
|
338
|
+
throw new Error("Say what to halt: a job_id, or a launch (launched).");
|
|
282
339
|
const lines = [];
|
|
283
|
-
if (params.job_id !== undefined
|
|
340
|
+
if (params.job_id !== undefined)
|
|
284
341
|
lines.push(stopJob(jobs, params.job_id, params.reason, options.workLoop?.()));
|
|
285
|
-
if (params.
|
|
286
|
-
|
|
287
|
-
lines.push(stopped.length > 0 ? `Halted ${stopped.join(", ")}.` : `Nothing activate started is running${params.activated === "all" ? "" : ` as ${params.activated}`}.`);
|
|
288
|
-
}
|
|
342
|
+
if (params.launched !== undefined)
|
|
343
|
+
lines.push(await haltLaunched(params.launched, options.launches));
|
|
289
344
|
return { content: [{ type: "text", text: lines.join("\n") }], details: {} };
|
|
290
345
|
},
|
|
291
346
|
});
|
|
292
347
|
}
|
|
348
|
+
/** Halt what a launch started by its name, a module's launch under way and what it started, or every one: what was halted, said. */
|
|
349
|
+
export async function haltLaunched(which, launches) {
|
|
350
|
+
const all = which === "all";
|
|
351
|
+
const underWay = launches !== undefined && (all || launches.pending(which) !== undefined) ? await launches.stop(all ? undefined : which) : [];
|
|
352
|
+
const module = !all && runningLaunched(which).length > 0 && !runningLaunched().some((item) => item.name === which);
|
|
353
|
+
const before = runningLaunched();
|
|
354
|
+
const stopped = await stopLaunched(all ? {} : module || underWay.length > 0 ? { moduleName: which } : { name: which });
|
|
355
|
+
// The launches whose servers those were, with nothing of them left running: stopped too - a host hears it, and the next
|
|
356
|
+
// launch of the codebase launches anew.
|
|
357
|
+
const codebases = new Set(before.filter((item) => item.exited !== undefined).map((item) => item.moduleName));
|
|
358
|
+
for (const codebase of codebases)
|
|
359
|
+
launches?.halted(codebase);
|
|
360
|
+
const halted = [...underWay.map((id) => `the launch ${id}`), ...stopped];
|
|
361
|
+
return halted.length > 0 ? `Halted ${halted.join(", ")}.` : `Nothing a launch started is running${all ? "" : ` as ${which}`}, and no launch of it is under way.`;
|
|
362
|
+
}
|
package/dist/notice.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface NoticeInput {
|
|
|
35
35
|
check?: string;
|
|
36
36
|
/**
|
|
37
37
|
* The person may leave it as the build has it, for good (`{ ignore: true }`): a gap in the ***plain the build settled
|
|
38
|
-
* with an assumption - never something broken, a pulse that went wrong, a
|
|
38
|
+
* with an assumption - never something broken, a pulse that went wrong, a launch that did not come up, nor the
|
|
39
39
|
* question whether to start the sentinel.
|
|
40
40
|
*/
|
|
41
41
|
ignorable?: boolean;
|
|
@@ -85,8 +85,9 @@ export declare function describeNotice(notice: NoticeInput): string;
|
|
|
85
85
|
export declare function wentWrong(job: Job): boolean;
|
|
86
86
|
/**
|
|
87
87
|
* The sentinel done with a pulse - or a check a host asked for: whether what it checked holds, and what it checked and
|
|
88
|
-
* found, in a line or two. `unchecked`: a check that never
|
|
89
|
-
* be opened
|
|
88
|
+
* found, in a line or two. `unchecked`: a pulse or a check that was never checked - the person did not start the
|
|
89
|
+
* sentinel, it could not be opened, nothing of the module is launched to test a check in, or what runs cannot hold a
|
|
90
|
+
* pulse's commit - turri's own word, never the sentinel's.
|
|
90
91
|
*/
|
|
91
92
|
export interface Conclusion {
|
|
92
93
|
/** The pulse: its job id. Undefined for a check. */
|
|
@@ -99,12 +100,12 @@ export interface Conclusion {
|
|
|
99
100
|
pulse?: number;
|
|
100
101
|
}
|
|
101
102
|
/**
|
|
102
|
-
* Functional specs of a module a host asked the sentinel to check, in the module
|
|
103
|
-
*
|
|
103
|
+
* Functional specs of a module a host asked the sentinel to check, in what is launched of the module: its codebase's code,
|
|
104
|
+
* which holds every module its requires chain builds on. Queued with the pulses, in a conversation of its own.
|
|
104
105
|
*/
|
|
105
106
|
export interface SentinelCheck {
|
|
106
107
|
id: string;
|
|
107
|
-
/** The module
|
|
108
|
+
/** The module whose launch is tested, by name. */
|
|
108
109
|
module: string;
|
|
109
110
|
plainFile: string;
|
|
110
111
|
/** The functional specs to test, each `module:func-id` - of the module, or of a module its requires chain builds on. */
|
package/dist/parse-cli.js
CHANGED
|
@@ -5,8 +5,8 @@ const USAGE = `usage: turri parse <file.plain | directory> [options]
|
|
|
5
5
|
Parses ***plain - its syntax and structure, never its code or tests: each module with its test plain files,
|
|
6
6
|
its imports and required modules, every error reported without regenerating anything - and every test plain file
|
|
7
7
|
outside its module's folder. A functional spec with no test plain file is not tested. A module whose
|
|
8
|
-
functional specs have scenarios but which has no test reqs, or no conformance testing script
|
|
9
|
-
|
|
8
|
+
functional specs have scenarios but which has no test reqs, or no conformance testing script,
|
|
9
|
+
is a warning: its conformance tests are not written until it has them. A test plain file or
|
|
10
10
|
test folder is refused: name its module.
|
|
11
11
|
|
|
12
12
|
--template-dir <dir> extra template directory (repeatable)
|
package/dist/pi-launch.js
CHANGED
|
@@ -14,6 +14,7 @@ import "./terminal-images.js";
|
|
|
14
14
|
import { withoutResumeLine } from "./resume-line.js";
|
|
15
15
|
import { lastRun } from "./chat-records.js";
|
|
16
16
|
import { driveTerminal } from "./chat-terminal.js";
|
|
17
|
+
import { takeOverSettings } from "./pi-settings.js";
|
|
17
18
|
import turri, { createTurriCore, processSession } from "./extension.js";
|
|
18
19
|
/**
|
|
19
20
|
* pi, started the way its own CLI starts it, for `turri`.
|
|
@@ -42,6 +43,8 @@ ProcessTerminal.prototype.setTitle = function (title) {
|
|
|
42
43
|
// is answered for this run as `quietStartup` is; the line it prints instead, to resume the session, is left out too:
|
|
43
44
|
// `turri --continue` opens the last run again.
|
|
44
45
|
SettingsManager.prototype.getFullscreenExitOutput = () => "resume-hint";
|
|
46
|
+
// /settings is turri's, pi's own menu the last entry of it (pi-settings.ts).
|
|
47
|
+
takeOverSettings();
|
|
45
48
|
const write = process.stdout.write.bind(process.stdout);
|
|
46
49
|
process.stdout.write = ((chunk, ...rest) => write(typeof chunk === "string" ? withoutResumeLine(chunk) : chunk, ...rest));
|
|
47
50
|
// pi's own keys stand: a new line is shift+enter or ctrl+j. turri's side panel is on ctrl+h (job-panel.ts PANEL_KEY).
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Take pi's /settings over: once a process, every chat's screen. */
|
|
2
|
+
export declare function takeOverSettings(): void;
|
|
3
|
+
/** Open pi's own settings menu on the screen /settings was typed on. False where there is none - a host, print mode. */
|
|
4
|
+
export declare function openPiSettings(): boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { InteractiveMode } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
let piMenu;
|
|
3
|
+
/** Take pi's /settings over: once a process, every chat's screen. */
|
|
4
|
+
export function takeOverSettings() {
|
|
5
|
+
if (piMenu !== undefined)
|
|
6
|
+
return;
|
|
7
|
+
const prototype = InteractiveMode.prototype;
|
|
8
|
+
const own = prototype.showSettingsSelector;
|
|
9
|
+
const conflicts = prototype.getBuiltInCommandConflictDiagnostics;
|
|
10
|
+
const completions = prototype.createBaseAutocompleteProvider;
|
|
11
|
+
const menu = { open: (screen) => own.call(screen) };
|
|
12
|
+
piMenu = menu;
|
|
13
|
+
// A bare /settings: turri's, when the extension has one - pi's menu otherwise, as it was.
|
|
14
|
+
prototype.showSettingsSelector = function () {
|
|
15
|
+
if (this.session.extensionRunner.getCommand("settings") === undefined)
|
|
16
|
+
return own.call(this);
|
|
17
|
+
menu.screen = this;
|
|
18
|
+
void this.session.prompt("/settings");
|
|
19
|
+
};
|
|
20
|
+
prototype.getBuiltInCommandConflictDiagnostics = function (runner) {
|
|
21
|
+
return conflicts.call(this, runner).filter((diagnostic) => !diagnostic.message.includes("'/settings'"));
|
|
22
|
+
};
|
|
23
|
+
// The completions: pi's /settings line gives way to turri's, which pi leaves out as a clash.
|
|
24
|
+
prototype.createBaseAutocompleteProvider = function () {
|
|
25
|
+
const provider = completions.call(this);
|
|
26
|
+
const turri = this.session.extensionRunner.getCommand("settings");
|
|
27
|
+
if (turri === undefined)
|
|
28
|
+
return provider;
|
|
29
|
+
provider.commands = provider.commands.map((command) => command.name === "settings" ? { name: "settings", description: turri.description, getArgumentCompletions: turri.getArgumentCompletions } : command);
|
|
30
|
+
return provider;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Open pi's own settings menu on the screen /settings was typed on. False where there is none - a host, print mode. */
|
|
34
|
+
export function openPiSettings() {
|
|
35
|
+
if (piMenu?.screen === undefined)
|
|
36
|
+
return false;
|
|
37
|
+
piMenu.open(piMenu.screen);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
package/dist/pi.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fileURLToPath } from "node:url";
|
|
|
3
3
|
import { createAgentSession, DefaultResourceLoader, getAgentDir, ModelRegistry, SessionManager, } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import { installedProviders, runtimeWithProviders } from "./installed-providers.js";
|
|
5
5
|
import { loadRules, renderRulesBlock } from "./rules.js";
|
|
6
|
-
import { debugMode, inheritModel,
|
|
6
|
+
import { debugMode, inheritModel, configModuleOf, readProjectConfig, ROLE_THINKING, roleModel, roleTurnLimitMs, splitModelSpec } from "./config.js";
|
|
7
7
|
import { maskToolResults } from "./regenerate/masking.js";
|
|
8
8
|
import { withListArguments } from "./regenerate/list-arguments.js";
|
|
9
9
|
import { checkAgainstScript, ENVIRONMENT_ERROR_TOOL, EnvironmentError, environmentErrorTool, sandboxGapOf } from "./regenerate/environment-error.js";
|
|
@@ -317,6 +317,9 @@ async function askOnce(session, text, onDelta) {
|
|
|
317
317
|
reportNow("thinking");
|
|
318
318
|
}
|
|
319
319
|
else if (update.type === "text_start") {
|
|
320
|
+
// Each message of the turn its own paragraph: the agent's words between tool calls never run into each other.
|
|
321
|
+
if (out !== "" && !/\s$/.test(out))
|
|
322
|
+
out += "\n\n";
|
|
320
323
|
reportNow("writing");
|
|
321
324
|
}
|
|
322
325
|
else if (update.type === "toolcall_start") {
|
|
@@ -800,11 +803,11 @@ export async function createExecutor(opts) {
|
|
|
800
803
|
}
|
|
801
804
|
return session;
|
|
802
805
|
}
|
|
803
|
-
/** The config an agent working in `cwd` is under: the project's, with the
|
|
806
|
+
/** The config an agent working in `cwd` is under: the project's, with the pulse's module's own file over it. */
|
|
804
807
|
function configForCwd(cwd) {
|
|
805
808
|
try {
|
|
806
809
|
const root = projectRootOf(cwd);
|
|
807
|
-
return readProjectConfig(root,
|
|
810
|
+
return readProjectConfig(root, configModuleOf(root));
|
|
808
811
|
}
|
|
809
812
|
catch {
|
|
810
813
|
return {};
|
package/dist/plain/check.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the parser can see without generating anything. The parser's errors come one at a time, the first it meets, as the
|
|
7
7
|
* reference gives them. turri's own checks list everything they find at once: every functional spec without a test
|
|
8
8
|
* plain file, and every test plain file that is not where it belongs. A module whose functional specs have scenarios
|
|
9
|
-
* but which has no test reqs, or no conformance testing script
|
|
9
|
+
* but which has no test reqs, or no conformance testing script, passes with a warning.
|
|
10
10
|
*/
|
|
11
11
|
export interface CheckedFunctionalSpec {
|
|
12
12
|
funcId: string;
|
package/dist/plain/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
2
|
import { basename, extname, join, relative, resolve, sep } from "node:path";
|
|
3
|
-
import { testDirOf } from "../config.js";
|
|
3
|
+
import { configModuleFor, testDirOf } from "../config.js";
|
|
4
4
|
import { projectDirOf, resolveTemplateDirs } from "../regenerate/paths.js";
|
|
5
5
|
import { isImportModule } from "../regenerate/requires.js";
|
|
6
6
|
import { testingGap } from "../regenerate/testing-steps.js";
|
|
@@ -114,6 +114,8 @@ export function checkPlainFile(file, templateDirs = []) {
|
|
|
114
114
|
testDir,
|
|
115
115
|
requireTestPlainFiles: false,
|
|
116
116
|
});
|
|
117
|
+
// Two config files among the modules it requires: which one builds it cannot be told - an error, as a syntax one is.
|
|
118
|
+
configModuleFor(path);
|
|
117
119
|
// Scenarios with a step of adding tests skipped - the test reqs, or the conformance testing script: a warning, never a failure.
|
|
118
120
|
const gaps = testingGapsOf(moduleName, path, tree, projectDir, templateDirs);
|
|
119
121
|
// A codebase that requires nothing starts from its base folder: one named and not there stops its first pulse.
|
package/dist/plain-files.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
/**
|
|
3
3
|
* The project's ***plain and what it is built with, and a digest of each: its .plain files, the resources they link,
|
|
4
|
-
* its testing scripts and its config.turri*.yaml. Nothing else is a skill's to change - not the built code, a
|
|
4
|
+
* its testing scripts and its config.turri*.yaml. Nothing else is a skill's to change - not the built code, a launch,
|
|
5
5
|
* what a running app writes. `also`: paths that were among them before, digested while they are there, so one a skill
|
|
6
6
|
* stopped linking or naming is still seen if it changed it.
|
|
7
7
|
*/
|
|
@@ -11,7 +11,7 @@ export declare function changedFiles(before: Map<string, string>, after: Map<str
|
|
|
11
11
|
/**
|
|
12
12
|
* Why a skill's agent may not write a path, or nothing when it may. It writes the project's ***plain: a file of it
|
|
13
13
|
* (`projectFiles`), or a new one - a resource it is about to link, a testing script - anywhere in the project but where
|
|
14
|
-
* what is built,
|
|
14
|
+
* what is built, launched or installed lives. Never an existing file that is not the ***plain's: the code, a launch,
|
|
15
15
|
* what an app it started writes.
|
|
16
16
|
*/
|
|
17
17
|
export declare function plainWriteRefusal(root: string, path: string): string | undefined;
|
package/dist/plain-files.js
CHANGED
|
@@ -2,14 +2,14 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { basename, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { createEditToolDefinition, createWriteToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
5
|
-
import { readProjectConfig,
|
|
5
|
+
import { readProjectConfig, moduleConfigsOf } from "./config.js";
|
|
6
6
|
import { parseMarkdown } from "./plain/markdown.js";
|
|
7
7
|
import { hasScheme, linksIn } from "./plain/parser.js";
|
|
8
8
|
import { insideAny } from "./regenerate/confine.js";
|
|
9
9
|
import { credentialRefusal, isCredentialFile } from "./regenerate/credentials.js";
|
|
10
10
|
import { DIST_DIR, MODULES_DIR } from "./regenerate/paths.js";
|
|
11
11
|
import { PREPARE_NAME, SCRIPTS_DIR, scriptKind } from "./regenerate/test-scripts.js";
|
|
12
|
-
/** A config.turri.yaml, a
|
|
12
|
+
/** A config.turri.yaml, a module's own config.turri.<module>.yaml - what the project's testing scripts are named in. */
|
|
13
13
|
const TURRI_CONFIG_NAME = /^config\.turri(\.[^/]+)?\.yaml$/;
|
|
14
14
|
/** Folders that hold what is built, installed or turri's own - never the project's ***plain. */
|
|
15
15
|
function outsidePlain(path) {
|
|
@@ -18,7 +18,7 @@ function outsidePlain(path) {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* The project's ***plain and what it is built with, and a digest of each: its .plain files, the resources they link,
|
|
21
|
-
* its testing scripts and its config.turri*.yaml. Nothing else is a skill's to change - not the built code, a
|
|
21
|
+
* its testing scripts and its config.turri*.yaml. Nothing else is a skill's to change - not the built code, a launch,
|
|
22
22
|
* what a running app writes. `also`: paths that were among them before, digested while they are there, so one a skill
|
|
23
23
|
* stopped linking or naming is still seen if it changed it.
|
|
24
24
|
*/
|
|
@@ -69,8 +69,8 @@ export function projectFiles(root, also = []) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
// Scripts config.turri*.yaml names, whatever they are called.
|
|
72
|
-
for (const
|
|
73
|
-
const config = readProjectConfig(root,
|
|
72
|
+
for (const module of [undefined, ...moduleConfigsOf(root)]) {
|
|
73
|
+
const config = readProjectConfig(root, module);
|
|
74
74
|
named(config.unittestsScript);
|
|
75
75
|
named(config.conformanceTestsScript);
|
|
76
76
|
named(config.prepareEnvironmentScript);
|
|
@@ -97,7 +97,7 @@ export function changedFiles(before, after) {
|
|
|
97
97
|
/**
|
|
98
98
|
* Why a skill's agent may not write a path, or nothing when it may. It writes the project's ***plain: a file of it
|
|
99
99
|
* (`projectFiles`), or a new one - a resource it is about to link, a testing script - anywhere in the project but where
|
|
100
|
-
* what is built,
|
|
100
|
+
* what is built, launched or installed lives. Never an existing file that is not the ***plain's: the code, a launch,
|
|
101
101
|
* what an app it started writes.
|
|
102
102
|
*/
|
|
103
103
|
export function plainWriteRefusal(root, path) {
|
|
@@ -109,7 +109,7 @@ export function plainWriteRefusal(root, path) {
|
|
|
109
109
|
const inProject = relative(resolve(root), absolute);
|
|
110
110
|
if (outsidePlain(inProject)) {
|
|
111
111
|
return (`${inProject} is not the project's ***plain - ${MODULES_DIR}/, ${DIST_DIR}/ and the hidden folders hold what is ` +
|
|
112
|
-
"built,
|
|
112
|
+
"built, launched and installed, and turri's own. A skill writes .plain files, the resources they link and the testing scripts.");
|
|
113
113
|
}
|
|
114
114
|
if (existsSync(absolute) && !projectFiles(root).has(inProject)) {
|
|
115
115
|
return (`${inProject} is not the project's ***plain: no .plain file links it, and it is not a testing script or a ` +
|
|
@@ -42,7 +42,7 @@ export declare function tidyCaches(scratch: string, keepMb: number): void;
|
|
|
42
42
|
* JVMs' sockets beside it.
|
|
43
43
|
*/
|
|
44
44
|
export declare const DARWIN_TEMP_SUFFIX = "DIRHELPER_USER_DIR_SUFFIX";
|
|
45
|
-
/** What `agent-env:` - the project's, with the
|
|
45
|
+
/** What `agent-env:` - the project's, with the pulse's module's own file's added - passes, and what of it is not there. Reads only. */
|
|
46
46
|
export declare function passedCredentials(module: string, hostEnv: NodeJS.ProcessEnv): {
|
|
47
47
|
values: Record<string, string>;
|
|
48
48
|
missing: MissingCredential[];
|
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { chmodSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { basename, join, resolve } from "node:path";
|
|
5
|
-
import { DEFAULT_CACHE_KEEP_MB, readProjectConfig,
|
|
5
|
+
import { DEFAULT_CACHE_KEEP_MB, readProjectConfig, configModuleOf } from "../config.js";
|
|
6
6
|
import { registerSecrets } from "./masking.js";
|
|
7
7
|
import { projectRootOf, modulesScratchDir } from "./paths.js";
|
|
8
8
|
/**
|
|
@@ -258,10 +258,10 @@ export const DARWIN_TEMP_SUFFIX = "DIRHELPER_USER_DIR_SUFFIX";
|
|
|
258
258
|
function darwinTempSuffix(module, name) {
|
|
259
259
|
return `turri-${name.replace(/[^\w.-]/g, "_")}-${createHash("sha256").update(resolve(module)).digest("hex").slice(0, 8)}`;
|
|
260
260
|
}
|
|
261
|
-
/** What `agent-env:` - the project's, with the
|
|
261
|
+
/** What `agent-env:` - the project's, with the pulse's module's own file's added - passes, and what of it is not there. Reads only. */
|
|
262
262
|
export function passedCredentials(module, hostEnv) {
|
|
263
263
|
const root = projectRootOf(module);
|
|
264
|
-
const setting = readProjectConfig(root,
|
|
264
|
+
const setting = readProjectConfig(root, configModuleOf(root)).agentEnv;
|
|
265
265
|
const values = {};
|
|
266
266
|
const missing = [];
|
|
267
267
|
if (setting === undefined)
|