@cossistant/core 0.0.30 → 0.0.32

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":"seen-store.js","names":["INITIAL_STATE: SeenState","nextConversation: ConversationSeenState","nextEntries: ConversationSeenState"],"sources":["../../src/store/seen-store.ts"],"sourcesContent":["import type { RealtimeEvent } from \"@cossistant/types/realtime-events\";\nimport type { ConversationSeen } from \"@cossistant/types/schemas\";\nimport { createStore, type Store } from \"./create-store\";\n\nexport type SeenActorType = \"visitor\" | \"user\" | \"ai_agent\";\n\nexport type SeenEntry = {\n\tactorType: SeenActorType;\n\tactorId: string;\n\tlastSeenAt: string;\n};\n\nexport type ConversationSeenState = Record<string, SeenEntry>;\n\nexport type SeenState = {\n\tconversations: Record<string, ConversationSeenState>;\n};\n\nconst INITIAL_STATE: SeenState = {\n\tconversations: {},\n};\n\ntype UpsertSeenOptions = {\n\tconversationId: string;\n\tactorType: SeenActorType;\n\tactorId: string;\n\tlastSeenAt: string;\n};\n\nfunction makeKey(\n\tconversationId: string,\n\tactorType: SeenActorType,\n\tactorId: string\n): string {\n\treturn `${conversationId}:${actorType}:${actorId}`;\n}\n\nfunction hasSameEntries(\n\texisting: ConversationSeenState | undefined,\n\tnext: ConversationSeenState\n): boolean {\n\tif (!existing) {\n\t\treturn false;\n\t}\n\n\tconst existingKeys = Object.keys(existing);\n\tconst nextKeys = Object.keys(next);\n\n\tif (existingKeys.length !== nextKeys.length) {\n\t\treturn false;\n\t}\n\n\tfor (const key of nextKeys) {\n\t\tconst previous = existing[key];\n\t\tconst incoming = next[key];\n\n\t\tif (!(previous && incoming)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tprevious.actorType !== incoming.actorType ||\n\t\t\tprevious.actorId !== incoming.actorId ||\n\t\t\tnew Date(previous.lastSeenAt).getTime() !==\n\t\t\t\tnew Date(incoming.lastSeenAt).getTime()\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nexport type SeenStore = Store<SeenState> & {\n\tupsert(options: UpsertSeenOptions): void;\n\thydrate(conversationId: string, entries: ConversationSeen[]): void;\n\tclear(conversationId: string): void;\n};\n\ntype ActorIdentity = {\n\tactorType: SeenActorType;\n\tactorId: string;\n};\n\nfunction resolveActorIdentity(\n\tentry: Pick<\n\t\tConversationSeen | RealtimeEvent<\"conversationSeen\">[\"payload\"],\n\t\t\"userId\" | \"visitorId\" | \"aiAgentId\"\n\t>\n): ActorIdentity | null {\n\tif (entry.userId) {\n\t\treturn { actorType: \"user\", actorId: entry.userId } satisfies ActorIdentity;\n\t}\n\n\tif (entry.visitorId) {\n\t\treturn {\n\t\t\tactorType: \"visitor\",\n\t\t\tactorId: entry.visitorId,\n\t\t} satisfies ActorIdentity;\n\t}\n\n\tif (entry.aiAgentId) {\n\t\treturn {\n\t\t\tactorType: \"ai_agent\",\n\t\t\tactorId: entry.aiAgentId,\n\t\t} satisfies ActorIdentity;\n\t}\n\n\treturn null;\n}\n\nexport function createSeenStore(\n\tinitialState: SeenState = INITIAL_STATE\n): SeenStore {\n\tconst store = createStore<SeenState>({\n\t\tconversations: { ...initialState.conversations },\n\t});\n\n\treturn {\n\t\t...store,\n\t\tupsert({ conversationId, actorType, actorId, lastSeenAt }) {\n\t\t\tstore.setState((state) => {\n\t\t\t\tconst existingConversation = state.conversations[conversationId] ?? {};\n\t\t\t\tconst key = makeKey(conversationId, actorType, actorId);\n\t\t\t\tconst previous = existingConversation[key];\n\n\t\t\t\tif (\n\t\t\t\t\tprevious &&\n\t\t\t\t\tnew Date(previous.lastSeenAt).getTime() >=\n\t\t\t\t\t\tnew Date(lastSeenAt).getTime()\n\t\t\t\t) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\n\t\t\t\tconst nextConversation: ConversationSeenState = {\n\t\t\t\t\t...existingConversation,\n\t\t\t\t\t[key]: {\n\t\t\t\t\t\tactorType,\n\t\t\t\t\t\tactorId,\n\t\t\t\t\t\tlastSeenAt,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\treturn {\n\t\t\t\t\tconversations: {\n\t\t\t\t\t\t...state.conversations,\n\t\t\t\t\t\t[conversationId]: nextConversation,\n\t\t\t\t\t},\n\t\t\t\t} satisfies SeenState;\n\t\t\t});\n\t\t},\n\t\thydrate(conversationId, entries) {\n\t\t\tstore.setState((state) => {\n\t\t\t\tif (entries.length === 0) {\n\t\t\t\t\tif (!(conversationId in state.conversations)) {\n\t\t\t\t\t\treturn state;\n\t\t\t\t\t}\n\t\t\t\t\tconst nextConversations = { ...state.conversations };\n\t\t\t\t\tdelete nextConversations[conversationId];\n\t\t\t\t\treturn { conversations: nextConversations } satisfies SeenState;\n\t\t\t\t}\n\n\t\t\t\tconst existing = state.conversations[conversationId] ?? {};\n\t\t\t\tconst nextEntries: ConversationSeenState = {\n\t\t\t\t\t...existing,\n\t\t\t\t};\n\n\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\tconst identity = resolveActorIdentity(entry);\n\n\t\t\t\t\tif (!identity) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst key = makeKey(\n\t\t\t\t\t\tconversationId,\n\t\t\t\t\t\tidentity.actorType,\n\t\t\t\t\t\tidentity.actorId\n\t\t\t\t\t);\n\t\t\t\t\tconst previous = existing[key];\n\t\t\t\t\tconst incomingTimestamp = new Date(entry.lastSeenAt).getTime();\n\t\t\t\t\tconst previousTimestamp = previous\n\t\t\t\t\t\t? new Date(previous.lastSeenAt).getTime()\n\t\t\t\t\t\t: null;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tprevious &&\n\t\t\t\t\t\tpreviousTimestamp !== null &&\n\t\t\t\t\t\t!Number.isNaN(previousTimestamp) &&\n\t\t\t\t\t\t!Number.isNaN(incomingTimestamp) &&\n\t\t\t\t\t\tpreviousTimestamp > incomingTimestamp\n\t\t\t\t\t) {\n\t\t\t\t\t\tnextEntries[key] = previous;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tnextEntries[key] = {\n\t\t\t\t\t\tactorType: identity.actorType,\n\t\t\t\t\t\tactorId: identity.actorId,\n\t\t\t\t\t\tlastSeenAt: entry.lastSeenAt,\n\t\t\t\t\t} satisfies SeenEntry;\n\t\t\t\t}\n\n\t\t\t\tif (hasSameEntries(existing, nextEntries)) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\n\t\t\t\tif (Object.keys(nextEntries).length === 0) {\n\t\t\t\t\tconst nextConversations = { ...state.conversations };\n\t\t\t\t\tdelete nextConversations[conversationId];\n\t\t\t\t\treturn { conversations: nextConversations } satisfies SeenState;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tconversations: {\n\t\t\t\t\t\t...state.conversations,\n\t\t\t\t\t\t[conversationId]: nextEntries,\n\t\t\t\t\t},\n\t\t\t\t} satisfies SeenState;\n\t\t\t});\n\t\t},\n\t\tclear(conversationId) {\n\t\t\tstore.setState((state) => {\n\t\t\t\tif (!(conversationId in state.conversations)) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\n\t\t\t\tconst nextConversations = { ...state.conversations };\n\t\t\t\tdelete nextConversations[conversationId];\n\n\t\t\t\treturn { conversations: nextConversations } satisfies SeenState;\n\t\t\t});\n\t\t},\n\t} satisfies SeenStore;\n}\n\nexport function hydrateConversationSeen(\n\tstore: SeenStore,\n\tconversationId: string,\n\tentries: ConversationSeen[]\n): void {\n\tstore.hydrate(conversationId, entries);\n}\n\nexport function upsertConversationSeen(\n\tstore: SeenStore,\n\toptions: UpsertSeenOptions\n): void {\n\tstore.upsert(options);\n}\n\nexport function applyConversationSeenEvent(\n\tstore: SeenStore,\n\tevent: RealtimeEvent<\"conversationSeen\">,\n\toptions: {\n\t\tignoreVisitorId?: string | null;\n\t\tignoreUserId?: string | null;\n\t\tignoreAiAgentId?: string | null;\n\t} = {}\n): void {\n\tconst { payload } = event;\n\tconst identity = resolveActorIdentity(payload);\n\n\tif (!identity) {\n\t\treturn;\n\t}\n\n\tif (\n\t\t(identity.actorType === \"visitor\" &&\n\t\t\tpayload.visitorId &&\n\t\t\toptions.ignoreVisitorId &&\n\t\t\tpayload.visitorId === options.ignoreVisitorId) ||\n\t\t(identity.actorType === \"user\" &&\n\t\t\tpayload.userId &&\n\t\t\toptions.ignoreUserId &&\n\t\t\tpayload.userId === options.ignoreUserId) ||\n\t\t(identity.actorType === \"ai_agent\" &&\n\t\t\tpayload.aiAgentId &&\n\t\t\toptions.ignoreAiAgentId &&\n\t\t\tpayload.aiAgentId === options.ignoreAiAgentId)\n\t) {\n\t\treturn;\n\t}\n\n\tconst lastSeenAt = payload.lastSeenAt;\n\n\tupsertConversationSeen(store, {\n\t\tconversationId: payload.conversationId,\n\t\tactorType: identity.actorType,\n\t\tactorId: identity.actorId,\n\t\tlastSeenAt,\n\t});\n}\n"],"mappings":";;;AAkBA,MAAMA,gBAA2B,EAChC,eAAe,EAAE,EACjB;AASD,SAAS,QACR,gBACA,WACA,SACS;AACT,QAAO,GAAG,eAAe,GAAG,UAAU,GAAG;;AAG1C,SAAS,eACR,UACA,MACU;AACV,KAAI,CAAC,SACJ,QAAO;CAGR,MAAM,eAAe,OAAO,KAAK,SAAS;CAC1C,MAAM,WAAW,OAAO,KAAK,KAAK;AAElC,KAAI,aAAa,WAAW,SAAS,OACpC,QAAO;AAGR,MAAK,MAAM,OAAO,UAAU;EAC3B,MAAM,WAAW,SAAS;EAC1B,MAAM,WAAW,KAAK;AAEtB,MAAI,EAAE,YAAY,UACjB,QAAO;AAGR,MACC,SAAS,cAAc,SAAS,aAChC,SAAS,YAAY,SAAS,WAC9B,IAAI,KAAK,SAAS,WAAW,CAAC,SAAS,KACtC,IAAI,KAAK,SAAS,WAAW,CAAC,SAAS,CAExC,QAAO;;AAIT,QAAO;;AAcR,SAAS,qBACR,OAIuB;AACvB,KAAI,MAAM,OACT,QAAO;EAAE,WAAW;EAAQ,SA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,gBAE/B;CAGD,MAAM,aAAa,QAAQ;AAE3B,wBAAuB,OAAO;EAC7B,gBAAgB,QAAQ;EACxB,WAAW,SAAS;EACpB,SAAS,SAAS;EAClB;EACA,CAAC"}
1
+ {"version":3,"file":"seen-store.js","names":["INITIAL_STATE: SeenState","nextConversation: ConversationSeenState","nextEntries: ConversationSeenState"],"sources":["../../src/store/seen-store.ts"],"sourcesContent":["import type { RealtimeEvent } from \"@cossistant/types/realtime-events\";\nimport type { ConversationSeen } from \"@cossistant/types/schemas\";\nimport { createStore, type Store } from \"./create-store\";\n\nexport type SeenActorType = \"visitor\" | \"user\" | \"ai_agent\";\n\nexport type SeenEntry = {\n\tactorType: SeenActorType;\n\tactorId: string;\n\tlastSeenAt: string;\n};\n\nexport type ConversationSeenState = Record<string, SeenEntry>;\n\nexport type SeenState = {\n\tconversations: Record<string, ConversationSeenState>;\n};\n\nconst INITIAL_STATE: SeenState = {\n\tconversations: {},\n};\n\ntype UpsertSeenOptions = {\n\tconversationId: string;\n\tactorType: SeenActorType;\n\tactorId: string;\n\tlastSeenAt: string;\n};\n\nfunction makeKey(\n\tconversationId: string,\n\tactorType: SeenActorType,\n\tactorId: string\n): string {\n\treturn `${conversationId}:${actorType}:${actorId}`;\n}\n\nfunction hasSameEntries(\n\texisting: ConversationSeenState | undefined,\n\tnext: ConversationSeenState\n): boolean {\n\tif (!existing) {\n\t\treturn false;\n\t}\n\n\tconst existingKeys = Object.keys(existing);\n\tconst nextKeys = Object.keys(next);\n\n\tif (existingKeys.length !== nextKeys.length) {\n\t\treturn false;\n\t}\n\n\tfor (const key of nextKeys) {\n\t\tconst previous = existing[key];\n\t\tconst incoming = next[key];\n\n\t\tif (!(previous && incoming)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\tprevious.actorType !== incoming.actorType ||\n\t\t\tprevious.actorId !== incoming.actorId ||\n\t\t\tnew Date(previous.lastSeenAt).getTime() !==\n\t\t\t\tnew Date(incoming.lastSeenAt).getTime()\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nexport type SeenStore = Store<SeenState> & {\n\tupsert(options: UpsertSeenOptions): void;\n\thydrate(conversationId: string, entries: ConversationSeen[]): void;\n\tclear(conversationId: string): void;\n};\n\ntype ActorIdentity = {\n\tactorType: SeenActorType;\n\tactorId: string;\n};\n\n/**\n * Input type for resolving actor identity from either:\n * - ConversationSeen (has userId/visitorId/aiAgentId)\n * - RealtimeEvent<\"conversationSeen\"> payload (has actorType/actorId plus userId/visitorId/aiAgentId)\n */\ntype SeenEntryInput = {\n\tuserId?: string | null;\n\tvisitorId?: string | null;\n\taiAgentId?: string | null;\n\tactorType?: SeenActorType | string;\n\tactorId?: string;\n};\n\nfunction resolveActorIdentity(entry: SeenEntryInput): ActorIdentity | null {\n\tif (entry.actorType && entry.actorId) {\n\t\treturn {\n\t\t\tactorType: entry.actorType as SeenActorType,\n\t\t\tactorId: entry.actorId,\n\t\t} satisfies ActorIdentity;\n\t}\n\n\tif (entry.userId) {\n\t\treturn { actorType: \"user\", actorId: entry.userId } satisfies ActorIdentity;\n\t}\n\n\tif (entry.visitorId) {\n\t\treturn {\n\t\t\tactorType: \"visitor\",\n\t\t\tactorId: entry.visitorId,\n\t\t} satisfies ActorIdentity;\n\t}\n\n\tif (entry.aiAgentId) {\n\t\treturn {\n\t\t\tactorType: \"ai_agent\",\n\t\t\tactorId: entry.aiAgentId,\n\t\t} satisfies ActorIdentity;\n\t}\n\n\treturn null;\n}\n\nexport function createSeenStore(\n\tinitialState: SeenState = INITIAL_STATE\n): SeenStore {\n\tconst store = createStore<SeenState>({\n\t\tconversations: { ...initialState.conversations },\n\t});\n\n\treturn {\n\t\t...store,\n\t\tupsert({ conversationId, actorType, actorId, lastSeenAt }) {\n\t\t\tstore.setState((state) => {\n\t\t\t\tconst existingConversation = state.conversations[conversationId] ?? {};\n\t\t\t\tconst key = makeKey(conversationId, actorType, actorId);\n\t\t\t\tconst previous = existingConversation[key];\n\n\t\t\t\tif (\n\t\t\t\t\tprevious &&\n\t\t\t\t\tnew Date(previous.lastSeenAt).getTime() >=\n\t\t\t\t\t\tnew Date(lastSeenAt).getTime()\n\t\t\t\t) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\n\t\t\t\tconst nextConversation: ConversationSeenState = {\n\t\t\t\t\t...existingConversation,\n\t\t\t\t\t[key]: {\n\t\t\t\t\t\tactorType,\n\t\t\t\t\t\tactorId,\n\t\t\t\t\t\tlastSeenAt,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\treturn {\n\t\t\t\t\tconversations: {\n\t\t\t\t\t\t...state.conversations,\n\t\t\t\t\t\t[conversationId]: nextConversation,\n\t\t\t\t\t},\n\t\t\t\t} satisfies SeenState;\n\t\t\t});\n\t\t},\n\t\thydrate(conversationId, entries) {\n\t\t\tstore.setState((state) => {\n\t\t\t\tif (entries.length === 0) {\n\t\t\t\t\tif (!(conversationId in state.conversations)) {\n\t\t\t\t\t\treturn state;\n\t\t\t\t\t}\n\t\t\t\t\tconst nextConversations = { ...state.conversations };\n\t\t\t\t\tdelete nextConversations[conversationId];\n\t\t\t\t\treturn { conversations: nextConversations } satisfies SeenState;\n\t\t\t\t}\n\n\t\t\t\tconst existing = state.conversations[conversationId] ?? {};\n\t\t\t\tconst nextEntries: ConversationSeenState = {\n\t\t\t\t\t...existing,\n\t\t\t\t};\n\n\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\tconst identity = resolveActorIdentity(entry);\n\n\t\t\t\t\tif (!identity) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst key = makeKey(\n\t\t\t\t\t\tconversationId,\n\t\t\t\t\t\tidentity.actorType,\n\t\t\t\t\t\tidentity.actorId\n\t\t\t\t\t);\n\t\t\t\t\tconst previous = existing[key];\n\t\t\t\t\tconst incomingTimestamp = new Date(entry.lastSeenAt).getTime();\n\t\t\t\t\tconst previousTimestamp = previous\n\t\t\t\t\t\t? new Date(previous.lastSeenAt).getTime()\n\t\t\t\t\t\t: null;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tprevious &&\n\t\t\t\t\t\tpreviousTimestamp !== null &&\n\t\t\t\t\t\t!Number.isNaN(previousTimestamp) &&\n\t\t\t\t\t\t!Number.isNaN(incomingTimestamp) &&\n\t\t\t\t\t\tpreviousTimestamp > incomingTimestamp\n\t\t\t\t\t) {\n\t\t\t\t\t\tnextEntries[key] = previous;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tnextEntries[key] = {\n\t\t\t\t\t\tactorType: identity.actorType,\n\t\t\t\t\t\tactorId: identity.actorId,\n\t\t\t\t\t\tlastSeenAt: entry.lastSeenAt,\n\t\t\t\t\t} satisfies SeenEntry;\n\t\t\t\t}\n\n\t\t\t\tif (hasSameEntries(existing, nextEntries)) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\n\t\t\t\tif (Object.keys(nextEntries).length === 0) {\n\t\t\t\t\tconst nextConversations = { ...state.conversations };\n\t\t\t\t\tdelete nextConversations[conversationId];\n\t\t\t\t\treturn { conversations: nextConversations } satisfies SeenState;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tconversations: {\n\t\t\t\t\t\t...state.conversations,\n\t\t\t\t\t\t[conversationId]: nextEntries,\n\t\t\t\t\t},\n\t\t\t\t} satisfies SeenState;\n\t\t\t});\n\t\t},\n\t\tclear(conversationId) {\n\t\t\tstore.setState((state) => {\n\t\t\t\tif (!(conversationId in state.conversations)) {\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\n\t\t\t\tconst nextConversations = { ...state.conversations };\n\t\t\t\tdelete nextConversations[conversationId];\n\n\t\t\t\treturn { conversations: nextConversations } satisfies SeenState;\n\t\t\t});\n\t\t},\n\t} satisfies SeenStore;\n}\n\nexport function hydrateConversationSeen(\n\tstore: SeenStore,\n\tconversationId: string,\n\tentries: ConversationSeen[]\n): void {\n\tstore.hydrate(conversationId, entries);\n}\n\nexport function upsertConversationSeen(\n\tstore: SeenStore,\n\toptions: UpsertSeenOptions\n): void {\n\tstore.upsert(options);\n}\n\nexport function applyConversationSeenEvent(\n\tstore: SeenStore,\n\tevent: RealtimeEvent<\"conversationSeen\">,\n\toptions: {\n\t\tignoreVisitorId?: string | null;\n\t\tignoreUserId?: string | null;\n\t\tignoreAiAgentId?: string | null;\n\t} = {}\n): void {\n\tconst { payload } = event;\n\tconst identity = resolveActorIdentity(payload);\n\n\tif (!identity) {\n\t\treturn;\n\t}\n\n\tif (\n\t\t(identity.actorType === \"visitor\" &&\n\t\t\toptions.ignoreVisitorId &&\n\t\t\tidentity.actorId === options.ignoreVisitorId) ||\n\t\t(identity.actorType === \"user\" &&\n\t\t\toptions.ignoreUserId &&\n\t\t\tidentity.actorId === options.ignoreUserId) ||\n\t\t(identity.actorType === \"ai_agent\" &&\n\t\t\toptions.ignoreAiAgentId &&\n\t\t\tidentity.actorId === options.ignoreAiAgentId)\n\t) {\n\t\treturn;\n\t}\n\n\tconst lastSeenAt = payload.lastSeenAt;\n\n\tupsertConversationSeen(store, {\n\t\tconversationId: payload.conversationId,\n\t\tactorType: identity.actorType,\n\t\tactorId: identity.actorId,\n\t\tlastSeenAt,\n\t});\n}\n"],"mappings":";;;AAkBA,MAAMA,gBAA2B,EAChC,eAAe,EAAE,EACjB;AASD,SAAS,QACR,gBACA,WACA,SACS;AACT,QAAO,GAAG,eAAe,GAAG,UAAU,GAAG;;AAG1C,SAAS,eACR,UACA,MACU;AACV,KAAI,CAAC,SACJ,QAAO;CAGR,MAAM,eAAe,OAAO,KAAK,SAAS;CAC1C,MAAM,WAAW,OAAO,KAAK,KAAK;AAElC,KAAI,aAAa,WAAW,SAAS,OACpC,QAAO;AAGR,MAAK,MAAM,OAAO,UAAU;EAC3B,MAAM,WAAW,SAAS;EAC1B,MAAM,WAAW,KAAK;AAEtB,MAAI,EAAE,YAAY,UACjB,QAAO;AAGR,MACC,SAAS,cAAc,SAAS,aAChC,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-16,6 +16,7 @@ declare const createConversationRequestSchema: z.ZodObject<{
16
16
  message: "message";
17
17
  event: "event";
18
18
  identification: "identification";
19
+ tool: "tool";
19
20
  }>;
20
21
  text: z.ZodNullable<z.ZodString>;
21
22
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -115,7 +116,6 @@ declare const createConversationRequestSchema: z.ZodObject<{
115
116
  }, z.core.$strip>, z.ZodObject<{
116
117
  type: z.ZodLiteral<"event">;
117
118
  eventType: z.ZodEnum<{
118
- resolved: "resolved";
119
119
  assigned: "assigned";
120
120
  unassigned: "unassigned";
121
121
  participant_requested: "participant_requested";
@@ -125,6 +125,7 @@ declare const createConversationRequestSchema: z.ZodObject<{
125
125
  priority_changed: "priority_changed";
126
126
  tag_added: "tag_added";
127
127
  tag_removed: "tag_removed";
128
+ resolved: "resolved";
128
129
  reopened: "reopened";
129
130
  visitor_blocked: "visitor_blocked";
130
131
  visitor_unblocked: "visitor_unblocked";
@@ -165,6 +166,7 @@ declare const createConversationResponseSchema: z.ZodObject<{
165
166
  message: "message";
166
167
  event: "event";
167
168
  identification: "identification";
169
+ tool: "tool";
168
170
  }>;
169
171
  text: z.ZodNullable<z.ZodString>;
170
172
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -264,7 +266,6 @@ declare const createConversationResponseSchema: z.ZodObject<{
264
266
  }, z.core.$strip>, z.ZodObject<{
265
267
  type: z.ZodLiteral<"event">;
266
268
  eventType: z.ZodEnum<{
267
- resolved: "resolved";
268
269
  assigned: "assigned";
269
270
  unassigned: "unassigned";
270
271
  participant_requested: "participant_requested";
@@ -274,6 +275,7 @@ declare const createConversationResponseSchema: z.ZodObject<{
274
275
  priority_changed: "priority_changed";
275
276
  tag_added: "tag_added";
276
277
  tag_removed: "tag_removed";
278
+ resolved: "resolved";
277
279
  reopened: "reopened";
278
280
  visitor_blocked: "visitor_blocked";
279
281
  visitor_unblocked: "visitor_unblocked";
@@ -306,10 +308,12 @@ declare const createConversationResponseSchema: z.ZodObject<{
306
308
  visitorId: z.ZodString;
307
309
  websiteId: z.ZodString;
308
310
  status: z.ZodDefault<z.ZodEnum<{
309
- open: "open";
310
311
  resolved: "resolved";
312
+ open: "open";
311
313
  spam: "spam";
312
314
  }>>;
315
+ visitorRating: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
316
+ visitorRatingAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
313
317
  deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
314
318
  visitorLastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
319
  lastTimelineItem: z.ZodOptional<z.ZodObject<{
@@ -324,6 +328,7 @@ declare const createConversationResponseSchema: z.ZodObject<{
324
328
  message: "message";
325
329
  event: "event";
326
330
  identification: "identification";
331
+ tool: "tool";
327
332
  }>;
328
333
  text: z.ZodNullable<z.ZodString>;
329
334
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -423,7 +428,6 @@ declare const createConversationResponseSchema: z.ZodObject<{
423
428
  }, z.core.$strip>, z.ZodObject<{
424
429
  type: z.ZodLiteral<"event">;
425
430
  eventType: z.ZodEnum<{
426
- resolved: "resolved";
427
431
  assigned: "assigned";
428
432
  unassigned: "unassigned";
429
433
  participant_requested: "participant_requested";
@@ -433,6 +437,7 @@ declare const createConversationResponseSchema: z.ZodObject<{
433
437
  priority_changed: "priority_changed";
434
438
  tag_added: "tag_added";
435
439
  tag_removed: "tag_removed";
440
+ resolved: "resolved";
436
441
  reopened: "reopened";
437
442
  visitor_blocked: "visitor_blocked";
438
443
  visitor_unblocked: "visitor_unblocked";
@@ -487,10 +492,12 @@ declare const listConversationsResponseSchema: z.ZodObject<{
487
492
  visitorId: z.ZodString;
488
493
  websiteId: z.ZodString;
489
494
  status: z.ZodDefault<z.ZodEnum<{
490
- open: "open";
491
495
  resolved: "resolved";
496
+ open: "open";
492
497
  spam: "spam";
493
498
  }>>;
499
+ visitorRating: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
500
+ visitorRatingAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
494
501
  deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
495
502
  visitorLastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
496
503
  lastTimelineItem: z.ZodOptional<z.ZodObject<{
@@ -505,6 +512,7 @@ declare const listConversationsResponseSchema: z.ZodObject<{
505
512
  message: "message";
506
513
  event: "event";
507
514
  identification: "identification";
515
+ tool: "tool";
508
516
  }>;
509
517
  text: z.ZodNullable<z.ZodString>;
510
518
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -604,7 +612,6 @@ declare const listConversationsResponseSchema: z.ZodObject<{
604
612
  }, z.core.$strip>, z.ZodObject<{
605
613
  type: z.ZodLiteral<"event">;
606
614
  eventType: z.ZodEnum<{
607
- resolved: "resolved";
608
615
  assigned: "assigned";
609
616
  unassigned: "unassigned";
610
617
  participant_requested: "participant_requested";
@@ -614,6 +621,7 @@ declare const listConversationsResponseSchema: z.ZodObject<{
614
621
  priority_changed: "priority_changed";
615
622
  tag_added: "tag_added";
616
623
  tag_removed: "tag_removed";
624
+ resolved: "resolved";
617
625
  reopened: "reopened";
618
626
  visitor_blocked: "visitor_blocked";
619
627
  visitor_unblocked: "visitor_unblocked";
@@ -661,10 +669,12 @@ declare const getConversationResponseSchema: z.ZodObject<{
661
669
  visitorId: z.ZodString;
662
670
  websiteId: z.ZodString;
663
671
  status: z.ZodDefault<z.ZodEnum<{
664
- open: "open";
665
672
  resolved: "resolved";
673
+ open: "open";
666
674
  spam: "spam";
667
675
  }>>;
676
+ visitorRating: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
677
+ visitorRatingAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
668
678
  deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
669
679
  visitorLastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
670
680
  lastTimelineItem: z.ZodOptional<z.ZodObject<{
@@ -679,6 +689,7 @@ declare const getConversationResponseSchema: z.ZodObject<{
679
689
  message: "message";
680
690
  event: "event";
681
691
  identification: "identification";
692
+ tool: "tool";
682
693
  }>;
683
694
  text: z.ZodNullable<z.ZodString>;
684
695
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -778,7 +789,6 @@ declare const getConversationResponseSchema: z.ZodObject<{
778
789
  }, z.core.$strip>, z.ZodObject<{
779
790
  type: z.ZodLiteral<"event">;
780
791
  eventType: z.ZodEnum<{
781
- resolved: "resolved";
782
792
  assigned: "assigned";
783
793
  unassigned: "unassigned";
784
794
  participant_requested: "participant_requested";
@@ -788,6 +798,7 @@ declare const getConversationResponseSchema: z.ZodObject<{
788
798
  priority_changed: "priority_changed";
789
799
  tag_added: "tag_added";
790
800
  tag_removed: "tag_removed";
801
+ resolved: "resolved";
791
802
  reopened: "reopened";
792
803
  visitor_blocked: "visitor_blocked";
793
804
  visitor_unblocked: "visitor_unblocked";
@@ -831,6 +842,18 @@ declare const setConversationTypingResponseSchema: z.ZodObject<{
831
842
  sentAt: z.ZodString;
832
843
  }, z.core.$strip>;
833
844
  type SetConversationTypingResponseBody = z.infer<typeof setConversationTypingResponseSchema>;
845
+ declare const submitConversationRatingRequestSchema: z.ZodObject<{
846
+ rating: z.ZodNumber;
847
+ comment: z.ZodOptional<z.ZodString>;
848
+ visitorId: z.ZodOptional<z.ZodString>;
849
+ }, z.core.$strip>;
850
+ type SubmitConversationRatingRequestBody = z.infer<typeof submitConversationRatingRequestSchema>;
851
+ declare const submitConversationRatingResponseSchema: z.ZodObject<{
852
+ conversationId: z.ZodString;
853
+ rating: z.ZodNumber;
854
+ ratedAt: z.ZodString;
855
+ }, z.core.$strip>;
856
+ type SubmitConversationRatingResponseBody = z.infer<typeof submitConversationRatingResponseSchema>;
834
857
  declare const getConversationSeenDataResponseSchema: z.ZodObject<{
835
858
  seenData: z.ZodArray<z.ZodObject<{
836
859
  id: z.ZodString;
@@ -846,5 +869,5 @@ declare const getConversationSeenDataResponseSchema: z.ZodObject<{
846
869
  }, z.core.$strip>;
847
870
  type GetConversationSeenDataResponse = z.infer<typeof getConversationSeenDataResponseSchema>;
848
871
  //#endregion
849
- export { CreateConversationRequestBody, CreateConversationResponseBody, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, ListConversationsRequest, ListConversationsResponse, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, SetConversationTypingResponseBody };
872
+ export { CreateConversationRequestBody, CreateConversationResponseBody, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, ListConversationsRequest, ListConversationsResponse, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, SetConversationTypingResponseBody, SubmitConversationRatingRequestBody, SubmitConversationRatingResponseBody };
850
873
  //# sourceMappingURL=conversation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","names":[],"sources":["../../../../../types/src/api/conversation.ts"],"sourcesContent":[],"mappings":";;;cAIa,iCAA+B,CAAA,CAAA;;EAA/B,cAAA,eAAA,YAoBV,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAES,6BAAA,GAAgC,CAAA,CAAE,aACtC;cAGK,kCAAgC,CAAA,CAAA;;;;;;;;;;;;;;;;;MA1BD,IAAA,cAAA,CAAA,MAAA,CAAA;MAAA,IAAA,aAAA;MAsBhC,KAAA,eAAA,UAA6B,CAAA;QAI5B,SAAA,EAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ChC;cAGK,mCAAiC,CAAA,CAAA;;;KAYlC,+BAAA,GAAkC,CAAA,CAAE,aACxC;cAGK,oCAAkC,CAAA,CAAA;;;;KAcnC,gCAAA,GAAmC,CAAA,CAAE,aACzC;cA0BK,qCAAmC,CAAA,CAAA;;;;;;KAoBpC,iCAAA,GAAoC,CAAA,CAAE,aAC1C;cAGK,uCAAqC,CAAA,CAAA;;;;;KAkBtC,mCAAA,GAAsC,CAAA,CAAE,aAC5C;cAGK,wCAAsC,CAAA,CAAA;;;;;KAgBvC,oCAAA,GAAuC,CAAA,CAAE,aAC7C;cAGK,uCAAqC,CAAA,CAAA;;;;;;;;;;;;;KAuCtC,+BAAA,GAAkC,CAAA,CAAE,aACxC"}
@@ -14,6 +14,7 @@ declare const timelineItemSchema: z.ZodObject<{
14
14
  message: "message";
15
15
  event: "event";
16
16
  identification: "identification";
17
+ tool: "tool";
17
18
  }>;
18
19
  text: z.ZodNullable<z.ZodString>;
19
20
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -113,7 +114,6 @@ declare const timelineItemSchema: z.ZodObject<{
113
114
  }, z.core.$strip>, z.ZodObject<{
114
115
  type: z.ZodLiteral<"event">;
115
116
  eventType: z.ZodEnum<{
116
- resolved: "resolved";
117
117
  assigned: "assigned";
118
118
  unassigned: "unassigned";
119
119
  participant_requested: "participant_requested";
@@ -123,6 +123,7 @@ declare const timelineItemSchema: z.ZodObject<{
123
123
  priority_changed: "priority_changed";
124
124
  tag_added: "tag_added";
125
125
  tag_removed: "tag_removed";
126
+ resolved: "resolved";
126
127
  reopened: "reopened";
127
128
  visitor_blocked: "visitor_blocked";
128
129
  visitor_unblocked: "visitor_unblocked";
@@ -167,6 +168,7 @@ declare const getConversationTimelineItemsResponseSchema: z.ZodObject<{
167
168
  message: "message";
168
169
  event: "event";
169
170
  identification: "identification";
171
+ tool: "tool";
170
172
  }>;
171
173
  text: z.ZodNullable<z.ZodString>;
172
174
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -266,7 +268,6 @@ declare const getConversationTimelineItemsResponseSchema: z.ZodObject<{
266
268
  }, z.core.$strip>, z.ZodObject<{
267
269
  type: z.ZodLiteral<"event">;
268
270
  eventType: z.ZodEnum<{
269
- resolved: "resolved";
270
271
  assigned: "assigned";
271
272
  unassigned: "unassigned";
272
273
  participant_requested: "participant_requested";
@@ -276,6 +277,7 @@ declare const getConversationTimelineItemsResponseSchema: z.ZodObject<{
276
277
  priority_changed: "priority_changed";
277
278
  tag_added: "tag_added";
278
279
  tag_removed: "tag_removed";
280
+ resolved: "resolved";
279
281
  reopened: "reopened";
280
282
  visitor_blocked: "visitor_blocked";
281
283
  visitor_unblocked: "visitor_unblocked";
@@ -409,7 +411,6 @@ declare const sendTimelineItemRequestSchema: z.ZodObject<{
409
411
  }, z.core.$strip>, z.ZodObject<{
410
412
  type: z.ZodLiteral<"event">;
411
413
  eventType: z.ZodEnum<{
412
- resolved: "resolved";
413
414
  assigned: "assigned";
414
415
  unassigned: "unassigned";
415
416
  participant_requested: "participant_requested";
@@ -419,6 +420,7 @@ declare const sendTimelineItemRequestSchema: z.ZodObject<{
419
420
  priority_changed: "priority_changed";
420
421
  tag_added: "tag_added";
421
422
  tag_removed: "tag_removed";
423
+ resolved: "resolved";
422
424
  reopened: "reopened";
423
425
  visitor_blocked: "visitor_blocked";
424
426
  visitor_unblocked: "visitor_unblocked";
@@ -462,6 +464,7 @@ declare const sendTimelineItemResponseSchema: z.ZodObject<{
462
464
  message: "message";
463
465
  event: "event";
464
466
  identification: "identification";
467
+ tool: "tool";
465
468
  }>;
466
469
  text: z.ZodNullable<z.ZodString>;
467
470
  tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -561,7 +564,6 @@ declare const sendTimelineItemResponseSchema: z.ZodObject<{
561
564
  }, z.core.$strip>, z.ZodObject<{
562
565
  type: z.ZodLiteral<"event">;
563
566
  eventType: z.ZodEnum<{
564
- resolved: "resolved";
565
567
  assigned: "assigned";
566
568
  unassigned: "unassigned";
567
569
  participant_requested: "participant_requested";
@@ -571,6 +573,7 @@ declare const sendTimelineItemResponseSchema: z.ZodObject<{
571
573
  priority_changed: "priority_changed";
572
574
  tag_added: "tag_added";
573
575
  tag_removed: "tag_removed";
576
+ resolved: "resolved";
574
577
  reopened: "reopened";
575
578
  visitor_blocked: "visitor_blocked";
576
579
  visitor_unblocked: "visitor_unblocked";
@@ -1 +1 @@
1
- {"version":3,"file":"timeline-item.d.ts","names":[],"sources":["../../../../../types/src/api/timeline-item.ts"],"sourcesContent":[],"mappings":";;;;cAkSa,oBAAkB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2HwB,GAAA,aAAA;IAAA,KAAA,eAAA,YAAA,CAAA;IAiB3C,gBAAA,eAAA,YAAoC,CAAA;MAKnC,UAAA,eAkDV,YAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA/IS,kBAAA,GAAqB,CAAA,CAAE,aAAa;KAEpC,YAAA,GAAe,CAAA,CAAE,aAAa;cAkD7B,2CAAyC,CAAA,CAAA;;;;KAe1C,mCAAA,GAAsC,CAAA,CAAE,aAC5C;cAGK,4CAA0C,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAsBb,OAAA,EAAA,SAAA;UAAA,CAAA,CAAA,CAAA;UAoD9B,eAAuB,eAC3B,YAAA,CAAA;UAGK,WAAA,eAQV,YAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KArES,oCAAA,GAAuC,CAAA,CAAE,aAC7C;cAIK,+BAA6B,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ItB,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA7DD,oCAAA,GAAuC,CAAA,CAAE,aAC7C;cAIK,+BAA6B,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAwDC,eAAA,eAAA,YAAA,CAAA;UAAA,WAAA,eAAA,YAAA,CAAA;QAU/B,CAAA,eAAwB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAdxB,uBAAA,GAA0B,CAAA,CAAE,aAChC;cAGK,gCAA8B,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAU/B,wBAAA,GAA2B,CAAA,CAAE,aACjC"}
@@ -117,8 +117,9 @@ const timelineItemSchema = z.object({
117
117
  type: z.enum([
118
118
  ConversationTimelineType.MESSAGE,
119
119
  ConversationTimelineType.EVENT,
120
- ConversationTimelineType.IDENTIFICATION
121
- ]).openapi({ description: "Type of timeline item - message, event, or interactive identification tool" }),
120
+ ConversationTimelineType.IDENTIFICATION,
121
+ ConversationTimelineType.TOOL
122
+ ]).openapi({ description: "Type of timeline item - message, event, identification, or tool call" }),
122
123
  text: z.string().nullable().openapi({ description: "Main text content of the timeline item" }),
123
124
  tool: z.string().nullable().optional().openapi({ description: "Optional tool identifier associated with this timeline item" }),
124
125
  parts: timelineItemPartsSchema,
@@ -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,QAAQ,CAAC,QAAQ,EACxB,aAAa,oBACb,CAAC;CACF,OAAO,EAAE,KAAK,CAAC,aAAa,OAAO,CAAC,CAAC,UAAU,CAAC,QAAQ,EACvD,aACC,mEACD,CAAC;CACF,CAAC;AAKF,MAAM,sBAAsB,EAAE,OAAO;CACpC,MAAM,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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\";\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\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>;\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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;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"}