@octavus/core 0.0.10 → 0.0.12

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 CHANGED
@@ -67,10 +67,21 @@ interface ErrorEvent {
67
67
  errorText: string;
68
68
  }
69
69
  type FinishReason = 'stop' | 'tool-calls' | 'length' | 'content-filter' | 'error' | 'other';
70
- /** Start of text generation for a specific text part */
70
+ /**
71
+ * Start of text generation for a specific text part.
72
+ *
73
+ * If `responseType` is set, the text content is JSON matching a custom type.
74
+ * The client SDK should parse the text as a structured object instead of
75
+ * displaying it as plain text.
76
+ */
71
77
  interface TextStartEvent {
72
78
  type: 'text-start';
73
79
  id: string;
80
+ /**
81
+ * If specified, the text content is JSON matching this type name.
82
+ * Client SDK should parse as object, not display as text.
83
+ */
84
+ responseType?: string;
74
85
  }
75
86
  /** Incremental text content */
76
87
  interface TextDeltaEvent {
@@ -217,11 +228,46 @@ interface ToolResult {
217
228
  outputVariable?: string;
218
229
  blockIndex?: number;
219
230
  }
220
- type StreamEvent = StartEvent | FinishEvent | ErrorEvent | TextStartEvent | TextDeltaEvent | TextEndEvent | ReasoningStartEvent | ReasoningDeltaEvent | ReasoningEndEvent | ToolInputStartEvent | ToolInputDeltaEvent | ToolInputEndEvent | ToolInputAvailableEvent | ToolOutputAvailableEvent | ToolOutputErrorEvent | SourceEvent | BlockStartEvent | BlockEndEvent | ResourceUpdateEvent | ToolRequestEvent;
231
+ /**
232
+ * A file generated during execution (aligned with Vercel AI SDK FilePart).
233
+ * Used for skill outputs, image generation, code execution artifacts, etc.
234
+ */
235
+ interface GeneratedFile {
236
+ /** Unique file ID */
237
+ id: string;
238
+ /** MIME type (e.g., 'image/png', 'application/pdf') - aligned with Vercel AI SDK */
239
+ mediaType: string;
240
+ /** URL for download/display (presigned S3 URL or data URL) */
241
+ url: string;
242
+ /** Original filename (optional, for display/download) */
243
+ filename?: string;
244
+ /** Size in bytes (optional, for display) */
245
+ size?: number;
246
+ }
247
+ /**
248
+ * File generated and available for download/display.
249
+ * Emitted when a tool or skill produces a file output.
250
+ */
251
+ interface FileAvailableEvent {
252
+ type: 'file-available';
253
+ /** Unique file ID */
254
+ id: string;
255
+ /** MIME type (aligned with Vercel AI SDK) */
256
+ mediaType: string;
257
+ /** URL for download/display */
258
+ url: string;
259
+ /** Original filename */
260
+ filename?: string;
261
+ /** Size in bytes */
262
+ size?: number;
263
+ /** Tool call that generated this file */
264
+ toolCallId?: string;
265
+ }
266
+ type StreamEvent = StartEvent | FinishEvent | ErrorEvent | TextStartEvent | TextDeltaEvent | TextEndEvent | ReasoningStartEvent | ReasoningDeltaEvent | ReasoningEndEvent | ToolInputStartEvent | ToolInputDeltaEvent | ToolInputEndEvent | ToolInputAvailableEvent | ToolOutputAvailableEvent | ToolOutputErrorEvent | SourceEvent | BlockStartEvent | BlockEndEvent | ResourceUpdateEvent | ToolRequestEvent | FileAvailableEvent;
221
267
  /**
222
268
  * Type of content in a message part (internal)
223
269
  */
224
- type MessagePartType = 'text' | 'reasoning' | 'tool-call' | 'source';
270
+ type MessagePartType = 'text' | 'reasoning' | 'tool-call' | 'source' | 'file' | 'object';
225
271
  /**
226
272
  * Source info for URL sources (from web search, etc.)
227
273
  */
@@ -245,6 +291,27 @@ interface SourceDocumentInfo {
245
291
  * Source info - union of all source types (internal)
246
292
  */
247
293
  type SourceInfo = SourceUrlInfo | SourceDocumentInfo;
294
+ /**
295
+ * File info for generated files (from skill execution, code execution, etc.)
296
+ */
297
+ interface FileInfo {
298
+ id: string;
299
+ mediaType: string;
300
+ url: string;
301
+ filename?: string;
302
+ size?: number;
303
+ toolCallId?: string;
304
+ }
305
+ /**
306
+ * Object info for structured output (internal storage)
307
+ */
308
+ interface ObjectInfo {
309
+ id: string;
310
+ /** Type name from the protocol */
311
+ typeName: string;
312
+ /** The structured object value */
313
+ value: unknown;
314
+ }
248
315
  /**
249
316
  * A single part of a message, stored in order for proper display (internal)
250
317
  */
@@ -258,6 +325,10 @@ interface MessagePart {
258
325
  toolCall?: ToolCallInfo;
259
326
  /** Source info for source parts (from web search, etc.) */
260
327
  source?: SourceInfo;
328
+ /** File info for file parts (from skill execution, etc.) */
329
+ file?: FileInfo;
330
+ /** Object info for object parts (structured output) */
331
+ object?: ObjectInfo;
261
332
  /** Thread name for non-main-thread content (e.g., "summary") */
262
333
  thread?: string;
263
334
  }
@@ -378,10 +449,57 @@ interface UISourceDocumentPart extends BaseUISourcePart {
378
449
  * Source part - union of all source types
379
450
  */
380
451
  type UISourcePart = UISourceUrlPart | UISourceDocumentPart;
452
+ /**
453
+ * File attachment part (aligned with Vercel AI SDK FilePart).
454
+ * Generated by skill execution, image generation, code execution, etc.
455
+ */
456
+ interface UIFilePart {
457
+ type: 'file';
458
+ /** Unique file ID */
459
+ id: string;
460
+ /** MIME type for rendering (aligned with Vercel AI SDK) */
461
+ mediaType: string;
462
+ /** URL for download/display (presigned URL or data URL) */
463
+ url: string;
464
+ /** Original filename (for display/download) */
465
+ filename?: string;
466
+ /** Size in bytes */
467
+ size?: number;
468
+ /** Tool call that generated this file */
469
+ toolCallId?: string;
470
+ /** Thread name (undefined or 'main' for main thread) */
471
+ thread?: string;
472
+ }
473
+ /**
474
+ * Status of a UI object part
475
+ */
476
+ type UIObjectStatus = 'streaming' | 'done' | 'error';
477
+ /**
478
+ * Structured object part in a UI message.
479
+ * Used when the agent response is a typed object (structured output).
480
+ * Client applications can render custom UI based on the typeName.
481
+ */
482
+ interface UIObjectPart {
483
+ type: 'object';
484
+ /** Unique part ID */
485
+ id: string;
486
+ /** The type name from the protocol (e.g., "ChatResponse") */
487
+ typeName: string;
488
+ /** Partial object while streaming (may have missing/incomplete fields) */
489
+ partial?: unknown;
490
+ /** Final validated object when done */
491
+ object?: unknown;
492
+ /** Current status */
493
+ status: UIObjectStatus;
494
+ /** Error message if status is 'error' */
495
+ error?: string;
496
+ /** Thread name (undefined or 'main' for main thread) */
497
+ thread?: string;
498
+ }
381
499
  /**
382
500
  * Union of all UI message part types
383
501
  */
384
- type UIMessagePart = UITextPart | UIReasoningPart | UIToolCallPart | UIOperationPart | UISourcePart;
502
+ type UIMessagePart = UITextPart | UIReasoningPart | UIToolCallPart | UIOperationPart | UISourcePart | UIFilePart | UIObjectPart;
385
503
  /**
386
504
  * UI Message - the client-facing message format
387
505
  * All complexity is handled by the SDK, this is what consumers render
@@ -419,10 +537,12 @@ declare const chatMessageSchema: z.ZodObject<{
419
537
  }>;
420
538
  parts: z.ZodArray<z.ZodObject<{
421
539
  type: z.ZodEnum<{
540
+ object: "object";
422
541
  source: "source";
423
542
  text: "text";
424
543
  reasoning: "reasoning";
425
544
  "tool-call": "tool-call";
545
+ file: "file";
426
546
  }>;
427
547
  visible: z.ZodBoolean;
428
548
  content: z.ZodOptional<z.ZodString>;
@@ -452,6 +572,19 @@ declare const chatMessageSchema: z.ZodObject<{
452
572
  title: z.ZodString;
453
573
  filename: z.ZodOptional<z.ZodString>;
454
574
  }, z.core.$strip>], "sourceType">>;
575
+ file: z.ZodOptional<z.ZodObject<{
576
+ id: z.ZodString;
577
+ mediaType: z.ZodString;
578
+ url: z.ZodString;
579
+ filename: z.ZodOptional<z.ZodString>;
580
+ size: z.ZodOptional<z.ZodNumber>;
581
+ toolCallId: z.ZodOptional<z.ZodString>;
582
+ }, z.core.$strip>>;
583
+ object: z.ZodOptional<z.ZodObject<{
584
+ id: z.ZodString;
585
+ typeName: z.ZodString;
586
+ value: z.ZodUnknown;
587
+ }, z.core.$strip>>;
455
588
  thread: z.ZodOptional<z.ZodString>;
456
589
  }, z.core.$strip>>;
457
590
  createdAt: z.ZodString;
@@ -530,7 +663,29 @@ declare const uiMessagePartSchema: z.ZodUnion<readonly [z.ZodObject<{
530
663
  title: z.ZodString;
531
664
  filename: z.ZodOptional<z.ZodString>;
532
665
  thread: z.ZodOptional<z.ZodString>;
533
- }, z.core.$strip>], "sourceType">]>;
666
+ }, z.core.$strip>], "sourceType">, z.ZodObject<{
667
+ type: z.ZodLiteral<"file">;
668
+ id: z.ZodString;
669
+ mediaType: z.ZodString;
670
+ url: z.ZodString;
671
+ filename: z.ZodOptional<z.ZodString>;
672
+ size: z.ZodOptional<z.ZodNumber>;
673
+ toolCallId: z.ZodOptional<z.ZodString>;
674
+ thread: z.ZodOptional<z.ZodString>;
675
+ }, z.core.$strip>, z.ZodObject<{
676
+ type: z.ZodLiteral<"object">;
677
+ id: z.ZodString;
678
+ typeName: z.ZodString;
679
+ partial: z.ZodOptional<z.ZodUnknown>;
680
+ object: z.ZodOptional<z.ZodUnknown>;
681
+ status: z.ZodEnum<{
682
+ streaming: "streaming";
683
+ error: "error";
684
+ done: "done";
685
+ }>;
686
+ error: z.ZodOptional<z.ZodString>;
687
+ thread: z.ZodOptional<z.ZodString>;
688
+ }, z.core.$strip>]>;
534
689
  declare const uiMessageSchema: z.ZodObject<{
535
690
  id: z.ZodString;
536
691
  role: z.ZodEnum<{
@@ -593,7 +748,29 @@ declare const uiMessageSchema: z.ZodObject<{
593
748
  title: z.ZodString;
594
749
  filename: z.ZodOptional<z.ZodString>;
595
750
  thread: z.ZodOptional<z.ZodString>;
596
- }, z.core.$strip>], "sourceType">]>>;
751
+ }, z.core.$strip>], "sourceType">, z.ZodObject<{
752
+ type: z.ZodLiteral<"file">;
753
+ id: z.ZodString;
754
+ mediaType: z.ZodString;
755
+ url: z.ZodString;
756
+ filename: z.ZodOptional<z.ZodString>;
757
+ size: z.ZodOptional<z.ZodNumber>;
758
+ toolCallId: z.ZodOptional<z.ZodString>;
759
+ thread: z.ZodOptional<z.ZodString>;
760
+ }, z.core.$strip>, z.ZodObject<{
761
+ type: z.ZodLiteral<"object">;
762
+ id: z.ZodString;
763
+ typeName: z.ZodString;
764
+ partial: z.ZodOptional<z.ZodUnknown>;
765
+ object: z.ZodOptional<z.ZodUnknown>;
766
+ status: z.ZodEnum<{
767
+ streaming: "streaming";
768
+ error: "error";
769
+ done: "done";
770
+ }>;
771
+ error: z.ZodOptional<z.ZodString>;
772
+ thread: z.ZodOptional<z.ZodString>;
773
+ }, z.core.$strip>]>>;
597
774
  status: z.ZodEnum<{
598
775
  streaming: "streaming";
599
776
  done: "done";
@@ -625,6 +802,7 @@ declare function safeParseStreamEvent(data: unknown): z.ZodSafeParseResult<{
625
802
  } | {
626
803
  type: "text-start";
627
804
  id: string;
805
+ responseType?: string | undefined;
628
806
  } | {
629
807
  type: "text-delta";
630
808
  id: string;
@@ -694,6 +872,14 @@ declare function safeParseStreamEvent(data: unknown): z.ZodSafeParseResult<{
694
872
  outputVariable?: string | undefined;
695
873
  blockIndex?: number | undefined;
696
874
  }[];
875
+ } | {
876
+ type: "file-available";
877
+ id: string;
878
+ mediaType: string;
879
+ url: string;
880
+ filename?: string | undefined;
881
+ size?: number | undefined;
882
+ toolCallId?: string | undefined;
697
883
  }>;
698
884
  declare function safeParseUIMessage(data: unknown): z.ZodSafeParseResult<{
699
885
  id: string;
@@ -740,6 +926,24 @@ declare function safeParseUIMessage(data: unknown): z.ZodSafeParseResult<{
740
926
  operationType: string;
741
927
  status: "done" | "running";
742
928
  thread?: string | undefined;
929
+ } | {
930
+ type: "file";
931
+ id: string;
932
+ mediaType: string;
933
+ url: string;
934
+ filename?: string | undefined;
935
+ size?: number | undefined;
936
+ toolCallId?: string | undefined;
937
+ thread?: string | undefined;
938
+ } | {
939
+ type: "object";
940
+ id: string;
941
+ typeName: string;
942
+ status: "streaming" | "error" | "done";
943
+ partial?: unknown;
944
+ object?: unknown;
945
+ error?: string | undefined;
946
+ thread?: string | undefined;
743
947
  })[];
744
948
  status: "streaming" | "done";
745
949
  createdAt: Date;
@@ -789,9 +993,72 @@ declare function safeParseUIMessages(data: unknown): z.ZodSafeParseResult<{
789
993
  operationType: string;
790
994
  status: "done" | "running";
791
995
  thread?: string | undefined;
996
+ } | {
997
+ type: "file";
998
+ id: string;
999
+ mediaType: string;
1000
+ url: string;
1001
+ filename?: string | undefined;
1002
+ size?: number | undefined;
1003
+ toolCallId?: string | undefined;
1004
+ thread?: string | undefined;
1005
+ } | {
1006
+ type: "object";
1007
+ id: string;
1008
+ typeName: string;
1009
+ status: "streaming" | "error" | "done";
1010
+ partial?: unknown;
1011
+ object?: unknown;
1012
+ error?: string | undefined;
1013
+ thread?: string | undefined;
792
1014
  })[];
793
1015
  status: "streaming" | "done";
794
1016
  createdAt: Date;
795
1017
  }[]>;
796
1018
 
797
- export { AppError, type BlockEndEvent, type BlockStartEvent, type ChatMessage, ConflictError, type DisplayMode, type ErrorEvent, type FinishEvent, type FinishReason, type MessagePart, type MessagePartType, type MessageRole, NotFoundError, 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 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, safeParseStreamEvent, safeParseUIMessage, safeParseUIMessages, toolResultSchema, uiMessagePartSchema, uiMessageSchema };
1019
+ /**
1020
+ * Octavus skill tool names
1021
+ *
1022
+ * These are internal tools executed in E2B sandboxes.
1023
+ * Use these constants to filter skill tool events from external tool call events.
1024
+ */
1025
+ declare const OCTAVUS_SKILL_TOOLS: {
1026
+ readonly SKILL_READ: "octavus_skill_read";
1027
+ readonly SKILL_LIST: "octavus_skill_list";
1028
+ readonly SKILL_RUN: "octavus_skill_run";
1029
+ readonly CODE_RUN: "octavus_code_run";
1030
+ readonly FILE_WRITE: "octavus_file_write";
1031
+ readonly FILE_READ: "octavus_file_read";
1032
+ };
1033
+ type OctavusSkillToolName = (typeof OCTAVUS_SKILL_TOOLS)[keyof typeof OCTAVUS_SKILL_TOOLS];
1034
+ /**
1035
+ * Check if a tool name is an Octavus skill tool
1036
+ *
1037
+ * @example
1038
+ * ```typescript
1039
+ * if (isOctavusSkillTool(event.toolName)) {
1040
+ * // This is a skill tool, executed in E2B sandbox
1041
+ * const skillSlug = event.input?.skill;
1042
+ * } else {
1043
+ * // This is an external tool, executed on consumer's server
1044
+ * }
1045
+ * ```
1046
+ */
1047
+ declare function isOctavusSkillTool(toolName: string): toolName is OctavusSkillToolName;
1048
+ /**
1049
+ * Extract skill slug from skill tool arguments
1050
+ *
1051
+ * Most skill tools include a `skill` parameter with the skill slug.
1052
+ * Returns undefined if the tool is not a skill tool or if the skill slug is not present.
1053
+ *
1054
+ * @example
1055
+ * ```typescript
1056
+ * const slug = getSkillSlugFromToolCall(event.toolName, event.input);
1057
+ * if (slug) {
1058
+ * console.log(`Using skill: ${slug}`);
1059
+ * }
1060
+ * ```
1061
+ */
1062
+ declare function getSkillSlugFromToolCall(toolName: string, args: Record<string, unknown> | undefined): string | undefined;
1063
+
1064
+ 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 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, isOctavusSkillTool, safeParseStreamEvent, safeParseUIMessage, safeParseUIMessages, toolResultSchema, uiMessagePartSchema, uiMessageSchema };
package/dist/index.js CHANGED
@@ -68,7 +68,8 @@ var errorEventSchema = z.object({
68
68
  });
69
69
  var textStartEventSchema = z.object({
70
70
  type: z.literal("text-start"),
71
- id: z.string()
71
+ id: z.string(),
72
+ responseType: z.string().optional()
72
73
  });
73
74
  var textDeltaEventSchema = z.object({
74
75
  type: z.literal("text-delta"),
@@ -182,6 +183,15 @@ var toolResultSchema = z.object({
182
183
  outputVariable: z.string().optional(),
183
184
  blockIndex: z.number().optional()
184
185
  });
186
+ var fileAvailableEventSchema = z.object({
187
+ type: z.literal("file-available"),
188
+ id: z.string(),
189
+ mediaType: z.string(),
190
+ url: z.string(),
191
+ filename: z.string().optional(),
192
+ size: z.number().optional(),
193
+ toolCallId: z.string().optional()
194
+ });
185
195
  var streamEventSchema = z.union([
186
196
  // Standard events (Vercel AI SDK aligned)
187
197
  startEventSchema,
@@ -204,9 +214,17 @@ var streamEventSchema = z.union([
204
214
  blockStartEventSchema,
205
215
  blockEndEventSchema,
206
216
  resourceUpdateEventSchema,
207
- toolRequestEventSchema
217
+ toolRequestEventSchema,
218
+ fileAvailableEventSchema
219
+ ]);
220
+ var messagePartTypeSchema = z.enum([
221
+ "text",
222
+ "reasoning",
223
+ "tool-call",
224
+ "source",
225
+ "file",
226
+ "object"
208
227
  ]);
209
- var messagePartTypeSchema = z.enum(["text", "reasoning", "tool-call", "source"]);
210
228
  var sourceUrlInfoSchema = z.object({
211
229
  sourceType: z.literal("url"),
212
230
  id: z.string(),
@@ -224,12 +242,27 @@ var sourceInfoSchema = z.discriminatedUnion("sourceType", [
224
242
  sourceUrlInfoSchema,
225
243
  sourceDocumentInfoSchema
226
244
  ]);
245
+ var fileInfoSchema = z.object({
246
+ id: z.string(),
247
+ mediaType: z.string(),
248
+ url: z.string(),
249
+ filename: z.string().optional(),
250
+ size: z.number().optional(),
251
+ toolCallId: z.string().optional()
252
+ });
253
+ var objectInfoSchema = z.object({
254
+ id: z.string(),
255
+ typeName: z.string(),
256
+ value: z.unknown()
257
+ });
227
258
  var messagePartSchema = z.object({
228
259
  type: messagePartTypeSchema,
229
260
  visible: z.boolean(),
230
261
  content: z.string().optional(),
231
262
  toolCall: toolCallInfoSchema.optional(),
232
263
  source: sourceInfoSchema.optional(),
264
+ file: fileInfoSchema.optional(),
265
+ object: objectInfoSchema.optional(),
233
266
  thread: z.string().optional()
234
267
  });
235
268
  var chatMessageSchema = z.object({
@@ -299,12 +332,35 @@ var uiSourcePartSchema = z.discriminatedUnion("sourceType", [
299
332
  uiSourceUrlPartSchema,
300
333
  uiSourceDocumentPartSchema
301
334
  ]);
335
+ var uiFilePartSchema = z.object({
336
+ type: z.literal("file"),
337
+ id: z.string(),
338
+ mediaType: z.string(),
339
+ url: z.string(),
340
+ filename: z.string().optional(),
341
+ size: z.number().optional(),
342
+ toolCallId: z.string().optional(),
343
+ thread: z.string().optional()
344
+ });
345
+ var uiObjectStatusSchema = z.enum(["streaming", "done", "error"]);
346
+ var uiObjectPartSchema = z.object({
347
+ type: z.literal("object"),
348
+ id: z.string(),
349
+ typeName: z.string(),
350
+ partial: z.unknown().optional(),
351
+ object: z.unknown().optional(),
352
+ status: uiObjectStatusSchema,
353
+ error: z.string().optional(),
354
+ thread: z.string().optional()
355
+ });
302
356
  var uiMessagePartSchema = z.union([
303
357
  uiTextPartSchema,
304
358
  uiReasoningPartSchema,
305
359
  uiToolCallPartSchema,
306
360
  uiOperationPartSchema,
307
- uiSourcePartSchema
361
+ uiSourcePartSchema,
362
+ uiFilePartSchema,
363
+ uiObjectPartSchema
308
364
  ]);
309
365
  var uiMessageSchema = z.object({
310
366
  id: z.string(),
@@ -322,13 +378,38 @@ function safeParseUIMessage(data) {
322
378
  function safeParseUIMessages(data) {
323
379
  return z.array(uiMessageSchema).safeParse(data);
324
380
  }
381
+
382
+ // src/skills.ts
383
+ var OCTAVUS_SKILL_TOOLS = {
384
+ SKILL_READ: "octavus_skill_read",
385
+ SKILL_LIST: "octavus_skill_list",
386
+ SKILL_RUN: "octavus_skill_run",
387
+ CODE_RUN: "octavus_code_run",
388
+ FILE_WRITE: "octavus_file_write",
389
+ FILE_READ: "octavus_file_read"
390
+ };
391
+ function isOctavusSkillTool(toolName) {
392
+ return Object.values(OCTAVUS_SKILL_TOOLS).includes(toolName);
393
+ }
394
+ function getSkillSlugFromToolCall(toolName, args) {
395
+ if (!isOctavusSkillTool(toolName) || !args) {
396
+ return void 0;
397
+ }
398
+ if (typeof args.skill === "string") {
399
+ return args.skill;
400
+ }
401
+ return void 0;
402
+ }
325
403
  export {
326
404
  AppError,
327
405
  ConflictError,
328
406
  NotFoundError,
407
+ OCTAVUS_SKILL_TOOLS,
329
408
  ValidationError,
330
409
  chatMessageSchema,
331
410
  generateId,
411
+ getSkillSlugFromToolCall,
412
+ isOctavusSkillTool,
332
413
  safeParseStreamEvent,
333
414
  safeParseUIMessage,
334
415
  safeParseUIMessages,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/utils.ts","../src/stream/schemas.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// =============================================================================\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]);\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\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]);\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"],"mappings":";AAAO,IAAM,WAAN,cAAuB,MAAM;AAAA,EAClC,YACE,SACO,MACA,aAAa,KACpB;AACA,UAAM,OAAO;AAHN;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,gBAAN,cAA4B,SAAS;AAAA,EAC1C,YAAY,UAAkB,IAAY;AACxC,UAAM,GAAG,QAAQ,eAAe,EAAE,IAAI,aAAa,GAAG;AACtD,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,kBA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AqB,MAAe;AAClD,SAAO,kBAAkB,UAAU,IAAI;AACzC;AAEO,SAAS,mBAAmB,MAAe;AAChD,SAAO,gBAAgB,UAAU,IAAI;AACvC;AAEO,SAAS,oBAAoB,MAAe;AACjD,SAAO,EAAE,MAAM,eAAe,EAAE,UAAU,IAAI;AAChD;","names":[]}
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 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 '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,YACE,SACO,MACA,aAAa,KACpB;AACA,UAAM,OAAO;AAHN;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,gBAAN,cAA4B,SAAS;AAAA,EAC1C,YAAY,UAAkB,IAAY;AACxC,UAAM,GAAG,QAAQ,eAAe,EAAE,IAAI,aAAa,GAAG;AACtD,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,kBAAN,cAA8B,SAAS;AAAA,EAC5C,YACE,SACO,QACP;AACA,UAAM,SAAS,oBAAoB,GAAG;AAF/B;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,gBAAN,cAA4B,SAAS;AAAA,EAC1C,YAAY,UAAkB,YAAoB;AAChD,UAAM,GAAG,QAAQ,oBAAoB,U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,EACb,MAAM,EAAE,KAAK,CAAC,QAAQ,WAAW,CAAC;AAAA,EAClC,OAAO,EAAE,MAAM,mBAAmB;AAAA,EAClC,QAAQ;AAAA,EACR,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC;AAEM,SAAS,qBAAqB,MAAe;AAClD,SAAO,kBAAkB,UAAU,IAAI;AACzC;AAEO,SAAS,mBAAmB,MAAe;AAChD,SAAO,gBAAgB,UAAU,IAAI;AACvC;AAEO,SAAS,oBAAoB,MAAe;AACjD,SAAO,EAAE,MAAM,eAAe,EAAE,UAAU,IAAI;AAChD;;;ACrbO,IAAM,sBAAsB;AAAA,EACjC,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,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":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octavus/core",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "Public types and utilities for Octavus client/server SDK communication",
5
5
  "license": "MIT",
6
6
  "author": "Octavus AI <dev@octavus.ai>",