From 95a3794e6811d307038f7b811838057bb6aa3bc4 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Mon, 27 Jul 2026 16:15:29 +0800 Subject: [PATCH] refactor(gui): source SessionProjectionMap from the interface package's pure-type outlet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swap the client runtime's parallel-construction placeholder for import type from @deepseek-ai/dsh-session-projection/types — the zero-import outlet, never the package root, whose dsh-agent → dsh-session chain would drag the host Context.sessions merge into the client program. One type table end to end (host provider, wire block, client cell, React hook); the spec's test key now declare-merges the real module. Adds the workspace dep and the tsconfig project reference. --- packages/client/runtime/package.json | 1 + .../src/client/sessions/projection-cell.ts | 20 ++++++++----------- .../runtime/tests/projection-cell.spec.ts | 6 +++--- packages/client/runtime/tsconfig.json | 3 +++ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/client/runtime/package.json b/packages/client/runtime/package.json index 4bd95595c1..ff994dad72 100644 --- a/packages/client/runtime/package.json +++ b/packages/client/runtime/package.json @@ -36,6 +36,7 @@ "@deepseek-ai/dsh-host-apiproxy": "workspace:^", "@deepseek-ai/dsh-llm": "workspace:^", "@deepseek-ai/dsh-session": "workspace:^", + "@deepseek-ai/dsh-session-projection": "workspace:^", "immer": "^10.1.1", "react": "^18.2.0", "zustand": "~4.4.7" diff --git a/packages/client/runtime/src/client/sessions/projection-cell.ts b/packages/client/runtime/src/client/sessions/projection-cell.ts index 539015992e..de7cb5ac12 100644 --- a/packages/client/runtime/src/client/sessions/projection-cell.ts +++ b/packages/client/runtime/src/client/sessions/projection-cell.ts @@ -8,21 +8,17 @@ * (useProjection) happens in web-react. */ import type { SessionEvent } from '@deepseek-ai/dsh-session/types' +import type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types' import type { ObservableSnapshot } from '../contract/store.ts' import { Notifier } from './notifier.ts' -/** - * The single projection type table, typed end to end (host provider, wire - * block, client cell, React hook). Domain packages merge their keys in. - * - * TODO(gui): switch to `import type { SessionProjectionMap } from - * '@deepseek-ai/dsh-session-projection'` (pure type-only edge) once the host - * interface package lands; this placeholder is structurally identical and - * exists only because the two bases are built in parallel. No second - * client-side "views" table — one map end to end (user ruling, RFC - * Alternatives). - */ -export interface SessionProjectionMap {} +// The single projection type table, typed end to end (host provider, wire +// block, client cell, React hook) — the interface package's pure-type outlet +// (`/types`, zero imports), never the package root: the root's dsh-agent → +// dsh-session chain would drag the host `Context.sessions` merge into the +// client program (one program must not hold both sides). No second +// client-side "views" table (user ruling, RFC Alternatives). +export type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types' /** * Minimal validating-schema face (zod-compatible: `ZodType` satisfies it diff --git a/packages/client/runtime/tests/projection-cell.spec.ts b/packages/client/runtime/tests/projection-cell.spec.ts index 78a661222b..8ab22c4347 100644 --- a/packages/client/runtime/tests/projection-cell.spec.ts +++ b/packages/client/runtime/tests/projection-cell.spec.ts @@ -15,9 +15,9 @@ import { SessionsService } from '../src/client/sessions/service.ts' import { FakeApiClient, ok } from './fake-api.ts' import { entries, plainTurn } from './event-script.ts' -// Test-domain key merged into the (placeholder) projection map: a whole-value -// marker list, the smallest last-wins shape. -declare module '../src/client/sessions/projection-cell.ts' { +// Test-domain key merged into the projection map (the interface package's +// pure-type outlet): a whole-value marker list, the smallest last-wins shape. +declare module '@deepseek-ai/dsh-session-projection/types' { interface SessionProjectionMap { 'test/marks': { marks: string[] } } diff --git a/packages/client/runtime/tsconfig.json b/packages/client/runtime/tsconfig.json index 2e22ea1013..afb8b76cb3 100644 --- a/packages/client/runtime/tsconfig.json +++ b/packages/client/runtime/tsconfig.json @@ -23,6 +23,9 @@ { "path": "../../host/apiproxy" }, + { + "path": "../../session-projection/session-projection" + }, { "path": "../../llm/llm" },