1{ 2 "name": "@factory/collaboration", 3 "version": "0.1.0", 4 "private": true, 5 "type": "module", 6 "description": "Realtime collaboration bridge for AI Software Factory (realtime-architecture.md §1–5, phase-07 tasks TASK-0091…0095). The block tree ↔ Yjs codec (blocksToYDoc/yDocToBlocks, minimal-op diff, round-trip + two-codecs-agree property tested), the yXml node mapping derived from @factory/shared's BLOCK_CONTENT_SCHEMAS (the structural gate for new block types), the WebSocket client provider (TASK-0091 R3 frame protocol: hello / sync.request / sync.state / binary 0x01-update + 0x02-awareness frames, close codes 4000–4010, token refresh on 4001, <3 s reconnect budget), offline persistence (y-indexeddb v9, 1 s autosave, doc name factory:{workspaceId}:{pageId}), the presence/awareness store (deterministic colors from @factory/shared/presence, stale-cursor validity, 60 s client prune), and the non-editor mutation outbox (per-resource FIFO, Idempotency-Key, 1 s→30 s backoff, 4xx failed list, 24 h GC, 500-item cap). Plain TypeScript classes — no React; the canvas (apps/web) wires the provider to the Tiptap editor via y-prosemirror.", 7 "main": "./src/index.ts", 8 "types": "./src/index.ts", 9 "exports": { 10 ".": { 11 "types": "./src/index.ts", 12 "default": "./src/index.ts" 13 }, 14 "./codec": { 15 "types": "./src/codec.ts", 16 "default": "./src/codec.ts" 17 }, 18 "./mapping": { 19 "types": "./src/mapping.ts", 20 "default": "./src/mapping.ts" 21 }, 22 "./provider": { 23 "types": "./src/provider.ts", 24 "default": "./src/provider.ts" 25 }, 26 "./offline": { 27 "types": "./src/offline.ts", 28 "default": "./src/offline.ts" 29 }, 30 "./awareness": { 31 "types": "./src/awareness.ts", 32 "default": "./src/awareness.ts" 33 }, 34 "./outbox": { 35 "types": "./src/outbox.ts", 36 "default": "./src/outbox.ts" 37 }, 38 "./lww": { 39 "types": "./src/lww.ts", 40 "default": "./src/lww.ts" 41 } 42 }, 43 "scripts": { 44 "test": "vitest run", 45 "test:unit": "vitest run", 46 "typecheck": "tsc --noEmit" 47 }, 48 "dependencies": { 49 "@factory/shared": "workspace:*", 50 "y-indexeddb": "^9.0.12", 51 "y-prosemirror": "^1.3.7", 52 "yjs": "^13.6.0", 53 "zod": "^3.23.8" 54 }, 55 "devDependencies": { 56 "@factory/editor": "workspace:*", 57 "fast-check": "^3.22.0", 58 "typescript": "^5.6.0", 59 "vitest": "^2.1.1" 60 } 61} 62