@wildo-ai/external-connectors-models 1.1.10 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/core/commons.external-connectors-models.schemas.d.ts +140 -0
- package/dist/esm/core/commons.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/commons.external-connectors-models.schemas.js +203 -0
- package/dist/esm/core/commons.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/oauth2.enums.d.ts.map +1 -1
- package/dist/esm/core/oauth2.enums.js.map +1 -1
- package/dist/esm/core/operation-classification.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/operation-classification.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/operations.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.d.ts +4 -2
- package/dist/esm/core/security.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.js +10 -4
- package/dist/esm/core/security.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts +9 -42
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js +31 -1
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/billing.standard-interface.schemas.d.ts +64 -3
- package/dist/esm/protocols/billing.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/billing.standard-interface.schemas.js +23 -2
- package/dist/esm/protocols/billing.standard-interface.schemas.js.map +1 -1
- package/dist/esm/protocols/content-safety.external-connectors-models.schemas.d.ts +150 -0
- package/dist/esm/protocols/content-safety.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/content-safety.external-connectors-models.schemas.js +182 -0
- package/dist/esm/protocols/content-safety.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts +41 -9
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js +40 -14
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/electronic-signature.external-connectors-models.schemas.d.ts +157 -0
- package/dist/esm/protocols/electronic-signature.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/electronic-signature.external-connectors-models.schemas.js +134 -0
- package/dist/esm/protocols/electronic-signature.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/email-inbound.standard-interface.schemas.d.ts +85 -0
- package/dist/esm/protocols/email-inbound.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/email-inbound.standard-interface.schemas.js +46 -2
- package/dist/esm/protocols/email-inbound.standard-interface.schemas.js.map +1 -1
- package/dist/esm/protocols/email.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/email.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/email.standard-interface.schemas.js +4 -0
- package/dist/esm/protocols/email.standard-interface.schemas.js.map +1 -1
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts +86 -10
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js +146 -7
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/file-storage.standard-interface.d.ts +14 -1
- package/dist/esm/protocols/file-storage.standard-interface.d.ts.map +1 -1
- package/dist/esm/protocols/file-storage.standard-interface.js +6 -0
- package/dist/esm/protocols/file-storage.standard-interface.js.map +1 -1
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/graphql-operations.external-connectors-models.schemas.d.ts +254 -0
- package/dist/esm/protocols/graphql-operations.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/graphql-operations.external-connectors-models.schemas.js +480 -0
- package/dist/esm/protocols/graphql-operations.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.d.ts +7 -2
- package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts +482 -7
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.js +348 -0
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/image.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts +165 -8
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js +243 -20
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/oauth2-provider-assurance.definitions.js.map +1 -1
- package/dist/esm/protocols/oauth2-provider-assurance.schemas.js.map +1 -1
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/provider-configuration-authoring.external-connectors-models.schemas.d.ts +52 -0
- package/dist/esm/protocols/provider-configuration-authoring.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/provider-configuration-authoring.external-connectors-models.schemas.js +132 -0
- package/dist/esm/protocols/provider-configuration-authoring.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/provider-connection-parameters.external-connectors-models.d.ts +111 -0
- package/dist/esm/protocols/provider-connection-parameters.external-connectors-models.d.ts.map +1 -0
- package/dist/esm/protocols/provider-connection-parameters.external-connectors-models.js +203 -0
- package/dist/esm/protocols/provider-connection-parameters.external-connectors-models.js.map +1 -0
- package/dist/esm/protocols/provider-oauth2-token-endpoint-hosts.external-connectors-models.d.ts +6 -0
- package/dist/esm/protocols/provider-oauth2-token-endpoint-hosts.external-connectors-models.d.ts.map +1 -1
- package/dist/esm/protocols/provider-oauth2-token-endpoint-hosts.external-connectors-models.js +13 -7
- package/dist/esm/protocols/provider-oauth2-token-endpoint-hosts.external-connectors-models.js.map +1 -1
- package/dist/esm/protocols/provider-vendor-registration.external-connectors-models.d.ts +50 -0
- package/dist/esm/protocols/provider-vendor-registration.external-connectors-models.d.ts.map +1 -0
- package/dist/esm/protocols/provider-vendor-registration.external-connectors-models.js +30 -0
- package/dist/esm/protocols/provider-vendor-registration.external-connectors-models.js.map +1 -0
- package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.d.ts +1165 -11
- package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.js +1217 -9
- package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/service-account-token.external-connectors-models.schemas.d.ts +73 -0
- package/dist/esm/protocols/service-account-token.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/service-account-token.external-connectors-models.schemas.js +82 -0
- package/dist/esm/protocols/service-account-token.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/sms.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.d.ts +79 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.js +93 -0
- package/dist/esm/protocols/sms.standard-interface.schemas.js.map +1 -1
- package/dist/esm/protocols/subject-erasure-effect.standard-interface.d.ts +133 -0
- package/dist/esm/protocols/subject-erasure-effect.standard-interface.d.ts.map +1 -0
- package/dist/esm/protocols/subject-erasure-effect.standard-interface.js +61 -0
- package/dist/esm/protocols/subject-erasure-effect.standard-interface.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/esm/.native.tsbuildinfo +0 -1
|
@@ -115,6 +115,10 @@ export const StandardEmail_SendResponseSchema = z.object({
|
|
|
115
115
|
/**
|
|
116
116
|
* Provider-declared detail explaining its explicit classification, including
|
|
117
117
|
* semantic rejection or an ambiguous idempotency/processing conflict.
|
|
118
|
+
*
|
|
119
|
+
* CONTENT-FREE: the vendor's own code or error name, never the vendor's message, which routinely quotes the refused
|
|
120
|
+
* address or the payload. The engine logs this text and returns it in batch results, and a log outlives an erasure
|
|
121
|
+
* (#2251).
|
|
118
122
|
*/
|
|
119
123
|
providerError: z.string().min(1).optional(),
|
|
120
124
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.standard-interface.schemas.js","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;AAE7I,iEAAiE;AACjE,2BAA2B;AAC3B,WAAW;AACX,qEAAqE;AACrE,gEAAgE;AAChE,+BAA+B;AAC/B,EAAE;AACF,qBAAqB;AACrB,uDAAuD;AACvD,gEAAgE;AAChE,yEAAyE;AACzE,iEAAiE;AAEjE,kEAAkE;AAClE,yBAAyB;AACzB,kEAAkE;AAElE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAIH,kEAAkE;AAClE,sBAAsB;AACtB,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CAAC;IAC7D,YAAY,EAAE,CAAC,wBAAwB,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,kBAAkB,CAAC;IACxG,UAAU,EAAE,CAAC,wBAAwB,CAAC,wBAAwB,CAAC;CACvD,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { EmailProvider_Capability, EmailProvider_EmailType, EmailProvider_DeliveryStatus } from \"./email.external-connectors-models.schemas\";\n\n//===============================================================\n// Standard Email Interface\n// --------\n// This is the canonical interface that Wildo uses internally to send\n// emails. The ETL layer transforms these standard requests into\n// provider-specific API calls.\n//\n// Design Principles:\n// 1. Provider-agnostic - works with any email provider\n// 2. Capability-aware - validates against provider capabilities\n// 3. Extensible - new fields can be added without breaking existing code\n//===============================================================\n\n// ===============================================================\n// Standard Email Address\n// ===============================================================\n\nexport const StandardEmail_AddressSchema = z.object({\n email: z.email(),\n name: z.string().optional(),\n});\n\nexport type StandardEmail_Address = z.infer<typeof StandardEmail_AddressSchema>;\n\n// ===============================================================\n// Standard Attachment\n// ===============================================================\n\nexport const StandardEmail_AttachmentSchema = z.object({\n filename: z.string().min(1),\n content: z.string(), // Base64 encoded\n contentType: z.string().optional(),\n contentId: z.string().optional(), // For inline images (cid:)\n});\n\nexport type StandardEmail_Attachment = z.infer<typeof StandardEmail_AttachmentSchema>;\n\n/**\n * Wire encoding used by a network email provider gateway.\n *\n * This vocabulary is deliberately closed and explicit on every provider\n * contract: JSON and multipart data require materially different headers and\n * serialization. There is no implicit default.\n */\nexport enum EmailProviderPayloadEncoding {\n JSON = \"json\",\n MULTIPART_FORM_DATA = \"multipart-form-data\",\n}\n\n/** Provider acknowledgement state returned by a synchronous send endpoint. */\nexport enum EmailProviderSubmissionStatus {\n QUEUED = \"queued\",\n SENT = \"sent\",\n SCHEDULED = \"scheduled\",\n}\n\n/** Provider-owned classification for HTTP responses whose status is ambiguous. */\nexport enum EmailProviderSubmissionClassification {\n ACCEPTED = \"accepted\",\n REJECTED = \"rejected\",\n ACCEPTANCE_UNKNOWN = \"acceptance_unknown\",\n}\n\n// ===============================================================\n// TRANSACTIONAL: Send Email Request\n// ===============================================================\n\nexport const StandardEmail_SendRequestSchema = z.object({\n /**\n * Stable identity of ONE logical provider submission across retries.\n *\n * Deliberately not named `idempotencyKey`: it remains the framework's\n * correlation identity even when the selected provider cannot enforce\n * idempotency. Provider gateways may map it to a native idempotency field as\n * an optional duplicate-risk reduction.\n */\n submissionId: z.string().min(1).max(256),\n\n // Recipients (required)\n to: z.array(StandardEmail_AddressSchema).min(1),\n cc: z.array(StandardEmail_AddressSchema).optional(),\n bcc: z.array(StandardEmail_AddressSchema).optional(),\n \n // Sender (required unless provider config has default)\n from: StandardEmail_AddressSchema.optional(),\n replyTo: StandardEmail_AddressSchema.optional(),\n \n // Content (html OR text required)\n subject: z.string().min(1),\n html: z.string().optional(),\n text: z.string().optional(),\n \n // Optional features\n attachments: z.array(StandardEmail_AttachmentSchema).optional(),\n headers: z.record(z.string(), z.string()).optional(),\n tags: z.array(z.string()).optional(),\n \n // Scheduling (optional - requires SUPPORTS_SCHEDULING)\n scheduledAt: z.iso.datetime().optional(),\n \n // Tracking (optional, uses provider default if not set)\n trackOpens: z.boolean().optional(),\n trackClicks: z.boolean().optional(),\n \n // Metadata for correlation/tracking\n metadata: z.record(z.string(), z.string()).optional(),\n}).refine(\n (data) => data.html !== undefined || data.text !== undefined,\n { message: \"Either html or text content is required\" }\n);\n\nexport type StandardEmail_SendRequest = z.infer<typeof StandardEmail_SendRequestSchema>;\n\n// ===============================================================\n// TRANSACTIONAL: Send Email Response\n// ===============================================================\n\nexport const StandardEmail_SendResponseSchema = z.object({\n success: z.boolean(),\n /**\n * Mandatory provider-owned submission meaning. HTTP status, receipt shape,\n * and recipient-level `success` are not interchangeable across providers.\n */\n classification: z.enum(EmailProviderSubmissionClassification),\n /**\n * Provider-assigned receipts. An array is required because Brevo and\n * Mailchimp may acknowledge several recipient messages in one response.\n * Empty is honest for a successful non-delivery preview or a provider that\n * accepted the request without returning a receipt.\n */\n providerMessageIds: z.array(z.string().min(1)),\n /** Per-recipient rejections returned inside an otherwise successful HTTP response. */\n rejectedRecipients: z.array(z.object({\n email: z.string().min(1),\n reason: z.string().optional(),\n })).optional(),\n /**\n * Provider-declared detail explaining its explicit classification, including\n * semantic rejection or an ambiguous idempotency/processing conflict.\n */\n providerError: z.string().min(1).optional(),\n /**\n * Whether the caller should retry this response under at-least-once\n * semantics. For an acceptance-unknown response, a retry may duplicate a\n * message unless the selected provider happens to enforce the submission id.\n */\n retryable: z.boolean().optional(),\n /** Provider reports that this submission identity was already suppressed. */\n deduplicated: z.boolean().optional(),\n status: z.enum(EmailProviderSubmissionStatus).optional(),\n scheduledAt: z.iso.datetime().optional(),\n}).superRefine((response, context) => {\n const accepted =\n response.classification\n === EmailProviderSubmissionClassification.ACCEPTED;\n\n /**\n * `success` describes whole-request success, whereas `classification`\n * describes whether any provider submission was accepted. Once a provider\n * adapter classifies a submission as accepted, auxiliary result metadata\n * must never turn that acknowledgement into permission to replay. A false\n * `success` may describe an honest partial result (for example Mailchimp)\n * or anomalous adapter metadata; `rejectedRecipients` is therefore useful\n * evidence, but not a prerequisite for preserving acceptance.\n */\n if (response.success && !accepted) {\n context.addIssue({\n code: 'custom',\n path: ['success'],\n message:\n 'A successful email response must be classified as accepted',\n });\n }\n if (response.success && (response.rejectedRecipients?.length ?? 0) > 0) {\n context.addIssue({\n code: 'custom',\n path: ['rejectedRecipients'],\n message:\n 'A successful email response cannot contain rejected recipients',\n });\n }\n if (!accepted && response.providerMessageIds.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerMessageIds'],\n message:\n 'A non-accepted email response cannot contain provider acceptance receipts',\n });\n }\n for (const [index, providerMessageId] of response.providerMessageIds.entries()) {\n if (response.providerMessageIds.indexOf(providerMessageId) !== index) {\n context.addIssue({\n code: 'custom',\n path: ['providerMessageIds', index],\n message: 'Provider message receipts must be unique',\n });\n }\n }\n\n for (const acceptedOnlyField of [\n 'deduplicated',\n 'status',\n 'scheduledAt',\n ] as const) {\n if (!accepted && response[acceptedOnlyField] !== undefined) {\n context.addIssue({\n code: 'custom',\n path: [acceptedOnlyField],\n message:\n `${acceptedOnlyField} is valid only for an accepted email response`,\n });\n }\n }\n if (\n response.scheduledAt !== undefined\n && response.status !== EmailProviderSubmissionStatus.SCHEDULED\n ) {\n context.addIssue({\n code: 'custom',\n path: ['scheduledAt'],\n message:\n 'A scheduledAt receipt requires provider status scheduled',\n });\n }\n if (accepted && response.retryable === true) {\n context.addIssue({\n code: 'custom',\n path: ['retryable'],\n message: 'An accepted email response cannot request replay',\n });\n }\n});\n\nexport type StandardEmail_SendResponse = z.infer<typeof StandardEmail_SendResponseSchema>;\n\n// ===============================================================\n// TRANSACTIONAL: Send Template Request\n// ===============================================================\n\nexport const StandardEmail_SendTemplateRequestSchema = z.object({\n // Recipients\n to: z.array(StandardEmail_AddressSchema).min(1),\n cc: z.array(StandardEmail_AddressSchema).optional(),\n bcc: z.array(StandardEmail_AddressSchema).optional(),\n \n // Sender\n from: StandardEmail_AddressSchema.optional(),\n replyTo: StandardEmail_AddressSchema.optional(),\n \n // Template (requires SUPPORTS_TEMPLATES)\n templateId: z.string().min(1),\n templateAlias: z.string().optional(), // Alternative identifier (Postmark)\n variables: z.record(z.string(), z.unknown()).optional(),\n \n // Optional overrides\n subject: z.string().optional(), // Override template subject\n \n // Optional features\n attachments: z.array(StandardEmail_AttachmentSchema).optional(),\n tags: z.array(z.string()).optional(),\n scheduledAt: z.iso.datetime().optional(),\n \n // Metadata\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type StandardEmail_SendTemplateRequest = z.infer<typeof StandardEmail_SendTemplateRequestSchema>;\n\n// ===============================================================\n// TRANSACTIONAL: Batch Send Request\n// ===============================================================\n\nexport const StandardEmail_BatchRecipientSchema = z.object({\n to: StandardEmail_AddressSchema,\n cc: z.array(StandardEmail_AddressSchema).optional(),\n bcc: z.array(StandardEmail_AddressSchema).optional(),\n variables: z.record(z.string(), z.unknown()).optional(),\n subject: z.string().optional(), // Per-recipient subject override\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type StandardEmail_BatchRecipient = z.infer<typeof StandardEmail_BatchRecipientSchema>;\n\nexport const StandardEmail_BatchRequestSchema = z.object({\n // Sender (shared)\n from: StandardEmail_AddressSchema.optional(),\n replyTo: StandardEmail_AddressSchema.optional(),\n \n // Content (shared - either direct or template)\n subject: z.string().optional(), // Default subject\n html: z.string().optional(),\n text: z.string().optional(),\n templateId: z.string().optional(),\n \n // Recipients with personalizations (requires SUPPORTS_BATCH_SENDING)\n recipients: z.array(StandardEmail_BatchRecipientSchema).min(1),\n \n // Optional features\n attachments: z.array(StandardEmail_AttachmentSchema).optional(),\n tags: z.array(z.string()).optional(),\n scheduledAt: z.iso.datetime().optional(),\n});\n\nexport type StandardEmail_BatchRequest = z.infer<typeof StandardEmail_BatchRequestSchema>;\n\n// ===============================================================\n// TRANSACTIONAL: Batch Send Response\n// ===============================================================\n\nexport const StandardEmail_BatchResponseSchema = z.object({\n success: z.boolean(),\n totalRequested: z.number().int(),\n totalAccepted: z.number().int(),\n totalRejected: z.number().int(),\n results: z.array(z.object({\n // Email address OR summary identifier (e.g. \"batch\" when provider returns aggregate result)\n email: z.string().min(1),\n success: z.boolean(),\n messageId: z.string().optional(),\n error: z.string().optional(),\n })),\n});\n\nexport type StandardEmail_BatchResponse = z.infer<typeof StandardEmail_BatchResponseSchema>;\n\n// ===============================================================\n// MARKETING: Contact\n// ===============================================================\n\nexport const StandardMarketing_ContactSchema = z.object({\n email: z.email(),\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n phone: z.string().optional(),\n attributes: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type StandardMarketing_Contact = z.infer<typeof StandardMarketing_ContactSchema>;\n\n// ===============================================================\n// MARKETING: List\n// ===============================================================\n\nexport const StandardMarketing_ListSchema = z.object({\n id: z.string().optional(), // Provider assigns on create\n name: z.string().min(1),\n description: z.string().optional(),\n});\n\nexport type StandardMarketing_List = z.infer<typeof StandardMarketing_ListSchema>;\n\n// ===============================================================\n// MARKETING: Audience (List + Contacts)\n// ===============================================================\n\nexport const StandardMarketing_AudienceSchema = z.object({\n // List reference (use existing by ID, or create/find by name)\n list: z.object({\n id: z.string().optional(),\n name: z.string().optional(),\n description: z.string().optional(),\n }).refine(\n (data) => data.id !== undefined || data.name !== undefined,\n { message: \"Either list.id or list.name is required\" }\n ),\n \n // Contacts to add/sync (optional if using existing list)\n contacts: z.array(StandardMarketing_ContactSchema).optional(),\n});\n\nexport type StandardMarketing_Audience = z.infer<typeof StandardMarketing_AudienceSchema>;\n\n// ===============================================================\n// MARKETING: Campaign Content\n// ===============================================================\n\nexport const StandardMarketing_ContentSchema = z.object({\n // Use template OR inline content\n templateId: z.string().optional(),\n templateVariables: z.record(z.string(), z.unknown()).optional(),\n \n // Inline content (if no template)\n subject: z.string().optional(),\n html: z.string().optional(),\n text: z.string().optional(),\n previewText: z.string().optional(),\n \n // Attachments\n attachments: z.array(StandardEmail_AttachmentSchema).optional(),\n}).refine(\n (data) => data.templateId !== undefined || data.subject !== undefined,\n { message: \"Either templateId or subject is required\" }\n);\n\nexport type StandardMarketing_Content = z.infer<typeof StandardMarketing_ContentSchema>;\n\n// ===============================================================\n// MARKETING: Campaign Request\n// ===============================================================\n\nexport const StandardMarketing_CampaignRequestSchema = z.object({\n // Campaign name\n name: z.string().min(1),\n \n // Sender\n from: StandardEmail_AddressSchema,\n replyTo: StandardEmail_AddressSchema.optional(),\n \n // Audience\n audience: StandardMarketing_AudienceSchema,\n \n // Content\n content: StandardMarketing_ContentSchema,\n \n // Execution\n schedule: z.object({\n sendAt: z.iso.datetime().optional(),\n sendImmediately: z.boolean().optional(),\n }).optional(),\n \n // Tracking\n trackOpens: z.boolean().optional().default(true),\n trackClicks: z.boolean().optional().default(true),\n \n // Tags\n tags: z.array(z.string()).optional(),\n \n // Metadata\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type StandardMarketing_CampaignRequest = z.infer<typeof StandardMarketing_CampaignRequestSchema>;\n\n// ===============================================================\n// MARKETING: Campaign Response\n// ===============================================================\n\nexport const StandardMarketing_CampaignResponseSchema = z.object({\n success: z.boolean(),\n campaignId: z.string(),\n providerCampaignId: z.string().optional(),\n status: z.enum([\"draft\", \"scheduled\", \"sending\", \"sent\", \"cancelled\"]),\n scheduledAt: z.iso.datetime().optional(),\n listId: z.string().optional(),\n audienceSize: z.number().int().optional(),\n});\n\nexport type StandardMarketing_CampaignResponse = z.infer<typeof StandardMarketing_CampaignResponseSchema>;\n\n// ===============================================================\n// Message Status Request/Response\n// ===============================================================\n\nexport const StandardEmail_GetStatusRequestSchema = z.object({\n messageId: z.string().min(1),\n});\n\nexport type StandardEmail_GetStatusRequest = z.infer<typeof StandardEmail_GetStatusRequestSchema>;\n\nexport const StandardEmail_GetStatusResponseSchema = z.object({\n messageId: 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 bounceReason: z.string().optional(),\n});\n\nexport type StandardEmail_GetStatusResponse = z.infer<typeof StandardEmail_GetStatusResponseSchema>;\n\n// ===============================================================\n// Standard Error\n// ===============================================================\n\nexport const StandardEmail_ErrorSchema = z.object({\n code: z.enum([\n \"VALIDATION_ERROR\",\n \"PROVIDER_ERROR\",\n \"CAPABILITY_NOT_SUPPORTED\",\n \"MARKETING_NOT_SUPPORTED\",\n \"SCHEDULING_NOT_SUPPORTED\",\n \"TEMPLATE_NOT_FOUND\",\n \"RATE_LIMIT_EXCEEDED\",\n \"AUTHENTICATION_FAILED\",\n \"QUOTA_EXCEEDED\",\n \"UNKNOWN_ERROR\",\n ]),\n message: z.string(),\n provider: z.string().optional(),\n details: z.unknown().optional(),\n \n // For capability errors - dynamically populated from registry\n requiredCapability: z.enum(EmailProvider_Capability).optional(),\n supportedProviders: z.array(z.string()).optional(),\n});\n\nexport type StandardEmail_Error = z.infer<typeof StandardEmail_ErrorSchema>;\n\n// ===============================================================\n// Capability Requirements\n// ===============================================================\n\n/**\n * Maps standard operations to required capabilities.\n * Used by the ETL layer to validate provider support.\n */\nexport const StandardEmail_OperationCapabilities = {\n sendEmail: [] as EmailProvider_Capability[], // All providers support basic send\n sendTemplate: [EmailProvider_Capability.SUPPORTS_TEMPLATES],\n sendBatch: [EmailProvider_Capability.SUPPORTS_BATCH_SENDING],\n sendScheduled: [EmailProvider_Capability.SUPPORTS_SCHEDULING],\n sendCampaign: [EmailProvider_Capability.SUPPORTS_MARKETING, EmailProvider_Capability.SUPPORTS_CAMPAIGNS],\n manageList: [EmailProvider_Capability.SUPPORTS_LIST_MANAGEMENT],\n} as const;\n\nexport type StandardEmail_Operation = keyof typeof StandardEmail_OperationCapabilities;\n"]}
|
|
1
|
+
{"version":3,"file":"email.standard-interface.schemas.js","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;AAE7I,iEAAiE;AACjE,2BAA2B;AAC3B,WAAW;AACX,qEAAqE;AACrE,gEAAgE;AAChE,+BAA+B;AAC/B,EAAE;AACF,qBAAqB;AACrB,uDAAuD;AACvD,gEAAgE;AAChE,yEAAyE;AACzE,iEAAiE;AAEjE,kEAAkE;AAClE,yBAAyB;AACzB,kEAAkE;AAElE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAIH,kEAAkE;AAClE,sBAAsB;AAC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mBAAmB,CAAC;IAC7D,YAAY,EAAE,CAAC,wBAAwB,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,kBAAkB,CAAC;IACxG,UAAU,EAAE,CAAC,wBAAwB,CAAC,wBAAwB,CAAC;CACvD,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { EmailProvider_Capability, EmailProvider_EmailType, EmailProvider_DeliveryStatus } from \"./email.external-connectors-models.schemas\";\n\n//===============================================================\n// Standard Email Interface\n// --------\n// This is the canonical interface that Wildo uses internally to send\n// emails. The ETL layer transforms these standard requests into\n// provider-specific API calls.\n//\n// Design Principles:\n// 1. Provider-agnostic - works with any email provider\n// 2. Capability-aware - validates against provider capabilities\n// 3. Extensible - new fields can be added without breaking existing code\n//===============================================================\n\n// ===============================================================\n// Standard Email Address\n// ===============================================================\n\nexport const StandardEmail_AddressSchema = z.object({\n email: z.email(),\n name: z.string().optional(),\n});\n\nexport type StandardEmail_Address = z.infer<typeof StandardEmail_AddressSchema>;\n\n// ===============================================================\n// Standard Attachment\n// ===============================================================\n\nexport const StandardEmail_AttachmentSchema = z.object({\n filename: z.string().min(1),\n content: z.string(), // Base64 encoded\n contentType: z.string().optional(),\n contentId: z.string().optional(), // For inline images (cid:)\n});\n\nexport type StandardEmail_Attachment = z.infer<typeof StandardEmail_AttachmentSchema>;\n\n/**\n * Wire encoding used by a network email provider gateway.\n *\n * This vocabulary is deliberately closed and explicit on every provider\n * contract: JSON and multipart data require materially different headers and\n * serialization. There is no implicit default.\n */\nexport enum EmailProviderPayloadEncoding {\n JSON = \"json\",\n MULTIPART_FORM_DATA = \"multipart-form-data\",\n}\n\n/** Provider acknowledgement state returned by a synchronous send endpoint. */\nexport enum EmailProviderSubmissionStatus {\n QUEUED = \"queued\",\n SENT = \"sent\",\n SCHEDULED = \"scheduled\",\n}\n\n/** Provider-owned classification for HTTP responses whose status is ambiguous. */\nexport enum EmailProviderSubmissionClassification {\n ACCEPTED = \"accepted\",\n REJECTED = \"rejected\",\n ACCEPTANCE_UNKNOWN = \"acceptance_unknown\",\n}\n\n// ===============================================================\n// TRANSACTIONAL: Send Email Request\n// ===============================================================\n\nexport const StandardEmail_SendRequestSchema = z.object({\n /**\n * Stable identity of ONE logical provider submission across retries.\n *\n * Deliberately not named `idempotencyKey`: it remains the framework's\n * correlation identity even when the selected provider cannot enforce\n * idempotency. Provider gateways may map it to a native idempotency field as\n * an optional duplicate-risk reduction.\n */\n submissionId: z.string().min(1).max(256),\n\n // Recipients (required)\n to: z.array(StandardEmail_AddressSchema).min(1),\n cc: z.array(StandardEmail_AddressSchema).optional(),\n bcc: z.array(StandardEmail_AddressSchema).optional(),\n \n // Sender (required unless provider config has default)\n from: StandardEmail_AddressSchema.optional(),\n replyTo: StandardEmail_AddressSchema.optional(),\n \n // Content (html OR text required)\n subject: z.string().min(1),\n html: z.string().optional(),\n text: z.string().optional(),\n \n // Optional features\n attachments: z.array(StandardEmail_AttachmentSchema).optional(),\n headers: z.record(z.string(), z.string()).optional(),\n tags: z.array(z.string()).optional(),\n \n // Scheduling (optional - requires SUPPORTS_SCHEDULING)\n scheduledAt: z.iso.datetime().optional(),\n \n // Tracking (optional, uses provider default if not set)\n trackOpens: z.boolean().optional(),\n trackClicks: z.boolean().optional(),\n \n // Metadata for correlation/tracking\n metadata: z.record(z.string(), z.string()).optional(),\n}).refine(\n (data) => data.html !== undefined || data.text !== undefined,\n { message: \"Either html or text content is required\" }\n);\n\nexport type StandardEmail_SendRequest = z.infer<typeof StandardEmail_SendRequestSchema>;\n\n// ===============================================================\n// TRANSACTIONAL: Send Email Response\n// ===============================================================\n\nexport const StandardEmail_SendResponseSchema = z.object({\n success: z.boolean(),\n /**\n * Mandatory provider-owned submission meaning. HTTP status, receipt shape,\n * and recipient-level `success` are not interchangeable across providers.\n */\n classification: z.enum(EmailProviderSubmissionClassification),\n /**\n * Provider-assigned receipts. An array is required because Brevo and\n * Mailchimp may acknowledge several recipient messages in one response.\n * Empty is honest for a successful non-delivery preview or a provider that\n * accepted the request without returning a receipt.\n */\n providerMessageIds: z.array(z.string().min(1)),\n /** Per-recipient rejections returned inside an otherwise successful HTTP response. */\n rejectedRecipients: z.array(z.object({\n email: z.string().min(1),\n reason: z.string().optional(),\n })).optional(),\n /**\n * Provider-declared detail explaining its explicit classification, including\n * semantic rejection or an ambiguous idempotency/processing conflict.\n *\n * CONTENT-FREE: the vendor's own code or error name, never the vendor's message, which routinely quotes the refused\n * address or the payload. The engine logs this text and returns it in batch results, and a log outlives an erasure\n * (#2251).\n */\n providerError: z.string().min(1).optional(),\n /**\n * Whether the caller should retry this response under at-least-once\n * semantics. For an acceptance-unknown response, a retry may duplicate a\n * message unless the selected provider happens to enforce the submission id.\n */\n retryable: z.boolean().optional(),\n /** Provider reports that this submission identity was already suppressed. */\n deduplicated: z.boolean().optional(),\n status: z.enum(EmailProviderSubmissionStatus).optional(),\n scheduledAt: z.iso.datetime().optional(),\n}).superRefine((response, context) => {\n const accepted =\n response.classification\n === EmailProviderSubmissionClassification.ACCEPTED;\n\n /**\n * `success` describes whole-request success, whereas `classification`\n * describes whether any provider submission was accepted. Once a provider\n * adapter classifies a submission as accepted, auxiliary result metadata\n * must never turn that acknowledgement into permission to replay. A false\n * `success` may describe an honest partial result (for example Mailchimp)\n * or anomalous adapter metadata; `rejectedRecipients` is therefore useful\n * evidence, but not a prerequisite for preserving acceptance.\n */\n if (response.success && !accepted) {\n context.addIssue({\n code: 'custom',\n path: ['success'],\n message:\n 'A successful email response must be classified as accepted',\n });\n }\n if (response.success && (response.rejectedRecipients?.length ?? 0) > 0) {\n context.addIssue({\n code: 'custom',\n path: ['rejectedRecipients'],\n message:\n 'A successful email response cannot contain rejected recipients',\n });\n }\n if (!accepted && response.providerMessageIds.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerMessageIds'],\n message:\n 'A non-accepted email response cannot contain provider acceptance receipts',\n });\n }\n for (const [index, providerMessageId] of response.providerMessageIds.entries()) {\n if (response.providerMessageIds.indexOf(providerMessageId) !== index) {\n context.addIssue({\n code: 'custom',\n path: ['providerMessageIds', index],\n message: 'Provider message receipts must be unique',\n });\n }\n }\n\n for (const acceptedOnlyField of [\n 'deduplicated',\n 'status',\n 'scheduledAt',\n ] as const) {\n if (!accepted && response[acceptedOnlyField] !== undefined) {\n context.addIssue({\n code: 'custom',\n path: [acceptedOnlyField],\n message:\n `${acceptedOnlyField} is valid only for an accepted email response`,\n });\n }\n }\n if (\n response.scheduledAt !== undefined\n && response.status !== EmailProviderSubmissionStatus.SCHEDULED\n ) {\n context.addIssue({\n code: 'custom',\n path: ['scheduledAt'],\n message:\n 'A scheduledAt receipt requires provider status scheduled',\n });\n }\n if (accepted && response.retryable === true) {\n context.addIssue({\n code: 'custom',\n path: ['retryable'],\n message: 'An accepted email response cannot request replay',\n });\n }\n});\n\nexport type StandardEmail_SendResponse = z.infer<typeof StandardEmail_SendResponseSchema>;\n\n// ===============================================================\n// TRANSACTIONAL: Send Template Request\n// ===============================================================\n\nexport const StandardEmail_SendTemplateRequestSchema = z.object({\n // Recipients\n to: z.array(StandardEmail_AddressSchema).min(1),\n cc: z.array(StandardEmail_AddressSchema).optional(),\n bcc: z.array(StandardEmail_AddressSchema).optional(),\n \n // Sender\n from: StandardEmail_AddressSchema.optional(),\n replyTo: StandardEmail_AddressSchema.optional(),\n \n // Template (requires SUPPORTS_TEMPLATES)\n templateId: z.string().min(1),\n templateAlias: z.string().optional(), // Alternative identifier (Postmark)\n variables: z.record(z.string(), z.unknown()).optional(),\n \n // Optional overrides\n subject: z.string().optional(), // Override template subject\n \n // Optional features\n attachments: z.array(StandardEmail_AttachmentSchema).optional(),\n tags: z.array(z.string()).optional(),\n scheduledAt: z.iso.datetime().optional(),\n \n // Metadata\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type StandardEmail_SendTemplateRequest = z.infer<typeof StandardEmail_SendTemplateRequestSchema>;\n\n// ===============================================================\n// TRANSACTIONAL: Batch Send Request\n// ===============================================================\n\nexport const StandardEmail_BatchRecipientSchema = z.object({\n to: StandardEmail_AddressSchema,\n cc: z.array(StandardEmail_AddressSchema).optional(),\n bcc: z.array(StandardEmail_AddressSchema).optional(),\n variables: z.record(z.string(), z.unknown()).optional(),\n subject: z.string().optional(), // Per-recipient subject override\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type StandardEmail_BatchRecipient = z.infer<typeof StandardEmail_BatchRecipientSchema>;\n\nexport const StandardEmail_BatchRequestSchema = z.object({\n // Sender (shared)\n from: StandardEmail_AddressSchema.optional(),\n replyTo: StandardEmail_AddressSchema.optional(),\n \n // Content (shared - either direct or template)\n subject: z.string().optional(), // Default subject\n html: z.string().optional(),\n text: z.string().optional(),\n templateId: z.string().optional(),\n \n // Recipients with personalizations (requires SUPPORTS_BATCH_SENDING)\n recipients: z.array(StandardEmail_BatchRecipientSchema).min(1),\n \n // Optional features\n attachments: z.array(StandardEmail_AttachmentSchema).optional(),\n tags: z.array(z.string()).optional(),\n scheduledAt: z.iso.datetime().optional(),\n});\n\nexport type StandardEmail_BatchRequest = z.infer<typeof StandardEmail_BatchRequestSchema>;\n\n// ===============================================================\n// TRANSACTIONAL: Batch Send Response\n// ===============================================================\n\nexport const StandardEmail_BatchResponseSchema = z.object({\n success: z.boolean(),\n totalRequested: z.number().int(),\n totalAccepted: z.number().int(),\n totalRejected: z.number().int(),\n results: z.array(z.object({\n // Email address OR summary identifier (e.g. \"batch\" when provider returns aggregate result)\n email: z.string().min(1),\n success: z.boolean(),\n messageId: z.string().optional(),\n error: z.string().optional(),\n })),\n});\n\nexport type StandardEmail_BatchResponse = z.infer<typeof StandardEmail_BatchResponseSchema>;\n\n// ===============================================================\n// MARKETING: Contact\n// ===============================================================\n\nexport const StandardMarketing_ContactSchema = z.object({\n email: z.email(),\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n phone: z.string().optional(),\n attributes: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type StandardMarketing_Contact = z.infer<typeof StandardMarketing_ContactSchema>;\n\n// ===============================================================\n// MARKETING: List\n// ===============================================================\n\nexport const StandardMarketing_ListSchema = z.object({\n id: z.string().optional(), // Provider assigns on create\n name: z.string().min(1),\n description: z.string().optional(),\n});\n\nexport type StandardMarketing_List = z.infer<typeof StandardMarketing_ListSchema>;\n\n// ===============================================================\n// MARKETING: Audience (List + Contacts)\n// ===============================================================\n\nexport const StandardMarketing_AudienceSchema = z.object({\n // List reference (use existing by ID, or create/find by name)\n list: z.object({\n id: z.string().optional(),\n name: z.string().optional(),\n description: z.string().optional(),\n }).refine(\n (data) => data.id !== undefined || data.name !== undefined,\n { message: \"Either list.id or list.name is required\" }\n ),\n \n // Contacts to add/sync (optional if using existing list)\n contacts: z.array(StandardMarketing_ContactSchema).optional(),\n});\n\nexport type StandardMarketing_Audience = z.infer<typeof StandardMarketing_AudienceSchema>;\n\n// ===============================================================\n// MARKETING: Campaign Content\n// ===============================================================\n\nexport const StandardMarketing_ContentSchema = z.object({\n // Use template OR inline content\n templateId: z.string().optional(),\n templateVariables: z.record(z.string(), z.unknown()).optional(),\n \n // Inline content (if no template)\n subject: z.string().optional(),\n html: z.string().optional(),\n text: z.string().optional(),\n previewText: z.string().optional(),\n \n // Attachments\n attachments: z.array(StandardEmail_AttachmentSchema).optional(),\n}).refine(\n (data) => data.templateId !== undefined || data.subject !== undefined,\n { message: \"Either templateId or subject is required\" }\n);\n\nexport type StandardMarketing_Content = z.infer<typeof StandardMarketing_ContentSchema>;\n\n// ===============================================================\n// MARKETING: Campaign Request\n// ===============================================================\n\nexport const StandardMarketing_CampaignRequestSchema = z.object({\n // Campaign name\n name: z.string().min(1),\n \n // Sender\n from: StandardEmail_AddressSchema,\n replyTo: StandardEmail_AddressSchema.optional(),\n \n // Audience\n audience: StandardMarketing_AudienceSchema,\n \n // Content\n content: StandardMarketing_ContentSchema,\n \n // Execution\n schedule: z.object({\n sendAt: z.iso.datetime().optional(),\n sendImmediately: z.boolean().optional(),\n }).optional(),\n \n // Tracking\n trackOpens: z.boolean().optional().default(true),\n trackClicks: z.boolean().optional().default(true),\n \n // Tags\n tags: z.array(z.string()).optional(),\n \n // Metadata\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type StandardMarketing_CampaignRequest = z.infer<typeof StandardMarketing_CampaignRequestSchema>;\n\n// ===============================================================\n// MARKETING: Campaign Response\n// ===============================================================\n\nexport const StandardMarketing_CampaignResponseSchema = z.object({\n success: z.boolean(),\n campaignId: z.string(),\n providerCampaignId: z.string().optional(),\n status: z.enum([\"draft\", \"scheduled\", \"sending\", \"sent\", \"cancelled\"]),\n scheduledAt: z.iso.datetime().optional(),\n listId: z.string().optional(),\n audienceSize: z.number().int().optional(),\n});\n\nexport type StandardMarketing_CampaignResponse = z.infer<typeof StandardMarketing_CampaignResponseSchema>;\n\n// ===============================================================\n// Message Status Request/Response\n// ===============================================================\n\nexport const StandardEmail_GetStatusRequestSchema = z.object({\n messageId: z.string().min(1),\n});\n\nexport type StandardEmail_GetStatusRequest = z.infer<typeof StandardEmail_GetStatusRequestSchema>;\n\nexport const StandardEmail_GetStatusResponseSchema = z.object({\n messageId: 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 bounceReason: z.string().optional(),\n});\n\nexport type StandardEmail_GetStatusResponse = z.infer<typeof StandardEmail_GetStatusResponseSchema>;\n\n// ===============================================================\n// Standard Error\n// ===============================================================\n\nexport const StandardEmail_ErrorSchema = z.object({\n code: z.enum([\n \"VALIDATION_ERROR\",\n \"PROVIDER_ERROR\",\n \"CAPABILITY_NOT_SUPPORTED\",\n \"MARKETING_NOT_SUPPORTED\",\n \"SCHEDULING_NOT_SUPPORTED\",\n \"TEMPLATE_NOT_FOUND\",\n \"RATE_LIMIT_EXCEEDED\",\n \"AUTHENTICATION_FAILED\",\n \"QUOTA_EXCEEDED\",\n \"UNKNOWN_ERROR\",\n ]),\n message: z.string(),\n provider: z.string().optional(),\n details: z.unknown().optional(),\n \n // For capability errors - dynamically populated from registry\n requiredCapability: z.enum(EmailProvider_Capability).optional(),\n supportedProviders: z.array(z.string()).optional(),\n});\n\nexport type StandardEmail_Error = z.infer<typeof StandardEmail_ErrorSchema>;\n\n// ===============================================================\n// Capability Requirements\n// ===============================================================\n\n/**\n * Maps standard operations to required capabilities.\n * Used by the ETL layer to validate provider support.\n */\nexport const StandardEmail_OperationCapabilities = {\n sendEmail: [] as EmailProvider_Capability[], // All providers support basic send\n sendTemplate: [EmailProvider_Capability.SUPPORTS_TEMPLATES],\n sendBatch: [EmailProvider_Capability.SUPPORTS_BATCH_SENDING],\n sendScheduled: [EmailProvider_Capability.SUPPORTS_SCHEDULING],\n sendCampaign: [EmailProvider_Capability.SUPPORTS_MARKETING, EmailProvider_Capability.SUPPORTS_CAMPAIGNS],\n manageList: [EmailProvider_Capability.SUPPORTS_LIST_MANAGEMENT],\n} as const;\n\nexport type StandardEmail_Operation = keyof typeof StandardEmail_OperationCapabilities;\n"]}
|
|
@@ -27,20 +27,63 @@ export declare enum EmbeddingsProvider_OperationKey {
|
|
|
27
27
|
EMBED_TEXTS = "embeddings.embedTexts"
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* WHY a text is being embedded —
|
|
31
|
-
* DOCUMENTS they search over
|
|
32
|
-
*
|
|
33
|
-
*
|
|
30
|
+
* WHY a text is being embedded — the ROLE of the text in a retrieval. Some models embed retrieval
|
|
31
|
+
* QUERIES differently from the DOCUMENTS they search over, so the caller's intent must travel with
|
|
32
|
+
* the call rather than being inferred. The caller that knows sets it: the `rag:embedding-drain`
|
|
33
|
+
* worker embeds corpus chunks as {@link CORPUS}, retrieval embeds the search text as {@link QUERY}.
|
|
34
|
+
*
|
|
35
|
+
* It reaches the vendor through the provider's declared {@link EmbeddingsProvider_TextPurposeHandling}
|
|
36
|
+
* (#3427); the engine never names a vendor parameter. Measured 2026-11-06, the vendors split:
|
|
37
|
+
* - Cohere's `input_type` is "Required for embedding models v3 and higher": `search_document` is
|
|
38
|
+
* "Used for embeddings stored in a vector database for search use-cases", `search_query` "Used for
|
|
39
|
+
* embeddings of search queries run against a vector DB to find relevant documents".
|
|
40
|
+
* spec-cite: Cohere API reference, "Embed API (v2)" (https://docs.cohere.com/reference/embed, fetched 2026-11-06), `input_type`.
|
|
41
|
+
* - Voyage's `input_type` takes `None` (default), `query` or `document`; for the last two it prepends
|
|
42
|
+
* "Represent the query for retrieving supporting documents:" / "Represent the document for retrieval:",
|
|
43
|
+
* and recommends specifying it for retrieval.
|
|
44
|
+
* spec-cite: Voyage AI documentation, "Text Embeddings" (https://docs.voyageai.com/docs/embeddings, fetched 2026-11-06), `input_type`.
|
|
45
|
+
* - OpenAI's embeddings request has no such parameter (`input`, `model`, `dimensions`,
|
|
46
|
+
* `encoding_format`, `user`), nor does Amazon Titan Text Embeddings V2 (`inputText`, `dimensions`,
|
|
47
|
+
* `normalize`, `embeddingTypes`): those providers declare that their vendor has no role.
|
|
34
48
|
*
|
|
35
49
|
* A named home (semantic-string-literals rule): `'corpus'`/`'query'` are a closed vocabulary,
|
|
36
50
|
* and this enum is where their semantics live.
|
|
37
51
|
*/
|
|
38
52
|
export declare enum EmbeddingsProvider_TextPurpose {
|
|
39
|
-
/** The text IS retrievable content — a RAG chunk entering the corpus. */
|
|
53
|
+
/** The text IS retrievable content — a RAG chunk entering the corpus (Cohere `search_document`, Voyage `document`). */
|
|
40
54
|
CORPUS = "corpus",
|
|
41
|
-
/** The text is a SEARCH query that will be matched against corpus vectors. */
|
|
55
|
+
/** The text is a SEARCH query that will be matched against corpus vectors (Cohere `search_query`, Voyage `query`). */
|
|
42
56
|
QUERY = "query"
|
|
43
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* HOW a provider carries {@link EmbeddingsProvider_TextPurpose} to its vendor — the kind of an embeddings arm's
|
|
60
|
+
* `textPurposeHandling` (#3427). The arm must declare one: a provider whose vendor distinguishes the roles maps each,
|
|
61
|
+
* and one whose vendor does not says so with its reason, so "this provider ignores the role" is a decision on record
|
|
62
|
+
* and never the silent default it was. (Until #3427 no provider could map it: the role reached the trace only, and
|
|
63
|
+
* Cohere's SDK, given nothing, sent `search_query` for the corpus too.)
|
|
64
|
+
*/
|
|
65
|
+
export declare enum EmbeddingsProvider_TextPurposeHandlingKind {
|
|
66
|
+
/**
|
|
67
|
+
* The vendor's embedding API has no query/document parameter, so one vector space serves both roles and the engine
|
|
68
|
+
* sends nothing for it. Declared with the reason (the vendor's documented request parameters), never assumed.
|
|
69
|
+
*/
|
|
70
|
+
VENDOR_HAS_NO_ROLE = "vendor-has-no-role",
|
|
71
|
+
/**
|
|
72
|
+
* The vendor distinguishes the roles, and its AI-SDK client reads the role from `providerOptions`: the arm declares,
|
|
73
|
+
* for EVERY purpose, the options the engine hands `embedMany` for a call of that purpose (Cohere:
|
|
74
|
+
* `{ cohere: { inputType: 'search_document' } }` for CORPUS). Data, not a function, so the engine stays
|
|
75
|
+
* provider-neutral and a registry module's declaration can be checked before any text leaves.
|
|
76
|
+
*/
|
|
77
|
+
SDK_PROVIDER_OPTIONS = "sdk-provider-options"
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Why a provider's declared `textPurposeHandling` cannot be used, or `undefined` (#3427). A registry module is loaded at
|
|
81
|
+
* runtime, so nothing compiled its declaration; absence is a defect too, because an embeddings arm must state how the
|
|
82
|
+
* role reaches its vendor. A {@link EmbeddingsProvider_TextPurposeHandlingKind.SDK_PROVIDER_OPTIONS} declaration must
|
|
83
|
+
* map EVERY purpose to a non-empty `{ <sdk provider id>: { <option>: string | number | boolean } }`: a purpose left
|
|
84
|
+
* out would be embedded with the SDK's default, which is exactly the mismatch the declaration exists to prevent.
|
|
85
|
+
*/
|
|
86
|
+
export declare const describeEmbeddingsTextPurposeHandlingDefect: (handling: unknown) => string | undefined;
|
|
44
87
|
/**
|
|
45
88
|
* @wildo_source:part:start saas.external-providers.embeddings.applicability facet:kind:api facet:audience:app-developer
|
|
46
89
|
*
|
|
@@ -92,19 +135,47 @@ export declare const EMBEDDINGS_MODEL_CATALOG: Record<EmbeddingsProvider_Model,
|
|
|
92
135
|
* converging over runs. No agent/worker definition changes.
|
|
93
136
|
*/
|
|
94
137
|
export declare const EMBEDDINGS_MODEL_APPLICABILITY_PREFERENCE: Record<Embeddings_Applicability, readonly EmbeddingsProvider_Model[]>;
|
|
138
|
+
/**
|
|
139
|
+
* An embedding model a provider the engine does NOT ship declares it serves (#2516) — the embeddings mirror of
|
|
140
|
+
* `LLM_ModelDeclaration`. The catalog is an exhaustive record over {@link EmbeddingsProvider_Model}, so a registry
|
|
141
|
+
* vendor declares its models on its embeddings arm instead of adding a row.
|
|
142
|
+
*
|
|
143
|
+
* `dims` is as load-bearing here as on a catalog row: the drain worker verifies every returned vector against it, and the
|
|
144
|
+
* per-dimension vector index is keyed by it. It must be the model's published output dimension.
|
|
145
|
+
*/
|
|
146
|
+
export type Embeddings_ModelDeclaration = {
|
|
147
|
+
model: string;
|
|
148
|
+
dims: number;
|
|
149
|
+
applicabilities: readonly Embeddings_Applicability[];
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Why a provider's declared embedding models ({@link Embeddings_ModelDeclaration}) cannot be used, or `undefined`
|
|
153
|
+
* (#2516). Absent is fine: an engine provider has none. A registry module is loaded at runtime, so nothing compiled its
|
|
154
|
+
* `models`; `dims` in particular decides which vector index a chunk enters, so it must be a positive integer.
|
|
155
|
+
*/
|
|
156
|
+
export declare const describeEmbeddingsModelDeclarationsDefect: (models: unknown) => string | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Whether the engine's embedding catalog knows this provider, which decides where its model facts come from (#2516): catalog
|
|
159
|
+
* rows for an engine provider, the provider's own `models` declaration otherwise.
|
|
160
|
+
*/
|
|
161
|
+
export declare const isEmbeddingsCatalogProvider: (providerRef: string, catalog?: Record<EmbeddingsProvider_Model, Embeddings_ModelCatalogEntry>) => boolean;
|
|
95
162
|
/** Why {@link resolveEmbeddingsModelForApplicability} could not answer — carried into a named CONFIGURATION error. */
|
|
96
163
|
export declare enum Embeddings_ModelResolutionFailure {
|
|
97
164
|
/** The applicability has no candidate at all for this provider. */
|
|
98
|
-
NO_CANDIDATE_FOR_PROVIDER = "no_candidate_for_provider"
|
|
165
|
+
NO_CANDIDATE_FOR_PROVIDER = "no_candidate_for_provider",
|
|
166
|
+
/** An engine provider (one the catalog knows) also declares models; its models are catalog rows, so it is refused. */
|
|
167
|
+
CATALOG_PROVIDER_DECLARES_MODELS = "catalog_provider_declares_models",
|
|
168
|
+
/** A declared model's `dims` is not a positive integer, so nothing could verify or index its vectors. */
|
|
169
|
+
DECLARED_DIMS_INVALID = "declared_dims_invalid"
|
|
99
170
|
}
|
|
100
171
|
export type Embeddings_ModelResolution = {
|
|
101
172
|
resolved: true;
|
|
102
|
-
model:
|
|
103
|
-
|
|
173
|
+
model: string;
|
|
174
|
+
dims: number;
|
|
104
175
|
} | {
|
|
105
176
|
resolved: false;
|
|
106
177
|
failure: Embeddings_ModelResolutionFailure;
|
|
107
|
-
consideredModels: readonly
|
|
178
|
+
consideredModels: readonly string[];
|
|
108
179
|
};
|
|
109
180
|
/**
|
|
110
181
|
* Resolve an applicability class to ONE concrete embedding model for a given provider.
|
|
@@ -113,10 +184,15 @@ export type Embeddings_ModelResolution = {
|
|
|
113
184
|
* fallback to some other model would fracture the vector space the class exists to keep whole.
|
|
114
185
|
* The resolved `(class, model)` pair is what the RAG drain worker stamps on every chunk and what
|
|
115
186
|
* its migration pass compares stamps against.
|
|
187
|
+
*
|
|
188
|
+
* Two sources, decided by whether the catalog knows the provider (as `resolveModelForApplicability`, #2516): an engine
|
|
189
|
+
* provider resolves through the preference and catalog and is refused if it also declares models; any other provider
|
|
190
|
+
* resolves from its `declaredModels`, the first declaring the applicability.
|
|
116
191
|
*/
|
|
117
192
|
export declare const resolveEmbeddingsModelForApplicability: (input: {
|
|
118
193
|
applicability: Embeddings_Applicability;
|
|
119
194
|
providerRef: string;
|
|
195
|
+
declaredModels?: readonly Embeddings_ModelDeclaration[];
|
|
120
196
|
}, catalog?: Record<EmbeddingsProvider_Model, Embeddings_ModelCatalogEntry>) => Embeddings_ModelResolution;
|
|
121
197
|
/**
|
|
122
198
|
* Usage of one embedding call. There is NO completion-token dimension — an embedding consumes
|
|
@@ -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,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
|
|
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;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,oBAAY,8BAA8B;IACxC,uHAAuH;IACvH,MAAM,WAAW;IACjB,sHAAsH;IACtH,KAAK,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
|
|
45
45
|
})(EmbeddingsProvider_OperationKey || (EmbeddingsProvider_OperationKey = {}));
|
|
46
46
|
/**
|
|
47
|
-
* WHY a text is being embedded —
|
|
48
|
-
* DOCUMENTS they search over
|
|
49
|
-
*
|
|
50
|
-
*
|
|
47
|
+
* WHY a text is being embedded — the ROLE of the text in a retrieval. Some models embed retrieval
|
|
48
|
+
* QUERIES differently from the DOCUMENTS they search over, so the caller's intent must travel with
|
|
49
|
+
* the call rather than being inferred. The caller that knows sets it: the `rag:embedding-drain`
|
|
50
|
+
* worker embeds corpus chunks as {@link CORPUS}, retrieval embeds the search text as {@link QUERY}.
|
|
51
|
+
*
|
|
52
|
+
* It reaches the vendor through the provider's declared {@link EmbeddingsProvider_TextPurposeHandling}
|
|
53
|
+
* (#3427); the engine never names a vendor parameter. Measured 2026-11-06, the vendors split:
|
|
54
|
+
* - Cohere's `input_type` is "Required for embedding models v3 and higher": `search_document` is
|
|
55
|
+
* "Used for embeddings stored in a vector database for search use-cases", `search_query` "Used for
|
|
56
|
+
* embeddings of search queries run against a vector DB to find relevant documents".
|
|
57
|
+
* spec-cite: Cohere API reference, "Embed API (v2)" (https://docs.cohere.com/reference/embed, fetched 2026-11-06), `input_type`.
|
|
58
|
+
* - Voyage's `input_type` takes `None` (default), `query` or `document`; for the last two it prepends
|
|
59
|
+
* "Represent the query for retrieving supporting documents:" / "Represent the document for retrieval:",
|
|
60
|
+
* and recommends specifying it for retrieval.
|
|
61
|
+
* spec-cite: Voyage AI documentation, "Text Embeddings" (https://docs.voyageai.com/docs/embeddings, fetched 2026-11-06), `input_type`.
|
|
62
|
+
* - OpenAI's embeddings request has no such parameter (`input`, `model`, `dimensions`,
|
|
63
|
+
* `encoding_format`, `user`), nor does Amazon Titan Text Embeddings V2 (`inputText`, `dimensions`,
|
|
64
|
+
* `normalize`, `embeddingTypes`): those providers declare that their vendor has no role.
|
|
51
65
|
*
|
|
52
66
|
* A named home (semantic-string-literals rule): `'corpus'`/`'query'` are a closed vocabulary,
|
|
53
67
|
* and this enum is where their semantics live.
|
|
54
68
|
*/
|
|
55
69
|
export var EmbeddingsProvider_TextPurpose;
|
|
56
70
|
(function (EmbeddingsProvider_TextPurpose) {
|
|
57
|
-
/** The text IS retrievable content — a RAG chunk entering the corpus. */
|
|
71
|
+
/** The text IS retrievable content — a RAG chunk entering the corpus (Cohere `search_document`, Voyage `document`). */
|
|
58
72
|
EmbeddingsProvider_TextPurpose["CORPUS"] = "corpus";
|
|
59
|
-
/** The text is a SEARCH query that will be matched against corpus vectors. */
|
|
73
|
+
/** The text is a SEARCH query that will be matched against corpus vectors (Cohere `search_query`, Voyage `query`). */
|
|
60
74
|
EmbeddingsProvider_TextPurpose["QUERY"] = "query";
|
|
61
75
|
})(EmbeddingsProvider_TextPurpose || (EmbeddingsProvider_TextPurpose = {}));
|
|
76
|
+
/**
|
|
77
|
+
* HOW a provider carries {@link EmbeddingsProvider_TextPurpose} to its vendor — the kind of an embeddings arm's
|
|
78
|
+
* `textPurposeHandling` (#3427). The arm must declare one: a provider whose vendor distinguishes the roles maps each,
|
|
79
|
+
* and one whose vendor does not says so with its reason, so "this provider ignores the role" is a decision on record
|
|
80
|
+
* and never the silent default it was. (Until #3427 no provider could map it: the role reached the trace only, and
|
|
81
|
+
* Cohere's SDK, given nothing, sent `search_query` for the corpus too.)
|
|
82
|
+
*/
|
|
83
|
+
export var EmbeddingsProvider_TextPurposeHandlingKind;
|
|
84
|
+
(function (EmbeddingsProvider_TextPurposeHandlingKind) {
|
|
85
|
+
/**
|
|
86
|
+
* The vendor's embedding API has no query/document parameter, so one vector space serves both roles and the engine
|
|
87
|
+
* sends nothing for it. Declared with the reason (the vendor's documented request parameters), never assumed.
|
|
88
|
+
*/
|
|
89
|
+
EmbeddingsProvider_TextPurposeHandlingKind["VENDOR_HAS_NO_ROLE"] = "vendor-has-no-role";
|
|
90
|
+
/**
|
|
91
|
+
* The vendor distinguishes the roles, and its AI-SDK client reads the role from `providerOptions`: the arm declares,
|
|
92
|
+
* for EVERY purpose, the options the engine hands `embedMany` for a call of that purpose (Cohere:
|
|
93
|
+
* `{ cohere: { inputType: 'search_document' } }` for CORPUS). Data, not a function, so the engine stays
|
|
94
|
+
* provider-neutral and a registry module's declaration can be checked before any text leaves.
|
|
95
|
+
*/
|
|
96
|
+
EmbeddingsProvider_TextPurposeHandlingKind["SDK_PROVIDER_OPTIONS"] = "sdk-provider-options";
|
|
97
|
+
})(EmbeddingsProvider_TextPurposeHandlingKind || (EmbeddingsProvider_TextPurposeHandlingKind = {}));
|
|
98
|
+
/**
|
|
99
|
+
* Why a provider's declared `textPurposeHandling` cannot be used, or `undefined` (#3427). A registry module is loaded at
|
|
100
|
+
* runtime, so nothing compiled its declaration; absence is a defect too, because an embeddings arm must state how the
|
|
101
|
+
* role reaches its vendor. A {@link EmbeddingsProvider_TextPurposeHandlingKind.SDK_PROVIDER_OPTIONS} declaration must
|
|
102
|
+
* map EVERY purpose to a non-empty `{ <sdk provider id>: { <option>: string | number | boolean } }`: a purpose left
|
|
103
|
+
* out would be embedded with the SDK's default, which is exactly the mismatch the declaration exists to prevent.
|
|
104
|
+
*/
|
|
105
|
+
export const describeEmbeddingsTextPurposeHandlingDefect = (handling) => {
|
|
106
|
+
if (typeof handling !== "object" || handling === null || Array.isArray(handling)) {
|
|
107
|
+
return "declares no `textPurposeHandling`: an embeddings arm must say how a text's role (corpus or query) reaches its vendor, or that the vendor has none";
|
|
108
|
+
}
|
|
109
|
+
const { kind, reason, providerOptionsByPurpose } = handling;
|
|
110
|
+
if (kind === EmbeddingsProvider_TextPurposeHandlingKind.VENDOR_HAS_NO_ROLE) {
|
|
111
|
+
return typeof reason === "string" && reason.trim().length > 0 ? undefined : "declares its vendor has no role without a `reason`";
|
|
112
|
+
}
|
|
113
|
+
if (kind !== EmbeddingsProvider_TextPurposeHandlingKind.SDK_PROVIDER_OPTIONS) {
|
|
114
|
+
return "declares an unknown `textPurposeHandling.kind`";
|
|
115
|
+
}
|
|
116
|
+
if (typeof providerOptionsByPurpose !== "object" || providerOptionsByPurpose === null || Array.isArray(providerOptionsByPurpose)) {
|
|
117
|
+
return "declares SDK provider options with no `providerOptionsByPurpose`";
|
|
118
|
+
}
|
|
119
|
+
for (const purpose of Object.values(EmbeddingsProvider_TextPurpose)) {
|
|
120
|
+
const options = providerOptionsByPurpose[purpose];
|
|
121
|
+
if (typeof options !== "object" || options === null || Array.isArray(options) || Object.keys(options).length === 0) {
|
|
122
|
+
return `maps no SDK provider options for the "${purpose}" purpose`;
|
|
123
|
+
}
|
|
124
|
+
for (const perProvider of Object.values(options)) {
|
|
125
|
+
if (typeof perProvider !== "object" || perProvider === null || Array.isArray(perProvider) || Object.keys(perProvider).length === 0) {
|
|
126
|
+
return `maps an empty or malformed SDK provider option set for the "${purpose}" purpose`;
|
|
127
|
+
}
|
|
128
|
+
if (!Object.values(perProvider).every((value) => ["string", "number", "boolean"].includes(typeof value))) {
|
|
129
|
+
return `maps a non-scalar SDK provider option for the "${purpose}" purpose`;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// One option set for every purpose is the original defect in a declaration's clothing (a copy-paste slip that sends
|
|
134
|
+
// the corpus as queries again): a vendor whose roles do not differ declares VENDOR_HAS_NO_ROLE instead.
|
|
135
|
+
const distinctOptionSets = new Set(Object.values(EmbeddingsProvider_TextPurpose).map((purpose) => canonicalJson(providerOptionsByPurpose[purpose])));
|
|
136
|
+
if (distinctOptionSets.size < Object.values(EmbeddingsProvider_TextPurpose).length) {
|
|
137
|
+
return "maps the same SDK provider options to more than one purpose: a vendor whose embedding request has no role declares `vendor-has-no-role`";
|
|
138
|
+
}
|
|
139
|
+
return undefined;
|
|
140
|
+
};
|
|
141
|
+
/** JSON with object keys sorted at every level, so two option sets compare by content rather than by key order. */
|
|
142
|
+
const canonicalJson = (value) => JSON.stringify(value, (_key, nested) => typeof nested === "object" && nested !== null && !Array.isArray(nested)
|
|
143
|
+
? Object.fromEntries(Object.entries(nested).sort(([left], [right]) => left.localeCompare(right)))
|
|
144
|
+
: nested);
|
|
62
145
|
/**
|
|
63
146
|
* @wildo_source:part:start saas.external-providers.embeddings.applicability facet:kind:api facet:audience:app-developer
|
|
64
147
|
*
|
|
@@ -113,11 +196,48 @@ export const EMBEDDINGS_MODEL_APPLICABILITY_PREFERENCE = {
|
|
|
113
196
|
EmbeddingsProvider_Model.OPEN_AI_TEXT_EMBEDDING_3_SMALL,
|
|
114
197
|
],
|
|
115
198
|
};
|
|
199
|
+
/**
|
|
200
|
+
* Why a provider's declared embedding models ({@link Embeddings_ModelDeclaration}) cannot be used, or `undefined`
|
|
201
|
+
* (#2516). Absent is fine: an engine provider has none. A registry module is loaded at runtime, so nothing compiled its
|
|
202
|
+
* `models`; `dims` in particular decides which vector index a chunk enters, so it must be a positive integer.
|
|
203
|
+
*/
|
|
204
|
+
export const describeEmbeddingsModelDeclarationsDefect = (models) => {
|
|
205
|
+
if (models === undefined)
|
|
206
|
+
return undefined;
|
|
207
|
+
if (!Array.isArray(models))
|
|
208
|
+
return "are not a list";
|
|
209
|
+
const applicabilities = new Set(Object.values(Embeddings_Applicability));
|
|
210
|
+
const seen = new Set();
|
|
211
|
+
for (const [index, declaration] of models.entries()) {
|
|
212
|
+
if (typeof declaration !== "object" || declaration === null || Array.isArray(declaration))
|
|
213
|
+
return `have no \`model\` at position ${index}`;
|
|
214
|
+
const { model, dims, applicabilities: declared } = declaration;
|
|
215
|
+
if (typeof model !== "string" || model.trim().length === 0)
|
|
216
|
+
return `have no \`model\` at position ${index}`;
|
|
217
|
+
if (seen.has(model))
|
|
218
|
+
return `declare "${model}" twice`;
|
|
219
|
+
seen.add(model);
|
|
220
|
+
if (typeof dims !== "number" || !Number.isInteger(dims) || dims <= 0)
|
|
221
|
+
return `give "${model}" no positive integer \`dims\``;
|
|
222
|
+
if (!Array.isArray(declared) || !declared.every((member) => applicabilities.has(member)))
|
|
223
|
+
return `give "${model}" unknown \`applicabilities\``;
|
|
224
|
+
}
|
|
225
|
+
return undefined;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Whether the engine's embedding catalog knows this provider, which decides where its model facts come from (#2516): catalog
|
|
229
|
+
* rows for an engine provider, the provider's own `models` declaration otherwise.
|
|
230
|
+
*/
|
|
231
|
+
export const isEmbeddingsCatalogProvider = (providerRef, catalog = EMBEDDINGS_MODEL_CATALOG) => Object.values(catalog).some((entry) => entry.providerRef === providerRef);
|
|
116
232
|
/** Why {@link resolveEmbeddingsModelForApplicability} could not answer — carried into a named CONFIGURATION error. */
|
|
117
233
|
export var Embeddings_ModelResolutionFailure;
|
|
118
234
|
(function (Embeddings_ModelResolutionFailure) {
|
|
119
235
|
/** The applicability has no candidate at all for this provider. */
|
|
120
236
|
Embeddings_ModelResolutionFailure["NO_CANDIDATE_FOR_PROVIDER"] = "no_candidate_for_provider";
|
|
237
|
+
/** An engine provider (one the catalog knows) also declares models; its models are catalog rows, so it is refused. */
|
|
238
|
+
Embeddings_ModelResolutionFailure["CATALOG_PROVIDER_DECLARES_MODELS"] = "catalog_provider_declares_models";
|
|
239
|
+
/** A declared model's `dims` is not a positive integer, so nothing could verify or index its vectors. */
|
|
240
|
+
Embeddings_ModelResolutionFailure["DECLARED_DIMS_INVALID"] = "declared_dims_invalid";
|
|
121
241
|
})(Embeddings_ModelResolutionFailure || (Embeddings_ModelResolutionFailure = {}));
|
|
122
242
|
/**
|
|
123
243
|
* Resolve an applicability class to ONE concrete embedding model for a given provider.
|
|
@@ -126,8 +246,27 @@ export var Embeddings_ModelResolutionFailure;
|
|
|
126
246
|
* fallback to some other model would fracture the vector space the class exists to keep whole.
|
|
127
247
|
* The resolved `(class, model)` pair is what the RAG drain worker stamps on every chunk and what
|
|
128
248
|
* its migration pass compares stamps against.
|
|
249
|
+
*
|
|
250
|
+
* Two sources, decided by whether the catalog knows the provider (as `resolveModelForApplicability`, #2516): an engine
|
|
251
|
+
* provider resolves through the preference and catalog and is refused if it also declares models; any other provider
|
|
252
|
+
* resolves from its `declaredModels`, the first declaring the applicability.
|
|
129
253
|
*/
|
|
130
254
|
export const resolveEmbeddingsModelForApplicability = (input, catalog = EMBEDDINGS_MODEL_CATALOG) => {
|
|
255
|
+
const declared = input.declaredModels ?? [];
|
|
256
|
+
const catalogKnowsProvider = isEmbeddingsCatalogProvider(input.providerRef, catalog);
|
|
257
|
+
if (catalogKnowsProvider && declared.length > 0) {
|
|
258
|
+
return { resolved: false, failure: Embeddings_ModelResolutionFailure.CATALOG_PROVIDER_DECLARES_MODELS, consideredModels: declared.map((entry) => entry.model) };
|
|
259
|
+
}
|
|
260
|
+
if (!catalogKnowsProvider) {
|
|
261
|
+
const chosen = declared.find((entry) => entry.applicabilities.includes(input.applicability));
|
|
262
|
+
if (chosen === undefined) {
|
|
263
|
+
return { resolved: false, failure: Embeddings_ModelResolutionFailure.NO_CANDIDATE_FOR_PROVIDER, consideredModels: declared.map((entry) => entry.model) };
|
|
264
|
+
}
|
|
265
|
+
if (!Number.isInteger(chosen.dims) || chosen.dims <= 0) {
|
|
266
|
+
return { resolved: false, failure: Embeddings_ModelResolutionFailure.DECLARED_DIMS_INVALID, consideredModels: [chosen.model] };
|
|
267
|
+
}
|
|
268
|
+
return { resolved: true, model: chosen.model, dims: chosen.dims };
|
|
269
|
+
}
|
|
131
270
|
const candidates = EMBEDDINGS_MODEL_APPLICABILITY_PREFERENCE[input.applicability];
|
|
132
271
|
const forProvider = candidates.filter((model) => {
|
|
133
272
|
const entry = catalog[model];
|
|
@@ -137,7 +276,7 @@ export const resolveEmbeddingsModelForApplicability = (input, catalog = EMBEDDIN
|
|
|
137
276
|
return { resolved: false, failure: Embeddings_ModelResolutionFailure.NO_CANDIDATE_FOR_PROVIDER, consideredModels: candidates };
|
|
138
277
|
}
|
|
139
278
|
const model = forProvider[0];
|
|
140
|
-
return { resolved: true, model,
|
|
279
|
+
return { resolved: true, model, dims: catalog[model].dims };
|
|
141
280
|
};
|
|
142
281
|
// ===============================================================
|
|
143
282
|
// Embeddings Operations Context
|