From 0f3ca1dcb32a3ecf5be3f3e75307f5eca0ee8c56 Mon Sep 17 00:00:00 2001 From: Jonathan Raphaelson Date: Tue, 21 Oct 2025 05:34:02 +0000 Subject: [PATCH] extract realm specific handling into #realm --- package.json | 1 + src/client/components/messenger.tsx | 2 +- src/client/components/peer-list.tsx | 6 ++--- src/client/page-app.tsx | 10 ++++---- src/client/root/service-database.ts | 4 ++-- src/client/skypod/context.tsx | 8 +++---- src/client/skypod/feed-fetch.worker.ts | 4 ++-- src/cmd/register-ident.ts | 2 +- src/cmd/server.ts | 2 +- src/common/protocol.ts | 21 ---------------- .../client}/cmpnt-connection-manager.tsx | 2 +- .../client}/context-connection.tsx | 0 .../client}/context-identity.tsx | 4 ++-- .../client}/service-connection-peer.ts | 6 ++--- .../client}/service-connection-sync.ts | 4 ++-- .../client}/service-connection.ts | 7 +++--- .../realm => realm/client}/service-device.ts | 2 +- .../client}/service-identity.ts | 2 +- src/{client/realm => realm/client}/types.ts | 2 +- src/{common => realm}/protocol/brands.ts | 0 src/{common => realm}/protocol/device.ts | 0 src/realm/protocol/index.ts | 24 +++++++++++++++++++ .../protocol/logical-clock.ts | 2 +- src/{common => realm}/protocol/messages.ts | 0 src/{common => realm}/protocol/schema.ts | 0 src/{server => realm}/realm-storage.ts | 6 ++--- .../server}/handler-preauth.ts | 4 ++-- .../server}/handler-realm.ts | 10 ++++---- .../routes-socket => realm/server}/handler.ts | 0 .../routes-socket => realm/server}/state.ts | 6 ++--- src/server/index.ts | 2 +- src/skypod/actions-feed.ts | 2 +- src/skypod/actions-feedentry.ts | 2 +- src/skypod/actions.ts | 4 ++-- src/skypod/schema.ts | 4 ++-- tsconfig.json | 1 + 36 files changed, 82 insertions(+), 74 deletions(-) rename src/{client/realm => realm/client}/cmpnt-connection-manager.tsx (98%) rename src/{client/realm => realm/client}/context-connection.tsx (100%) rename src/{client/realm => realm/client}/context-identity.tsx (94%) rename src/{client/realm => realm/client}/service-connection-peer.ts (97%) rename src/{client/realm => realm/client}/service-connection-sync.ts (94%) rename src/{client/realm => realm/client}/service-connection.ts (98%) rename src/{client/realm => realm/client}/service-device.ts (86%) rename src/{client/realm => realm/client}/service-identity.ts (93%) rename src/{client/realm => realm/client}/types.ts (86%) rename src/{common => realm}/protocol/brands.ts (100%) rename src/{common => realm}/protocol/device.ts (100%) create mode 100644 src/realm/protocol/index.ts rename src/{common => realm}/protocol/logical-clock.ts (98%) rename src/{common => realm}/protocol/messages.ts (100%) rename src/{common => realm}/protocol/schema.ts (100%) rename src/{server => realm}/realm-storage.ts (96%) rename src/{server/routes-socket => realm/server}/handler-preauth.ts (99%) rename src/{server/routes-socket => realm/server}/handler-realm.ts (95%) rename src/{server/routes-socket => realm/server}/handler.ts (100%) rename src/{server/routes-socket => realm/server}/state.ts (94%) diff --git a/package.json b/package.json index 53acf59..9a9a25e 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "type": "module", "imports": { "#common/*": "./src/common/*", + "#realm/*": "./src/realm/*", "#client/*": "./src/client/*", "#server/*": "./src/server/*", "#skypod/*": "./src/skypod/*" diff --git a/src/client/components/messenger.tsx b/src/client/components/messenger.tsx index 98f3c12..481bfec 100644 --- a/src/client/components/messenger.tsx +++ b/src/client/components/messenger.tsx @@ -1,9 +1,9 @@ import {useSignal} from '@preact/signals' import {useCallback} from 'preact/hooks' -import {useRealmIdentity} from '#client/realm/context-identity' import {useDatabase} from '#client/root/context-database' import {useSkypod} from '#client/skypod/context' +import {useRealmIdentity} from '#realm/client/context-identity' export const Messenger: preact.FunctionComponent = () => { const {useDbSignal} = useDatabase() diff --git a/src/client/components/peer-list.tsx b/src/client/components/peer-list.tsx index 984deaf..caaf3be 100644 --- a/src/client/components/peer-list.tsx +++ b/src/client/components/peer-list.tsx @@ -1,8 +1,8 @@ import {useSignal, useSignalEffect} from '@preact/signals' -import {useRealmConnection} from '#client/realm/context-connection' -import {PeerState} from '#client/realm/types' -import {IdentID} from '#common/protocol' +import {useRealmConnection} from '#realm/client/context-connection' +import {PeerState} from '#realm/client/types' +import {IdentID} from '#realm/protocol/index' export const PeerList: preact.FunctionComponent = () => { const connection = useRealmConnection() diff --git a/src/client/page-app.tsx b/src/client/page-app.tsx index fd45156..1f655ac 100644 --- a/src/client/page-app.tsx +++ b/src/client/page-app.tsx @@ -1,11 +1,11 @@ -import {RealmConnectionManager} from '#client/realm/cmpnt-connection-manager' +import {DatabaseProvider} from '#client/root/context-database' +import {SkypodProvider} from '#client/skypod/context' +import {RealmConnectionManager} from '#realm/client/cmpnt-connection-manager' import { RealmConnectionFallbackProps, RealmConnectionProvider, -} from '#client/realm/context-connection' -import {RealmIdentityFallbackProps, RealmIdentityProvider} from '#client/realm/context-identity' -import {DatabaseProvider} from '#client/root/context-database' -import {SkypodProvider} from '#client/skypod/context' +} from '#realm/client/context-connection' +import {RealmIdentityFallbackProps, RealmIdentityProvider} from '#realm/client/context-identity' import {DebugNuke} from './components/debug-nuke' import {Messenger} from './components/messenger' diff --git a/src/client/root/service-database.ts b/src/client/root/service-database.ts index 039220f..f0d1291 100644 --- a/src/client/root/service-database.ts +++ b/src/client/root/service-database.ts @@ -1,8 +1,8 @@ import Dexie, {Collection, IndexableType, type Table} from 'dexie' import {JWK} from '#common/crypto/jwks' -import {IdentID, RealmID} from '#common/protocol' -import {LCTimestamp, LogicalClock} from '#common/protocol/logical-clock' +import {IdentID, RealmID} from '#realm/protocol/index' +import {LCTimestamp, LogicalClock} from '#realm/protocol/logical-clock' import {Feed, FeedEntry, Lock} from '#skypod/schema' export interface LocalIdentity { diff --git a/src/client/skypod/context.tsx b/src/client/skypod/context.tsx index 644d1c9..6437182 100644 --- a/src/client/skypod/context.tsx +++ b/src/client/skypod/context.tsx @@ -2,15 +2,15 @@ import {createContext} from 'preact' import {useContext, useEffect, useRef} from 'preact/hooks' import {z} from 'zod/v4' -import {IdentID} from '#common/protocol' +import {IdentID} from '#realm/protocol/index' import {Action, ActionMap, ActionOpts, actionSchema} from '#skypod/actions' import {feedSchema} from '#skypod/schema' -import {useRealmConnection} from '#client/realm/context-connection' -import {useRealmIdentity} from '#client/realm/context-identity' import {useDatabase} from '#client/root/context-database' +import {useRealmConnection} from '#realm/client/context-connection' +import {useRealmIdentity} from '#realm/client/context-identity' -import {LogicalClock} from '#common/protocol/logical-clock' +import {LogicalClock} from '#realm/protocol/logical-clock' import FeedFetchWorker from './feed-fetch.worker?worker' export type MiddlewareFn = ( diff --git a/src/client/skypod/feed-fetch.worker.ts b/src/client/skypod/feed-fetch.worker.ts index ffab6c9..d3ce783 100644 --- a/src/client/skypod/feed-fetch.worker.ts +++ b/src/client/skypod/feed-fetch.worker.ts @@ -3,8 +3,8 @@ import {z} from 'zod/v4' import {Database} from '#client/root/service-database' import {normalizeProtocolError} from '#common/errors' -import {IdentBrand, IdentID} from '#common/protocol' -import {LCTimestamp, LogicalClock} from '#common/protocol/logical-clock' +import {IdentBrand, IdentID} from '#realm/protocol/index' +import {LCTimestamp, LogicalClock} from '#realm/protocol/logical-clock' const msgStartSchema = z.object({ msg: z.literal('start'), diff --git a/src/cmd/register-ident.ts b/src/cmd/register-ident.ts index 7705dfa..2bbfbb3 100644 --- a/src/cmd/register-ident.ts +++ b/src/cmd/register-ident.ts @@ -1,7 +1,7 @@ #!/usr/bin/env node import {generateSignableJwt, generateSigningJwkPair, jwkExport} from '#common/crypto/jwks' -import {IdentBrand, RealmBrand} from '#common/protocol' +import {IdentBrand, RealmBrand} from '#realm/protocol/index' async function generateRegistrationJWT(realm?: string) { const keypair = await generateSigningJwkPair() diff --git a/src/cmd/server.ts b/src/cmd/server.ts index aaa318b..cc8044b 100644 --- a/src/cmd/server.ts +++ b/src/cmd/server.ts @@ -2,8 +2,8 @@ import {dirname, join} from 'path' import {fileURLToPath} from 'url' import {parseArgs} from 'util' +import {ensureRealmMap} from '#realm/server/state' import {buildServer} from '#server/index' -import {ensureRealmMap} from '#server/routes-socket/state' const __filename = fileURLToPath(import.meta.url) const __dirname = dirname(__filename) diff --git a/src/common/protocol.ts b/src/common/protocol.ts index 010636f..da4b8bb 100644 --- a/src/common/protocol.ts +++ b/src/common/protocol.ts @@ -1,9 +1,4 @@ import {z} from 'zod/v4' -import {ProtocolError} from './errors' -import {errorMessageSchema} from './protocol/schema' - -export * from './protocol/brands' -export * from './protocol/messages' /** a zod transformer for parsing json */ export const parseJson = z.transform((input, ctx) => { @@ -19,19 +14,3 @@ export const parseJson = z.transform((input, ctx) => { return z.NEVER } }) - -export function makeError( - error: ProtocolError, - detail: string, - seq?: number, -): z.infer { - return { - typ: 'err', - msg: error.message, - seq, - dat: { - code: error.status, - detail, - }, - } -} diff --git a/src/client/realm/cmpnt-connection-manager.tsx b/src/realm/client/cmpnt-connection-manager.tsx similarity index 98% rename from src/client/realm/cmpnt-connection-manager.tsx rename to src/realm/client/cmpnt-connection-manager.tsx index 613f910..37fc08b 100644 --- a/src/client/realm/cmpnt-connection-manager.tsx +++ b/src/realm/client/cmpnt-connection-manager.tsx @@ -4,7 +4,7 @@ import {useCallback} from 'preact/hooks' import {generateSignableJwt} from '#common/crypto/jwks' import {jwtSchema} from '#common/crypto/jwts' -import {RealmBrand} from '#common/protocol' +import {RealmBrand} from '#realm/protocol/index' import {useRealmConnection} from './context-connection' import {useRealmIdentity} from './context-identity' diff --git a/src/client/realm/context-connection.tsx b/src/realm/client/context-connection.tsx similarity index 100% rename from src/client/realm/context-connection.tsx rename to src/realm/client/context-connection.tsx diff --git a/src/client/realm/context-identity.tsx b/src/realm/client/context-identity.tsx similarity index 94% rename from src/client/realm/context-identity.tsx rename to src/realm/client/context-identity.tsx index 2069114..e808b33 100644 --- a/src/client/realm/context-identity.tsx +++ b/src/realm/client/context-identity.tsx @@ -5,8 +5,8 @@ import {useContext, useEffect} from 'preact/hooks' import {useDatabase} from '#client/root/context-database' import {generateSigningJwkPair} from '#common/crypto/jwks' import {normalizeProtocolError, ProtocolError} from '#common/errors' -import {IdentBrand, IdentID} from '#common/protocol' -import {ClockState, ClockStorage, LogicalClock} from '#common/protocol/logical-clock' +import {IdentBrand, IdentID} from '#realm/protocol/index' +import {ClockState, ClockStorage, LogicalClock} from '#realm/protocol/logical-clock' import {RealmIdentity} from './service-identity' diff --git a/src/client/realm/service-connection-peer.ts b/src/realm/client/service-connection-peer.ts similarity index 97% rename from src/client/realm/service-connection-peer.ts rename to src/realm/client/service-connection-peer.ts index 54d7598..2706d91 100644 --- a/src/client/realm/service-connection-peer.ts +++ b/src/realm/client/service-connection-peer.ts @@ -3,9 +3,9 @@ import z from 'zod/v4' import {BlockingQueue} from '#common/async/blocking-queue' import {sleep} from '#common/async/sleep' -import * as protocol from '#common/protocol' -import {IdentID} from '#common/protocol' -import {DeviceCaps, DeviceInfo} from '#common/protocol/device' +import {DeviceCaps, DeviceInfo} from '#realm/protocol/device' +import * as protocol from '#realm/protocol/index' +import {IdentID} from '#realm/protocol/index' import {RealmSyncManager} from './service-connection-sync' diff --git a/src/client/realm/service-connection-sync.ts b/src/realm/client/service-connection-sync.ts similarity index 94% rename from src/client/realm/service-connection-sync.ts rename to src/realm/client/service-connection-sync.ts index 6e26494..fe2f846 100644 --- a/src/client/realm/service-connection-sync.ts +++ b/src/realm/client/service-connection-sync.ts @@ -1,6 +1,6 @@ import {Database, StoredAction} from '#client/root/service-database' -import {IdentID} from '#common/protocol' -import {LCTimestamp, LogicalClock} from '#common/protocol/logical-clock' +import {IdentID} from '#realm/protocol/index' +import {LCTimestamp, LogicalClock} from '#realm/protocol/logical-clock' import {DeviceScanner} from './service-device' export class RealmSyncManager { diff --git a/src/client/realm/service-connection.ts b/src/realm/client/service-connection.ts similarity index 98% rename from src/client/realm/service-connection.ts rename to src/realm/client/service-connection.ts index 675f0bb..764a038 100644 --- a/src/client/realm/service-connection.ts +++ b/src/realm/client/service-connection.ts @@ -7,11 +7,12 @@ import {sleep} from '#common/async/sleep' import {generateSignableJwt, jwkImport} from '#common/crypto/jwks' import {jwtPayload, verifyJwtToken} from '#common/crypto/jwts' import {normalizeError, normalizeProtocolError, ProtocolError} from '#common/errors' -import * as protocol from '#common/protocol' -import {IdentID, RealmID} from '#common/protocol' -import {LogicalClock} from '#common/protocol/logical-clock' import {streamSocketJson, takeSocketJson} from '#common/socket' +import {IdentID, RealmID} from '#realm/protocol/brands' +import * as protocol from '#realm/protocol/index' +import {LogicalClock} from '#realm/protocol/logical-clock' + import {Database} from '#client/root/service-database' import {RealmPeer} from './service-connection-peer' diff --git a/src/client/realm/service-device.ts b/src/realm/client/service-device.ts similarity index 86% rename from src/client/realm/service-device.ts rename to src/realm/client/service-device.ts index 2bb4db4..743dee0 100644 --- a/src/client/realm/service-device.ts +++ b/src/realm/client/service-device.ts @@ -1,4 +1,4 @@ -import {DeviceCaps, DeviceInfo} from '#common/protocol/device' +import {DeviceCaps, DeviceInfo} from '#realm/protocol/device' export class DeviceScanner { #caps: DeviceCaps diff --git a/src/client/realm/service-identity.ts b/src/realm/client/service-identity.ts similarity index 93% rename from src/client/realm/service-identity.ts rename to src/realm/client/service-identity.ts index 58d7026..95dea30 100644 --- a/src/client/realm/service-identity.ts +++ b/src/realm/client/service-identity.ts @@ -1,5 +1,5 @@ import {JWK, jwkExport} from '#common/crypto/jwks' -import {IdentID} from '#common/protocol' +import {IdentID} from '#realm/protocol/index' import {Signable} from './types' diff --git a/src/client/realm/types.ts b/src/realm/client/types.ts similarity index 86% rename from src/client/realm/types.ts rename to src/realm/client/types.ts index 49fce52..785baf5 100644 --- a/src/client/realm/types.ts +++ b/src/realm/client/types.ts @@ -1,4 +1,4 @@ -import {IdentID, RealmID} from '#common/protocol' +import {IdentID, RealmID} from '#realm/protocol/index' /** identity info for connecting to a realm */ export interface ConnectionIdentity { diff --git a/src/common/protocol/brands.ts b/src/realm/protocol/brands.ts similarity index 100% rename from src/common/protocol/brands.ts rename to src/realm/protocol/brands.ts diff --git a/src/common/protocol/device.ts b/src/realm/protocol/device.ts similarity index 100% rename from src/common/protocol/device.ts rename to src/realm/protocol/device.ts diff --git a/src/realm/protocol/index.ts b/src/realm/protocol/index.ts new file mode 100644 index 0000000..0c1f319 --- /dev/null +++ b/src/realm/protocol/index.ts @@ -0,0 +1,24 @@ +import {z} from 'zod/v4' + +import {ProtocolError} from '#common/errors' + +import {errorMessageSchema} from './schema' + +export * from './brands' +export * from './messages' + +export function makeError( + error: ProtocolError, + detail: string, + seq?: number, +): z.infer { + return { + typ: 'err', + msg: error.message, + seq, + dat: { + code: error.status, + detail, + }, + } +} diff --git a/src/common/protocol/logical-clock.ts b/src/realm/protocol/logical-clock.ts similarity index 98% rename from src/common/protocol/logical-clock.ts rename to src/realm/protocol/logical-clock.ts index 4c2fb36..85a0ceb 100644 --- a/src/common/protocol/logical-clock.ts +++ b/src/realm/protocol/logical-clock.ts @@ -1,4 +1,4 @@ -import {IdentBrand, IdentID} from '#common/protocol/brands' +import {IdentBrand, IdentID} from '#realm/protocol/brands' import {z} from 'zod/v4' export interface ClockStorage { diff --git a/src/common/protocol/messages.ts b/src/realm/protocol/messages.ts similarity index 100% rename from src/common/protocol/messages.ts rename to src/realm/protocol/messages.ts diff --git a/src/common/protocol/schema.ts b/src/realm/protocol/schema.ts similarity index 100% rename from src/common/protocol/schema.ts rename to src/realm/protocol/schema.ts diff --git a/src/server/realm-storage.ts b/src/realm/realm-storage.ts similarity index 96% rename from src/server/realm-storage.ts rename to src/realm/realm-storage.ts index 4052868..69c5c76 100644 --- a/src/server/realm-storage.ts +++ b/src/realm/realm-storage.ts @@ -4,10 +4,10 @@ import path from 'node:path' import {z} from 'zod/v4' import {jwkExport, jwkImport, type JWK} from '#common/crypto/jwks' -import {IdentBrand, IdentID, RealmBrand, RealmID} from '#common/protocol' -import {LCTimestamp, LogicalClock} from '#common/protocol/logical-clock' -import {actionMessageSchema} from '#common/protocol/schema' import {StrictMap} from '#common/strict-map' +import {IdentBrand, IdentID, RealmBrand, RealmID} from '#realm/protocol/index' +import {LCTimestamp, LogicalClock} from '#realm/protocol/logical-clock' +import {actionMessageSchema} from '#realm/protocol/schema' export type IncomingAction = z.infer export type StoredAction = z.infer diff --git a/src/server/routes-socket/handler-preauth.ts b/src/realm/server/handler-preauth.ts similarity index 99% rename from src/server/routes-socket/handler-preauth.ts rename to src/realm/server/handler-preauth.ts index 2310df4..7324045 100644 --- a/src/server/routes-socket/handler-preauth.ts +++ b/src/realm/server/handler-preauth.ts @@ -4,6 +4,7 @@ import {combineSignals, timeoutSignal} from '#common/async/aborts' import {JWK, jwkExport, jwkImport} from '#common/crypto/jwks' import {jwtPayload, jwtSchema, JWTToken, verifyJwtToken} from '#common/crypto/jwts' import {normalizeError, ProtocolError} from '#common/errors' +import {takeSocket} from '#common/socket' import { IdentBrand, IdentID, @@ -11,8 +12,7 @@ import { PreauthResponse, RealmBrand, RealmID, -} from '#common/protocol' -import {takeSocket} from '#common/socket' +} from '#realm/protocol/index' import * as realms from './state' diff --git a/src/server/routes-socket/handler-realm.ts b/src/realm/server/handler-realm.ts similarity index 95% rename from src/server/routes-socket/handler-realm.ts rename to src/realm/server/handler-realm.ts index 2aee442..4b0d56d 100644 --- a/src/server/routes-socket/handler-realm.ts +++ b/src/realm/server/handler-realm.ts @@ -3,11 +3,13 @@ import {z} from 'zod/v4' import {jwkExport} from '#common/crypto/jwks' import {normalizeProtocolError, ProtocolError} from '#common/errors' -import * as protocol from '#common/protocol' -import {actionMessageSchema} from '#common/protocol/schema' +import {parseJson} from '#common/protocol' import {streamSocket} from '#common/socket' -import * as realm from '#server/routes-socket/state' +import * as protocol from '#realm/protocol/index' +import {actionMessageSchema} from '#realm/protocol/schema' + +import * as realm from '#realm/server/state' // what can the server handle? const incomingMessageSchema = z.union([ @@ -30,7 +32,7 @@ export async function realmHandler( realmBroadcast(auth, await buildRtcPeerJoined(auth)) try { - const incomingParser = protocol.parseJson.pipe(incomingMessageSchema) + const incomingParser = parseJson.pipe(incomingMessageSchema) for await (const msg of streamSocket(ws, {signal})) { try { const data = await incomingParser.parseAsync(msg) diff --git a/src/server/routes-socket/handler.ts b/src/realm/server/handler.ts similarity index 100% rename from src/server/routes-socket/handler.ts rename to src/realm/server/handler.ts diff --git a/src/server/routes-socket/state.ts b/src/realm/server/state.ts similarity index 94% rename from src/server/routes-socket/state.ts rename to src/realm/server/state.ts index 0a07d6c..2284ac7 100644 --- a/src/server/routes-socket/state.ts +++ b/src/realm/server/state.ts @@ -1,10 +1,10 @@ import WebSocket from 'isomorphic-ws' -import {IdentID, RealmID} from '#common/protocol' -import {DeviceCaps, DeviceInfo} from '#common/protocol/device' import {StrictMap} from '#common/strict-map' +import {DeviceCaps, DeviceInfo} from '#realm/protocol/device' +import {IdentID, RealmID} from '#realm/protocol/index' -import {RealmStorage} from '#server/realm-storage' +import {RealmStorage} from '#realm/realm-storage' /** An authenticated identity; only handed out in response to successful authentication. */ export interface AuthenticatedIdentity { diff --git a/src/server/index.ts b/src/server/index.ts index 128b97f..f1ec5c2 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -3,9 +3,9 @@ import * as http from 'http' import {WebSocketServer} from 'ws' +import {socketHandler} from '#realm/server/handler' import {apiRouter} from './routes-api/middleware' import {notFoundHandler} from './routes-error' -import {socketHandler} from './routes-socket/handler' import {makeSpaMiddleware, makeStaticMiddleware} from './routes-static' /** diff --git a/src/skypod/actions-feed.ts b/src/skypod/actions-feed.ts index 1765519..b6d78df 100644 --- a/src/skypod/actions-feed.ts +++ b/src/skypod/actions-feed.ts @@ -1,4 +1,4 @@ -import {makeActionSchema} from '#common/protocol/schema' +import {makeActionSchema} from '#realm/protocol/schema' import {z} from 'zod/v4' import {feedSchema, lockSchema} from './schema' diff --git a/src/skypod/actions-feedentry.ts b/src/skypod/actions-feedentry.ts index e79450a..d2c8999 100644 --- a/src/skypod/actions-feedentry.ts +++ b/src/skypod/actions-feedentry.ts @@ -1,4 +1,4 @@ -import {makeActionSchema} from '#common/protocol/schema' +import {makeActionSchema} from '#realm/protocol/schema' import {z} from 'zod/v4' export const patchActionSchema = makeActionSchema( diff --git a/src/skypod/actions.ts b/src/skypod/actions.ts index 3f3a44d..74f467f 100644 --- a/src/skypod/actions.ts +++ b/src/skypod/actions.ts @@ -1,5 +1,5 @@ -import {LCTimestamp} from '#common/protocol/logical-clock' -import {actionOptionsSchema} from '#common/protocol/schema' +import {LCTimestamp} from '#realm/protocol/logical-clock' +import {actionOptionsSchema} from '#realm/protocol/schema' import {z} from 'zod/v4' import {feedActionSchemas} from './actions-feed' diff --git a/src/skypod/schema.ts b/src/skypod/schema.ts index 9eefc1a..9164f3f 100644 --- a/src/skypod/schema.ts +++ b/src/skypod/schema.ts @@ -1,5 +1,5 @@ -import {IdentBrand} from '#common/protocol/brands' -import {LogicalClock} from '#common/protocol/logical-clock' +import {IdentBrand} from '#realm/protocol/brands' +import {LogicalClock} from '#realm/protocol/logical-clock' import {z} from 'zod/v4' // lock schema for distributed work coordination diff --git a/tsconfig.json b/tsconfig.json index a4efda8..d53a4f1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,6 +25,7 @@ "baseUrl": ".", "paths": { "#common/*": ["./src/common/*"], + "#realm/*": ["./src/realm/*"], "#client/*": ["./src/client/*"], "#server/*": ["./src/server/*"], "#skypod/*": ["./src/skypod/*"] -- 2.51.2