@octavus/core 0.0.11 → 0.1.0
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/dist/index.d.ts +138 -4
- package/dist/index.js +58 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,31 @@ declare class ConflictError extends AppError {
|
|
|
22
22
|
*/
|
|
23
23
|
declare function generateId(): string;
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Default thread name when none is specified.
|
|
27
|
+
*/
|
|
28
|
+
declare const MAIN_THREAD: "main";
|
|
29
|
+
/**
|
|
30
|
+
* Resolve a thread name, defaulting to main thread.
|
|
31
|
+
*/
|
|
32
|
+
declare function resolveThread(thread: string | undefined): string;
|
|
33
|
+
/**
|
|
34
|
+
* Check if a thread is the main thread.
|
|
35
|
+
*/
|
|
36
|
+
declare function isMainThread(thread: string | undefined): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Normalize thread for storage in message parts.
|
|
39
|
+
* Main thread is stored as undefined to save space.
|
|
40
|
+
*/
|
|
41
|
+
declare function threadForPart(thread: string | undefined): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Check if a message part belongs to a non-main thread.
|
|
44
|
+
* Non-main thread content (e.g., "summary") is typically displayed differently.
|
|
45
|
+
*/
|
|
46
|
+
declare function isOtherThread(part: {
|
|
47
|
+
thread?: string;
|
|
48
|
+
}): boolean;
|
|
49
|
+
|
|
25
50
|
/**
|
|
26
51
|
* Stream event types for Octavus agent communication.
|
|
27
52
|
*
|
|
@@ -67,10 +92,21 @@ interface ErrorEvent {
|
|
|
67
92
|
errorText: string;
|
|
68
93
|
}
|
|
69
94
|
type FinishReason = 'stop' | 'tool-calls' | 'length' | 'content-filter' | 'error' | 'other';
|
|
70
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Start of text generation for a specific text part.
|
|
97
|
+
*
|
|
98
|
+
* If `responseType` is set, the text content is JSON matching a custom type.
|
|
99
|
+
* The client SDK should parse the text as a structured object instead of
|
|
100
|
+
* displaying it as plain text.
|
|
101
|
+
*/
|
|
71
102
|
interface TextStartEvent {
|
|
72
103
|
type: 'text-start';
|
|
73
104
|
id: string;
|
|
105
|
+
/**
|
|
106
|
+
* If specified, the text content is JSON matching this type name.
|
|
107
|
+
* Client SDK should parse as object, not display as text.
|
|
108
|
+
*/
|
|
109
|
+
responseType?: string;
|
|
74
110
|
}
|
|
75
111
|
/** Incremental text content */
|
|
76
112
|
interface TextDeltaEvent {
|
|
@@ -256,7 +292,7 @@ type StreamEvent = StartEvent | FinishEvent | ErrorEvent | TextStartEvent | Text
|
|
|
256
292
|
/**
|
|
257
293
|
* Type of content in a message part (internal)
|
|
258
294
|
*/
|
|
259
|
-
type MessagePartType = 'text' | 'reasoning' | 'tool-call' | 'source' | 'file';
|
|
295
|
+
type MessagePartType = 'text' | 'reasoning' | 'tool-call' | 'source' | 'file' | 'object';
|
|
260
296
|
/**
|
|
261
297
|
* Source info for URL sources (from web search, etc.)
|
|
262
298
|
*/
|
|
@@ -291,6 +327,16 @@ interface FileInfo {
|
|
|
291
327
|
size?: number;
|
|
292
328
|
toolCallId?: string;
|
|
293
329
|
}
|
|
330
|
+
/**
|
|
331
|
+
* Object info for structured output (internal storage)
|
|
332
|
+
*/
|
|
333
|
+
interface ObjectInfo {
|
|
334
|
+
id: string;
|
|
335
|
+
/** Type name from the protocol */
|
|
336
|
+
typeName: string;
|
|
337
|
+
/** The structured object value */
|
|
338
|
+
value: unknown;
|
|
339
|
+
}
|
|
294
340
|
/**
|
|
295
341
|
* A single part of a message, stored in order for proper display (internal)
|
|
296
342
|
*/
|
|
@@ -306,6 +352,8 @@ interface MessagePart {
|
|
|
306
352
|
source?: SourceInfo;
|
|
307
353
|
/** File info for file parts (from skill execution, etc.) */
|
|
308
354
|
file?: FileInfo;
|
|
355
|
+
/** Object info for object parts (structured output) */
|
|
356
|
+
object?: ObjectInfo;
|
|
309
357
|
/** Thread name for non-main-thread content (e.g., "summary") */
|
|
310
358
|
thread?: string;
|
|
311
359
|
}
|
|
@@ -447,10 +495,36 @@ interface UIFilePart {
|
|
|
447
495
|
/** Thread name (undefined or 'main' for main thread) */
|
|
448
496
|
thread?: string;
|
|
449
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* Status of a UI object part
|
|
500
|
+
*/
|
|
501
|
+
type UIObjectStatus = 'streaming' | 'done' | 'error';
|
|
502
|
+
/**
|
|
503
|
+
* Structured object part in a UI message.
|
|
504
|
+
* Used when the agent response is a typed object (structured output).
|
|
505
|
+
* Client applications can render custom UI based on the typeName.
|
|
506
|
+
*/
|
|
507
|
+
interface UIObjectPart {
|
|
508
|
+
type: 'object';
|
|
509
|
+
/** Unique part ID */
|
|
510
|
+
id: string;
|
|
511
|
+
/** The type name from the protocol (e.g., "ChatResponse") */
|
|
512
|
+
typeName: string;
|
|
513
|
+
/** Partial object while streaming (may have missing/incomplete fields) */
|
|
514
|
+
partial?: unknown;
|
|
515
|
+
/** Final validated object when done */
|
|
516
|
+
object?: unknown;
|
|
517
|
+
/** Current status */
|
|
518
|
+
status: UIObjectStatus;
|
|
519
|
+
/** Error message if status is 'error' */
|
|
520
|
+
error?: string;
|
|
521
|
+
/** Thread name (undefined or 'main' for main thread) */
|
|
522
|
+
thread?: string;
|
|
523
|
+
}
|
|
450
524
|
/**
|
|
451
525
|
* Union of all UI message part types
|
|
452
526
|
*/
|
|
453
|
-
type UIMessagePart = UITextPart | UIReasoningPart | UIToolCallPart | UIOperationPart | UISourcePart | UIFilePart;
|
|
527
|
+
type UIMessagePart = UITextPart | UIReasoningPart | UIToolCallPart | UIOperationPart | UISourcePart | UIFilePart | UIObjectPart;
|
|
454
528
|
/**
|
|
455
529
|
* UI Message - the client-facing message format
|
|
456
530
|
* All complexity is handled by the SDK, this is what consumers render
|
|
@@ -488,10 +562,12 @@ declare const chatMessageSchema: z.ZodObject<{
|
|
|
488
562
|
}>;
|
|
489
563
|
parts: z.ZodArray<z.ZodObject<{
|
|
490
564
|
type: z.ZodEnum<{
|
|
565
|
+
object: "object";
|
|
491
566
|
source: "source";
|
|
492
567
|
text: "text";
|
|
493
568
|
reasoning: "reasoning";
|
|
494
569
|
"tool-call": "tool-call";
|
|
570
|
+
file: "file";
|
|
495
571
|
}>;
|
|
496
572
|
visible: z.ZodBoolean;
|
|
497
573
|
content: z.ZodOptional<z.ZodString>;
|
|
@@ -521,6 +597,19 @@ declare const chatMessageSchema: z.ZodObject<{
|
|
|
521
597
|
title: z.ZodString;
|
|
522
598
|
filename: z.ZodOptional<z.ZodString>;
|
|
523
599
|
}, z.core.$strip>], "sourceType">>;
|
|
600
|
+
file: z.ZodOptional<z.ZodObject<{
|
|
601
|
+
id: z.ZodString;
|
|
602
|
+
mediaType: z.ZodString;
|
|
603
|
+
url: z.ZodString;
|
|
604
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
605
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
606
|
+
toolCallId: z.ZodOptional<z.ZodString>;
|
|
607
|
+
}, z.core.$strip>>;
|
|
608
|
+
object: z.ZodOptional<z.ZodObject<{
|
|
609
|
+
id: z.ZodString;
|
|
610
|
+
typeName: z.ZodString;
|
|
611
|
+
value: z.ZodUnknown;
|
|
612
|
+
}, z.core.$strip>>;
|
|
524
613
|
thread: z.ZodOptional<z.ZodString>;
|
|
525
614
|
}, z.core.$strip>>;
|
|
526
615
|
createdAt: z.ZodString;
|
|
@@ -608,6 +697,19 @@ declare const uiMessagePartSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
608
697
|
size: z.ZodOptional<z.ZodNumber>;
|
|
609
698
|
toolCallId: z.ZodOptional<z.ZodString>;
|
|
610
699
|
thread: z.ZodOptional<z.ZodString>;
|
|
700
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
701
|
+
type: z.ZodLiteral<"object">;
|
|
702
|
+
id: z.ZodString;
|
|
703
|
+
typeName: z.ZodString;
|
|
704
|
+
partial: z.ZodOptional<z.ZodUnknown>;
|
|
705
|
+
object: z.ZodOptional<z.ZodUnknown>;
|
|
706
|
+
status: z.ZodEnum<{
|
|
707
|
+
streaming: "streaming";
|
|
708
|
+
error: "error";
|
|
709
|
+
done: "done";
|
|
710
|
+
}>;
|
|
711
|
+
error: z.ZodOptional<z.ZodString>;
|
|
712
|
+
thread: z.ZodOptional<z.ZodString>;
|
|
611
713
|
}, z.core.$strip>]>;
|
|
612
714
|
declare const uiMessageSchema: z.ZodObject<{
|
|
613
715
|
id: z.ZodString;
|
|
@@ -680,6 +782,19 @@ declare const uiMessageSchema: z.ZodObject<{
|
|
|
680
782
|
size: z.ZodOptional<z.ZodNumber>;
|
|
681
783
|
toolCallId: z.ZodOptional<z.ZodString>;
|
|
682
784
|
thread: z.ZodOptional<z.ZodString>;
|
|
785
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
786
|
+
type: z.ZodLiteral<"object">;
|
|
787
|
+
id: z.ZodString;
|
|
788
|
+
typeName: z.ZodString;
|
|
789
|
+
partial: z.ZodOptional<z.ZodUnknown>;
|
|
790
|
+
object: z.ZodOptional<z.ZodUnknown>;
|
|
791
|
+
status: z.ZodEnum<{
|
|
792
|
+
streaming: "streaming";
|
|
793
|
+
error: "error";
|
|
794
|
+
done: "done";
|
|
795
|
+
}>;
|
|
796
|
+
error: z.ZodOptional<z.ZodString>;
|
|
797
|
+
thread: z.ZodOptional<z.ZodString>;
|
|
683
798
|
}, z.core.$strip>]>>;
|
|
684
799
|
status: z.ZodEnum<{
|
|
685
800
|
streaming: "streaming";
|
|
@@ -712,6 +827,7 @@ declare function safeParseStreamEvent(data: unknown): z.ZodSafeParseResult<{
|
|
|
712
827
|
} | {
|
|
713
828
|
type: "text-start";
|
|
714
829
|
id: string;
|
|
830
|
+
responseType?: string | undefined;
|
|
715
831
|
} | {
|
|
716
832
|
type: "text-delta";
|
|
717
833
|
id: string;
|
|
@@ -844,6 +960,15 @@ declare function safeParseUIMessage(data: unknown): z.ZodSafeParseResult<{
|
|
|
844
960
|
size?: number | undefined;
|
|
845
961
|
toolCallId?: string | undefined;
|
|
846
962
|
thread?: string | undefined;
|
|
963
|
+
} | {
|
|
964
|
+
type: "object";
|
|
965
|
+
id: string;
|
|
966
|
+
typeName: string;
|
|
967
|
+
status: "streaming" | "error" | "done";
|
|
968
|
+
partial?: unknown;
|
|
969
|
+
object?: unknown;
|
|
970
|
+
error?: string | undefined;
|
|
971
|
+
thread?: string | undefined;
|
|
847
972
|
})[];
|
|
848
973
|
status: "streaming" | "done";
|
|
849
974
|
createdAt: Date;
|
|
@@ -902,6 +1027,15 @@ declare function safeParseUIMessages(data: unknown): z.ZodSafeParseResult<{
|
|
|
902
1027
|
size?: number | undefined;
|
|
903
1028
|
toolCallId?: string | undefined;
|
|
904
1029
|
thread?: string | undefined;
|
|
1030
|
+
} | {
|
|
1031
|
+
type: "object";
|
|
1032
|
+
id: string;
|
|
1033
|
+
typeName: string;
|
|
1034
|
+
status: "streaming" | "error" | "done";
|
|
1035
|
+
partial?: unknown;
|
|
1036
|
+
object?: unknown;
|
|
1037
|
+
error?: string | undefined;
|
|
1038
|
+
thread?: string | undefined;
|
|
905
1039
|
})[];
|
|
906
1040
|
status: "streaming" | "done";
|
|
907
1041
|
createdAt: Date;
|
|
@@ -952,4 +1086,4 @@ declare function isOctavusSkillTool(toolName: string): toolName is OctavusSkillT
|
|
|
952
1086
|
*/
|
|
953
1087
|
declare function getSkillSlugFromToolCall(toolName: string, args: Record<string, unknown> | undefined): string | undefined;
|
|
954
1088
|
|
|
955
|
-
export { AppError, type BlockEndEvent, type BlockStartEvent, type ChatMessage, ConflictError, type DisplayMode, type ErrorEvent, type FileAvailableEvent, type FileInfo, type FinishEvent, type FinishReason, type GeneratedFile, type MessagePart, type MessagePartType, type MessageRole, NotFoundError, OCTAVUS_SKILL_TOOLS, type OctavusSkillToolName, type PendingToolCall, type ReasoningDeltaEvent, type ReasoningEndEvent, type ReasoningStartEvent, type ResourceUpdateEvent, type ResourceUpdateHandler, type SourceDocumentEvent, type SourceDocumentInfo, type SourceEvent, type SourceInfo, type SourceUrlEvent, type SourceUrlInfo, type StartEvent, type StreamEvent, type TextDeltaEvent, type TextEndEvent, type TextStartEvent, type ToolCallInfo, type ToolCallStatus, type ToolHandler, type ToolHandlers, type ToolInputAvailableEvent, type ToolInputDeltaEvent, type ToolInputEndEvent, type ToolInputStartEvent, type ToolOutputAvailableEvent, type ToolOutputErrorEvent, type ToolRequestEvent, type ToolResult, type UIFilePart, type UIMessage, type UIMessagePart, type UIMessageStatus, type UIOperationPart, type UIOperationStatus, type UIPartStatus, type UIReasoningPart, type UISourceDocumentPart, type UISourcePart, type UISourceUrlPart, type UITextPart, type UIToolCallPart, type UIToolCallStatus, ValidationError, chatMessageSchema, generateId, getSkillSlugFromToolCall, isOctavusSkillTool, safeParseStreamEvent, safeParseUIMessage, safeParseUIMessages, toolResultSchema, uiMessagePartSchema, uiMessageSchema };
|
|
1089
|
+
export { AppError, type BlockEndEvent, type BlockStartEvent, type ChatMessage, ConflictError, type DisplayMode, type ErrorEvent, type FileAvailableEvent, type FileInfo, type FinishEvent, type FinishReason, type GeneratedFile, MAIN_THREAD, type MessagePart, type MessagePartType, type MessageRole, NotFoundError, OCTAVUS_SKILL_TOOLS, type ObjectInfo, type OctavusSkillToolName, type PendingToolCall, type ReasoningDeltaEvent, type ReasoningEndEvent, type ReasoningStartEvent, type ResourceUpdateEvent, type ResourceUpdateHandler, type SourceDocumentEvent, type SourceDocumentInfo, type SourceEvent, type SourceInfo, type SourceUrlEvent, type SourceUrlInfo, type StartEvent, type StreamEvent, type TextDeltaEvent, type TextEndEvent, type TextStartEvent, type ToolCallInfo, type ToolCallStatus, type ToolHandler, type ToolHandlers, type ToolInputAvailableEvent, type ToolInputDeltaEvent, type ToolInputEndEvent, type ToolInputStartEvent, type ToolOutputAvailableEvent, type ToolOutputErrorEvent, type ToolRequestEvent, type ToolResult, type UIFilePart, type UIMessage, type UIMessagePart, type UIMessageStatus, type UIObjectPart, type UIObjectStatus, type UIOperationPart, type UIOperationStatus, type UIPartStatus, type UIReasoningPart, type UISourceDocumentPart, type UISourcePart, type UISourceUrlPart, type UITextPart, type UIToolCallPart, type UIToolCallStatus, ValidationError, chatMessageSchema, generateId, getSkillSlugFromToolCall, isMainThread, isOctavusSkillTool, isOtherThread, resolveThread, safeParseStreamEvent, safeParseUIMessage, safeParseUIMessages, threadForPart, toolResultSchema, uiMessagePartSchema, uiMessageSchema };
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,21 @@ function generateId() {
|
|
|
32
32
|
return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
// src/thread.ts
|
|
36
|
+
var MAIN_THREAD = "main";
|
|
37
|
+
function resolveThread(thread) {
|
|
38
|
+
return thread ?? MAIN_THREAD;
|
|
39
|
+
}
|
|
40
|
+
function isMainThread(thread) {
|
|
41
|
+
return thread === void 0 || thread === MAIN_THREAD;
|
|
42
|
+
}
|
|
43
|
+
function threadForPart(thread) {
|
|
44
|
+
return isMainThread(thread) ? void 0 : thread;
|
|
45
|
+
}
|
|
46
|
+
function isOtherThread(part) {
|
|
47
|
+
return !isMainThread(part.thread);
|
|
48
|
+
}
|
|
49
|
+
|
|
35
50
|
// src/stream/schemas.ts
|
|
36
51
|
import { z } from "zod";
|
|
37
52
|
var displayModeSchema = z.enum(["hidden", "name", "description", "stream"]);
|
|
@@ -68,7 +83,8 @@ var errorEventSchema = z.object({
|
|
|
68
83
|
});
|
|
69
84
|
var textStartEventSchema = z.object({
|
|
70
85
|
type: z.literal("text-start"),
|
|
71
|
-
id: z.string()
|
|
86
|
+
id: z.string(),
|
|
87
|
+
responseType: z.string().optional()
|
|
72
88
|
});
|
|
73
89
|
var textDeltaEventSchema = z.object({
|
|
74
90
|
type: z.literal("text-delta"),
|
|
@@ -216,7 +232,14 @@ var streamEventSchema = z.union([
|
|
|
216
232
|
toolRequestEventSchema,
|
|
217
233
|
fileAvailableEventSchema
|
|
218
234
|
]);
|
|
219
|
-
var messagePartTypeSchema = z.enum([
|
|
235
|
+
var messagePartTypeSchema = z.enum([
|
|
236
|
+
"text",
|
|
237
|
+
"reasoning",
|
|
238
|
+
"tool-call",
|
|
239
|
+
"source",
|
|
240
|
+
"file",
|
|
241
|
+
"object"
|
|
242
|
+
]);
|
|
220
243
|
var sourceUrlInfoSchema = z.object({
|
|
221
244
|
sourceType: z.literal("url"),
|
|
222
245
|
id: z.string(),
|
|
@@ -234,12 +257,27 @@ var sourceInfoSchema = z.discriminatedUnion("sourceType", [
|
|
|
234
257
|
sourceUrlInfoSchema,
|
|
235
258
|
sourceDocumentInfoSchema
|
|
236
259
|
]);
|
|
260
|
+
var fileInfoSchema = z.object({
|
|
261
|
+
id: z.string(),
|
|
262
|
+
mediaType: z.string(),
|
|
263
|
+
url: z.string(),
|
|
264
|
+
filename: z.string().optional(),
|
|
265
|
+
size: z.number().optional(),
|
|
266
|
+
toolCallId: z.string().optional()
|
|
267
|
+
});
|
|
268
|
+
var objectInfoSchema = z.object({
|
|
269
|
+
id: z.string(),
|
|
270
|
+
typeName: z.string(),
|
|
271
|
+
value: z.unknown()
|
|
272
|
+
});
|
|
237
273
|
var messagePartSchema = z.object({
|
|
238
274
|
type: messagePartTypeSchema,
|
|
239
275
|
visible: z.boolean(),
|
|
240
276
|
content: z.string().optional(),
|
|
241
277
|
toolCall: toolCallInfoSchema.optional(),
|
|
242
278
|
source: sourceInfoSchema.optional(),
|
|
279
|
+
file: fileInfoSchema.optional(),
|
|
280
|
+
object: objectInfoSchema.optional(),
|
|
243
281
|
thread: z.string().optional()
|
|
244
282
|
});
|
|
245
283
|
var chatMessageSchema = z.object({
|
|
@@ -319,13 +357,25 @@ var uiFilePartSchema = z.object({
|
|
|
319
357
|
toolCallId: z.string().optional(),
|
|
320
358
|
thread: z.string().optional()
|
|
321
359
|
});
|
|
360
|
+
var uiObjectStatusSchema = z.enum(["streaming", "done", "error"]);
|
|
361
|
+
var uiObjectPartSchema = z.object({
|
|
362
|
+
type: z.literal("object"),
|
|
363
|
+
id: z.string(),
|
|
364
|
+
typeName: z.string(),
|
|
365
|
+
partial: z.unknown().optional(),
|
|
366
|
+
object: z.unknown().optional(),
|
|
367
|
+
status: uiObjectStatusSchema,
|
|
368
|
+
error: z.string().optional(),
|
|
369
|
+
thread: z.string().optional()
|
|
370
|
+
});
|
|
322
371
|
var uiMessagePartSchema = z.union([
|
|
323
372
|
uiTextPartSchema,
|
|
324
373
|
uiReasoningPartSchema,
|
|
325
374
|
uiToolCallPartSchema,
|
|
326
375
|
uiOperationPartSchema,
|
|
327
376
|
uiSourcePartSchema,
|
|
328
|
-
uiFilePartSchema
|
|
377
|
+
uiFilePartSchema,
|
|
378
|
+
uiObjectPartSchema
|
|
329
379
|
]);
|
|
330
380
|
var uiMessageSchema = z.object({
|
|
331
381
|
id: z.string(),
|
|
@@ -368,16 +418,21 @@ function getSkillSlugFromToolCall(toolName, args) {
|
|
|
368
418
|
export {
|
|
369
419
|
AppError,
|
|
370
420
|
ConflictError,
|
|
421
|
+
MAIN_THREAD,
|
|
371
422
|
NotFoundError,
|
|
372
423
|
OCTAVUS_SKILL_TOOLS,
|
|
373
424
|
ValidationError,
|
|
374
425
|
chatMessageSchema,
|
|
375
426
|
generateId,
|
|
376
427
|
getSkillSlugFromToolCall,
|
|
428
|
+
isMainThread,
|
|
377
429
|
isOctavusSkillTool,
|
|
430
|
+
isOtherThread,
|
|
431
|
+
resolveThread,
|
|
378
432
|
safeParseStreamEvent,
|
|
379
433
|
safeParseUIMessage,
|
|
380
434
|
safeParseUIMessages,
|
|
435
|
+
threadForPart,
|
|
381
436
|
toolResultSchema,
|
|
382
437
|
uiMessagePartSchema,
|
|
383
438
|
uiMessageSchema
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts","../src/utils.ts","../src/stream/schemas.ts","../src/skills.ts"],"sourcesContent":["export class AppError extends Error {\n constructor(\n message: string,\n public code: string,\n public statusCode = 500,\n ) {\n super(message);\n this.name = 'AppError';\n }\n}\n\nexport class NotFoundError extends AppError {\n constructor(resource: string, id: string) {\n super(`${resource} not found: ${id}`, 'NOT_FOUND', 404);\n this.name = 'NotFoundError';\n }\n}\n\nexport class ValidationError extends AppError {\n constructor(\n message: string,\n public issues?: unknown[],\n ) {\n super(message, 'VALIDATION_ERROR', 400);\n this.name = 'ValidationError';\n }\n}\n\nexport class ConflictError extends AppError {\n constructor(resource: string, identifier: string) {\n super(`${resource} already exists: ${identifier}`, 'CONFLICT', 409);\n this.name = 'ConflictError';\n }\n}\n","/**\n * Generate a unique ID for messages, tool calls, etc.\n * Format: timestamp-random (e.g., \"1702345678901-abc123def\")\n */\nexport function generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\n","/**\n * Zod schemas for stream events.\n *\n * Schemas are organized into two categories:\n * - Standard Events (====): Aligned with Vercel AI SDK for interoperability\n * - Octavus Events (----): Octavus-specific protocol events\n */\n\nimport { z } from 'zod';\n\nexport const displayModeSchema = z.enum(['hidden', 'name', 'description', 'stream']);\nexport const messageRoleSchema = z.enum(['user', 'assistant', 'system']);\nexport const toolCallStatusSchema = z.enum(['pending', 'streaming', 'available', 'error']);\nexport const finishReasonSchema = z.enum([\n 'stop',\n 'tool-calls',\n 'length',\n 'content-filter',\n 'error',\n 'other',\n]);\n\nexport const toolCallInfoSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n arguments: z.record(z.string(), z.unknown()),\n status: toolCallStatusSchema,\n result: z.unknown().optional(),\n error: z.string().optional(),\n});\n\n// =============================================================================\n// STANDARD EVENTS (aligned with Vercel AI SDK)\n// =============================================================================\n\n// ============================== Lifecycle ====================================\n\nexport const startEventSchema = z.object({\n type: z.literal('start'),\n messageId: z.string().optional(),\n});\n\nexport const finishEventSchema = z.object({\n type: z.literal('finish'),\n finishReason: finishReasonSchema,\n});\n\nexport const errorEventSchema = z.object({\n type: z.literal('error'),\n errorText: z.string(),\n});\n\n// ================================= Text ======================================\n\nexport const textStartEventSchema = z.object({\n type: z.literal('text-start'),\n id: z.string(),\n});\n\nexport const textDeltaEventSchema = z.object({\n type: z.literal('text-delta'),\n id: z.string(),\n delta: z.string(),\n});\n\nexport const textEndEventSchema = z.object({\n type: z.literal('text-end'),\n id: z.string(),\n});\n\n// =============================== Reasoning ===================================\n\nexport const reasoningStartEventSchema = z.object({\n type: z.literal('reasoning-start'),\n id: z.string(),\n});\n\nexport const reasoningDeltaEventSchema = z.object({\n type: z.literal('reasoning-delta'),\n id: z.string(),\n delta: z.string(),\n});\n\nexport const reasoningEndEventSchema = z.object({\n type: z.literal('reasoning-end'),\n id: z.string(),\n});\n\n// ================================= Tool ======================================\n\nexport const toolInputStartEventSchema = z.object({\n type: z.literal('tool-input-start'),\n toolCallId: z.string(),\n toolName: z.string(),\n title: z.string().optional(),\n});\n\nexport const toolInputDeltaEventSchema = z.object({\n type: z.literal('tool-input-delta'),\n toolCallId: z.string(),\n inputTextDelta: z.string(),\n});\n\nexport const toolInputEndEventSchema = z.object({\n type: z.literal('tool-input-end'),\n toolCallId: z.string(),\n});\n\nexport const toolInputAvailableEventSchema = z.object({\n type: z.literal('tool-input-available'),\n toolCallId: z.string(),\n toolName: z.string(),\n input: z.unknown(),\n});\n\nexport const toolOutputAvailableEventSchema = z.object({\n type: z.literal('tool-output-available'),\n toolCallId: z.string(),\n output: z.unknown(),\n});\n\nexport const toolOutputErrorEventSchema = z.object({\n type: z.literal('tool-output-error'),\n toolCallId: z.string(),\n errorText: z.string(),\n});\n\n// ================================ Source =====================================\n\nexport const sourceUrlEventSchema = z.object({\n type: z.literal('source'),\n sourceType: z.literal('url'),\n id: z.string(),\n url: z.string(),\n title: z.string().optional(),\n});\n\nexport const sourceDocumentEventSchema = z.object({\n type: z.literal('source'),\n sourceType: z.literal('document'),\n id: z.string(),\n mediaType: z.string(),\n title: z.string(),\n filename: z.string().optional(),\n});\n\nexport const sourceEventSchema = z.discriminatedUnion('sourceType', [\n sourceUrlEventSchema,\n sourceDocumentEventSchema,\n]);\n\n// =============================================================================\n// OCTAVUS EVENTS (protocol-specific)\n// =============================================================================\n\n// --------------------------------- Block -------------------------------------\n\nexport const blockStartEventSchema = z.object({\n type: z.literal('block-start'),\n blockId: z.string(),\n blockName: z.string(),\n blockType: z.string(),\n display: displayModeSchema,\n description: z.string().optional(),\n outputToChat: z.boolean().optional(),\n thread: z.string().optional(),\n});\n\nexport const blockEndEventSchema = z.object({\n type: z.literal('block-end'),\n blockId: z.string(),\n summary: z.string().optional(),\n});\n\nexport const resourceUpdateEventSchema = z.object({\n type: z.literal('resource-update'),\n name: z.string(),\n value: z.unknown(),\n});\n\nexport const pendingToolCallSchema = z.object({\n toolCallId: z.string(),\n toolName: z.string(),\n args: z.record(z.string(), z.unknown()),\n source: z.enum(['llm', 'block']).optional(),\n outputVariable: z.string().optional(),\n blockIndex: z.number().optional(),\n});\n\nexport const toolRequestEventSchema = z.object({\n type: z.literal('tool-request'),\n toolCalls: z.array(pendingToolCallSchema),\n});\n\nexport const toolResultSchema = z.object({\n toolCallId: z.string(),\n toolName: z.string().optional(),\n result: z.unknown().optional(),\n error: z.string().optional(),\n outputVariable: z.string().optional(),\n blockIndex: z.number().optional(),\n});\n\n// --------------------------------- File --------------------------------------\n\nexport const fileAvailableEventSchema = z.object({\n type: z.literal('file-available'),\n id: z.string(),\n mediaType: z.string(),\n url: z.string(),\n filename: z.string().optional(),\n size: z.number().optional(),\n toolCallId: z.string().optional(),\n});\n\n// =============================================================================\n// Union of all stream events\n// =============================================================================\n\n// Note: We use z.union here because source events share type: 'source' but\n// differ by sourceType. z.discriminatedUnion requires unique discriminator values.\nexport const streamEventSchema = z.union([\n // Standard events (Vercel AI SDK aligned)\n startEventSchema,\n finishEventSchema,\n errorEventSchema,\n textStartEventSchema,\n textDeltaEventSchema,\n textEndEventSchema,\n reasoningStartEventSchema,\n reasoningDeltaEventSchema,\n reasoningEndEventSchema,\n toolInputStartEventSchema,\n toolInputDeltaEventSchema,\n toolInputEndEventSchema,\n toolInputAvailableEventSchema,\n toolOutputAvailableEventSchema,\n toolOutputErrorEventSchema,\n sourceEventSchema,\n // Octavus events (protocol-specific)\n blockStartEventSchema,\n blockEndEventSchema,\n resourceUpdateEventSchema,\n toolRequestEventSchema,\n fileAvailableEventSchema,\n]);\n\n// =============================================================================\n// Internal Message Types (used by platform/runtime)\n// =============================================================================\n\nexport const messagePartTypeSchema = z.enum(['text', 'reasoning', 'tool-call', 'source']);\n\nexport const sourceUrlInfoSchema = z.object({\n sourceType: z.literal('url'),\n id: z.string(),\n url: z.string(),\n title: z.string().optional(),\n});\n\nexport const sourceDocumentInfoSchema = z.object({\n sourceType: z.literal('document'),\n id: z.string(),\n mediaType: z.string(),\n title: z.string(),\n filename: z.string().optional(),\n});\n\nexport const sourceInfoSchema = z.discriminatedUnion('sourceType', [\n sourceUrlInfoSchema,\n sourceDocumentInfoSchema,\n]);\n\nexport const messagePartSchema = z.object({\n type: messagePartTypeSchema,\n visible: z.boolean(),\n content: z.string().optional(),\n toolCall: toolCallInfoSchema.optional(),\n source: sourceInfoSchema.optional(),\n thread: z.string().optional(),\n});\n\nexport const chatMessageSchema = z.object({\n id: z.string(),\n role: messageRoleSchema,\n parts: z.array(messagePartSchema),\n createdAt: z.string(),\n visible: z.boolean().optional(),\n content: z.string(),\n toolCalls: z.array(toolCallInfoSchema).optional(),\n reasoning: z.string().optional(),\n reasoningSignature: z.string().optional(),\n});\n\n// =============================================================================\n// UI Message Types (used by SDKs and consumer apps)\n// =============================================================================\n\nexport const uiMessageStatusSchema = z.enum(['streaming', 'done']);\nexport const uiPartStatusSchema = z.enum(['streaming', 'done']);\nexport const uiToolCallStatusSchema = z.enum(['pending', 'running', 'done', 'error']);\n\nexport const uiTextPartSchema = z.object({\n type: z.literal('text'),\n text: z.string(),\n status: uiPartStatusSchema,\n thread: z.string().optional(),\n});\n\nexport const uiReasoningPartSchema = z.object({\n type: z.literal('reasoning'),\n text: z.string(),\n status: uiPartStatusSchema,\n thread: z.string().optional(),\n});\n\nexport const uiToolCallPartSchema = z.object({\n type: z.literal('tool-call'),\n toolCallId: z.string(),\n toolName: z.string(),\n displayName: z.string().optional(),\n args: z.record(z.string(), z.unknown()),\n result: z.unknown().optional(),\n error: z.string().optional(),\n status: uiToolCallStatusSchema,\n thread: z.string().optional(),\n});\n\nexport const uiOperationStatusSchema = z.enum(['running', 'done']);\n\nexport const uiOperationPartSchema = z.object({\n type: z.literal('operation'),\n operationId: z.string(),\n name: z.string(),\n operationType: z.string(),\n status: uiOperationStatusSchema,\n thread: z.string().optional(),\n});\n\nexport const uiSourceUrlPartSchema = z.object({\n type: z.literal('source'),\n sourceType: z.literal('url'),\n id: z.string(),\n url: z.string(),\n title: z.string().optional(),\n thread: z.string().optional(),\n});\n\nexport const uiSourceDocumentPartSchema = z.object({\n type: z.literal('source'),\n sourceType: z.literal('document'),\n id: z.string(),\n mediaType: z.string(),\n title: z.string(),\n filename: z.string().optional(),\n thread: z.string().optional(),\n});\n\nexport const uiSourcePartSchema = z.discriminatedUnion('sourceType', [\n uiSourceUrlPartSchema,\n uiSourceDocumentPartSchema,\n]);\n\nexport const uiFilePartSchema = z.object({\n type: z.literal('file'),\n id: z.string(),\n mediaType: z.string(),\n url: z.string(),\n filename: z.string().optional(),\n size: z.number().optional(),\n toolCallId: z.string().optional(),\n thread: z.string().optional(),\n});\n\n// Note: We use z.union here because source parts share type: 'source' but\n// differ by sourceType. z.discriminatedUnion requires unique discriminator values.\nexport const uiMessagePartSchema = z.union([\n uiTextPartSchema,\n uiReasoningPartSchema,\n uiToolCallPartSchema,\n uiOperationPartSchema,\n uiSourcePartSchema,\n uiFilePartSchema,\n]);\n\nexport const uiMessageSchema = z.object({\n id: z.string(),\n role: z.enum(['user', 'assistant']),\n parts: z.array(uiMessagePartSchema),\n status: uiMessageStatusSchema,\n createdAt: z.coerce.date(),\n});\n\nexport function safeParseStreamEvent(data: unknown) {\n return streamEventSchema.safeParse(data);\n}\n\nexport function safeParseUIMessage(data: unknown) {\n return uiMessageSchema.safeParse(data);\n}\n\nexport function safeParseUIMessages(data: unknown) {\n return z.array(uiMessageSchema).safeParse(data);\n}\n","/**\n * Octavus skill tool names\n *\n * These are internal tools executed in E2B sandboxes.\n * Use these constants to filter skill tool events from external tool call events.\n */\nexport const OCTAVUS_SKILL_TOOLS = {\n SKILL_READ: 'octavus_skill_read',\n SKILL_LIST: 'octavus_skill_list',\n SKILL_RUN: 'octavus_skill_run',\n CODE_RUN: 'octavus_code_run',\n FILE_WRITE: 'octavus_file_write',\n FILE_READ: 'octavus_file_read',\n} as const;\n\nexport type OctavusSkillToolName = (typeof OCTAVUS_SKILL_TOOLS)[keyof typeof OCTAVUS_SKILL_TOOLS];\n\n/**\n * Check if a tool name is an Octavus skill tool\n *\n * @example\n * ```typescript\n * if (isOctavusSkillTool(event.toolName)) {\n * // This is a skill tool, executed in E2B sandbox\n * const skillSlug = event.input?.skill;\n * } else {\n * // This is an external tool, executed on consumer's server\n * }\n * ```\n */\nexport function isOctavusSkillTool(toolName: string): toolName is OctavusSkillToolName {\n return Object.values(OCTAVUS_SKILL_TOOLS).includes(toolName as OctavusSkillToolName);\n}\n\n/**\n * Extract skill slug from skill tool arguments\n *\n * Most skill tools include a `skill` parameter with the skill slug.\n * Returns undefined if the tool is not a skill tool or if the skill slug is not present.\n *\n * @example\n * ```typescript\n * const slug = getSkillSlugFromToolCall(event.toolName, event.input);\n * if (slug) {\n * console.log(`Using skill: ${slug}`);\n * }\n * ```\n */\nexport function getSkillSlugFromToolCall(\n toolName: string,\n args: Record<string, unknown> | undefined,\n): string | undefined {\n if (!isOctavusSkillTool(toolName) || !args) {\n return undefined;\n }\n\n // Most skill tools have a 'skill' parameter\n if (typeof args.skill === 'string') {\n return args.skill;\n }\n\n return undefined;\n}\n"],"mappings":";AAAO,IAAM,WAAN,cAAuB,MAAM;AAAA,EAClC,Y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AA,EACZ,WAAW;AACb;AAiBO,SAAS,mBAAmB,UAAoD;AACrF,SAAO,OAAO,OAAO,mBAAmB,EAAE,SAAS,QAAgC;AACrF;AAgBO,SAAS,yBACd,UACA,MACoB;AACpB,MAAI,CAAC,mBAAmB,QAAQ,KAAK,CAAC,MAAM;AAC1C,WAAO;AAAA,EACT;AAGA,MAAI,OAAO,KAAK,UAAU,UAAU;AAClC,WAAO,KAAK;AAAA,EACd;AAEA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/utils.ts","../src/thread.ts","../src/stream/schemas.ts","../src/skills.ts"],"sourcesContent":["export class AppError extends Error {\n constructor(\n message: string,\n public code: string,\n public statusCode = 500,\n ) {\n super(message);\n this.name = 'AppError';\n }\n}\n\nexport class NotFoundError extends AppError {\n constructor(resource: string, id: string) {\n super(`${resource} not found: ${id}`, 'NOT_FOUND', 404);\n this.name = 'NotFoundError';\n }\n}\n\nexport class ValidationError extends AppError {\n constructor(\n message: string,\n public issues?: unknown[],\n ) {\n super(message, 'VALIDATION_ERROR', 400);\n this.name = 'ValidationError';\n }\n}\n\nexport class ConflictError extends AppError {\n constructor(resource: string, identifier: string) {\n super(`${resource} already exists: ${identifier}`, 'CONFLICT', 409);\n this.name = 'ConflictError';\n }\n}\n","/**\n * Generate a unique ID for messages, tool calls, etc.\n * Format: timestamp-random (e.g., \"1702345678901-abc123def\")\n */\nexport function generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\n","/**\n * Default thread name when none is specified.\n */\nexport const MAIN_THREAD = 'main' as const;\n\n/**\n * Resolve a thread name, defaulting to main thread.\n */\nexport function resolveThread(thread: string | undefined): string {\n return thread ?? MAIN_THREAD;\n}\n\n/**\n * Check if a thread is the main thread.\n */\nexport function isMainThread(thread: string | undefined): boolean {\n return thread === undefined || thread === MAIN_THREAD;\n}\n\n/**\n * Normalize thread for storage in message parts.\n * Main thread is stored as undefined to save space.\n */\nexport function threadForPart(thread: string | undefined): string | undefined {\n return isMainThread(thread) ? undefined : thread;\n}\n\n/**\n * Check if a message part belongs to a non-main thread.\n * Non-main thread content (e.g., \"summary\") is typically displayed differently.\n */\nexport function isOtherThread(part: { thread?: string }): boolean {\n return !isMainThread(part.thread);\n}\n","/**\n * Zod schemas for stream events.\n *\n * Schemas are organized into two categories:\n * - Standard Events (====): Aligned with Vercel AI SDK for interoperability\n * - Octavus Events (----): Octavus-specific protocol events\n */\n\nimport { z } from 'zod';\n\nexport const displayModeSchema = z.enum(['hidden', 'name', 'description', 'stream']);\nexport const messageRoleSchema = z.enum(['user', 'assistant', 'system']);\nexport const toolCallStatusSchema = z.enum(['pending', 'streaming', 'available', 'error']);\nexport const finishReasonSchema = z.enum([\n 'stop',\n 'tool-calls',\n 'length',\n 'content-filter',\n 'error',\n 'other',\n]);\n\nexport const toolCallInfoSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n arguments: z.record(z.string(), z.unknown()),\n status: toolCallStatusSchema,\n result: z.unknown().optional(),\n error: z.string().optional(),\n});\n\n// =============================================================================\n// STANDARD EVENTS (aligned with Vercel AI SDK)\n// =============================================================================\n\n// ============================== Lifecycle ====================================\n\nexport const startEventSchema = z.object({\n type: z.literal('start'),\n messageId: z.string().optional(),\n});\n\nexport const finishEventSchema = z.object({\n type: z.literal('finish'),\n finishReason: finishReasonSchema,\n});\n\nexport const errorEventSchema = z.object({\n type: z.literal('error'),\n errorText: z.string(),\n});\n\n// ================================= Text ======================================\n\nexport const textStartEventSchema = z.object({\n type: z.literal('text-start'),\n id: z.string(),\n responseType: z.string().optional(),\n});\n\nexport const textDeltaEventSchema = z.object({\n type: z.literal('text-delta'),\n id: z.string(),\n delta: z.string(),\n});\n\nexport const textEndEventSchema = z.object({\n type: z.literal('text-end'),\n id: z.string(),\n});\n\n// =============================== Reasoning ===================================\n\nexport const reasoningStartEventSchema = z.object({\n type: z.literal('reasoning-start'),\n id: z.string(),\n});\n\nexport const reasoningDeltaEventSchema = z.object({\n type: z.literal('reasoning-delta'),\n id: z.string(),\n delta: z.string(),\n});\n\nexport const reasoningEndEventSchema = z.object({\n type: z.literal('reasoning-end'),\n id: z.string(),\n});\n\n// ================================= Tool ======================================\n\nexport const toolInputStartEventSchema = z.object({\n type: z.literal('tool-input-start'),\n toolCallId: z.string(),\n toolName: z.string(),\n title: z.string().optional(),\n});\n\nexport const toolInputDeltaEventSchema = z.object({\n type: z.literal('tool-input-delta'),\n toolCallId: z.string(),\n inputTextDelta: z.string(),\n});\n\nexport const toolInputEndEventSchema = z.object({\n type: z.literal('tool-input-end'),\n toolCallId: z.string(),\n});\n\nexport const toolInputAvailableEventSchema = z.object({\n type: z.literal('tool-input-available'),\n toolCallId: z.string(),\n toolName: z.string(),\n input: z.unknown(),\n});\n\nexport const toolOutputAvailableEventSchema = z.object({\n type: z.literal('tool-output-available'),\n toolCallId: z.string(),\n output: z.unknown(),\n});\n\nexport const toolOutputErrorEventSchema = z.object({\n type: z.literal('tool-output-error'),\n toolCallId: z.string(),\n errorText: z.string(),\n});\n\n// ================================ Source =====================================\n\nexport const sourceUrlEventSchema = z.object({\n type: z.literal('source'),\n sourceType: z.literal('url'),\n id: z.string(),\n url: z.string(),\n title: z.string().optional(),\n});\n\nexport const sourceDocumentEventSchema = z.object({\n type: z.literal('source'),\n sourceType: z.literal('document'),\n id: z.string(),\n mediaType: z.string(),\n title: z.string(),\n filename: z.string().optional(),\n});\n\nexport const sourceEventSchema = z.discriminatedUnion('sourceType', [\n sourceUrlEventSchema,\n sourceDocumentEventSchema,\n]);\n\n// =============================================================================\n// OCTAVUS EVENTS (protocol-specific)\n// =============================================================================\n\n// --------------------------------- Block -------------------------------------\n\nexport const blockStartEventSchema = z.object({\n type: z.literal('block-start'),\n blockId: z.string(),\n blockName: z.string(),\n blockType: z.string(),\n display: displayModeSchema,\n description: z.string().optional(),\n outputToChat: z.boolean().optional(),\n thread: z.string().optional(),\n});\n\nexport const blockEndEventSchema = z.object({\n type: z.literal('block-end'),\n blockId: z.string(),\n summary: z.string().optional(),\n});\n\nexport const resourceUpdateEventSchema = z.object({\n type: z.literal('resource-update'),\n name: z.string(),\n value: z.unknown(),\n});\n\nexport const pendingToolCallSchema = z.object({\n toolCallId: z.string(),\n toolName: z.string(),\n args: z.record(z.string(), z.unknown()),\n source: z.enum(['llm', 'block']).optional(),\n outputVariable: z.string().optional(),\n blockIndex: z.number().optional(),\n});\n\nexport const toolRequestEventSchema = z.object({\n type: z.literal('tool-request'),\n toolCalls: z.array(pendingToolCallSchema),\n});\n\nexport const toolResultSchema = z.object({\n toolCallId: z.string(),\n toolName: z.string().optional(),\n result: z.unknown().optional(),\n error: z.string().optional(),\n outputVariable: z.string().optional(),\n blockIndex: z.number().optional(),\n});\n\n// --------------------------------- File --------------------------------------\n\nexport const fileAvailableEventSchema = z.object({\n type: z.literal('file-available'),\n id: z.string(),\n mediaType: z.string(),\n url: z.string(),\n filename: z.string().optional(),\n size: z.number().optional(),\n toolCallId: z.string().optional(),\n});\n\n// =============================================================================\n// Union of all stream events\n// =============================================================================\n\n// Note: We use z.union here because source events share type: 'source' but\n// differ by sourceType. z.discriminatedUnion requires unique discriminator values.\nexport const streamEventSchema = z.union([\n // Standard events (Vercel AI SDK aligned)\n startEventSchema,\n finishEventSchema,\n errorEventSchema,\n textStartEventSchema,\n textDeltaEventSchema,\n textEndEventSchema,\n reasoningStartEventSchema,\n reasoningDeltaEventSchema,\n reasoningEndEventSchema,\n toolInputStartEventSchema,\n toolInputDeltaEventSchema,\n toolInputEndEventSchema,\n toolInputAvailableEventSchema,\n toolOutputAvailableEventSchema,\n toolOutputErrorEventSchema,\n sourceEventSchema,\n // Octavus events (protocol-specific)\n blockStartEventSchema,\n blockEndEventSchema,\n resourceUpdateEventSchema,\n toolRequestEventSchema,\n fileAvailableEventSchema,\n]);\n\n// =============================================================================\n// Internal Message Types (used by platform/runtime)\n// =============================================================================\n\nexport const messagePartTypeSchema = z.enum([\n 'text',\n 'reasoning',\n 'tool-call',\n 'source',\n 'file',\n 'object',\n]);\n\nexport const sourceUrlInfoSchema = z.object({\n sourceType: z.literal('url'),\n id: z.string(),\n url: z.string(),\n title: z.string().optional(),\n});\n\nexport const sourceDocumentInfoSchema = z.object({\n sourceType: z.literal('document'),\n id: z.string(),\n mediaType: z.string(),\n title: z.string(),\n filename: z.string().optional(),\n});\n\nexport const sourceInfoSchema = z.discriminatedUnion('sourceType', [\n sourceUrlInfoSchema,\n sourceDocumentInfoSchema,\n]);\n\nexport const fileInfoSchema = z.object({\n id: z.string(),\n mediaType: z.string(),\n url: z.string(),\n filename: z.string().optional(),\n size: z.number().optional(),\n toolCallId: z.string().optional(),\n});\n\nexport const objectInfoSchema = z.object({\n id: z.string(),\n typeName: z.string(),\n value: z.unknown(),\n});\n\nexport const messagePartSchema = z.object({\n type: messagePartTypeSchema,\n visible: z.boolean(),\n content: z.string().optional(),\n toolCall: toolCallInfoSchema.optional(),\n source: sourceInfoSchema.optional(),\n file: fileInfoSchema.optional(),\n object: objectInfoSchema.optional(),\n thread: z.string().optional(),\n});\n\nexport const chatMessageSchema = z.object({\n id: z.string(),\n role: messageRoleSchema,\n parts: z.array(messagePartSchema),\n createdAt: z.string(),\n visible: z.boolean().optional(),\n content: z.string(),\n toolCalls: z.array(toolCallInfoSchema).optional(),\n reasoning: z.string().optional(),\n reasoningSignature: z.string().optional(),\n});\n\n// =============================================================================\n// UI Message Types (used by SDKs and consumer apps)\n// =============================================================================\n\nexport const uiMessageStatusSchema = z.enum(['streaming', 'done']);\nexport const uiPartStatusSchema = z.enum(['streaming', 'done']);\nexport const uiToolCallStatusSchema = z.enum(['pending', 'running', 'done', 'error']);\n\nexport const uiTextPartSchema = z.object({\n type: z.literal('text'),\n text: z.string(),\n status: uiPartStatusSchema,\n thread: z.string().optional(),\n});\n\nexport const uiReasoningPartSchema = z.object({\n type: z.literal('reasoning'),\n text: z.string(),\n status: uiPartStatusSchema,\n thread: z.string().optional(),\n});\n\nexport const uiToolCallPartSchema = z.object({\n type: z.literal('tool-call'),\n toolCallId: z.string(),\n toolName: z.string(),\n displayName: z.string().optional(),\n args: z.record(z.string(), z.unknown()),\n result: z.unknown().optional(),\n error: z.string().optional(),\n status: uiToolCallStatusSchema,\n thread: z.string().optional(),\n});\n\nexport const uiOperationStatusSchema = z.enum(['running', 'done']);\n\nexport const uiOperationPartSchema = z.object({\n type: z.literal('operation'),\n operationId: z.string(),\n name: z.string(),\n operationType: z.string(),\n status: uiOperationStatusSchema,\n thread: z.string().optional(),\n});\n\nexport const uiSourceUrlPartSchema = z.object({\n type: z.literal('source'),\n sourceType: z.literal('url'),\n id: z.string(),\n url: z.string(),\n title: z.string().optional(),\n thread: z.string().optional(),\n});\n\nexport const uiSourceDocumentPartSchema = z.object({\n type: z.literal('source'),\n sourceType: z.literal('document'),\n id: z.string(),\n mediaType: z.string(),\n title: z.string(),\n filename: z.string().optional(),\n thread: z.string().optional(),\n});\n\nexport const uiSourcePartSchema = z.discriminatedUnion('sourceType', [\n uiSourceUrlPartSchema,\n uiSourceDocumentPartSchema,\n]);\n\nexport const uiFilePartSchema = z.object({\n type: z.literal('file'),\n id: z.string(),\n mediaType: z.string(),\n url: z.string(),\n filename: z.string().optional(),\n size: z.number().optional(),\n toolCallId: z.string().optional(),\n thread: z.string().optional(),\n});\n\nexport const uiObjectStatusSchema = z.enum(['streaming', 'done', 'error']);\n\nexport const uiObjectPartSchema = z.object({\n type: z.literal('object'),\n id: z.string(),\n typeName: z.string(),\n partial: z.unknown().optional(),\n object: z.unknown().optional(),\n status: uiObjectStatusSchema,\n error: z.string().optional(),\n thread: z.string().optional(),\n});\n\n// Note: We use z.union here because source parts share type: 'source' but\n// differ by sourceType. z.discriminatedUnion requires unique discriminator values.\nexport const uiMessagePartSchema = z.union([\n uiTextPartSchema,\n uiReasoningPartSchema,\n uiToolCallPartSchema,\n uiOperationPartSchema,\n uiSourcePartSchema,\n uiFilePartSchema,\n uiObjectPartSchema,\n]);\n\nexport const uiMessageSchema = z.object({\n id: z.string(),\n role: z.enum(['user', 'assistant']),\n parts: z.array(uiMessagePartSchema),\n status: uiMessageStatusSchema,\n createdAt: z.coerce.date(),\n});\n\nexport function safeParseStreamEvent(data: unknown) {\n return streamEventSchema.safeParse(data);\n}\n\nexport function safeParseUIMessage(data: unknown) {\n return uiMessageSchema.safeParse(data);\n}\n\nexport function safeParseUIMessages(data: unknown) {\n return z.array(uiMessageSchema).safeParse(data);\n}\n","/**\n * Octavus skill tool names\n *\n * These are internal tools executed in E2B sandboxes.\n * Use these constants to filter skill tool events from external tool call events.\n */\nexport const OCTAVUS_SKILL_TOOLS = {\n SKILL_READ: 'octavus_skill_read',\n SKILL_LIST: 'octavus_skill_list',\n SKILL_RUN: 'octavus_skill_run',\n CODE_RUN: 'octavus_code_run',\n FILE_WRITE: 'octavus_file_write',\n FILE_READ: 'octavus_file_read',\n} as const;\n\nexport type OctavusSkillToolName = (typeof OCTAVUS_SKILL_TOOLS)[keyof typeof OCTAVUS_SKILL_TOOLS];\n\n/**\n * Check if a tool name is an Octavus skill tool\n *\n * @example\n * ```typescript\n * if (isOctavusSkillTool(event.toolName)) {\n * // This is a skill tool, executed in E2B sandbox\n * const skillSlug = event.input?.skill;\n * } else {\n * // This is an external tool, executed on consumer's server\n * }\n * ```\n */\nexport function isOctavusSkillTool(toolName: string): toolName is OctavusSkillToolName {\n return Object.values(OCTAVUS_SKILL_TOOLS).includes(toolName as OctavusSkillToolName);\n}\n\n/**\n * Extract skill slug from skill tool arguments\n *\n * Most skill tools include a `skill` parameter with the skill slug.\n * Returns undefined if the tool is not a skill tool or if the skill slug is not present.\n *\n * @example\n * ```typescript\n * const slug = getSkillSlugFromToolCall(event.toolName, event.input);\n * if (slug) {\n * console.log(`Using skill: ${slug}`);\n * }\n * ```\n */\nexport function getSkillSlugFromToolCall(\n toolName: string,\n args: Record<string, unknown> | undefined,\n): string | undefined {\n if (!isOctavusSkillTool(toolName) || !args) {\n return undefined;\n }\n\n // Most skill tools have a 'sk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