fwdloop 0.35.2 → 0.37.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 +5 -2
- package/package.json +3 -3
- package/src/action-stop.js +1 -1
- package/src/auditchecks.js +41 -9
- package/src/authoring.js +78 -20
- package/src/blockasks.js +10 -12
- package/src/blockassemble.js +49 -43
- package/src/blockdraft.js +4 -2
- package/src/blockpick.js +10 -0
- package/src/canrun.js +2 -1
- package/src/cardlist.js +28 -5
- package/src/checkblock.js +610 -64
- package/src/checked.js +28 -33
- package/src/checklistsign.js +2 -1
- package/src/checklook.js +45 -0
- package/src/checkrows.js +202 -0
- package/src/cited-record.js +2 -2
- package/src/citedcheck.js +53 -12
- package/src/citedwords.js +7 -4
- package/src/closers.js +49 -2
- package/src/declaration.js +26 -4
- package/src/drafter.js +86 -62
- package/src/factwords.js +7 -4
- package/src/globprefix.js +26 -0
- package/src/model-step.js +22 -4
- package/src/pageask.js +6 -4
- package/src/pagedropwords.js +3 -11
- package/src/pagedry.js +75 -1
- package/src/pagefetch.js +11 -6
- package/src/pagelook.js +2 -1
- package/src/pagerules.js +8 -2
- package/src/panel/author.js +20 -8
- package/src/panel/authorcard.js +3 -3
- package/src/panel/data.js +3 -2
- package/src/panel/index.html +176 -41
- package/src/panel/result.js +40 -3
- package/src/pickrecord.js +14 -0
- package/src/planrebuild.js +55 -19
- package/src/ratelimit.js +117 -0
- package/src/report.js +216 -0
- package/src/rowresults.js +111 -0
- package/src/rubricstep.js +65 -2
- package/src/runner.js +61 -9
- package/src/send.js +19 -82
- package/src/shapebuild.js +281 -0
- package/src/shapelook.js +91 -0
- package/src/shapemenu.js +64 -0
- package/src/shaperesult.js +104 -0
- package/src/shaperows.js +263 -0
- package/src/shapewords.js +140 -0
- package/src/sheetbuild.js +41 -29
- package/src/sheetclaims.js +49 -1
- package/src/sheetfind.js +8 -0
- package/src/sheetlook.js +11 -1
- package/src/sheetrows.js +10 -64
- package/src/ticketrows.js +1 -1
- package/src/try-checks.js +39 -6
- package/src/types.js +1 -0
- package/src/whole-job.js +108 -16
- package/types/action-stop.d.ts +1 -1
- package/types/auditchecks.d.ts +13 -2
- package/types/authoring.d.ts +24 -4
- package/types/blockasks.d.ts +6 -10
- package/types/blockassemble.d.ts +13 -13
- package/types/blockdraft.d.ts +3 -2
- package/types/blockpick.d.ts +4 -0
- package/types/cardlist.d.ts +18 -2
- package/types/checkblock.d.ts +278 -28
- package/types/checked.d.ts +15 -6
- package/types/checklook.d.ts +36 -0
- package/types/checkrows.d.ts +119 -0
- package/types/citedcheck.d.ts +4 -2
- package/types/closers.d.ts +10 -1
- package/types/drafter.d.ts +8 -4
- package/types/globprefix.d.ts +5 -0
- package/types/model-step.d.ts +43 -2
- package/types/pageask.d.ts +5 -3
- package/types/pagedropwords.d.ts +0 -1
- package/types/pagedry.d.ts +27 -0
- package/types/pagefetch.d.ts +3 -2
- package/types/pagerules.d.ts +4 -0
- package/types/panel/result.d.ts +19 -2
- package/types/pickrecord.d.ts +10 -0
- package/types/ratelimit.d.ts +59 -0
- package/types/report.d.ts +46 -0
- package/types/rowresults.d.ts +28 -0
- package/types/rubricstep.d.ts +21 -0
- package/types/runner.d.ts +3 -1
- package/types/send.d.ts +13 -12
- package/types/shapebuild.d.ts +97 -0
- package/types/shapelook.d.ts +76 -0
- package/types/shapemenu.d.ts +40 -0
- package/types/shaperesult.d.ts +40 -0
- package/types/shaperows.d.ts +102 -0
- package/types/shapewords.d.ts +43 -0
- package/types/sheetbuild.d.ts +31 -13
- package/types/sheetclaims.d.ts +16 -0
- package/types/sheetfind.d.ts +1 -0
- package/types/sheetrows.d.ts +5 -36
- package/types/ticketrows.d.ts +1 -1
- package/types/try-checks.d.ts +2 -1
- package/types/types.d.ts +4 -0
- package/types/whole-job.d.ts +69 -3
package/types/runner.d.ts
CHANGED
|
@@ -616,10 +616,11 @@ import { readTicketMcp } from './ticket-mcp.js';
|
|
|
616
616
|
* @param {number} [opts.triesDone] - tries a Stop already closed on this step (they count against its limit)
|
|
617
617
|
* @param {string|null} [opts.runDir] - M4d am29 item 2: the run's folder, where each try saves its checks
|
|
618
618
|
* @param {any[]} [opts.checkList] - M16 item 5: the plan's signed list; a list line's checks carry the row's `by`
|
|
619
|
+
* @param {any[]} [opts.jobLines] - M19 am11 item 4: the signed job lines; the words of a list line's rows read the person's rule
|
|
619
620
|
* @param {Record<string, any>} [opts.mcpGranted] - M13 item 5: this step's signed MCP tools, already bound to its bridge (`runStepRalph` builds them); handed to the model with the verbs
|
|
620
621
|
* @returns {Promise<{ok:true, artifact:any, attempts:number, hitl?:boolean} | {ok:false, outcome:string, red:string, stop?:{where:string, book:Record<string, any>, step?:string|null}}>}
|
|
621
622
|
*/
|
|
622
|
-
declare function runStepTries({ step, primitivesMap, readsMap, businessDate, modelStep, spent, capUsd, ceilingUsd, recordAudit, initialGap, attemptOffset, thinkingBox, learnHints, now, readStop, stepNo, triesDone, runDir, prevStepId, mcpGranted, checkList, }: {
|
|
623
|
+
declare function runStepTries({ step, primitivesMap, readsMap, businessDate, modelStep, spent, capUsd, ceilingUsd, recordAudit, initialGap, attemptOffset, thinkingBox, learnHints, now, readStop, stepNo, triesDone, runDir, prevStepId, mcpGranted, checkList, jobLines, }: {
|
|
623
624
|
step: any;
|
|
624
625
|
primitivesMap?: Record<string, any> | undefined;
|
|
625
626
|
readsMap: Record<string, any>;
|
|
@@ -649,6 +650,7 @@ declare function runStepTries({ step, primitivesMap, readsMap, businessDate, mod
|
|
|
649
650
|
triesDone?: number | undefined;
|
|
650
651
|
runDir?: string | null | undefined;
|
|
651
652
|
checkList?: any[] | undefined;
|
|
653
|
+
jobLines?: any[] | undefined;
|
|
652
654
|
mcpGranted?: Record<string, any> | undefined;
|
|
653
655
|
}): Promise<{
|
|
654
656
|
ok: true;
|
package/types/send.d.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* M15
|
|
3
|
-
* `Name words: value` line per field; a list of results is one `## Result k` block per result with one line per value, in the order the answer holds
|
|
4
|
-
* them, then `from the page: "<quote>"`. Never JSON braces, never check marks. What it throws away: a result's keys other than `quote` and `values`.
|
|
5
|
-
* @param {Record<string, any>} content @returns {string}
|
|
6
|
-
*/
|
|
7
|
-
export function renderSentMd(content: Record<string, any>): string;
|
|
8
|
-
/**
|
|
2
|
+
* M15 am3: the send writes ONE markdown report per run, `<job name>-YYYY-MM-DD.md` (then `-2`, `-3`, ... when that name is taken, never over a taken file): the title, the `Passed` line and the accepted
|
|
9
3
|
* @param {string} target - a signed arbiter target, e.g. `file:poc/m0/out`.
|
|
10
|
-
* @param {string}
|
|
11
|
-
* @param {unknown} content - the accepted artifact; hash-checked as its JSON
|
|
4
|
+
* @param {string} jobName - the job's name: the file's name starts with it
|
|
5
|
+
* @param {unknown} content - the accepted artifact; hash-checked as its JSON (M4b item 4).
|
|
12
6
|
* @param {string|null} [acceptedSha256] - the sha256 the human's accept recorded
|
|
13
7
|
* (`answerAsk`, M4b piece 3). Required: none recorded (an answer written by an
|
|
14
8
|
* older version, or no accept in this process) refuses by name.
|
|
15
|
-
* @param {{root?: string, runDir?: string}} [ctx] the flow root and this run's folder, for the destination refusals
|
|
16
|
-
* @returns {Promise<{ok:true, path:string, bytes:number, sha256:string} | {ok:false, red:string}>}
|
|
9
|
+
* @param {{root?: string, runDir?: string, report?: {runNo: number|null, now?: Date, body: string}}} [ctx] the flow root and this run's folder, for the destination refusals; the report's body, run number and day
|
|
10
|
+
* @returns {Promise<{ok:true, path:string, name:string, bytes:number, sha256:string, taken:string|null} | {ok:false, red:string}>}
|
|
17
11
|
*/
|
|
18
|
-
export function sendViaPrimitive(target: string,
|
|
12
|
+
export function sendViaPrimitive(target: string, jobName: string, content: unknown, acceptedSha256?: string | null, ctx?: {
|
|
19
13
|
root?: string;
|
|
20
14
|
runDir?: string;
|
|
15
|
+
report?: {
|
|
16
|
+
runNo: number | null;
|
|
17
|
+
now?: Date;
|
|
18
|
+
body: string;
|
|
19
|
+
};
|
|
21
20
|
}): Promise<{
|
|
22
21
|
ok: true;
|
|
23
22
|
path: string;
|
|
23
|
+
name: string;
|
|
24
24
|
bytes: number;
|
|
25
25
|
sha256: string;
|
|
26
|
+
taken: string | null;
|
|
26
27
|
} | {
|
|
27
28
|
ok: false;
|
|
28
29
|
red: string;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does a field carry at least ONE real bound the person's rule grounds (a number, a count of characters, words or entries, the one-of values, a yes/no value; `required` + `minChars: 1` is "each item has a title")?
|
|
3
|
+
* A modifier alone (a currency, a unit, how a number is read) is no bound. A list counts when its entries do.
|
|
4
|
+
* @param {Record<string, any>} bounds @returns {boolean}
|
|
5
|
+
*/
|
|
6
|
+
export function hasRealBound(bounds: Record<string, any>): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {{name: string, kind: string, required: boolean, bounds: Record<string, any>, rule: number|null, by: 'you'|'agent', held: boolean, why?: string}} ShapeField
|
|
9
|
+
* @typedef {{rule: number, text: string, state: 'built'|'not-checked', reason: string|null, name: string|null}} ShapeRule
|
|
10
|
+
* @typedef {{line: number, ok: boolean, fields: ShapeField[], itemCount: {labels: string[], n: number}|null, rows: ShapeRule[], refused: {helper: string, why: string}[], reservedChecked: boolean}} LineShape
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Is ONE bound value in the person's words? A number counts when it is written as a number there (an upper bound also when it is the written number minus one: "under 60" signs 59); a string value when it is
|
|
14
|
+
* written there, case and spacing aside.
|
|
15
|
+
* @param {string} key @param {unknown} v @param {string} text the person's words (the field's own rule) @param {boolean} required
|
|
16
|
+
* @returns {boolean}
|
|
17
|
+
*/
|
|
18
|
+
export function boundGrounded(key: string, v: unknown, text: string, required?: boolean): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Build the shape of ONE job line from the AI's suggestion, or refuse each part with its plain reason.
|
|
21
|
+
* @param {{line: {n: number, text?: string, rules?: string[], rule?: string}, labels: string[], suggestion: unknown, nameRules?: ReturnType<typeof shapeNameRules>}} o
|
|
22
|
+
* @returns {LineShape}
|
|
23
|
+
*/
|
|
24
|
+
export function buildShapeLine({ line, labels, suggestion, nameRules }: {
|
|
25
|
+
line: {
|
|
26
|
+
n: number;
|
|
27
|
+
text?: string;
|
|
28
|
+
rules?: string[];
|
|
29
|
+
rule?: string;
|
|
30
|
+
};
|
|
31
|
+
labels: string[];
|
|
32
|
+
suggestion: unknown;
|
|
33
|
+
nameRules?: ReturnType<typeof shapeNameRules>;
|
|
34
|
+
}): LineShape;
|
|
35
|
+
/**
|
|
36
|
+
* Build the shape of every candidate line from the reply's suggestions, each routed to its job line by its own `line`. A suggestion naming no candidate line, or not an object, is refused and listed.
|
|
37
|
+
* @param {{lines: {n: number, text?: string, rules?: string[], rule?: string}[], labels: string[], suggestions: unknown[], nameRules?: ReturnType<typeof shapeNameRules>}} o
|
|
38
|
+
* @returns {{built: Record<number, LineShape>, notChecked: Record<string, string>, refused: {line: number|null, helper: string, why: string}[]}}
|
|
39
|
+
* `built` holds only the lines whose shape stands (at least one field from a `~` rule); `notChecked`: `line N: "rule"` -> why, for each rule of a built line no field holds
|
|
40
|
+
*/
|
|
41
|
+
export function buildShapes({ lines, labels, suggestions, nameRules }: {
|
|
42
|
+
lines: {
|
|
43
|
+
n: number;
|
|
44
|
+
text?: string;
|
|
45
|
+
rules?: string[];
|
|
46
|
+
rule?: string;
|
|
47
|
+
}[];
|
|
48
|
+
labels: string[];
|
|
49
|
+
suggestions: unknown[];
|
|
50
|
+
nameRules?: ReturnType<typeof shapeNameRules>;
|
|
51
|
+
}): {
|
|
52
|
+
built: Record<number, LineShape>;
|
|
53
|
+
notChecked: Record<string, string>;
|
|
54
|
+
refused: {
|
|
55
|
+
line: number | null;
|
|
56
|
+
helper: string;
|
|
57
|
+
why: string;
|
|
58
|
+
}[];
|
|
59
|
+
};
|
|
60
|
+
/** why a `~` rule no field holds is Not checked, when no field named it (judged at Accept, not at an Ask) */
|
|
61
|
+
export const NO_FIELD_WHY: "No field was picked for it, so you judge it at Accept.";
|
|
62
|
+
/** why a rule whose field carries no limit from its own words stays Not checked: a field with no bound checks nothing the person asked for (hamr 2026-11-19) */
|
|
63
|
+
export const NO_BOUND_WHY: "The field picked for it has no limit from your words, so it checks nothing; you judge it at Accept.";
|
|
64
|
+
export function fieldSpec(f: ShapeField): Record<string, any>;
|
|
65
|
+
export type ShapeField = {
|
|
66
|
+
name: string;
|
|
67
|
+
kind: string;
|
|
68
|
+
required: boolean;
|
|
69
|
+
bounds: Record<string, any>;
|
|
70
|
+
rule: number | null;
|
|
71
|
+
by: "you" | "agent";
|
|
72
|
+
held: boolean;
|
|
73
|
+
why?: string;
|
|
74
|
+
};
|
|
75
|
+
export type ShapeRule = {
|
|
76
|
+
rule: number;
|
|
77
|
+
text: string;
|
|
78
|
+
state: "built" | "not-checked";
|
|
79
|
+
reason: string | null;
|
|
80
|
+
name: string | null;
|
|
81
|
+
};
|
|
82
|
+
export type LineShape = {
|
|
83
|
+
line: number;
|
|
84
|
+
ok: boolean;
|
|
85
|
+
fields: ShapeField[];
|
|
86
|
+
itemCount: {
|
|
87
|
+
labels: string[];
|
|
88
|
+
n: number;
|
|
89
|
+
} | null;
|
|
90
|
+
rows: ShapeRule[];
|
|
91
|
+
refused: {
|
|
92
|
+
helper: string;
|
|
93
|
+
why: string;
|
|
94
|
+
}[];
|
|
95
|
+
reservedChecked: boolean;
|
|
96
|
+
};
|
|
97
|
+
import { shapeNameRules } from './shapemenu.js';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** the menu as the drafter reads it, one line per kind of src/shapemenu.js (the one place it is named): ` boolean: bounds equals` @returns {string[]} */
|
|
2
|
+
export function shapeMenuLines(): string[];
|
|
3
|
+
/**
|
|
4
|
+
* What the AI is told: the job (its `~` rules numbered per line), the inputs (bounded), the kind menu and the answer form.
|
|
5
|
+
* @param {{jobLines: {n: number, text: string, rule?: string, rules?: string[]}[], lineNums: number[], texts: Record<string, string>, left?: {line: number, rules: number[]}[]}} o `lineNums` the lines a shape can be offered for, `left` the rules still without a check
|
|
6
|
+
* @returns {string}
|
|
7
|
+
*/
|
|
8
|
+
export function shapeLookPrompt({ jobLines, lineNums, texts, left }: {
|
|
9
|
+
jobLines: {
|
|
10
|
+
n: number;
|
|
11
|
+
text: string;
|
|
12
|
+
rule?: string;
|
|
13
|
+
rules?: string[];
|
|
14
|
+
}[];
|
|
15
|
+
lineNums: number[];
|
|
16
|
+
texts: Record<string, string>;
|
|
17
|
+
left?: {
|
|
18
|
+
line: number;
|
|
19
|
+
rules: number[];
|
|
20
|
+
}[];
|
|
21
|
+
}): string;
|
|
22
|
+
/**
|
|
23
|
+
* Read the AI's answer: ONE JSON object `{"shapes":[...]}`, each shape an object with a whole `line`, its `fields` and `extraFields` lists (an absent list is none). No repair: anything else is a malformed answer. What a field MEANS is judged by code (src/shapebuild.js).
|
|
24
|
+
* @param {unknown} text @returns {{ok: true, shapes: Record<string, any>[]}|{ok: false}}
|
|
25
|
+
*/
|
|
26
|
+
export function parseShapeAnswer(text: unknown): {
|
|
27
|
+
ok: true;
|
|
28
|
+
shapes: Record<string, any>[];
|
|
29
|
+
} | {
|
|
30
|
+
ok: false;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Look at the shape of the answer: the call (once; once more after an unreadable answer or one transport failure; a 429 waits the vendor's stated time once and is not an attempt).
|
|
34
|
+
* `callModel(content, attempt)` makes and meters ONE model round (the drafter's `makeCallModel('shape-map', SHAPE_SYSTEM)`) and returns `{text}`, `{text, cutOff: true}` or `{error}` (with `budget: true` when the cap stopped the call, `threw` when the provider threw).
|
|
35
|
+
* @param {{texts: Record<string, string>, jobLines: {n: number, text: string, rule?: string, rules?: string[]}[], lineNums: number[], left?: {line: number, rules: number[]}[], ceilingUsd?: number|null,
|
|
36
|
+
* callModel: (content: string, attempt: number) => Promise<{text?: string, cutOff?: boolean, error?: string, budget?: boolean, threw?: any}>, sleep?: (ms: number) => Promise<void>}} o
|
|
37
|
+
* @returns {Promise<{ok: true, shapes: Record<string, any>[], attempts: number}|{ok: false, reason: string, attempts: number}>}
|
|
38
|
+
*/
|
|
39
|
+
export function lookAtShape({ texts, jobLines, lineNums, left, ceilingUsd, callModel, sleep }: {
|
|
40
|
+
texts: Record<string, string>;
|
|
41
|
+
jobLines: {
|
|
42
|
+
n: number;
|
|
43
|
+
text: string;
|
|
44
|
+
rule?: string;
|
|
45
|
+
rules?: string[];
|
|
46
|
+
}[];
|
|
47
|
+
lineNums: number[];
|
|
48
|
+
left?: {
|
|
49
|
+
line: number;
|
|
50
|
+
rules: number[];
|
|
51
|
+
}[];
|
|
52
|
+
ceilingUsd?: number | null;
|
|
53
|
+
callModel: (content: string, attempt: number) => Promise<{
|
|
54
|
+
text?: string;
|
|
55
|
+
cutOff?: boolean;
|
|
56
|
+
error?: string;
|
|
57
|
+
budget?: boolean;
|
|
58
|
+
threw?: any;
|
|
59
|
+
}>;
|
|
60
|
+
sleep?: (ms: number) => Promise<void>;
|
|
61
|
+
}): Promise<{
|
|
62
|
+
ok: true;
|
|
63
|
+
shapes: Record<string, any>[];
|
|
64
|
+
attempts: number;
|
|
65
|
+
} | {
|
|
66
|
+
ok: false;
|
|
67
|
+
reason: string;
|
|
68
|
+
attempts: number;
|
|
69
|
+
}>;
|
|
70
|
+
/** the label of the one paid call about a shape, as the drafting book and the progress line see it (the sibling of `SHEET_CALL_LABEL`) */
|
|
71
|
+
export const SHAPE_CALL_LABEL: "shape-map";
|
|
72
|
+
/** how much of each input the call is shown (the POC's bound, declared in its preregistration) */
|
|
73
|
+
export const SHAPE_SHOWN_CHARS: 8000;
|
|
74
|
+
/** at most this many fields in one suggestion (bareguard allows 50 per `fields` object; a person's rule list is far shorter) */
|
|
75
|
+
export const MAX_SHAPE_FIELDS: 20;
|
|
76
|
+
export const SHAPE_SYSTEM: "You map a person's job to the SHAPE of an answer: a list of items, each item with named fields. You never grade and never invent bounds: a bound is only what the person wrote. Reply with JSON only.";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does the bareguard this package runs carry `itemShape`? Read from the vocabulary at call time (true from bareguard 0.37); the shape look and everything after it is OFF where it is false.
|
|
3
|
+
* @returns {boolean}
|
|
4
|
+
*/
|
|
5
|
+
export function shapeAvailable(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The name rules of a signed field, all bareguard's own: the characters, the length and its reserved reason words (a field named `wrong-value` would read as a gap).
|
|
8
|
+
* @returns {{max: number, forbidden: string[], reserved: string[]}}
|
|
9
|
+
*/
|
|
10
|
+
export function shapeNameRules(): {
|
|
11
|
+
max: number;
|
|
12
|
+
forbidden: string[];
|
|
13
|
+
reserved: string[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Is `name` a legal signed field name? Null when it is, else the plain reason.
|
|
17
|
+
* @param {unknown} name @param {{max: number, forbidden: string[], reserved: string[]|null}} [rules]
|
|
18
|
+
* @returns {string|null}
|
|
19
|
+
*/
|
|
20
|
+
export function nameWhy(name: unknown, rules?: {
|
|
21
|
+
max: number;
|
|
22
|
+
forbidden: string[];
|
|
23
|
+
reserved: string[] | null;
|
|
24
|
+
}): string | null;
|
|
25
|
+
/** kind -> the options (bounds and modifiers) the kind accepts, as bareguard lists them (`object` is not offered). `of` and `minEntries`/`maxEntries`/`unique` are the list's; `equals` is the boolean's. @type {Readonly<Record<string, readonly string[]>>} */
|
|
26
|
+
export const SHAPE_KINDS: Readonly<Record<string, readonly string[]>>;
|
|
27
|
+
/** the options whose value must be one of a closed list, as bareguard lists them (`money.currency` is a SIGN: "$", "€", "£"; `decimal`, `date.lang`): `kind` -> option -> the allowed values @type {Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>} */
|
|
28
|
+
export const SHAPE_OPTION_VALUES: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>;
|
|
29
|
+
/** the kinds a list entry (`of`) may be: every scalar kind (never `list`, never `object`) */
|
|
30
|
+
export const ENTRY_KINDS: readonly string[];
|
|
31
|
+
/** the options that are BOUNDS: each must appear in the person's own words (the same law as `groundedLiterals`, src/sheetbuild.js). The other options only say how a value is read (currency, unit, of, fromText ...). `equals` has its own rule (R5). */
|
|
32
|
+
export const GROUNDED_BOUNDS: readonly string[];
|
|
33
|
+
/** the upper bounds: "under 60 words" may sign 59, and "under 450" 449.99, so the number the person wrote, one more and its ceiling are the candidates */
|
|
34
|
+
export const UPPER_BOUNDS: readonly string[];
|
|
35
|
+
/** the bounds that count characters, words or entries: whole numbers, 0 or more */
|
|
36
|
+
export const COUNT_BOUNDS: readonly string[];
|
|
37
|
+
/** a field name is at most this long (bareguard's `nameMaxLength`) */
|
|
38
|
+
export const NAME_MAX_CHARS: number;
|
|
39
|
+
/** a field name holds none of these (they separate the path in a red item: bareguard's `nameForbiddenChars`) */
|
|
40
|
+
export const NAME_FORBIDDEN: any;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One item red in the Result tab's words: `item 3: status is "done", not one of: in progress, closed, finished`.
|
|
3
|
+
* @param {string} red `#<i>:<path>:<reason>` @param {Record<string, any>|null} field the signed field `{name, spec, rule?}` or null @param {unknown} value the worker's value @param {string} said the person's rule for the field
|
|
4
|
+
* @returns {string}
|
|
5
|
+
*/
|
|
6
|
+
export function shapeViewRed(red: string, field: Record<string, any> | null, value: unknown, said: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* The model of a shape line's answer.
|
|
9
|
+
* @param {{part: any, results: unknown, reds?: string[], rules?: string[]}} o `part` the signed shape part; `results` the answer's `results` list; `reds` the item reds the close recorded (`#<i>:<path>:<reason>`, none for a green run); `rules` the line's `~` rules
|
|
10
|
+
* @returns {{columns: {name: string}[], rows: {name: string, cells: {mark: 'g'|'r', text: string, why?: string}[]}[], total: number, passed: number, failed: number, errors: string[], notChecked: string, head: string}}
|
|
11
|
+
*/
|
|
12
|
+
export function shapeResultModel({ part, results, reds, rules }: {
|
|
13
|
+
part: any;
|
|
14
|
+
results: unknown;
|
|
15
|
+
reds?: string[];
|
|
16
|
+
rules?: string[];
|
|
17
|
+
}): {
|
|
18
|
+
columns: {
|
|
19
|
+
name: string;
|
|
20
|
+
}[];
|
|
21
|
+
rows: {
|
|
22
|
+
name: string;
|
|
23
|
+
cells: {
|
|
24
|
+
mark: "g" | "r";
|
|
25
|
+
text: string;
|
|
26
|
+
why?: string;
|
|
27
|
+
}[];
|
|
28
|
+
}[];
|
|
29
|
+
total: number;
|
|
30
|
+
passed: number;
|
|
31
|
+
failed: number;
|
|
32
|
+
errors: string[];
|
|
33
|
+
notChecked: string;
|
|
34
|
+
head: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The shape section of the .md report (the signed mock D): the shape-checks line, a table (items as rows, fields as columns, a mark and the short value in each cell), the Not checked line and, when any item failed, a Failed list.
|
|
38
|
+
* @param {ReturnType<typeof shapeResultModel>} m @returns {string}
|
|
39
|
+
*/
|
|
40
|
+
export function shapeMarkdown(m: ReturnType<typeof shapeResultModel>): string;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/** the words of the `[default]` row of a shape line, drawn only when the person's words gave an item count (hamr 2026-11-18: the card's `$` row is the Not checked line): `exactly 2 items` @param {{min?: number, max?: number}|null} [count] @returns {string|null} */
|
|
2
|
+
export function shapeDefaultWords(count?: {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
} | null): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* M19 am11 item 1: the item count a `~` rule's own words ARE ("exactly 4 list items" -> 4 to 4, "at least 3" -> at least 3, "at most 5" -> at most 5), or null. "at most 0" is no item count (bareguard's `maxItems` is at least 1): it stays a pick over the text.
|
|
8
|
+
* @param {string} text @returns {{min?: number, max?: number}|null}
|
|
9
|
+
*/
|
|
10
|
+
export function itemCountOf(text: string): {
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
} | null;
|
|
14
|
+
/**
|
|
15
|
+
* M19 am11: the words of the rule row that holds a signed item count (the `[default]` row's words, `the answer lists exactly N items`, for an exact count; `at least N items` / `at most N items` beside it). Pure.
|
|
16
|
+
* @param {{minItems?: number, maxItems?: number}} part @returns {string|null}
|
|
17
|
+
*/
|
|
18
|
+
export function shapeCountWords(part: {
|
|
19
|
+
minItems?: number;
|
|
20
|
+
maxItems?: number;
|
|
21
|
+
}): string | null;
|
|
22
|
+
/** an upper bound `n` as the person's own form: "under N unit" when their words say under/fewer than/less than/below N+1 (so the signed N is "under N+1"), else "at most N unit" @param {number} n @param {string} unit @param {string} said */
|
|
23
|
+
export function upper(n: number, unit: string, said: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* A field spec as one plain sentence, written by code from the signed fields, in the person's own form where their words show it ("under 200 characters", not "at most 199"). Pure.
|
|
26
|
+
* @param {Record<string, any>} spec `{kind, required?, ...bounds}` @param {string} [said] the person's own rule for the field @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
export function shapeFieldSentence(spec: Record<string, any>, said?: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* The signed part of ONE shape line, from the fields that stand (the `[you]` rule fields and the `[agent]` fields the person has not dropped or left Suggested).
|
|
31
|
+
* @param {{text: string, fields: {name: string, spec: Record<string, any>, rule?: number|null, by?: 'you'|'agent'}[], itemCount?: {n?: number, min?: number, max?: number}|null, countRules?: number[]}} o `countRules` = the `~` rules whose words are the item count
|
|
32
|
+
* @returns {Record<string, any>}
|
|
33
|
+
*/
|
|
34
|
+
export function buildShapePart({ text, fields, itemCount, countRules }: {
|
|
35
|
+
text: string;
|
|
36
|
+
fields: {
|
|
37
|
+
name: string;
|
|
38
|
+
spec: Record<string, any>;
|
|
39
|
+
rule?: number | null;
|
|
40
|
+
by?: "you" | "agent";
|
|
41
|
+
}[];
|
|
42
|
+
itemCount?: {
|
|
43
|
+
n?: number;
|
|
44
|
+
min?: number;
|
|
45
|
+
max?: number;
|
|
46
|
+
} | null;
|
|
47
|
+
countRules?: number[];
|
|
48
|
+
}): Record<string, any>;
|
|
49
|
+
/** the signed shape part of job line `n` in a close, or null @param {any} closeDecl @param {number} n */
|
|
50
|
+
export function shapePartOfLine(closeDecl: any, n: number): any;
|
|
51
|
+
/** the words of one signed field row: `name \u00B7 sentence` (the rule it comes from is the `~ [you]` tag's, the card's heading says what is checked) @param {any} f @param {string[]} rules the line's `~` rules @returns {string} */
|
|
52
|
+
export function shapeFieldText(f: any, rules: string[]): string;
|
|
53
|
+
/**
|
|
54
|
+
* The shape rows of a signed close, read from its shape parts: one per field (a `[you]` rule row's, an `[agent]` row's), then the line's `[default]` row. A close with no shape part has none.
|
|
55
|
+
* `rule` is the rule a `[you]` row is. Text is code's (never a model's).
|
|
56
|
+
* @param {any} closeDecl @param {any[]|null} [jobLines] the person's numbered lines
|
|
57
|
+
* @returns {{line: number, key: string, by: 'you'|'agent'|'default', text: string, name?: string, rule?: number}[]}
|
|
58
|
+
*/
|
|
59
|
+
export function shapeRowsOf(closeDecl: any, jobLines?: any[] | null): {
|
|
60
|
+
line: number;
|
|
61
|
+
key: string;
|
|
62
|
+
by: "you" | "agent" | "default";
|
|
63
|
+
text: string;
|
|
64
|
+
name?: string;
|
|
65
|
+
rule?: number;
|
|
66
|
+
}[];
|
|
67
|
+
/**
|
|
68
|
+
* The bareguard `itemShape` check of a signed shape part (clause 6, `buildStepSpec`): the answer field `results`, the item count the person's words gave, and one field spec per signed field.
|
|
69
|
+
* @param {any} part a `shape` part @param {string} id @param {any} [factPart] the step's fact part, when the line is facts+shape @returns {Record<string, any>}
|
|
70
|
+
*/
|
|
71
|
+
export function shapeItemCheck(part: any, id: string, factPart?: any): Record<string, any>;
|
|
72
|
+
/**
|
|
73
|
+
* The SHAPE of a `shape` part (clause 5, called by `rubricStepShapeReds`): its fields are named legally and once, each spec has a kind on the menu, the count is whole numbers, a rule number is a whole number, and bareguard itself
|
|
74
|
+
* accepts the check (`createRubric`, which refuses an impossible bound or a field spec it does not know, naming the path). Pure, never throws.
|
|
75
|
+
* @param {any} part @param {string} w the path of the part @param {(code: string, path: string, detail: string) => void} red
|
|
76
|
+
*/
|
|
77
|
+
export function shapeShapeReds(part: any, w: string, red: (code: string, path: string, detail: string) => void, factPart?: null): void;
|
|
78
|
+
/**
|
|
79
|
+
* One worked example item of a shape, written by code from the signed fields (never by a model): a value of each field's kind that the field's own bounds accept.
|
|
80
|
+
* @param {{name: string, spec: Record<string, any>}[]} fields @returns {Record<string, any>}
|
|
81
|
+
*/
|
|
82
|
+
export function shapeExampleItem(fields: {
|
|
83
|
+
name: string;
|
|
84
|
+
spec: Record<string, any>;
|
|
85
|
+
}[]): Record<string, any>;
|
|
86
|
+
export function shapeRowKey(line: number, name: string): string;
|
|
87
|
+
export function shapeDefaultKey(line: number): string;
|
|
88
|
+
/** why the truth of a shape line's items is not checked: the person judges it at Accept (the Not checked row of every shape line) */
|
|
89
|
+
export const SHAPE_TRUTH_PARTS: readonly string[];
|
|
90
|
+
export const SHAPE_TRUTH_WORDS: string;
|
|
91
|
+
/** the words of a shape card's heading, once above a shape line's rows (code's, never the model's) */
|
|
92
|
+
export const SHAPE_HEAD_PARTS: readonly string[];
|
|
93
|
+
export const SHAPE_HEAD: string;
|
|
94
|
+
export function shapePartOf(params: any): any;
|
|
95
|
+
export function shapeFieldBody(f: {
|
|
96
|
+
name: string;
|
|
97
|
+
kind: string;
|
|
98
|
+
required?: boolean;
|
|
99
|
+
bounds?: Record<string, any>;
|
|
100
|
+
}): Record<string, any>;
|
|
101
|
+
/** the answer field the `itemShape` check reads: the shape answer's one list (the step file is `{"results": [...]}`) */
|
|
102
|
+
export const SHAPE_FIELD: "results";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** the measured value of a `not-a-list` gap in a person's words, or `something else` when none came @param {unknown} measured @returns {string} */
|
|
2
|
+
export function measuredWords(measured: unknown): string;
|
|
3
|
+
/**
|
|
4
|
+
* Split one item red into its item (0-based), its field path (null when the red is about the item as a whole) and its reason. Null when the text is not an item red.
|
|
5
|
+
* @param {unknown} item @returns {{i: number, path: string|null, reason: string}|null}
|
|
6
|
+
*/
|
|
7
|
+
export function parseShapeItem(item: unknown): {
|
|
8
|
+
i: number;
|
|
9
|
+
path: string | null;
|
|
10
|
+
reason: string;
|
|
11
|
+
} | null;
|
|
12
|
+
/** the field a red names, as the signed spec names it: the first name of the path, a list entry's `[j]` and a nested `.name` left off @param {unknown} item @returns {string|null} */
|
|
13
|
+
export function itemFieldOf(item: unknown): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* One item red as a plain sentence: `item 2: "summary" is too long (201 characters, at most 200)`.
|
|
16
|
+
* @param {unknown} item `#<i>:<path>:<reason>` @returns {string}
|
|
17
|
+
*/
|
|
18
|
+
export function plainShapeItem(item: unknown): string;
|
|
19
|
+
/**
|
|
20
|
+
* One bareguard `itemShape` gap as plain lines (one per item red, or one for a whole-field gap).
|
|
21
|
+
* @param {{at: string, file: string, field?: string}} where `at` = `line N`, `file` = the step file's path, `field` = the answer field holding the items (default `results`)
|
|
22
|
+
* @param {any} g the gap @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
export function plainShapeGap({ at, file, field }: {
|
|
25
|
+
at: string;
|
|
26
|
+
file: string;
|
|
27
|
+
field?: string;
|
|
28
|
+
}, g: any): string;
|
|
29
|
+
/**
|
|
30
|
+
* The inverse of {@link plainShapeItem}: the item red (`#<i>:<path>:<reason>`) a plain sentence of ours says, or null when the text is none of ours. A red run records only the close's plain gap lines (the per-row record
|
|
31
|
+
* is the final close's), so the Result tab's grid reads them back through this; a test walks every reason through both directions.
|
|
32
|
+
* @param {string} text `item 3: "status" is not one of the allowed values` @returns {string|null}
|
|
33
|
+
*/
|
|
34
|
+
export function shapeItemOfPlain(text: string): string | null;
|
|
35
|
+
/** the words of a `not-a-list` gap's measured value (bareguard's `type:<kind>`); any other measured value is printed as it came */
|
|
36
|
+
export const MEASURED_WORDS: Readonly<{
|
|
37
|
+
'type:string': "plain text";
|
|
38
|
+
'type:number': "a number";
|
|
39
|
+
'type:boolean': "true or false";
|
|
40
|
+
'type:object': "an object";
|
|
41
|
+
'type:null': "empty";
|
|
42
|
+
}>;
|
|
43
|
+
export function shapeGapCount(g: any): number;
|
package/types/sheetbuild.d.ts
CHANGED
|
@@ -35,14 +35,13 @@ export function buildSheetLine({ line, tables, suggestions }: {
|
|
|
35
35
|
}[];
|
|
36
36
|
}>;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @param {{
|
|
41
|
-
* @returns {Promise<{
|
|
42
|
-
*
|
|
38
|
+
* Build the checks of every sheet line from the reply's suggestions, each routed to its job line by its own `line`. Every sheet line in `lines` gets a result, a line with no suggestion included (its rules are
|
|
39
|
+
* then Not checked with the no-pick sentence, never silently nothing). A suggestion that names no sheet line, or is not an object, is refused and listed with its helper.
|
|
40
|
+
* @param {{lines: {n: number, text?: string, rules?: string[], guardrail?: string, rule?: string}[], tables: Record<string, {header: string[], rows: any[]}>, suggestions: any[]}} o
|
|
41
|
+
* @returns {Promise<{built: Record<number, Awaited<ReturnType<typeof buildSheetLine>>>, checks: any[], notChecked: Record<string, string>, refused: {line: number|null, helper: string, why: string}[]}>}
|
|
42
|
+
* `notChecked`: `line N: "rule"` -> the refusal that named it (or `NO_VALUE_WHY`), for each rule of a sheet line that no check holds
|
|
43
43
|
*/
|
|
44
|
-
export function buildSheetChecks({
|
|
45
|
-
declaration: any;
|
|
44
|
+
export function buildSheetChecks({ lines, tables, suggestions }: {
|
|
46
45
|
lines: {
|
|
47
46
|
n: number;
|
|
48
47
|
text?: string;
|
|
@@ -54,19 +53,38 @@ export function buildSheetChecks({ declaration, lines, tables }: {
|
|
|
54
53
|
header: string[];
|
|
55
54
|
rows: any[];
|
|
56
55
|
}>;
|
|
56
|
+
suggestions: any[];
|
|
57
57
|
}): Promise<{
|
|
58
|
-
|
|
58
|
+
built: Record<number, Awaited<ReturnType<typeof buildSheetLine>>>;
|
|
59
|
+
checks: any[];
|
|
59
60
|
notChecked: Record<string, string>;
|
|
60
61
|
refused: {
|
|
61
|
-
line: number;
|
|
62
|
+
line: number | null;
|
|
62
63
|
helper: string;
|
|
63
64
|
why: string;
|
|
64
65
|
}[];
|
|
65
|
-
unbuilt: {
|
|
66
|
-
line: number;
|
|
67
|
-
lost: string[];
|
|
68
|
-
}[];
|
|
69
66
|
}>;
|
|
67
|
+
/**
|
|
68
|
+
* M17 am5 / P5 (fwd's own, kept from the declaration-rewriting builder): the green steps that read a sheet and hold no check after the build (no suggestion, or none code could build), each with its rules as Not-checked lines
|
|
69
|
+
* and the refusal that named each (else the no-pick sentence). What class such a step gets is the caller's to decide (src/blockassemble.js closeUnbuiltSheetSteps); this file writes no class.
|
|
70
|
+
* @param {{declaration: any, lines: {n: number, text?: string, rules?: string[], guardrail?: string, rule?: string}[], roles: string[], notChecked: Record<string, string>}} o
|
|
71
|
+
* @returns {{line: number, lost: string[]}[]}
|
|
72
|
+
*/
|
|
73
|
+
export function unbuiltSheetLines({ declaration, lines, roles, notChecked }: {
|
|
74
|
+
declaration: any;
|
|
75
|
+
lines: {
|
|
76
|
+
n: number;
|
|
77
|
+
text?: string;
|
|
78
|
+
rules?: string[];
|
|
79
|
+
guardrail?: string;
|
|
80
|
+
rule?: string;
|
|
81
|
+
}[];
|
|
82
|
+
roles: string[];
|
|
83
|
+
notChecked: Record<string, string>;
|
|
84
|
+
}): {
|
|
85
|
+
line: number;
|
|
86
|
+
lost: string[];
|
|
87
|
+
}[];
|
|
70
88
|
/** the fields of a suggestion code does not read: it names every check itself */
|
|
71
89
|
export const SUGGESTION_DROPPED: readonly string[];
|
|
72
90
|
export type Placed = {
|
package/types/sheetclaims.d.ts
CHANGED
|
@@ -25,3 +25,19 @@ export function sheetBrief(checks: any[]): {
|
|
|
25
25
|
answer: string;
|
|
26
26
|
fields: Record<string, Record<string, any>>;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* The plain lines the report carries for each sumIf / countIf check: `Count of rows 3, 5, 9: 3 (computed by code from the rows named)` and `Total of rows 3, 5, 9: 1,234.50 (computed by code from the rows named)`.
|
|
30
|
+
* Computed from the FROZEN table and the rows the step named in the `rows` check of the same table and `where` (M15 am3a), never from a number the step wrote. A check with no such `rows` check, or whose box holds no list
|
|
31
|
+
* of integers, writes no line. A named row that is no row of the sheet adds nothing; a blank cell is skipped; a cell that is no strict number makes the total "not computed", naming the row and the column.
|
|
32
|
+
* @param {any[]} checks the step's sheet checks as signed @param {any} claims the step's boxes by claim name @param {Record<string, {header: string[], rows: {rowNumber: number, cells: string[]}[]}>} tables by input label
|
|
33
|
+
* @returns {string[]}
|
|
34
|
+
*/
|
|
35
|
+
export function sheetTotalLines(checks: any[], claims: any, tables: Record<string, {
|
|
36
|
+
header: string[];
|
|
37
|
+
rows: {
|
|
38
|
+
rowNumber: number;
|
|
39
|
+
cells: string[];
|
|
40
|
+
}[];
|
|
41
|
+
}>): string[];
|
|
42
|
+
export function isRec(v: unknown): boolean;
|
|
43
|
+
export const ROW_MATH_OPS: readonly string[];
|
package/types/sheetfind.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export function findColumn(csvText: string, word: string): FoundHeader | FoundAs
|
|
|
13
13
|
/** a column fits when a plain number fills at least this share of the rows (F71 (b)) */
|
|
14
14
|
export const FIT_RATIO: 0.9;
|
|
15
15
|
export function columnQuestion(word: string, found: FoundAsk, line: number, tied?: boolean): string;
|
|
16
|
+
export function columnTieQuestion(word: string, columns: string[], line: number): string;
|
|
16
17
|
export function columnTail(line: number, tied?: boolean): string;
|
|
17
18
|
/**
|
|
18
19
|
* the word IS a column (nothing to ask)
|
package/types/sheetrows.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** the fields that say what a check IS: all but the names code gives it (id, claim), the rules it covers and its row tag. Two drafts name checks differently, so "the very same check" is read on these @param {any} c @returns {Record<string, any>} */
|
|
2
|
+
export function sheetCheckBody(c: any): Record<string, any>;
|
|
1
3
|
/**
|
|
2
4
|
* The sheet rows of a declaration, read from its steps' `close.sheet`: the signed rows (for `declaration.checkList`) and the card rows (words, tag, whether a Drop is offered).
|
|
3
5
|
* @param {{declaration: any, lines: any[], csvRoles: string[]}} o
|
|
@@ -20,50 +22,18 @@ export function sheetRowsOf({ declaration, lines, csvRoles }: {
|
|
|
20
22
|
}[];
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
|
-
* The plan's card with the sheet rows on it: the sheet rows after the block's rows
|
|
24
|
-
* @param {{rows: any[], suggested: any[]}} card the block's card (src/cardlist.js) @param {{card: any[]}} sheet `sheetRowsOf`
|
|
25
|
+
* The plan's card with the sheet rows on it: the sheet rows after the block's rows. A dropped sheet check is among the block's own suggestions (Add), like any dropped `!` row (src/cardlist.js).
|
|
26
|
+
* @param {{rows: any[], suggested: any[]}} card the block's card (src/cardlist.js) @param {{card: any[]}} sheet `sheetRowsOf`
|
|
25
27
|
*/
|
|
26
28
|
export function withSheetCard(card: {
|
|
27
29
|
rows: any[];
|
|
28
30
|
suggested: any[];
|
|
29
31
|
}, sheet: {
|
|
30
32
|
card: any[];
|
|
31
|
-
}
|
|
32
|
-
key: string;
|
|
33
|
-
line: number;
|
|
34
|
-
text: string;
|
|
35
|
-
}[]): {
|
|
33
|
+
}): {
|
|
36
34
|
rows: any[];
|
|
37
35
|
suggested: any[];
|
|
38
36
|
};
|
|
39
|
-
/**
|
|
40
|
-
* M17 am3: the key of the check of the line that IS a dropped one (same typed fields; code names every check, so an id says nothing across drafts), or null. A Revise keeps a Drop only for the very same check.
|
|
41
|
-
* @param {any} declaration @param {{line: number, check: any}} d a record of `droppedSheetOf` @returns {string|null}
|
|
42
|
-
*/
|
|
43
|
-
export function keyOfSameCheck(declaration: any, d: {
|
|
44
|
-
line: number;
|
|
45
|
-
check: any;
|
|
46
|
-
}): string | null;
|
|
47
|
-
/**
|
|
48
|
-
* The person's Drop or Add on a sheet row, applied to the declaration (a copy). Same words as the block's own refusals (src/checkblock.js `rowChoice`).
|
|
49
|
-
* @param {{declaration: any, lines: any[], csvRoles: string[], op: 'drop'|'add', key: string, dropped: any[]}} o
|
|
50
|
-
* @returns {{ok: true, declaration: any, dropped: any[]}|{ok: false, why: string}}
|
|
51
|
-
*/
|
|
52
|
-
export function sheetChoice({ declaration, lines, csvRoles, op, key, dropped }: {
|
|
53
|
-
declaration: any;
|
|
54
|
-
lines: any[];
|
|
55
|
-
csvRoles: string[];
|
|
56
|
-
op: "drop" | "add";
|
|
57
|
-
key: string;
|
|
58
|
-
dropped: any[];
|
|
59
|
-
}): {
|
|
60
|
-
ok: true;
|
|
61
|
-
declaration: any;
|
|
62
|
-
dropped: any[];
|
|
63
|
-
} | {
|
|
64
|
-
ok: false;
|
|
65
|
-
why: string;
|
|
66
|
-
};
|
|
67
37
|
/**
|
|
68
38
|
* The list of a declaration with its sheet rows: the block's rows first, then the sheet rows. A declaration with no sheet check keeps the list exactly as it was.
|
|
69
39
|
* @param {{declaration: any, lines: any[], csvRoles: string[]}} o @returns {{declaration: any, sheet: ReturnType<typeof sheetRowsOf>}}
|
|
@@ -78,4 +48,3 @@ export function withSheetRows({ declaration, lines, csvRoles }: {
|
|
|
78
48
|
};
|
|
79
49
|
export function sheetRowKey(line: number, id: string): string;
|
|
80
50
|
export function isSheetKey(key: unknown): boolean;
|
|
81
|
-
export function droppedSheetOf(record: any): any[];
|
package/types/ticketrows.d.ts
CHANGED
|
@@ -57,5 +57,5 @@ export function ticketListReds(declaration: any): string[];
|
|
|
57
57
|
/** @type {readonly ('ticketFilter'|'ticketWatch')[]} */
|
|
58
58
|
export const TICKET_FIELDS: readonly ("ticketFilter" | "ticketWatch")[];
|
|
59
59
|
/** the Not-checked reason of a ticket rule no legal value was suggested for (the block's own noPick sentence is used by the caller's words) */
|
|
60
|
-
export const NO_VALUE_WHY: "No check was picked for it, so you judge it at
|
|
60
|
+
export const NO_VALUE_WHY: "No check was picked for it, so you judge it at Accept.";
|
|
61
61
|
export function ticketRowKey(line: number, rule: number, field: string): string;
|