MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / createPromptServiceOverride

Function createPromptServiceOverride

packages/server/test/prompt.e2e.test.ts:116–145  ·  view source on GitHub ↗
(
  stub: Partial<IPromptService>,
)

Source from the content-addressed store, hash-verified

114}
115
116function createPromptServiceOverride(
117 stub: Partial<IPromptService>,
118): IPromptService {
119 const noopComplete = (() => ({ dispose: () => undefined })) as IPromptService['onDidComplete'];
120 const noopAbort = (() => ({ dispose: () => undefined })) as IPromptService['onDidAbort'];
121 const defaultImpl: IPromptService = {
122 _serviceBrand: undefined,
123 list: async () => ({ active: null, queued: [] }),
124 submit: async () => ({
125 prompt_id: 'prompt_test',
126 user_message_id: 'msg_test',
127 status: 'running',
128 content: [{ type: 'text', text: 'test' }],
129 created_at: '2026-06-09T00:00:00.000Z',
130 }),
131 steer: async (_sid, promptIds) => ({
132 steered: true,
133 prompt_ids: [...promptIds],
134 }),
135 abort: async () => ({ aborted: true }),
136 abortBySession: async () => ({ aborted: true }),
137 getCurrentPromptId: () => undefined,
138 applyAgentState: async () => undefined,
139 getAgentStateSnapshot: () => undefined,
140 startBtw: async () => 'prompt_btw_test',
141 onDidComplete: noopComplete,
142 onDidAbort: noopAbort,
143 };
144 return { ...defaultImpl, ...stub };
145}
146
147function buildMultipart(parts: {
148 file: { fieldName: string; filename: string; contentType: string; data: Buffer };

Callers 1

prompt.e2e.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected