fwdloop 0.20.0 → 0.22.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 (92) hide show
  1. package/README.md +2 -0
  2. package/bin/fwdloop +85 -34
  3. package/package.json +4 -3
  4. package/src/audit-fold.js +181 -0
  5. package/src/authoring.js +33 -7
  6. package/src/books.js +1 -1
  7. package/src/checked.js +18 -1
  8. package/src/cited-record.js +138 -0
  9. package/src/cited-source.js +49 -0
  10. package/src/citedcheck.js +306 -0
  11. package/src/citedwords.js +197 -0
  12. package/src/closers.js +105 -9
  13. package/src/ctx-tools.js +2 -14
  14. package/src/declaration.js +85 -5
  15. package/src/diary.js +49 -0
  16. package/src/docx.js +16 -2
  17. package/src/draft-steps.js +1 -1
  18. package/src/drafter.js +292 -25
  19. package/src/flow.js +33 -7
  20. package/src/flowmodel.js +63 -5
  21. package/src/input-facts.js +20 -3
  22. package/src/model-step.js +132 -9
  23. package/src/pageask.js +136 -0
  24. package/src/pagebits.js +107 -0
  25. package/src/pagedropwords.js +171 -0
  26. package/src/pagedry.js +120 -0
  27. package/src/pagefetch.js +164 -0
  28. package/src/pagelook.js +155 -0
  29. package/src/pagemap.js +55 -0
  30. package/src/pageplace.js +103 -0
  31. package/src/pagerules.js +318 -0
  32. package/src/panel/author.js +41 -20
  33. package/src/panel/authorcard.js +11 -1
  34. package/src/panel/authorflows.js +21 -15
  35. package/src/panel/authorstart.js +2 -4
  36. package/src/panel/authortrigger.js +14 -4
  37. package/src/panel/data.js +130 -10
  38. package/src/panel/index.html +499 -41
  39. package/src/panel/result.js +295 -0
  40. package/src/panel/server.js +27 -3
  41. package/src/primitives.js +43 -2
  42. package/src/provider.js +5 -2
  43. package/src/redact.js +17 -0
  44. package/src/runner.js +128 -21
  45. package/src/schedule.js +3 -3
  46. package/src/setup.js +16 -1
  47. package/src/sheetfind.js +50 -0
  48. package/src/sheetlook.js +157 -0
  49. package/src/signed-text.js +11 -1
  50. package/src/thinking.js +39 -0
  51. package/src/try-checks.js +68 -0
  52. package/src/types.js +4 -2
  53. package/types/audit-fold.d.ts +54 -0
  54. package/types/authoring.d.ts +20 -2
  55. package/types/books.d.ts +17 -0
  56. package/types/checked.d.ts +10 -0
  57. package/types/cited-record.d.ts +21 -0
  58. package/types/cited-source.d.ts +18 -0
  59. package/types/citedcheck.d.ts +95 -0
  60. package/types/citedwords.d.ts +97 -0
  61. package/types/closers.d.ts +55 -3
  62. package/types/declaration.d.ts +15 -1
  63. package/types/diary.d.ts +57 -0
  64. package/types/docx.d.ts +14 -0
  65. package/types/drafter.d.ts +244 -2
  66. package/types/flow.d.ts +21 -0
  67. package/types/flowmodel.d.ts +40 -3
  68. package/types/input-facts.d.ts +12 -2
  69. package/types/model-step.d.ts +38 -3
  70. package/types/pageask.d.ts +75 -0
  71. package/types/pagebits.d.ts +32 -0
  72. package/types/pagedropwords.d.ts +40 -0
  73. package/types/pagedry.d.ts +38 -0
  74. package/types/pagefetch.d.ts +86 -0
  75. package/types/pagelook.d.ts +75 -0
  76. package/types/pagemap.d.ts +31 -0
  77. package/types/pageplace.d.ts +22 -0
  78. package/types/pagerules.d.ts +86 -0
  79. package/types/panel/authorcard.d.ts +2 -0
  80. package/types/panel/authorflows.d.ts +2 -0
  81. package/types/panel/data.d.ts +26 -0
  82. package/types/panel/result.d.ts +156 -0
  83. package/types/provider.d.ts +3 -1
  84. package/types/redact.d.ts +1 -0
  85. package/types/runner.d.ts +156 -7
  86. package/types/schedule.d.ts +0 -11
  87. package/types/setup.d.ts +13 -0
  88. package/types/sheetfind.d.ts +46 -0
  89. package/types/sheetlook.d.ts +120 -0
  90. package/types/thinking.d.ts +31 -0
  91. package/types/try-checks.d.ts +55 -0
  92. package/types/types.d.ts +20 -3
@@ -19,6 +19,37 @@ export function worstThinkingStatus(statuses: Array<string | null | undefined>):
19
19
  * @param {string|null} status @returns {string|null}
20
20
  */
21
21
  export function thinkingSay(status: string | null): string | null;
22
+ /**
23
+ * M4d am26 items 1-2: the words after a try line in the Audit, from that try's audit-row `thinking` {asked, status} (am25). bareagent confirmed it
24
+ * ('applied'): `thinking on` / `thinking off`. Any other status: `thinkingSay`'s words above, the same ones Chat uses. A row with no `thinking` (before am25,
25
+ * or no model call) has no words: nothing is guessed.
26
+ * M4d am27: a row with a `thinking` record but no status (the model sent no reply: an error, the time limit, a Stop before the first reply) reads
27
+ * `thinking <asked> (no reply)`, from what was ASKED; the words never say thinking happened. Nothing asked (asked null) has no words.
28
+ * @param {{asked?: unknown, status?: unknown}|null|undefined} thinking @returns {string|null}
29
+ */
30
+ export function thinkingTryWords(thinking: {
31
+ asked?: unknown;
32
+ status?: unknown;
33
+ } | null | undefined): string | null;
34
+ /**
35
+ * M4d am28 items 2-4 (replaces am26 item 3's words and the hidden row): the Job tab's Thinking value, from the run's own record
36
+ * (`boxOn` = the Chat "Thinking on" box as the run started). A run with no record (before am25) is `null` and reads `—`, never a guess from model.json.
37
+ * Words: bareloop's `thinkingJobText`.
38
+ * // borrowed-from: bareloop src/thinking.js@b79e7d9
39
+ * @param {boolean|null} boxOn
40
+ */
41
+ export function thinkingRuleWords(boxOn: boolean | null): "—" | "always on" | "on retries";
42
+ /**
43
+ * M4d am25 item 1/2: the ONE owner of what thinking a step's model call asks for. Code decides, never the model.
44
+ * Box ticked (the job's Chat "Thinking on" box, kept with the job): every try 'on'. Box off: the 1st try 'off'; the 2nd and later tries 'on'.
45
+ * A step redone after a human Redo is numbered after the step's last try (the runner's `attemptOffset`, am30), so it is always a 2nd-or-later try and thinks 'on'.
46
+ * @param {{boxOn: boolean, attempt: number}} a the runner's 1-based attempt number for this step
47
+ * @returns {'on'|'off'}
48
+ */
49
+ export function stepThinkingMode({ boxOn, attempt }: {
50
+ boxOn: boolean;
51
+ attempt: number;
52
+ }): "on" | "off";
22
53
  /** The sentence under a greyed "Thinking on" box (amendment 7 item 2). */
23
54
  export const THINKING_FIXED_SAY: "can't change this for this model";
24
55
  /** The note beside the Chat "Thinking on" box, before any draft, for a model bareagent has not checked (M4d am11 item 2). */
@@ -0,0 +1,55 @@
1
+ /** The size words of a byte count: `412 B`, `7.9 KB`, `1.2 MB`. @param {number} n */
2
+ export function sizeWords(n: number): string;
3
+ /** #2, the model's own `done`. @param {{verdict: 'done'|'not-done'}} doneCheck @param {unknown} artifact */
4
+ export function doneRecord(doneCheck: {
5
+ verdict: "done" | "not-done";
6
+ }, artifact: unknown): {
7
+ n: number;
8
+ text: string;
9
+ ok: boolean;
10
+ result: string | null;
11
+ source: string;
12
+ };
13
+ /** #1, the happened check: the output exists and is not empty. @param {{verdict: string, red?: string}} happened @param {unknown} artifact */
14
+ export function happenedRecord(happened: {
15
+ verdict: string;
16
+ red?: string;
17
+ }, artifact: unknown): {
18
+ n: number;
19
+ text: string;
20
+ ok: boolean;
21
+ result: string;
22
+ source: string;
23
+ };
24
+ /** The output a try judged: the file it is saved as when the step closes, with the size and sha256 of those exact bytes. Never its content. @param {{emits?: string}} step @param {unknown} artifact */
25
+ export function outputRecord(step: {
26
+ emits?: string;
27
+ }, artifact: unknown): {
28
+ file: string;
29
+ bytes: number;
30
+ sha256: string;
31
+ };
32
+ /**
33
+ * #3 and up: the close's own checks. A softgreen close carries each of its checks; a green close is one check over all its cited fields; a close that
34
+ * judged nothing (`unparseable`, `crash`) is one check that could not run, with that third outcome as its result.
35
+ * @param {any} step @param {any} artifact @param {{verdict: string, red?: string|null, checks?: Array<{text:string, ok:boolean, result:string|null}>}} closed
36
+ */
37
+ export function closeRecords(step: any, artifact: any, closed: {
38
+ verdict: string;
39
+ red?: string | null;
40
+ checks?: Array<{
41
+ text: string;
42
+ ok: boolean;
43
+ result: string | null;
44
+ }>;
45
+ }): {
46
+ n: number;
47
+ text: string;
48
+ ok: boolean;
49
+ result: string | null;
50
+ source: string;
51
+ }[];
52
+ export const EVERY_STEP: "every step";
53
+ export function lineSource(step: {
54
+ fromLine?: unknown;
55
+ }): string;
package/types/types.d.ts CHANGED
@@ -56,11 +56,11 @@ export type SourceSlot = {
56
56
  */
57
57
  role: string;
58
58
  /**
59
- * - only `file:` sources are available before M9.
59
+ * - `file:` (a path) or `page:` (a web address, M10 am3); nothing else is available.
60
60
  */
61
- kind: "file";
61
+ kind: "file" | "page";
62
62
  /**
63
- * - everything after `file:` to end of line, trimmed.
63
+ * - everything after `file:` / `page:` to end of line, trimmed.
64
64
  */
65
65
  path: string;
66
66
  };
@@ -277,6 +277,23 @@ export type CloseVerdict = {
277
277
  verdict: "green" | "red" | "hitl" | "unparseable" | "crash";
278
278
  red?: string | null | undefined;
279
279
  reds?: string[] | undefined;
280
+ /**
281
+ * a softgreen close: every check it ran (M4d am29 item 2)
282
+ */
283
+ checks?: {
284
+ id: string;
285
+ text: string;
286
+ ok: boolean;
287
+ result: string | null;
288
+ }[] | undefined;
289
+ /**
290
+ * a cited green close (M10 piece 4): the fact part and the check's own answer, for the run's cited-check record
291
+ */
292
+ cited?: {
293
+ part: any;
294
+ check: any;
295
+ results?: unknown;
296
+ } | undefined;
280
297
  };
281
298
  /**
282
299
  * One row appended to `runs/<run-id>/audit.jsonl` (M2 scope item 9).