@stigmer/runner 3.1.1 → 3.1.3
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/.build-fingerprint +1 -1
- package/dist/activities/execute-cursor/attachment-resolver.d.ts +49 -8
- package/dist/activities/execute-cursor/attachment-resolver.js +83 -26
- package/dist/activities/execute-cursor/attachment-resolver.js.map +1 -1
- package/dist/activities/execute-cursor/capture-flow.d.ts +18 -0
- package/dist/activities/execute-cursor/capture-flow.js +21 -0
- package/dist/activities/execute-cursor/capture-flow.js.map +1 -1
- package/dist/activities/execute-cursor/cas-observations.d.ts +13 -0
- package/dist/activities/execute-cursor/cas-observations.js +39 -5
- package/dist/activities/execute-cursor/cas-observations.js.map +1 -1
- package/dist/activities/execute-cursor/hook-script.js +19 -1
- package/dist/activities/execute-cursor/hook-script.js.map +1 -1
- package/dist/activities/execute-cursor/index.d.ts +5 -0
- package/dist/activities/execute-cursor/index.js +222 -160
- package/dist/activities/execute-cursor/index.js.map +1 -1
- package/dist/activities/execute-cursor/message-translator.js +10 -1
- package/dist/activities/execute-cursor/message-translator.js.map +1 -1
- package/dist/activities/execute-cursor/prompt-builder.d.ts +32 -7
- package/dist/activities/execute-cursor/prompt-builder.js +38 -20
- package/dist/activities/execute-cursor/prompt-builder.js.map +1 -1
- package/dist/activities/execute-cursor/skill-resolver.d.ts +1 -10
- package/dist/activities/execute-cursor/skill-resolver.js +3 -55
- package/dist/activities/execute-cursor/skill-resolver.js.map +1 -1
- package/dist/activities/execute-cursor/stigmer-link.d.ts +35 -0
- package/dist/activities/execute-cursor/stigmer-link.js +73 -0
- package/dist/activities/execute-cursor/stigmer-link.js.map +1 -0
- package/dist/activities/execute-cursor/turn-boundary.d.ts +108 -0
- package/dist/activities/execute-cursor/turn-boundary.js +163 -0
- package/dist/activities/execute-cursor/turn-boundary.js.map +1 -0
- package/dist/activities/execute-cursor/workspace-provision.d.ts +3 -2
- package/dist/activities/execute-cursor/workspace-provision.js +5 -3
- package/dist/activities/execute-cursor/workspace-provision.js.map +1 -1
- package/dist/activities/execute-deep-agent/index.js +89 -5
- package/dist/activities/execute-deep-agent/index.js.map +1 -1
- package/dist/activities/execute-deep-agent/prompt-builder.d.ts +17 -0
- package/dist/activities/execute-deep-agent/prompt-builder.js +16 -0
- package/dist/activities/execute-deep-agent/prompt-builder.js.map +1 -1
- package/dist/activities/execute-deep-agent/setup.js +22 -16
- package/dist/activities/execute-deep-agent/setup.js.map +1 -1
- package/dist/activities/execute-deep-agent/streaming-v3.js +6 -1
- package/dist/activities/execute-deep-agent/streaming-v3.js.map +1 -1
- package/dist/activities/execute-deep-agent/streaming.d.ts +7 -0
- package/dist/activities/execute-deep-agent/streaming.js +5 -1
- package/dist/activities/execute-deep-agent/streaming.js.map +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.js +9 -0
- package/dist/config.js.map +1 -1
- package/dist/middleware/approval-gate.js +36 -6
- package/dist/middleware/approval-gate.js.map +1 -1
- package/dist/runner-manager.d.ts +2 -0
- package/dist/runner-manager.js +2 -1
- package/dist/runner-manager.js.map +1 -1
- package/dist/runner.d.ts +2 -0
- package/dist/runner.js +2 -1
- package/dist/runner.js.map +1 -1
- package/dist/shared/artifact-storage.d.ts +32 -0
- package/dist/shared/artifact-storage.js +74 -1
- package/dist/shared/artifact-storage.js.map +1 -1
- package/dist/shared/filereview/capture.d.ts +18 -1
- package/dist/shared/filereview/capture.js +105 -28
- package/dist/shared/filereview/capture.js.map +1 -1
- package/dist/shared/filereview/cas-substrate.d.ts +9 -0
- package/dist/shared/filereview/cas-substrate.js +9 -1
- package/dist/shared/filereview/cas-substrate.js.map +1 -1
- package/dist/shared/filereview/events.d.ts +16 -0
- package/dist/shared/filereview/events.js +37 -0
- package/dist/shared/filereview/events.js.map +1 -1
- package/dist/shared/filereview/git-substrate.d.ts +42 -0
- package/dist/shared/filereview/git-substrate.js +78 -0
- package/dist/shared/filereview/git-substrate.js.map +1 -1
- package/dist/shared/filereview/index.d.ts +3 -1
- package/dist/shared/filereview/index.js +3 -1
- package/dist/shared/filereview/index.js.map +1 -1
- package/dist/shared/filereview/line-counts.d.ts +48 -0
- package/dist/shared/filereview/line-counts.js +72 -0
- package/dist/shared/filereview/line-counts.js.map +1 -0
- package/dist/shared/filereview/progress.d.ts +96 -0
- package/dist/shared/filereview/progress.js +134 -0
- package/dist/shared/filereview/progress.js.map +1 -0
- package/dist/shared/implement-plan-prompt.d.ts +44 -0
- package/dist/shared/implement-plan-prompt.js +98 -0
- package/dist/shared/implement-plan-prompt.js.map +1 -0
- package/dist/shared/plan-artifact.d.ts +59 -11
- package/dist/shared/plan-artifact.js +144 -16
- package/dist/shared/plan-artifact.js.map +1 -1
- package/dist/shared/plan-mode-prompt.d.ts +32 -0
- package/dist/shared/plan-mode-prompt.js +56 -0
- package/dist/shared/plan-mode-prompt.js.map +1 -0
- package/dist/shared/status.d.ts +11 -0
- package/dist/shared/status.js +12 -2
- package/dist/shared/status.js.map +1 -1
- package/dist/shared/tool-row.d.ts +30 -1
- package/dist/shared/tool-row.js +53 -4
- package/dist/shared/tool-row.js.map +1 -1
- package/dist/shared/workspace/session-root.d.ts +35 -0
- package/dist/shared/workspace/session-root.js +53 -0
- package/dist/shared/workspace/session-root.js.map +1 -0
- package/dist/shared/workspace/workspace-lock.d.ts +86 -0
- package/dist/shared/workspace/workspace-lock.js +187 -0
- package/dist/shared/workspace/workspace-lock.js.map +1 -0
- package/package.json +8 -5
- package/src/__tests__/config.test.ts +8 -0
- package/src/activities/__tests__/classify-tool-approvals.test.ts +1 -0
- package/src/activities/__tests__/discover-mcp-server.test.ts +1 -0
- package/src/activities/execute-cursor/__tests__/attachment-resolver.test.ts +161 -0
- package/src/activities/execute-cursor/__tests__/build-prompt.test.ts +132 -2
- package/src/activities/execute-cursor/__tests__/cas-observations.test.ts +55 -0
- package/src/activities/execute-cursor/__tests__/delta-enricher.test.ts +68 -0
- package/src/activities/execute-cursor/__tests__/hitl-ledger.test.ts +28 -0
- package/src/activities/execute-cursor/__tests__/hook-script.test.ts +63 -4
- package/src/activities/execute-cursor/__tests__/turn-boundary.test.ts +280 -0
- package/src/activities/execute-cursor/__tests__/workspace-provision.test.ts +36 -2
- package/src/activities/execute-cursor/attachment-resolver.ts +116 -34
- package/src/activities/execute-cursor/capture-flow.ts +32 -0
- package/src/activities/execute-cursor/cas-observations.ts +41 -5
- package/src/activities/execute-cursor/hook-script.ts +19 -1
- package/src/activities/execute-cursor/index.ts +243 -178
- package/src/activities/execute-cursor/message-translator.ts +9 -1
- package/src/activities/execute-cursor/prompt-builder.ts +60 -22
- package/src/activities/execute-cursor/skill-resolver.ts +3 -59
- package/src/activities/execute-cursor/stigmer-link.ts +78 -0
- package/src/activities/execute-cursor/turn-boundary.ts +274 -0
- package/src/activities/execute-cursor/workspace-provision.ts +5 -3
- package/src/activities/execute-deep-agent/__tests__/hitl-resume-approve-all.test.ts +7 -2
- package/src/activities/execute-deep-agent/__tests__/hitl-resume-history.test.ts +7 -2
- package/src/activities/execute-deep-agent/__tests__/index.test.ts +4 -1
- package/src/activities/execute-deep-agent/__tests__/prompt-builder.test.ts +99 -0
- package/src/activities/execute-deep-agent/__tests__/sequential-gate-resume.test.ts +7 -2
- package/src/activities/execute-deep-agent/index.ts +104 -5
- package/src/activities/execute-deep-agent/prompt-builder.ts +39 -0
- package/src/activities/execute-deep-agent/setup.ts +25 -17
- package/src/activities/execute-deep-agent/streaming-v3.ts +6 -1
- package/src/activities/execute-deep-agent/streaming.ts +12 -1
- package/src/config.ts +17 -0
- package/src/middleware/__tests__/approval-gate.test.ts +77 -12
- package/src/middleware/approval-gate.ts +39 -7
- package/src/runner-manager.ts +6 -1
- package/src/runner.ts +6 -1
- package/src/shared/__tests__/artifact-storage.test.ts +111 -1
- package/src/shared/__tests__/implement-plan-prompt.test.ts +86 -0
- package/src/shared/__tests__/plan-artifact.test.ts +142 -9
- package/src/shared/__tests__/secret-leak-scan.test.ts +105 -0
- package/src/shared/__tests__/status.test.ts +7 -2
- package/src/shared/__tests__/tool-row.test.ts +136 -1
- package/src/shared/artifact-storage.ts +83 -1
- package/src/shared/filereview/__tests__/capture.test.ts +182 -1
- package/src/shared/filereview/__tests__/cas-substrate.test.ts +34 -0
- package/src/shared/filereview/__tests__/events.test.ts +105 -0
- package/src/shared/filereview/__tests__/line-counts.test.ts +73 -0
- package/src/shared/filereview/__tests__/progress.test.ts +236 -0
- package/src/shared/filereview/capture.ts +134 -30
- package/src/shared/filereview/cas-substrate.ts +17 -1
- package/src/shared/filereview/events.ts +50 -0
- package/src/shared/filereview/git-substrate.ts +108 -0
- package/src/shared/filereview/index.ts +22 -1
- package/src/shared/filereview/line-counts.ts +83 -0
- package/src/shared/filereview/progress.ts +186 -0
- package/src/shared/implement-plan-prompt.ts +104 -0
- package/src/shared/plan-artifact.ts +152 -16
- package/src/shared/plan-mode-prompt.ts +56 -0
- package/src/shared/status.ts +11 -1
- package/src/shared/tool-row.ts +58 -5
- package/src/shared/workspace/__tests__/session-root.test.ts +42 -0
- package/src/shared/workspace/__tests__/workspace-lock.test.ts +200 -0
- package/src/shared/workspace/session-root.ts +60 -0
- package/src/shared/workspace/workspace-lock.ts +241 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-substrate.js","sourceRoot":"","sources":["../../../src/shared/filereview/git-substrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OA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CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACvD,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAClE,OAAO;QACL,IAAI;QACJ,UAAU,EAAE,cAAc,CAAC,MAAM;QACjC,MAAM,EAAE,MAAM,IAAI,YAAY;QAC9B,KAAK,EAAE,KAAK,IAAI,YAAY;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
export { aggregateDigest, fileChangeKindName, fileDigest, sha256Bytes, sha256Hex, type FileDigestInput, } from "./digest.js";
|
|
7
7
|
export { appendFileReviewEvents, buildBaselineCapturedEvent, buildCandidateCapturedEvent, buildCapturedFileChange, buildFailedEvent, buildReconciledEvent, eventId, hasCandidateCaptured, type CapturedChangeInput, type ChangeSetContext, } from "./events.js";
|
|
8
8
|
export { applyCaptureDecisions, captureBaselineToLedger, captureCandidateToLedger, type CaptureResumeResult, } from "./capture.js";
|
|
9
|
-
export { isGitWorkTree } from "./git-substrate.js";
|
|
9
|
+
export { captureProgressDelta, isGitWorkTree, type GitProgressEntry, type ProgressDelta, } from "./git-substrate.js";
|
|
10
|
+
export { buildFileChangeProgress, captureFileChangeProgress, newProgressCaptureState, PROGRESS_CAPTURE_MIN_INTERVAL_MS, PROGRESS_MAX_ENTRIES, shouldCaptureProgress, type ProgressCaptureState, } from "./progress.js";
|
|
11
|
+
export { countLineChanges, LINE_COUNT_MAX_BYTES, type LineChangeCounts, } from "./line-counts.js";
|
|
10
12
|
export { applyCasApproved, casBlobKey, casBlobReader, casManifestKey, loadCasManifest, restoreCasToBaseline, snapshotCasChangeSet, type BlobReader, type CasBlobRef, type CasCapturedFile, type CasManifest, type CasPathCapture, type CasSnapshotRef, } from "./cas-substrate.js";
|
|
11
13
|
export { isSecretLikePath, partitionIgnoredPathsBySecret, SECRET_BASENAME_PATTERNS, SECRET_PATH_PATTERNS, type CasSecretPartition, } from "./secret-paths.js";
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
export { aggregateDigest, fileChangeKindName, fileDigest, sha256Bytes, sha256Hex, } from "./digest.js";
|
|
7
7
|
export { appendFileReviewEvents, buildBaselineCapturedEvent, buildCandidateCapturedEvent, buildCapturedFileChange, buildFailedEvent, buildReconciledEvent, eventId, hasCandidateCaptured, } from "./events.js";
|
|
8
8
|
export { applyCaptureDecisions, captureBaselineToLedger, captureCandidateToLedger, } from "./capture.js";
|
|
9
|
-
export { isGitWorkTree } from "./git-substrate.js";
|
|
9
|
+
export { captureProgressDelta, isGitWorkTree, } from "./git-substrate.js";
|
|
10
|
+
export { buildFileChangeProgress, captureFileChangeProgress, newProgressCaptureState, PROGRESS_CAPTURE_MIN_INTERVAL_MS, PROGRESS_MAX_ENTRIES, shouldCaptureProgress, } from "./progress.js";
|
|
11
|
+
export { countLineChanges, LINE_COUNT_MAX_BYTES, } from "./line-counts.js";
|
|
10
12
|
export { applyCasApproved, casBlobKey, casBlobReader, casManifestKey, loadCasManifest, restoreCasToBaseline, snapshotCasChangeSet, } from "./cas-substrate.js";
|
|
11
13
|
export { isSecretLikePath, partitionIgnoredPathsBySecret, SECRET_BASENAME_PATTERNS, SECRET_PATH_PATTERNS, } from "./secret-paths.js";
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/filereview/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,SAAS,GAEV,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,OAAO,EACP,oBAAoB,GAGrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,GAEzB,MAAM,cAAc,CAAC;AAEtB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/filereview/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,SAAS,GAEV,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,OAAO,EACP,oBAAoB,GAGrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,GAEzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,gCAAgC,EAChC,oBAAoB,EACpB,qBAAqB,GAEtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GAErB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,GAOrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,GAErB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture-time line counting for the file-review subsystem: the `+N −M` stamped
|
|
3
|
+
* onto each {@link CapturedFileChange} so review surfaces can decorate file
|
|
4
|
+
* lists without the file bodies.
|
|
5
|
+
*
|
|
6
|
+
* WHY THE RUNNER COUNTS, AND WHY WITH JSDIFF. The counts exist because the
|
|
7
|
+
* review UI's compact file lists must show per-file magnitude, but by the time
|
|
8
|
+
* the UI renders, large before/after bodies may have been offloaded to artifact
|
|
9
|
+
* storage (status-offload) — a client cannot count what it would first have to
|
|
10
|
+
* download. So the counts are computed once, at capture, where the bytes are
|
|
11
|
+
* always in hand. They are computed with the SAME `diff` (jsdiff) Myers
|
|
12
|
+
* algorithm the SDK's diff renderer uses (`computeDiff` → `structuredPatch`),
|
|
13
|
+
* NOT with `git diff --numstat`: two counting authorities can disagree on edge
|
|
14
|
+
* cases (trailing newlines being the classic), and a list that says `+37 −1`
|
|
15
|
+
* beside a rendered diff showing `+37 −0` is a self-contradicting UI. One
|
|
16
|
+
* algorithm, consistent by construction.
|
|
17
|
+
*
|
|
18
|
+
* The counts are INFORMATIONAL display data only — never an enforcement input,
|
|
19
|
+
* never folded into `file_digest`/`aggregate_digest` (the same contract as
|
|
20
|
+
* `blocked_reason`).
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Per-side byte ceiling above which counting is skipped. Myers is O(ND) and a
|
|
24
|
+
* pathological many-MB text pair must never stall the capture activity just to
|
|
25
|
+
* decorate a list; above this the counts stay absent and the UI hides the stat.
|
|
26
|
+
* Generous relative to the 128 KiB per-side inline-persist cap — a file can be
|
|
27
|
+
* several times that and still count quickly — while bounding the worst case.
|
|
28
|
+
*/
|
|
29
|
+
export declare const LINE_COUNT_MAX_BYTES: number;
|
|
30
|
+
/** The `+N −M` pair for one file change. */
|
|
31
|
+
export interface LineChangeCounts {
|
|
32
|
+
readonly linesAdded: number;
|
|
33
|
+
readonly linesRemoved: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Count the added/removed lines between two text sides, exactly as the SDK's
|
|
37
|
+
* diff renderer would show them.
|
|
38
|
+
*
|
|
39
|
+
* An absent side is the empty document — an ADD counts every `after` line as
|
|
40
|
+
* added, a DELETE every `before` line as removed — mirroring how the renderer
|
|
41
|
+
* diffs a create/delete. `` markers are metadata,
|
|
42
|
+
* not content, and are excluded (the same rule as the SDK's `mapPatchHunks`).
|
|
43
|
+
*
|
|
44
|
+
* Returns `undefined` when counting is not possible or meaningful: both sides
|
|
45
|
+
* absent, or either side over {@link LINE_COUNT_MAX_BYTES}. Callers leave the
|
|
46
|
+
* proto counts at zero in that case, which consumers render as "no stat".
|
|
47
|
+
*/
|
|
48
|
+
export declare function countLineChanges(before: string | undefined, after: string | undefined): LineChangeCounts | undefined;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture-time line counting for the file-review subsystem: the `+N −M` stamped
|
|
3
|
+
* onto each {@link CapturedFileChange} so review surfaces can decorate file
|
|
4
|
+
* lists without the file bodies.
|
|
5
|
+
*
|
|
6
|
+
* WHY THE RUNNER COUNTS, AND WHY WITH JSDIFF. The counts exist because the
|
|
7
|
+
* review UI's compact file lists must show per-file magnitude, but by the time
|
|
8
|
+
* the UI renders, large before/after bodies may have been offloaded to artifact
|
|
9
|
+
* storage (status-offload) — a client cannot count what it would first have to
|
|
10
|
+
* download. So the counts are computed once, at capture, where the bytes are
|
|
11
|
+
* always in hand. They are computed with the SAME `diff` (jsdiff) Myers
|
|
12
|
+
* algorithm the SDK's diff renderer uses (`computeDiff` → `structuredPatch`),
|
|
13
|
+
* NOT with `git diff --numstat`: two counting authorities can disagree on edge
|
|
14
|
+
* cases (trailing newlines being the classic), and a list that says `+37 −1`
|
|
15
|
+
* beside a rendered diff showing `+37 −0` is a self-contradicting UI. One
|
|
16
|
+
* algorithm, consistent by construction.
|
|
17
|
+
*
|
|
18
|
+
* The counts are INFORMATIONAL display data only — never an enforcement input,
|
|
19
|
+
* never folded into `file_digest`/`aggregate_digest` (the same contract as
|
|
20
|
+
* `blocked_reason`).
|
|
21
|
+
*/
|
|
22
|
+
import { structuredPatch } from "diff";
|
|
23
|
+
/**
|
|
24
|
+
* Per-side byte ceiling above which counting is skipped. Myers is O(ND) and a
|
|
25
|
+
* pathological many-MB text pair must never stall the capture activity just to
|
|
26
|
+
* decorate a list; above this the counts stay absent and the UI hides the stat.
|
|
27
|
+
* Generous relative to the 128 KiB per-side inline-persist cap — a file can be
|
|
28
|
+
* several times that and still count quickly — while bounding the worst case.
|
|
29
|
+
*/
|
|
30
|
+
export const LINE_COUNT_MAX_BYTES = 1024 * 1024;
|
|
31
|
+
/**
|
|
32
|
+
* Count the added/removed lines between two text sides, exactly as the SDK's
|
|
33
|
+
* diff renderer would show them.
|
|
34
|
+
*
|
|
35
|
+
* An absent side is the empty document — an ADD counts every `after` line as
|
|
36
|
+
* added, a DELETE every `before` line as removed — mirroring how the renderer
|
|
37
|
+
* diffs a create/delete. `` markers are metadata,
|
|
38
|
+
* not content, and are excluded (the same rule as the SDK's `mapPatchHunks`).
|
|
39
|
+
*
|
|
40
|
+
* Returns `undefined` when counting is not possible or meaningful: both sides
|
|
41
|
+
* absent, or either side over {@link LINE_COUNT_MAX_BYTES}. Callers leave the
|
|
42
|
+
* proto counts at zero in that case, which consumers render as "no stat".
|
|
43
|
+
*/
|
|
44
|
+
export function countLineChanges(before, after) {
|
|
45
|
+
if (before === undefined && after === undefined)
|
|
46
|
+
return undefined;
|
|
47
|
+
const beforeText = before ?? "";
|
|
48
|
+
const afterText = after ?? "";
|
|
49
|
+
if (Buffer.byteLength(beforeText, "utf8") > LINE_COUNT_MAX_BYTES ||
|
|
50
|
+
Buffer.byteLength(afterText, "utf8") > LINE_COUNT_MAX_BYTES) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
// Zero context: the +/- line population is independent of context width, and
|
|
54
|
+
// omitting context lines keeps the walk (and the patch object) minimal.
|
|
55
|
+
const patch = structuredPatch("a", "b", beforeText, afterText, "", "", {
|
|
56
|
+
context: 0,
|
|
57
|
+
});
|
|
58
|
+
let linesAdded = 0;
|
|
59
|
+
let linesRemoved = 0;
|
|
60
|
+
for (const hunk of patch.hunks) {
|
|
61
|
+
for (const line of hunk.lines) {
|
|
62
|
+
if (line.startsWith("\\"))
|
|
63
|
+
continue;
|
|
64
|
+
if (line[0] === "+")
|
|
65
|
+
linesAdded++;
|
|
66
|
+
else if (line[0] === "-")
|
|
67
|
+
linesRemoved++;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return { linesAdded, linesRemoved };
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=line-counts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-counts.js","sourceRoot":"","sources":["../../../src/shared/filereview/line-counts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAAC;AAQhD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAA0B,EAC1B,KAAyB;IAEzB,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAClE,MAAM,UAAU,GAAG,MAAM,IAAI,EAAE,CAAC;IAChC,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE,CAAC;IAC9B,IACE,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,oBAAoB;QAC5D,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,oBAAoB,EAC3D,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,6EAA6E;IAC7E,wEAAwE;IACxE,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE;QACrE,OAAO,EAAE,CAAC;KACX,CAAC,CAAC;IAEH,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBAAE,SAAS;YACpC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;gBAAE,UAAU,EAAE,CAAC;iBAC7B,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;gBAAE,YAAY,EAAE,CAAC;QAC3C,CAAC;IACH,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mid-run live capture — the harness-agnostic glue that turns a content-free git
|
|
3
|
+
* delta ({@link ./git-substrate.js} `captureProgressDelta`) into the transient
|
|
4
|
+
* `AgentExecutionStatus.file_change_progress` snapshot the "N files changed so
|
|
5
|
+
* far" strip renders (DD-32).
|
|
6
|
+
*
|
|
7
|
+
* THE MODEL
|
|
8
|
+
* ---------
|
|
9
|
+
* This is category 2 of the two status patterns: a runner-owned, latest-snapshot
|
|
10
|
+
* DISPLAY field, NOT the event-sourced file-review ledger. It is deliberately NOT
|
|
11
|
+
* a `FileChangeSet` — progress is never in the ledger, carries NO file bytes or
|
|
12
|
+
* digests, and is NEVER decidable. The turn-boundary CANDIDATE_CAPTURED (in
|
|
13
|
+
* `file_change_sets`) remains the single authoritative, reviewable diff; a mid-run
|
|
14
|
+
* snapshot is no more authoritative than a streamed tool-call arg.
|
|
15
|
+
*
|
|
16
|
+
* Both harnesses drive this through {@link captureFileChangeProgress} from their
|
|
17
|
+
* per-persist loop, each passing its OWN `excludePaths` (the runner-owned gate
|
|
18
|
+
* files it writes into the workspace), so progress and the turn-boundary candidate
|
|
19
|
+
* agree on what is "the agent's change". Capture is throttled by a floor +
|
|
20
|
+
* tree-sha short-circuit so a quiet turn is nearly free.
|
|
21
|
+
*
|
|
22
|
+
* SECRET SAFETY
|
|
23
|
+
* -------------
|
|
24
|
+
* No file bodies are ever carried. A secret-like path ({@link isSecretLikePath})
|
|
25
|
+
* is still surfaced (path visible) but with its line counts ZEROED — the same
|
|
26
|
+
* "path visible, content withheld" rule the ledger uses (DD-12). Nothing new can
|
|
27
|
+
* leak through this field.
|
|
28
|
+
*
|
|
29
|
+
* @since File-Change HITL Redesign (mid-run live capture / DD-32)
|
|
30
|
+
*/
|
|
31
|
+
import type { AgentExecutionStatus } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
32
|
+
import type { FileChangeProgress } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
|
|
33
|
+
import { type ProgressDelta } from "./git-substrate.js";
|
|
34
|
+
/**
|
|
35
|
+
* Cap the per-file entry list so a turn touching thousands of files does not
|
|
36
|
+
* bloat the persisted status (which rides Temporal / the store). `files_changed`
|
|
37
|
+
* and the aggregate counts stay honest over ALL files; the strip shows "… and K
|
|
38
|
+
* more" when the list is capped.
|
|
39
|
+
*/
|
|
40
|
+
export declare const PROGRESS_MAX_ENTRIES = 200;
|
|
41
|
+
/**
|
|
42
|
+
* Minimum wall-clock gap between two mid-run captures, in ms. A floor on cost:
|
|
43
|
+
* every capture stages the working tree (`write-tree`), so we bound how often
|
|
44
|
+
* that runs regardless of persist frequency. Env-tunable for large-repo
|
|
45
|
+
* deployments; defaults to 2s (feels live without hammering git).
|
|
46
|
+
*/
|
|
47
|
+
export declare const PROGRESS_CAPTURE_MIN_INTERVAL_MS: number;
|
|
48
|
+
/**
|
|
49
|
+
* Whether enough wall-clock has elapsed since the last capture to take another.
|
|
50
|
+
* Pure and separated for direct testing (mirrors `persist-decision.ts`). A
|
|
51
|
+
* `lastAtMs` of 0 (never captured) always passes.
|
|
52
|
+
*/
|
|
53
|
+
export declare function shouldCaptureProgress(lastAtMs: number, nowMs: number, minIntervalMs?: number): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Build the transient {@link FileChangeProgress} message from a content-free git
|
|
56
|
+
* delta. Zeroes counts for secret-like paths (path visible, magnitude withheld),
|
|
57
|
+
* caps the entry list at {@link PROGRESS_MAX_ENTRIES} while keeping
|
|
58
|
+
* `files_changed`/aggregate counts honest over every file, and stamps
|
|
59
|
+
* `captured_at`. Pure and exported for direct testing.
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildFileChangeProgress(delta: ProgressDelta, changeSetId: string): FileChangeProgress;
|
|
62
|
+
/**
|
|
63
|
+
* Mutable per-turn state the caller threads across persists: the last captured
|
|
64
|
+
* tree sha (for the short-circuit) and the last capture time (for the floor).
|
|
65
|
+
* A fresh turn starts a fresh state (`{ lastAtMs: 0 }`).
|
|
66
|
+
*/
|
|
67
|
+
export interface ProgressCaptureState {
|
|
68
|
+
lastTreeSha?: string;
|
|
69
|
+
lastAtMs: number;
|
|
70
|
+
}
|
|
71
|
+
/** A fresh per-turn progress state. */
|
|
72
|
+
export declare function newProgressCaptureState(): ProgressCaptureState;
|
|
73
|
+
/**
|
|
74
|
+
* Capture-and-attach the live progress snapshot onto `status.file_change_progress`,
|
|
75
|
+
* throttled by the floor + tree-sha short-circuit. Mutates `status` and `state`
|
|
76
|
+
* in place; a no-op when the floor has not elapsed or the working tree is
|
|
77
|
+
* unchanged since the last capture. Content-free and secret-safe (see
|
|
78
|
+
* {@link buildFileChangeProgress}). Called by both harnesses from their per-persist
|
|
79
|
+
* loop; each passes its own `excludePaths`.
|
|
80
|
+
*
|
|
81
|
+
* The field is set even when the delta is now EMPTY (the agent reverted its own
|
|
82
|
+
* edits) so the strip reflects the reversion (it hides at zero) rather than
|
|
83
|
+
* showing a stale count — the server's presence-guarded merge would keep the
|
|
84
|
+
* stale value if the runner omitted the field.
|
|
85
|
+
*/
|
|
86
|
+
export declare function captureFileChangeProgress(opts: {
|
|
87
|
+
readonly status: AgentExecutionStatus;
|
|
88
|
+
readonly gitRoot: string;
|
|
89
|
+
readonly executionId: string;
|
|
90
|
+
readonly changeSetId: string;
|
|
91
|
+
readonly baselineTree: string;
|
|
92
|
+
readonly excludePaths?: readonly string[];
|
|
93
|
+
readonly state: ProgressCaptureState;
|
|
94
|
+
/** Injectable clock for tests; defaults to `Date.now()`. */
|
|
95
|
+
readonly nowMs?: number;
|
|
96
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mid-run live capture — the harness-agnostic glue that turns a content-free git
|
|
3
|
+
* delta ({@link ./git-substrate.js} `captureProgressDelta`) into the transient
|
|
4
|
+
* `AgentExecutionStatus.file_change_progress` snapshot the "N files changed so
|
|
5
|
+
* far" strip renders (DD-32).
|
|
6
|
+
*
|
|
7
|
+
* THE MODEL
|
|
8
|
+
* ---------
|
|
9
|
+
* This is category 2 of the two status patterns: a runner-owned, latest-snapshot
|
|
10
|
+
* DISPLAY field, NOT the event-sourced file-review ledger. It is deliberately NOT
|
|
11
|
+
* a `FileChangeSet` — progress is never in the ledger, carries NO file bytes or
|
|
12
|
+
* digests, and is NEVER decidable. The turn-boundary CANDIDATE_CAPTURED (in
|
|
13
|
+
* `file_change_sets`) remains the single authoritative, reviewable diff; a mid-run
|
|
14
|
+
* snapshot is no more authoritative than a streamed tool-call arg.
|
|
15
|
+
*
|
|
16
|
+
* Both harnesses drive this through {@link captureFileChangeProgress} from their
|
|
17
|
+
* per-persist loop, each passing its OWN `excludePaths` (the runner-owned gate
|
|
18
|
+
* files it writes into the workspace), so progress and the turn-boundary candidate
|
|
19
|
+
* agree on what is "the agent's change". Capture is throttled by a floor +
|
|
20
|
+
* tree-sha short-circuit so a quiet turn is nearly free.
|
|
21
|
+
*
|
|
22
|
+
* SECRET SAFETY
|
|
23
|
+
* -------------
|
|
24
|
+
* No file bodies are ever carried. A secret-like path ({@link isSecretLikePath})
|
|
25
|
+
* is still surfaced (path visible) but with its line counts ZEROED — the same
|
|
26
|
+
* "path visible, content withheld" rule the ledger uses (DD-12). Nothing new can
|
|
27
|
+
* leak through this field.
|
|
28
|
+
*
|
|
29
|
+
* @since File-Change HITL Redesign (mid-run live capture / DD-32)
|
|
30
|
+
*/
|
|
31
|
+
import { create } from "@bufbuild/protobuf";
|
|
32
|
+
import { FileChangeProgressEntrySchema, FileChangeProgressSchema, } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
|
|
33
|
+
import { utcTimestamp } from "../status.js";
|
|
34
|
+
import { toFileChangeKind } from "./capture.js";
|
|
35
|
+
import { captureProgressDelta } from "./git-substrate.js";
|
|
36
|
+
import { isSecretLikePath } from "./secret-paths.js";
|
|
37
|
+
/**
|
|
38
|
+
* Cap the per-file entry list so a turn touching thousands of files does not
|
|
39
|
+
* bloat the persisted status (which rides Temporal / the store). `files_changed`
|
|
40
|
+
* and the aggregate counts stay honest over ALL files; the strip shows "… and K
|
|
41
|
+
* more" when the list is capped.
|
|
42
|
+
*/
|
|
43
|
+
export const PROGRESS_MAX_ENTRIES = 200;
|
|
44
|
+
/**
|
|
45
|
+
* Minimum wall-clock gap between two mid-run captures, in ms. A floor on cost:
|
|
46
|
+
* every capture stages the working tree (`write-tree`), so we bound how often
|
|
47
|
+
* that runs regardless of persist frequency. Env-tunable for large-repo
|
|
48
|
+
* deployments; defaults to 2s (feels live without hammering git).
|
|
49
|
+
*/
|
|
50
|
+
export const PROGRESS_CAPTURE_MIN_INTERVAL_MS = readMinIntervalMs();
|
|
51
|
+
function readMinIntervalMs() {
|
|
52
|
+
const raw = process.env.STIGMER_PROGRESS_CAPTURE_MIN_INTERVAL_MS;
|
|
53
|
+
if (!raw)
|
|
54
|
+
return 2000;
|
|
55
|
+
const n = Number.parseInt(raw, 10);
|
|
56
|
+
return Number.isFinite(n) && n >= 0 ? n : 2000;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Whether enough wall-clock has elapsed since the last capture to take another.
|
|
60
|
+
* Pure and separated for direct testing (mirrors `persist-decision.ts`). A
|
|
61
|
+
* `lastAtMs` of 0 (never captured) always passes.
|
|
62
|
+
*/
|
|
63
|
+
export function shouldCaptureProgress(lastAtMs, nowMs, minIntervalMs = PROGRESS_CAPTURE_MIN_INTERVAL_MS) {
|
|
64
|
+
return nowMs - lastAtMs >= minIntervalMs;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Build the transient {@link FileChangeProgress} message from a content-free git
|
|
68
|
+
* delta. Zeroes counts for secret-like paths (path visible, magnitude withheld),
|
|
69
|
+
* caps the entry list at {@link PROGRESS_MAX_ENTRIES} while keeping
|
|
70
|
+
* `files_changed`/aggregate counts honest over every file, and stamps
|
|
71
|
+
* `captured_at`. Pure and exported for direct testing.
|
|
72
|
+
*/
|
|
73
|
+
export function buildFileChangeProgress(delta, changeSetId) {
|
|
74
|
+
let filesChanged = 0;
|
|
75
|
+
let totalAdded = 0;
|
|
76
|
+
let totalRemoved = 0;
|
|
77
|
+
const entries = [];
|
|
78
|
+
for (const entry of delta.entries) {
|
|
79
|
+
filesChanged += 1;
|
|
80
|
+
// A secret-like path is surfaced (path visible) but its magnitude is withheld
|
|
81
|
+
// — counts zeroed, mirroring the ledger's "path visible, content withheld".
|
|
82
|
+
const secret = isSecretLikePath(entry.pathAfter || entry.pathBefore);
|
|
83
|
+
const linesAdded = secret ? 0 : entry.linesAdded;
|
|
84
|
+
const linesRemoved = secret ? 0 : entry.linesRemoved;
|
|
85
|
+
totalAdded += linesAdded;
|
|
86
|
+
totalRemoved += linesRemoved;
|
|
87
|
+
if (entries.length < PROGRESS_MAX_ENTRIES) {
|
|
88
|
+
entries.push(create(FileChangeProgressEntrySchema, {
|
|
89
|
+
pathBefore: entry.pathBefore,
|
|
90
|
+
pathAfter: entry.pathAfter,
|
|
91
|
+
kind: toFileChangeKind(entry.changeType),
|
|
92
|
+
linesAdded,
|
|
93
|
+
linesRemoved,
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return create(FileChangeProgressSchema, {
|
|
98
|
+
changeSetId,
|
|
99
|
+
filesChanged,
|
|
100
|
+
linesAdded: totalAdded,
|
|
101
|
+
linesRemoved: totalRemoved,
|
|
102
|
+
entries,
|
|
103
|
+
capturedAt: utcTimestamp(),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** A fresh per-turn progress state. */
|
|
107
|
+
export function newProgressCaptureState() {
|
|
108
|
+
return { lastAtMs: 0 };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Capture-and-attach the live progress snapshot onto `status.file_change_progress`,
|
|
112
|
+
* throttled by the floor + tree-sha short-circuit. Mutates `status` and `state`
|
|
113
|
+
* in place; a no-op when the floor has not elapsed or the working tree is
|
|
114
|
+
* unchanged since the last capture. Content-free and secret-safe (see
|
|
115
|
+
* {@link buildFileChangeProgress}). Called by both harnesses from their per-persist
|
|
116
|
+
* loop; each passes its own `excludePaths`.
|
|
117
|
+
*
|
|
118
|
+
* The field is set even when the delta is now EMPTY (the agent reverted its own
|
|
119
|
+
* edits) so the strip reflects the reversion (it hides at zero) rather than
|
|
120
|
+
* showing a stale count — the server's presence-guarded merge would keep the
|
|
121
|
+
* stale value if the runner omitted the field.
|
|
122
|
+
*/
|
|
123
|
+
export async function captureFileChangeProgress(opts) {
|
|
124
|
+
const now = opts.nowMs ?? Date.now();
|
|
125
|
+
if (!shouldCaptureProgress(opts.state.lastAtMs, now))
|
|
126
|
+
return;
|
|
127
|
+
opts.state.lastAtMs = now;
|
|
128
|
+
const delta = await captureProgressDelta(opts.gitRoot, opts.executionId, opts.baselineTree, opts.excludePaths, opts.state.lastTreeSha);
|
|
129
|
+
if (!delta)
|
|
130
|
+
return; // working tree unchanged since the last capture
|
|
131
|
+
opts.state.lastTreeSha = delta.afterTree;
|
|
132
|
+
opts.status.fileChangeProgress = buildFileChangeProgress(delta, opts.changeSetId);
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/shared/filereview/progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;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I,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC;QAAE,OAAO;IAC7D,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC;IAE1B,MAAM,KAAK,GAAG,MAAM,oBAAoB,CACtC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,KAAK,CAAC,WAAW,CACvB,CAAC;IACF,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,gDAAgD;IAEpE,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,kBAAkB,GAAG,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Build-from-plan prompt directive, shared by both harnesses.
|
|
3
|
+
*
|
|
4
|
+
* When the user approves a plan and clicks "Build from plan", the client
|
|
5
|
+
* submits an execution with `spec.execution_config.build_from_plan` set and a
|
|
6
|
+
* short human-readable message ("Build from plan") — it does NOT embed
|
|
7
|
+
* implement instructions in the message text. The runner owns the agent-facing
|
|
8
|
+
* instruction, injected from this module, so the chat thread can render the
|
|
9
|
+
* turn as a compact chip while the model still receives the full contract.
|
|
10
|
+
*
|
|
11
|
+
* The directive has two variants, chosen by whether the approved plan document
|
|
12
|
+
* actually materialized in the workspace:
|
|
13
|
+
* - Attached (the normal case): the client uploaded the approved plan text
|
|
14
|
+
* (edited or not) and attached it, mounted under `.stigmer/inputs/` as the
|
|
15
|
+
* plan's own file (`<slug>_<id>.plan.md`). The directive points the model at
|
|
16
|
+
* that file and names it authoritative —
|
|
17
|
+
* the user may have refined the document after the plan turn, so the
|
|
18
|
+
* conversation's version can be stale.
|
|
19
|
+
* - Conversation-only (the client's upload failed): the directive falls back
|
|
20
|
+
* to the plan as proposed in the conversation.
|
|
21
|
+
*
|
|
22
|
+
* Like `PLAN_MODE_DIRECTIVE` (plan-mode-prompt.ts), this module is the single
|
|
23
|
+
* source of truth for the words; each harness wraps them in its own prompt
|
|
24
|
+
* framing (XML-tag section for Cursor, markdown heading for the native
|
|
25
|
+
* harness).
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Find the approved plan document among the workspace paths the harness
|
|
29
|
+
* injected for this execution's attachments. Detection keys on the plan
|
|
30
|
+
* filename convention ({@link isPlanArtifactName} — the legacy `plan.md` or any
|
|
31
|
+
* `*.plan.md`), the same convention the UI uses to detect the plan artifact.
|
|
32
|
+
* Returns `undefined` when no plan attachment landed (upload failed, or the
|
|
33
|
+
* attachment itself failed to inject), which selects the conversation-only
|
|
34
|
+
* directive variant.
|
|
35
|
+
*/
|
|
36
|
+
export declare function findApprovedPlanPath(attachmentPaths: readonly string[]): string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Build the implement-plan directive body for a Build-from-plan execution.
|
|
39
|
+
*
|
|
40
|
+
* @param planPath - Workspace-relative path of the attached approved plan
|
|
41
|
+
* (from {@link findApprovedPlanPath}), or `undefined` when the plan exists
|
|
42
|
+
* only in the conversation.
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildImplementPlanDirective(planPath?: string): string;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Build-from-plan prompt directive, shared by both harnesses.
|
|
3
|
+
*
|
|
4
|
+
* When the user approves a plan and clicks "Build from plan", the client
|
|
5
|
+
* submits an execution with `spec.execution_config.build_from_plan` set and a
|
|
6
|
+
* short human-readable message ("Build from plan") — it does NOT embed
|
|
7
|
+
* implement instructions in the message text. The runner owns the agent-facing
|
|
8
|
+
* instruction, injected from this module, so the chat thread can render the
|
|
9
|
+
* turn as a compact chip while the model still receives the full contract.
|
|
10
|
+
*
|
|
11
|
+
* The directive has two variants, chosen by whether the approved plan document
|
|
12
|
+
* actually materialized in the workspace:
|
|
13
|
+
* - Attached (the normal case): the client uploaded the approved plan text
|
|
14
|
+
* (edited or not) and attached it, mounted under `.stigmer/inputs/` as the
|
|
15
|
+
* plan's own file (`<slug>_<id>.plan.md`). The directive points the model at
|
|
16
|
+
* that file and names it authoritative —
|
|
17
|
+
* the user may have refined the document after the plan turn, so the
|
|
18
|
+
* conversation's version can be stale.
|
|
19
|
+
* - Conversation-only (the client's upload failed): the directive falls back
|
|
20
|
+
* to the plan as proposed in the conversation.
|
|
21
|
+
*
|
|
22
|
+
* Like `PLAN_MODE_DIRECTIVE` (plan-mode-prompt.ts), this module is the single
|
|
23
|
+
* source of truth for the words; each harness wraps them in its own prompt
|
|
24
|
+
* framing (XML-tag section for Cursor, markdown heading for the native
|
|
25
|
+
* harness).
|
|
26
|
+
*/
|
|
27
|
+
import { isPlanArtifactName } from "./plan-artifact.js";
|
|
28
|
+
/**
|
|
29
|
+
* Progress-tracking instruction shared by both directive variants (Tier 3 of
|
|
30
|
+
* Plan mode — plan-driven build progress). The agent's own to-do tool is the
|
|
31
|
+
* single writer of `status.todos`, so instructing it to derive the list from
|
|
32
|
+
* the approved plan is the entire plan→progress linkage: the runner's todo
|
|
33
|
+
* extraction and the clients' todo renderers light up unchanged.
|
|
34
|
+
*
|
|
35
|
+
* Deliberately tool-agnostic ("your to-do list"): the Cursor harness exposes
|
|
36
|
+
* TodoWrite/updateTodos, the native harness write_todos, and each runtime
|
|
37
|
+
* already teaches the model its own tool.
|
|
38
|
+
*
|
|
39
|
+
* Wording constraint: this block rides BOTH variants, and the conversation-only
|
|
40
|
+
* variant is pinned by tests to never contain "plan.md" (it has no plan file
|
|
41
|
+
* to reference) — so say "the plan", never name the file.
|
|
42
|
+
*/
|
|
43
|
+
const TRACK_PROGRESS_INSTRUCTION = [
|
|
44
|
+
"Track your progress with your to-do list so the user can follow the " +
|
|
45
|
+
"build:",
|
|
46
|
+
"- Before you start, break the plan into a concrete, ordered to-do list — " +
|
|
47
|
+
"roughly one item per implementation step.",
|
|
48
|
+
"- As you work, keep it current: mark each item in progress when you " +
|
|
49
|
+
"begin it and completed when it is done.",
|
|
50
|
+
].join("\n");
|
|
51
|
+
/**
|
|
52
|
+
* Find the approved plan document among the workspace paths the harness
|
|
53
|
+
* injected for this execution's attachments. Detection keys on the plan
|
|
54
|
+
* filename convention ({@link isPlanArtifactName} — the legacy `plan.md` or any
|
|
55
|
+
* `*.plan.md`), the same convention the UI uses to detect the plan artifact.
|
|
56
|
+
* Returns `undefined` when no plan attachment landed (upload failed, or the
|
|
57
|
+
* attachment itself failed to inject), which selects the conversation-only
|
|
58
|
+
* directive variant.
|
|
59
|
+
*/
|
|
60
|
+
export function findApprovedPlanPath(attachmentPaths) {
|
|
61
|
+
return attachmentPaths.find((p) => {
|
|
62
|
+
const name = p.split("/").pop();
|
|
63
|
+
return name !== undefined && isPlanArtifactName(name);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Build the implement-plan directive body for a Build-from-plan execution.
|
|
68
|
+
*
|
|
69
|
+
* @param planPath - Workspace-relative path of the attached approved plan
|
|
70
|
+
* (from {@link findApprovedPlanPath}), or `undefined` when the plan exists
|
|
71
|
+
* only in the conversation.
|
|
72
|
+
*/
|
|
73
|
+
export function buildImplementPlanDirective(planPath) {
|
|
74
|
+
if (planPath) {
|
|
75
|
+
return [
|
|
76
|
+
"IMPORTANT: This turn implements a plan the user has reviewed and " +
|
|
77
|
+
"APPROVED.",
|
|
78
|
+
"",
|
|
79
|
+
`The approved plan document is attached at \`${planPath}\`. Read it ` +
|
|
80
|
+
"FIRST, then implement it step by step.",
|
|
81
|
+
"",
|
|
82
|
+
"That document is the authoritative version of the plan — the user may " +
|
|
83
|
+
"have edited it after it was proposed, so where it differs from the " +
|
|
84
|
+
"conversation above, follow the document.",
|
|
85
|
+
"",
|
|
86
|
+
TRACK_PROGRESS_INSTRUCTION,
|
|
87
|
+
].join("\n");
|
|
88
|
+
}
|
|
89
|
+
return [
|
|
90
|
+
"IMPORTANT: This turn implements a plan the user has reviewed and " +
|
|
91
|
+
"APPROVED.",
|
|
92
|
+
"",
|
|
93
|
+
"Implement the plan proposed in the conversation above, step by step.",
|
|
94
|
+
"",
|
|
95
|
+
TRACK_PROGRESS_INSTRUCTION,
|
|
96
|
+
].join("\n");
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=implement-plan-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implement-plan-prompt.js","sourceRoot":"","sources":["../../src/shared/implement-plan-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,MAAM,0BAA0B,GAAG;IACjC,sEAAsE;QACpE,QAAQ;IACV,2EAA2E;QACzE,2CAA2C;IAC7C,sEAAsE;QACpE,yCAAyC;CAC5C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,eAAkC;IAElC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QAChC,OAAO,IAAI,KAAK,SAAS,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,QAAiB;IAC3D,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;YACL,mEAAmE;gBACjE,WAAW;YACb,EAAE;YACF,+CAA+C,QAAQ,cAAc;gBACnE,wCAAwC;YAC1C,EAAE;YACF,wEAAwE;gBACtE,qEAAqE;gBACrE,0CAA0C;YAC5C,EAAE;YACF,0BAA0B;SAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAED,OAAO;QACL,mEAAmE;YACjE,WAAW;QACb,EAAE;QACF,sEAAsE;QACtE,EAAE;QACF,0BAA0B;KAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|