dominds-kernel 1.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +3 -0
  3. package/dist/app-host-contract.d.ts +87 -0
  4. package/dist/app-host-contract.js +2 -0
  5. package/dist/app-json.d.ts +139 -0
  6. package/dist/app-json.js +234 -0
  7. package/dist/diligence.d.ts +3 -0
  8. package/dist/diligence.js +64 -0
  9. package/dist/evt.d.ts +40 -0
  10. package/dist/evt.js +142 -0
  11. package/dist/index.d.ts +6 -0
  12. package/dist/index.js +25 -0
  13. package/dist/team-mgmt-manual.d.ts +20 -0
  14. package/dist/team-mgmt-manual.js +121 -0
  15. package/dist/types/context-health.d.ts +33 -0
  16. package/dist/types/context-health.js +2 -0
  17. package/dist/types/dialog.d.ts +398 -0
  18. package/dist/types/dialog.js +8 -0
  19. package/dist/types/display-state.d.ts +43 -0
  20. package/dist/types/display-state.js +2 -0
  21. package/dist/types/i18n.d.ts +2 -0
  22. package/dist/types/i18n.js +2 -0
  23. package/dist/types/language.d.ts +5 -0
  24. package/dist/types/language.js +35 -0
  25. package/dist/types/priming.d.ts +55 -0
  26. package/dist/types/priming.js +2 -0
  27. package/dist/types/problems.d.ts +128 -0
  28. package/dist/types/problems.js +2 -0
  29. package/dist/types/q4h.d.ts +9 -0
  30. package/dist/types/q4h.js +2 -0
  31. package/dist/types/setup.d.ts +170 -0
  32. package/dist/types/setup.js +2 -0
  33. package/dist/types/snippets.d.ts +68 -0
  34. package/dist/types/snippets.js +2 -0
  35. package/dist/types/storage.d.ts +561 -0
  36. package/dist/types/storage.js +85 -0
  37. package/dist/types/tools-registry.d.ts +19 -0
  38. package/dist/types/tools-registry.js +2 -0
  39. package/dist/types/wire.d.ts +227 -0
  40. package/dist/types/wire.js +18 -0
  41. package/dist/types.d.ts +112 -0
  42. package/dist/types.js +28 -0
  43. package/dist/utils/html.d.ts +2 -0
  44. package/dist/utils/html.js +20 -0
  45. package/dist/utils/id.d.ts +1 -0
  46. package/dist/utils/id.js +6 -0
  47. package/dist/utils/time.d.ts +1 -0
  48. package/dist/utils/time.js +13 -0
  49. package/package.json +84 -0
  50. package/src/app-host-contract.ts +105 -0
  51. package/src/app-json.ts +401 -0
  52. package/src/diligence.ts +64 -0
  53. package/src/evt.ts +156 -0
  54. package/src/index.ts +48 -0
  55. package/src/team-mgmt-manual.ts +151 -0
  56. package/src/types/context-health.ts +39 -0
  57. package/src/types/dialog.ts +487 -0
  58. package/src/types/display-state.ts +21 -0
  59. package/src/types/i18n.ts +3 -0
  60. package/src/types/language.ts +33 -0
  61. package/src/types/priming.ts +69 -0
  62. package/src/types/problems.ts +144 -0
  63. package/src/types/q4h.ts +11 -0
  64. package/src/types/setup.ts +140 -0
  65. package/src/types/snippets.ts +55 -0
  66. package/src/types/storage.ts +682 -0
  67. package/src/types/tools-registry.ts +24 -0
  68. package/src/types/wire.ts +335 -0
  69. package/src/types.ts +133 -0
  70. package/src/utils/html.ts +17 -0
  71. package/src/utils/id.ts +3 -0
  72. package/src/utils/time.ts +10 -0
@@ -0,0 +1,398 @@
1
+ /**
2
+ * Module: kernel/types/dialog
3
+ *
4
+ * Strongly typed discriminated unions for dialog events.
5
+ * These types are shared between backend and frontend for real-time dialog communication.
6
+ */
7
+ import type { ContextHealthSnapshot } from './context-health';
8
+ import type { DialogDisplayState, DialogInterruptionReason } from './display-state';
9
+ import type { LanguageCode } from './language';
10
+ import type { AssignmentCourseNumber, AssignmentGenerationSeqNumber, CalleeCourseNumber, CalleeGenerationSeqNumber, CallerCourseNumber, CallingCourseNumber, CallingGenerationSeqNumber, DialogCourseNumber, FuncResultContentItem } from './storage';
11
+ export interface DialogDisplayStateEvent {
12
+ type: 'dlg_display_state_evt';
13
+ displayState: DialogDisplayState;
14
+ }
15
+ export interface DialogTouchedEvent {
16
+ type: 'dlg_touched_evt';
17
+ sourceType: string;
18
+ }
19
+ export interface DiligenceBudgetEvent {
20
+ type: 'diligence_budget_evt';
21
+ maxInjectCount: number;
22
+ injectedCount: number;
23
+ remainingCount: number;
24
+ disableDiligencePush: boolean;
25
+ }
26
+ export interface DialogDisplayStateMarkerEvent {
27
+ type: 'dlg_display_state_marker_evt';
28
+ kind: 'interrupted' | 'resumed';
29
+ reason?: DialogInterruptionReason;
30
+ }
31
+ export interface SubdialogEvent extends DialogEventBase {
32
+ type: 'subdialog_created_evt';
33
+ course: number;
34
+ parentDialog: {
35
+ selfId: string;
36
+ rootId: string;
37
+ };
38
+ subDialog: {
39
+ selfId: string;
40
+ rootId: string;
41
+ };
42
+ targetAgentId: string;
43
+ callName: 'tellask' | 'tellaskSessionless' | 'freshBootsReasoning';
44
+ mentionList?: string[];
45
+ tellaskContent: string;
46
+ subDialogNode: {
47
+ selfId: string;
48
+ rootId: string;
49
+ supdialogId: string;
50
+ agentId: string;
51
+ taskDocPath: string;
52
+ status: 'running' | 'completed' | 'archived';
53
+ currentCourse: number;
54
+ createdAt: string;
55
+ lastModified: string;
56
+ displayState?: DialogDisplayState;
57
+ sessionSlug?: string;
58
+ assignmentFromSup?: {
59
+ callName: 'tellask' | 'tellaskSessionless' | 'freshBootsReasoning';
60
+ mentionList?: string[];
61
+ tellaskContent: string;
62
+ originMemberId: string;
63
+ callerDialogId: string;
64
+ callId: string;
65
+ };
66
+ };
67
+ genseq?: number;
68
+ }
69
+ export interface StreamErrorEvent {
70
+ type: 'stream_error_evt';
71
+ course: number;
72
+ error: string;
73
+ genseq?: number;
74
+ }
75
+ export type LlmRetryEvent = LlmGenDlgEvent & {
76
+ type: 'llm_retry_evt';
77
+ phase: 'waiting' | 'running' | 'exhausted';
78
+ provider: string;
79
+ attempt: number;
80
+ totalAttempts: number;
81
+ maxRetries: number;
82
+ retriesRemaining: number;
83
+ backoffMs?: number;
84
+ failureKind: 'retriable' | 'rejected' | 'fatal';
85
+ status?: number;
86
+ code?: string;
87
+ error: string;
88
+ suggestion?: string;
89
+ };
90
+ export type GeneratingStartEvent = LlmGenDlgEvent & {
91
+ type: 'generating_start_evt';
92
+ msgId?: string;
93
+ };
94
+ export type GeneratingFinishEvent = LlmGenDlgEvent & {
95
+ type: 'generating_finish_evt';
96
+ llmGenModel?: string;
97
+ };
98
+ export type ContextHealthEvent = LlmGenDlgEvent & {
99
+ type: 'context_health_evt';
100
+ contextHealth: ContextHealthSnapshot;
101
+ };
102
+ export type ThinkingStartEvent = LlmGenDlgEvent & {
103
+ type: 'thinking_start_evt';
104
+ };
105
+ export type ThinkingChunkEvent = LlmGenDlgEvent & {
106
+ type: 'thinking_chunk_evt';
107
+ chunk: string;
108
+ };
109
+ export type ThinkingFinishEvent = LlmGenDlgEvent & {
110
+ type: 'thinking_finish_evt';
111
+ };
112
+ export type SayingStartEvent = LlmGenDlgEvent & {
113
+ type: 'saying_start_evt';
114
+ };
115
+ export type SayingFinishEvent = LlmGenDlgEvent & {
116
+ type: 'saying_finish_evt';
117
+ };
118
+ export type MarkdownStartEvent = LlmGenDlgEvent & {
119
+ type: 'markdown_start_evt';
120
+ };
121
+ export type MarkdownChunkEvent = LlmGenDlgEvent & {
122
+ type: 'markdown_chunk_evt';
123
+ chunk: string;
124
+ };
125
+ export type MarkdownFinishEvent = LlmGenDlgEvent & {
126
+ type: 'markdown_finish_evt';
127
+ };
128
+ export type FuncCallStartEvent = LlmGenDlgEvent & {
129
+ type: 'func_call_requested_evt';
130
+ funcName: string;
131
+ funcId: string;
132
+ arguments: string;
133
+ course: number;
134
+ genseq: number;
135
+ };
136
+ export interface FunctionResultEvent {
137
+ type: 'func_result_evt';
138
+ id: string;
139
+ name: string;
140
+ content: string;
141
+ contentItems?: FuncResultContentItem[];
142
+ course: number;
143
+ genseq?: number;
144
+ }
145
+ export type WebSearchCallAction = {
146
+ type: 'search';
147
+ query?: string;
148
+ } | {
149
+ type: 'open_page';
150
+ url?: string;
151
+ } | {
152
+ type: 'find_in_page';
153
+ url?: string;
154
+ pattern?: string;
155
+ };
156
+ export type WebSearchCallEvent = LlmGenDlgEvent & {
157
+ type: 'web_search_call_evt';
158
+ phase: 'added' | 'done';
159
+ itemId: string;
160
+ status?: string;
161
+ action?: WebSearchCallAction;
162
+ };
163
+ export type GenerationDiscardEvent = LlmGenDlgEvent & {
164
+ type: 'genseq_discard_evt';
165
+ reason: 'retry';
166
+ };
167
+ export type TellaskCallStartEvent = (LlmGenDlgEvent & {
168
+ type: 'tellask_call_start_evt';
169
+ callName: 'tellask';
170
+ callId: string;
171
+ mentionList: string[];
172
+ sessionSlug: string;
173
+ tellaskContent: string;
174
+ }) | (LlmGenDlgEvent & {
175
+ type: 'tellask_call_start_evt';
176
+ callName: 'tellaskSessionless';
177
+ callId: string;
178
+ mentionList: string[];
179
+ tellaskContent: string;
180
+ }) | (LlmGenDlgEvent & {
181
+ type: 'tellask_call_start_evt';
182
+ callName: 'tellaskBack' | 'askHuman' | 'freshBootsReasoning';
183
+ callId: string;
184
+ tellaskContent: string;
185
+ });
186
+ export type TellaskCallResultEvent = {
187
+ type: 'tellask_call_result_evt';
188
+ course: number;
189
+ calling_genseq?: CallingGenerationSeqNumber;
190
+ responderId: string;
191
+ callName: 'tellask' | 'tellaskSessionless';
192
+ mentionList: string[];
193
+ tellaskContent: string;
194
+ status: 'completed' | 'failed';
195
+ result: string;
196
+ callId: string;
197
+ } | {
198
+ type: 'tellask_call_result_evt';
199
+ course: number;
200
+ calling_genseq?: CallingGenerationSeqNumber;
201
+ responderId: string;
202
+ callName: 'tellaskBack' | 'askHuman' | 'freshBootsReasoning';
203
+ tellaskContent: string;
204
+ status: 'completed' | 'failed';
205
+ result: string;
206
+ callId: string;
207
+ };
208
+ export interface TellaskCallCarryoverEvent {
209
+ type: 'tellask_call_carryover_evt';
210
+ course: number;
211
+ responderId: string;
212
+ status: 'completed' | 'failed';
213
+ callId: string;
214
+ carryoverCourse: DialogCourseNumber;
215
+ }
216
+ export interface TellaskCallAnchorEvent {
217
+ type: 'tellask_call_anchor_evt';
218
+ course: number;
219
+ genseq: number;
220
+ anchorRole: 'assignment' | 'response';
221
+ callId: string;
222
+ assignmentCourse?: AssignmentCourseNumber;
223
+ assignmentGenseq?: AssignmentGenerationSeqNumber;
224
+ callerDialogId?: string;
225
+ callerCourse?: CallerCourseNumber;
226
+ }
227
+ export interface ReminderContent {
228
+ content: string;
229
+ meta?: Record<string, unknown>;
230
+ reminder_no?: number;
231
+ echoback?: boolean;
232
+ }
233
+ export interface FullRemindersEvent {
234
+ type: 'full_reminders_update';
235
+ reminders: ReminderContent[];
236
+ }
237
+ export type TellaskResponseEvent = {
238
+ type: 'tellask_response_evt';
239
+ course: number;
240
+ calling_genseq?: CallingGenerationSeqNumber;
241
+ responderId: string;
242
+ calleeDialogId?: string;
243
+ calleeCourse?: CalleeCourseNumber;
244
+ calleeGenseq?: CalleeGenerationSeqNumber;
245
+ callName: 'tellask';
246
+ sessionSlug: string;
247
+ mentionList: string[];
248
+ tellaskContent: string;
249
+ status: 'completed' | 'failed';
250
+ response: string;
251
+ agentId: string;
252
+ callId: string;
253
+ originMemberId: string;
254
+ } | {
255
+ type: 'tellask_response_evt';
256
+ course: number;
257
+ calling_genseq?: CallingGenerationSeqNumber;
258
+ responderId: string;
259
+ calleeDialogId?: string;
260
+ calleeCourse?: CalleeCourseNumber;
261
+ calleeGenseq?: CalleeGenerationSeqNumber;
262
+ callName: 'tellaskSessionless';
263
+ mentionList: string[];
264
+ tellaskContent: string;
265
+ status: 'completed' | 'failed';
266
+ response: string;
267
+ agentId: string;
268
+ callId: string;
269
+ originMemberId: string;
270
+ } | {
271
+ type: 'tellask_response_evt';
272
+ course: number;
273
+ calling_genseq?: CallingGenerationSeqNumber;
274
+ responderId: string;
275
+ calleeDialogId?: string;
276
+ calleeCourse?: CalleeCourseNumber;
277
+ calleeGenseq?: CalleeGenerationSeqNumber;
278
+ callName: 'tellaskBack' | 'freshBootsReasoning';
279
+ tellaskContent: string;
280
+ status: 'completed' | 'failed';
281
+ response: string;
282
+ agentId: string;
283
+ callId: string;
284
+ originMemberId: string;
285
+ };
286
+ export type TellaskCarryoverResultEvent = {
287
+ type: 'tellask_carryover_result_evt';
288
+ course: number;
289
+ originCourse: CallingCourseNumber;
290
+ responderId: string;
291
+ callName: 'tellask';
292
+ sessionSlug: string;
293
+ mentionList: string[];
294
+ tellaskContent: string;
295
+ status: 'completed' | 'failed';
296
+ response: string;
297
+ content: string;
298
+ agentId: string;
299
+ callId: string;
300
+ originMemberId: string;
301
+ calleeDialogId?: string;
302
+ calleeCourse?: CalleeCourseNumber;
303
+ calleeGenseq?: CalleeGenerationSeqNumber;
304
+ } | {
305
+ type: 'tellask_carryover_result_evt';
306
+ course: number;
307
+ originCourse: CallingCourseNumber;
308
+ responderId: string;
309
+ callName: 'tellaskSessionless';
310
+ mentionList: string[];
311
+ tellaskContent: string;
312
+ status: 'completed' | 'failed';
313
+ response: string;
314
+ content: string;
315
+ agentId: string;
316
+ callId: string;
317
+ originMemberId: string;
318
+ calleeDialogId?: string;
319
+ calleeCourse?: CalleeCourseNumber;
320
+ calleeGenseq?: CalleeGenerationSeqNumber;
321
+ } | {
322
+ type: 'tellask_carryover_result_evt';
323
+ course: number;
324
+ originCourse: CallingCourseNumber;
325
+ responderId: string;
326
+ callName: 'freshBootsReasoning';
327
+ tellaskContent: string;
328
+ status: 'completed' | 'failed';
329
+ response: string;
330
+ content: string;
331
+ agentId: string;
332
+ callId: string;
333
+ originMemberId: string;
334
+ calleeDialogId?: string;
335
+ calleeCourse?: CalleeCourseNumber;
336
+ calleeGenseq?: CalleeGenerationSeqNumber;
337
+ };
338
+ export interface EndOfUserSayingEvent {
339
+ type: 'end_of_user_saying_evt';
340
+ course: number;
341
+ genseq: number;
342
+ msgId: string;
343
+ content: string;
344
+ grammar: 'markdown';
345
+ origin: 'user' | 'diligence_push' | 'runtime';
346
+ userLanguageCode?: LanguageCode;
347
+ q4hAnswerCallIds?: string[];
348
+ }
349
+ export interface QueueUserMsgEvent {
350
+ type: 'queue_user_msg_evt';
351
+ course: number;
352
+ msgId: string;
353
+ content: string;
354
+ grammar: 'markdown';
355
+ origin?: 'user' | 'diligence_push' | 'runtime';
356
+ userLanguageCode?: LanguageCode;
357
+ }
358
+ export interface CourseEvent {
359
+ type: 'course_update';
360
+ course: number;
361
+ totalCourses: number;
362
+ }
363
+ export interface NewQ4HAskedEvent {
364
+ type: 'new_q4h_asked';
365
+ question: {
366
+ id: string;
367
+ selfId: string;
368
+ tellaskContent: string;
369
+ askedAt: string;
370
+ callId?: string;
371
+ remainingCallIds?: string[];
372
+ callSiteRef: {
373
+ course: number;
374
+ messageIndex: number;
375
+ };
376
+ rootId: string;
377
+ agentId: string;
378
+ taskDocPath: string;
379
+ };
380
+ }
381
+ export interface Q4HAnsweredEvent {
382
+ type: 'q4h_answered';
383
+ questionId: string;
384
+ selfId: string;
385
+ }
386
+ export interface DialogEventBase {
387
+ dialog: {
388
+ selfId: string;
389
+ rootId: string;
390
+ };
391
+ timestamp: string;
392
+ }
393
+ export interface LlmGenDlgEvent {
394
+ course: number;
395
+ genseq: number;
396
+ }
397
+ export type TypedDialogEvent = DialogEvent & DialogEventBase;
398
+ export type DialogEvent = DialogTouchedEvent | GeneratingStartEvent | GeneratingFinishEvent | ContextHealthEvent | DialogDisplayStateEvent | DialogDisplayStateMarkerEvent | DiligenceBudgetEvent | ThinkingStartEvent | ThinkingChunkEvent | ThinkingFinishEvent | SayingStartEvent | SayingFinishEvent | MarkdownStartEvent | MarkdownChunkEvent | MarkdownFinishEvent | FuncCallStartEvent | FunctionResultEvent | WebSearchCallEvent | GenerationDiscardEvent | TellaskCallStartEvent | TellaskCallResultEvent | TellaskCallCarryoverEvent | TellaskCallAnchorEvent | TellaskResponseEvent | TellaskCarryoverResultEvent | SubdialogEvent | QueueUserMsgEvent | EndOfUserSayingEvent | FullRemindersEvent | CourseEvent | NewQ4HAskedEvent | Q4HAnsweredEvent | StreamErrorEvent | LlmRetryEvent;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Module: kernel/types/dialog
4
+ *
5
+ * Strongly typed discriminated unions for dialog events.
6
+ * These types are shared between backend and frontend for real-time dialog communication.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,43 @@
1
+ export type DialogInterruptionReason = {
2
+ kind: 'user_stop';
3
+ } | {
4
+ kind: 'emergency_stop';
5
+ } | {
6
+ kind: 'server_restart';
7
+ } | {
8
+ kind: 'system_stop';
9
+ detail: string;
10
+ };
11
+ export type DialogBlockedReason = {
12
+ kind: 'needs_human_input';
13
+ } | {
14
+ kind: 'waiting_for_subdialogs';
15
+ } | {
16
+ kind: 'needs_human_input_and_subdialogs';
17
+ };
18
+ export type DialogDeadReason = {
19
+ kind: 'declared_by_user';
20
+ } | {
21
+ kind: 'system';
22
+ detail: string;
23
+ };
24
+ export type DialogDisplayState = {
25
+ kind: 'idle_waiting_user';
26
+ } | {
27
+ kind: 'proceeding';
28
+ } | {
29
+ kind: 'proceeding_stop_requested';
30
+ reason: 'user_stop' | 'emergency_stop';
31
+ } | {
32
+ kind: 'interrupted';
33
+ reason: DialogInterruptionReason;
34
+ } | {
35
+ kind: 'blocked';
36
+ reason: DialogBlockedReason;
37
+ } | {
38
+ kind: 'dead';
39
+ reason: DialogDeadReason;
40
+ } | {
41
+ kind: 'terminal';
42
+ status: 'completed' | 'archived';
43
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import type { LanguageCode } from './language';
2
+ export type I18nText = Record<LanguageCode, string>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export declare const supportedLanguageCodes: readonly ["en", "zh"];
2
+ export type LanguageCode = (typeof supportedLanguageCodes)[number];
3
+ export declare function isLanguageCode(value: string): value is LanguageCode;
4
+ export declare function normalizeLanguageCode(input: string): LanguageCode | null;
5
+ export declare function formatLanguageName(lang: LanguageCode, inLanguage: LanguageCode): string;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supportedLanguageCodes = void 0;
4
+ exports.isLanguageCode = isLanguageCode;
5
+ exports.normalizeLanguageCode = normalizeLanguageCode;
6
+ exports.formatLanguageName = formatLanguageName;
7
+ exports.supportedLanguageCodes = ['en', 'zh'];
8
+ function isLanguageCode(value) {
9
+ return exports.supportedLanguageCodes.includes(value);
10
+ }
11
+ function normalizeLanguageCode(input) {
12
+ const raw = input.trim();
13
+ if (raw === '')
14
+ return null;
15
+ const lowered = raw.replace(/_/g, '-').toLowerCase();
16
+ if (lowered === 'en' || lowered.startsWith('en-'))
17
+ return 'en';
18
+ if (lowered === 'zh' || lowered.startsWith('zh-'))
19
+ return 'zh';
20
+ return null;
21
+ }
22
+ function formatLanguageName(lang, inLanguage) {
23
+ switch (inLanguage) {
24
+ case 'en': {
25
+ return lang === 'en' ? 'English' : 'Simplified Chinese';
26
+ }
27
+ case 'zh': {
28
+ return lang === 'en' ? '英语' : '简体中文';
29
+ }
30
+ default: {
31
+ const exhaustiveCheck = inLanguage;
32
+ throw new Error(`Unsupported inLanguage: ${exhaustiveCheck}`);
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,55 @@
1
+ import type { DialogStatusKind } from './wire';
2
+ export type PrimingScriptScope = 'individual' | 'team_shared';
3
+ export type PrimingScriptSummary = {
4
+ ref: string;
5
+ scope: PrimingScriptScope;
6
+ slug: string;
7
+ title?: string;
8
+ path: string;
9
+ updatedAt: string;
10
+ ownerAgentId?: string;
11
+ };
12
+ export type PrimingScriptLoadWarning = {
13
+ path: string;
14
+ error: string;
15
+ };
16
+ export type PrimingScriptWarningSummary = {
17
+ skippedCount: number;
18
+ samples: PrimingScriptLoadWarning[];
19
+ };
20
+ export type ListPrimingScriptsResponse = {
21
+ success: true;
22
+ recent: PrimingScriptSummary[];
23
+ warningSummary?: PrimingScriptWarningSummary;
24
+ } | {
25
+ success: false;
26
+ error: string;
27
+ };
28
+ export type SearchPrimingScriptsResponse = {
29
+ success: true;
30
+ scripts: PrimingScriptSummary[];
31
+ warningSummary?: PrimingScriptWarningSummary;
32
+ } | {
33
+ success: false;
34
+ error: string;
35
+ };
36
+ export type SaveCurrentCoursePrimingRequest = {
37
+ dialog: {
38
+ rootId: string;
39
+ selfId: string;
40
+ status?: DialogStatusKind;
41
+ };
42
+ course: number;
43
+ slug: string;
44
+ overwrite?: boolean;
45
+ };
46
+ export type SaveCurrentCoursePrimingResponse = {
47
+ success: true;
48
+ script: PrimingScriptSummary;
49
+ messageCount: number;
50
+ path: string;
51
+ } | {
52
+ success: false;
53
+ error: string;
54
+ errorCode?: 'ALREADY_EXISTS' | 'INVALID_REQUEST' | 'INTERNAL_ERROR';
55
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,128 @@
1
+ export type ProblemSeverity = 'info' | 'warning' | 'error';
2
+ export type WorkspaceProblemLifecycle = Readonly<{
3
+ occurredAt?: string;
4
+ resolved?: boolean;
5
+ resolvedAt?: string | null;
6
+ }>;
7
+ export type WorkspaceProblem = {
8
+ kind: 'mcp_workspace_config_error';
9
+ source: 'mcp';
10
+ id: string;
11
+ severity: 'error';
12
+ timestamp: string;
13
+ message: string;
14
+ detail: {
15
+ filePath: string;
16
+ errorText: string;
17
+ };
18
+ } | {
19
+ kind: 'team_workspace_config_error';
20
+ source: 'team';
21
+ id: string;
22
+ severity: 'error' | 'warning';
23
+ timestamp: string;
24
+ message: string;
25
+ detail: {
26
+ filePath: string;
27
+ errorText: string;
28
+ };
29
+ } | {
30
+ kind: 'mcp_server_error';
31
+ source: 'mcp';
32
+ id: string;
33
+ severity: 'error';
34
+ timestamp: string;
35
+ message: string;
36
+ detail: {
37
+ serverId: string;
38
+ errorText: string;
39
+ };
40
+ } | {
41
+ kind: 'mcp_tool_collision';
42
+ source: 'mcp';
43
+ id: string;
44
+ severity: 'warning';
45
+ timestamp: string;
46
+ message: string;
47
+ detail: {
48
+ serverId: string;
49
+ toolName: string;
50
+ domindsToolName: string;
51
+ };
52
+ } | {
53
+ kind: 'mcp_tool_blacklisted';
54
+ source: 'mcp';
55
+ id: string;
56
+ severity: 'info' | 'warning';
57
+ timestamp: string;
58
+ message: string;
59
+ detail: {
60
+ serverId: string;
61
+ toolName: string;
62
+ pattern: string;
63
+ };
64
+ } | {
65
+ kind: 'mcp_tool_not_whitelisted';
66
+ source: 'mcp';
67
+ id: string;
68
+ severity: 'info' | 'warning';
69
+ timestamp: string;
70
+ message: string;
71
+ detail: {
72
+ serverId: string;
73
+ toolName: string;
74
+ pattern: string;
75
+ };
76
+ } | {
77
+ kind: 'mcp_tool_invalid_name';
78
+ source: 'mcp';
79
+ id: string;
80
+ severity: 'warning';
81
+ timestamp: string;
82
+ message: string;
83
+ detail: {
84
+ serverId: string;
85
+ toolName: string;
86
+ rule: string;
87
+ };
88
+ } | {
89
+ kind: 'llm_provider_rejected_request';
90
+ source: 'llm';
91
+ id: string;
92
+ severity: 'error';
93
+ timestamp: string;
94
+ message: string;
95
+ detail: {
96
+ dialogId: string;
97
+ provider: string;
98
+ errorText: string;
99
+ };
100
+ } | {
101
+ kind: 'generic_problem';
102
+ source: 'system';
103
+ id: string;
104
+ severity: ProblemSeverity;
105
+ timestamp: string;
106
+ message: string;
107
+ detail: {
108
+ text: string;
109
+ };
110
+ };
111
+ export type WorkspaceProblemRecord = WorkspaceProblem & WorkspaceProblemLifecycle;
112
+ export interface GetProblemsRequest {
113
+ type: 'get_problems';
114
+ }
115
+ export interface ClearResolvedProblemsRequest {
116
+ type: 'clear_resolved_problems';
117
+ }
118
+ export interface ClearResolvedProblemsResultMessage {
119
+ type: 'clear_resolved_problems_result';
120
+ removedCount: number;
121
+ timestamp: string;
122
+ }
123
+ export interface ProblemsSnapshotMessage {
124
+ type: 'problems_snapshot';
125
+ version: number;
126
+ problems: WorkspaceProblemRecord[];
127
+ timestamp: string;
128
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });