@cossistant/types 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api/index.d.ts CHANGED
@@ -2,13 +2,13 @@ import { AIAgentGoal, AIModel, AIModelConfig, AI_AGENT_GOALS, AI_MODELS, AiAgent
2
2
  import { PaginationInput, PaginationResponse, emailSchema, optionalUserIdSchema, paginationResponseSchema, paginationSchema, userIdSchema } from "./common.js";
3
3
  import { Contact, ContactMetadata, ContactOrganizationResponse, ContactResponse, CreateContactOrganizationRequest, CreateContactRequest, IdentifyContactRequest, IdentifyContactResponse, UpdateContactMetadataRequest, UpdateContactOrganizationRequest, UpdateContactRequest, contactMetadataSchema, contactOrganization, contactOrganizationResponseSchema, contactResponseSchema, createContactOrganizationRequestSchema, createContactRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema } from "./contact.js";
4
4
  import { CreateConversationRequestBody, CreateConversationResponseBody, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, ListConversationsRequest, ListConversationsResponse, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, SetConversationTypingRequestBody, SetConversationTypingResponseBody, createConversationRequestSchema, createConversationResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema } from "./conversation.js";
5
- import { ArticleKnowledgePayload, CreateKnowledgeRequest, CreateKnowledgeRestRequest, FaqKnowledgePayload, GetKnowledgeRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UrlKnowledgePayload, articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema } from "./knowledge.js";
5
+ import { ArticleKnowledgePayload, CreateKnowledgeRequest, CreateKnowledgeRestRequest, DeleteKnowledgeRequest, FaqKnowledgePayload, GetKnowledgeRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, ToggleKnowledgeEntryIncludedRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UploadKnowledgeFileRequest, UrlKnowledgePayload, articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, uploadKnowledgeFileRequestSchema, urlKnowledgePayloadSchema } from "./knowledge.js";
6
6
  import { CancelLinkSourceRequest, CrawlProgressPage, CreateLinkSourceRequest, DeleteLinkSourceRequest, DeletePageRequest, DiscoveredPage, GetCrawlStatusRequest, GetLinkSourceRequest, GetTrainingStatsRequest, IgnorePageRequest, LinkSourceResponse, LinkSourceStatus, ListKnowledgeByLinkSourceRequest, ListLinkSourcesRequest, ListLinkSourcesResponse, RecrawlLinkSourceRequest, ReindexPageRequest, ScanSubpagesRequest, ToggleKnowledgeIncludedRequest, TrainingStatsResponse, cancelLinkSourceRequestSchema, crawlProgressPageSchema, createLinkSourceRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, getCrawlStatusRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, ignorePageRequestSchema, linkSourceResponseSchema, linkSourceStatusSchema, listKnowledgeByLinkSourceRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, scanSubpagesRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema } from "./link-source.js";
7
7
  import { ContactNotificationSettings, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, MemberNotificationChannelDefinition, MemberNotificationPreference, MemberNotificationSettingsResponse, UpdateMemberNotificationSettingsRequest, UpdateMemberNotificationSettingsResponse, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, getDefaultMemberNotificationPreference, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema } from "./notification.js";
8
8
  import { OrganizationResponse, organizationResponseSchema } from "./organization.js";
9
- import { GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, SendTimelineItemRequest, SendTimelineItemResponse, TimelineItem, TimelineItemParts, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, timelineItemPartsSchema, timelineItemSchema } from "./timeline-item.js";
9
+ import { CossistantProviderMetadata, FilePart, GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, ImagePart, ReasoningPart, SendTimelineItemRequest, SendTimelineItemResponse, SourceDocumentPart, SourceUrlPart, StepStartPart, TextPart, TimelineItem, TimelineItemParts, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, ToolPart, ToolState, cossistantProviderMetadataSchema, filePartSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, imagePartSchema, reasoningPartSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, sourceDocumentPartSchema, sourceUrlPartSchema, stepStartPartSchema, textPartSchema, timelineItemPartsSchema, timelineItemSchema, timelinePartEventSchema, timelinePartMetadataSchema, toolPartSchema, toolStateSchema } from "./timeline-item.js";
10
10
  import { GenerateUploadUrlRequest, GenerateUploadUrlResponse, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema } from "./upload.js";
11
11
  import { UpdateUserProfileRequest, UserResponse, updateUserProfileRequestSchema, userResponseSchema } from "./user.js";
12
12
  import { PublicContact, PublicVisitor, PublicVisitorResponse, UpdateVisitorMetadataRequest, UpdateVisitorRequest, Visitor, VisitorMetadata, VisitorResponse, publicContactResponseSchema, publicVisitorResponseSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema } from "./visitor.js";
13
13
  import { AvailableAIAgent, AvailableAIAgentSchema, AvailableHumanAgent, CheckWebsiteDomainRequest, CreateWebsiteApiKeyRequest, CreateWebsiteRequest, CreateWebsiteResponse, ListByOrganizationRequest, PublicWebsiteResponse, RevokeWebsiteApiKeyRequest, UpdateWebsiteRequest, WebsiteApiKey, WebsiteDeveloperSettingsResponse, WebsiteListItem, WebsiteSummary, availableHumanAgentSchema, checkWebsiteDomainRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, listByOrganizationRequestSchema, publicWebsiteResponseSchema, revokeWebsiteApiKeyRequestSchema, updateWebsiteRequestSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema } from "./website.js";
14
- export { AIAgentGoal, AIModel, AIModelConfig, AI_AGENT_GOALS, AI_MODELS, AiAgentBehaviorSettings, AiAgentResponse, ArticleKnowledgePayload, AvailableAIAgent, AvailableAIAgentSchema, AvailableHumanAgent, CancelLinkSourceRequest, CheckWebsiteDomainRequest, Contact, ContactMetadata, ContactNotificationSettings, ContactOrganizationResponse, ContactResponse, CrawlProgressPage, CreateAiAgentRequest, CreateContactOrganizationRequest, CreateContactRequest, CreateConversationRequestBody, CreateConversationResponseBody, CreateKnowledgeRequest, CreateKnowledgeRestRequest, CreateLinkSourceRequest, CreateWebsiteApiKeyRequest, CreateWebsiteRequest, CreateWebsiteResponse, DeleteAiAgentRequest, DeleteLinkSourceRequest, DeletePageRequest, DiscoveredPage, FaqKnowledgePayload, GenerateBasePromptRequest, GenerateBasePromptResponse, GenerateUploadUrlRequest, GenerateUploadUrlResponse, GetAiAgentRequest, GetBehaviorSettingsRequest, GetBehaviorSettingsResponse, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, GetCrawlStatusRequest, GetKnowledgeRequest, GetLinkSourceRequest, GetTrainingStatsRequest, IdentifyContactRequest, IdentifyContactResponse, IgnorePageRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, LinkSourceResponse, LinkSourceStatus, ListByOrganizationRequest, ListConversationsRequest, ListConversationsResponse, ListKnowledgeByLinkSourceRequest, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, ListLinkSourcesRequest, ListLinkSourcesResponse, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, MemberNotificationChannel, MemberNotificationChannelDefinition, MemberNotificationPreference, MemberNotificationSettingsResponse, OrganizationResponse, PaginationInput, PaginationResponse, PublicContact, PublicVisitor, PublicVisitorResponse, PublicWebsiteResponse, RecrawlLinkSourceRequest, ReindexPageRequest, RevokeWebsiteApiKeyRequest, ScanSubpagesRequest, SendTimelineItemRequest, SendTimelineItemResponse, SetConversationTypingRequestBody, SetConversationTypingResponseBody, TimelineItem, TimelineItemParts, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, ToggleAiAgentActiveRequest, ToggleKnowledgeIncludedRequest, TrainingStatsResponse, UpdateAiAgentRequest, UpdateBehaviorSettingsRequest, UpdateBehaviorSettingsResponse, UpdateContactMetadataRequest, UpdateContactOrganizationRequest, UpdateContactRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UpdateMemberNotificationSettingsRequest, UpdateMemberNotificationSettingsResponse, UpdateUserProfileRequest, UpdateVisitorMetadataRequest, UpdateVisitorRequest, UpdateWebsiteRequest, UrlKnowledgePayload, UserResponse, Visitor, VisitorMetadata, VisitorResponse, WebsiteApiKey, WebsiteDeveloperSettingsResponse, WebsiteListItem, WebsiteSummary, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, cancelLinkSourceRequestSchema, checkWebsiteDomainRequestSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganization, contactOrganizationResponseSchema, contactResponseSchema, crawlProgressPageSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createLinkSourceRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteAiAgentRequestSchema, deleteKnowledgeRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, emailSchema, faqKnowledgePayloadSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getCrawlStatusRequestSchema, getDefaultMemberNotificationPreference, getKnowledgeRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, ignorePageRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, linkSourceResponseSchema, linkSourceStatusSchema, listByOrganizationRequestSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeByLinkSourceRequestSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, revokeWebsiteApiKeyRequestSchema, scanSubpagesRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, timelineItemPartsSchema, timelineItemSchema, toggleAiAgentActiveRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
14
+ export { AIAgentGoal, AIModel, AIModelConfig, AI_AGENT_GOALS, AI_MODELS, AiAgentBehaviorSettings, AiAgentResponse, ArticleKnowledgePayload, AvailableAIAgent, AvailableAIAgentSchema, AvailableHumanAgent, CancelLinkSourceRequest, CheckWebsiteDomainRequest, Contact, ContactMetadata, ContactNotificationSettings, ContactOrganizationResponse, ContactResponse, CossistantProviderMetadata, CrawlProgressPage, CreateAiAgentRequest, CreateContactOrganizationRequest, CreateContactRequest, CreateConversationRequestBody, CreateConversationResponseBody, CreateKnowledgeRequest, CreateKnowledgeRestRequest, CreateLinkSourceRequest, CreateWebsiteApiKeyRequest, CreateWebsiteRequest, CreateWebsiteResponse, DeleteAiAgentRequest, DeleteKnowledgeRequest, DeleteLinkSourceRequest, DeletePageRequest, DiscoveredPage, FaqKnowledgePayload, FilePart, GenerateBasePromptRequest, GenerateBasePromptResponse, GenerateUploadUrlRequest, GenerateUploadUrlResponse, GetAiAgentRequest, GetBehaviorSettingsRequest, GetBehaviorSettingsResponse, GetConversationRequest, GetConversationResponse, GetConversationSeenDataResponse, GetConversationTimelineItemsRequest, GetConversationTimelineItemsResponse, GetCrawlStatusRequest, GetKnowledgeRequest, GetLinkSourceRequest, GetTrainingStatsRequest, IdentifyContactRequest, IdentifyContactResponse, IgnorePageRequest, ImagePart, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, LinkSourceResponse, LinkSourceStatus, ListByOrganizationRequest, ListConversationsRequest, ListConversationsResponse, ListKnowledgeByLinkSourceRequest, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, ListLinkSourcesRequest, ListLinkSourcesResponse, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MarkConversationSeenRequestBody, MarkConversationSeenResponseBody, MemberNotificationChannel, MemberNotificationChannelDefinition, MemberNotificationPreference, MemberNotificationSettingsResponse, OrganizationResponse, PaginationInput, PaginationResponse, PublicContact, PublicVisitor, PublicVisitorResponse, PublicWebsiteResponse, ReasoningPart, RecrawlLinkSourceRequest, ReindexPageRequest, RevokeWebsiteApiKeyRequest, ScanSubpagesRequest, SendTimelineItemRequest, SendTimelineItemResponse, SetConversationTypingRequestBody, SetConversationTypingResponseBody, SourceDocumentPart, SourceUrlPart, StepStartPart, TextPart, TimelineItem, TimelineItemParts, TimelinePartEvent, TimelinePartFile, TimelinePartImage, TimelinePartMetadata, TimelinePartText, ToggleAiAgentActiveRequest, ToggleKnowledgeEntryIncludedRequest, ToggleKnowledgeIncludedRequest, ToolPart, ToolState, TrainingStatsResponse, UpdateAiAgentRequest, UpdateBehaviorSettingsRequest, UpdateBehaviorSettingsResponse, UpdateContactMetadataRequest, UpdateContactOrganizationRequest, UpdateContactRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UpdateMemberNotificationSettingsRequest, UpdateMemberNotificationSettingsResponse, UpdateUserProfileRequest, UpdateVisitorMetadataRequest, UpdateVisitorRequest, UpdateWebsiteRequest, UploadKnowledgeFileRequest, UrlKnowledgePayload, UserResponse, Visitor, VisitorMetadata, VisitorResponse, WebsiteApiKey, WebsiteDeveloperSettingsResponse, WebsiteListItem, WebsiteSummary, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, cancelLinkSourceRequestSchema, checkWebsiteDomainRequestSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganization, contactOrganizationResponseSchema, contactResponseSchema, cossistantProviderMetadataSchema, crawlProgressPageSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createLinkSourceRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteAiAgentRequestSchema, deleteKnowledgeRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, emailSchema, faqKnowledgePayloadSchema, filePartSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getCrawlStatusRequestSchema, getDefaultMemberNotificationPreference, getKnowledgeRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, ignorePageRequestSchema, imagePartSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, linkSourceResponseSchema, linkSourceStatusSchema, listByOrganizationRequestSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeByLinkSourceRequestSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, reasoningPartSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, revokeWebsiteApiKeyRequestSchema, scanSubpagesRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, sourceDocumentPartSchema, sourceUrlPartSchema, stepStartPartSchema, textPartSchema, timelineItemPartsSchema, timelineItemSchema, timelinePartEventSchema, timelinePartMetadataSchema, toggleAiAgentActiveRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, toggleKnowledgeIncludedRequestSchema, toolPartSchema, toolStateSchema, trainingStatsResponseSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadKnowledgeFileRequestSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
package/api/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { AI_AGENT_GOALS, AI_MODELS, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, createAiAgentRequestSchema, deleteAiAgentRequestSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema } from "./ai-agent.js";
2
2
  import { emailSchema, optionalUserIdSchema, paginationResponseSchema, paginationSchema, userIdSchema } from "./common.js";
3
3
  import { contactMetadataSchema, contactOrganizationResponseSchema, contactResponseSchema, createContactOrganizationRequestSchema, createContactRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema } from "./contact.js";
4
- import { getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, timelineItemPartsSchema, timelineItemSchema } from "./timeline-item.js";
4
+ import { cossistantProviderMetadataSchema, filePartSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, imagePartSchema, reasoningPartSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, sourceDocumentPartSchema, sourceUrlPartSchema, stepStartPartSchema, textPartSchema, timelineItemPartsSchema, timelineItemSchema, timelinePartEventSchema, timelinePartMetadataSchema, toolPartSchema, toolStateSchema } from "./timeline-item.js";
5
5
  import { createConversationRequestSchema, createConversationResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, listConversationsRequestSchema, listConversationsResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema } from "./conversation.js";
6
- import { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema } from "./knowledge.js";
6
+ import { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, uploadKnowledgeFileRequestSchema, urlKnowledgePayloadSchema } from "./knowledge.js";
7
7
  import { cancelLinkSourceRequestSchema, crawlProgressPageSchema, createLinkSourceRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, getCrawlStatusRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, ignorePageRequestSchema, linkSourceResponseSchema, linkSourceStatusSchema, listKnowledgeByLinkSourceRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, scanSubpagesRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema } from "./link-source.js";
8
8
  import { MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, getDefaultMemberNotificationPreference, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema } from "./notification.js";
9
9
  import { organizationResponseSchema } from "./organization.js";
@@ -12,4 +12,4 @@ import { updateUserProfileRequestSchema, userResponseSchema } from "./user.js";
12
12
  import { publicContactResponseSchema, publicVisitorResponseSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema } from "./visitor.js";
13
13
  import { AvailableAIAgentSchema, availableHumanAgentSchema, checkWebsiteDomainRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, listByOrganizationRequestSchema, publicWebsiteResponseSchema, revokeWebsiteApiKeyRequestSchema, updateWebsiteRequestSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema } from "./website.js";
14
14
 
15
- export { AI_AGENT_GOALS, AI_MODELS, AvailableAIAgentSchema, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, cancelLinkSourceRequestSchema, checkWebsiteDomainRequestSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganizationResponseSchema, contactResponseSchema, crawlProgressPageSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createLinkSourceRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteAiAgentRequestSchema, deleteKnowledgeRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, emailSchema, faqKnowledgePayloadSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getCrawlStatusRequestSchema, getDefaultMemberNotificationPreference, getKnowledgeRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, ignorePageRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, linkSourceResponseSchema, linkSourceStatusSchema, listByOrganizationRequestSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeByLinkSourceRequestSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, revokeWebsiteApiKeyRequestSchema, scanSubpagesRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, timelineItemPartsSchema, timelineItemSchema, toggleAiAgentActiveRequestSchema, toggleKnowledgeIncludedRequestSchema, trainingStatsResponseSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
15
+ export { AI_AGENT_GOALS, AI_MODELS, AvailableAIAgentSchema, MEMBER_NOTIFICATION_CHANNEL_DEFINITIONS, MEMBER_NOTIFICATION_DEFINITION_MAP, MemberNotificationChannel, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, articleKnowledgePayloadSchema, availableHumanAgentSchema, cancelLinkSourceRequestSchema, checkWebsiteDomainRequestSchema, contactMetadataSchema, contactNotificationChannelConfigSchema, contactNotificationSettingsSchema, contactOrganizationResponseSchema, contactResponseSchema, cossistantProviderMetadataSchema, crawlProgressPageSchema, createAiAgentRequestSchema, createContactOrganizationRequestSchema, createContactRequestSchema, createConversationRequestSchema, createConversationResponseSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, createLinkSourceRequestSchema, createWebsiteApiKeyRequestSchema, createWebsiteRequestSchema, createWebsiteResponseSchema, deleteAiAgentRequestSchema, deleteKnowledgeRequestSchema, deleteLinkSourceRequestSchema, deletePageRequestSchema, discoveredPageSchema, emailSchema, faqKnowledgePayloadSchema, filePartSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, generateUploadUrlRequestSchema, generateUploadUrlResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, getConversationRequestSchema, getConversationResponseSchema, getConversationSeenDataResponseSchema, getConversationTimelineItemsRequestSchema, getConversationTimelineItemsResponseSchema, getCrawlStatusRequestSchema, getDefaultMemberNotificationPreference, getKnowledgeRequestSchema, getLinkSourceRequestSchema, getTrainingStatsRequestSchema, identifyContactRequestSchema, identifyContactResponseSchema, ignorePageRequestSchema, imagePartSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, linkSourceResponseSchema, linkSourceStatusSchema, listByOrganizationRequestSchema, listConversationsRequestSchema, listConversationsResponseSchema, listKnowledgeByLinkSourceRequestSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, listLinkSourcesRequestSchema, listLinkSourcesResponseSchema, markConversationSeenRequestSchema, markConversationSeenResponseSchema, memberNotificationChannelSchema, memberNotificationPreferenceSchema, memberNotificationSettingsResponseSchema, optionalUserIdSchema, organizationResponseSchema, paginationResponseSchema, paginationSchema, publicContactResponseSchema, publicVisitorResponseSchema, publicWebsiteResponseSchema, reasoningPartSchema, recrawlLinkSourceRequestSchema, reindexPageRequestSchema, revokeWebsiteApiKeyRequestSchema, scanSubpagesRequestSchema, sendTimelineItemRequestSchema, sendTimelineItemResponseSchema, setConversationTypingRequestSchema, setConversationTypingResponseSchema, sourceDocumentPartSchema, sourceUrlPartSchema, stepStartPartSchema, textPartSchema, timelineItemPartsSchema, timelineItemSchema, timelinePartEventSchema, timelinePartMetadataSchema, toggleAiAgentActiveRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, toggleKnowledgeIncludedRequestSchema, toolPartSchema, toolStateSchema, trainingStatsResponseSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateContactMetadataRequestSchema, updateContactOrganizationRequestSchema, updateContactRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, updateMemberNotificationSettingsRequestSchema, updateMemberNotificationSettingsResponseSchema, updateUserProfileRequestSchema, updateVisitorMetadataRequestSchema, updateVisitorRequestSchema, updateWebsiteRequestSchema, uploadContactIdSchema, uploadConversationIdSchema, uploadFileExtensionSchema, uploadFileNameSchema, uploadKnowledgeFileRequestSchema, uploadOrganizationIdSchema, uploadPathSchema, uploadScopeContactSchema, uploadScopeConversationSchema, uploadScopeSchema, uploadScopeUserSchema, uploadScopeVisitorSchema, uploadUserIdSchema, uploadVisitorIdSchema, uploadWebsiteIdSchema, urlKnowledgePayloadSchema, userIdSchema, userResponseSchema, visitorMetadataSchema, visitorProfileSchema, visitorResponseSchema, websiteApiKeySchema, websiteDeveloperSettingsResponseSchema, websiteListItemSchema, websiteSummarySchema };
@@ -43,7 +43,7 @@ declare const knowledgeCreateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
43
43
  origin: z.ZodString;
44
44
  createdBy: z.ZodString;
45
45
  contentHash: z.ZodString;
46
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
46
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
47
47
  type: z.ZodLiteral<"url">;
48
48
  sourceUrl: z.ZodURL;
49
49
  payload: z.ZodObject<{
@@ -68,7 +68,7 @@ declare const knowledgeCreateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
68
68
  origin: z.ZodString;
69
69
  createdBy: z.ZodString;
70
70
  contentHash: z.ZodString;
71
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
71
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
72
72
  type: z.ZodLiteral<"faq">;
73
73
  payload: z.ZodObject<{
74
74
  question: z.ZodString;
@@ -84,7 +84,7 @@ declare const knowledgeCreateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
84
84
  origin: z.ZodString;
85
85
  createdBy: z.ZodString;
86
86
  contentHash: z.ZodString;
87
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
87
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
88
88
  type: z.ZodLiteral<"article">;
89
89
  sourceUrl: z.ZodNullable<z.ZodURL>;
90
90
  payload: z.ZodObject<{
@@ -106,7 +106,7 @@ declare const knowledgeSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodO
106
106
  origin: z.ZodString;
107
107
  createdBy: z.ZodString;
108
108
  contentHash: z.ZodString;
109
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
109
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
110
110
  type: z.ZodLiteral<"url">;
111
111
  sourceUrl: z.ZodURL;
112
112
  payload: z.ZodObject<{
@@ -131,7 +131,7 @@ declare const knowledgeSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodO
131
131
  origin: z.ZodString;
132
132
  createdBy: z.ZodString;
133
133
  contentHash: z.ZodString;
134
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
134
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
135
135
  type: z.ZodLiteral<"faq">;
136
136
  payload: z.ZodObject<{
137
137
  question: z.ZodString;
@@ -147,7 +147,7 @@ declare const knowledgeSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodO
147
147
  origin: z.ZodString;
148
148
  createdBy: z.ZodString;
149
149
  contentHash: z.ZodString;
150
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
150
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
151
151
  type: z.ZodLiteral<"article">;
152
152
  sourceUrl: z.ZodNullable<z.ZodURL>;
153
153
  payload: z.ZodObject<{
@@ -203,12 +203,12 @@ declare const knowledgeResponseSchema: z.ZodObject<{
203
203
  alt: z.ZodNullable<z.ZodString>;
204
204
  }, z.core.$strip>>>;
205
205
  estimatedTokens: z.ZodOptional<z.ZodNumber>;
206
- }, z.core.$strip>, z.ZodObject<{
206
+ }, z.core.$loose>, z.ZodObject<{
207
207
  question: z.ZodString;
208
208
  answer: z.ZodString;
209
209
  categories: z.ZodDefault<z.ZodArray<z.ZodString>>;
210
210
  relatedQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
211
- }, z.core.$strip>, z.ZodObject<{
211
+ }, z.core.$loose>, z.ZodObject<{
212
212
  title: z.ZodString;
213
213
  summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
214
  markdown: z.ZodString;
@@ -217,8 +217,8 @@ declare const knowledgeResponseSchema: z.ZodObject<{
217
217
  src: z.ZodURL;
218
218
  alt: z.ZodNullable<z.ZodString>;
219
219
  }, z.core.$strip>>;
220
- }, z.core.$strip>]>;
221
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
220
+ }, z.core.$loose>]>;
221
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
222
222
  isIncluded: z.ZodBoolean;
223
223
  sizeBytes: z.ZodNumber;
224
224
  createdAt: z.ZodString;
@@ -287,12 +287,12 @@ declare const listKnowledgeResponseSchema: z.ZodObject<{
287
287
  alt: z.ZodNullable<z.ZodString>;
288
288
  }, z.core.$strip>>>;
289
289
  estimatedTokens: z.ZodOptional<z.ZodNumber>;
290
- }, z.core.$strip>, z.ZodObject<{
290
+ }, z.core.$loose>, z.ZodObject<{
291
291
  question: z.ZodString;
292
292
  answer: z.ZodString;
293
293
  categories: z.ZodDefault<z.ZodArray<z.ZodString>>;
294
294
  relatedQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
295
- }, z.core.$strip>, z.ZodObject<{
295
+ }, z.core.$loose>, z.ZodObject<{
296
296
  title: z.ZodString;
297
297
  summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
298
298
  markdown: z.ZodString;
@@ -301,8 +301,8 @@ declare const listKnowledgeResponseSchema: z.ZodObject<{
301
301
  src: z.ZodURL;
302
302
  alt: z.ZodNullable<z.ZodString>;
303
303
  }, z.core.$strip>>;
304
- }, z.core.$strip>]>;
305
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
304
+ }, z.core.$loose>]>;
305
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
306
306
  isIncluded: z.ZodBoolean;
307
307
  sizeBytes: z.ZodNumber;
308
308
  createdAt: z.ZodString;
@@ -366,7 +366,7 @@ declare const createKnowledgeRequestSchema: z.ZodObject<{
366
366
  alt: z.ZodNullable<z.ZodString>;
367
367
  }, z.core.$strip>>;
368
368
  }, z.core.$strip>]>;
369
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
369
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
370
370
  }, z.core.$strip>;
371
371
  type CreateKnowledgeRequest = z.infer<typeof createKnowledgeRequestSchema>;
372
372
  /**
@@ -409,11 +409,15 @@ declare const createKnowledgeRestRequestSchema: z.ZodObject<{
409
409
  alt: z.ZodNullable<z.ZodString>;
410
410
  }, z.core.$strip>>;
411
411
  }, z.core.$strip>]>;
412
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
412
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
413
413
  }, z.core.$strip>;
414
414
  type CreateKnowledgeRestRequest = z.infer<typeof createKnowledgeRestRequestSchema>;
415
415
  /**
416
416
  * Update knowledge request schema (TRPC)
417
+ *
418
+ * Note: We use .passthrough() on payload schemas to prevent Zod's union validation
419
+ * from stripping fields when the first matching schema (urlKnowledgePayloadSchema)
420
+ * doesn't include all fields from other schemas (like articleKnowledgePayloadSchema's title).
417
421
  */
418
422
  declare const updateKnowledgeRequestSchema: z.ZodObject<{
419
423
  websiteSlug: z.ZodString;
@@ -433,12 +437,12 @@ declare const updateKnowledgeRequestSchema: z.ZodObject<{
433
437
  alt: z.ZodNullable<z.ZodString>;
434
438
  }, z.core.$strip>>>;
435
439
  estimatedTokens: z.ZodOptional<z.ZodNumber>;
436
- }, z.core.$strip>, z.ZodObject<{
440
+ }, z.core.$loose>, z.ZodObject<{
437
441
  question: z.ZodString;
438
442
  answer: z.ZodString;
439
443
  categories: z.ZodDefault<z.ZodArray<z.ZodString>>;
440
444
  relatedQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
441
- }, z.core.$strip>, z.ZodObject<{
445
+ }, z.core.$loose>, z.ZodObject<{
442
446
  title: z.ZodString;
443
447
  summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
444
448
  markdown: z.ZodString;
@@ -447,12 +451,15 @@ declare const updateKnowledgeRequestSchema: z.ZodObject<{
447
451
  src: z.ZodURL;
448
452
  alt: z.ZodNullable<z.ZodString>;
449
453
  }, z.core.$strip>>;
450
- }, z.core.$strip>]>>;
451
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
454
+ }, z.core.$loose>]>>;
455
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
452
456
  }, z.core.$strip>;
453
457
  type UpdateKnowledgeRequest = z.infer<typeof updateKnowledgeRequestSchema>;
454
458
  /**
455
459
  * Update knowledge request schema (REST) - without websiteSlug
460
+ *
461
+ * Note: We use .passthrough() on payload schemas to prevent Zod's union validation
462
+ * from stripping fields. See updateKnowledgeRequestSchema for details.
456
463
  */
457
464
  declare const updateKnowledgeRestRequestSchema: z.ZodObject<{
458
465
  aiAgentId: z.ZodOptional<z.ZodNullable<z.ZodULID>>;
@@ -470,12 +477,12 @@ declare const updateKnowledgeRestRequestSchema: z.ZodObject<{
470
477
  alt: z.ZodNullable<z.ZodString>;
471
478
  }, z.core.$strip>>>;
472
479
  estimatedTokens: z.ZodOptional<z.ZodNumber>;
473
- }, z.core.$strip>, z.ZodObject<{
480
+ }, z.core.$loose>, z.ZodObject<{
474
481
  question: z.ZodString;
475
482
  answer: z.ZodString;
476
483
  categories: z.ZodDefault<z.ZodArray<z.ZodString>>;
477
484
  relatedQuestions: z.ZodDefault<z.ZodArray<z.ZodString>>;
478
- }, z.core.$strip>, z.ZodObject<{
485
+ }, z.core.$loose>, z.ZodObject<{
479
486
  title: z.ZodString;
480
487
  summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
481
488
  markdown: z.ZodString;
@@ -484,8 +491,8 @@ declare const updateKnowledgeRestRequestSchema: z.ZodObject<{
484
491
  src: z.ZodURL;
485
492
  alt: z.ZodNullable<z.ZodString>;
486
493
  }, z.core.$strip>>;
487
- }, z.core.$strip>]>>;
488
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
494
+ }, z.core.$loose>]>>;
495
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
489
496
  }, z.core.$strip>;
490
497
  type UpdateKnowledgeRestRequest = z.infer<typeof updateKnowledgeRestRequestSchema>;
491
498
  /**
@@ -495,6 +502,31 @@ declare const deleteKnowledgeRequestSchema: z.ZodObject<{
495
502
  websiteSlug: z.ZodString;
496
503
  id: z.ZodULID;
497
504
  }, z.core.$strip>;
505
+ type DeleteKnowledgeRequest = z.infer<typeof deleteKnowledgeRequestSchema>;
506
+ /**
507
+ * Toggle knowledge entry included request schema (TRPC)
508
+ * Named differently from link-source's toggleKnowledgeIncludedRequestSchema to avoid export conflict
509
+ */
510
+ declare const toggleKnowledgeEntryIncludedRequestSchema: z.ZodObject<{
511
+ websiteSlug: z.ZodString;
512
+ id: z.ZodULID;
513
+ isIncluded: z.ZodBoolean;
514
+ }, z.core.$strip>;
515
+ type ToggleKnowledgeEntryIncludedRequest = z.infer<typeof toggleKnowledgeEntryIncludedRequestSchema>;
516
+ /**
517
+ * Upload knowledge file request schema (TRPC)
518
+ */
519
+ declare const uploadKnowledgeFileRequestSchema: z.ZodObject<{
520
+ websiteSlug: z.ZodString;
521
+ aiAgentId: z.ZodOptional<z.ZodNullable<z.ZodULID>>;
522
+ fileName: z.ZodString;
523
+ fileContent: z.ZodString;
524
+ fileExtension: z.ZodEnum<{
525
+ md: "md";
526
+ txt: "txt";
527
+ }>;
528
+ }, z.core.$strip>;
529
+ type UploadKnowledgeFileRequest = z.infer<typeof uploadKnowledgeFileRequestSchema>;
498
530
  //#endregion
499
- export { ArticleKnowledgePayload, CreateKnowledgeRequest, CreateKnowledgeRestRequest, FaqKnowledgePayload, GetKnowledgeRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UrlKnowledgePayload, articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema };
531
+ export { ArticleKnowledgePayload, CreateKnowledgeRequest, CreateKnowledgeRestRequest, DeleteKnowledgeRequest, FaqKnowledgePayload, GetKnowledgeRequest, Knowledge, KnowledgeCreateInput, KnowledgeResponse, KnowledgeType, ListKnowledgeRequest, ListKnowledgeResponse, ListKnowledgeRestRequest, ToggleKnowledgeEntryIncludedRequest, UpdateKnowledgeRequest, UpdateKnowledgeRestRequest, UploadKnowledgeFileRequest, UrlKnowledgePayload, articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, uploadKnowledgeFileRequestSchema, urlKnowledgePayloadSchema };
500
532
  //# sourceMappingURL=knowledge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge.d.ts","names":[],"sources":["../../src/api/knowledge.ts"],"sourcesContent":[],"mappings":";;;cAEa,qBAAmB,CAAA,CAAA;;EAAnB,GAAA,EAAA,KAAA;EAgCA,OAAA,EAAA,SAAA;;cAAA,2BAAyB,CAAA,CAAA;;;;;;;;;;;;;cAkBzB,2BAAyB,CAAA,CAAA;;;;;;AAlBA,cAmCzB,6BAnCyB,EAmCI,CAAA,CAAA,SAnCJ,CAAA;EAAA,KAAA,aAAA;EAkBzB,OAAA,eAAA,cAeV,YAAA,CAAA,CAAA;;;;;;;;cAoGU,uBAAqB,CAAA,CAAA,uBAAA,CAAA,CAAA;;EAnHI,SAA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74
74
  keywords: z.array(z.string()).default([]),
75
75
  heroImage: imageSchema.optional()
76
76
  }).openapi({ description: "Payload describing a full article or help doc" });
77
- const metadataSchema = z.record(z.string(), z.unknown()).optional().openapi({
77
+ const metadataSchema = z.record(z.string(), z.unknown()).nullish().openapi({
78
78
  description: "Arbitrary metadata such as locale or crawl depth",
79
79
  example: {
80
80
  locale: "en-US",
@@ -200,9 +200,9 @@ const knowledgeResponseSchema = z.object({
200
200
  example: "5d41402abc4b2a76b9719d911017c592"
201
201
  }),
202
202
  payload: z.union([
203
- urlKnowledgePayloadSchema,
204
- faqKnowledgePayloadSchema,
205
- articleKnowledgePayloadSchema
203
+ urlKnowledgePayloadSchema.passthrough(),
204
+ faqKnowledgePayloadSchema.passthrough(),
205
+ articleKnowledgePayloadSchema.passthrough()
206
206
  ]),
207
207
  metadata: metadataSchema,
208
208
  isIncluded: z.boolean().openapi({
@@ -375,6 +375,10 @@ const createKnowledgeRestRequestSchema = z.object({
375
375
  }).openapi({ description: "Request to create a new knowledge entry (REST)" });
376
376
  /**
377
377
  * Update knowledge request schema (TRPC)
378
+ *
379
+ * Note: We use .passthrough() on payload schemas to prevent Zod's union validation
380
+ * from stripping fields when the first matching schema (urlKnowledgePayloadSchema)
381
+ * doesn't include all fields from other schemas (like articleKnowledgePayloadSchema's title).
378
382
  */
379
383
  const updateKnowledgeRequestSchema = z.object({
380
384
  websiteSlug: z.string().openapi({
@@ -398,14 +402,17 @@ const updateKnowledgeRequestSchema = z.object({
398
402
  example: "Getting started with the Cossistant dashboard"
399
403
  }),
400
404
  payload: z.union([
401
- urlKnowledgePayloadSchema,
402
- faqKnowledgePayloadSchema,
403
- articleKnowledgePayloadSchema
405
+ urlKnowledgePayloadSchema.passthrough(),
406
+ faqKnowledgePayloadSchema.passthrough(),
407
+ articleKnowledgePayloadSchema.passthrough()
404
408
  ]).optional(),
405
409
  metadata: metadataSchema
406
410
  }).openapi({ description: "Request to update an existing knowledge entry" });
407
411
  /**
408
412
  * Update knowledge request schema (REST) - without websiteSlug
413
+ *
414
+ * Note: We use .passthrough() on payload schemas to prevent Zod's union validation
415
+ * from stripping fields. See updateKnowledgeRequestSchema for details.
409
416
  */
410
417
  const updateKnowledgeRestRequestSchema = z.object({
411
418
  aiAgentId: z.ulid().nullable().optional().openapi({
@@ -421,9 +428,9 @@ const updateKnowledgeRestRequestSchema = z.object({
421
428
  example: "Getting started with the Cossistant dashboard"
422
429
  }),
423
430
  payload: z.union([
424
- urlKnowledgePayloadSchema,
425
- faqKnowledgePayloadSchema,
426
- articleKnowledgePayloadSchema
431
+ urlKnowledgePayloadSchema.passthrough(),
432
+ faqKnowledgePayloadSchema.passthrough(),
433
+ articleKnowledgePayloadSchema.passthrough()
427
434
  ]).optional(),
428
435
  metadata: metadataSchema
429
436
  }).openapi({ description: "Request to update an existing knowledge entry (REST)" });
@@ -440,7 +447,50 @@ const deleteKnowledgeRequestSchema = z.object({
440
447
  example: "01JG00000000000000000000A"
441
448
  })
442
449
  }).openapi({ description: "Request to delete a knowledge entry" });
450
+ /**
451
+ * Toggle knowledge entry included request schema (TRPC)
452
+ * Named differently from link-source's toggleKnowledgeIncludedRequestSchema to avoid export conflict
453
+ */
454
+ const toggleKnowledgeEntryIncludedRequestSchema = z.object({
455
+ websiteSlug: z.string().openapi({
456
+ description: "The website slug",
457
+ example: "my-website"
458
+ }),
459
+ id: z.ulid().openapi({
460
+ description: "Knowledge entry ID",
461
+ example: "01JG00000000000000000000A"
462
+ }),
463
+ isIncluded: z.boolean().openapi({
464
+ description: "Whether this entry should be included in training",
465
+ example: true
466
+ })
467
+ }).openapi({ description: "Request to toggle knowledge entry inclusion in training" });
468
+ /**
469
+ * Upload knowledge file request schema (TRPC)
470
+ */
471
+ const uploadKnowledgeFileRequestSchema = z.object({
472
+ websiteSlug: z.string().openapi({
473
+ description: "The website slug",
474
+ example: "my-website"
475
+ }),
476
+ aiAgentId: z.ulid().nullable().optional().openapi({
477
+ description: "Optional AI agent ID; null/omit for shared at website scope",
478
+ example: "01JG000000000000000000002"
479
+ }),
480
+ fileName: z.string().min(1).openapi({
481
+ description: "Original file name",
482
+ example: "getting-started.md"
483
+ }),
484
+ fileContent: z.string().min(1).openapi({
485
+ description: "Raw file content",
486
+ example: "# Getting Started\n\nWelcome to our documentation..."
487
+ }),
488
+ fileExtension: z.enum(["md", "txt"]).openapi({
489
+ description: "File extension",
490
+ example: "md"
491
+ })
492
+ }).openapi({ description: "Request to upload a file as a knowledge entry" });
443
493
 
444
494
  //#endregion
445
- export { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, urlKnowledgePayloadSchema };
495
+ export { articleKnowledgePayloadSchema, createKnowledgeRequestSchema, createKnowledgeRestRequestSchema, deleteKnowledgeRequestSchema, faqKnowledgePayloadSchema, getKnowledgeRequestSchema, knowledgeCreateSchema, knowledgeResponseSchema, knowledgeSchema, knowledgeTypeSchema, listKnowledgeRequestSchema, listKnowledgeResponseSchema, listKnowledgeRestRequestSchema, toggleKnowledgeEntryIncludedRequestSchema, updateKnowledgeRequestSchema, updateKnowledgeRestRequestSchema, uploadKnowledgeFileRequestSchema, urlKnowledgePayloadSchema };
446
496
  //# sourceMappingURL=knowledge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge.js","names":[],"sources":["../../src/api/knowledge.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\n\nexport const knowledgeTypeSchema = z.enum([\"url\", \"faq\", \"article\"]).openapi({\n\tdescription: \"Knowledge entry type\",\n\texample: \"url\",\n});\n\nconst headingSchema = z.object({\n\tlevel: z.number().int().min(1).max(6).openapi({\n\t\tdescription: \"Heading level (1-6)\",\n\t\texample: 2,\n\t}),\n\ttext: z.string().min(1).openapi({\n\t\tdescription: \"Heading text content\",\n\t\texample: \"Getting started\",\n\t}),\n});\n\nconst linkSchema = z.url().openapi({\n\tdescription: \"Absolute URL discovered in the document\",\n\texample: \"https://docs.cossistant.com/guide\",\n});\n\nconst imageSchema = z.object({\n\tsrc: z.url().openapi({\n\t\tdescription: \"Image URL captured during scraping\",\n\t\texample: \"https://cdn.cossistant.com/assets/hero.png\",\n\t}),\n\talt: z.string().nullable().openapi({\n\t\tdescription: \"Optional alt text attached to the image\",\n\t\texample: \"Agent dashboard hero illustration\",\n\t}),\n});\n\nexport const urlKnowledgePayloadSchema = z\n\t.object({\n\t\tmarkdown: z.string().min(1).openapi({\n\t\t\tdescription: \"Scraped markdown body\",\n\t\t\texample: \"# Welcome to the Help Center\",\n\t\t}),\n\t\theadings: z.array(headingSchema).default([]),\n\t\tlinks: z.array(linkSchema).default([]),\n\t\timages: z.array(imageSchema).default([]),\n\t\testimatedTokens: z.number().int().nonnegative().optional().openapi({\n\t\t\tdescription: \"Heuristic token count to assist chunking\",\n\t\t\texample: 2048,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Structured payload for raw page content\",\n\t});\n\nexport const faqKnowledgePayloadSchema = z\n\t.object({\n\t\tquestion: z.string().min(1).openapi({\n\t\t\tdescription: \"FAQ question\",\n\t\t\texample: \"How do I reset my password?\",\n\t\t}),\n\t\tanswer: z.string().min(1).openapi({\n\t\t\tdescription: \"Answer shown to customers\",\n\t\t\texample: \"Go to Settings → Security and click Reset password.\",\n\t\t}),\n\t\tcategories: z.array(z.string()).default([]),\n\t\trelatedQuestions: z.array(z.string()).default([]),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload describing a single FAQ entry\",\n\t});\n\nexport const articleKnowledgePayloadSchema = z\n\t.object({\n\t\ttitle: z.string().min(1).openapi({\n\t\t\tdescription: \"Article title\",\n\t\t\texample: \"Billing and invoicing overview\",\n\t\t}),\n\t\tsummary: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Short synopsis or excerpt\",\n\t\t\texample: \"Understand how billing cycles and invoices are generated.\",\n\t\t}),\n\t\tmarkdown: z.string().min(1).openapi({\n\t\t\tdescription: \"Article body in markdown format\",\n\t\t\texample: \"## Billing cycles\\n\\nCossistant bills you monthly...\",\n\t\t}),\n\t\tkeywords: z.array(z.string()).default([]),\n\t\theroImage: imageSchema.optional(),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload describing a full article or help doc\",\n\t});\n\nconst metadataSchema = z\n\t.record(z.string(), z.unknown())\n\t.optional()\n\t.openapi({\n\t\tdescription: \"Arbitrary metadata such as locale or crawl depth\",\n\t\texample: {\n\t\t\tlocale: \"en-US\",\n\t\t\tsource: \"firecrawl\",\n\t\t},\n\t});\n\nconst baseKnowledgeFields = {\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"Owning organization identifier\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\twebsiteId: z.ulid().openapi({\n\t\tdescription: \"Website identifier\",\n\t\texample: \"01JG000000000000000000001\",\n\t}),\n\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\tdescription:\n\t\t\t\"Optional AI agent identifier; null/omitted means the entry is shared at the website scope.\",\n\t\texample: \"01JG000000000000000000002\",\n\t}),\n\tsourceUrl: z.url().nullable().openapi({\n\t\tdescription:\n\t\t\t\"Origin URL for this entry (required for url knowledge; optional for others)\",\n\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t}),\n\tsourceTitle: z.string().nullable().openapi({\n\t\tdescription: \"Readable title captured during scraping\",\n\t\texample: \"Getting started with the Cossistant dashboard\",\n\t}),\n\torigin: z.string().min(1).openapi({\n\t\tdescription:\n\t\t\t\"Describes how this entry was created (crawl, manual, agent, etc.)\",\n\t\texample: \"crawl\",\n\t}),\n\tcreatedBy: z.string().min(1).openapi({\n\t\tdescription:\n\t\t\t\"Identifier of the actor (user, agent, system) that created this entry\",\n\t\texample: \"user_01JG00000000000000000000\",\n\t}),\n\tcontentHash: z.string().min(1).openapi({\n\t\tdescription: \"Deterministic hash of the payload for deduping\",\n\t\texample: \"5d41402abc4b2a76b9719d911017c592\",\n\t}),\n\tmetadata: metadataSchema,\n};\n\nconst urlKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"url\"),\n\t\tsourceUrl: z.url(),\n\t\tpayload: urlKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"URL knowledge entry\" });\n\nconst faqKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"faq\"),\n\t\tpayload: faqKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"FAQ knowledge entry\" });\n\nconst articleKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"article\"),\n\t\tsourceUrl: z.url().nullable(),\n\t\tpayload: articleKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"Article knowledge entry\" });\n\nexport const knowledgeCreateSchema = z.discriminatedUnion(\"type\", [\n\turlKnowledgeSchema,\n\tfaqKnowledgeSchema,\n\tarticleKnowledgeSchema,\n]);\n\nconst knowledgeAuditFieldsSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"Knowledge entry identifier\",\n\t\texample: \"01JG00000000000000000000A\",\n\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"Creation timestamp\",\n\t\texample: \"2024-06-10T12:00:00.000Z\",\n\t}),\n\tupdatedAt: z.string().openapi({\n\t\tdescription: \"Last update timestamp\",\n\t\texample: \"2024-06-11T08:00:00.000Z\",\n\t}),\n\tdeletedAt: z.string().nullable().openapi({\n\t\tdescription: \"Soft delete timestamp\",\n\t\texample: null,\n\t}),\n});\n\nexport const knowledgeSchema = knowledgeCreateSchema\n\t// Intersection preserves the discriminated union while adding persisted fields.\n\t.and(knowledgeAuditFieldsSchema)\n\t.openapi({\n\t\tdescription: \"Persisted knowledge entry\",\n\t});\n\nexport type KnowledgeType = z.infer<typeof knowledgeTypeSchema>;\nexport type UrlKnowledgePayload = z.infer<typeof urlKnowledgePayloadSchema>;\nexport type FaqKnowledgePayload = z.infer<typeof faqKnowledgePayloadSchema>;\nexport type ArticleKnowledgePayload = z.infer<\n\ttypeof articleKnowledgePayloadSchema\n>;\nexport type KnowledgeCreateInput = z.infer<typeof knowledgeCreateSchema>;\nexport type Knowledge = z.infer<typeof knowledgeSchema>;\n\n// ============================================================================\n// API Request/Response Schemas\n// ============================================================================\n\n/**\n * Knowledge response schema - used for single item responses\n */\nexport const knowledgeResponseSchema = z\n\t.object({\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry identifier\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"Owning organization identifier\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"Website identifier\",\n\t\t\texample: \"01JG000000000000000000001\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent identifier; null means shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tlinkSourceId: z.ulid().nullable().openapi({\n\t\t\tdescription: \"Reference to the link source that created this entry\",\n\t\t\texample: \"01JG000000000000000000003\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().openapi({\n\t\t\tdescription: \"Readable title captured during scraping\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"crawl\",\n\t\t}),\n\t\tcreatedBy: z.string().openapi({\n\t\t\tdescription: \"Identifier of the actor that created this entry\",\n\t\t\texample: \"user_01JG00000000000000000000\",\n\t\t}),\n\t\tcontentHash: z.string().openapi({\n\t\t\tdescription: \"Deterministic hash of the payload for deduping\",\n\t\t\texample: \"5d41402abc4b2a76b9719d911017c592\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t\tisIncluded: z.boolean().openapi({\n\t\t\tdescription: \"Whether this entry is included in training\",\n\t\t\texample: true,\n\t\t}),\n\t\tsizeBytes: z.number().int().nonnegative().openapi({\n\t\t\tdescription: \"Size of this entry in bytes\",\n\t\t\texample: 4096,\n\t\t}),\n\t\tcreatedAt: z.string().openapi({\n\t\t\tdescription: \"Creation timestamp\",\n\t\t\texample: \"2024-06-10T12:00:00.000Z\",\n\t\t}),\n\t\tupdatedAt: z.string().openapi({\n\t\t\tdescription: \"Last update timestamp\",\n\t\t\texample: \"2024-06-11T08:00:00.000Z\",\n\t\t}),\n\t\tdeletedAt: z.string().nullable().openapi({\n\t\t\tdescription: \"Soft delete timestamp\",\n\t\t\texample: null,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Knowledge entry response\",\n\t});\n\nexport type KnowledgeResponse = z.infer<typeof knowledgeResponseSchema>;\n\n/**\n * List knowledge request schema (TRPC) - with websiteSlug\n */\nexport const listKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to list knowledge for\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema.optional().openapi({\n\t\t\tdescription: \"Filter by knowledge type\",\n\t\t\texample: \"url\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Filter by AI agent ID; null for shared entries; omit for all\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tpage: z.coerce.number().int().positive().default(1).openapi({\n\t\t\tdescription: \"Page number (1-indexed)\",\n\t\t\texample: 1,\n\t\t}),\n\t\tlimit: z.coerce.number().int().positive().max(100).default(20).openapi({\n\t\t\tdescription: \"Items per page (max 100)\",\n\t\t\texample: 20,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to list knowledge entries with filters and pagination\",\n\t});\n\nexport type ListKnowledgeRequest = z.infer<typeof listKnowledgeRequestSchema>;\n\n/**\n * List knowledge request schema (REST) - without websiteSlug (derived from API key)\n */\nexport const listKnowledgeRestRequestSchema = z\n\t.object({\n\t\ttype: knowledgeTypeSchema.optional().openapi({\n\t\t\tdescription: \"Filter by knowledge type\",\n\t\t\texample: \"url\",\n\t\t}),\n\t\taiAgentId: z\n\t\t\t.union([z.ulid(), z.literal(\"null\"), z.literal(\"\")])\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t'Filter by AI agent ID. Pass a valid ULID to filter by agent, pass \"null\" or empty string to filter for shared/website-scoped entries only, or omit entirely to return all entries.',\n\t\t\t\texample: \"01JG000000000000000000002\",\n\t\t\t}),\n\t\tpage: z.coerce.number().int().positive().default(1).openapi({\n\t\t\tdescription: \"Page number (1-indexed)\",\n\t\t\texample: 1,\n\t\t}),\n\t\tlimit: z.coerce.number().int().positive().max(100).default(20).openapi({\n\t\t\tdescription: \"Items per page (max 100)\",\n\t\t\texample: 20,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to list knowledge entries with filters and pagination (REST)\",\n\t});\n\nexport type ListKnowledgeRestRequest = z.infer<\n\ttypeof listKnowledgeRestRequestSchema\n>;\n\n/**\n * List knowledge response schema\n */\nexport const listKnowledgeResponseSchema = z\n\t.object({\n\t\titems: z.array(knowledgeResponseSchema).openapi({\n\t\t\tdescription: \"Array of knowledge entries\",\n\t\t}),\n\t\tpagination: z\n\t\t\t.object({\n\t\t\t\tpage: z.number().int().positive().openapi({\n\t\t\t\t\tdescription: \"Current page number\",\n\t\t\t\t\texample: 1,\n\t\t\t\t}),\n\t\t\t\tlimit: z.number().int().positive().openapi({\n\t\t\t\t\tdescription: \"Items per page\",\n\t\t\t\t\texample: 20,\n\t\t\t\t}),\n\t\t\t\ttotal: z.number().int().nonnegative().openapi({\n\t\t\t\t\tdescription: \"Total number of items\",\n\t\t\t\t\texample: 100,\n\t\t\t\t}),\n\t\t\t\thasMore: z.boolean().openapi({\n\t\t\t\t\tdescription: \"Whether there are more items available\",\n\t\t\t\t\texample: true,\n\t\t\t\t}),\n\t\t\t})\n\t\t\t.openapi({\n\t\t\t\tdescription: \"Pagination metadata\",\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Paginated list of knowledge entries\",\n\t});\n\nexport type ListKnowledgeResponse = z.infer<typeof listKnowledgeResponseSchema>;\n\n/**\n * Get knowledge request schema (TRPC)\n */\nexport const getKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to get a single knowledge entry\",\n\t});\n\nexport type GetKnowledgeRequest = z.infer<typeof getKnowledgeRequestSchema>;\n\n/**\n * Create knowledge request schema (TRPC) - extends create input with websiteSlug\n */\nexport const createKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to create knowledge for\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().min(1).openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"manual\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to create a new knowledge entry\",\n\t});\n\nexport type CreateKnowledgeRequest = z.infer<\n\ttypeof createKnowledgeRequestSchema\n>;\n\n/**\n * Create knowledge request schema (REST) - without websiteSlug\n */\nexport const createKnowledgeRestRequestSchema = z\n\t.object({\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().min(1).openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"manual\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to create a new knowledge entry (REST)\",\n\t});\n\nexport type CreateKnowledgeRestRequest = z.infer<\n\ttypeof createKnowledgeRestRequestSchema\n>;\n\n/**\n * Update knowledge request schema (TRPC)\n */\nexport const updateKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID to update\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription: \"Update AI agent association\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Update origin URL\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Update readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\tpayload: z\n\t\t\t.union([\n\t\t\t\turlKnowledgePayloadSchema,\n\t\t\t\tfaqKnowledgePayloadSchema,\n\t\t\t\tarticleKnowledgePayloadSchema,\n\t\t\t])\n\t\t\t.optional(),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to update an existing knowledge entry\",\n\t});\n\nexport type UpdateKnowledgeRequest = z.infer<\n\ttypeof updateKnowledgeRequestSchema\n>;\n\n/**\n * Update knowledge request schema (REST) - without websiteSlug\n */\nexport const updateKnowledgeRestRequestSchema = z\n\t.object({\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription: \"Update AI agent association\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Update origin URL\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Update readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\tpayload: z\n\t\t\t.union([\n\t\t\t\turlKnowledgePayloadSchema,\n\t\t\t\tfaqKnowledgePayloadSchema,\n\t\t\t\tarticleKnowledgePayloadSchema,\n\t\t\t])\n\t\t\t.optional(),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to update an existing knowledge entry (REST)\",\n\t});\n\nexport type UpdateKnowledgeRestRequest = z.infer<\n\ttypeof updateKnowledgeRestRequestSchema\n>;\n\n/**\n * Delete knowledge request schema (TRPC)\n */\nexport const deleteKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID to delete\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to delete a knowledge entry\",\n\t});\n"],"mappings":";;;AAEA,MAAa,sBAAsB,EAAE,KAAK;CAAC;CAAO;CAAO;CAAU,CAAC,CAAC,QAAQ;CAC5E,aAAa;CACb,SAAS;CACT,CAAC;AAEF,MAAM,gBAAgB,EAAE,OAAO;CAC9B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ;EAC7C,aAAa;EACb,SAAS;EACT,CAAC;CACF,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC;AAEF,MAAM,aAAa,EAAE,KAAK,CAAC,QAAQ;CAClC,aAAa;CACb,SAAS;CACT,CAAC;AAEF,MAAM,cAAc,EAAE,OAAO;CAC5B,KAAK,EAAE,KA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Z,UAAU;CACV,CAAC,CACD,QAAQ,EACR,aAAa,wDACb,CAAC;;;;AASH,MAAa,+BAA+B,EAC1C,OAAO;CACP,aAAa,EAAE,QAAQ,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,IAAI,EAAE,MAAM,CAAC,QAAQ;EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,uCACb,CAAC"}
1
+ {"version":3,"file":"knowledge.js","names":[],"sources":["../../src/api/knowledge.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\n\nexport const knowledgeTypeSchema = z.enum([\"url\", \"faq\", \"article\"]).openapi({\n\tdescription: \"Knowledge entry type\",\n\texample: \"url\",\n});\n\nconst headingSchema = z.object({\n\tlevel: z.number().int().min(1).max(6).openapi({\n\t\tdescription: \"Heading level (1-6)\",\n\t\texample: 2,\n\t}),\n\ttext: z.string().min(1).openapi({\n\t\tdescription: \"Heading text content\",\n\t\texample: \"Getting started\",\n\t}),\n});\n\nconst linkSchema = z.url().openapi({\n\tdescription: \"Absolute URL discovered in the document\",\n\texample: \"https://docs.cossistant.com/guide\",\n});\n\nconst imageSchema = z.object({\n\tsrc: z.url().openapi({\n\t\tdescription: \"Image URL captured during scraping\",\n\t\texample: \"https://cdn.cossistant.com/assets/hero.png\",\n\t}),\n\talt: z.string().nullable().openapi({\n\t\tdescription: \"Optional alt text attached to the image\",\n\t\texample: \"Agent dashboard hero illustration\",\n\t}),\n});\n\nexport const urlKnowledgePayloadSchema = z\n\t.object({\n\t\tmarkdown: z.string().min(1).openapi({\n\t\t\tdescription: \"Scraped markdown body\",\n\t\t\texample: \"# Welcome to the Help Center\",\n\t\t}),\n\t\theadings: z.array(headingSchema).default([]),\n\t\tlinks: z.array(linkSchema).default([]),\n\t\timages: z.array(imageSchema).default([]),\n\t\testimatedTokens: z.number().int().nonnegative().optional().openapi({\n\t\t\tdescription: \"Heuristic token count to assist chunking\",\n\t\t\texample: 2048,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Structured payload for raw page content\",\n\t});\n\nexport const faqKnowledgePayloadSchema = z\n\t.object({\n\t\tquestion: z.string().min(1).openapi({\n\t\t\tdescription: \"FAQ question\",\n\t\t\texample: \"How do I reset my password?\",\n\t\t}),\n\t\tanswer: z.string().min(1).openapi({\n\t\t\tdescription: \"Answer shown to customers\",\n\t\t\texample: \"Go to Settings → Security and click Reset password.\",\n\t\t}),\n\t\tcategories: z.array(z.string()).default([]),\n\t\trelatedQuestions: z.array(z.string()).default([]),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload describing a single FAQ entry\",\n\t});\n\nexport const articleKnowledgePayloadSchema = z\n\t.object({\n\t\ttitle: z.string().min(1).openapi({\n\t\t\tdescription: \"Article title\",\n\t\t\texample: \"Billing and invoicing overview\",\n\t\t}),\n\t\tsummary: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Short synopsis or excerpt\",\n\t\t\texample: \"Understand how billing cycles and invoices are generated.\",\n\t\t}),\n\t\tmarkdown: z.string().min(1).openapi({\n\t\t\tdescription: \"Article body in markdown format\",\n\t\t\texample: \"## Billing cycles\\n\\nCossistant bills you monthly...\",\n\t\t}),\n\t\tkeywords: z.array(z.string()).default([]),\n\t\theroImage: imageSchema.optional(),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload describing a full article or help doc\",\n\t});\n\nconst metadataSchema = z\n\t.record(z.string(), z.unknown())\n\t.nullish()\n\t.openapi({\n\t\tdescription: \"Arbitrary metadata such as locale or crawl depth\",\n\t\texample: {\n\t\t\tlocale: \"en-US\",\n\t\t\tsource: \"firecrawl\",\n\t\t},\n\t});\n\nconst baseKnowledgeFields = {\n\torganizationId: z.ulid().openapi({\n\t\tdescription: \"Owning organization identifier\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\twebsiteId: z.ulid().openapi({\n\t\tdescription: \"Website identifier\",\n\t\texample: \"01JG000000000000000000001\",\n\t}),\n\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\tdescription:\n\t\t\t\"Optional AI agent identifier; null/omitted means the entry is shared at the website scope.\",\n\t\texample: \"01JG000000000000000000002\",\n\t}),\n\tsourceUrl: z.url().nullable().openapi({\n\t\tdescription:\n\t\t\t\"Origin URL for this entry (required for url knowledge; optional for others)\",\n\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t}),\n\tsourceTitle: z.string().nullable().openapi({\n\t\tdescription: \"Readable title captured during scraping\",\n\t\texample: \"Getting started with the Cossistant dashboard\",\n\t}),\n\torigin: z.string().min(1).openapi({\n\t\tdescription:\n\t\t\t\"Describes how this entry was created (crawl, manual, agent, etc.)\",\n\t\texample: \"crawl\",\n\t}),\n\tcreatedBy: z.string().min(1).openapi({\n\t\tdescription:\n\t\t\t\"Identifier of the actor (user, agent, system) that created this entry\",\n\t\texample: \"user_01JG00000000000000000000\",\n\t}),\n\tcontentHash: z.string().min(1).openapi({\n\t\tdescription: \"Deterministic hash of the payload for deduping\",\n\t\texample: \"5d41402abc4b2a76b9719d911017c592\",\n\t}),\n\tmetadata: metadataSchema,\n};\n\nconst urlKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"url\"),\n\t\tsourceUrl: z.url(),\n\t\tpayload: urlKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"URL knowledge entry\" });\n\nconst faqKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"faq\"),\n\t\tpayload: faqKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"FAQ knowledge entry\" });\n\nconst articleKnowledgeSchema = z\n\t.object(baseKnowledgeFields)\n\t.extend({\n\t\ttype: z.literal(\"article\"),\n\t\tsourceUrl: z.url().nullable(),\n\t\tpayload: articleKnowledgePayloadSchema,\n\t})\n\t.openapi({ description: \"Article knowledge entry\" });\n\nexport const knowledgeCreateSchema = z.discriminatedUnion(\"type\", [\n\turlKnowledgeSchema,\n\tfaqKnowledgeSchema,\n\tarticleKnowledgeSchema,\n]);\n\nconst knowledgeAuditFieldsSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"Knowledge entry identifier\",\n\t\texample: \"01JG00000000000000000000A\",\n\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"Creation timestamp\",\n\t\texample: \"2024-06-10T12:00:00.000Z\",\n\t}),\n\tupdatedAt: z.string().openapi({\n\t\tdescription: \"Last update timestamp\",\n\t\texample: \"2024-06-11T08:00:00.000Z\",\n\t}),\n\tdeletedAt: z.string().nullable().openapi({\n\t\tdescription: \"Soft delete timestamp\",\n\t\texample: null,\n\t}),\n});\n\nexport const knowledgeSchema = knowledgeCreateSchema\n\t// Intersection preserves the discriminated union while adding persisted fields.\n\t.and(knowledgeAuditFieldsSchema)\n\t.openapi({\n\t\tdescription: \"Persisted knowledge entry\",\n\t});\n\nexport type KnowledgeType = z.infer<typeof knowledgeTypeSchema>;\nexport type UrlKnowledgePayload = z.infer<typeof urlKnowledgePayloadSchema>;\nexport type FaqKnowledgePayload = z.infer<typeof faqKnowledgePayloadSchema>;\nexport type ArticleKnowledgePayload = z.infer<\n\ttypeof articleKnowledgePayloadSchema\n>;\nexport type KnowledgeCreateInput = z.infer<typeof knowledgeCreateSchema>;\nexport type Knowledge = z.infer<typeof knowledgeSchema>;\n\n// ============================================================================\n// API Request/Response Schemas\n// ============================================================================\n\n/**\n * Knowledge response schema - used for single item responses\n */\nexport const knowledgeResponseSchema = z\n\t.object({\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry identifier\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\torganizationId: z.ulid().openapi({\n\t\t\tdescription: \"Owning organization identifier\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\twebsiteId: z.ulid().openapi({\n\t\t\tdescription: \"Website identifier\",\n\t\t\texample: \"01JG000000000000000000001\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent identifier; null means shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tlinkSourceId: z.ulid().nullable().openapi({\n\t\t\tdescription: \"Reference to the link source that created this entry\",\n\t\t\texample: \"01JG000000000000000000003\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().openapi({\n\t\t\tdescription: \"Readable title captured during scraping\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"crawl\",\n\t\t}),\n\t\tcreatedBy: z.string().openapi({\n\t\t\tdescription: \"Identifier of the actor that created this entry\",\n\t\t\texample: \"user_01JG00000000000000000000\",\n\t\t}),\n\t\tcontentHash: z.string().openapi({\n\t\t\tdescription: \"Deterministic hash of the payload for deduping\",\n\t\t\texample: \"5d41402abc4b2a76b9719d911017c592\",\n\t\t}),\n\t\t// Note: We use .passthrough() to prevent Zod's union validation from stripping\n\t\t// fields when the first matching schema doesn't include all fields from other schemas.\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema.passthrough(),\n\t\t\tfaqKnowledgePayloadSchema.passthrough(),\n\t\t\tarticleKnowledgePayloadSchema.passthrough(),\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t\tisIncluded: z.boolean().openapi({\n\t\t\tdescription: \"Whether this entry is included in training\",\n\t\t\texample: true,\n\t\t}),\n\t\tsizeBytes: z.number().int().nonnegative().openapi({\n\t\t\tdescription: \"Size of this entry in bytes\",\n\t\t\texample: 4096,\n\t\t}),\n\t\tcreatedAt: z.string().openapi({\n\t\t\tdescription: \"Creation timestamp\",\n\t\t\texample: \"2024-06-10T12:00:00.000Z\",\n\t\t}),\n\t\tupdatedAt: z.string().openapi({\n\t\t\tdescription: \"Last update timestamp\",\n\t\t\texample: \"2024-06-11T08:00:00.000Z\",\n\t\t}),\n\t\tdeletedAt: z.string().nullable().openapi({\n\t\t\tdescription: \"Soft delete timestamp\",\n\t\t\texample: null,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Knowledge entry response\",\n\t});\n\nexport type KnowledgeResponse = z.infer<typeof knowledgeResponseSchema>;\n\n/**\n * List knowledge request schema (TRPC) - with websiteSlug\n */\nexport const listKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to list knowledge for\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema.optional().openapi({\n\t\t\tdescription: \"Filter by knowledge type\",\n\t\t\texample: \"url\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Filter by AI agent ID; null for shared entries; omit for all\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tpage: z.coerce.number().int().positive().default(1).openapi({\n\t\t\tdescription: \"Page number (1-indexed)\",\n\t\t\texample: 1,\n\t\t}),\n\t\tlimit: z.coerce.number().int().positive().max(100).default(20).openapi({\n\t\t\tdescription: \"Items per page (max 100)\",\n\t\t\texample: 20,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to list knowledge entries with filters and pagination\",\n\t});\n\nexport type ListKnowledgeRequest = z.infer<typeof listKnowledgeRequestSchema>;\n\n/**\n * List knowledge request schema (REST) - without websiteSlug (derived from API key)\n */\nexport const listKnowledgeRestRequestSchema = z\n\t.object({\n\t\ttype: knowledgeTypeSchema.optional().openapi({\n\t\t\tdescription: \"Filter by knowledge type\",\n\t\t\texample: \"url\",\n\t\t}),\n\t\taiAgentId: z\n\t\t\t.union([z.ulid(), z.literal(\"null\"), z.literal(\"\")])\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t'Filter by AI agent ID. Pass a valid ULID to filter by agent, pass \"null\" or empty string to filter for shared/website-scoped entries only, or omit entirely to return all entries.',\n\t\t\t\texample: \"01JG000000000000000000002\",\n\t\t\t}),\n\t\tpage: z.coerce.number().int().positive().default(1).openapi({\n\t\t\tdescription: \"Page number (1-indexed)\",\n\t\t\texample: 1,\n\t\t}),\n\t\tlimit: z.coerce.number().int().positive().max(100).default(20).openapi({\n\t\t\tdescription: \"Items per page (max 100)\",\n\t\t\texample: 20,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to list knowledge entries with filters and pagination (REST)\",\n\t});\n\nexport type ListKnowledgeRestRequest = z.infer<\n\ttypeof listKnowledgeRestRequestSchema\n>;\n\n/**\n * List knowledge response schema\n */\nexport const listKnowledgeResponseSchema = z\n\t.object({\n\t\titems: z.array(knowledgeResponseSchema).openapi({\n\t\t\tdescription: \"Array of knowledge entries\",\n\t\t}),\n\t\tpagination: z\n\t\t\t.object({\n\t\t\t\tpage: z.number().int().positive().openapi({\n\t\t\t\t\tdescription: \"Current page number\",\n\t\t\t\t\texample: 1,\n\t\t\t\t}),\n\t\t\t\tlimit: z.number().int().positive().openapi({\n\t\t\t\t\tdescription: \"Items per page\",\n\t\t\t\t\texample: 20,\n\t\t\t\t}),\n\t\t\t\ttotal: z.number().int().nonnegative().openapi({\n\t\t\t\t\tdescription: \"Total number of items\",\n\t\t\t\t\texample: 100,\n\t\t\t\t}),\n\t\t\t\thasMore: z.boolean().openapi({\n\t\t\t\t\tdescription: \"Whether there are more items available\",\n\t\t\t\t\texample: true,\n\t\t\t\t}),\n\t\t\t})\n\t\t\t.openapi({\n\t\t\t\tdescription: \"Pagination metadata\",\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Paginated list of knowledge entries\",\n\t});\n\nexport type ListKnowledgeResponse = z.infer<typeof listKnowledgeResponseSchema>;\n\n/**\n * Get knowledge request schema (TRPC)\n */\nexport const getKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to get a single knowledge entry\",\n\t});\n\nexport type GetKnowledgeRequest = z.infer<typeof getKnowledgeRequestSchema>;\n\n/**\n * Create knowledge request schema (TRPC) - extends create input with websiteSlug\n */\nexport const createKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to create knowledge for\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().min(1).openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"manual\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to create a new knowledge entry\",\n\t});\n\nexport type CreateKnowledgeRequest = z.infer<\n\ttypeof createKnowledgeRequestSchema\n>;\n\n/**\n * Create knowledge request schema (REST) - without websiteSlug\n */\nexport const createKnowledgeRestRequestSchema = z\n\t.object({\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\ttype: knowledgeTypeSchema,\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Origin URL for this entry\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\torigin: z.string().min(1).openapi({\n\t\t\tdescription: \"How this entry was created (crawl, manual, agent, etc.)\",\n\t\t\texample: \"manual\",\n\t\t}),\n\t\tpayload: z.union([\n\t\t\turlKnowledgePayloadSchema,\n\t\t\tfaqKnowledgePayloadSchema,\n\t\t\tarticleKnowledgePayloadSchema,\n\t\t]),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to create a new knowledge entry (REST)\",\n\t});\n\nexport type CreateKnowledgeRestRequest = z.infer<\n\ttypeof createKnowledgeRestRequestSchema\n>;\n\n/**\n * Update knowledge request schema (TRPC)\n *\n * Note: We use .passthrough() on payload schemas to prevent Zod's union validation\n * from stripping fields when the first matching schema (urlKnowledgePayloadSchema)\n * doesn't include all fields from other schemas (like articleKnowledgePayloadSchema's title).\n */\nexport const updateKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID to update\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription: \"Update AI agent association\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Update origin URL\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Update readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\tpayload: z\n\t\t\t.union([\n\t\t\t\turlKnowledgePayloadSchema.passthrough(),\n\t\t\t\tfaqKnowledgePayloadSchema.passthrough(),\n\t\t\t\tarticleKnowledgePayloadSchema.passthrough(),\n\t\t\t])\n\t\t\t.optional(),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to update an existing knowledge entry\",\n\t});\n\nexport type UpdateKnowledgeRequest = z.infer<\n\ttypeof updateKnowledgeRequestSchema\n>;\n\n/**\n * Update knowledge request schema (REST) - without websiteSlug\n *\n * Note: We use .passthrough() on payload schemas to prevent Zod's union validation\n * from stripping fields. See updateKnowledgeRequestSchema for details.\n */\nexport const updateKnowledgeRestRequestSchema = z\n\t.object({\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription: \"Update AI agent association\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tsourceUrl: z.url().nullable().optional().openapi({\n\t\t\tdescription: \"Update origin URL\",\n\t\t\texample: \"https://docs.cossistant.com/getting-started\",\n\t\t}),\n\t\tsourceTitle: z.string().nullable().optional().openapi({\n\t\t\tdescription: \"Update readable title\",\n\t\t\texample: \"Getting started with the Cossistant dashboard\",\n\t\t}),\n\t\tpayload: z\n\t\t\t.union([\n\t\t\t\turlKnowledgePayloadSchema.passthrough(),\n\t\t\t\tfaqKnowledgePayloadSchema.passthrough(),\n\t\t\t\tarticleKnowledgePayloadSchema.passthrough(),\n\t\t\t])\n\t\t\t.optional(),\n\t\tmetadata: metadataSchema,\n\t})\n\t.openapi({\n\t\tdescription: \"Request to update an existing knowledge entry (REST)\",\n\t});\n\nexport type UpdateKnowledgeRestRequest = z.infer<\n\ttypeof updateKnowledgeRestRequestSchema\n>;\n\n/**\n * Delete knowledge request schema (TRPC)\n */\nexport const deleteKnowledgeRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID to delete\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to delete a knowledge entry\",\n\t});\n\nexport type DeleteKnowledgeRequest = z.infer<\n\ttypeof deleteKnowledgeRequestSchema\n>;\n\n/**\n * Toggle knowledge entry included request schema (TRPC)\n * Named differently from link-source's toggleKnowledgeIncludedRequestSchema to avoid export conflict\n */\nexport const toggleKnowledgeEntryIncludedRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tid: z.ulid().openapi({\n\t\t\tdescription: \"Knowledge entry ID\",\n\t\t\texample: \"01JG00000000000000000000A\",\n\t\t}),\n\t\tisIncluded: z.boolean().openapi({\n\t\t\tdescription: \"Whether this entry should be included in training\",\n\t\t\texample: true,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to toggle knowledge entry inclusion in training\",\n\t});\n\nexport type ToggleKnowledgeEntryIncludedRequest = z.infer<\n\ttypeof toggleKnowledgeEntryIncludedRequestSchema\n>;\n\n/**\n * Upload knowledge file request schema (TRPC)\n */\nexport const uploadKnowledgeFileRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Optional AI agent ID; null/omit for shared at website scope\",\n\t\t\texample: \"01JG000000000000000000002\",\n\t\t}),\n\t\tfileName: z.string().min(1).openapi({\n\t\t\tdescription: \"Original file name\",\n\t\t\texample: \"getting-started.md\",\n\t\t}),\n\t\tfileContent: z.string().min(1).openapi({\n\t\t\tdescription: \"Raw file content\",\n\t\t\texample: \"# Getting Started\\n\\nWelcome to our documentation...\",\n\t\t}),\n\t\tfileExtension: z.enum([\"md\", \"txt\"]).openapi({\n\t\t\tdescription: \"File extension\",\n\t\t\texample: \"md\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to upload a file as a knowledge entry\",\n\t});\n\nexport type UploadKnowledgeFileRequest = z.infer<\n\ttypeof uploadKnowledgeFileRequestSchema\n>;\n"],"mappings":";;;AAEA,MAAa,sBAAsB,EAAE,KAAK;CAAC;CAAO;CAAO;CAAU,CAAC,CAAC,QAAQ;CAC5E,aAAa;CACb,SAAS;CACT,CAAC;AAEF,MAAM,gBAAgB,EAAE,OAAO;CAC9B,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ;EAC7C,aAAa;EACb,SAAS;EACT,CAAC;CACF,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC;AAEF,MAAM,aAAa,EAAE,KAAK,CAAC,QAAQ;CAClC,aAAa;CACb,SAAS;CACT,CAAC;AAEF,MAAM,cAAc,EAAE,OAAO;CAC5B,KAAK,EAAE,KAAK,CAAC,QAAQ;EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;EAClC,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC;AAEF,MAAa,4BAA4B,EACvC,OAAO;CACP,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ;EACnC,aAAa;EACb,SAAS;EACT,CAAC;CACF,UAAU,EAAE,MAAM,cAAc,CAAC,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b,SAAS;EACT,CAAC;CACF,IAAI,EAAE,MAAM,CAAC,QAAQ;EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,uCACb,CAAC;;;;;AAUH,MAAa,4CAA4C,EACvD,OAAO;CACP,aAAa,EAAE,QAAQ,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,IAAI,EAAE,MAAM,CAAC,QAAQ;EACpB,aAAa;EACb,SAAS;EACT,CAAC;CACF,YAAY,EAAE,SAAS,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,2DACb,CAAC;;;;AASH,MAAa,mCAAmC,EAC9C,OAAO;CACP,aAAa,EAAE,QAAQ,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ;EACjD,aACC;EACD,SAAS;EACT,CAAC;CACF,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ;EACnC,aAAa;EACb,SAAS;EACT,CAAC;CACF,aAAa,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ;EACtC,aAAa;EACb,SAAS;EACT,CAAC;CACF,eAAe,EAAE,KAAK,CAAC,MAAM,MAAM,CAAC,CAAC,QAAQ;EAC5C,aAAa;EACb,SAAS;EACT,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,iDACb,CAAC"}
@@ -164,6 +164,8 @@ declare const trainingStatsResponseSchema: z.ZodObject<{
164
164
  planLimitLinks: z.ZodNullable<z.ZodNumber>;
165
165
  crawlPagesPerSourceLimit: z.ZodNullable<z.ZodNumber>;
166
166
  totalPagesLimit: z.ZodNullable<z.ZodNumber>;
167
+ planLimitFaqs: z.ZodNullable<z.ZodNumber>;
168
+ planLimitFiles: z.ZodNullable<z.ZodNumber>;
167
169
  }, z.core.$strip>;
168
170
  type TrainingStatsResponse = z.infer<typeof trainingStatsResponseSchema>;
169
171
  /**