fwdloop 0.28.0 → 0.29.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/README.md +1 -1
- package/bin/fwdloop +27 -5
- package/package.json +3 -3
- package/src/ask.js +1 -1
- package/src/audit-fold.js +9 -1
- package/src/authoring.js +11 -4
- package/src/checked.js +5 -2
- package/src/checkpick.js +257 -0
- package/src/checkwords.js +24 -0
- package/src/closers.js +8 -1
- package/src/declaration.js +53 -3
- package/src/drafter.js +114 -33
- package/src/learn.js +1 -1
- package/src/learnstore.js +6 -6
- package/src/memo.js +120 -0
- package/src/model-step.js +89 -17
- package/src/pageask.js +9 -6
- package/src/pagedropwords.js +9 -0
- package/src/panel/author.js +31 -9
- package/src/panel/authorcard.js +51 -2
- package/src/panel/data.js +12 -7
- package/src/panel/index.html +137 -59
- package/src/panel/result.js +28 -7
- package/src/panel/server.js +2 -1
- package/src/pickrecord.js +146 -0
- package/src/plain-checks.js +1 -0
- package/src/provider.js +4 -1
- package/src/runfile.js +4 -2
- package/src/runner.js +82 -30
- package/src/send.js +71 -4
- package/src/setup.js +13 -1
- package/types/ask.d.ts +2 -1
- package/types/audit-fold.d.ts +13 -2
- package/types/authoring.d.ts +6 -2
- package/types/checked.d.ts +7 -2
- package/types/checkpick.d.ts +149 -0
- package/types/checkwords.d.ts +14 -0
- package/types/closers.d.ts +2 -1
- package/types/declaration.d.ts +9 -0
- package/types/drafter.d.ts +12 -25
- package/types/learn.d.ts +1 -0
- package/types/learnstore.d.ts +2 -3
- package/types/memo.d.ts +15 -0
- package/types/model-step.d.ts +5 -0
- package/types/pageask.d.ts +9 -2
- package/types/pagedropwords.d.ts +1 -0
- package/types/panel/author.d.ts +1 -1
- package/types/panel/authorcard.d.ts +41 -0
- package/types/panel/result.d.ts +9 -3
- package/types/pickrecord.d.ts +88 -0
- package/types/runfile.d.ts +7 -2
- package/types/runner.d.ts +16 -5
- package/types/send.d.ts +10 -2
- package/types/setup.d.ts +1 -56
- package/src/attemptdiff.js +0 -118
- package/types/attemptdiff.d.ts +0 -38
package/src/panel/index.html
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
--cap-j:#6b7396; --cap-j-bg:#2a2f45; --cap-j-ink:#c0caf5;
|
|
37
37
|
--cap-r:#2b8a7e; --cap-r-bg:#17332f; --cap-r-ink:#8fdccf;
|
|
38
38
|
--req:#c9a85f;
|
|
39
|
-
--accent:#7aa2f7;
|
|
39
|
+
--accent:#7aa2f7; --search-tint:var(--panel2);
|
|
40
40
|
--btn-bg:#1f2335; --btn-text:#c0caf5;
|
|
41
41
|
--field-bg:var(--bg); --field-soft-bg:var(--bg); --field-border:var(--text-dim);
|
|
42
42
|
--primary-bg:#7aa2f7; --primary-text:#1a1b26; --primary-border:#7aa2f7;
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
--cap-s:#2a4fa8; --cap-s-bg:#cfdaf3; --cap-s-ink:#1d3a80;
|
|
83
83
|
--cap-j:#5b6680; --cap-j-bg:#c7cddb; --cap-j-ink:#333c52;
|
|
84
84
|
--cap-r:#2b8a7e; --cap-r-bg:#cdeee8; --cap-r-ink:#14524a; --req:#8a6d2a;
|
|
85
|
-
--accent:#2668c2;
|
|
85
|
+
--accent:#2668c2; --search-tint:#f5f7fc;
|
|
86
86
|
--btn-bg:#e9e9ed; --btn-text:#3760bf;
|
|
87
87
|
--field-bg:#ffffff; --field-soft-bg:#f7f7f9;
|
|
88
88
|
--primary-bg:#2668c2; --primary-text:#e1e2e7; --primary-border:#2668c2;
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
--cap-s:#2a4fa8; --cap-s-bg:#cfdaf3; --cap-s-ink:#1d3a80;
|
|
102
102
|
--cap-j:#5b6680; --cap-j-bg:#c7cddb; --cap-j-ink:#333c52;
|
|
103
103
|
--cap-r:#2b8a7e; --cap-r-bg:#cdeee8; --cap-r-ink:#14524a; --req:#8a6d2a;
|
|
104
|
-
--accent:#2668c2;
|
|
104
|
+
--accent:#2668c2; --search-tint:#f5f7fc;
|
|
105
105
|
--btn-bg:#e9e9ed; --btn-text:#3760bf;
|
|
106
106
|
--field-bg:#ffffff; --field-soft-bg:#f7f7f9;
|
|
107
107
|
--primary-bg:#2668c2; --primary-text:#e1e2e7; --primary-border:#2668c2;
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
/* M4b piece 4: the answer doors. Shape/placement from bareloop's mockup Run-tab
|
|
237
237
|
action bar (a row of `.btn`s with a hint line under it), redo is ours. */
|
|
238
238
|
.answer-doors{margin-top:12px;padding-top:8px;border-top:1px solid var(--border);}
|
|
239
|
-
.answer-doors label{display:block;font-size:
|
|
239
|
+
.answer-doors label{display:block;font-size:12px;font-weight:700;color:var(--accent);text-transform:uppercase;letter-spacing:0.04em;margin-bottom:3px;}
|
|
240
240
|
.answer-doors textarea{display:block;width:100%;max-width:100%;box-sizing:border-box;min-height:64px;padding:6px 8px;font:inherit;color:var(--text);background:var(--bg);border:1px solid var(--border-strong);resize:vertical;}
|
|
241
241
|
.answer-doors .actions-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;}
|
|
242
242
|
.answer-doors .btn{min-width:44px;}
|
|
@@ -306,6 +306,13 @@
|
|
|
306
306
|
.rl-pill-need{border-color:var(--accent);color:var(--accent);}
|
|
307
307
|
.rl-dash{border-top:1px dashed var(--border-strong);margin:10px 0 6px;}
|
|
308
308
|
#panel-runs .rl-faint{margin-bottom:4px;}
|
|
309
|
+
/* Runs tab: the search block is a light card (V1), hamr 2026-11-03 */
|
|
310
|
+
#panel-runs .rl-dash{border:0;margin:12px 0 0;}
|
|
311
|
+
#panel-runs .rl-faint[data-testid="rl-filter-note"]{color:var(--accent);font-weight:700;font-size:12px;letter-spacing:.02em;background:var(--search-tint);padding:8px 10px 6px;margin-bottom:0;border-radius:6px 6px 0 0;}
|
|
312
|
+
#panel-runs .rl-faint[data-testid="rl-filter-note"]::before{content:"SEARCH ";letter-spacing:.08em;}
|
|
313
|
+
#runs-filterbar-anchor{background:var(--search-tint);padding:4px 10px 10px;margin-bottom:12px;border-radius:0 0 6px 6px;}
|
|
314
|
+
#runs-filterbar-anchor input[type="search"],#runs-filterbar-anchor input[type="text"]{border:1px solid var(--accent) !important;background:var(--bg,#fff);font-size:14px;padding:8px 10px;}
|
|
315
|
+
#runs-filterbar-anchor input:focus{outline:2px solid var(--accent);outline-offset:1px;}
|
|
309
316
|
@media (max-width:899px){ .rl-fold{min-height:44px;} }
|
|
310
317
|
|
|
311
318
|
.rp-header{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:2px solid var(--border-strong);background:var(--panel);flex-wrap:wrap;gap:8px;}
|
|
@@ -344,11 +351,12 @@
|
|
|
344
351
|
.ended-block.amber,.ended-block.expired,.ended-block.stuck{border-color:var(--amber);}
|
|
345
352
|
.ended-row{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap;margin-bottom:6px;}
|
|
346
353
|
.ended-row:last-child{margin-bottom:0;}
|
|
347
|
-
|
|
354
|
+
/* hamr 2026-11-02: Run tab ended/next/schedule and Result tab captions accent bold; Run summary/map +1px */
|
|
355
|
+
.ended-label{color:var(--accent);font-weight:700;font-size:11px;letter-spacing:0.08em;min-width:84px;}
|
|
348
356
|
.ended-text{flex:1 1 220px;min-width:0;overflow-wrap:anywhere;}
|
|
349
357
|
/* M9 am24: a NEXT with several instructions is one per line, label muted, instructions in a second column (shape: bareloop 8cad363, with labels in the muted colour) */
|
|
350
358
|
.next-rows{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:10px;row-gap:2px;}
|
|
351
|
-
.next-label{color:var(--
|
|
359
|
+
.next-label{color:var(--accent);font-weight:700;}
|
|
352
360
|
.next-text{min-width:0;overflow-wrap:anywhere;}
|
|
353
361
|
.audit-sched-start{padding:6px 10px;margin-bottom:8px;border:1px solid var(--border-strong);background:var(--panel2);font-size:12px;overflow-wrap:anywhere;}
|
|
354
362
|
.when-sub{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px;}
|
|
@@ -360,10 +368,11 @@
|
|
|
360
368
|
.summary-box.grey,.summary-box.stopped,.summary-box.skipped{border-color:var(--grey-dot);}
|
|
361
369
|
.summary-box.amber,.summary-box.expired,.summary-box.stuck{border-color:var(--amber);}
|
|
362
370
|
.summary-box.magenta{border-color:var(--magenta);}
|
|
363
|
-
.summary-box::before{content:"┤ SUMMARY ├";position:absolute;top:-10px;left:10px;background:var(--panel2);padding:0 6px;font-size:
|
|
371
|
+
.summary-box::before{content:"┤ SUMMARY ├";position:absolute;top:-10px;left:10px;background:var(--panel2);padding:0 6px;font-size:12px;font-weight:700;color:var(--accent);letter-spacing:0.08em;}
|
|
364
372
|
.summary-headline{font-weight:700;margin-bottom:8px;font-size:13px;}
|
|
365
373
|
.summary-row{display:flex;gap:0;padding:2px 0;}
|
|
366
|
-
|
|
374
|
+
/* hamr 2026-11-02: Run summary captions blue, same size */
|
|
375
|
+
.sum-label{flex:none;width:66px;color:var(--accent);font-weight:700;}
|
|
367
376
|
.sum-val{color:var(--text);}
|
|
368
377
|
.summary-box .num{color:var(--accent);font-weight:700;}
|
|
369
378
|
|
|
@@ -371,7 +380,7 @@
|
|
|
371
380
|
wrapping; a name is never cut. A box + its trailing arrow are ONE unit (the arrow never wraps alone); the lead arrow
|
|
372
381
|
of a wrapped line hangs in the container's left padding (absolute, zero layout impact — toggling it moves nothing). */
|
|
373
382
|
.map-box{border:1px solid var(--border-strong);padding:10px;margin-top:16px;margin-bottom:14px;background:var(--panel2);}
|
|
374
|
-
.map-box::before{content:"┤ MAP ├";display:block;font-size:
|
|
383
|
+
.map-box::before{content:"┤ MAP ├";display:block;font-size:12px;font-weight:700;color:var(--accent);letter-spacing:0.08em;margin:-2px 0 8px 0;}
|
|
375
384
|
.map-chips{display:flex;flex-wrap:wrap;gap:8px 4px;align-items:flex-start;padding-left:1.4em;}
|
|
376
385
|
.map-item{position:relative;display:inline-flex;align-items:center;gap:4px;max-width:100%;}
|
|
377
386
|
.map-arrow{color:var(--text-dim);font-size:13px;flex:none;}
|
|
@@ -500,7 +509,7 @@
|
|
|
500
509
|
.audit-tally{color:var(--text-dim);margin:2px 0 4px;}
|
|
501
510
|
.audit-try{margin:4px 0 2px;overflow-wrap:anywhere;}
|
|
502
511
|
.audit-judged{color:var(--text-faint);}
|
|
503
|
-
.audit-fold-label{color:var(--
|
|
512
|
+
.audit-fold-label{color:var(--accent);text-transform:uppercase;font-size:10px;letter-spacing:.05em;margin-top:8px;}
|
|
504
513
|
.audit-fold-body table.rounds-table{width:100%;border-collapse:collapse;margin-top:4px;}
|
|
505
514
|
.audit-fold-body table.rounds-table th{position:sticky;top:0;z-index:1;}
|
|
506
515
|
.audit-fold-body table.rounds-table tr.trysep td{border-top:1px solid var(--border-strong);}
|
|
@@ -526,14 +535,14 @@
|
|
|
526
535
|
.fold-list{margin-top:10px;}
|
|
527
536
|
.fgrid .cell.fail[aria-expanded="true"]{outline:2px solid var(--red);outline-offset:1px;}
|
|
528
537
|
.fx-errors{margin:8px 0 4px;min-width:0;}
|
|
529
|
-
.fx-label{font-size:11px;color:var(--
|
|
538
|
+
.fx-label{font-size:11px;color:var(--accent);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:2px;}
|
|
530
539
|
.fx-row{min-width:0;}
|
|
531
540
|
.fx-rowhead{display:flex;align-items:baseline;gap:8px;width:100%;min-width:0;min-height:32px;padding:3px 4px;border:0;background:none;color:var(--text);font:inherit;font-size:12px;text-align:left;}
|
|
532
541
|
button.fx-rowhead{cursor:pointer;}
|
|
533
542
|
button.fx-rowhead:hover{background:var(--panel2);}
|
|
534
543
|
button.fx-rowhead:focus-visible,.fx-more:focus-visible,.cell.fail:focus-visible{outline:2px solid var(--red);outline-offset:1px;}
|
|
535
544
|
.fx-caret{flex:none;width:12px;color:var(--text-faint);}
|
|
536
|
-
.fx-try{flex:none;font-weight:700;}
|
|
545
|
+
.fx-try{flex:none;font-weight:700;color:var(--accent);}
|
|
537
546
|
.fx-chk{flex:none;white-space:nowrap;}
|
|
538
547
|
.fx-first{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-dim);}
|
|
539
548
|
.fx-faint,.fx-count{color:var(--text-faint);}
|
|
@@ -550,6 +559,8 @@
|
|
|
550
559
|
.btn.hints:focus-visible{outline:2px solid var(--accent);outline-offset:1px;}
|
|
551
560
|
.cell.none{color:var(--text-faint);cursor:default;font-weight:400;}
|
|
552
561
|
tr.hint-row td{color:var(--text-faint);}
|
|
562
|
+
tr.hint-row td.q{color:var(--accent);}
|
|
563
|
+
.audit-group th{color:var(--accent);}
|
|
553
564
|
.fx-row.hintrow.open>.fx-rowhead{background:var(--panel2);}
|
|
554
565
|
.fx-row.hintrow .fx-body{border-left-color:var(--accent);background:var(--panel2);}
|
|
555
566
|
.fx-row.hintrow .fx-try{flex:1 1 auto;min-width:0;overflow-wrap:anywhere;}
|
|
@@ -598,6 +609,7 @@
|
|
|
598
609
|
#result-body .tg-stats{font-size:13px;margin:0 0 8px;overflow-wrap:anywhere;}
|
|
599
610
|
table.grid.tg td.r,table.grid.tg th.r{position:sticky;left:0;background:var(--panel2);z-index:1;min-width:84px;white-space:nowrap;}
|
|
600
611
|
table.grid.tg td.c{min-width:84px;}
|
|
612
|
+
table.grid.tg th{color:var(--accent);font-weight:700;}
|
|
601
613
|
.tg-rowname{display:flex;align-items:center;max-width:min(240px,60vw);}
|
|
602
614
|
table.grid.tg button.tg-name{flex:0 1 auto;min-width:0;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border:0;background:none;padding:0;min-height:32px;font:inherit;font-size:12px;font-weight:700;color:var(--accent);cursor:pointer;}
|
|
603
615
|
table.grid.tg button.tg-name:hover{text-decoration:underline;}
|
|
@@ -626,12 +638,13 @@
|
|
|
626
638
|
/* M10 am4 item 8 (bareloop never looked on a phone): a long saved-file name wraps inside its button instead of pushing it past the screen */
|
|
627
639
|
#result-body .btn{max-width:100%;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;}
|
|
628
640
|
.field{margin-bottom:10px;}
|
|
629
|
-
|
|
641
|
+
/* hamr 2026-11-02: captions on every page 1px bigger, bold, accent (Chat card keeps its pills) */
|
|
642
|
+
label{display:block;font-size:12px;font-weight:700;color:var(--accent);margin-bottom:2px;text-transform:uppercase;letter-spacing:0.04em;}
|
|
630
643
|
/* hamr's 2026-09-27 exit-check review #3: Ask tab box headers — same
|
|
631
644
|
bold/uppercase weight `label` already gives the Job tab's own fields,
|
|
632
645
|
applied to "draft under review" and each unjudged input's own label
|
|
633
646
|
("resume-text"/"jd-text" etc.), never the faint `.hint` style. */
|
|
634
|
-
.evidence-heading{font-size:
|
|
647
|
+
.evidence-heading{font-size:12px;font-weight:700;color:var(--accent);margin:8px 0 3px;text-transform:uppercase;letter-spacing:0.04em;}
|
|
635
648
|
.evidence-heading:first-child{margin-top:0;}
|
|
636
649
|
/* review #3: the ask's own question, a real heading under the "step ·
|
|
637
650
|
draft N · asked · status" meta line — reuses the box-drawing h4 look
|
|
@@ -679,8 +692,8 @@
|
|
|
679
692
|
@media (max-width:400px){.job-card .radio-row{padding-right:76px;}}
|
|
680
693
|
.cap-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;margin-bottom:6px;}
|
|
681
694
|
.cap-field label{display:block;font-size:11px;font-weight:700;color:var(--text-dim);margin-bottom:1px;}
|
|
682
|
-
/* hamr 2026-11-
|
|
683
|
-
#chat-job-card .field > label:not(.jf-thinking),#chat-job-card .cap-field > label
|
|
695
|
+
/* hamr 2026-11-02 picked variant C: the Chat card's field captions are pill captions (accent text on a tinted pill), no left bar; `required` is small and grey */
|
|
696
|
+
#chat-job-card .field > label:not(.jf-thinking),#chat-job-card .cap-field > label{font-size:13px;font-weight:700;color:var(--accent);text-transform:none;letter-spacing:0;margin:8px 0 6px;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--accent) 16%,transparent);display:inline-block;}
|
|
684
697
|
#chat-job-card .req{font-size:11px;font-weight:400;color:var(--req);margin-left:8px;}
|
|
685
698
|
.cap-field input{width:100%;padding:5px 6px;box-sizing:border-box;}
|
|
686
699
|
.btn.primary{background:var(--primary-bg);color:var(--primary-text);border-color:var(--primary-border);font-weight:700;}
|
|
@@ -780,7 +793,6 @@
|
|
|
780
793
|
.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;}
|
|
781
794
|
.ro-lines .ro-line{display:flex;gap:8px;}
|
|
782
795
|
.ro-lines .ro-n{flex:none;min-width:1.4em;color:var(--text-faint);}
|
|
783
|
-
.jf-waitrow{margin-bottom:4px;}
|
|
784
796
|
.jf-err{font-size:11px;color:var(--red);margin-top:2px;overflow-wrap:anywhere;}
|
|
785
797
|
.jf-err:empty{display:none;}
|
|
786
798
|
.dest-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:6px;}
|
|
@@ -892,7 +904,7 @@
|
|
|
892
904
|
.settings-header h2::after{content:" ├";color:var(--text-faint);}
|
|
893
905
|
.money-strip{display:grid;grid-template-columns:repeat(3, 1fr);gap:12px;align-items:end;padding:10px;border:1px solid var(--border-strong);background:var(--panel2);}
|
|
894
906
|
.money-item{min-width:0;}
|
|
895
|
-
.money-item label{display:block;font-size:
|
|
907
|
+
.money-item label{display:block;font-size:12px;font-weight:700;color:var(--accent);margin-bottom:2px;}
|
|
896
908
|
.money-value{font-size:16px;font-weight:700;padding:6px 0;overflow-wrap:anywhere;}
|
|
897
909
|
.money-item input{width:100%;height:44px;box-sizing:border-box;}
|
|
898
910
|
.keyfile-strip{position:relative;border:1px solid var(--border-strong);padding:12px 12px 8px;background:var(--panel2);margin:14px 0;font-size:12px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
|
|
@@ -921,7 +933,7 @@
|
|
|
921
933
|
.pv-fold{border:0;background:none;color:var(--text);font:inherit;padding:0 4px 0 0;min-width:22px;min-height:24px;cursor:pointer;text-align:left;}
|
|
922
934
|
.pv-krow select,.pv-krow input[type=text]{width:100%;max-width:100%;min-height:28px;box-sizing:border-box;}
|
|
923
935
|
.pv-grid select,.pv-grid input[type=text]{font-size:12px;height:28px;padding:2px 6px;}
|
|
924
|
-
.pv-legacy{display:inline-flex;align-items:center;gap:6px;cursor:pointer;min-height:28px;text-transform:none;letter-spacing:0;font-weight:400;font-size:12px;}
|
|
936
|
+
.pv-legacy{display:inline-flex;align-items:center;gap:6px;cursor:pointer;min-height:28px;color:var(--text-dim);text-transform:none;letter-spacing:0;font-weight:400;font-size:12px;}
|
|
925
937
|
.pv-legacy input,.pv-m-use input{width:16px;height:16px;margin:0;accent-color:var(--accent);cursor:pointer;}
|
|
926
938
|
.pv-tok{text-align:right;font-variant-numeric:tabular-nums;}
|
|
927
939
|
.pv-refcell{display:flex;justify-content:flex-end;}
|
|
@@ -960,7 +972,7 @@
|
|
|
960
972
|
.pv-typed{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:4px;}
|
|
961
973
|
.pv-typed input{flex:1 1 160px;min-width:0;max-width:260px;min-height:28px;box-sizing:border-box;}
|
|
962
974
|
.pv-typed .hint{flex:1 1 100%;margin:0;}
|
|
963
|
-
.field label.jf-thinking{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:6px;margin-top:6px;font-size:12px;text-transform:none;letter-spacing:0;}
|
|
975
|
+
.field label.jf-thinking{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:6px;margin-top:6px;font-size:12px;color:var(--text-dim);text-transform:none;letter-spacing:0;}
|
|
964
976
|
.field label.jf-thinking input{width:auto;min-height:0;margin:0;}
|
|
965
977
|
.hint.bad{color:var(--red);}
|
|
966
978
|
.table-wrap{overflow-x:auto;border:1px solid var(--border-strong);background:var(--panel2);max-width:100%;}
|
|
@@ -1175,7 +1187,7 @@
|
|
|
1175
1187
|
<div class="jf-gut" id="jf-job-gut" data-testid="jf-job-gut" aria-hidden="true"><div class="jf-gut-in"></div></div>
|
|
1176
1188
|
<textarea class="jf-wrap" id="jf-job" rows="6" data-testid="jf-job" autocomplete="off" spellcheck="false" placeholder="Read my resume ~keep it under 600 words Ask: check it with me Write it out"></textarea>
|
|
1177
1189
|
</div>
|
|
1178
|
-
<div class="hint">One step per line. A line starting with <code>~</code> is a guardrail of the step above it. <code>Ask:</code> stops for you; <code>Ask 2h:</code> sets that ask's own wait.
|
|
1190
|
+
<div class="hint">One step per line. A line starting with <code>~</code> is a guardrail of the step above it. <code>Ask:</code> stops for you; <code>Ask 2h:</code> sets that ask's own wait. The last line writes the result to the Destination.</div>
|
|
1179
1191
|
<div class="jf-err" id="jf-err-job" data-testid="jf-err-job"></div>
|
|
1180
1192
|
</div>
|
|
1181
1193
|
<div class="field">
|
|
@@ -1217,9 +1229,9 @@
|
|
|
1217
1229
|
<div class="jf-err" id="jf-err-schedule" data-testid="jf-err-schedule"></div>
|
|
1218
1230
|
</div>
|
|
1219
1231
|
<div class="field">
|
|
1220
|
-
<label for="jf-dest-folder">Destination</label>
|
|
1232
|
+
<label for="jf-dest-folder">Destination <span class="req" id="jf-req-destination" data-testid="jf-req-destination">required</span></label>
|
|
1221
1233
|
<input id="jf-dest-folder" type="text" placeholder="/full/path/to/a/folder" autocomplete="off" spellcheck="false" data-testid="jf-dest-folder">
|
|
1222
|
-
<div class="hint">Where the accepted result is placed, at the last step
|
|
1234
|
+
<div class="hint">Where the accepted result is placed, at the last step.</div>
|
|
1223
1235
|
<div class="jf-err" id="jf-err-destination" data-testid="jf-err-destination"></div>
|
|
1224
1236
|
</div>
|
|
1225
1237
|
<div class="cap-row" data-testid="cap-row">
|
|
@@ -1326,11 +1338,14 @@
|
|
|
1326
1338
|
<div class="hint" id="jf-run-left" data-testid="jf-run-left"></div>
|
|
1327
1339
|
<div class="jf-err" id="jf-err-run-capUsd" data-testid="jf-err-run-capUsd"></div>
|
|
1328
1340
|
</div>
|
|
1329
|
-
<div class="cap-field" id="jf-run-waits" data-testid="jf-run-waits"
|
|
1341
|
+
<div class="cap-field" id="jf-run-waits" data-testid="jf-run-waits" hidden>
|
|
1342
|
+
<label for="jf-run-wait">Ask wait</label>
|
|
1343
|
+
<input id="jf-run-wait" class="jf-wait" type="text" placeholder="e.g. 30m" autocomplete="off" spellcheck="false" data-testid="jf-run-wait">
|
|
1344
|
+
</div>
|
|
1330
1345
|
</div>
|
|
1331
1346
|
<div class="jf-err" id="jf-err-run-askWaits" data-testid="jf-err-run-askWaits"></div>
|
|
1332
1347
|
<div class="hint" id="jf-run-sign-hint" data-testid="jf-run-sign-hint">A different destination, cap or ask wait is signed for this run only: two clicks. The flow's own values never change.</div>
|
|
1333
|
-
<div class="field">
|
|
1348
|
+
<div class="field" id="jf-run-id-field" data-testid="jf-run-id-field">
|
|
1334
1349
|
<label for="jf-run-id">Run id</label>
|
|
1335
1350
|
<input id="jf-run-id" type="text" autocomplete="off" spellcheck="false" data-testid="jf-run-id">
|
|
1336
1351
|
<div class="jf-err" id="jf-err-runId" data-testid="jf-err-runId"></div>
|
|
@@ -2772,6 +2787,14 @@
|
|
|
2772
2787
|
return resultField("Page read", '<div class="ro-value" data-testid="' + testid + '" style="overflow-wrap:anywhere"><a href="' + escapeXml(url) +
|
|
2773
2788
|
'" target="_blank" rel="noopener noreferrer">' + escapeXml(url) + '</a><div class="hint" data-testid="result-page-note">' + escapeXml(note || "") + '</div></div>');
|
|
2774
2789
|
}
|
|
2790
|
+
// M15 item 5: the sent file(s), at the top: a link that opens the file, or the server's words (gone / changed) in its place. A run that sent nothing draws nothing.
|
|
2791
|
+
function resultFileLinks(data){
|
|
2792
|
+
return (data.delivered || []).map(function(d){
|
|
2793
|
+
return resultField("Saved", d.words ? '<div class="rs-warn" data-testid="result-file-top-gone">' + escapeXml(d.name) + ' \u2014 ' + escapeXml(d.words) + '</div>'
|
|
2794
|
+
: '<div class="ro-value" data-testid="result-file-top" style="overflow-wrap:anywhere"><a href="/api/runs/' + encodeURIComponent(data.flow) + '/' + encodeURIComponent(data.runId) +
|
|
2795
|
+
'/download?i=' + d.i + '&view=1" target="_blank" rel="noopener noreferrer">' + escapeXml(d.name) + '</a></div>');
|
|
2796
|
+
}).join("");
|
|
2797
|
+
}
|
|
2775
2798
|
// `own` = the Result tab read 2+ pages, so this line's box shows its own page
|
|
2776
2799
|
function resultLineCard(line, own, note){
|
|
2777
2800
|
return '<div class="job-card" data-testid="result-line"><h4>Line ' + escapeXml(String(line.n)) + '</h4>' + resultLineBox(line) +
|
|
@@ -2913,7 +2936,7 @@
|
|
|
2913
2936
|
' \u00b7 ' + escapeXml(detail.checkType) + ' \u00b7 ' + escapeXml(detail.flow + " (" + detail.runId + ")") + '</div>') +
|
|
2914
2937
|
'<div class="field-row">' + resultField("Money", '<div class="ro-value" data-testid="result-counters">' + escapeXml(counters[0] || "") + '</div>') +
|
|
2915
2938
|
resultField("Time", '<div class="ro-value">' + escapeXml((counters[1] || "").replace(/^took /, "")) + '</div>') + '</div>' +
|
|
2916
|
-
((data.pages || []).length === 1 ? resultPageLink(data.pages[0], data.pageNote, "result-page-top") : "") + '</div>';
|
|
2939
|
+
((data.pages || []).length === 1 ? resultPageLink(data.pages[0], data.pageNote, "result-page-top") : "") + resultFileLinks(data) + '</div>';
|
|
2917
2940
|
var ownPages = (data.pages || []).length >= 2;
|
|
2918
2941
|
(data.lines || []).forEach(function(line){ h += resultLineCard(line, ownPages, data.pageNote); });
|
|
2919
2942
|
if(data.gap){
|
|
@@ -3660,7 +3683,7 @@
|
|
|
3660
3683
|
function gridTryOf(t){
|
|
3661
3684
|
var out = {
|
|
3662
3685
|
n: t.n, glyph: t.mark, hint: t.thinking || "", noVerdict: null, known: Array.isArray(t.checks) && t.checks.length > 0, inflight: t.mark === "·",
|
|
3663
|
-
cells: {}, order: [], output: t.output || null, hints: t.hints && t.hints.text ? t.hints : null, red: null
|
|
3686
|
+
cells: {}, order: [], output: t.output || null, hints: t.hints && t.hints.text ? t.hints : null, memo: t.memo && t.memo.text ? t.memo : null, red: null
|
|
3664
3687
|
};
|
|
3665
3688
|
if(out.known){
|
|
3666
3689
|
t.checks.forEach(function(c){
|
|
@@ -3719,6 +3742,13 @@
|
|
|
3719
3742
|
return open;
|
|
3720
3743
|
}
|
|
3721
3744
|
function gridHintsWord(h){ return h.n + (h.n === 1 ? " hint" : " hints"); }
|
|
3745
|
+
// M14 item 7: the memo button's word is the memo's line count (the words "line" and "lines" are the page's own, as in "+N more lines")
|
|
3746
|
+
function gridMemoLines(m){
|
|
3747
|
+
var lines = String(m.text).split("\n");
|
|
3748
|
+
while(lines.length && lines[lines.length - 1].trim() === "") lines.pop();
|
|
3749
|
+
return lines;
|
|
3750
|
+
}
|
|
3751
|
+
function gridMemoWord(m){ var n = gridMemoLines(m).length; return n + (n === 1 ? " line" : " lines"); }
|
|
3722
3752
|
function gridTableHtml(pid, model){
|
|
3723
3753
|
if(model.rows.length === 0) return "";
|
|
3724
3754
|
var head = '<tr><th class="q">check</th>' + model.tries.map(function(t){
|
|
@@ -3730,6 +3760,12 @@
|
|
|
3730
3760
|
return '<td class="c">' + (t.hints ? '<button type="button" class="btn small hints" data-hint="' + t.n + '" aria-expanded="false" aria-controls="fxerr-' + pid + '" title="try ' + t.n + ' · told from earlier runs">' + gridHintsWord(t.hints) + "</button>" : '<span class="cell none">—</span>') + "</td>";
|
|
3731
3761
|
}).join("") + "</tr>";
|
|
3732
3762
|
}
|
|
3763
|
+
// M14 item 7: `told in this run` directly under `told from earlier runs`, one button per try that was handed a memo; it opens the exact text the way the hints do
|
|
3764
|
+
if(model.tries.some(function(t){ return !!t.memo; })){
|
|
3765
|
+
hrow += '<tr class="hint-row memo-row"><td class="q">told in this run</td>' + model.tries.map(function(t){
|
|
3766
|
+
return '<td class="c">' + (t.memo ? '<button type="button" class="btn small hints" data-memo="' + t.n + '" aria-expanded="false" aria-controls="fxerr-' + pid + '" title="try ' + t.n + ' · told in this run">' + gridMemoWord(t.memo) + "</button>" : '<span class="cell none">—</span>') + "</td>";
|
|
3767
|
+
}).join("") + "</tr>";
|
|
3768
|
+
}
|
|
3733
3769
|
var sub = "";
|
|
3734
3770
|
var body = model.rows.map(function(r){
|
|
3735
3771
|
var tds = model.tries.map(function(t){
|
|
@@ -3765,13 +3801,17 @@
|
|
|
3765
3801
|
while(lines.length && lines[lines.length - 1].trim() === "") lines.pop();
|
|
3766
3802
|
return lines;
|
|
3767
3803
|
}
|
|
3768
|
-
// the errors area: the hints texts opened by their buttons, then one line per red try (`try N ✗ <first error line>`).
|
|
3804
|
+
// the errors area: the hints and memo texts opened by their buttons, then one line per red try (`try N ✗ <first error line>`).
|
|
3769
3805
|
// `st` = {open: {tryN: true}, more: {tryN: true}, hint: {tryN: true}, hmore: {tryN: true}}
|
|
3770
3806
|
function gridErrorsHtml(pid, model, st){
|
|
3771
3807
|
var hrows = model.tries.filter(function(t){ return t.hints && st.hint[t.n]; }).map(function(t){
|
|
3772
3808
|
return '<div class="fx-row hintrow open"><button type="button" class="fx-rowhead" id="fxhint-' + pid + "-" + t.n + '" data-hrow="' + t.n + '" aria-expanded="true"><span class="fx-caret">▾</span><span class="fx-try">try ' + t.n + " · told from earlier runs · " + gridHintsWord(t.hints) + '</span></button><div class="fx-body">' +
|
|
3773
3809
|
gridLinesHtml(gridHintLines(t.hints), !!st.hmore[t.n], "data-hmore", t.n) + "</div></div>";
|
|
3774
3810
|
}).join("");
|
|
3811
|
+
var mrows = model.tries.filter(function(t){ return t.memo && st.memo[t.n]; }).map(function(t){
|
|
3812
|
+
return '<div class="fx-row hintrow open"><button type="button" class="fx-rowhead" id="fxmemo-' + pid + "-" + t.n + '" data-mrow="' + t.n + '" aria-expanded="true"><span class="fx-caret">▾</span><span class="fx-try">try ' + t.n + " · told in this run · " + gridMemoWord(t.memo) + '</span></button><div class="fx-body">' +
|
|
3813
|
+
gridLinesHtml(gridMemoLines(t.memo), !!st.mmore[t.n], "data-mmore", t.n) + "</div></div>";
|
|
3814
|
+
}).join("");
|
|
3775
3815
|
var rows = model.tries.map(function(t){
|
|
3776
3816
|
if(t.noVerdict){
|
|
3777
3817
|
return '<div class="fx-row fx-row-q"><span class="fx-rowhead"><span class="fx-caret"></span><span class="fx-try">try ' + t.n + '</span><span class="fx-chk">' + gridGlyph("?") + '</span><span class="fx-first fx-faint" title="' + escapeXml(t.noVerdict) + '">' + escapeXml(t.noVerdict) + "</span></span></div>";
|
|
@@ -3787,7 +3827,7 @@
|
|
|
3787
3827
|
var body = open ? '<div class="fx-body">' + gridLinesHtml(lines, !!st.more[t.n], "data-fxmore", t.n) + "</div>" : "";
|
|
3788
3828
|
return '<div class="fx-row' + (open ? " open" : "") + '">' + head + body + "</div>";
|
|
3789
3829
|
}).join("");
|
|
3790
|
-
return hrows + rows ? '<div class="fx-label">errors</div>' + hrows + rows : "";
|
|
3830
|
+
return hrows + mrows + rows ? '<div class="fx-label">errors</div>' + hrows + mrows + rows : "";
|
|
3791
3831
|
}
|
|
3792
3832
|
// the rounds, folded per try: each fold builds its own try's rows (20 a page) the first time it opens
|
|
3793
3833
|
function gridRoundsHtml(model){
|
|
@@ -3821,12 +3861,15 @@
|
|
|
3821
3861
|
Array.prototype.forEach.call(wrap.querySelectorAll("[data-hint]"), function(b){
|
|
3822
3862
|
b.setAttribute("aria-expanded", st.hint[b.getAttribute("data-hint")] ? "true" : "false");
|
|
3823
3863
|
});
|
|
3864
|
+
Array.prototype.forEach.call(wrap.querySelectorAll("[data-memo]"), function(b){
|
|
3865
|
+
b.setAttribute("aria-expanded", st.memo[b.getAttribute("data-memo")] ? "true" : "false");
|
|
3866
|
+
});
|
|
3824
3867
|
}
|
|
3825
3868
|
// a model step's body below its tally: the grid (hints row, every-step row, the close's checks), the errors area, the judged line, then the rounds folds
|
|
3826
3869
|
function buildGridEl(g){
|
|
3827
3870
|
var pid = String(g.step).replace(/[^A-Za-z0-9_-]/g, "_");
|
|
3828
3871
|
var model = gridModelOf(g.fold);
|
|
3829
|
-
var st = { open: gridDefaultOpen(model), more: {}, hint: {}, hmore: {} };
|
|
3872
|
+
var st = { open: gridDefaultOpen(model), more: {}, hint: {}, hmore: {}, memo: {}, mmore: {} };
|
|
3830
3873
|
var wrap = document.createElement("div");
|
|
3831
3874
|
wrap.setAttribute("data-fxpart", pid);
|
|
3832
3875
|
wrap.setAttribute("data-testid", "audit-grid-" + g.step);
|
|
@@ -3849,6 +3892,33 @@
|
|
|
3849
3892
|
if(hagain) hagain.focus();
|
|
3850
3893
|
return;
|
|
3851
3894
|
}
|
|
3895
|
+
var mmore = e.target.closest("[data-mmore]");
|
|
3896
|
+
if(mmore){
|
|
3897
|
+
var mk = mmore.getAttribute("data-mmore");
|
|
3898
|
+
st.mmore[mk] = !st.mmore[mk];
|
|
3899
|
+
renderGridErrors(wrap, pid, model, st);
|
|
3900
|
+
var magain = wrap.querySelector('[data-mmore="' + mk + '"]');
|
|
3901
|
+
if(magain) magain.focus();
|
|
3902
|
+
return;
|
|
3903
|
+
}
|
|
3904
|
+
var mrow = e.target.closest("[data-mrow]");
|
|
3905
|
+
if(mrow){
|
|
3906
|
+
var mn = mrow.getAttribute("data-mrow");
|
|
3907
|
+
st.memo[mn] = false;
|
|
3908
|
+
renderGridErrors(wrap, pid, model, st);
|
|
3909
|
+
var mb = wrap.querySelector('[data-memo="' + mn + '"]');
|
|
3910
|
+
if(mb) mb.focus();
|
|
3911
|
+
return;
|
|
3912
|
+
}
|
|
3913
|
+
var memo = e.target.closest("[data-memo]");
|
|
3914
|
+
if(memo){
|
|
3915
|
+
var mn2 = memo.getAttribute("data-memo");
|
|
3916
|
+
st.memo[mn2] = !st.memo[mn2];
|
|
3917
|
+
renderGridErrors(wrap, pid, model, st);
|
|
3918
|
+
var me = document.getElementById("fxmemo-" + pid + "-" + mn2);
|
|
3919
|
+
if(me) me.scrollIntoView({ block: "nearest" });
|
|
3920
|
+
return;
|
|
3921
|
+
}
|
|
3852
3922
|
var hrow = e.target.closest("[data-hrow]");
|
|
3853
3923
|
if(hrow){
|
|
3854
3924
|
var hn = hrow.getAttribute("data-hrow");
|
|
@@ -5472,7 +5542,9 @@
|
|
|
5472
5542
|
var capNoteEl = document.getElementById("jf-cap-note");
|
|
5473
5543
|
var runDestEl = document.getElementById("jf-run-dest"); // Run a signed flow: the open Destination box (amendment 5)
|
|
5474
5544
|
var runCapEl = document.getElementById("jf-run-cap"); // ... and the open Cap $ box
|
|
5475
|
-
var runWaitsEl = document.getElementById("jf-run-waits"); // ... and one wait box
|
|
5545
|
+
var runWaitsEl = document.getElementById("jf-run-waits"); // ... and its one Ask wait box (M13 am7)
|
|
5546
|
+
var runWaitEl = document.getElementById("jf-run-wait");
|
|
5547
|
+
var runSignedWaits = {}; // the signed wait of each ask line of the picked job, line -> "1h"; ONE writer: paintRunFlow
|
|
5476
5548
|
var resumeBox = document.getElementById("jf-resume"); // the "Resume run-<n>" form (amendment 4 item 4): only Cap $ is open
|
|
5477
5549
|
var resumeCapEl = document.getElementById("jf-resume-cap");
|
|
5478
5550
|
var modeRow = document.getElementById("jf-mode-row");
|
|
@@ -5873,9 +5945,10 @@
|
|
|
5873
5945
|
paintRequired();
|
|
5874
5946
|
inputsHintEl.textContent = (generic || tickets) ? "The Inputs line says what to read; it may be empty for a generic MCP job." : INPUTS_HINT_PLAIN;
|
|
5875
5947
|
}
|
|
5876
|
-
// M13 am5: the one writer of the required marks. Inputs is optional only for an MCP job; the Run card's mark shows when the flow has input rows
|
|
5948
|
+
// M13 am5/am6: the one writer of the required marks. Destination is required for every flow type (am6). Inputs is optional only for an MCP job; the Run card's mark shows when the flow has input rows
|
|
5877
5949
|
function paintRequired(){
|
|
5878
5950
|
byId("jf-req-inputs").textContent = flowTypeEl.value === "mcp" ? "optional for MCP" : "required";
|
|
5951
|
+
byId("jf-req-destination").textContent = "required";
|
|
5879
5952
|
byId("jf-run-req-inputs").hidden = runInputsEl.children.length === 0;
|
|
5880
5953
|
}
|
|
5881
5954
|
function setFlow(type, server, sched){
|
|
@@ -5916,11 +5989,21 @@
|
|
|
5916
5989
|
...(reuseOf !== null ? {reuseOf: reuseOf} : {})
|
|
5917
5990
|
};
|
|
5918
5991
|
}
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5992
|
+
// M13 am7: the one Ask wait box is the wait of every ask that does not set its own. The job's shared wait is its commonest signed wait (first ask on a
|
|
5993
|
+
// tie); an ask signed with a different wait sets its own and keeps it. An empty box changes nothing.
|
|
5994
|
+
function sharedAskWait(signed){
|
|
5995
|
+
var count = {}, best = "";
|
|
5996
|
+
Object.keys(signed).forEach(function(l){ count[signed[l]] = (count[signed[l]] || 0) + 1; });
|
|
5997
|
+
Object.keys(signed).forEach(function(l){ if(best === "" || count[signed[l]] > count[best]) best = signed[l]; });
|
|
5998
|
+
return best;
|
|
5999
|
+
}
|
|
6000
|
+
function askWaitsFrom(signed, text){
|
|
6001
|
+
var t = String(text).trim(), out = {}, base = sharedAskWait(signed);
|
|
6002
|
+
if(t === "") return out;
|
|
6003
|
+
Object.keys(signed).forEach(function(l){ if(signed[l] === base) out[l] = t; });
|
|
6004
|
+
return out;
|
|
6005
|
+
}
|
|
6006
|
+
function runWaits(){ return askWaitsFrom(runSignedWaits, runWaitEl.value); }
|
|
5924
6007
|
function currentRun(){
|
|
5925
6008
|
return {
|
|
5926
6009
|
flow: pickedFlow || "", inputs: readRows(runInputsEl), runId: (byId("jf-run-id").value.trim() === autoRunId ? "" : byId("jf-run-id").value.trim()),
|
|
@@ -5963,8 +6046,8 @@
|
|
|
5963
6046
|
}
|
|
5964
6047
|
var c = currentCard();
|
|
5965
6048
|
var v = Number(c.capUsd);
|
|
5966
|
-
// M13 am5: Inputs is required except for an MCP job (item 4); the server still judges what is in it
|
|
5967
|
-
return c.flowName !== "" && c.job.trim() !== "" && (flowTypeEl.value === "mcp" || c.inputs.trim() !== "") && c.capUsd !== "" && isFinite(v) && v > 0;
|
|
6049
|
+
// M13 am6: Destination is required for every flow type. M13 am5: Inputs is required except for an MCP job (item 4); the server still judges what is in it
|
|
6050
|
+
return c.flowName !== "" && c.job.trim() !== "" && c.destination !== "" && (flowTypeEl.value === "mcp" || c.inputs.trim() !== "") && c.capUsd !== "" && isFinite(v) && v > 0;
|
|
5968
6051
|
}
|
|
5969
6052
|
|
|
5970
6053
|
// ---- the money note under Cap (M4e amendment 4 items 1-2) ----
|
|
@@ -6123,7 +6206,9 @@
|
|
|
6123
6206
|
return b;
|
|
6124
6207
|
}
|
|
6125
6208
|
function paintReuseKind(){
|
|
6209
|
+
// M13 am7: the name that will be true. The server's answer (the one that picks the button) shows the new name OR the Run id, never both
|
|
6126
6210
|
newNameField.hidden = !(mode === "run" && reuseKind === "draft" && !reuseRunOf);
|
|
6211
|
+
byId("jf-run-id-field").hidden = !newNameField.hidden;
|
|
6127
6212
|
}
|
|
6128
6213
|
function checkReuse(){
|
|
6129
6214
|
if(mode !== "run" || !selectedFlow()){ reuseKind = null; reuseBusy = false; paintReuseKind(); return; }
|
|
@@ -6152,8 +6237,7 @@
|
|
|
6152
6237
|
if(!f || mode !== "run" || cardLocked() || sessionLive) return;
|
|
6153
6238
|
reuseOf = reuseRunOf ? {flow: f.flow, fromRun: pickedRun ? pickedRun.runId : ""} : {flow: f.flow, fromRun: pickedRun ? pickedRun.runId : undefined};
|
|
6154
6239
|
var rows = readRows(runInputsEl);
|
|
6155
|
-
var
|
|
6156
|
-
var firstWait = Object.keys(waits).map(function(k){ return waits[k]; }).filter(function(w){ return w !== ""; })[0] || "1h";
|
|
6240
|
+
var firstWait = runWaitEl.value.trim() || "1h";
|
|
6157
6241
|
var pk = runPickChoice();
|
|
6158
6242
|
setMode("new");
|
|
6159
6243
|
setVal("jf-name", reuseRunOf ? f.flow : newNameEl.value.trim()); setVal("jf-job", jobBoxEl.value); setVal("jf-cap-money", runCapEl.value.trim());
|
|
@@ -6202,18 +6286,9 @@
|
|
|
6202
6286
|
runDestEl.classList.toggle("locked", !(f && f.hasSend));
|
|
6203
6287
|
byId("jf-run-dest-hint").textContent = !f ? "" : (f.hasSend ? "Where the accepted result is placed, at the last step. A different folder is signed for this run only." : "This flow has no send step, so there is no destination to set.");
|
|
6204
6288
|
runCapEl.value = f ? String(f.values.capUsd) : ""; // M6 am11: the job's SIGNED cap, never what an earlier run was capped at after drafting (v)
|
|
6205
|
-
|
|
6206
|
-
Object.keys(
|
|
6207
|
-
|
|
6208
|
-
row.className = "jf-waitrow";
|
|
6209
|
-
var lab = document.createElement("label");
|
|
6210
|
-
lab.textContent = "Ask wait \u00b7 line " + line;
|
|
6211
|
-
var inp = makeInput("jf-wait", "e.g. 30m", v.askWaits[line]);
|
|
6212
|
-
inp.setAttribute("data-line", line);
|
|
6213
|
-
inp.setAttribute("data-testid", "jf-run-wait-" + line);
|
|
6214
|
-
row.appendChild(lab); row.appendChild(inp);
|
|
6215
|
-
runWaitsEl.appendChild(row);
|
|
6216
|
-
});
|
|
6289
|
+
runSignedWaits = (v && v.askWaits) || {};
|
|
6290
|
+
runWaitsEl.hidden = Object.keys(runSignedWaits).length === 0;
|
|
6291
|
+
runWaitEl.value = sharedAskWait(runSignedWaits);
|
|
6217
6292
|
paintRunRows(f, pickedRun ? pickedRun.sources : (f ? f.lastSources : null));
|
|
6218
6293
|
autoRunId = f && f.nextRunId ? f.nextRunId : "";
|
|
6219
6294
|
byId("jf-run-id").value = autoRunId;
|
|
@@ -6961,15 +7036,18 @@
|
|
|
6961
7036
|
// Re-attach after a page load/refresh or a panel restart: the server reads the newest unsigned draft from its files, so ask it.
|
|
6962
7037
|
// If one exists, this tab takes it over as if it had started it: the card filled from the draft's own copy, the poll loop, the
|
|
6963
7038
|
// progress list, the readout and the main button. A signed or abandoned draft never comes back (empty card).
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
openNewCard();
|
|
6967
|
-
setMode("new");
|
|
7039
|
+
// ONE writer of the New-job boxes from a draft's card (attach, and Revise opening on the newest card)
|
|
7040
|
+
function fillCardFields(c){
|
|
6968
7041
|
setVal("jf-name", c.flowName); setVal("jf-job", c.job); setVal("jf-cap-money", c.capUsd);
|
|
6969
7042
|
setModelPick(c.provider || "", c.model || ""); thinkingEl.checked = c.thinking === true && !thinkingNone;
|
|
6970
7043
|
refreshCapNote();
|
|
6971
7044
|
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");
|
|
6972
7045
|
setFlow(c.flowType, c.mcp, c.schedule);
|
|
7046
|
+
}
|
|
7047
|
+
function attachSession(d){
|
|
7048
|
+
openNewCard();
|
|
7049
|
+
setMode("new");
|
|
7050
|
+
fillCardFields(d.card || {});
|
|
6973
7051
|
sessionId = d.draftId;
|
|
6974
7052
|
sessionLive = CLIENT_TERMINAL_PHASES.indexOf(d.phase) === -1;
|
|
6975
7053
|
renderThread(d);
|
|
@@ -7003,7 +7081,7 @@
|
|
|
7003
7081
|
resetCard();
|
|
7004
7082
|
});
|
|
7005
7083
|
// Revise (amendment 14 item 2): opens every card field, filled as last submitted; nothing is sent
|
|
7006
|
-
reviseBtn.addEventListener("click", function(){ if(reviseBtn.disabled) return; reviseOpen = true; refreshStartEnabled(); });
|
|
7084
|
+
reviseBtn.addEventListener("click", function(){ if(reviseBtn.disabled) return; if(lastState && lastState.card) fillCardFields(lastState.card); reviseOpen = true; refreshStartEnabled(); fitCardBoxes(); });
|
|
7007
7085
|
// Start over (amendment 14 item 3): the same draft call as Draft, from the card as it is now; the old draft's files stay (a new draft id, 2 new revises)
|
|
7008
7086
|
startOverBtn.addEventListener("click", function(){ if(!startOverBtn.disabled) doDraft(sessionId); });
|
|
7009
7087
|
qSend.addEventListener("click", doAnswer);
|
|
@@ -7496,7 +7574,7 @@
|
|
|
7496
7574
|
var shown = more ? s.check.tools : s.check.tools.slice(0, MCP_TOOLS_SHOWN);
|
|
7497
7575
|
list = '<div class="pv-mhead mc-t" aria-hidden="true"><span>TOOL</span><span>HINT</span><span class="n">USED</span></div>' +
|
|
7498
7576
|
shown.map(function(t){
|
|
7499
|
-
return '<div class="pv-mrow mc-t" tabindex="-1" data-testid="mcp-tool"><span class="pv-m-name"><code>' + escapeXml(t.name) + '</code></span><span>' + escapeXml(t.hint || "—") + '</span><span class="n">' + ((s.use && s.use.tools && s.use.tools[t.name]) || 0) + '</span></div>';
|
|
7577
|
+
return '<div class="pv-mrow mc-t" tabindex="-1" data-testid="mcp-tool"><span class="pv-m-name"><code>' + escapeXml(t.name) + '</code></span><span>' + escapeXml(t.hint || "—") + '</span><span class="n">' + ((s.use && s.use.tools && Object.prototype.hasOwnProperty.call(s.use.tools, t.name) && s.use.tools[t.name]) || 0) + '</span></div>';
|
|
7500
7578
|
}).join("") +
|
|
7501
7579
|
(s.check.tools.length > shown.length ? '<div class="pv-more"><button class="pv-add" type="button" data-more="' + pi + "-" + si + '">+' + (s.check.tools.length - shown.length) + ' more</button></div>' : "");
|
|
7502
7580
|
} else if(s.check) list = '<div class="pv-more"><span class="hint bad">' + escapeXml(s.check.error || "") + '</span></div>';
|
package/src/panel/result.js
CHANGED
|
@@ -15,7 +15,8 @@ import { readFileInside } from '../flow.js';
|
|
|
15
15
|
import { isCellsPath } from '../closers.js';
|
|
16
16
|
import { readAcceptedHashesByEmits } from '../ask.js';
|
|
17
17
|
import { NOT_CHECKED_LABEL } from '../checked.js';
|
|
18
|
-
import { checkSendDestination } from '../runner.js';
|
|
18
|
+
import { checkSendDestination, readArtifactResult } from '../runner.js';
|
|
19
|
+
import { flowTypeOf } from '../declaration.js';
|
|
19
20
|
import { isAgree, readingOfQuestion } from '../pageask.js';
|
|
20
21
|
import { lineRules } from '../pagebits.js';
|
|
21
22
|
import { readLineSection, LINE_CHECKS_FILE } from '../line-checks.js';
|
|
@@ -49,6 +50,15 @@ export function isResultRun(arbiter) {
|
|
|
49
50
|
return sources.some((s) => s && (s.kind === 'page' || (isStr(s.path) && (isCellsPath(s.path) || s.path.toLowerCase().endsWith('.docx')))));
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
/**
|
|
54
|
+
* M15 item 1: the ONE decider of the Result tab and of its cards. Every job has it; a Tickets MCP job keeps what it had (M13 am2: the grid, and M10's cards only when
|
|
55
|
+
* it reads a page, a CSV or a .docx). Read off the signed declaration and arbiter.
|
|
56
|
+
* @param {any} arbiter @param {any} declaration @returns {boolean}
|
|
57
|
+
*/
|
|
58
|
+
export function hasResultCards(arbiter, declaration) {
|
|
59
|
+
return flowTypeOf(declaration) === 'tickets' ? isResultRun(arbiter) : true;
|
|
60
|
+
}
|
|
61
|
+
|
|
52
62
|
/** The run's check type: its distinct close classes, in step order (`hitl + softgreen`). `—` for a declaration with none.
|
|
53
63
|
* @param {any} declaration @returns {string} */
|
|
54
64
|
export function checkTypeOf(declaration) {
|
|
@@ -166,9 +176,9 @@ export function readDelivered(rec) {
|
|
|
166
176
|
}
|
|
167
177
|
|
|
168
178
|
/**
|
|
169
|
-
* The files this run's signed sends wrote: for each signed send whose send step ended green in the audit, the file `<flow>-<runId>-<emits>.
|
|
170
|
-
* in the signed folder
|
|
171
|
-
* send itself checked). No accepted hash = recorded as null, which reads as "changed", never as ok.
|
|
179
|
+
* The files this run's signed sends wrote: for each signed send whose send step ended green in the audit, the file `<flow>-<runId>-<emits>.md`
|
|
180
|
+
* in the signed folder with the sha256 the send recorded for it (M15), or, for a send older than M15, `.json` with the sha256 the human's accept recorded for the ask that
|
|
181
|
+
* send reads (`readAcceptedHashesByEmits`, the same record the send itself checked). No accepted hash = recorded as null, which reads as "changed", never as ok.
|
|
172
182
|
* @returns {{path: string, dir: string|null, name: string, sha256: string|null}[]}
|
|
173
183
|
*/
|
|
174
184
|
export function deliveredOf({
|
|
@@ -181,13 +191,16 @@ export function deliveredOf({
|
|
|
181
191
|
const out = [];
|
|
182
192
|
for (const send of arbiter?.sends ?? []) {
|
|
183
193
|
const step = steps.find((s) => s.fromLine === send.line);
|
|
184
|
-
|
|
185
|
-
|
|
194
|
+
const sentRow = step ? auditRows.findLast((r) => r.step === step.emits && r.verdict === 'green') : undefined;
|
|
195
|
+
if (!step || !sentRow) continue; // eslint-disable-line no-continue
|
|
196
|
+
// M15 item 4: a send since M15 wrote `<emits>.md` and recorded that file's own sha256 on its green audit row; an older send wrote the JSON, bound to the accept's hash
|
|
197
|
+
const plain = isStr(sentRow.sentSha256) && sentRow.sentSha256 !== '';
|
|
198
|
+
const name = `${flow}-${runId}-${step.emits}.${plain ? 'md' : 'json'}`;
|
|
186
199
|
const dest = checkSendDestination(`${send.target.kind}:${send.target.path}`, { root, runDir });
|
|
187
200
|
const [askId] = (step.reads ?? []).filter((id) => askEmits.has(id));
|
|
188
201
|
out.push({
|
|
189
202
|
path: join(dest.ok ? dest.dir : send.target.path, name), dir: dest.ok ? dest.dir : null, name,
|
|
190
|
-
sha256: hashes.ok && askId !== undefined ? (hashes.byEmits.get(askId) ?? null) : null,
|
|
203
|
+
sha256: plain ? sentRow.sentSha256 : (hashes.ok && askId !== undefined ? (hashes.byEmits.get(askId) ?? null) : null),
|
|
191
204
|
});
|
|
192
205
|
}
|
|
193
206
|
return out;
|
|
@@ -242,6 +255,14 @@ export function buildResult({
|
|
|
242
255
|
checks: checksOfLine((declaration?.steps ?? []).filter((st) => st.fromLine === l.n), diary),
|
|
243
256
|
sheet: sheetBlocks.find((b) => b.line === l.n) ?? null,
|
|
244
257
|
};
|
|
258
|
+
// M15 item 2: a line whose step wrote text (no facts) shows that text, from the step's own artifact (`{text}`); a sheet line keeps its block
|
|
259
|
+
if (!c && out.sheet === null) {
|
|
260
|
+
const written = (declaration?.steps ?? []).filter((st) => st.fromLine === l.n).map((st) => {
|
|
261
|
+
const a = readArtifactResult(runDir, st.emits);
|
|
262
|
+
return a.ok && isStr(a.value?.text) && a.value.text !== '' ? a.value.text : null;
|
|
263
|
+
}).filter((x) => x !== null);
|
|
264
|
+
if (written.length > 0) out.answer = written.join('\n\n');
|
|
265
|
+
}
|
|
245
266
|
if (c) {
|
|
246
267
|
out.source = c.source;
|
|
247
268
|
out.page = urls.get(c.source) ?? null;
|
package/src/panel/server.js
CHANGED
|
@@ -644,7 +644,8 @@ export function handleRequest(req, res, opts) {
|
|
|
644
644
|
res.writeHead(200, {
|
|
645
645
|
'content-type': `${got.type}; charset=utf-8`,
|
|
646
646
|
'content-length': got.buf.length,
|
|
647
|
-
|
|
647
|
+
// M15 item 5: `?view=1` (the top card's file link) opens the saved file in the tab; its type is text/plain or a download type, nosniff stays
|
|
648
|
+
'content-disposition': `${url.searchParams.get('view') === '1' && /^(text\/plain|text\/csv|application\/json)$/.test(got.type) ? 'inline' : 'attachment'}; filename="${plain}"; filename*=UTF-8''${encodeURIComponent(got.name)}`,
|
|
648
649
|
'x-content-type-options': 'nosniff',
|
|
649
650
|
});
|
|
650
651
|
if (method === 'HEAD') res.end(); else res.end(got.buf);
|