@yagni-app/code-staging 1.2.14-staging.2344.1 → 1.2.14-staging.2349.1
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/dist/extension/pipeline/cloud.d.ts +6 -0
- package/dist/extension/pipeline/codeWriter.d.ts +36 -0
- package/dist/extension/pipeline/codeWriter.js +45 -0
- package/dist/extension/pipeline/personas.d.ts +1 -1
- package/dist/extension/pipeline/personas.js +2 -2
- package/dist/extension/pipeline/sessionLane.d.ts +40 -3
- package/dist/extension/pipeline/sessionLane.js +140 -15
- package/dist/extension/subagents.d.ts +12 -1
- package/dist/extension/subagents.js +34 -4
- package/package.json +2 -2
|
@@ -128,6 +128,12 @@ export interface AttemptResult extends CloudIdentity {
|
|
|
128
128
|
* adds its own parts.
|
|
129
129
|
*/
|
|
130
130
|
pullRequestText?: string;
|
|
131
|
+
/**
|
|
132
|
+
* How a plan turn asked for the plan's UI preview left it (`sessionLane.ts`):
|
|
133
|
+
* a whole page, its word that nothing on a screen changes, or neither.
|
|
134
|
+
* Absent on every other turn: the host then drafts the preview itself.
|
|
135
|
+
*/
|
|
136
|
+
uiPreview?: "drawn" | "none" | "not_drawn";
|
|
131
137
|
}
|
|
132
138
|
/** The findings the result reports, blocking first. */
|
|
133
139
|
export declare function openFindings(findings: readonly Finding[]): OpenFinding[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who writes a session-lane build's code: the session itself, or the
|
|
3
|
+
* `implementer` subagent on a tier the host names. The host says which with
|
|
4
|
+
* each turn in {@link CODE_WRITER_ENV} (the backend's `attempts/codeWriter.ts`);
|
|
5
|
+
* the agents a session-lane turn is offered (`subagents.ts`) and its build
|
|
6
|
+
* message (`sessionLane.ts`) both read it here, so they never disagree.
|
|
7
|
+
*
|
|
8
|
+
* The session writes unless the value names a helper it can be served: unset
|
|
9
|
+
* and anything unreadable mean the session, so a typo never brings a helper
|
|
10
|
+
* back.
|
|
11
|
+
*/
|
|
12
|
+
import type { ModelTier } from "./types.js";
|
|
13
|
+
/** `session`, or `helper:<tier>` with tier `efficient`, `standard` or `advanced`. */
|
|
14
|
+
export declare const CODE_WRITER_ENV = "YAGNI_GO_CODE_WRITER";
|
|
15
|
+
export type CodeWriter = {
|
|
16
|
+
writer: "session";
|
|
17
|
+
} | {
|
|
18
|
+
writer: "helper";
|
|
19
|
+
tier: ModelTier;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The value as the session reads it. A helper on `peak` is not one: the model
|
|
23
|
+
* proxy serves a subagent only up to `advanced`, so it would ask for a tier it
|
|
24
|
+
* is not served.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseCodeWriter(raw: string | undefined): CodeWriter;
|
|
27
|
+
/**
|
|
28
|
+
* A value the host sent that names nobody this reads: neither `session` nor
|
|
29
|
+
* a helper on a tier it is served. The session writes then, and the turn says
|
|
30
|
+
* so (`sessionLane.ts`), so a setting that did not take never looks like one
|
|
31
|
+
* that is off. Null for unset, `session` and a helper that was read.
|
|
32
|
+
*/
|
|
33
|
+
export declare function ignoredCodeWriter(raw: string | undefined): string | null;
|
|
34
|
+
/** Who writes, from an environment (the turn's child env, or `process.env`). */
|
|
35
|
+
export declare function resolveCodeWriter(env: NodeJS.ProcessEnv): CodeWriter;
|
|
36
|
+
//# sourceMappingURL=codeWriter.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who writes a session-lane build's code: the session itself, or the
|
|
3
|
+
* `implementer` subagent on a tier the host names. The host says which with
|
|
4
|
+
* each turn in {@link CODE_WRITER_ENV} (the backend's `attempts/codeWriter.ts`);
|
|
5
|
+
* the agents a session-lane turn is offered (`subagents.ts`) and its build
|
|
6
|
+
* message (`sessionLane.ts`) both read it here, so they never disagree.
|
|
7
|
+
*
|
|
8
|
+
* The session writes unless the value names a helper it can be served: unset
|
|
9
|
+
* and anything unreadable mean the session, so a typo never brings a helper
|
|
10
|
+
* back.
|
|
11
|
+
*/
|
|
12
|
+
import { parseTierCap } from "./tierCap.js";
|
|
13
|
+
/** `session`, or `helper:<tier>` with tier `efficient`, `standard` or `advanced`. */
|
|
14
|
+
export const CODE_WRITER_ENV = "YAGNI_GO_CODE_WRITER";
|
|
15
|
+
const SESSION_WRITES = { writer: "session" };
|
|
16
|
+
const HELPER_PREFIX = "helper:";
|
|
17
|
+
/**
|
|
18
|
+
* The value as the session reads it. A helper on `peak` is not one: the model
|
|
19
|
+
* proxy serves a subagent only up to `advanced`, so it would ask for a tier it
|
|
20
|
+
* is not served.
|
|
21
|
+
*/
|
|
22
|
+
export function parseCodeWriter(raw) {
|
|
23
|
+
const value = raw?.trim().toLowerCase() ?? "";
|
|
24
|
+
if (!value.startsWith(HELPER_PREFIX))
|
|
25
|
+
return SESSION_WRITES;
|
|
26
|
+
const tier = parseTierCap(value.slice(HELPER_PREFIX.length));
|
|
27
|
+
return tier && tier !== "peak" ? { writer: "helper", tier } : SESSION_WRITES;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A value the host sent that names nobody this reads: neither `session` nor
|
|
31
|
+
* a helper on a tier it is served. The session writes then, and the turn says
|
|
32
|
+
* so (`sessionLane.ts`), so a setting that did not take never looks like one
|
|
33
|
+
* that is off. Null for unset, `session` and a helper that was read.
|
|
34
|
+
*/
|
|
35
|
+
export function ignoredCodeWriter(raw) {
|
|
36
|
+
const value = raw?.trim() ?? "";
|
|
37
|
+
if (!value || value.toLowerCase() === "session")
|
|
38
|
+
return null;
|
|
39
|
+
return parseCodeWriter(value).writer === "helper" ? null : value.slice(0, 60);
|
|
40
|
+
}
|
|
41
|
+
/** Who writes, from an environment (the turn's child env, or `process.env`). */
|
|
42
|
+
export function resolveCodeWriter(env) {
|
|
43
|
+
return parseCodeWriter(env[CODE_WRITER_ENV]);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=codeWriter.js.map
|
|
@@ -36,7 +36,7 @@ import type { PipelineStage } from "./types.js";
|
|
|
36
36
|
* each fix. Its words never name the harness (the branding scrub rewrites
|
|
37
37
|
* that word) and open with no bullet.
|
|
38
38
|
*/
|
|
39
|
-
export declare const WORK_A_TICKET_SKILL = "---\nname: work-a-ticket\ndescription: How YAGNI works a ticket in one session, from reading it to a committed, honestly reported change. Read, run and plan with options and a recommendation, stop for approval, build the smallest change
|
|
39
|
+
export declare const WORK_A_TICKET_SKILL = "---\nname: work-a-ticket\ndescription: How YAGNI works a ticket in one session, from reading it to a committed, honestly reported change. Read, run and plan with options and a recommendation, stop for approval, build the smallest change yourself, verify with a fresh subagent, commit and report.\n---\n\n# How YAGNI works a ticket\n\nYou work one ticket for a Team, in its repository, checked out in your working directory on a machine that is yours for the whole run. A person approves your plan before anything is built. YAGNI pushes your commits, opens the pull request, waits for CI and the review, and brings you back with what they asked. Each time YAGNI resumes you, its message says which turn this is and what it needs back. This is a playbook, not a contract: use your judgement, and say what you did.\n\n## 1. Understand the ticket\n\nRead the ticket, its evidence and every image it names, the design, the memo, the checks, the Team's playbook and the Plan line's instructions. Read the code the ticket touches, and send searcher subagents for wide reads, in parallel. Settle facts by running things rather than guessing: the tests, a type check, the app, Docker, a query. Installing what a check needs is fine. Read the decision ledger (team_read with yagni_decisions_read_for_repository) and ask_yagni before you ask a person anything.\n\nCheck the ticket before you build on it. Each thing it states and your plan relies on (a bug, a file, a behaviour, a number) is a premise: check it against the code, the git history or the data, and keep the command, file or query that shows it. A premise you cannot check is marked so, never assumed. Take \"Done when\" from the ticket's acceptance criteria, or write it when the ticket has none. When the check shows the problem is already gone, your plan recommends closing the ticket, with the evidence, instead of a change.\n\n## 2. Plan, then stop\n\nOpen the plan with the ticket check and \"Done when\". Name the files and the steps. Where there is a real choice of approach, give the options, each with what it changes and what it costs, and recommend one. End the turn with the plan in the format the message gives, and stop. A fresh reviewer then reads your plan against the ticket and the code; when it finds something major, its findings come back to you in this session: check each one, revise the plan for the real ones, and send the whole plan again. You have no edit or write tool until the plan is approved, and anything you change in tracked files before then is put back.\n\n## 3. Build\n\nThe option the person approved is binding. The plan's steps are guidance: when the code shows a better step, take it, and record the departure and why. Prefer the smallest change that meets the ticket: no drive-by refactors and no files the ticket does not need. Write the change yourself, in this session, with the ticket, the plan and the code you read in mind. Only when this turn's message names a helper, hand it fully specified chunks of work (the files, the change, the check that proves it) and keep the judgement calls yourself. Run the checks that prove the change. A check that already failed on the unchanged code is not yours to fix; say so.\n\n## 4. Verify\n\nBefore you finish, dispatch a fresh verification subagent on your diff, with the ticket and the plan, and fix what it finds that is real. Send one. Only for a risky change (a migration, auth, money, data that cannot be restored) send two or three with different lenses and treat their agreement as confirmation.\n\n## 5. Commit and report\n\nCommit on the branch you are on, with clear messages. Never push, never open or edit a pull request, and never change the git identity or config. Write the report the message asks for last, and honestly: each check you ran with its real exit code, what you could not verify and why, and every departure from the plan and why. A check you did not run is not a pass.\n\n## Rules that always hold\n\nNever fabricate a path, a result or a check: \"not found\" and \"not verified\" are answers. Never print, commit or send a token or a variable's value. If the disk fills (\"no space left on device\"), stop and say so; do not delete or prune to go on. Call record_decision only for a consequential product or architecture call the plan did not settle.\n";
|
|
40
40
|
/** Persona body keyed by the agent name referenced in `stages.ts`. */
|
|
41
41
|
export declare const PERSONA_BODIES: Record<string, string>;
|
|
42
42
|
/**
|
|
@@ -82,7 +82,7 @@ const CLOUD_PLANNER_FINISH = `Complete the task fully: do not gold-plate, but do
|
|
|
82
82
|
*/
|
|
83
83
|
export const WORK_A_TICKET_SKILL = `---
|
|
84
84
|
name: work-a-ticket
|
|
85
|
-
description: How YAGNI works a ticket in one session, from reading it to a committed, honestly reported change. Read, run and plan with options and a recommendation, stop for approval, build the smallest change
|
|
85
|
+
description: How YAGNI works a ticket in one session, from reading it to a committed, honestly reported change. Read, run and plan with options and a recommendation, stop for approval, build the smallest change yourself, verify with a fresh subagent, commit and report.
|
|
86
86
|
---
|
|
87
87
|
|
|
88
88
|
# How YAGNI works a ticket
|
|
@@ -101,7 +101,7 @@ Open the plan with the ticket check and "Done when". Name the files and the step
|
|
|
101
101
|
|
|
102
102
|
## 3. Build
|
|
103
103
|
|
|
104
|
-
The option the person approved is binding. The plan's steps are guidance: when the code shows a better step, take it, and record the departure and why. Prefer the smallest change that meets the ticket: no drive-by refactors and no files the ticket does not need.
|
|
104
|
+
The option the person approved is binding. The plan's steps are guidance: when the code shows a better step, take it, and record the departure and why. Prefer the smallest change that meets the ticket: no drive-by refactors and no files the ticket does not need. Write the change yourself, in this session, with the ticket, the plan and the code you read in mind. Only when this turn's message names a helper, hand it fully specified chunks of work (the files, the change, the check that proves it) and keep the judgement calls yourself. Run the checks that prove the change. A check that already failed on the unchanged code is not yours to fix; say so.
|
|
105
105
|
|
|
106
106
|
## 4. Verify
|
|
107
107
|
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* The session lane (`yagni go --headless --cloud --session`, 2026-10-28): a
|
|
3
3
|
* ticket runs as ONE pi session, on the strongest tier, in one Machine the
|
|
4
4
|
* host keeps for the whole run, in place of the cloud lane's stage graph.
|
|
5
|
-
* The model works the ticket itself
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The model works the ticket itself and writes its change itself, with the
|
|
6
|
+
* `subagent` tool for wide reads and a fresh verifier (a helper that writes
|
|
7
|
+
* for it only when the host names one, `codeWriter.ts`), and the host meets
|
|
8
|
+
* it at the same checkpoints the cloud lane has, by the same files.
|
|
8
9
|
*
|
|
9
10
|
* Each host execution is one TURN of that session: this process runs one pi
|
|
10
11
|
* child on the session file the run keeps under the run user's home
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
* own clock.
|
|
44
45
|
*/
|
|
45
46
|
import { type PlacedValues } from "../placedValues.js";
|
|
47
|
+
import { type CodeWriter } from "./codeWriter.js";
|
|
46
48
|
import { type AttemptResult, type CloudIdentity, type CloudStage } from "./cloud.js";
|
|
47
49
|
import type { ContinuationInputs } from "./continuation.js";
|
|
48
50
|
import { type PlanChange } from "./planChanges.js";
|
|
@@ -76,6 +78,32 @@ export declare const MAX_PULL_REQUEST_TEXT_CHARS = 20000;
|
|
|
76
78
|
export declare function pullRequestTextOf(text: string | null): string | null;
|
|
77
79
|
/** What a plan turn may use: everything that reads or runs, nothing that edits. */
|
|
78
80
|
export declare const PLAN_TURN_TOOLS: string[];
|
|
81
|
+
/**
|
|
82
|
+
* The brief the host writes beside the ticket when the plan turn draws the
|
|
83
|
+
* plan's UI preview itself (a yak's; `attempts/sessionPreview.ts`): the page's
|
|
84
|
+
* contract and how to work. Absent, the turn draws none and its result says
|
|
85
|
+
* nothing about one, so the host drafts the preview as it always did.
|
|
86
|
+
*/
|
|
87
|
+
export declare const UI_PREVIEW_BRIEF_FILE_NAME = "ui-preview-brief.md";
|
|
88
|
+
/** The preview's page, in the output folder (the host's `SESSION_PREVIEW_FILE`). */
|
|
89
|
+
export declare const UI_PREVIEW_FILE_NAME = "preview.html";
|
|
90
|
+
/** What the turn writes instead of a page when the plan changes nothing on a screen. */
|
|
91
|
+
export declare const UI_PREVIEW_NONE_FILE_NAME = "ui-preview-none.md";
|
|
92
|
+
/** The most a preview's page may weigh (the host's `MAX_SESSION_PREVIEW_BYTES`). */
|
|
93
|
+
export declare const MAX_UI_PREVIEW_BYTES: number;
|
|
94
|
+
/** How a plan turn asked for its UI preview left it (`AttemptResult.uiPreview`). */
|
|
95
|
+
export type UiPreviewOutcome = "drawn" | "none" | "not_drawn";
|
|
96
|
+
/**
|
|
97
|
+
* What a plan turn that draws its preview may use: the plan turn's tools, and
|
|
98
|
+
* write and edit for the page. Anything they change in the repository is put
|
|
99
|
+
* back before the plan's gate, as a shell's change is ({@link putBackPlanTurn}).
|
|
100
|
+
*/
|
|
101
|
+
export declare const PLAN_PREVIEW_TURN_TOOLS: string[];
|
|
102
|
+
/**
|
|
103
|
+
* Why a preview's page cannot stand, as the host's judge would refuse it
|
|
104
|
+
* (`parseDesignDocument`): empty when it is a whole page within size. Pure.
|
|
105
|
+
*/
|
|
106
|
+
export declare function previewPageProblems(text: string | null): string[];
|
|
79
107
|
/** What a turn that builds may use: the plan turn's tools and the writes. */
|
|
80
108
|
export declare const BUILD_TURN_TOOLS: string[];
|
|
81
109
|
/** The run's files under the run user's home: its one session, and the playbook it runs on. */
|
|
@@ -108,6 +136,13 @@ export interface TurnFacts {
|
|
|
108
136
|
* (YAG-1162). Any stage, the plan's included.
|
|
109
137
|
*/
|
|
110
138
|
newSinceLastTurn?: string | null;
|
|
139
|
+
/**
|
|
140
|
+
* The input folder has `ui-preview-brief.md`: this plan turn draws the
|
|
141
|
+
* plan's UI preview itself. Only ever on a plan turn.
|
|
142
|
+
*/
|
|
143
|
+
preview?: boolean;
|
|
144
|
+
/** Who writes the change, as the host said (`codeWriter.ts`); absent, the session. */
|
|
145
|
+
codeWriter?: CodeWriter;
|
|
111
146
|
}
|
|
112
147
|
/** The file the host writes a person's note for the next step to (`attempts/inputs.ts`). */
|
|
113
148
|
export declare const NEXT_STEP_NOTE_FILE_NAME = "next-step-note.md";
|
|
@@ -194,6 +229,8 @@ export interface SessionTurnDeps {
|
|
|
194
229
|
writeFile?: (path: string, text: string) => void;
|
|
195
230
|
exists?: (path: string) => boolean;
|
|
196
231
|
mkdir?: (path: string) => void;
|
|
232
|
+
/** Removes a file, missing or not: the last turn's preview files. */
|
|
233
|
+
remove?: (path: string) => void;
|
|
197
234
|
exec?: WorktreeExec;
|
|
198
235
|
snapshot?: typeof snapshotWorkspace;
|
|
199
236
|
/** The run user's home; the Machine's `/home/user`. */
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* The session lane (`yagni go --headless --cloud --session`, 2026-10-28): a
|
|
3
3
|
* ticket runs as ONE pi session, on the strongest tier, in one Machine the
|
|
4
4
|
* host keeps for the whole run, in place of the cloud lane's stage graph.
|
|
5
|
-
* The model works the ticket itself
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The model works the ticket itself and writes its change itself, with the
|
|
6
|
+
* `subagent` tool for wide reads and a fresh verifier (a helper that writes
|
|
7
|
+
* for it only when the host names one, `codeWriter.ts`), and the host meets
|
|
8
|
+
* it at the same checkpoints the cloud lane has, by the same files.
|
|
8
9
|
*
|
|
9
10
|
* Each host execution is one TURN of that session: this process runs one pi
|
|
10
11
|
* child on the session file the run keeps under the run user's home
|
|
@@ -42,11 +43,12 @@
|
|
|
42
43
|
* kept: the review loop and its round cap, the fixer, and the plan stage's
|
|
43
44
|
* own clock.
|
|
44
45
|
*/
|
|
45
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
46
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
46
47
|
import { homedir } from "node:os";
|
|
47
48
|
import { isAbsolute, join, relative } from "node:path";
|
|
48
49
|
import { openPlacedValues } from "../placedValues.js";
|
|
49
50
|
import { scanChange } from "./changeScan.js";
|
|
51
|
+
import { CODE_WRITER_ENV, ignoredCodeWriter, resolveCodeWriter, } from "./codeWriter.js";
|
|
50
52
|
import { completeCloudSession, RESULT_FILE_NAME, } from "./cloud.js";
|
|
51
53
|
import { finishExec } from "./finish.js";
|
|
52
54
|
import { MISSION_CHECKS_FILE_NAME, readMissionChecksFile } from "./missionChecks.js";
|
|
@@ -103,6 +105,48 @@ export const PLAN_TURN_TOOLS = [
|
|
|
103
105
|
"prototype_read",
|
|
104
106
|
"subagent",
|
|
105
107
|
];
|
|
108
|
+
/**
|
|
109
|
+
* The brief the host writes beside the ticket when the plan turn draws the
|
|
110
|
+
* plan's UI preview itself (a yak's; `attempts/sessionPreview.ts`): the page's
|
|
111
|
+
* contract and how to work. Absent, the turn draws none and its result says
|
|
112
|
+
* nothing about one, so the host drafts the preview as it always did.
|
|
113
|
+
*/
|
|
114
|
+
export const UI_PREVIEW_BRIEF_FILE_NAME = "ui-preview-brief.md";
|
|
115
|
+
/** The preview's page, in the output folder (the host's `SESSION_PREVIEW_FILE`). */
|
|
116
|
+
export const UI_PREVIEW_FILE_NAME = "preview.html";
|
|
117
|
+
/** What the turn writes instead of a page when the plan changes nothing on a screen. */
|
|
118
|
+
export const UI_PREVIEW_NONE_FILE_NAME = "ui-preview-none.md";
|
|
119
|
+
/** The most a preview's page may weigh (the host's `MAX_SESSION_PREVIEW_BYTES`). */
|
|
120
|
+
export const MAX_UI_PREVIEW_BYTES = 4 * 1024 * 1024;
|
|
121
|
+
/**
|
|
122
|
+
* What a plan turn that draws its preview may use: the plan turn's tools, and
|
|
123
|
+
* write and edit for the page. Anything they change in the repository is put
|
|
124
|
+
* back before the plan's gate, as a shell's change is ({@link putBackPlanTurn}).
|
|
125
|
+
*/
|
|
126
|
+
export const PLAN_PREVIEW_TURN_TOOLS = [...PLAN_TURN_TOOLS, "write", "edit"];
|
|
127
|
+
const VIEW_MARKER = /\sdata-yagni-(?:view|state|choice)\s*=/i;
|
|
128
|
+
/**
|
|
129
|
+
* Why a preview's page cannot stand, as the host's judge would refuse it
|
|
130
|
+
* (`parseDesignDocument`): empty when it is a whole page within size. Pure.
|
|
131
|
+
*/
|
|
132
|
+
export function previewPageProblems(text) {
|
|
133
|
+
const html = text?.trim() ?? "";
|
|
134
|
+
if (!html)
|
|
135
|
+
return ["the file is missing or empty"];
|
|
136
|
+
const problems = [];
|
|
137
|
+
if (!/^(?:<!doctype html[^>]*>\s*)?<html[\s>]/i.test(html) && !/^<!doctype html/i.test(html)) {
|
|
138
|
+
problems.push("it must be a whole HTML document that starts with <!doctype html> or <html>");
|
|
139
|
+
}
|
|
140
|
+
if (!/<\/html>\s*$/i.test(html))
|
|
141
|
+
problems.push("it must end with </html>; it looks cut off");
|
|
142
|
+
if (VIEW_MARKER.test(html)) {
|
|
143
|
+
problems.push("it must carry no data-yagni-view, data-yagni-state or data-yagni-choice attribute");
|
|
144
|
+
}
|
|
145
|
+
if (Buffer.byteLength(html, "utf8") > MAX_UI_PREVIEW_BYTES) {
|
|
146
|
+
problems.push(`it is over ${MAX_UI_PREVIEW_BYTES / (1024 * 1024)} MB`);
|
|
147
|
+
}
|
|
148
|
+
return problems;
|
|
149
|
+
}
|
|
106
150
|
/** What a turn that builds may use: the plan turn's tools and the writes. */
|
|
107
151
|
export const BUILD_TURN_TOOLS = [
|
|
108
152
|
...PLAN_TURN_TOOLS,
|
|
@@ -179,16 +223,20 @@ const REPORT_CONTRACT = (outDir) => `Last, write ${join(outDir, SESSION_REPORT_F
|
|
|
179
223
|
'not a pass, and goes in "notVerified". "baseline" is "fails_on_base" only when the check already ' +
|
|
180
224
|
'failed on the unchanged code. "planChanges" lists only a step you did differently than plan.md ' +
|
|
181
225
|
"says, or left out, never a choice the plan left to you. Then end your turn.";
|
|
226
|
+
/** The build rule that says who writes the change: the host's value, in words. */
|
|
227
|
+
const WRITER_RULE = (who) => who.writer === "helper"
|
|
228
|
+
? `- Hand fully specified chunks to the implementer subagent (it runs on the ${who.tier} tier and shares none of your context) and wide reads to searcher subagents, in parallel where they touch different files; keep the judgement calls yourself.`
|
|
229
|
+
: "- Write the change yourself, in this session: you hold the ticket, the plan and the code you read, and no subagent writes it for you. Send wide reads to searcher subagents, in parallel.";
|
|
182
230
|
const PULL_REQUEST_CONTRACT = (outDir) => `Before the report, write ${join(outDir, PULL_REQUEST_FILE_NAME)}: the description of this attempt's pull request ` +
|
|
183
231
|
"as it stands after this turn, whole, in Markdown, for a reviewer who has not read the ticket. Lead with the product, " +
|
|
184
232
|
'never the files: what changes for the user, or one line "No product change: <what this is>". For a product change ' +
|
|
185
233
|
"give a **Before:** and **After:** pair as the user meets it. Then what you verified and how, and what you did not " +
|
|
186
234
|
"verify and why. Short sentences, no file-by-file list. Never quote command output, a log, or a value from the " +
|
|
187
235
|
"environment: everyone on the repository reads it. Write no title, checks table or plan version: YAGNI adds those.";
|
|
188
|
-
const BUILD_RULES = (outDir) => [
|
|
236
|
+
const BUILD_RULES = (outDir, who) => [
|
|
189
237
|
"Write tools are on now. Work as your playbook says:",
|
|
190
238
|
"- Prefer the smallest change that meets the ticket.",
|
|
191
|
-
|
|
239
|
+
WRITER_RULE(who),
|
|
192
240
|
"- Run the checks that prove the change (checks.json, the plan's checks) and fix what your change breaks.",
|
|
193
241
|
"- Before you finish, dispatch a fresh verification subagent on your diff with the ticket and the plan, and fix what it finds that is real.",
|
|
194
242
|
"- Commit on the branch you are on. Never push and never open or edit a pull request: YAGNI pushes your commits and opens it.",
|
|
@@ -206,16 +254,41 @@ const INPUTS = (inputDir) => [
|
|
|
206
254
|
].join("\n");
|
|
207
255
|
/** A close recommendation sent back is a person's call that the ticket needs work. */
|
|
208
256
|
const PLANNED_ANYWAY = "If the plan sent back recommended closing the ticket, the person chose to plan it anyway: plan the change, and do not recommend closing it again.";
|
|
209
|
-
const
|
|
210
|
-
|
|
257
|
+
const PLAN_TOOLS = "read, grep, find, ls, bash, ask_yagni, team_read, prototype_read and subagent";
|
|
258
|
+
/**
|
|
259
|
+
* The plan turn's rules. With `preview` (the host's brief is in the input
|
|
260
|
+
* folder) the turn also draws the plan's UI preview: it gets write and edit
|
|
261
|
+
* for the preview's files, and the rule that says when to draw one.
|
|
262
|
+
*/
|
|
263
|
+
const planRules = (preview) => [
|
|
264
|
+
preview
|
|
265
|
+
? `This turn you have ${PLAN_TOOLS}, and write and edit for the UI preview's files in ${preview.outDir} only: never for a file in the repository.`
|
|
266
|
+
: `This turn you have ${PLAN_TOOLS}, and no edit or write tool.`,
|
|
267
|
+
...PLAN_RULES_BEFORE_PREVIEW,
|
|
268
|
+
...(preview ? [previewRule(preview.inputDir, preview.outDir)] : []),
|
|
269
|
+
...PLAN_RULES_AFTER_PREVIEW,
|
|
270
|
+
].join("\n\n");
|
|
271
|
+
/** When a plan turn draws the plan's UI preview, and what it writes when the plan has nothing to show. */
|
|
272
|
+
const previewRule = (inputDir, outDir) => `A person reads this plan beside its UI preview, and you draw it: read ${join(inputDir, UI_PREVIEW_BRIEF_FILE_NAME)} before you plan. ` +
|
|
273
|
+
`When the plan changes anything a person sees on a screen, write the preview to ${join(outDir, UI_PREVIEW_FILE_NAME)} as the brief says, before your plan message, ` +
|
|
274
|
+
"from what you read and ran this turn, and keep it in step with the plan whenever a review changes the plan. " +
|
|
275
|
+
`When the plan changes nothing on a screen, write ${join(outDir, UI_PREVIEW_NONE_FILE_NAME)} instead, with one line saying why, and draw nothing.`;
|
|
276
|
+
/** What a plan turn that left neither a page nor its none file is asked, once. */
|
|
277
|
+
const previewReask = (inputDir, outDir, problems) => `The plan has no UI preview yet: ${join(outDir, UI_PREVIEW_FILE_NAME)} cannot stand (${problems.join("; ")}), and ${join(outDir, UI_PREVIEW_NONE_FILE_NAME)} is not there. ` +
|
|
278
|
+
`If the plan changes anything a person sees on a screen, write the preview now as ${join(inputDir, UI_PREVIEW_BRIEF_FILE_NAME)} says. ` +
|
|
279
|
+
`If it changes nothing on a screen, write ${join(outDir, UI_PREVIEW_NONE_FILE_NAME)} with one line saying why. ` +
|
|
280
|
+
"Leave the plan as it is and do not send it again: answer in one line when the file is written.";
|
|
281
|
+
const PLAN_RULES_BEFORE_PREVIEW = [
|
|
211
282
|
"Run whatever settles a fact: the tests, a type check, the app, Docker, a query. Change no tracked file and commit nothing: anything this turn changes in the repository is put back before the plan's gate.",
|
|
212
283
|
`Call team_read with tool "${DECISIONS_READ_TOOL}" before you ask a person anything: a question an earlier decision on this repository already answers is not a question.`,
|
|
213
284
|
"Check the ticket before you plan on it: each premise it states that the plan relies on, against the code, the git history or the data.",
|
|
285
|
+
];
|
|
286
|
+
const PLAN_RULES_AFTER_PREVIEW = [
|
|
214
287
|
"End the turn with the plan as your last message. Open it with ## Ticket check: a table of premise | checked, or not checkable | the command, file:line or query that shows it, one row per premise. Then ## Done when: the ticket's acceptance criteria, or yours when it has none, one line each. Then ## Goal (one sentence), ## Plan (numbered steps, each naming the file or function), ## Files to modify / create (say \"new\" beside a file the plan creates), ## Checks and ## Risks, then the plan-json block. Where there is a real choice of approach, ask it as a decision question with your recommendation and its alternatives; the plan's steps follow your recommendation.",
|
|
215
288
|
'When the ticket check shows the problem is already gone, recommend closing the ticket instead of planning a change: ## Goal says so in one sentence, the ticket check holds the evidence, ## Plan says "Nothing to build." with no numbered steps, and the plan-json block carries "closeTicket" with the evidence and names no checks and no paths. A person then decides whether to close it.',
|
|
216
289
|
PLAN_JSON_CONTRACT,
|
|
217
290
|
"Then stop: a fresh reviewer reads the plan next, and its major findings come back to you in this session to revise. A person approves the plan before anything is built.",
|
|
218
|
-
]
|
|
291
|
+
];
|
|
219
292
|
/** The one message a turn sends the session. Pure. */
|
|
220
293
|
export function turnMessage(facts) {
|
|
221
294
|
const at = (file) => join(facts.inputDir, file);
|
|
@@ -239,7 +312,7 @@ export function turnMessage(facts) {
|
|
|
239
312
|
}
|
|
240
313
|
if (newSince)
|
|
241
314
|
parts.push(newSince);
|
|
242
|
-
parts.push(
|
|
315
|
+
parts.push(planRules(facts.preview ? { inputDir: facts.inputDir, outDir: facts.outDir } : undefined));
|
|
243
316
|
return parts.join("\n\n");
|
|
244
317
|
}
|
|
245
318
|
if (facts.stage === "implement" && facts.resumed && !facts.continuation) {
|
|
@@ -278,7 +351,7 @@ export function turnMessage(facts) {
|
|
|
278
351
|
parts.push(note);
|
|
279
352
|
if (newSince)
|
|
280
353
|
parts.push(newSince);
|
|
281
|
-
parts.push(BUILD_RULES(facts.outDir));
|
|
354
|
+
parts.push(BUILD_RULES(facts.outDir, facts.codeWriter ?? { writer: "session" }));
|
|
282
355
|
return parts.join("\n\n");
|
|
283
356
|
}
|
|
284
357
|
const MAX_REPORTED_CHECKS = 40;
|
|
@@ -521,6 +594,7 @@ async function runTurn(input, deps, pulse) {
|
|
|
521
594
|
const writeFile = deps.writeFile ?? ((path, text) => writeFileSync(path, text));
|
|
522
595
|
const exists = deps.exists ?? existsSync;
|
|
523
596
|
const mkdir = deps.mkdir ?? ((path) => void mkdirSync(path, { recursive: true }));
|
|
597
|
+
const remove = deps.remove ?? ((path) => rmSync(path, { force: true }));
|
|
524
598
|
const exec = deps.exec ?? finishExec;
|
|
525
599
|
const snapshot = deps.snapshot ?? snapshotWorkspace;
|
|
526
600
|
const runStage = deps.runStage ?? defaultRunStage;
|
|
@@ -544,6 +618,21 @@ async function runTurn(input, deps, pulse) {
|
|
|
544
618
|
const baseSha = start.head;
|
|
545
619
|
const preRunDirt = parseChangedPaths(start.status);
|
|
546
620
|
const writes = input.stage !== "plan";
|
|
621
|
+
// The host's brief is there: this plan turn draws the plan's UI preview
|
|
622
|
+
// itself, and whatever an earlier turn left in its place goes first.
|
|
623
|
+
const drawsPreview = input.stage === "plan" && exists(join(input.inputDir, UI_PREVIEW_BRIEF_FILE_NAME));
|
|
624
|
+
const previewFile = join(input.outDir, UI_PREVIEW_FILE_NAME);
|
|
625
|
+
const previewNoneFile = join(input.outDir, UI_PREVIEW_NONE_FILE_NAME);
|
|
626
|
+
if (drawsPreview) {
|
|
627
|
+
for (const path of [previewFile, previewNoneFile]) {
|
|
628
|
+
try {
|
|
629
|
+
remove(path);
|
|
630
|
+
}
|
|
631
|
+
catch {
|
|
632
|
+
// One that cannot be removed is read as this turn's: the host's judge still reads the page.
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
547
636
|
// A yak's System's other repositories, each as the turn found it, for the
|
|
548
637
|
// read of a writing turn's change for a placed secret (YAG-1211).
|
|
549
638
|
const others = [];
|
|
@@ -577,7 +666,7 @@ async function runTurn(input, deps, pulse) {
|
|
|
577
666
|
id: stageId,
|
|
578
667
|
agent: "session",
|
|
579
668
|
model: SESSION_TIER,
|
|
580
|
-
tools: writes ? BUILD_TURN_TOOLS : PLAN_TURN_TOOLS,
|
|
669
|
+
tools: writes ? BUILD_TURN_TOOLS : drawsPreview ? PLAN_PREVIEW_TURN_TOOLS : PLAN_TURN_TOOLS,
|
|
581
670
|
taskTemplate: "{ticket}",
|
|
582
671
|
};
|
|
583
672
|
let decisionsRecorded = 0;
|
|
@@ -649,6 +738,12 @@ async function runTurn(input, deps, pulse) {
|
|
|
649
738
|
},
|
|
650
739
|
now,
|
|
651
740
|
});
|
|
741
|
+
// On the CLI's own stderr, whose tail the host logs: a value that named
|
|
742
|
+
// nobody is the session writing, said once per turn.
|
|
743
|
+
const ignoredWriter = ignoredCodeWriter(input.childEnv[CODE_WRITER_ENV]);
|
|
744
|
+
if (ignoredWriter) {
|
|
745
|
+
input.writeErr(`Ignoring ${CODE_WRITER_ENV}=${JSON.stringify(ignoredWriter)}: it names neither the session nor a helper on a tier a subagent is served, so the session writes its change itself.`);
|
|
746
|
+
}
|
|
652
747
|
const message = turnMessage({
|
|
653
748
|
stage: input.stage,
|
|
654
749
|
resumed,
|
|
@@ -660,10 +755,15 @@ async function runTurn(input, deps, pulse) {
|
|
|
660
755
|
sentBack: exists(join(input.inputDir, "sent-back-plan.md")),
|
|
661
756
|
nextStepNote: input.stage === "plan" ? null : readOrNull(join(input.inputDir, NEXT_STEP_NOTE_FILE_NAME)),
|
|
662
757
|
newSinceLastTurn: readOrNull(join(input.inputDir, NEW_SINCE_LAST_TURN_FILE_NAME)),
|
|
758
|
+
...(drawsPreview ? { preview: true } : {}),
|
|
759
|
+
// The env the turn's child runs on, so the message and the agents the
|
|
760
|
+
// child is offered (`builtinAgents`) read one value.
|
|
761
|
+
codeWriter: resolveCodeWriter(input.childEnv),
|
|
663
762
|
});
|
|
664
763
|
const notes = [];
|
|
665
764
|
const stages = [];
|
|
666
765
|
let planText = "";
|
|
766
|
+
let uiPreview = null;
|
|
667
767
|
let ran;
|
|
668
768
|
try {
|
|
669
769
|
let run = await turn(message);
|
|
@@ -731,6 +831,28 @@ async function runTurn(input, deps, pulse) {
|
|
|
731
831
|
sections.length > 0
|
|
732
832
|
? [run.finalOutput.trimEnd(), ...sections].join("\n\n")
|
|
733
833
|
: run.finalOutput;
|
|
834
|
+
if (drawsPreview && planText.trim()) {
|
|
835
|
+
// The preview is settled on the final plan, from the files alone: the
|
|
836
|
+
// session's words are the yak's in its thread, never a signal here.
|
|
837
|
+
const left = () => {
|
|
838
|
+
const problems = previewPageProblems(readOrNull(previewFile));
|
|
839
|
+
if (problems.length === 0)
|
|
840
|
+
return "drawn";
|
|
841
|
+
return readOrNull(previewNoneFile)?.trim() ? "none" : problems;
|
|
842
|
+
};
|
|
843
|
+
let settled = left();
|
|
844
|
+
if (typeof settled !== "string" &&
|
|
845
|
+
turnStop(run, false, input.signal?.aborted === true).stop === "clean") {
|
|
846
|
+
stages.push(await turn(previewReask(input.inputDir, input.outDir, settled)));
|
|
847
|
+
settled = left();
|
|
848
|
+
}
|
|
849
|
+
uiPreview = typeof settled === "string" ? settled : "not_drawn";
|
|
850
|
+
if (typeof settled !== "string") {
|
|
851
|
+
const note = `The plan turn left no UI preview that can stand (${settled.join("; ")}); the plan's gate opens without one.`;
|
|
852
|
+
notes.push(note);
|
|
853
|
+
input.writeErr(note);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
734
856
|
notes.push(...(await putBackPlanTurn(input.cwd, start, exec, snapshot, input.signal)));
|
|
735
857
|
}
|
|
736
858
|
const stop = turnStop(run, writes, input.signal?.aborted === true);
|
|
@@ -791,10 +913,13 @@ async function runTurn(input, deps, pulse) {
|
|
|
791
913
|
const noted = { ...done.attempt, notes: [...notes, ...done.attempt.notes] };
|
|
792
914
|
const attempt = writes
|
|
793
915
|
? withSessionAccount(noted, parseSessionReport(readOrNull(join(input.outDir, SESSION_REPORT_FILE_NAME)), knownBaselines(input.inputDir, readFile)), pullRequestTextOf(readOrNull(join(input.outDir, PULL_REQUEST_FILE_NAME))))
|
|
794
|
-
:
|
|
916
|
+
: uiPreview
|
|
917
|
+
? { ...noted, uiPreview }
|
|
918
|
+
: noted;
|
|
795
919
|
// The cloud lane's finish wrote `result.json`; it is written again when
|
|
796
|
-
// this turn adds to it (the model's account, the plan turn's put-back
|
|
797
|
-
|
|
920
|
+
// this turn adds to it (the model's account, the plan turn's put-back, how
|
|
921
|
+
// it left its UI preview).
|
|
922
|
+
if (writes || notes.length > 0 || uiPreview)
|
|
798
923
|
rewriteResult(input.outDir, attempt, writeFile);
|
|
799
924
|
input.emit({ type: "pipeline_result", ...attempt });
|
|
800
925
|
const ok = writes ? done.ok && attempt.stopReason === "clean" : done.ok;
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* any Claude Code plugin `agents/` dirs the launcher passed via
|
|
14
14
|
* `YAGNI_CLAUDE_AGENT_DIRS` (project beats user beats plugin on a name
|
|
15
15
|
* collision). A built-in `general` agent is always available, so the tool
|
|
16
|
-
* works in a repo with no definitions at all
|
|
16
|
+
* works in a repo with no definitions at all; a session-lane turn is the one
|
|
17
|
+
* exception (see {@link builtinAgents}).
|
|
17
18
|
* Claude model names map onto YAGNI tiers (opus→advanced, sonnet→standard,
|
|
18
19
|
* haiku→efficient); unknown models run on standard.
|
|
19
20
|
*/
|
|
@@ -72,6 +73,16 @@ export interface SubagentDef {
|
|
|
72
73
|
* it declares.
|
|
73
74
|
*/
|
|
74
75
|
export declare function verificationTier(env?: NodeJS.ProcessEnv): ModelTier;
|
|
76
|
+
/**
|
|
77
|
+
* The built-in agents a process is offered. Everywhere but a session-lane
|
|
78
|
+
* turn: all four. A session-lane turn (`pipeline/sessionLane.ts`) writes its
|
|
79
|
+
* change itself, so it is offered no built-in that writes for it: no
|
|
80
|
+
* `general`, and no `implementer` unless the host names a helper and its tier
|
|
81
|
+
* (`pipeline/codeWriter.ts`). Taken out of what is offered, never only asked
|
|
82
|
+
* in the turn's message, so it does not rest on the model obeying. A
|
|
83
|
+
* repository's own agents load over these as everywhere.
|
|
84
|
+
*/
|
|
85
|
+
export declare function builtinAgents(env: NodeJS.ProcessEnv): SubagentDef[];
|
|
75
86
|
/** Claude Code model names → YAGNI tiers; YAGNI tiers pass through. */
|
|
76
87
|
export declare function mapModelTier(model: string | undefined): ModelTier;
|
|
77
88
|
/**
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* any Claude Code plugin `agents/` dirs the launcher passed via
|
|
14
14
|
* `YAGNI_CLAUDE_AGENT_DIRS` (project beats user beats plugin on a name
|
|
15
15
|
* collision). A built-in `general` agent is always available, so the tool
|
|
16
|
-
* works in a repo with no definitions at all
|
|
16
|
+
* works in a repo with no definitions at all; a session-lane turn is the one
|
|
17
|
+
* exception (see {@link builtinAgents}).
|
|
17
18
|
* Claude model names map onto YAGNI tiers (opus→advanced, sonnet→standard,
|
|
18
19
|
* haiku→efficient); unknown models run on standard.
|
|
19
20
|
*/
|
|
@@ -24,6 +25,7 @@ import { parseFrontmatter, } from "@earendil-works/pi-coding-agent";
|
|
|
24
25
|
import { Type } from "typebox";
|
|
25
26
|
import { sanitizeCallerSegment } from "./config.js";
|
|
26
27
|
import { logEvent } from "./errorSink.js";
|
|
28
|
+
import { resolveCodeWriter } from "./pipeline/codeWriter.js";
|
|
27
29
|
import { withResilience } from "./pipeline/resilience.js";
|
|
28
30
|
import { runStage } from "./pipeline/runner.js";
|
|
29
31
|
import { isSessionLaneTurn } from "./pipeline/sessionLane.js";
|
|
@@ -245,6 +247,26 @@ function verificationAgent(env) {
|
|
|
245
247
|
source: "builtin",
|
|
246
248
|
};
|
|
247
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* The built-in agents a process is offered. Everywhere but a session-lane
|
|
252
|
+
* turn: all four. A session-lane turn (`pipeline/sessionLane.ts`) writes its
|
|
253
|
+
* change itself, so it is offered no built-in that writes for it: no
|
|
254
|
+
* `general`, and no `implementer` unless the host names a helper and its tier
|
|
255
|
+
* (`pipeline/codeWriter.ts`). Taken out of what is offered, never only asked
|
|
256
|
+
* in the turn's message, so it does not rest on the model obeying. A
|
|
257
|
+
* repository's own agents load over these as everywhere.
|
|
258
|
+
*/
|
|
259
|
+
export function builtinAgents(env) {
|
|
260
|
+
if (!isSessionLaneTurn(env)) {
|
|
261
|
+
return [GENERAL_AGENT, SEARCHER_AGENT, IMPLEMENTER_AGENT, verificationAgent(env)];
|
|
262
|
+
}
|
|
263
|
+
const who = resolveCodeWriter(env);
|
|
264
|
+
return [
|
|
265
|
+
SEARCHER_AGENT,
|
|
266
|
+
...(who.writer === "helper" ? [{ ...IMPLEMENTER_AGENT, model: who.tier }] : []),
|
|
267
|
+
verificationAgent(env),
|
|
268
|
+
];
|
|
269
|
+
}
|
|
248
270
|
// Concrete tiers a subagent can actually run on. `balanced` is deliberately NOT
|
|
249
271
|
// a member here even though it is a member of `ModelTier`: a subagent needs
|
|
250
272
|
// ONE model for its whole run, and balanced is a session-level routing policy,
|
|
@@ -342,7 +364,7 @@ export function discoverSubagents(deps) {
|
|
|
342
364
|
const home = deps.homeDir ?? homedir();
|
|
343
365
|
const env = deps.env ?? process.env;
|
|
344
366
|
const layers = [
|
|
345
|
-
|
|
367
|
+
builtinAgents(env),
|
|
346
368
|
...pluginAgentDirs(env).map((dir) => loadAgentsFromDir(dir, "plugin")),
|
|
347
369
|
loadAgentsFromDir(join(home, ".claude", "agents"), "user-claude"),
|
|
348
370
|
loadAgentsFromDir(join(deps.cwd, ".pi", "agents"), "project-pi"),
|
|
@@ -470,7 +492,9 @@ const parameters = Type.Object({
|
|
|
470
492
|
task: Type.Optional(Type.String({
|
|
471
493
|
description: "The self-contained task. Include everything needed: the subagent shares none of your context.",
|
|
472
494
|
})),
|
|
473
|
-
agent: Type.Optional(Type.String({
|
|
495
|
+
agent: Type.Optional(Type.String({
|
|
496
|
+
description: "Agent name (see /agents). Defaults to general where it is offered.",
|
|
497
|
+
})),
|
|
474
498
|
tasks: Type.Optional(Type.Array(Type.Object({
|
|
475
499
|
task: Type.String(),
|
|
476
500
|
agent: Type.Optional(Type.String({
|
|
@@ -577,8 +601,12 @@ export function makeSubagentTool(deps = {}) {
|
|
|
577
601
|
// the list is current as of session launch; /agents shows the live set.
|
|
578
602
|
// Fails soft: discovery problems never block the tool.
|
|
579
603
|
let agentListBlock = "";
|
|
604
|
+
// Whether a call that names no agent has one to run as: not in a
|
|
605
|
+
// session-lane turn, which is offered no `general`.
|
|
606
|
+
let hasGeneral = true;
|
|
580
607
|
try {
|
|
581
608
|
const discovered = discover({ cwd: process.cwd(), homeDir: deps.homeDir, env: deps.env });
|
|
609
|
+
hasGeneral = discovered.some((a) => a.name === GENERAL_AGENT_NAME);
|
|
582
610
|
if (discovered.length > 0) {
|
|
583
611
|
agentListBlock =
|
|
584
612
|
" Available agents (first sentence only; /agents lists them in full):\n" +
|
|
@@ -602,7 +630,9 @@ export function makeSubagentTool(deps = {}) {
|
|
|
602
630
|
"a compressed report. Use it for context-heavy exploration you don't need blow-by-blow, or to " +
|
|
603
631
|
"run independent tasks in parallel via `tasks`. The subagent shares NONE of your conversation: " +
|
|
604
632
|
"spell out the task completely. Agents come from this repo's .claude/agents and .pi/agents " +
|
|
605
|
-
|
|
633
|
+
`(list them with /agents); ${hasGeneral
|
|
634
|
+
? "omit `agent` for the general-purpose one"
|
|
635
|
+
: "name the agent on every task, since no general-purpose one was offered at session launch"}. The list below was ` +
|
|
606
636
|
"captured at session launch — if the session's cwd differs from the launch cwd it may be " +
|
|
607
637
|
"stale; an unknown name is a hard error, so trust /agents over this list when they differ." +
|
|
608
638
|
agentListBlock,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yagni-app/code-staging",
|
|
3
|
-
"version": "1.2.14-staging.
|
|
3
|
+
"version": "1.2.14-staging.2349.1",
|
|
4
4
|
"description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"turndown": "^7.2.4",
|
|
59
59
|
"typebox": "^1.3.15"
|
|
60
60
|
},
|
|
61
|
-
"yagniSourceSha": "
|
|
61
|
+
"yagniSourceSha": "5dde9f4b58a461d01339e98d569f6f8739f0b0e8"
|
|
62
62
|
}
|