test: finish the Remote-result and picker-split test migrations

Every generated Remote method resolves to `RemoteResult<T>`, so the Gateway
client spec asserts the ok and error branches instead of the unwrapped value
and a throw, and the generator fixtures declare the wrapper in the consumer
face they typecheck. The RPC-failure test splits into the Host error carried
verbatim in the error branch plus a transport throw folded into it.

The runtime client, ui-command and ui-plan benches answer the generated
commands Remote through its result branches and provide the `remote.commands`
namespace their plugins now inject; the ui-command bench also serves the `$on`
the service subscribes on construction.

The directory-picker chooser mounts a backend and its surface as a pair, so the
real-Loader composition serves both surface packages and asserts each entry
arrives and leaves with its backend.
This commit is contained in:
imccyu
2026-08-11 20:45:10 +08:00
parent 03f88e3c3d
commit 92e0e3377f
9 changed files with 138 additions and 64 deletions

View File

@@ -14,7 +14,7 @@ import type { ConversationNodeDefinition } from '../src/client/contract/conversa
import { Session } from '../src/client/sessions/session.ts'
import type { SessionsService } from '../src/client/sessions/service.ts'
import type { WorkspacesService } from '../src/client/workspaces/service.ts'
import { FakeApiClient, ok } from './fake-api.ts'
import { FakeApiClient, fakeRemote, ok } from './fake-api.ts'
interface Bench {
ctx: Context
@@ -45,6 +45,7 @@ async function mount(): Promise<Bench> {
}
ctx.reflect.provide('connection', handle)
ctx.reflect.provide('remote', {})
ctx.reflect.provide('remote.commands', fakeRemote().commands)
await ctx.plugin(RuntimeClient).await()
return bench
}

View File

@@ -13,7 +13,7 @@ import TypertRegistry from '@deepseek-ai/dsh-typert-registry'
// key face and per-event listener signatures.
import type {} from '@deepseek-ai/dsh-api-remotes/client'
import * as RuntimeClient from '../src/client/index.ts'
import { FakeApiClient } from './fake-api.ts'
import { FakeApiClient, fakeRemote } from './fake-api.ts'
/**
* Compile-time face of `ctx.remote.$on`, asserted by type-checking this file
@@ -74,6 +74,7 @@ async function mount(): Promise<Bench> {
},
}
ctx.reflect.provide('connection', handle)
ctx.reflect.provide('remote.commands', fakeRemote().commands)
await ctx.plugin(RuntimeClient).await()
return bench
}