fwdloop 0.32.0 → 0.34.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.
Files changed (114) hide show
  1. package/bin/fwdloop +20 -2
  2. package/package.json +2 -2
  3. package/src/auditchecks.js +55 -0
  4. package/src/authoring.js +53 -12
  5. package/src/blockasks.js +45 -0
  6. package/src/blockassemble.js +159 -0
  7. package/src/blockdraft.js +86 -0
  8. package/src/blocklines.js +30 -0
  9. package/src/blockpick.js +175 -0
  10. package/src/cardlist.js +19 -0
  11. package/src/checkblock.js +843 -0
  12. package/src/checked.js +48 -9
  13. package/src/checklist.js +99 -0
  14. package/src/checklistsign.js +93 -0
  15. package/src/checkpick.js +7 -73
  16. package/src/checkwords.js +20 -1
  17. package/src/cited-record.js +21 -1
  18. package/src/citedcheck.js +162 -7
  19. package/src/closers.js +41 -3
  20. package/src/declaration.js +34 -9
  21. package/src/declaredclose.js +4 -0
  22. package/src/draft-steps.js +3 -1
  23. package/src/drafter.js +311 -206
  24. package/src/factwords.js +112 -0
  25. package/src/inputlook.js +53 -0
  26. package/src/labelscan.js +162 -0
  27. package/src/noteask.js +62 -0
  28. package/src/pageask.js +9 -69
  29. package/src/pagedropwords.js +11 -1
  30. package/src/pagedry.js +27 -4
  31. package/src/pagerules.js +19 -3
  32. package/src/panel/author.js +76 -7
  33. package/src/panel/authorcard.js +43 -17
  34. package/src/panel/data.js +41 -9
  35. package/src/panel/index.html +208 -13
  36. package/src/panel/result.js +4 -3
  37. package/src/panel/server.js +3 -1
  38. package/src/pickrecord.js +70 -54
  39. package/src/placerule.js +398 -0
  40. package/src/planrebuild.js +216 -0
  41. package/src/rowedit.js +148 -0
  42. package/src/rubricstep.js +272 -0
  43. package/src/runfile.js +4 -2
  44. package/src/runner.js +67 -10
  45. package/src/setup.js +11 -5
  46. package/src/sheetblock.js +22 -8
  47. package/src/sheetbuild.js +151 -0
  48. package/src/sheetchecks.js +52 -66
  49. package/src/sheetclaims.js +12 -32
  50. package/src/sheetfind.js +4 -4
  51. package/src/sheetlook.js +14 -3
  52. package/src/sheetoffer.js +74 -57
  53. package/src/sheetrows.js +123 -0
  54. package/src/sheetrun.js +13 -10
  55. package/src/summary-words.js +3 -3
  56. package/src/ticket-draft.js +4 -21
  57. package/src/ticketrows.js +100 -0
  58. package/src/try-checks.js +31 -12
  59. package/src/types.js +1 -0
  60. package/types/auditchecks.d.ts +25 -0
  61. package/types/authoring.d.ts +21 -2
  62. package/types/blockasks.d.ts +36 -0
  63. package/types/blockassemble.d.ts +50 -0
  64. package/types/blockdraft.d.ts +75 -0
  65. package/types/blocklines.d.ts +31 -0
  66. package/types/blockpick.d.ts +46 -0
  67. package/types/cardlist.d.ts +21 -0
  68. package/types/checkblock.d.ts +378 -0
  69. package/types/checked.d.ts +16 -2
  70. package/types/checklist.d.ts +115 -0
  71. package/types/checklistsign.d.ts +27 -0
  72. package/types/checkpick.d.ts +4 -34
  73. package/types/checkwords.d.ts +5 -0
  74. package/types/cited-record.d.ts +9 -0
  75. package/types/citedcheck.d.ts +33 -2
  76. package/types/closers.d.ts +24 -2
  77. package/types/declaration.d.ts +7 -0
  78. package/types/declaredclose.d.ts +2 -0
  79. package/types/drafter.d.ts +29 -715
  80. package/types/factwords.d.ts +38 -0
  81. package/types/inputlook.d.ts +49 -0
  82. package/types/labelscan.d.ts +35 -0
  83. package/types/noteask.d.ts +52 -0
  84. package/types/pageask.d.ts +2 -35
  85. package/types/pagedry.d.ts +13 -0
  86. package/types/pagerules.d.ts +7 -0
  87. package/types/panel/author.d.ts +41 -0
  88. package/types/panel/authorcard.d.ts +14 -9
  89. package/types/panel/authorflows.d.ts +4 -4
  90. package/types/panel/data.d.ts +5 -3
  91. package/types/panel/jobgrid.d.ts +1 -1
  92. package/types/pickrecord.d.ts +69 -13
  93. package/types/placerule.d.ts +208 -0
  94. package/types/planrebuild.d.ts +52 -0
  95. package/types/provider.d.ts +1 -1
  96. package/types/rowedit.d.ts +48 -0
  97. package/types/rubricstep.d.ts +63 -0
  98. package/types/runfile.d.ts +5 -2
  99. package/types/runner.d.ts +45 -1
  100. package/types/sheetblock.d.ts +12 -4
  101. package/types/sheetbuild.d.ts +84 -0
  102. package/types/sheetchecks.d.ts +12 -18
  103. package/types/sheetclaims.d.ts +2 -1
  104. package/types/sheetfind.d.ts +2 -2
  105. package/types/sheetoffer.d.ts +31 -6
  106. package/types/sheetrows.d.ts +81 -0
  107. package/types/sheetrun.d.ts +4 -4
  108. package/types/summary-words.d.ts +2 -1
  109. package/types/ticket-draft.d.ts +3 -49
  110. package/types/ticketrows.d.ts +61 -0
  111. package/types/try-checks.d.ts +4 -2
  112. package/types/types.d.ts +8 -0
  113. package/src/repairs.js +0 -38
  114. package/types/repairs.d.ts +0 -13
@@ -1,13 +1,10 @@
1
1
  /**
2
- * The forced tool's parameter schema. `menu` = wiredMenu(). `sheets` (M10b piece 3, optional) = the drafting copy's table of each CSV input role: with it a step may carry
3
- * `close.sheet`, and every column a check names is an enum of that sheet's exact header (src/sheetoffer.js); without it (no CSV input) no sheet property exists.
2
+ * The forced tool's parameter schema. `menu` = wiredMenu(). M17 am2: the AI is offered no `close.sheet` (it suggests sheet checks on the row-edit reply, src/rowedit.js; code builds them, src/sheetbuild.js).
4
3
  * M13 piece 4: `ticket` = `{flowType, tools}` for MCP (generic) and Tickets; then a step may carry `mcpTools` (an enum of the job's tools) and, for Tickets, the tool carries `ticketFilter` and `ticketWatch` (src/ticket-draft.js). The job's `mcp` block and `flowType` are set by code, never offered.
5
- * @param {any[]} menu @param {{sheets?: Record<string, {header: string[]}>, ticket?: {flowType: 'mcp'|'tickets', tools: string[]}}} [o]
4
+ * M16 item 5: the AI is offered no `close.cited` (the list owns the facts; code builds them from its rows).
5
+ * @param {any[]} menu @param {{ticket?: {flowType: 'mcp'|'tickets', tools: string[]}}} [o]
6
6
  */
7
- export function buildDeclarationSchema(menu: any[], { sheets, ticket }?: {
8
- sheets?: Record<string, {
9
- header: string[];
10
- }>;
7
+ export function buildDeclarationSchema(menu: any[], { ticket }?: {
11
8
  ticket?: {
12
9
  flowType: "mcp" | "tickets";
13
10
  tools: string[];
@@ -23,225 +20,6 @@ export function buildDeclarationSchema(menu: any[], { sheets, ticket }?: {
23
20
  };
24
21
  description: string;
25
22
  };
26
- unjudgeable: {
27
- type: string;
28
- additionalProperties: {
29
- type: string;
30
- };
31
- description: string;
32
- };
33
- refused: {
34
- type: string;
35
- items: {
36
- type: string;
37
- properties: {
38
- line: {
39
- type: string;
40
- };
41
- reason: {
42
- type: string;
43
- minLength: number;
44
- };
45
- };
46
- required: string[];
47
- additionalProperties: boolean;
48
- };
49
- description: string;
50
- };
51
- ticketFilter?: undefined;
52
- ticketWatch?: undefined;
53
- steps: {
54
- type: string;
55
- minItems: number;
56
- items: {
57
- type: string;
58
- properties: {
59
- reads: {
60
- type: string;
61
- items: {
62
- type: string;
63
- };
64
- description: string;
65
- };
66
- emits: {
67
- type: string;
68
- minLength: number;
69
- description: string;
70
- };
71
- fromLine: {
72
- type: string[];
73
- description: string;
74
- };
75
- picks: {
76
- type: string;
77
- additionalProperties: {
78
- type: string;
79
- items: {
80
- type: string;
81
- };
82
- };
83
- description: string;
84
- };
85
- close: {
86
- type: string;
87
- properties: {
88
- sheet?: Record<string, any> | undefined;
89
- class: {
90
- type: string;
91
- enum: string[];
92
- description: string;
93
- };
94
- cited: Readonly<{
95
- type: "object";
96
- description: "only on a green step that checks quotes from a web page or a document input: the facts every result must hold. Omit on any other step";
97
- properties: {
98
- source: {
99
- type: string;
100
- description: string;
101
- };
102
- facts: {
103
- type: string;
104
- minItems: number;
105
- maxItems: number;
106
- description: string;
107
- items: {
108
- type: string;
109
- properties: {
110
- name: {
111
- type: string;
112
- description: string;
113
- };
114
- shape: {
115
- type: string;
116
- enum: string[];
117
- };
118
- unit: {
119
- type: string[];
120
- items: {
121
- type: string;
122
- };
123
- description: string;
124
- };
125
- currency: {
126
- type: string[];
127
- items: {
128
- type: string;
129
- };
130
- description: string;
131
- };
132
- phrase: {
133
- type: string;
134
- description: string;
135
- };
136
- anchor: {
137
- type: string;
138
- description: string;
139
- };
140
- until: {
141
- type: string;
142
- description: string;
143
- };
144
- rule: {
145
- type: string;
146
- description: string;
147
- properties: {
148
- op: {
149
- type: string;
150
- enum: string[];
151
- };
152
- value: {};
153
- lo: {};
154
- hi: {};
155
- };
156
- required: string[];
157
- additionalProperties: boolean;
158
- };
159
- };
160
- required: string[];
161
- additionalProperties: boolean;
162
- };
163
- };
164
- count: {
165
- type: string;
166
- description: string;
167
- properties: {
168
- min: {
169
- type: string;
170
- minimum: number;
171
- };
172
- max: {
173
- type: string;
174
- minimum: number;
175
- };
176
- };
177
- additionalProperties: boolean;
178
- };
179
- };
180
- required: string[];
181
- additionalProperties: false;
182
- }>;
183
- columns: Readonly<{
184
- type: "array";
185
- minItems: 1;
186
- maxItems: 10;
187
- description: "only on a green step that reads a CSV input: the exact column names (the sheet's header) its values come from. Omit on any other step";
188
- items: {
189
- type: string;
190
- properties: {
191
- source: {
192
- type: string;
193
- description: string;
194
- };
195
- column: {
196
- type: string;
197
- description: string;
198
- };
199
- };
200
- required: string[];
201
- additionalProperties: boolean;
202
- };
203
- }>;
204
- };
205
- required: string[];
206
- additionalProperties: boolean;
207
- };
208
- mcpTools?: {
209
- type: string;
210
- items: {
211
- type: string;
212
- enum: string[];
213
- };
214
- description: string;
215
- } | undefined;
216
- primitives: {
217
- type: string;
218
- items: {
219
- type: string;
220
- enum: any[];
221
- };
222
- description: string;
223
- };
224
- };
225
- required: string[];
226
- additionalProperties: boolean;
227
- };
228
- };
229
- } | {
230
- guardrailClasses: {
231
- type: string;
232
- additionalProperties: {
233
- type: string;
234
- enum: string[];
235
- };
236
- description: string;
237
- };
238
- unjudgeable: {
239
- type: string;
240
- additionalProperties: {
241
- type: string;
242
- };
243
- description: string;
244
- };
245
23
  refused: {
246
24
  type: string;
247
25
  items: {
@@ -260,36 +38,6 @@ export function buildDeclarationSchema(menu: any[], { sheets, ticket }?: {
260
38
  };
261
39
  description: string;
262
40
  };
263
- ticketFilter: {
264
- type: string;
265
- properties: {
266
- priority: {
267
- type: string;
268
- items: {
269
- type: string;
270
- enum: string[];
271
- };
272
- description: string;
273
- };
274
- labels: {
275
- type: string;
276
- items: {
277
- type: string;
278
- };
279
- description: string;
280
- };
281
- };
282
- additionalProperties: boolean;
283
- description: string;
284
- };
285
- ticketWatch: {
286
- type: string;
287
- items: {
288
- type: string;
289
- enum: string[];
290
- };
291
- description: string;
292
- };
293
41
  steps: {
294
42
  type: string;
295
43
  minItems: number;
@@ -325,101 +73,11 @@ export function buildDeclarationSchema(menu: any[], { sheets, ticket }?: {
325
73
  close: {
326
74
  type: string;
327
75
  properties: {
328
- sheet?: Record<string, any> | undefined;
329
76
  class: {
330
77
  type: string;
331
78
  enum: string[];
332
79
  description: string;
333
80
  };
334
- cited: Readonly<{
335
- type: "object";
336
- description: "only on a green step that checks quotes from a web page or a document input: the facts every result must hold. Omit on any other step";
337
- properties: {
338
- source: {
339
- type: string;
340
- description: string;
341
- };
342
- facts: {
343
- type: string;
344
- minItems: number;
345
- maxItems: number;
346
- description: string;
347
- items: {
348
- type: string;
349
- properties: {
350
- name: {
351
- type: string;
352
- description: string;
353
- };
354
- shape: {
355
- type: string;
356
- enum: string[];
357
- };
358
- unit: {
359
- type: string[];
360
- items: {
361
- type: string;
362
- };
363
- description: string;
364
- };
365
- currency: {
366
- type: string[];
367
- items: {
368
- type: string;
369
- };
370
- description: string;
371
- };
372
- phrase: {
373
- type: string;
374
- description: string;
375
- };
376
- anchor: {
377
- type: string;
378
- description: string;
379
- };
380
- until: {
381
- type: string;
382
- description: string;
383
- };
384
- rule: {
385
- type: string;
386
- description: string;
387
- properties: {
388
- op: {
389
- type: string;
390
- enum: string[];
391
- };
392
- value: {};
393
- lo: {};
394
- hi: {};
395
- };
396
- required: string[];
397
- additionalProperties: boolean;
398
- };
399
- };
400
- required: string[];
401
- additionalProperties: boolean;
402
- };
403
- };
404
- count: {
405
- type: string;
406
- description: string;
407
- properties: {
408
- min: {
409
- type: string;
410
- minimum: number;
411
- };
412
- max: {
413
- type: string;
414
- minimum: number;
415
- };
416
- };
417
- additionalProperties: boolean;
418
- };
419
- };
420
- required: string[];
421
- additionalProperties: false;
422
- }>;
423
81
  columns: Readonly<{
424
82
  type: "array";
425
83
  minItems: 1;
@@ -470,245 +128,16 @@ export function buildDeclarationSchema(menu: any[], { sheets, ticket }?: {
470
128
  required: string[];
471
129
  additionalProperties: boolean;
472
130
  };
473
- /** The declaration schema plus the optional `notChecked` (every try) and, on try 3 only, `questions`. Neither is in `required`. */
474
- /** @param {any[]} menu @param {{questions?: boolean, sheets?: Record<string, {header: string[]}>|undefined, ticket?: {flowType: 'mcp'|'tickets', tools: string[]}}} [o] */
475
- export function buildRoundSchema(menu: any[], { questions, sheets, ticket }?: {
131
+ /** The declaration schema plus, on try 3 only, `questions` (not in `required`). */
132
+ /** @param {any[]} menu @param {{questions?: boolean, ticket?: {flowType: 'mcp'|'tickets', tools: string[]}}} [o] */
133
+ export function buildRoundSchema(menu: any[], { questions, ticket }?: {
476
134
  questions?: boolean;
477
- sheets?: Record<string, {
478
- header: string[];
479
- }> | undefined;
480
135
  ticket?: {
481
136
  flowType: "mcp" | "tickets";
482
137
  tools: string[];
483
138
  };
484
139
  }): {
485
140
  properties: {
486
- notChecked: {
487
- type: string;
488
- items: {
489
- type: string;
490
- };
491
- description: string;
492
- };
493
- guardrailClasses: {
494
- type: string;
495
- additionalProperties: {
496
- type: string;
497
- enum: string[];
498
- };
499
- description: string;
500
- };
501
- unjudgeable: {
502
- type: string;
503
- additionalProperties: {
504
- type: string;
505
- };
506
- description: string;
507
- };
508
- refused: {
509
- type: string;
510
- items: {
511
- type: string;
512
- properties: {
513
- line: {
514
- type: string;
515
- };
516
- reason: {
517
- type: string;
518
- minLength: number;
519
- };
520
- };
521
- required: string[];
522
- additionalProperties: boolean;
523
- };
524
- description: string;
525
- };
526
- ticketFilter?: undefined;
527
- ticketWatch?: undefined;
528
- steps: {
529
- type: string;
530
- minItems: number;
531
- items: {
532
- type: string;
533
- properties: {
534
- reads: {
535
- type: string;
536
- items: {
537
- type: string;
538
- };
539
- description: string;
540
- };
541
- emits: {
542
- type: string;
543
- minLength: number;
544
- description: string;
545
- };
546
- fromLine: {
547
- type: string[];
548
- description: string;
549
- };
550
- picks: {
551
- type: string;
552
- additionalProperties: {
553
- type: string;
554
- items: {
555
- type: string;
556
- };
557
- };
558
- description: string;
559
- };
560
- close: {
561
- type: string;
562
- properties: {
563
- sheet?: Record<string, any> | undefined;
564
- class: {
565
- type: string;
566
- enum: string[];
567
- description: string;
568
- };
569
- cited: Readonly<{
570
- type: "object";
571
- description: "only on a green step that checks quotes from a web page or a document input: the facts every result must hold. Omit on any other step";
572
- properties: {
573
- source: {
574
- type: string;
575
- description: string;
576
- };
577
- facts: {
578
- type: string;
579
- minItems: number;
580
- maxItems: number;
581
- description: string;
582
- items: {
583
- type: string;
584
- properties: {
585
- name: {
586
- type: string;
587
- description: string;
588
- };
589
- shape: {
590
- type: string;
591
- enum: string[];
592
- };
593
- unit: {
594
- type: string[];
595
- items: {
596
- type: string;
597
- };
598
- description: string;
599
- };
600
- currency: {
601
- type: string[];
602
- items: {
603
- type: string;
604
- };
605
- description: string;
606
- };
607
- phrase: {
608
- type: string;
609
- description: string;
610
- };
611
- anchor: {
612
- type: string;
613
- description: string;
614
- };
615
- until: {
616
- type: string;
617
- description: string;
618
- };
619
- rule: {
620
- type: string;
621
- description: string;
622
- properties: {
623
- op: {
624
- type: string;
625
- enum: string[];
626
- };
627
- value: {};
628
- lo: {};
629
- hi: {};
630
- };
631
- required: string[];
632
- additionalProperties: boolean;
633
- };
634
- };
635
- required: string[];
636
- additionalProperties: boolean;
637
- };
638
- };
639
- count: {
640
- type: string;
641
- description: string;
642
- properties: {
643
- min: {
644
- type: string;
645
- minimum: number;
646
- };
647
- max: {
648
- type: string;
649
- minimum: number;
650
- };
651
- };
652
- additionalProperties: boolean;
653
- };
654
- };
655
- required: string[];
656
- additionalProperties: false;
657
- }>;
658
- columns: Readonly<{
659
- type: "array";
660
- minItems: 1;
661
- maxItems: 10;
662
- description: "only on a green step that reads a CSV input: the exact column names (the sheet's header) its values come from. Omit on any other step";
663
- items: {
664
- type: string;
665
- properties: {
666
- source: {
667
- type: string;
668
- description: string;
669
- };
670
- column: {
671
- type: string;
672
- description: string;
673
- };
674
- };
675
- required: string[];
676
- additionalProperties: boolean;
677
- };
678
- }>;
679
- };
680
- required: string[];
681
- additionalProperties: boolean;
682
- };
683
- mcpTools?: {
684
- type: string;
685
- items: {
686
- type: string;
687
- enum: string[];
688
- };
689
- description: string;
690
- } | undefined;
691
- primitives: {
692
- type: string;
693
- items: {
694
- type: string;
695
- enum: any[];
696
- };
697
- description: string;
698
- };
699
- };
700
- required: string[];
701
- additionalProperties: boolean;
702
- };
703
- };
704
- } | {
705
- notChecked: {
706
- type: string;
707
- items: {
708
- type: string;
709
- };
710
- description: string;
711
- };
712
141
  guardrailClasses: {
713
142
  type: string;
714
143
  additionalProperties: {
@@ -717,13 +146,6 @@ export function buildRoundSchema(menu: any[], { questions, sheets, ticket }?: {
717
146
  };
718
147
  description: string;
719
148
  };
720
- unjudgeable: {
721
- type: string;
722
- additionalProperties: {
723
- type: string;
724
- };
725
- description: string;
726
- };
727
149
  refused: {
728
150
  type: string;
729
151
  items: {
@@ -742,36 +164,6 @@ export function buildRoundSchema(menu: any[], { questions, sheets, ticket }?: {
742
164
  };
743
165
  description: string;
744
166
  };
745
- ticketFilter: {
746
- type: string;
747
- properties: {
748
- priority: {
749
- type: string;
750
- items: {
751
- type: string;
752
- enum: string[];
753
- };
754
- description: string;
755
- };
756
- labels: {
757
- type: string;
758
- items: {
759
- type: string;
760
- };
761
- description: string;
762
- };
763
- };
764
- additionalProperties: boolean;
765
- description: string;
766
- };
767
- ticketWatch: {
768
- type: string;
769
- items: {
770
- type: string;
771
- enum: string[];
772
- };
773
- description: string;
774
- };
775
167
  steps: {
776
168
  type: string;
777
169
  minItems: number;
@@ -807,101 +199,11 @@ export function buildRoundSchema(menu: any[], { questions, sheets, ticket }?: {
807
199
  close: {
808
200
  type: string;
809
201
  properties: {
810
- sheet?: Record<string, any> | undefined;
811
202
  class: {
812
203
  type: string;
813
204
  enum: string[];
814
205
  description: string;
815
206
  };
816
- cited: Readonly<{
817
- type: "object";
818
- description: "only on a green step that checks quotes from a web page or a document input: the facts every result must hold. Omit on any other step";
819
- properties: {
820
- source: {
821
- type: string;
822
- description: string;
823
- };
824
- facts: {
825
- type: string;
826
- minItems: number;
827
- maxItems: number;
828
- description: string;
829
- items: {
830
- type: string;
831
- properties: {
832
- name: {
833
- type: string;
834
- description: string;
835
- };
836
- shape: {
837
- type: string;
838
- enum: string[];
839
- };
840
- unit: {
841
- type: string[];
842
- items: {
843
- type: string;
844
- };
845
- description: string;
846
- };
847
- currency: {
848
- type: string[];
849
- items: {
850
- type: string;
851
- };
852
- description: string;
853
- };
854
- phrase: {
855
- type: string;
856
- description: string;
857
- };
858
- anchor: {
859
- type: string;
860
- description: string;
861
- };
862
- until: {
863
- type: string;
864
- description: string;
865
- };
866
- rule: {
867
- type: string;
868
- description: string;
869
- properties: {
870
- op: {
871
- type: string;
872
- enum: string[];
873
- };
874
- value: {};
875
- lo: {};
876
- hi: {};
877
- };
878
- required: string[];
879
- additionalProperties: boolean;
880
- };
881
- };
882
- required: string[];
883
- additionalProperties: boolean;
884
- };
885
- };
886
- count: {
887
- type: string;
888
- description: string;
889
- properties: {
890
- min: {
891
- type: string;
892
- minimum: number;
893
- };
894
- max: {
895
- type: string;
896
- minimum: number;
897
- };
898
- };
899
- additionalProperties: boolean;
900
- };
901
- };
902
- required: string[];
903
- additionalProperties: false;
904
- }>;
905
207
  columns: Readonly<{
906
208
  type: "array";
907
209
  minItems: 1;
@@ -969,13 +271,13 @@ export function normalizeQuestions(raw: any, failedLines: any): {
969
271
  };
970
272
  /**
971
273
  * The job lines as the page look may see them (no count rule), and `toOriginal`, which takes a look fact's / dropped entry's visible rule number back to the guardrail's own number.
972
- * @param {{n: number, text: string, rule?: string}[]} jobLines
274
+ * @param {{n: number, text: string, rule?: string}[]} jobLines @param {Set<number>} [shown] lines whose count rules the look may see (M16: the block's lines)
973
275
  */
974
276
  export function hideCounts(jobLines: {
975
277
  n: number;
976
278
  text: string;
977
279
  rule?: string;
978
- }[]): {
280
+ }[], shown?: Set<number>): {
979
281
  seenLines: {
980
282
  rule?: string | undefined;
981
283
  n: number;
@@ -983,11 +285,12 @@ export function hideCounts(jobLines: {
983
285
  }[];
984
286
  toOriginal: (f: any) => any;
985
287
  };
986
- export function buildSystemPrompt({ menu, lines, arbiter, factsInfo }: {
288
+ export function buildSystemPrompt({ menu, lines, arbiter, factsInfo, blockLines }: {
987
289
  menu: any;
988
290
  lines: any;
989
291
  arbiter: any;
990
292
  factsInfo: any;
293
+ blockLines?: Set<number> | undefined;
991
294
  }): string;
992
295
  /**
993
296
  * A step's goal = its signed line's text, exactly as parseSignedText's `lines` gives it: the words after
@@ -1008,11 +311,11 @@ export function goalForLine(fromLine: any, lines: any): any;
1008
311
  * @returns {Promise<{ok:boolean, declaration:object|null, reds:string[], rounds:number, calls:number, spendComplete:boolean,
1009
312
  * costUsd:number|null, modelReturned:string|null, modelId?:string, price?:object|null, tokens?:object|null, structureRetries:number, revisions:number, stop:string|null, log:object[],
1010
313
  * questions?:{line:number, question:string}[], droppedQuestions?:object[], notChecked?:string[], thinking?:{asked:string, status:string|null, say:string|null}, inputs?:{role:string, detail:string}[],
1011
- * look?:{facts:any[], dropped:any[]}, pageLooks?:{role:string, address:string, sha256:string, bytes:number, frozen:string, attempts:number, mapping:any}[], sheetLooks?:any[]}>}
314
+ * checkCard?:ReturnType<typeof cardOfBlock>, notCheckedBy?:Record<string,'you'|'agent'|'default'>, look?:{facts:any[], dropped:any[]}, pageLooks?:{role:string, address:string, sha256:string, bytes:number, frozen:string, attempts:number, mapping:any}[], sheetLooks?:any[]}>}
1012
315
  * `learnHints` (M8 item 5a): the earlier runs' notes block (src/learnstore.js hintsForRun), appended to the drafter's system prompt; null = nothing.
1013
316
  * `look` / `pageLooks` (M10 item 3) are there when the job signs a web page: the kept facts (with their `reading`, the input a later ask reads), every drop, and per page its address, sha256 and the AI's map. Each drop is also a line in `notChecked`.
1014
317
  */
1015
- export function draft({ proseText, slot, model, provider: injected, rates: injectedRates, modelId: injectedModelId, env, priorSpend, skills, makeProviderFn, onBook, offerQuestions, draftThinking, draftDir, fetchPage, leftRules, checkPicks, carriedPicks, onPickRecord, learnHints, mcpServers, flowType, mcp, }: {
318
+ export function draft({ proseText, slot, model, provider: injected, rates: injectedRates, modelId: injectedModelId, env, priorSpend, skills, makeProviderFn, onBook, offerQuestions, draftThinking, draftDir, fetchPage, leftRules, columnAnswers, carriedColumns, onColumns, checkPicks, carriedPicks, carriedChoices, carriedSheetDropped, onSheetDropped, onChoices, onPickRecord, learnHints, mcpServers, flowType, mcp, }: {
1016
319
  proseText: any;
1017
320
  slot: any;
1018
321
  model: any;
@@ -1032,8 +335,19 @@ export function draft({ proseText, slot, model, provider: injected, rates: injec
1032
335
  line: number;
1033
336
  rule: number;
1034
337
  }[] | undefined;
338
+ columnAnswers?: {
339
+ line: number;
340
+ word: string;
341
+ column: string;
342
+ }[] | undefined;
343
+ carriedColumns?: any[] | undefined;
344
+ onColumns?: ((rec: any[]) => void) | undefined;
1035
345
  checkPicks?: import("./checkpick.js").Pick[] | undefined;
1036
346
  carriedPicks?: import("./pickrecord.js").Entry[] | undefined;
347
+ carriedChoices?: any[] | null | undefined;
348
+ carriedSheetDropped?: any[] | undefined;
349
+ onSheetDropped?: ((rec: any[]) => void) | undefined;
350
+ onChoices?: ((rec: any[]) => void) | undefined;
1037
351
  onPickRecord?: ((r: {
1038
352
  picks: import("./pickrecord.js").Entry[];
1039
353
  kept: {
@@ -1048,7 +362,7 @@ export function draft({ proseText, slot, model, provider: injected, rates: injec
1048
362
  ids: string[];
1049
363
  } | null | undefined;
1050
364
  mcpServers?: string[] | undefined;
1051
- flowType?: "mcp" | "plain" | "tickets" | undefined;
365
+ flowType?: "tickets" | "mcp" | "plain" | undefined;
1052
366
  mcp?: any;
1053
367
  }): Promise<{
1054
368
  ok: boolean;
@@ -1081,6 +395,8 @@ export function draft({ proseText, slot, model, provider: injected, rates: injec
1081
395
  role: string;
1082
396
  detail: string;
1083
397
  }[];
398
+ checkCard?: ReturnType<typeof cardOfBlock>;
399
+ notCheckedBy?: Record<string, "you" | "agent" | "default">;
1084
400
  look?: {
1085
401
  facts: any[];
1086
402
  dropped: any[];
@@ -1103,11 +419,9 @@ export const DRAFT_SKILLS: readonly string[];
1103
419
  export const CLASSES: readonly string[];
1104
420
  /** The whole-output-ceiling rule, told once to the drafter (schema and prompt use this string). Amendment 29; no number words (am25). */
1105
421
  export const WHOLE_OUTPUT_CEILING_RULE: "use the guardrail's ceiling for the whole output";
422
+ export function docRolesOf(sources: any[] | undefined): string[];
1106
423
  export const MAX_QUESTIONS: 2;
1107
- /** What fwdloop's typed checks can really check (bareloop F174: give the model the real list, or "Not checked" is invented). */
1108
- export const CHECKABLE: readonly string[];
1109
- /** Offered on EVERY try (it is information, not asking). */
1110
- export const NOTCHECKED_PROMPT: string;
1111
424
  /** Try 3 only, and only after tries 1 and 2 both failed validation. No digit and no number word anywhere (a test greps this): the machine, not the prompt, bounds the count. */
1112
425
  export const QUESTIONS_PROMPT: string;
1113
426
  import { makeProvider } from './provider.js';
427
+ import { cardOfBlock } from './cardlist.js';