fwdloop 0.25.0 → 0.25.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fwdloop",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "description": "Describe a job as steps and guardrails; an agent builds the workflow, pauses for humans where you said, checks every step happened, and reruns it under budgets it cannot touch.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/csv.js CHANGED
@@ -33,10 +33,11 @@ export function parseCellRef(cell) {
33
33
  /**
34
34
  * Split CSV text into records (RFC 4180): a cell may be quoted ("1,200.50" is one cell, "" inside quotes is one quote, a comma or a line break inside quotes
35
35
  * stays in the cell); LF and CRLF both end a record. Each record carries `line`, the 1-based line of the text it starts on, so a line break inside a quoted
36
- * cell still counts. A blank line (nothing, not even quotes) is no record, but its line is counted. A quote inside an unquoted cell is just a character.
36
+ * cell still counts. A leading byte-order mark is dropped. A blank line (nothing, not even quotes) is no record, but its line is counted. A quote inside an unquoted cell is just a character.
37
37
  * @param {string} text @returns {{line: number, fields: string[]}[]}
38
38
  */
39
39
  function records(text) {
40
+ if (text.charCodeAt(0) === 0xFEFF) text = text.slice(1); // Excel "CSV UTF-8" starts with a byte-order mark; it is not part of the first cell (the one place it is dropped)
40
41
  /** @type {{line: number, fields: string[]}[]} */
41
42
  const out = [];
42
43
  let line = 1;
package/src/runfile.js CHANGED
@@ -49,12 +49,11 @@ export function readRunInputs(runDir) {
49
49
  /**
50
50
  * M8b item 1: the ONE writer of `run.json`, called once when a fresh run has frozen its inputs (`runFlow`); never over an existing record. `model` is the pick
51
51
  * the run started on (M4d am33; null = the section is left out), `thinking` the job's "Thinking on" box as it was at the start (M4d am25: written for every fresh
52
- * run, ticked or not), `inputs` the manifest `freezeInputs` returned. A section given as null is left out;
53
- * a fresh run always has `thinking` and `inputs`.
54
- * @param {string} runDir @param {{ model: { slot: string, model: string }|null, thinking: boolean|null, inputs: any[]|null }} start
52
+ * run, ticked or not), `inputs` the manifest `freezeInputs` returned. A fresh run always has `thinking` and `inputs`.
53
+ * @param {string} runDir @param {{ model: { slot: string, model: string }|null, thinking: boolean, inputs: any[] }} start
55
54
  */
56
55
  export function writeRunStart(runDir, { model, thinking, inputs }) {
57
56
  writeFileSync(join(runDir, RUN_FILE), `${JSON.stringify({
58
- ...(model ? { model: { slot: model.slot, model: model.model } } : {}), ...(thinking === null ? {} : { thinking }), ...(inputs === null ? {} : { inputs }),
57
+ ...(model ? { model: { slot: model.slot, model: model.model } } : {}), thinking, inputs,
59
58
  }, null, 2)}\n`, { mode: 0o600, flag: 'wx' });
60
59
  }
@@ -32,17 +32,16 @@ export function readRunInputs(runDir: string | null): {
32
32
  /**
33
33
  * M8b item 1: the ONE writer of `run.json`, called once when a fresh run has frozen its inputs (`runFlow`); never over an existing record. `model` is the pick
34
34
  * the run started on (M4d am33; null = the section is left out), `thinking` the job's "Thinking on" box as it was at the start (M4d am25: written for every fresh
35
- * run, ticked or not), `inputs` the manifest `freezeInputs` returned. A section given as null is left out;
36
- * a fresh run always has `thinking` and `inputs`.
37
- * @param {string} runDir @param {{ model: { slot: string, model: string }|null, thinking: boolean|null, inputs: any[]|null }} start
35
+ * run, ticked or not), `inputs` the manifest `freezeInputs` returned. A fresh run always has `thinking` and `inputs`.
36
+ * @param {string} runDir @param {{ model: { slot: string, model: string }|null, thinking: boolean, inputs: any[] }} start
38
37
  */
39
38
  export function writeRunStart(runDir: string, { model, thinking, inputs }: {
40
39
  model: {
41
40
  slot: string;
42
41
  model: string;
43
42
  } | null;
44
- thinking: boolean | null;
45
- inputs: any[] | null;
43
+ thinking: boolean;
44
+ inputs: any[];
46
45
  }): void;
47
46
  /** the file's name in the run's folder */
48
47
  export const RUN_FILE: "run.json";