@a3s-lab/office 0.7.1 → 0.7.3

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,8 +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; until then, unsupported
26
- non-edit modes remain read-only.
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.
27
28
  - Editors never collaborate by repeatedly replacing one serialized OOXML file
28
29
  or one universal JSON blob. Each format gets a typed, conflict-local model.
29
30
 
@@ -87,20 +88,30 @@ Status: implemented in the browser library.
87
88
  navigate only on explicit activation; passive Awareness updates preserve
88
89
  local focus, selection, and viewport.
89
90
  - React, Vue, and Web Component session and presence plumbing.
91
+ - A runnable A3S Boot reference backend now provides signed room tickets,
92
+ Origin validation, permission enforcement, WebSocket rooms, durable Yrs
93
+ persistence, ephemeral Awareness relay, reconnect repair, and service-owned
94
+ 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.
90
100
  - Convergence, offline/reconnect, transport-boundary, presence, permission,
91
- StrictMode, framework-parity, and ownership tests.
92
-
93
- Remaining before this phase is production complete:
101
+ StrictMode, framework-parity, ownership, backend persistence, room broadcast,
102
+ ticket tamper, and read-only authorization tests.
94
103
 
95
- - Add reference WebSocket/WebTransport relay examples with provider-side
96
- authorization and persistent update replay.
104
+ The reference backend is complete for one service process. Multi-replica
105
+ deployments still require host-selected sticky room routing or shared
106
+ Redis/NATS fan-out plus a distributed writer/lock policy.
97
107
 
98
108
  ### Phase 2: Document
99
109
 
100
110
  Status: browser collaboration foundation, participant roster, remote
101
- selection/caret projection, participant navigation, and native
102
- text/options/bounded structural paragraph mutations implemented; rich native
103
- parity and the remaining review authorization matrix are pending.
111
+ 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.
104
115
 
105
116
  - TipTap is bound to `document.content` through
106
117
  `@tiptap/extension-collaboration`; StarterKit undo/redo is disabled and the
@@ -134,11 +145,30 @@ parity and the remaining review authorization matrix are pending.
134
145
  after durable restart and replay, including concurrent native and browser
135
146
  paragraph insertion across nested lists and nested tables. Real CLI and MCP
136
147
  subprocess tests exercise the same bounded structural mutations.
148
+ - Document `comment` sessions now create selection-anchored threads, append
149
+ replies, resolve or reopen threads, and delete only their actor's own comment
150
+ or reply records while canonical text, structure, options, bibliography, and
151
+ non-comment formatting stay read-only. Records persist by stable ID and
152
+ immutable creation claim; removing an anchor through an authorized content
153
+ edit retains a detached thread. Remote review changes do not enter local undo
154
+ history.
155
+ - 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.
137
167
 
138
168
  Remaining:
139
169
 
140
170
  - Add suggestion-only authorization and durable accept/reject decision audit
141
- records; `comment` and `suggest` remain read-only until those models exist.
171
+ records; `suggest` remains read-only until that model exists.
142
172
  - Prove concurrent full-table, list-restructure, section, comment, and revision
143
173
  workflows, plus DOCX import/export after merged edits.
144
174
  - Expand native convergence from bounded paragraph edits to complete table,
@@ -340,7 +370,7 @@ destructive actions remain attributable, reviewable, and non-retryable.
340
370
 
341
371
  Status: native Yrs replica store, resumable CLI/MCP event streams, `a3s code`
342
372
  projection, a host-injected live CLI transport session, and typed Markdown,
343
- Document, Spreadsheet cell, Presentation scene-element, PDF
373
+ Document content/comment, Spreadsheet cell, Presentation scene-element, PDF
344
374
  annotation/form-value, and PDF redaction/page-operation review mutation
345
375
  surfaces are implemented; the remaining format mutations and native presence
346
376
  projection are pending.
@@ -356,7 +386,7 @@ projection are pending.
356
386
  canonical replay preserves genuinely missing updates while resolving Yrs
357
387
  array items whose causal dependencies arrived out of order.
358
388
  - `a3s-office collab` exposes non-interactive `create`, `join`, `inspect`,
359
- `diff`/`synchronize`, `apply`, `mutate`, `checkpoint`, `watch`, and `leave`
389
+ `read`, `diff`/`synchronize`, `apply`, `mutate`, `checkpoint`, `watch`, and `leave`
360
390
  commands
361
391
  with JSON output and optional no-clobber binary output. `sync-step1`,
362
392
  `encode-update`, and `handle-message` expose standard y-sync document
@@ -385,10 +415,23 @@ projection are pending.
385
415
  if the declared match count is stale. Bounded section/list/table/blockquote
386
416
  paragraph insert/delete uses explicit stable identities and exact deletion
387
417
  guards, while table-contained edits rotate all ancestor row text identities;
388
- page color and track-changes write their typed option fields. All emit minimal
389
- incremental updates through the same durable
390
- receipt/checkpoint path. Canonical typed mutations require `edit`; raw remote
391
- updates remain receivable in every mode so read-only peers still converge.
418
+ page color and track-changes write their typed option fields. Document comment
419
+ create/reply/resolve/delete writes attributable browser-compatible review
420
+ records and exact selection marks. All emit minimal incremental updates
421
+ through the same durable receipt/checkpoint path. Canonical content mutations
422
+ require `edit`; Document review mutations accept `edit` or `comment`, with
423
+ ownership-restricted deletion in `comment`. Raw remote updates remain
424
+ receivable in every mode so read-only peers still converge.
425
+ - Rust `project`, `collab read`, and `office_collaboration_read` interpret the
426
+ Office-owned browser schema inside Office rather than in a product host.
427
+ Markdown returns its exact canonical source. Document returns bounded
428
+ 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.
431
+ `document-replace-paragraph` uses those stable
432
+ identities plus complete expected text to reject a stale same-paragraph
433
+ browser/agent edit before writing, while unrelated changes can proceed
434
+ without replacing the full document.
392
435
  - Spreadsheet cell mutations create or recursively patch one zero-based
393
436
  coordinate after matching the caller's observed cell, or delete it only after
394
437
  an exact complete-cell match. They preserve the browser's field-addressed
@@ -427,7 +470,7 @@ projection are pending.
427
470
  source browser operation, and source attribution is audit data rather than
428
471
  an authorization token.
429
472
  - Cross-language tests apply deterministic native UTF-16 Markdown, ProseMirror
430
- Document text/options/paragraph, Spreadsheet cell, Presentation
473
+ Document text/options/paragraph/comment, Spreadsheet cell, Presentation
431
474
  scene-element content/z-order, and PDF annotation/form-value updates in browser Yjs,
432
475
  including concurrent browser/native paragraph, cell-leaf, element-field,
433
476
  annotation-leaf, and PDF form edits, in addition to importing browser Yjs
@@ -440,9 +483,8 @@ Remaining:
440
483
 
441
484
  - Extend typed format-model mutations to Spreadsheet and remaining Presentation
442
485
  structural/rich-text operations plus PDF signatures; deepen Document
443
- mutations to additional nested structures and review operations, and add
444
- durable comment/suggest operations before enabling those modes for local
445
- mutation.
486
+ mutations to additional nested structures and tracked suggestion decisions
487
+ before enabling `suggest` for local mutation.
446
488
  - Project editor-visible presence and selection state while keeping Awareness
447
489
  ephemeral and outside native replica persistence.
448
490
 
package/README.md CHANGED
@@ -143,8 +143,9 @@ The images below are committed visual-regression baselines from the real
143
143
  also keep a durable Yrs replica, exchange standard Yjs v1 updates and state
144
144
  vectors, perform authorized typed Markdown, Document, Spreadsheet cell,
145
145
  Presentation scene-element and z-order, and PDF annotation, form-value, and
146
- review changes, retain browser/native actor attribution, and checkpoint
147
- without replacing a whole Office file.
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.
148
149
 
149
150
  ## Real-time collaboration
150
151
 
@@ -158,8 +159,16 @@ through the CLI, standard MCP server, or A3S Code.
158
159
  The host owns rooms, authentication, authorization, network delivery, offline
159
160
  buffering, persistence, and the `Y.Doc`; A3S Office owns format-specific
160
161
  bindings, local undo, validated presence, and conflict-local typed mutations.
162
+ An authenticated Document `comment` session can select text, create a durable
163
+ thread, reply, resolve or reopen it, and delete only review records owned by
164
+ its actor while canonical content remains read-only. The server independently
165
+ validates that review-only boundary before persistence and broadcast.
161
166
  See the bilingual [real-time collaboration guide](https://a3s-lab.github.io/Office/docs/components/collaboration.html)
162
167
  for React, Vue, Web Component, reconnect, security, and native-agent setup.
168
+ The repository also ships a runnable
169
+ [A3S Boot collaboration server](examples/collaboration-server/) with signed
170
+ room tickets, Origin validation, durable Yrs storage, Awareness relay, a typed
171
+ browser adapter, and actor-scoped browser or native room messages.
163
172
 
164
173
  ## Quick start
165
174
 
@@ -1042,6 +1051,19 @@ cargo run -p a3s-office-cli -- collab mutate .a3s/report.replica \
1042
1051
  --operation-id edit-44 \
1043
1052
  --mutation '{"type":"document-insert-paragraph","anchorParagraphId":"00000001","position":"after","paragraphId":"00000012","textId":"00000013","text":"Native paragraph"}' --json
1044
1053
 
1054
+ # Add a durable selection comment from a comment-mode native replica. Read the
1055
+ # projection first and use its exact paragraph/text IDs, anchor text, and UTF-16
1056
+ # offsets. The author must match the authenticated actor display name.
1057
+ cargo run -p a3s-office-cli -- collab join .a3s/report-review.replica \
1058
+ --artifact-id report --kind document --actor-id agent-7 \
1059
+ --actor-kind agent --mode comment --operation-id comment-join-1 \
1060
+ --input browser.update --json
1061
+ cargo run -p a3s-office-cli -- collab read .a3s/report-review.replica --json
1062
+ cargo run -p a3s-office-cli -- collab mutate .a3s/report-review.replica \
1063
+ --artifact-id report --kind document --actor-id agent-7 --mode comment \
1064
+ --operation-id comment-45 \
1065
+ --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
+
1045
1067
  # Recursively patch one Spreadsheet cell after matching the observed value.
1046
1068
  # Zero-based row/column coordinates follow the browser collaboration model.
1047
1069
  cargo run -p a3s-office-cli -- collab mutate .a3s/plan.replica \
@@ -1110,9 +1132,18 @@ controller as a shared participant roster, remote canvas projection, and
1110
1132
  participant-to-location navigation; neither component creates an account or
1111
1133
  backend. The native CLI's JSONL session bridges the same host-channel envelope,
1112
1134
  including reconnect handshakes, durable agent updates, and remote-echo
1113
- suppression, without opening its own network provider. Typed Markdown
1135
+ suppression, without opening its own network provider. Native Rust `project`,
1136
+ `collab read`, and `office_collaboration_read` return the exact canonical
1137
+ Markdown source or an Office-owned bounded Document projection with stable
1138
+ paragraph/text identities, structural ancestry, option fields, subordinate
1139
+ 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
1142
+ not need to interpret Office's private Yjs schema. Typed Markdown
1114
1143
  replace/splice operations use browser UTF-16 offsets. Document mutations edit
1115
- ProseMirror `Y.XmlText` in place, rotate the affected Word `textId`, insert a
1144
+ ProseMirror `Y.XmlText` in place, rotate the affected Word `textId`, replace one
1145
+ stable plain paragraph only after its `paragraphId`, `textId`, and complete
1146
+ text still match, insert a
1116
1147
  plain paragraph beside a stable identity in a bounded section, list-item,
1117
1148
  table-cell/header, or blockquote container, or delete one only after its
1118
1149
  complete text and `textId` still match. Required container blocks and each list
@@ -1153,6 +1184,17 @@ targets, or a second final decision. None of these paths puts source or
1153
1184
  signature bytes in Yjs. Validated browser source origins survive native
1154
1185
  persistence and are re-emitted separately from host delivery IDs.
1155
1186
 
1187
+ Document review mutations use `document-comment-create`,
1188
+ `document-comment-reply`, `document-comment-set-resolved`, and
1189
+ `document-comment-delete`. Create validates an exact paragraph/text identity,
1190
+ UTF-16 range, and selected text before writing both the thread and its
1191
+ `documentComment` mark. Replies append to the stable thread; resolution can be
1192
+ set or cleared; and `comment` mode can delete only records attributed to its
1193
+ own actor. Removing selected text through a separately authorized edit keeps
1194
+ the thread as a detached review record. Browser and native comment changes
1195
+ share immutable claims and remain isolated from another participant's undo
1196
+ history.
1197
+
1156
1198
  Read the [native engine design](docs/latest/en/native-office-engine.md), the
1157
1199
  complete [CLI reference](docs/latest/en/cli-reference.md), or the published
1158
1200
  [CLI and Skill guide](https://a3s-lab.github.io/Office/docs/automation/).
@@ -1216,6 +1258,8 @@ without hard-coded return URLs.
1216
1258
 
1217
1259
  - [Live Playground](https://a3s-lab.github.io/Office/)
1218
1260
  - [Documentation center](https://a3s-lab.github.io/Office/docs/)
1261
+ - [A3S Office 0.7.3 documentation](https://a3s-lab.github.io/Office/docs/0.7.3/)
1262
+ - [A3S Office 0.7.2 documentation](https://a3s-lab.github.io/Office/docs/0.7.2/)
1219
1263
  - [A3S Office 0.7.1 documentation](https://a3s-lab.github.io/Office/docs/0.7.1/)
1220
1264
  - [A3S Office 0.7.0 documentation](https://a3s-lab.github.io/Office/docs/0.7.0/)
1221
1265
  - [A3S Office 0.6.0 documentation](https://a3s-lab.github.io/Office/docs/0.6.0/)