harnessed 4.32.12 → 4.32.13
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/bin/harnessed-inject-state.mjs +358 -363
- package/dist/cli.mjs +5 -4
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -38,7 +38,7 @@ var init_package = __esm({
|
|
|
38
38
|
"package.json"() {
|
|
39
39
|
package_default = {
|
|
40
40
|
name: "harnessed",
|
|
41
|
-
version: "4.32.
|
|
41
|
+
version: "4.32.13",
|
|
42
42
|
description: "AI coding harness package manager + composition orchestrator",
|
|
43
43
|
type: "module",
|
|
44
44
|
license: "Apache-2.0",
|
|
@@ -9869,12 +9869,12 @@ function findPhaseContextExcerpt(repoRoot, phase, budget) {
|
|
|
9869
9869
|
}
|
|
9870
9870
|
return null;
|
|
9871
9871
|
}
|
|
9872
|
-
function buildInjection(repoRoot, wf, learningsMd, budget = DEFAULT_INJECT_BUDGET, intent = null, nowMs = Date.now()) {
|
|
9872
|
+
function buildInjection(repoRoot, wf, learningsMd, budget = DEFAULT_INJECT_BUDGET, intent = null, nowMs = Date.now(), opts = {}) {
|
|
9873
9873
|
const ledgerEmpty = (wf?.sub_progress ?? []).length === 0;
|
|
9874
9874
|
const intentBlock = ledgerEmpty ? buildIntentBlock(intent, nowMs) : "";
|
|
9875
9875
|
if (!wf) return intentBlock;
|
|
9876
9876
|
const forward = nextPending(wf.sub_progress ?? []) === null ? forwardPointer(repoRoot, wf) : null;
|
|
9877
|
-
const ws = buildWorkflowStateBlock(wf, forward);
|
|
9877
|
+
const ws = buildWorkflowStateBlock(wf, forward, opts.ledgerAgeMs);
|
|
9878
9878
|
const ledgerSubs = (wf.sub_progress ?? []).map((e) => e.sub);
|
|
9879
9879
|
const rel = selectWithinBudget(
|
|
9880
9880
|
filterRelevantLearnings(parseLearnings(learningsMd), { phase: wf.phase, ledgerSubs }),
|
|
@@ -9882,7 +9882,8 @@ function buildInjection(repoRoot, wf, learningsMd, budget = DEFAULT_INJECT_BUDGE
|
|
|
9882
9882
|
);
|
|
9883
9883
|
const usedTokens = rel.reduce((a, e) => a + tok(e.raw), 0);
|
|
9884
9884
|
const ctx = findPhaseContextExcerpt(repoRoot, wf.phase, Math.max(0, budget - usedTokens));
|
|
9885
|
-
const
|
|
9885
|
+
const pcRaw = buildProjectContextBlock({ learnings: rel, contextExcerpt: ctx ?? void 0 });
|
|
9886
|
+
const pc2 = pcRaw && opts.pcGate ? opts.pcGate(pcRaw) ? pcRaw : "" : pcRaw;
|
|
9886
9887
|
const normal = pc2 ? `${ws}
|
|
9887
9888
|
${pc2}` : ws;
|
|
9888
9889
|
return intentBlock ? `${intentBlock}
|