@cossistant/core 0.0.31 → 0.0.33

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.
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-item.js","names":[],"sources":["../../../../../types/src/api/timeline-item.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\n\nimport {\n\tConversationEventType,\n\tConversationTimelineType,\n\tTimelineItemVisibility,\n} from \"../enums\";\n\n// ============================================================================\n// AI SDK v6 COMPATIBLE PART SCHEMAS\n// These follow Vercel AI SDK v6 patterns for UIMessagePart types.\n// Cossistant extensions use providerMetadata.cossistant namespace.\n// ============================================================================\n\n// ----------------------------------------------------------------------------\n// Cossistant Provider Metadata (extension point for all parts)\n// ----------------------------------------------------------------------------\nconst cossistantProviderMetadataSchema = z\n\t.object({\n\t\tcossistant: z\n\t\t\t.object({\n\t\t\t\tvisibility: z.enum([\"public\", \"private\"]).optional().openapi({\n\t\t\t\t\tdescription: \"Part-level visibility control for filtering\",\n\t\t\t\t}),\n\t\t\t\tprogressMessage: z.string().optional().openapi({\n\t\t\t\t\tdescription: \"Custom progress message to display during execution\",\n\t\t\t\t}),\n\t\t\t\tknowledgeId: z.string().optional().openapi({\n\t\t\t\t\tdescription: \"Reference to a Cossistant knowledge entry\",\n\t\t\t\t}),\n\t\t\t})\n\t\t\t.optional(),\n\t})\n\t.passthrough()\n\t.optional();\n\n// ----------------------------------------------------------------------------\n// TEXT PART (AI SDK compatible)\n// ----------------------------------------------------------------------------\nconst textPartSchema = z.object({\n\ttype: z.literal(\"text\").openapi({\n\t\tdescription: \"Text content part - matches AI SDK TextUIPart\",\n\t}),\n\ttext: z.string().openapi({\n\t\tdescription: \"The text content\",\n\t}),\n\tstate: z.enum([\"streaming\", \"done\"]).optional().openapi({\n\t\tdescription:\n\t\t\t\"AI SDK state: 'streaming' = still processing, 'done' = complete\",\n\t}),\n});\n\n// ----------------------------------------------------------------------------\n// REASONING PART (AI SDK compatible - for AI chain-of-thought)\n// ----------------------------------------------------------------------------\nconst reasoningPartSchema = z.object({\n\ttype: z.literal(\"reasoning\").openapi({\n\t\tdescription:\n\t\t\t\"AI reasoning/chain-of-thought - matches AI SDK ReasoningUIPart\",\n\t}),\n\ttext: z.string().openapi({\n\t\tdescription: \"The reasoning text content\",\n\t}),\n\tstate: z.enum([\"streaming\", \"done\"]).optional().openapi({\n\t\tdescription:\n\t\t\t\"AI SDK state: 'streaming' = still processing, 'done' = complete\",\n\t}),\n\tproviderMetadata: cossistantProviderMetadataSchema,\n});\n\n// ----------------------------------------------------------------------------\n// TOOL PART (AI SDK compatible - for tool invocations)\n// AI SDK uses type: `tool-${toolName}` pattern, but we use a generic schema\n// with toolName field for flexibility. Type checking happens at runtime.\n// ----------------------------------------------------------------------------\nconst toolStateSchema = z.enum([\"partial\", \"result\", \"error\"]).openapi({\n\tdescription:\n\t\t\"AI SDK tool state: 'partial' = executing, 'result' = success, 'error' = failed\",\n});\n\nconst toolPartSchema = z.object({\n\ttype: z\n\t\t.string()\n\t\t.regex(/^tool-.+$/)\n\t\t.openapi({\n\t\t\tdescription: \"Tool type following AI SDK pattern: tool-{toolName}\",\n\t\t}),\n\ttoolCallId: z.string().openapi({\n\t\tdescription: \"Unique identifier for this tool invocation\",\n\t}),\n\ttoolName: z.string().openapi({\n\t\tdescription: \"Name of the tool being invoked\",\n\t}),\n\tinput: z.record(z.string(), z.unknown()).openapi({\n\t\tdescription: \"Input parameters passed to the tool\",\n\t}),\n\toutput: z.unknown().optional().openapi({\n\t\tdescription: \"Output returned by the tool (when state is 'result')\",\n\t}),\n\tstate: toolStateSchema,\n\terrorText: z.string().optional().openapi({\n\t\tdescription: \"Error message when state is 'error'\",\n\t}),\n\tproviderMetadata: cossistantProviderMetadataSchema,\n});\n\n// ----------------------------------------------------------------------------\n// SOURCE URL PART (AI SDK compatible - for citations)\n// ----------------------------------------------------------------------------\nconst sourceUrlPartSchema = z.object({\n\ttype: z.literal(\"source-url\").openapi({\n\t\tdescription: \"URL source citation - matches AI SDK SourceUrlUIPart\",\n\t}),\n\tsourceId: z.string().openapi({\n\t\tdescription: \"Unique identifier for this source\",\n\t}),\n\turl: z.string().url().openapi({\n\t\tdescription: \"URL of the source\",\n\t}),\n\ttitle: z.string().optional().openapi({\n\t\tdescription: \"Title of the source\",\n\t}),\n\tproviderMetadata: cossistantProviderMetadataSchema,\n});\n\n// ----------------------------------------------------------------------------\n// SOURCE DOCUMENT PART (AI SDK compatible - for document citations)\n// ----------------------------------------------------------------------------\nconst sourceDocumentPartSchema = z.object({\n\ttype: z.literal(\"source-document\").openapi({\n\t\tdescription:\n\t\t\t\"Document source citation - matches AI SDK SourceDocumentUIPart\",\n\t}),\n\tsourceId: z.string().openapi({\n\t\tdescription: \"Unique identifier for this source\",\n\t}),\n\tmediaType: z.string().openapi({\n\t\tdescription: \"IANA media type of the document\",\n\t}),\n\ttitle: z.string().openapi({\n\t\tdescription: \"Title of the document\",\n\t}),\n\tfilename: z.string().optional().openapi({\n\t\tdescription: \"Filename of the document\",\n\t}),\n\tproviderMetadata: cossistantProviderMetadataSchema,\n});\n\n// ----------------------------------------------------------------------------\n// STEP START PART (AI SDK compatible - for multi-step boundaries)\n// ----------------------------------------------------------------------------\nconst stepStartPartSchema = z.object({\n\ttype: z.literal(\"step-start\").openapi({\n\t\tdescription: \"Step boundary marker - matches AI SDK StepStartUIPart\",\n\t}),\n});\n\n// ----------------------------------------------------------------------------\n// FILE PART (AI SDK compatible)\n// ----------------------------------------------------------------------------\nconst filePartSchema = z.object({\n\ttype: z.literal(\"file\").openapi({\n\t\tdescription: \"File attachment - matches AI SDK FileUIPart\",\n\t}),\n\turl: z.string().openapi({\n\t\tdescription: \"URL of the file (can be hosted URL or Data URL)\",\n\t}),\n\tmediaType: z.string().openapi({\n\t\tdescription: \"IANA media type of the file\",\n\t}),\n\tfilename: z.string().optional().openapi({\n\t\tdescription: \"Original filename\",\n\t}),\n\t// Cossistant extension: additional file metadata\n\tsize: z.number().optional().openapi({\n\t\tdescription: \"Size of the file in bytes\",\n\t}),\n});\n\n// ----------------------------------------------------------------------------\n// IMAGE PART (Cossistant extension - more detailed than AI SDK file)\n// ----------------------------------------------------------------------------\nconst imagePartSchema = z.object({\n\ttype: z.literal(\"image\").openapi({\n\t\tdescription: \"Image attachment with dimensions\",\n\t}),\n\turl: z.string().openapi({\n\t\tdescription: \"URL of the image\",\n\t}),\n\tmediaType: z.string().openapi({\n\t\tdescription: \"IANA media type of the image\",\n\t}),\n\t// Use lowercase 'filename' for AI SDK consistency\n\t// Note: Legacy data may have 'fileName' - conversion utilities handle both\n\tfilename: z.string().optional().openapi({\n\t\tdescription: \"Original filename of the image\",\n\t}),\n\tsize: z.number().optional().openapi({\n\t\tdescription: \"Size of the image in bytes\",\n\t}),\n\twidth: z.number().optional().openapi({\n\t\tdescription: \"Width of the image in pixels\",\n\t}),\n\theight: z.number().optional().openapi({\n\t\tdescription: \"Height of the image in pixels\",\n\t}),\n});\n\n// ============================================================================\n// COSSISTANT-SPECIFIC PART SCHEMAS\n// These are Cossistant-specific parts not in AI SDK\n// ============================================================================\n\nconst timelinePartEventSchema = z.object({\n\ttype: z.literal(\"event\").openapi({\n\t\tdescription: \"Type of timeline part - always 'event' for event parts\",\n\t}),\n\teventType: z\n\t\t.enum([\n\t\t\tConversationEventType.ASSIGNED,\n\t\t\tConversationEventType.UNASSIGNED,\n\t\t\tConversationEventType.PARTICIPANT_REQUESTED,\n\t\t\tConversationEventType.PARTICIPANT_JOINED,\n\t\t\tConversationEventType.PARTICIPANT_LEFT,\n\t\t\tConversationEventType.STATUS_CHANGED,\n\t\t\tConversationEventType.PRIORITY_CHANGED,\n\t\t\tConversationEventType.TAG_ADDED,\n\t\t\tConversationEventType.TAG_REMOVED,\n\t\t\tConversationEventType.RESOLVED,\n\t\t\tConversationEventType.REOPENED,\n\t\t\tConversationEventType.VISITOR_BLOCKED,\n\t\t\tConversationEventType.VISITOR_UNBLOCKED,\n\t\t\tConversationEventType.VISITOR_IDENTIFIED,\n\t\t])\n\t\t.openapi({\n\t\t\tdescription: \"Type of event that occurred\",\n\t\t}),\n\tactorUserId: z.string().nullable().openapi({\n\t\tdescription: \"User that triggered the event, if applicable\",\n\t}),\n\tactorAiAgentId: z.string().nullable().openapi({\n\t\tdescription: \"AI agent that triggered the event, if applicable\",\n\t}),\n\ttargetUserId: z.string().nullable().openapi({\n\t\tdescription: \"User targeted by the event, if applicable\",\n\t}),\n\ttargetAiAgentId: z.string().nullable().openapi({\n\t\tdescription: \"AI agent targeted by the event, if applicable\",\n\t}),\n\tmessage: z.string().nullable().optional().openapi({\n\t\tdescription: \"Optional human readable message attached to the event\",\n\t}),\n});\n\nconst timelinePartMetadataSchema = z.object({\n\ttype: z.literal(\"metadata\").openapi({\n\t\tdescription: \"Type of timeline part - always 'metadata' for metadata parts\",\n\t}),\n\tsource: z.enum([\"email\", \"widget\", \"api\"]).openapi({\n\t\tdescription: \"Source channel through which the message was created\",\n\t}),\n});\n\n// ============================================================================\n// TIMELINE ITEM PARTS UNION\n// Combines AI SDK compatible parts with Cossistant-specific parts\n// ============================================================================\n\nexport const timelineItemPartsSchema = z\n\t.array(\n\t\tz.union([\n\t\t\t// AI SDK compatible parts\n\t\t\ttextPartSchema,\n\t\t\treasoningPartSchema,\n\t\t\ttoolPartSchema,\n\t\t\tsourceUrlPartSchema,\n\t\t\tsourceDocumentPartSchema,\n\t\t\tstepStartPartSchema,\n\t\t\tfilePartSchema,\n\t\t\timagePartSchema,\n\t\t\t// Cossistant-specific parts\n\t\t\ttimelinePartEventSchema,\n\t\t\ttimelinePartMetadataSchema,\n\t\t])\n\t)\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Array of timeline parts that make up the timeline item content. Includes AI SDK compatible parts (text, reasoning, tool-*, source-url, source-document, step-start, file, image) and Cossistant-specific parts (event, metadata).\",\n\t});\n\nexport const timelineItemSchema = z.object({\n\tid: z.string().optional().openapi({\n\t\tdescription: \"Unique identifier for the timeline item\",\n\t}),\n\tconversationId: z.string().openapi({\n\t\tdescription: \"ID of the conversation this timeline item belongs to\",\n\t}),\n\torganizationId: z.string().openapi({\n\t\tdescription: \"ID of the organization this timeline item belongs to\",\n\t}),\n\tvisibility: z\n\t\t.enum([TimelineItemVisibility.PUBLIC, TimelineItemVisibility.PRIVATE])\n\t\t.openapi({\n\t\t\tdescription: \"Visibility level of the timeline item\",\n\t\t}),\n\ttype: z\n\t\t.enum([\n\t\t\tConversationTimelineType.MESSAGE,\n\t\t\tConversationTimelineType.EVENT,\n\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t])\n\t\t.openapi({\n\t\t\tdescription:\n\t\t\t\t\"Type of timeline item - message, event, or interactive identification tool\",\n\t\t}),\n\ttext: z.string().nullable().openapi({\n\t\tdescription: \"Main text content of the timeline item\",\n\t}),\n\ttool: z.string().nullable().optional().openapi({\n\t\tdescription: \"Optional tool identifier associated with this timeline item\",\n\t}),\n\tparts: timelineItemPartsSchema,\n\tuserId: z.string().nullable().openapi({\n\t\tdescription: \"ID of the user who created this timeline item, if applicable\",\n\t}),\n\taiAgentId: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"ID of the AI agent that created this timeline item, if applicable\",\n\t}),\n\tvisitorId: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"ID of the visitor who created this timeline item, if applicable\",\n\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"ISO 8601 timestamp when the timeline item was created\",\n\t}),\n\tdeletedAt: z.string().nullable().optional().openapi({\n\t\tdescription:\n\t\t\t\"ISO 8601 timestamp when the timeline item was deleted, if applicable\",\n\t}),\n});\n\nexport type timelineItemSchema = z.infer<typeof timelineItemSchema>;\n\nexport type TimelineItem = z.infer<typeof timelineItemSchema>;\nexport type TimelineItemParts = z.infer<typeof timelineItemPartsSchema>;\n\n// AI SDK compatible part types\nexport type TextPart = z.infer<typeof textPartSchema>;\nexport type ReasoningPart = z.infer<typeof reasoningPartSchema>;\nexport type ToolPart = z.infer<typeof toolPartSchema>;\nexport type SourceUrlPart = z.infer<typeof sourceUrlPartSchema>;\nexport type SourceDocumentPart = z.infer<typeof sourceDocumentPartSchema>;\nexport type StepStartPart = z.infer<typeof stepStartPartSchema>;\nexport type FilePart = z.infer<typeof filePartSchema>;\nexport type ImagePart = z.infer<typeof imagePartSchema>;\n\n// Cossistant-specific part types\nexport type TimelinePartEvent = z.infer<typeof timelinePartEventSchema>;\nexport type TimelinePartMetadata = z.infer<typeof timelinePartMetadataSchema>;\n\n// Backward-compatible type aliases (deprecated, use new names)\n/** @deprecated Use `FilePart` instead */\nexport type TimelinePartFile = FilePart;\n/** @deprecated Use `ImagePart` instead */\nexport type TimelinePartImage = ImagePart;\n/** @deprecated Use `TextPart` instead */\nexport type TimelinePartText = TextPart;\n\n// Provider metadata type for extensions\nexport type CossistantProviderMetadata = z.infer<\n\ttypeof cossistantProviderMetadataSchema\n>;\n\n// Tool state type\nexport type ToolState = z.infer<typeof toolStateSchema>;\n\n// Export schemas for external use\nexport {\n\ttextPartSchema,\n\treasoningPartSchema,\n\ttoolPartSchema,\n\ttoolStateSchema,\n\tsourceUrlPartSchema,\n\tsourceDocumentPartSchema,\n\tstepStartPartSchema,\n\tfilePartSchema,\n\timagePartSchema,\n\ttimelinePartEventSchema,\n\ttimelinePartMetadataSchema,\n\tcossistantProviderMetadataSchema,\n};\n\n// REST API Schemas\nexport const getConversationTimelineItemsRequestSchema = z\n\t.object({\n\t\tlimit: z.coerce.number().min(1).max(100).default(50).openapi({\n\t\t\tdescription: \"Number of timeline items to fetch per page\",\n\t\t\tdefault: 50,\n\t\t}),\n\t\tcursor: z.string().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Cursor for pagination (timestamp_id format from previous response)\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Query parameters for fetching conversation timeline items\",\n\t});\n\nexport type GetConversationTimelineItemsRequest = z.infer<\n\ttypeof getConversationTimelineItemsRequestSchema\n>;\n\nexport const getConversationTimelineItemsResponseSchema = z\n\t.object({\n\t\titems: z.array(timelineItemSchema).openapi({\n\t\t\tdescription: \"Array of timeline items in chronological order\",\n\t\t}),\n\t\tnextCursor: z.string().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Cursor for the next page, null if no more items are available\",\n\t\t}),\n\t\thasNextPage: z.boolean().openapi({\n\t\t\tdescription: \"Whether there are more items available to fetch\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Response containing paginated timeline items\",\n\t});\n\nexport type GetConversationTimelineItemsResponse = z.infer<\n\ttypeof getConversationTimelineItemsResponseSchema\n>;\n\n// Send Timeline Item (Message) Schemas\nexport const sendTimelineItemRequestSchema = z\n\t.object({\n\t\tconversationId: z.string().openapi({\n\t\t\tdescription: \"ID of the conversation to send the timeline item to\",\n\t\t}),\n\t\titem: z.object({\n\t\t\tid: z.string().optional().openapi({\n\t\t\t\tdescription: \"Optional client-generated ID for the timeline item\",\n\t\t\t}),\n\t\t\ttype: z\n\t\t\t\t.enum([\n\t\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\t])\n\t\t\t\t.default(ConversationTimelineType.MESSAGE)\n\t\t\t\t.openapi({\n\t\t\t\t\tdescription: \"Type of timeline item - defaults to MESSAGE\",\n\t\t\t\t\tdefault: ConversationTimelineType.MESSAGE,\n\t\t\t\t}),\n\t\t\ttext: z.string().openapi({\n\t\t\t\tdescription: \"Main text content of the timeline item\",\n\t\t\t}),\n\t\t\tparts: timelineItemPartsSchema.optional(),\n\t\t\tvisibility: z\n\t\t\t\t.enum([TimelineItemVisibility.PUBLIC, TimelineItemVisibility.PRIVATE])\n\t\t\t\t.default(TimelineItemVisibility.PUBLIC)\n\t\t\t\t.openapi({\n\t\t\t\t\tdescription: \"Visibility level of the timeline item\",\n\t\t\t\t\tdefault: TimelineItemVisibility.PUBLIC,\n\t\t\t\t}),\n\t\t\ttool: z.string().nullable().optional().openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional tool identifier when sending non-message timeline items\",\n\t\t\t}),\n\t\t\tuserId: z.string().nullable().optional().openapi({\n\t\t\t\tdescription: \"ID of the user creating this timeline item\",\n\t\t\t}),\n\t\t\taiAgentId: z.string().nullable().optional().openapi({\n\t\t\t\tdescription: \"ID of the AI agent creating this timeline item\",\n\t\t\t}),\n\t\t\tvisitorId: z.string().nullable().optional().openapi({\n\t\t\t\tdescription: \"ID of the visitor creating this timeline item\",\n\t\t\t}),\n\t\t\tcreatedAt: z.string().optional().openapi({\n\t\t\t\tdescription: \"Optional timestamp for the timeline item\",\n\t\t\t}),\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request body for sending a timeline item to a conversation\",\n\t});\n\nexport type SendTimelineItemRequest = z.infer<\n\ttypeof sendTimelineItemRequestSchema\n>;\n\nexport const sendTimelineItemResponseSchema = z\n\t.object({\n\t\titem: timelineItemSchema.openapi({\n\t\t\tdescription: \"The created timeline item\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Response containing the created timeline item\",\n\t});\n\nexport type SendTimelineItemResponse = z.infer<\n\ttypeof sendTimelineItemResponseSchema\n>;\n"],"mappings":";;;;AAiBA,MAAM,mCAAmC,EACvC,OAAO,EACP,YAAY,EACV,OAAO;CACP,YAAY,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC,CAAC,UAAU,CAAC,QAAQ,EAC5D,aAAa,+CACb,CAAC;CACF,iBAAiB,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAC9C,aAAa,uDACb,CAAC;CACF,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAC1C,aAAa,6CACb,CAAC;CACF,CAAC,CACD,UAAU,EACZ,CAAC,CACD,aAAa,CACb,UAAU;AAKZ,MAAM,iBAAiB,EAAE,OAAO;CAC/B,MAAM,EAAE,QAAQ,OAAO,CAAC,QAAQ,EAC/B,aAAa,iDACb,CAAC;CACF,MAAM,EAAE,QAA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QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAChD,aAAa,8CACb,CAAC;EACF,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EACnD,aAAa,kDACb,CAAC;EACF,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EACnD,aAAa,iDACb,CAAC;EACF,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,EACxC,aAAa,4CACb,CAAC;EACF,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,8DACb,CAAC;AAMH,MAAa,iCAAiC,EAC5C,OAAO,EACP,MAAM,mBAAmB,QAAQ,EAChC,aAAa,6BACb,CAAC,EACF,CAAC,CACD,QAAQ,EACR,aAAa,iDACb,CAAC"}
1
+ {"version":3,"file":"timeline-item.js","names":[],"sources":["../../../../../types/src/api/timeline-item.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\n\nimport {\n\tConversationEventType,\n\tConversationTimelineType,\n\tTimelineItemVisibility,\n} from \"../enums\";\nimport { TOOL_TIMELINE_LOG_TYPE } from \"../tool-timeline-policy\";\n\n// ============================================================================\n// AI SDK v6 COMPATIBLE PART SCHEMAS\n// These follow Vercel AI SDK v6 patterns for UIMessagePart types.\n// Cossistant extensions use providerMetadata/callProviderMetadata.cossistant namespace.\n// ============================================================================\n\n// ----------------------------------------------------------------------------\n// Cossistant Provider Metadata (extension point for all parts)\n// ----------------------------------------------------------------------------\nconst cossistantToolTimelineMetadataSchema = z.object({\n\tlogType: z\n\t\t.enum([\n\t\t\tTOOL_TIMELINE_LOG_TYPE.CUSTOMER_FACING,\n\t\t\tTOOL_TIMELINE_LOG_TYPE.LOG,\n\t\t\tTOOL_TIMELINE_LOG_TYPE.DECISION,\n\t\t])\n\t\t.openapi({\n\t\t\tdescription:\n\t\t\t\t\"Tool timeline classification: conversation-visible, log-only, or decision stage\",\n\t\t}),\n\ttriggerMessageId: z.string().openapi({\n\t\tdescription:\n\t\t\t\"Message ID that triggered the tool/decision workflow execution\",\n\t}),\n\tworkflowRunId: z.string().openapi({\n\t\tdescription:\n\t\t\t\"Workflow run identifier used to correlate tool timeline updates\",\n\t}),\n\ttriggerVisibility: z.enum([\"public\", \"private\"]).optional().openapi({\n\t\tdescription:\n\t\t\t\"Visibility of the trigger message at the time the tool was executed\",\n\t}),\n});\n\nconst cossistantProviderMetadataSchema = z\n\t.object({\n\t\tcossistant: z\n\t\t\t.object({\n\t\t\t\tvisibility: z.enum([\"public\", \"private\"]).optional().openapi({\n\t\t\t\t\tdescription: \"Part-level visibility control for filtering\",\n\t\t\t\t}),\n\t\t\t\tprogressMessage: z.string().optional().openapi({\n\t\t\t\t\tdescription: \"Custom progress message to display during execution\",\n\t\t\t\t}),\n\t\t\t\tknowledgeId: z.string().optional().openapi({\n\t\t\t\t\tdescription: \"Reference to a Cossistant knowledge entry\",\n\t\t\t\t}),\n\t\t\t\ttoolTimeline: cossistantToolTimelineMetadataSchema.optional().openapi({\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Tool timeline metadata used to classify visibility and trigger linkage\",\n\t\t\t\t}),\n\t\t\t})\n\t\t\t.optional(),\n\t})\n\t.passthrough()\n\t.optional();\n\n// ----------------------------------------------------------------------------\n// TEXT PART (AI SDK compatible)\n// ----------------------------------------------------------------------------\nconst textPartSchema = z.object({\n\ttype: z.literal(\"text\").openapi({\n\t\tdescription: \"Text content part - matches AI SDK TextUIPart\",\n\t}),\n\ttext: z.string().openapi({\n\t\tdescription: \"The text content\",\n\t}),\n\tstate: z.enum([\"streaming\", \"done\"]).optional().openapi({\n\t\tdescription:\n\t\t\t\"AI SDK state: 'streaming' = still processing, 'done' = complete\",\n\t}),\n});\n\n// ----------------------------------------------------------------------------\n// REASONING PART (AI SDK compatible - for AI chain-of-thought)\n// ----------------------------------------------------------------------------\nconst reasoningPartSchema = z.object({\n\ttype: z.literal(\"reasoning\").openapi({\n\t\tdescription:\n\t\t\t\"AI reasoning/chain-of-thought - matches AI SDK ReasoningUIPart\",\n\t}),\n\ttext: z.string().openapi({\n\t\tdescription: \"The reasoning text content\",\n\t}),\n\tstate: z.enum([\"streaming\", \"done\"]).optional().openapi({\n\t\tdescription:\n\t\t\t\"AI SDK state: 'streaming' = still processing, 'done' = complete\",\n\t}),\n\tproviderMetadata: cossistantProviderMetadataSchema,\n});\n\n// ----------------------------------------------------------------------------\n// TOOL PART (AI SDK compatible - for tool invocations)\n// AI SDK uses type: `tool-${toolName}` pattern, but we use a generic schema\n// with toolName field for flexibility. Type checking happens at runtime.\n// ----------------------------------------------------------------------------\nconst toolStateSchema = z.enum([\"partial\", \"result\", \"error\"]).openapi({\n\tdescription:\n\t\t\"AI SDK tool state: 'partial' = executing, 'result' = success, 'error' = failed\",\n});\n\nconst toolPartSchema = z.object({\n\ttype: z\n\t\t.string()\n\t\t.regex(/^tool-.+$/)\n\t\t.openapi({\n\t\t\tdescription: \"Tool type following AI SDK pattern: tool-{toolName}\",\n\t\t}),\n\ttoolCallId: z.string().openapi({\n\t\tdescription: \"Unique identifier for this tool invocation\",\n\t}),\n\ttoolName: z.string().openapi({\n\t\tdescription: \"Name of the tool being invoked\",\n\t}),\n\tinput: z.record(z.string(), z.unknown()).openapi({\n\t\tdescription: \"Input parameters passed to the tool\",\n\t}),\n\toutput: z.unknown().optional().openapi({\n\t\tdescription: \"Output returned by the tool (when state is 'result')\",\n\t}),\n\tstate: toolStateSchema,\n\terrorText: z.string().optional().openapi({\n\t\tdescription: \"Error message when state is 'error'\",\n\t}),\n\tcallProviderMetadata: cossistantProviderMetadataSchema,\n\tproviderMetadata: cossistantProviderMetadataSchema,\n});\n\n// ----------------------------------------------------------------------------\n// SOURCE URL PART (AI SDK compatible - for citations)\n// ----------------------------------------------------------------------------\nconst sourceUrlPartSchema = z.object({\n\ttype: z.literal(\"source-url\").openapi({\n\t\tdescription: \"URL source citation - matches AI SDK SourceUrlUIPart\",\n\t}),\n\tsourceId: z.string().openapi({\n\t\tdescription: \"Unique identifier for this source\",\n\t}),\n\turl: z.string().url().openapi({\n\t\tdescription: \"URL of the source\",\n\t}),\n\ttitle: z.string().optional().openapi({\n\t\tdescription: \"Title of the source\",\n\t}),\n\tproviderMetadata: cossistantProviderMetadataSchema,\n});\n\n// ----------------------------------------------------------------------------\n// SOURCE DOCUMENT PART (AI SDK compatible - for document citations)\n// ----------------------------------------------------------------------------\nconst sourceDocumentPartSchema = z.object({\n\ttype: z.literal(\"source-document\").openapi({\n\t\tdescription:\n\t\t\t\"Document source citation - matches AI SDK SourceDocumentUIPart\",\n\t}),\n\tsourceId: z.string().openapi({\n\t\tdescription: \"Unique identifier for this source\",\n\t}),\n\tmediaType: z.string().openapi({\n\t\tdescription: \"IANA media type of the document\",\n\t}),\n\ttitle: z.string().openapi({\n\t\tdescription: \"Title of the document\",\n\t}),\n\tfilename: z.string().optional().openapi({\n\t\tdescription: \"Filename of the document\",\n\t}),\n\tproviderMetadata: cossistantProviderMetadataSchema,\n});\n\n// ----------------------------------------------------------------------------\n// STEP START PART (AI SDK compatible - for multi-step boundaries)\n// ----------------------------------------------------------------------------\nconst stepStartPartSchema = z.object({\n\ttype: z.literal(\"step-start\").openapi({\n\t\tdescription: \"Step boundary marker - matches AI SDK StepStartUIPart\",\n\t}),\n});\n\n// ----------------------------------------------------------------------------\n// FILE PART (AI SDK compatible)\n// ----------------------------------------------------------------------------\nconst filePartSchema = z.object({\n\ttype: z.literal(\"file\").openapi({\n\t\tdescription: \"File attachment - matches AI SDK FileUIPart\",\n\t}),\n\turl: z.string().openapi({\n\t\tdescription: \"URL of the file (can be hosted URL or Data URL)\",\n\t}),\n\tmediaType: z.string().openapi({\n\t\tdescription: \"IANA media type of the file\",\n\t}),\n\tfilename: z.string().optional().openapi({\n\t\tdescription: \"Original filename\",\n\t}),\n\t// Cossistant extension: additional file metadata\n\tsize: z.number().optional().openapi({\n\t\tdescription: \"Size of the file in bytes\",\n\t}),\n});\n\n// ----------------------------------------------------------------------------\n// IMAGE PART (Cossistant extension - more detailed than AI SDK file)\n// ----------------------------------------------------------------------------\nconst imagePartSchema = z.object({\n\ttype: z.literal(\"image\").openapi({\n\t\tdescription: \"Image attachment with dimensions\",\n\t}),\n\turl: z.string().openapi({\n\t\tdescription: \"URL of the image\",\n\t}),\n\tmediaType: z.string().openapi({\n\t\tdescription: \"IANA media type of the image\",\n\t}),\n\t// Use lowercase 'filename' for AI SDK consistency\n\t// Note: Legacy data may have 'fileName' - conversion utilities handle both\n\tfilename: z.string().optional().openapi({\n\t\tdescription: \"Original filename of the image\",\n\t}),\n\tsize: z.number().optional().openapi({\n\t\tdescription: \"Size of the image in bytes\",\n\t}),\n\twidth: z.number().optional().openapi({\n\t\tdescription: \"Width of the image in pixels\",\n\t}),\n\theight: z.number().optional().openapi({\n\t\tdescription: \"Height of the image in pixels\",\n\t}),\n});\n\n// ============================================================================\n// COSSISTANT-SPECIFIC PART SCHEMAS\n// These are Cossistant-specific parts not in AI SDK\n// ============================================================================\n\nconst timelinePartEventSchema = z.object({\n\ttype: z.literal(\"event\").openapi({\n\t\tdescription: \"Type of timeline part - always 'event' for event parts\",\n\t}),\n\teventType: z\n\t\t.enum([\n\t\t\tConversationEventType.ASSIGNED,\n\t\t\tConversationEventType.UNASSIGNED,\n\t\t\tConversationEventType.PARTICIPANT_REQUESTED,\n\t\t\tConversationEventType.PARTICIPANT_JOINED,\n\t\t\tConversationEventType.PARTICIPANT_LEFT,\n\t\t\tConversationEventType.STATUS_CHANGED,\n\t\t\tConversationEventType.PRIORITY_CHANGED,\n\t\t\tConversationEventType.TAG_ADDED,\n\t\t\tConversationEventType.TAG_REMOVED,\n\t\t\tConversationEventType.RESOLVED,\n\t\t\tConversationEventType.REOPENED,\n\t\t\tConversationEventType.VISITOR_BLOCKED,\n\t\t\tConversationEventType.VISITOR_UNBLOCKED,\n\t\t\tConversationEventType.VISITOR_IDENTIFIED,\n\t\t])\n\t\t.openapi({\n\t\t\tdescription: \"Type of event that occurred\",\n\t\t}),\n\tactorUserId: z.string().nullable().openapi({\n\t\tdescription: \"User that triggered the event, if applicable\",\n\t}),\n\tactorAiAgentId: z.string().nullable().openapi({\n\t\tdescription: \"AI agent that triggered the event, if applicable\",\n\t}),\n\ttargetUserId: z.string().nullable().openapi({\n\t\tdescription: \"User targeted by the event, if applicable\",\n\t}),\n\ttargetAiAgentId: z.string().nullable().openapi({\n\t\tdescription: \"AI agent targeted by the event, if applicable\",\n\t}),\n\tmessage: z.string().nullable().optional().openapi({\n\t\tdescription: \"Optional human readable message attached to the event\",\n\t}),\n});\n\nconst timelinePartMetadataSchema = z.object({\n\ttype: z.literal(\"metadata\").openapi({\n\t\tdescription: \"Type of timeline part - always 'metadata' for metadata parts\",\n\t}),\n\tsource: z.enum([\"email\", \"widget\", \"api\"]).openapi({\n\t\tdescription: \"Source channel through which the message was created\",\n\t}),\n});\n\n// ============================================================================\n// TIMELINE ITEM PARTS UNION\n// Combines AI SDK compatible parts with Cossistant-specific parts\n// ============================================================================\n\nexport const timelineItemPartsSchema = z\n\t.array(\n\t\tz.union([\n\t\t\t// AI SDK compatible parts\n\t\t\ttextPartSchema,\n\t\t\treasoningPartSchema,\n\t\t\ttoolPartSchema,\n\t\t\tsourceUrlPartSchema,\n\t\t\tsourceDocumentPartSchema,\n\t\t\tstepStartPartSchema,\n\t\t\tfilePartSchema,\n\t\t\timagePartSchema,\n\t\t\t// Cossistant-specific parts\n\t\t\ttimelinePartEventSchema,\n\t\t\ttimelinePartMetadataSchema,\n\t\t])\n\t)\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Array of timeline parts that make up the timeline item content. Includes AI SDK compatible parts (text, reasoning, tool-*, source-url, source-document, step-start, file, image) and Cossistant-specific parts (event, metadata).\",\n\t});\n\nexport const timelineItemSchema = z.object({\n\tid: z.string().optional().openapi({\n\t\tdescription: \"Unique identifier for the timeline item\",\n\t}),\n\tconversationId: z.string().openapi({\n\t\tdescription: \"ID of the conversation this timeline item belongs to\",\n\t}),\n\torganizationId: z.string().openapi({\n\t\tdescription: \"ID of the organization this timeline item belongs to\",\n\t}),\n\tvisibility: z\n\t\t.enum([TimelineItemVisibility.PUBLIC, TimelineItemVisibility.PRIVATE])\n\t\t.openapi({\n\t\t\tdescription: \"Visibility level of the timeline item\",\n\t\t}),\n\ttype: z\n\t\t.enum([\n\t\t\tConversationTimelineType.MESSAGE,\n\t\t\tConversationTimelineType.EVENT,\n\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t\tConversationTimelineType.TOOL,\n\t\t])\n\t\t.openapi({\n\t\t\tdescription:\n\t\t\t\t\"Type of timeline item - message, event, identification, or tool call\",\n\t\t}),\n\ttext: z.string().nullable().openapi({\n\t\tdescription: \"Main text content of the timeline item\",\n\t}),\n\ttool: z.string().nullable().optional().openapi({\n\t\tdescription: \"Optional tool identifier associated with this timeline item\",\n\t}),\n\tparts: timelineItemPartsSchema,\n\tuserId: z.string().nullable().openapi({\n\t\tdescription: \"ID of the user who created this timeline item, if applicable\",\n\t}),\n\taiAgentId: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"ID of the AI agent that created this timeline item, if applicable\",\n\t}),\n\tvisitorId: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"ID of the visitor who created this timeline item, if applicable\",\n\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"ISO 8601 timestamp when the timeline item was created\",\n\t}),\n\tdeletedAt: z.string().nullable().optional().openapi({\n\t\tdescription:\n\t\t\t\"ISO 8601 timestamp when the timeline item was deleted, if applicable\",\n\t}),\n});\n\nexport type timelineItemSchema = z.infer<typeof timelineItemSchema>;\n\nexport type TimelineItem = z.infer<typeof timelineItemSchema>;\nexport type TimelineItemParts = z.infer<typeof timelineItemPartsSchema>;\n\n// AI SDK compatible part types\nexport type TextPart = z.infer<typeof textPartSchema>;\nexport type ReasoningPart = z.infer<typeof reasoningPartSchema>;\nexport type ToolPart = z.infer<typeof toolPartSchema>;\nexport type SourceUrlPart = z.infer<typeof sourceUrlPartSchema>;\nexport type SourceDocumentPart = z.infer<typeof sourceDocumentPartSchema>;\nexport type StepStartPart = z.infer<typeof stepStartPartSchema>;\nexport type FilePart = z.infer<typeof filePartSchema>;\nexport type ImagePart = z.infer<typeof imagePartSchema>;\n\n// Cossistant-specific part types\nexport type TimelinePartEvent = z.infer<typeof timelinePartEventSchema>;\nexport type TimelinePartMetadata = z.infer<typeof timelinePartMetadataSchema>;\n\n// Backward-compatible type aliases (deprecated, use new names)\n/** @deprecated Use `FilePart` instead */\nexport type TimelinePartFile = FilePart;\n/** @deprecated Use `ImagePart` instead */\nexport type TimelinePartImage = ImagePart;\n/** @deprecated Use `TextPart` instead */\nexport type TimelinePartText = TextPart;\n\n// Provider metadata type for extensions\nexport type CossistantProviderMetadata = z.infer<\n\ttypeof cossistantProviderMetadataSchema\n>;\nexport type CossistantToolTimelineMetadata = z.infer<\n\ttypeof cossistantToolTimelineMetadataSchema\n>;\n\n// Tool state type\nexport type ToolState = z.infer<typeof toolStateSchema>;\n\n// Export schemas for external use\nexport {\n\ttextPartSchema,\n\treasoningPartSchema,\n\ttoolPartSchema,\n\ttoolStateSchema,\n\tsourceUrlPartSchema,\n\tsourceDocumentPartSchema,\n\tstepStartPartSchema,\n\tfilePartSchema,\n\timagePartSchema,\n\ttimelinePartEventSchema,\n\ttimelinePartMetadataSchema,\n\tcossistantProviderMetadataSchema,\n};\n\n// REST API Schemas\nexport const getConversationTimelineItemsRequestSchema = z\n\t.object({\n\t\tlimit: z.coerce.number().min(1).max(100).default(50).openapi({\n\t\t\tdescription: \"Number of timeline items to fetch per page\",\n\t\t\tdefault: 50,\n\t\t}),\n\t\tcursor: z.string().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Cursor for pagination (timestamp_id format from previous response)\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Query parameters for fetching conversation timeline items\",\n\t});\n\nexport type GetConversationTimelineItemsRequest = z.infer<\n\ttypeof getConversationTimelineItemsRequestSchema\n>;\n\nexport const getConversationTimelineItemsResponseSchema = z\n\t.object({\n\t\titems: z.array(timelineItemSchema).openapi({\n\t\t\tdescription: \"Array of timeline items in chronological order\",\n\t\t}),\n\t\tnextCursor: z.string().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Cursor for the next page, null if no more items are available\",\n\t\t}),\n\t\thasNextPage: z.boolean().openapi({\n\t\t\tdescription: \"Whether there are more items available to fetch\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Response containing paginated timeline items\",\n\t});\n\nexport type GetConversationTimelineItemsResponse = z.infer<\n\ttypeof getConversationTimelineItemsResponseSchema\n>;\n\n// Send Timeline Item (Message) Schemas\nexport const sendTimelineItemRequestSchema = z\n\t.object({\n\t\tconversationId: z.string().openapi({\n\t\t\tdescription: \"ID of the conversation to send the timeline item to\",\n\t\t}),\n\t\titem: z.object({\n\t\t\tid: z.string().optional().openapi({\n\t\t\t\tdescription: \"Optional client-generated ID for the timeline item\",\n\t\t\t}),\n\t\t\ttype: z\n\t\t\t\t.enum([\n\t\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\t])\n\t\t\t\t.default(ConversationTimelineType.MESSAGE)\n\t\t\t\t.openapi({\n\t\t\t\t\tdescription: \"Type of timeline item - defaults to MESSAGE\",\n\t\t\t\t\tdefault: ConversationTimelineType.MESSAGE,\n\t\t\t\t}),\n\t\t\ttext: z.string().openapi({\n\t\t\t\tdescription: \"Main text content of the timeline item\",\n\t\t\t}),\n\t\t\tparts: timelineItemPartsSchema.optional(),\n\t\t\tvisibility: z\n\t\t\t\t.enum([TimelineItemVisibility.PUBLIC, TimelineItemVisibility.PRIVATE])\n\t\t\t\t.default(TimelineItemVisibility.PUBLIC)\n\t\t\t\t.openapi({\n\t\t\t\t\tdescription: \"Visibility level of the timeline item\",\n\t\t\t\t\tdefault: TimelineItemVisibility.PUBLIC,\n\t\t\t\t}),\n\t\t\ttool: z.string().nullable().optional().openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional tool identifier when sending non-message timeline items\",\n\t\t\t}),\n\t\t\tuserId: z.string().nullable().optional().openapi({\n\t\t\t\tdescription: \"ID of the user creating this timeline item\",\n\t\t\t}),\n\t\t\taiAgentId: z.string().nullable().optional().openapi({\n\t\t\t\tdescription: \"ID of the AI agent creating this timeline item\",\n\t\t\t}),\n\t\t\tvisitorId: z.string().nullable().optional().openapi({\n\t\t\t\tdescription: \"ID of the visitor creating this timeline item\",\n\t\t\t}),\n\t\t\tcreatedAt: z.string().optional().openapi({\n\t\t\t\tdescription: \"Optional timestamp for the timeline item\",\n\t\t\t}),\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request body for sending a timeline item to a conversation\",\n\t});\n\nexport type SendTimelineItemRequest = z.infer<\n\ttypeof sendTimelineItemRequestSchema\n>;\n\nexport const sendTimelineItemResponseSchema = z\n\t.object({\n\t\titem: timelineItemSchema.openapi({\n\t\t\tdescription: \"The created timeline item\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Response containing the created timeline item\",\n\t});\n\nexport type SendTimelineItemResponse = z.infer<\n\ttypeof sendTimelineItemResponseSchema\n>;\n"],"mappings":";;;;;AAkBA,MAAM,uCAAuC,EAAE,OAAO;CACrD,SAAS,EACP,KAAK;EACL,uBAAuB;EACvB,uBAAuB;EACvB,uBAAuB;EACvB,CAAC,CACD,QAAQ,EACR,aACC,mFACD,CAAC;CACH,kBAAkB,EAAE,QAAQ,CAAC,QAAQ,EACpC,aACC,kEACD,CAAC;CACF,eAAe,EAAE,QAAQ,CAAC,QAAQ,EACjC,aACC,mEACD,CAAC;CACF,mBAAmB,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC,CAAC,UAAU,CAAC,QAAQ,EACnE,aACC,uEACD,CAAC;CACF,CAAC;AAEF,MAAM,mCAAmC,EACvC,OAAO,EACP,YAAY,EACV,OAAO;CACP,YAAY,EAAE,KAAK,CAA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jC,aAAa,sDACb,CAAC;EACF,MAAM,EACJ,KAAK,CACL,yBAAyB,SACzB,yBAAyB,MACzB,CAAC,CACD,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ;GACR,aAAa;GACb,SAAS,yBAAyB;GAClC,CAAC;EACH,MAAM,EAAE,QAAQ,CAAC,QAAQ,EACxB,aAAa,0CACb,CAAC;EACF,OAAO,wBAAwB,UAAU;EACzC,YAAY,EACV,KAAK,CAAC,uBAAuB,QAAQ,uBAAuB,QAAQ,CAAC,CACrE,QAAQ,uBAAuB,OAAO,CACtC,QAAQ;GACR,aAAa;GACb,SAAS,uBAAuB;GAChC,CAAC;EACH,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAC9C,aACC,oEACD,CAAC;EACF,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAChD,aAAa,8CACb,CAAC;EACF,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EACnD,aAAa,kDACb,CAAC;EACF,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EACnD,aAAa,iDACb,CAAC;EACF,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,EACxC,aAAa,4CACb,CAAC;EACF,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,8DACb,CAAC;AAMH,MAAa,iCAAiC,EAC5C,OAAO,EACP,MAAM,mBAAmB,QAAQ,EAChC,aAAa,6BACb,CAAC,EACF,CAAC,CACD,QAAQ,EACR,aAAa,iDACb,CAAC"}
@@ -16,7 +16,8 @@ const TimelineItemVisibility = {
16
16
  const ConversationTimelineType = {
17
17
  MESSAGE: "message",
18
18
  EVENT: "event",
19
- IDENTIFICATION: "identification"
19
+ IDENTIFICATION: "identification",
20
+ TOOL: "tool"
20
21
  };
21
22
  const ConversationEventType = {
22
23
  ASSIGNED: "assigned",
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":[],"sources":["../../../../types/src/enums.ts"],"sourcesContent":["export const SenderType = {\n\tVISITOR: \"visitor\",\n\tTEAM_MEMBER: \"team_member\",\n\tAI: \"ai\",\n} as const;\n\nexport type SenderType = (typeof SenderType)[keyof typeof SenderType];\n\nexport const ConversationStatus = {\n\tOPEN: \"open\",\n\tRESOLVED: \"resolved\",\n\tSPAM: \"spam\",\n} as const;\n\nexport type ConversationStatus =\n\t(typeof ConversationStatus)[keyof typeof ConversationStatus];\n\nexport const ConversationPriority = {\n\tLOW: \"low\",\n\tNORMAL: \"normal\",\n\tHIGH: \"high\",\n\tURGENT: \"urgent\",\n} as const;\n\nexport const TimelineItemVisibility = {\n\tPUBLIC: \"public\",\n\tPRIVATE: \"private\",\n} as const;\n\nexport const ConversationTimelineType = {\n\tMESSAGE: \"message\",\n\tEVENT: \"event\",\n\tIDENTIFICATION: \"identification\",\n} as const;\n\nexport type ConversationTimelineType =\n\t(typeof ConversationTimelineType)[keyof typeof ConversationTimelineType];\n\nexport const ConversationEventType = {\n\tASSIGNED: \"assigned\",\n\tUNASSIGNED: \"unassigned\",\n\tPARTICIPANT_REQUESTED: \"participant_requested\",\n\tPARTICIPANT_JOINED: \"participant_joined\",\n\tPARTICIPANT_LEFT: \"participant_left\",\n\tSTATUS_CHANGED: \"status_changed\",\n\tPRIORITY_CHANGED: \"priority_changed\",\n\tTAG_ADDED: \"tag_added\",\n\tTAG_REMOVED: \"tag_removed\",\n\tRESOLVED: \"resolved\",\n\tREOPENED: \"reopened\",\n\tVISITOR_BLOCKED: \"visitor_blocked\",\n\tVISITOR_UNBLOCKED: \"visitor_unblocked\",\n\tVISITOR_IDENTIFIED: \"visitor_identified\",\n\t// Private AI events (team only, not visible to visitors)\n\tAI_ANALYZED: \"ai_analyzed\",\n\tTITLE_GENERATED: \"title_generated\",\n\tAI_ESCALATED: \"ai_escalated\",\n} as const;\n\nexport const ConversationParticipationStatus = {\n\tREQUESTED: \"requested\",\n\tACTIVE: \"active\",\n\tLEFT: \"left\",\n\tDECLINED: \"declined\",\n} as const;\n\nexport const ConversationSentiment = {\n\tPOSITIVE: \"positive\",\n\tNEGATIVE: \"negative\",\n\tNEUTRAL: \"neutral\",\n} as const;\n\nexport type ConversationSentiment =\n\t(typeof ConversationSentiment)[keyof typeof ConversationSentiment];\n\nexport type ConversationParticipationStatus =\n\t(typeof ConversationParticipationStatus)[keyof typeof ConversationParticipationStatus];\n\nexport type ConversationEventType =\n\t(typeof ConversationEventType)[keyof typeof ConversationEventType];\n\nexport type TimelineItemVisibility =\n\t(typeof TimelineItemVisibility)[keyof typeof TimelineItemVisibility];\n\nexport type ConversationPriority =\n\t(typeof ConversationPriority)[keyof typeof ConversationPriority];\n\nexport const WebsiteInstallationTarget = {\n\tNEXTJS: \"nextjs\",\n\tREACT: \"react\",\n} as const;\n\nexport const WebsiteStatus = {\n\tACTIVE: \"active\",\n\tINACTIVE: \"inactive\",\n} as const;\n\nexport type WebsiteStatus = (typeof WebsiteStatus)[keyof typeof WebsiteStatus];\n\nexport type WebsiteInstallationTarget =\n\t(typeof WebsiteInstallationTarget)[keyof typeof WebsiteInstallationTarget];\n\nexport const APIKeyType = {\n\tPRIVATE: \"private\",\n\tPUBLIC: \"public\",\n} as const;\n\nexport type APIKeyType = (typeof APIKeyType)[keyof typeof APIKeyType];\n"],"mappings":";AAAA,MAAa,aAAa;CACzB,SAAS;CACT,aAAa;CACb,IAAI;CACJ;AAID,MAAa,qBAAqB;CACjC,MAAM;CACN,UAAU;CACV,MAAM;CACN;AAYD,MAAa,yBAAyB;CACrC,QAAQ;CACR,SAAS;CACT;AAED,MAAa,2BAA2B;CACvC,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB;AAKD,MAAa,wBAAwB;CACpC,UAAU;CACV,YAAY;CACZ,uBAAuB;CACvB,oBAAoB;CACpB,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,WAAW;CACX,aAAa;CACb,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,mBAAmB;CACnB,oBAAoB;CAEpB,aAAa;CACb,iBAAiB;CACjB,cAAc;CACd"}
1
+ {"version":3,"file":"enums.js","names":[],"sources":["../../../../types/src/enums.ts"],"sourcesContent":["export const SenderType = {\n\tVISITOR: \"visitor\",\n\tTEAM_MEMBER: \"team_member\",\n\tAI: \"ai\",\n} as const;\n\nexport type SenderType = (typeof SenderType)[keyof typeof SenderType];\n\nexport const ConversationStatus = {\n\tOPEN: \"open\",\n\tRESOLVED: \"resolved\",\n\tSPAM: \"spam\",\n} as const;\n\nexport type ConversationStatus =\n\t(typeof ConversationStatus)[keyof typeof ConversationStatus];\n\nexport const ConversationPriority = {\n\tLOW: \"low\",\n\tNORMAL: \"normal\",\n\tHIGH: \"high\",\n\tURGENT: \"urgent\",\n} as const;\n\nexport const TimelineItemVisibility = {\n\tPUBLIC: \"public\",\n\tPRIVATE: \"private\",\n} as const;\n\nexport const ConversationTimelineType = {\n\tMESSAGE: \"message\",\n\tEVENT: \"event\",\n\tIDENTIFICATION: \"identification\",\n\tTOOL: \"tool\",\n} as const;\n\nexport type ConversationTimelineType =\n\t(typeof ConversationTimelineType)[keyof typeof ConversationTimelineType];\n\nexport const ConversationEventType = {\n\tASSIGNED: \"assigned\",\n\tUNASSIGNED: \"unassigned\",\n\tPARTICIPANT_REQUESTED: \"participant_requested\",\n\tPARTICIPANT_JOINED: \"participant_joined\",\n\tPARTICIPANT_LEFT: \"participant_left\",\n\tSTATUS_CHANGED: \"status_changed\",\n\tPRIORITY_CHANGED: \"priority_changed\",\n\tTAG_ADDED: \"tag_added\",\n\tTAG_REMOVED: \"tag_removed\",\n\tRESOLVED: \"resolved\",\n\tREOPENED: \"reopened\",\n\tVISITOR_BLOCKED: \"visitor_blocked\",\n\tVISITOR_UNBLOCKED: \"visitor_unblocked\",\n\tVISITOR_IDENTIFIED: \"visitor_identified\",\n\t// Private AI events (team only, not visible to visitors)\n\tAI_ANALYZED: \"ai_analyzed\",\n\tTITLE_GENERATED: \"title_generated\",\n\tAI_ESCALATED: \"ai_escalated\",\n} as const;\n\nexport const ConversationParticipationStatus = {\n\tREQUESTED: \"requested\",\n\tACTIVE: \"active\",\n\tLEFT: \"left\",\n\tDECLINED: \"declined\",\n} as const;\n\nexport const ConversationSentiment = {\n\tPOSITIVE: \"positive\",\n\tNEGATIVE: \"negative\",\n\tNEUTRAL: \"neutral\",\n} as const;\n\nexport type ConversationSentiment =\n\t(typeof ConversationSentiment)[keyof typeof ConversationSentiment];\n\nexport type ConversationParticipationStatus =\n\t(typeof ConversationParticipationStatus)[keyof typeof ConversationParticipationStatus];\n\nexport type ConversationEventType =\n\t(typeof ConversationEventType)[keyof typeof ConversationEventType];\n\nexport type TimelineItemVisibility =\n\t(typeof TimelineItemVisibility)[keyof typeof TimelineItemVisibility];\n\nexport type ConversationPriority =\n\t(typeof ConversationPriority)[keyof typeof ConversationPriority];\n\nexport const WebsiteInstallationTarget = {\n\tNEXTJS: \"nextjs\",\n\tREACT: \"react\",\n} as const;\n\nexport const WebsiteStatus = {\n\tACTIVE: \"active\",\n\tINACTIVE: \"inactive\",\n} as const;\n\nexport type WebsiteStatus = (typeof WebsiteStatus)[keyof typeof WebsiteStatus];\n\nexport type WebsiteInstallationTarget =\n\t(typeof WebsiteInstallationTarget)[keyof typeof WebsiteInstallationTarget];\n\nexport const APIKeyType = {\n\tPRIVATE: \"private\",\n\tPUBLIC: \"public\",\n} as const;\n\nexport type APIKeyType = (typeof APIKeyType)[keyof typeof APIKeyType];\n"],"mappings":";AAAA,MAAa,aAAa;CACzB,SAAS;CACT,aAAa;CACb,IAAI;CACJ;AAID,MAAa,qBAAqB;CACjC,MAAM;CACN,UAAU;CACV,MAAM;CACN;AAYD,MAAa,yBAAyB;CACrC,QAAQ;CACR,SAAS;CACT;AAED,MAAa,2BAA2B;CACvC,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB,MAAM;CACN;AAKD,MAAa,wBAAwB;CACpC,UAAU;CACV,YAAY;CACZ,uBAAuB;CACvB,oBAAoB;CACpB,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,WAAW;CACX,aAAa;CACb,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,mBAAmB;CACnB,oBAAoB;CAEpB,aAAa;CACb,iBAAiB;CACjB,cAAc;CACd"}
@@ -90,6 +90,7 @@ declare const realtimeSchema: {
90
90
  message: "message";
91
91
  event: "event";
92
92
  identification: "identification";
93
+ tool: "tool";
93
94
  }>;
94
95
  text: z.ZodNullable<z.ZodString>;
95
96
  parts: z.ZodArray<z.ZodUnknown>;
@@ -115,8 +116,8 @@ declare const realtimeSchema: {
115
116
  visitorId: z.ZodString;
116
117
  websiteId: z.ZodString;
117
118
  status: z.ZodDefault<z.ZodEnum<{
118
- resolved: "resolved";
119
119
  open: "open";
120
+ resolved: "resolved";
120
121
  spam: "spam";
121
122
  }>>;
122
123
  visitorRating: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -135,6 +136,7 @@ declare const realtimeSchema: {
135
136
  message: "message";
136
137
  event: "event";
137
138
  identification: "identification";
139
+ tool: "tool";
138
140
  }>;
139
141
  text: z.ZodNullable<z.ZodString>;
140
142
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -160,6 +162,19 @@ declare const realtimeSchema: {
160
162
  }>>;
161
163
  progressMessage: z.ZodOptional<z.ZodString>;
162
164
  knowledgeId: z.ZodOptional<z.ZodString>;
165
+ toolTimeline: z.ZodOptional<z.ZodObject<{
166
+ logType: z.ZodEnum<{
167
+ customer_facing: "customer_facing";
168
+ log: "log";
169
+ decision: "decision";
170
+ }>;
171
+ triggerMessageId: z.ZodString;
172
+ workflowRunId: z.ZodString;
173
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
174
+ public: "public";
175
+ private: "private";
176
+ }>>;
177
+ }, z.core.$strip>>;
163
178
  }, z.core.$strip>>;
164
179
  }, z.core.$loose>>;
165
180
  }, z.core.$strip>, z.ZodObject<{
@@ -174,6 +189,29 @@ declare const realtimeSchema: {
174
189
  result: "result";
175
190
  }>;
176
191
  errorText: z.ZodOptional<z.ZodString>;
192
+ callProviderMetadata: z.ZodOptional<z.ZodObject<{
193
+ cossistant: z.ZodOptional<z.ZodObject<{
194
+ visibility: z.ZodOptional<z.ZodEnum<{
195
+ public: "public";
196
+ private: "private";
197
+ }>>;
198
+ progressMessage: z.ZodOptional<z.ZodString>;
199
+ knowledgeId: z.ZodOptional<z.ZodString>;
200
+ toolTimeline: z.ZodOptional<z.ZodObject<{
201
+ logType: z.ZodEnum<{
202
+ customer_facing: "customer_facing";
203
+ log: "log";
204
+ decision: "decision";
205
+ }>;
206
+ triggerMessageId: z.ZodString;
207
+ workflowRunId: z.ZodString;
208
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
209
+ public: "public";
210
+ private: "private";
211
+ }>>;
212
+ }, z.core.$strip>>;
213
+ }, z.core.$strip>>;
214
+ }, z.core.$loose>>;
177
215
  providerMetadata: z.ZodOptional<z.ZodObject<{
178
216
  cossistant: z.ZodOptional<z.ZodObject<{
179
217
  visibility: z.ZodOptional<z.ZodEnum<{
@@ -182,6 +220,19 @@ declare const realtimeSchema: {
182
220
  }>>;
183
221
  progressMessage: z.ZodOptional<z.ZodString>;
184
222
  knowledgeId: z.ZodOptional<z.ZodString>;
223
+ toolTimeline: z.ZodOptional<z.ZodObject<{
224
+ logType: z.ZodEnum<{
225
+ customer_facing: "customer_facing";
226
+ log: "log";
227
+ decision: "decision";
228
+ }>;
229
+ triggerMessageId: z.ZodString;
230
+ workflowRunId: z.ZodString;
231
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
232
+ public: "public";
233
+ private: "private";
234
+ }>>;
235
+ }, z.core.$strip>>;
185
236
  }, z.core.$strip>>;
186
237
  }, z.core.$loose>>;
187
238
  }, z.core.$strip>, z.ZodObject<{
@@ -197,6 +248,19 @@ declare const realtimeSchema: {
197
248
  }>>;
198
249
  progressMessage: z.ZodOptional<z.ZodString>;
199
250
  knowledgeId: z.ZodOptional<z.ZodString>;
251
+ toolTimeline: z.ZodOptional<z.ZodObject<{
252
+ logType: z.ZodEnum<{
253
+ customer_facing: "customer_facing";
254
+ log: "log";
255
+ decision: "decision";
256
+ }>;
257
+ triggerMessageId: z.ZodString;
258
+ workflowRunId: z.ZodString;
259
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
260
+ public: "public";
261
+ private: "private";
262
+ }>>;
263
+ }, z.core.$strip>>;
200
264
  }, z.core.$strip>>;
201
265
  }, z.core.$loose>>;
202
266
  }, z.core.$strip>, z.ZodObject<{
@@ -213,6 +277,19 @@ declare const realtimeSchema: {
213
277
  }>>;
214
278
  progressMessage: z.ZodOptional<z.ZodString>;
215
279
  knowledgeId: z.ZodOptional<z.ZodString>;
280
+ toolTimeline: z.ZodOptional<z.ZodObject<{
281
+ logType: z.ZodEnum<{
282
+ customer_facing: "customer_facing";
283
+ log: "log";
284
+ decision: "decision";
285
+ }>;
286
+ triggerMessageId: z.ZodString;
287
+ workflowRunId: z.ZodString;
288
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
289
+ public: "public";
290
+ private: "private";
291
+ }>>;
292
+ }, z.core.$strip>>;
216
293
  }, z.core.$strip>>;
217
294
  }, z.core.$loose>>;
218
295
  }, z.core.$strip>, z.ZodObject<{
@@ -234,6 +311,7 @@ declare const realtimeSchema: {
234
311
  }, z.core.$strip>, z.ZodObject<{
235
312
  type: z.ZodLiteral<"event">;
236
313
  eventType: z.ZodEnum<{
314
+ resolved: "resolved";
237
315
  assigned: "assigned";
238
316
  unassigned: "unassigned";
239
317
  participant_requested: "participant_requested";
@@ -243,7 +321,6 @@ declare const realtimeSchema: {
243
321
  priority_changed: "priority_changed";
244
322
  tag_added: "tag_added";
245
323
  tag_removed: "tag_removed";
246
- resolved: "resolved";
247
324
  reopened: "reopened";
248
325
  visitor_blocked: "visitor_blocked";
249
326
  visitor_unblocked: "visitor_unblocked";
@@ -272,8 +349,8 @@ declare const realtimeSchema: {
272
349
  header: z.ZodObject<{
273
350
  id: z.ZodString;
274
351
  status: z.ZodEnum<{
275
- resolved: "resolved";
276
352
  open: "open";
353
+ resolved: "resolved";
277
354
  spam: "spam";
278
355
  }>;
279
356
  priority: z.ZodEnum<{
@@ -332,6 +409,7 @@ declare const realtimeSchema: {
332
409
  message: "message";
333
410
  event: "event";
334
411
  identification: "identification";
412
+ tool: "tool";
335
413
  }>;
336
414
  text: z.ZodNullable<z.ZodString>;
337
415
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -357,6 +435,19 @@ declare const realtimeSchema: {
357
435
  }>>;
358
436
  progressMessage: z.ZodOptional<z.ZodString>;
359
437
  knowledgeId: z.ZodOptional<z.ZodString>;
438
+ toolTimeline: z.ZodOptional<z.ZodObject<{
439
+ logType: z.ZodEnum<{
440
+ customer_facing: "customer_facing";
441
+ log: "log";
442
+ decision: "decision";
443
+ }>;
444
+ triggerMessageId: z.ZodString;
445
+ workflowRunId: z.ZodString;
446
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
447
+ public: "public";
448
+ private: "private";
449
+ }>>;
450
+ }, z.core.$strip>>;
360
451
  }, z.core.$strip>>;
361
452
  }, z.core.$loose>>;
362
453
  }, z.core.$strip>, z.ZodObject<{
@@ -371,6 +462,29 @@ declare const realtimeSchema: {
371
462
  result: "result";
372
463
  }>;
373
464
  errorText: z.ZodOptional<z.ZodString>;
465
+ callProviderMetadata: z.ZodOptional<z.ZodObject<{
466
+ cossistant: z.ZodOptional<z.ZodObject<{
467
+ visibility: z.ZodOptional<z.ZodEnum<{
468
+ public: "public";
469
+ private: "private";
470
+ }>>;
471
+ progressMessage: z.ZodOptional<z.ZodString>;
472
+ knowledgeId: z.ZodOptional<z.ZodString>;
473
+ toolTimeline: z.ZodOptional<z.ZodObject<{
474
+ logType: z.ZodEnum<{
475
+ customer_facing: "customer_facing";
476
+ log: "log";
477
+ decision: "decision";
478
+ }>;
479
+ triggerMessageId: z.ZodString;
480
+ workflowRunId: z.ZodString;
481
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
482
+ public: "public";
483
+ private: "private";
484
+ }>>;
485
+ }, z.core.$strip>>;
486
+ }, z.core.$strip>>;
487
+ }, z.core.$loose>>;
374
488
  providerMetadata: z.ZodOptional<z.ZodObject<{
375
489
  cossistant: z.ZodOptional<z.ZodObject<{
376
490
  visibility: z.ZodOptional<z.ZodEnum<{
@@ -379,6 +493,19 @@ declare const realtimeSchema: {
379
493
  }>>;
380
494
  progressMessage: z.ZodOptional<z.ZodString>;
381
495
  knowledgeId: z.ZodOptional<z.ZodString>;
496
+ toolTimeline: z.ZodOptional<z.ZodObject<{
497
+ logType: z.ZodEnum<{
498
+ customer_facing: "customer_facing";
499
+ log: "log";
500
+ decision: "decision";
501
+ }>;
502
+ triggerMessageId: z.ZodString;
503
+ workflowRunId: z.ZodString;
504
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
505
+ public: "public";
506
+ private: "private";
507
+ }>>;
508
+ }, z.core.$strip>>;
382
509
  }, z.core.$strip>>;
383
510
  }, z.core.$loose>>;
384
511
  }, z.core.$strip>, z.ZodObject<{
@@ -394,6 +521,19 @@ declare const realtimeSchema: {
394
521
  }>>;
395
522
  progressMessage: z.ZodOptional<z.ZodString>;
396
523
  knowledgeId: z.ZodOptional<z.ZodString>;
524
+ toolTimeline: z.ZodOptional<z.ZodObject<{
525
+ logType: z.ZodEnum<{
526
+ customer_facing: "customer_facing";
527
+ log: "log";
528
+ decision: "decision";
529
+ }>;
530
+ triggerMessageId: z.ZodString;
531
+ workflowRunId: z.ZodString;
532
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
533
+ public: "public";
534
+ private: "private";
535
+ }>>;
536
+ }, z.core.$strip>>;
397
537
  }, z.core.$strip>>;
398
538
  }, z.core.$loose>>;
399
539
  }, z.core.$strip>, z.ZodObject<{
@@ -410,6 +550,19 @@ declare const realtimeSchema: {
410
550
  }>>;
411
551
  progressMessage: z.ZodOptional<z.ZodString>;
412
552
  knowledgeId: z.ZodOptional<z.ZodString>;
553
+ toolTimeline: z.ZodOptional<z.ZodObject<{
554
+ logType: z.ZodEnum<{
555
+ customer_facing: "customer_facing";
556
+ log: "log";
557
+ decision: "decision";
558
+ }>;
559
+ triggerMessageId: z.ZodString;
560
+ workflowRunId: z.ZodString;
561
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
562
+ public: "public";
563
+ private: "private";
564
+ }>>;
565
+ }, z.core.$strip>>;
413
566
  }, z.core.$strip>>;
414
567
  }, z.core.$loose>>;
415
568
  }, z.core.$strip>, z.ZodObject<{
@@ -431,6 +584,7 @@ declare const realtimeSchema: {
431
584
  }, z.core.$strip>, z.ZodObject<{
432
585
  type: z.ZodLiteral<"event">;
433
586
  eventType: z.ZodEnum<{
587
+ resolved: "resolved";
434
588
  assigned: "assigned";
435
589
  unassigned: "unassigned";
436
590
  participant_requested: "participant_requested";
@@ -440,7 +594,6 @@ declare const realtimeSchema: {
440
594
  priority_changed: "priority_changed";
441
595
  tag_added: "tag_added";
442
596
  tag_removed: "tag_removed";
443
- resolved: "resolved";
444
597
  reopened: "reopened";
445
598
  visitor_blocked: "visitor_blocked";
446
599
  visitor_unblocked: "visitor_unblocked";
@@ -477,6 +630,7 @@ declare const realtimeSchema: {
477
630
  message: "message";
478
631
  event: "event";
479
632
  identification: "identification";
633
+ tool: "tool";
480
634
  }>;
481
635
  text: z.ZodNullable<z.ZodString>;
482
636
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -502,6 +656,19 @@ declare const realtimeSchema: {
502
656
  }>>;
503
657
  progressMessage: z.ZodOptional<z.ZodString>;
504
658
  knowledgeId: z.ZodOptional<z.ZodString>;
659
+ toolTimeline: z.ZodOptional<z.ZodObject<{
660
+ logType: z.ZodEnum<{
661
+ customer_facing: "customer_facing";
662
+ log: "log";
663
+ decision: "decision";
664
+ }>;
665
+ triggerMessageId: z.ZodString;
666
+ workflowRunId: z.ZodString;
667
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
668
+ public: "public";
669
+ private: "private";
670
+ }>>;
671
+ }, z.core.$strip>>;
505
672
  }, z.core.$strip>>;
506
673
  }, z.core.$loose>>;
507
674
  }, z.core.$strip>, z.ZodObject<{
@@ -516,6 +683,29 @@ declare const realtimeSchema: {
516
683
  result: "result";
517
684
  }>;
518
685
  errorText: z.ZodOptional<z.ZodString>;
686
+ callProviderMetadata: z.ZodOptional<z.ZodObject<{
687
+ cossistant: z.ZodOptional<z.ZodObject<{
688
+ visibility: z.ZodOptional<z.ZodEnum<{
689
+ public: "public";
690
+ private: "private";
691
+ }>>;
692
+ progressMessage: z.ZodOptional<z.ZodString>;
693
+ knowledgeId: z.ZodOptional<z.ZodString>;
694
+ toolTimeline: z.ZodOptional<z.ZodObject<{
695
+ logType: z.ZodEnum<{
696
+ customer_facing: "customer_facing";
697
+ log: "log";
698
+ decision: "decision";
699
+ }>;
700
+ triggerMessageId: z.ZodString;
701
+ workflowRunId: z.ZodString;
702
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
703
+ public: "public";
704
+ private: "private";
705
+ }>>;
706
+ }, z.core.$strip>>;
707
+ }, z.core.$strip>>;
708
+ }, z.core.$loose>>;
519
709
  providerMetadata: z.ZodOptional<z.ZodObject<{
520
710
  cossistant: z.ZodOptional<z.ZodObject<{
521
711
  visibility: z.ZodOptional<z.ZodEnum<{
@@ -524,6 +714,19 @@ declare const realtimeSchema: {
524
714
  }>>;
525
715
  progressMessage: z.ZodOptional<z.ZodString>;
526
716
  knowledgeId: z.ZodOptional<z.ZodString>;
717
+ toolTimeline: z.ZodOptional<z.ZodObject<{
718
+ logType: z.ZodEnum<{
719
+ customer_facing: "customer_facing";
720
+ log: "log";
721
+ decision: "decision";
722
+ }>;
723
+ triggerMessageId: z.ZodString;
724
+ workflowRunId: z.ZodString;
725
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
726
+ public: "public";
727
+ private: "private";
728
+ }>>;
729
+ }, z.core.$strip>>;
527
730
  }, z.core.$strip>>;
528
731
  }, z.core.$loose>>;
529
732
  }, z.core.$strip>, z.ZodObject<{
@@ -539,6 +742,19 @@ declare const realtimeSchema: {
539
742
  }>>;
540
743
  progressMessage: z.ZodOptional<z.ZodString>;
541
744
  knowledgeId: z.ZodOptional<z.ZodString>;
745
+ toolTimeline: z.ZodOptional<z.ZodObject<{
746
+ logType: z.ZodEnum<{
747
+ customer_facing: "customer_facing";
748
+ log: "log";
749
+ decision: "decision";
750
+ }>;
751
+ triggerMessageId: z.ZodString;
752
+ workflowRunId: z.ZodString;
753
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
754
+ public: "public";
755
+ private: "private";
756
+ }>>;
757
+ }, z.core.$strip>>;
542
758
  }, z.core.$strip>>;
543
759
  }, z.core.$loose>>;
544
760
  }, z.core.$strip>, z.ZodObject<{
@@ -555,6 +771,19 @@ declare const realtimeSchema: {
555
771
  }>>;
556
772
  progressMessage: z.ZodOptional<z.ZodString>;
557
773
  knowledgeId: z.ZodOptional<z.ZodString>;
774
+ toolTimeline: z.ZodOptional<z.ZodObject<{
775
+ logType: z.ZodEnum<{
776
+ customer_facing: "customer_facing";
777
+ log: "log";
778
+ decision: "decision";
779
+ }>;
780
+ triggerMessageId: z.ZodString;
781
+ workflowRunId: z.ZodString;
782
+ triggerVisibility: z.ZodOptional<z.ZodEnum<{
783
+ public: "public";
784
+ private: "private";
785
+ }>>;
786
+ }, z.core.$strip>>;
558
787
  }, z.core.$strip>>;
559
788
  }, z.core.$loose>>;
560
789
  }, z.core.$strip>, z.ZodObject<{
@@ -576,6 +805,7 @@ declare const realtimeSchema: {
576
805
  }, z.core.$strip>, z.ZodObject<{
577
806
  type: z.ZodLiteral<"event">;
578
807
  eventType: z.ZodEnum<{
808
+ resolved: "resolved";
579
809
  assigned: "assigned";
580
810
  unassigned: "unassigned";
581
811
  participant_requested: "participant_requested";
@@ -585,7 +815,6 @@ declare const realtimeSchema: {
585
815
  priority_changed: "priority_changed";
586
816
  tag_added: "tag_added";
587
817
  tag_removed: "tag_removed";
588
- resolved: "resolved";
589
818
  reopened: "reopened";
590
819
  visitor_blocked: "visitor_blocked";
591
820
  visitor_unblocked: "visitor_unblocked";
@@ -684,6 +913,7 @@ declare const realtimeSchema: {
684
913
  conversationId: z.ZodString;
685
914
  organizationId: z.ZodString;
686
915
  type: z.ZodEnum<{
916
+ resolved: "resolved";
687
917
  assigned: "assigned";
688
918
  unassigned: "unassigned";
689
919
  participant_requested: "participant_requested";
@@ -693,7 +923,6 @@ declare const realtimeSchema: {
693
923
  priority_changed: "priority_changed";
694
924
  tag_added: "tag_added";
695
925
  tag_removed: "tag_removed";
696
- resolved: "resolved";
697
926
  reopened: "reopened";
698
927
  visitor_blocked: "visitor_blocked";
699
928
  visitor_unblocked: "visitor_unblocked";
@@ -726,6 +955,22 @@ declare const realtimeSchema: {
726
955
  sentimentConfidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
727
956
  escalatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
728
957
  escalationReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
958
+ status: z.ZodOptional<z.ZodEnum<{
959
+ open: "open";
960
+ resolved: "resolved";
961
+ spam: "spam";
962
+ }>>;
963
+ priority: z.ZodOptional<z.ZodEnum<{
964
+ low: "low";
965
+ normal: "normal";
966
+ high: "high";
967
+ urgent: "urgent";
968
+ }>>;
969
+ resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
970
+ resolvedByUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
971
+ resolvedByAiAgentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
972
+ resolutionTime: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
973
+ deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
729
974
  }, z.core.$strip>;
730
975
  aiAgentId: z.ZodNullable<z.ZodString>;
731
976
  }, z.core.$strip>;
@@ -827,6 +1072,7 @@ declare const realtimeSchema: {
827
1072
  message: "message";
828
1073
  event: "event";
829
1074
  identification: "identification";
1075
+ tool: "tool";
830
1076
  }>;
831
1077
  text: z.ZodNullable<z.ZodString>;
832
1078
  parts: z.ZodArray<z.ZodUnknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../../../../types/src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAqBa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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