refactor(client): carve outward interfaces for the session, workspace, layout, slash, and conversation services
Feature packages now reach these domains through interface types only: ISession/SessionFace (identity + prompt/cancel/loadOlder + the useSession snapshot source), ISessions, IWorkspaces, ILayout, IConversation, and the existing SlashServiceContract now actually mounted on Context.slash. The concrete services implement their face; wire-pump and assembly entry points stay on the classes. The provide-channel materialization and current-projection logic moves into SessionProvideChannel so the production service and the client test runtime share one implementation. The workspaces service consumes sessions through the narrow SessionsPort.
This commit is contained in:
@@ -24,7 +24,8 @@ export type { SlashServiceContract } from './contract.ts'
|
||||
|
||||
declare module 'cordis' {
|
||||
interface Context {
|
||||
slash: SlashService
|
||||
/** The outward face only; the concrete service stays inside this plugin. */
|
||||
slash: import('./contract.ts').SlashServiceContract
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Service } from 'cordis'
|
||||
import type { Context } from 'cordis'
|
||||
import type { ClientContext, SessionId, SessionsService } from '@deepseek-ai/dsh-client-runtime/client'
|
||||
import type { ClientContext, ISessions, SessionId } from '@deepseek-ai/dsh-client-runtime/client'
|
||||
import type { SlashSource } from '../types.ts'
|
||||
import { SlashController } from './controller.ts'
|
||||
import type { SlashServiceContract } from './contract.ts'
|
||||
@@ -99,7 +99,7 @@ export class SlashService extends Service implements SlashServiceContract {
|
||||
return controller
|
||||
}
|
||||
|
||||
private sessions(): SessionsService {
|
||||
private sessions(): ISessions {
|
||||
const sessions = this.ctx.get('sessions')
|
||||
if (sessions === undefined) throw new Error('ui-slash: sessions service unavailable')
|
||||
return sessions
|
||||
|
||||
Reference in New Issue
Block a user