fwdloop 0.33.0 → 0.35.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 +14 -0
- package/bin/fwdloop +18 -2
- package/package.json +1 -1
- package/src/action-line.js +100 -0
- package/src/action-stop.js +44 -0
- package/src/ask.js +9 -2
- package/src/auditchecks.js +6 -4
- package/src/authoring.js +28 -14
- package/src/blockasks.js +3 -2
- package/src/blockassemble.js +40 -21
- package/src/blockdraft.js +8 -13
- package/src/blockpick.js +11 -1
- package/src/checkblock.js +102 -58
- package/src/checked.js +7 -2
- package/src/checklist.js +1 -3
- package/src/checklistsign.js +1 -1
- package/src/checkpick.js +7 -73
- package/src/declaration.js +20 -35
- package/src/drafter.js +281 -208
- package/src/jobkey.js +2 -3
- package/src/noteask.js +62 -0
- package/src/pageask.js +24 -69
- package/src/pagedry.js +27 -4
- package/src/pagemap.js +8 -2
- package/src/pagerules.js +19 -3
- package/src/panel/author.js +63 -36
- package/src/panel/authorcard.js +36 -20
- package/src/panel/data.js +5 -1
- package/src/panel/index.html +66 -37
- package/src/pickrecord.js +42 -54
- package/src/planrebuild.js +16 -6
- package/src/rowedit.js +35 -5
- package/src/rubricstep.js +9 -1
- package/src/runner.js +87 -41
- package/src/runvalues.js +9 -1
- package/src/setup.js +3 -1
- package/src/sheetblock.js +17 -7
- package/src/sheetbuild.js +148 -0
- package/src/sheetchecks.js +3 -2
- package/src/sheetfind.js +4 -4
- package/src/sheetlook.js +15 -4
- package/src/sheetoffer.js +50 -5
- package/src/sheetrows.js +18 -2
- package/src/signed-text.js +1 -5
- package/src/ticket-draft.js +4 -21
- package/src/ticketrows.js +100 -0
- package/src/whole-job.js +27 -11
- package/types/action-line.d.ts +71 -0
- package/types/action-stop.d.ts +36 -0
- package/types/ask.d.ts +3 -2
- package/types/auditchecks.d.ts +2 -1
- package/types/authoring.d.ts +8 -3
- package/types/blockasks.d.ts +1 -2
- package/types/blockassemble.d.ts +20 -3
- package/types/blockdraft.d.ts +4 -12
- package/types/blockpick.d.ts +5 -0
- package/types/checkblock.d.ts +33 -17
- package/types/checked.d.ts +2 -0
- package/types/checklist.d.ts +3 -5
- package/types/checkpick.d.ts +4 -34
- package/types/declaration.d.ts +7 -0
- package/types/drafter.d.ts +23 -356
- package/types/noteask.d.ts +52 -0
- package/types/pageask.d.ts +12 -36
- package/types/pagedry.d.ts +13 -0
- package/types/pagerules.d.ts +7 -0
- package/types/panel/author.d.ts +1 -1
- package/types/panel/authorcard.d.ts +13 -8
- package/types/panel/authorflows.d.ts +4 -4
- package/types/panel/data.d.ts +2 -2
- package/types/panel/jobgrid.d.ts +1 -1
- package/types/pickrecord.d.ts +47 -13
- package/types/rowedit.d.ts +16 -1
- package/types/rubricstep.d.ts +3 -0
- package/types/sheetblock.d.ts +11 -4
- package/types/sheetbuild.d.ts +82 -0
- package/types/sheetchecks.d.ts +2 -1
- package/types/sheetfind.d.ts +2 -2
- package/types/sheetoffer.d.ts +26 -1
- package/types/sheetrows.d.ts +8 -0
- package/types/ticket-draft.d.ts +3 -49
- package/types/ticketrows.d.ts +61 -0
- package/types/whole-job.d.ts +3 -3
- package/src/added-end.js +0 -60
- package/src/repairs.js +0 -38
- package/types/added-end.d.ts +0 -62
- package/types/repairs.d.ts +0 -13
package/types/drafter.d.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The forced tool's parameter schema. `menu` = wiredMenu().
|
|
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
4
|
* M16 item 5: the AI is offered no `close.cited` (the list owns the facts; code builds them from its rows).
|
|
6
|
-
* @param {any[]} menu @param {{
|
|
5
|
+
* @param {any[]} menu @param {{ticket?: {flowType: 'mcp'|'tickets', tools: string[]}}} [o]
|
|
7
6
|
*/
|
|
8
|
-
export function buildDeclarationSchema(menu: any[], {
|
|
9
|
-
sheets?: Record<string, {
|
|
10
|
-
header: string[];
|
|
11
|
-
}>;
|
|
7
|
+
export function buildDeclarationSchema(menu: any[], { ticket }?: {
|
|
12
8
|
ticket?: {
|
|
13
9
|
flowType: "mcp" | "tickets";
|
|
14
10
|
tools: string[];
|
|
@@ -24,13 +20,6 @@ export function buildDeclarationSchema(menu: any[], { sheets, ticket }?: {
|
|
|
24
20
|
};
|
|
25
21
|
description: string;
|
|
26
22
|
};
|
|
27
|
-
unjudgeable: {
|
|
28
|
-
type: string;
|
|
29
|
-
additionalProperties: {
|
|
30
|
-
type: string;
|
|
31
|
-
};
|
|
32
|
-
description: string;
|
|
33
|
-
};
|
|
34
23
|
refused: {
|
|
35
24
|
type: string;
|
|
36
25
|
items: {
|
|
@@ -49,8 +38,6 @@ export function buildDeclarationSchema(menu: any[], { sheets, ticket }?: {
|
|
|
49
38
|
};
|
|
50
39
|
description: string;
|
|
51
40
|
};
|
|
52
|
-
ticketFilter?: undefined;
|
|
53
|
-
ticketWatch?: undefined;
|
|
54
41
|
steps: {
|
|
55
42
|
type: string;
|
|
56
43
|
minItems: number;
|
|
@@ -86,158 +73,6 @@ export function buildDeclarationSchema(menu: any[], { sheets, ticket }?: {
|
|
|
86
73
|
close: {
|
|
87
74
|
type: string;
|
|
88
75
|
properties: {
|
|
89
|
-
sheet?: Record<string, any> | undefined;
|
|
90
|
-
class: {
|
|
91
|
-
type: string;
|
|
92
|
-
enum: string[];
|
|
93
|
-
description: string;
|
|
94
|
-
};
|
|
95
|
-
columns: Readonly<{
|
|
96
|
-
type: "array";
|
|
97
|
-
minItems: 1;
|
|
98
|
-
maxItems: 10;
|
|
99
|
-
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";
|
|
100
|
-
items: {
|
|
101
|
-
type: string;
|
|
102
|
-
properties: {
|
|
103
|
-
source: {
|
|
104
|
-
type: string;
|
|
105
|
-
description: string;
|
|
106
|
-
};
|
|
107
|
-
column: {
|
|
108
|
-
type: string;
|
|
109
|
-
description: string;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
required: string[];
|
|
113
|
-
additionalProperties: boolean;
|
|
114
|
-
};
|
|
115
|
-
}>;
|
|
116
|
-
};
|
|
117
|
-
required: string[];
|
|
118
|
-
additionalProperties: boolean;
|
|
119
|
-
};
|
|
120
|
-
mcpTools?: {
|
|
121
|
-
type: string;
|
|
122
|
-
items: {
|
|
123
|
-
type: string;
|
|
124
|
-
enum: string[];
|
|
125
|
-
};
|
|
126
|
-
description: string;
|
|
127
|
-
} | undefined;
|
|
128
|
-
primitives: {
|
|
129
|
-
type: string;
|
|
130
|
-
items: {
|
|
131
|
-
type: string;
|
|
132
|
-
enum: any[];
|
|
133
|
-
};
|
|
134
|
-
description: string;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
required: string[];
|
|
138
|
-
additionalProperties: boolean;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
} | {
|
|
142
|
-
guardrailClasses: {
|
|
143
|
-
type: string;
|
|
144
|
-
additionalProperties: {
|
|
145
|
-
type: string;
|
|
146
|
-
enum: string[];
|
|
147
|
-
};
|
|
148
|
-
description: string;
|
|
149
|
-
};
|
|
150
|
-
unjudgeable: {
|
|
151
|
-
type: string;
|
|
152
|
-
additionalProperties: {
|
|
153
|
-
type: string;
|
|
154
|
-
};
|
|
155
|
-
description: string;
|
|
156
|
-
};
|
|
157
|
-
refused: {
|
|
158
|
-
type: string;
|
|
159
|
-
items: {
|
|
160
|
-
type: string;
|
|
161
|
-
properties: {
|
|
162
|
-
line: {
|
|
163
|
-
type: string;
|
|
164
|
-
};
|
|
165
|
-
reason: {
|
|
166
|
-
type: string;
|
|
167
|
-
minLength: number;
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
required: string[];
|
|
171
|
-
additionalProperties: boolean;
|
|
172
|
-
};
|
|
173
|
-
description: string;
|
|
174
|
-
};
|
|
175
|
-
ticketFilter: {
|
|
176
|
-
type: string;
|
|
177
|
-
properties: {
|
|
178
|
-
priority: {
|
|
179
|
-
type: string;
|
|
180
|
-
items: {
|
|
181
|
-
type: string;
|
|
182
|
-
enum: string[];
|
|
183
|
-
};
|
|
184
|
-
description: string;
|
|
185
|
-
};
|
|
186
|
-
labels: {
|
|
187
|
-
type: string;
|
|
188
|
-
items: {
|
|
189
|
-
type: string;
|
|
190
|
-
};
|
|
191
|
-
description: string;
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
additionalProperties: boolean;
|
|
195
|
-
description: string;
|
|
196
|
-
};
|
|
197
|
-
ticketWatch: {
|
|
198
|
-
type: string;
|
|
199
|
-
items: {
|
|
200
|
-
type: string;
|
|
201
|
-
enum: string[];
|
|
202
|
-
};
|
|
203
|
-
description: string;
|
|
204
|
-
};
|
|
205
|
-
steps: {
|
|
206
|
-
type: string;
|
|
207
|
-
minItems: number;
|
|
208
|
-
items: {
|
|
209
|
-
type: string;
|
|
210
|
-
properties: {
|
|
211
|
-
reads: {
|
|
212
|
-
type: string;
|
|
213
|
-
items: {
|
|
214
|
-
type: string;
|
|
215
|
-
};
|
|
216
|
-
description: string;
|
|
217
|
-
};
|
|
218
|
-
emits: {
|
|
219
|
-
type: string;
|
|
220
|
-
minLength: number;
|
|
221
|
-
description: string;
|
|
222
|
-
};
|
|
223
|
-
fromLine: {
|
|
224
|
-
type: string[];
|
|
225
|
-
description: string;
|
|
226
|
-
};
|
|
227
|
-
picks: {
|
|
228
|
-
type: string;
|
|
229
|
-
additionalProperties: {
|
|
230
|
-
type: string;
|
|
231
|
-
items: {
|
|
232
|
-
type: string;
|
|
233
|
-
};
|
|
234
|
-
};
|
|
235
|
-
description: string;
|
|
236
|
-
};
|
|
237
|
-
close: {
|
|
238
|
-
type: string;
|
|
239
|
-
properties: {
|
|
240
|
-
sheet?: Record<string, any> | undefined;
|
|
241
76
|
class: {
|
|
242
77
|
type: string;
|
|
243
78
|
enum: string[];
|
|
@@ -293,26 +128,16 @@ export function buildDeclarationSchema(menu: any[], { sheets, ticket }?: {
|
|
|
293
128
|
required: string[];
|
|
294
129
|
additionalProperties: boolean;
|
|
295
130
|
};
|
|
296
|
-
/** The declaration schema plus
|
|
297
|
-
/** @param {any[]} menu @param {{questions?: boolean,
|
|
298
|
-
export function buildRoundSchema(menu: any[], { questions,
|
|
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 }?: {
|
|
299
134
|
questions?: boolean;
|
|
300
|
-
sheets?: Record<string, {
|
|
301
|
-
header: string[];
|
|
302
|
-
}> | undefined;
|
|
303
135
|
ticket?: {
|
|
304
136
|
flowType: "mcp" | "tickets";
|
|
305
137
|
tools: string[];
|
|
306
138
|
};
|
|
307
139
|
}): {
|
|
308
140
|
properties: {
|
|
309
|
-
notChecked: {
|
|
310
|
-
type: string;
|
|
311
|
-
items: {
|
|
312
|
-
type: string;
|
|
313
|
-
};
|
|
314
|
-
description: string;
|
|
315
|
-
};
|
|
316
141
|
guardrailClasses: {
|
|
317
142
|
type: string;
|
|
318
143
|
additionalProperties: {
|
|
@@ -321,143 +146,6 @@ export function buildRoundSchema(menu: any[], { questions, sheets, ticket }?: {
|
|
|
321
146
|
};
|
|
322
147
|
description: string;
|
|
323
148
|
};
|
|
324
|
-
unjudgeable: {
|
|
325
|
-
type: string;
|
|
326
|
-
additionalProperties: {
|
|
327
|
-
type: string;
|
|
328
|
-
};
|
|
329
|
-
description: string;
|
|
330
|
-
};
|
|
331
|
-
refused: {
|
|
332
|
-
type: string;
|
|
333
|
-
items: {
|
|
334
|
-
type: string;
|
|
335
|
-
properties: {
|
|
336
|
-
line: {
|
|
337
|
-
type: string;
|
|
338
|
-
};
|
|
339
|
-
reason: {
|
|
340
|
-
type: string;
|
|
341
|
-
minLength: number;
|
|
342
|
-
};
|
|
343
|
-
};
|
|
344
|
-
required: string[];
|
|
345
|
-
additionalProperties: boolean;
|
|
346
|
-
};
|
|
347
|
-
description: string;
|
|
348
|
-
};
|
|
349
|
-
ticketFilter?: undefined;
|
|
350
|
-
ticketWatch?: undefined;
|
|
351
|
-
steps: {
|
|
352
|
-
type: string;
|
|
353
|
-
minItems: number;
|
|
354
|
-
items: {
|
|
355
|
-
type: string;
|
|
356
|
-
properties: {
|
|
357
|
-
reads: {
|
|
358
|
-
type: string;
|
|
359
|
-
items: {
|
|
360
|
-
type: string;
|
|
361
|
-
};
|
|
362
|
-
description: string;
|
|
363
|
-
};
|
|
364
|
-
emits: {
|
|
365
|
-
type: string;
|
|
366
|
-
minLength: number;
|
|
367
|
-
description: string;
|
|
368
|
-
};
|
|
369
|
-
fromLine: {
|
|
370
|
-
type: string[];
|
|
371
|
-
description: string;
|
|
372
|
-
};
|
|
373
|
-
picks: {
|
|
374
|
-
type: string;
|
|
375
|
-
additionalProperties: {
|
|
376
|
-
type: string;
|
|
377
|
-
items: {
|
|
378
|
-
type: string;
|
|
379
|
-
};
|
|
380
|
-
};
|
|
381
|
-
description: string;
|
|
382
|
-
};
|
|
383
|
-
close: {
|
|
384
|
-
type: string;
|
|
385
|
-
properties: {
|
|
386
|
-
sheet?: Record<string, any> | undefined;
|
|
387
|
-
class: {
|
|
388
|
-
type: string;
|
|
389
|
-
enum: string[];
|
|
390
|
-
description: string;
|
|
391
|
-
};
|
|
392
|
-
columns: Readonly<{
|
|
393
|
-
type: "array";
|
|
394
|
-
minItems: 1;
|
|
395
|
-
maxItems: 10;
|
|
396
|
-
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";
|
|
397
|
-
items: {
|
|
398
|
-
type: string;
|
|
399
|
-
properties: {
|
|
400
|
-
source: {
|
|
401
|
-
type: string;
|
|
402
|
-
description: string;
|
|
403
|
-
};
|
|
404
|
-
column: {
|
|
405
|
-
type: string;
|
|
406
|
-
description: string;
|
|
407
|
-
};
|
|
408
|
-
};
|
|
409
|
-
required: string[];
|
|
410
|
-
additionalProperties: boolean;
|
|
411
|
-
};
|
|
412
|
-
}>;
|
|
413
|
-
};
|
|
414
|
-
required: string[];
|
|
415
|
-
additionalProperties: boolean;
|
|
416
|
-
};
|
|
417
|
-
mcpTools?: {
|
|
418
|
-
type: string;
|
|
419
|
-
items: {
|
|
420
|
-
type: string;
|
|
421
|
-
enum: string[];
|
|
422
|
-
};
|
|
423
|
-
description: string;
|
|
424
|
-
} | undefined;
|
|
425
|
-
primitives: {
|
|
426
|
-
type: string;
|
|
427
|
-
items: {
|
|
428
|
-
type: string;
|
|
429
|
-
enum: any[];
|
|
430
|
-
};
|
|
431
|
-
description: string;
|
|
432
|
-
};
|
|
433
|
-
};
|
|
434
|
-
required: string[];
|
|
435
|
-
additionalProperties: boolean;
|
|
436
|
-
};
|
|
437
|
-
};
|
|
438
|
-
} | {
|
|
439
|
-
notChecked: {
|
|
440
|
-
type: string;
|
|
441
|
-
items: {
|
|
442
|
-
type: string;
|
|
443
|
-
};
|
|
444
|
-
description: string;
|
|
445
|
-
};
|
|
446
|
-
guardrailClasses: {
|
|
447
|
-
type: string;
|
|
448
|
-
additionalProperties: {
|
|
449
|
-
type: string;
|
|
450
|
-
enum: string[];
|
|
451
|
-
};
|
|
452
|
-
description: string;
|
|
453
|
-
};
|
|
454
|
-
unjudgeable: {
|
|
455
|
-
type: string;
|
|
456
|
-
additionalProperties: {
|
|
457
|
-
type: string;
|
|
458
|
-
};
|
|
459
|
-
description: string;
|
|
460
|
-
};
|
|
461
149
|
refused: {
|
|
462
150
|
type: string;
|
|
463
151
|
items: {
|
|
@@ -476,36 +164,6 @@ export function buildRoundSchema(menu: any[], { questions, sheets, ticket }?: {
|
|
|
476
164
|
};
|
|
477
165
|
description: string;
|
|
478
166
|
};
|
|
479
|
-
ticketFilter: {
|
|
480
|
-
type: string;
|
|
481
|
-
properties: {
|
|
482
|
-
priority: {
|
|
483
|
-
type: string;
|
|
484
|
-
items: {
|
|
485
|
-
type: string;
|
|
486
|
-
enum: string[];
|
|
487
|
-
};
|
|
488
|
-
description: string;
|
|
489
|
-
};
|
|
490
|
-
labels: {
|
|
491
|
-
type: string;
|
|
492
|
-
items: {
|
|
493
|
-
type: string;
|
|
494
|
-
};
|
|
495
|
-
description: string;
|
|
496
|
-
};
|
|
497
|
-
};
|
|
498
|
-
additionalProperties: boolean;
|
|
499
|
-
description: string;
|
|
500
|
-
};
|
|
501
|
-
ticketWatch: {
|
|
502
|
-
type: string;
|
|
503
|
-
items: {
|
|
504
|
-
type: string;
|
|
505
|
-
enum: string[];
|
|
506
|
-
};
|
|
507
|
-
description: string;
|
|
508
|
-
};
|
|
509
167
|
steps: {
|
|
510
168
|
type: string;
|
|
511
169
|
minItems: number;
|
|
@@ -541,7 +199,6 @@ export function buildRoundSchema(menu: any[], { questions, sheets, ticket }?: {
|
|
|
541
199
|
close: {
|
|
542
200
|
type: string;
|
|
543
201
|
properties: {
|
|
544
|
-
sheet?: Record<string, any> | undefined;
|
|
545
202
|
class: {
|
|
546
203
|
type: string;
|
|
547
204
|
enum: string[];
|
|
@@ -653,12 +310,12 @@ export function goalForLine(fromLine: any, lines: any): any;
|
|
|
653
310
|
*
|
|
654
311
|
* @returns {Promise<{ok:boolean, declaration:object|null, reds:string[], rounds:number, calls:number, spendComplete:boolean,
|
|
655
312
|
* costUsd:number|null, modelReturned:string|null, modelId?:string, price?:object|null, tokens?:object|null, structureRetries:number, revisions:number, stop:string|null, log:object[],
|
|
656
|
-
* questions?:{line:number, question:string}[], droppedQuestions?:object[], notChecked?:string[], thinking?:{asked:string, status:string|null, say:string|null}, inputs?:{role:string, detail:string}[],
|
|
313
|
+
* questions?:{line:number, question:string}[], proseText?:string, action?:{line:number, by?:'agent'|'you', dropped?:true}|null, droppedQuestions?:object[], notChecked?:string[], thinking?:{asked:string, status:string|null, say:string|null}, inputs?:{role:string, detail:string}[],
|
|
657
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[]}>}
|
|
658
315
|
* `learnHints` (M8 item 5a): the earlier runs' notes block (src/learnstore.js hintsForRun), appended to the drafter's system prompt; null = nothing.
|
|
659
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`.
|
|
660
317
|
*/
|
|
661
|
-
export function draft({ proseText, slot, model, provider: injected, rates: injectedRates, modelId: injectedModelId, env, priorSpend, skills, makeProviderFn, onBook, offerQuestions, draftThinking, draftDir, fetchPage, leftRules, checkPicks, carriedPicks, carriedChoices, carriedSheetDropped, onSheetDropped, onChoices, 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, actionMode, }: {
|
|
662
319
|
proseText: any;
|
|
663
320
|
slot: any;
|
|
664
321
|
model: any;
|
|
@@ -678,6 +335,13 @@ export function draft({ proseText, slot, model, provider: injected, rates: injec
|
|
|
678
335
|
line: number;
|
|
679
336
|
rule: number;
|
|
680
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;
|
|
681
345
|
checkPicks?: import("./checkpick.js").Pick[] | undefined;
|
|
682
346
|
carriedPicks?: import("./pickrecord.js").Entry[] | undefined;
|
|
683
347
|
carriedChoices?: any[] | null | undefined;
|
|
@@ -698,8 +362,9 @@ export function draft({ proseText, slot, model, provider: injected, rates: injec
|
|
|
698
362
|
ids: string[];
|
|
699
363
|
} | null | undefined;
|
|
700
364
|
mcpServers?: string[] | undefined;
|
|
701
|
-
flowType?: "
|
|
365
|
+
flowType?: "tickets" | "mcp" | "plain" | undefined;
|
|
702
366
|
mcp?: any;
|
|
367
|
+
actionMode?: "check" | "known" | null | undefined;
|
|
703
368
|
}): Promise<{
|
|
704
369
|
ok: boolean;
|
|
705
370
|
declaration: object | null;
|
|
@@ -720,6 +385,12 @@ export function draft({ proseText, slot, model, provider: injected, rates: injec
|
|
|
720
385
|
line: number;
|
|
721
386
|
question: string;
|
|
722
387
|
}[];
|
|
388
|
+
proseText?: string;
|
|
389
|
+
action?: {
|
|
390
|
+
line: number;
|
|
391
|
+
by?: "agent" | "you";
|
|
392
|
+
dropped?: true;
|
|
393
|
+
} | null;
|
|
723
394
|
droppedQuestions?: object[];
|
|
724
395
|
notChecked?: string[];
|
|
725
396
|
thinking?: {
|
|
@@ -757,10 +428,6 @@ export const CLASSES: readonly string[];
|
|
|
757
428
|
export const WHOLE_OUTPUT_CEILING_RULE: "use the guardrail's ceiling for the whole output";
|
|
758
429
|
export function docRolesOf(sources: any[] | undefined): string[];
|
|
759
430
|
export const MAX_QUESTIONS: 2;
|
|
760
|
-
/** What fwdloop's typed checks can really check (bareloop F174: give the model the real list, or "Not checked" is invented). */
|
|
761
|
-
export const CHECKABLE: readonly string[];
|
|
762
|
-
/** Offered on EVERY try (it is information, not asking). */
|
|
763
|
-
export const NOTCHECKED_PROMPT: string;
|
|
764
431
|
/** 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. */
|
|
765
432
|
export const QUESTIONS_PROMPT: string;
|
|
766
433
|
import { makeProvider } from './provider.js';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** What the AI is told: the numbered job lines (text only) and the one question. @param {{n: number, text: string}[]} lines @returns {string} */
|
|
2
|
+
export function notePrompt(lines: {
|
|
3
|
+
n: number;
|
|
4
|
+
text: string;
|
|
5
|
+
}[]): string;
|
|
6
|
+
/**
|
|
7
|
+
* Code reads the typed answer: every asked line answered exactly yes or no, else null (no repair). An answer for a line not asked is unreadable too.
|
|
8
|
+
* @param {any} args the tool's arguments @param {{n: number}[]} lines @returns {Map<number, 'yes'|'no'>|null}
|
|
9
|
+
*/
|
|
10
|
+
export function decideNote(args: any, lines: {
|
|
11
|
+
n: number;
|
|
12
|
+
}[]): Map<number, "yes" | "no"> | null;
|
|
13
|
+
/**
|
|
14
|
+
* The answers per asked line as the block reads them: the typed answer, or `failed` for every asked line when there is none. ONE function, shared by the draft and the replay.
|
|
15
|
+
* @param {number[]} asked the facts-only lines asked @param {any} args the tool's arguments, or null @param {{n: number}[]} lines
|
|
16
|
+
* @returns {{line: number, answer: 'yes'|'no'|'failed'}[]}
|
|
17
|
+
*/
|
|
18
|
+
export function noteAnswers(asked: number[], args: any, lines: {
|
|
19
|
+
n: number;
|
|
20
|
+
}[]): {
|
|
21
|
+
line: number;
|
|
22
|
+
answer: "yes" | "no" | "failed";
|
|
23
|
+
}[];
|
|
24
|
+
/** the label of the forced turn, as the draft's log and the replay in src/planrebuild.js see it */
|
|
25
|
+
export const NOTE_KIND: "note-ask";
|
|
26
|
+
export const NOTE_TOOL: "answer_note_question";
|
|
27
|
+
export const NOTE_SYSTEM: "You read the numbered lines of a job. You answer only about what each line says; you never invent words.";
|
|
28
|
+
export const NOTE_SCHEMA: Readonly<{
|
|
29
|
+
type: "object";
|
|
30
|
+
properties: {
|
|
31
|
+
lines: {
|
|
32
|
+
type: string;
|
|
33
|
+
items: {
|
|
34
|
+
type: string;
|
|
35
|
+
properties: {
|
|
36
|
+
line: {
|
|
37
|
+
type: string;
|
|
38
|
+
minimum: number;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
writtenWords: {
|
|
42
|
+
enum: string[];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
required: string[];
|
|
46
|
+
additionalProperties: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
required: string[];
|
|
51
|
+
additionalProperties: false;
|
|
52
|
+
}>;
|
package/types/pageask.d.ts
CHANGED
|
@@ -17,29 +17,6 @@ export function panelQuestionText(q: {
|
|
|
17
17
|
line: number;
|
|
18
18
|
source?: string;
|
|
19
19
|
}): string;
|
|
20
|
-
/**
|
|
21
|
-
* The early asks CODE forces before any paid drafting, from the look's own result. One ask per rule text on a line; readings first, then can't-check
|
|
22
|
-
* asks, each in line order. The caller applies the cap and the answer gate.
|
|
23
|
-
* @param {{facts?: {line: number, forRule?: number, name?: string, shape?: string, unit?: string[], currency?: string[], reading?: import('./pagerules.js').Reading}[]}|null|undefined} look
|
|
24
|
-
* @param {{n: number, text?: string, rule?: string, rules?: string[]}[]|null|undefined} jobLines
|
|
25
|
-
* @returns {LookAsk[]}
|
|
26
|
-
*/
|
|
27
|
-
export function askableFromLook(look: {
|
|
28
|
-
facts?: {
|
|
29
|
-
line: number;
|
|
30
|
-
forRule?: number;
|
|
31
|
-
name?: string;
|
|
32
|
-
shape?: string;
|
|
33
|
-
unit?: string[];
|
|
34
|
-
currency?: string[];
|
|
35
|
-
reading?: import("./pagerules.js").Reading;
|
|
36
|
-
}[];
|
|
37
|
-
} | null | undefined, jobLines: {
|
|
38
|
-
n: number;
|
|
39
|
-
text?: string;
|
|
40
|
-
rule?: string;
|
|
41
|
-
rules?: string[];
|
|
42
|
-
}[] | null | undefined): LookAsk[];
|
|
43
20
|
/**
|
|
44
21
|
* More asks than the cap means the job needs a rewrite, not a questionnaire. The code-owned stop words list EVERY ask and its reading as the
|
|
45
22
|
* suggestion (no extra paid call). A secret in a rule is masked.
|
|
@@ -50,6 +27,15 @@ export function tooManyAsksText(asks: {
|
|
|
50
27
|
ruleText: string;
|
|
51
28
|
reading?: string;
|
|
52
29
|
}[]): string;
|
|
30
|
+
/**
|
|
31
|
+
* M17 am8: what a button-picked answer decided, as the one Audit line; null when the row has no pick (a box-answered drafter question, an older record).
|
|
32
|
+
* @param {{choice?: string, words?: string}} h
|
|
33
|
+
* @returns {string|null}
|
|
34
|
+
*/
|
|
35
|
+
export function decidedWords(h: {
|
|
36
|
+
choice?: string;
|
|
37
|
+
words?: string;
|
|
38
|
+
}): string | null;
|
|
53
39
|
/**
|
|
54
40
|
* What a typed answer to a look ask does, the ONE place that decides (the panel's answer route, the setup record and the Result tab all read it).
|
|
55
41
|
* `agree` / `yes` to a reading ask takes the code's reading; `drop it` to a can't-check ask leaves the rule Not checked (no `~` line); anything else is the
|
|
@@ -57,7 +43,7 @@ export function tooManyAsksText(asks: {
|
|
|
57
43
|
* M10 am16: a shape guardrail's ask (`ask: 'check'` proposes a check, `'no-check'` found none) takes the same words: `agree` takes the proposal (and the check it
|
|
58
44
|
* carries, `check`), `drop it` leaves the rule Not checked (either kind), anything else is the person's own words (`own`: a `~` rule on the line, no check).
|
|
59
45
|
* @param {{source?: string, ask?: string, proposal?: string|null, check?: Record<string, any>}} q @param {unknown} typed @param {'agree'|'drop'|'rule'} [choice] M10 am29: the button used; absent = today's words reading (CLI, old files)
|
|
60
|
-
* @returns {{rule: string|null, left: boolean, check?: Record<string, any>, own?: boolean}} `rule` = the words written as a new `~` rule (null when the rule is left Not checked)
|
|
46
|
+
* @returns {{rule: string|null, left: boolean, check?: Record<string, any>, own?: boolean, action?: 'known', actionLine?: string}} `rule` = the words written as a new `~` rule (null when the rule is left Not checked)
|
|
61
47
|
*/
|
|
62
48
|
export function ruleOfAnswer(q: {
|
|
63
49
|
source?: string;
|
|
@@ -69,6 +55,8 @@ export function ruleOfAnswer(q: {
|
|
|
69
55
|
left: boolean;
|
|
70
56
|
check?: Record<string, any>;
|
|
71
57
|
own?: boolean;
|
|
58
|
+
action?: "known";
|
|
59
|
+
actionLine?: string;
|
|
72
60
|
};
|
|
73
61
|
/** the most asks before drafting; more than this is a job to rewrite, not a questionnaire (am1) */
|
|
74
62
|
export const MAX_LOOK_ASKS: 3;
|
|
@@ -81,15 +69,3 @@ export function isAgree(text: unknown): boolean;
|
|
|
81
69
|
export function stripAgreeLead(text: string): string;
|
|
82
70
|
export function readingQuestion(n: number, rule: string, reading: string): string;
|
|
83
71
|
export function cantCheckQuestion(n: number, rule: string): string;
|
|
84
|
-
/**
|
|
85
|
-
* `reading` = the plain words an `agree` writes as a `~` rule (a reading ask only)
|
|
86
|
-
*/
|
|
87
|
-
export type LookAsk = {
|
|
88
|
-
line: number;
|
|
89
|
-
rule: number;
|
|
90
|
-
source: "look";
|
|
91
|
-
question: string;
|
|
92
|
-
ask: "reading" | "cant-check";
|
|
93
|
-
ruleText: string;
|
|
94
|
-
reading?: string;
|
|
95
|
-
};
|
package/types/pagedry.d.ts
CHANGED
|
@@ -19,6 +19,19 @@ export function dryReadMoney(text: string, facts: KeptFact[]): Promise<{
|
|
|
19
19
|
reads: Record<string, number>;
|
|
20
20
|
results: Record<string, number>;
|
|
21
21
|
}>;
|
|
22
|
+
/**
|
|
23
|
+
* The page's RESULT LINES: the lines the given money facts read (`moneyResultLines`), each quote once. Empty when no money fact reads a line (the result lines are then unknown).
|
|
24
|
+
* The one owner of "what is a result row" for phrase facts, shared by the dry read below and by the check list's `!` rows (`phraseInNoResult`).
|
|
25
|
+
* @param {string} text @param {KeptFact[]} facts @returns {string[]}
|
|
26
|
+
*/
|
|
27
|
+
export function resultQuotes(text: string, facts: KeptFact[]): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Is this phrase in the page but in NONE of its result lines (the `phrase-no-result` case)? Sync, for a `!` row the check list is about to build.
|
|
30
|
+
* True only when result lines exist and no line holds the words (case and spacing aside, a plain substring: it never refuses a phrase the run's presence check could pass).
|
|
31
|
+
* With no result line known nothing is guessed (false).
|
|
32
|
+
* @param {string} text @param {KeptFact[]} moneyFacts the line's money facts @param {string} words @returns {boolean}
|
|
33
|
+
*/
|
|
34
|
+
export function phraseInNoResult(text: string, moneyFacts: KeptFact[], words: string): boolean;
|
|
22
35
|
/**
|
|
23
36
|
* The same "can it read" for PHRASE facts (bareloop c550dc8; our failure: m10-walk-flights-3, "Rome" was on the page only in "Track prices from Madrid to
|
|
24
37
|
* Rome" switches, in none of the 18 result lines, so no result could ever say it). A kept phrase fact is read against the page's RESULT LINES = the lines
|
package/types/pagerules.d.ts
CHANGED
|
@@ -26,6 +26,13 @@ export function validReading(shape: unknown, r: unknown): boolean;
|
|
|
26
26
|
* @param {string} s @returns {string|undefined}
|
|
27
27
|
*/
|
|
28
28
|
export function numberAtEnd(s: string): string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The ONE owner of a label's separator: the label as the page writes it. The run's checker reads a value right after the signed label, so a page that
|
|
31
|
+
* writes "Departure time: 10:24 AM." can only be read by the label "Departure time:". When EVERY place the page holds the label has a colon right after
|
|
32
|
+
* it, the label is signed with that colon; one bare place leaves it as the look gave it. A plain count of the page's own text, no pattern.
|
|
33
|
+
* @param {string} text the frozen page text @param {string} label a label as normLabel leaves it @returns {string}
|
|
34
|
+
*/
|
|
35
|
+
export function withColon(text: string, label: string): string;
|
|
29
36
|
/**
|
|
30
37
|
* Apply the rules to the AI's map over one saved page. Returns the kept facts and, for everything a rule removed, one `dropped` entry.
|
|
31
38
|
* The order of the rules is the POC's (apply-v3.mjs): found-on-page, then the rules that read the page. A place is read as a phrase.
|
package/types/panel/author.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export function createAuthor(opts: {
|
|
|
44
44
|
/** `GET /api/author/run-again`, its flow entry carrying the trigger card like the list's entries do. @param {string|null} flow @param {string|null} runId */
|
|
45
45
|
runAgain(flow: string | null, runId: string | null): any;
|
|
46
46
|
/** M4b am4 item 7: how many drafts are open for `whoami` and the launcher's stop warning: the card `live()` returns (the newest draft not abandoned or signed), 0 or 1. */
|
|
47
|
-
openDrafts():
|
|
47
|
+
openDrafts(): 1 | 0;
|
|
48
48
|
run: (body: any) => {
|
|
49
49
|
status: any;
|
|
50
50
|
body: any;
|