@wildo-ai/external-connectors-models 1.1.4 → 1.1.6

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.
Files changed (100) hide show
  1. package/dist/esm/companion-exports.d.ts.map +1 -1
  2. package/dist/esm/core/commons.external-connectors-models.schemas.d.ts +23 -132
  3. package/dist/esm/core/commons.external-connectors-models.schemas.d.ts.map +1 -1
  4. package/dist/esm/core/commons.external-connectors-models.schemas.js +23 -31
  5. package/dist/esm/core/commons.external-connectors-models.schemas.js.map +1 -1
  6. package/dist/esm/core/operation-classification.external-connectors-models.schemas.d.ts.map +1 -1
  7. package/dist/esm/core/operation-classification.external-connectors-models.schemas.js.map +1 -1
  8. package/dist/esm/core/security.external-connectors-models.schemas.d.ts +40 -8
  9. package/dist/esm/core/security.external-connectors-models.schemas.d.ts.map +1 -1
  10. package/dist/esm/core/security.external-connectors-models.schemas.js +61 -14
  11. package/dist/esm/core/security.external-connectors-models.schemas.js.map +1 -1
  12. package/dist/esm/index.d.ts +5 -2
  13. package/dist/esm/index.d.ts.map +1 -1
  14. package/dist/esm/index.js +5 -2
  15. package/dist/esm/index.js.map +1 -1
  16. package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts +78 -163
  17. package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts.map +1 -1
  18. package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js +78 -93
  19. package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js.map +1 -1
  20. package/dist/esm/protocols/billing.standard-interface.schemas.d.ts +258 -13
  21. package/dist/esm/protocols/billing.standard-interface.schemas.d.ts.map +1 -1
  22. package/dist/esm/protocols/billing.standard-interface.schemas.js +41 -0
  23. package/dist/esm/protocols/billing.standard-interface.schemas.js.map +1 -1
  24. package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts +57 -17
  25. package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts.map +1 -1
  26. package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js +26 -7
  27. package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js.map +1 -1
  28. package/dist/esm/protocols/email-inbound.standard-interface.schemas.d.ts +229 -0
  29. package/dist/esm/protocols/email-inbound.standard-interface.schemas.d.ts.map +1 -0
  30. package/dist/esm/protocols/email-inbound.standard-interface.schemas.js +160 -0
  31. package/dist/esm/protocols/email-inbound.standard-interface.schemas.js.map +1 -0
  32. package/dist/esm/protocols/email.external-connectors-models.schemas.d.ts +1 -56
  33. package/dist/esm/protocols/email.external-connectors-models.schemas.d.ts.map +1 -1
  34. package/dist/esm/protocols/email.external-connectors-models.schemas.js +0 -20
  35. package/dist/esm/protocols/email.external-connectors-models.schemas.js.map +1 -1
  36. package/dist/esm/protocols/email.standard-interface.schemas.d.ts +4 -4
  37. package/dist/esm/protocols/email.standard-interface.schemas.d.ts.map +1 -1
  38. package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts +1 -16
  39. package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts.map +1 -1
  40. package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js +4 -9
  41. package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js.map +1 -1
  42. package/dist/esm/protocols/file-storage.standard-interface.d.ts +179 -0
  43. package/dist/esm/protocols/file-storage.standard-interface.d.ts.map +1 -0
  44. package/dist/esm/protocols/file-storage.standard-interface.js +79 -0
  45. package/dist/esm/protocols/file-storage.standard-interface.js.map +1 -0
  46. package/dist/esm/protocols/frontend.external-connectors-models.schemas.d.ts +6 -13
  47. package/dist/esm/protocols/frontend.external-connectors-models.schemas.d.ts.map +1 -1
  48. package/dist/esm/protocols/frontend.external-connectors-models.schemas.js +0 -9
  49. package/dist/esm/protocols/frontend.external-connectors-models.schemas.js.map +1 -1
  50. package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.d.ts.map +1 -1
  51. package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.js.map +1 -1
  52. package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts +20 -16
  53. package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts.map +1 -1
  54. package/dist/esm/protocols/hooks.external-connectors-models.schemas.js +12 -9
  55. package/dist/esm/protocols/hooks.external-connectors-models.schemas.js.map +1 -1
  56. package/dist/esm/protocols/image.external-connectors-models.schemas.d.ts +1 -18
  57. package/dist/esm/protocols/image.external-connectors-models.schemas.d.ts.map +1 -1
  58. package/dist/esm/protocols/image.external-connectors-models.schemas.js +1 -7
  59. package/dist/esm/protocols/image.external-connectors-models.schemas.js.map +1 -1
  60. package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts +100 -40
  61. package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts.map +1 -1
  62. package/dist/esm/protocols/llm.external-connectors-models.schemas.js +164 -41
  63. package/dist/esm/protocols/llm.external-connectors-models.schemas.js.map +1 -1
  64. package/dist/esm/protocols/oauth2-provider-assurance.definitions.d.ts +7 -0
  65. package/dist/esm/protocols/oauth2-provider-assurance.definitions.d.ts.map +1 -0
  66. package/dist/esm/protocols/oauth2-provider-assurance.definitions.js +36 -0
  67. package/dist/esm/protocols/oauth2-provider-assurance.definitions.js.map +1 -0
  68. package/dist/esm/protocols/oauth2-provider-assurance.schemas.d.ts +23 -0
  69. package/dist/esm/protocols/oauth2-provider-assurance.schemas.d.ts.map +1 -0
  70. package/dist/esm/protocols/oauth2-provider-assurance.schemas.js +25 -0
  71. package/dist/esm/protocols/oauth2-provider-assurance.schemas.js.map +1 -0
  72. package/dist/esm/protocols/oauth2.external-connectors-models.schemas.d.ts +0 -148
  73. package/dist/esm/protocols/oauth2.external-connectors-models.schemas.d.ts.map +1 -1
  74. package/dist/esm/protocols/oauth2.external-connectors-models.schemas.js +1 -40
  75. package/dist/esm/protocols/oauth2.external-connectors-models.schemas.js.map +1 -1
  76. package/dist/esm/protocols/provider-oauth2-token-endpoint-hosts.external-connectors-models.d.ts +39 -0
  77. package/dist/esm/protocols/provider-oauth2-token-endpoint-hosts.external-connectors-models.d.ts.map +1 -0
  78. package/dist/esm/protocols/provider-oauth2-token-endpoint-hosts.external-connectors-models.js +66 -0
  79. package/dist/esm/protocols/provider-oauth2-token-endpoint-hosts.external-connectors-models.js.map +1 -0
  80. package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.d.ts +863 -16
  81. package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.d.ts.map +1 -1
  82. package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.js +703 -0
  83. package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.js.map +1 -1
  84. package/dist/esm/protocols/sms.external-connectors-models.schemas.d.ts +0 -39
  85. package/dist/esm/protocols/sms.external-connectors-models.schemas.d.ts.map +1 -1
  86. package/dist/esm/protocols/sms.external-connectors-models.schemas.js +0 -13
  87. package/dist/esm/protocols/sms.external-connectors-models.schemas.js.map +1 -1
  88. package/dist/esm/protocols/sms.standard-interface.schemas.d.ts +1 -1
  89. package/dist/esm/protocols/sms.standard-interface.schemas.d.ts.map +1 -1
  90. package/dist/esm/protocols/sms.standard-interface.schemas.js.map +1 -1
  91. package/dist/tsconfig.build.tsbuildinfo +1 -1
  92. package/package.json +2 -3
  93. package/dist/esm/core/protocols.external-connectors-models.schemas.d.ts +0 -74
  94. package/dist/esm/core/protocols.external-connectors-models.schemas.d.ts.map +0 -1
  95. package/dist/esm/core/protocols.external-connectors-models.schemas.js +0 -1
  96. package/dist/esm/core/protocols.external-connectors-models.schemas.js.map +0 -1
  97. package/dist/esm/protocols/rest-api.external-connectors-models.schemas.d.ts +0 -37
  98. package/dist/esm/protocols/rest-api.external-connectors-models.schemas.d.ts.map +0 -1
  99. package/dist/esm/protocols/rest-api.external-connectors-models.schemas.js +0 -10
  100. package/dist/esm/protocols/rest-api.external-connectors-models.schemas.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"email.external-connectors-models.schemas.js","sourceRoot":"","sources":["../../../../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AAE;IAChC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAElC,aAAa;IACb,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,gBAAgB,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAE7C,sCAAsC;IACtC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CACxD,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { \n ExternalProvider_ExchangeProtocol_Configuration_Base, \n ExternalProvider_ExchangeProtocol_Kind, \n ExternalProvider_ExchangeProtocol_Profile_Base, \n ExternalProvider_ExchangeProtocol_Status_BaseSchema \n} from \"../core/commons.external-connectors-models.schemas\";\nimport { ExternalProvider_OperationContextSchema, ExternalProvider_OperationDefinition_Base } from \"../core/operations.external-connectors-models.schemas\";\n\n//===============================================================\n// Email Provider\n// --------\n// Integration with email service providers for sending transactional\n// and marketing emails. Supports both REST API and SMTP-based providers\n// with differentiated operations for each email type.\n//\n// CONFIGURATION LEVELS:\n// - Profile (Provider-level): Fixed by the provider, cannot be changed.\n// Examples: API endpoints, SMTP server addresses, capabilities, limits.\n// - Configuration (Consumer-level): User-configurable settings.\n// Examples: API keys, sender addresses, tracking preferences, webhooks.\n//===============================================================\n\n// ===============================================================\n// Email Provider Enums\n// ===============================================================\n\n/**\n * The type of email operation - transactional vs marketing have different\n * requirements, compliance rules, and often use separate sending domains/IPs.\n */\nexport enum EmailProvider_EmailType {\n TRANSACTIONAL = \"transactional\", // Password resets, receipts, notifications\n MARKETING = \"marketing\", // Newsletters, promotions, campaigns\n}\n\n/**\n * The delivery method used by the email provider.\n * REST API provides more features, SMTP is simpler but more limited.\n */\nexport enum EmailProvider_DeliveryMethod {\n REST_API = \"rest_api\",\n SMTP = \"smtp\",\n}\n\n/**\n * SMTP encryption/security modes.\n */\nexport enum EmailProvider_SMTP_Security {\n NONE = \"none\", // Plain text (port 25, not recommended)\n STARTTLS = \"starttls\", // Upgrade to TLS (port 587)\n TLS = \"tls\", // Implicit TLS/SSL (port 465)\n}\n\n/**\n * Email delivery status for tracking.\n */\nexport enum EmailProvider_DeliveryStatus {\n QUEUED = \"queued\",\n SENT = \"sent\",\n DELIVERED = \"delivered\",\n OPENED = \"opened\",\n CLICKED = \"clicked\",\n BOUNCED = \"bounced\",\n SOFT_BOUNCED = \"soft_bounced\",\n SPAM_COMPLAINT = \"spam_complaint\",\n UNSUBSCRIBED = \"unsubscribed\",\n DROPPED = \"dropped\",\n DEFERRED = \"deferred\",\n FAILED = \"failed\",\n}\n\n/**\n * Email bounce types.\n */\nexport enum EmailProvider_BounceType {\n HARD = \"hard\", // Permanent failure (address doesn't exist)\n SOFT = \"soft\", // Temporary failure (mailbox full, server down)\n TRANSIENT = \"transient\",\n}\n\n/**\n * Standard email provider operation keys.\n * Each provider implements a subset of these based on capabilities.\n */\nexport enum EmailProvider_OperationKey {\n // Core Transactional Operations\n SEND_EMAIL = \"email.send\",\n SEND_BATCH = \"email.sendBatch\",\n SEND_TEMPLATE = \"email.sendTemplate\",\n \n // Marketing/Campaign Operations\n SEND_CAMPAIGN = \"email.campaign.send\",\n CREATE_CAMPAIGN = \"email.campaign.create\",\n SCHEDULE_CAMPAIGN = \"email.campaign.schedule\",\n GET_CAMPAIGN = \"email.campaign.get\",\n \n // List Management (Marketing)\n LIST_CREATE = \"email.list.create\",\n LIST_ADD_CONTACT = \"email.list.addContact\",\n LIST_REMOVE_CONTACT = \"email.list.removeContact\",\n LIST_GET = \"email.list.get\",\n \n // Template Operations\n TEMPLATE_CREATE = \"email.template.create\",\n TEMPLATE_GET = \"email.template.get\",\n TEMPLATE_LIST = \"email.template.list\",\n TEMPLATE_DELETE = \"email.template.delete\",\n \n // Status & Analytics\n GET_MESSAGE_STATUS = \"email.message.getStatus\",\n GET_ANALYTICS = \"email.analytics.get\",\n \n // Suppression/Bounces\n GET_SUPPRESSIONS = \"email.suppressions.get\",\n ADD_SUPPRESSION = \"email.suppressions.add\",\n DELETE_SUPPRESSION = \"email.suppressions.delete\",\n \n // Domain Verification\n DOMAIN_VERIFY = \"email.domain.verify\",\n DOMAIN_GET_STATUS = \"email.domain.getStatus\",\n}\n\n/**\n * Email provider capabilities - what features the provider supports.\n * Used to determine which operations are available.\n */\nexport enum EmailProvider_Capability {\n // Delivery Methods\n SUPPORTS_REST_API = \"supports_rest_api\",\n SUPPORTS_SMTP = \"supports_smtp\",\n \n // Email Types\n SUPPORTS_TRANSACTIONAL = \"supports_transactional\",\n SUPPORTS_MARKETING = \"supports_marketing\",\n \n // Core Features\n SUPPORTS_TEMPLATES = \"supports_templates\",\n SUPPORTS_BATCH_SENDING = \"supports_batch_sending\",\n SUPPORTS_SCHEDULING = \"supports_scheduling\",\n SUPPORTS_ATTACHMENTS = \"supports_attachments\",\n SUPPORTS_INLINE_IMAGES = \"supports_inline_images\",\n \n // Tracking\n SUPPORTS_OPEN_TRACKING = \"supports_open_tracking\",\n SUPPORTS_CLICK_TRACKING = \"supports_click_tracking\",\n SUPPORTS_WEBHOOKS = \"supports_webhooks\",\n \n // Marketing Specific\n SUPPORTS_CAMPAIGNS = \"supports_campaigns\",\n SUPPORTS_LIST_MANAGEMENT = \"supports_list_management\",\n SUPPORTS_SEGMENTATION = \"supports_segmentation\",\n SUPPORTS_AB_TESTING = \"supports_ab_testing\",\n \n // Compliance & Deliverability\n SUPPORTS_SUPPRESSION_LISTS = \"supports_suppression_lists\",\n SUPPORTS_DEDICATED_IP = \"supports_dedicated_ip\",\n SUPPORTS_CUSTOM_DOMAIN = \"supports_custom_domain\",\n SUPPORTS_EMAIL_VALIDATION = \"supports_email_validation\",\n}\n\n// ===============================================================\n// SMTP Server Profile (Provider-level, fixed)\n// ===============================================================\n\nexport const EmailProvider_SMTP_ServerProfileSchema = z.object({\n host: z.string().min(1),\n port: z.number().int().min(1).max(65535),\n security: z.enum(EmailProvider_SMTP_Security),\n // Note: username/password are consumer-level (in Configuration)\n});\nexport type EmailProvider_SMTP_ServerProfile = z.infer<typeof EmailProvider_SMTP_ServerProfileSchema>;\n\n// ===============================================================\n// Email Address Schema\n// ===============================================================\n\nexport const EmailProvider_AddressSchema = z.object({\n email: z.email(),\n name: z.string().optional(),\n});\nexport type EmailProvider_Address = z.infer<typeof EmailProvider_AddressSchema>;\n\n// ===============================================================\n// Email Attachment Schema\n// ===============================================================\n\nexport const EmailProvider_AttachmentSchema = z.object({\n filename: z.string().min(1),\n content: z.string(), // Base64 encoded content\n contentType: z.string().optional(),\n contentId: z.string().optional(), // For inline images (cid:)\n});\nexport type EmailProvider_Attachment = z.infer<typeof EmailProvider_AttachmentSchema>;\n\n// ===============================================================\n// Email Provider Profile (Provider-level - FIXED by provider)\n// ===============================================================\n\nexport type EmailProvider_Profile = ExternalProvider_ExchangeProtocol_Profile_Base & {\n // Human-readable provider name (for display and registry)\n displayName?: string;\n \n // API settings (for REST API providers)\n baseURL: string;\n apiVersion?: string;\n \n // SMTP server settings (for SMTP-capable providers)\n // Note: These are the provider's SMTP server details, NOT user credentials\n smtpServer?: EmailProvider_SMTP_ServerProfile;\n \n // Provider capabilities (fixed)\n capabilities: EmailProvider_Capability[];\n \n // Supported email types (fixed)\n supportedEmailTypes: EmailProvider_EmailType[];\n \n // Delivery methods supported (fixed)\n deliveryMethods: EmailProvider_DeliveryMethod[];\n \n // Provider-imposed limits (fixed)\n limits: {\n maxRecipientsPerRequest?: number;\n maxBatchSize?: number;\n maxAttachmentSizeMB?: number;\n maxEmailSizeKB?: number;\n rateLimit?: {\n requests: number;\n period: \"second\" | \"minute\" | \"hour\" | \"day\";\n };\n };\n};\n\n// ===============================================================\n// Email Provider Configuration (Consumer-level - user configurable)\n// ===============================================================\n\nexport type EmailProvider_Configuration = ExternalProvider_ExchangeProtocol_Configuration_Base & {\n // Preferred delivery method (if provider supports both)\n preferredDeliveryMethod?: EmailProvider_DeliveryMethod;\n \n // SMTP credentials (user's credentials for SMTP)\n smtpCredentials?: {\n username: string;\n passwordSecretRef: string; // Reference to secret store\n };\n \n // Default sender identity (user's sender)\n defaultFromAddress?: EmailProvider_Address;\n defaultReplyTo?: EmailProvider_Address;\n \n // Tracking preferences\n openTrackingEnabled?: boolean;\n clickTrackingEnabled?: boolean;\n \n // Webhook for delivery events\n webhookConfig?: {\n url: string;\n secretRef?: string;\n events?: EmailProvider_DeliveryStatus[];\n };\n \n // Testing/sandbox mode\n sandboxMode?: boolean;\n \n // IP pool selection (for providers that support it)\n ipPoolName?: string;\n \n // Tags to apply to all emails\n defaultTags?: string[];\n};\n\n// ===============================================================\n// Send Email Input Schema\n// ===============================================================\n\nexport const EmailProvider_SendEmailInputSchema = z.object({\n // Recipients\n to: z.array(EmailProvider_AddressSchema).min(1),\n cc: z.array(EmailProvider_AddressSchema).optional(),\n bcc: z.array(EmailProvider_AddressSchema).optional(),\n \n // Sender (can override configuration default)\n from: EmailProvider_AddressSchema.optional(),\n replyTo: EmailProvider_AddressSchema.optional(),\n \n // Content\n subject: z.string().min(1),\n text: z.string().optional(),\n html: z.string().optional(),\n \n // Attachments\n attachments: z.array(EmailProvider_AttachmentSchema).optional(),\n \n // Headers\n headers: z.record(z.string(), z.string()).optional(),\n \n // Tags for categorization/analytics\n tags: z.array(z.string()).optional(),\n \n // Scheduling\n scheduledAt: z.iso.datetime().optional(),\n \n // Tracking overrides\n trackOpens: z.boolean().optional(),\n trackClicks: z.boolean().optional(),\n});\nexport type EmailProvider_SendEmailInput = z.infer<typeof EmailProvider_SendEmailInputSchema>;\n\n// ===============================================================\n// Send Email Output Schema\n// ===============================================================\n\nexport const EmailProvider_SendEmailOutputSchema = z.object({\n // Provider's message ID\n id: z.string(),\n \n // Status (if available immediately)\n status: z.enum(EmailProvider_DeliveryStatus).optional(),\n \n // Provider-specific data\n providerMessageId: z.string().optional(),\n});\nexport type EmailProvider_SendEmailOutput = z.infer<typeof EmailProvider_SendEmailOutputSchema>;\n\n// ===============================================================\n// Send Template Email Input Schema\n// ===============================================================\n\nexport const EmailProvider_SendTemplateInputSchema = z.object({\n // Recipients\n to: z.array(EmailProvider_AddressSchema).min(1),\n cc: z.array(EmailProvider_AddressSchema).optional(),\n bcc: z.array(EmailProvider_AddressSchema).optional(),\n \n // Sender\n from: EmailProvider_AddressSchema.optional(),\n replyTo: EmailProvider_AddressSchema.optional(),\n \n // Template\n templateId: z.string().min(1),\n templateAlias: z.string().optional(), // Some providers use alias instead of ID\n \n // Template variables\n variables: z.record(z.string(), z.unknown()).optional(),\n \n // Subject override (if template allows)\n subject: z.string().optional(),\n \n // Tags\n tags: z.array(z.string()).optional(),\n \n // Scheduling\n scheduledAt: z.iso.datetime().optional(),\n});\nexport type EmailProvider_SendTemplateInput = z.infer<typeof EmailProvider_SendTemplateInputSchema>;\n\n// ===============================================================\n// Batch Send Input Schema\n// ===============================================================\n\nconst emailProviderBatchItemSchema = z.object({\n to: EmailProvider_AddressSchema,\n variables: z.record(z.string(), z.unknown()).optional(),\n subject: z.string().optional(), // Override per recipient\n});\n\nexport const EmailProvider_SendBatchInputSchema = z.object({\n // Sender\n from: EmailProvider_AddressSchema.optional(),\n replyTo: EmailProvider_AddressSchema.optional(),\n \n // Content (direct or template)\n subject: z.string().optional(), // Default subject\n text: z.string().optional(),\n html: z.string().optional(),\n templateId: z.string().optional(),\n \n // Recipients with personalizations\n recipients: z.array(emailProviderBatchItemSchema).min(1),\n \n // Tags\n tags: z.array(z.string()).optional(),\n});\nexport type EmailProvider_SendBatchInput = z.infer<typeof EmailProvider_SendBatchInputSchema>;\n\n// ===============================================================\n// Batch Send Output Schema\n// ===============================================================\n\nexport const EmailProvider_SendBatchOutputSchema = z.object({\n // Summary\n totalRequested: z.number().int(),\n totalAccepted: z.number().int(),\n totalRejected: z.number().int(),\n \n // Results per recipient\n results: z.array(z.object({\n email: z.string(),\n id: z.string().optional(),\n status: z.enum([\"accepted\", \"rejected\"]),\n error: z.string().optional(),\n })),\n});\nexport type EmailProvider_SendBatchOutput = z.infer<typeof EmailProvider_SendBatchOutputSchema>;\n\n// ===============================================================\n// Campaign Input Schema (Marketing)\n// ===============================================================\n\nexport const EmailProvider_CreateCampaignInputSchema = z.object({\n // Campaign details\n name: z.string().min(1),\n subject: z.string().min(1),\n previewText: z.string().optional(),\n \n // Sender\n from: EmailProvider_AddressSchema,\n replyTo: EmailProvider_AddressSchema.optional(),\n \n // Content\n html: z.string().optional(),\n text: z.string().optional(),\n templateId: z.string().optional(),\n \n // Recipients\n listIds: z.array(z.string()).optional(),\n segmentIds: z.array(z.string()).optional(),\n \n // Scheduling\n scheduledAt: z.iso.datetime().optional(),\n \n // Tracking\n trackOpens: z.boolean().optional().default(true),\n trackClicks: z.boolean().optional().default(true),\n});\nexport type EmailProvider_CreateCampaignInput = z.infer<typeof EmailProvider_CreateCampaignInputSchema>;\n\n// ===============================================================\n// Campaign Output Schema\n// ===============================================================\n\nexport const EmailProvider_CampaignOutputSchema = z.object({\n id: z.string(),\n status: z.enum([\"draft\", \"scheduled\", \"sending\", \"sent\", \"cancelled\"]),\n scheduledAt: z.iso.datetime().optional(),\n sentAt: z.iso.datetime().optional(),\n});\nexport type EmailProvider_CampaignOutput = z.infer<typeof EmailProvider_CampaignOutputSchema>;\n\n// ===============================================================\n// Message Status Schema\n// ===============================================================\n\nexport const EmailProvider_MessageStatusSchema = z.object({\n id: z.string(),\n status: z.enum(EmailProvider_DeliveryStatus),\n to: z.email(),\n subject: z.string().optional(),\n sentAt: z.iso.datetime().optional(),\n deliveredAt: z.iso.datetime().optional(),\n openedAt: z.iso.datetime().optional(),\n clickedAt: z.iso.datetime().optional(),\n bouncedAt: z.iso.datetime().optional(),\n bounceType: z.enum(EmailProvider_BounceType).optional(),\n bounceReason: z.string().optional(),\n});\nexport type EmailProvider_MessageStatus = z.infer<typeof EmailProvider_MessageStatusSchema>;\n\n// ===============================================================\n// Email Operation Context (for tracking)\n// ===============================================================\n\nexport const EmailProvider_OperationContextSchema = ExternalProvider_OperationContextSchema.extend({\n // Message identification\n messageId: z.string().optional(),\n \n // Delivery info\n deliveryMethod: z.enum(EmailProvider_DeliveryMethod).optional(),\n deliveryStatus: z.enum(EmailProvider_DeliveryStatus).optional(),\n \n // Email type\n emailType: z.enum(EmailProvider_EmailType).optional(),\n \n // Counts\n recipientCount: z.number().int().optional(),\n \n // Rate limit headers from provider\n rateLimitRemaining: z.number().optional(),\n rateLimitResetAt: z.iso.datetime().optional(),\n});\nexport type EmailProvider_OperationContext = z.infer<typeof EmailProvider_OperationContextSchema>;\n\n// ===============================================================\n// Webhook Event Schema\n// ===============================================================\n\nexport const EmailProvider_WebhookEventSchema = z.object({\n eventType: z.enum(EmailProvider_DeliveryStatus),\n messageId: z.string(),\n email: z.email(),\n timestamp: z.iso.datetime(),\n \n // Event-specific data\n bounceType: z.enum(EmailProvider_BounceType).optional(),\n bounceReason: z.string().optional(),\n link: z.url().optional(), // For click events\n userAgent: z.string().optional(),\n \n // Original tags\n tags: z.array(z.string()).optional(),\n});\nexport type EmailProvider_WebhookEvent = z.infer<typeof EmailProvider_WebhookEventSchema>;\n\n// ===============================================================\n// Email Operation Definition\n// ===============================================================\n\nexport type EmailProvider_OperationDefinition = ExternalProvider_OperationDefinition_Base & {\n operationContextSchema: typeof EmailProvider_OperationContextSchema;\n \n // Which email types this operation supports\n supportedEmailTypes: EmailProvider_EmailType[];\n \n // Which delivery methods work for this operation\n supportedDeliveryMethods: EmailProvider_DeliveryMethod[];\n \n // Required capabilities\n requiredCapabilities?: EmailProvider_Capability[];\n};\n\n// ===============================================================\n// Email Provider Status Schema\n// ===============================================================\n\nexport const EmailProvider_StatusSchema = ExternalProvider_ExchangeProtocol_Status_BaseSchema.extend({\n protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.EMAIL_PROVIDER),\n \n // API connectivity\n apiConnected: z.boolean().optional(),\n smtpConnected: z.boolean().optional(),\n \n // Domain status\n domainVerified: z.boolean().optional(),\n spfValid: z.boolean().optional(),\n dkimValid: z.boolean().optional(),\n dmarcValid: z.boolean().optional(),\n \n // Rate limit\n rateLimitRemaining: z.number().optional(),\n rateLimitResetAt: z.iso.datetime().optional(),\n \n // Reputation (if provider exposes it)\n senderReputation: z.number().min(0).max(100).optional(),\n});\nexport type EmailProvider_Status = z.infer<typeof EmailProvider_StatusSchema>;\n"]}
1
+ {"version":3,"file":"email.external-connectors-models.schemas.js","sourceRoot":"","sources":["../../../../src/protocols/email.external-connectors-models.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,uCAAuC,EAA6C,MAAM,uDAAuD,CAAC;AAE3J,iEAAiE;AACjE,iBAAiB;AACjB,WAAW;AACX,qEAAqE;AACrE,wEAAwE;AACxE,sDAAsD;AACtD,EAAE;AACF,wBAAwB;AACxB,wEAAwE;AACxE,0EAA0E;AAC1E,gEAAgE;AAChE,0EAA0E;AAC1E,iEAAiE;AAEjE,kEAAkE;AAClE,uBAAuB;AACvB,kEAAkE;AAElE;;;GAGG;AACH,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,0DAA+B,CAAA;IAC/B,kDAAuB,CAAA;AACzB,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,qDAAqB,CAAA;IACrB,6CAAa,CAAA;AACf,CAAC,EAHW,4BAA4B,KAA5B,4BAA4B,QAGvC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,2BAIX;AAJD,WAAY,2BAA2B;IACrC,4CAAa,CAAA;IACb,oDAAqB,CAAA;IACrB,0CAAW,CAAA;AACb,CAAC,EAJW,2BAA2B,KAA3B,2BAA2B,QAItC;AAED;;GA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AAQ,EAAE;IAE/D,aAAa;IACb,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE;IAErD,SAAS;IACT,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAE3C,mCAAmC;IACnC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,gBAAgB,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC;AAGH,kEAAkE;AAClE,uBAAuB;AACvB,kEAAkE;AAElE,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE;IAChB,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAE3B,sBAAsB;IACtB,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE;IACvD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,mBAAmB;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAEhC,gBAAgB;IAChB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { \n ExternalProvider_ExchangeProtocol_Kind \n} from \"../core/commons.external-connectors-models.schemas\";\nimport { ExternalProvider_OperationContextSchema, ExternalProvider_OperationDefinition_Base } from \"../core/operations.external-connectors-models.schemas\";\n\n//===============================================================\n// Email Provider\n// --------\n// Integration with email service providers for sending transactional\n// and marketing emails. Supports both REST API and SMTP-based providers\n// with differentiated operations for each email type.\n//\n// CONFIGURATION LEVELS:\n// - Profile (Provider-level): Fixed by the provider, cannot be changed.\n// Examples: API endpoints, SMTP server addresses, capabilities, limits.\n// - Configuration (Consumer-level): User-configurable settings.\n// Examples: API keys, sender addresses, tracking preferences, webhooks.\n//===============================================================\n\n// ===============================================================\n// Email Provider Enums\n// ===============================================================\n\n/**\n * The type of email operation - transactional vs marketing have different\n * requirements, compliance rules, and often use separate sending domains/IPs.\n */\nexport enum EmailProvider_EmailType {\n TRANSACTIONAL = \"transactional\", // Password resets, receipts, notifications\n MARKETING = \"marketing\", // Newsletters, promotions, campaigns\n}\n\n/**\n * The delivery method used by the email provider.\n * REST API provides more features, SMTP is simpler but more limited.\n */\nexport enum EmailProvider_DeliveryMethod {\n REST_API = \"rest_api\",\n SMTP = \"smtp\",\n}\n\n/**\n * SMTP encryption/security modes.\n */\nexport enum EmailProvider_SMTP_Security {\n NONE = \"none\", // Plain text (port 25, not recommended)\n STARTTLS = \"starttls\", // Upgrade to TLS (port 587)\n TLS = \"tls\", // Implicit TLS/SSL (port 465)\n}\n\n/**\n * Email delivery status for tracking.\n */\nexport enum EmailProvider_DeliveryStatus {\n QUEUED = \"queued\",\n SENT = \"sent\",\n DELIVERED = \"delivered\",\n OPENED = \"opened\",\n CLICKED = \"clicked\",\n BOUNCED = \"bounced\",\n SOFT_BOUNCED = \"soft_bounced\",\n SPAM_COMPLAINT = \"spam_complaint\",\n UNSUBSCRIBED = \"unsubscribed\",\n DROPPED = \"dropped\",\n DEFERRED = \"deferred\",\n FAILED = \"failed\",\n}\n\n/**\n * Email bounce types.\n */\nexport enum EmailProvider_BounceType {\n HARD = \"hard\", // Permanent failure (address doesn't exist)\n SOFT = \"soft\", // Temporary failure (mailbox full, server down)\n TRANSIENT = \"transient\",\n}\n\n/**\n * Standard email provider operation keys.\n * Each provider implements a subset of these based on capabilities.\n */\nexport enum EmailProvider_OperationKey {\n // Core Transactional Operations\n SEND_EMAIL = \"email.send\",\n SEND_BATCH = \"email.sendBatch\",\n SEND_TEMPLATE = \"email.sendTemplate\",\n \n // Marketing/Campaign Operations\n SEND_CAMPAIGN = \"email.campaign.send\",\n CREATE_CAMPAIGN = \"email.campaign.create\",\n SCHEDULE_CAMPAIGN = \"email.campaign.schedule\",\n GET_CAMPAIGN = \"email.campaign.get\",\n \n // List Management (Marketing)\n LIST_CREATE = \"email.list.create\",\n LIST_ADD_CONTACT = \"email.list.addContact\",\n LIST_REMOVE_CONTACT = \"email.list.removeContact\",\n LIST_GET = \"email.list.get\",\n \n // Template Operations\n TEMPLATE_CREATE = \"email.template.create\",\n TEMPLATE_GET = \"email.template.get\",\n TEMPLATE_LIST = \"email.template.list\",\n TEMPLATE_DELETE = \"email.template.delete\",\n \n // Status & Analytics\n GET_MESSAGE_STATUS = \"email.message.getStatus\",\n GET_ANALYTICS = \"email.analytics.get\",\n \n // Suppression/Bounces\n GET_SUPPRESSIONS = \"email.suppressions.get\",\n ADD_SUPPRESSION = \"email.suppressions.add\",\n DELETE_SUPPRESSION = \"email.suppressions.delete\",\n \n // Domain Verification\n DOMAIN_VERIFY = \"email.domain.verify\",\n DOMAIN_GET_STATUS = \"email.domain.getStatus\",\n}\n\n/**\n * Email provider capabilities - what features the provider supports.\n * Used to determine which operations are available.\n */\nexport enum EmailProvider_Capability {\n // Delivery Methods\n SUPPORTS_REST_API = \"supports_rest_api\",\n SUPPORTS_SMTP = \"supports_smtp\",\n \n // Email Types\n SUPPORTS_TRANSACTIONAL = \"supports_transactional\",\n SUPPORTS_MARKETING = \"supports_marketing\",\n \n // Core Features\n SUPPORTS_TEMPLATES = \"supports_templates\",\n SUPPORTS_BATCH_SENDING = \"supports_batch_sending\",\n SUPPORTS_SCHEDULING = \"supports_scheduling\",\n SUPPORTS_ATTACHMENTS = \"supports_attachments\",\n SUPPORTS_INLINE_IMAGES = \"supports_inline_images\",\n \n // Tracking\n SUPPORTS_OPEN_TRACKING = \"supports_open_tracking\",\n SUPPORTS_CLICK_TRACKING = \"supports_click_tracking\",\n SUPPORTS_WEBHOOKS = \"supports_webhooks\",\n \n // Marketing Specific\n SUPPORTS_CAMPAIGNS = \"supports_campaigns\",\n SUPPORTS_LIST_MANAGEMENT = \"supports_list_management\",\n SUPPORTS_SEGMENTATION = \"supports_segmentation\",\n SUPPORTS_AB_TESTING = \"supports_ab_testing\",\n \n // Compliance & Deliverability\n SUPPORTS_SUPPRESSION_LISTS = \"supports_suppression_lists\",\n SUPPORTS_DEDICATED_IP = \"supports_dedicated_ip\",\n SUPPORTS_CUSTOM_DOMAIN = \"supports_custom_domain\",\n SUPPORTS_EMAIL_VALIDATION = \"supports_email_validation\",\n}\n\n// ===============================================================\n// SMTP Server Profile (Provider-level, fixed)\n// ===============================================================\n\nexport const EmailProvider_SMTP_ServerProfileSchema = z.object({\n host: z.string().min(1),\n port: z.number().int().min(1).max(65535),\n security: z.enum(EmailProvider_SMTP_Security),\n // Note: username/password are consumer-level (in Configuration)\n});\nexport type EmailProvider_SMTP_ServerProfile = z.infer<typeof EmailProvider_SMTP_ServerProfileSchema>;\n\n// ===============================================================\n// Email Address Schema\n// ===============================================================\n\nexport const EmailProvider_AddressSchema = z.object({\n email: z.email(),\n name: z.string().optional(),\n});\nexport type EmailProvider_Address = z.infer<typeof EmailProvider_AddressSchema>;\n\n// ===============================================================\n// Email Attachment Schema\n// ===============================================================\n\nexport const EmailProvider_AttachmentSchema = z.object({\n filename: z.string().min(1),\n content: z.string(), // Base64 encoded content\n contentType: z.string().optional(),\n contentId: z.string().optional(), // For inline images (cid:)\n});\nexport type EmailProvider_Attachment = z.infer<typeof EmailProvider_AttachmentSchema>;\n\n// ===============================================================\n// Send Email Input Schema\n// ===============================================================\n\nexport const EmailProvider_SendEmailInputSchema = z.object({\n // Recipients\n to: z.array(EmailProvider_AddressSchema).min(1),\n cc: z.array(EmailProvider_AddressSchema).optional(),\n bcc: z.array(EmailProvider_AddressSchema).optional(),\n \n // Sender (can override configuration default)\n from: EmailProvider_AddressSchema.optional(),\n replyTo: EmailProvider_AddressSchema.optional(),\n \n // Content\n subject: z.string().min(1),\n text: z.string().optional(),\n html: z.string().optional(),\n \n // Attachments\n attachments: z.array(EmailProvider_AttachmentSchema).optional(),\n \n // Headers\n headers: z.record(z.string(), z.string()).optional(),\n \n // Tags for categorization/analytics\n tags: z.array(z.string()).optional(),\n \n // Scheduling\n scheduledAt: z.iso.datetime().optional(),\n \n // Tracking overrides\n trackOpens: z.boolean().optional(),\n trackClicks: z.boolean().optional(),\n});\nexport type EmailProvider_SendEmailInput = z.infer<typeof EmailProvider_SendEmailInputSchema>;\n\n// ===============================================================\n// Send Email Output Schema\n// ===============================================================\n\nexport const EmailProvider_SendEmailOutputSchema = z.object({\n // Provider's message ID\n id: z.string(),\n \n // Status (if available immediately)\n status: z.enum(EmailProvider_DeliveryStatus).optional(),\n \n // Provider-specific data\n providerMessageId: z.string().optional(),\n});\nexport type EmailProvider_SendEmailOutput = z.infer<typeof EmailProvider_SendEmailOutputSchema>;\n\n// ===============================================================\n// Send Template Email Input Schema\n// ===============================================================\n\nexport const EmailProvider_SendTemplateInputSchema = z.object({\n // Recipients\n to: z.array(EmailProvider_AddressSchema).min(1),\n cc: z.array(EmailProvider_AddressSchema).optional(),\n bcc: z.array(EmailProvider_AddressSchema).optional(),\n \n // Sender\n from: EmailProvider_AddressSchema.optional(),\n replyTo: EmailProvider_AddressSchema.optional(),\n \n // Template\n templateId: z.string().min(1),\n templateAlias: z.string().optional(), // Some providers use alias instead of ID\n \n // Template variables\n variables: z.record(z.string(), z.unknown()).optional(),\n \n // Subject override (if template allows)\n subject: z.string().optional(),\n \n // Tags\n tags: z.array(z.string()).optional(),\n \n // Scheduling\n scheduledAt: z.iso.datetime().optional(),\n});\nexport type EmailProvider_SendTemplateInput = z.infer<typeof EmailProvider_SendTemplateInputSchema>;\n\n// ===============================================================\n// Batch Send Input Schema\n// ===============================================================\n\nconst emailProviderBatchItemSchema = z.object({\n to: EmailProvider_AddressSchema,\n variables: z.record(z.string(), z.unknown()).optional(),\n subject: z.string().optional(), // Override per recipient\n});\n\nexport const EmailProvider_SendBatchInputSchema = z.object({\n // Sender\n from: EmailProvider_AddressSchema.optional(),\n replyTo: EmailProvider_AddressSchema.optional(),\n \n // Content (direct or template)\n subject: z.string().optional(), // Default subject\n text: z.string().optional(),\n html: z.string().optional(),\n templateId: z.string().optional(),\n \n // Recipients with personalizations\n recipients: z.array(emailProviderBatchItemSchema).min(1),\n \n // Tags\n tags: z.array(z.string()).optional(),\n});\nexport type EmailProvider_SendBatchInput = z.infer<typeof EmailProvider_SendBatchInputSchema>;\n\n// ===============================================================\n// Batch Send Output Schema\n// ===============================================================\n\nexport const EmailProvider_SendBatchOutputSchema = z.object({\n // Summary\n totalRequested: z.number().int(),\n totalAccepted: z.number().int(),\n totalRejected: z.number().int(),\n \n // Results per recipient\n results: z.array(z.object({\n email: z.string(),\n id: z.string().optional(),\n status: z.enum([\"accepted\", \"rejected\"]),\n error: z.string().optional(),\n })),\n});\nexport type EmailProvider_SendBatchOutput = z.infer<typeof EmailProvider_SendBatchOutputSchema>;\n\n// ===============================================================\n// Campaign Input Schema (Marketing)\n// ===============================================================\n\nexport const EmailProvider_CreateCampaignInputSchema = z.object({\n // Campaign details\n name: z.string().min(1),\n subject: z.string().min(1),\n previewText: z.string().optional(),\n \n // Sender\n from: EmailProvider_AddressSchema,\n replyTo: EmailProvider_AddressSchema.optional(),\n \n // Content\n html: z.string().optional(),\n text: z.string().optional(),\n templateId: z.string().optional(),\n \n // Recipients\n listIds: z.array(z.string()).optional(),\n segmentIds: z.array(z.string()).optional(),\n \n // Scheduling\n scheduledAt: z.iso.datetime().optional(),\n \n // Tracking\n trackOpens: z.boolean().optional().default(true),\n trackClicks: z.boolean().optional().default(true),\n});\nexport type EmailProvider_CreateCampaignInput = z.infer<typeof EmailProvider_CreateCampaignInputSchema>;\n\n// ===============================================================\n// Campaign Output Schema\n// ===============================================================\n\nexport const EmailProvider_CampaignOutputSchema = z.object({\n id: z.string(),\n status: z.enum([\"draft\", \"scheduled\", \"sending\", \"sent\", \"cancelled\"]),\n scheduledAt: z.iso.datetime().optional(),\n sentAt: z.iso.datetime().optional(),\n});\nexport type EmailProvider_CampaignOutput = z.infer<typeof EmailProvider_CampaignOutputSchema>;\n\n// ===============================================================\n// Message Status Schema\n// ===============================================================\n\nexport const EmailProvider_MessageStatusSchema = z.object({\n id: z.string(),\n status: z.enum(EmailProvider_DeliveryStatus),\n to: z.email(),\n subject: z.string().optional(),\n sentAt: z.iso.datetime().optional(),\n deliveredAt: z.iso.datetime().optional(),\n openedAt: z.iso.datetime().optional(),\n clickedAt: z.iso.datetime().optional(),\n bouncedAt: z.iso.datetime().optional(),\n bounceType: z.enum(EmailProvider_BounceType).optional(),\n bounceReason: z.string().optional(),\n});\nexport type EmailProvider_MessageStatus = z.infer<typeof EmailProvider_MessageStatusSchema>;\n\n// ===============================================================\n// Email Operation Context (for tracking)\n// ===============================================================\n\nexport const EmailProvider_OperationContextSchema = ExternalProvider_OperationContextSchema.extend({\n // Message identification\n messageId: z.string().optional(),\n \n // Delivery info\n deliveryMethod: z.enum(EmailProvider_DeliveryMethod).optional(),\n deliveryStatus: z.enum(EmailProvider_DeliveryStatus).optional(),\n \n // Email type\n emailType: z.enum(EmailProvider_EmailType).optional(),\n \n // Counts\n recipientCount: z.number().int().optional(),\n \n // Rate limit headers from provider\n rateLimitRemaining: z.number().optional(),\n rateLimitResetAt: z.iso.datetime().optional(),\n});\nexport type EmailProvider_OperationContext = z.infer<typeof EmailProvider_OperationContextSchema>;\n\n// ===============================================================\n// Webhook Event Schema\n// ===============================================================\n\nexport const EmailProvider_WebhookEventSchema = z.object({\n eventType: z.enum(EmailProvider_DeliveryStatus),\n messageId: z.string(),\n email: z.email(),\n timestamp: z.iso.datetime(),\n \n // Event-specific data\n bounceType: z.enum(EmailProvider_BounceType).optional(),\n bounceReason: z.string().optional(),\n link: z.url().optional(), // For click events\n userAgent: z.string().optional(),\n \n // Original tags\n tags: z.array(z.string()).optional(),\n});\nexport type EmailProvider_WebhookEvent = z.infer<typeof EmailProvider_WebhookEventSchema>;\n\n// ===============================================================\n// Email Operation Definition\n// ===============================================================\n\nexport type EmailProvider_OperationDefinition = ExternalProvider_OperationDefinition_Base & {\n operationContextSchema: typeof EmailProvider_OperationContextSchema;\n \n // Which email types this operation supports\n supportedEmailTypes: EmailProvider_EmailType[];\n \n // Which delivery methods work for this operation\n supportedDeliveryMethods: EmailProvider_DeliveryMethod[];\n \n // Required capabilities\n requiredCapabilities?: EmailProvider_Capability[];\n};\n\n"]}
@@ -325,14 +325,14 @@ export declare const StandardEmail_ErrorSchema: z.ZodObject<{
325
325
  code: z.ZodEnum<{
326
326
  VALIDATION_ERROR: "VALIDATION_ERROR";
327
327
  PROVIDER_ERROR: "PROVIDER_ERROR";
328
- RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED";
329
- AUTHENTICATION_FAILED: "AUTHENTICATION_FAILED";
330
- QUOTA_EXCEEDED: "QUOTA_EXCEEDED";
331
- UNKNOWN_ERROR: "UNKNOWN_ERROR";
332
328
  CAPABILITY_NOT_SUPPORTED: "CAPABILITY_NOT_SUPPORTED";
333
329
  MARKETING_NOT_SUPPORTED: "MARKETING_NOT_SUPPORTED";
334
330
  SCHEDULING_NOT_SUPPORTED: "SCHEDULING_NOT_SUPPORTED";
335
331
  TEMPLATE_NOT_FOUND: "TEMPLATE_NOT_FOUND";
332
+ RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED";
333
+ AUTHENTICATION_FAILED: "AUTHENTICATION_FAILED";
334
+ QUOTA_EXCEEDED: "QUOTA_EXCEEDED";
335
+ UNKNOWN_ERROR: "UNKNOWN_ERROR";
336
336
  }>;
337
337
  message: z.ZodString;
338
338
  provider: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"email.standard-interface.schemas.d.ts","sourceRoot":"","sources":["../../../src/protocols/email.standard-interface.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAA2B,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAmB7I,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAMhF,eAAO,MAAM,8BAA8B;;;;;iBAKzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,oBAAY,4BAA4B;IACtC,IAAI,SAAS;IACb,mBAAmB,wBAAwB;CAC5C;AAED,8EAA8E;AAC9E,oBAAY,6BAA6B;IACvC,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,SAAS,cAAc;CACxB;AAED,kFAAkF;AAClF,oBAAY,qCAAqC;IAC/C,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;CAC1C;AAMD,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0C3C,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAMxF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;iBAkH3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAM1F,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBlD,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAA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AAEH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAM1G,eAAO,MAAM,oCAAoC;;iBAE/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,qCAAqC;;;;;;;;;;;iBAWhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAMpG,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;iBAoBpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM5E;;;GAGG;AACH,eAAO,MAAM,mCAAmC;wBAC7B,wBAAwB,EAAE;;;;;;CAMnC,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,MAAM,OAAO,mCAAmC,CAAC"}
1
+ {"version":3,"file":"email.standard-interface.schemas.d.ts","sourceRoot":"","sources":["../../../../src/protocols/email.standard-interface.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAA2B,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAmB7I,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAMhF,eAAO,MAAM,8BAA8B;;;;;iBAKzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,oBAAY,4BAA4B;IACtC,IAAI,SAAS;IACb,mBAAmB,wBAAwB;CAC5C;AAED,8EAA8E;AAC9E,oBAAY,6BAA6B;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AAuB,GAAG,MAAM,OAAO,mCAAmC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { ExternalProvider_ExchangeProtocol_Configuration_Base, ExternalProvider_ExchangeProtocol_Kind, ExternalProvider_ExchangeProtocol_Profile_Base } from "../core/commons.external-connectors-models.schemas";
2
+ import { ExternalProvider_ExchangeProtocol_Kind } from "../core/commons.external-connectors-models.schemas";
3
3
  /**
4
4
  * Concrete embedding-model ids the framework knows. Ids and dimensions are published provider
5
5
  * facts (OpenAI embeddings API); the runtime additionally verifies the MEASURED dimension of
@@ -118,14 +118,6 @@ export declare const resolveEmbeddingsModelForApplicability: (input: {
118
118
  applicability: Embeddings_Applicability;
119
119
  providerRef: string;
120
120
  }, catalog?: Record<EmbeddingsProvider_Model, Embeddings_ModelCatalogEntry>) => Embeddings_ModelResolution;
121
- export type EmbeddingsProvider_Profile = ExternalProvider_ExchangeProtocol_Profile_Base & {
122
- baseURL?: string;
123
- /** Model ids this provider serves (advertised for validation/UX). */
124
- supportedModels?: string[];
125
- };
126
- export type EmbeddingsProvider_Configuration = ExternalProvider_ExchangeProtocol_Configuration_Base & {
127
- customLocation?: string;
128
- };
129
121
  /**
130
122
  * Usage of one embedding call. There is NO completion-token dimension — an embedding consumes
131
123
  * input tokens and produces vectors, so usage-completeness for an embedding trace is judged on
@@ -165,11 +157,4 @@ export declare const EmbeddingsProvider_EmbedTextsOutputSchema: z.ZodObject<{
165
157
  }, z.core.$strip>;
166
158
  }, z.core.$strip>;
167
159
  export type EmbeddingsProvider_EmbedTextsOutput = z.infer<typeof EmbeddingsProvider_EmbedTextsOutputSchema>;
168
- export declare const EmbeddingsProvider_StatusSchema: z.ZodObject<{
169
- status: z.ZodEnum<typeof import("..").ExternalProvider_Status>;
170
- lastCheckedAt: z.ZodString;
171
- errorReason: z.ZodOptional<z.ZodString>;
172
- protocolKind: z.ZodLiteral<ExternalProvider_ExchangeProtocol_Kind.EMBEDDINGS_PROVIDER>;
173
- }, z.core.$strip>;
174
- export type EmbeddingsProvider_Status = z.infer<typeof EmbeddingsProvider_StatusSchema>;
175
160
  //# sourceMappingURL=embeddings.external-connectors-models.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"embeddings.external-connectors-models.schemas.d.ts","sourceRoot":"","sources":["../../../src/protocols/embeddings.external-connectors-models.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACL,oDAAoD,EACpD,sCAAsC,EACtC,8CAA8C,EAE/C,MAAM,oDAAoD,CAAA;AAkB3D;;;;;GAKG;AACH,oBAAY,wBAAwB;IAClC,kGAAkG;IAClG,8BAA8B,2BAA2B;IACzD,kEAAkE;IAClE,8BAA8B,2BAA2B;CAC1D;AAED;;;;;;;;;GASG;AACH,oBAAY,+BAA+B;IACzC,8DAA8D;IAC9D,WAAW,0BAA0B;CACtC;AAED;;;;;;;;GAQG;AACH,oBAAY,8BAA8B;IACxC,yEAAyE;IACzE,MAAM,WAAW;IACjB,8EAA8E;IAC9E,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,wBAAwB;IAClC,iGAAiG;IACjG,WAAW,gBAAgB;CAC5B;AACD,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,eAAe,EAAE,SAAS,wBAAwB,EAAE,CAAC;CACtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,wBAAwB,EAAE,4BAA4B,CAcnG,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAAC,wBAAwB,EAAE,SAAS,wBAAwB,EAAE,CAI3H,CAAC;AAEF,sHAAsH;AACtH,oBAAY,iCAAiC;I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MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAM5G,eAAO,MAAM,+BAA+B;;;;;iBAE1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
1
+ {"version":3,"file":"embeddings.external-connectors-models.schemas.d.ts","sourceRoot":"","sources":["../../../../src/protocols/embeddings.external-connectors-models.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACL,sCAAsC,EACrC,MAAM,oDAAoD,CAAA;AAkB7D;;;;;GAKG;AACH,oBAAY,wBAAwB;IAClC,kGAAkG;IAClG,8BAA8B,2BAA2B;IACzD,kEAAkE;IAClE,8BAA8B,2BAA2B;CAC1D;AAED;;;;;;;;;GASG;AACH,oBAAY,+BAA+B;IACzC,8DAA8D;IAC9D,WAAW,0BAA0B;CACtC;AAED;;;;;;;;GAQG;AACH,oBAAY,8BAA8B;IACxC,yEAAyE;IACzE,MAAM,WAAW;IACjB,8EAA8E;IAC9E,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,wBAAwB;IAClC,iGAAiG;IACjG,WAAW,gBAAgB;CAC5B;AACD,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,eAAe,EAAE,SAAS,wBAAwB,EAAE,CAAC;CACtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,wBAAwB,EAAE,4BAA4B,CAenG,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAAC,wBAAwB,EAAE,SAAS,wBAAwB,EAAE,CAI3H,CAAC;AAEF,sHAAsH;AACtH,oBAAY,iCAAiC;IAC3C,mEAAmE;IACnE,yBAAyB,8BAA8B;CACxD;AAED,MAAM,MAAM,0BAA0B,GAClC;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,wBAAwB,CAAC;IAAC,KAAK,EAAE,4BAA4B,CAAA;CAAE,GACxF;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,iCAAiC,CAAC;IAAC,gBAAgB,EAAE,SAAS,wBAAwB,EAAE,CAAA;CAAE,CAAC;AAE3H;;;;;;;GAOG;AACH,eAAO,MAAM,sCAAsC,GACjD,OAAO;IAAE,aAAa,EAAE,wBAAwB,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,EACvE,UAAS,MAAM,CAAC,wBAAwB,EAAE,4BAA4B,CAA4B,KACjG,0BAWF,CAAC;AAMF;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;iBAGzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,mDAAmD;;;;iBAI9D,CAAC;AACH,MAAM,MAAM,6CAA6C,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mDAAmD,CAAC,CAAC;AAMhI,kFAAkF;AAClF,eAAO,MAAM,wCAAwC;;;iBAKnD,CAAC;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G;;;;;;;GAOG;AACH,eAAO,MAAM,yCAAyC;;;;;;;iBAOpD,CAAC;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { ExternalProvider_ExchangeProtocol_Kind, ExternalProvider_ExchangeProtocol_Status_BaseSchema, } from "../core/commons.external-connectors-models.schemas.js";
2
+ import { ExternalProvider_ExchangeProtocol_Kind, } from "../core/commons.external-connectors-models.schemas.js";
3
3
  //===============================================================
4
4
  // Embeddings Provider
5
5
  // --------
@@ -95,8 +95,9 @@ export const EMBEDDINGS_MODEL_CATALOG = {
95
95
  providerRef: "openai",
96
96
  dims: 3072,
97
97
  // Deliberately NOT auto-selected for RAG_DEFAULT: 2× the storage + ANN cost for a quality
98
- // delta most application corpora do not need. An application that wants it overrides the
99
- // preference (or a future applicability class names the high-quality surface).
98
+ // delta most application corpora do not need. Selection is framework-owned: the public
99
+ // resolver exposes no per-application preference override. Selecting this model would
100
+ // require a framework applicability/preference change, with corpus migration implications.
100
101
  applicabilities: [],
101
102
  },
102
103
  };
@@ -182,10 +183,4 @@ export const EmbeddingsProvider_EmbedTextsOutputSchema = z.object({
182
183
  dims: z.number().int().positive(),
183
184
  usage: EmbeddingsProvider_UsageSchema,
184
185
  });
185
- // ===============================================================
186
- // STATUS
187
- // ===============================================================
188
- export const EmbeddingsProvider_StatusSchema = ExternalProvider_ExchangeProtocol_Status_BaseSchema.extend({
189
- protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.EMBEDDINGS_PROVIDER),
190
- });
191
186
  //# sourceMappingURL=embeddings.external-connectors-models.schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"embeddings.external-connectors-models.schemas.js","sourceRoot":"","sources":["../../../../src/protocols/embeddings.external-connectors-models.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAEL,sCAAsC,EAEtC,mDAAmD,GACpD,MAAM,oDAAoD,CAAA;AAE3D,iEAAiE;AACjE,sBAAsB;AACtB,WAAW;AACX,wFAAwF;AACxF,2FAA2F;AAC3F,yFAAyF;AACzF,yDAAyD;AACzD,EAAE;AACF,2FAA2F;AAC3F,+FAA+F;AAC/F,6FAA6F;AAC7F,+FAA+F;AAC/F,iGAAiG;AACjG,8DAA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G,CAAC,CAAC,MAAM,CAAC;IAC1E,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,sCAAsC,CAAC,mBAAmB,CAAC;IACnF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAGH,kEAAkE;AAClE,yBAAyB;AACzB,kEAAkE;AAElE,kFAAkF;AAClF,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/D,2EAA2E;IAC3E,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,iFAAiF;IACjF,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC;CAChD,CAAC,CAAC;AAGH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,6FAA6F;IAC7F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,0FAA0F;IAC1F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACjC,KAAK,EAAE,8BAA8B;CACtC,CAAC,CAAC;AAGH,kEAAkE;AAClE,SAAS;AACT,kEAAkE;AAElE,MAAM,CAAC,MAAM,+BAA+B,GAAG,mDAAmD,CAAC,MAAM,CAAC;IACxG,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,sCAAsC,CAAC,mBAAmB,CAAC;CACpF,CAAC,CAAC","sourcesContent":["import { z } from \"zod\"\nimport {\n ExternalProvider_ExchangeProtocol_Configuration_Base,\n ExternalProvider_ExchangeProtocol_Kind,\n ExternalProvider_ExchangeProtocol_Profile_Base,\n ExternalProvider_ExchangeProtocol_Status_BaseSchema,\n} from \"../core/commons.external-connectors-models.schemas\"\n\n//===============================================================\n// Embeddings Provider\n// --------\n// Text → vector embedding providers (OpenAI text-embedding-3, Voyage, Cohere embed, …).\n// Serves the RAG derived-data tier: the `rag:embedding-drain` worker embeds corpus chunks,\n// and retrieval (RAG plan Phase 5) embeds queries through the SAME provider seam so both\n// sides of a similarity search live in one vector space.\n//\n// Deliberately a SEPARATE protocol from `LLM_PROVIDER` (RAG plan DL2, the `IMAGE_PROVIDER`\n// precedent): its I/O is float vectors, its parameters (dimensions / batch size) share nothing\n// with LLM sampling, and — decisive — a sixth `LLMProvider_OperationKey` would fail SILENTLY\n// in every LLM consumer surface, while a new `runtimeContract.kind` fails COMPILATION at every\n// switch. It also fills its own `EngineCapability.AI_EMBEDDINGS` slot so an application can pick\n// Anthropic for chat and a different provider for embeddings.\n//===============================================================\n\n/**\n * Concrete embedding-model ids the framework knows. Ids and dimensions are published provider\n * facts (OpenAI embeddings API); the runtime additionally verifies the MEASURED dimension of\n * every returned vector against the catalog row before anything is persisted, so a wrong row\n * here fails loudly instead of poisoning a vector store.\n */\nexport enum EmbeddingsProvider_Model {\n /** OpenAI's cost-efficient embedding model — 1536 dimensions. The industry-default RAG choice. */\n OPEN_AI_TEXT_EMBEDDING_3_SMALL = \"text-embedding-3-small\",\n /** OpenAI's highest-quality embedding model — 3072 dimensions. */\n OPEN_AI_TEXT_EMBEDDING_3_LARGE = \"text-embedding-3-large\",\n}\n\n/**\n * The embeddings operation vocabulary — deliberately DISJOINT from `LLMProvider_OperationKey`\n * and `ImageProvider_OperationKey` (each protocol kind owns its own operation enum, so a key's\n * membership decides its protocol without inspection).\n *\n * Import path: `@wildo-ai/external-connectors-models`.\n *\n * (`@wildo_source` anchoring + the teaching skill are RAG-plan Phase-7 work — the\n * capability-catalog rule's DoD is deferred there deliberately, not forgotten.)\n */\nexport enum EmbeddingsProvider_OperationKey {\n /** A batch of texts → one vector per text, in input order. */\n EMBED_TEXTS = \"embeddings.embedTexts\",\n}\n\n/**\n * WHY a text is being embedded — some models embed retrieval QUERIES differently from the\n * DOCUMENTS they search over (Voyage/Cohere `input_type`; instruction-prefixed models), so the\n * caller's intent must travel with the call rather than being inferred. OpenAI `text-embedding-3-*`\n * ignores the distinction; providers that honour it translate this value at their boundary.\n *\n * A named home (semantic-string-literals rule): `'corpus'`/`'query'` are a closed vocabulary,\n * and this enum is where their semantics live.\n */\nexport enum EmbeddingsProvider_TextPurpose {\n /** The text IS retrievable content — a RAG chunk entering the corpus. */\n CORPUS = \"corpus\",\n /** The text is a SEARCH query that will be matched against corpus vectors. */\n QUERY = \"query\",\n}\n\n/**\n * @wildo_source:part:start saas.external-providers.embeddings.applicability facet:kind:api facet:audience:app-developer\n *\n * WHAT an embedding is produced FOR — the durable axis of embedding-model selection\n * (model-selection-by-applicability rule: an author names a CLASS, never a concrete model id;\n * the framework resolves the id from the catalog + preference below).\n *\n * This is ALSO the persisted `embeddingClass` stamp on every RAG chunk row: the drain worker\n * stamps the class it embedded under, and the model-migration pass re-embeds any chunk whose\n * stamped class→model binding no longer matches the current resolution — so changing the\n * preference below IS the migration trigger, with no chunk-table DDL and no call-site edits.\n *\n * NOTE both corpus AND query embedding of one retrieval surface MUST resolve through the SAME\n * class — a similarity search across two models' vector spaces is meaningless. That is why the\n * class names the SURFACE (`RAG_DEFAULT`), not the side (`purpose` carries the side).\n */\nexport enum Embeddings_Applicability {\n /** The default RAG surface: `.ragSource()` corpus chunks and the retrieval queries over them. */\n RAG_DEFAULT = \"rag-default\",\n}\n/** @wildo_source:part:end saas.external-providers.embeddings.applicability */\n\n/**\n * One row per embedding model: everything the framework knows about a concrete id.\n * Mirrors `LLM_ModelCatalogEntry`'s shape at the size this axis needs today.\n */\nexport type Embeddings_ModelCatalogEntry = {\n /** The `ref` of the provider module that serves this id. */\n providerRef: string;\n /**\n * The model's published output dimension. Load-bearing twice: the drain worker VERIFIES every\n * returned vector against it before persisting (a wrong-dims write silently poisons ANN\n * indexes), and the pgvector HNSW expression index is created per this dimension.\n */\n dims: number;\n /** FRAMEWORK OPINION — which applicability classes this model may be resolved for. */\n applicabilities: readonly Embeddings_Applicability[];\n};\n\n/**\n * THE embedding-model catalog — the single per-model fact table (the `LLM_MODEL_CATALOG`\n * discipline: an EXHAUSTIVE `Record`, so a new `EmbeddingsProvider_Model` member without a row\n * is a compile error).\n */\nexport const EMBEDDINGS_MODEL_CATALOG: Record<EmbeddingsProvider_Model, Embeddings_ModelCatalogEntry> = {\n [EmbeddingsProvider_Model.OPEN_AI_TEXT_EMBEDDING_3_SMALL]: {\n providerRef: \"openai\",\n dims: 1536,\n applicabilities: [Embeddings_Applicability.RAG_DEFAULT],\n },\n [EmbeddingsProvider_Model.OPEN_AI_TEXT_EMBEDDING_3_LARGE]: {\n providerRef: \"openai\",\n dims: 3072,\n // Deliberately NOT auto-selected for RAG_DEFAULT: 2× the storage + ANN cost for a quality\n // delta most application corpora do not need. An application that wants it overrides the\n // preference (or a future applicability class names the high-quality surface).\n applicabilities: [],\n },\n};\n\n/**\n * The framework's DEFAULT answer to \"which embedding model serves this class\", ordered by\n * preference, highest first. THIS BINDING IS THE MIGRATION KEY (RAG plan §3.d): editing it\n * changes what `resolveEmbeddingsModelForApplicability` answers, which makes every chunk stamped\n * with the previous model a migration candidate the drain worker re-embeds — bounded per run,\n * converging over runs. No agent/worker definition changes.\n */\nexport const EMBEDDINGS_MODEL_APPLICABILITY_PREFERENCE: Record<Embeddings_Applicability, readonly EmbeddingsProvider_Model[]> = {\n [Embeddings_Applicability.RAG_DEFAULT]: [\n EmbeddingsProvider_Model.OPEN_AI_TEXT_EMBEDDING_3_SMALL,\n ],\n};\n\n/** Why {@link resolveEmbeddingsModelForApplicability} could not answer — carried into a named CONFIGURATION error. */\nexport enum Embeddings_ModelResolutionFailure {\n /** The applicability has no candidate at all for this provider. */\n NO_CANDIDATE_FOR_PROVIDER = \"no_candidate_for_provider\",\n}\n\nexport type Embeddings_ModelResolution =\n | { resolved: true; model: EmbeddingsProvider_Model; entry: Embeddings_ModelCatalogEntry }\n | { resolved: false; failure: Embeddings_ModelResolutionFailure; consideredModels: readonly EmbeddingsProvider_Model[] };\n\n/**\n * Resolve an applicability class to ONE concrete embedding model for a given provider.\n *\n * Fails CLOSED and explains itself (the `resolveModelForApplicability` contract): a silent\n * fallback to some other model would fracture the vector space the class exists to keep whole.\n * The resolved `(class, model)` pair is what the RAG drain worker stamps on every chunk and what\n * its migration pass compares stamps against.\n */\nexport const resolveEmbeddingsModelForApplicability = (\n input: { applicability: Embeddings_Applicability; providerRef: string },\n catalog: Record<EmbeddingsProvider_Model, Embeddings_ModelCatalogEntry> = EMBEDDINGS_MODEL_CATALOG,\n): Embeddings_ModelResolution => {\n const candidates = EMBEDDINGS_MODEL_APPLICABILITY_PREFERENCE[input.applicability];\n const forProvider = candidates.filter((model) => {\n const entry = catalog[model];\n return entry.providerRef === input.providerRef && entry.applicabilities.includes(input.applicability);\n });\n if (forProvider.length === 0) {\n return { resolved: false, failure: Embeddings_ModelResolutionFailure.NO_CANDIDATE_FOR_PROVIDER, consideredModels: candidates };\n }\n const model = forProvider[0]!;\n return { resolved: true, model, entry: catalog[model] };\n};\n\n// ===============================================================\n// Embeddings Provider Profiles and Configurations (the config arm —\n// disjoint from LLM/image config by construction)\n// ===============================================================\n\nexport type EmbeddingsProvider_Profile = ExternalProvider_ExchangeProtocol_Profile_Base & {\n baseURL?: string,\n /** Model ids this provider serves (advertised for validation/UX). */\n supportedModels?: string[],\n}\n\nexport type EmbeddingsProvider_Configuration = ExternalProvider_ExchangeProtocol_Configuration_Base & {\n customLocation?: string,\n}\n\n// ===============================================================\n// Embeddings Operations Context\n// ===============================================================\n\n/**\n * Usage of one embedding call. There is NO completion-token dimension — an embedding consumes\n * input tokens and produces vectors, so usage-completeness for an embedding trace is judged on\n * `inputTokens` alone (H4: an embedding trace must never be flagged token-incomplete for lacking\n * completion tokens it structurally cannot have).\n */\nexport const EmbeddingsProvider_UsageSchema = z.object({\n /** Provider-reported input tokens, when the model reports them (OpenAI does). */\n inputTokens: z.number().optional(),\n});\nexport type EmbeddingsProvider_Usage = z.infer<typeof EmbeddingsProvider_UsageSchema>;\n\nexport const EmbeddingsProvider_ExecutionTransportMetadataSchema = z.object({\n protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.EMBEDDINGS_PROVIDER),\n providerRef: z.string(),\n model: z.string().optional(),\n});\nexport type EmbeddingsProvider_ExecutionTransportMetadata = z.infer<typeof EmbeddingsProvider_ExecutionTransportMetadataSchema>;\n\n// ===============================================================\n// Embeddings I/O Schemas\n// ===============================================================\n\n/** Input of the {@link EmbeddingsProvider_OperationKey.EMBED_TEXTS} operation. */\nexport const EmbeddingsProvider_EmbedTextsInputSchema = z.object({\n /** The texts to embed — one vector is returned per text, in this order. */\n texts: z.array(z.string()).min(1),\n /** Why these texts are embedded — see {@link EmbeddingsProvider_TextPurpose}. */\n purpose: z.enum(EmbeddingsProvider_TextPurpose),\n});\nexport type EmbeddingsProvider_EmbedTextsInput = z.infer<typeof EmbeddingsProvider_EmbedTextsInputSchema>;\n\n/**\n * Output of {@link EmbeddingsProvider_OperationKey.EMBED_TEXTS}. `vectors[i]` embeds `texts[i]`.\n *\n * ⚠️ PRIVACY/OBSERVABILITY CONTRACT: raw vectors are a lossy ENCODING of the source text, not\n * telemetry — they must NEVER reach analytics events, traces, or logs at any verbosity. Consumers\n * summarize (`vectorCount`, `dims`) instead; the PostHog sink's embedding arm enforces this\n * defensively even against a mis-built trace.\n */\nexport const EmbeddingsProvider_EmbedTextsOutputSchema = z.object({\n vectors: z.array(z.array(z.number())),\n /** The concrete model that produced the vectors — the chunk rows' `embeddingModel` stamp. */\n model: z.string(),\n /** The (verified) dimension every returned vector carries — the `embeddingDims` stamp. */\n dims: z.number().int().positive(),\n usage: EmbeddingsProvider_UsageSchema,\n});\nexport type EmbeddingsProvider_EmbedTextsOutput = z.infer<typeof EmbeddingsProvider_EmbedTextsOutputSchema>;\n\n// ===============================================================\n// STATUS\n// ===============================================================\n\nexport const EmbeddingsProvider_StatusSchema = ExternalProvider_ExchangeProtocol_Status_BaseSchema.extend({\n protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.EMBEDDINGS_PROVIDER),\n});\nexport type EmbeddingsProvider_Status = z.infer<typeof EmbeddingsProvider_StatusSchema>;\n"]}
1
+ {"version":3,"file":"embeddings.external-connectors-models.schemas.js","sourceRoot":"","sources":["../../../../src/protocols/embeddings.external-connectors-models.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACL,sCAAsC,GACrC,MAAM,oDAAoD,CAAA;AAE7D,iEAAiE;AACjE,sBAAsB;AACtB,WAAW;AACX,wFAAwF;AACxF,2FAA2F;AAC3F,yFAAyF;AACzF,yDAAyD;AACzD,EAAE;AACF,2FAA2F;AAC3F,+FAA+F;AAC/F,6FAA6F;AAC7F,+FAA+F;AAC/F,iGAAiG;AACjG,8DAA8D;AAC9D,iEAAiE;AAEjE;;;;;GAKG;AACH,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,kGAAkG;IAClG,qFAAyD,CAAA;IACzD,kEAAkE;IAClE,qFAAyD,CAAA;AAC3D,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,+BAGX;AAHD,WAAY,+BAA+B;IACzC,8DAA8D;IAC9D,wEAAqC,CAAA;AACvC,CAAC,EAHW,+BAA+B,KAA/B,+BAA+B,QAG1C;AAED;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,8BAKX;AALD,WAAY,8BAA8B;IACxC,yEAAyE;IACzE,mDAAiB,CAAA;IACjB,8EAA8E;IAC9E,iDAAe,CAAA;AACjB,CAAC,EALW,8BAA8B,KAA9B,8BAA8B,QAKzC;AAED;;;;;;;;;;;;;;;GAeG;AAC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AOG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,6FAA6F;IAC7F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,0FAA0F;IAC1F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACjC,KAAK,EAAE,8BAA8B;CACtC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\"\nimport {\n ExternalProvider_ExchangeProtocol_Kind,\n } from \"../core/commons.external-connectors-models.schemas\"\n\n//===============================================================\n// Embeddings Provider\n// --------\n// Text → vector embedding providers (OpenAI text-embedding-3, Voyage, Cohere embed, …).\n// Serves the RAG derived-data tier: the `rag:embedding-drain` worker embeds corpus chunks,\n// and retrieval (RAG plan Phase 5) embeds queries through the SAME provider seam so both\n// sides of a similarity search live in one vector space.\n//\n// Deliberately a SEPARATE protocol from `LLM_PROVIDER` (RAG plan DL2, the `IMAGE_PROVIDER`\n// precedent): its I/O is float vectors, its parameters (dimensions / batch size) share nothing\n// with LLM sampling, and — decisive — a sixth `LLMProvider_OperationKey` would fail SILENTLY\n// in every LLM consumer surface, while a new `runtimeContract.kind` fails COMPILATION at every\n// switch. It also fills its own `EngineCapability.AI_EMBEDDINGS` slot so an application can pick\n// Anthropic for chat and a different provider for embeddings.\n//===============================================================\n\n/**\n * Concrete embedding-model ids the framework knows. Ids and dimensions are published provider\n * facts (OpenAI embeddings API); the runtime additionally verifies the MEASURED dimension of\n * every returned vector against the catalog row before anything is persisted, so a wrong row\n * here fails loudly instead of poisoning a vector store.\n */\nexport enum EmbeddingsProvider_Model {\n /** OpenAI's cost-efficient embedding model — 1536 dimensions. The industry-default RAG choice. */\n OPEN_AI_TEXT_EMBEDDING_3_SMALL = \"text-embedding-3-small\",\n /** OpenAI's highest-quality embedding model — 3072 dimensions. */\n OPEN_AI_TEXT_EMBEDDING_3_LARGE = \"text-embedding-3-large\",\n}\n\n/**\n * The embeddings operation vocabulary — deliberately DISJOINT from `LLMProvider_OperationKey`\n * and `ImageProvider_OperationKey` (each protocol kind owns its own operation enum, so a key's\n * membership decides its protocol without inspection).\n *\n * Import path: `@wildo-ai/external-connectors-models`.\n *\n * (`@wildo_source` anchoring + the teaching skill are RAG-plan Phase-7 work — the\n * capability-catalog rule's DoD is deferred there deliberately, not forgotten.)\n */\nexport enum EmbeddingsProvider_OperationKey {\n /** A batch of texts → one vector per text, in input order. */\n EMBED_TEXTS = \"embeddings.embedTexts\",\n}\n\n/**\n * WHY a text is being embedded — some models embed retrieval QUERIES differently from the\n * DOCUMENTS they search over (Voyage/Cohere `input_type`; instruction-prefixed models), so the\n * caller's intent must travel with the call rather than being inferred. OpenAI `text-embedding-3-*`\n * ignores the distinction; providers that honour it translate this value at their boundary.\n *\n * A named home (semantic-string-literals rule): `'corpus'`/`'query'` are a closed vocabulary,\n * and this enum is where their semantics live.\n */\nexport enum EmbeddingsProvider_TextPurpose {\n /** The text IS retrievable content — a RAG chunk entering the corpus. */\n CORPUS = \"corpus\",\n /** The text is a SEARCH query that will be matched against corpus vectors. */\n QUERY = \"query\",\n}\n\n/**\n * @wildo_source:part:start saas.external-providers.embeddings.applicability facet:kind:api facet:audience:app-developer\n *\n * WHAT an embedding is produced FOR — the durable axis of embedding-model selection\n * (model-selection-by-applicability rule: an author names a CLASS, never a concrete model id;\n * the framework resolves the id from the catalog + preference below).\n *\n * This is ALSO the persisted `embeddingClass` stamp on every RAG chunk row: the drain worker\n * stamps the class it embedded under, and the model-migration pass re-embeds any chunk whose\n * stamped class→model binding no longer matches the current resolution — so changing the\n * preference below IS the migration trigger, with no chunk-table DDL and no call-site edits.\n *\n * NOTE both corpus AND query embedding of one retrieval surface MUST resolve through the SAME\n * class — a similarity search across two models' vector spaces is meaningless. That is why the\n * class names the SURFACE (`RAG_DEFAULT`), not the side (`purpose` carries the side).\n */\nexport enum Embeddings_Applicability {\n /** The default RAG surface: `.ragSource()` corpus chunks and the retrieval queries over them. */\n RAG_DEFAULT = \"rag-default\",\n}\n/** @wildo_source:part:end saas.external-providers.embeddings.applicability */\n\n/**\n * One row per embedding model: everything the framework knows about a concrete id.\n * Mirrors `LLM_ModelCatalogEntry`'s shape at the size this axis needs today.\n */\nexport type Embeddings_ModelCatalogEntry = {\n /** The `ref` of the provider module that serves this id. */\n providerRef: string;\n /**\n * The model's published output dimension. Load-bearing twice: the drain worker VERIFIES every\n * returned vector against it before persisting (a wrong-dims write silently poisons ANN\n * indexes), and the pgvector HNSW expression index is created per this dimension.\n */\n dims: number;\n /** FRAMEWORK OPINION — which applicability classes this model may be resolved for. */\n applicabilities: readonly Embeddings_Applicability[];\n};\n\n/**\n * THE embedding-model catalog — the single per-model fact table (the `LLM_MODEL_CATALOG`\n * discipline: an EXHAUSTIVE `Record`, so a new `EmbeddingsProvider_Model` member without a row\n * is a compile error).\n */\nexport const EMBEDDINGS_MODEL_CATALOG: Record<EmbeddingsProvider_Model, Embeddings_ModelCatalogEntry> = {\n [EmbeddingsProvider_Model.OPEN_AI_TEXT_EMBEDDING_3_SMALL]: {\n providerRef: \"openai\",\n dims: 1536,\n applicabilities: [Embeddings_Applicability.RAG_DEFAULT],\n },\n [EmbeddingsProvider_Model.OPEN_AI_TEXT_EMBEDDING_3_LARGE]: {\n providerRef: \"openai\",\n dims: 3072,\n // Deliberately NOT auto-selected for RAG_DEFAULT: 2× the storage + ANN cost for a quality\n // delta most application corpora do not need. Selection is framework-owned: the public\n // resolver exposes no per-application preference override. Selecting this model would\n // require a framework applicability/preference change, with corpus migration implications.\n applicabilities: [],\n },\n};\n\n/**\n * The framework's DEFAULT answer to \"which embedding model serves this class\", ordered by\n * preference, highest first. THIS BINDING IS THE MIGRATION KEY (RAG plan §3.d): editing it\n * changes what `resolveEmbeddingsModelForApplicability` answers, which makes every chunk stamped\n * with the previous model a migration candidate the drain worker re-embeds — bounded per run,\n * converging over runs. No agent/worker definition changes.\n */\nexport const EMBEDDINGS_MODEL_APPLICABILITY_PREFERENCE: Record<Embeddings_Applicability, readonly EmbeddingsProvider_Model[]> = {\n [Embeddings_Applicability.RAG_DEFAULT]: [\n EmbeddingsProvider_Model.OPEN_AI_TEXT_EMBEDDING_3_SMALL,\n ],\n};\n\n/** Why {@link resolveEmbeddingsModelForApplicability} could not answer — carried into a named CONFIGURATION error. */\nexport enum Embeddings_ModelResolutionFailure {\n /** The applicability has no candidate at all for this provider. */\n NO_CANDIDATE_FOR_PROVIDER = \"no_candidate_for_provider\",\n}\n\nexport type Embeddings_ModelResolution =\n | { resolved: true; model: EmbeddingsProvider_Model; entry: Embeddings_ModelCatalogEntry }\n | { resolved: false; failure: Embeddings_ModelResolutionFailure; consideredModels: readonly EmbeddingsProvider_Model[] };\n\n/**\n * Resolve an applicability class to ONE concrete embedding model for a given provider.\n *\n * Fails CLOSED and explains itself (the `resolveModelForApplicability` contract): a silent\n * fallback to some other model would fracture the vector space the class exists to keep whole.\n * The resolved `(class, model)` pair is what the RAG drain worker stamps on every chunk and what\n * its migration pass compares stamps against.\n */\nexport const resolveEmbeddingsModelForApplicability = (\n input: { applicability: Embeddings_Applicability; providerRef: string },\n catalog: Record<EmbeddingsProvider_Model, Embeddings_ModelCatalogEntry> = EMBEDDINGS_MODEL_CATALOG,\n): Embeddings_ModelResolution => {\n const candidates = EMBEDDINGS_MODEL_APPLICABILITY_PREFERENCE[input.applicability];\n const forProvider = candidates.filter((model) => {\n const entry = catalog[model];\n return entry.providerRef === input.providerRef && entry.applicabilities.includes(input.applicability);\n });\n if (forProvider.length === 0) {\n return { resolved: false, failure: Embeddings_ModelResolutionFailure.NO_CANDIDATE_FOR_PROVIDER, consideredModels: candidates };\n }\n const model = forProvider[0]!;\n return { resolved: true, model, entry: catalog[model] };\n};\n\n// ===============================================================\n// Embeddings Operations Context\n// ===============================================================\n\n/**\n * Usage of one embedding call. There is NO completion-token dimension — an embedding consumes\n * input tokens and produces vectors, so usage-completeness for an embedding trace is judged on\n * `inputTokens` alone (H4: an embedding trace must never be flagged token-incomplete for lacking\n * completion tokens it structurally cannot have).\n */\nexport const EmbeddingsProvider_UsageSchema = z.object({\n /** Provider-reported input tokens, when the model reports them (OpenAI does). */\n inputTokens: z.number().optional(),\n});\nexport type EmbeddingsProvider_Usage = z.infer<typeof EmbeddingsProvider_UsageSchema>;\n\nexport const EmbeddingsProvider_ExecutionTransportMetadataSchema = z.object({\n protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.EMBEDDINGS_PROVIDER),\n providerRef: z.string(),\n model: z.string().optional(),\n});\nexport type EmbeddingsProvider_ExecutionTransportMetadata = z.infer<typeof EmbeddingsProvider_ExecutionTransportMetadataSchema>;\n\n// ===============================================================\n// Embeddings I/O Schemas\n// ===============================================================\n\n/** Input of the {@link EmbeddingsProvider_OperationKey.EMBED_TEXTS} operation. */\nexport const EmbeddingsProvider_EmbedTextsInputSchema = z.object({\n /** The texts to embed — one vector is returned per text, in this order. */\n texts: z.array(z.string()).min(1),\n /** Why these texts are embedded — see {@link EmbeddingsProvider_TextPurpose}. */\n purpose: z.enum(EmbeddingsProvider_TextPurpose),\n});\nexport type EmbeddingsProvider_EmbedTextsInput = z.infer<typeof EmbeddingsProvider_EmbedTextsInputSchema>;\n\n/**\n * Output of {@link EmbeddingsProvider_OperationKey.EMBED_TEXTS}. `vectors[i]` embeds `texts[i]`.\n *\n * ⚠️ PRIVACY/OBSERVABILITY CONTRACT: raw vectors are a lossy ENCODING of the source text, not\n * telemetry — they must NEVER reach analytics events, traces, or logs at any verbosity. Consumers\n * summarize (`vectorCount`, `dims`) instead; the PostHog sink's embedding arm enforces this\n * defensively even against a mis-built trace.\n */\nexport const EmbeddingsProvider_EmbedTextsOutputSchema = z.object({\n vectors: z.array(z.array(z.number())),\n /** The concrete model that produced the vectors — the chunk rows' `embeddingModel` stamp. */\n model: z.string(),\n /** The (verified) dimension every returned vector carries — the `embeddingDims` stamp. */\n dims: z.number().int().positive(),\n usage: EmbeddingsProvider_UsageSchema,\n});\nexport type EmbeddingsProvider_EmbedTextsOutput = z.infer<typeof EmbeddingsProvider_EmbedTextsOutputSchema>;\n\n"]}
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Standard File Storage Adapter Interface (#1674)
3
+ * --------
4
+ * The contract a PROVIDER implements so a file storage whose bytes live at a vendor — a person's
5
+ * OneDrive, an organization's SharePoint library, a Dropbox folder — can be contributed by a package
6
+ * instead of being wired into the engine.
7
+ *
8
+ * ## Why it lives here, below the backend library
9
+ *
10
+ * The engine's storage contract (`IFileStorageProvider` in `@wildo-ai/saas-backend-lib`) takes the
11
+ * backend library's `ExecutionContext`. A provider package depends on
12
+ * `@wildo-ai/external-connectors-private`, which `saas-backend-lib` itself depends on, so a package
13
+ * could not implement that interface without a dependency edge pointing the wrong way — the same
14
+ * constraint billing met in #336. This contract sits in `@wildo-ai/external-connectors-models`, below
15
+ * both sides, and deliberately knows nothing about execution contexts, tenants or stored credentials:
16
+ * an adapter receives the ACCESS the engine resolved for one call and the file identifiers, and does
17
+ * the vendor's half of the work.
18
+ *
19
+ * The engine wraps every contributed adapter in its own `IFileStorageProvider`, which keeps everything
20
+ * an adapter must not decide for itself: which grant a file is read through (the person who linked or
21
+ * uploaded it, or the file's organization), the recorded credential use naming the connection and the
22
+ * contributing package, input validation and size limits, and the mapping of a vendor failure onto the
23
+ * application's error vocabulary.
24
+ *
25
+ * ## What it rejects, on purpose
26
+ *
27
+ * Supersedes #336's decision D10 ("file storage stays a separate registry, revisited when a storage
28
+ * vendor package is actually wanted"): Microsoft storage is now wanted from a package. The rejected
29
+ * alternative was #336's billing pattern — a registry of ENGINE-shipped adapters keyed by a declared
30
+ * name — because it keeps the implementation in the engine and so can never admit a package's adapter.
31
+ *
32
+ * The storage VOCABULARY stays closed. An adapter serves a member of `FileStorageAccepted` the engine
33
+ * already declares; it never adds a member. A declared member nothing serves remains a startup refusal.
34
+ */
35
+ import type { FileStorageAccepted } from '@wildo-ai/zod-decorators';
36
+ import type { ExternalProvider_Connection_OwnerScope } from '../core/security.external-connectors-models.schemas';
37
+ /** @wildo_source:part:start external-connectors.models.file-storage-adapter facet:kind:api facet:audience:app-developer */
38
+ /**
39
+ * WHOSE grant a file in this storage is read and written through. A subset of the connection owner
40
+ * vocabulary, not a new one: a vendor storage is reachable through a person's connection or an
41
+ * organization's, never through the application's own account (the application's own bytes live in the
42
+ * framework's storages).
43
+ *
44
+ * - `USER` — the person who LINKED or UPLOADED the file (the row's `uploadedBy`). Another reader still
45
+ * reads it: the application authorizes the ROW, and the storage reads the BYTES as that person.
46
+ * - `ORGANIZATION` — the organization the file belongs to (the row's `organizationId`, which only an
47
+ * organization-scoped file carries).
48
+ *
49
+ * Both are already on the file row, which is what lets erasure and retention reach a file held in
50
+ * someone's own drive.
51
+ */
52
+ export type ProviderFileStorageGrantOwner = ExternalProvider_Connection_OwnerScope.USER | ExternalProvider_Connection_OwnerScope.ORGANIZATION;
53
+ /** What removing a file's row does to the bytes at the vendor. */
54
+ export declare enum ProviderFileStorageDeleteBehavior {
55
+ /** The bytes are the application's, kept at the vendor on its behalf: `delete` removes them. */
56
+ REMOVES_BYTES = "REMOVES_BYTES",
57
+ /**
58
+ * The bytes are the owner's own document (a person's file they linked): `delete` forgets the
59
+ * reference and never calls the vendor. Deleting someone's document because an application row went
60
+ * away is an irreversible act that needs a deliberate door of its own.
61
+ */
62
+ FORGETS_REFERENCE = "FORGETS_REFERENCE"
63
+ }
64
+ /** Why an adapter could not do what it was asked. The engine maps each to its own error type. */
65
+ export declare enum ProviderFileStorageFailureKind {
66
+ /** The vendor knows no such file for this grant. */
67
+ NOT_FOUND = "NOT_FOUND",
68
+ /** The vendor refused the grant for this file (revoked, insufficient scope, not shared with the owner). */
69
+ ACCESS_DENIED = "ACCESS_DENIED",
70
+ /** The reference cannot be a file here (a folder, a vendor-native document with no bytes, a malformed id). */
71
+ INVALID_REFERENCE = "INVALID_REFERENCE",
72
+ /** The vendor failed or could not be reached. */
73
+ VENDOR_FAILURE = "VENDOR_FAILURE"
74
+ }
75
+ /**
76
+ * The failure an adapter throws. Anything else an adapter throws is treated as `VENDOR_FAILURE`, so a
77
+ * vendor SDK's own error never reaches a person as an unexplained 500.
78
+ */
79
+ export declare class ProviderFileStorageFailure extends Error {
80
+ readonly kind: ProviderFileStorageFailureKind;
81
+ /**
82
+ * The HTTP status the vendor answered with, when it answered. Recorded on the outbound record, so a reviewer
83
+ * can tell a vendor that refused from one that never answered. Leave it out when nothing came back.
84
+ */
85
+ readonly status?: number;
86
+ constructor(kind: ProviderFileStorageFailureKind, message: string, options?: {
87
+ readonly status?: number;
88
+ });
89
+ }
90
+ /**
91
+ * The access the engine resolved for ONE call: the delegated token of the grant the file lives under.
92
+ * Resolved, recorded as a credential use and handed over per call, so an adapter never holds a
93
+ * credential between calls and never chooses whose it is.
94
+ */
95
+ export interface ProviderFileStorageAccess {
96
+ readonly accessToken: string;
97
+ }
98
+ /** What the vendor says about one file. */
99
+ export interface ProviderFileStorageDescription {
100
+ /** The vendor's display name for the file. */
101
+ readonly name: string;
102
+ readonly contentType: string;
103
+ /** Size in bytes. A vendor-native document with no bytes cannot be described: throw `INVALID_REFERENCE`. */
104
+ readonly size: number;
105
+ readonly etag?: string;
106
+ readonly lastModified?: Date;
107
+ }
108
+ export interface ProviderFileStorageUploadRequest {
109
+ readonly access: ProviderFileStorageAccess;
110
+ /** The application's id for the file — stable, never shown to a person. */
111
+ readonly fileId: string;
112
+ /** The name to give the file at the vendor. */
113
+ readonly fileName: string;
114
+ readonly contentType: string;
115
+ /** The size the engine already validated against the application's limit. */
116
+ readonly size: number;
117
+ /** The bytes, streamed. Already bounded by the engine. */
118
+ readonly body: AsyncIterable<Uint8Array>;
119
+ }
120
+ export interface ProviderFileStorageReferenceRequest {
121
+ readonly access: ProviderFileStorageAccess;
122
+ /** The vendor's id for the file, as `upload` returned it or a picker linked it. */
123
+ readonly storageRef: string;
124
+ }
125
+ export interface ProviderFileStorageDownload {
126
+ readonly body: AsyncIterable<Uint8Array>;
127
+ readonly contentType: string;
128
+ readonly size: number;
129
+ readonly etag?: string;
130
+ readonly lastModified?: Date;
131
+ }
132
+ /**
133
+ * A file storage a provider contributes. Declared on the provider's backend module
134
+ * (`fileStorageAdapters`); the grant it spends is ITS OWN provider's connection — a module cannot
135
+ * point an adapter at another provider's grant — so a package whose ref belongs to a declared shared
136
+ * connection (`microsoft`, #1725) stores through that one connection.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * export const oneDriveStorage: ProviderFileStorageAdapter = {
141
+ * storage: FileStorageAccepted.ONEDRIVE,
142
+ * grantOwner: ExternalProvider_Connection_OwnerScope.USER,
143
+ * deleteBehavior: ProviderFileStorageDeleteBehavior.FORGETS_REFERENCE,
144
+ * acceptsRemoteReferences: true,
145
+ * upload: async ({ access, fileName, body }) => ({ storageRef: await putDriveItem(access, fileName, body) }),
146
+ * download: async ({ access, storageRef }) => getDriveItemContent(access, storageRef),
147
+ * describe: async ({ access, storageRef }) => getDriveItem(access, storageRef),
148
+ * delete: async () => undefined,
149
+ * };
150
+ * ```
151
+ */
152
+ export interface ProviderFileStorageAdapter {
153
+ /**
154
+ * The declared storage member this adapter serves. Exactly one adapter may serve a member.
155
+ *
156
+ * Typed as the member's VALUE (`'onedrive'`) rather than the `@wildo-ai/zod-decorators` enum, so a provider package
157
+ * names it through the vocabulary it can already reach — `FileStorageAccepted.ONEDRIVE` from `@wildo-ai/saas-models`,
158
+ * whose members are held equal to the enum's — without taking a dependency on the decorator package. The set stays
159
+ * closed: the engine refuses a value that is not a member when it admits the adapter.
160
+ */
161
+ readonly storage: `${FileStorageAccepted}`;
162
+ readonly grantOwner: ProviderFileStorageGrantOwner;
163
+ readonly deleteBehavior: ProviderFileStorageDeleteBehavior;
164
+ /**
165
+ * Whether a person may LINK a file that already exists at the vendor (a picker's
166
+ * `REMOTE_REFERENCE`). When true, the engine describes the reference through the linker's grant
167
+ * before a row is created — which is also the proof the reference is real and reachable by them.
168
+ */
169
+ readonly acceptsRemoteReferences: boolean;
170
+ upload(request: ProviderFileStorageUploadRequest): Promise<{
171
+ readonly storageRef: string;
172
+ }>;
173
+ download(request: ProviderFileStorageReferenceRequest): Promise<ProviderFileStorageDownload>;
174
+ describe(request: ProviderFileStorageReferenceRequest): Promise<ProviderFileStorageDescription>;
175
+ /** Called only when `deleteBehavior` is `REMOVES_BYTES`. */
176
+ delete(request: ProviderFileStorageReferenceRequest): Promise<void>;
177
+ }
178
+ /** @wildo_source:part:end external-connectors.models.file-storage-adapter */
179
+ //# sourceMappingURL=file-storage.standard-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-storage.standard-interface.d.ts","sourceRoot":"","sources":["../../../../src/protocols/file-storage.standard-interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,qDAAqD,CAAC;AAElH,2HAA2H;AAE3H;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,6BAA6B,GACrC,sCAAsC,CAAC,IAAI,GAC3C,sCAAsC,CAAC,YAAY,CAAC;AAExD,kEAAkE;AAClE,oBAAY,iCAAiC;IAC3C,gGAAgG;IAChG,aAAa,kBAAkB;IAC/B;;;;OAIG;IACH,iBAAiB,sBAAsB;CACxC;AAED,iGAAiG;AACjG,oBAAY,8BAA8B;IACxC,oDAAoD;IACpD,SAAS,cAAc;IACvB,2GAA2G;IAC3G,aAAa,kBAAkB;IAC/B,8GAA8G;IAC9G,iBAAiB,sBAAsB;IACvC,iDAAiD;IACjD,cAAc,mBAAmB;CAClC;AAED;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,EAAE,8BAA8B,CAAC;IAC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AAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,6BAA6B,CAAC;IACnD,QAAQ,CAAC,cAAc,EAAE,iCAAiC,CAAC;IAC3D;;;;OAIG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,MAAM,CAAC,OAAO,EAAE,gCAAgC,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5F,QAAQ,CAAC,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC7F,QAAQ,CAAC,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAChG,4DAA4D;IAC5D,MAAM,CAAC,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,6EAA6E"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Standard File Storage Adapter Interface (#1674)
3
+ * --------
4
+ * The contract a PROVIDER implements so a file storage whose bytes live at a vendor — a person's
5
+ * OneDrive, an organization's SharePoint library, a Dropbox folder — can be contributed by a package
6
+ * instead of being wired into the engine.
7
+ *
8
+ * ## Why it lives here, below the backend library
9
+ *
10
+ * The engine's storage contract (`IFileStorageProvider` in `@wildo-ai/saas-backend-lib`) takes the
11
+ * backend library's `ExecutionContext`. A provider package depends on
12
+ * `@wildo-ai/external-connectors-private`, which `saas-backend-lib` itself depends on, so a package
13
+ * could not implement that interface without a dependency edge pointing the wrong way — the same
14
+ * constraint billing met in #336. This contract sits in `@wildo-ai/external-connectors-models`, below
15
+ * both sides, and deliberately knows nothing about execution contexts, tenants or stored credentials:
16
+ * an adapter receives the ACCESS the engine resolved for one call and the file identifiers, and does
17
+ * the vendor's half of the work.
18
+ *
19
+ * The engine wraps every contributed adapter in its own `IFileStorageProvider`, which keeps everything
20
+ * an adapter must not decide for itself: which grant a file is read through (the person who linked or
21
+ * uploaded it, or the file's organization), the recorded credential use naming the connection and the
22
+ * contributing package, input validation and size limits, and the mapping of a vendor failure onto the
23
+ * application's error vocabulary.
24
+ *
25
+ * ## What it rejects, on purpose
26
+ *
27
+ * Supersedes #336's decision D10 ("file storage stays a separate registry, revisited when a storage
28
+ * vendor package is actually wanted"): Microsoft storage is now wanted from a package. The rejected
29
+ * alternative was #336's billing pattern — a registry of ENGINE-shipped adapters keyed by a declared
30
+ * name — because it keeps the implementation in the engine and so can never admit a package's adapter.
31
+ *
32
+ * The storage VOCABULARY stays closed. An adapter serves a member of `FileStorageAccepted` the engine
33
+ * already declares; it never adds a member. A declared member nothing serves remains a startup refusal.
34
+ */
35
+ /** What removing a file's row does to the bytes at the vendor. */
36
+ export var ProviderFileStorageDeleteBehavior;
37
+ (function (ProviderFileStorageDeleteBehavior) {
38
+ /** The bytes are the application's, kept at the vendor on its behalf: `delete` removes them. */
39
+ ProviderFileStorageDeleteBehavior["REMOVES_BYTES"] = "REMOVES_BYTES";
40
+ /**
41
+ * The bytes are the owner's own document (a person's file they linked): `delete` forgets the
42
+ * reference and never calls the vendor. Deleting someone's document because an application row went
43
+ * away is an irreversible act that needs a deliberate door of its own.
44
+ */
45
+ ProviderFileStorageDeleteBehavior["FORGETS_REFERENCE"] = "FORGETS_REFERENCE";
46
+ })(ProviderFileStorageDeleteBehavior || (ProviderFileStorageDeleteBehavior = {}));
47
+ /** Why an adapter could not do what it was asked. The engine maps each to its own error type. */
48
+ export var ProviderFileStorageFailureKind;
49
+ (function (ProviderFileStorageFailureKind) {
50
+ /** The vendor knows no such file for this grant. */
51
+ ProviderFileStorageFailureKind["NOT_FOUND"] = "NOT_FOUND";
52
+ /** The vendor refused the grant for this file (revoked, insufficient scope, not shared with the owner). */
53
+ ProviderFileStorageFailureKind["ACCESS_DENIED"] = "ACCESS_DENIED";
54
+ /** The reference cannot be a file here (a folder, a vendor-native document with no bytes, a malformed id). */
55
+ ProviderFileStorageFailureKind["INVALID_REFERENCE"] = "INVALID_REFERENCE";
56
+ /** The vendor failed or could not be reached. */
57
+ ProviderFileStorageFailureKind["VENDOR_FAILURE"] = "VENDOR_FAILURE";
58
+ })(ProviderFileStorageFailureKind || (ProviderFileStorageFailureKind = {}));
59
+ /**
60
+ * The failure an adapter throws. Anything else an adapter throws is treated as `VENDOR_FAILURE`, so a
61
+ * vendor SDK's own error never reaches a person as an unexplained 500.
62
+ */
63
+ export class ProviderFileStorageFailure extends Error {
64
+ kind;
65
+ /**
66
+ * The HTTP status the vendor answered with, when it answered. Recorded on the outbound record, so a reviewer
67
+ * can tell a vendor that refused from one that never answered. Leave it out when nothing came back.
68
+ */
69
+ status;
70
+ constructor(kind, message, options) {
71
+ super(message);
72
+ this.name = 'ProviderFileStorageFailure';
73
+ this.kind = kind;
74
+ if (options?.status !== undefined)
75
+ this.status = options.status;
76
+ }
77
+ }
78
+ /** @wildo_source:part:end external-connectors.models.file-storage-adapter */
79
+ //# sourceMappingURL=file-storage.standard-interface.js.map