@a3s-lab/office 0.3.0 → 0.4.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.
Files changed (262) hide show
  1. package/COLLABORATION_ROADMAP.md +426 -0
  2. package/README.md +635 -9
  3. package/dist/0~1403.js +1 -1
  4. package/dist/0~2805.js +1279 -0
  5. package/dist/{0~use-office-draft.js → 0~345.js} +30 -1
  6. package/dist/0~3539.js +1 -1
  7. package/dist/0~3557.js +1 -1
  8. package/dist/0~3635.js +1 -1
  9. package/dist/0~4595.js +7 -2
  10. package/dist/0~4980.js +154 -0
  11. package/dist/{0~9512.js → 0~6090.js} +539 -3
  12. package/dist/0~7048.js +92 -66
  13. package/dist/0~7614.js +2 -1
  14. package/dist/0~7754.js +5653 -0
  15. package/dist/0~9445.js +1 -1
  16. package/dist/0~document-editor.js +1815 -1553
  17. package/dist/0~markdown-editor.js +250 -44
  18. package/dist/0~pdf-viewer.js +1016 -24
  19. package/dist/0~presentation-editor.js +179 -8
  20. package/dist/0~spreadsheet-editor.js +3371 -578
  21. package/dist/0~work-docx-export.js +6801 -658
  22. package/dist/0~work-docx-import.js +1388 -795
  23. package/dist/0~work-office-diagnostics.js +524 -30
  24. package/dist/0~work-pptx-export.js +2 -1
  25. package/dist/0~work-pptx-import.js +1 -2
  26. package/dist/0~work-presentation-charts.js +1 -1
  27. package/dist/2591.js +197 -0
  28. package/dist/3818.js +1090 -0
  29. package/dist/4104.js +970 -60
  30. package/dist/432.js +171 -14
  31. package/dist/4476.js +2008 -0
  32. package/dist/4560.js +674 -0
  33. package/dist/4650.js +70 -0
  34. package/dist/{1134.js → 5184.js} +183 -1
  35. package/dist/6489.js +18 -18
  36. package/dist/7060.js +132 -0
  37. package/dist/8715.js +2 -136
  38. package/dist/8928.js +16778 -0
  39. package/dist/9787.js +209 -0
  40. package/dist/core.d.ts +29 -9
  41. package/dist/core.js +10 -2
  42. package/dist/index.js +13 -3
  43. package/dist/internal/collaboration/office-collaboration-flat-json.d.ts +13 -0
  44. package/dist/internal/collaboration/office-collaboration-json.d.ts +4 -0
  45. package/dist/internal/collaboration/office-collaboration-presence.d.ts +86 -0
  46. package/dist/internal/collaboration/office-collaboration-transport.d.ts +42 -0
  47. package/dist/internal/collaboration/office-collaboration.d.ts +85 -0
  48. package/dist/internal/collaboration/office-document-collaboration-bibliography.d.ts +7 -0
  49. package/dist/internal/collaboration/office-document-collaboration-claims.d.ts +9 -0
  50. package/dist/internal/collaboration/office-document-collaboration-comments.d.ts +7 -0
  51. package/dist/internal/collaboration/office-document-collaboration-sidecar-utils.d.ts +27 -0
  52. package/dist/internal/collaboration/office-document-collaboration-sidecars.d.ts +16 -0
  53. package/dist/internal/collaboration/office-document-collaboration.d.ts +45 -0
  54. package/dist/internal/collaboration/office-markdown-collaboration.d.ts +31 -0
  55. package/dist/internal/collaboration/office-pdf-collaboration-claims.d.ts +4 -0
  56. package/dist/internal/collaboration/office-pdf-collaboration-conflicts.d.ts +2 -0
  57. package/dist/internal/collaboration/office-pdf-collaboration-model.d.ts +26 -0
  58. package/dist/internal/collaboration/office-pdf-collaboration-records.d.ts +21 -0
  59. package/dist/internal/collaboration/office-pdf-collaboration-types.d.ts +91 -0
  60. package/dist/internal/collaboration/office-pdf-collaboration-validation.d.ts +4 -0
  61. package/dist/internal/collaboration/office-pdf-collaboration.d.ts +35 -0
  62. package/dist/internal/collaboration/office-presentation-collaboration-model.d.ts +25 -0
  63. package/dist/internal/collaboration/office-presentation-collaboration-records.d.ts +22 -0
  64. package/dist/internal/collaboration/office-presentation-collaboration-validation.d.ts +4 -0
  65. package/dist/internal/collaboration/office-presentation-collaboration.d.ts +32 -0
  66. package/dist/internal/collaboration/office-spreadsheet-collaboration-cells.d.ts +13 -0
  67. package/dist/internal/collaboration/office-spreadsheet-collaboration-claims.d.ts +4 -0
  68. package/dist/internal/collaboration/office-spreadsheet-collaboration-conflicts.d.ts +2 -0
  69. package/dist/internal/collaboration/office-spreadsheet-collaboration-flat-json.d.ts +10 -0
  70. package/dist/internal/collaboration/office-spreadsheet-collaboration-model.d.ts +31 -0
  71. package/dist/internal/collaboration/office-spreadsheet-collaboration-records.d.ts +17 -0
  72. package/dist/internal/collaboration/office-spreadsheet-collaboration-validation.d.ts +4 -0
  73. package/dist/internal/collaboration/office-spreadsheet-collaboration.d.ts +32 -0
  74. package/dist/internal/features/work/components/work-document-page-border.d.ts +6 -0
  75. package/dist/internal/features/work/editors/document-command-catalog.d.ts +9 -0
  76. package/dist/internal/features/work/editors/document-editor-focus.d.ts +1 -1
  77. package/dist/internal/features/work/editors/document-editor.d.ts +7 -1
  78. package/dist/internal/features/work/editors/document-external-content.d.ts +14 -0
  79. package/dist/internal/features/work/editors/document-page-stack.d.ts +10 -1
  80. package/dist/internal/features/work/editors/document-page-thumbnail.d.ts +2 -0
  81. package/dist/internal/features/work/editors/document-pagination-run-coordinator.d.ts +26 -0
  82. package/dist/internal/features/work/editors/document-picture-properties-dialog-model.d.ts +20 -1
  83. package/dist/internal/features/work/editors/document-table-properties-dialog-model.d.ts +4 -1
  84. package/dist/internal/features/work/editors/document-toolbar.d.ts +8 -1
  85. package/dist/internal/features/work/editors/markdown-editor-focus.d.ts +1 -1
  86. package/dist/internal/features/work/editors/markdown-editor.d.ts +5 -1
  87. package/dist/internal/features/work/editors/markdown-toolbar.d.ts +2 -1
  88. package/dist/internal/features/work/editors/office-collaboration-participants.d.ts +3 -0
  89. package/dist/internal/features/work/editors/office-collaboration-presence-context.d.ts +17 -0
  90. package/dist/internal/features/work/editors/office-collaboration-presence-ui.d.ts +25 -0
  91. package/dist/internal/features/work/editors/office-editor-focus-handoff.d.ts +27 -0
  92. package/dist/internal/features/work/editors/pdf-annotation-controller.d.ts +5 -0
  93. package/dist/internal/features/work/editors/pdf-collaboration-presence.d.ts +3 -0
  94. package/dist/internal/features/work/editors/pdf-collaboration-projection.d.ts +10 -0
  95. package/dist/internal/features/work/editors/pdf-evidence-contract.d.ts +36 -0
  96. package/dist/internal/features/work/editors/pdf-evidence-overlay.d.ts +37 -0
  97. package/dist/internal/features/work/editors/pdf-toolbar.d.ts +2 -1
  98. package/dist/internal/features/work/editors/pdf-viewer-controller.d.ts +7 -1
  99. package/dist/internal/features/work/editors/pdf-viewer.d.ts +11 -1
  100. package/dist/internal/features/work/editors/presentation-collaboration-presence.d.ts +5 -0
  101. package/dist/internal/features/work/editors/presentation-editor-focus.d.ts +3 -2
  102. package/dist/internal/features/work/editors/presentation-editor-types.d.ts +3 -0
  103. package/dist/internal/features/work/editors/presentation-editor.d.ts +1 -1
  104. package/dist/internal/features/work/editors/spreadsheet-auto-filter.d.ts +9 -0
  105. package/dist/internal/features/work/editors/spreadsheet-cell-clear.d.ts +3 -0
  106. package/dist/internal/features/work/editors/spreadsheet-cell-merge.d.ts +12 -0
  107. package/dist/internal/features/work/editors/spreadsheet-clipboard-shortcuts.d.ts +3 -7
  108. package/dist/internal/features/work/editors/spreadsheet-collaboration-presence.d.ts +9 -0
  109. package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +464 -0
  110. package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +45 -9
  111. package/dist/internal/features/work/editors/spreadsheet-context-menu.d.ts +2 -0
  112. package/dist/internal/features/work/editors/spreadsheet-editor-ribbon.d.ts +9 -28
  113. package/dist/internal/features/work/editors/spreadsheet-editor.d.ts +8 -2
  114. package/dist/internal/features/work/editors/spreadsheet-format-painter.d.ts +27 -0
  115. package/dist/internal/features/work/editors/spreadsheet-freeze-panes.d.ts +14 -0
  116. package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +3 -2
  117. package/dist/internal/features/work/editors/use-document-pagination.d.ts +6 -1
  118. package/dist/internal/features/work/editors/use-document-review-conflicts.d.ts +28 -0
  119. package/dist/internal/features/work/editors/use-spreadsheet-auto-filter.d.ts +21 -0
  120. package/dist/internal/features/work/editors/use-spreadsheet-collaboration.d.ts +27 -0
  121. package/dist/internal/features/work/editors/use-spreadsheet-format-painter.d.ts +18 -0
  122. package/dist/internal/features/work/work-document-bookmark-references.d.ts +37 -0
  123. package/dist/internal/features/work/work-document-bookmarks.d.ts +29 -0
  124. package/dist/internal/features/work/work-document-caption-nodes.d.ts +4 -1
  125. package/dist/internal/features/work/work-document-comments.d.ts +1 -1
  126. package/dist/internal/features/work/work-document-equations.d.ts +513 -0
  127. package/dist/internal/features/work/work-document-extensions.d.ts +1 -0
  128. package/dist/internal/features/work/work-document-field-identity.d.ts +2 -0
  129. package/dist/internal/features/work/work-document-field-node.d.ts +2 -2
  130. package/dist/internal/features/work/work-document-fields.d.ts +7 -0
  131. package/dist/internal/features/work/work-document-image-identity.d.ts +30 -0
  132. package/dist/internal/features/work/work-document-image-layout.d.ts +46 -1
  133. package/dist/internal/features/work/work-document-image-wrap-contour.d.ts +16 -0
  134. package/dist/internal/features/work/work-document-incremental-layout.d.ts +2 -2
  135. package/dist/internal/features/work/work-document-model-codec.d.ts +4 -1
  136. package/dist/internal/features/work/work-document-note-integrity.d.ts +2 -0
  137. package/dist/internal/features/work/work-document-page-borders.d.ts +25 -0
  138. package/dist/internal/features/work/work-document-page-capture.d.ts +8 -0
  139. package/dist/internal/features/work/work-document-page-frames.d.ts +15 -0
  140. package/dist/internal/features/work/work-document-page-margins.d.ts +56 -0
  141. package/dist/internal/features/work/work-document-page-size.d.ts +47 -0
  142. package/dist/internal/features/work/work-document-pagination-measurement.d.ts +1 -2
  143. package/dist/internal/features/work/work-document-pagination-types.d.ts +7 -2
  144. package/dist/internal/features/work/work-document-pagination.d.ts +2 -2
  145. package/dist/internal/features/work/work-document-paragraph-borders.d.ts +32 -0
  146. package/dist/internal/features/work/work-document-paragraph-identity.d.ts +26 -0
  147. package/dist/internal/features/work/work-document-paragraph-shading.d.ts +18 -0
  148. package/dist/internal/features/work/work-document-review-conflicts.d.ts +35 -0
  149. package/dist/internal/features/work/work-document-section.d.ts +4 -0
  150. package/dist/internal/features/work/work-document-snapshot.d.ts +19 -0
  151. package/dist/internal/features/work/work-document-source.d.ts +23 -0
  152. package/dist/internal/features/work/work-document-table-column-widths.d.ts +7 -0
  153. package/dist/internal/features/work/work-document-table-property-changes.d.ts +3 -0
  154. package/dist/internal/features/work/work-document-table-row-identity.d.ts +15 -0
  155. package/dist/internal/features/work/work-document-table-sizing.d.ts +3 -0
  156. package/dist/internal/features/work/work-document-text-layout.d.ts +3 -1
  157. package/dist/internal/features/work/work-document-word-line-metrics.d.ts +2 -0
  158. package/dist/internal/features/work/work-docx-bookmark-diagnostics.d.ts +3 -0
  159. package/dist/internal/features/work/work-docx-bookmark-import.d.ts +24 -0
  160. package/dist/internal/features/work/work-docx-bookmarks.d.ts +17 -0
  161. package/dist/internal/features/work/work-docx-comment-durable-id-preservation.d.ts +2 -0
  162. package/dist/internal/features/work/work-docx-comment-export.d.ts +3 -0
  163. package/dist/internal/features/work/work-docx-comment-metadata.d.ts +2 -0
  164. package/dist/internal/features/work/work-docx-drawing-extension-preservation.d.ts +4 -0
  165. package/dist/internal/features/work/work-docx-equation-diagnostics.d.ts +3 -0
  166. package/dist/internal/features/work/work-docx-equation-export.d.ts +14 -0
  167. package/dist/internal/features/work/work-docx-equation-import.d.ts +30 -0
  168. package/dist/internal/features/work/work-docx-equation-story.d.ts +9 -0
  169. package/dist/internal/features/work/work-docx-export-formatting.d.ts +3 -1
  170. package/dist/internal/features/work/work-docx-export-image.d.ts +5 -1
  171. package/dist/internal/features/work/work-docx-export.d.ts +1 -1
  172. package/dist/internal/features/work/work-docx-field-instructions.d.ts +8 -0
  173. package/dist/internal/features/work/work-docx-font-table-preservation.d.ts +3 -0
  174. package/dist/internal/features/work/work-docx-ignorable-extension-preservation.d.ts +15 -0
  175. package/dist/internal/features/work/work-docx-image-crop.d.ts +12 -0
  176. package/dist/internal/features/work/work-docx-image-identity.d.ts +17 -0
  177. package/dist/internal/features/work/work-docx-image-layer.d.ts +12 -0
  178. package/dist/internal/features/work/work-docx-image-layout-import.d.ts +14 -2
  179. package/dist/internal/features/work/work-docx-image-wrap.d.ts +15 -0
  180. package/dist/internal/features/work/work-docx-import.d.ts +13 -3
  181. package/dist/internal/features/work/work-docx-list-export.d.ts +18 -0
  182. package/dist/internal/features/work/work-docx-list-import.d.ts +14 -0
  183. package/dist/internal/features/work/work-docx-note-comment-content-control-block-preservation.d.ts +18 -0
  184. package/dist/internal/features/work/work-docx-note-comment-content-control-model.d.ts +47 -0
  185. package/dist/internal/features/work/work-docx-note-comment-content-control-preservation.d.ts +4 -0
  186. package/dist/internal/features/work/work-docx-note-comment-content-control-properties.d.ts +17 -0
  187. package/dist/internal/features/work/work-docx-note-comment-content-control-table-model.d.ts +17 -0
  188. package/dist/internal/features/work/work-docx-note-comment-content-control-xml.d.ts +14 -0
  189. package/dist/internal/features/work/work-docx-note-comment-extension-preservation.d.ts +2 -0
  190. package/dist/internal/features/work/work-docx-note-comment-hyperlink-content.d.ts +40 -0
  191. package/dist/internal/features/work/work-docx-note-comment-hyperlink-preservation.d.ts +5 -0
  192. package/dist/internal/features/work/work-docx-note-comment-hyperlink-relationships.d.ts +35 -0
  193. package/dist/internal/features/work/work-docx-note-comment-identity.d.ts +15 -0
  194. package/dist/internal/features/work/work-docx-note-comment-run-preservation.d.ts +4 -0
  195. package/dist/internal/features/work/work-docx-note-comment-run-properties.d.ts +2 -0
  196. package/dist/internal/features/work/work-docx-note-image-import.d.ts +12 -0
  197. package/dist/internal/features/work/work-docx-note-image-relationships.d.ts +1 -0
  198. package/dist/internal/features/work/work-docx-numbering-extension-preservation.d.ts +6 -0
  199. package/dist/internal/features/work/work-docx-numbering.d.ts +1 -0
  200. package/dist/internal/features/work/work-docx-page-borders-diagnostics.d.ts +3 -0
  201. package/dist/internal/features/work/work-docx-page-borders-import.d.ts +10 -0
  202. package/dist/internal/features/work/work-docx-page-margins-diagnostics.d.ts +3 -0
  203. package/dist/internal/features/work/work-docx-page-margins-import.d.ts +18 -0
  204. package/dist/internal/features/work/work-docx-page-size-diagnostics.d.ts +2 -0
  205. package/dist/internal/features/work/work-docx-page-size-import.d.ts +17 -0
  206. package/dist/internal/features/work/work-docx-paragraph-borders-diagnostics.d.ts +3 -0
  207. package/dist/internal/features/work/work-docx-paragraph-borders-export.d.ts +18 -0
  208. package/dist/internal/features/work/work-docx-paragraph-borders-import.d.ts +24 -0
  209. package/dist/internal/features/work/work-docx-paragraph-default-collapsed.d.ts +19 -0
  210. package/dist/internal/features/work/work-docx-paragraph-extension-preservation.d.ts +2 -0
  211. package/dist/internal/features/work/work-docx-paragraph-identity-import.d.ts +10 -0
  212. package/dist/internal/features/work/work-docx-paragraph-identity.d.ts +18 -0
  213. package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +6 -1
  214. package/dist/internal/features/work/work-docx-paragraph-shading-diagnostics.d.ts +3 -0
  215. package/dist/internal/features/work/work-docx-paragraph-shading-export.d.ts +5 -0
  216. package/dist/internal/features/work/work-docx-paragraph-shading-import.d.ts +18 -0
  217. package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +3 -0
  218. package/dist/internal/features/work/work-docx-settings-preservation.d.ts +10 -0
  219. package/dist/internal/features/work/work-docx-settings-xml.d.ts +16 -0
  220. package/dist/internal/features/work/work-docx-style-extension-preservation.d.ts +2 -0
  221. package/dist/internal/features/work/work-docx-table-cell-export.d.ts +2 -1
  222. package/dist/internal/features/work/work-docx-table-cell-import.d.ts +3 -0
  223. package/dist/internal/features/work/work-docx-table-extension-preservation.d.ts +2 -0
  224. package/dist/internal/features/work/work-docx-table-row-import.d.ts +2 -0
  225. package/dist/internal/features/work/work-docx-table-sizing-import.d.ts +1 -0
  226. package/dist/internal/features/work/work-docx-theme-reference.d.ts +23 -0
  227. package/dist/internal/features/work/work-docx-theme.d.ts +4 -1
  228. package/dist/internal/features/work/work-docx-twips.d.ts +12 -0
  229. package/dist/internal/features/work/work-file-contract.d.ts +1 -0
  230. package/dist/internal/features/work/work-file-io.d.ts +1 -1
  231. package/dist/internal/features/work/work-markdown-extensions.d.ts +4 -1
  232. package/dist/internal/features/work/work-ooxml-package-preservation.d.ts +12 -0
  233. package/dist/internal/features/work/work-ooxml-package-security.d.ts +6 -0
  234. package/dist/internal/features/work/work-ooxml-relationship-preservation.d.ts +10 -0
  235. package/dist/internal/features/work/work-ooxml-xml.d.ts +2 -0
  236. package/dist/internal/features/work/work-pdf-export.d.ts +10 -0
  237. package/dist/internal/features/work/work-repository.d.ts +2 -0
  238. package/dist/internal/features/work/work-types.d.ts +15 -2
  239. package/dist/internal/kernel/office-kernel-client-types.d.ts +1 -0
  240. package/dist/internal/kernel/office-kernel-protocol.d.ts +7 -0
  241. package/dist/internal/kernel/office-kernel-version.d.ts +1 -1
  242. package/dist/office-kernel.wasm +0 -0
  243. package/dist/office-kernel.worker.js +93 -41
  244. package/dist/react.d.ts +18 -12
  245. package/dist/react.js +1 -1
  246. package/dist/styles.css +1153 -14
  247. package/dist/vue.d.ts +48 -5
  248. package/dist/vue.js +42 -3
  249. package/dist/web-component.d.ts +24 -2
  250. package/dist/web-component.js +101 -2
  251. package/docs/latest/en/browser-editor-architecture.md +231 -49
  252. package/package.json +19 -4
  253. package/dist/0~152.js +0 -94
  254. package/dist/0~2582.js +0 -485
  255. package/dist/0~4750.js +0 -939
  256. package/dist/0~5861.js +0 -596
  257. package/dist/0~work-document-extensions.js +0 -3045
  258. package/dist/0~work-document-model-codec.js +0 -42
  259. package/dist/0~work-docx-bibliography.js +0 -347
  260. package/dist/0~work-docx-page-color.js +0 -42
  261. package/dist/2881.js +0 -1455
  262. package/dist/8728.js +0 -723
@@ -0,0 +1,426 @@
1
+ # Real-time collaboration roadmap
2
+
3
+ This roadmap defines one versioned collaboration protocol for every A3S Office
4
+ editor and for native CLI/coding-agent clients. It complements `ROADMAP.md`,
5
+ which tracks editor capability parity with WPS.
6
+
7
+ ## Design invariants
8
+
9
+ - Yjs is the browser protocol implementation. Yrs is the native Rust
10
+ implementation. Both exchange standard Yjs v1 updates and state vectors.
11
+ - The host owns transport, authentication, authorization, persistence, rooms,
12
+ and retention. Office consumes a synchronized document and never silently
13
+ creates a network provider.
14
+ - Every shared document is bound to a version, artifact ID, and artifact kind.
15
+ A client rejects mismatches before it edits canonical state.
16
+ - Exactly one bootstrap authority seeds a new artifact. Concurrent independent
17
+ seeds are detected as ambiguous instead of being resolved with
18
+ last-write-wins.
19
+ - Canonical content, durable review data, and ephemeral awareness use separate
20
+ roots. Awareness is never persisted as document content.
21
+ - Human and agent transactions carry typed origins. Undo managers track only
22
+ the local binding origin, so one participant cannot undo another
23
+ participant's operation.
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.
27
+ - Editors never collaborate by repeatedly replacing one serialized OOXML file
28
+ or one universal JSON blob. Each format gets a typed, conflict-local model.
29
+
30
+ Session modes are client-side capability guards, not a security boundary. The
31
+ host and synchronization service must enforce authorization for received and
32
+ persisted updates.
33
+
34
+ ## Shared schema
35
+
36
+ Protocol v1 reserves the `a3s.office` namespace.
37
+
38
+ | Root | Y type | Purpose |
39
+ | --- | --- | --- |
40
+ | `metadata` | `Y.Map` | Protocol version, artifact identity, kind, and initialized state. |
41
+ | `bootstrap.initializers` | `Y.Array` | Detects more than one independent initial seed. |
42
+ | `markdown.source` | `Y.Text` | Canonical Markdown source. |
43
+ | `document.content` | `Y.XmlFragment` | ProseMirror document, including section layout, comment anchors, and tracked-change marks. |
44
+ | `document.options` | `Y.Map` | Document-level editable options such as page color and tracking mode. |
45
+ | `document.comments` / `document.comment-order` | `Y.Map` / `Y.Array` | ID-keyed durable comment/reply records and deterministic presentation order. |
46
+ | `document.bibliography*` | Typed maps/arrays | Bibliography settings and ID-keyed citation sources. |
47
+ | `spreadsheet.*` | Typed maps/arrays | Sheet order, field-addressed sparse cells, formulas, styles, objects, names, and print state. |
48
+ | `presentation.*` | Typed maps/arrays | Slide/master/layout order, ID-keyed scene objects, notes, transitions, and comments. |
49
+ | `pdf.*` | Typed maps/arrays | Immutable source identity, annotations, forms, signatures, redaction proposals, reviewed page operations, and final decisions. |
50
+
51
+ Optional additive roots such as `pdf.source-identities` let newer clients
52
+ validate sessions created by newer clients while continuing to accept legacy
53
+ protocol-v1 documents that do not contain the root. Older clients ignore the
54
+ unknown root.
55
+
56
+ Schema additions must be backward readable within protocol v1. A breaking root
57
+ or meaning change requires a new protocol version and an explicit migration.
58
+
59
+ ## Delivery phases
60
+
61
+ ### Phase 1: protocol core and Markdown
62
+
63
+ Status: implemented in the browser library.
64
+
65
+ - Versioned sessions, metadata validation, actor-aware origins, edit-mode
66
+ enforcement, and host-owned `Y.Doc` lifecycle.
67
+ - Explicit single-authority initialization with concurrent-bootstrap
68
+ detection.
69
+ - Canonical `Y.Text` Markdown binding with bounded UTF-16-safe replacements.
70
+ - Remote update projection into source and visual panes.
71
+ - Per-client undo/redo that preserves remote operations.
72
+ - A bounded, identity-bound host transport adapter exchanges standard Yjs v1
73
+ state vectors and updates, preserves typed incremental origins, suppresses
74
+ update echoes, and exposes explicit reconnect synchronization.
75
+ - A provider-owned Awareness controller publishes validated actor, mode,
76
+ activity, and format-specific locations for all five artifact kinds without
77
+ persisting presence in the shared document.
78
+ - A shared, accessible participant roster projects local and remote humans,
79
+ agents, modes, activity, and typed location summaries into editable and
80
+ preview chrome for all five editor kinds. Pairing fails closed across
81
+ artifact, kind, Y.Doc client, actor, namespace, or mode boundaries.
82
+ - Every browser editor publishes its local ephemeral location and projects
83
+ remote locations into its native editing surface. Document and Markdown use
84
+ text selections/carets (with explicit Markdown source/visual coordinates),
85
+ Spreadsheet uses Fortune Sheet cell presence, Presentation uses stable
86
+ object frames, and PDF uses page/annotation markers. Remote roster rows
87
+ navigate only on explicit activation; passive Awareness updates preserve
88
+ local focus, selection, and viewport.
89
+ - React, Vue, and Web Component session and presence plumbing.
90
+ - Convergence, offline/reconnect, transport-boundary, presence, permission,
91
+ StrictMode, framework-parity, and ownership tests.
92
+
93
+ Remaining before this phase is production complete:
94
+
95
+ - Add reference WebSocket/WebTransport relay examples with provider-side
96
+ authorization and persistent update replay.
97
+
98
+ ### Phase 2: Document
99
+
100
+ 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.
104
+
105
+ - TipTap is bound to `document.content` through
106
+ `@tiptap/extension-collaboration`; StarterKit undo/redo is disabled and the
107
+ collaboration binding owns local history.
108
+ - Section/page OOXML state, comment anchors, and tracked-change marks converge
109
+ in the ProseMirror fragment. Document-level page color, tracking mode,
110
+ comment threads/replies, and bibliography sources use conflict-local typed
111
+ roots instead of a serialized document blob.
112
+ - React, Vue, and Web Component adapters accept the same initialized session.
113
+ - Append-only record claims deduplicate identical offline retries and fail
114
+ closed when disconnected clients assign different records to one stable ID.
115
+ - Browser tests cover initialization, bootstrap races, sidecar convergence,
116
+ stable-ID retries/collisions, stale-snapshot delete conflicts, local-only
117
+ undo, permission guards, real TipTap peer edits, remote projection,
118
+ StrictMode, and framework parity.
119
+ - Native Rust, CLI, and MCP clients can replace an exact expected match count
120
+ inside ProseMirror `Y.XmlText`, including UTF-16 astral characters, without
121
+ replacing the shared HTML/XML tree. The replacement preserves the first
122
+ deleted character's rich-text attributes and rotates the affected Word
123
+ `textId` once. They can also insert a plain paragraph before or after a
124
+ uniquely identified paragraph, heading, or document caption in a bounded
125
+ top-level section, nested list item, table cell/header, or blockquote path,
126
+ and delete a plain paragraph only when its complete text and current
127
+ `textId` still match. Required container blocks and list-leading paragraphs
128
+ are preserved. Any text or structural edit inside a table rotates every
129
+ identified ancestor row's `rowTextId` in the same transaction. Page color
130
+ and track-changes settings mutate their conflict-local `document.options`
131
+ entries.
132
+ - Deterministic browser-to-Yrs and Yrs-to-browser fixtures prove that native
133
+ text/options/paragraph updates remain readable by the Office TipTap schema
134
+ after durable restart and replay, including concurrent native and browser
135
+ paragraph insertion across nested lists and nested tables. Real CLI and MCP
136
+ subprocess tests exercise the same bounded structural mutations.
137
+
138
+ Remaining:
139
+
140
+ - Add suggestion-only authorization and durable accept/reject decision audit
141
+ records; `comment` and `suggest` remain read-only until those models exist.
142
+ - Prove concurrent full-table, list-restructure, section, comment, and revision
143
+ workflows, plus DOCX import/export after merged edits.
144
+ - Expand native convergence from bounded paragraph edits to complete table,
145
+ list, and section operations, comments, and tracked revisions.
146
+
147
+ Exit criterion: two browsers and one native client converge on document
148
+ content and review state; local undo never removes a remote change; a DOCX
149
+ round trip preserves supported and untouched unsupported OOXML.
150
+
151
+ ### Phase 3: Presentation
152
+
153
+ Status: browser collaboration foundation implemented; rich-text CRDT and PPTX
154
+ round-trip concurrency coverage are pending.
155
+
156
+ - Stable slide/master/layout order arrays and ID-keyed record maps avoid a
157
+ serialized whole-deck root. Scene elements and slide comments are ID-keyed
158
+ child records.
159
+ - Snapshot writes are translated into `previous -> next` record patches, so an
160
+ unrelated stale snapshot does not remove remotely added slides or objects.
161
+ - Typed validation rejects duplicate identities and invalid references before
162
+ bootstrap; concurrent independent bootstrap remains fail-closed.
163
+ - Per-binding undo/redo tracks only local transactions. React, Vue, and Web
164
+ Component surfaces project remote snapshots and keep non-edit modes
165
+ read-only.
166
+ - Tests cover bootstrap, identity validation, separate-record convergence,
167
+ stale snapshots, concurrent comments, local-only undo, permissions, mounted
168
+ projection, and framework adapters.
169
+
170
+ Remaining:
171
+
172
+ - Bind editable scene text to collaborative XML fragments instead of scalar
173
+ text/run replacement.
174
+ - Add creation claims and explicit conflict handling for concurrent same-ID
175
+ object creation, delete-vs-edit, z-order, grouping, and theme changes.
176
+ - Keep derived thumbnails and layout measurements local and prove this in UI
177
+ tests.
178
+ - Add offline/reordered-update property tests plus merged PPTX export/reopen.
179
+
180
+ Exit criterion: concurrent object transforms, rich-text edits, slide reorder,
181
+ comments, and delete-vs-edit cases converge and survive PPTX round trips.
182
+
183
+ ### Phase 4: Spreadsheet
184
+
185
+ Status: browser collaboration foundation implemented; structural operations,
186
+ native recalculation parity, and XLSX concurrency coverage are pending.
187
+
188
+ - Stable sheet/named-range order arrays, ID-keyed records, and append-only
189
+ creation claims avoid a serialized workbook or dense worksheet root.
190
+ - Sparse cell presence and recursively field-addressed values let formula,
191
+ cached value, number format, style, hyperlink, and note edits converge even
192
+ when two disconnected clients first populate the same blank cell.
193
+ - Sheet configuration and formula metadata are recursively field-addressed,
194
+ so independent merge geometry, row/column sizing, protection, source-formula,
195
+ and dynamic-array metadata leaves do not replace their containing object.
196
+ - Images, charts, pivot tables, defined names, calculation settings, print
197
+ areas/titles, page breaks, and page setup have conflict-local typed roots.
198
+ - Snapshot writes are translated into `previous -> next` patches. Unrelated
199
+ stale snapshots preserve remote cells and records; a delete that would
200
+ discard a remote edit fails closed and asks the caller to refresh.
201
+ - Selection, active-sheet status, zoom, calculation chains, dynamic-array
202
+ caches, and derived chart preview images are excluded from canonical state.
203
+ - The public Core binding supports typed origins, edit permissions,
204
+ subscriptions, and per-client undo/redo. Tests cover bootstrap races,
205
+ malformed roots, identity collisions, stale snapshots, OOXML field
206
+ convergence, and local-only undo.
207
+ - React, Vue, and Web Component editors project remote workbook snapshots and
208
+ route canonical edits plus local-only undo/redo through the same binding.
209
+ Active-sheet status, selections, zoom, and Fortune Sheet focus remain local
210
+ view state and are reapplied after remote canonical updates.
211
+
212
+ Remaining:
213
+
214
+ - Translate one user gesture into one transaction; batch paste/fill/sort/filter
215
+ without emitting a document-sized replacement.
216
+ - Add stable structural operations and reference transforms for row/column
217
+ insertion/deletion, merged ranges, tables, sort, and named references.
218
+ - Treat calculated values as derived once browser and native recalculation are
219
+ deterministic and source formulas remain the only canonical formula state.
220
+ - Add offline/reordered-update property tests plus merged XLSX export/reopen.
221
+
222
+ Exit criterion: multi-client structural edits converge, recalculation agrees
223
+ across browser and native clients, and XLSX round trips preserve supported plus
224
+ untouched unsupported package state.
225
+
226
+ ### Phase 5: PDF
227
+
228
+ Status: browser Core plus PDF viewer/framework projection, native annotation
229
+ and form-value mutation, and native append-only redaction/page-operation
230
+ proposal and final-decision mutations implemented; save/reopen, authenticated
231
+ assets, and full native parity are pending.
232
+
233
+ - Shared artifacts are bound to a lowercase SHA-256 fingerprint, exact byte
234
+ length, and page count. Source bytes never enter Yjs, and a binding rejects
235
+ another source even when its page count matches.
236
+ - Annotations, form values, signature placements, redaction proposals, page
237
+ operations, and final review decisions use typed, ID-keyed, recursively
238
+ field-addressed roots instead of one PDF or JSON blob.
239
+ - Annotation deletion uses an irreversible durable tombstone. Signature
240
+ placements reference host-owned appearance assets; private/signature bytes
241
+ are not synchronized as canonical content.
242
+ - Signature, redaction, page-operation, and decision records are append-only
243
+ audit data. Redaction and destructive page operations require an explicit,
244
+ attributable final review decision before a host applies them to bytes.
245
+ - Creation claims deduplicate identical offline retries and fail closed on
246
+ concurrent same-ID reuse. Snapshot writes preflight stale conflicts before
247
+ changing any shared root, and local undo is limited to annotations and form
248
+ values.
249
+ - Core tests cover source mismatch, validation, bootstrap races, field-level
250
+ convergence, delete-vs-edit, offline creation collisions, append-only review
251
+ records, stale-write atomicity, local-only undo, permissions, immutable
252
+ annotation identities, and legacy protocol-v1 reads.
253
+ - The React viewer captures the immutable PDFium annotation/form baseline,
254
+ projects Yjs overlays in both directions, verifies source bytes and page
255
+ count, and replaces EmbedPDF history with local-origin Yjs history. Viewer
256
+ history is purged after projection so one user gesture cannot create two
257
+ competing undo stacks.
258
+ - Browser projection currently accepts the five public editor tools: free
259
+ text, highlight, underline, strikeout, and ink. Annotation kinds that need
260
+ unsynchronized binary/context payloads, including stamps and signatures,
261
+ fail closed until their authenticated asset port is available. Shared form
262
+ records must match an existing writable field name.
263
+ - Vue emits `collaborationChange`; the Web Component dispatches
264
+ `collaboration-change` and also supports a callback property. Viewport,
265
+ search, selection, render caches, and page bitmaps stay local.
266
+ - Projection tests cover base annotation edits/deletion, created annotations,
267
+ forms, remote echo suppression (including renderer-added default authors),
268
+ ISO date portability, local undo, and irreversible tombstones.
269
+ - Rust, CLI, MCP, and A3S Code can set a PDF form value by stable field name.
270
+ Existing values update only their conflict-local leaf; new records use the
271
+ browser-compatible presence/fields/order encoding. Browser-to-Yrs fixtures,
272
+ native restart/idempotency tests, real subprocesses, and concurrent
273
+ browser/native edits prove form-value convergence without synchronizing PDF
274
+ source bytes.
275
+ - Rust, CLI, MCP, and A3S Code can create, optimistically update, and
276
+ irreversibly tombstone portable FreeText, Highlight, Underline, StrikeOut,
277
+ and Ink annotations. Creation writes a complete immutable claim and always
278
+ uses `source: created`; updates recursively compare mutable JSON leaves so
279
+ unrelated concurrent edits merge while same-leaf conflicts fail closed; ID,
280
+ page, type, and source identity cannot drift. Native restart, idempotency,
281
+ real CLI/MCP subprocesses, browser Yjs delivery reordering, and a real
282
+ EmbedPDF Playground projection cover create/update/delete. The deterministic
283
+ Playground path is retained as an `a3s-test` ACL regression with visual,
284
+ accessibility, console, and page-error evidence.
285
+ - Rust, CLI, MCP, and A3S Code can append a bounded redaction proposal, rotate
286
+ or delete a validated source-page subset, propose a complete page
287
+ permutation, and append the single final decision for an existing redaction
288
+ or page operation. Actor IDs come from the replica manifest, timestamps use
289
+ canonical UTC, and each typed record plus its browser-compatible canonical
290
+ claim commit together. Missing targets, duplicate final decisions,
291
+ conflicting same-ID reuse, invalid geometry, invalid rotation degrees,
292
+ deleting every page, incomplete reorders, and out-of-range pages fail
293
+ closed. Native restart/idempotency, real subprocess, and browser Yjs fixtures
294
+ cover concurrent browser records plus reordered and duplicate native
295
+ delivery. An exhaustive native property test delivers causally related
296
+ rotation, deletion, reorder, and final-decision updates in all 24 orders,
297
+ injects a duplicate, restarts the replica, and compares the final state
298
+ vector and document digest with the source replica.
299
+
300
+ Remaining:
301
+
302
+ - Resolve signature appearance assets through an explicit authenticated host
303
+ port and keep asset hashes aligned with the audit record.
304
+ - Apply approved redaction/page operations in a non-retryable host workflow,
305
+ then save and reopen a merged PDF fixture to verify durable results.
306
+ - Extend offline/reordered-update property coverage and native Yrs parity to
307
+ signatures and additional annotation-type payloads.
308
+
309
+ Exit criterion: annotations and forms converge and reopen from a saved PDF;
310
+ destructive actions remain attributable, reviewable, and non-retryable.
311
+
312
+ ### Phase 6: CLI, MCP, and coding agents
313
+
314
+ Status: native Yrs replica store, resumable CLI/MCP event streams, `a3s code`
315
+ 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.
319
+
320
+ - Yrs `0.27.3` now uses 53-bit Yjs-compatible client IDs and exchanges standard
321
+ Yjs v1 updates, state vectors, and y-sync `SyncStep1`/`Update` messages with
322
+ the browser package.
323
+ - Native replicas persist immutable, checksummed update entries and periodic
324
+ full-state checkpoints/state vectors. Atomic no-clobber publication,
325
+ contiguous sequence validation, startup replay, bounded automatic/manual
326
+ compaction, and durable operation receipts provide crash recovery. Commit
327
+ receipts are derived from authoritative checkpoint-plus-log replay; bounded
328
+ canonical replay preserves genuinely missing updates while resolving Yrs
329
+ array items whose causal dependencies arrived out of order.
330
+ - `a3s-office collab` exposes non-interactive `create`, `join`, `inspect`,
331
+ `diff`/`synchronize`, `apply`, `mutate`, `checkpoint`, `watch`, and `leave`
332
+ commands
333
+ with JSON output and optional no-clobber binary output. `sync-step1`,
334
+ `encode-update`, and `handle-message` expose standard y-sync document
335
+ handshakes; mutating SyncStep2/Update messages use the same identity and
336
+ receipt path. Resumable event cursors report compaction gaps as explicit
337
+ full-state resets.
338
+ - The transport-neutral Rust session accepts the browser host-channel envelope,
339
+ emits a fresh `SyncStep1` on connect/reconnect, answers peer handshakes with
340
+ `SyncStep2`, durably applies incremental updates, suppresses their room echo,
341
+ and projects updates committed by other CLI/MCP processes back to the host.
342
+ A compaction gap sends one complete update and restarts the state-vector
343
+ handshake instead of replaying an unsafe partial history.
344
+ - `a3s-office collab session` exposes that state machine as bounded JSONL over
345
+ stdin/stdout for a coding-agent or product host. The host still owns the
346
+ WebSocket or IPC channel, room selection, authentication, authorization,
347
+ buffering, and delivery identities; the CLI never opens a provider itself.
348
+ - Each replica binds one stable actor ID, actor kind, permission mode, artifact
349
+ identity/kind, namespace, and client ID. Apply/checkpoint/leave require the
350
+ same identity plus a stable operation ID and accept an optional state-vector
351
+ precondition.
352
+ - `collab mutate` and `office_collaboration_mutate` accept a closed typed
353
+ operation instead of caller-authored Yjs bytes. Markdown replace/splice
354
+ writes canonical `Y.Text` with browser UTF-16 offsets. Document exact-match
355
+ replacement edits ProseMirror `Y.XmlText` in place, preserves the first
356
+ replaced character's formatting attributes, rotates Word `textId`, and fails
357
+ if the declared match count is stale. Bounded section/list/table/blockquote
358
+ paragraph insert/delete uses explicit stable identities and exact deletion
359
+ guards, while table-contained edits rotate all ancestor row text identities;
360
+ page color and track-changes write their typed option fields. All emit minimal
361
+ incremental updates through the same durable
362
+ receipt/checkpoint path. Canonical typed mutations require `edit`; raw remote
363
+ updates remain receivable in every mode so read-only peers still converge.
364
+ - PDF form-value mutations write the browser-compatible conflict-local record
365
+ roots by fully-qualified field name, retain idempotent receipts and optional
366
+ state-vector preconditions, and never synchronize source bytes.
367
+ - PDF annotation mutations create browser-compatible portable records, merge
368
+ unrelated mutable JSON leaves under recursive optimistic guards, preserve
369
+ immutable creation claims, and use irreversible deletion tombstones. The
370
+ accepted annotation types are FreeText, Highlight, Underline, StrikeOut, and
371
+ Ink; record identity and source-page bounds fail closed before mutation.
372
+ - PDF redaction and rotate/delete/reorder page-operation proposals plus final
373
+ review decisions write append-only typed records and canonical creation
374
+ claims, derive attribution from the replica, and reject stale identity,
375
+ range, permutation, and target conflicts before producing an update.
376
+ - Durable operation receipts make identical retries idempotent and reject an
377
+ operation ID reused for another payload. Artifact, kind, actor, mode,
378
+ stale-state, invalid update, ambiguous bootstrap, corrupt log, and incomplete
379
+ log failures are structured and fail closed.
380
+ - Cross-language tests import a fixture emitted by Yjs, validate browser
381
+ metadata/bootstrap roots in Yrs, and apply the exported update to another
382
+ Yrs peer. Core and process tests cover restart, checkpoint compaction,
383
+ duplicate operations, stale preconditions, identity mismatches, and missing
384
+ log entries.
385
+ - Validated browser update origins are retained in immutable operation receipts
386
+ and resumable events, survive restart, and are re-emitted unchanged by native
387
+ live transports. The host delivery operation remains distinct from the
388
+ source browser operation, and source attribution is audit data rather than
389
+ an authorization token.
390
+ - 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.
394
+ - Standard MCP exposes the durable replica lifecycle and bounded event stream;
395
+ the same seven collaboration tools are explicitly available to the dedicated
396
+ `a3s code` Use worker.
397
+
398
+ Remaining:
399
+
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.
404
+ - Project editor-visible presence and selection state while keeping Awareness
405
+ ephemeral and outside native replica persistence.
406
+
407
+ Exit criterion: a browser, `office` CLI, MCP client, and `a3s code` agent edit
408
+ the same artifact concurrently, converge at the shared-model level, reconnect
409
+ after interruption, and preserve actor/operation attribution.
410
+
411
+ ## Required test matrix
412
+
413
+ Every format phase adds tests for two concurrent browser clients, browser plus
414
+ Yrs, offline edits followed by reconnect, duplicate/reordered updates,
415
+ single-authority bootstrap, artifact and kind mismatch, local-only undo,
416
+ permission denial, host-owned lifecycle, schema migration, import after merge,
417
+ and export/reopen. Fuzz and property tests compare final state after different
418
+ valid update delivery orders.
419
+
420
+ ## Non-goals
421
+
422
+ - Shipping a hosted collaboration backend inside the component package.
423
+ - Treating awareness as authorization or durable audit history.
424
+ - Hiding provider synchronization behind editor mount.
425
+ - Claiming comments or suggestions are supported by a format until its durable
426
+ review schema and accept/reject semantics are implemented.