@vincemakes/kiso-tui-cells 0.49.0 → 0.50.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.
@@ -162,6 +162,10 @@ export type BodyCell = {
162
162
  * the target, the reason in the W4 parentheses idiom, NO timing
163
163
  * metadata (the call never ran). */
164
164
  reason: string | null;
165
+ /** O1: the write created its file (the result's "created" tag)
166
+ * — the input no longer cites "absent" when the host binds
167
+ * the observed revision. */
168
+ created?: boolean;
165
169
  /** A5: the approval verdict — the permission_decided event bound
166
170
  * into the cell (no free-standing ` approved` orphan row). The
167
171
  * settled head row aggregates name + status + decidedBy in ONE
@@ -1818,8 +1818,8 @@ function editDiffOf(c) {
1818
1818
  if (c.name !== "edit_file" && c.name !== "write_file")
1819
1819
  return null;
1820
1820
  const known = editDiffMemo.get(c);
1821
- if (known !== undefined)
1822
- return known;
1821
+ if (known !== undefined && known.created === (c.created === true))
1822
+ return known.out;
1823
1823
  let input = null;
1824
1824
  try {
1825
1825
  const v = JSON.parse(c.inputFull);
@@ -1840,14 +1840,15 @@ function editDiffOf(c) {
1840
1840
  else if (input !== null && typeof input.content === "string") {
1841
1841
  const content = input.content.replace(/\n$/, "");
1842
1842
  const all = content === "" ? [] : content.split("\n");
1843
- // a write that cites "absent" creates the file; any other rewrites
1844
- // one whose old text is not in the log, so its lines are shown as
1845
- // they now read, not as additions
1846
- const created = input.expectedRevision === "absent";
1843
+ // a write that cites "absent" (or, with the observed revision
1844
+ // bound by the host, whose result is tagged "created") creates the
1845
+ // file; any other rewrites one whose old text is not in the log, so
1846
+ // its lines are shown as they now read, not as additions
1847
+ const created = input.expectedRevision === "absent" || c.created === true;
1847
1848
  const n = `${all.length} line${all.length === 1 ? "" : "s"}`;
1848
1849
  out = { lines: all.map((text) => ({ kind: created ? "+" : " ", text })), meta: created ? `new file \u00b7 ${n}` : `rewrote \u00b7 ${n}`, cap: WRITE_HEAD };
1849
1850
  }
1850
- editDiffMemo.set(c, out);
1851
+ editDiffMemo.set(c, { created: c.created === true, out });
1851
1852
  return out;
1852
1853
  }
1853
1854
  /** The TOOL's OWN truncation note (W10) — a different fact from the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-tui-cells",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "kiso tui-cells \u2014 the components cell renderer (components, diff, width, the render slice). Zero runtime dependencies: input is data, output is bytes.",
5
5
  "type": "module",
6
6
  "license": "MIT",