@a3s-lab/office 0.7.3 → 0.8.1

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.
@@ -22,9 +22,9 @@ which tracks editor capability parity with WPS.
22
22
  the local binding origin, so one participant cannot undo another
23
23
  participant's operation.
24
24
  - `view`, `comment`, `suggest`, and `edit` are explicit session modes. A format
25
- enables a mode only after its durable model exists. Document now enables
26
- durable review-only `comment`; unsupported mode/format pairs remain
27
- read-only.
25
+ enables a mode only after its durable model exists. Document enables durable
26
+ review-only `comment` plus actor-attributed `suggest`; unsupported
27
+ mode/format pairs remain read-only.
28
28
  - Editors never collaborate by repeatedly replacing one serialized OOXML file
29
29
  or one universal JSON blob. Each format gets a typed, conflict-local model.
30
30
 
@@ -44,6 +44,7 @@ Protocol v1 reserves the `a3s.office` namespace.
44
44
  | `document.content` | `Y.XmlFragment` | ProseMirror document, including section layout, comment anchors, and tracked-change marks. |
45
45
  | `document.options` | `Y.Map` | Document-level editable options such as page color and tracking mode. |
46
46
  | `document.comments` / `document.comment-order` | `Y.Map` / `Y.Array` | ID-keyed durable comment/reply records and deterministic presentation order. |
47
+ | `document.change-decisions` / `document.change-decision-order` | `Y.Map` / `Y.Array` | Immutable accept/reject audit records and deterministic decision order. |
47
48
  | `document.bibliography*` | Typed maps/arrays | Bibliography settings and ID-keyed citation sources. |
48
49
  | `spreadsheet.*` | Typed maps/arrays | Sheet order, field-addressed sparse cells, formulas, styles, objects, names, and print state. |
49
50
  | `presentation.*` | Typed maps/arrays | Slide/master/layout order, ID-keyed scene objects, notes, transitions, and comments. |
@@ -92,11 +93,11 @@ Status: implemented in the browser library.
92
93
  Origin validation, permission enforcement, WebSocket rooms, durable Yrs
93
94
  persistence, ephemeral Awareness relay, reconnect repair, and service-owned
94
95
  durable update polling. Version-2 tickets bind actor display name and the
95
- durable store semantically authorizes Document comment-mode updates under
96
- the room lock before persistence or broadcast. Its browser adapter converts
97
- bounded base64 wire payloads back to the package's typed `Uint8Array`
98
- transport envelope and verifies the ready identity against the local
99
- session.
96
+ durable store semantically authorizes Document comment- and suggestion-mode
97
+ updates under the room lock before persistence or broadcast. Its browser
98
+ adapter converts bounded base64 wire payloads back to the package's typed
99
+ `Uint8Array` transport envelope and verifies the ready identity against the
100
+ local session.
100
101
  - Convergence, offline/reconnect, transport-boundary, presence, permission,
101
102
  StrictMode, framework-parity, ownership, backend persistence, room broadcast,
102
103
  ticket tamper, and read-only authorization tests.
@@ -109,9 +110,9 @@ Redis/NATS fan-out plus a distributed writer/lock policy.
109
110
 
110
111
  Status: browser collaboration foundation, participant roster, remote
111
112
  selection/caret projection, participant navigation, durable review-only
112
- comment mode, and native text/options/bounded structural paragraph/comment
113
- mutations implemented; rich native parity and suggestion authorization are
114
- pending.
113
+ comment and suggestion modes, immutable suggestion-decision audit, and native
114
+ text/options/bounded structural paragraph/comment/suggestion mutations
115
+ implemented; rich native mutation parity remains pending.
115
116
 
116
117
  - TipTap is bound to `document.content` through
117
118
  `@tiptap/extension-collaboration`; StarterKit undo/redo is disabled and the
@@ -152,23 +153,39 @@ pending.
152
153
  immutable creation claim; removing an anchor through an authorized content
153
154
  edit retains a detached thread. Remote review changes do not enter local undo
154
155
  history.
156
+ - Authenticated Document `suggest` sessions create attributed insertion,
157
+ deletion, and replacement proposals as `documentChange` marks. Their
158
+ canonical projection is unchanged until an `edit` participant decides the
159
+ proposal. Suggesters may withdraw their own insertion proposals, but cannot
160
+ change canonical text, structure, non-suggestion formatting, options,
161
+ comments, bibliography, another actor's proposal, or a deletion proposal's
162
+ targeted canonical text.
163
+ - Accepting or rejecting a suggestion applies the tracked change and appends
164
+ one immutable actor-attributed record to `document.change-decisions` plus its
165
+ deterministic order root in the same transaction. Identical offline retries
166
+ converge, a second conflicting final decision fails closed, old Documents
167
+ without the additive roots remain readable, and a final decision clears
168
+ local history that could otherwise resurrect the decided mark.
155
169
  - Rust, CLI, MCP, and A3S Code expose `document-comment-create`,
156
- `document-comment-reply`, `document-comment-set-resolved`, and
157
- `document-comment-delete`. Projection schema v2 returns attributable threads,
158
- replies, anchor text, paragraph/text identities, browser-compatible UTF-16
159
- offsets, resolution, and detached state. Native and browser fixtures cover
160
- restart, reordered delivery, stale anchor guards, idempotent retries,
161
- ownership failures, and cross-language convergence.
162
- - The A3S Boot backend permits `edit` content/review updates and semantically
163
- validated Document `comment` review-only updates. Signed actor display name
164
- must match the session actor and every new record author. Forged roots,
165
- content, structure, options, authorship, order, claims, anchors, or foreign
166
- deletion fail before the durable store changes.
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.
179
+ - The A3S Boot backend permits `edit` content/review updates, semantically
180
+ validated Document `comment` review-only updates, and semantically validated
181
+ Document `suggest` proposal updates. Signed actor identity and display name
182
+ must match every new comment, reply, or suggestion. Forged roots, canonical
183
+ content, structure, options, non-suggestion formatting, authorship, order,
184
+ claims, anchors, foreign deletion, or foreign suggestion changes fail before
185
+ the durable store changes.
167
186
 
168
187
  Remaining:
169
188
 
170
- - Add suggestion-only authorization and durable accept/reject decision audit
171
- records; `suggest` remains read-only until that model exists.
172
189
  - Prove concurrent full-table, list-restructure, section, comment, and revision
173
190
  workflows, plus DOCX import/export after merged edits.
174
191
  - Expand native convergence from bounded paragraph edits to complete table,
@@ -369,11 +386,12 @@ destructive actions remain attributable, reviewable, and non-retryable.
369
386
  ### Phase 6: CLI, MCP, and coding agents
370
387
 
371
388
  Status: native Yrs replica store, resumable CLI/MCP event streams, `a3s code`
372
- projection, a host-injected live CLI transport session, and typed Markdown,
373
- Document content/comment, Spreadsheet cell, Presentation scene-element, PDF
374
- annotation/form-value, and PDF redaction/page-operation review mutation
375
- surfaces are implemented; the remaining format mutations and native presence
376
- projection are pending.
389
+ projection, a host-injected live CLI transport session, authenticated browser
390
+ suggestion-update authorization, and typed Markdown, Document
391
+ content/comment/suggestion, Spreadsheet cell, Presentation scene-element, PDF
392
+ annotation/form-value, and PDF redaction/page-operation review mutation surfaces
393
+ are implemented; the remaining format mutations and native presence projection
394
+ are pending.
377
395
 
378
396
  - Yrs `0.27.3` now uses 53-bit Yjs-compatible client IDs and exchanges standard
379
397
  Yjs v1 updates, state vectors, and y-sync `SyncStep1`/`Update` messages with
@@ -422,12 +440,21 @@ projection are pending.
422
440
  require `edit`; Document review mutations accept `edit` or `comment`, with
423
441
  ownership-restricted deletion in `comment`. Raw remote updates remain
424
442
  receivable in every mode so read-only peers still converge.
443
+ - Host-authenticated Document `suggest` transport updates are semantically
444
+ checked in Yrs before commit: only attributed insertion/deletion/replacement
445
+ proposals owned by the authenticated actor may be added or withdrawn, while
446
+ canonical state and every non-suggestion root remain protected.
447
+ `document-suggestion-create` exposes the same closed proposal contract to an
448
+ actor-scoped native `suggest` replica; `document-suggestion-decide` lets an
449
+ `edit` replica match and accept or reject one or more complete projected
450
+ identities atomically, then appends immutable browser-compatible decisions.
425
451
  - Rust `project`, `collab read`, and `office_collaboration_read` interpret the
426
452
  Office-owned browser schema inside Office rather than in a product host.
427
453
  Markdown returns its exact canonical source. Document returns bounded
428
454
  traversal-order paragraph records, stable `paragraphId`/`textId` pairs,
429
- structural ancestry, option fields, subordinate plain text, and projection-v2
430
- comment/reply/anchor/detached records together with the exact state vector.
455
+ structural ancestry, option fields, subordinate plain text, and projection-v3
456
+ comment/reply/anchor/detached records, live suggestions with exact placements,
457
+ and immutable final decisions together with the exact state vector.
431
458
  `document-replace-paragraph` uses those stable
432
459
  identities plus complete expected text to reject a stale same-paragraph
433
460
  browser/agent edit before writing, while unrelated changes can proceed
@@ -483,8 +510,8 @@ Remaining:
483
510
 
484
511
  - Extend typed format-model mutations to Spreadsheet and remaining Presentation
485
512
  structural/rich-text operations plus PDF signatures; deepen Document
486
- mutations to additional nested structures and tracked suggestion decisions
487
- before enabling `suggest` for local mutation.
513
+ mutations to additional nested structures and complete table/list/section
514
+ revision workflows.
488
515
  - Project editor-visible presence and selection state while keeping Awareness
489
516
  ephemeral and outside native replica persistence.
490
517
 
@@ -506,5 +533,5 @@ valid update delivery orders.
506
533
  - Shipping a hosted collaboration backend inside the component package.
507
534
  - Treating awareness as authorization or durable audit history.
508
535
  - Hiding provider synchronization behind editor mount.
509
- - Claiming comments or suggestions are supported by a format until its durable
510
- review schema and accept/reject semantics are implemented.
536
+ - Claiming comments or suggestions are supported by a format that lacks a
537
+ durable review schema and, for suggestions, explicit accept/reject semantics.
package/README.md CHANGED
@@ -46,6 +46,9 @@ workflows, and a separate Rust automation plane.
46
46
  permissions, collaboration, and model providers.
47
47
  - **Collaborate across every editor** with shared Yjs/Yrs content, Awareness
48
48
  participants and remote locations, plus browser, CLI, MCP, and A3S Code peers.
49
+ Document reviewers can submit attributed insertions, deletions, and
50
+ replacements without directly changing canonical text; editors accept or
51
+ reject each proposal with an immutable shared decision record.
49
52
  - **Automate deterministically** through the native CLI, standard MCP server,
50
53
  or packaged Office Skill.
51
54
 
@@ -143,9 +146,9 @@ The images below are committed visual-regression baselines from the real
143
146
  also keep a durable Yrs replica, exchange standard Yjs v1 updates and state
144
147
  vectors, perform authorized typed Markdown, Document, Spreadsheet cell,
145
148
  Presentation scene-element and z-order, and PDF annotation, form-value, and
146
- review changes, including attributable Document selection comments and
147
- replies, retain browser/native actor attribution, and checkpoint without
148
- 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.
149
152
 
150
153
  ## Real-time collaboration
151
154
 
@@ -162,7 +165,15 @@ bindings, local undo, validated presence, and conflict-local typed mutations.
162
165
  An authenticated Document `comment` session can select text, create a durable
163
166
  thread, reply, resolve or reopen it, and delete only review records owned by
164
167
  its actor while canonical content remains read-only. The server independently
165
- validates that review-only boundary before persistence and broadcast.
168
+ validates that review-only boundary before persistence and broadcast. An
169
+ authenticated Document `suggest` session can submit attributed insertions,
170
+ deletions, and replacements while canonical text, structure, formatting,
171
+ options, comments, and other actors' suggestions remain protected. An `edit`
172
+ participant accepts or rejects a proposal and appends the final actor-attributed
173
+ decision to the immutable `document.change-decisions` audit trail. The A3S Boot
174
+ service validates both comment and suggestion semantics under the durable room
175
+ lock before it persists or broadcasts caller-supplied Yjs bytes. `suggest` on
176
+ non-Document formats remains receive-only.
166
177
  See the bilingual [real-time collaboration guide](https://a3s-lab.github.io/Office/docs/components/collaboration.html)
167
178
  for React, Vue, Web Component, reconnect, security, and native-agent setup.
168
179
  The repository also ships a runnable
@@ -1064,6 +1075,33 @@ cargo run -p a3s-office-cli -- collab mutate .a3s/report-review.replica \
1064
1075
  --operation-id comment-45 \
1065
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
1066
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
+
1067
1105
  # Recursively patch one Spreadsheet cell after matching the observed value.
1068
1106
  # Zero-based row/column coordinates follow the browser collaboration model.
1069
1107
  cargo run -p a3s-office-cli -- collab mutate .a3s/plan.replica \
@@ -1137,8 +1175,9 @@ suppression, without opening its own network provider. Native Rust `project`,
1137
1175
  Markdown source or an Office-owned bounded Document projection with stable
1138
1176
  paragraph/text identities, structural ancestry, option fields, subordinate
1139
1177
  plain text, durable comments, replies, resolution and detached state, exact
1140
- paragraph-local UTF-16 anchors, and the current state vector. Projection schema
1141
- version 2 is the contract for these review fields. Product hosts therefore do
1178
+ paragraph-local UTF-16 anchors, live suggestions with exact placements,
1179
+ immutable final decisions, and the current state vector. Projection schema
1180
+ version 3 is the contract for these review fields. Product hosts therefore do
1142
1181
  not need to interpret Office's private Yjs schema. Typed Markdown
1143
1182
  replace/splice operations use browser UTF-16 offsets. Document mutations edit
1144
1183
  ProseMirror `Y.XmlText` in place, rotate the affected Word `textId`, replace one
@@ -1195,6 +1234,18 @@ the thread as a detached review record. Browser and native comment changes
1195
1234
  share immutable claims and remain isolated from another participant's undo
1196
1235
  history.
1197
1236
 
1237
+ Document suggestion mutations use `document-suggestion-create` in an
1238
+ actor-scoped `suggest` replica and `document-suggestion-decide` in an `edit`
1239
+ replica. Creation matches a stable plain paragraph, its current text identity,
1240
+ an exact UTF-16 range, and selected text before writing an insertion, deletion,
1241
+ or atomic replacement proposal. Decisions match every projected suggestion
1242
+ identity and text in the batch, then accept or reject all of them in one
1243
+ transaction and append immutable browser-compatible audit records. Actor IDs
1244
+ come from replica manifests; authors and decision names must match the
1245
+ authenticated display names. Stable-ID retries are idempotent, while stale
1246
+ identities, overlapping proposals, incomplete replacement IDs, forged
1247
+ attribution, or conflicting final decisions fail without a durable update.
1248
+
1198
1249
  Read the [native engine design](docs/latest/en/native-office-engine.md), the
1199
1250
  complete [CLI reference](docs/latest/en/cli-reference.md), or the published
1200
1251
  [CLI and Skill guide](https://a3s-lab.github.io/Office/docs/automation/).
@@ -1258,6 +1309,8 @@ without hard-coded return URLs.
1258
1309
 
1259
1310
  - [Live Playground](https://a3s-lab.github.io/Office/)
1260
1311
  - [Documentation center](https://a3s-lab.github.io/Office/docs/)
1312
+ - [A3S Office 0.8.1 documentation](https://a3s-lab.github.io/Office/docs/0.8.1/)
1313
+ - [A3S Office 0.8.0 documentation](https://a3s-lab.github.io/Office/docs/0.8.0/)
1261
1314
  - [A3S Office 0.7.3 documentation](https://a3s-lab.github.io/Office/docs/0.7.3/)
1262
1315
  - [A3S Office 0.7.2 documentation](https://a3s-lab.github.io/Office/docs/0.7.2/)
1263
1316
  - [A3S Office 0.7.1 documentation](https://a3s-lab.github.io/Office/docs/0.7.1/)