diff --git a/packages/api/gateway/package.json b/packages/api/gateway/package.json index e961defbad..d5601ab188 100644 --- a/packages/api/gateway/package.json +++ b/packages/api/gateway/package.json @@ -35,9 +35,6 @@ }, "dsh": { "client": { - "external": [ - "@deepseek-ai/dsh-typert-protocol" - ], "inject": [ "@deepseek-ai/dsh-typert-registry", "@deepseek-ai/dsh-client-connection" diff --git a/packages/api/gateway/tests/gateway.client.spec.ts b/packages/api/gateway/tests/gateway.client.spec.ts index 519b4dc0cc..829afc6c2f 100644 --- a/packages/api/gateway/tests/gateway.client.spec.ts +++ b/packages/api/gateway/tests/gateway.client.spec.ts @@ -5,6 +5,7 @@ import { describe, expect, expectTypeOf, it, vi } from 'vitest' import { z } from 'zod' import { apply as applyConnection, + type ConnectionGeneration, type ConnectionGenerationSource, type ConnectionHandle, } from '@deepseek-ai/dsh-client-connection/client' @@ -548,6 +549,35 @@ describe('Client Remote transport readiness', () => { await client.dispose() }) + it('reports Host facts as plain reads and keeps them through Connection withdrawal', async () => { + const ctx = new Context() + await ctx.plugin(TypertRegistry) + const generation = new GenerationHarness() + const live: { snapshot: ConnectionGeneration | undefined } = { snapshot: undefined } + const handle = { + isLoopback: true, + generation: { getSnapshot: () => live.snapshot, subscribe: () => () => {} }, + rpc: { + call: vi.fn(), + open: () => unexpectedInProcessStream(), + }, + registerGenerationSource: generation.register, + start: () => ({ stop: () => {} }), + } as unknown as ConnectionHandle + const withdraw = ctx.provide('connection', handle) + const client = ctx.plugin({ inject, apply }) + await client + const remote = ctx.remote + + expect(remote.$host).toEqual({ home: undefined, isLoopback: true }) + live.snapshot = { id: 1, host: { home: '/hosts/primary' } } + expect(remote.$host).toEqual({ home: '/hosts/primary', isLoopback: true }) + + withdraw() + expect(ctx.get('connection')).toBeUndefined() + expect(remote.$host).toEqual({ home: '/hosts/primary', isLoopback: true }) + }) + it('starts after Loader settlement and stops the owned loop on disposal', async () => { const readiness = deferredReadiness() const { client, start, stop } = await loaderReadinessBench(readiness.promise) diff --git a/packages/client/tsdown.client.ts b/packages/client/tsdown.client.ts index 984a6a6828..f31d1510e3 100644 --- a/packages/client/tsdown.client.ts +++ b/packages/client/tsdown.client.ts @@ -58,7 +58,7 @@ function styleInjectionModule( * Everything else under @deepseek-ai/* is either a module-table entry * (external) or a leak the purity gate rejects. */ -export const INLINE_SAFE = /^(?:@deepseek-ai\/dsh-(?:file-reference|session|llm|tools|brand|util-crypto|util-workspace-path)(?:\/|$)|@deepseek-ai\/dsh-token-meter\/client$)/ +export const INLINE_SAFE = /^(?:@deepseek-ai\/dsh-(?:file-reference|session|llm|tools|brand|typert-protocol|util-crypto|util-workspace-path)(?:\/|$)|@deepseek-ai\/dsh-token-meter\/client$)/ /** * Vendored framework libraries: rescoped into @deepseek-ai, so the gate below diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d607e39d27..9b37eee6d1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10539,6 +10539,9 @@ importers: '@deepseek-ai/dsh-user-questions': specifier: workspace:^ version: link:../../packages/interaction/user-questions + '@deepseek-ai/dsh-util-time': + specifier: workspace:^ + version: link:../../packages/util/time '@deepseek-ai/dsh-web': specifier: workspace:^ version: link:../../packages/web/web diff --git a/python/sdk-runtime/package.json b/python/sdk-runtime/package.json index 331d388a0f..61dc113188 100644 --- a/python/sdk-runtime/package.json +++ b/python/sdk-runtime/package.json @@ -119,6 +119,7 @@ "@deepseek-ai/dsh-user-approval": "workspace:^", "@deepseek-ai/dsh-anonymous-user-id": "workspace:^", "@deepseek-ai/dsh-user-questions": "workspace:^", + "@deepseek-ai/dsh-util-time": "workspace:^", "@deepseek-ai/dsh-web": "workspace:^", "@deepseek-ai/dsh-web-fetch-http": "workspace:^", "@deepseek-ai/dsh-web-search-deepseek": "workspace:^",