fwdloop 0.23.0 → 0.24.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/bin/fwdloop +31 -8
- package/package.json +1 -1
- package/src/ask.js +15 -1
- package/src/attemptdiff.js +118 -0
- package/src/audit-fold.js +2 -0
- package/src/authoring.js +32 -2
- package/src/citedwords.js +36 -2
- package/src/config.js +5 -1
- package/src/drafter.js +6 -2
- package/src/flowmodel.js +56 -1
- package/src/learn.js +952 -0
- package/src/learnstore.js +346 -0
- package/src/model-step.js +2 -0
- package/src/pagedry.js +3 -4
- package/src/pagefetch.js +9 -2
- package/src/pagerules.js +28 -5
- package/src/panel/data.js +61 -13
- package/src/panel/index.html +143 -11
- package/src/redact.js +6 -6
- package/src/runner.js +127 -17
- package/src/thinking.js +11 -0
- package/types/ask.d.ts +7 -2
- package/types/attemptdiff.d.ts +38 -0
- package/types/citedwords.d.ts +14 -0
- package/types/drafter.d.ts +6 -1
- package/types/flowmodel.d.ts +36 -0
- package/types/learn.d.ts +576 -0
- package/types/learnstore.d.ts +168 -0
- package/types/pagerules.d.ts +7 -0
- package/types/panel/data.d.ts +2 -1
- package/types/panel/result.d.ts +1 -1
- package/types/runner.d.ts +11 -2
- package/types/thinking.d.ts +11 -0
package/src/panel/index.html
CHANGED
|
@@ -170,6 +170,7 @@
|
|
|
170
170
|
/* the Run tab's top action row (Stop, Resume) */
|
|
171
171
|
.run-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:8px;}
|
|
172
172
|
.run-actions .answer-msg{margin-top:0;flex:1 1 100%;}
|
|
173
|
+
.run-actions .hint{margin-top:0;flex:1 1 100%;overflow-wrap:anywhere;}
|
|
173
174
|
/* M4c: only the two "alive" signs pulse — [▶] running and [·] waiting on
|
|
174
175
|
you — keyed to `.pulse`, which the server decides (glyphPulses), never to
|
|
175
176
|
a colour class (.grey is also the placeholder dot). A gentle opacity wave on the existing colors;
|
|
@@ -436,6 +437,11 @@
|
|
|
436
437
|
.audit-group.audit-fold h4.audit-status-header::before{content:"\25B6 ";color:var(--text-faint);}
|
|
437
438
|
.audit-group.audit-fold h4.audit-status-header[aria-expanded="true"]::before{content:"\25BC ";}
|
|
438
439
|
.audit-group.audit-fold h4.audit-status-header::after{content:none;}
|
|
440
|
+
/* M8 item 6: bareloop's learnings box, copied (borrowed-from: bareloop src/panel/index.html@v0.46.0 :421-424): a framed row, the header a full-width button with the chip and words inline, no arrow */
|
|
441
|
+
.audit-part{border:1px solid var(--border);margin-bottom:6px;background:var(--panel2);}
|
|
442
|
+
.audit-part-toggle{width:100%;text-align:left;display:block;white-space:normal;min-height:44px;padding:8px 10px;}
|
|
443
|
+
.audit-part-toggle::before,.audit-part-toggle::after{content:"";}
|
|
444
|
+
.audit-part-body{padding:8px 10px 10px;border-top:1px dotted var(--border-strong);}
|
|
439
445
|
@media (max-width: 640px){
|
|
440
446
|
/* (l) a phone: the name is the only thing that shrinks — drop the dots and the word "try", tighten the gaps */
|
|
441
447
|
.audit-group.audit-fold{padding-left:8px;padding-right:8px;}
|
|
@@ -522,7 +528,7 @@
|
|
|
522
528
|
┤ ├ pips — those are reserved for a whole-box title, not an in-flow
|
|
523
529
|
line) so it reads as a clear, bold heading without a second border. */
|
|
524
530
|
.ask-question-heading{margin:6px 0 0;font-size:13px;font-weight:700;color:var(--text);}
|
|
525
|
-
.ro-value{padding:6px 8px;min-height:32px;box-sizing:border-box;border:1px solid var(--border);background:var(--bg);color:var(--text-dim);}
|
|
531
|
+
.ro-value{padding:6px 8px;min-height:32px;box-sizing:border-box;border:1px solid var(--border);background:var(--bg);color:var(--text-dim);overflow-wrap:anywhere;}
|
|
526
532
|
.art-head{color:var(--accent);}
|
|
527
533
|
.ro-value.sub{margin-left:20px;min-height:0;padding-top:2px;padding-bottom:2px;border-top-width:0;overflow-wrap:anywhere;}
|
|
528
534
|
/* M4e amendment 37 (changes 34's layout): the Job tab is ONE column at every width. Each signed line, its ~ rows, then its step(s) folded under it:
|
|
@@ -746,6 +752,11 @@
|
|
|
746
752
|
.audit-group table.rounds-table tbody{display:table-row-group;}
|
|
747
753
|
.audit-group table.rounds-table tr{display:table-row;padding:0;overflow:visible;}
|
|
748
754
|
.audit-group table.rounds-table td{display:table-cell;padding:4px 6px;white-space:normal;overflow-wrap:anywhere;border-right:1px dotted var(--border);}
|
|
755
|
+
/* M8 item 6: a hint's table fits the box and wraps (as bareloop's does at 320), it does not scroll sideways */
|
|
756
|
+
.audit-part table.learn-hint{display:table;width:100%;min-width:0;max-width:100%;}
|
|
757
|
+
.audit-part table.learn-hint tbody{display:table-row-group;}
|
|
758
|
+
.audit-part table.learn-hint tr{display:table-row;padding:0;}
|
|
759
|
+
.audit-part table.learn-hint td{display:table-cell;padding:4px 6px;white-space:normal;overflow-wrap:anywhere;}
|
|
749
760
|
}
|
|
750
761
|
|
|
751
762
|
/* M4d piece 4: the Settings view (a sibling of #main-view, opened from the header). Layout borrowed from bareloop:
|
|
@@ -1263,6 +1274,7 @@
|
|
|
1263
1274
|
</div>
|
|
1264
1275
|
</div>
|
|
1265
1276
|
<div id="audit-filter-empty" class="hint" data-testid="audit-filter-empty" hidden style="padding:12px 0;"></div>
|
|
1277
|
+
<div id="audit-learnings" data-testid="audit-learnings" hidden></div>
|
|
1266
1278
|
<div id="audit-groups" data-testid="audit-groups"></div>
|
|
1267
1279
|
<div class="audit-table-scroll" id="audit-flat-wrap" hidden>
|
|
1268
1280
|
<table data-testid="audit-table">
|
|
@@ -1307,7 +1319,7 @@
|
|
|
1307
1319
|
<div class="field"><label>Ask</label><div id="details-asks"></div></div>
|
|
1308
1320
|
<div class="field"><label>Destination</label><div id="details-sends"></div></div>
|
|
1309
1321
|
<div class="field"><label>$ cap</label><div class="ro-value" id="details-cap">—</div></div>
|
|
1310
|
-
<div class="field"><label>
|
|
1322
|
+
<div class="field"><label>Inputs</label><div id="details-sources"></div></div>
|
|
1311
1323
|
<div class="field"><label>Signed</label><div class="ro-value" id="details-signature">—</div></div>
|
|
1312
1324
|
<div class="plan-legend" data-testid="plan-legend"><span class="plan-mark">›</span> = the approved plan</div>
|
|
1313
1325
|
</div>
|
|
@@ -2782,8 +2794,11 @@
|
|
|
2782
2794
|
el.appendChild(makeButton("Resume", "run-resume", function(){ if(window.fwdloopOpenResume) window.fwdloopOpenResume(detail); }));
|
|
2783
2795
|
}
|
|
2784
2796
|
else if(c.noCopySay){ var nc = document.createElement("div"); nc.className = "answer-msg refused"; nc.setAttribute("data-testid", "run-no-copy-say"); nc.textContent = c.noCopySay; el.appendChild(nc); }
|
|
2797
|
+
// M11 am22: Reopen is also here, from the server's `detail.reopen` (the Ask tab's own `reopenOffer` answer); the click is the Ask tab's `sendReopen`, the line its why
|
|
2798
|
+
if(detail.reopen) el.appendChild(makeButton("Reopen for another " + waitText(detail.reopen.waitMs), "run-reopen", function(){ sendReopen(el, detail, detail.reopen.askId); }));
|
|
2785
2799
|
// M11 am11 item 3: a stopped / stuck run in Needs you can leave it; the Run tab's own button, shown only when the server says it is removable
|
|
2786
2800
|
if(detail.needsYou && detail.needsYou.removable) el.appendChild(makeRemoveNeedsButton(detail.flow, detail.runId, function(){ return reloadRun(detail.flow, detail.runId); }));
|
|
2801
|
+
if(detail.reopen) el.appendChild(textDiv("hint", detail.reopen.why));
|
|
2787
2802
|
if(stopSay){ var m = document.createElement("div"); m.className = "answer-msg refused"; m.setAttribute("data-testid", "run-stop-say"); m.textContent = stopSay.text; el.appendChild(m); }
|
|
2788
2803
|
el.hidden = el.children.length === 0;
|
|
2789
2804
|
}
|
|
@@ -3208,7 +3223,7 @@
|
|
|
3208
3223
|
if(testId) e.setAttribute("data-testid", testId);
|
|
3209
3224
|
return e;
|
|
3210
3225
|
}
|
|
3211
|
-
function foldTryEl(t, human){
|
|
3226
|
+
function foldTryEl(t, human, stepKey){
|
|
3212
3227
|
var wrap = document.createElement("div");
|
|
3213
3228
|
var line = foldEl("div", "audit-try", null, "audit-try-line");
|
|
3214
3229
|
line.appendChild(document.createTextNode("try " + t.n + " "));
|
|
@@ -3218,6 +3233,21 @@
|
|
|
3218
3233
|
: [t.thinking, t.gap];
|
|
3219
3234
|
rest.forEach(function(x){ if(x) line.appendChild(document.createTextNode(" \u00b7 " + x)); });
|
|
3220
3235
|
wrap.appendChild(line);
|
|
3236
|
+
// M8 am7 item 4: this try was handed the earlier runs' block - one line, a click opens the exact text (the learnings box's own fold classes); hidden when nothing was handed
|
|
3237
|
+
if(!human && t.hints && t.hints.text){
|
|
3238
|
+
var hk = "\u0000hints:" + stepKey + ":" + t.n;
|
|
3239
|
+
var hpart = foldEl("div", "audit-part", null, "audit-try-hints");
|
|
3240
|
+
var hhead = foldEl("button", "btn audit-part-toggle", "told from earlier runs \u00B7 " + t.hints.n + (t.hints.n === 1 ? " hint" : " hints"), "audit-try-hints-head");
|
|
3241
|
+
hhead.type = "button";
|
|
3242
|
+
var hbody = foldEl("div", "audit-part-body", null, "audit-try-hints-text");
|
|
3243
|
+
hbody.style.cssText = "white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0";
|
|
3244
|
+
hbody.textContent = t.hints.text;
|
|
3245
|
+
var paintHints = function(open){ hbody.hidden = !open; hhead.setAttribute("aria-expanded", open ? "true" : "false"); };
|
|
3246
|
+
paintHints(auditExpanded[hk] === true);
|
|
3247
|
+
hhead.addEventListener("click", function(ev){ ev.stopPropagation(); var open = hbody.hidden; auditExpanded[hk] = open; paintHints(open); });
|
|
3248
|
+
hpart.appendChild(hhead); hpart.appendChild(hbody);
|
|
3249
|
+
wrap.appendChild(hpart);
|
|
3250
|
+
}
|
|
3221
3251
|
if(!human && t.checks && t.checks.length){
|
|
3222
3252
|
var box = foldEl("div", "audit-checks", null, "audit-checks");
|
|
3223
3253
|
t.checks.forEach(function(c){
|
|
@@ -3280,12 +3310,94 @@
|
|
|
3280
3310
|
var f = g.fold, human = f.who === "human";
|
|
3281
3311
|
var body = foldEl("div", "audit-fold-body", null, "audit-fold-body-" + g.step);
|
|
3282
3312
|
if(f.tally) body.appendChild(foldEl("div", "audit-tally", f.tally, "audit-tally"));
|
|
3283
|
-
(f.tries || []).forEach(function(t){ body.appendChild(foldTryEl(t, human)); });
|
|
3313
|
+
(f.tries || []).forEach(function(t){ body.appendChild(foldTryEl(t, human, g.step)); });
|
|
3284
3314
|
body.appendChild(foldRoundsEl(g));
|
|
3285
3315
|
return body;
|
|
3286
3316
|
}
|
|
3287
3317
|
var auditExpanded = {}; // step -> true/false once a human toggled it; reset when the run changes
|
|
3288
3318
|
var auditExpandedRun = null;
|
|
3319
|
+
// M8 item 6: cross-run learnings, READ-ONLY: what the drafter was handed from earlier runs. ONE fold at the top of the Audit tab, in both views, hidden when the run was handed nothing.
|
|
3320
|
+
// borrowed-from: bareloop src/panel/index.html@v0.46.0 :2843-2931 (learnRow, learnHintLabel, renderAuditLearnings), drawn in fwdloop's own fold (the schedule section's header and body shape)
|
|
3321
|
+
// instead of bareloop's .audit-part button. The fields come from the server (learn.js parseHintBlock, the one reader of the block) - this page never splits the prose. No edit, no button but the fold.
|
|
3322
|
+
function learnRow(tbody, testid, label, lines){
|
|
3323
|
+
var tr = document.createElement("tr");
|
|
3324
|
+
tr.setAttribute("data-testid", testid);
|
|
3325
|
+
var lab = document.createElement("td");
|
|
3326
|
+
lab.className = "hint";
|
|
3327
|
+
lab.style.cssText = "white-space:nowrap";
|
|
3328
|
+
lab.textContent = label;
|
|
3329
|
+
var val = document.createElement("td");
|
|
3330
|
+
val.style.cssText = "overflow-wrap:anywhere;white-space:pre-wrap";
|
|
3331
|
+
val.textContent = lines.join("\n");
|
|
3332
|
+
tr.appendChild(lab);
|
|
3333
|
+
tr.appendChild(val);
|
|
3334
|
+
tbody.appendChild(tr);
|
|
3335
|
+
}
|
|
3336
|
+
function learnHintLabel(h){
|
|
3337
|
+
var bits = [h.n, h.level, "seen " + h.count + (h.count === 1 ? " time" : " times")];
|
|
3338
|
+
if(h.check) bits.push(h.check);
|
|
3339
|
+
if(h.kinds && h.kinds.length) bits.push(h.kinds.join(", "));
|
|
3340
|
+
bits.push(h.fixed ? "fixed" : "never fixed");
|
|
3341
|
+
return bits.join(" \u00B7 ");
|
|
3342
|
+
}
|
|
3343
|
+
function renderAuditLearnings(result){
|
|
3344
|
+
var box = document.getElementById("audit-learnings");
|
|
3345
|
+
box.innerHTML = "";
|
|
3346
|
+
var items = result && Array.isArray(result.learnings) ? result.learnings : [];
|
|
3347
|
+
box.hidden = items.length === 0;
|
|
3348
|
+
if(items.length === 0) return;
|
|
3349
|
+
var it = items[0];
|
|
3350
|
+
var hints = Array.isArray(it.hints) ? it.hints : [];
|
|
3351
|
+
var count = Array.isArray(it.ids) ? it.ids.length : hints.length;
|
|
3352
|
+
var wrap = document.createElement("div");
|
|
3353
|
+
wrap.className = "audit-part";
|
|
3354
|
+
wrap.setAttribute("data-testid", "audit-group-learnings");
|
|
3355
|
+
var head = document.createElement("button");
|
|
3356
|
+
head.type = "button";
|
|
3357
|
+
head.className = "btn audit-part-toggle";
|
|
3358
|
+
head.setAttribute("aria-expanded", "false");
|
|
3359
|
+
head.setAttribute("data-testid", "audit-learnings-head");
|
|
3360
|
+
var label = "What the planner was told from earlier runs \u00B7 " + count + (count === 1 ? " hint" : " hints");
|
|
3361
|
+
head.innerHTML = stateDotHTML(glyphClass("[\u2713]"), "learnings", "audit-learnings-state") + " " + escapeXml(label);
|
|
3362
|
+
var list = document.createElement("div");
|
|
3363
|
+
list.className = "audit-part-body";
|
|
3364
|
+
list.setAttribute("data-testid", "audit-learnings-list");
|
|
3365
|
+
list.hidden = true;
|
|
3366
|
+
var note = document.createElement("div");
|
|
3367
|
+
note.className = "hint";
|
|
3368
|
+
note.style.cssText = "margin:6px 0;overflow-wrap:anywhere;";
|
|
3369
|
+
note.textContent = "Read-only. Given to the planner at the draft (" + Number(it.chars).toLocaleString("en-US") + " characters). No worker sees it.";
|
|
3370
|
+
list.appendChild(note);
|
|
3371
|
+
hints.forEach(function(h){
|
|
3372
|
+
var hint = document.createElement("div");
|
|
3373
|
+
hint.className = "audit-table-scroll";
|
|
3374
|
+
hint.setAttribute("data-testid", "audit-learnings-hint-" + it.phase + "-" + h.n);
|
|
3375
|
+
var table = document.createElement("table");
|
|
3376
|
+
table.className = "rounds-table learn-hint";
|
|
3377
|
+
var tbody = document.createElement("tbody");
|
|
3378
|
+
var trT = document.createElement("tr");
|
|
3379
|
+
var title = document.createElement("td");
|
|
3380
|
+
title.setAttribute("colspan", "2");
|
|
3381
|
+
title.style.cssText = "font-weight:600;overflow-wrap:anywhere";
|
|
3382
|
+
title.setAttribute("data-testid", "audit-learnings-hint-" + it.phase + "-" + h.n + "-title");
|
|
3383
|
+
title.textContent = learnHintLabel(h);
|
|
3384
|
+
trT.appendChild(title);
|
|
3385
|
+
tbody.appendChild(trT);
|
|
3386
|
+
var t = "audit-learnings-hint-" + it.phase + "-" + h.n + "-";
|
|
3387
|
+
if(h.said) learnRow(tbody, t + "said", "It said:", [h.said]);
|
|
3388
|
+
if(h.touched) learnRow(tbody, t + "touched", "Fix touched:", [h.touched]);
|
|
3389
|
+
if(h.changed && h.changed.length) learnRow(tbody, t + "changed", "What changed:", h.changed.concat(h.moreChanged ? ["(+" + h.moreChanged + " more)"] : []));
|
|
3390
|
+
table.appendChild(tbody);
|
|
3391
|
+
hint.appendChild(table);
|
|
3392
|
+
list.appendChild(hint);
|
|
3393
|
+
});
|
|
3394
|
+
function paintLearn(open){ list.hidden = !open; head.setAttribute("aria-expanded", open ? "true" : "false"); }
|
|
3395
|
+
function toggleLearn(){ var open = list.hidden; auditExpanded["\u0000learnings"] = open; paintLearn(open); } // folded on open; a re-render keeps what you chose for this run
|
|
3396
|
+
if(auditExpanded["\u0000learnings"] === true) paintLearn(true);
|
|
3397
|
+
head.addEventListener("click", toggleLearn);
|
|
3398
|
+
wrap.appendChild(head); wrap.appendChild(list);
|
|
3399
|
+
box.appendChild(wrap);
|
|
3400
|
+
}
|
|
3289
3401
|
function renderAuditGroups(result){
|
|
3290
3402
|
var runKey = currentFlow + "/" + currentRunId;
|
|
3291
3403
|
if(auditExpandedRun !== runKey){ auditExpanded = {}; auditExpandedRun = runKey; }
|
|
@@ -3437,6 +3549,7 @@
|
|
|
3437
3549
|
// says why" — checked against whichever view is actually on screen.
|
|
3438
3550
|
function paintAudit(result){
|
|
3439
3551
|
var anyGrouped = renderAuditGroups(result);
|
|
3552
|
+
renderAuditLearnings(result);
|
|
3440
3553
|
var anyFlat = renderAuditFlat(result);
|
|
3441
3554
|
var filterEmpty = document.getElementById("audit-filter-empty");
|
|
3442
3555
|
var nothingMatched = auditViewMode === "flat" ? !anyFlat : !anyGrouped;
|
|
@@ -3459,11 +3572,12 @@
|
|
|
3459
3572
|
var content = document.getElementById("audit-content");
|
|
3460
3573
|
lastAuditResult = result;
|
|
3461
3574
|
// a run with no audit rows yet still has its Draft: say so in words, and show the card
|
|
3462
|
-
var hasDraft = !!(result && (result.draft || result.schedule || result.needsLeft));
|
|
3575
|
+
var hasDraft = !!(result && (result.draft || result.schedule || result.needsLeft || (result.learnings && result.learnings.length)));
|
|
3463
3576
|
if(!result || (result.empty && !hasDraft)){
|
|
3464
3577
|
empty.hidden = false;
|
|
3465
3578
|
empty.textContent = (result && result.why) || "no audit rows for this run";
|
|
3466
3579
|
content.hidden = true;
|
|
3580
|
+
document.getElementById("audit-learnings").hidden = true; // M8 item 6: a run with nothing to show keeps no box of the run before
|
|
3467
3581
|
return;
|
|
3468
3582
|
}
|
|
3469
3583
|
empty.hidden = !result.empty;
|
|
@@ -3633,9 +3747,9 @@
|
|
|
3633
3747
|
document.getElementById("details-cap").textContent =
|
|
3634
3748
|
(typeof job.capUsd === "number" ? ("$" + job.capUsd.toFixed(2)) : "unknown")
|
|
3635
3749
|
+ " per run" + (waitText ? " · " + waitText : "") + " · redo up to " + (typeof job.redoCap === "number" ? job.redoCap : "unknown");
|
|
3636
|
-
// review #5: "
|
|
3750
|
+
// review #5: "Inputs" — role -> the full signed path (a web address shows its address), by hamr 2026-10-24.
|
|
3637
3751
|
renderRowsField("details-sources", job.sources, "no signed sources", function(s){
|
|
3638
|
-
return s.role + " → " + s.
|
|
3752
|
+
return s.role + " → " + s.path;
|
|
3639
3753
|
});
|
|
3640
3754
|
// review #5: "Destination" — one row per signed send.
|
|
3641
3755
|
renderRowsField("details-sends", job.sends, "no signed sends", function(s){
|
|
@@ -4292,7 +4406,11 @@
|
|
|
4292
4406
|
return reloadRun(ctx.flow, ctx.runId);
|
|
4293
4407
|
}).then(function(){ if(root.isConnected) setBusy(root, false); });
|
|
4294
4408
|
}
|
|
4409
|
+
// M11 am22: the Ask tab's button and the Run tab's button are one door; while a reopen is out neither can send a second one.
|
|
4410
|
+
var reopenOut = false;
|
|
4295
4411
|
function sendReopen(root, ctx, askId){
|
|
4412
|
+
if(reopenOut) return;
|
|
4413
|
+
reopenOut = true;
|
|
4296
4414
|
say(ctx.flow, ctx.runId, "info", "reopening…");
|
|
4297
4415
|
setBusy(root, true);
|
|
4298
4416
|
postJSON("/api/reopen", { flow: ctx.flow, runId: ctx.runId, askId: askId }).then(function(r){
|
|
@@ -4306,7 +4424,7 @@
|
|
|
4306
4424
|
}).catch(function(e){
|
|
4307
4425
|
say(ctx.flow, ctx.runId, "refused", networkText());
|
|
4308
4426
|
return reloadRun(ctx.flow, ctx.runId);
|
|
4309
|
-
}).then(function(){ if(root.isConnected) setBusy(root, false); });
|
|
4427
|
+
}).then(function(){ reopenOut = false; if(root.isConnected) setBusy(root, false); });
|
|
4310
4428
|
}
|
|
4311
4429
|
// M11 am11 item 3: Remove from Needs you. One door for the Ask tab (expired ask) and the Run tab (stopped / stuck): the server writes the marker and changes nothing else.
|
|
4312
4430
|
function makeRemoveNeedsButton(flow, runId, after){
|
|
@@ -4432,6 +4550,12 @@
|
|
|
4432
4550
|
sheetBox.innerHTML = resultSheetBlock(evidence.sheet.block) + resultField("Answer", '<div class="ro-value" data-testid="ask-sheet-answers">' +
|
|
4433
4551
|
(evidence.sheet.answer || []).map(function(t){ return '<div data-testid="ask-sheet-answer">' + escapeXml(t) + '</div>'; }).join("") + '</div>');
|
|
4434
4552
|
ev.appendChild(sheetBox);
|
|
4553
|
+
} else if(evidence.cited){
|
|
4554
|
+
// a cited step's ask shows the Result tab's own results (resultFactsLine): each with its fields and its proof; the unjudged evidence follows below
|
|
4555
|
+
var citedBox = document.createElement("div");
|
|
4556
|
+
citedBox.setAttribute("data-testid", "ask-cited");
|
|
4557
|
+
citedBox.innerHTML = resultFactsLine(evidence.cited);
|
|
4558
|
+
ev.appendChild(citedBox);
|
|
4435
4559
|
} else {
|
|
4436
4560
|
ev.appendChild(textDiv("hint", evidence.why || "no draft on file"));
|
|
4437
4561
|
}
|
|
@@ -4451,7 +4575,13 @@
|
|
|
4451
4575
|
}
|
|
4452
4576
|
var art = document.createElement("div");
|
|
4453
4577
|
art.className = "ro-value scroll";
|
|
4454
|
-
if(typeof u.text === "string"){ fillArtifactText(art, u.text); }
|
|
4578
|
+
if(typeof u.text === "string"){ fillArtifactText(art, u.text); }
|
|
4579
|
+
else if(u.cells && typeof u.cells === "object"){
|
|
4580
|
+
// a step that leaves fields, not prose: one line per field, "name: value" (textContent, so every value is escaped)
|
|
4581
|
+
art.style.whiteSpace = "pre-wrap";
|
|
4582
|
+
art.setAttribute("data-testid", "ask-unjudged-cells");
|
|
4583
|
+
art.textContent = Object.keys(u.cells).map(function(k){ return k + ": " + String(u.cells[k]); }).join("\n");
|
|
4584
|
+
} else { art.textContent = "no artifact text on file"; }
|
|
4455
4585
|
ev.appendChild(art);
|
|
4456
4586
|
});
|
|
4457
4587
|
return ev;
|
|
@@ -5326,8 +5456,10 @@
|
|
|
5326
5456
|
refreshCapNote(); fitCardBoxes();
|
|
5327
5457
|
doDraft(null);
|
|
5328
5458
|
}
|
|
5329
|
-
// the card stops reusing: the name box is free again
|
|
5459
|
+
// the card stops reusing: the name box is free again. ONE owner: reuseOf and the boxes startReuseDraft filled go together, so a card that
|
|
5460
|
+
// left Reuse (a refused signed start too) can never be drafted as a plain new job carrying the old job and name
|
|
5330
5461
|
function leaveReuse(){
|
|
5462
|
+
if(reuseOf !== null){ ["jf-name", "jf-job", "jf-cap-money", "jf-dest-folder", "jf-inputs"].forEach(function(id){ byId(id).value = ""; }); askWaitEl.value = "1h"; }
|
|
5331
5463
|
reuseOf = null;
|
|
5332
5464
|
editBannerEl.hidden = true; editBannerEl.textContent = "";
|
|
5333
5465
|
}
|
|
@@ -6154,7 +6286,7 @@
|
|
|
6154
6286
|
});
|
|
6155
6287
|
document.querySelectorAll('input[name="jf-mode"]').forEach(function(r){
|
|
6156
6288
|
r.addEventListener("change", function(){
|
|
6157
|
-
if(r.checked && reuseOf !== null && r.value !== "new" && !sessionLive){ leaveReuse();
|
|
6289
|
+
if(r.checked && reuseOf !== null && r.value !== "new" && !sessionLive){ leaveReuse(); }
|
|
6158
6290
|
if(r.checked) setMode(r.value);
|
|
6159
6291
|
});
|
|
6160
6292
|
});
|
package/src/redact.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// The one secret inventory: known token shapes only, masked before a value is stored or written.
|
|
2
|
-
// borrowed-from: bareloop src/validate.js@
|
|
2
|
+
// borrowed-from: bareloop src/validate.js@76168c8 (SECRET_PATTERNS; a key right after a hyphen is masked for the distinctive prefixes). Its own module so a caller that only
|
|
3
3
|
// needs to mask (src/diary.js) does not pull litectx in through src/ctx-tools.js.
|
|
4
4
|
|
|
5
5
|
import { redact } from 'bareguard';
|
|
6
6
|
|
|
7
7
|
const SECRET_PATTERNS = [
|
|
8
8
|
/(?<![A-Za-z0-9_-])sk-[A-Za-z0-9_-]{16,}/,
|
|
9
|
-
/(?<![A-Za-z0-9_
|
|
10
|
-
/(?<![A-Za-z0-9_
|
|
11
|
-
/(?<![A-Za-z0-9_
|
|
12
|
-
/(?<![A-Za-z0-9_
|
|
13
|
-
/(?<![A-Za-z0-9_
|
|
9
|
+
/(?<![A-Za-z0-9_])ghp_[A-Za-z0-9]{20,}/,
|
|
10
|
+
/(?<![A-Za-z0-9_])github_pat_[A-Za-z0-9_]{20,}/,
|
|
11
|
+
/(?<![A-Za-z0-9_])AKIA[0-9A-Z]{16}/,
|
|
12
|
+
/(?<![A-Za-z0-9_])xox[bap]-[A-Za-z0-9-]{10,}/,
|
|
13
|
+
/(?<![A-Za-z0-9_])AIza[0-9A-Za-z_-]{35}/,
|
|
14
14
|
];
|
|
15
15
|
|
|
16
16
|
/** Mask known secret shapes. @param {unknown} raw */
|