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.
- package/LICENSE +1 -0
- package/README.md +3 -0
- package/dist/app-host-contract.d.ts +87 -0
- package/dist/app-host-contract.js +2 -0
- package/dist/app-json.d.ts +139 -0
- package/dist/app-json.js +234 -0
- package/dist/diligence.d.ts +3 -0
- package/dist/diligence.js +64 -0
- package/dist/evt.d.ts +40 -0
- package/dist/evt.js +142 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +25 -0
- package/dist/team-mgmt-manual.d.ts +20 -0
- package/dist/team-mgmt-manual.js +121 -0
- package/dist/types/context-health.d.ts +33 -0
- package/dist/types/context-health.js +2 -0
- package/dist/types/dialog.d.ts +398 -0
- package/dist/types/dialog.js +8 -0
- package/dist/types/display-state.d.ts +43 -0
- package/dist/types/display-state.js +2 -0
- package/dist/types/i18n.d.ts +2 -0
- package/dist/types/i18n.js +2 -0
- package/dist/types/language.d.ts +5 -0
- package/dist/types/language.js +35 -0
- package/dist/types/priming.d.ts +55 -0
- package/dist/types/priming.js +2 -0
- package/dist/types/problems.d.ts +128 -0
- package/dist/types/problems.js +2 -0
- package/dist/types/q4h.d.ts +9 -0
- package/dist/types/q4h.js +2 -0
- package/dist/types/setup.d.ts +170 -0
- package/dist/types/setup.js +2 -0
- package/dist/types/snippets.d.ts +68 -0
- package/dist/types/snippets.js +2 -0
- package/dist/types/storage.d.ts +561 -0
- package/dist/types/storage.js +85 -0
- package/dist/types/tools-registry.d.ts +19 -0
- package/dist/types/tools-registry.js +2 -0
- package/dist/types/wire.d.ts +227 -0
- package/dist/types/wire.js +18 -0
- package/dist/types.d.ts +112 -0
- package/dist/types.js +28 -0
- package/dist/utils/html.d.ts +2 -0
- package/dist/utils/html.js +20 -0
- package/dist/utils/id.d.ts +1 -0
- package/dist/utils/id.js +6 -0
- package/dist/utils/time.d.ts +1 -0
- package/dist/utils/time.js +13 -0
- package/package.json +84 -0
- package/src/app-host-contract.ts +105 -0
- package/src/app-json.ts +401 -0
- package/src/diligence.ts +64 -0
- package/src/evt.ts +156 -0
- package/src/index.ts +48 -0
- package/src/team-mgmt-manual.ts +151 -0
- package/src/types/context-health.ts +39 -0
- package/src/types/dialog.ts +487 -0
- package/src/types/display-state.ts +21 -0
- package/src/types/i18n.ts +3 -0
- package/src/types/language.ts +33 -0
- package/src/types/priming.ts +69 -0
- package/src/types/problems.ts +144 -0
- package/src/types/q4h.ts +11 -0
- package/src/types/setup.ts +140 -0
- package/src/types/snippets.ts +55 -0
- package/src/types/storage.ts +682 -0
- package/src/types/tools-registry.ts +24 -0
- package/src/types/wire.ts +335 -0
- package/src/types.ts +133 -0
- package/src/utils/html.ts +17 -0
- package/src/utils/id.ts +3 -0
- package/src/utils/time.ts +10 -0
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module: kernel/types/storage
|
|
3
|
+
*
|
|
4
|
+
* Strongly typed disk storage formats for dialog persistence.
|
|
5
|
+
* Uses modern TypeScript patterns for statically verifiable field access.
|
|
6
|
+
*/
|
|
7
|
+
import type { ContextHealthSnapshot } from './context-health';
|
|
8
|
+
import type { DialogDeadReason, DialogDisplayState, DialogInterruptionReason } from './display-state';
|
|
9
|
+
import type { LanguageCode } from './language';
|
|
10
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
11
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
12
|
+
export type JsonObject = {
|
|
13
|
+
[key: string]: JsonValue;
|
|
14
|
+
};
|
|
15
|
+
export type JsonArray = JsonValue[];
|
|
16
|
+
export type ProviderData = JsonObject;
|
|
17
|
+
export type ToolArguments = JsonObject;
|
|
18
|
+
export type ReasoningSummaryItem = {
|
|
19
|
+
type: 'summary_text';
|
|
20
|
+
text: string;
|
|
21
|
+
};
|
|
22
|
+
export type ReasoningContentItem = {
|
|
23
|
+
type: 'reasoning_text';
|
|
24
|
+
text: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'text';
|
|
27
|
+
text: string;
|
|
28
|
+
};
|
|
29
|
+
export interface ReasoningPayload {
|
|
30
|
+
summary: ReasoningSummaryItem[];
|
|
31
|
+
content?: ReasoningContentItem[];
|
|
32
|
+
encrypted_content?: string;
|
|
33
|
+
}
|
|
34
|
+
export type FuncResultContentItem = {
|
|
35
|
+
type: 'input_text';
|
|
36
|
+
text: string;
|
|
37
|
+
} | {
|
|
38
|
+
type: 'input_image';
|
|
39
|
+
mimeType: string;
|
|
40
|
+
byteLength: number;
|
|
41
|
+
artifact: {
|
|
42
|
+
rootId: string;
|
|
43
|
+
selfId: string;
|
|
44
|
+
status: 'running' | 'completed' | 'archived';
|
|
45
|
+
relPath: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export interface RootDialogMetadataFile {
|
|
49
|
+
id: string;
|
|
50
|
+
agentId: string;
|
|
51
|
+
taskDocPath: string;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
supdialogId?: undefined;
|
|
54
|
+
sessionSlug?: undefined;
|
|
55
|
+
assignmentFromSup?: undefined;
|
|
56
|
+
priming?: {
|
|
57
|
+
scriptRefs: string[];
|
|
58
|
+
showInUi: boolean;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export interface SubdialogMetadataFile {
|
|
62
|
+
id: string;
|
|
63
|
+
agentId: string;
|
|
64
|
+
taskDocPath: string;
|
|
65
|
+
createdAt: string;
|
|
66
|
+
supdialogId: string;
|
|
67
|
+
sessionSlug?: string;
|
|
68
|
+
assignmentFromSup: {
|
|
69
|
+
callName: 'tellask' | 'tellaskSessionless' | 'freshBootsReasoning';
|
|
70
|
+
mentionList?: string[];
|
|
71
|
+
tellaskContent: string;
|
|
72
|
+
originMemberId: string;
|
|
73
|
+
callerDialogId: string;
|
|
74
|
+
callId: string;
|
|
75
|
+
collectiveTargets?: string[];
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export type DialogMetadataFile = RootDialogMetadataFile | SubdialogMetadataFile;
|
|
79
|
+
export interface DialogLatestFile {
|
|
80
|
+
currentCourse: number;
|
|
81
|
+
lastModified: string;
|
|
82
|
+
messageCount?: number;
|
|
83
|
+
functionCallCount?: number;
|
|
84
|
+
subdialogCount?: number;
|
|
85
|
+
status: 'active' | 'completed' | 'archived';
|
|
86
|
+
generating?: boolean;
|
|
87
|
+
needsDrive?: boolean;
|
|
88
|
+
displayState?: DialogDisplayState;
|
|
89
|
+
executionMarker?: DialogExecutionMarker;
|
|
90
|
+
disableDiligencePush?: boolean;
|
|
91
|
+
diligencePushRemainingBudget?: number;
|
|
92
|
+
}
|
|
93
|
+
export type DialogExecutionMarker = {
|
|
94
|
+
kind: 'interrupted';
|
|
95
|
+
reason: DialogInterruptionReason;
|
|
96
|
+
} | {
|
|
97
|
+
kind: 'dead';
|
|
98
|
+
reason: DialogDeadReason;
|
|
99
|
+
};
|
|
100
|
+
export interface CourseMetadataFile {
|
|
101
|
+
course: number;
|
|
102
|
+
startedAt: string;
|
|
103
|
+
completedAt?: string;
|
|
104
|
+
messageCount: number;
|
|
105
|
+
functionCallCount: number;
|
|
106
|
+
subdialogCount: number;
|
|
107
|
+
status: 'active' | 'completed';
|
|
108
|
+
taskDoc?: string;
|
|
109
|
+
}
|
|
110
|
+
export type RootCourseNumber = number & {
|
|
111
|
+
readonly __rootCourseBrand: unique symbol;
|
|
112
|
+
};
|
|
113
|
+
export type RootGenerationSeqNumber = number & {
|
|
114
|
+
readonly __rootGenerationSeqBrand: unique symbol;
|
|
115
|
+
};
|
|
116
|
+
export type DialogCourseNumber = number & {
|
|
117
|
+
readonly __dialogCourseBrand: unique symbol;
|
|
118
|
+
};
|
|
119
|
+
export type CallingCourseNumber = number & {
|
|
120
|
+
readonly __callingCourseBrand: unique symbol;
|
|
121
|
+
};
|
|
122
|
+
export type CallingGenerationSeqNumber = number & {
|
|
123
|
+
readonly __callingGenerationSeqBrand: unique symbol;
|
|
124
|
+
};
|
|
125
|
+
export type AssignmentCourseNumber = number & {
|
|
126
|
+
readonly __assignmentCourseBrand: unique symbol;
|
|
127
|
+
};
|
|
128
|
+
export type AssignmentGenerationSeqNumber = number & {
|
|
129
|
+
readonly __assignmentGenerationSeqBrand: unique symbol;
|
|
130
|
+
};
|
|
131
|
+
export type CallerCourseNumber = number & {
|
|
132
|
+
readonly __callerCourseBrand: unique symbol;
|
|
133
|
+
};
|
|
134
|
+
export type CalleeCourseNumber = number & {
|
|
135
|
+
readonly __calleeCourseBrand: unique symbol;
|
|
136
|
+
};
|
|
137
|
+
export type CalleeGenerationSeqNumber = number & {
|
|
138
|
+
readonly __calleeGenerationSeqBrand: unique symbol;
|
|
139
|
+
};
|
|
140
|
+
export interface RootGenerationAnchor {
|
|
141
|
+
rootCourse: RootCourseNumber;
|
|
142
|
+
rootGenseq: RootGenerationSeqNumber;
|
|
143
|
+
}
|
|
144
|
+
export type ReconciledRecordWriteTarget = {
|
|
145
|
+
kind: 'dialog_course';
|
|
146
|
+
rootAnchor: RootGenerationAnchor;
|
|
147
|
+
dialogCourse: DialogCourseNumber;
|
|
148
|
+
} | {
|
|
149
|
+
kind: 'root_anchor';
|
|
150
|
+
rootAnchor: RootGenerationAnchor;
|
|
151
|
+
};
|
|
152
|
+
export interface RootGenerationRef {
|
|
153
|
+
rootCourse?: RootCourseNumber;
|
|
154
|
+
rootGenseq?: RootGenerationSeqNumber;
|
|
155
|
+
}
|
|
156
|
+
export declare function toRootCourseNumber(value: number): RootCourseNumber;
|
|
157
|
+
export declare function toRootGenerationSeqNumber(value: number): RootGenerationSeqNumber;
|
|
158
|
+
export declare function toDialogCourseNumber(value: number): DialogCourseNumber;
|
|
159
|
+
export declare function toCallingCourseNumber(value: number): CallingCourseNumber;
|
|
160
|
+
export declare function toCallingGenerationSeqNumber(value: number): CallingGenerationSeqNumber;
|
|
161
|
+
export declare function toAssignmentCourseNumber(value: number): AssignmentCourseNumber;
|
|
162
|
+
export declare function toAssignmentGenerationSeqNumber(value: number): AssignmentGenerationSeqNumber;
|
|
163
|
+
export declare function toCallerCourseNumber(value: number): CallerCourseNumber;
|
|
164
|
+
export declare function toCalleeCourseNumber(value: number): CalleeCourseNumber;
|
|
165
|
+
export declare function toCalleeGenerationSeqNumber(value: number): CalleeGenerationSeqNumber;
|
|
166
|
+
export declare function toRootGenerationAnchor(args: {
|
|
167
|
+
rootCourse: number;
|
|
168
|
+
rootGenseq: number;
|
|
169
|
+
}): RootGenerationAnchor;
|
|
170
|
+
export interface ReminderSnapshotItem {
|
|
171
|
+
content: string;
|
|
172
|
+
ownerName?: string;
|
|
173
|
+
meta?: JsonValue;
|
|
174
|
+
echoback?: boolean;
|
|
175
|
+
createdAt: string;
|
|
176
|
+
priority: 'high' | 'medium' | 'low';
|
|
177
|
+
}
|
|
178
|
+
export interface PendingSubdialogStateRecord {
|
|
179
|
+
subdialogId: string;
|
|
180
|
+
createdAt: string;
|
|
181
|
+
callName: 'tellask' | 'tellaskSessionless' | 'freshBootsReasoning';
|
|
182
|
+
mentionList?: string[];
|
|
183
|
+
tellaskContent: string;
|
|
184
|
+
targetAgentId: string;
|
|
185
|
+
callId: string;
|
|
186
|
+
callingCourse?: CallingCourseNumber;
|
|
187
|
+
callType: 'A' | 'B' | 'C';
|
|
188
|
+
sessionSlug?: string;
|
|
189
|
+
}
|
|
190
|
+
export interface SubdialogRegistryStateRecord {
|
|
191
|
+
key: string;
|
|
192
|
+
subdialogId: string;
|
|
193
|
+
agentId: string;
|
|
194
|
+
sessionSlug?: string;
|
|
195
|
+
}
|
|
196
|
+
export interface SubdialogResponseStateRecord {
|
|
197
|
+
responseId: string;
|
|
198
|
+
subdialogId: string;
|
|
199
|
+
response: string;
|
|
200
|
+
completedAt: string;
|
|
201
|
+
status?: 'completed' | 'failed';
|
|
202
|
+
callType: 'A' | 'B' | 'C';
|
|
203
|
+
callName: 'tellaskBack' | 'tellask' | 'tellaskSessionless' | 'freshBootsReasoning';
|
|
204
|
+
mentionList?: string[];
|
|
205
|
+
tellaskContent: string;
|
|
206
|
+
responderId: string;
|
|
207
|
+
originMemberId: string;
|
|
208
|
+
callId: string;
|
|
209
|
+
}
|
|
210
|
+
export interface AgentThoughtRecord extends RootGenerationRef {
|
|
211
|
+
ts: string;
|
|
212
|
+
type: 'agent_thought_record';
|
|
213
|
+
genseq: number;
|
|
214
|
+
content: string;
|
|
215
|
+
reasoning?: ReasoningPayload;
|
|
216
|
+
provider_data?: ProviderData;
|
|
217
|
+
sourceTag?: 'priming_script';
|
|
218
|
+
}
|
|
219
|
+
export interface AgentWordsRecord extends RootGenerationRef {
|
|
220
|
+
ts: string;
|
|
221
|
+
type: 'agent_words_record';
|
|
222
|
+
genseq: number;
|
|
223
|
+
content: string;
|
|
224
|
+
sourceTag?: 'priming_script';
|
|
225
|
+
}
|
|
226
|
+
export interface UiOnlyMarkdownRecord extends RootGenerationRef {
|
|
227
|
+
ts: string;
|
|
228
|
+
type: 'ui_only_markdown_record';
|
|
229
|
+
genseq: number;
|
|
230
|
+
content: string;
|
|
231
|
+
sourceTag?: 'priming_script';
|
|
232
|
+
}
|
|
233
|
+
export interface FuncCallRecord extends RootGenerationRef {
|
|
234
|
+
ts: string;
|
|
235
|
+
type: 'func_call_record';
|
|
236
|
+
genseq: number;
|
|
237
|
+
id: string;
|
|
238
|
+
name: string;
|
|
239
|
+
arguments: ToolArguments;
|
|
240
|
+
sourceTag?: 'priming_script';
|
|
241
|
+
}
|
|
242
|
+
export type WebSearchCallActionRecord = {
|
|
243
|
+
type: 'search';
|
|
244
|
+
query?: string;
|
|
245
|
+
} | {
|
|
246
|
+
type: 'open_page';
|
|
247
|
+
url?: string;
|
|
248
|
+
} | {
|
|
249
|
+
type: 'find_in_page';
|
|
250
|
+
url?: string;
|
|
251
|
+
pattern?: string;
|
|
252
|
+
};
|
|
253
|
+
export interface WebSearchCallRecord extends RootGenerationRef {
|
|
254
|
+
ts: string;
|
|
255
|
+
type: 'web_search_call_record';
|
|
256
|
+
genseq: number;
|
|
257
|
+
phase: 'added' | 'done';
|
|
258
|
+
itemId?: string;
|
|
259
|
+
status?: string;
|
|
260
|
+
action?: WebSearchCallActionRecord;
|
|
261
|
+
sourceTag?: 'priming_script';
|
|
262
|
+
}
|
|
263
|
+
export interface HumanTextRecord extends RootGenerationRef {
|
|
264
|
+
ts: string;
|
|
265
|
+
type: 'human_text_record';
|
|
266
|
+
genseq: number;
|
|
267
|
+
msgId: string;
|
|
268
|
+
content: string;
|
|
269
|
+
grammar: 'markdown';
|
|
270
|
+
origin?: 'user' | 'diligence_push' | 'runtime';
|
|
271
|
+
userLanguageCode?: LanguageCode;
|
|
272
|
+
sourceTag?: 'priming_script';
|
|
273
|
+
q4hAnswerCallIds?: string[];
|
|
274
|
+
}
|
|
275
|
+
export interface FuncResultRecord extends RootGenerationRef {
|
|
276
|
+
ts: string;
|
|
277
|
+
type: 'func_result_record';
|
|
278
|
+
genseq: number;
|
|
279
|
+
id: string;
|
|
280
|
+
name: string;
|
|
281
|
+
content: string;
|
|
282
|
+
contentItems?: FuncResultContentItem[];
|
|
283
|
+
sourceTag?: 'priming_script';
|
|
284
|
+
}
|
|
285
|
+
export interface QuestForSupRecord extends RootGenerationRef {
|
|
286
|
+
ts: string;
|
|
287
|
+
type: 'quest_for_sup_record';
|
|
288
|
+
genseq: number;
|
|
289
|
+
mentionList: string[];
|
|
290
|
+
tellaskContent: string;
|
|
291
|
+
subDialogId: string;
|
|
292
|
+
sourceTag?: 'priming_script';
|
|
293
|
+
}
|
|
294
|
+
export interface TellaskCallResultRecord extends RootGenerationRef {
|
|
295
|
+
ts: string;
|
|
296
|
+
type: 'tellask_call_result_record';
|
|
297
|
+
calling_genseq?: CallingGenerationSeqNumber;
|
|
298
|
+
responderId: string;
|
|
299
|
+
callName: 'tellaskBack' | 'tellask' | 'tellaskSessionless' | 'askHuman' | 'freshBootsReasoning';
|
|
300
|
+
mentionList?: string[];
|
|
301
|
+
tellaskContent: string;
|
|
302
|
+
status: 'completed' | 'failed';
|
|
303
|
+
result: string;
|
|
304
|
+
callId: string;
|
|
305
|
+
sourceTag?: 'priming_script';
|
|
306
|
+
}
|
|
307
|
+
export interface TellaskCallCarryoverRecord extends RootGenerationRef {
|
|
308
|
+
ts: string;
|
|
309
|
+
type: 'tellask_call_carryover_record';
|
|
310
|
+
responderId: string;
|
|
311
|
+
status: 'completed' | 'failed';
|
|
312
|
+
callId: string;
|
|
313
|
+
carryoverCourse: DialogCourseNumber;
|
|
314
|
+
sourceTag?: 'priming_script';
|
|
315
|
+
}
|
|
316
|
+
export interface TellaskCallAnchorRecord {
|
|
317
|
+
ts: string;
|
|
318
|
+
type: 'tellask_call_anchor_record';
|
|
319
|
+
rootCourse: RootCourseNumber;
|
|
320
|
+
rootGenseq: RootGenerationSeqNumber;
|
|
321
|
+
anchorRole: 'assignment' | 'response';
|
|
322
|
+
callId: string;
|
|
323
|
+
genseq: number;
|
|
324
|
+
assignmentCourse?: AssignmentCourseNumber;
|
|
325
|
+
assignmentGenseq?: AssignmentGenerationSeqNumber;
|
|
326
|
+
callerDialogId?: string;
|
|
327
|
+
callerCourse?: CallerCourseNumber;
|
|
328
|
+
sourceTag?: 'priming_script';
|
|
329
|
+
}
|
|
330
|
+
export type TellaskResponseRecord = (RootGenerationRef & {
|
|
331
|
+
ts: string;
|
|
332
|
+
type: 'tellask_response_record';
|
|
333
|
+
calling_genseq?: CallingGenerationSeqNumber;
|
|
334
|
+
responderId: string;
|
|
335
|
+
calleeDialogId?: string;
|
|
336
|
+
calleeCourse?: CalleeCourseNumber;
|
|
337
|
+
calleeGenseq?: CalleeGenerationSeqNumber;
|
|
338
|
+
callName: 'tellask';
|
|
339
|
+
sessionSlug: string;
|
|
340
|
+
mentionList: string[];
|
|
341
|
+
tellaskContent: string;
|
|
342
|
+
status: 'completed' | 'failed';
|
|
343
|
+
response: string;
|
|
344
|
+
agentId: string;
|
|
345
|
+
callId: string;
|
|
346
|
+
originMemberId: string;
|
|
347
|
+
sourceTag?: 'priming_script';
|
|
348
|
+
}) | (RootGenerationRef & {
|
|
349
|
+
ts: string;
|
|
350
|
+
type: 'tellask_response_record';
|
|
351
|
+
calling_genseq?: CallingGenerationSeqNumber;
|
|
352
|
+
responderId: string;
|
|
353
|
+
calleeDialogId?: string;
|
|
354
|
+
calleeCourse?: CalleeCourseNumber;
|
|
355
|
+
calleeGenseq?: CalleeGenerationSeqNumber;
|
|
356
|
+
callName: 'tellaskSessionless';
|
|
357
|
+
mentionList: string[];
|
|
358
|
+
tellaskContent: string;
|
|
359
|
+
status: 'completed' | 'failed';
|
|
360
|
+
response: string;
|
|
361
|
+
agentId: string;
|
|
362
|
+
callId: string;
|
|
363
|
+
originMemberId: string;
|
|
364
|
+
sourceTag?: 'priming_script';
|
|
365
|
+
}) | (RootGenerationRef & {
|
|
366
|
+
ts: string;
|
|
367
|
+
type: 'tellask_response_record';
|
|
368
|
+
calling_genseq?: CallingGenerationSeqNumber;
|
|
369
|
+
responderId: string;
|
|
370
|
+
calleeDialogId?: string;
|
|
371
|
+
calleeCourse?: CalleeCourseNumber;
|
|
372
|
+
calleeGenseq?: CalleeGenerationSeqNumber;
|
|
373
|
+
callName: 'tellaskBack' | 'freshBootsReasoning';
|
|
374
|
+
tellaskContent: string;
|
|
375
|
+
status: 'completed' | 'failed';
|
|
376
|
+
response: string;
|
|
377
|
+
agentId: string;
|
|
378
|
+
callId: string;
|
|
379
|
+
originMemberId: string;
|
|
380
|
+
sourceTag?: 'priming_script';
|
|
381
|
+
});
|
|
382
|
+
export type TellaskCarryoverResultRecord = (RootGenerationRef & {
|
|
383
|
+
ts: string;
|
|
384
|
+
type: 'tellask_carryover_result_record';
|
|
385
|
+
originCourse: CallingCourseNumber;
|
|
386
|
+
responderId: string;
|
|
387
|
+
callName: 'tellask';
|
|
388
|
+
sessionSlug: string;
|
|
389
|
+
mentionList: string[];
|
|
390
|
+
tellaskContent: string;
|
|
391
|
+
status: 'completed' | 'failed';
|
|
392
|
+
response: string;
|
|
393
|
+
content: string;
|
|
394
|
+
agentId: string;
|
|
395
|
+
callId: string;
|
|
396
|
+
originMemberId: string;
|
|
397
|
+
calleeDialogId?: string;
|
|
398
|
+
calleeCourse?: CalleeCourseNumber;
|
|
399
|
+
calleeGenseq?: CalleeGenerationSeqNumber;
|
|
400
|
+
sourceTag?: 'priming_script';
|
|
401
|
+
}) | (RootGenerationRef & {
|
|
402
|
+
ts: string;
|
|
403
|
+
type: 'tellask_carryover_result_record';
|
|
404
|
+
originCourse: CallingCourseNumber;
|
|
405
|
+
responderId: string;
|
|
406
|
+
callName: 'tellaskSessionless';
|
|
407
|
+
mentionList: string[];
|
|
408
|
+
tellaskContent: string;
|
|
409
|
+
status: 'completed' | 'failed';
|
|
410
|
+
response: string;
|
|
411
|
+
content: string;
|
|
412
|
+
agentId: string;
|
|
413
|
+
callId: string;
|
|
414
|
+
originMemberId: string;
|
|
415
|
+
calleeDialogId?: string;
|
|
416
|
+
calleeCourse?: CalleeCourseNumber;
|
|
417
|
+
calleeGenseq?: CalleeGenerationSeqNumber;
|
|
418
|
+
sourceTag?: 'priming_script';
|
|
419
|
+
}) | (RootGenerationRef & {
|
|
420
|
+
ts: string;
|
|
421
|
+
type: 'tellask_carryover_result_record';
|
|
422
|
+
originCourse: CallingCourseNumber;
|
|
423
|
+
responderId: string;
|
|
424
|
+
callName: 'freshBootsReasoning';
|
|
425
|
+
tellaskContent: string;
|
|
426
|
+
status: 'completed' | 'failed';
|
|
427
|
+
response: string;
|
|
428
|
+
content: string;
|
|
429
|
+
agentId: string;
|
|
430
|
+
callId: string;
|
|
431
|
+
originMemberId: string;
|
|
432
|
+
calleeDialogId?: string;
|
|
433
|
+
calleeCourse?: CalleeCourseNumber;
|
|
434
|
+
calleeGenseq?: CalleeGenerationSeqNumber;
|
|
435
|
+
sourceTag?: 'priming_script';
|
|
436
|
+
});
|
|
437
|
+
export interface GenStartRecord extends RootGenerationRef {
|
|
438
|
+
ts: string;
|
|
439
|
+
type: 'gen_start_record';
|
|
440
|
+
genseq: number;
|
|
441
|
+
sourceTag?: 'priming_script';
|
|
442
|
+
}
|
|
443
|
+
export interface GenFinishRecord extends RootGenerationRef {
|
|
444
|
+
ts: string;
|
|
445
|
+
type: 'gen_finish_record';
|
|
446
|
+
genseq: number;
|
|
447
|
+
contextHealth?: ContextHealthSnapshot;
|
|
448
|
+
llmGenModel?: string;
|
|
449
|
+
sourceTag?: 'priming_script';
|
|
450
|
+
}
|
|
451
|
+
export interface SubdialogCreatedRecord extends RootGenerationAnchor {
|
|
452
|
+
ts: string;
|
|
453
|
+
type: 'subdialog_created_record';
|
|
454
|
+
subdialogId: string;
|
|
455
|
+
supdialogId: string;
|
|
456
|
+
agentId: string;
|
|
457
|
+
taskDocPath: string;
|
|
458
|
+
createdAt: string;
|
|
459
|
+
sessionSlug?: string;
|
|
460
|
+
assignmentFromSup: {
|
|
461
|
+
callName: 'tellask' | 'tellaskSessionless' | 'freshBootsReasoning';
|
|
462
|
+
mentionList?: string[];
|
|
463
|
+
tellaskContent: string;
|
|
464
|
+
originMemberId: string;
|
|
465
|
+
callerDialogId: string;
|
|
466
|
+
callId: string;
|
|
467
|
+
collectiveTargets?: string[];
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
export interface RemindersReconciledRecord extends RootGenerationAnchor {
|
|
471
|
+
ts: string;
|
|
472
|
+
type: 'reminders_reconciled_record';
|
|
473
|
+
reminders: ReminderSnapshotItem[];
|
|
474
|
+
}
|
|
475
|
+
export interface Questions4HumanReconciledRecord extends RootGenerationAnchor {
|
|
476
|
+
ts: string;
|
|
477
|
+
type: 'questions4human_reconciled_record';
|
|
478
|
+
questions: HumanQuestion[];
|
|
479
|
+
}
|
|
480
|
+
export interface PendingSubdialogsReconciledRecord extends RootGenerationAnchor {
|
|
481
|
+
ts: string;
|
|
482
|
+
type: 'pending_subdialogs_reconciled_record';
|
|
483
|
+
pendingSubdialogs: PendingSubdialogStateRecord[];
|
|
484
|
+
}
|
|
485
|
+
export interface SubdialogRegistryReconciledRecord extends RootGenerationAnchor {
|
|
486
|
+
ts: string;
|
|
487
|
+
type: 'subdialog_registry_reconciled_record';
|
|
488
|
+
entries: SubdialogRegistryStateRecord[];
|
|
489
|
+
}
|
|
490
|
+
export interface SubdialogResponsesReconciledRecord extends RootGenerationAnchor {
|
|
491
|
+
ts: string;
|
|
492
|
+
type: 'subdialog_responses_reconciled_record';
|
|
493
|
+
responses: SubdialogResponseStateRecord[];
|
|
494
|
+
}
|
|
495
|
+
export interface ReminderStateFile {
|
|
496
|
+
reminders: Array<{
|
|
497
|
+
id: string;
|
|
498
|
+
content: string;
|
|
499
|
+
ownerName?: string;
|
|
500
|
+
meta?: JsonValue;
|
|
501
|
+
echoback?: boolean;
|
|
502
|
+
createdAt: string;
|
|
503
|
+
priority: 'high' | 'medium' | 'low';
|
|
504
|
+
}>;
|
|
505
|
+
updatedAt: string;
|
|
506
|
+
}
|
|
507
|
+
export interface HumanQuestion {
|
|
508
|
+
id: string;
|
|
509
|
+
tellaskContent: string;
|
|
510
|
+
askedAt: string;
|
|
511
|
+
callId?: string;
|
|
512
|
+
remainingCallIds?: string[];
|
|
513
|
+
callSiteRef: {
|
|
514
|
+
course: number;
|
|
515
|
+
messageIndex: number;
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
export interface Questions4HumanFile {
|
|
519
|
+
questions: HumanQuestion[];
|
|
520
|
+
updatedAt: string;
|
|
521
|
+
}
|
|
522
|
+
export interface DialogDirectoryStructure {
|
|
523
|
+
rootPath: string;
|
|
524
|
+
statusDir: 'run' | 'done' | 'archive';
|
|
525
|
+
selfId: string;
|
|
526
|
+
rootId: string;
|
|
527
|
+
isSubdialog: boolean;
|
|
528
|
+
metadataPath: string;
|
|
529
|
+
latestPath: string;
|
|
530
|
+
courseCurrPath: string;
|
|
531
|
+
remindersPath: string;
|
|
532
|
+
questionsPath: string;
|
|
533
|
+
courseJsonlPattern: string;
|
|
534
|
+
courseYamlPattern: string;
|
|
535
|
+
subdialogsPath?: string;
|
|
536
|
+
}
|
|
537
|
+
export interface DialogListItem {
|
|
538
|
+
id: string;
|
|
539
|
+
selfId: string;
|
|
540
|
+
rootId: string;
|
|
541
|
+
agentId: string;
|
|
542
|
+
taskDocPath: string;
|
|
543
|
+
status: 'active' | 'completed' | 'archived';
|
|
544
|
+
createdAt: string;
|
|
545
|
+
lastModified: string;
|
|
546
|
+
currentCourse: number;
|
|
547
|
+
messageCount: number;
|
|
548
|
+
subdialogCount: number;
|
|
549
|
+
preview?: string;
|
|
550
|
+
supdialogId?: string;
|
|
551
|
+
sessionSlug?: string;
|
|
552
|
+
assignmentFromSup?: {
|
|
553
|
+
callName: 'tellask' | 'tellaskSessionless' | 'freshBootsReasoning';
|
|
554
|
+
mentionList?: string[];
|
|
555
|
+
tellaskContent: string;
|
|
556
|
+
originMemberId: string;
|
|
557
|
+
callerDialogId: string;
|
|
558
|
+
callId: string;
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
export type PersistedDialogRecord = AgentThoughtRecord | AgentWordsRecord | UiOnlyMarkdownRecord | FuncCallRecord | WebSearchCallRecord | HumanTextRecord | FuncResultRecord | QuestForSupRecord | TellaskCallResultRecord | TellaskCallCarryoverRecord | TellaskCallAnchorRecord | TellaskResponseRecord | TellaskCarryoverResultRecord | GenStartRecord | GenFinishRecord | SubdialogCreatedRecord | RemindersReconciledRecord | Questions4HumanReconciledRecord | PendingSubdialogsReconciledRecord | SubdialogRegistryReconciledRecord | SubdialogResponsesReconciledRecord;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Module: kernel/types/storage
|
|
4
|
+
*
|
|
5
|
+
* Strongly typed disk storage formats for dialog persistence.
|
|
6
|
+
* Uses modern TypeScript patterns for statically verifiable field access.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.toRootCourseNumber = toRootCourseNumber;
|
|
10
|
+
exports.toRootGenerationSeqNumber = toRootGenerationSeqNumber;
|
|
11
|
+
exports.toDialogCourseNumber = toDialogCourseNumber;
|
|
12
|
+
exports.toCallingCourseNumber = toCallingCourseNumber;
|
|
13
|
+
exports.toCallingGenerationSeqNumber = toCallingGenerationSeqNumber;
|
|
14
|
+
exports.toAssignmentCourseNumber = toAssignmentCourseNumber;
|
|
15
|
+
exports.toAssignmentGenerationSeqNumber = toAssignmentGenerationSeqNumber;
|
|
16
|
+
exports.toCallerCourseNumber = toCallerCourseNumber;
|
|
17
|
+
exports.toCalleeCourseNumber = toCalleeCourseNumber;
|
|
18
|
+
exports.toCalleeGenerationSeqNumber = toCalleeGenerationSeqNumber;
|
|
19
|
+
exports.toRootGenerationAnchor = toRootGenerationAnchor;
|
|
20
|
+
function toRootCourseNumber(value) {
|
|
21
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
22
|
+
throw new Error(`Invalid root course number: ${String(value)}`);
|
|
23
|
+
}
|
|
24
|
+
return Math.floor(value);
|
|
25
|
+
}
|
|
26
|
+
function toRootGenerationSeqNumber(value) {
|
|
27
|
+
if (!Number.isFinite(value) || value < 0) {
|
|
28
|
+
throw new Error(`Invalid root generation sequence number: ${String(value)}`);
|
|
29
|
+
}
|
|
30
|
+
return Math.floor(value);
|
|
31
|
+
}
|
|
32
|
+
function toDialogCourseNumber(value) {
|
|
33
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
34
|
+
throw new Error(`Invalid dialog course number: ${String(value)}`);
|
|
35
|
+
}
|
|
36
|
+
return Math.floor(value);
|
|
37
|
+
}
|
|
38
|
+
function toCallingCourseNumber(value) {
|
|
39
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
40
|
+
throw new Error(`Invalid calling course number: ${String(value)}`);
|
|
41
|
+
}
|
|
42
|
+
return Math.floor(value);
|
|
43
|
+
}
|
|
44
|
+
function toCallingGenerationSeqNumber(value) {
|
|
45
|
+
if (!Number.isFinite(value) || value < 0) {
|
|
46
|
+
throw new Error(`Invalid calling generation sequence number: ${String(value)}`);
|
|
47
|
+
}
|
|
48
|
+
return Math.floor(value);
|
|
49
|
+
}
|
|
50
|
+
function toAssignmentCourseNumber(value) {
|
|
51
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
52
|
+
throw new Error(`Invalid assignment course number: ${String(value)}`);
|
|
53
|
+
}
|
|
54
|
+
return Math.floor(value);
|
|
55
|
+
}
|
|
56
|
+
function toAssignmentGenerationSeqNumber(value) {
|
|
57
|
+
if (!Number.isFinite(value) || value < 0) {
|
|
58
|
+
throw new Error(`Invalid assignment generation sequence number: ${String(value)}`);
|
|
59
|
+
}
|
|
60
|
+
return Math.floor(value);
|
|
61
|
+
}
|
|
62
|
+
function toCallerCourseNumber(value) {
|
|
63
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
64
|
+
throw new Error(`Invalid caller course number: ${String(value)}`);
|
|
65
|
+
}
|
|
66
|
+
return Math.floor(value);
|
|
67
|
+
}
|
|
68
|
+
function toCalleeCourseNumber(value) {
|
|
69
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
70
|
+
throw new Error(`Invalid callee course number: ${String(value)}`);
|
|
71
|
+
}
|
|
72
|
+
return Math.floor(value);
|
|
73
|
+
}
|
|
74
|
+
function toCalleeGenerationSeqNumber(value) {
|
|
75
|
+
if (!Number.isFinite(value) || value < 0) {
|
|
76
|
+
throw new Error(`Invalid callee generation sequence number: ${String(value)}`);
|
|
77
|
+
}
|
|
78
|
+
return Math.floor(value);
|
|
79
|
+
}
|
|
80
|
+
function toRootGenerationAnchor(args) {
|
|
81
|
+
return {
|
|
82
|
+
rootCourse: toRootCourseNumber(args.rootCourse),
|
|
83
|
+
rootGenseq: toRootGenerationSeqNumber(args.rootGenseq),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { I18nText } from './i18n';
|
|
2
|
+
export type ToolKind = 'func';
|
|
3
|
+
export type ToolsetSource = 'dominds' | 'mcp' | 'app';
|
|
4
|
+
export type ToolInfo = {
|
|
5
|
+
name: string;
|
|
6
|
+
kind: ToolKind;
|
|
7
|
+
description?: string;
|
|
8
|
+
descriptionI18n?: I18nText;
|
|
9
|
+
};
|
|
10
|
+
export type ToolsetInfo = {
|
|
11
|
+
name: string;
|
|
12
|
+
source: ToolsetSource;
|
|
13
|
+
descriptionI18n?: I18nText;
|
|
14
|
+
tools: ToolInfo[];
|
|
15
|
+
};
|
|
16
|
+
export type ToolsRegistrySnapshot = {
|
|
17
|
+
toolsets: ToolsetInfo[];
|
|
18
|
+
timestamp: string;
|
|
19
|
+
};
|