@a3s-lab/office 0.4.0 → 0.5.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.
@@ -182,8 +182,9 @@ comments, and delete-vs-edit cases converge and survive PPTX round trips.
182
182
 
183
183
  ### Phase 4: Spreadsheet
184
184
 
185
- Status: browser collaboration foundation implemented; structural operations,
186
- native recalculation parity, and XLSX concurrency coverage are pending.
185
+ Status: browser collaboration foundation and native conflict-local cell
186
+ mutations implemented; structural operations, native recalculation parity, and
187
+ XLSX concurrency coverage are pending.
187
188
 
188
189
  - Stable sheet/named-range order arrays, ID-keyed records, and append-only
189
190
  creation claims avoid a serialized workbook or dense worksheet root.
@@ -208,6 +209,14 @@ native recalculation parity, and XLSX concurrency coverage are pending.
208
209
  route canonical edits plus local-only undo/redo through the same binding.
209
210
  Active-sheet status, selections, zoom, and Fortune Sheet focus remain local
210
211
  view state and are reapplied after remote canonical updates.
212
+ - Rust, CLI, MCP, and A3S Code can create or recursively patch one cell with
213
+ `spreadsheet-set-cell`, or delete one exact complete cell with
214
+ `spreadsheet-delete-cell`. Recursive optimistic guards merge unrelated JSON
215
+ leaves and reject stale same-leaf edits before writing. Dense projections
216
+ retain and safely extend row lengths, sparse projections remain `celldata`,
217
+ and an empty sheet's first write stays sparse. Native restart, real CLI/MCP
218
+ subprocesses, and browser Yjs duplicate/reordered delivery cover the same
219
+ update contract.
211
220
 
212
221
  Remaining:
213
222
 
@@ -313,9 +322,9 @@ destructive actions remain attributable, reviewable, and non-retryable.
313
322
 
314
323
  Status: native Yrs replica store, resumable CLI/MCP event streams, `a3s code`
315
324
  projection, a host-injected live CLI transport session, and typed Markdown,
316
- Document, PDF annotation/form-value, and PDF redaction/page-operation review
317
- mutation surfaces are implemented; the remaining format mutations and native
318
- presence projection are pending.
325
+ Document, Spreadsheet cell, PDF annotation/form-value, and PDF
326
+ redaction/page-operation review mutation surfaces are implemented; the
327
+ remaining format mutations and native presence projection are pending.
319
328
 
320
329
  - Yrs `0.27.3` now uses 53-bit Yjs-compatible client IDs and exchanges standard
321
330
  Yjs v1 updates, state vectors, and y-sync `SyncStep1`/`Update` messages with
@@ -361,6 +370,11 @@ presence projection are pending.
361
370
  incremental updates through the same durable
362
371
  receipt/checkpoint path. Canonical typed mutations require `edit`; raw remote
363
372
  updates remain receivable in every mode so read-only peers still converge.
373
+ - Spreadsheet cell mutations create or recursively patch one zero-based
374
+ coordinate after matching the caller's observed cell, or delete it only after
375
+ an exact complete-cell match. They preserve the browser's field-addressed
376
+ representation, dense/sparse projection mode, and atomic fail-closed
377
+ semantics without replacing a worksheet or workbook.
364
378
  - PDF form-value mutations write the browser-compatible conflict-local record
365
379
  roots by fully-qualified field name, retain idempotent receipts and optional
366
380
  state-vector preconditions, and never synchronize source bytes.
@@ -388,19 +402,20 @@ presence projection are pending.
388
402
  source browser operation, and source attribution is audit data rather than
389
403
  an authorization token.
390
404
  - Cross-language tests apply deterministic native UTF-16 Markdown, ProseMirror
391
- Document text/options/paragraph, and PDF annotation/form-value updates in
392
- browser Yjs, including concurrent browser/native paragraph, annotation-leaf,
393
- and PDF form edits, in addition to importing browser Yjs fixtures in Yrs.
405
+ Document text/options/paragraph, Spreadsheet cell, and PDF
406
+ annotation/form-value updates in browser Yjs, including concurrent
407
+ browser/native paragraph, cell-leaf, annotation-leaf, and PDF form edits, in
408
+ addition to importing browser Yjs fixtures in Yrs.
394
409
  - Standard MCP exposes the durable replica lifecycle and bounded event stream;
395
410
  the same seven collaboration tools are explicitly available to the dedicated
396
411
  `a3s code` Use worker.
397
412
 
398
413
  Remaining:
399
414
 
400
- - Extend typed format-model mutations to Spreadsheet and Presentation plus PDF
401
- signatures; deepen Document mutations to additional nested structures and
402
- review operations, and add durable comment/suggest operations before enabling
403
- those modes for local mutation.
415
+ - Extend typed format-model mutations to Spreadsheet structural operations and
416
+ Presentation plus PDF signatures; deepen Document mutations to additional
417
+ nested structures and review operations, and add durable comment/suggest
418
+ operations before enabling those modes for local mutation.
404
419
  - Project editor-visible presence and selection state while keeping Awareness
405
420
  ephemeral and outside native replica persistence.
406
421
 
package/README.md CHANGED
@@ -138,9 +138,9 @@ The images below are committed visual-regression baselines from the real
138
138
  - **Automation outside the browser** — The native Rust CLI, standard MCP
139
139
  server, and Office Skill share bounded mutation contracts. Coding agents can
140
140
  also keep a durable Yrs replica, exchange standard Yjs v1 updates and state
141
- vectors, perform authorized typed Markdown, Document, and PDF annotation,
142
- form-value, and review changes, retain browser/native actor attribution, and
143
- checkpoint without replacing a whole Office file.
141
+ vectors, perform authorized typed Markdown, Document, Spreadsheet cell, and
142
+ PDF annotation, form-value, and review changes, retain browser/native actor
143
+ attribution, and checkpoint without replacing a whole Office file.
144
144
 
145
145
  ## Quick start
146
146
 
@@ -1023,6 +1023,13 @@ cargo run -p a3s-office-cli -- collab mutate .a3s/report.replica \
1023
1023
  --operation-id edit-44 \
1024
1024
  --mutation '{"type":"document-insert-paragraph","anchorParagraphId":"00000001","position":"after","paragraphId":"00000012","textId":"00000013","text":"Native paragraph"}' --json
1025
1025
 
1026
+ # Recursively patch one Spreadsheet cell after matching the observed value.
1027
+ # Zero-based row/column coordinates follow the browser collaboration model.
1028
+ cargo run -p a3s-office-cli -- collab mutate .a3s/plan.replica \
1029
+ --artifact-id plan --kind spreadsheet --actor-id agent-7 --mode edit \
1030
+ --operation-id edit-45 \
1031
+ --mutation '{"type":"spreadsheet-set-cell","sheetId":"sheet-data","row":1,"column":0,"expectedCell":{"v":10,"m":"10"},"nextCell":{"v":12,"m":"12","f":"=6*2"}}' --json
1032
+
1026
1033
  # Set one PDF form value through its stable fully-qualified field name.
1027
1034
  cargo run -p a3s-office-cli -- collab mutate .a3s/application.replica \
1028
1035
  --artifact-id application --kind pdf --actor-id agent-7 --mode edit \
@@ -1080,7 +1087,13 @@ table rotate every identified ancestor row's `rowTextId`; incomplete row
1080
1087
  identities fail before any write. Paragraphs containing inline atoms or review
1081
1088
  marks remain guarded.
1082
1089
  Page-color/track-changes sidecars remain independent conflict-local fields. All
1083
- mutations use the same durable event path. PDF annotation creation accepts the
1090
+ mutations use the same durable event path. Spreadsheet set-cell mutations
1091
+ recursively compare `expectedCell` with the current browser-compatible cell and
1092
+ write only changed leaves, so unrelated concurrent value, formula, style,
1093
+ hyperlink, note, and metadata edits merge. Use `expectedCell: null` only when
1094
+ creating an observed blank coordinate. Spreadsheet deletion requires the exact
1095
+ complete current cell, dense projections keep their dimensions, and sparse or
1096
+ empty sheets remain sparse. PDF annotation creation accepts the
1084
1097
  portable browser record for FreeText, Highlight, Underline, StrikeOut, or Ink,
1085
1098
  writes `source: created`, and commits its immutable claim atomically. An update
1086
1099
  supplies complete `expectedAnnotation` and `nextAnnotation` values; recursive
@@ -1158,6 +1171,7 @@ without hard-coded return URLs.
1158
1171
 
1159
1172
  - [Live Playground](https://a3s-lab.github.io/Office/)
1160
1173
  - [Documentation center](https://a3s-lab.github.io/Office/docs/)
1174
+ - [A3S Office 0.5.0 documentation](https://a3s-lab.github.io/Office/docs/0.5.0/)
1161
1175
  - [A3S Office 0.4.0 documentation](https://a3s-lab.github.io/Office/docs/0.4.0/)
1162
1176
  - [A3S Office 0.3.0 documentation](https://a3s-lab.github.io/Office/docs/0.3.0/)
1163
1177
  - [A3S Office 0.2.0 documentation](https://a3s-lab.github.io/Office/docs/0.2.0/)
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a3s-lab/office",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Open-source browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
5
5
  "keywords": [
6
6
  "office",
@@ -87,8 +87,8 @@
87
87
  "playground:visual:spreadsheet-ribbon": "playwright test visual-tests/spreadsheet-ribbon.functional.spec.ts --config playwright.config.ts",
88
88
  "playground:visual:update": "playwright test --config playwright.config.ts --update-snapshots",
89
89
  "test": "rstest",
90
- "test:e2e": "bun run test:e2e:fixtures && a3s-test run tests/e2e/word-page-color.acl --json && a3s-test run tests/e2e/word-page-setup-phone.acl --json && a3s-test run tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test run tests/e2e/word-list-formatting-phone.acl --json && a3s-test run tests/e2e/word-font-picker-phone.acl --json && a3s-test run tests/e2e/word-comments-drawer.acl --json && a3s-test run tests/e2e/word-comment-windowing.acl --json && a3s-test run tests/e2e/word-citations-phone.acl --json && a3s-test run tests/e2e/word-navigation-search.acl --json && a3s-test run tests/e2e/word-navigation-windowing.acl --json && a3s-test run tests/e2e/word-find-replace-phone.acl --json && a3s-test run tests/e2e/word-page-navigation.acl --json && a3s-test run tests/e2e/word-page-windowing.acl --json && a3s-test run tests/e2e/word-ai-question.acl --json && a3s-test run tests/e2e/word-picture-insert.acl --json && a3s-test run tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test run tests/e2e/word-track-changes-phone.acl --json && a3s-test run tests/e2e/word-review-conflict-phone.acl --json && a3s-test run tests/e2e/word-revision-windowing.acl --json && a3s-test run tests/e2e/word-table-phone.acl --json && a3s-test run tests/e2e/word-table-borders.acl --json && a3s-test run tests/e2e/word-theme-table.acl --json && a3s-test run tests/e2e/word-styled-table.acl --json && a3s-test run tests/e2e/word-multi-page-table.acl --json && a3s-test run tests/e2e/word-cross-reference-phone.acl --json && a3s-test run tests/e2e/word-bookmark-links-phone.acl --json && a3s-test run tests/e2e/word-notes-phone.acl --json && a3s-test run tests/e2e/word-fields-phone.acl --json && a3s-test run tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test run tests/e2e/spreadsheet-phone-find.acl --json && a3s-test run tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test run tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test run tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test run tests/e2e/presentation-presenter-view.acl --json && a3s-test run tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test run tests/e2e/presentation-phone-comments.acl --json && a3s-test run tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test run tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test run tests/e2e/markdown-phone-modes.acl --json && a3s-test run tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test run tests/e2e/office-docs-navigation.acl --json && a3s-test run tests/e2e/collaboration-participants.acl --json && a3s-test run tests/e2e/collaboration-pdf-annotations.acl --json",
91
- "test:e2e:check": "bun run test:e2e:fixtures && a3s-test check tests/e2e/word-page-color.acl --json && a3s-test check tests/e2e/word-page-setup-phone.acl --json && a3s-test check tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test check tests/e2e/word-list-formatting-phone.acl --json && a3s-test check tests/e2e/word-font-picker-phone.acl --json && a3s-test check tests/e2e/word-comments-drawer.acl --json && a3s-test check tests/e2e/word-comment-windowing.acl --json && a3s-test check tests/e2e/word-citations-phone.acl --json && a3s-test check tests/e2e/word-navigation-search.acl --json && a3s-test check tests/e2e/word-navigation-windowing.acl --json && a3s-test check tests/e2e/word-find-replace-phone.acl --json && a3s-test check tests/e2e/word-page-navigation.acl --json && a3s-test check tests/e2e/word-page-windowing.acl --json && a3s-test check tests/e2e/word-ai-question.acl --json && a3s-test check tests/e2e/word-picture-insert.acl --json && a3s-test check tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test check tests/e2e/word-track-changes-phone.acl --json && a3s-test check tests/e2e/word-review-conflict-phone.acl --json && a3s-test check tests/e2e/word-revision-windowing.acl --json && a3s-test check tests/e2e/word-table-phone.acl --json && a3s-test check tests/e2e/word-table-borders.acl --json && a3s-test check tests/e2e/word-theme-table.acl --json && a3s-test check tests/e2e/word-styled-table.acl --json && a3s-test check tests/e2e/word-multi-page-table.acl --json && a3s-test check tests/e2e/word-cross-reference-phone.acl --json && a3s-test check tests/e2e/word-bookmark-links-phone.acl --json && a3s-test check tests/e2e/word-notes-phone.acl --json && a3s-test check tests/e2e/word-fields-phone.acl --json && a3s-test check tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test check tests/e2e/spreadsheet-phone-find.acl --json && a3s-test check tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test check tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test check tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test check tests/e2e/presentation-presenter-view.acl --json && a3s-test check tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test check tests/e2e/presentation-phone-comments.acl --json && a3s-test check tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test check tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test check tests/e2e/markdown-phone-modes.acl --json && a3s-test check tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test check tests/e2e/office-docs-navigation.acl --json && a3s-test check tests/e2e/collaboration-participants.acl --json && a3s-test check tests/e2e/collaboration-pdf-annotations.acl --json",
90
+ "test:e2e": "bun run test:e2e:fixtures && a3s-test run tests/e2e/word-page-color.acl --json && a3s-test run tests/e2e/word-page-setup-phone.acl --json && a3s-test run tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test run tests/e2e/word-list-formatting-phone.acl --json && a3s-test run tests/e2e/word-font-picker-phone.acl --json && a3s-test run tests/e2e/word-comments-drawer.acl --json && a3s-test run tests/e2e/word-comment-windowing.acl --json && a3s-test run tests/e2e/word-citations-phone.acl --json && a3s-test run tests/e2e/word-navigation-search.acl --json && a3s-test run tests/e2e/word-navigation-windowing.acl --json && a3s-test run tests/e2e/word-find-replace-phone.acl --json && a3s-test run tests/e2e/word-page-navigation.acl --json && a3s-test run tests/e2e/word-page-windowing.acl --json && a3s-test run tests/e2e/word-ai-question.acl --json && a3s-test run tests/e2e/word-picture-insert.acl --json && a3s-test run tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test run tests/e2e/word-track-changes-phone.acl --json && a3s-test run tests/e2e/word-review-conflict-phone.acl --json && a3s-test run tests/e2e/word-revision-windowing.acl --json && a3s-test run tests/e2e/word-table-phone.acl --json && a3s-test run tests/e2e/word-table-borders.acl --json && a3s-test run tests/e2e/word-theme-table.acl --json && a3s-test run tests/e2e/word-styled-table.acl --json && a3s-test run tests/e2e/word-multi-page-table.acl --json && a3s-test run tests/e2e/word-cross-reference-phone.acl --json && a3s-test run tests/e2e/word-bookmark-links-phone.acl --json && a3s-test run tests/e2e/word-notes-phone.acl --json && a3s-test run tests/e2e/word-fields-phone.acl --json && a3s-test run tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test run tests/e2e/spreadsheet-phone-find.acl --json && a3s-test run tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test run tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test run tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test run tests/e2e/presentation-presenter-view.acl --json && a3s-test run tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test run tests/e2e/presentation-phone-comments.acl --json && a3s-test run tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test run tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test run tests/e2e/markdown-phone-modes.acl --json && a3s-test run tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test run tests/e2e/office-docs-navigation.acl --json && a3s-test run tests/e2e/collaboration-participants.acl --json && a3s-test run tests/e2e/collaboration-pdf-annotations.acl --json && a3s-test run tests/e2e/collaboration-spreadsheet-cells.acl --json",
91
+ "test:e2e:check": "bun run test:e2e:fixtures && a3s-test check tests/e2e/word-page-color.acl --json && a3s-test check tests/e2e/word-page-setup-phone.acl --json && a3s-test check tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test check tests/e2e/word-list-formatting-phone.acl --json && a3s-test check tests/e2e/word-font-picker-phone.acl --json && a3s-test check tests/e2e/word-comments-drawer.acl --json && a3s-test check tests/e2e/word-comment-windowing.acl --json && a3s-test check tests/e2e/word-citations-phone.acl --json && a3s-test check tests/e2e/word-navigation-search.acl --json && a3s-test check tests/e2e/word-navigation-windowing.acl --json && a3s-test check tests/e2e/word-find-replace-phone.acl --json && a3s-test check tests/e2e/word-page-navigation.acl --json && a3s-test check tests/e2e/word-page-windowing.acl --json && a3s-test check tests/e2e/word-ai-question.acl --json && a3s-test check tests/e2e/word-picture-insert.acl --json && a3s-test check tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test check tests/e2e/word-track-changes-phone.acl --json && a3s-test check tests/e2e/word-review-conflict-phone.acl --json && a3s-test check tests/e2e/word-revision-windowing.acl --json && a3s-test check tests/e2e/word-table-phone.acl --json && a3s-test check tests/e2e/word-table-borders.acl --json && a3s-test check tests/e2e/word-theme-table.acl --json && a3s-test check tests/e2e/word-styled-table.acl --json && a3s-test check tests/e2e/word-multi-page-table.acl --json && a3s-test check tests/e2e/word-cross-reference-phone.acl --json && a3s-test check tests/e2e/word-bookmark-links-phone.acl --json && a3s-test check tests/e2e/word-notes-phone.acl --json && a3s-test check tests/e2e/word-fields-phone.acl --json && a3s-test check tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test check tests/e2e/spreadsheet-phone-find.acl --json && a3s-test check tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test check tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test check tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test check tests/e2e/presentation-presenter-view.acl --json && a3s-test check tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test check tests/e2e/presentation-phone-comments.acl --json && a3s-test check tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test check tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test check tests/e2e/markdown-phone-modes.acl --json && a3s-test check tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test check tests/e2e/office-docs-navigation.acl --json && a3s-test check tests/e2e/collaboration-participants.acl --json && a3s-test check tests/e2e/collaboration-pdf-annotations.acl --json && a3s-test check tests/e2e/collaboration-spreadsheet-cells.acl --json",
92
92
  "test:e2e:fixtures": "bun scripts/create-e2e-fixtures.ts",
93
93
  "test:e2e:initial-focus": "a3s-test run tests/e2e/office-editor-initial-focus.acl --json",
94
94
  "test:e2e:initial-focus:check": "a3s-test check tests/e2e/office-editor-initial-focus.acl --json",
@@ -96,6 +96,8 @@
96
96
  "test:e2e:collaboration-participants:check": "a3s-test check tests/e2e/collaboration-participants.acl --json",
97
97
  "test:e2e:collaboration-pdf-annotations": "a3s-test run tests/e2e/collaboration-pdf-annotations.acl --json",
98
98
  "test:e2e:collaboration-pdf-annotations:check": "a3s-test check tests/e2e/collaboration-pdf-annotations.acl --json",
99
+ "test:e2e:collaboration-spreadsheet-cells": "a3s-test run tests/e2e/collaboration-spreadsheet-cells.acl --json",
100
+ "test:e2e:collaboration-spreadsheet-cells:check": "a3s-test check tests/e2e/collaboration-spreadsheet-cells.acl --json",
99
101
  "test:e2e:wps-layout": "bun run test:e2e:fixtures && a3s-test run tests/e2e/word-wps-layout-parity.acl --json && a3s-test run tests/e2e/word-wps-font-grid-parity.acl --json",
100
102
  "test:e2e:wps-layout:check": "bun run test:e2e:fixtures && a3s-test check tests/e2e/word-wps-layout-parity.acl --json && a3s-test check tests/e2e/word-wps-font-grid-parity.acl --json",
101
103
  "test:e2e:writer-ribbon": "a3s-test run tests/e2e/word-ribbon-collapse.acl --json",