onionskin-cli 0.0.3 → 0.0.6

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 (109) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/INSTALL.md +5 -1
  3. package/NOTICE +34 -0
  4. package/README.md +102 -34
  5. package/docs/contracts/batch.schema.json +27 -4
  6. package/docs/contracts/ops.schema.json +117 -5
  7. package/package.json +4 -2
  8. package/scripts/checker/check.py +24 -5
  9. package/scripts/checker/requirements.txt +482 -5
  10. package/scripts/requirements.txt +482 -5
  11. package/scripts/rewriter/apple/main.swift +1 -1
  12. package/scripts/rewriter/apple/onionskin-fm +0 -0
  13. package/scripts/rewriter/apple/onionskin-fm.json +1 -1
  14. package/skills/onionskin/SKILL.md +12 -9
  15. package/skills/onionskin/reference/batch.md +5 -3
  16. package/skills/onionskin/reference/formats.md +5 -1
  17. package/skills/onionskin/reference/ops.md +48 -4
  18. package/skills/onionskin/reference/troubleshooting.md +31 -0
  19. package/src/agent-detect.js +28 -2
  20. package/src/agent-prompt.js +12 -1
  21. package/src/agent-runner.js +110 -20
  22. package/src/anchor-work.js +154 -0
  23. package/src/anchor-worker.js +38 -0
  24. package/src/anchors.js +61 -11
  25. package/src/apply.js +119 -47
  26. package/src/batch.js +32 -8
  27. package/src/check-worker.js +8 -5
  28. package/src/checker.js +238 -33
  29. package/src/cli.js +248 -42
  30. package/src/constants.js +34 -1
  31. package/src/diff.js +3 -1
  32. package/src/doctor.js +12 -3
  33. package/src/docx.js +464 -87
  34. package/src/edit-hash.js +19 -0
  35. package/src/fsutil.js +14 -6
  36. package/src/history-worker.js +8 -8
  37. package/src/history.js +144 -31
  38. package/src/html-active.js +384 -0
  39. package/src/html-envelope.js +51 -0
  40. package/src/html-parser.js +8 -0
  41. package/src/html-render-worker.js +25 -0
  42. package/src/html-render.js +939 -0
  43. package/src/html-utf8.js +65 -0
  44. package/src/html-write-worker.js +14 -0
  45. package/src/html-write.js +380 -0
  46. package/src/html.js +1259 -0
  47. package/src/local.js +68 -4
  48. package/src/merge-package.js +1166 -0
  49. package/src/merge-pptx.js +98 -38
  50. package/src/merge-proof.js +1019 -0
  51. package/src/merge-worker.js +60 -0
  52. package/src/merge-xlsx.js +84 -29
  53. package/src/merge.js +286 -83
  54. package/src/nfc.js +46 -0
  55. package/src/notes.js +122 -0
  56. package/src/offload.js +419 -1
  57. package/src/open-worker.js +27 -0
  58. package/src/ops/common.js +2 -1
  59. package/src/ops/docx-table.js +5 -3
  60. package/src/ops/docx.js +58 -29
  61. package/src/ops/html.js +394 -0
  62. package/src/ops/pptx.js +82 -23
  63. package/src/ops/run.js +23 -3
  64. package/src/ops/runs.js +215 -13
  65. package/src/ops/schema.js +8 -1
  66. package/src/ops/xlsx.js +121 -10
  67. package/src/ops-worker.js +17 -0
  68. package/src/package.js +43 -4
  69. package/src/person.js +2 -1
  70. package/src/pptx.js +323 -23
  71. package/src/question.js +10 -3
  72. package/src/quick-plan.js +13 -6
  73. package/src/quick.js +1 -1
  74. package/src/redline-check.js +12 -2
  75. package/src/redline-worker.js +10 -14
  76. package/src/reply.js +46 -19
  77. package/src/retain.js +223 -0
  78. package/src/review.js +32 -18
  79. package/src/rewrite-check.js +2 -2
  80. package/src/rewriter.js +38 -8
  81. package/src/sanitize.js +16 -3
  82. package/src/server-entry.js +4 -3
  83. package/src/server.js +175 -62
  84. package/src/session.js +1151 -210
  85. package/src/setup.js +20 -2
  86. package/src/stop-gate.js +34 -0
  87. package/src/suggest-reply.js +42 -7
  88. package/src/suggest.js +14 -29
  89. package/src/text.js +161 -11
  90. package/src/update.js +517 -0
  91. package/src/voice-guide.js +15 -9
  92. package/src/voice-learn.js +15 -4
  93. package/src/voice-sample-worker.js +7 -6
  94. package/src/voice-store.js +11 -4
  95. package/src/voice-worker.js +4 -6
  96. package/src/voice.js +2 -1
  97. package/src/worker-host.js +23 -0
  98. package/src/xlsx.js +378 -97
  99. package/src/xml-tree.js +6 -3
  100. package/src/xml.js +82 -34
  101. package/src/zip-write.js +10 -5
  102. package/src/zip.js +73 -18
  103. package/vendor/parse5/LICENSE.txt +32 -0
  104. package/vendor/parse5/parse5.mjs +7822 -0
  105. package/vendor/parse5.lock.json +23 -0
  106. package/web/dist/assets/{index-DS-WST1E.js → index-CjsTf5gj.js} +58 -52
  107. package/web/dist/assets/index-DnbLtHhG.css +1 -0
  108. package/web/dist/index.html +2 -2
  109. package/web/dist/assets/index-BCAEKiOG.css +0 -1
package/src/merge-pptx.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { EDITS_OVERFLOW } from "./constants.js";
1
2
  import { minimalReplace } from "./merge.js";
2
3
  import { findAll } from "./ops/runs.js";
3
4
  import { parseDeck } from "./pptx.js";
@@ -16,6 +17,7 @@ import { untrusted } from "./sanitize.js";
16
17
  // format, so it is used only where the shape's text has one format; otherwise the text is handed back.
17
18
 
18
19
  const CAP = 2000;
20
+ const turn = () => new Promise((resolve) => setImmediate(resolve));
19
21
  const cut = (t) => (t.length > CAP ? `${t.slice(0, CAP)}...` : t);
20
22
  const sid = (s) => String(s.id ?? `#${s.index}`);
21
23
  const key = (sh) => `${sh.id}#${sh.ordinal}`;
@@ -32,7 +34,7 @@ function readEdits(edits) {
32
34
  for (const e of edits || []) {
33
35
  const kind = String(e?.kind ?? "");
34
36
  const slide = Number.isInteger(e?.slide) ? e.slide : null;
35
- if (TEXT.has(kind)) continue;
37
+ if (TEXT.has(kind) || kind === EDITS_OVERFLOW) continue; // the list was cut: what it misses is found in the bytes (src/merge-proof.js handBack)
36
38
  if (kind === "format") out.format.add(slide);
37
39
  else if (kind.startsWith("shape.")) out.shapes.add(slide);
38
40
  else if (kind.startsWith("slide.")) out.slides = true;
@@ -41,24 +43,46 @@ function readEdits(edits) {
41
43
  return out;
42
44
  }
43
45
 
44
- /** The ops that turn the base text of one shape into the user's: one replace per changed line (last line first), else the whole text. */
45
- function shapeOps(target, old, text) {
46
+ // Lines changed in one shape that are carried one replace each; past it the shape's whole text is set (one op). The engine runs each
47
+ // op on the whole shape, about 18 microseconds per line of it here: 2,000 changed lines of a 2,000-line shape took 50 s to apply, 100 of
48
+ // a 25,000-line shape 46 s. So both count: at most MAX_LINE_OPS replaces, and at most LINE_OP_WORK (replaces x lines), about 2 s.
49
+ export const MAX_LINE_OPS = 100;
50
+ const LINE_OP_WORK = 100_000;
51
+
52
+ /**
53
+ * The ops that turn the base text of one shape into the user's: one replace per changed line (last line first), else the whole text.
54
+ * `work` ({left}) is the budget of the whole plan for minimalReplace and for counting the find text in the lines before each one.
55
+ */
56
+ function shapeOps(target, old, text, work) {
46
57
  const B = old.text.split("\n");
47
58
  const M = text.split("\n");
48
59
  const expect = { text_hash: old.hash };
49
- if (B.length === M.length) {
50
- const ops = [];
51
- for (let i = M.length - 1; i >= 0; i--) {
52
- if (B[i] === M[i]) continue;
53
- const r = minimalReplace(B[i], M[i]);
54
- if (!r) return [{ op: "set_shape_text", target, expect, paragraphs: M }];
55
- // the find text occurs once in its own line; lines before it are counted, and they are untouched when this op runs
56
- const before = B.slice(0, i).reduce((n, line) => n + findAll(line, r.find).length, 0);
57
- ops.push({ op: "replace_text_in_shape", target, expect, find: r.find, replace: r.replace, occurrence: before + 1 });
60
+ const whole = [{ op: "set_shape_text", target, expect, paragraphs: M }];
61
+ if (B.length !== M.length) return whole;
62
+ let changed = 0;
63
+ for (let i = 0; i < M.length; i++) if (B[i] !== M[i] && (++changed > MAX_LINE_OPS || changed * B.length > LINE_OP_WORK)) return whole;
64
+ // how often a find text occurs in the lines before line i, counted once per find text in one pass (counting the lines before each
65
+ // changed line rescanned all of them: 25,000 changed lines took 4 s to plan in an outside review)
66
+ const before = new Map();
67
+ const countBefore = (find, i) => {
68
+ let at = before.get(find);
69
+ if (!at) {
70
+ work.left -= old.text.length;
71
+ at = new Int32Array(B.length + 1);
72
+ for (let k = 0; k < B.length; k++) at[k + 1] = at[k] + findAll(B[k], find).length;
73
+ before.set(find, at);
58
74
  }
59
- return ops;
75
+ return at[i];
76
+ };
77
+ const ops = [];
78
+ for (let i = M.length - 1; i >= 0; i--) {
79
+ if (B[i] === M[i]) continue;
80
+ const r = minimalReplace(B[i], M[i], work);
81
+ if (!r || work.left < 0) return whole;
82
+ // the find text occurs once in its own line; lines before it are counted, and they are untouched when this op runs
83
+ ops.push({ op: "replace_text_in_shape", target, expect, find: r.find, replace: r.replace, occurrence: countBefore(r.find, i) + 1 });
60
84
  }
61
- return [{ op: "set_shape_text", target, expect, paragraphs: M }];
85
+ return ops;
62
86
  }
63
87
 
64
88
  /**
@@ -69,11 +93,15 @@ function shapeOps(target, old, text) {
69
93
  export function planPptxMerge(base, mine, theirs, edits = []) {
70
94
  for (const d of [base, mine, theirs]) d.ensure();
71
95
  const said = readEdits(edits);
96
+ const work = { left: 4_000_000 + 16 * [base, mine].reduce((n, d) => n + d.slides.reduce((k, sl) => k + sl.shapes.reduce((j, x) => j + x.text.length, 0), 0), 0) };
72
97
  const items = [];
73
98
  const unplaced = [];
74
99
  let copy = false;
75
- const back = (label, why, text = "") => unplaced.push({ label, text: cut(text), why });
76
- const whole = (label, why, text = "") => (back(label, why, text), (copy = true));
100
+ // `of` names what an entry stands for, for the proof of the merge (src/merge-proof.js): "s" and a slide id, "h" and a slide id and
101
+ // shape key, or "order" (the order of the slides)
102
+ const back = (label, why, text = "", of = []) => unplaced.push({ label, text: cut(text), why, of });
103
+ const whole = (label, why, text = "", of = []) => (back(label, why, text, of), (copy = true));
104
+ const shapeRef = (sl, sh) => `h${sid(sl)}/${key(sh)}`;
77
105
  const inBase = new Map(base.slides.map((s) => [sid(s), s]));
78
106
  const inMine = new Map(mine.slides.map((s) => [sid(s), s]));
79
107
  const inTheirs = new Map(theirs.slides.map((s) => [sid(s), s]));
@@ -81,17 +109,17 @@ export function planPptxMerge(base, mine, theirs, edits = []) {
81
109
  for (const m of mine.slides) {
82
110
  if (inBase.has(sid(m))) continue;
83
111
  slidesSaid = true;
84
- whole(`Slide ${m.index + 1}`, `You added slide ${m.index + 1}. Slide changes are not carried over.${slideText(m) ? " This is its text." : ""}`, slideText(m));
112
+ whole(`Slide ${m.index + 1}`, `You added slide ${m.index + 1}. Slide changes are not carried over.${slideText(m) ? " This is its text." : ""}`, slideText(m), [`s${sid(m)}`]);
85
113
  }
86
114
  for (const b of base.slides) {
87
115
  if (inMine.has(sid(b))) continue;
88
116
  slidesSaid = true;
89
- back(`Slide ${b.index + 1}`, `You removed the slide that was slide ${b.index + 1}. Slide changes are not carried over.`);
117
+ back(`Slide ${b.index + 1}`, `You removed the slide that was slide ${b.index + 1}. Slide changes are not carried over.`, "", [`s${sid(b)}`]);
90
118
  }
91
119
  const order = (d) => d.slides.map(sid).filter((x) => inBase.has(x) && inMine.has(x)).join(" ");
92
120
  if (order(base) !== order(mine)) {
93
121
  slidesSaid = true;
94
- back("Slides", "You moved slides. Slide changes are not carried over.");
122
+ back("Slides", "You moved slides. Slide changes are not carried over.", "", ["order"]);
95
123
  }
96
124
  if (said.slides && !slidesSaid) back("Slides", "You changed slides (hidden, background or order). Slide changes are not carried over.");
97
125
 
@@ -105,37 +133,44 @@ export function planPptxMerge(base, mine, theirs, edits = []) {
105
133
  if (!sure) {
106
134
  const had = new Set(b.shapes.map((x) => x.text));
107
135
  const mineOnly = m.shapes.filter((x) => x.text && !had.has(x.text)).map((x) => x.text);
108
- if (mineOnly.length || keys(b) !== keys(m)) whole(`Slide ${n}`, `Shapes on slide ${n} share an id and shapes were added or removed there, so your edits could not be matched to the agent's version.${mineOnly.length ? " These are yours." : ""}`, mineOnly.join("\n\n"));
136
+ if (mineOnly.length || keys(b) !== keys(m)) whole(`Slide ${n}`, `Shapes on slide ${n} share an id and shapes were added or removed there, so your edits could not be matched to the agent's version.${mineOnly.length ? " These are yours." : ""}`, mineOnly.join("\n\n"), [`s${sid(m)}`]);
109
137
  continue;
110
138
  }
111
139
  const wasBy = new Map(b.shapes.map((x) => [key(x), x]));
112
140
  const nowBy = new Map((t?.shapes || []).map((x) => [key(x), x]));
113
141
  const mineKeys = new Set(m.shapes.map(key));
114
- for (const old of b.shapes) if (!mineKeys.has(key(old))) back(`Slide ${n}`, `You removed ${nameOf(b, old)}. Shape changes are not carried over.`);
142
+ for (const old of b.shapes) if (!mineKeys.has(key(old))) back(`Slide ${n}`, `You removed ${nameOf(b, old)}. Shape changes are not carried over.`, "", [shapeRef(b, old)]);
143
+ // what the page may not have named: shapes put in another order (front to back), and text formatting changed in a shape whose text
144
+ // did not change (in one whose text changed, the text's own line names the shape)
145
+ const inOrder = (sl) => sl.shapes.map(key).filter((k) => wasBy.has(k) && mineKeys.has(k)).join(" ");
146
+ if (inOrder(b) !== inOrder(m)) back(`Slide ${n}`, `You put shapes on slide ${n} in another order. Shape changes are not carried over.`, "", m.shapes.map((x) => shapeRef(m, x)));
147
+ if (!said.format.has(m.index)) for (const sh of m.shapes) if (wasBy.get(key(sh))?.text === sh.text && JSON.stringify(wasBy.get(key(sh)).fmt) !== JSON.stringify(sh.fmt)) back(`Slide ${n}`, `You changed text formatting in ${nameOf(m, sh)}. Formatting is not carried over.`, "", [shapeRef(m, sh)]);
115
148
  for (const sh of m.shapes) {
116
149
  const old = wasBy.get(key(sh));
117
150
  const label = untrusted(`Slide ${n}, ${sh.isTitle ? "Title" : sh.name ? sh.name : `shape ${sh.id}`}`, 100);
118
151
  if (!old) {
119
- whole(label, `You added ${nameOf(m, sh)}. Shape changes are not carried over.${sh.text ? " This is its text." : ""}`, sh.text);
152
+ whole(label, `You added ${nameOf(m, sh)}. Shape changes are not carried over.${sh.text ? " This is its text." : ""}`, sh.text, [shapeRef(m, sh)]);
120
153
  continue;
121
154
  }
122
155
  if (old.text === sh.text) continue;
123
156
  const now = nowBy.get(key(sh));
124
- if (!t) back(label, `The agent removed slide ${n}, so your edit to ${nameOf(m, sh)} was not carried over. This is yours.`, sh.text);
125
- else if (!now) back(label, `The agent removed ${nameOf(m, sh)}, so your edit was not carried over. This is yours.`, sh.text);
157
+ if (!t) back(label, `The agent removed slide ${n}, so your edit to ${nameOf(m, sh)} was not carried over. This is yours.`, sh.text, [shapeRef(m, sh)]);
158
+ else if (!now) back(label, `The agent removed ${nameOf(m, sh)}, so your edit was not carried over. This is yours.`, sh.text, [shapeRef(m, sh)]);
126
159
  else if (now.text === sh.text) continue; // the agent wrote the same text
127
- else if (now.text !== old.text) back(label, `The agent changed ${nameOf(t, now)} too. Its text is on the slide; this is yours.`, sh.text);
128
- else if (sh.kind !== "shape") back(label, `You changed ${nameOf(m, sh)}, which is not a plain text box (a table or a group). That is not carried over. This is yours.`, sh.text);
160
+ else if (now.text !== old.text) back(label, `The agent changed ${nameOf(t, now)} too. Its text is on the slide; this is yours.`, sh.text, [shapeRef(m, sh)]);
161
+ else if (sh.kind !== "shape") back(label, `You changed ${nameOf(m, sh)}, which is not a plain text box (a table or a group). That is not carried over. This is yours.`, sh.text, [shapeRef(m, sh)]);
129
162
  else {
130
- const ops = shapeOps({ slide_id: sid(m), shape_id: sh.id }, old, sh.text);
131
- if (ops[0].op === "set_shape_text" && mixed(now)) back(label, `You added or removed lines in ${nameOf(m, sh)}, whose text mixes formats. That cannot be carried over without losing them. This is yours.`, sh.text);
132
- else items.push({ label, text: cut(sh.text), name: nameOf(t, now), slide: sid(m), key: key(sh), want: sh.text, ops });
163
+ const ops = shapeOps({ slide_id: sid(m), shape_id: sh.id }, old, sh.text, work);
164
+ const lines = old.text.split("\n").length === sh.text.split("\n").length;
165
+ if (ops[0].op === "set_shape_text" && mixed(now)) back(label, lines ? `You changed many lines in ${nameOf(m, sh)}, whose text mixes formats. They are carried over only as the whole text, which would lose the formats. This is yours.` : `You added or removed lines in ${nameOf(m, sh)}, whose text mixes formats. That cannot be carried over without losing them. This is yours.`, sh.text, [shapeRef(m, sh)]);
166
+ else items.push({ label, of: [shapeRef(m, sh)], text: cut(sh.text), name: nameOf(t, now), slide: sid(m), key: key(sh), want: sh.text, look: JSON.stringify(old.fmt) !== JSON.stringify(sh.fmt) ? JSON.stringify(sh.fmt) : null, ops });
133
167
  }
134
168
  }
135
169
  }
136
170
  const where = (slide) => (slide == null ? "" : ` on slide ${slide + 1}`);
137
- for (const slide of said.format) back("Formatting", `You changed text formatting${where(slide)}. Formatting is not carried over.`);
138
- for (const slide of said.shapes) whole("Shapes", `You added, removed, moved or restyled shapes${where(slide)}. Shape changes are not carried over.`);
171
+ const slideRef = (slide) => (slide != null && mine.slides[slide] ? [`s${sid(mine.slides[slide])}`] : []);
172
+ for (const slide of said.format) back("Formatting", `You changed text formatting${where(slide)}. Formatting is not carried over.`, "", slideRef(slide));
173
+ for (const slide of said.shapes) whole("Shapes", `You added, removed, moved or restyled shapes${where(slide)}. Shape changes are not carried over.`, "", slideRef(slide));
139
174
  if (said.other) whole("Other changes", "You made a change that is not text. It is not carried over.");
140
175
  return { items, unplaced, copy };
141
176
  }
@@ -166,31 +201,56 @@ function verify(theirs, out, applied) {
166
201
  * written.
167
202
  */
168
203
  export async function mergePptx({ base, mine, theirs, name, runOps, edits = [] }) {
204
+ // a turn of the event loop between the readings and the plan, so a large deck is never read three times in one stretch
169
205
  const T = parseDeck(theirs);
170
- const plan = planPptxMerge(parseDeck(base), parseDeck(mine), T, edits);
206
+ T.ensure();
207
+ await turn();
208
+ const B = parseDeck(base);
209
+ B.ensure();
210
+ await turn();
211
+ const M = parseDeck(mine);
212
+ M.ensure();
213
+ await turn();
214
+ const plan = planPptxMerge(B, M, T, edits);
215
+ await turn();
171
216
  const unplaced = [...plan.unplaced];
172
- const fail = (it, why) => unplaced.push({ label: it.label, text: it.text, why });
173
- const end = (bytes, merged) => ({ bytes, merged, unplaced, copy: plan.copy });
217
+ const fail = (it, why) => unplaced.push({ label: it.label, text: it.text, why, of: it.of });
218
+ const end = (bytes, merged) => ({ bytes, merged, unplaced, copy: plan.copy, read: { base: B, mine: M, theirs: T } }); // `read`: for the proof
174
219
  let items = plan.items;
175
220
  for (let pass = 0; pass < 2 && items.length; pass++) {
176
221
  const owner = items.flatMap((it) => it.ops.map(() => it));
177
222
  const { results, bytes, blocked } = await runOps({ bytes: theirs, format: "pptx", name, ops: items.flatMap((it) => it.ops), partial: true });
178
- const status = (it) => owner.map((o, n) => (o === it ? results[n]?.status : null)).filter(Boolean);
223
+ // each item's op results, gathered once (a map over every op for each item was quadratic: 10,000 shapes held the thread for 1.3 s)
224
+ const statuses = new Map(items.map((it) => [it, []]));
225
+ owner.forEach((it, n) => results[n]?.status && statuses.get(it).push(results[n].status));
226
+ const status = (it) => statuses.get(it);
179
227
  const notPlaced = (it) => (status(it).includes("skipped_protected") ? `Your edit to ${it.name} was not carried over: the text box holds content that cannot be rewritten safely (a field or an equation). This is yours.` : `Your edit to ${it.name} could not be placed on the agent's version. This is yours.`);
180
228
  if (!bytes) {
181
229
  for (const it of items) fail(it, blocked ? "Carrying your edits over would have damaged the file, so none were applied." : notPlaced(it));
182
230
  return end(null, 0);
183
231
  }
184
232
  const applied = items.filter((it) => status(it).every((x) => x === "applied"));
233
+ const isApplied = new Set(applied);
185
234
  // a shape with one op applied and another not reads as neither version: these bytes are not written, the rest is run again
186
- const half = items.some((it) => !applied.includes(it) && status(it).includes("applied"));
235
+ const half = items.some((it) => !isApplied.has(it) && status(it).includes("applied"));
236
+ if (!half) await turn();
187
237
  const { foreign, bad } = half ? { foreign: false, bad: new Set() } : verify(T, parseDeck(bytes), applied);
188
238
  if (foreign) break;
189
239
  for (const it of items) {
190
- if (!applied.includes(it)) fail(it, notPlaced(it));
240
+ if (!isApplied.has(it)) fail(it, notPlaced(it));
191
241
  else if (bad.has(it)) fail(it, `Your edit to ${it.name} did not land as typed, so the agent's version was kept there. This is yours.`);
192
242
  }
193
- if (!bad.size && !half) return end(bytes, applied.length);
243
+ if (!bad.size && !half) {
244
+ // text the person also formatted differently: the text is carried, its look is not (only text is), and that is said
245
+ const looks = applied.filter((it) => it.look !== null);
246
+ if (looks.length) {
247
+ const out = parseDeck(bytes);
248
+ out.ensure();
249
+ const at = new Map(out.slides.map((sl) => [sid(sl), new Map(sl.shapes.map((x) => [key(x), x]))]));
250
+ for (const it of looks) if (JSON.stringify(at.get(it.slide)?.get(it.key)?.fmt) !== it.look) unplaced.push({ label: it.label, text: "", why: `Your text in ${it.name} was carried over, but not the formatting you changed in it: set it again.`, of: it.of, check: true });
251
+ }
252
+ return end(bytes, applied.length);
253
+ }
194
254
  items = applied.filter((it) => !bad.has(it));
195
255
  }
196
256
  for (const it of items) fail(it, "Carrying your edits over would have changed the agent's text, so none were applied.");