@pmelab/gtd 64.3.0 → 66.0.0
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/.claude-plugin/plugin.json +1 -1
- package/README.md +35 -25
- package/claude/hooks/assist.ts +9 -35
- package/claude/hooks/doors.ts +4 -4
- package/claude/hooks/drive.ts +10 -1
- package/claude/hooks/git.ts +56 -0
- package/claude/hooks/handoff.ts +11 -11
- package/claude/hooks/jobs.ts +8 -8
- package/claude/hooks/pr.ts +86 -26
- package/claude/hooks/register.tsx +35 -82
- package/claude/hooks/tools.ts +7 -20
- package/claude/hooks/wording.ts +3 -3
- package/dist/chunks/{flows-dnIE_qbe.mjs → flows-CmQplvh1.mjs} +146 -35
- package/dist/chunks/{steering-DEh_MS40.mjs → steering-CMrePUiY.mjs} +115 -17
- package/dist/chunks/{testkit-BUX-47TD.mjs → testkit-BJhAAVGt.mjs} +905 -99
- package/dist/chunks/{wire-CaPJ9Tme.mjs → wire-xTbzFc26.mjs} +12 -6
- package/dist/flows.mjs +1 -1
- package/dist/gtd.bundle.mjs +965 -163
- package/dist/gtd.core.mjs +150 -134
- package/dist/steering.mjs +1 -1
- package/dist/testkit/gherkin.mjs +1 -1
- package/dist/testkit.mjs +2 -2
- package/dist/web/main.css +1 -1
- package/dist/web/main.js +185 -18
- package/dist/wire.mjs +1 -1
- package/dist/workflow-kit.mjs +9 -3
- package/package.json +1 -1
- package/src/cli/Cli.ts +5 -5
- package/src/cli/History.test.ts +10 -8
- package/src/cli/Metrics.test.ts +2 -1
- package/src/cli/Program.test.ts +4 -2
- package/src/cli/Program.ts +105 -7
- package/src/edge/Edge.test.ts +37 -16
- package/src/edge/Edge.ts +380 -33
- package/src/emit/GitScript.ts +116 -15
- package/src/emit/index.ts +7 -0
- package/src/flows/config.ts +7 -1
- package/src/flows/helpers.ts +36 -18
- package/src/flows/index.test.ts +4 -0
- package/src/flows/index.ts +7 -0
- package/src/flows/runtime.ts +153 -15
- package/src/install/Install.ts +9 -2
- package/src/platform/Git.test.ts +7 -11
- package/src/platform/NodeSync.ts +2 -0
- package/src/platform/RetainedHistory.ts +3 -0
- package/src/platform/SyncIo.ts +2 -0
- package/src/platform/Workspace.test.ts +37 -0
- package/src/platform/Workspace.ts +36 -0
- package/src/platform/index.ts +1 -0
- package/src/replay/Replay.test.ts +9 -0
- package/src/replay/Replay.ts +92 -16
- package/src/replay/Trailers.ts +17 -0
- package/src/replay/Tree.ts +5 -0
- package/src/replay/index.ts +1 -1
- package/src/steering/FORMATS.md +3 -1
- package/src/steering/SteeringFormat.ts +13 -0
- package/src/steering/fixtures/review/sectioned.md +1 -1
- package/src/steering/fixtures/review/sectioned.read.json +0 -1
- package/src/steering/index.ts +1 -0
- package/src/steering/review.test.ts +181 -5
- package/src/steering/review.ts +160 -18
- package/src/step/LandStep.ts +12 -0
- package/src/step/RepoSnapshot.ts +15 -0
- package/src/step/index.ts +1 -0
- package/src/step/planStart.test.ts +4 -3
- package/src/step/planStart.ts +7 -0
- package/src/step/planStep.ts +22 -17
- package/src/step/startBranch.ts +54 -0
- package/src/twins/EmittedScriptRecognizer.ts +118 -1
- package/src/twins/EmittedScripts.test.ts +147 -1
- package/src/twins/InMemRepo.ts +140 -3
- package/src/twins/Layers.ts +1 -0
- package/src/twins/SyncIo.test.ts +19 -4
- package/src/twins/SyncIo.ts +13 -1
- package/src/wire/BeatDocument.test.ts +15 -0
- package/src/wire/BeatDocument.ts +8 -2
- package/src/wire/Demand.ts +26 -12
- package/src/wire/constants.ts +3 -0
- package/src/wire/golden/1/beat-capture.json +1 -0
- package/src/wire/golden/1/beat-message.json +1 -0
- package/src/wire/golden/1/beat-prompt.json +1 -0
- package/src/wire/golden/1/beat-script.json +1 -0
- package/src/wire/golden/1/beat-stalled.json +1 -0
- package/src/wire/types.ts +4 -0
- package/src/workflow/Workflow.ts +3 -0
- package/src/workflow/compile.ts +2 -0
- package/src/workflow/load.ts +2 -0
- package/src/workflow-kit/index.test.ts +1 -0
- package/src/workflow-kit/index.ts +1 -0
- package/src/workflow-kit/scenarios.ts +8 -0
- package/claude/hooks/ship.ts +0 -730
|
@@ -17,6 +17,8 @@ const renderFormat = (fmt, ...args) => {
|
|
|
17
17
|
const ACCESS_REFUSAL = "gtd land: this turn wrote outside its write access — revert these paths, then run `gtd land` again:";
|
|
18
18
|
/** Where a process keeps its pin: the engine and workflow it runs on, as `gtd bundle` prints them. */
|
|
19
19
|
const PIN_PATH = ".gtd/process.gtdpin";
|
|
20
|
+
/** Where a `run(…, { onFail: "rest" })` body's failure is recorded in the tree: the exit status and the output. */
|
|
21
|
+
const RUN_FAILED_PATH = ".gtd/run-failed.txt";
|
|
20
22
|
// src/wire/ExitCodes.ts
|
|
21
23
|
const EXIT_OK = 0;
|
|
22
24
|
/** Something failed that was never a matter of how gtd was invoked — a refusal or an unexpected error. */
|
|
@@ -73,7 +75,7 @@ const beatKindOf = (input) => {
|
|
|
73
75
|
* `stalled at "<state>"` stays a stable substring (see
|
|
74
76
|
* `tests/integration/features/driver-doc.feature`).
|
|
75
77
|
*/
|
|
76
|
-
const stallDiagnosis = (state, actor) => `stalled at "${state}": the last gtd(${actor}): ${state} turn landed an empty attempt, the tree is clean, and another dispatch would repeat it.\n\nTwo ways out:\n - sharpen the step's prompt so the turn has something concrete to author\n - pass allowEmpty: true to the step, so an empty turn completes it and the\n flow decides what follows — finishing, or an escalation step after N\n empty turns\n`;
|
|
78
|
+
const stallDiagnosis = (state, actor, failure, blocked) => blocked !== void 0 ? `stalled at "${state}": landing this ship step is refused.\n\n${blocked}\n` : failure !== void 0 ? `stalled at "${state}": the script exited non-zero and its failure is recorded in the tree. Change the tree to run the script again; the step advances only on a zero exit.\n\n${failure}` : `stalled at "${state}": the last gtd(${actor}): ${state} turn landed an empty attempt, the tree is clean, and another dispatch would repeat it.\n\nTwo ways out:\n - sharpen the step's prompt so the turn has something concrete to author\n - pass allowEmpty: true to the step, so an empty turn completes it and the\n flow decides what follows — finishing, or an escalation step after N\n empty turns\n`;
|
|
77
79
|
/**
|
|
78
80
|
* Assemble one `Demand` — the ONLY place a rest's resolved content becomes
|
|
79
81
|
* `Demand.content` (`stallDiagnosis` at `kind === "stalled"`, the rendered
|
|
@@ -82,8 +84,8 @@ const stallDiagnosis = (state, actor) => `stalled at "${state}": the last gtd(${
|
|
|
82
84
|
* any other kind.
|
|
83
85
|
*/
|
|
84
86
|
const demandOf = (input) => {
|
|
85
|
-
const { rendered, kind, session, validate } = input;
|
|
86
|
-
const content = kind === "stalled" ? stallDiagnosis(rendered.state, rendered.actor) : rendered.content;
|
|
87
|
+
const { rendered, kind, session, validate, fresh = null } = input;
|
|
88
|
+
const content = kind === "stalled" ? stallDiagnosis(rendered.state, rendered.actor, rendered.failure, rendered.blocked) : rendered.content;
|
|
87
89
|
const skills = rendered.skills !== void 0 && rendered.skills.length > 0 ? rendered.skills : void 0;
|
|
88
90
|
const access = rendered.access ?? {
|
|
89
91
|
read: null,
|
|
@@ -94,6 +96,7 @@ const demandOf = (input) => {
|
|
|
94
96
|
content,
|
|
95
97
|
session,
|
|
96
98
|
validate,
|
|
99
|
+
fresh,
|
|
97
100
|
skills,
|
|
98
101
|
access
|
|
99
102
|
};
|
|
@@ -156,6 +159,7 @@ const dispatchFieldsOf = (demand) => {
|
|
|
156
159
|
const none = {
|
|
157
160
|
session: void 0,
|
|
158
161
|
validate: void 0,
|
|
162
|
+
fresh: null,
|
|
159
163
|
skills: void 0,
|
|
160
164
|
access: void 0,
|
|
161
165
|
pin: void 0
|
|
@@ -165,6 +169,7 @@ const dispatchFieldsOf = (demand) => {
|
|
|
165
169
|
...none,
|
|
166
170
|
session: demand.session,
|
|
167
171
|
validate: demand.validate,
|
|
172
|
+
fresh: demand.fresh,
|
|
168
173
|
skills: demand.skills,
|
|
169
174
|
access: demand.access
|
|
170
175
|
};
|
|
@@ -179,13 +184,13 @@ const dispatchFieldsOf = (demand) => {
|
|
|
179
184
|
}
|
|
180
185
|
};
|
|
181
186
|
/**
|
|
182
|
-
* Flatten a `Demand` plus its `BeatStatus` into the single
|
|
187
|
+
* Flatten a `Demand` plus its `BeatStatus` into the single 27-key document
|
|
183
188
|
* `gtd next --json` emits — the ONLY place the two are joined. `cost`/
|
|
184
189
|
* `costByModel` are omitted together, exactly when no cost was recorded
|
|
185
190
|
* (`cost <= 0`).
|
|
186
191
|
*/
|
|
187
192
|
const beatDocument = (demand, status) => {
|
|
188
|
-
const { session, validate, skills, access, pin } = dispatchFieldsOf(demand);
|
|
193
|
+
const { session, validate, fresh, skills, access, pin } = dispatchFieldsOf(demand);
|
|
189
194
|
const hasCost = status.cost > 0;
|
|
190
195
|
return {
|
|
191
196
|
schema: 1,
|
|
@@ -197,6 +202,7 @@ const beatDocument = (demand, status) => {
|
|
|
197
202
|
model: status.model,
|
|
198
203
|
system: status.system,
|
|
199
204
|
validate,
|
|
205
|
+
fresh,
|
|
200
206
|
pin,
|
|
201
207
|
log: status.log,
|
|
202
208
|
state: status.state,
|
|
@@ -485,4 +491,4 @@ const compile = (glob) => {
|
|
|
485
491
|
return new RegExp(`${pattern}$`, "s");
|
|
486
492
|
};
|
|
487
493
|
const globMatches = (path, glob) => compile(glob).test(path);
|
|
488
|
-
export {
|
|
494
|
+
export { RUN_FAILED_PATH as A, EXIT_RUNTIME_ERROR as C, EXIT_USAGE_ERROR as D, EXIT_STRAYS_FOUND as E, WIRE_SCHEMA as M, renderFormat as N, ACCESS_REFUSAL as O, EXIT_OK as S, EXIT_SIGTERM as T, BEAT_KINDS as _, renderScriptJson as a, stallDiagnosis as b, landProseText as c, renderLandPlain as d, DEMAND_BRIEFING as f, statusOf as g, renderBeatJson as h, judgeJson as i, UNATTRIBUTED_MODEL as j, PIN_PATH as k, noopText as l, beatDocument as m, resolveSession as n, scriptFields as o, renderBeatPlain as p, selectPath as r, landFields as s, globMatches as t, renderLandJson as u, beatKindOf as v, EXIT_SIGINT as w, EXIT_CODES as x, demandOf as y };
|
package/dist/flows.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { N as FLOWS_PROTOCOL, P as FlowsProtocolError, F as accessFor, I as agent, s as answered, w as applyScript, L as changes, R as changesSince, c as check, T as checkScript, l as codeChanges, z as codeThreads, r as defineConfig, a as defineWorkflow, u as displayPath, B as envSettings, V as envSettingsOf, H as glob, d as hasThreadFor, U as head, W as human, K as judge, f as judgeDiffShape, q as kept, J as mark, X as matches, E as moveScript, p as numeric, Z as openQuestions, m as progressErrors, D as quote, $ as read, et as refuse, O as removeScript, h as repliesErrors, g as requireAnswers, _ as requireProgress, v as requireReplies, y as requireRevert, b as requireThreadsClosed, tt as restart, k as restoreScript, x as revertErrors, A as revertScript, nt as run, rt as scope, S as seamGate, it as sectionBodies, at as sections, ot as settings, st as settingsOf, ct as ship, j as showScript, lt as skillsFor, ut as start, dt as threads, ft as workflow, M as writeScript, C as wrote } from "./chunks/flows-CmQplvh1.mjs";
|