feat: single-source projection keys via domain ./client/types pure outlets
This commit is contained in:
@@ -15,12 +15,17 @@
|
||||
"types": "./lib/types/invariant.d.ts",
|
||||
"default": "./lib/invariant.js"
|
||||
},
|
||||
"./client/types": {
|
||||
"types": "./lib/types/client/types.d.ts",
|
||||
"default": "./lib/types/client/types.js"
|
||||
},
|
||||
"./src/*": "./src/*",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"lib/index.js",
|
||||
"lib/invariant.js",
|
||||
"lib/types/**/*.js",
|
||||
"lib/types/**/*.d.ts",
|
||||
"lib/types/**/*.d.ts.map",
|
||||
"src"
|
||||
|
||||
25
packages/session-title/session-title/src/client/types.ts
Normal file
25
packages/session-title/session-title/src/client/types.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Pure-type client outlet of the title domain: the ONE home of the `title`
|
||||
* projection-key declaration, importable from client aggregates without
|
||||
* dragging this package's host-side value imports (cordis service,
|
||||
* schemastery, the llm seam). The host entry (`index.ts`) imports this module
|
||||
* type-only to reuse the same merge — one declaration serves both program
|
||||
* sides.
|
||||
*
|
||||
* @module @deepseek-ai/dsh-session-title/client/types
|
||||
*/
|
||||
|
||||
// Marks this file a module so the declaration below AUGMENTS the projection
|
||||
// table instead of declaring an ambient module.
|
||||
export {}
|
||||
|
||||
declare module '@deepseek-ai/dsh-session-projection/types' {
|
||||
interface SessionProjectionMap {
|
||||
/**
|
||||
* The session's current normalized title — the latest `session/title`
|
||||
* event's text (last-wins), or `null` before the first title lands. A
|
||||
* plain string: the shape the client list rows consume.
|
||||
*/
|
||||
title: string | null
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,12 @@ import type {
|
||||
} from '@deepseek-ai/dsh-session'
|
||||
// Type-only: resolves ctx.sessionProjections for the optional unit child.
|
||||
import type {} from '@deepseek-ai/dsh-session-projection'
|
||||
// The `title` projection-key declaration lives in the client outlet (its one
|
||||
// home). A PLAIN side-effect import, not `import type`: declaration emit
|
||||
// elides type-only imports, and the aggregate programs resolve this package
|
||||
// through its emitted declarations — the merge must survive in index.d.ts.
|
||||
// The imported module is types-only, so the runtime edge is an empty module.
|
||||
import './client/types.ts'
|
||||
import { fallbackSessionTitle, normalizeSessionTitle } from './normalize.ts'
|
||||
|
||||
export { fallbackSessionTitle, normalizeSessionTitle, truncateTitleUtf8 } from './normalize.ts'
|
||||
@@ -103,17 +109,6 @@ declare module '@deepseek-ai/dsh-session' {
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@deepseek-ai/dsh-session-projection/types' {
|
||||
interface SessionProjectionMap {
|
||||
/**
|
||||
* The session's current normalized title — the latest `session/title`
|
||||
* event's text (last-wins), or `null` before the first title lands. A
|
||||
* plain string: the shape the client list rows consume.
|
||||
*/
|
||||
title: string | null
|
||||
}
|
||||
}
|
||||
|
||||
/** Per-session settlement tails for title-capability out-of-band writes. */
|
||||
const SESSION_TITLE_WRITE_TAILS = new WeakMap<Session, Promise<void>>()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user