Skip to content

Commit f8211f3

Browse files
authored
Merge pull request #1137 from EpicenterHQ/braden-w/rm-hocuspocus
chore(epicenter): remove hocuspocus provider and dependencies
2 parents 59c8d82 + fcda1cb commit f8211f3

File tree

9 files changed

+20
-159
lines changed

9 files changed

+20
-159
lines changed

bun.lock

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@
219219
},
220220
"dependencies": {
221221
"@elysiajs/openapi": "^1.4.11",
222-
"@hocuspocus/provider": "^3.4.0",
223-
"@hocuspocus/server": "^3.4.0",
224222
"@standard-community/standard-json": "^0.3.5",
225223
"@standard-schema/spec": "^1.0.0",
226224
"@tursodatabase/database": "^0.3.2",
@@ -229,10 +227,12 @@
229227
"diff": "^8.0.2",
230228
"drizzle-orm": "catalog:",
231229
"elysia": "^1.2.25",
230+
"lib0": "^0.2.99",
232231
"mime": "catalog:",
233232
"nanoid": "catalog:",
234233
"wellcrafted": "catalog:",
235234
"y-indexeddb": "^9.0.12",
235+
"y-protocols": "^1.0.6",
236236
"yargs": "catalog:",
237237
"yjs": "^13.6.27",
238238
},
@@ -581,12 +581,6 @@
581581

582582
"@google/generative-ai": ["@google/[email protected]", "", {}, "sha512-MqO+MLfM6kjxcKoy0p1wRzG3b4ZZXtPI+z2IE26UogS2Cm/XHO+7gGRBh6gcJsOiIVoH93UwKvW4HdgiOZCy9Q=="],
583583

584-
"@hocuspocus/common": ["@hocuspocus/[email protected]", "", { "dependencies": { "lib0": "^0.2.87" } }, "sha512-29Dpa3nslBvM4dksIoskovYt/aecJomEeWE5Wmzr+lNFJje15P/L/47WcogguRd/IqYIu2auNTyKlouvSRrDAQ=="],
585-
586-
"@hocuspocus/provider": ["@hocuspocus/[email protected]", "", { "dependencies": { "@hocuspocus/common": "^3.4.1", "@lifeomic/attempt": "^3.0.2", "lib0": "^0.2.87", "ws": "^8.17.1" }, "peerDependencies": { "y-protocols": "^1.0.6", "yjs": "^13.6.8" } }, "sha512-lFNxXf2NsyhT8fvxX/N6caki97hbUUGOM79tAoeJty/Y6hKfQyY6ythvkeVdqk+yvx/RiVogrW4PLjazRGprGg=="],
587-
588-
"@hocuspocus/server": ["@hocuspocus/[email protected]", "", { "dependencies": { "@hocuspocus/common": "^3.4.1", "async-lock": "^1.3.1", "async-mutex": "^0.5.0", "kleur": "^4.1.4", "lib0": "^0.2.47", "ws": "^8.5.0" }, "peerDependencies": { "y-protocols": "^1.0.6", "yjs": "^13.6.8" } }, "sha512-VgHmu71CFwyCYOlkLovAqaFrUKGq+OSsIw13PaMLMUrnLT3EdMqFzfkw9b82Qbf23WoN3yvMCPklNjnjg5/Brg=="],
589-
590584
"@humanfs/core": ["@humanfs/[email protected]", "", {}, "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA=="],
591585

592586
"@humanfs/node": ["@humanfs/[email protected]", "", { "dependencies": { "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.4.0" } }, "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ=="],
@@ -681,8 +675,6 @@
681675

682676
"@libsql/win32-x64-msvc": ["@libsql/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-7pJzOWzPm6oJUxml+PCDRzYQ4A1hTMHAciTAHfFK4fkbDZX33nWPVG7Y3vqdKtslcwAzwmrNDc6sXy2nwWnbiw=="],
683677

684-
"@lifeomic/attempt": ["@lifeomic/[email protected]", "", {}, "sha512-QZqem4QuAnAyzfz+Gj5/+SLxqwCAw2qmt7732ZXodr6VDWGeYLG6w1i/vYLa55JQM9wRuBKLmXmiZ2P0LtE5rw=="],
685-
686678
"@lucide/astro": ["@lucide/[email protected]", "", { "peerDependencies": { "astro": "^4 || ^5" } }, "sha512-YtnEpWuk+ETun3kcLFbfYlPWuE5fhStg76u8dmhOUsRHk7E1ZsXbtxY612GobgJRiD9tqXmhcg1qu0yVuceTvw=="],
687679

688680
"@lucide/svelte": ["@lucide/[email protected]", "", { "peerDependencies": { "svelte": "^5" } }, "sha512-aqTOMjBjf/HNwrhggRdb83T0QslZdpJTyTwr/chtXTGw7u4Hcu4zQb/5uA+csF0KKawKWVnsNI1MdHEHeEXTcQ=="],
@@ -1057,10 +1049,6 @@
10571049

10581050
"astro": ["[email protected]", "", { "dependencies": { "@astrojs/compiler": "^2.13.0", "@astrojs/internal-helpers": "0.7.5", "@astrojs/markdown-remark": "6.3.10", "@astrojs/telemetry": "3.3.0", "@capsizecss/unpack": "^3.0.1", "@oslojs/encoding": "^1.1.0", "@rollup/pluginutils": "^5.3.0", "acorn": "^8.15.0", "aria-query": "^5.3.2", "axobject-query": "^4.1.0", "boxen": "8.0.1", "ci-info": "^4.3.1", "clsx": "^2.1.1", "common-ancestor-path": "^1.0.1", "cookie": "^1.0.2", "cssesc": "^3.0.0", "debug": "^4.4.3", "deterministic-object-hash": "^2.0.2", "devalue": "^5.5.0", "diff": "^5.2.0", "dlv": "^1.1.3", "dset": "^3.1.4", "es-module-lexer": "^1.7.0", "esbuild": "^0.25.0", "estree-walker": "^3.0.3", "flattie": "^1.1.1", "fontace": "~0.3.1", "github-slugger": "^2.0.0", "html-escaper": "3.0.3", "http-cache-semantics": "^4.2.0", "import-meta-resolve": "^4.2.0", "js-yaml": "^4.1.1", "magic-string": "^0.30.21", "magicast": "^0.5.1", "mrmime": "^2.0.1", "neotraverse": "^0.6.18", "p-limit": "^6.2.0", "p-queue": "^8.1.1", "package-manager-detector": "^1.5.0", "piccolore": "^0.1.3", "picomatch": "^4.0.3", "prompts": "^2.4.2", "rehype": "^13.0.2", "semver": "^7.7.3", "shiki": "^3.15.0", "smol-toml": "^1.5.2", "svgo": "^4.0.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tsconfck": "^3.1.6", "ultrahtml": "^1.6.0", "unifont": "~0.6.0", "unist-util-visit": "^5.0.0", "unstorage": "^1.17.3", "vfile": "^6.0.3", "vite": "^6.4.1", "vitefu": "^1.1.1", "xxhash-wasm": "^1.1.0", "yargs-parser": "^21.1.1", "yocto-spinner": "^0.2.3", "zod": "^3.25.76", "zod-to-json-schema": "^3.25.0", "zod-to-ts": "^1.2.0" }, "optionalDependencies": { "sharp": "^0.34.0" }, "bin": { "astro": "astro.js" } }, "sha512-QeuM4xzTR0QuXFDNlGVW0BW7rcquKFIkylaPeM4ufii0/RRiPTYtwxDYVZ3KfiMRuuc+nbLD0214kMKTvz/yvQ=="],
10591051

1060-
"async-lock": ["[email protected]", "", {}, "sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ=="],
1061-
1062-
"async-mutex": ["[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA=="],
1063-
10641052
"asynckit": ["[email protected]", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="],
10651053

10661054
"audio-recorder-polyfill": ["[email protected]", "", {}, "sha512-SS4qVOzuVwlS/tjQdd0uR+9cCKBTkx4jsAdjM+rMNqoTEWf6bMnBSTfv+FO4Zn9ngxviJOxhkgRWWXsAMqM96Q=="],

packages/epicenter/README.md

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,10 @@ providers: {
216216
persistence: setupPersistence,
217217
sqlite: (c) => sqliteProvider(c),
218218

219-
// Option A: WebRTC sync (P2P, server as peer)
220-
sync: createWebrtcSyncProvider({
221-
signaling: ['ws://localhost:3913/signaling'],
219+
// WebSocket sync (y-websocket protocol)
220+
sync: createWebsocketSyncProvider({
221+
url: 'ws://localhost:3913/sync',
222222
}),
223-
224-
// Option B: Hocuspocus WebSocket sync (server as hub)
225-
sync: createHocuspocusProvider({ url: 'ws://localhost:3913' }),
226223
}
227224
```
228225

@@ -851,24 +848,6 @@ Yjs supports multiple providers simultaneously. Changes merge automatically via
851848

852849
See [SYNC_ARCHITECTURE.md](./SYNC_ARCHITECTURE.md) for complete multi-device sync documentation.
853850

854-
### Hocuspocus Provider
855-
856-
Alternative WebSocket-based sync using the Hocuspocus server.
857-
858-
**Setup:**
859-
860-
```typescript
861-
import { createHocuspocusProvider } from '@epicenter/hq';
862-
863-
providers: {
864-
sync: createHocuspocusProvider({
865-
url: 'ws://localhost:1234',
866-
})
867-
}
868-
```
869-
870-
See [@hocuspocus/provider documentation](https://tiptap.dev/docs/hocuspocus/provider) for configuration options.
871-
872851
## Workspace Dependencies
873852

874853
Workspaces can depend on other workspaces, enabling modular architecture.
@@ -1134,7 +1113,7 @@ type ProviderContext = {
11341113
```typescript
11351114
import { setupPersistence } from '@epicenter/hq/providers';
11361115
import { sqliteProvider, markdownProvider } from '@epicenter/hq';
1137-
import { HocuspocusProvider } from '@hocuspocus/provider';
1116+
import { createWebsocketSyncProvider } from '@epicenter/hq/providers/websocket-sync';
11381117

11391118
providers: {
11401119
// Filesystem persistence (Node.js) or IndexedDB (browser)
@@ -1146,11 +1125,9 @@ providers: {
11461125
// Markdown materializer
11471126
markdown: (c) => markdownProvider(c),
11481127

1149-
// WebSocket sync provider
1150-
sync: ({ ydoc }) => new HocuspocusProvider({
1151-
url: 'wss://collab.example.com',
1152-
name: 'my-workspace',
1153-
document: ydoc,
1128+
// WebSocket sync provider (y-websocket protocol)
1129+
sync: createWebsocketSyncProvider({
1130+
url: 'ws://localhost:3913/sync',
11541131
}),
11551132

11561133
// Custom provider

packages/epicenter/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"node": "./src/index.node.ts",
1010
"default": "./src/index.node.ts"
1111
},
12-
"./providers/hocuspocus": "./src/providers/hocuspocus.ts",
1312
"./providers/persistence": {
1413
"browser": "./src/providers/persistence/index.browser.ts",
1514
"node": "./src/providers/persistence/index.node.ts",
@@ -31,8 +30,6 @@
3130
},
3231
"dependencies": {
3332
"mime": "catalog:",
34-
"@hocuspocus/provider": "^3.4.0",
35-
"@hocuspocus/server": "^3.4.0",
3633
"@elysiajs/openapi": "^1.4.11",
3734
"@standard-community/standard-json": "^0.3.5",
3835
"@standard-schema/spec": "^1.0.0",

packages/epicenter/src/core/epicenter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Create an Epicenter client directly for standalone scripts:
3434
The server is just a wrapper around `createEpicenterClient` that:
3535
1. Creates an Epicenter client
3636
2. Keeps it alive
37-
3. Maps REST, MCP, and Hocuspocus endpoints to client actions
37+
3. Maps REST, MCP, and WebSocket Sync endpoints to client actions
3838

3939
```typescript
4040
// Server (long-running)

packages/epicenter/src/providers/hocuspocus.ts

Lines changed: 0 additions & 98 deletions
This file was deleted.

packages/epicenter/src/server/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Expose your Epicenter workspaces as REST APIs and AI-accessible tools.
88

99
1. **Creates an Epicenter client** (same initialization as scripts)
1010
2. **Keeps it alive** (doesn't dispose until you stop the server)
11-
3. **Maps HTTP endpoints** to each client action (REST, MCP, Hocuspocus)
11+
3. **Maps HTTP endpoints** to each client action (REST, MCP, WebSocket Sync)
1212

1313
The key difference from running scripts:
1414

@@ -60,7 +60,7 @@ Bun.serve({ fetch: app.fetch, port: 3913 });
6060

6161
- Web applications
6262
- API backends
63-
- Real-time collaboration (Hocuspocus)
63+
- Real-time collaboration (WebSocket Sync)
6464
- Multiple concurrent clients (via HTTP)
6565

6666
**Benefits:**

specs/20251001T175148 vault-collaborative-workspaces.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export default defineWorkspace({
4141

4242
### Real-Time Collaboration
4343

44-
Each workspace can be synchronized across multiple users via Yjs and a collaboration provider like Hocuspocus:
44+
Each workspace can be synchronized across multiple users via Yjs and a WebSocket sync provider:
4545

4646
```typescript
4747
import { runPlugin } from '@epicenter/vault';
4848
import * as Y from 'yjs';
49-
import { HocuspocusProvider } from '@hocuspocus/provider';
49+
import { createWebsocketSyncProvider } from '@epicenter/hq/providers/websocket-sync';
5050

5151
// Load workspace config
5252
const workspace = await import('./users/epicenter.config.ts');
@@ -55,11 +55,9 @@ const workspace = await import('./users/epicenter.config.ts');
5555
const ydoc = new Y.Doc({ guid: workspace.default.id });
5656

5757
// Connect to collaboration server
58-
const provider = new HocuspocusProvider({
59-
url: 'wss://collab.example.com',
60-
name: workspace.default.id, // Use workspace ID as document name
61-
document: ydoc
62-
});
58+
createWebsocketSyncProvider({
59+
url: 'wss://collab.example.com/sync',
60+
})({ ydoc });
6361

6462
// Run plugin with sync enabled
6563
const api = await runPlugin(workspace.default, {
@@ -144,7 +142,7 @@ Share only specific workspaces:
144142
- [ ] Add Yjs document support to `runPlugin`
145143
- [ ] Implement CRDT-based table operations
146144
- [ ] Add conflict resolution strategies
147-
- [ ] Create Hocuspocus adapter
145+
- [x] Create WebSocket sync adapter
148146

149147
### Phase 3: Collaboration Features (Future)
150148
- [ ] Real-time presence indicators

specs/20251105T150000_subpath-exports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Looking at the codebase structure, I see several distinct modules:
1515

1616
1. **Core exports** (already in main barrel): workspace, schema, actions, epicenter, db
1717
2. **Index implementations**: markdown, sqlite (partially exported)
18-
3. **Providers**: persistence, hocuspocus (already has `/providers` subpath)
18+
3. **Providers**: persistence, websocket-sync (already has `/providers` subpath)
1919
4. **Platform-specific**: cli, desktop, web (already have subpaths)
2020
5. **Server**: REST API and MCP server (already has subpath indirectly)
2121
6. **Missing exports**: Helper functions, error types from index implementations

specs/20251210T120000-unified-providers-migration.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ defineWorkspace({
8989
- [ ] Update `packages/epicenter/src/providers/persistence/web.ts`
9090
- Same changes as desktop.ts
9191

92-
- [ ] Update `packages/epicenter/src/providers/hocuspocus.ts` (if exists)
93-
- Update to use new `ProviderContext` shape
92+
- [x] ~~Update `packages/epicenter/src/providers/hocuspocus.ts` (if exists)~~ (removed - replaced by websocket-sync)
9493

9594
### Phase 4: Index → Provider Migration
9695

0 commit comments

Comments
 (0)