The sidebar terminal header entry watches the displayed Session's terminal roster, so every assembled Web spec that renders a Session opened terminal/watch and failed on the unmatched request. The default table now opens it with an empty roster, like the other boot streams.
64 lines
3.7 KiB
TypeScript
64 lines
3.7 KiB
TypeScript
/**
|
|
* Default responses for every Remote endpoint the web assembly calls while
|
|
* booting and rendering with no sessions, no workspaces, and default settings.
|
|
* The comment above each row names the plugin that calls it; endpoints boot
|
|
* never touches stay absent so a new call fails loud. `$events` is built into
|
|
* `RemoteMock`.
|
|
* @module @deepseek-ai/dsh-client-test-runtime/src/assembly/remote-default-responses
|
|
*/
|
|
import { ok, openStream, type RemoteTable } from '@deepseek-ai/dsh-remote-mock'
|
|
|
|
/** Default responses of the boot-time Remote endpoints; a spec loads it first and layers its own table on top. */
|
|
export const remoteDefaultResponses: RemoteTable = {
|
|
unary: {
|
|
// api-session-controller `sessions.handleConnected()` on `connection/reset`.
|
|
'session/list': ok({ items: [] }),
|
|
// ui-workspace startup with no entries; first-use initialization is ineligible.
|
|
'workspace/initializeDefault': ok(undefined),
|
|
// ui-settings `mirror.ensure()` at apply and again on `connection/reset`.
|
|
'settings/describe': ok({ writable: true, hasDocument: false, namespaces: [] }),
|
|
// ui-model-selection `ModelDirectoryResolver` constructor.
|
|
'session/modelCatalog': ok({
|
|
default: { provider: 'deepseek-official', model: 'deepseek-v4-flash' },
|
|
routableProviders: [],
|
|
groups: [],
|
|
failures: [],
|
|
}),
|
|
// ui-agent-preset hero chip and header label on first mount.
|
|
'agentPresets/list': ok({ presets: [] }),
|
|
// cordis-client-runner `ClientCordisInspectRegistry.sync` at apply and on `connection/reset`.
|
|
'dynamicCordisRunner/syncInspectManifest': ok(null),
|
|
// ui-cordis inventory at apply and on `connection/reset`.
|
|
'dynamicCordisRunner/inventory': ok([]),
|
|
// ui-settings-web-search page `readCredential()` when the settings mirror first publishes.
|
|
'credentials/describe': ok({}),
|
|
// ui-settings-web-search page provider options at apply and on `connection/reset`.
|
|
'web/listProviders': ok({ search: [], fetch: [] }),
|
|
// ui-permission-presets `PermissionCatalogDirectory` on its first read for a connection generation.
|
|
'permissionPresets/catalog': ok({ options: [] }),
|
|
// ui-settings-account refreshes details after a stored-grant snapshot.
|
|
'account/getProfile': ok(null),
|
|
'account/getBalance': ok(null),
|
|
// ui-settings-account bonus notice read and acknowledgement at signing in.
|
|
'account/getUnnotifiedBonuses': ok(null),
|
|
'account/ackBonusNotified': ok(true),
|
|
},
|
|
// Stream endpoints the roster opens later than boot; declared so a spec that forgets the script gets a stream miss.
|
|
streams: [
|
|
// api-session-controller `SessionEventStream.follow` when a Session opens.
|
|
'session/follow',
|
|
],
|
|
stream: {
|
|
// api-session-controller client `apply`: the control stream's opening baseline, then open.
|
|
'session/control': openStream([{ type: 'baseline', value: { projections: {} } }]),
|
|
// ui-settings-account shares the account snapshot across settings and the sidebar menu.
|
|
'account/watch': openStream([{ status: 'signed-out', attempt: null, links: { usageUrl: 'https://platform.deepseek.com/usage', topUpUrl: 'https://platform.deepseek.com/top_up' } }]),
|
|
// api-workspace-controller client `apply`: the follow stream's opening baseline, then open.
|
|
'workspace/follow': openStream([{ type: 'baseline', value: { items: [], archivedSessionIds: [], pinnedSessionIds: [] } }]),
|
|
// api-remote-access client `mountAccess`: the owner's access snapshot, then open.
|
|
'remoteAccess/follow': openStream([{ type: 'baseline', owner: true }]),
|
|
// ui-sidebar-terminal header entry `agent-terminals`: the displayed Session's terminal roster, then open.
|
|
'terminal/watch': openStream([[]]),
|
|
},
|
|
}
|