refactor: projection-key home moves to src/types.ts with /types + /client/types dual outlets

This commit is contained in:
imccyu
2026-07-27 22:22:33 +08:00
parent 75ea589976
commit 38ffb78e1c
9 changed files with 58 additions and 31 deletions

View File

@@ -12,12 +12,11 @@ import { defineTool } from '@deepseek-ai/dsh-tools'
import type { TodoItem } from '@deepseek-ai/dsh-session'
// Type-only: resolves ctx.sessionProjections for the optional unit child.
import type {} from '@deepseek-ai/dsh-session-projection'
// The `todos` 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'
// The `todos` projection-key declaration lives in src/types.ts (its one home);
// this re-export projects the type face onto the package root AND keeps the
// module edge in the emitted index.d.ts, so aggregate programs consuming the
// declarations still receive the SessionProjectionMap merge.
export type * from './types.ts'
export const name = 'tool-todo'
export const inject = ['tools']