fwdloop 0.14.0 → 0.15.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/package.json +1 -1
- package/src/authoring.js +5 -2
- package/src/checked.js +9 -5
- package/src/declaration.js +2 -0
- package/src/flow.js +220 -5
- package/src/panel/author.js +9 -3
- package/src/panel/authorcard.js +55 -3
- package/src/panel/authorflows.js +39 -3
- package/src/panel/authorresume.js +2 -2
- package/src/panel/authorstart.js +18 -10
- package/src/panel/data.js +59 -18
- package/src/panel/index.html +148 -41
- package/src/panel/server.js +1 -1
- package/src/runner.js +9 -1
- package/src/signed-diff.js +71 -0
- package/types/authoring.d.ts +11 -5
- package/types/checked.d.ts +6 -4
- package/types/flow.d.ts +42 -2
- package/types/panel/author.d.ts +34 -0
- package/types/panel/authorcard.d.ts +32 -0
- package/types/panel/authorflows.d.ts +39 -0
- package/types/panel/authorstart.d.ts +1 -0
- package/types/panel/data.d.ts +8 -4
- package/types/signed-diff.d.ts +10 -0
package/src/panel/index.html
CHANGED
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
|
|
127
127
|
[hidden]{display:none !important;}
|
|
128
128
|
.main{display:flex;flex:1;min-height:0;}
|
|
129
|
-
.left-pane{width:
|
|
129
|
+
.left-pane{width:630px;flex:none;border-right:1px solid var(--border-strong);display:flex;flex-direction:column;background:var(--panel);}
|
|
130
130
|
.right-pane{flex:1;min-width:0;display:flex;flex-direction:column;}
|
|
131
131
|
|
|
132
132
|
.tabrow{display:flex;border-bottom:1px solid var(--border-strong);background:var(--panel2);counter-reset:tabnum;}
|
|
@@ -499,6 +499,8 @@
|
|
|
499
499
|
.chat-steps .step.wait .step-label{color:var(--amber);}
|
|
500
500
|
.chat-steps .step-detail{display:block;flex-basis:100%;min-width:0;padding-left:1.2em;color:var(--text-faint);word-break:break-word;white-space:pre-wrap;}
|
|
501
501
|
.chat-steps .step.bad .step-detail{color:var(--red);}
|
|
502
|
+
.chat-steps .step-raw{margin-top:2px;color:var(--text-faint);}
|
|
503
|
+
.chat-steps .step-raw summary{cursor:pointer;}
|
|
502
504
|
.chat-steps .step.run .step-sign::after{content:"\2026";}
|
|
503
505
|
@keyframes step-dots{0%{content:"";}25%{content:".";}50%{content:"..";}75%{content:"...";}}
|
|
504
506
|
@media (prefers-reduced-motion: no-preference){
|
|
@@ -521,7 +523,10 @@
|
|
|
521
523
|
.msg.bot .who::before{content:"$ ";}
|
|
522
524
|
.msg .who{font-size:11px;color:var(--text-faint);margin-bottom:3px;text-transform:none;font-weight:400;}
|
|
523
525
|
/* the card's free-text boxes wrap (textarea): grow a few rows (fitBox), then scroll inside */
|
|
524
|
-
.job-card textarea.jf-wrap{width:100%;box-sizing:border-box;font:inherit;padding:6px 8px;border:1px solid var(--border-strong);border-radius:0;background:var(--bg);color:var(--text);resize:vertical;overflow-y:auto;
|
|
526
|
+
.job-card textarea.jf-wrap{width:100%;box-sizing:border-box;font:inherit;padding:6px 8px;border:1px solid var(--border-strong);border-radius:0;background:var(--bg);color:var(--text);resize:vertical;overflow-y:auto;}
|
|
527
|
+
/* M6 am2: every job box (the textarea and the read-only lines) grows with its text up to 8 lines, then scrolls inside:
|
|
528
|
+
8 x 1.5em + 6px padding x2 + 1px border x2; ONE rule, fitBox reads this cap */
|
|
529
|
+
.job-card textarea.jf-wrap, .job-card .ro-lines{line-height:1.5;max-height:calc(12em + 14px);}
|
|
525
530
|
/* the focused/selected Chat-card field gets a blue border (the accent), no outline ring */
|
|
526
531
|
#panel-chat :is(input,select,textarea):focus{border-color:var(--accent);outline:none;}
|
|
527
532
|
/* amendment 2: the job and inputs boxes have a gutter OUTSIDE them on the left (`N >` per step, `~` per guardrail; a number per input
|
|
@@ -560,7 +565,7 @@
|
|
|
560
565
|
.rw-picked{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:6px;padding:6px 8px;border:1px solid var(--accent);}
|
|
561
566
|
.rw-picked span{overflow-wrap:anywhere;}
|
|
562
567
|
.rw-picked a{font-size:12px;cursor:pointer;flex:none;}
|
|
563
|
-
.ro-lines{padding:6px 8px;border:1px solid var(--border);background:var(--bg);color:var(--text-dim);font-size:12px;overflow-wrap:anywhere;
|
|
568
|
+
.ro-lines{padding:6px 8px;border:1px solid var(--border);background:var(--bg);color:var(--text-dim);font-size:12px;overflow-wrap:anywhere;overflow-y:auto;}
|
|
564
569
|
.ro-lines .ro-line{display:flex;gap:8px;}
|
|
565
570
|
.ro-lines .ro-n{flex:none;min-width:1.4em;color:var(--text-faint);}
|
|
566
571
|
.jf-waitrow{margin-bottom:4px;}
|
|
@@ -783,6 +788,7 @@
|
|
|
783
788
|
</div>
|
|
784
789
|
|
|
785
790
|
<div id="jf-new" data-testid="jf-new">
|
|
791
|
+
<div class="hint edit-banner" id="jf-edit-banner" data-testid="jf-edit-banner" hidden></div>
|
|
786
792
|
<div class="field">
|
|
787
793
|
<label for="jf-name">Flow name</label>
|
|
788
794
|
<input id="jf-name" type="text" placeholder="lowercase letters, digits, - or _" autocomplete="off" spellcheck="false" data-testid="jf-name">
|
|
@@ -843,7 +849,9 @@
|
|
|
843
849
|
<div class="field dimmed" data-testid="jf-run-job-field">
|
|
844
850
|
<label>The job</label>
|
|
845
851
|
<div class="ro-lines" id="jf-run-job" data-testid="jf-run-job"></div>
|
|
846
|
-
<div class="hint">Fixed by the signature (the steps, the job lines and the asks). To change
|
|
852
|
+
<div class="hint">Fixed by the signature (the steps, the job lines and the asks). To change them, edit the job: the AI drafts a new plan, and signing it replaces this job.</div>
|
|
853
|
+
<button class="btn" type="button" id="jf-run-edit" data-testid="jf-run-edit">Edit this job</button>
|
|
854
|
+
<div class="hint" id="jf-run-edit-why" data-testid="jf-run-edit-why"></div>
|
|
847
855
|
</div>
|
|
848
856
|
<div class="field">
|
|
849
857
|
<label for="jf-run-dest">Destination</label>
|
|
@@ -921,7 +929,7 @@
|
|
|
921
929
|
<button class="btn primary wide" type="button" id="chat-q-send" data-testid="chat-q-send">Send</button>
|
|
922
930
|
</div>
|
|
923
931
|
|
|
924
|
-
<!-- M4e amendments 24/25: beside a green plan, Your answers (if it was drafted with any), Checked (built by code from the typed checks) and Not checked (
|
|
932
|
+
<!-- M4e amendments 24/25: beside a green plan, Your answers (if it was drafted with any), Checked (built by code from the typed checks) and Not checked (labelled, from src/checked.js) -->
|
|
925
933
|
<div class="chat-extras" id="chat-extras" data-testid="chat-extras"></div>
|
|
926
934
|
|
|
927
935
|
<!-- a refused draft / run / sign / abandon POST (or a refused start) shows here and STAYS: set only by this tab's own
|
|
@@ -1049,7 +1057,10 @@
|
|
|
1049
1057
|
<div id="job-empty" class="hint" style="font-size:13px;padding:24px 0;">select a run first</div>
|
|
1050
1058
|
<div class="job-card" id="job-card" hidden data-testid="job-card-readonly">
|
|
1051
1059
|
<h4 id="details-title">Job card — signed</h4>
|
|
1060
|
+
<div class="hint" id="details-jobfrom" data-testid="details-jobfrom"></div>
|
|
1052
1061
|
<div class="field"><label>Model</label><div class="ro-value" id="details-model">—</div></div>
|
|
1062
|
+
<!-- am41 item 6: the same "The job" label the Chat card carries, over the signed lines -->
|
|
1063
|
+
<div class="field" style="margin-bottom:0"><label id="details-job-title">The job</label></div>
|
|
1053
1064
|
<!-- M4e amendment 37: ONE column. #details-prose holds one wrapper per signed line (the line, its ~ rows, its steps folded under it);
|
|
1054
1065
|
#details-plan-tail holds any step from no listed line, then the folded "not checked" line; then Ask, Destination, $ cap, Source, Signed. -->
|
|
1055
1066
|
<div id="job-grid" data-testid="job-grid">
|
|
@@ -1449,24 +1460,6 @@
|
|
|
1449
1460
|
// page's step-map builder; the DATA it draws is fwdloop's own: one box per
|
|
1450
1461
|
// `declaration.steps` entry, no scout/plan/judge/fix-loop/rounds — ruling
|
|
1451
1462
|
// A, "no per-round parts"). ----
|
|
1452
|
-
// hamr review #2: "map cards missing try 2 if multiple attempts/iteration"
|
|
1453
|
-
// — a plain "try N" count whenever a step has been attempted more than
|
|
1454
|
-
// once, plus a mark when the LATEST attempt followed a human redo (the
|
|
1455
|
-
// same `afterReject` boundary src/panel/data.js already worked out —
|
|
1456
|
-
// never re-derived here). One attempt (the common case) shows no "try"
|
|
1457
|
-
// text at all, matching bareloop's own "only say it when it's true" shape.
|
|
1458
|
-
// `tryCount` is server-derived (src/panel/data.js's computeTryCount) —
|
|
1459
|
-
// for an ask (hitl) step it counts asks shown to the human (a pause row
|
|
1460
|
-
// + its answer row are the SAME try), for a model step it counts model
|
|
1461
|
-
// attempts. Never re-derived here from `attempts.length` (browser
|
|
1462
|
-
// re-walk bug #2: that over-counted an ask step's pause/answer pairs).
|
|
1463
|
-
function tryCountText(tryCount, attempts){
|
|
1464
|
-
if(!tryCount || tryCount <= 1) return "";
|
|
1465
|
-
var last = attempts && attempts.length ? attempts[attempts.length - 1] : null;
|
|
1466
|
-
var txt = "try " + tryCount;
|
|
1467
|
-
if(last && last.afterReject) txt += " (re-attempt after redo)";
|
|
1468
|
-
return txt;
|
|
1469
|
-
}
|
|
1470
1463
|
// hamr review (browser re-walk #1): the per-attempt list ("attempt 1
|
|
1471
1464
|
// failed · attempt 2 passed · …") is a map node's single biggest source of
|
|
1472
1465
|
// width — that level of detail belongs in the Audit tab, never on the
|
|
@@ -1781,6 +1774,11 @@
|
|
|
1781
1774
|
// selection on the next render.
|
|
1782
1775
|
var wfExpanded = {};
|
|
1783
1776
|
|
|
1777
|
+
// am41 item 5: a job card shows its latest 7 sub-cards (`runs` is newest first); the rest are reached by search.
|
|
1778
|
+
function capChildRuns(runs){
|
|
1779
|
+
return {shown: runs.slice(0, 7), hidden: Math.max(0, runs.length - 7)};
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1784
1782
|
function renderWorkflows(flows){
|
|
1785
1783
|
var el = document.getElementById("wf-list");
|
|
1786
1784
|
el.innerHTML = "";
|
|
@@ -1837,7 +1835,9 @@
|
|
|
1837
1835
|
if(expanded){
|
|
1838
1836
|
var runsWrap = document.createElement("div");
|
|
1839
1837
|
runsWrap.className = "wf-runs";
|
|
1840
|
-
|
|
1838
|
+
var capped = capChildRuns(childRuns);
|
|
1839
|
+
capped.shown.forEach(function(r){ runsWrap.appendChild(buildRunRowEl(r, { sub: true })); });
|
|
1840
|
+
if(capped.hidden > 0) runsWrap.appendChild(textDiv("hint wf-older", "older runs: use search"));
|
|
1841
1841
|
wrap.appendChild(runsWrap);
|
|
1842
1842
|
}
|
|
1843
1843
|
el.appendChild(wrap);
|
|
@@ -2755,7 +2755,11 @@
|
|
|
2755
2755
|
var sends = (job.sends || []).filter(function(sd){ return sd.line === st.line; });
|
|
2756
2756
|
var writes = (st.mayDo || []).some(function(p){ return p === "write" || p === "send"; });
|
|
2757
2757
|
if(writes && sends.length) out += " → " + (sends[0].target || "unknown");
|
|
2758
|
-
|
|
2758
|
+
if(st.checkClass === "green" || st.checkClass === "softgreen") return head + out + " · machine check";
|
|
2759
|
+
// am41 item 2: after the last ask step the human's part is the accept, not a check.
|
|
2760
|
+
var lastAsk = 0;
|
|
2761
|
+
((job.plan && job.plan.steps) || []).forEach(function(p){ if(p.ask && p.step > lastAsk) lastAsk = p.step; });
|
|
2762
|
+
return head + out + " · " + (lastAsk > 0 && st.step > lastAsk ? "after you accept" : "you check");
|
|
2759
2763
|
}
|
|
2760
2764
|
function jobStepFold(st, job){
|
|
2761
2765
|
var fold = document.createElement("details");
|
|
@@ -2771,7 +2775,7 @@
|
|
|
2771
2775
|
fold.appendChild(textDiv("plan-row", "check: " + (st.ask ? "ASK · waits " + plainWait(st.waitMs) : (st.check || []).join(" "))));
|
|
2772
2776
|
return fold;
|
|
2773
2777
|
}
|
|
2774
|
-
// The tail: any step that came from no listed line, then the folded
|
|
2778
|
+
// The tail: any step that came from no listed line, then the folded Not-checked summary (its label comes from the payload, src/checked.js; always shown).
|
|
2775
2779
|
// `placed` (step numbers already folded under a line) is filled by renderJob's line loop before this runs.
|
|
2776
2780
|
function paintJobPlan(job, placed){
|
|
2777
2781
|
var plan = job.plan || {steps: [], notChecked: {recorded: false, items: []}};
|
|
@@ -2783,7 +2787,7 @@
|
|
|
2783
2787
|
fold.className = "plan-fold plan-notchecked";
|
|
2784
2788
|
var sum = document.createElement("summary");
|
|
2785
2789
|
sum.className = "plan-sum";
|
|
2786
|
-
sum.textContent =
|
|
2790
|
+
sum.textContent = nc.label || "";
|
|
2787
2791
|
fold.appendChild(sum);
|
|
2788
2792
|
if(!nc.recorded) fold.appendChild(textDiv("plan-row", "not recorded (signed before amendment 34)"));
|
|
2789
2793
|
else if(!(nc.items || []).length) fold.appendChild(textDiv("plan-row", "the AI listed nothing"));
|
|
@@ -2798,6 +2802,8 @@
|
|
|
2798
2802
|
empty.hidden = true;
|
|
2799
2803
|
card.hidden = false;
|
|
2800
2804
|
document.getElementById("details-title").textContent = "Job — " + job.flow + " (signed)";
|
|
2805
|
+
// M6: which job this is: the copy the run saved when it started, or (a run from before M6) the flow's job as it is now
|
|
2806
|
+
document.getElementById("details-jobfrom").textContent = job.jobFrom === "run" ? "This is the job as this run started it." : (job.jobFromWhy || "");
|
|
2801
2807
|
// review #5: "Job (prose)" — the signed lines, numbered, WITHOUT their
|
|
2802
2808
|
// guardrail mixed in (guardrails get their own field below).
|
|
2803
2809
|
// M4e amendment 6 item 6: the Job block reads like the card: each numbered line, then its own `~` rows: its guardrail, an ask line's
|
|
@@ -3796,6 +3802,7 @@
|
|
|
3796
3802
|
var modeRow = document.getElementById("jf-mode-row");
|
|
3797
3803
|
var titleEl = document.getElementById("job-card-title");
|
|
3798
3804
|
|
|
3805
|
+
var editOf = null; // M6: the signed job this card EDITS: { flow, flowHash } (ONE writer each: startEdit sets it, leaveEdit clears it); null = a new job
|
|
3799
3806
|
var mode = "new"; // "new" | "run" | "resume"
|
|
3800
3807
|
var runSignInfo = null; // Run form, first Sign & run click: { hash } (cleared by any edit)
|
|
3801
3808
|
var resumeCtx = null; // the run being resumed: { flow, runId, form }
|
|
@@ -3925,6 +3932,44 @@
|
|
|
3925
3932
|
return String(n);
|
|
3926
3933
|
});
|
|
3927
3934
|
}
|
|
3935
|
+
// am41 item 7: ONE function turns a checker's red (the text src/declaration.js writes) into one plain sentence for the card. The raw text rides
|
|
3936
|
+
// along unchanged and is folded under "details"; a red no rule below knows gets the generic sentence and still shows its raw text. This reads
|
|
3937
|
+
// the checker's own fixed wording, never the model's prose.
|
|
3938
|
+
function plainPlanCheck(raw){
|
|
3939
|
+
var PLAN_CHECK_RULES = [
|
|
3940
|
+
[/which is not in the job line's words/, "A section name in the plan's check is not in your job line. Change the job line to use the section words you want."],
|
|
3941
|
+
[/the job line says .*; the check says/, "The sections in the plan's check come in a different order than your job line. Change the job line to change the order."],
|
|
3942
|
+
[/the guardrail says \d+ sections; the check has/, "The number of sections in your guardrail is not the number in the plan's check."],
|
|
3943
|
+
[/section name is a short phrase|which is the job line or most of it/, "A section name in the plan's check is too long; it must be a short phrase from your job line."],
|
|
3944
|
+
[/one section name may not contain another/, "One section name in the plan's check contains another, which cannot be checked."],
|
|
3945
|
+
[/wordsPerSection/, "The words for each section in your guardrail and in the plan's check do not match."],
|
|
3946
|
+
[/work as a pair/, "The plan's check has one part of a pair without the other, so it cannot be checked."],
|
|
3947
|
+
[/is blank|characters; the most one entry|ends in ":"/, "A name in the plan's check is empty, too long or ends in a colon, so it cannot be matched."],
|
|
3948
|
+
[/cannot be built into a check/, "The plan's check cannot be built from what the AI wrote."],
|
|
3949
|
+
[/is not its signed line/, "A step does not use your job line word for word as its goal."],
|
|
3950
|
+
[/not in the catalogue|not wired|which is not signed|checkpoint/, "A step uses a tool that is not available for this job."],
|
|
3951
|
+
[/reads artifact|is a duplicate|\.reads must|\.emits must/, "The steps do not pass their results to each other in a workable order."],
|
|
3952
|
+
[/ask at line \d+|signed ask at line|ask slot/, "The ask on one of your lines is not set up as a plain stop where you decide."],
|
|
3953
|
+
[/send at line \d+|signed send at line|send slot/, "The send step is not set up to follow your accept and write only to your destination."],
|
|
3954
|
+
[/hitl after the last signed ask/, "A step after your last ask would leave without your seeing it, so it is refused."],
|
|
3955
|
+
[/is a pause .* unsigned line/, "A step pauses at a line you did not sign as an ask."],
|
|
3956
|
+
[/neither served by any step/, "A line of your job is not covered by any step."],
|
|
3957
|
+
[/picks|inputFacts|invented name/, "The plan names a field that is not in your input."],
|
|
3958
|
+
[/guardrailClasses|unjudgeable|refused/, "The AI's notes on which lines it can check are not in a form the checker accepts."],
|
|
3959
|
+
[/^line \d+'s (guardrail|check)|can't write files/, null],
|
|
3960
|
+
[/must be an? |is required|must name|does not name/, "The plan the AI wrote is not in the shape the checker needs."]
|
|
3961
|
+
];
|
|
3962
|
+
var text = typeof raw === "string" ? raw : "";
|
|
3963
|
+
for(var i = 0; i < PLAN_CHECK_RULES.length; i++){
|
|
3964
|
+
if(PLAN_CHECK_RULES[i][0].test(text)) return {say: PLAN_CHECK_RULES[i][1] === null ? text.replace(/^declaration: /, "") : PLAN_CHECK_RULES[i][1], raw: text};
|
|
3965
|
+
}
|
|
3966
|
+
return {say: "One of the checks on the plan failed.", raw: text};
|
|
3967
|
+
}
|
|
3968
|
+
// a failed step's details: the plain sentences, with the raw checker texts beside them in `raw`
|
|
3969
|
+
function failedDetails(reds){
|
|
3970
|
+
var rows = (reds || []).map(plainPlanCheck);
|
|
3971
|
+
return {details: rows.map(function(r){ return r.say; }), raw: rows.map(function(r){ return r.raw; })};
|
|
3972
|
+
}
|
|
3928
3973
|
// pure: the progress list for a draft. Chronological; a waiting step has no check; a step's detail lines sit under it; no two
|
|
3929
3974
|
// identical lines in a row. `ctx` = { model, starting }.
|
|
3930
3975
|
function stepsFor(state, ctx){
|
|
@@ -3944,7 +3989,7 @@
|
|
|
3944
3989
|
var label = rv.kind === "answers" ? "drafted again with your answers" : "revise " + (reviseNo += 1);
|
|
3945
3990
|
if(rv.phase === "running") out.push({id: "revise-" + rv.n, label: label, status: "running", details: []});
|
|
3946
3991
|
else if(rv.phase === "green") out.push({id: "revise-" + rv.n, label: label, status: "done", details: []});
|
|
3947
|
-
else out.push({id: "revise-" + rv.n, label: label, status: "failed", details:
|
|
3992
|
+
else { var rf = failedDetails(rv.reds); out.push({id: "revise-" + rv.n, label: label, status: "failed", details: rf.details, raw: rf.raw}); }
|
|
3948
3993
|
});
|
|
3949
3994
|
if(state.phase === "green"){
|
|
3950
3995
|
if(ctx.starting) out.push({id: "signed", label: "signed", status: "done", details: []});
|
|
@@ -3953,7 +3998,8 @@
|
|
|
3953
3998
|
if(state.phase === "questions-open") out.push({id: "question", label: "waiting for your answer (" + state.openK + " of " + state.total + ")", status: "waiting", details: []});
|
|
3954
3999
|
} else if(state.phase === "red"){
|
|
3955
4000
|
out.push({id: "drafted", label: "drafted with " + who, status: "done", details: []});
|
|
3956
|
-
|
|
4001
|
+
var cf = failedDetails(state.reds);
|
|
4002
|
+
out.push({id: "checks", label: "plan checks", status: "failed", details: cf.details, raw: cf.raw});
|
|
3957
4003
|
} else if(state.phase === "stopped"){
|
|
3958
4004
|
out.push({id: "drafting", label: "drafting with " + who + capPart, status: "failed", details: []});
|
|
3959
4005
|
} else if(state.phase === "green" || state.phase === "revising"){
|
|
@@ -3994,7 +4040,7 @@
|
|
|
3994
4040
|
return (c.line !== null && c.line !== undefined ? "line " + c.line : "step " + c.step) + ": " + c.sentences.join(" ");
|
|
3995
4041
|
})});
|
|
3996
4042
|
var nc = state.notChecked || {};
|
|
3997
|
-
blocks.push({id: "chat-notchecked", head:
|
|
4043
|
+
blocks.push({id: "chat-notchecked", head: nc.label || "", sub: "", lines: (nc.items && nc.items.length) ? nc.items.map(function(x){ return "- " + x; }) : ["The drafter listed nothing."]});
|
|
3998
4044
|
return {blocks: blocks};
|
|
3999
4045
|
}
|
|
4000
4046
|
// pure: did this POST succeed (one decision for every handler)
|
|
@@ -4024,7 +4070,8 @@
|
|
|
4024
4070
|
el.style.height = "auto";
|
|
4025
4071
|
if(!el.scrollHeight){ el.style.height = ""; return; }
|
|
4026
4072
|
var border = el.offsetHeight - el.clientHeight;
|
|
4027
|
-
|
|
4073
|
+
var cap = parseFloat(window.getComputedStyle(el).maxHeight);
|
|
4074
|
+
el.style.height = Math.min(el.scrollHeight + border, cap > 0 ? cap : 200) + "px";
|
|
4028
4075
|
}
|
|
4029
4076
|
// Paint a gutter: a hidden mirror of the textarea (same font, same content width, same wrapping) measures each logical line's height;
|
|
4030
4077
|
// the gutter gets one entry of exactly that height, its mark on the first visual line. Re-run on every input, resize and fit.
|
|
@@ -4099,7 +4146,8 @@
|
|
|
4099
4146
|
destination: destEl.value.trim(),
|
|
4100
4147
|
inputs: inputsBox.value,
|
|
4101
4148
|
capUsd: byId("jf-cap-money").value.trim(),
|
|
4102
|
-
askWait: askWaitEl.value.trim()
|
|
4149
|
+
askWait: askWaitEl.value.trim(),
|
|
4150
|
+
editOf: editOf
|
|
4103
4151
|
};
|
|
4104
4152
|
}
|
|
4105
4153
|
function runWaits(){
|
|
@@ -4229,8 +4277,10 @@
|
|
|
4229
4277
|
function syncCardLock(){
|
|
4230
4278
|
var on = cardLocked();
|
|
4231
4279
|
card.querySelectorAll("input[type=text], textarea").forEach(function(el){ el.readOnly = on; el.classList.toggle("locked", on); });
|
|
4280
|
+
if(editOf !== null){ byId("jf-name").readOnly = true; byId("jf-name").classList.add("locked"); } // M6: an edit keeps its job's name
|
|
4232
4281
|
runFlowSel.disabled = on;
|
|
4233
4282
|
runFlowSel.classList.toggle("locked", on);
|
|
4283
|
+
syncEditBtn();
|
|
4234
4284
|
rwPickedEl.classList.toggle("locked", on);
|
|
4235
4285
|
card.querySelectorAll('input[name="jf-mode"]').forEach(function(r){ r.disabled = on || sessionLive; });
|
|
4236
4286
|
}
|
|
@@ -4268,6 +4318,38 @@
|
|
|
4268
4318
|
el.appendChild(row);
|
|
4269
4319
|
});
|
|
4270
4320
|
}
|
|
4321
|
+
// ---- M6: Edit a signed job. The list entry carries the job as a card (`edit`); Edit fills the New-job boxes from it and keeps the job's name and
|
|
4322
|
+
// the signature hash it was opened at. Nothing is written until the normal Draft -> Sign. Clear / Abandon leave the job exactly as it was.
|
|
4323
|
+
var editBtn = document.getElementById("jf-run-edit");
|
|
4324
|
+
var editWhyEl = document.getElementById("jf-run-edit-why");
|
|
4325
|
+
var editBannerEl = document.getElementById("jf-edit-banner");
|
|
4326
|
+
function syncEditBtn(){
|
|
4327
|
+
if(!editBtn) return; // called by the first lock sync, before this block has run
|
|
4328
|
+
var f = selectedFlow();
|
|
4329
|
+
var can = !!(f && f.edit && f.edit.ok === true);
|
|
4330
|
+
editBtn.disabled = !can || cardLocked() || sessionLive || startId !== null;
|
|
4331
|
+
editWhyEl.textContent = (f && f.edit && f.edit.ok === false) ? f.edit.say : "";
|
|
4332
|
+
}
|
|
4333
|
+
function startEdit(){
|
|
4334
|
+
var f = selectedFlow();
|
|
4335
|
+
if(!f || !f.edit || f.edit.ok !== true || cardLocked() || sessionLive) return;
|
|
4336
|
+
var c = f.edit.card;
|
|
4337
|
+
editOf = {flow: f.flow, flowHash: f.edit.flowHash};
|
|
4338
|
+
setMode("new");
|
|
4339
|
+
setVal("jf-name", f.flow); setVal("jf-job", c.job); setVal("jf-cap-money", c.capUsd);
|
|
4340
|
+
setVal("jf-dest-folder", c.destination); setVal("jf-inputs", c.inputs); setVal("jf-ask-wait", c.askWait || "1h");
|
|
4341
|
+
editBannerEl.textContent = "Editing \u201c" + f.flow + "\u201d. Draft it, read the new plan, then sign: signing replaces this job. Clear leaves it exactly as it was.";
|
|
4342
|
+
editBannerEl.hidden = false;
|
|
4343
|
+
chatActionOk();
|
|
4344
|
+
refreshCapNote(); fitCardBoxes(); refreshStartEnabled();
|
|
4345
|
+
}
|
|
4346
|
+
// the card stops editing a job: the name box is free again
|
|
4347
|
+
function leaveEdit(){
|
|
4348
|
+
editOf = null;
|
|
4349
|
+
editBannerEl.hidden = true; editBannerEl.textContent = "";
|
|
4350
|
+
var nm = byId("jf-name"); nm.readOnly = false; nm.classList.remove("locked");
|
|
4351
|
+
}
|
|
4352
|
+
editBtn.addEventListener("click", startEdit);
|
|
4271
4353
|
function paintRunFlow(){
|
|
4272
4354
|
var f = selectedFlow();
|
|
4273
4355
|
var v = f ? (pickedRun ? pickedRun.values : f.values) : null; // a picked run's own values, else the flow's own
|
|
@@ -4296,6 +4378,7 @@
|
|
|
4296
4378
|
byId("jf-run-id").value = autoRunId;
|
|
4297
4379
|
clearFieldErrors();
|
|
4298
4380
|
refreshCapNote();
|
|
4381
|
+
syncEditBtn();
|
|
4299
4382
|
}
|
|
4300
4383
|
// borrowed-from: bareloop src/panel/index.html@b5e37b8 — the Reuse workflow picker: ONE function shows the search box + list before a pick and the
|
|
4301
4384
|
// picked box after; a row is the name (the typed part marked) over the flow's track record line.
|
|
@@ -4373,17 +4456,32 @@
|
|
|
4373
4456
|
// ---- render: the progress list, the readout and the one main button ----
|
|
4374
4457
|
// Returns true when the list's content actually changed (a new line, or the latest line changed) so the caller can scroll only
|
|
4375
4458
|
// then; an identical poll tick returns false and leaves the person's scroll position alone.
|
|
4459
|
+
// A fold the person opened stays open: the list is rewritten only when its markup changed, and a rewrite draws each fold open again
|
|
4460
|
+
// from progressOpen (keyed step id : detail index, set by the toggle listener) until the person closes it.
|
|
4461
|
+
var progressHtml = "";
|
|
4462
|
+
var progressOpen = {};
|
|
4463
|
+
progressRow.addEventListener("toggle", function(e){
|
|
4464
|
+
var key = e.target && e.target.getAttribute ? e.target.getAttribute("data-fold") : null;
|
|
4465
|
+
if(key) progressOpen[key] = e.target.open === true;
|
|
4466
|
+
}, true);
|
|
4376
4467
|
function renderProgress(steps){
|
|
4377
|
-
var before = progressRow.innerHTML;
|
|
4378
4468
|
progressRow.hidden = steps.length === 0;
|
|
4379
|
-
|
|
4469
|
+
var html = steps.map(function(st){
|
|
4380
4470
|
var cls = st.status === "waiting" ? "wait" : (st.status === "running" ? "run" : (st.status === "failed" ? "bad" : "ok"));
|
|
4381
4471
|
var sign = cls === "ok" ? "✓" : (cls === "bad" ? "✗" : "");
|
|
4382
4472
|
return '<li class="step ' + cls + '" data-step="' + escapeXml(st.id) + '"><div class="step-line"><span class="step-label">' + escapeXml(st.label) + '</span>' +
|
|
4383
4473
|
'<span class="step-sign">' + sign + '</span></div>' +
|
|
4384
|
-
(st.details || []).map(function(d){
|
|
4474
|
+
(st.details || []).map(function(d, k){
|
|
4475
|
+
var raw = st.raw || [];
|
|
4476
|
+
var key = st.id + ":" + k;
|
|
4477
|
+
var fold = typeof raw[k] === "string" && raw[k] !== "" ? '<details class="step-raw" data-fold="' + escapeXml(key) + '"' + (progressOpen[key] ? " open" : "") + '><summary>details</summary>' + escapeXml(raw[k]) + '</details>' : "";
|
|
4478
|
+
return '<div class="step-detail">' + escapeXml("> " + d) + fold + '</div>';
|
|
4479
|
+
}).join("") + '</li>';
|
|
4385
4480
|
}).join("");
|
|
4386
|
-
|
|
4481
|
+
if(html === progressHtml) return false;
|
|
4482
|
+
progressHtml = html;
|
|
4483
|
+
progressRow.innerHTML = html;
|
|
4484
|
+
return true;
|
|
4387
4485
|
}
|
|
4388
4486
|
// the plan the human is about to sign: the drafter's readout and the hash; nothing else goes in the thread
|
|
4389
4487
|
var threadKey = "";
|
|
@@ -4495,7 +4593,7 @@
|
|
|
4495
4593
|
threadKey = ""; thread.innerHTML = "";
|
|
4496
4594
|
renderQuestion(null); renderExtras(null);
|
|
4497
4595
|
errEl.textContent = "";
|
|
4498
|
-
progressRow.hidden = true; progressRow.innerHTML = "";
|
|
4596
|
+
progressRow.hidden = true; progressRow.innerHTML = ""; progressHtml = "";
|
|
4499
4597
|
refreshStartEnabled();
|
|
4500
4598
|
}
|
|
4501
4599
|
function openNewCard(){
|
|
@@ -4508,12 +4606,13 @@
|
|
|
4508
4606
|
sessionId = null; sessionLive = false; lastState = null; signInfo = null; signClickedOnce = false; busy = false; reviseOpen = false;
|
|
4509
4607
|
stopPoll();
|
|
4510
4608
|
progressRow.hidden = true;
|
|
4511
|
-
progressRow.innerHTML = "";
|
|
4609
|
+
progressRow.innerHTML = ""; progressHtml = "";
|
|
4512
4610
|
refreshStartEnabled();
|
|
4513
4611
|
}
|
|
4514
4612
|
// back to a fresh empty card: every box, the inputs, the progress list, the ask box
|
|
4515
4613
|
function resetCard(){
|
|
4516
4614
|
if(mode === "resume"){ resumeCtx = null; setMode(modeBeforeResume === "resume" ? "new" : modeBeforeResume); }
|
|
4615
|
+
leaveEdit();
|
|
4517
4616
|
["jf-name", "jf-job", "jf-cap-money", "jf-dest-folder", "jf-inputs"].forEach(function(id){ byId(id).value = ""; });
|
|
4518
4617
|
askWaitEl.value = "1h";
|
|
4519
4618
|
refreshCapNote();
|
|
@@ -4587,7 +4686,7 @@
|
|
|
4587
4686
|
window.fwdloopResuming = null; // a refused start leaves the run stopped: Resume is offered again
|
|
4588
4687
|
refusedStartId = j.startId;
|
|
4589
4688
|
chatActionFailed(signed ? j.say + " The flow is signed; start it from \"Run a signed flow\"." : j.say);
|
|
4590
|
-
if(signed){ endSession(); loadFlows(true); } else { progressRow.hidden = true; progressRow.innerHTML = ""; refreshStartEnabled(); }
|
|
4689
|
+
if(signed){ leaveEdit(); endSession(); loadFlows(true); } else { progressRow.hidden = true; progressRow.innerHTML = ""; progressHtml = ""; refreshStartEnabled(); }
|
|
4591
4690
|
return;
|
|
4592
4691
|
}
|
|
4593
4692
|
if(j.ok === false && j.refused === "no-such-start"){
|
|
@@ -4761,7 +4860,7 @@
|
|
|
4761
4860
|
if(!o.ok){
|
|
4762
4861
|
busy = false;
|
|
4763
4862
|
failFrom(r);
|
|
4764
|
-
if(r.body && r.body.signed === true){ endSession(); loadFlows(true); } else { refreshStartEnabled(); }
|
|
4863
|
+
if(r.body && r.body.signed === true){ leaveEdit(); endSession(); loadFlows(true); } else { refreshStartEnabled(); }
|
|
4765
4864
|
return;
|
|
4766
4865
|
}
|
|
4767
4866
|
chatActionOk();
|
|
@@ -4812,6 +4911,11 @@
|
|
|
4812
4911
|
setVal("jf-name", c.flowName); setVal("jf-job", c.job); setVal("jf-cap-money", c.capUsd);
|
|
4813
4912
|
refreshCapNote();
|
|
4814
4913
|
setVal("jf-dest-folder", typeof c.destination === "string" ? c.destination : ""); setVal("jf-inputs", typeof c.inputs === "string" ? c.inputs : ""); setVal("jf-ask-wait", c.askWait || "1h");
|
|
4914
|
+
if(c.editOf && typeof c.editOf.flow === "string"){
|
|
4915
|
+
editOf = {flow: c.editOf.flow, flowHash: c.editOf.flowHash};
|
|
4916
|
+
editBannerEl.textContent = "Editing \u201c" + c.editOf.flow + "\u201d. Draft it, read the new plan, then sign: signing replaces this job. Clear leaves it exactly as it was.";
|
|
4917
|
+
editBannerEl.hidden = false;
|
|
4918
|
+
}
|
|
4815
4919
|
sessionId = d.draftId;
|
|
4816
4920
|
sessionLive = CLIENT_TERMINAL_PHASES.indexOf(d.phase) === -1;
|
|
4817
4921
|
renderThread(d);
|
|
@@ -4870,7 +4974,10 @@
|
|
|
4870
4974
|
refreshStartEnabled();
|
|
4871
4975
|
});
|
|
4872
4976
|
document.querySelectorAll('input[name="jf-mode"]').forEach(function(r){
|
|
4873
|
-
r.addEventListener("change", function(){
|
|
4977
|
+
r.addEventListener("change", function(){
|
|
4978
|
+
if(r.checked && editOf !== null && r.value !== "new" && !sessionLive){ leaveEdit(); ["jf-name", "jf-job", "jf-cap-money", "jf-dest-folder", "jf-inputs"].forEach(function(id){ byId(id).value = ""; }); }
|
|
4979
|
+
if(r.checked) setMode(r.value);
|
|
4980
|
+
});
|
|
4874
4981
|
});
|
|
4875
4982
|
runFlowSel.addEventListener("input", function(){ rwHl = 0; renderFlowSearch(); });
|
|
4876
4983
|
runFlowSel.addEventListener("keydown", function(e){
|
package/src/panel/server.js
CHANGED
|
@@ -506,7 +506,7 @@ export function handleRequest(req, res, opts) {
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
if (pathname === '/api/inbox') {
|
|
509
|
-
const rows = listStops({ root: opts.root, resumeAttempt });
|
|
509
|
+
const rows = listStops({ root: opts.root, resumeAttempt, catalogue });
|
|
510
510
|
send(200, { rows, openCount: inboxOpenCount(rows) });
|
|
511
511
|
return;
|
|
512
512
|
}
|
package/src/runner.js
CHANGED
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
import { fileURLToPath } from 'node:url';
|
|
47
47
|
|
|
48
48
|
import {
|
|
49
|
-
readFlow, resolveRunDir, readFileInside, readdirInside, resolveInside, FLOW_FILES, PANEL_STARTS_DIR,
|
|
49
|
+
readFlow, resolveRunDir, readFileInside, readdirInside, resolveInside, FLOW_FILES, PANEL_STARTS_DIR, writeRunJobCopy,
|
|
50
50
|
} from './flow.js';
|
|
51
51
|
import {
|
|
52
52
|
writeAskArchive, readAcceptedHashesByEmits, serializeArtifact, normalizeDecision, answerTiming, effectiveExpiresAt, withReopen, setAsideAnswer,
|
|
@@ -1046,6 +1046,14 @@ export async function runFlow({
|
|
|
1046
1046
|
}
|
|
1047
1047
|
mkdirSync(runDir, { recursive: true });
|
|
1048
1048
|
|
|
1049
|
+
// M6: the run keeps a write-once copy of the job it runs, from before its first step (its Job tab shows this, not the flow's later versions)
|
|
1050
|
+
const jobCopy = writeRunJobCopy(flowDir, runDir, signature.flow);
|
|
1051
|
+
if (!jobCopy.ok) {
|
|
1052
|
+
return haltRun({
|
|
1053
|
+
flowDir, runDir, runId, capUsd, startedAt, now, nowMs: getNowMs, signatureHash: signature.flow, outcome: 'preflight-red', red: jobCopy.red, spent: { value: 0 },
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1049
1057
|
const frozen = freezeInputs(runDir, sources ?? []);
|
|
1050
1058
|
if (!frozen.ok) {
|
|
1051
1059
|
return haltRun({
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// M5 close / amendment 43: say what changed. Pure — no disk, no clock. Given the signed copy of the two signed files and what is on disk now,
|
|
2
|
+
// name each change in plain words ("line 3 changed", "line 3's guardrail changed", "the cap changed") instead of only the file name.
|
|
3
|
+
// What this throws away: the old and new values themselves (only that a thing changed, and for a number the two numbers); a prose edit
|
|
4
|
+
// that parses to the same lines and arbiter (spacing, blank lines) is named as "wording or spacing", never silently dropped.
|
|
5
|
+
|
|
6
|
+
import { parseSignedText } from './signed-text.js';
|
|
7
|
+
|
|
8
|
+
const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
9
|
+
const sec = (ms) => (ms % 3600000 === 0 ? `${ms / 3600000}h` : ms % 60000 === 0 ? `${ms / 60000}m` : `${ms / 1000}s`);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @param {{ oldProse: string, newProse: string, oldDecl: string, newDecl: string }} x the signed copy (old) and the files on disk (new)
|
|
13
|
+
* @returns {string[]} plain sentences; empty when nothing differs
|
|
14
|
+
*/
|
|
15
|
+
export function describeChange({ oldProse, newProse, oldDecl, newDecl }) {
|
|
16
|
+
const out = [];
|
|
17
|
+
const a = parseSignedText(oldProse);
|
|
18
|
+
const b = parseSignedText(newProse);
|
|
19
|
+
if (oldProse.replace(/\r\n/g, '\n') !== newProse.replace(/\r\n/g, '\n')) {
|
|
20
|
+
if (!a.ok || !b.ok) {
|
|
21
|
+
out.push(b.ok ? 'the signed text could not be compared with the saved copy' : `prose.txt no longer reads as a signed job (${b.reds[0]})`);
|
|
22
|
+
} else {
|
|
23
|
+
const before = new Map(a.lines.map((l) => [l.n, l]));
|
|
24
|
+
const after = new Map(b.lines.map((l) => [l.n, l]));
|
|
25
|
+
for (const [n, l] of before) {
|
|
26
|
+
const m = after.get(n);
|
|
27
|
+
if (!m) { out.push(`line ${n} was removed`); continue; }
|
|
28
|
+
if (l.text !== m.text) out.push(`line ${n} changed`);
|
|
29
|
+
if (l.guardrail !== m.guardrail) out.push(`line ${n}'s guardrail changed`);
|
|
30
|
+
}
|
|
31
|
+
for (const n of after.keys()) if (!before.has(n)) out.push(`line ${n} was added`);
|
|
32
|
+
const x = a.arbiter;
|
|
33
|
+
const y = b.arbiter;
|
|
34
|
+
if (x.capUsd !== y.capUsd) out.push(`the cap changed (from $${x.capUsd} to $${y.capUsd})`);
|
|
35
|
+
if (x.redoCap !== y.redoCap) out.push(`the redo cap changed (from ${x.redoCap} to ${y.redoCap})`);
|
|
36
|
+
if (x.roundBudgetMs !== y.roundBudgetMs) out.push(`the round budget changed (from ${sec(x.roundBudgetMs)} to ${sec(y.roundBudgetMs)})`);
|
|
37
|
+
if (!same(x.skills, y.skills)) out.push('the skills changed');
|
|
38
|
+
for (const k of x.asks) {
|
|
39
|
+
const o = y.asks.find((s) => s.line === k.line);
|
|
40
|
+
if (!o) out.push(`the ask at line ${k.line} was removed`);
|
|
41
|
+
else if (o.ttlMs !== k.ttlMs) out.push(`the wait of the ask at line ${k.line} changed (from ${sec(k.ttlMs)} to ${sec(o.ttlMs)})`);
|
|
42
|
+
else if (o.question !== k.question) out.push(`the question of the ask at line ${k.line} changed`);
|
|
43
|
+
}
|
|
44
|
+
for (const k of y.asks) if (!x.asks.some((s) => s.line === k.line)) out.push(`an ask was added at line ${k.line}`);
|
|
45
|
+
for (const k of x.sends) {
|
|
46
|
+
const o = y.sends.find((s) => s.line === k.line);
|
|
47
|
+
if (!o) out.push(`the send at line ${k.line} was removed`);
|
|
48
|
+
else if (!same(o.target, k.target)) out.push(`the send destination at line ${k.line} changed`);
|
|
49
|
+
}
|
|
50
|
+
for (const k of y.sends) if (!x.sends.some((s) => s.line === k.line)) out.push(`a send was added at line ${k.line}`);
|
|
51
|
+
for (const k of x.sources) {
|
|
52
|
+
const o = y.sources.find((s) => s.role === k.role);
|
|
53
|
+
if (!o) out.push(`the input "${k.role}" was removed`);
|
|
54
|
+
else if (!same(o, k)) out.push(`the input "${k.role}" changed`);
|
|
55
|
+
}
|
|
56
|
+
for (const k of y.sources) if (!x.sources.some((s) => s.role === k.role)) out.push(`an input "${k.role}" was added`);
|
|
57
|
+
if (out.length === 0) out.push('prose.txt changed in wording or spacing (no job line, guardrail or arbiter value differs)');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
let d1;
|
|
61
|
+
let d2;
|
|
62
|
+
try { d1 = JSON.stringify(sortDeep(JSON.parse(oldDecl))); d2 = JSON.stringify(sortDeep(JSON.parse(newDecl))); } catch { d1 = oldDecl; d2 = newDecl; }
|
|
63
|
+
if (d1 !== d2) out.push('the plan changed (declaration.json)');
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function sortDeep(v) {
|
|
68
|
+
if (Array.isArray(v)) return v.map(sortDeep);
|
|
69
|
+
if (v && typeof v === 'object') return Object.fromEntries(Object.keys(v).sort().map((k) => [k, sortDeep(v[k])]));
|
|
70
|
+
return v;
|
|
71
|
+
}
|
package/types/authoring.d.ts
CHANGED
|
@@ -146,14 +146,20 @@ export function draftToDir({ proseFile, dir, root, name, slot, model, budgetUsd,
|
|
|
146
146
|
* The human step, $0. Every refusal returns reds and writes NO flow.
|
|
147
147
|
* `signedBy` must come from the human's own invocation (the CLI's --signed-by/username).
|
|
148
148
|
* `sessionDir` (the panel's draft folder: card, notes, every change) widens the setup record; the CLI has none, so its record is the one plan folder.
|
|
149
|
+
* M6: `replaces: {flowHash}` (a draft opened from an existing signed job, carrying that job's signature hash) makes this sign REPLACE that job
|
|
150
|
+
* (`writeFlow` checks the hash is still the job's); without it a taken name is refused as ever.
|
|
151
|
+
* @param {{dir: any, approve?: any, signedBy: any, signedAt?: string, env?: Record<string, string|undefined>, sessionDir?: string, replaces?: {flowHash: string}}} a
|
|
149
152
|
*/
|
|
150
|
-
export function signDraft({ dir, approve, signedBy, signedAt, env, sessionDir, }: {
|
|
153
|
+
export function signDraft({ dir, approve, signedBy, signedAt, env, sessionDir, replaces, }: {
|
|
151
154
|
dir: any;
|
|
152
|
-
approve
|
|
155
|
+
approve?: any;
|
|
153
156
|
signedBy: any;
|
|
154
|
-
signedAt?: string
|
|
155
|
-
env?:
|
|
156
|
-
sessionDir
|
|
157
|
+
signedAt?: string;
|
|
158
|
+
env?: Record<string, string | undefined>;
|
|
159
|
+
sessionDir?: string;
|
|
160
|
+
replaces?: {
|
|
161
|
+
flowHash: string;
|
|
162
|
+
};
|
|
157
163
|
}): {
|
|
158
164
|
ok: boolean;
|
|
159
165
|
reds: any[];
|
package/types/checked.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One entry per step, in plan order: the plain sentences for what its typed close checks.
|
|
3
|
-
* @param {{ steps?: any[] }} declaration @param {{ hasAsk?: boolean }} [opts] hasAsk = the job has a signed ask line (so "you check it at the ask" is true)
|
|
3
|
+
* @param {{ steps?: any[] }} declaration @param {{ hasAsk?: boolean, askLines?: number[] }} [opts] hasAsk = the job has a signed ask line (so "you check it at the ask" is true);
|
|
4
|
+
* askLines = the job lines of the signed asks, which also lets a step after the LAST ask read "you check it after you accept" (am41 item 2, am42: the ONE place for these words)
|
|
4
5
|
* @returns {{ step: number, line: number|null, goal: string, class: string, sentences: string[] }[]}
|
|
5
6
|
*/
|
|
6
7
|
export function checkedLines(declaration: {
|
|
7
8
|
steps?: any[];
|
|
8
|
-
}, { hasAsk }?: {
|
|
9
|
+
}, { hasAsk, askLines }?: {
|
|
9
10
|
hasAsk?: boolean;
|
|
11
|
+
askLines?: number[];
|
|
10
12
|
}): {
|
|
11
13
|
step: number;
|
|
12
14
|
line: number | null;
|
|
@@ -19,5 +21,5 @@ export function notCheckedBlock(items: unknown): {
|
|
|
19
21
|
label: string;
|
|
20
22
|
items: any[];
|
|
21
23
|
};
|
|
22
|
-
/** The label that always sits with the "Not checked" list. */
|
|
23
|
-
export const NOT_CHECKED_LABEL: "the
|
|
24
|
+
/** The label that always sits with the "Not checked" list (am41 item 3: the ONE place these words live; the Job tab and the Chat card read it off their payloads). */
|
|
25
|
+
export const NOT_CHECKED_LABEL: "not checked (the AI's own reading)";
|