@a3s-lab/office 0.8.0 → 0.9.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.
@@ -111,8 +111,8 @@ Redis/NATS fan-out plus a distributed writer/lock policy.
111
111
  Status: browser collaboration foundation, participant roster, remote
112
112
  selection/caret projection, participant navigation, durable review-only
113
113
  comment and suggestion modes, immutable suggestion-decision audit, and native
114
- text/options/bounded structural paragraph/comment mutations implemented; rich
115
- native mutation parity remains pending.
114
+ text/options/bounded structural paragraph/comment/suggestion mutations
115
+ implemented; rich native mutation parity remains pending.
116
116
 
117
117
  - TipTap is bound to `document.content` through
118
118
  `@tiptap/extension-collaboration`; StarterKit undo/redo is disabled and the
@@ -167,12 +167,15 @@ native mutation parity remains pending.
167
167
  without the additive roots remain readable, and a final decision clears
168
168
  local history that could otherwise resurrect the decided mark.
169
169
  - Rust, CLI, MCP, and A3S Code expose `document-comment-create`,
170
- `document-comment-reply`, `document-comment-set-resolved`, and
171
- `document-comment-delete`. Projection schema v2 returns attributable threads,
172
- replies, anchor text, paragraph/text identities, browser-compatible UTF-16
173
- offsets, resolution, and detached state. Native and browser fixtures cover
174
- restart, reordered delivery, stale anchor guards, idempotent retries,
175
- ownership failures, and cross-language convergence.
170
+ `document-comment-reply`, `document-comment-set-resolved`,
171
+ `document-comment-delete`, `document-suggestion-create`, and
172
+ `document-suggestion-decide`. Projection schema v3 returns attributable
173
+ comment threads, replies, anchor text, live suggestion identities and exact
174
+ placements, immutable final decisions, paragraph/text identities,
175
+ browser-compatible UTF-16 offsets, resolution, and detached state. Native and
176
+ browser fixtures cover restart, reordered delivery, stale guards, idempotent
177
+ retries, ownership/mode failures, atomic replacement decisions, and
178
+ cross-language convergence.
176
179
  - The A3S Boot backend permits `edit` content/review updates, semantically
177
180
  validated Document `comment` review-only updates, and semantically validated
178
181
  Document `suggest` proposal updates. Signed actor identity and display name
@@ -183,10 +186,6 @@ native mutation parity remains pending.
183
186
 
184
187
  Remaining:
185
188
 
186
- - Add closed typed native projection and mutation variants for creating
187
- Document suggestions and deciding them through CLI/MCP/A3S Code. The current
188
- typed native mutation set can synchronize the resulting Yjs state but does
189
- not originate these two workflows.
190
189
  - Prove concurrent full-table, list-restructure, section, comment, and revision
191
190
  workflows, plus DOCX import/export after merged edits.
192
191
  - Expand native convergence from bounded paragraph edits to complete table,
@@ -248,9 +247,9 @@ comments, and delete-vs-edit cases converge and survive PPTX round trips.
248
247
 
249
248
  ### Phase 4: Spreadsheet
250
249
 
251
- Status: browser collaboration foundation and native conflict-local cell
252
- mutations implemented; structural operations, native recalculation parity, and
253
- XLSX concurrency coverage are pending.
250
+ Status: browser collaboration foundation plus native conflict-local single-cell
251
+ and atomic batch-cell mutations implemented; structural operations, native
252
+ recalculation parity, and XLSX concurrency coverage are pending.
254
253
 
255
254
  - Stable sheet/named-range order arrays, ID-keyed records, and append-only
256
255
  creation claims avoid a serialized workbook or dense worksheet root.
@@ -283,11 +282,16 @@ XLSX concurrency coverage are pending.
283
282
  and an empty sheet's first write stays sparse. Native restart, real CLI/MCP
284
283
  subprocesses, and browser Yjs duplicate/reordered delivery cover the same
285
284
  update contract.
285
+ - `spreadsheet-batch-cells` translates one paste, fill, or other bounded user
286
+ gesture into 1 to 4,096 distinct coordinates in one sheet and one Yjs
287
+ transaction. Set/create changes retain recursive optimistic guards; delete
288
+ changes require an exact complete observed cell. Every change is preflighted
289
+ against one shared sheet snapshot, so one conflict rejects the entire batch
290
+ without partial fields, presence markers, dense dimensions, or durable log
291
+ growth. Single-cell mutations use this same kernel.
286
292
 
287
293
  Remaining:
288
294
 
289
- - Translate one user gesture into one transaction; batch paste/fill/sort/filter
290
- without emitting a document-sized replacement.
291
295
  - Add stable structural operations and reference transforms for row/column
292
296
  insertion/deletion, merged ranges, tables, sort, and named references.
293
297
  - Treat calculated values as derived once browser and native recalculation are
@@ -388,11 +392,11 @@ destructive actions remain attributable, reviewable, and non-retryable.
388
392
 
389
393
  Status: native Yrs replica store, resumable CLI/MCP event streams, `a3s code`
390
394
  projection, a host-injected live CLI transport session, authenticated browser
391
- suggestion-update authorization, and typed Markdown, Document content/comment,
392
- Spreadsheet cell, Presentation scene-element, PDF annotation/form-value, and
393
- PDF redaction/page-operation review mutation surfaces are implemented; typed
394
- native Document suggestion/decision mutations, the remaining format mutations,
395
- and native presence projection are pending.
395
+ suggestion-update authorization, and typed Markdown, Document
396
+ content/comment/suggestion, Spreadsheet cell, Presentation scene-element, PDF
397
+ annotation/form-value, and PDF redaction/page-operation review mutation surfaces
398
+ are implemented; the remaining format mutations and native presence projection
399
+ are pending.
396
400
 
397
401
  - Yrs `0.27.3` now uses 53-bit Yjs-compatible client IDs and exchanges standard
398
402
  Yjs v1 updates, state vectors, and y-sync `SyncStep1`/`Update` messages with
@@ -444,25 +448,28 @@ and native presence projection are pending.
444
448
  - Host-authenticated Document `suggest` transport updates are semantically
445
449
  checked in Yrs before commit: only attributed insertion/deletion/replacement
446
450
  proposals owned by the authenticated actor may be added or withdrawn, while
447
- canonical state and every non-suggestion root remain protected. This is a
448
- transport authorization path, not a `NativeOfficeCollaborationMutation`;
449
- `collab mutate`, `office_collaboration_mutate`, and projection v2 do not yet
450
- expose native typed suggestion creation or final-decision operations.
451
+ canonical state and every non-suggestion root remain protected.
452
+ `document-suggestion-create` exposes the same closed proposal contract to an
453
+ actor-scoped native `suggest` replica; `document-suggestion-decide` lets an
454
+ `edit` replica match and accept or reject one or more complete projected
455
+ identities atomically, then appends immutable browser-compatible decisions.
451
456
  - Rust `project`, `collab read`, and `office_collaboration_read` interpret the
452
457
  Office-owned browser schema inside Office rather than in a product host.
453
458
  Markdown returns its exact canonical source. Document returns bounded
454
459
  traversal-order paragraph records, stable `paragraphId`/`textId` pairs,
455
- structural ancestry, option fields, subordinate plain text, and projection-v2
456
- comment/reply/anchor/detached records together with the exact state vector.
460
+ structural ancestry, option fields, subordinate plain text, and projection-v3
461
+ comment/reply/anchor/detached records, live suggestions with exact placements,
462
+ and immutable final decisions together with the exact state vector.
457
463
  `document-replace-paragraph` uses those stable
458
464
  identities plus complete expected text to reject a stale same-paragraph
459
465
  browser/agent edit before writing, while unrelated changes can proceed
460
466
  without replacing the full document.
461
467
  - Spreadsheet cell mutations create or recursively patch one zero-based
462
468
  coordinate after matching the caller's observed cell, or delete it only after
463
- an exact complete-cell match. They preserve the browser's field-addressed
464
- representation, dense/sparse projection mode, and atomic fail-closed
465
- semantics without replacing a worksheet or workbook.
469
+ an exact complete-cell match. `spreadsheet-batch-cells` applies 1 to 4,096
470
+ distinct changes from one sheet snapshot in one transaction. They preserve
471
+ the browser's field-addressed representation, dense/sparse projection mode,
472
+ and atomic fail-closed semantics without replacing a worksheet or workbook.
466
473
  - Presentation scene-element mutations create, update, move, or tombstone one
467
474
  stable object inside a slide, master, or layout. Canonical creation claims
468
475
  prevent conflicting same-ID reuse, optimistic top-level field guards merge
@@ -509,9 +516,8 @@ Remaining:
509
516
 
510
517
  - Extend typed format-model mutations to Spreadsheet and remaining Presentation
511
518
  structural/rich-text operations plus PDF signatures; deepen Document
512
- mutations to additional nested structures and add typed suggestion creation,
513
- suggestion projection, and tracked final-decision operations for native
514
- clients.
519
+ mutations to additional nested structures and complete table/list/section
520
+ revision workflows.
515
521
  - Project editor-visible presence and selection state while keeping Awareness
516
522
  ephemeral and outside native replica persistence.
517
523
 
package/README.md CHANGED
@@ -144,11 +144,11 @@ The images below are committed visual-regression baselines from the real
144
144
  - **Automation outside the browser** — The native Rust CLI, standard MCP
145
145
  server, and Office Skill share bounded mutation contracts. Coding agents can
146
146
  also keep a durable Yrs replica, exchange standard Yjs v1 updates and state
147
- vectors, perform authorized typed Markdown, Document, Spreadsheet cell,
147
+ vectors, perform authorized typed Markdown, Document, Spreadsheet cell/batch,
148
148
  Presentation scene-element and z-order, and PDF annotation, form-value, and
149
- review changes, including attributable Document selection comments and
150
- replies, retain browser/native actor attribution, and checkpoint without
151
- replacing a whole Office file.
149
+ review changes, including attributable Document selection comments, replies,
150
+ text suggestions, and atomic final decisions, retain browser/native actor
151
+ attribution, and checkpoint without replacing a whole Office file.
152
152
 
153
153
  ## Real-time collaboration
154
154
 
@@ -1075,6 +1075,33 @@ cargo run -p a3s-office-cli -- collab mutate .a3s/report-review.replica \
1075
1075
  --operation-id comment-45 \
1076
1076
  --mutation '{"type":"document-comment-create","commentId":"comment-1","paragraphId":"00000001","expectedTextId":"00000002","startUtf16":6,"endUtf16":12,"expectedText":"review","author":"Ada Reviewer","createdAt":"2026-08-17T00:00:00.000Z","text":"Clarify this review point."}' --json
1077
1077
 
1078
+ # Propose an atomic replacement from an actor-scoped suggest replica. Read
1079
+ # projection v3 immediately before writing and copy its exact paragraph/text
1080
+ # identity, UTF-16 selection, and selected text.
1081
+ cargo run -p a3s-office-cli -- collab join .a3s/report-suggest.replica \
1082
+ --artifact-id report --kind document --actor-id agent-7 \
1083
+ --actor-kind agent --mode suggest --operation-id suggestion-join-1 \
1084
+ --input browser.update --json
1085
+ cargo run -p a3s-office-cli -- collab read .a3s/report-suggest.replica --json
1086
+ cargo run -p a3s-office-cli -- collab mutate .a3s/report-suggest.replica \
1087
+ --artifact-id report --kind document --actor-id agent-7 --mode suggest \
1088
+ --operation-id suggestion-create-1 \
1089
+ --mutation '{"type":"document-suggestion-create","paragraphId":"00000001","expectedTextId":"00000002","startUtf16":6,"endUtf16":8,"expectedText":"😀","replacement":"reviewed","insertionId":"agent-7-insertion-1","deletionId":"agent-7-deletion-1","author":"A3S Agent","createdAt":"2026-08-17T11:00:00.000Z"}' --json
1090
+ cargo run -p a3s-office-cli -- collab diff .a3s/report-suggest.replica \
1091
+ --output agent-suggestion.update --json
1092
+
1093
+ # An edit replica accepts or rejects one or more complete projected suggestion
1094
+ # identities atomically and appends immutable actor-attributed decisions.
1095
+ cargo run -p a3s-office-cli -- collab join .a3s/report-editor.replica \
1096
+ --artifact-id report --kind document --actor-id editor-1 \
1097
+ --actor-kind human --mode edit --operation-id editor-join-1 \
1098
+ --input agent-suggestion.update --json
1099
+ cargo run -p a3s-office-cli -- collab read .a3s/report-editor.replica --json
1100
+ cargo run -p a3s-office-cli -- collab mutate .a3s/report-editor.replica \
1101
+ --artifact-id report --kind document --actor-id editor-1 --mode edit \
1102
+ --operation-id suggestion-accept-1 \
1103
+ --mutation '{"type":"document-suggestion-decide","suggestions":[{"id":"agent-7-deletion-1","kind":"deletion","expectedActorId":"agent-7","expectedAuthor":"A3S Agent","expectedCreatedAt":"2026-08-17T11:00:00.000Z","expectedText":"😀"},{"id":"agent-7-insertion-1","kind":"insertion","expectedActorId":"agent-7","expectedAuthor":"A3S Agent","expectedCreatedAt":"2026-08-17T11:00:00.000Z","expectedText":"reviewed"}],"decision":"accept","decidedBy":"Grace Editor","decidedAt":"2026-08-17T11:01:00.000Z"}' --json
1104
+
1078
1105
  # Recursively patch one Spreadsheet cell after matching the observed value.
1079
1106
  # Zero-based row/column coordinates follow the browser collaboration model.
1080
1107
  cargo run -p a3s-office-cli -- collab mutate .a3s/plan.replica \
@@ -1082,6 +1109,13 @@ cargo run -p a3s-office-cli -- collab mutate .a3s/plan.replica \
1082
1109
  --operation-id edit-45 \
1083
1110
  --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
1084
1111
 
1112
+ # Apply one bounded Spreadsheet gesture atomically. Coordinates must be unique;
1113
+ # nextCell:null is an exact guarded delete.
1114
+ cargo run -p a3s-office-cli -- collab mutate .a3s/plan.replica \
1115
+ --artifact-id plan --kind spreadsheet --actor-id agent-7 --mode edit \
1116
+ --operation-id paste-46 \
1117
+ --mutation '{"type":"spreadsheet-batch-cells","sheetId":"sheet-data","changes":[{"row":1,"column":0,"expectedCell":{"v":12,"m":"12","f":"=6*2"},"nextCell":{"v":14,"m":"14","f":"=7*2"}},{"row":1,"column":1,"expectedCell":null,"nextCell":{"v":20,"m":"20"}},{"row":2,"column":0,"expectedCell":{"v":"obsolete","m":"obsolete"},"nextCell":null}]}' --json
1118
+
1085
1119
  # Update one Presentation scene element after matching the complete observed
1086
1120
  # record. Create/delete use presentation-create/delete-element.
1087
1121
  cargo run -p a3s-office-cli -- collab mutate .a3s/deck.replica \
@@ -1148,8 +1182,9 @@ suppression, without opening its own network provider. Native Rust `project`,
1148
1182
  Markdown source or an Office-owned bounded Document projection with stable
1149
1183
  paragraph/text identities, structural ancestry, option fields, subordinate
1150
1184
  plain text, durable comments, replies, resolution and detached state, exact
1151
- paragraph-local UTF-16 anchors, and the current state vector. Projection schema
1152
- version 2 is the contract for these review fields. Product hosts therefore do
1185
+ paragraph-local UTF-16 anchors, live suggestions with exact placements,
1186
+ immutable final decisions, and the current state vector. Projection schema
1187
+ version 3 is the contract for these review fields. Product hosts therefore do
1153
1188
  not need to interpret Office's private Yjs schema. Typed Markdown
1154
1189
  replace/splice operations use browser UTF-16 offsets. Document mutations edit
1155
1190
  ProseMirror `Y.XmlText` in place, rotate the affected Word `textId`, replace one
@@ -1169,7 +1204,11 @@ write only changed leaves, so unrelated concurrent value, formula, style,
1169
1204
  hyperlink, note, and metadata edits merge. Use `expectedCell: null` only when
1170
1205
  creating an observed blank coordinate. Spreadsheet deletion requires the exact
1171
1206
  complete current cell, dense projections keep their dimensions, and sparse or
1172
- empty sheets remain sparse. Presentation creation writes one complete element
1207
+ empty sheets remain sparse. `spreadsheet-batch-cells` applies 1 to 4,096
1208
+ distinct coordinates in one sheet after checking every guard against the same
1209
+ snapshot, then writes fields, presence markers, and dense dimensions in one
1210
+ Yjs transaction. One conflict rejects the complete gesture without a durable
1211
+ event. Presentation creation writes one complete element
1173
1212
  plus a canonical immutable claim inside a slide, master, or layout and can
1174
1213
  place it after a stable active element. Presentation update compares complete
1175
1214
  expected/current/next elements and writes only changed top-level fields, so
@@ -1206,6 +1245,18 @@ the thread as a detached review record. Browser and native comment changes
1206
1245
  share immutable claims and remain isolated from another participant's undo
1207
1246
  history.
1208
1247
 
1248
+ Document suggestion mutations use `document-suggestion-create` in an
1249
+ actor-scoped `suggest` replica and `document-suggestion-decide` in an `edit`
1250
+ replica. Creation matches a stable plain paragraph, its current text identity,
1251
+ an exact UTF-16 range, and selected text before writing an insertion, deletion,
1252
+ or atomic replacement proposal. Decisions match every projected suggestion
1253
+ identity and text in the batch, then accept or reject all of them in one
1254
+ transaction and append immutable browser-compatible audit records. Actor IDs
1255
+ come from replica manifests; authors and decision names must match the
1256
+ authenticated display names. Stable-ID retries are idempotent, while stale
1257
+ identities, overlapping proposals, incomplete replacement IDs, forged
1258
+ attribution, or conflicting final decisions fail without a durable update.
1259
+
1209
1260
  Read the [native engine design](docs/latest/en/native-office-engine.md), the
1210
1261
  complete [CLI reference](docs/latest/en/cli-reference.md), or the published
1211
1262
  [CLI and Skill guide](https://a3s-lab.github.io/Office/docs/automation/).
@@ -1269,6 +1320,8 @@ without hard-coded return URLs.
1269
1320
 
1270
1321
  - [Live Playground](https://a3s-lab.github.io/Office/)
1271
1322
  - [Documentation center](https://a3s-lab.github.io/Office/docs/)
1323
+ - [A3S Office 0.9.0 documentation](https://a3s-lab.github.io/Office/docs/0.9.0/)
1324
+ - [A3S Office 0.8.1 documentation](https://a3s-lab.github.io/Office/docs/0.8.1/)
1272
1325
  - [A3S Office 0.8.0 documentation](https://a3s-lab.github.io/Office/docs/0.8.0/)
1273
1326
  - [A3S Office 0.7.3 documentation](https://a3s-lab.github.io/Office/docs/0.7.3/)
1274
1327
  - [A3S Office 0.7.2 documentation](https://a3s-lab.github.io/Office/docs/0.7.2/)
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a3s-lab/office",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Open-source collaborative browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
5
5
  "keywords": [
6
6
  "office",