@turri-dev/cli 0.2.4-next.8422d0f → 0.2.4-next.bc1fc47
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 +3 -3
- package/dist/chat-idle.d.ts +2 -2
- package/dist/chat-idle.js +2 -2
- package/dist/chats.d.ts +0 -10
- package/dist/chats.js +0 -23
- package/dist/cli.js +5 -7
- package/dist/config-edit.js +1 -3
- package/dist/config.d.ts +20 -22
- package/dist/config.js +49 -22
- package/dist/conform-cli.js +13 -2
- package/dist/conformance-switch.d.ts +7 -17
- package/dist/conformance-switch.js +24 -46
- package/dist/drift-cli.js +1 -1
- package/dist/extension.d.ts +8 -10
- package/dist/extension.js +188 -242
- package/dist/genome.js +9 -48
- package/dist/graph.js +3 -5
- package/dist/host-session.d.ts +4 -15
- package/dist/host-session.js +2 -4
- package/dist/host.d.ts +1 -3
- package/dist/host.js +1 -4
- package/dist/identity.js +0 -1
- package/dist/init-config.d.ts +0 -1
- package/dist/init-config.js +2 -9
- package/dist/installed-providers.d.ts +1 -1
- package/dist/installed-providers.js +1 -1
- package/dist/loop-cli.d.ts +4 -3
- package/dist/loop-cli.js +13 -11
- package/dist/loop-tools.d.ts +28 -5
- package/dist/loop-tools.js +87 -22
- package/dist/new-project.js +2 -2
- package/dist/pi-launch.js +1 -1
- package/dist/pi.js +9 -6
- package/dist/plain/check.d.ts +1 -8
- package/dist/plain/check.js +3 -38
- package/dist/regenerate/activity.d.ts +0 -7
- package/dist/regenerate/activity.js +2 -20
- package/dist/regenerate/agent-shell.js +3 -1
- package/dist/regenerate/audit.js +9 -0
- 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/drift.d.ts +4 -0
- package/dist/regenerate/drift.js +26 -6
- package/dist/regenerate/failure-reports.d.ts +28 -0
- package/dist/regenerate/failure-reports.js +79 -0
- package/dist/regenerate/job-panel.js +3 -1
- package/dist/regenerate/jobs-tree.js +1 -1
- package/dist/regenerate/jobs.d.ts +2 -0
- package/dist/regenerate/jobs.js +4 -0
- package/dist/regenerate/ledger-view.d.ts +11 -24
- package/dist/regenerate/ledger-view.js +14 -60
- package/dist/regenerate/ledger.d.ts +1 -14
- package/dist/regenerate/ledger.js +1 -1
- package/dist/regenerate/loop.d.ts +46 -60
- package/dist/regenerate/loop.js +277 -116
- package/dist/regenerate/records.d.ts +11 -0
- package/dist/regenerate/records.js +15 -0
- package/dist/regenerate/regenerate.d.ts +0 -2
- package/dist/regenerate/regenerate.js +4 -15
- 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/spec-map.js +3 -3
- package/dist/regenerate/standing.js +1 -1
- package/dist/regenerate/submit-work.d.ts +2 -0
- package/dist/regenerate/submit-work.js +8 -3
- package/dist/regenerate/testing-steps.d.ts +11 -0
- package/dist/regenerate/testing-steps.js +22 -3
- package/dist/regenerate-cli.js +18 -9
- package/dist/self-invocation.d.ts +11 -0
- package/dist/self-invocation.js +33 -7
- package/dist/sentinel.js +8 -5
- package/dist/skill.d.ts +0 -11
- package/dist/skill.js +0 -9
- package/dist/stacks.js +1 -1
- package/dist/tools.js +2 -3
- package/dist/turri-versions.js +2 -1
- package/docs/README.md +0 -2
- package/docs/authoring-plain.md +3 -3
- package/docs/chats.md +1 -3
- package/docs/config.md +11 -13
- package/docs/deploy.md +1 -1
- package/docs/development.md +2 -3
- package/docs/headless.md +6 -4
- package/docs/hosting.md +6 -6
- package/docs/parser.md +2 -2
- package/docs/regenerating.md +21 -13
- package/docs/sentinel.md +4 -4
- package/docs/skills-and-gates.md +4 -8
- package/docs/using.md +13 -21
- package/genome/rules/test-plain-files.md +15 -7
- package/genome/rules/turri-regeneration.md +4 -8
- package/genome/skills/convert-old-syntax/SKILL.md +5 -5
- package/package.json +1 -1
- package/dist/advisor-chat.d.ts +0 -63
- package/dist/advisor-chat.js +0 -290
- package/dist/change-plain-cli.d.ts +0 -1
- package/dist/change-plain-cli.js +0 -55
- package/dist/ledger-cli.d.ts +0 -1
- package/dist/ledger-cli.js +0 -50
- package/dist/ledger-tools.d.ts +0 -10
- package/dist/ledger-tools.js +0 -64
- package/dist/regenerate/advisor-records.d.ts +0 -93
- package/dist/regenerate/advisor-records.js +0 -110
- package/dist/regenerate/advisor-runs.d.ts +0 -87
- package/dist/regenerate/advisor-runs.js +0 -327
- package/dist/regenerate/test-advisor.d.ts +0 -101
- package/dist/regenerate/test-advisor.js +0 -379
- package/dist/spec-tools.d.ts +0 -36
- package/dist/spec-tools.js +0 -128
- package/docs/test-advisor.md +0 -110
package/dist/extension.js
CHANGED
|
@@ -9,7 +9,7 @@ import { allocateImageId, Box, getCapabilities, getPngDimensions, isKeyRelease,
|
|
|
9
9
|
import { defineTool, getMarkdownTheme, UserMessageComponent } from "@earendil-works/pi-coding-agent";
|
|
10
10
|
import { Type } from "typebox";
|
|
11
11
|
import { CODING_MODEL_ENV } from "./chat-models.js";
|
|
12
|
-
import { AGENT_ROLES, chosenStack, CONFIG_FILE, configForSpec, stackForModule, hasProjectConfig, LEGACY_CONFIG_FILE, projectConfigFile, stackConfigFileIn, stackOf, stacksOf, withStack, modelOnly, modelSpec, projectModels, readProjectConfig, roleModel, splitModelSpec } from "./config.js";
|
|
12
|
+
import { AGENT_ROLES, chosenStack, CONFIG_FILE, configForSpec, stackForModule, hasProjectConfig, LEGACY_CONFIG_FILE, projectConfigFile, stackConfigFileIn, stackOf, stacksOf, withStack, modelOnly, modelSpec, projectModels, readProjectConfig, roleModel, splitModelSpec, unknownConfigLines } from "./config.js";
|
|
13
13
|
import { projectDirOf, skillRunDir } from "./regenerate/paths.js";
|
|
14
14
|
import { sweepOrphanedGroups } from "./regenerate/shell.js";
|
|
15
15
|
import { readScript, scriptAgainstMachine, stackOnMachine, toolchainsBlock } from "./stack.js";
|
|
@@ -18,10 +18,10 @@ import { findTestScripts, scriptKindOfSkill } from "./regenerate/test-scripts.js
|
|
|
18
18
|
import { writingScript } from "./regenerate/scripts-being-written.js";
|
|
19
19
|
import { applyBedrockRegion } from "./bedrock-region.js";
|
|
20
20
|
import { bannerWarnings } from "./turri-versions.js";
|
|
21
|
-
import { conformanceBlock, conformanceTestsOn, conformanceTestsOnIn,
|
|
21
|
+
import { CONFORMANCE_OFF_REFUSAL, conformanceBlock, conformanceTestsOn, conformanceTestsOnIn, turnOnConformanceTests } from "./conformance-switch.js";
|
|
22
22
|
import { BACKGROUND_NOTE, doneLine, failedTask, ownChanges, runDetails, skillRunDelivery, startedText } from "./background-skills.js";
|
|
23
23
|
import { createAskUserTool } from "./tools.js";
|
|
24
|
-
import { asksFromScratch, asksWholeChain, driftTool, fromWorkingDir, haltTool, loopReply, MODEL_PARAM, regenerateTool, STACK_PARAM, stopJob, WAIT_PARAM, withCallStack, WORKING_DIR_PARAM } from "./loop-tools.js";
|
|
24
|
+
import { asksFromScratch, asksWholeChain, driftTool, endWait, fromWorkingDir, haltTool, loopReply, startWait, toldByWaitingCall, MODEL_PARAM, regenerateTool, STACK_PARAM, stopJob, WAIT_PARAM, withCallStack, WORKING_DIR_PARAM } from "./loop-tools.js";
|
|
25
25
|
import { createWebTools } from "./regenerate/web.js";
|
|
26
26
|
import { describeGates, interruptedRun, runSkill } from "./genome.js";
|
|
27
27
|
import { unqueue } from "./chat-waiting.js";
|
|
@@ -38,10 +38,8 @@ import { checkPlainFile, formatCheckResults } from "./plain/check.js";
|
|
|
38
38
|
import { checkPlainTool } from "./parse-tool.js";
|
|
39
39
|
import { changedFiles, projectFiles } from "./plain-files.js";
|
|
40
40
|
import { whyFailed } from "./regenerate/diagnose-job.js";
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import { advisorDir } from "./regenerate/advisor-records.js";
|
|
44
|
-
import { bindAdvisor, evaluateTestsTool, TEST_ADVISOR_BLOCK, verdictDelivery } from "./advisor-chat.js";
|
|
41
|
+
import { didNotLand } from "./regenerate/failure-reports.js";
|
|
42
|
+
import { conformanceRefusal, createWorkLoop, describeModules, isUpToDate } from "./regenerate/loop.js";
|
|
45
43
|
import { brandNeon, brandPink, plainPaint } from "./regenerate/plain-palette.js";
|
|
46
44
|
import { halfBlocks, JELLYFISH_FRAME_MS, JELLYFISH_REST, JELLYFISH_SEQUENCE, JELLYFISH_TEXT_FRAMES } from "./jellyfish.js";
|
|
47
45
|
import { createJobPanel, didNotPass, keyPressed, PANEL_KEY, spinner } from "./regenerate/job-panel.js";
|
|
@@ -54,13 +52,12 @@ import { createSpecMapSource, defaultMapFiles } from "./regenerate/spec-map.js";
|
|
|
54
52
|
import { createSpecMapState } from "./regenerate/spec-map-view.js";
|
|
55
53
|
import { createJobsTreeState, selectJob } from "./regenerate/jobs-tree.js";
|
|
56
54
|
import { describeDiagnosis, diagnoseFailure } from "./regenerate/diagnose.js";
|
|
57
|
-
import { HISTORY_DIR, historyLog
|
|
55
|
+
import { HISTORY_DIR, historyLog } from "./regenerate/lineage.js";
|
|
58
56
|
import { defaultBuildDir } from "./regenerate/paths.js";
|
|
59
57
|
import { describeTurnIncident, describeUsage, JobStoppedError, onModelEvent } from "./regenerate/activity.js";
|
|
60
58
|
import { ledgerWanted, startLedger } from "./regenerate/ledger.js";
|
|
61
59
|
import { describePastPulse, describeRuns, earlierPulses, ledgerProjects } from "./regenerate/ledger-view.js";
|
|
62
60
|
import { doctorTool } from "./doctor-tool.js";
|
|
63
|
-
import { ledgerTool } from "./ledger-tools.js";
|
|
64
61
|
import { describeSpecConflict } from "./regenerate/stop-report.js";
|
|
65
62
|
import { inheritProviders, inheritThinkingLevel } from "./pi.js";
|
|
66
63
|
import { LOADING_PROVIDERS } from "./installed-providers.js";
|
|
@@ -84,7 +81,7 @@ import { currentChat } from "./chat-scope.js";
|
|
|
84
81
|
import { registerChats } from "./chat-commands.js";
|
|
85
82
|
import { turriIdentity } from "./environment.js";
|
|
86
83
|
import { answerSideQuestion, askWithAsides, BTW_HOW, runningSkill, skillRunStarted, skillSessionText, transcriptOf } from "./btw.js";
|
|
87
|
-
import { createJobRegistry, defaultParallelJobs, describeJob,
|
|
84
|
+
import { createJobRegistry, defaultParallelJobs, describeJob, formatDuration, pulseName, shouldWait, STOPPED_ON_REQUEST, } from "./regenerate/jobs.js";
|
|
88
85
|
/**
|
|
89
86
|
* Makes gated skills reachable from a conversation.
|
|
90
87
|
*
|
|
@@ -103,6 +100,15 @@ const PACKAGE_ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
|
103
100
|
* exchange is therefore reported back, so the interview is visible while it happens and
|
|
104
101
|
* survives in the tool's result afterwards.
|
|
105
102
|
*/
|
|
103
|
+
/**
|
|
104
|
+
* What a question gets with nobody to answer it - print, json and rpc modes. What is the agent's to decide it decides; the
|
|
105
|
+
* person's own files it leaves as they are, as it would have without their yes - a testing script it finds wrong is said,
|
|
106
|
+
* not rewritten.
|
|
107
|
+
*/
|
|
108
|
+
export const NO_USER_ANSWER = "No user is available to answer. Decide yourself what is yours to decide - the ***plain you were asked to write, a choice the " +
|
|
109
|
+
"***plain leaves open - and say in your report what you assumed. What you asked because it is the person's - their testing " +
|
|
110
|
+
"scripts, their config, any file of theirs you would replace or delete - leave as it is: say what you would change and why, " +
|
|
111
|
+
"and go on without it.";
|
|
106
112
|
export function askUserVia(ctx, onExchange,
|
|
107
113
|
/** Given, "/btw ..." typed as an answer is a side question: answered with this, and the question asked again. */
|
|
108
114
|
aside,
|
|
@@ -110,7 +116,7 @@ aside,
|
|
|
110
116
|
dialogs) {
|
|
111
117
|
return async (request) => {
|
|
112
118
|
if (dialogs === undefined && !ctx.hasUI) {
|
|
113
|
-
return
|
|
119
|
+
return NO_USER_ANSWER;
|
|
114
120
|
}
|
|
115
121
|
// Declined - ctrl+c at it, the host's decline, or the turn that asked it stopped: the dialog open is closed, no other is
|
|
116
122
|
// opened, and it comes back as DECLINED.
|
|
@@ -351,30 +357,6 @@ export function createTurriCore(host = {}, options = {}) {
|
|
|
351
357
|
setSurface(jobs, host.surface);
|
|
352
358
|
// What release has shipped, module by module: release does nothing for a module whose last commit it already shipped.
|
|
353
359
|
deployStates.set(jobs, createDeployState());
|
|
354
|
-
// The test advisor watches what the work loop looks at, and picks up what it left pending when turri last quit.
|
|
355
|
-
if (options.advisor === true) {
|
|
356
|
-
// The conversation's own words on how the work is to be planned - AGENTS.md the advisor reads itself.
|
|
357
|
-
const context = (plainFile) => [...steeringStore.get(EVERY_MODULE), ...steeringStore.get(moduleNameOf(plainFile))];
|
|
358
|
-
const advisor = createTestAdvisor({
|
|
359
|
-
context,
|
|
360
|
-
// A verdict goes to the chat the person looks at - a host's too - which writes the scenarios on a yes.
|
|
361
|
-
onVerdict: (verdict) => void session.advised(verdict),
|
|
362
|
-
});
|
|
363
|
-
advisors.set(jobs, advisor);
|
|
364
|
-
// Where it may have left work pending: the folder turri runs in, and a project in a folder of it - ***plain kept in plain/.
|
|
365
|
-
const projects = () => {
|
|
366
|
-
try {
|
|
367
|
-
return [cwd, ...readdirSync(cwd, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !entry.name.startsWith(".") && existsSync(advisorDir(join(cwd, entry.name)))).map((entry) => join(cwd, entry.name))];
|
|
368
|
-
}
|
|
369
|
-
catch {
|
|
370
|
-
return [cwd];
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
setTimeout(() => {
|
|
374
|
-
for (const project of projects())
|
|
375
|
-
advisor.resume(project);
|
|
376
|
-
}, 0).unref?.();
|
|
377
|
-
}
|
|
378
360
|
// What this session does, as facts, in the project's .turri/ledger - a pulse's own in its project. Said once, in the
|
|
379
361
|
// chat shown, when it cannot be written.
|
|
380
362
|
if (ledgerWanted()) {
|
|
@@ -467,6 +449,9 @@ function turriExtension(api, session, link) {
|
|
|
467
449
|
// what finished. In the chat that asked for the pulse, shown or not.
|
|
468
450
|
const announce = (job) => {
|
|
469
451
|
announceJob(pi, job);
|
|
452
|
+
// A pulse a call of this chat waits for is told in that call's reply: a turn of its own would say it again.
|
|
453
|
+
if (toldByWaitingCall(jobs, job) && job.specConflict === undefined)
|
|
454
|
+
return;
|
|
470
455
|
// A spec that contradicts itself is the person's to settle, now: the agent is started on it.
|
|
471
456
|
if (job.specConflict !== undefined) {
|
|
472
457
|
void pi.sendMessage({ customType: "turri_spec_conflict", content: specConflictTask(job.specConflict), display: false, details: { jobId: job.id } }, { triggerTurn: true });
|
|
@@ -539,15 +524,13 @@ function turriExtension(api, session, link) {
|
|
|
539
524
|
announceJob(pi, job);
|
|
540
525
|
if (job.specConflict !== undefined)
|
|
541
526
|
session.notice(specConflictNotice(job, specConflictTask(job.specConflict)));
|
|
542
|
-
if (options.tell !== true)
|
|
527
|
+
if (options.tell !== true || toldByWaitingCall(jobs, job))
|
|
543
528
|
return;
|
|
544
529
|
// A host that shows the person the pulse's end itself: the chat knows of it - in order, with no turn of its own.
|
|
545
530
|
const shown = host.pulseEndsShown === true;
|
|
546
531
|
void pi.sendMessage({ customType: "turri_job_landed", content: landedNote(job, runningDeployed(job.module), { shown }), display: false, details: { jobId: job.id, status: job.status } }, shown ? { triggerTurn: false } : { triggerTurn: true, deliverAs: "followUp" });
|
|
547
532
|
};
|
|
548
533
|
const notices = noticeDialogs(pi, session, link, contextNow);
|
|
549
|
-
// The test advisor's verdicts, once the chat is idle: a yes starts a turn that writes its scenarios, a no is a line.
|
|
550
|
-
const verdicts = verdictDelivery(pi, link, contextNow);
|
|
551
534
|
link.live({
|
|
552
535
|
announce,
|
|
553
536
|
landed,
|
|
@@ -556,14 +539,12 @@ function turriExtension(api, session, link) {
|
|
|
556
539
|
notice: notices.put,
|
|
557
540
|
noticeOver: notices.over,
|
|
558
541
|
concluded: notices.concluded,
|
|
559
|
-
advised: verdicts.put,
|
|
560
542
|
act: (task) => {
|
|
561
543
|
void pi.sendMessage({ customType: "turri_notice_answer", content: task, display: false }, { triggerTurn: true, deliverAs: "followUp" });
|
|
562
544
|
},
|
|
563
545
|
jobsChanged: () => panel.refresh(),
|
|
564
546
|
thinkingLevel: () => pi.getThinkingLevel(),
|
|
565
547
|
context: contextNow,
|
|
566
|
-
conformanceSwitched: () => conformanceTools(),
|
|
567
548
|
});
|
|
568
549
|
pi.on("session_start", (_event, ctx) => {
|
|
569
550
|
lastContext = ctx;
|
|
@@ -616,8 +597,6 @@ function turriExtension(api, session, link) {
|
|
|
616
597
|
pulseEndsBlock(session.sentinelOn()),
|
|
617
598
|
// Conformance tests - what they are, whether they are on here, and how they are turned on: every turn, read afresh.
|
|
618
599
|
conformanceBlock(conformanceTestsOnIn(cwd)),
|
|
619
|
-
// The test advisor, and that the chat alone writes scenarios - while the session has one the project wants.
|
|
620
|
-
...(sessionAdvisor(session) !== undefined && conformanceTestsOnIn(cwd) && readProjectConfig(cwd).testAdvisor !== false ? [TEST_ADVISOR_BLOCK] : []),
|
|
621
600
|
projectConfigBlock(cwd),
|
|
622
601
|
machineBlock(cwd, machine.now()),
|
|
623
602
|
rulesBlock(),
|
|
@@ -737,40 +716,12 @@ function turriExtension(api, session, link) {
|
|
|
737
716
|
});
|
|
738
717
|
registerRegenerate(pi, cwd, jobs);
|
|
739
718
|
registerDrift(pi, cwd, jobs);
|
|
740
|
-
registerGlimpse(pi, cwd, jobs);
|
|
741
719
|
registerBind(pi, cwd, jobs, (plainFile) => turnOnConformance(session, plainFile));
|
|
742
720
|
registerRenderModels(pi);
|
|
743
721
|
registerDeploy(pi, cwd, jobs, deployStates.get(jobs) ?? createDeployState());
|
|
744
722
|
registerSteering(pi, cwd);
|
|
745
723
|
registerSideQuestions(pi, cwd, jobs);
|
|
746
724
|
registerStacks(pi, cwd);
|
|
747
|
-
// The chat's own way to the test advisor, while the session has one - whatever test-advisor says.
|
|
748
|
-
if (sessionAdvisor(session) !== undefined)
|
|
749
|
-
pi.registerTool(evaluateTestsTool({ cwd, advisor: () => sessionAdvisor(session) }));
|
|
750
|
-
// Conformance tests on or off: conform and evaluate_tests are the chat's while they are on, the tool that turns them on
|
|
751
|
-
// while they are off - set as each turn starts, and at once when the chat turns them on. Not the sentinel's: it has its own.
|
|
752
|
-
const conformanceTools = () => {
|
|
753
|
-
if (isSentinel)
|
|
754
|
-
return;
|
|
755
|
-
try {
|
|
756
|
-
const on = conformanceTestsOnIn(cwd);
|
|
757
|
-
const registered = new Set(pi.getAllTools().map((tool) => tool.name));
|
|
758
|
-
const active = pi.getActiveTools();
|
|
759
|
-
const wanted = [
|
|
760
|
-
...active.filter((name) => !CONFORMANCE_TOOLS.includes(name) && name !== TURN_ON_TOOL),
|
|
761
|
-
...(on ? CONFORMANCE_TOOLS : [TURN_ON_TOOL]).filter((name) => registered.has(name)),
|
|
762
|
-
];
|
|
763
|
-
if (wanted.length !== active.length || wanted.some((name) => !active.includes(name)))
|
|
764
|
-
pi.setActiveTools(wanted);
|
|
765
|
-
}
|
|
766
|
-
catch {
|
|
767
|
-
/* not bound to a session yet: the next turn sets them */
|
|
768
|
-
}
|
|
769
|
-
};
|
|
770
|
-
if (!isSentinel)
|
|
771
|
-
pi.registerTool(turnOnConformanceTestsTool({ turnOn: (plainFile) => turnOnConformance(session, plainFile) }));
|
|
772
|
-
pi.on("session_start", () => conformanceTools());
|
|
773
|
-
pi.on("before_agent_start", () => conformanceTools());
|
|
774
725
|
// More chats beside this one, in the terminal: /chat, alt+n, alt+1…9 (chat-commands.ts).
|
|
775
726
|
if (session.terminal)
|
|
776
727
|
registerChats(pi, session);
|
|
@@ -818,7 +769,7 @@ function turriExtension(api, session, link) {
|
|
|
818
769
|
.filter((part) => part !== undefined && part.trim() !== "")
|
|
819
770
|
.join("\n\n");
|
|
820
771
|
const filesBefore = projectFiles(cwd);
|
|
821
|
-
const writes = ["write", "edit", "bash"
|
|
772
|
+
const writes = ["write", "edit", "bash"].some((tool) => skill.allowedTools.includes(tool));
|
|
822
773
|
const quiet = { step: () => { }, artifact: () => { }, gate: () => { }, judge: () => { }, outcome: () => { } };
|
|
823
774
|
const about = runDetails(kind, shown);
|
|
824
775
|
const end = (ended) => skillRunEnds.put(ended.ok
|
|
@@ -913,7 +864,7 @@ function turriExtension(api, session, link) {
|
|
|
913
864
|
// The conformance testing script is for conformance tests: none is written while they are off.
|
|
914
865
|
if (scriptKindOfSkill(skill.name) === "conformance" && !conformanceTestsOnIn(cwd)) {
|
|
915
866
|
return {
|
|
916
|
-
content: [{ type: "text", text: `${skill.name} writes the conformance testing script,
|
|
867
|
+
content: [{ type: "text", text: `${skill.name} writes the conformance testing script, for conformance tests. ${CONFORMANCE_OFF_REFUSAL}` }],
|
|
917
868
|
details: { notStarted: true },
|
|
918
869
|
};
|
|
919
870
|
}
|
|
@@ -1047,9 +998,16 @@ function turriExtension(api, session, link) {
|
|
|
1047
998
|
// files while it runs, and they are not its doing.
|
|
1048
999
|
const filesBefore = projectFiles(cwd);
|
|
1049
1000
|
// A side question asked while it runs is told what it has done so far.
|
|
1050
|
-
const
|
|
1051
|
-
//
|
|
1052
|
-
|
|
1001
|
+
const ran_ = skillRunStarted({ skill: skill.name, dir: skill.dir, step: () => live.step, trace: () => [...trace], runDir });
|
|
1002
|
+
// A testing script being written - here to its end, in print mode - holds the modules it is for, as in the background:
|
|
1003
|
+
// a pulse started meanwhile, by a regenerate called beside it, would run against the script as it was.
|
|
1004
|
+
const kind = scriptKindOfSkill(skill.name);
|
|
1005
|
+
const stack = plainFile !== undefined ? stackForModule(plainFile) : chosenStack();
|
|
1006
|
+
const written = kind !== undefined ? writingScript({ project: plainFile !== undefined ? projectDirOf(plainFile) : cwd, kind, ...(stack !== undefined ? { stack } : {}) }) : () => { };
|
|
1007
|
+
const ended = () => {
|
|
1008
|
+
written();
|
|
1009
|
+
ran_();
|
|
1010
|
+
};
|
|
1053
1011
|
const ran = await captureConsole(() => runSkill({
|
|
1054
1012
|
skillDir: skill.dir,
|
|
1055
1013
|
// The chat's turn stopped - ctrl+c, esc - stops the run with it.
|
|
@@ -1081,7 +1039,7 @@ function turriExtension(api, session, link) {
|
|
|
1081
1039
|
regenerateTool({ cwd, jobs, loop: () => workLoopFor(jobs, cwd, ctx), model: (_skill, plainFile, named, work) => jobModel(ctx, work ?? "spec_changes", named, plainFile), wait: () => false }),
|
|
1082
1040
|
driftTool({ cwd, jobs, loop: () => workLoopFor(jobs, cwd, ctx) }),
|
|
1083
1041
|
haltTool({ jobs, workLoop: () => workLoops.get(jobs)?.loop }),
|
|
1084
|
-
conformTool({ cwd, loop: () => workLoopFor(jobs, cwd, ctx), model: (_skill, plainFile, named) => jobModel(ctx, "spec_changes", named, plainFile), wait: () => false }),
|
|
1042
|
+
conformTool({ cwd, jobs, loop: () => workLoopFor(jobs, cwd, ctx), model: (_skill, plainFile, named) => jobModel(ctx, "spec_changes", named, plainFile), wait: () => false }),
|
|
1085
1043
|
],
|
|
1086
1044
|
// The escalation becomes a real dialog - the host's own, when it has them. Without one there is nobody to ask,
|
|
1087
1045
|
// so the gate stands.
|
|
@@ -1126,7 +1084,7 @@ function turriExtension(api, session, link) {
|
|
|
1126
1084
|
push(noise);
|
|
1127
1085
|
const changes = changedFiles(filesBefore, projectFiles(cwd, filesBefore.keys()));
|
|
1128
1086
|
// A skill that only reads and reports - an analysis - changes nothing, and its result is its verdict.
|
|
1129
|
-
const writes = ["write", "edit", "bash"
|
|
1087
|
+
const writes = ["write", "edit", "bash"].some((tool) => skill.allowedTools.includes(tool));
|
|
1130
1088
|
const changed = changes.length > 0
|
|
1131
1089
|
? `It changed ${changes.length} file${changes.length === 1 ? "" : "s"} in the project: ${changes.join(", ")}.`
|
|
1132
1090
|
: writes
|
|
@@ -1139,22 +1097,16 @@ function turriExtension(api, session, link) {
|
|
|
1139
1097
|
const owner = moduleOfTestPlainFile(resolve(cwd, path));
|
|
1140
1098
|
return owner === undefined ? path : `${path} (a test plain file of ${owner.plainFile !== undefined ? relative(cwd, owner.plainFile) : owner.module})`;
|
|
1141
1099
|
});
|
|
1142
|
-
const unrendered = specsChanged.length > 0
|
|
1100
|
+
const unrendered = specsChanged.length > 0
|
|
1143
1101
|
? `${named.join(", ")} changed, and nothing is regenerated from that yet: call regenerate for ${named.length === 1 ? "its module" : "their modules"}, and the code and its conformance tests are brought up to the spec.`
|
|
1144
1102
|
: "";
|
|
1145
1103
|
const gated = skill.steps.some((step) => step.gate !== undefined);
|
|
1146
|
-
const first = skill.allowedTools.includes("change_plain") ? firstRegeneration(jobs.list(), began) : {};
|
|
1147
|
-
const ttfr = first.started === undefined
|
|
1148
|
-
? ""
|
|
1149
|
-
: `Time to first regeneration: ${formatElapsed(first.started)} - its first pulse started that long after ${skill.name} began` +
|
|
1150
|
-
(first.landed !== undefined ? `, and landed after ${formatElapsed(first.landed)}.` : ".");
|
|
1151
1104
|
const said = heard.length > 0 ? ["", `While it ran, the person said to it - its agent read and acted on each:`, ...heard.map((text) => `- ${text.replace(/\s+/g, " ").trim()}`)] : [];
|
|
1152
1105
|
const text = result.ok
|
|
1153
1106
|
? [
|
|
1154
1107
|
gated ? `${skill.name}: passed all gates.` : `${skill.name}: finished. It has no review gates, so nothing checked its work: read what it changed before you report it.`,
|
|
1155
1108
|
changed,
|
|
1156
1109
|
...(unrendered !== "" ? [unrendered] : []),
|
|
1157
|
-
...(ttfr !== "" ? [ttfr] : []),
|
|
1158
1110
|
...said,
|
|
1159
1111
|
"",
|
|
1160
1112
|
"<artifact>",
|
|
@@ -1325,10 +1277,16 @@ export const COMMAND_STARTED_REACTION = "My pulses are running from the person's
|
|
|
1325
1277
|
* What the agent does when /conform started nothing: answers it at once - why, and what would let it start - and offers
|
|
1326
1278
|
* to do that, rather than leave the person with a refusal and a silent chat.
|
|
1327
1279
|
*/
|
|
1328
|
-
export const CONFORM_REFUSED_REACTION = "Nothing was started from the person's /conform, for the reason shown
|
|
1329
|
-
"
|
|
1330
|
-
"
|
|
1331
|
-
"
|
|
1280
|
+
export const CONFORM_REFUSED_REACTION = "Nothing was started from the person's /conform, for the reason shown - and their /conform is their yes to conformance " +
|
|
1281
|
+
"tests here. Where what is missing is yours to write - the test reqs, the conformance testing script, the scenarios - " +
|
|
1282
|
+
"write it now, in that order and only what is missing, asking nothing: the test reqs first; then the conformance testing " +
|
|
1283
|
+
"script, started with its skill before anything else - it runs in the background, so the scenarios are written while it " +
|
|
1284
|
+
"does; then the scenarios of the functional specs they named, " +
|
|
1285
|
+
"or, naming none, of each functional spec that needs them by the rules on test plain files. Then call regenerate for the " +
|
|
1286
|
+
"module: the work loop writes and runs their tests once the code is built. Say in a line or two what you wrote, and for " +
|
|
1287
|
+
"each functional spec why it needs scenarios - or, when none does, that and why. Where it is not yours to settle - a " +
|
|
1288
|
+
"functional spec they named that is not there, ***plain that would have to change its meaning to be tested - tell them " +
|
|
1289
|
+
"why nothing started and what would let it, and start nothing.";
|
|
1332
1290
|
export const COMMAND_OUTCOME = "turri_command_outcome";
|
|
1333
1291
|
/** Longer than a frame of the TUI's (16ms): an entry appended before it is drawn by its end. */
|
|
1334
1292
|
const ONE_FRAME_MS = 20;
|
|
@@ -1378,6 +1336,7 @@ function registerDrift(pi, cwd, jobs) {
|
|
|
1378
1336
|
function registerBind(pi, cwd, jobs, turnOn) {
|
|
1379
1337
|
pi.registerTool(conformTool({
|
|
1380
1338
|
cwd,
|
|
1339
|
+
jobs,
|
|
1381
1340
|
loop: (ctx) => workLoopFor(jobs, cwd, ctx),
|
|
1382
1341
|
model: (ctx, plainFile, named) => jobModel(ctx, "spec_changes", named, plainFile),
|
|
1383
1342
|
wait: (ctx, asked) => shouldWait(ctx.mode, asked),
|
|
@@ -1387,7 +1346,7 @@ function registerBind(pi, cwd, jobs, turnOn) {
|
|
|
1387
1346
|
// them is asking for them on: off, they are turned on first. What would start nothing is found before anything is
|
|
1388
1347
|
// said, and the chat's agent answers it at once.
|
|
1389
1348
|
pi.registerCommand("conform", {
|
|
1390
|
-
description: "Write and run a module's conformance tests now - the functional specs named, or every one with scenarios - in one pulse, or one a functional spec when asked; turned on first when they are off: /conform [module | file.plain] [module:func-id ...] [one by one]",
|
|
1349
|
+
description: "Write and run a module's conformance tests now - the functional specs named, or every one with scenarios - in one pulse, or one a functional spec when asked; those written already written again, named, or from scratch - the tests folder at the tip of its chain taken out, started again from the module it requires, or from nothing with whole chain; turned on first when they are off: /conform [module | file.plain] [module:func-id ...] [from scratch [whole chain]] [one by one]",
|
|
1391
1350
|
handler: async (args, ctx) => {
|
|
1392
1351
|
const command = `/conform ${args.trim()}`.trim();
|
|
1393
1352
|
await echoCommand(pi, command);
|
|
@@ -1403,9 +1362,15 @@ function registerBind(pi, cwd, jobs, turnOn) {
|
|
|
1403
1362
|
const { funcIds, rest } = funcIdsNamedFirst(picked.rest);
|
|
1404
1363
|
const words = rest.join(" ").trim();
|
|
1405
1364
|
const separately = asksOneByOne(words);
|
|
1406
|
-
//
|
|
1407
|
-
|
|
1408
|
-
|
|
1365
|
+
// From scratch - the tests written again, the code untouched - asked in the person's words; the whole chain's with it.
|
|
1366
|
+
const scratch = asksFromScratch(words) ? (asksWholeChain(words) ? "chain" : "module") : undefined;
|
|
1367
|
+
// Nothing but the functional specs, from scratch and one by one: no planner reads guidance here, so other words are not dropped unsaid.
|
|
1368
|
+
if (words !== "" && !separately && scratch === undefined) {
|
|
1369
|
+
refuse(`/conform takes functional specs, each as module:func-id, "from scratch" with "whole chain" and "one by one" - not "${words}". Nothing was started.`);
|
|
1370
|
+
return;
|
|
1371
|
+
}
|
|
1372
|
+
if (scratch !== undefined && funcIds.length > 0) {
|
|
1373
|
+
refuse("Name functional specs or ask for the conformance tests from scratch, not both: from scratch writes every one of them again. Nothing was started.");
|
|
1409
1374
|
return;
|
|
1410
1375
|
}
|
|
1411
1376
|
// Off: turned on - written where the module's value comes from, every chat's tools switched - and said with what follows.
|
|
@@ -1434,7 +1399,10 @@ function registerBind(pi, cwd, jobs, turnOn) {
|
|
|
1434
1399
|
}
|
|
1435
1400
|
const module = basename(plainFile).replace(/\.plain$/, "");
|
|
1436
1401
|
const model = jobModel(ctx, "spec_changes", undefined, plainFile);
|
|
1437
|
-
|
|
1402
|
+
const starting = scratch !== undefined
|
|
1403
|
+
? `Writing ${module}'s conformance tests${scratch === "chain" ? " and its whole chain's" : ""} again from scratch…`
|
|
1404
|
+
: `Starting ${funcIds.length > 0 ? `the conformance tests of ${funcIds.join(", ")}` : `${module}'s conformance tests`}…`;
|
|
1405
|
+
shownAfterCommand(pi, ctx, command, withTurnedOn(starting), "info", true);
|
|
1438
1406
|
await nextFrame();
|
|
1439
1407
|
// In the background, as /regenerate: a codebase built on the module may be stopped and deleted first.
|
|
1440
1408
|
void (async () => {
|
|
@@ -1443,6 +1411,7 @@ function registerBind(pi, cwd, jobs, turnOn) {
|
|
|
1443
1411
|
...(funcIds.length > 0 ? { funcIds } : {}),
|
|
1444
1412
|
...(model !== undefined ? { model } : {}),
|
|
1445
1413
|
...(separately ? { separately: true } : {}),
|
|
1414
|
+
...(scratch !== undefined ? { fromScratch: scratch } : {}),
|
|
1446
1415
|
}));
|
|
1447
1416
|
// Nothing to write: said in the loop's words - "up to date" alone speaks of the code, not its tests.
|
|
1448
1417
|
const upToDate = statuses.length > 0 && statuses.every(isUpToDate);
|
|
@@ -1474,21 +1443,34 @@ function conformTool(options) {
|
|
|
1474
1443
|
"conformance and acceptance scenarios, at least one test each, by the spec's test reqs, runs them with the whole suite " +
|
|
1475
1444
|
"the module inherits, and, where one fails, fixes the test or the code, whichever is wrong. What they are written for is " +
|
|
1476
1445
|
"recorded apart from the code. The work loop starts these pulses by itself for every functional spec with scenarios whose " +
|
|
1477
|
-
"tests are behind, once the module's code is built; conform starts them now, or for the functional specs named - those alone: the module's others stay behind until conform names none, or the module is regenerated.
|
|
1446
|
+
"tests are behind, once the module's code is built; conform starts them now, or for the functional specs named - those alone: the module's others stay behind until conform names none, or the module is regenerated. " +
|
|
1447
|
+
"A functional spec named whose tests are written already has them written again - deleted and written anew from its " +
|
|
1448
|
+
"scenarios, its code untouched; with from_scratch, the module's whole tests folder is taken out and written again, at " +
|
|
1449
|
+
"the tip of each chain it is built in, as regenerate from scratch does its code. A " +
|
|
1478
1450
|
"functional spec with no scenarios - no test plain file - is refused: there is nothing to test until scenarios " +
|
|
1479
1451
|
"are written. So is one the spec does not have, and a module with scenarios that skipped a step of adding tests - " +
|
|
1480
|
-
"no test reqs, or no conformance testing script for its stack: the refusal names the next step."
|
|
1452
|
+
"no test reqs, or no conformance testing script for its stack: the refusal names the next step. While conformance tests " +
|
|
1453
|
+
"are off it is refused too: they make each change take about twice as long, and turning them on is the person's - " +
|
|
1454
|
+
"with /conform - never yours.",
|
|
1481
1455
|
promptSnippet: "conform: write and run the conformance tests of functional specs with scenarios",
|
|
1482
1456
|
promptGuidelines: [
|
|
1483
|
-
"What is tested is the scenarios: a functional spec's conformance and acceptance scenarios, in its test plain file, tests/<module>/<func-id>.plain. When the user asks for conformance tests, decide in a sentence or two which scenarios to write,
|
|
1457
|
+
"What is tested is the scenarios: a functional spec's conformance and acceptance scenarios, in its test plain file, tests/<module>/<func-id>.plain. When the user asks for conformance tests, decide in a sentence or two which scenarios to write, write them with the file tools - a test plain file's ***conformance tests*** and ***acceptance tests***, each scenario a # <scenario-id> heading and its text - then call regenerate for the module. Every scenario written is tested once the code is built: the loop starts the conformance pulse by itself. Never edit config.turri.yaml for it, and never name a functionality in funcIds to get them.",
|
|
1484
1458
|
"Call conform when the user asks for the conformance tests to be written or run now, for a module or some of its functional specs with scenarios.",
|
|
1485
1459
|
"What the user asks for comes first: for a module already regenerated, while a module built on it is being regenerated, conform stops that pulse, deletes the codebase built on it, writes the tests, and the module above is regenerated from it after - say so. For a module not regenerated yet, its tests are written once its code is built, before anything is built on it.",
|
|
1486
1460
|
"Conformance tests go in one pulse for all the functional specs tested. Set one_by_one only when the user asks for a pulse a functional spec - one at a time, separately, or the like.",
|
|
1461
|
+
"Name a functional spec whose tests are written only when the user asks for its tests to be written again: they are deleted and written anew. Set from_scratch only when the user asks for a module's conformance tests - or its whole chain's - to be written again from scratch, never to fix tests that did not pass. Name funcIds or set from_scratch, not both.",
|
|
1462
|
+
'from_scratch works where the module\'s code lives - the tip of each chain it is built in, never a module in the middle - and takes that codebase\'s whole tests folder out, committed first so its lineage keeps it. "module" starts it again from a copy of the tests of the module the tip requires, and writes the tip\'s own tests anew on them; "chain" starts it from nothing, every functional spec of the chain written anew. Neither touches the code, nor any other codebase.',
|
|
1487
1463
|
],
|
|
1488
1464
|
parameters: Type.Object({
|
|
1489
1465
|
plain_file: Type.String({ description: "A .plain file of the module" }),
|
|
1490
1466
|
working_dir: WORKING_DIR_PARAM,
|
|
1491
|
-
funcIds: Type.Optional(Type.Array(Type.String(), {
|
|
1467
|
+
funcIds: Type.Optional(Type.Array(Type.String(), {
|
|
1468
|
+
description: "The functional specs to test, each as module:func-id (todo:add-task) - each with scenarios; one whose tests are written has them written again. Omitted: every one with scenarios",
|
|
1469
|
+
})),
|
|
1470
|
+
from_scratch: Type.Optional(Type.Union([Type.Literal("module"), Type.Literal("chain")], {
|
|
1471
|
+
description: "Only when the user asks for it: the tests folder where the module's code lives - the tip of its chain - taken out, committed first so its lineage keeps it, and written again from a copy of the tests of the module the tip requires; the code untouched. " +
|
|
1472
|
+
'"chain": written again from nothing - every functional spec of the chain\'s tests',
|
|
1473
|
+
})),
|
|
1492
1474
|
one_by_one: Type.Optional(Type.Boolean({ description: "Only when the user asks for it: a pulse a functional spec. Omitted: every functional spec tested in one pulse, as far as the size guardrail lets" })),
|
|
1493
1475
|
stack: STACK_PARAM,
|
|
1494
1476
|
model: MODEL_PARAM,
|
|
@@ -1499,63 +1481,28 @@ function conformTool(options) {
|
|
|
1499
1481
|
const plainFile = resolve(params.base, params.plain_file);
|
|
1500
1482
|
refuseTestPlainFile(plainFile);
|
|
1501
1483
|
return withCallStack(plainFile, params.stack, async () => {
|
|
1484
|
+
// Off: the person's to turn on, never the chat's - it is told to say why it wants them, and they decide.
|
|
1485
|
+
if (!conformanceTestsOn(plainFile))
|
|
1486
|
+
return { content: [{ type: "text", text: CONFORMANCE_OFF_REFUSAL }], details: { refused: true } };
|
|
1502
1487
|
const model = options.model(ctx, plainFile, params.model);
|
|
1503
1488
|
const loop = options.loop(ctx);
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
promptSnippet: "glimpse: the next pulse of a module and its coding agent's whole prompt, starting nothing",
|
|
1522
|
-
promptGuidelines: [
|
|
1523
|
-
"Use glimpse when the user wants to see what a pulse will be told before it runs, or to check a plan before steering it with steer.",
|
|
1524
|
-
],
|
|
1525
|
-
parameters: Type.Object({
|
|
1526
|
-
plain_file: Type.String({ description: "Path to the .plain file" }),
|
|
1527
|
-
working_dir: WORKING_DIR_PARAM,
|
|
1528
|
-
stack: STACK_PARAM,
|
|
1529
|
-
}),
|
|
1530
|
-
async execute(_id, given, _signal, _onUpdate, ctx) {
|
|
1531
|
-
const params = fromWorkingDir(cwd, given);
|
|
1532
|
-
const plainFile = resolve(params.base, params.plain_file);
|
|
1533
|
-
refuseTestPlainFile(plainFile);
|
|
1534
|
-
return withCallStack(plainFile, params.stack, async () => {
|
|
1535
|
-
const running = new Set(workLoopFor(jobs, cwd, ctx).status().filter((status) => status.running !== undefined).map((status) => status.module));
|
|
1536
|
-
const planner = chatModelOf(ctx);
|
|
1537
|
-
const model = modelFor(chosenModels, "spec_changes", projectModel(ctx, plainFile) ?? planner);
|
|
1538
|
-
const { statuses, previews, busy } = await previewJobs({
|
|
1539
|
-
plainFile,
|
|
1540
|
-
cwd,
|
|
1541
|
-
...(model !== undefined ? { model } : {}),
|
|
1542
|
-
...(planner !== undefined ? { plannerModel: planner } : {}),
|
|
1543
|
-
steering: (file) => steeringFor(file, cwd, steeringStore),
|
|
1544
|
-
busy: (module) => running.has(module),
|
|
1545
|
-
});
|
|
1546
|
-
const text = [
|
|
1547
|
-
describeModules(statuses),
|
|
1548
|
-
...busy.map((module) => `\n${module} has a pulse running: its next pulse is planned from what that one lands - preview it once it has.`),
|
|
1549
|
-
...previews.map((preview) => [
|
|
1550
|
-
"",
|
|
1551
|
-
`<next pulse module="${preview.module}" track="${preview.track}" title="${preview.title}">`,
|
|
1552
|
-
preview.task ?? "A conformance pulse's prompt is built from what the code it tests holds once it is built: it is not shown before.",
|
|
1553
|
-
"</next pulse>",
|
|
1554
|
-
].join("\n")),
|
|
1555
|
-
"",
|
|
1556
|
-
"Nothing was started. Tell the user what the next pulse is and what it will be told - the parts they are likely to care about, not the whole prompt unless they ask.",
|
|
1557
|
-
].join("\n");
|
|
1558
|
-
return { content: [{ type: "text", text }], details: {} };
|
|
1489
|
+
const wait = options.wait(ctx, params.wait);
|
|
1490
|
+
const waiting = wait ? { jobs: options.jobs, wait: startWait(options.jobs) } : undefined;
|
|
1491
|
+
let statuses;
|
|
1492
|
+
try {
|
|
1493
|
+
statuses = await loop.conformance(plainFile, {
|
|
1494
|
+
...(params.funcIds !== undefined ? { funcIds: params.funcIds } : {}),
|
|
1495
|
+
...(model !== undefined ? { model } : {}),
|
|
1496
|
+
...(params.one_by_one === true ? { separately: true } : {}),
|
|
1497
|
+
...(params.from_scratch !== undefined ? { fromScratch: params.from_scratch } : {}),
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
catch (error) {
|
|
1501
|
+
if (waiting !== undefined)
|
|
1502
|
+
endWait(waiting.jobs, waiting.wait);
|
|
1503
|
+
throw error;
|
|
1504
|
+
}
|
|
1505
|
+
return loopReply(loop, statuses, wait, waiting);
|
|
1559
1506
|
});
|
|
1560
1507
|
},
|
|
1561
1508
|
});
|
|
@@ -1679,7 +1626,7 @@ export function projectConfigBlock(root) {
|
|
|
1679
1626
|
return [
|
|
1680
1627
|
...settings(readProjectConfig(dir), withStack(undefined, () => findTestScripts(dir)), dir === root ? `${projectConfigFile(dir)}, for the specs here:` : `${relative(root, dir)}/${projectConfigFile(dir)}, for the specs in ${relative(root, dir)}/ - built in ${relative(root, dir)}/plain_modules:`, where, stacks.length > 0 ? "project of stacks" : "project"),
|
|
1681
1628
|
...(stacks.length > 0
|
|
1682
|
-
? ["", `Stacks: ${stacks.join(", ")} - chosen now: ${chosen ?? "none, so the project's file alone"}. Each module is built with the stack of its part, pinned to its pulses whatever is chosen after: a stack named after the module is its own - backend.plain is built with config.turri.backend.yaml - with nothing to choose. For a module whose stack has another name, pass it as stack to regenerate, conform
|
|
1629
|
+
? ["", `Stacks: ${stacks.join(", ")} - chosen now: ${chosen ?? "none, so the project's file alone"}. Each module is built with the stack of its part, pinned to its pulses whatever is chosen after: a stack named after the module is its own - backend.plain is built with config.turri.backend.yaml - with nothing to choose. For a module whose stack has another name, pass it as stack to regenerate, conform and pulses. Choose one for this chat with the stack tool only when the user asks.`]
|
|
1683
1630
|
: []),
|
|
1684
1631
|
// A stack: its file over the project's, for everything built while it is chosen.
|
|
1685
1632
|
...stacks.flatMap((stack) => [
|
|
@@ -1697,7 +1644,7 @@ export function projectConfigBlock(root) {
|
|
|
1697
1644
|
...[
|
|
1698
1645
|
config.module !== undefined && of !== "stack" ? `- module: ${config.module}${where} - the module to build when the user does not name one.` : undefined,
|
|
1699
1646
|
of !== "stack"
|
|
1700
|
-
? "- conformance tests: written for every functional spec with scenarios - the conformance and acceptance scenarios of its test plain file - once the module's code is built, before anything is built on it. A functional spec with an empty test plain file is not tested. To have one tested, write its scenarios with
|
|
1647
|
+
? "- conformance tests: written for every functional spec with scenarios - the conformance and acceptance scenarios of its test plain file - once the module's code is built, before anything is built on it. A functional spec with an empty test plain file is not tested. To have one tested, write its scenarios with the file tools, then call regenerate."
|
|
1701
1648
|
: undefined,
|
|
1702
1649
|
config.review === true
|
|
1703
1650
|
? "- review: true - the code and its tests are reviewed once they pass: two reviews at most, the arbiter weighing the second."
|
|
@@ -1777,21 +1724,12 @@ function chatModelOf(ctx) {
|
|
|
1777
1724
|
let lastChatModel;
|
|
1778
1725
|
/**
|
|
1779
1726
|
* Conformance tests turned on, for the session: `conformance-tests: true` written where the module's value comes from
|
|
1780
|
-
* (conformance-switch.ts)
|
|
1781
|
-
*
|
|
1727
|
+
* (conformance-switch.ts) - what /conform does when they are off, and a host's turnOnConformance. Every chat is told at
|
|
1728
|
+
* its next turn. `plainFile`, absolute or from the project, picks the module whose stack's file
|
|
1782
1729
|
* is written when that names the key. Returns the file written, from the project. Starts no conformance pulse.
|
|
1783
1730
|
*/
|
|
1784
1731
|
export function turnOnConformance(core, plainFile) {
|
|
1785
1732
|
const file = turnOnConformanceTests(core.cwd, plainFile !== undefined && plainFile.trim() !== "" ? resolve(core.cwd, plainFile) : undefined);
|
|
1786
|
-
for (const chat of core.chats()) {
|
|
1787
|
-
const live = core.session(chat.id);
|
|
1788
|
-
try {
|
|
1789
|
-
(live !== undefined ? core.chatOfSession(live) : undefined)?.instance?.conformanceSwitched?.();
|
|
1790
|
-
}
|
|
1791
|
-
catch {
|
|
1792
|
-
/* a chat let go: its next turn sets its tools */
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
1733
|
return file;
|
|
1796
1734
|
}
|
|
1797
1735
|
/** The skills running in the background, by project and skill - one at a time each, whichever chat started it - with what stops them. */
|
|
@@ -1883,9 +1821,8 @@ function setRenderModelTool(pi, conversation) {
|
|
|
1883
1821
|
name: "engine",
|
|
1884
1822
|
label: "Engine",
|
|
1885
1823
|
description: "The engine: which model the agents that regenerate the code run on. With no model, say which it is. With one, choose it " +
|
|
1886
|
-
"for the rest of this session: for spec changes " +
|
|
1887
|
-
"(
|
|
1888
|
-
"regenerate with functionalities named, conformance), or for everything. By default " +
|
|
1824
|
+
"for the rest of this session: for spec changes (every pulse the work loop plans, conformance tests included), for " +
|
|
1825
|
+
"functionalities (regenerate with funcIds named), or for everything. By default " +
|
|
1889
1826
|
"each runs on the model the project's config.turri.yaml names, or else the conversation's model. The model may be given as provider/model-id or by name as " +
|
|
1890
1827
|
"the user said it; a name that fits more than one model, or none with credentials, comes back as a " +
|
|
1891
1828
|
"list - ask the user which they meant, never pick one yourself. Pulses already queued keep their model.",
|
|
@@ -1893,7 +1830,7 @@ function setRenderModelTool(pi, conversation) {
|
|
|
1893
1830
|
promptGuidelines: [
|
|
1894
1831
|
"When the user says which model should regenerate or build something, call engine with it - once; it holds for the rest of the session. To say which one it is, call engine with no model.",
|
|
1895
1832
|
"If engine returns several candidates, ask the user which one with ask_user or in your reply, then call it again with the exact provider/model-id.",
|
|
1896
|
-
"Say which model a
|
|
1833
|
+
"Say which model a pulse will run on when you start one on something other than the conversation's model.",
|
|
1897
1834
|
],
|
|
1898
1835
|
parameters: Type.Object({
|
|
1899
1836
|
work: Type.Optional(Type.Union([Type.Literal("spec_changes"), Type.Literal("functionalities"), Type.Literal("all")], {
|
|
@@ -1976,12 +1913,6 @@ const workLoops = new WeakMap();
|
|
|
1976
1913
|
const steeringStore = createSteeringStore();
|
|
1977
1914
|
/** What release has shipped in a conversation, by its jobs: shared by the chat's release and a pulse's own. */
|
|
1978
1915
|
const deployStates = new WeakMap();
|
|
1979
|
-
/** A session's test advisor, by its jobs - only a chat's or a host's has one. */
|
|
1980
|
-
const advisors = new WeakMap();
|
|
1981
|
-
/** The session's test advisor, when it has one: the chat's and a host's - never pi's print, json and rpc modes'. */
|
|
1982
|
-
export function sessionAdvisor(session) {
|
|
1983
|
-
return advisors.get(session.jobs);
|
|
1984
|
-
}
|
|
1985
1916
|
function workLoopFor(jobs, cwd, ctx) {
|
|
1986
1917
|
let shared = workLoops.get(jobs);
|
|
1987
1918
|
if (shared === undefined) {
|
|
@@ -1994,8 +1925,6 @@ function workLoopFor(jobs, cwd, ctx) {
|
|
|
1994
1925
|
plannerModel: () => chatModelOf(from.ctx),
|
|
1995
1926
|
// How the work is to be planned: the conversation's steering, and AGENTS.md's - read afresh each plan.
|
|
1996
1927
|
steering: (plainFile) => steeringFor(plainFile, cwd, steeringStore),
|
|
1997
|
-
// What the loop looks at, the test advisor sees - in a session that has one.
|
|
1998
|
-
onSpec: (seen) => advisors.get(jobs)?.seen(seen),
|
|
1999
1928
|
// Under release-after-pulse, a pulse releases what it landed itself, before the next starts - on the model that
|
|
2000
1929
|
// regenerated it: a release follows steps, and a small model thinking little does that well.
|
|
2001
1930
|
release: ({ plainFile, moduleName, title, onDelta }) => {
|
|
@@ -2010,7 +1939,6 @@ function workLoopFor(jobs, cwd, ctx) {
|
|
|
2010
1939
|
});
|
|
2011
1940
|
},
|
|
2012
1941
|
});
|
|
2013
|
-
bindAdvisor(loop, () => advisors.get(jobs));
|
|
2014
1942
|
shared = { loop, from };
|
|
2015
1943
|
workLoops.set(jobs, shared);
|
|
2016
1944
|
}
|
|
@@ -2078,53 +2006,60 @@ const needsLooking = new WeakMap();
|
|
|
2078
2006
|
const pastPulseNote = "A pulse of an earlier session, as the ledger recorded it - facts, not its transcript. Its whole log is the file it names, " +
|
|
2079
2007
|
"for the read tool.";
|
|
2080
2008
|
function registerJobTools(pi, jobs, cwd) {
|
|
2081
|
-
pi.registerTool({
|
|
2082
|
-
name: "diagnose",
|
|
2083
|
-
label: "Diagnose a pulse",
|
|
2084
|
-
description: "Why a pulse did not land, from its whole transcript: how it ended and its diagnosis, the stages that went wrong, the " +
|
|
2085
|
-
"last failing test run with its output, the last review that sent the work back, and the tool calls that failed - " +
|
|
2086
|
-
"and where the whole log is. A pulse of an earlier session is told from the ledger - what it recorded of it, as facts.",
|
|
2087
|
-
promptSnippet: "diagnose: why a pulse did not land, from its transcript",
|
|
2088
|
-
promptGuidelines: ["When a pulse failed or did not land, call diagnose before you explain it or change the spec: go by what happened, not by the report alone."],
|
|
2089
|
-
parameters: Type.Object({ job_id: Type.String({ description: "The pulse's id" }) }),
|
|
2090
|
-
async execute(_id, params) {
|
|
2091
|
-
const job = jobs.get(params.job_id);
|
|
2092
|
-
if (job === undefined) {
|
|
2093
|
-
const past = describePastPulse(ledgerProjects(cwd), params.job_id);
|
|
2094
|
-
if (past !== undefined)
|
|
2095
|
-
return { content: [{ type: "text", text: `${pastPulseNote}\n\n${past}` }], details: { status: "earlier" } };
|
|
2096
|
-
return { content: [{ type: "text", text: `No pulse ${params.job_id} has run in this session, and the ledger has none by that id.` }], details: { status: "unknown" } };
|
|
2097
|
-
}
|
|
2098
|
-
// What the ledger recorded of it besides: its rounds, test runs, healers and commits, as facts.
|
|
2099
|
-
const facts = describePastPulse(ledgerProjects(cwd), job.id);
|
|
2100
|
-
const text = facts !== undefined ? `${whyFailed(job)}\n\nWhat the ledger recorded of it:\n${facts}` : whyFailed(job);
|
|
2101
|
-
return { content: [{ type: "text", text }], details: { status: job.status } };
|
|
2102
|
-
},
|
|
2103
|
-
});
|
|
2104
|
-
pi.registerTool(ledgerTool({ cwd }));
|
|
2105
2009
|
pi.registerTool(doctorTool({ cwd }));
|
|
2106
2010
|
pi.registerTool({
|
|
2107
2011
|
name: "pulses",
|
|
2108
2012
|
label: "Pulses",
|
|
2109
|
-
description: "
|
|
2110
|
-
"
|
|
2111
|
-
"
|
|
2112
|
-
|
|
2013
|
+
description: "Pulses in every tense - earlier sessions', this session's, running now and what runs next. With no parameter: every pulse of " +
|
|
2014
|
+
"this session - finished, running, and planned, those of a look ahead marked as waiting for regenerate - what activate started, " +
|
|
2015
|
+
"and the last runs of earlier sessions, a line a pulse - how each ended, how long, what it cost. With job_id, one pulse: " +
|
|
2016
|
+
"running, whether it still is and its latest output; finished, its report and what the ledger recorded of it - its rounds " +
|
|
2017
|
+
"and test runs (how many failed the same way), the verdicts, the healers, the model provider's trouble, what turri refused, " +
|
|
2018
|
+
"what it committed - and, one that did not land, why, from its whole transcript: its diagnosis, the stages that went wrong, " +
|
|
2019
|
+
"the last failing test run with its output, the last review that sent the work back, the tool calls that failed, and where " +
|
|
2020
|
+
"the whole log is; of an earlier session, told from the ledger; planned (planned-<module>-N), its cases and - the next pulse " +
|
|
2021
|
+
"of its codebase - the whole prompt its coding agent will get, from the plan regenerate runs. With plain_file, a look " +
|
|
2022
|
+
"ahead: that module's work planned as regenerate plans it, steering and all, and kept - nothing started, its pulses waiting " +
|
|
2023
|
+
"for regenerate, which then runs this plan unless the ***plain or the steering changed - and what is planned listed. " +
|
|
2024
|
+
"What is left to regenerate, without a plan, is drift's. Every generation of a module's code and tests is a commit in its " +
|
|
2025
|
+
"history, read with git: git --git-dir=plain_modules/<module>/.plaingit log, and show <commit>.",
|
|
2026
|
+
promptSnippet: "pulses: every pulse or one - earlier, running or planned - why one did not land, and with plain_file what will run next and its prompt",
|
|
2027
|
+
promptGuidelines: [
|
|
2028
|
+
"When a pulse failed or did not land, call pulses with its id before you explain it or change the spec: go by what happened, not by the report alone.",
|
|
2029
|
+
"Call pulses with plain_file when the user wants to see or check what will run before it does, then with a planned row's id for its prompt. To change the plan, use steer or change the ***plain, then look again.",
|
|
2030
|
+
],
|
|
2113
2031
|
parameters: Type.Object({
|
|
2114
|
-
job_id: Type.Optional(Type.String({
|
|
2115
|
-
|
|
2032
|
+
job_id: Type.Optional(Type.String({
|
|
2033
|
+
description: "One pulse: the id returned when it started, an earlier session's, or a planned row's (planned-<module>-N). Omitted: every pulse",
|
|
2034
|
+
})),
|
|
2035
|
+
plain_file: Type.Optional(Type.String({ description: "A look ahead: the .plain file of the module to plan, starting nothing. Not with job_id. Omitted: no look ahead" })),
|
|
2036
|
+
working_dir: WORKING_DIR_PARAM,
|
|
2037
|
+
stack: STACK_PARAM,
|
|
2038
|
+
wait: Type.Optional(Type.Boolean({ description: "With a pulse started: block until it finishes instead of reporting its current state (default false)" })),
|
|
2039
|
+
runs: Type.Optional(Type.Number({ description: `With no parameter: how many runs of earlier sessions to list (default ${EARLIER_RUNS})` })),
|
|
2116
2040
|
}),
|
|
2117
|
-
async execute(_id, params) {
|
|
2041
|
+
async execute(_id, params, _signal, _onUpdate, ctx) {
|
|
2042
|
+
if (params.plain_file !== undefined) {
|
|
2043
|
+
if (params.job_id !== undefined)
|
|
2044
|
+
return { content: [{ type: "text", text: "Pass job_id or plain_file, not both: plain_file looks ahead at a module, job_id tells one pulse." }], details: { status: "refused" } };
|
|
2045
|
+
const given = fromWorkingDir(cwd, params);
|
|
2046
|
+
const plainFile = resolve(given.base, given.plain_file);
|
|
2047
|
+
refuseTestPlainFile(plainFile);
|
|
2048
|
+
return withCallStack(plainFile, params.stack, async () => {
|
|
2049
|
+
const loop = workLoopFor(jobs, cwd, ctx);
|
|
2050
|
+
const statuses = await loop.lookAhead(plainFile);
|
|
2051
|
+
return { content: [{ type: "text", text: describeLookAhead(loop, statuses) }], details: { status: "looked ahead" } };
|
|
2052
|
+
});
|
|
2053
|
+
}
|
|
2118
2054
|
if (params.job_id === undefined) {
|
|
2119
|
-
|
|
2055
|
+
const runs = params.runs !== undefined && Number.isFinite(params.runs) ? Math.max(1, Math.floor(params.runs)) : EARLIER_RUNS;
|
|
2056
|
+
return { content: [{ type: "text", text: listJobs(jobs, cwd, runs) }], details: { status: "all" } };
|
|
2120
2057
|
}
|
|
2121
2058
|
const existing = jobs.get(params.job_id);
|
|
2122
2059
|
const planned = shownJobs(jobs).find((job) => job.id === params.job_id && jobs.get(job.id) === undefined);
|
|
2123
2060
|
if (planned !== undefined) {
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
details: { status: "planned" },
|
|
2127
|
-
};
|
|
2061
|
+
const pulse = await workLoops.get(jobs)?.loop.plannedPulse(planned.id);
|
|
2062
|
+
return { content: [{ type: "text", text: describePlannedRow(planned, pulse) }], details: { status: "planned" } };
|
|
2128
2063
|
}
|
|
2129
2064
|
if (existing === undefined) {
|
|
2130
2065
|
const past = describePastPulse(ledgerProjects(cwd), params.job_id);
|
|
@@ -2142,10 +2077,14 @@ function registerJobTools(pi, jobs, cwd) {
|
|
|
2142
2077
|
};
|
|
2143
2078
|
}
|
|
2144
2079
|
const job = params.wait === true ? await jobs.wait(params.job_id) : existing;
|
|
2145
|
-
|
|
2146
|
-
content: [{ type: "text", text: describeJob(job) }],
|
|
2147
|
-
|
|
2148
|
-
|
|
2080
|
+
if (job.status === "running" || job.status === "queued")
|
|
2081
|
+
return { content: [{ type: "text", text: describeJob(job) }], details: { status: job.status } };
|
|
2082
|
+
// Ended: how it went - why, for one that did not land - and what the ledger recorded of it besides: its rounds, test
|
|
2083
|
+
// runs, verdicts, healers and commits, as facts. A pulse that landed after a struggle shows it there.
|
|
2084
|
+
const told = didNotLand(job) ? whyFailed(job) : describeJob(job);
|
|
2085
|
+
const facts = describePastPulse(ledgerProjects(cwd), job.id, { report: false });
|
|
2086
|
+
const text = facts !== undefined ? `${told}\n\nWhat the ledger recorded of it:\n${facts}` : told;
|
|
2087
|
+
return { content: [{ type: "text", text }], details: { status: job.status } };
|
|
2149
2088
|
},
|
|
2150
2089
|
});
|
|
2151
2090
|
// The panel is compact and ctrl+o only lasts as long as the work does. This is the whole
|
|
@@ -2212,23 +2151,6 @@ function registerJobTools(pi, jobs, cwd) {
|
|
|
2212
2151
|
pi.appendEntry(HISTORY_ENTRY, { module: name, text: historyLog(defaultBuildDir(name, cwd)) });
|
|
2213
2152
|
},
|
|
2214
2153
|
});
|
|
2215
|
-
pi.registerTool({
|
|
2216
|
-
name: "lineage",
|
|
2217
|
-
label: "Lineage",
|
|
2218
|
-
description: "Read a module's lineage: every generation of its code and tests - each regeneration, conformance run and spec change, " +
|
|
2219
|
-
"with what it was regenerated from - as git commits. Without a commit, the log; with one, that commit in full - its message and " +
|
|
2220
|
-
"the change it made.",
|
|
2221
|
-
promptSnippet: "a module's lineage: what was regenerated into it, and when",
|
|
2222
|
-
parameters: Type.Object({
|
|
2223
|
-
module: Type.String({ description: "The module's name" }),
|
|
2224
|
-
commit: Type.Optional(Type.String({ description: "A commit from the log, to see in full" })),
|
|
2225
|
-
}),
|
|
2226
|
-
async execute(_id, params) {
|
|
2227
|
-
const buildDir = defaultBuildDir(params.module, cwd);
|
|
2228
|
-
const text = params.commit ? historyShow(buildDir, params.commit) : historyLog(buildDir);
|
|
2229
|
-
return { content: [{ type: "text", text }], details: {} };
|
|
2230
|
-
},
|
|
2231
|
-
});
|
|
2232
2154
|
// The side panel: the regeneration - and the pulses behind p - over the whole screen, or beside the chat (s, from one to
|
|
2233
2155
|
// the other). Its key (PANEL_KEY) opens it; the key again closes it and goes back to the chat, as esc does over the
|
|
2234
2156
|
// screen - beside the chat, the key switches sides, giving the keys to the chat or the panel, as esc gives them to the
|
|
@@ -2652,28 +2574,49 @@ function deployedLabel(name, what) {
|
|
|
2652
2574
|
function shownJobs(jobs) {
|
|
2653
2575
|
return [...(workLoops.get(jobs)?.loop.planned() ?? []), ...jobs.list()];
|
|
2654
2576
|
}
|
|
2655
|
-
function listJobs(jobs, cwd) {
|
|
2577
|
+
function listJobs(jobs, cwd, runs = EARLIER_RUNS) {
|
|
2656
2578
|
const all = [...shownJobs(jobs)].reverse().filter((job) => job.replacedBy === undefined);
|
|
2657
2579
|
const deployed = runningDeployed().map((item) => `deploy ${item.name} running ${item.moduleName}: ${item.url ?? item.command} (pid ${item.pid}, output in ${relative(process.cwd(), item.log) || item.log})`);
|
|
2658
2580
|
const listed = deployed.length > 0 ? `\n\nActivated from dist - /halt activated <name> halts one:\n${deployed.join("\n")}` : "";
|
|
2659
|
-
const before = earlierRuns(jobs, cwd);
|
|
2581
|
+
const before = earlierRuns(jobs, cwd, runs);
|
|
2660
2582
|
if (all.length === 0)
|
|
2661
2583
|
return `No pulses have been started in this session.${listed}${before}`;
|
|
2662
2584
|
return `${jobLines(all)}${listed}${before}`;
|
|
2663
2585
|
}
|
|
2586
|
+
/** How many runs of earlier sessions `pulses` lists when it is asked for none. */
|
|
2587
|
+
const EARLIER_RUNS = 3;
|
|
2664
2588
|
/** Earlier sessions' last runs and their pulses, from the ledger - nothing when it has none. */
|
|
2665
|
-
function earlierRuns(jobs, cwd) {
|
|
2589
|
+
function earlierRuns(jobs, cwd, runs) {
|
|
2666
2590
|
try {
|
|
2667
|
-
const found = earlierPulses(ledgerProjects(cwd), new Set(jobs.list().map((job) => job.id)));
|
|
2591
|
+
const found = earlierPulses(ledgerProjects(cwd), new Set(jobs.list().map((job) => job.id)), runs);
|
|
2668
2592
|
if (found.runs.length === 0)
|
|
2669
2593
|
return "";
|
|
2670
|
-
const more = found.more > 0 ? `\n\n${found.more} earlier run${found.more === 1 ? "" : "s"} beyond these
|
|
2671
|
-
return `\n\nEarlier sessions, from the ledger - pulses
|
|
2594
|
+
const more = found.more > 0 ? `\n\n${found.more} earlier run${found.more === 1 ? "" : "s"} beyond these: ask with runs for more.` : "";
|
|
2595
|
+
return `\n\nEarlier sessions, from the ledger - pulses with a pulse's id tells one:\n${describeRuns(found.runs)}${more}`;
|
|
2672
2596
|
}
|
|
2673
2597
|
catch {
|
|
2674
2598
|
return "";
|
|
2675
2599
|
}
|
|
2676
2600
|
}
|
|
2601
|
+
/** A look ahead, for the chat: what is planned in each codebase, each row by its id, and what happens next. */
|
|
2602
|
+
function describeLookAhead(loop, statuses) {
|
|
2603
|
+
const modules = new Set(statuses.map((status) => status.module));
|
|
2604
|
+
const rows = loop.planned().filter((row) => row.module !== undefined && modules.has(row.module));
|
|
2605
|
+
const listed = rows.length > 0 ? `\n\nThe planned pulses - pulses with a row's id tells its cases and, for the next pulse of a codebase, the whole prompt its coding agent will get:\n${rows.map((row) => `${row.id} ${row.summary}`).join("\n")}` : "";
|
|
2606
|
+
return (`${describeModules(statuses)}${listed}\n\n` +
|
|
2607
|
+
"Nothing was started. What is planned here waits for regenerate, conform or /regenerate, which runs this plan as it is - unless " +
|
|
2608
|
+
"the ***plain or the steering changes first, when it is planned again. To change the plan, use steer or change the ***plain, then " +
|
|
2609
|
+
"look again. Tell the user what will run and in what order - the parts they are likely to care about.");
|
|
2610
|
+
}
|
|
2611
|
+
/** A planned row, for the chat: what it is, and its prompt when it is the next pulse of its codebase. */
|
|
2612
|
+
function describePlannedRow(row, pulse) {
|
|
2613
|
+
const head = `${row.id} · ${pulseName(row)}: ${row.note ?? "planned, not started"}${row.waitingOn.length > 0 ? ` It runs after ${row.waitingOn.join(", ")}.` : ""}`;
|
|
2614
|
+
if (pulse?.task !== undefined) {
|
|
2615
|
+
return (`${head}\n\nThe whole prompt its coding agent will get - built from the plan kept, the one regenerate runs:\n<prompt>\n${pulse.task}\n</prompt>\n\n` +
|
|
2616
|
+
"Tell the user what the pulse is and what it will be told - the parts they are likely to care about, not the whole prompt unless they ask.");
|
|
2617
|
+
}
|
|
2618
|
+
return pulse?.why !== undefined ? `${head}\n\nNo prompt shown: ${pulse.why}` : head;
|
|
2619
|
+
}
|
|
2677
2620
|
function jobLines(all) {
|
|
2678
2621
|
return all
|
|
2679
2622
|
.map((job) => {
|
|
@@ -2683,7 +2626,8 @@ function jobLines(all) {
|
|
|
2683
2626
|
const after = job.status === "queued" && job.waitingOn.length > 0 ? ` (after ${job.waitingOn.join(", ")})` : "";
|
|
2684
2627
|
const spent = describeUsage(job.usage);
|
|
2685
2628
|
const model = job.model ? ` · ${job.model}` : "";
|
|
2686
|
-
|
|
2629
|
+
const held = job.lookedAhead === true ? " · looked ahead: waits for regenerate" : "";
|
|
2630
|
+
return `${job.id} ${(planned ? "planned" : job.status).padEnd(9)} ${time.padStart(7)} ${pulseName(job)}${model}${after}${held}${spent ? ` · ${spent}` : ""}`;
|
|
2687
2631
|
})
|
|
2688
2632
|
.join("\n");
|
|
2689
2633
|
}
|
|
@@ -3071,6 +3015,7 @@ function registerBranding(pi, skills) {
|
|
|
3071
3015
|
(data.commit !== undefined ? theme.fg("dim", ` from a clone, ${data.commit}${data.changed ? " with changes" : ""}`) : ""),
|
|
3072
3016
|
// A newer turri out, or one installed and hidden behind this one: said first, under the version it is about.
|
|
3073
3017
|
...(data.versions ?? []).map((line) => theme.fg("warning", line)),
|
|
3018
|
+
...(data.config ?? []).map((line) => theme.fg("warning", line)),
|
|
3074
3019
|
`${theme.fg("text", "the first coding agent with the power of ")}${brandPink(theme)("regenerative software")}`,
|
|
3075
3020
|
// Where the settings are changed, without leaving the chat.
|
|
3076
3021
|
theme.fg("muted", "configure with /turri-config"),
|
|
@@ -3122,6 +3067,7 @@ function registerBranding(pi, skills) {
|
|
|
3122
3067
|
pending: skills.pending.length,
|
|
3123
3068
|
sandbox: sandboxSummary(),
|
|
3124
3069
|
versions: versions.lines,
|
|
3070
|
+
config: unknownConfigLines(ctx.cwd),
|
|
3125
3071
|
});
|
|
3126
3072
|
}
|
|
3127
3073
|
catch {
|