@wildo-ai/external-connectors-models 1.1.9 → 1.1.11
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/core/commons.external-connectors-models.schemas.d.ts +130 -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 +193 -0
- package/dist/esm/core/commons.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.d.ts +2 -0
- 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 +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts +1 -0
- 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 +10 -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 +8 -0
- package/dist/esm/protocols/billing.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/billing.standard-interface.schemas.js +8 -0
- 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/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 +37 -4
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js +57 -1
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/file-storage.standard-interface.d.ts +6 -0
- package/dist/esm/protocols/file-storage.standard-interface.d.ts.map +1 -1
- package/dist/esm/protocols/file-storage.standard-interface.js.map +1 -1
- 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 +388 -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 +238 -0
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts +70 -5
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js +96 -5
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.d.ts +446 -5
- 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 +406 -0
- package/dist/esm/protocols/rest-operations.external-connectors-models.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 +2 -2
|
@@ -29,18 +29,74 @@ export var Hook_ContentType;
|
|
|
29
29
|
Hook_ContentType["FORM_URLENCODED"] = "application/x-www-form-urlencoded";
|
|
30
30
|
Hook_ContentType["XML"] = "application/xml";
|
|
31
31
|
})(Hook_ContentType || (Hook_ContentType = {}));
|
|
32
|
+
/** @wildo_source:part:start external-connectors.models.hook-trigger-strategy facet:kind:api facet:audience:app-developer */
|
|
33
|
+
/**
|
|
34
|
+
* How a provider endpoint's requests are TRUSTED, and so what the engine does with them. A trust posture, kept apart from
|
|
35
|
+
* {@link Hook_SignatureAlgorithm}, which only says how a signature is checked.
|
|
36
|
+
*/
|
|
32
37
|
export var Hook_TriggerStrategy;
|
|
33
38
|
(function (Hook_TriggerStrategy) {
|
|
39
|
+
/** The vendor pushes events, verified by the endpoint's `signatureConfig`; a verified event is stored and handled. */
|
|
34
40
|
Hook_TriggerStrategy["WEBHOOK"] = "webhook";
|
|
35
41
|
Hook_TriggerStrategy["POLLING"] = "polling";
|
|
36
42
|
Hook_TriggerStrategy["APP_WEBHOOK"] = "app_webhook";
|
|
43
|
+
/**
|
|
44
|
+
* The vendor pushes a NOTIFICATION nobody can verify (#2909): it signs nothing (IgniSign). The request is never
|
|
45
|
+
* trusted. It only names an object (`reReadTrigger.identifyReference`), and the engine:
|
|
46
|
+
* - answers 202 whatever happens, so a sender learns nothing about which references exist;
|
|
47
|
+
* - drops it unless the endpoint's handler resolves the reference to a record of this application;
|
|
48
|
+
* - stores only the reference, under an id derived from the reference and a coalescing window, so one reference
|
|
49
|
+
* causes at most one re-read per window, one at a time, and a notification after that window's re-read is kept for
|
|
50
|
+
* the next window rather than lost;
|
|
51
|
+
* - limits the endpoint's request rate, and charges the re-read to a share of the vendor's declared rate budget, so a
|
|
52
|
+
* flood never spends what polling needs. The provider must therefore DECLARE a budget (`rateBudgets` on its
|
|
53
|
+
* connection, or `maxRequestsPerMinute`); without one the route is withheld.
|
|
54
|
+
* The handler then RE-READS the object from the vendor's authenticated API: what the record becomes is what the
|
|
55
|
+
* vendor answered there, never what the notification said. Its handler resolves the reference to a record in an
|
|
56
|
+
* organization or a person's data, never the application scope. Polling remains the latency floor under attack.
|
|
57
|
+
* Such an endpoint declares no `signatureConfig`.
|
|
58
|
+
*/
|
|
59
|
+
Hook_TriggerStrategy["WEBHOOK_TRIGGERS_POLL"] = "webhook_triggers_poll";
|
|
37
60
|
})(Hook_TriggerStrategy || (Hook_TriggerStrategy = {}));
|
|
61
|
+
/** The default coalescing window of a re-read trigger: one re-read per reference per minute. */
|
|
62
|
+
export const HOOK_REREAD_TRIGGER_DEFAULT_COALESCING_WINDOW_SECONDS = 60;
|
|
63
|
+
/** The default request rate of a re-read trigger endpoint, all senders together. */
|
|
64
|
+
export const HOOK_REREAD_TRIGGER_DEFAULT_RATE_LIMIT = { maxRequests: 120, windowSeconds: 60 };
|
|
65
|
+
/**
|
|
66
|
+
* Whether an endpoint only triggers re-reads (#2909): its requests are never verified, never trusted. Decided by an
|
|
67
|
+
* exhaustive switch, so a strategy added tomorrow must be classified here before anything compiles (review F9).
|
|
68
|
+
*/
|
|
69
|
+
export function isReReadTriggerEndpoint(endpoint) {
|
|
70
|
+
switch (endpoint.triggerStrategy) {
|
|
71
|
+
case Hook_TriggerStrategy.WEBHOOK_TRIGGERS_POLL:
|
|
72
|
+
return true;
|
|
73
|
+
case Hook_TriggerStrategy.WEBHOOK:
|
|
74
|
+
case Hook_TriggerStrategy.POLLING:
|
|
75
|
+
case Hook_TriggerStrategy.APP_WEBHOOK:
|
|
76
|
+
return false;
|
|
77
|
+
default: {
|
|
78
|
+
// Compile-time: a new member must be classified above. At run time, a value outside the vocabulary takes the SIGNED
|
|
79
|
+
// path, which verifies everything it accepts, so a malformed declaration can never be trusted unverified.
|
|
80
|
+
const unclassified = endpoint.triggerStrategy;
|
|
81
|
+
void unclassified;
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** Whether a re-read trigger's declared numbers can be enforced: every one a positive integer (#2909 review F6). */
|
|
87
|
+
export function reReadTriggerLimitsAreSound(trigger) {
|
|
88
|
+
const positiveInteger = (value) => value === undefined || (Number.isSafeInteger(value) && value >= 1);
|
|
89
|
+
return positiveInteger(trigger.coalescingWindowSeconds)
|
|
90
|
+
&& (trigger.rateLimit === undefined || (positiveInteger(trigger.rateLimit.maxRequests) && positiveInteger(trigger.rateLimit.windowSeconds)));
|
|
91
|
+
}
|
|
92
|
+
/** @wildo_source:part:end external-connectors.models.hook-trigger-strategy */
|
|
38
93
|
export var Hook_HandshakeType;
|
|
39
94
|
(function (Hook_HandshakeType) {
|
|
40
95
|
Hook_HandshakeType["NONE"] = "none";
|
|
41
96
|
Hook_HandshakeType["CHALLENGE_RESPONSE"] = "challenge_response";
|
|
42
97
|
Hook_HandshakeType["VERIFICATION_TOKEN"] = "verification_token";
|
|
43
98
|
})(Hook_HandshakeType || (Hook_HandshakeType = {}));
|
|
99
|
+
/** @wildo_source:part:start external-connectors.models.hook-signature-algorithms facet:kind:api facet:audience:app-developer */
|
|
44
100
|
export var Hook_SignatureAlgorithm;
|
|
45
101
|
(function (Hook_SignatureAlgorithm) {
|
|
46
102
|
Hook_SignatureAlgorithm["HMAC_SHA256"] = "hmac-sha256";
|
|
@@ -57,7 +113,43 @@ export var Hook_SignatureAlgorithm;
|
|
|
57
113
|
* format, versioned signature list and timestamp tolerance.
|
|
58
114
|
*/
|
|
59
115
|
Hook_SignatureAlgorithm["SVIX_V1"] = "svix-v1";
|
|
116
|
+
/**
|
|
117
|
+
* Slack's request signing, verified by the ENGINE (#2659): HMAC-SHA256 with the app's signing secret over
|
|
118
|
+
* `v0:{X-Slack-Request-Timestamp}:{raw body}`, sent as `X-Slack-Signature: v0=<hex>`, inside a five-minute
|
|
119
|
+
* window. It covers JSON events and form-encoded interactions and commands alike, because it signs the bytes.
|
|
120
|
+
* Slack signs no delivery id, so the endpoint names its events with `identifyEvent` (an `event_id` or a
|
|
121
|
+
* `trigger_id` read from the verified body).
|
|
122
|
+
*
|
|
123
|
+
* spec-cite: https://docs.slack.dev/authentication/verifying-requests-from-slack — basestring, header names,
|
|
124
|
+
* `v0=` hex signature, raw body, five-minute window.
|
|
125
|
+
*/
|
|
126
|
+
Hook_SignatureAlgorithm["SLACK_V0"] = "slack-v0";
|
|
127
|
+
/**
|
|
128
|
+
* The Bot Framework Connector's bearer token, verified by the ENGINE (#2659), for Microsoft Teams and every
|
|
129
|
+
* other Azure Bot Service channel. The request carries `Authorization: Bearer <JWT>`; the token must be
|
|
130
|
+
* signed with a key from the Connector's published key set under an algorithm its OpenID metadata names,
|
|
131
|
+
* with issuer `https://api.botframework.com`, audience equal to the bot's Microsoft App ID (the value the
|
|
132
|
+
* endpoint's secret resolves to), inside its validity period (five minutes' skew), a `serviceUrl` claim
|
|
133
|
+
* equal to the activity's `serviceUrl`, and a signing key endorsed for the activity's `channelId`.
|
|
134
|
+
* The activity carries its own `id`, which the endpoint's `identifyEvent` returns.
|
|
135
|
+
*
|
|
136
|
+
* spec-cite: https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-authentication
|
|
137
|
+
* — "Authenticate requests from the Bot Connector service to your bot", steps 2-4 and the seven
|
|
138
|
+
* numbered token requirements.
|
|
139
|
+
*/
|
|
140
|
+
Hook_SignatureAlgorithm["BOT_FRAMEWORK_JWT"] = "bot-framework-jwt";
|
|
60
141
|
})(Hook_SignatureAlgorithm || (Hook_SignatureAlgorithm = {}));
|
|
142
|
+
/**
|
|
143
|
+
* The algorithms the ENGINE verifies itself. An endpoint naming one needs no provider adapter, and cannot be
|
|
144
|
+
* given one: the scheme is engine code, so the one fail-closed decision of the inbound path never moves into a
|
|
145
|
+
* provider package. Every other algorithm is verified by the adapter its provider registers.
|
|
146
|
+
*/
|
|
147
|
+
export const HOOK_ENGINE_VERIFIED_SIGNATURE_ALGORITHMS = new Set([
|
|
148
|
+
Hook_SignatureAlgorithm.SVIX_V1,
|
|
149
|
+
Hook_SignatureAlgorithm.SLACK_V0,
|
|
150
|
+
Hook_SignatureAlgorithm.BOT_FRAMEWORK_JWT,
|
|
151
|
+
]);
|
|
152
|
+
/** @wildo_source:part:end external-connectors.models.hook-signature-algorithms */
|
|
61
153
|
export var Hook_DeliveryStatus;
|
|
62
154
|
(function (Hook_DeliveryStatus) {
|
|
63
155
|
Hook_DeliveryStatus["PENDING"] = "pending";
|
|
@@ -73,10 +165,25 @@ export const Hook_SignatureConfigSchema = z.object({
|
|
|
73
165
|
headerName: z.string(), // e.g., "X-Hub-Signature-256"
|
|
74
166
|
timestampHeader: z.string().optional(),
|
|
75
167
|
prefix: z.string().optional(), // e.g., "sha256="
|
|
168
|
+
/**
|
|
169
|
+
* `BOT_FRAMEWORK_JWT` only (#2663): the account fact, on an ORGANIZATION's connection to this provider, that names
|
|
170
|
+
* another bot App ID this endpoint admits as a token's audience, beside the application's own bot (the endpoint's
|
|
171
|
+
* secret). A token is admitted for an organization's bot only when that organization's ENABLED connection holds its
|
|
172
|
+
* audience as vendor evidence (`PROVIDER_CONNECTION_ROUTING_FACT_PROVENANCES`): for a bot, `VERIFIED_BY_VENDOR`, the
|
|
173
|
+
* App ID whose secret the token endpoint accepted at connect. Never as an administrator merely typed it. The delivery
|
|
174
|
+
* then carries that organization. Absent: the application's own bot is the only audience.
|
|
175
|
+
*/
|
|
176
|
+
organizationAudienceFact: z.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/).optional(),
|
|
76
177
|
});
|
|
77
178
|
// ===============================================================
|
|
78
179
|
// Webhook Trigger Spec
|
|
79
180
|
// ===============================================================
|
|
181
|
+
//
|
|
182
|
+
// Declared for a future webhook-SUBSCRIPTION operation (a provider operation that registers a trigger at the vendor).
|
|
183
|
+
// No engine code reads it today. In particular its handshake fields are NOT how a receiving endpoint answers a URL
|
|
184
|
+
// challenge: that is `Hook_Endpoint.answerHandshake`, a pure function of the verified request (#2659). The declarative
|
|
185
|
+
// `handshakeType` that `Hook_Endpoint` used to carry was removed then, because nothing read it, so a provider setting
|
|
186
|
+
// it got no answer at all.
|
|
80
187
|
export const Hook_TriggerSpecSchema = z.object({
|
|
81
188
|
strategy: z.enum(Hook_TriggerStrategy),
|
|
82
189
|
// Events
|
|
@@ -93,6 +200,137 @@ export const Hook_TriggerSpecSchema = z.object({
|
|
|
93
200
|
hasOnEnable: z.boolean().optional(),
|
|
94
201
|
hasOnDisable: z.boolean().optional(),
|
|
95
202
|
});
|
|
203
|
+
/**
|
|
204
|
+
* Who sees a chat conversation at the vendor (#2665 S6), which decides where an answer to it may be posted. The chat
|
|
205
|
+
* door reads it from the verified request (`Hook_InboundChatMessage.audience`) and the chat-conversation ledger records it.
|
|
206
|
+
*/
|
|
207
|
+
export var ChatConversationAudience;
|
|
208
|
+
(function (ChatConversationAudience) {
|
|
209
|
+
/** A one-to-one conversation with the bot (a Slack DM, a Teams personal chat): answered in it. */
|
|
210
|
+
ChatConversationAudience["DIRECT"] = "direct";
|
|
211
|
+
/**
|
|
212
|
+
* A conversation other people read (a channel, a group chat): answered privately, in the asker's own conversation with
|
|
213
|
+
* the bot, with a content-free pointer in the thread. A turn runs with the asker's authority, so its answer may name
|
|
214
|
+
* what the others in the thread cannot see.
|
|
215
|
+
*/
|
|
216
|
+
ChatConversationAudience["SHARED"] = "shared";
|
|
217
|
+
/** A shared conversation that reaches people outside the organization (Slack Connect, a Teams shared channel): the same. */
|
|
218
|
+
ChatConversationAudience["SHARED_WITH_EXTERNAL"] = "shared_with_external";
|
|
219
|
+
})(ChatConversationAudience || (ChatConversationAudience = {}));
|
|
220
|
+
/** Whether a vendor conversation is a thread or a flat stream of messages (#2665 S6, plan B11). */
|
|
221
|
+
export var Hook_ChatConversationThreading;
|
|
222
|
+
(function (Hook_ChatConversationThreading) {
|
|
223
|
+
/** A thread (a Slack thread, a Teams channel's reply chain): one conversation for its whole life. */
|
|
224
|
+
Hook_ChatConversationThreading["THREADED"] = "threaded";
|
|
225
|
+
/**
|
|
226
|
+
* A flat conversation (a top-level Slack DM, a Teams personal or group chat): split after a quiet gap measured on the
|
|
227
|
+
* vendor's clock, so one transcript never grows without bound.
|
|
228
|
+
*/
|
|
229
|
+
Hook_ChatConversationThreading["FLAT"] = "flat";
|
|
230
|
+
})(Hook_ChatConversationThreading || (Hook_ChatConversationThreading = {}));
|
|
231
|
+
/** The person who wrote a chat message, as the provider's chat accounts write them: what their chat identity link is keyed on. */
|
|
232
|
+
export const Hook_InboundChatSenderSchema = z.object({
|
|
233
|
+
/** The vendor's workspace or tenant (a Slack team id, a Microsoft tenant id). */
|
|
234
|
+
workspaceRef: z.string().min(1),
|
|
235
|
+
/** The vendor's own id for the person (a Slack user id, a Microsoft Entra object id). */
|
|
236
|
+
chatUserId: z.string().min(1),
|
|
237
|
+
/** How the vendor names the person: shown on the link page only, never matched on. */
|
|
238
|
+
chatUserDisplayName: z.string().optional(),
|
|
239
|
+
/** How the vendor names the workspace: shown on the link page only, never matched on. */
|
|
240
|
+
workspaceDisplayName: z.string().optional(),
|
|
241
|
+
});
|
|
242
|
+
/**
|
|
243
|
+
* A message a person wrote to the bot, as a verified request carries it (#2665 S6, plan A14). The chat door reads all of
|
|
244
|
+
* it from the request the engine verified, never from a handler, so a handler decides only WHETHER to converse.
|
|
245
|
+
*
|
|
246
|
+
* One schema, the type derived from it (#2665 S6 review L-B): the engine parses what a provider module's `chatMessageOf`
|
|
247
|
+
* returns with this very schema, so a field added here is checked at the engine's boundary the day it is added, and a
|
|
248
|
+
* value the module built wrong (an empty key, a date that is not one) is read as no message.
|
|
249
|
+
*/
|
|
250
|
+
export const Hook_InboundChatMessageSchema = z.object({
|
|
251
|
+
sender: Hook_InboundChatSenderSchema,
|
|
252
|
+
/** The vendor's conversation: a Slack thread or DM channel, a Teams conversation (a channel's reply chain included). */
|
|
253
|
+
conversationKey: z.string().min(1),
|
|
254
|
+
threading: z.enum(Hook_ChatConversationThreading),
|
|
255
|
+
audience: z.enum(ChatConversationAudience),
|
|
256
|
+
/** The vendor's own id for the message, the same on every retry of its delivery: what makes it one message. */
|
|
257
|
+
messageKey: z.string().min(1),
|
|
258
|
+
/** When the vendor says it was sent (Slack's `ts`, a Teams activity's `timestamp`): the clock a flat conversation's epochs follow. */
|
|
259
|
+
sentAt: z.date(),
|
|
260
|
+
/** What the person wrote, the bot's own mention removed. May be empty: the door answers that the message said nothing. */
|
|
261
|
+
text: z.string(),
|
|
262
|
+
/** Where an answer to this message goes, serialized by the vendor module and parsed back by its chat reply handler. */
|
|
263
|
+
replyTarget: z.string().min(1),
|
|
264
|
+
});
|
|
265
|
+
/**
|
|
266
|
+
* A chat COMMAND a person sent, as a verified request carries it (#2666 S7): a Slack slash command (`/todo add buy milk`)
|
|
267
|
+
* or a Teams message-extension form a person submitted. Read by the engine from the request it verified, so the command
|
|
268
|
+
* door runs what the person sent and never what a handler says they sent. One schema, the type derived from it: what a
|
|
269
|
+
* provider module's `chatCommandOf` returns is parsed with it, and a value built wrong is read as no command.
|
|
270
|
+
*/
|
|
271
|
+
export const Hook_InboundChatCommandSchema = z.object({
|
|
272
|
+
sender: Hook_InboundChatSenderSchema,
|
|
273
|
+
/**
|
|
274
|
+
* The command's verb: the word after a Slack command, a Teams command's id. Null when the person typed none (a bare
|
|
275
|
+
* `/todo`), which the door answers with the list of commands.
|
|
276
|
+
*/
|
|
277
|
+
verb: z.string().min(1).nullable(),
|
|
278
|
+
/** Slack: what follows the verb, the bot's mentions made readable. Teams: empty (the form's fields are in `values`). */
|
|
279
|
+
text: z.string(),
|
|
280
|
+
/** Teams: the submitted form, field by field, as the person filled it (strings, converted by the door). Slack: empty. */
|
|
281
|
+
values: z.record(z.string(), z.string()).default({}),
|
|
282
|
+
/** Who can read the conversation it was sent from, which decides where its answer goes. */
|
|
283
|
+
audience: z.enum(ChatConversationAudience),
|
|
284
|
+
/** Where the answer goes, serialized by the vendor module and parsed back by its command result handler. */
|
|
285
|
+
replyTarget: z.string().min(1),
|
|
286
|
+
});
|
|
287
|
+
/**
|
|
288
|
+
* A chat SEARCH a person typed (#2666 S7): a Teams message-extension search, sent as the person types and answered within
|
|
289
|
+
* the vendor's deadline in the same request, never stored. Read by the engine from the request it verified.
|
|
290
|
+
*/
|
|
291
|
+
export const Hook_InboundChatSearchSchema = z.object({
|
|
292
|
+
sender: Hook_InboundChatSenderSchema,
|
|
293
|
+
/** The search command's id, as declared in the vendor package (the operation's verb). */
|
|
294
|
+
verb: z.string().min(1),
|
|
295
|
+
/** What the person typed; empty for the default query. */
|
|
296
|
+
text: z.string(),
|
|
297
|
+
/** The default query a vendor sends when the search opens (Teams `initialRun`), recognised by its marker, never by an empty text. */
|
|
298
|
+
initialRun: z.boolean(),
|
|
299
|
+
/** How many results to skip: the vendor's paging. */
|
|
300
|
+
skip: z.number().int().nonnegative(),
|
|
301
|
+
/** The vendor's own id for this request, the only name an unstored request has (recorded on its audit row). */
|
|
302
|
+
vendorRequestId: z.string().min(1),
|
|
303
|
+
});
|
|
304
|
+
/** What the engine answers a chat search with, before the vendor module writes it in the vendor's own response (#2666 S7). */
|
|
305
|
+
export var Hook_ChatSearchAnswerKind;
|
|
306
|
+
(function (Hook_ChatSearchAnswerKind) {
|
|
307
|
+
/** Records the person may insert, each named and linked. Empty when this page has nothing (a later page of the results). */
|
|
308
|
+
Hook_ChatSearchAnswerKind["RESULTS"] = "results";
|
|
309
|
+
/** One plain sentence in place of results: nothing found, refused, keep typing, try again. Carries no formatting. */
|
|
310
|
+
Hook_ChatSearchAnswerKind["MESSAGE"] = "message";
|
|
311
|
+
/** The person's chat account is linked to no member yet: the page that links it, and the text of the action that opens it. */
|
|
312
|
+
Hook_ChatSearchAnswerKind["SIGN_IN"] = "sign_in";
|
|
313
|
+
})(Hook_ChatSearchAnswerKind || (Hook_ChatSearchAnswerKind = {}));
|
|
314
|
+
/** How an endpoint's synchronous answer writes its body. */
|
|
315
|
+
export var Hook_AcknowledgementEncoding;
|
|
316
|
+
(function (Hook_AcknowledgementEncoding) {
|
|
317
|
+
/** No body. Slack takes an empty 200 as "received, nothing to show"; it closes a submitted modal view. */
|
|
318
|
+
Hook_AcknowledgementEncoding["EMPTY"] = "empty";
|
|
319
|
+
/** `application/json`. */
|
|
320
|
+
Hook_AcknowledgementEncoding["JSON"] = "json";
|
|
321
|
+
/** `text/plain; charset=utf-8`. */
|
|
322
|
+
Hook_AcknowledgementEncoding["TEXT"] = "text";
|
|
323
|
+
})(Hook_AcknowledgementEncoding || (Hook_AcknowledgementEncoding = {}));
|
|
324
|
+
/** @wildo_source:part:end external-connectors.models.hook-inbound-endpoint */
|
|
325
|
+
/**
|
|
326
|
+
* Whether an endpoint's handler may act as the chat member its verified request names (#2664): the endpoint declares
|
|
327
|
+
* {@link Hook_Endpoint.namesChatMember}, AND the engine verifies it. A declaration on an endpoint a provider adapter
|
|
328
|
+
* verifies is not honored, so the decision rests on engine code alone.
|
|
329
|
+
*/
|
|
330
|
+
export function hookEndpointNamesChatMember(endpoint) {
|
|
331
|
+
const algorithm = endpoint.signatureConfig?.algorithm;
|
|
332
|
+
return endpoint.namesChatMember === true && algorithm !== undefined && HOOK_ENGINE_VERIFIED_SIGNATURE_ALGORITHMS.has(algorithm);
|
|
333
|
+
}
|
|
96
334
|
// ===============================================================
|
|
97
335
|
// Webhook Operation Context
|
|
98
336
|
// ===============================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.external-connectors-models.schemas.js","sourceRoot":"","sources":["../../../../src/protocols/hooks.external-connectors-models.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EAGf,MAA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AO,EAAE,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AA4IH,kEAAkE;AAClE,4BAA4B;AAC5B,kEAAkE;AAElE,MAAM,CAAC,MAAM,2BAA2B,GAAG,uCAAuC,CAAC,MAAM,CAAC;IACxF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC;IAC3C,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACzC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { \n API_HttpMethod, \n ExternalProvider_ExchangeProtocol_Configuration_Base, \n ExternalProvider_ExchangeProtocol_Kind \n} from \"../core/commons.external-connectors-models.schemas\";\nimport { ExternalProvider_Auth_Kind } from \"../core/security.external-connectors-models.schemas\";\nimport { ExternalProvider_OperationContextSchema, ExternalProvider_OperationDefinition_Base } from \"../core/operations.external-connectors-models.schemas\";\n\n//===============================================================\n// Webhook/Hooks Provider\n// --------\n// Schema definitions for webhook integrations.\n// Supports event subscriptions, signature verification, and\n// delivery management.\n//===============================================================\n\n// ===============================================================\n// Webhook Enums\n// ===============================================================\n\nexport const Hook_HttpMethods: readonly API_HttpMethod[] = [\n API_HttpMethod.POST,\n API_HttpMethod.PUT,\n API_HttpMethod.PATCH,\n];\n\nexport const Hook_SecurityType: readonly ExternalProvider_Auth_Kind[] = [\n ExternalProvider_Auth_Kind.NONE,\n ExternalProvider_Auth_Kind.HMAC_SIGNATURE,\n ExternalProvider_Auth_Kind.BEARER,\n ExternalProvider_Auth_Kind.BASIC,\n];\n\nexport enum Hook_ContentType {\n JSON = \"application/json\",\n FORM_URLENCODED = \"application/x-www-form-urlencoded\",\n XML = \"application/xml\",\n}\n\nexport enum Hook_TriggerStrategy {\n WEBHOOK = \"webhook\",\n POLLING = \"polling\",\n APP_WEBHOOK = \"app_webhook\",\n}\n\nexport enum Hook_HandshakeType {\n NONE = \"none\",\n CHALLENGE_RESPONSE = \"challenge_response\",\n VERIFICATION_TOKEN = \"verification_token\",\n}\n\nexport enum Hook_SignatureAlgorithm {\n HMAC_SHA256 = \"hmac-sha256\",\n HMAC_SHA512 = \"hmac-sha512\",\n HMAC_SHA1 = \"hmac-sha1\",\n /**\n * The Svix / Standard Webhooks v1 construction, verified by the ENGINE (#1600): HMAC-SHA256 over\n * `{svix-id}.{svix-timestamp}.{rawBody}` with the base64 key of a `whsec_` secret, any listed `v1,` signature\n * matching, inside a five-minute window. An endpoint declaring it needs no provider adapter — the provider\n * cannot supply a verifier for it, which is the point: the one fail-closed decision of the inbound path stays\n * in engine code. `svix-id` is the delivery's dedup key.\n *\n * spec-cite: https://docs.svix.com/receiving/verifying-payloads/how-manual — headers, signed content, secret\n * format, versioned signature list and timestamp tolerance.\n */\n SVIX_V1 = \"svix-v1\",\n}\n\nexport enum Hook_DeliveryStatus {\n PENDING = \"pending\",\n DELIVERED = \"delivered\",\n FAILED = \"failed\",\n RETRYING = \"retrying\",\n}\n\n// ===============================================================\n// Webhook Signature Config\n// ===============================================================\n\nexport const Hook_SignatureConfigSchema = z.object({\n algorithm: z.enum(Hook_SignatureAlgorithm),\n headerName: z.string(), // e.g., \"X-Hub-Signature-256\"\n timestampHeader: z.string().optional(),\n prefix: z.string().optional(), // e.g., \"sha256=\"\n});\nexport type Hook_SignatureConfig = z.infer<typeof Hook_SignatureConfigSchema>;\n\n// ===============================================================\n// Webhook Trigger Spec\n// ===============================================================\n\nexport const Hook_TriggerSpecSchema = z.object({\n strategy: z.enum(Hook_TriggerStrategy),\n \n // Events\n eventTypes: z.array(z.string()).optional(),\n \n // Handshake\n handshakeType: z.enum(Hook_HandshakeType).optional(),\n challengeField: z.string().optional(),\n \n // Signature\n signatureConfig: Hook_SignatureConfigSchema.optional(),\n \n // Polling (for POLLING strategy)\n pollingIntervalMs: z.number().optional(),\n deduplicationKey: z.string().optional(),\n \n // Lifecycle\n hasOnEnable: z.boolean().optional(),\n hasOnDisable: z.boolean().optional(),\n});\nexport type Hook_TriggerSpec = z.infer<typeof Hook_TriggerSpecSchema>;\n\n// ===============================================================\n// Webhook Endpoint Scope Binding (Declarative Scope Resolution)\n// ===============================================================\n\n/**\n * Variant config for polymorphic scope resolution.\n * Each entry represents one variant collection to query during lookup.\n */\nexport interface Hook_PolymorphicVariantBinding {\n /** Variant resource type to query (e.g., 'organizationBillingAccounts') */\n resourceType: string;\n /** Parent resource type (e.g., 'organizations') */\n parentResourceType: string;\n /** Parent field identifier — the scope entity ID field on matched documents (e.g., 'organizationId') */\n parentFieldIdentifier: string;\n /** Whether this variant's parent is a primary scope entity */\n isPrimaryScope: boolean;\n}\n\n/**\n * Declarative scope resolution config for a webhook endpoint.\n * \n * Determines how an incoming webhook event is mapped to a engine scope\n * (organization or user) without writing per-capability code.\n * \n * Three modes:\n * - APPLICATION: Global events, no lookup needed.\n * - Single-scope (ORGANIZATIONS / USER_SELF): Extract an ID from the\n * event payload, look up a single resource type, and resolve the scope entity ID.\n * - Polymorphic: Extract an ID from the event payload, query N variant collections\n * in order, and resolve the scope from whichever variant matches. Used when a\n * resource has been polymorphically expanded across multiple scope types.\n */\nexport type Hook_EndpointScopeBinding =\n | {\n /** Global/application-scoped events — no entity lookup needed */\n primaryScope: 'APPLICATION';\n }\n | {\n /** Scoped events — requires payload extraction + resource lookup */\n primaryScope: 'ORGANIZATIONS' | 'USER_SELF';\n /** Dot-path into the parsed event payload to extract the provider's scope ID (e.g., 'data.object.customer') */\n payloadScopeIdPath: string;\n /** Resource type to query for scope resolution (e.g., 'BILLING_ACCOUNTS') */\n lookupResourceType: string;\n /** Field on the resource to match the extracted ID (e.g., 'providerCustomerId') */\n lookupField: string;\n /** Field on the found resource that gives the scope entity ID (defaults to 'organizationId'/'userId' based on primaryScope) */\n scopeEntityIdField?: string;\n /** Event types that don't carry scope — fall back to APPLICATION scope (e.g., 'product.created', 'price.updated') */\n scopeExemptEventTypes?: string[];\n }\n | {\n /** Polymorphic scope resolution — queries multiple variant collections */\n mode: 'polymorphic';\n /** Dot-path into the parsed event payload to extract the provider's scope ID (e.g., 'data.object.customer') */\n payloadScopeIdPath: string;\n /** Field on each variant resource to match the extracted ID (e.g., 'providerCustomerId') */\n lookupField: string;\n /** Variant collections to query, in order. First match wins. */\n variants: Hook_PolymorphicVariantBinding[];\n /** Event types that don't carry scope — fall back to APPLICATION scope (e.g., 'product.created', 'price.updated') */\n scopeExemptEventTypes?: string[];\n /**\n * Per-event-type overrides for payloadScopeIdPath.\n * Keyed by the provider's native event type (e.g., 'customer.deleted').\n * Use when different event types carry the scope ID at different payload paths.\n */\n eventTypeOverrides?: Record<string, { payloadScopeIdPath: string }>;\n };\n\n// ===============================================================\n// Webhook Endpoint\n// ===============================================================\n\n/**\n * A webhook endpoint for a specific domain/capability within a provider.\n * \n * Each endpoint generates a route: POST /webhooks/{providerRef}/{endpointKey}\n * \n * The endpoint is the SINGLE SOURCE OF TRUTH for all webhook metadata:\n * - Signature config (how to verify)\n * - Event types (what this endpoint handles)\n * - Scope binding (how events map to engine scope)\n * \n * Examples:\n * Stripe: { key: 'billing', capability: 'billing', ... }\n * Google: { key: 'calendar', capability: 'calendar', ... }, { key: 'drive', ... }\n * Microsoft: { key: 'graph', ... }, { key: 'teams', ... }\n */\nexport type Hook_Endpoint = {\n /** Unique key within this provider (used in route: /webhooks/stripe/{key}) */\n key: string;\n /**\n * Optional human-readable name. The runtime projection emitted by\n * `getDefaultProviderConfiguration` does not set this (verified\n * 2026-05-06 — no consumer reads `endpoint.displayName` anywhere\n * in the engine or in `external-connectors-public`); requiring it\n * was aspirational. Future admin/UI surfaces that want to display\n * webhook endpoints should treat the field as optional and fall\n * back to `key` when absent.\n */\n displayName?: string;\n /** Which capability this endpoint serves */\n capability: string;\n /** Signature verification config for this endpoint */\n signatureConfig: Hook_SignatureConfig;\n /** Trigger strategy (webhook push, polling, app_webhook) */\n triggerStrategy: Hook_TriggerStrategy;\n /** Handshake type if applicable */\n handshakeType?: Hook_HandshakeType;\n /** Event types this endpoint handles (single source of truth) */\n eventTypes: string[];\n /** Declarative scope binding — how events map to engine scope */\n scopeBinding: Hook_EndpointScopeBinding;\n /**\n * The largest body this endpoint accepts, in bytes, when an inbound handler takes its events (#1596).\n * A larger delivery is refused 413 and audited. Per ENDPOINT, not per route prefix: capping the whole\n * `/webhooks/` family would cap every provider at the smallest endpoint's size. Omitted, the server's\n * own body limit applies.\n */\n maxBodyBytes?: number;\n};\n\n// ===============================================================\n// Webhook Provider Configuration\n// ===============================================================\n\nexport type HookInitiatorProvider_Configuration = ExternalProvider_ExchangeProtocol_Configuration_Base & {\n /** Webhook endpoints — each generates a route: POST /webhooks/{providerRef}/{endpointKey} */\n endpoints: Hook_Endpoint[];\n /** Per-endpoint webhook secrets: endpointKey → secret value */\n endpointSecrets?: Record<string, string>;\n /** Fallback secret if not specified per-endpoint (legacy compat) */\n webhookSecret?: string;\n};\n\n// ===============================================================\n// Webhook Operation Context\n// ===============================================================\n\nexport const Hook_OperationContextSchema = ExternalProvider_OperationContextSchema.extend({\n eventType: z.string(),\n eventId: z.string().optional(),\n deliveryStatus: z.enum(Hook_DeliveryStatus),\n signatureVerified: z.boolean().optional(),\n pollingCursor: z.string().optional(),\n});\nexport type Hook_OperationContext = z.infer<typeof Hook_OperationContextSchema>;\n\n// ===============================================================\n// Webhook Operation Definition\n// ===============================================================\n\nexport type Hook_OperationDefinition = ExternalProvider_OperationDefinition_Base & {\n triggerSpec: Hook_TriggerSpec;\n operationContextSchema: typeof Hook_OperationContextSchema;\n samplePayload?: unknown;\n};\n\n"]}
|
|
1
|
+
{"version":3,"file":"hooks.external-connectors-models.schemas.js","sourceRoot":"","sources":["../../../../src/protocols/hooks.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A8E;AAE9E;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,QAAoE;IAC9G,MAAM,SAAS,GAAG,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC;IACtD,OAAO,QAAQ,CAAC,eAAe,KAAK,IAAI,IAAI,SAAS,KAAK,SAAS,IAAI,yCAAyC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAClI,CAAC;AAeD,kEAAkE;AAClE,4BAA4B;AAC5B,kEAAkE;AAElE,MAAM,CAAC,MAAM,2BAA2B,GAAG,uCAAuC,CAAC,MAAM,CAAC;IACxF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC;IAC3C,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACzC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { \n API_HttpMethod, \n ExternalProvider_ExchangeProtocol_Configuration_Base, \n ExternalProvider_ExchangeProtocol_Kind \n} from \"../core/commons.external-connectors-models.schemas\";\nimport { ExternalProvider_Auth_Kind } from \"../core/security.external-connectors-models.schemas\";\nimport { ExternalProvider_OperationContextSchema, ExternalProvider_OperationDefinition_Base } from \"../core/operations.external-connectors-models.schemas\";\n\n//===============================================================\n// Webhook/Hooks Provider\n// --------\n// Schema definitions for webhook integrations.\n// Supports event subscriptions, signature verification, and\n// delivery management.\n//===============================================================\n\n// ===============================================================\n// Webhook Enums\n// ===============================================================\n\nexport const Hook_HttpMethods: readonly API_HttpMethod[] = [\n API_HttpMethod.POST,\n API_HttpMethod.PUT,\n API_HttpMethod.PATCH,\n];\n\nexport const Hook_SecurityType: readonly ExternalProvider_Auth_Kind[] = [\n ExternalProvider_Auth_Kind.NONE,\n ExternalProvider_Auth_Kind.HMAC_SIGNATURE,\n ExternalProvider_Auth_Kind.BEARER,\n ExternalProvider_Auth_Kind.BASIC,\n];\n\nexport enum Hook_ContentType {\n JSON = \"application/json\",\n FORM_URLENCODED = \"application/x-www-form-urlencoded\",\n XML = \"application/xml\",\n}\n\n/** @wildo_source:part:start external-connectors.models.hook-trigger-strategy facet:kind:api facet:audience:app-developer */\n/**\n * How a provider endpoint's requests are TRUSTED, and so what the engine does with them. A trust posture, kept apart from\n * {@link Hook_SignatureAlgorithm}, which only says how a signature is checked.\n */\nexport enum Hook_TriggerStrategy {\n /** The vendor pushes events, verified by the endpoint's `signatureConfig`; a verified event is stored and handled. */\n WEBHOOK = \"webhook\",\n POLLING = \"polling\",\n APP_WEBHOOK = \"app_webhook\",\n /**\n * The vendor pushes a NOTIFICATION nobody can verify (#2909): it signs nothing (IgniSign). The request is never\n * trusted. It only names an object (`reReadTrigger.identifyReference`), and the engine:\n * - answers 202 whatever happens, so a sender learns nothing about which references exist;\n * - drops it unless the endpoint's handler resolves the reference to a record of this application;\n * - stores only the reference, under an id derived from the reference and a coalescing window, so one reference\n * causes at most one re-read per window, one at a time, and a notification after that window's re-read is kept for\n * the next window rather than lost;\n * - limits the endpoint's request rate, and charges the re-read to a share of the vendor's declared rate budget, so a\n * flood never spends what polling needs. The provider must therefore DECLARE a budget (`rateBudgets` on its\n * connection, or `maxRequestsPerMinute`); without one the route is withheld.\n * The handler then RE-READS the object from the vendor's authenticated API: what the record becomes is what the\n * vendor answered there, never what the notification said. Its handler resolves the reference to a record in an\n * organization or a person's data, never the application scope. Polling remains the latency floor under attack.\n * Such an endpoint declares no `signatureConfig`.\n */\n WEBHOOK_TRIGGERS_POLL = \"webhook_triggers_poll\",\n}\n\n/**\n * What a {@link Hook_TriggerStrategy.WEBHOOK_TRIGGERS_POLL} endpoint declares (#2909). Pure functions and numbers only:\n * the request is unverified, so nothing in it is believed beyond the reference it names.\n */\nexport interface Hook_ReReadTrigger {\n /**\n * The vendor's reference to the object the notification is about (a signature request id), read from the decoded,\n * UNVERIFIED body, or `null` when it names none. It is only ever looked up and re-read, never trusted. Pure: no I/O.\n */\n readonly identifyReference: (request: Hook_InboundRequest) => string | null;\n /**\n * The coalescing window, in seconds (default {@link HOOK_REREAD_TRIGGER_DEFAULT_COALESCING_WINDOW_SECONDS}): a reference\n * is re-read at most once per window, the windows aligned on the clock. A notification arriving once its window's\n * re-read is already stored is kept for the NEXT window, due at its start, so the last change a vendor reports is\n * never lost. A positive integer; the route is withheld otherwise.\n */\n readonly coalescingWindowSeconds?: number;\n /**\n * The most requests the endpoint takes per window, from every sender together (default\n * {@link HOOK_REREAD_TRIGGER_DEFAULT_RATE_LIMIT}). Past it a request is dropped, still answered 202. Positive integers.\n */\n readonly rateLimit?: { readonly maxRequests: number; readonly windowSeconds: number };\n}\n\n/** The default coalescing window of a re-read trigger: one re-read per reference per minute. */\nexport const HOOK_REREAD_TRIGGER_DEFAULT_COALESCING_WINDOW_SECONDS = 60;\n/** The default request rate of a re-read trigger endpoint, all senders together. */\nexport const HOOK_REREAD_TRIGGER_DEFAULT_RATE_LIMIT = { maxRequests: 120, windowSeconds: 60 } as const;\n\n/**\n * Whether an endpoint only triggers re-reads (#2909): its requests are never verified, never trusted. Decided by an\n * exhaustive switch, so a strategy added tomorrow must be classified here before anything compiles (review F9).\n */\nexport function isReReadTriggerEndpoint(endpoint: Pick<Hook_Endpoint, 'triggerStrategy'>): boolean {\n switch (endpoint.triggerStrategy) {\n case Hook_TriggerStrategy.WEBHOOK_TRIGGERS_POLL:\n return true;\n case Hook_TriggerStrategy.WEBHOOK:\n case Hook_TriggerStrategy.POLLING:\n case Hook_TriggerStrategy.APP_WEBHOOK:\n return false;\n default: {\n // Compile-time: a new member must be classified above. At run time, a value outside the vocabulary takes the SIGNED\n // path, which verifies everything it accepts, so a malformed declaration can never be trusted unverified.\n const unclassified: never = endpoint.triggerStrategy;\n void unclassified;\n return false;\n }\n }\n}\n\n/** Whether a re-read trigger's declared numbers can be enforced: every one a positive integer (#2909 review F6). */\nexport function reReadTriggerLimitsAreSound(trigger: Pick<Hook_ReReadTrigger, 'coalescingWindowSeconds' | 'rateLimit'>): boolean {\n const positiveInteger = (value: number | undefined) => value === undefined || (Number.isSafeInteger(value) && value >= 1);\n return positiveInteger(trigger.coalescingWindowSeconds)\n && (trigger.rateLimit === undefined || (positiveInteger(trigger.rateLimit.maxRequests) && positiveInteger(trigger.rateLimit.windowSeconds)));\n}\n/** @wildo_source:part:end external-connectors.models.hook-trigger-strategy */\n\nexport enum Hook_HandshakeType {\n NONE = \"none\",\n CHALLENGE_RESPONSE = \"challenge_response\",\n VERIFICATION_TOKEN = \"verification_token\",\n}\n\n/** @wildo_source:part:start external-connectors.models.hook-signature-algorithms facet:kind:api facet:audience:app-developer */\nexport enum Hook_SignatureAlgorithm {\n HMAC_SHA256 = \"hmac-sha256\",\n HMAC_SHA512 = \"hmac-sha512\",\n HMAC_SHA1 = \"hmac-sha1\",\n /**\n * The Svix / Standard Webhooks v1 construction, verified by the ENGINE (#1600): HMAC-SHA256 over\n * `{svix-id}.{svix-timestamp}.{rawBody}` with the base64 key of a `whsec_` secret, any listed `v1,` signature\n * matching, inside a five-minute window. An endpoint declaring it needs no provider adapter — the provider\n * cannot supply a verifier for it, which is the point: the one fail-closed decision of the inbound path stays\n * in engine code. `svix-id` is the delivery's dedup key.\n *\n * spec-cite: https://docs.svix.com/receiving/verifying-payloads/how-manual — headers, signed content, secret\n * format, versioned signature list and timestamp tolerance.\n */\n SVIX_V1 = \"svix-v1\",\n /**\n * Slack's request signing, verified by the ENGINE (#2659): HMAC-SHA256 with the app's signing secret over\n * `v0:{X-Slack-Request-Timestamp}:{raw body}`, sent as `X-Slack-Signature: v0=<hex>`, inside a five-minute\n * window. It covers JSON events and form-encoded interactions and commands alike, because it signs the bytes.\n * Slack signs no delivery id, so the endpoint names its events with `identifyEvent` (an `event_id` or a\n * `trigger_id` read from the verified body).\n *\n * spec-cite: https://docs.slack.dev/authentication/verifying-requests-from-slack — basestring, header names,\n * `v0=` hex signature, raw body, five-minute window.\n */\n SLACK_V0 = \"slack-v0\",\n /**\n * The Bot Framework Connector's bearer token, verified by the ENGINE (#2659), for Microsoft Teams and every\n * other Azure Bot Service channel. The request carries `Authorization: Bearer <JWT>`; the token must be\n * signed with a key from the Connector's published key set under an algorithm its OpenID metadata names,\n * with issuer `https://api.botframework.com`, audience equal to the bot's Microsoft App ID (the value the\n * endpoint's secret resolves to), inside its validity period (five minutes' skew), a `serviceUrl` claim\n * equal to the activity's `serviceUrl`, and a signing key endorsed for the activity's `channelId`.\n * The activity carries its own `id`, which the endpoint's `identifyEvent` returns.\n *\n * spec-cite: https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-authentication\n * — \"Authenticate requests from the Bot Connector service to your bot\", steps 2-4 and the seven\n * numbered token requirements.\n */\n BOT_FRAMEWORK_JWT = \"bot-framework-jwt\",\n}\n\n/**\n * The algorithms the ENGINE verifies itself. An endpoint naming one needs no provider adapter, and cannot be\n * given one: the scheme is engine code, so the one fail-closed decision of the inbound path never moves into a\n * provider package. Every other algorithm is verified by the adapter its provider registers.\n */\nexport const HOOK_ENGINE_VERIFIED_SIGNATURE_ALGORITHMS: ReadonlySet<Hook_SignatureAlgorithm> = new Set([\n Hook_SignatureAlgorithm.SVIX_V1,\n Hook_SignatureAlgorithm.SLACK_V0,\n Hook_SignatureAlgorithm.BOT_FRAMEWORK_JWT,\n]);\n/** @wildo_source:part:end external-connectors.models.hook-signature-algorithms */\n\nexport enum Hook_DeliveryStatus {\n PENDING = \"pending\",\n DELIVERED = \"delivered\",\n FAILED = \"failed\",\n RETRYING = \"retrying\",\n}\n\n// ===============================================================\n// Webhook Signature Config\n// ===============================================================\n\nexport const Hook_SignatureConfigSchema = z.object({\n algorithm: z.enum(Hook_SignatureAlgorithm),\n headerName: z.string(), // e.g., \"X-Hub-Signature-256\"\n timestampHeader: z.string().optional(),\n prefix: z.string().optional(), // e.g., \"sha256=\"\n /**\n * `BOT_FRAMEWORK_JWT` only (#2663): the account fact, on an ORGANIZATION's connection to this provider, that names\n * another bot App ID this endpoint admits as a token's audience, beside the application's own bot (the endpoint's\n * secret). A token is admitted for an organization's bot only when that organization's ENABLED connection holds its\n * audience as vendor evidence (`PROVIDER_CONNECTION_ROUTING_FACT_PROVENANCES`): for a bot, `VERIFIED_BY_VENDOR`, the\n * App ID whose secret the token endpoint accepted at connect. Never as an administrator merely typed it. The delivery\n * then carries that organization. Absent: the application's own bot is the only audience.\n */\n organizationAudienceFact: z.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/).optional(),\n});\nexport type Hook_SignatureConfig = z.infer<typeof Hook_SignatureConfigSchema>;\n\n// ===============================================================\n// Webhook Trigger Spec\n// ===============================================================\n//\n// Declared for a future webhook-SUBSCRIPTION operation (a provider operation that registers a trigger at the vendor).\n// No engine code reads it today. In particular its handshake fields are NOT how a receiving endpoint answers a URL\n// challenge: that is `Hook_Endpoint.answerHandshake`, a pure function of the verified request (#2659). The declarative\n// `handshakeType` that `Hook_Endpoint` used to carry was removed then, because nothing read it, so a provider setting\n// it got no answer at all.\n\nexport const Hook_TriggerSpecSchema = z.object({\n strategy: z.enum(Hook_TriggerStrategy),\n \n // Events\n eventTypes: z.array(z.string()).optional(),\n \n // Handshake\n handshakeType: z.enum(Hook_HandshakeType).optional(),\n challengeField: z.string().optional(),\n \n // Signature\n signatureConfig: Hook_SignatureConfigSchema.optional(),\n \n // Polling (for POLLING strategy)\n pollingIntervalMs: z.number().optional(),\n deduplicationKey: z.string().optional(),\n \n // Lifecycle\n hasOnEnable: z.boolean().optional(),\n hasOnDisable: z.boolean().optional(),\n});\nexport type Hook_TriggerSpec = z.infer<typeof Hook_TriggerSpecSchema>;\n\n// ===============================================================\n// Webhook Endpoint Scope Binding (Declarative Scope Resolution)\n// ===============================================================\n\n/**\n * Variant config for polymorphic scope resolution.\n * Each entry represents one variant collection to query during lookup.\n */\nexport interface Hook_PolymorphicVariantBinding {\n /** Variant resource type to query (e.g., 'organizationBillingAccounts') */\n resourceType: string;\n /** Parent resource type (e.g., 'organizations') */\n parentResourceType: string;\n /** Parent field identifier — the scope entity ID field on matched documents (e.g., 'organizationId') */\n parentFieldIdentifier: string;\n /** Whether this variant's parent is a primary scope entity */\n isPrimaryScope: boolean;\n}\n\n/**\n * Declarative scope resolution config for a webhook endpoint.\n * \n * Determines how an incoming webhook event is mapped to a engine scope\n * (organization or user) without writing per-capability code.\n * \n * Three modes:\n * - APPLICATION: Global events, no lookup needed.\n * - Single-scope (ORGANIZATIONS / USER_SELF): Extract an ID from the\n * event payload, look up a single resource type, and resolve the scope entity ID.\n * - Polymorphic: Extract an ID from the event payload, query N variant collections\n * in order, and resolve the scope from whichever variant matches. Used when a\n * resource has been polymorphically expanded across multiple scope types.\n */\nexport type Hook_EndpointScopeBinding =\n | {\n /** Global/application-scoped events — no entity lookup needed */\n primaryScope: 'APPLICATION';\n }\n | {\n /** Scoped events — requires payload extraction + resource lookup */\n primaryScope: 'ORGANIZATIONS' | 'USER_SELF';\n /** Dot-path into the parsed event payload to extract the provider's scope ID (e.g., 'data.object.customer') */\n payloadScopeIdPath: string;\n /** Resource type to query for scope resolution (e.g., 'BILLING_ACCOUNTS') */\n lookupResourceType: string;\n /** Field on the resource to match the extracted ID (e.g., 'providerCustomerId') */\n lookupField: string;\n /** Field on the found resource that gives the scope entity ID (defaults to 'organizationId'/'userId' based on primaryScope) */\n scopeEntityIdField?: string;\n /** Event types that don't carry scope — fall back to APPLICATION scope (e.g., 'product.created', 'price.updated') */\n scopeExemptEventTypes?: string[];\n }\n | {\n /** Polymorphic scope resolution — queries multiple variant collections */\n mode: 'polymorphic';\n /** Dot-path into the parsed event payload to extract the provider's scope ID (e.g., 'data.object.customer') */\n payloadScopeIdPath: string;\n /** Field on each variant resource to match the extracted ID (e.g., 'providerCustomerId') */\n lookupField: string;\n /** Variant collections to query, in order. First match wins. */\n variants: Hook_PolymorphicVariantBinding[];\n /** Event types that don't carry scope — fall back to APPLICATION scope (e.g., 'product.created', 'price.updated') */\n scopeExemptEventTypes?: string[];\n /**\n * Per-event-type overrides for payloadScopeIdPath.\n * Keyed by the provider's native event type (e.g., 'customer.deleted').\n * Use when different event types carry the scope ID at different payload paths.\n */\n eventTypeOverrides?: Record<string, { payloadScopeIdPath: string }>;\n };\n\n// ===============================================================\n// The verified request, and what an endpoint answers to it (#2659)\n// ===============================================================\n\n/** @wildo_source:part:start external-connectors.models.hook-inbound-endpoint facet:kind:api facet:audience:app-developer */\n/**\n * A provider request AFTER the engine verified it, as an endpoint's pure functions read it.\n *\n * Only ever built from a request whose signature or token the engine accepted, so everything in it, the\n * decoded body included, is what the sender signed (or, for a bearer-token scheme, what an authenticated\n * sender sent over TLS).\n */\nexport interface Hook_InboundRequest {\n /** The exact bytes received. */\n readonly rawBody: Uint8Array;\n /** Every request header, names lower-cased as Node delivers them. */\n readonly headers: Readonly<Record<string, string | readonly string[] | undefined>>;\n /** The media type the body was decoded as: one of the endpoint's `contentTypes`. */\n readonly contentType: Hook_ContentType;\n /**\n * The decoded body. JSON: the parsed value. A form: its fields, a field sent more than once becoming an array of\n * its values in order; bracket names (`a[b]`) are kept as written, never expanded into objects.\n */\n readonly body: unknown;\n}\n\n/** What identifies one provider event: the id the store deduplicates on, and the type a handler is chosen by. */\nexport interface Hook_InboundEventIdentity {\n /** Unique per event at the provider, and stable across its retries. */\n readonly eventId: string;\n /** The provider's own name for the event (`app_mention`, `block_actions`, `invoke`, …). */\n readonly providerEventType: string;\n}\n\n/**\n * A person's PERSONAL (one-to-one) conversation with the bot, as a verified request names it (#2664 S5b): who the person\n * is (the same account their chat identity link is keyed on) and where the bot can post to them later.\n */\nexport interface Hook_InboundPersonalConversation {\n /** The vendor's workspace or tenant, exactly as the provider's chat accounts write it (a lower-cased tenant id). */\n readonly workspaceRef: string;\n /** The vendor's id for the person, exactly as the provider's chat accounts write it (a lower-cased Entra object id). */\n readonly chatUserId: string;\n /** The conversation's id at the vendor. */\n readonly conversationId: string;\n /** Where the vendor takes messages for that conversation (the Bot Connector's `serviceUrl`). */\n readonly serviceUrl: string;\n}\n\n/**\n * Who sees a chat conversation at the vendor (#2665 S6), which decides where an answer to it may be posted. The chat\n * door reads it from the verified request (`Hook_InboundChatMessage.audience`) and the chat-conversation ledger records it.\n */\nexport enum ChatConversationAudience {\n /** A one-to-one conversation with the bot (a Slack DM, a Teams personal chat): answered in it. */\n DIRECT = 'direct',\n /**\n * A conversation other people read (a channel, a group chat): answered privately, in the asker's own conversation with\n * the bot, with a content-free pointer in the thread. A turn runs with the asker's authority, so its answer may name\n * what the others in the thread cannot see.\n */\n SHARED = 'shared',\n /** A shared conversation that reaches people outside the organization (Slack Connect, a Teams shared channel): the same. */\n SHARED_WITH_EXTERNAL = 'shared_with_external',\n}\n\n/** Whether a vendor conversation is a thread or a flat stream of messages (#2665 S6, plan B11). */\nexport enum Hook_ChatConversationThreading {\n /** A thread (a Slack thread, a Teams channel's reply chain): one conversation for its whole life. */\n THREADED = 'threaded',\n /**\n * A flat conversation (a top-level Slack DM, a Teams personal or group chat): split after a quiet gap measured on the\n * vendor's clock, so one transcript never grows without bound.\n */\n FLAT = 'flat',\n}\n\n/** The person who wrote a chat message, as the provider's chat accounts write them: what their chat identity link is keyed on. */\nexport const Hook_InboundChatSenderSchema = z.object({\n /** The vendor's workspace or tenant (a Slack team id, a Microsoft tenant id). */\n workspaceRef: z.string().min(1),\n /** The vendor's own id for the person (a Slack user id, a Microsoft Entra object id). */\n chatUserId: z.string().min(1),\n /** How the vendor names the person: shown on the link page only, never matched on. */\n chatUserDisplayName: z.string().optional(),\n /** How the vendor names the workspace: shown on the link page only, never matched on. */\n workspaceDisplayName: z.string().optional(),\n});\nexport type Hook_InboundChatSender = z.infer<typeof Hook_InboundChatSenderSchema>;\n\n/**\n * A message a person wrote to the bot, as a verified request carries it (#2665 S6, plan A14). The chat door reads all of\n * it from the request the engine verified, never from a handler, so a handler decides only WHETHER to converse.\n *\n * One schema, the type derived from it (#2665 S6 review L-B): the engine parses what a provider module's `chatMessageOf`\n * returns with this very schema, so a field added here is checked at the engine's boundary the day it is added, and a\n * value the module built wrong (an empty key, a date that is not one) is read as no message.\n */\nexport const Hook_InboundChatMessageSchema = z.object({\n sender: Hook_InboundChatSenderSchema,\n /** The vendor's conversation: a Slack thread or DM channel, a Teams conversation (a channel's reply chain included). */\n conversationKey: z.string().min(1),\n threading: z.enum(Hook_ChatConversationThreading),\n audience: z.enum(ChatConversationAudience),\n /** The vendor's own id for the message, the same on every retry of its delivery: what makes it one message. */\n messageKey: z.string().min(1),\n /** When the vendor says it was sent (Slack's `ts`, a Teams activity's `timestamp`): the clock a flat conversation's epochs follow. */\n sentAt: z.date(),\n /** What the person wrote, the bot's own mention removed. May be empty: the door answers that the message said nothing. */\n text: z.string(),\n /** Where an answer to this message goes, serialized by the vendor module and parsed back by its chat reply handler. */\n replyTarget: z.string().min(1),\n});\nexport type Hook_InboundChatMessage = z.infer<typeof Hook_InboundChatMessageSchema>;\n\n/**\n * A chat COMMAND a person sent, as a verified request carries it (#2666 S7): a Slack slash command (`/todo add buy milk`)\n * or a Teams message-extension form a person submitted. Read by the engine from the request it verified, so the command\n * door runs what the person sent and never what a handler says they sent. One schema, the type derived from it: what a\n * provider module's `chatCommandOf` returns is parsed with it, and a value built wrong is read as no command.\n */\nexport const Hook_InboundChatCommandSchema = z.object({\n sender: Hook_InboundChatSenderSchema,\n /**\n * The command's verb: the word after a Slack command, a Teams command's id. Null when the person typed none (a bare\n * `/todo`), which the door answers with the list of commands.\n */\n verb: z.string().min(1).nullable(),\n /** Slack: what follows the verb, the bot's mentions made readable. Teams: empty (the form's fields are in `values`). */\n text: z.string(),\n /** Teams: the submitted form, field by field, as the person filled it (strings, converted by the door). Slack: empty. */\n values: z.record(z.string(), z.string()).default({}),\n /** Who can read the conversation it was sent from, which decides where its answer goes. */\n audience: z.enum(ChatConversationAudience),\n /** Where the answer goes, serialized by the vendor module and parsed back by its command result handler. */\n replyTarget: z.string().min(1),\n});\nexport type Hook_InboundChatCommand = z.infer<typeof Hook_InboundChatCommandSchema>;\n\n/**\n * A chat SEARCH a person typed (#2666 S7): a Teams message-extension search, sent as the person types and answered within\n * the vendor's deadline in the same request, never stored. Read by the engine from the request it verified.\n */\nexport const Hook_InboundChatSearchSchema = z.object({\n sender: Hook_InboundChatSenderSchema,\n /** The search command's id, as declared in the vendor package (the operation's verb). */\n verb: z.string().min(1),\n /** What the person typed; empty for the default query. */\n text: z.string(),\n /** The default query a vendor sends when the search opens (Teams `initialRun`), recognised by its marker, never by an empty text. */\n initialRun: z.boolean(),\n /** How many results to skip: the vendor's paging. */\n skip: z.number().int().nonnegative(),\n /** The vendor's own id for this request, the only name an unstored request has (recorded on its audit row). */\n vendorRequestId: z.string().min(1),\n});\nexport type Hook_InboundChatSearch = z.infer<typeof Hook_InboundChatSearchSchema>;\n\n/** What the engine answers a chat search with, before the vendor module writes it in the vendor's own response (#2666 S7). */\nexport enum Hook_ChatSearchAnswerKind {\n /** Records the person may insert, each named and linked. Empty when this page has nothing (a later page of the results). */\n RESULTS = 'results',\n /** One plain sentence in place of results: nothing found, refused, keep typing, try again. Carries no formatting. */\n MESSAGE = 'message',\n /** The person's chat account is linked to no member yet: the page that links it, and the text of the action that opens it. */\n SIGN_IN = 'sign_in',\n}\n\n/** One record a chat search found: its name and its page in the application, nothing else (selecting it shares only these). */\nexport interface Hook_ChatSearchAnswerItem {\n /** The record's id. */\n readonly id: string;\n /** The record's name (its resource's `recordLabelFields`), or the framework's \"open it\" phrase when it has none. */\n readonly title: string;\n /** The record's page in the application, or `null` when its route cannot be built. */\n readonly url: string | null;\n}\n\n/**\n * The engine's answer to a chat search (#2666 S7), in the searcher's language, which the endpoint's\n * {@link Hook_Endpoint.answerChatSearch} turns into the vendor's response (a Teams `composeExtension` of type `result`,\n * `message` or `auth`). Built by the engine from the member's own results; a module only chooses how it looks.\n */\nexport type Hook_ChatSearchAnswer =\n | { readonly kind: Hook_ChatSearchAnswerKind.RESULTS; readonly items: readonly Hook_ChatSearchAnswerItem[] }\n | { readonly kind: Hook_ChatSearchAnswerKind.MESSAGE; readonly text: string }\n | { readonly kind: Hook_ChatSearchAnswerKind.SIGN_IN; readonly text: string; readonly url: string };\n\n/** How an endpoint's synchronous answer writes its body. */\nexport enum Hook_AcknowledgementEncoding {\n /** No body. Slack takes an empty 200 as \"received, nothing to show\"; it closes a submitted modal view. */\n EMPTY = \"empty\",\n /** `application/json`. */\n JSON = \"json\",\n /** `text/plain; charset=utf-8`. */\n TEXT = \"text\",\n}\n\n/**\n * The HTTP answer a provider's contract requires within its deadline, computed from the verified request.\n * Always a 200: it is the answer to a request the engine ACCEPTED (stored, a duplicate, or one no handler takes),\n * so a refusal never takes this path. The work itself still goes through the durable store and the queue.\n */\nexport type Hook_Acknowledgement =\n | { readonly encoding: Hook_AcknowledgementEncoding.EMPTY }\n | { readonly encoding: Hook_AcknowledgementEncoding.JSON; readonly body: unknown }\n | { readonly encoding: Hook_AcknowledgementEncoding.TEXT; readonly body: string };\n\n// ===============================================================\n// Webhook Endpoint\n// ===============================================================\n\n/**\n * A webhook endpoint for a specific domain/capability within a provider.\n * \n * Each endpoint generates a route: POST /webhooks/{providerRef}/{endpointKey}\n * \n * The endpoint is the SINGLE SOURCE OF TRUTH for all webhook metadata:\n * - Signature config (how to verify)\n * - Event types (what this endpoint handles)\n * - Scope binding (how events map to engine scope)\n * \n * Examples:\n * Stripe: { key: 'billing', capability: 'billing', ... }\n * Google: { key: 'calendar', capability: 'calendar', ... }, { key: 'drive', ... }\n * Microsoft: { key: 'graph', ... }, { key: 'teams', ... }\n */\nexport type Hook_Endpoint = {\n /** Unique key within this provider (used in route: /webhooks/stripe/{key}) */\n key: string;\n /**\n * Optional human-readable name. The runtime projection emitted by\n * `getDefaultProviderConfiguration` does not set this (verified\n * 2026-05-06 — no consumer reads `endpoint.displayName` anywhere\n * in the engine or in `external-connectors-public`); requiring it\n * was aspirational. Future admin/UI surfaces that want to display\n * webhook endpoints should treat the field as optional and fall\n * back to `key` when absent.\n */\n displayName?: string;\n /** Which capability this endpoint serves */\n capability: string;\n /**\n * How a request is verified. Required on every endpoint except a\n * {@link Hook_TriggerStrategy.WEBHOOK_TRIGGERS_POLL} one, which must declare none (nothing it receives is verified, and\n * a signature setting nothing reads would look like a control). The route gate withholds an endpoint that breaks either\n * half.\n */\n signatureConfig?: Hook_SignatureConfig;\n /** How the endpoint's requests are trusted, and so handled. See {@link Hook_TriggerStrategy}. */\n triggerStrategy: Hook_TriggerStrategy;\n /** Required for, and only for, a {@link Hook_TriggerStrategy.WEBHOOK_TRIGGERS_POLL} endpoint (#2909). */\n reReadTrigger?: Hook_ReReadTrigger;\n /** Event types this endpoint handles (single source of truth) */\n eventTypes: string[];\n /** Declarative scope binding — how events map to engine scope */\n scopeBinding: Hook_EndpointScopeBinding;\n /**\n * The largest body this endpoint accepts, in bytes, when an inbound handler takes its events (#1596).\n * A larger delivery is refused 413 and audited. Per ENDPOINT, not per route prefix: capping the whole\n * `/webhooks/` family would cap every provider at the smallest endpoint's size. Omitted, the server's\n * own body limit applies.\n */\n maxBodyBytes?: number;\n /**\n * The media types this endpoint accepts (#2659). A request in any other is refused 415 and audited. Omitted,\n * the endpoint accepts JSON only. Slack's interactions and slash commands are `FORM_URLENCODED`. The engine\n * decodes JSON and form bodies; it decodes no XML, so an endpoint declaring XML refuses every request.\n */\n contentTypes?: ReadonlyArray<Hook_ContentType>;\n /**\n * The verified request names a PERSON of the vendor's chat: a workspace or tenant and a user id, both carried in\n * bytes the vendor signed (Slack's events, clicks and commands; a Teams activity). Only such an endpoint's handler\n * may act as the member that chat account is linked to (`ctx.chat`, #2664); every other handler is refused.\n *\n * Honored only on an endpoint the ENGINE verifies (`HOOK_ENGINE_VERIFIED_SIGNATURE_ALGORITHMS`), read through\n * {@link hookEndpointNamesChatMember}: a person named in bytes the engine did not check could be anyone. An email\n * intake endpoint never declares it, because a From address is not verified by anything.\n */\n namesChatMember?: boolean;\n\n // ── Runtime-only pure functions (#2659). Authored on the provider module's endpoint descriptor; never\n // serialized, so nothing that persists or ships an endpoint carries them. Each runs only on a request\n // the engine has verified, and none may perform I/O: the answer is due within the provider's deadline.\n\n /**\n * Answers a HANDSHAKE: a request that proves the endpoint is reachable rather than delivering an event\n * (Slack's `url_verification`, answered with its `challenge`). Returns the answer for a handshake, `null` for\n * anything else. A handshake is answered and never stored: no handler runs for it.\n */\n answerHandshake?: (request: Hook_InboundRequest) => Hook_Acknowledgement | null;\n /**\n * Names the event in a verified request, for an engine-verified endpoint whose scheme signs no delivery id\n * (`SLACK_V0`, `BOT_FRAMEWORK_JWT`). Returns `null` for a request that carries no event the provider names; it\n * is acknowledged and stored nowhere. `SVIX_V1` needs none: its signed `svix-id` and the body's `type` name it.\n * An engine-verified endpoint whose scheme signs no id is not mounted without one.\n */\n identifyEvent?: (request: Hook_InboundRequest) => Hook_InboundEventIdentity | null;\n /**\n * The synchronous answer the provider requires, replacing the engine's `{ received: true }` on every accepted\n * request (Slack: an empty 200; a Teams `invoke`: an invoke response body). Omitted, the engine's answer stands.\n */\n acknowledge?: (request: Hook_InboundRequest) => Hook_Acknowledgement;\n /**\n * The PERSONAL conversation this request happened in, or `null` when it happened anywhere else (a group chat, a\n * channel) or names no person (#2664 S5b). Only for an endpoint that {@link namesChatMember} and whose scheme names\n * the bot the token was for (`BOT_FRAMEWORK_JWT`). The engine records it on the sender's chat identity link in the\n * delivery's organization, under that bot, so the application can post to the person later without their writing\n * first. A throw is logged and records nothing: the delivery is unaffected.\n */\n personalConversationOf?: (request: Hook_InboundRequest) => Hook_InboundPersonalConversation | null;\n /**\n * The message a person wrote to the bot in this request, or `null` when it carries none: a click, a command, the\n * bot's own message, an edit or a deletion (#2665 S6). Only for an endpoint that {@link namesChatMember}, on a scheme the\n * engine verifies: declared anywhere else, it stops startup (#2666 S7), because a person's words read from it would be\n * stored where READ returns them and nothing empties them. A handler on\n * such an endpoint converses through `ctx.chat.converse()`, which reads the message from here, and the engine orders\n * each sender's messages of one conversation by it (the delivery's ordering key). A throw is treated as `null`.\n * Read the BODY only: the engine calls it at receipt and again from the stored delivery, which keeps no header but\n * `content-type`, and the two reads must name the same message.\n */\n chatMessageOf?: (request: Hook_InboundRequest) => Hook_InboundChatMessage | null;\n /**\n * The chat command a person sent in this request, or `null` when it carries none (#2666 S7): a Slack slash command, or a\n * Teams message-extension form submitted. Only for an endpoint that {@link namesChatMember} on a scheme the engine\n * verifies; declared anywhere else, it stops startup. The engine marks the stored\n * delivery a COMMAND at receipt, so its body has one copy, and a handler runs it through `ctx.chat.runCommand()`, which\n * reads it from here. A throw is treated as `null`. Read the BODY only: the engine calls it at receipt and again from the\n * stored delivery, which keeps no header but `content-type`.\n */\n chatCommandOf?: (request: Hook_InboundRequest) => Hook_InboundChatCommand | null;\n /**\n * The chat SEARCH a person typed in this request, or `null` (#2666 S7): a Teams message-extension search. Only for an\n * endpoint that {@link namesChatMember} on a scheme the engine verifies; declared anywhere else, it stops startup. A search is answered in the request and never stored, so the engine asks this\n * BEFORE it names an event: a request it answers is a search, and nothing else runs for it. A throw is treated as `null`.\n * Declared with {@link answerChatSearch}, or startup refuses the endpoint.\n */\n chatSearchOf?: (request: Hook_InboundRequest) => Hook_InboundChatSearch | null;\n /**\n * The vendor's response to a chat search, from the engine's answer (#2666 S7): the person's results, a sentence, or the\n * page that links their chat account. Pure, because it is written inside the vendor's deadline. Declared exactly when\n * {@link chatSearchOf} is: one without the other stops startup.\n */\n answerChatSearch?: (answer: Hook_ChatSearchAnswer) => Hook_Acknowledgement;\n};\n/** @wildo_source:part:end external-connectors.models.hook-inbound-endpoint */\n\n/**\n * Whether an endpoint's handler may act as the chat member its verified request names (#2664): the endpoint declares\n * {@link Hook_Endpoint.namesChatMember}, AND the engine verifies it. A declaration on an endpoint a provider adapter\n * verifies is not honored, so the decision rests on engine code alone.\n */\nexport function hookEndpointNamesChatMember(endpoint: Pick<Hook_Endpoint, 'namesChatMember' | 'signatureConfig'>): boolean {\n const algorithm = endpoint.signatureConfig?.algorithm;\n return endpoint.namesChatMember === true && algorithm !== undefined && HOOK_ENGINE_VERIFIED_SIGNATURE_ALGORITHMS.has(algorithm);\n}\n\n// ===============================================================\n// Webhook Provider Configuration\n// ===============================================================\n\nexport type HookInitiatorProvider_Configuration = ExternalProvider_ExchangeProtocol_Configuration_Base & {\n /** Webhook endpoints — each generates a route: POST /webhooks/{providerRef}/{endpointKey} */\n endpoints: Hook_Endpoint[];\n /** Per-endpoint webhook secrets: endpointKey → secret value */\n endpointSecrets?: Record<string, string>;\n /** Fallback secret if not specified per-endpoint (legacy compat) */\n webhookSecret?: string;\n};\n\n// ===============================================================\n// Webhook Operation Context\n// ===============================================================\n\nexport const Hook_OperationContextSchema = ExternalProvider_OperationContextSchema.extend({\n eventType: z.string(),\n eventId: z.string().optional(),\n deliveryStatus: z.enum(Hook_DeliveryStatus),\n signatureVerified: z.boolean().optional(),\n pollingCursor: z.string().optional(),\n});\nexport type Hook_OperationContext = z.infer<typeof Hook_OperationContextSchema>;\n\n// ===============================================================\n// Webhook Operation Definition\n// ===============================================================\n\nexport type Hook_OperationDefinition = ExternalProvider_OperationDefinition_Base & {\n triggerSpec: Hook_TriggerSpec;\n operationContextSchema: typeof Hook_OperationContextSchema;\n samplePayload?: unknown;\n};\n\n"]}
|
|
@@ -393,6 +393,52 @@ export declare const LLM_MODEL_RESOLVABLE_AVAILABILITIES: readonly LLM_Model_Ava
|
|
|
393
393
|
* quietly widen what a model is used for.
|
|
394
394
|
*/
|
|
395
395
|
export declare const LLM_MODEL_APPLICABILITY_PREFERENCE: Record<LLM_Model_Applicability, readonly LLM_Model[]>;
|
|
396
|
+
/**
|
|
397
|
+
* A chat model a provider the engine does NOT ship declares it serves (#2516): what a registry provider says about its
|
|
398
|
+
* own models, so it can be chosen by applicability the way an engine model is chosen from {@link LLM_MODEL_CATALOG}.
|
|
399
|
+
*
|
|
400
|
+
* The mirror of `DocumentExtraction_ModelDeclaration` (#2021), and for the same reason: the catalog is an exhaustive
|
|
401
|
+
* record over {@link LLM_Model}, whose exhaustiveness is its whole guarantee, so a vendor the engine does not ship
|
|
402
|
+
* cannot add a row to it. Its provider declares its models instead, on its LLM arm.
|
|
403
|
+
*
|
|
404
|
+
* - `model` is the id the provider's SDK takes (`sdkFactory(...).languageModel(model)`).
|
|
405
|
+
* - `applicabilities` is the provider author's opinion of what the model may be SELECTED for, with the catalog's
|
|
406
|
+
* meaning; empty means never auto-selected. {@link LLM_Model_Applicability.WORKSPACE_CODING_AGENT} is refused: it is
|
|
407
|
+
* served over the Agent Client Protocol, never through a chat arm.
|
|
408
|
+
* - `ioCapabilities` is the evidence the vision gate reads; a model that declares none is not selected for vision work.
|
|
409
|
+
* - `thinkingCapability` / `unsupportedReasoningEfforts` feed the reasoning-effort check; absent, it fails open, as for
|
|
410
|
+
* an unprobed catalog row.
|
|
411
|
+
*
|
|
412
|
+
* There is no `availability`: declaring a model is the provider's statement that it serves it, as for document
|
|
413
|
+
* extraction. A model it no longer serves is removed from the declaration.
|
|
414
|
+
*/
|
|
415
|
+
export type LLM_ModelDeclaration = {
|
|
416
|
+
model: string;
|
|
417
|
+
applicabilities: readonly LLM_Model_Applicability[];
|
|
418
|
+
ioCapabilities?: readonly LLM_Model_IO_Capability[];
|
|
419
|
+
thinkingCapability?: LLM_Model_Thinking_Capability;
|
|
420
|
+
unsupportedReasoningEfforts?: readonly LLMProvider_ReasoningEffort[];
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* The facts a resolved model carries, whichever source it came from: an engine catalog row or a provider's declaration.
|
|
424
|
+
* What the backend reads after resolution (the reasoning-effort check), and nothing that only one source has.
|
|
425
|
+
*/
|
|
426
|
+
export type LLM_ResolvedModelFacts = Pick<LLM_ModelDeclaration, 'applicabilities' | 'ioCapabilities' | 'thinkingCapability' | 'unsupportedReasoningEfforts'>;
|
|
427
|
+
/**
|
|
428
|
+
* Why a provider's declared chat models ({@link LLM_ModelDeclaration}) cannot be used, or `undefined` (#2516). Absent is
|
|
429
|
+
* fine: an engine provider has none.
|
|
430
|
+
*
|
|
431
|
+
* A registry provider's module is loaded at runtime, so nothing here compiled its `models`; this is the check that holds
|
|
432
|
+
* them to their shape before resolution reads them. Every vocabulary is checked against its enum, because an unknown
|
|
433
|
+
* applicability would simply never match, and an unknown IO capability would read as evidence it is not.
|
|
434
|
+
*/
|
|
435
|
+
export declare const describeLLMModelDeclarationsDefect: (models: unknown) => string | undefined;
|
|
436
|
+
/**
|
|
437
|
+
* Whether the engine's catalog knows this provider, which decides where its model facts come from (#2516): catalog rows
|
|
438
|
+
* for an engine provider, the provider's own `models` declaration otherwise. One predicate, so the resolver and the agent
|
|
439
|
+
* registration that reads declarations cannot disagree about which side a provider is on.
|
|
440
|
+
*/
|
|
441
|
+
export declare const isLLMCatalogProvider: (providerRef: string, catalog?: Record<LLM_Model, LLM_ModelCatalogEntry>) => boolean;
|
|
396
442
|
/** Why {@link resolveModelForApplicability} could not answer — carried into a named CONFIGURATION error. */
|
|
397
443
|
export declare enum LLM_ModelResolutionFailure {
|
|
398
444
|
/** The applicability has no candidate at all for this provider. */
|
|
@@ -400,7 +446,12 @@ export declare enum LLM_ModelResolutionFailure {
|
|
|
400
446
|
/** Candidates exist for this provider but none is in a resolvable availability. */
|
|
401
447
|
NO_RESOLVABLE_AVAILABILITY = "no_resolvable_availability",
|
|
402
448
|
/** Candidates exist and are available, but none evidences the required IO capability. */
|
|
403
|
-
REQUIRED_IO_CAPABILITY_UNEVIDENCED = "required_io_capability_unevidenced"
|
|
449
|
+
REQUIRED_IO_CAPABILITY_UNEVIDENCED = "required_io_capability_unevidenced",
|
|
450
|
+
/**
|
|
451
|
+
* An engine provider (one the catalog knows) also declares models. Its models are catalog rows; a declaration beside
|
|
452
|
+
* them would be a second, unchecked source of the same facts, so it is refused rather than merged.
|
|
453
|
+
*/
|
|
454
|
+
CATALOG_PROVIDER_DECLARES_MODELS = "catalog_provider_declares_models"
|
|
404
455
|
}
|
|
405
456
|
export type LLM_ModelResolutionInput = {
|
|
406
457
|
applicability: LLM_Model_Applicability;
|
|
@@ -414,16 +465,21 @@ export type LLM_ModelResolutionInput = {
|
|
|
414
465
|
* applicability.
|
|
415
466
|
*/
|
|
416
467
|
preferenceOverride?: Partial<Record<LLM_Model_Applicability, readonly LLM_Model[]>>;
|
|
468
|
+
/**
|
|
469
|
+
* The models the provider declares on its LLM arm (#2516). Read only for a provider the catalog does not know; an
|
|
470
|
+
* engine provider that declares any is refused ({@link LLM_ModelResolutionFailure.CATALOG_PROVIDER_DECLARES_MODELS}).
|
|
471
|
+
*/
|
|
472
|
+
declaredModels?: readonly LLM_ModelDeclaration[];
|
|
417
473
|
};
|
|
418
474
|
export type LLM_ModelResolution = {
|
|
419
475
|
resolved: true;
|
|
420
|
-
model:
|
|
421
|
-
|
|
476
|
+
model: string;
|
|
477
|
+
facts: LLM_ResolvedModelFacts;
|
|
422
478
|
fromOverride: boolean;
|
|
423
479
|
} | {
|
|
424
480
|
resolved: false;
|
|
425
481
|
failure: LLM_ModelResolutionFailure;
|
|
426
|
-
consideredModels: readonly
|
|
482
|
+
consideredModels: readonly string[];
|
|
427
483
|
};
|
|
428
484
|
/**
|
|
429
485
|
* Resolve an applicability to ONE concrete model id for a given provider.
|
|
@@ -434,6 +490,13 @@ export type LLM_ModelResolution = {
|
|
|
434
490
|
* this layer exists to remove — the author asked for a KIND of model, and
|
|
435
491
|
* quietly handing them a different kind is worse than refusing.
|
|
436
492
|
*
|
|
493
|
+
* Two sources, decided by whether the catalog knows the provider (as document extraction decides, #2021):
|
|
494
|
+
* - an ENGINE provider resolves through {@link LLM_MODEL_APPLICABILITY_PREFERENCE} and its catalog rows, every gate
|
|
495
|
+
* below applying, and is refused if it also declares models;
|
|
496
|
+
* - any other provider resolves from its own `declaredModels`, in declared order: the first model declaring the
|
|
497
|
+
* applicability and evidencing the required IO capability. A provider that declares none fails with the same
|
|
498
|
+
* named failure, naming what it considered.
|
|
499
|
+
*
|
|
437
500
|
* Note this function answers the semantic question only. Whether the resolved
|
|
438
501
|
* model is reachable over the agent's TRANSPORT (a profile that
|
|
439
502
|
* declares it) is a separate gate owned by the backend, because the transport
|
|
@@ -490,9 +553,11 @@ export declare const getModelThinkingCapability: (model: string) => LLM_Model_Th
|
|
|
490
553
|
*
|
|
491
554
|
* @param model The configured model id (free-form; unknown ids pass).
|
|
492
555
|
* @param effort The configured effort; omit/undefined always passes.
|
|
556
|
+
* @param declared For a model a registry provider declares (#2516), its own thinking facts; they replace the catalog's,
|
|
557
|
+
* which knows nothing of it. Absent facts fail open, exactly as for an unprobed catalog row.
|
|
493
558
|
* @returns A violation message, or `null` if valid/unjudgeable.
|
|
494
559
|
*/
|
|
495
|
-
export declare const validateReasoningEffortForModel: (model: string, effort: LLMProvider_ReasoningEffort | undefined) => string | null;
|
|
560
|
+
export declare const validateReasoningEffortForModel: (model: string, effort: LLMProvider_ReasoningEffort | undefined, declared?: Pick<LLM_ModelDeclaration, "thinkingCapability" | "unsupportedReasoningEfforts">) => string | null;
|
|
496
561
|
/** @wildo_source:part:start saas.external-providers.llm.model-configuration facet:kind:api facet:audience:app-developer
|
|
497
562
|
*
|
|
498
563
|
* The provider/model/sampling surface every LLM agent config inherits — this is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm.external-connectors-models.schemas.d.ts","sourceRoot":"","sources":["../../../../src/protocols/llm.external-connectors-models.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,oDAAoD,EAAE,sCAAsC,EAAE,MAAM,oDAAoD,CAAA;AACjK,OAAO,EAAE,yCAAyC,EAA2C,MAAM,uDAAuD,CAAA;AAU1J,oBAAY,SAAS;IAEnB,UAAU,OAAO;IACjB,eAAe,YAAY;IAC3B,eAAe,YAAY;IAC3B,eAAe,YAAY;IAa3B,sCAAsC;IACtC,mBAAmB,gBAAgB;IACnC,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F,0BAA0B,+BAA+B;IACzD,yFAAyF;IACzF,kCAAkC,uCAAuC;
|
|
1
|
+
{"version":3,"file":"llm.external-connectors-models.schemas.d.ts","sourceRoot":"","sources":["../../../../src/protocols/llm.external-connectors-models.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,oDAAoD,EAAE,sCAAsC,EAAE,MAAM,oDAAoD,CAAA;AACjK,OAAO,EAAE,yCAAyC,EAA2C,MAAM,uDAAuD,CAAA;AAU1J,oBAAY,SAAS;IAEnB,UAAU,OAAO;IACjB,eAAe,YAAY;IAC3B,eAAe,YAAY;IAC3B,eAAe,YAAY;IAa3B,sCAAsC;IACtC,mBAAmB,gBAAgB;IACnC,+CAA+C;IAC/C,qBAAqB,kBAAkB;IACvC,oCAAoC;IACpC,oBAAoB,iBAAiB;IACrC,wEAAwE;IACxE,eAAe,YAAY;IAC3B,sCAAsC;IACtC,mBAAmB,gBAAgB;IACnC,eAAe,YAAY;IAC3B,aAAa,UAAU;IACvB,kBAAkB,eAAe;IACjC,cAAc,WAAW;IACzB,mBAAmB,gBAAgB;IACnC,mBAAmB,gBAAgB;IACnC,aAAa,UAAU;IACvB,qBAAqB,kBAAkB;IAWvC,mGAAmG;IACnG,cAAc,mBAAmB;IACjC,2GAA2G;IAC3G,eAAe,oBAAoB;IACnC,6HAA6H;IAC7H,aAAa,kBAAkB;IAC/B,iCAAiC;IACjC,eAAe,oBAAoB;IACnC,oEAAoE;IACpE,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,gBAAgB,qBAAqB;IAGrC,0BAA0B,wBAAwB;IAClD,mBAAmB,iBAAiB;IACpC,qBAAqB,mBAAmB;IACxC,uBAAuB,qBAAqB;IAC5C,uBAAuB,yBAAyB;IAChD,qBAAqB,mBAAmB;IACxC,uBAAuB,qBAAqB;IAC5C,iBAAiB,eAAe;IAChC,wBAAwB,sBAAsB;IAG9C,aAAa,yBA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