{ "name": "@factory/collaboration", "version": "0.1.0", "private": true, "type": "module", "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.", "main": "./src/index.ts", "types": "./src/index.ts", "exports": { ".": { "types": "./src/index.ts", "default": "./src/index.ts" }, "./codec": { "types": "./src/codec.ts", "default": "./src/codec.ts" }, "./mapping": { "types": "./src/mapping.ts", "default": "./src/mapping.ts" }, "./provider": { "types": "./src/provider.ts", "default": "./src/provider.ts" }, "./offline": { "types": "./src/offline.ts", "default": "./src/offline.ts" }, "./awareness": { "types": "./src/awareness.ts", "default": "./src/awareness.ts" }, "./outbox": { "types": "./src/outbox.ts", "default": "./src/outbox.ts" }, "./lww": { "types": "./src/lww.ts", "default": "./src/lww.ts" } }, "scripts": { "test": "vitest run", "test:unit": "vitest run", "typecheck": "tsc --noEmit" }, "dependencies": { "@factory/shared": "workspace:*", "y-indexeddb": "^9.0.12", "y-prosemirror": "^1.3.7", "yjs": "^13.6.0", "zod": "^3.23.8" }, "devDependencies": { "@factory/editor": "workspace:*", "fast-check": "^3.22.0", "typescript": "^5.6.0", "vitest": "^2.1.1" } }