onionskin-cli 0.0.0-stage → 0.0.2

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 (117) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/INSTALL.md +25 -0
  3. package/LICENSE +21 -0
  4. package/NOTICE +49 -0
  5. package/README.md +148 -2
  6. package/docs/contracts/batch.schema.json +839 -0
  7. package/docs/contracts/history.schema.json +126 -0
  8. package/docs/contracts/ops.schema.json +541 -0
  9. package/package.json +67 -4
  10. package/scripts/checker/check.py +411 -0
  11. package/scripts/checker/requirements.txt +5 -0
  12. package/scripts/install-check.mjs +9 -0
  13. package/scripts/requirements.txt +5 -0
  14. package/scripts/rewriter/apple/main.swift +135 -0
  15. package/scripts/rewriter/apple/onionskin-fm +0 -0
  16. package/scripts/rewriter/apple/onionskin-fm.json +6 -0
  17. package/skills/onionskin/SKILL.md +117 -0
  18. package/skills/onionskin/reference/batch.md +94 -0
  19. package/skills/onionskin/reference/formats.md +15 -0
  20. package/skills/onionskin/reference/ops.md +253 -0
  21. package/skills/onionskin/reference/troubleshooting.md +73 -0
  22. package/skills/onionskin/reference/voice-guide.md +86 -0
  23. package/skills/onionskin/voice.example.md +51 -0
  24. package/src/agent-detect.js +149 -0
  25. package/src/agent-events.js +159 -0
  26. package/src/agent-prompt.js +27 -0
  27. package/src/agent-runner.js +593 -0
  28. package/src/analyze.js +17 -0
  29. package/src/anchors.js +190 -0
  30. package/src/apply.js +387 -0
  31. package/src/auth.js +130 -0
  32. package/src/batch.js +322 -0
  33. package/src/check-worker.js +8 -0
  34. package/src/checker.js +293 -0
  35. package/src/cli.js +516 -0
  36. package/src/constants.js +20 -0
  37. package/src/diff.js +267 -0
  38. package/src/doctor.js +288 -0
  39. package/src/docx.js +438 -0
  40. package/src/fmt.js +30 -0
  41. package/src/fsutil.js +348 -0
  42. package/src/history-worker.js +16 -0
  43. package/src/history.js +576 -0
  44. package/src/lease.js +79 -0
  45. package/src/local.js +242 -0
  46. package/src/merge-pptx.js +198 -0
  47. package/src/merge-xlsx.js +453 -0
  48. package/src/merge.js +410 -0
  49. package/src/offload.js +34 -0
  50. package/src/ops/common.js +48 -0
  51. package/src/ops/docx-table.js +323 -0
  52. package/src/ops/docx.js +503 -0
  53. package/src/ops/engine.js +41 -0
  54. package/src/ops/pptx.js +336 -0
  55. package/src/ops/run.js +115 -0
  56. package/src/ops/runs.js +127 -0
  57. package/src/ops/schema.js +109 -0
  58. package/src/ops/xlsx.js +277 -0
  59. package/src/package.js +189 -0
  60. package/src/paths.js +64 -0
  61. package/src/person.js +66 -0
  62. package/src/pptx.js +194 -0
  63. package/src/question.js +47 -0
  64. package/src/quick-plan.js +107 -0
  65. package/src/quick.js +164 -0
  66. package/src/redline-check.js +251 -0
  67. package/src/redline-worker.js +29 -0
  68. package/src/redline.js +438 -0
  69. package/src/reply.js +410 -0
  70. package/src/review.js +274 -0
  71. package/src/rewrite-check.js +1014 -0
  72. package/src/rewriter-cleanup.js +105 -0
  73. package/src/rewriter-setup.js +104 -0
  74. package/src/rewriter.js +396 -0
  75. package/src/sanitize.js +42 -0
  76. package/src/sentence-span.js +25 -0
  77. package/src/server-entry.js +13 -0
  78. package/src/server.js +576 -0
  79. package/src/session.js +1912 -0
  80. package/src/settings.js +161 -0
  81. package/src/setup.js +199 -0
  82. package/src/stamp-words.js +10 -0
  83. package/src/stamps.js +59 -0
  84. package/src/style.js +110 -0
  85. package/src/suggest-reply.js +84 -0
  86. package/src/suggest.js +261 -0
  87. package/src/text.js +31 -0
  88. package/src/tracked-words.js +43 -0
  89. package/src/voice-guide.js +182 -0
  90. package/src/voice-learn.js +314 -0
  91. package/src/voice-sample-worker.js +95 -0
  92. package/src/voice-samples.js +329 -0
  93. package/src/voice-store.js +305 -0
  94. package/src/voice-worker.js +28 -0
  95. package/src/voice.js +297 -0
  96. package/src/xlsx.js +454 -0
  97. package/src/xml-tree.js +118 -0
  98. package/src/xml.js +127 -0
  99. package/src/zip-write.js +74 -0
  100. package/src/zip.js +88 -0
  101. package/vendor/engine/DocViewer-BZLXUcxJ.js +15137 -0
  102. package/vendor/engine/THIRD_PARTY_LICENSES.txt +79 -0
  103. package/vendor/engine/collab-BVynXMqc.js +2591 -0
  104. package/vendor/engine/collab.js +2 -0
  105. package/vendor/engine/core.js +4 -0
  106. package/vendor/engine/default-worker-DogNT09A.js +35625 -0
  107. package/vendor/engine/embed.js +107 -0
  108. package/vendor/engine/index.js +5 -0
  109. package/vendor/engine/office-engine.embed.js +184 -0
  110. package/vendor/engine/office-engine.worker.js +36030 -0
  111. package/vendor/engine/xlsx-ops-SYAv6V0f.js +939 -0
  112. package/vendor/engine-node/LICENSE +21 -0
  113. package/vendor/engine-node/engine-node.mjs +46618 -0
  114. package/vendor/engine.lock.json +26 -0
  115. package/web/dist/assets/index-BUtofdtr.js +197 -0
  116. package/web/dist/assets/index-Dfizlg0i.css +1 -0
  117. package/web/dist/index.html +14 -0
@@ -0,0 +1,541 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "onionskin.ops/1",
4
+ "title": "Operations file for `onionskin apply <file> --ops ops.json`",
5
+ "description": "Strictly validated: unknown fields are rejected. Ops run in order against anchors as delivered in the batch; every op carries `expect`, the text of the target as the agent saw it. Anchors and `expect` are checked against the file as it is BEFORE any op of this file runs. Nothing is written for an op whose anchor is missing or ambiguous or whose `expect` does not match. By default the set is atomic (all or nothing); `--partial` applies what it can.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema", "ops"],
9
+ "properties": {
10
+ "schema": { "const": "onionskin.ops/1" },
11
+ "ops": {
12
+ "type": "array",
13
+ "minItems": 1,
14
+ "maxItems": 500,
15
+ "items": {
16
+ "oneOf": [
17
+ { "$ref": "#/$defs/replace_text" },
18
+ { "$ref": "#/$defs/insert_paragraph_after" },
19
+ { "$ref": "#/$defs/insert_paragraph_before" },
20
+ { "$ref": "#/$defs/delete_paragraph" },
21
+ { "$ref": "#/$defs/set_paragraph_style" },
22
+ { "$ref": "#/$defs/format_text" },
23
+ { "$ref": "#/$defs/set_table_cell_text" },
24
+ { "$ref": "#/$defs/insert_table_row" },
25
+ { "$ref": "#/$defs/delete_table_row" },
26
+ { "$ref": "#/$defs/insert_table_column" },
27
+ { "$ref": "#/$defs/delete_table_column" },
28
+ { "$ref": "#/$defs/set_cells" },
29
+ { "$ref": "#/$defs/format_cells" },
30
+ { "$ref": "#/$defs/insert_rows" },
31
+ { "$ref": "#/$defs/delete_rows" },
32
+ { "$ref": "#/$defs/insert_columns" },
33
+ { "$ref": "#/$defs/delete_columns" },
34
+ { "$ref": "#/$defs/add_sheet" },
35
+ { "$ref": "#/$defs/rename_sheet" },
36
+ { "$ref": "#/$defs/set_shape_text" },
37
+ { "$ref": "#/$defs/replace_text_in_shape" },
38
+ { "$ref": "#/$defs/duplicate_slide" },
39
+ { "$ref": "#/$defs/delete_slide" },
40
+ { "$ref": "#/$defs/move_slide" },
41
+ { "$ref": "#/$defs/replace_all_text" },
42
+ { "$ref": "#/$defs/format_all" }
43
+ ]
44
+ }
45
+ }
46
+ },
47
+ "$defs": {
48
+ "id": { "type": "string", "maxLength": 64, "description": "Free label echoed in the report (for example the batch comment id this op answers)." },
49
+ "text": { "type": "string", "maxLength": 20000 },
50
+ "expect": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "minProperties": 1,
54
+ "description": "What the agent saw at the target. DOCX/PPTX text targets: `quote` must be contained in the target's text (whitespace collapsed, NFC), `text_hash` must equal the hash of the whole text (the batch `locator.text_hash`). XLSX targets: `quote` must EQUAL the text of the region (cells joined by TAB, rows by LF, each cell as typed: the formula if it has one, else the value; an empty region is the empty string), `text_hash` is the same hash of that text. `absent: true` (add_sheet) means the sheet name must not exist yet.",
55
+ "properties": {
56
+ "quote": { "type": "string", "maxLength": 20000 },
57
+ "text_hash": { "type": "string", "pattern": "^[0-9a-f]{16}$" },
58
+ "absent": { "type": "boolean" }
59
+ }
60
+ },
61
+ "expect_count": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": ["count"],
65
+ "description": "Document-wide ops: the exact number of matches (replace_all_text) or paragraphs in scope (format_all) the agent counted, protected ones included. A different count fails closed.",
66
+ "properties": { "count": { "type": "integer", "minimum": 0, "maximum": 1000000 } }
67
+ },
68
+ "docx_target": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "description": "A paragraph. Either an anchor id from the batch (`untrusted_document_evidence.anchors[].id`, resolved through the delivered batch) or an explicit durable locator copied from the batch: `para_id` (w14:paraId), or `body_path` with `text_hash`, or `text_hash` alone when it is unique. No fuzzy matching: an ambiguous or missing locator is `anchor_not_found`.",
72
+ "properties": {
73
+ "anchor_id": { "type": "string", "pattern": "^a[0-9]+$" },
74
+ "para_id": { "type": "string", "pattern": "^[0-9A-Fa-f]{8}$" },
75
+ "body_path": { "type": "array", "minItems": 1, "maxItems": 4, "items": { "type": "integer", "minimum": 0 } },
76
+ "text_hash": { "type": "string", "pattern": "^[0-9a-f]{16}$" }
77
+ }
78
+ },
79
+ "sheet": { "type": "string", "minLength": 1, "maxLength": 31, "description": "Sheet name as in the workbook." },
80
+ "a1": { "type": "string", "pattern": "^[A-Za-z]{1,3}[0-9]{1,7}(:[A-Za-z]{1,3}[0-9]{1,7})?$" },
81
+ "find": { "type": "string", "minLength": 1, "maxLength": 2000 },
82
+ "color": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
83
+ "replace_text": {
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "required": ["op", "target", "expect"],
87
+ "description": "Inside one paragraph. Either `find` + `replace` (the find text must occur exactly once unless `occurrence` or `all` is given; run formatting is kept) or `text` (the whole paragraph text; refused when the paragraph holds images or other objects).",
88
+ "properties": {
89
+ "op": { "const": "replace_text" },
90
+ "id": { "$ref": "#/$defs/id" },
91
+ "target": { "$ref": "#/$defs/docx_target" },
92
+ "expect": { "$ref": "#/$defs/expect" },
93
+ "find": { "$ref": "#/$defs/find" },
94
+ "replace": { "$ref": "#/$defs/text" },
95
+ "text": { "$ref": "#/$defs/text" },
96
+ "occurrence": { "type": "integer", "minimum": 1 },
97
+ "all": { "type": "boolean" },
98
+ "match_case": { "type": "boolean" }
99
+ }
100
+ },
101
+ "insert_paragraph_after": {
102
+ "type": "object",
103
+ "additionalProperties": false,
104
+ "required": ["op", "target", "expect", "text"],
105
+ "description": "New paragraph after the target. `style` is a paragraph style name or id (for example \"Heading 2\"); without it the new paragraph copies its neighbor's paragraph formatting.",
106
+ "properties": {
107
+ "op": { "const": "insert_paragraph_after" },
108
+ "id": { "$ref": "#/$defs/id" },
109
+ "target": { "$ref": "#/$defs/docx_target" },
110
+ "expect": { "$ref": "#/$defs/expect" },
111
+ "text": { "$ref": "#/$defs/text" },
112
+ "style": { "type": "string", "maxLength": 100 }
113
+ }
114
+ },
115
+ "insert_paragraph_before": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": ["op", "target", "expect", "text"],
119
+ "properties": {
120
+ "op": { "const": "insert_paragraph_before" },
121
+ "id": { "$ref": "#/$defs/id" },
122
+ "target": { "$ref": "#/$defs/docx_target" },
123
+ "expect": { "$ref": "#/$defs/expect" },
124
+ "text": { "$ref": "#/$defs/text" },
125
+ "style": { "type": "string", "maxLength": 100 }
126
+ }
127
+ },
128
+ "delete_paragraph": {
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "required": ["op", "target", "expect"],
132
+ "properties": {
133
+ "op": { "const": "delete_paragraph" },
134
+ "id": { "$ref": "#/$defs/id" },
135
+ "target": { "$ref": "#/$defs/docx_target" },
136
+ "expect": { "$ref": "#/$defs/expect" }
137
+ }
138
+ },
139
+ "set_paragraph_style": {
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": ["op", "target", "expect", "style"],
143
+ "properties": {
144
+ "op": { "const": "set_paragraph_style" },
145
+ "id": { "$ref": "#/$defs/id" },
146
+ "target": { "$ref": "#/$defs/docx_target" },
147
+ "expect": { "$ref": "#/$defs/expect" },
148
+ "style": { "type": "string", "minLength": 1, "maxLength": 100 }
149
+ }
150
+ },
151
+ "format_text": {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": ["op", "target", "expect", "find", "set"],
155
+ "description": "Run properties on the text range `find` inside the paragraph (must occur exactly once unless `occurrence` is given). Runs are split at the range boundaries.",
156
+ "properties": {
157
+ "op": { "const": "format_text" },
158
+ "id": { "$ref": "#/$defs/id" },
159
+ "target": { "$ref": "#/$defs/docx_target" },
160
+ "expect": { "$ref": "#/$defs/expect" },
161
+ "find": { "$ref": "#/$defs/find" },
162
+ "occurrence": { "type": "integer", "minimum": 1 },
163
+ "match_case": { "type": "boolean" },
164
+ "set": {
165
+ "type": "object",
166
+ "additionalProperties": false,
167
+ "minProperties": 1,
168
+ "properties": {
169
+ "bold": { "type": "boolean" },
170
+ "italic": { "type": "boolean" },
171
+ "underline": { "type": "boolean" },
172
+ "color": { "$ref": "#/$defs/color" },
173
+ "size_pt": { "type": "number", "minimum": 1, "maximum": 400 }
174
+ }
175
+ }
176
+ }
177
+ },
178
+ "set_table_cell_text": {
179
+ "type": "object",
180
+ "additionalProperties": false,
181
+ "required": ["op", "target", "expect", "text"],
182
+ "description": "Sets the text of one paragraph of a table cell (the first by default). `table` is the body ordinal of the table as in the batch `body_path[0]`; `row` and `col` are 0-based.",
183
+ "properties": {
184
+ "op": { "const": "set_table_cell_text" },
185
+ "id": { "$ref": "#/$defs/id" },
186
+ "target": {
187
+ "type": "object",
188
+ "additionalProperties": false,
189
+ "required": ["table", "row", "col"],
190
+ "properties": {
191
+ "table": { "type": "integer", "minimum": 0 },
192
+ "row": { "type": "integer", "minimum": 0 },
193
+ "col": { "type": "integer", "minimum": 0 },
194
+ "paragraph": { "type": "integer", "minimum": 0 }
195
+ }
196
+ },
197
+ "expect": { "$ref": "#/$defs/expect" },
198
+ "text": { "$ref": "#/$defs/text" }
199
+ }
200
+ },
201
+ "where": { "enum": ["before", "after"] },
202
+ "table_row_target": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "required": ["table", "row"],
206
+ "description": "A row of a top-level table: `table` is the body ordinal of the table as in the batch `body_path[0]`, `row` is 0-based (`body_path[1]`).",
207
+ "properties": { "table": { "type": "integer", "minimum": 0 }, "row": { "type": "integer", "minimum": 0 } }
208
+ },
209
+ "table_col_target": {
210
+ "type": "object",
211
+ "additionalProperties": false,
212
+ "required": ["table", "col"],
213
+ "description": "A column of a top-level table: `table` is the body ordinal of the table as in the batch `body_path[0]`, `col` is 0-based (`body_path[2]`).",
214
+ "properties": { "table": { "type": "integer", "minimum": 0 }, "col": { "type": "integer", "minimum": 0 } }
215
+ },
216
+ "insert_table_row": {
217
+ "type": "object",
218
+ "additionalProperties": false,
219
+ "required": ["op", "target", "expect", "where"],
220
+ "description": "New row before or after the target row, formatted like the target row (cell and paragraph formatting, no content). `cells` is the text of the new row's cells, left to right; fewer than the row has leaves the rest empty. `expect` is checked against the target row's text (cells joined by TAB, the paragraphs of a cell by LF). Refused when a vertical merge crosses the new row's place.",
221
+ "properties": {
222
+ "op": { "const": "insert_table_row" },
223
+ "id": { "$ref": "#/$defs/id" },
224
+ "target": { "$ref": "#/$defs/table_row_target" },
225
+ "expect": { "$ref": "#/$defs/expect" },
226
+ "where": { "$ref": "#/$defs/where" },
227
+ "cells": { "type": "array", "maxItems": 63, "items": { "type": "string", "maxLength": 2000 } }
228
+ }
229
+ },
230
+ "delete_table_row": {
231
+ "type": "object",
232
+ "additionalProperties": false,
233
+ "required": ["op", "target", "expect"],
234
+ "description": "Removes the target row. `expect` is checked against the row's text (cells joined by TAB, the paragraphs of a cell by LF). Refused for the only row of a table, the first row of a vertical merge that goes on below it, and a row that holds a protected paragraph or one end of a comment or bookmark.",
235
+ "properties": {
236
+ "op": { "const": "delete_table_row" },
237
+ "id": { "$ref": "#/$defs/id" },
238
+ "target": { "$ref": "#/$defs/table_row_target" },
239
+ "expect": { "$ref": "#/$defs/expect" }
240
+ }
241
+ },
242
+ "insert_table_column": {
243
+ "type": "object",
244
+ "additionalProperties": false,
245
+ "required": ["op", "target", "expect", "where"],
246
+ "description": "New column before or after the target column, each new cell formatted like its neighbor in the same row; the column widths are scaled so the table keeps its width. `cells` is the text of the new cells, top to bottom. `expect` is checked against the column's text (cells joined by LF, top to bottom). Refused for a table with horizontally merged or offset cells.",
247
+ "properties": {
248
+ "op": { "const": "insert_table_column" },
249
+ "id": { "$ref": "#/$defs/id" },
250
+ "target": { "$ref": "#/$defs/table_col_target" },
251
+ "expect": { "$ref": "#/$defs/expect" },
252
+ "where": { "$ref": "#/$defs/where" },
253
+ "cells": { "type": "array", "maxItems": 1000, "items": { "type": "string", "maxLength": 2000 } }
254
+ }
255
+ },
256
+ "delete_table_column": {
257
+ "type": "object",
258
+ "additionalProperties": false,
259
+ "required": ["op", "target", "expect"],
260
+ "description": "Removes the target column. `expect` is checked against the column's text (cells joined by LF, top to bottom). Refused for the only column, a table with horizontally merged or offset cells, and a column that holds a protected paragraph or one end of a comment or bookmark.",
261
+ "properties": {
262
+ "op": { "const": "delete_table_column" },
263
+ "id": { "$ref": "#/$defs/id" },
264
+ "target": { "$ref": "#/$defs/table_col_target" },
265
+ "expect": { "$ref": "#/$defs/expect" }
266
+ }
267
+ },
268
+ "set_cells": {
269
+ "type": "object",
270
+ "additionalProperties": false,
271
+ "required": ["op", "target", "expect", "values"],
272
+ "description": "Writes `values` (rows of cells, the same shape as `range`; a scalar fits a single cell) like a user typing: a string starting with = is a formula, text that looks like a number becomes a number, null clears.",
273
+ "properties": {
274
+ "op": { "const": "set_cells" },
275
+ "id": { "$ref": "#/$defs/id" },
276
+ "target": { "$ref": "#/$defs/xlsx_range_target" },
277
+ "expect": { "$ref": "#/$defs/expect" },
278
+ "values": {
279
+ "anyOf": [
280
+ { "type": ["string", "number", "boolean", "null"] },
281
+ { "type": "array", "minItems": 1, "maxItems": 10000, "items": { "type": "array", "minItems": 1, "maxItems": 1000, "items": { "type": ["string", "number", "boolean", "null"] } } }
282
+ ]
283
+ }
284
+ }
285
+ },
286
+ "format_cells": {
287
+ "type": "object",
288
+ "additionalProperties": false,
289
+ "required": ["op", "target", "expect", "set"],
290
+ "properties": {
291
+ "op": { "const": "format_cells" },
292
+ "id": { "$ref": "#/$defs/id" },
293
+ "target": { "$ref": "#/$defs/xlsx_range_target" },
294
+ "expect": { "$ref": "#/$defs/expect" },
295
+ "set": {
296
+ "type": "object",
297
+ "additionalProperties": false,
298
+ "minProperties": 1,
299
+ "properties": {
300
+ "number_format": { "type": "string", "maxLength": 200 },
301
+ "bold": { "type": "boolean" },
302
+ "italic": { "type": "boolean" },
303
+ "fill": { "$ref": "#/$defs/color" },
304
+ "font_color": { "$ref": "#/$defs/color" }
305
+ }
306
+ }
307
+ }
308
+ },
309
+ "insert_rows": {
310
+ "type": "object",
311
+ "additionalProperties": false,
312
+ "required": ["op", "target", "expect"],
313
+ "description": "Inserts `count` (default 1) empty rows BEFORE row `at` (1-based). `expect` is the text of the row currently at `at`. A workbook with a reference the engine cannot move is refused with the engine's refusal code.",
314
+ "properties": {
315
+ "op": { "const": "insert_rows" },
316
+ "id": { "$ref": "#/$defs/id" },
317
+ "target": {
318
+ "type": "object",
319
+ "additionalProperties": false,
320
+ "required": ["sheet", "at"],
321
+ "properties": { "sheet": { "$ref": "#/$defs/sheet" }, "at": { "type": "integer", "minimum": 1, "maximum": 1048576 }, "count": { "type": "integer", "minimum": 1, "maximum": 1000 } }
322
+ },
323
+ "expect": { "$ref": "#/$defs/expect" }
324
+ }
325
+ },
326
+ "delete_rows": {
327
+ "type": "object",
328
+ "additionalProperties": false,
329
+ "required": ["op", "target", "expect"],
330
+ "description": "Deletes `count` (default 1) rows starting at row `at` (1-based). `expect` is the text of the deleted rows (rows joined by LF).",
331
+ "properties": {
332
+ "op": { "const": "delete_rows" },
333
+ "id": { "$ref": "#/$defs/id" },
334
+ "target": {
335
+ "type": "object",
336
+ "additionalProperties": false,
337
+ "required": ["sheet", "at"],
338
+ "properties": { "sheet": { "$ref": "#/$defs/sheet" }, "at": { "type": "integer", "minimum": 1, "maximum": 1048576 }, "count": { "type": "integer", "minimum": 1, "maximum": 1000 } }
339
+ },
340
+ "expect": { "$ref": "#/$defs/expect" }
341
+ }
342
+ },
343
+ "insert_columns": {
344
+ "type": "object",
345
+ "additionalProperties": false,
346
+ "required": ["op", "target", "expect"],
347
+ "description": "Inserts `count` empty columns BEFORE column `at` (letters). `expect` is the text of the column currently at `at` (cells joined by LF, top to bottom).",
348
+ "properties": {
349
+ "op": { "const": "insert_columns" },
350
+ "id": { "$ref": "#/$defs/id" },
351
+ "target": {
352
+ "type": "object",
353
+ "additionalProperties": false,
354
+ "required": ["sheet", "at"],
355
+ "properties": { "sheet": { "$ref": "#/$defs/sheet" }, "at": { "type": "string", "pattern": "^[A-Za-z]{1,3}$" }, "count": { "type": "integer", "minimum": 1, "maximum": 1000 } }
356
+ },
357
+ "expect": { "$ref": "#/$defs/expect" }
358
+ }
359
+ },
360
+ "delete_columns": {
361
+ "type": "object",
362
+ "additionalProperties": false,
363
+ "required": ["op", "target", "expect"],
364
+ "properties": {
365
+ "op": { "const": "delete_columns" },
366
+ "id": { "$ref": "#/$defs/id" },
367
+ "target": {
368
+ "type": "object",
369
+ "additionalProperties": false,
370
+ "required": ["sheet", "at"],
371
+ "properties": { "sheet": { "$ref": "#/$defs/sheet" }, "at": { "type": "string", "pattern": "^[A-Za-z]{1,3}$" }, "count": { "type": "integer", "minimum": 1, "maximum": 1000 } }
372
+ },
373
+ "expect": { "$ref": "#/$defs/expect" }
374
+ }
375
+ },
376
+ "add_sheet": {
377
+ "type": "object",
378
+ "additionalProperties": false,
379
+ "required": ["op", "target", "expect"],
380
+ "description": "Adds a sheet at the end. `expect` must be { \"absent\": true }: the name must not exist yet.",
381
+ "properties": {
382
+ "op": { "const": "add_sheet" },
383
+ "id": { "$ref": "#/$defs/id" },
384
+ "target": { "type": "object", "additionalProperties": false, "required": ["name"], "properties": { "name": { "$ref": "#/$defs/sheet" } } },
385
+ "expect": { "$ref": "#/$defs/expect" }
386
+ }
387
+ },
388
+ "rename_sheet": {
389
+ "type": "object",
390
+ "additionalProperties": false,
391
+ "required": ["op", "target", "expect", "new_name"],
392
+ "description": "`target.sheet` is the current name; `expect.quote` must equal it exactly.",
393
+ "properties": {
394
+ "op": { "const": "rename_sheet" },
395
+ "id": { "$ref": "#/$defs/id" },
396
+ "target": { "type": "object", "additionalProperties": false, "required": ["sheet"], "properties": { "sheet": { "$ref": "#/$defs/sheet" } } },
397
+ "expect": { "$ref": "#/$defs/expect" },
398
+ "new_name": { "$ref": "#/$defs/sheet" }
399
+ }
400
+ },
401
+ "xlsx_range_target": {
402
+ "type": "object",
403
+ "additionalProperties": false,
404
+ "description": "A cell or range: either `anchor_id` alone (an anchor id from the batch; its locator carries `sheet` and `range`) or `sheet` with `range` (A1).",
405
+ "properties": {
406
+ "anchor_id": { "type": "string", "pattern": "^a[0-9]+$" },
407
+ "sheet": { "$ref": "#/$defs/sheet" },
408
+ "range": { "$ref": "#/$defs/a1" }
409
+ }
410
+ },
411
+ "pptx_target": {
412
+ "type": "object",
413
+ "additionalProperties": false,
414
+ "description": "A shape: either `anchor_id` alone (an anchor id from the batch; its locator carries `slide_id` and `shape_id`) or `slide_id` (the p:sldId id, digits) with `shape_id` (the cNvPr id of the shape).",
415
+ "properties": {
416
+ "anchor_id": { "type": "string", "pattern": "^a[0-9]+$" },
417
+ "slide_id": { "type": "string", "pattern": "^[0-9]{1,10}$" },
418
+ "shape_id": { "type": "integer", "minimum": 0 }
419
+ }
420
+ },
421
+ "set_shape_text": {
422
+ "type": "object",
423
+ "additionalProperties": false,
424
+ "required": ["op", "target", "expect", "paragraphs"],
425
+ "description": "Replaces the text of a shape, one string per paragraph. Existing paragraphs keep their formatting; extra ones copy the last. Refused when a paragraph of the shape is protected.",
426
+ "properties": {
427
+ "op": { "const": "set_shape_text" },
428
+ "id": { "$ref": "#/$defs/id" },
429
+ "target": { "$ref": "#/$defs/pptx_target" },
430
+ "expect": { "$ref": "#/$defs/expect" },
431
+ "paragraphs": { "type": "array", "minItems": 1, "maxItems": 200, "items": { "$ref": "#/$defs/text" } }
432
+ }
433
+ },
434
+ "replace_text_in_shape": {
435
+ "type": "object",
436
+ "additionalProperties": false,
437
+ "required": ["op", "target", "expect", "find", "replace"],
438
+ "properties": {
439
+ "op": { "const": "replace_text_in_shape" },
440
+ "id": { "$ref": "#/$defs/id" },
441
+ "target": { "$ref": "#/$defs/pptx_target" },
442
+ "expect": { "$ref": "#/$defs/expect" },
443
+ "find": { "$ref": "#/$defs/find" },
444
+ "replace": { "$ref": "#/$defs/text" },
445
+ "occurrence": { "type": "integer", "minimum": 1 },
446
+ "all": { "type": "boolean" },
447
+ "match_case": { "type": "boolean" }
448
+ }
449
+ },
450
+ "slide_target": {
451
+ "type": "object",
452
+ "additionalProperties": false,
453
+ "required": ["slide_id"],
454
+ "description": "A slide by its p:sldId id (digits), the batch's `slide_id`.",
455
+ "properties": { "slide_id": { "type": "string", "pattern": "^[0-9]{1,10}$" } }
456
+ },
457
+ "duplicate_slide": {
458
+ "type": "object",
459
+ "additionalProperties": false,
460
+ "required": ["op", "target", "expect"],
461
+ "description": "Copies the target slide (same layout, shapes and shape ids; speaker notes and comments are not copied) right after it, or `where` (before or after) the slide `to` names; give `to` and `where` together. `shapes` sets the text of shapes of the COPY, by the target slide's shape ids, like set_shape_text. `expect` is checked against the target slide's text (its shapes' text joined by LF). The report's `detail.slide_id` is the copy's id. Refused for a slide with a chart, diagram, embedded object or other part a copy would share, and for a deck with sections or custom shows.",
462
+ "properties": {
463
+ "op": { "const": "duplicate_slide" },
464
+ "id": { "$ref": "#/$defs/id" },
465
+ "target": { "$ref": "#/$defs/slide_target" },
466
+ "expect": { "$ref": "#/$defs/expect" },
467
+ "to": { "$ref": "#/$defs/slide_target" },
468
+ "where": { "$ref": "#/$defs/where" },
469
+ "shapes": {
470
+ "type": "array",
471
+ "minItems": 1,
472
+ "maxItems": 50,
473
+ "items": {
474
+ "type": "object",
475
+ "additionalProperties": false,
476
+ "required": ["shape_id", "paragraphs"],
477
+ "properties": { "shape_id": { "type": "integer", "minimum": 0 }, "paragraphs": { "type": "array", "minItems": 1, "maxItems": 200, "items": { "$ref": "#/$defs/text" } } }
478
+ }
479
+ }
480
+ }
481
+ },
482
+ "delete_slide": {
483
+ "type": "object",
484
+ "additionalProperties": false,
485
+ "required": ["op", "target", "expect"],
486
+ "description": "Removes the target slide with its speaker notes and comments. `expect` is checked against the slide's text (its shapes' text joined by LF). Refused for the last slide, a slide another slide links to, and a deck with sections or custom shows.",
487
+ "properties": {
488
+ "op": { "const": "delete_slide" },
489
+ "id": { "$ref": "#/$defs/id" },
490
+ "target": { "$ref": "#/$defs/slide_target" },
491
+ "expect": { "$ref": "#/$defs/expect" }
492
+ }
493
+ },
494
+ "move_slide": {
495
+ "type": "object",
496
+ "additionalProperties": false,
497
+ "required": ["op", "target", "expect", "to", "where"],
498
+ "description": "Moves the target slide before or after the slide `to` names. `expect` is checked against the target slide's text (its shapes' text joined by LF). Refused for a deck with sections or custom shows.",
499
+ "properties": {
500
+ "op": { "const": "move_slide" },
501
+ "id": { "$ref": "#/$defs/id" },
502
+ "target": { "$ref": "#/$defs/slide_target" },
503
+ "expect": { "$ref": "#/$defs/expect" },
504
+ "to": { "$ref": "#/$defs/slide_target" },
505
+ "where": { "$ref": "#/$defs/where" }
506
+ }
507
+ },
508
+ "replace_all_text": {
509
+ "type": "object",
510
+ "additionalProperties": false,
511
+ "required": ["op", "find", "replace", "expect"],
512
+ "description": "Every occurrence in the document (DOCX paragraphs including table cells, XLSX cells as typed, PPTX shapes). Protected units that contain a match are skipped and reported. `expect.count` is the number of matches including the protected ones.",
513
+ "properties": {
514
+ "op": { "const": "replace_all_text" },
515
+ "id": { "$ref": "#/$defs/id" },
516
+ "find": { "$ref": "#/$defs/find" },
517
+ "replace": { "$ref": "#/$defs/text" },
518
+ "match_case": { "type": "boolean" },
519
+ "expect": { "$ref": "#/$defs/expect_count" }
520
+ }
521
+ },
522
+ "format_all": {
523
+ "type": "object",
524
+ "additionalProperties": false,
525
+ "required": ["op", "scope", "set", "expect"],
526
+ "description": "DOCX only. Safe run properties on every non-protected paragraph in `scope`: headings (styles Title, Subtitle, Heading 1-9) or body (all other paragraphs). Protected paragraphs are skipped and reported. `expect.count` is the number of paragraphs in scope with text, protected ones included.",
527
+ "properties": {
528
+ "op": { "const": "format_all" },
529
+ "id": { "$ref": "#/$defs/id" },
530
+ "scope": { "enum": ["headings", "body"] },
531
+ "set": {
532
+ "type": "object",
533
+ "additionalProperties": false,
534
+ "minProperties": 1,
535
+ "properties": { "bold": { "type": "boolean" }, "italic": { "type": "boolean" }, "underline": { "type": "boolean" } }
536
+ },
537
+ "expect": { "$ref": "#/$defs/expect_count" }
538
+ }
539
+ }
540
+ }
541
+ }
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "onionskin-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "description": "Edit Word, Excel and PowerPoint files in the browser and send the batch to a coding agent.",
5
+ "type": "module",
6
+ "bin": {
7
+ "onionskin": "src/cli.js"
8
+ },
9
+ "engines": {
10
+ "node": ">=22"
11
+ },
12
+ "files": [
13
+ "src",
14
+ "web/dist",
15
+ "vendor/engine",
16
+ "vendor/engine-node",
17
+ "vendor/engine.lock.json",
18
+ "skills/onionskin",
19
+ "!skills/onionskin/voice.md",
20
+ "scripts/checker",
21
+ "scripts/rewriter",
22
+ "scripts/requirements.txt",
23
+ "scripts/install-check.mjs",
24
+ "docs/contracts/*.schema.json",
25
+ "NOTICE",
26
+ "CHANGELOG.md",
27
+ "INSTALL.md"
28
+ ],
29
+ "scripts": {
30
+ "build:web": "vite build --config web/vite.config.js",
31
+ "vendor": "node scripts/vendor-engine.mjs",
32
+ "verify:vendor": "node scripts/vendor-engine.mjs --verify",
33
+ "test:unit": "node --test --test-force-exit --test-timeout=60000 \"test/*.test.js\"",
34
+ "test:e2e": "node --test --test-force-exit --test-timeout=240000 --test-concurrency=1 \"e2e/*.e2e.test.js\"",
35
+ "test:webkit": "ONIONSKIN_BROWSER=webkit node --test --test-force-exit --test-timeout=240000 --test-concurrency=1 \"e2e/*.e2e.test.js\"",
36
+ "test:safari": "node scripts/real-safari/smoke.mjs",
37
+ "test": "node scripts/run-tests.mjs",
38
+ "package": "node scripts/package.mjs",
39
+ "rehearse:install": "sh scripts/rehearse-clean-install.sh",
40
+ "demo:build": "node scripts/demo/build.mjs",
41
+ "demo:serve": "node scripts/demo/serve.mjs",
42
+ "prepack": "node scripts/prepack.mjs"
43
+ },
44
+ "license": "MIT",
45
+ "devDependencies": {
46
+ "@vitejs/plugin-react": "^6.1.2",
47
+ "playwright-core": "^1.64.1",
48
+ "react": "^19.3.1",
49
+ "react-dom": "^19.3.1",
50
+ "vite": "^8.3.5"
51
+ },
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/abe238/onionskin.git"
55
+ },
56
+ "homepage": "https://onionskin.abediaz.ai",
57
+ "bugs": "https://github.com/abe238/onionskin/issues",
58
+ "keywords": [
59
+ "claude-code",
60
+ "codex",
61
+ "docx",
62
+ "xlsx",
63
+ "pptx",
64
+ "word",
65
+ "excel",
66
+ "powerpoint",
67
+ "agent-skill"
68
+ ]
69
+ }