@cognidesk/core 0.0.3-dev.2 → 0.0.3-dev.4
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/index.d.ts +2881 -441
- package/dist/index.js +4197 -454
- package/package.json +4 -3
- package/dist/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -133,6 +133,7 @@ declare const telemetrySpanNames: {
|
|
|
133
133
|
readonly runtimeReplayConversation: "cognidesk.runtime.replay_conversation";
|
|
134
134
|
readonly runtimeSubmitWidget: "cognidesk.runtime.submit_widget";
|
|
135
135
|
readonly runtimeGetSnapshot: "cognidesk.runtime.get_snapshot";
|
|
136
|
+
readonly runtimeHandleChannelEvent: "cognidesk.runtime.handle_channel_event";
|
|
136
137
|
readonly runtimeHandleUserMessage: "cognidesk.runtime.handle_user_message";
|
|
137
138
|
readonly runtimeCloseConversation: "cognidesk.runtime.close_conversation";
|
|
138
139
|
readonly runtimeRequestHandoff: "cognidesk.runtime.request_handoff";
|
|
@@ -195,6 +196,1062 @@ declare function addTelemetryContentEvent(options: TelemetryOptionsCarrier, name
|
|
|
195
196
|
declare function activeRuntimeEventTelemetry(options: TelemetryOptionsCarrier): RuntimeEventTelemetry | undefined;
|
|
196
197
|
declare function createTelemetryContext(options: TelemetryOptionsCarrier): TelemetryContext;
|
|
197
198
|
|
|
199
|
+
declare const coreConversationChannels: readonly ["chat", "voice", "email", "ticketing", "contactCenter", "messaging", "sms", "workplace", "social", "form", "helpCenter", "community", "ecommerce", "marketplace", "review", "video", "cobrowsing", "rcs"];
|
|
200
|
+
declare const coreProviderCategories: readonly ["model", "storage", "chat", "voice", "email", "ticketing", "contactCenter", "handoff", "studio", "messaging", "sms", "workplace", "social", "form", "helpCenter", "community", "ecommerce", "marketplace", "review", "video", "cobrowsing", "rcs"];
|
|
201
|
+
declare const coreChannelCapabilities: readonly ["receive", "send", "draft", "thread", "attach", "media", "handoff", "schedule", "cleanup", "notify", "transfer", "artifact", "create-provider-object", "read-provider-object", "update-provider-object", "delete-provider-object", "search-provider-object", "link-provider-object"];
|
|
202
|
+
declare const providerTrustLevels: readonly ["official", "verified", "community", "experimental"];
|
|
203
|
+
declare const providerDirections: readonly ["receive-only", "send-only", "inbound-only", "outbound-only", "bidirectional"];
|
|
204
|
+
declare const channelAudiences: readonly ["customer-facing", "internal-support", "mixed"];
|
|
205
|
+
declare const capabilityAvailabilityStatuses: readonly ["registry-available", "installed", "configured", "enabled", "blocked"];
|
|
206
|
+
declare const providerCredentialStatuses: readonly ["not-required", "required", "configured", "missing", "expired", "insufficient-scope", "permission-blocked", "unavailable"];
|
|
207
|
+
declare const categoryOperationLevels: readonly ["required", "recommended", "optional", "extension"];
|
|
208
|
+
declare const providerCapabilityCoverageLevels: readonly ["partial", "standard", "full"];
|
|
209
|
+
declare const categoryEventDirections: readonly ["inbound", "outbound", "internal", "bidirectional"];
|
|
210
|
+
type Extensible$1<T extends string> = T | (string & {});
|
|
211
|
+
type CoreConversationChannel = typeof coreConversationChannels[number];
|
|
212
|
+
type ConversationChannelKind = Extensible$1<CoreConversationChannel>;
|
|
213
|
+
type CoreProviderCategory = typeof coreProviderCategories[number];
|
|
214
|
+
type ProviderCategory = Extensible$1<CoreProviderCategory>;
|
|
215
|
+
type CoreChannelCapability = typeof coreChannelCapabilities[number];
|
|
216
|
+
type ChannelCapability = Extensible$1<CoreChannelCapability>;
|
|
217
|
+
type ProviderTrustLevel = typeof providerTrustLevels[number];
|
|
218
|
+
type ProviderDirection = typeof providerDirections[number];
|
|
219
|
+
type ChannelAudience = typeof channelAudiences[number];
|
|
220
|
+
type ActionAudience = ChannelAudience;
|
|
221
|
+
type CapabilityAvailabilityStatus = typeof capabilityAvailabilityStatuses[number];
|
|
222
|
+
type ProviderCredentialState = typeof providerCredentialStatuses[number];
|
|
223
|
+
type CategoryOperationLevel = typeof categoryOperationLevels[number];
|
|
224
|
+
type ProviderCapabilityCoverage = typeof providerCapabilityCoverageLevels[number];
|
|
225
|
+
type CategoryEventDirection = typeof categoryEventDirections[number];
|
|
226
|
+
declare const ConversationChannelKindSchema: z.ZodString;
|
|
227
|
+
declare const ProviderCategorySchema: z.ZodString;
|
|
228
|
+
declare const CoreChannelCapabilitySchema: z.ZodEnum<{
|
|
229
|
+
handoff: "handoff";
|
|
230
|
+
receive: "receive";
|
|
231
|
+
send: "send";
|
|
232
|
+
draft: "draft";
|
|
233
|
+
thread: "thread";
|
|
234
|
+
attach: "attach";
|
|
235
|
+
media: "media";
|
|
236
|
+
schedule: "schedule";
|
|
237
|
+
cleanup: "cleanup";
|
|
238
|
+
notify: "notify";
|
|
239
|
+
transfer: "transfer";
|
|
240
|
+
artifact: "artifact";
|
|
241
|
+
"create-provider-object": "create-provider-object";
|
|
242
|
+
"read-provider-object": "read-provider-object";
|
|
243
|
+
"update-provider-object": "update-provider-object";
|
|
244
|
+
"delete-provider-object": "delete-provider-object";
|
|
245
|
+
"search-provider-object": "search-provider-object";
|
|
246
|
+
"link-provider-object": "link-provider-object";
|
|
247
|
+
}>;
|
|
248
|
+
declare const ChannelCapabilitySchema: z.ZodString;
|
|
249
|
+
declare const ProviderTrustLevelSchema: z.ZodEnum<{
|
|
250
|
+
community: "community";
|
|
251
|
+
official: "official";
|
|
252
|
+
verified: "verified";
|
|
253
|
+
experimental: "experimental";
|
|
254
|
+
}>;
|
|
255
|
+
declare const ProviderDirectionSchema: z.ZodEnum<{
|
|
256
|
+
"receive-only": "receive-only";
|
|
257
|
+
"send-only": "send-only";
|
|
258
|
+
"inbound-only": "inbound-only";
|
|
259
|
+
"outbound-only": "outbound-only";
|
|
260
|
+
bidirectional: "bidirectional";
|
|
261
|
+
}>;
|
|
262
|
+
declare const ChannelAudienceSchema: z.ZodEnum<{
|
|
263
|
+
"customer-facing": "customer-facing";
|
|
264
|
+
"internal-support": "internal-support";
|
|
265
|
+
mixed: "mixed";
|
|
266
|
+
}>;
|
|
267
|
+
declare const ActionAudienceSchema: z.ZodEnum<{
|
|
268
|
+
"customer-facing": "customer-facing";
|
|
269
|
+
"internal-support": "internal-support";
|
|
270
|
+
mixed: "mixed";
|
|
271
|
+
}>;
|
|
272
|
+
declare const CapabilityAvailabilityStatusSchema: z.ZodEnum<{
|
|
273
|
+
"registry-available": "registry-available";
|
|
274
|
+
installed: "installed";
|
|
275
|
+
configured: "configured";
|
|
276
|
+
enabled: "enabled";
|
|
277
|
+
blocked: "blocked";
|
|
278
|
+
}>;
|
|
279
|
+
declare const ProviderCredentialStateSchema: z.ZodEnum<{
|
|
280
|
+
required: "required";
|
|
281
|
+
configured: "configured";
|
|
282
|
+
"not-required": "not-required";
|
|
283
|
+
missing: "missing";
|
|
284
|
+
expired: "expired";
|
|
285
|
+
"insufficient-scope": "insufficient-scope";
|
|
286
|
+
"permission-blocked": "permission-blocked";
|
|
287
|
+
unavailable: "unavailable";
|
|
288
|
+
}>;
|
|
289
|
+
declare const CategoryOperationLevelSchema: z.ZodEnum<{
|
|
290
|
+
required: "required";
|
|
291
|
+
recommended: "recommended";
|
|
292
|
+
optional: "optional";
|
|
293
|
+
extension: "extension";
|
|
294
|
+
}>;
|
|
295
|
+
declare const ProviderCapabilityCoverageSchema: z.ZodEnum<{
|
|
296
|
+
full: "full";
|
|
297
|
+
partial: "partial";
|
|
298
|
+
standard: "standard";
|
|
299
|
+
}>;
|
|
300
|
+
declare const CategoryEventDirectionSchema: z.ZodEnum<{
|
|
301
|
+
bidirectional: "bidirectional";
|
|
302
|
+
inbound: "inbound";
|
|
303
|
+
outbound: "outbound";
|
|
304
|
+
internal: "internal";
|
|
305
|
+
}>;
|
|
306
|
+
|
|
307
|
+
declare const ChannelCapabilityFlagsSchema: z.ZodDefault<z.ZodObject<{
|
|
308
|
+
realtime: z.ZodDefault<z.ZodBoolean>;
|
|
309
|
+
async: z.ZodDefault<z.ZodBoolean>;
|
|
310
|
+
voice: z.ZodDefault<z.ZodBoolean>;
|
|
311
|
+
audioInput: z.ZodDefault<z.ZodBoolean>;
|
|
312
|
+
audioOutput: z.ZodDefault<z.ZodBoolean>;
|
|
313
|
+
richText: z.ZodDefault<z.ZodBoolean>;
|
|
314
|
+
markdown: z.ZodDefault<z.ZodBoolean>;
|
|
315
|
+
html: z.ZodDefault<z.ZodBoolean>;
|
|
316
|
+
attachments: z.ZodDefault<z.ZodBoolean>;
|
|
317
|
+
images: z.ZodDefault<z.ZodBoolean>;
|
|
318
|
+
files: z.ZodDefault<z.ZodBoolean>;
|
|
319
|
+
widgets: z.ZodDefault<z.ZodBoolean>;
|
|
320
|
+
buttons: z.ZodDefault<z.ZodBoolean>;
|
|
321
|
+
quickReplies: z.ZodDefault<z.ZodBoolean>;
|
|
322
|
+
templates: z.ZodDefault<z.ZodBoolean>;
|
|
323
|
+
publicReplies: z.ZodDefault<z.ZodBoolean>;
|
|
324
|
+
privateReplies: z.ZodDefault<z.ZodBoolean>;
|
|
325
|
+
typingIndicator: z.ZodDefault<z.ZodBoolean>;
|
|
326
|
+
readReceipts: z.ZodDefault<z.ZodBoolean>;
|
|
327
|
+
deliveryReceipts: z.ZodDefault<z.ZodBoolean>;
|
|
328
|
+
threaded: z.ZodDefault<z.ZodBoolean>;
|
|
329
|
+
supportsHumanTransfer: z.ZodDefault<z.ZodBoolean>;
|
|
330
|
+
}, z.core.$strip>>;
|
|
331
|
+
type ChannelCapabilityFlags = z.infer<typeof ChannelCapabilityFlagsSchema>;
|
|
332
|
+
type ChannelCapabilityFlagsInput = z.input<typeof ChannelCapabilityFlagsSchema>;
|
|
333
|
+
declare const ChannelContextSchema: z.ZodObject<{
|
|
334
|
+
channelId: z.ZodString;
|
|
335
|
+
kind: z.ZodString;
|
|
336
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
337
|
+
externalThreadId: z.ZodOptional<z.ZodString>;
|
|
338
|
+
externalConversationId: z.ZodOptional<z.ZodString>;
|
|
339
|
+
externalMessageId: z.ZodOptional<z.ZodString>;
|
|
340
|
+
externalUserId: z.ZodOptional<z.ZodString>;
|
|
341
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
342
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
343
|
+
capabilities: z.ZodDefault<z.ZodDefault<z.ZodObject<{
|
|
344
|
+
realtime: z.ZodDefault<z.ZodBoolean>;
|
|
345
|
+
async: z.ZodDefault<z.ZodBoolean>;
|
|
346
|
+
voice: z.ZodDefault<z.ZodBoolean>;
|
|
347
|
+
audioInput: z.ZodDefault<z.ZodBoolean>;
|
|
348
|
+
audioOutput: z.ZodDefault<z.ZodBoolean>;
|
|
349
|
+
richText: z.ZodDefault<z.ZodBoolean>;
|
|
350
|
+
markdown: z.ZodDefault<z.ZodBoolean>;
|
|
351
|
+
html: z.ZodDefault<z.ZodBoolean>;
|
|
352
|
+
attachments: z.ZodDefault<z.ZodBoolean>;
|
|
353
|
+
images: z.ZodDefault<z.ZodBoolean>;
|
|
354
|
+
files: z.ZodDefault<z.ZodBoolean>;
|
|
355
|
+
widgets: z.ZodDefault<z.ZodBoolean>;
|
|
356
|
+
buttons: z.ZodDefault<z.ZodBoolean>;
|
|
357
|
+
quickReplies: z.ZodDefault<z.ZodBoolean>;
|
|
358
|
+
templates: z.ZodDefault<z.ZodBoolean>;
|
|
359
|
+
publicReplies: z.ZodDefault<z.ZodBoolean>;
|
|
360
|
+
privateReplies: z.ZodDefault<z.ZodBoolean>;
|
|
361
|
+
typingIndicator: z.ZodDefault<z.ZodBoolean>;
|
|
362
|
+
readReceipts: z.ZodDefault<z.ZodBoolean>;
|
|
363
|
+
deliveryReceipts: z.ZodDefault<z.ZodBoolean>;
|
|
364
|
+
threaded: z.ZodDefault<z.ZodBoolean>;
|
|
365
|
+
supportsHumanTransfer: z.ZodDefault<z.ZodBoolean>;
|
|
366
|
+
}, z.core.$strip>>>;
|
|
367
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
368
|
+
}, z.core.$strip>;
|
|
369
|
+
type ChannelContext = z.infer<typeof ChannelContextSchema>;
|
|
370
|
+
type ChannelContextInput = Omit<z.input<typeof ChannelContextSchema>, "capabilities"> & {
|
|
371
|
+
capabilities?: Partial<ChannelCapabilityFlagsInput>;
|
|
372
|
+
};
|
|
373
|
+
type ConversationChannel = ConversationChannelKind | ChannelContext;
|
|
374
|
+
type ConversationChannelInput = ConversationChannelKind | ChannelContextInput;
|
|
375
|
+
declare function defineChannelContext(input: ConversationChannelInput): ChannelContext;
|
|
376
|
+
declare function channelKindOf(channel?: ConversationChannelInput): ConversationChannelKind | undefined;
|
|
377
|
+
declare function defaultChannelCapabilityFlags(kind: ConversationChannelKind): ChannelCapabilityFlags;
|
|
378
|
+
|
|
379
|
+
declare const ProviderObjectDescriptorSchema: z.ZodObject<{
|
|
380
|
+
kind: z.ZodString;
|
|
381
|
+
label: z.ZodOptional<z.ZodString>;
|
|
382
|
+
description: z.ZodOptional<z.ZodString>;
|
|
383
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
384
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
385
|
+
}, z.core.$strip>;
|
|
386
|
+
type ProviderObjectDescriptor = z.infer<typeof ProviderObjectDescriptorSchema>;
|
|
387
|
+
declare const ChannelCapabilityDeclarationSchema: z.ZodObject<{
|
|
388
|
+
capability: z.ZodString;
|
|
389
|
+
label: z.ZodOptional<z.ZodString>;
|
|
390
|
+
description: z.ZodOptional<z.ZodString>;
|
|
391
|
+
audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
392
|
+
"customer-facing": "customer-facing";
|
|
393
|
+
"internal-support": "internal-support";
|
|
394
|
+
mixed: "mixed";
|
|
395
|
+
}>>>;
|
|
396
|
+
providerObjects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
397
|
+
kind: z.ZodString;
|
|
398
|
+
label: z.ZodOptional<z.ZodString>;
|
|
399
|
+
description: z.ZodOptional<z.ZodString>;
|
|
400
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
401
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
402
|
+
}, z.core.$strip>>>;
|
|
403
|
+
requiresCredential: z.ZodOptional<z.ZodBoolean>;
|
|
404
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
405
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
406
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
407
|
+
extension: z.ZodOptional<z.ZodBoolean>;
|
|
408
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
409
|
+
}, z.core.$strip>;
|
|
410
|
+
type ChannelCapabilityDeclaration = z.infer<typeof ChannelCapabilityDeclarationSchema>;
|
|
411
|
+
declare const CategoryOperationDeclarationSchema: z.ZodObject<{
|
|
412
|
+
alias: z.ZodString;
|
|
413
|
+
capability: z.ZodString;
|
|
414
|
+
label: z.ZodOptional<z.ZodString>;
|
|
415
|
+
description: z.ZodOptional<z.ZodString>;
|
|
416
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
417
|
+
providerObjects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
418
|
+
kind: z.ZodString;
|
|
419
|
+
label: z.ZodOptional<z.ZodString>;
|
|
420
|
+
description: z.ZodOptional<z.ZodString>;
|
|
421
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
422
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
423
|
+
}, z.core.$strip>>>;
|
|
424
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
425
|
+
"customer-facing": "customer-facing";
|
|
426
|
+
"internal-support": "internal-support";
|
|
427
|
+
mixed: "mixed";
|
|
428
|
+
}>>;
|
|
429
|
+
audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
430
|
+
"customer-facing": "customer-facing";
|
|
431
|
+
"internal-support": "internal-support";
|
|
432
|
+
mixed: "mixed";
|
|
433
|
+
}>>>;
|
|
434
|
+
requiresCredential: z.ZodOptional<z.ZodBoolean>;
|
|
435
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
436
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
437
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
438
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
439
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
440
|
+
requiredPolicyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
441
|
+
inputSchemaName: z.ZodOptional<z.ZodString>;
|
|
442
|
+
outputSchemaName: z.ZodOptional<z.ZodString>;
|
|
443
|
+
inputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
444
|
+
outputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
445
|
+
inputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
446
|
+
outputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
447
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
448
|
+
level: z.ZodDefault<z.ZodEnum<{
|
|
449
|
+
required: "required";
|
|
450
|
+
recommended: "recommended";
|
|
451
|
+
optional: "optional";
|
|
452
|
+
extension: "extension";
|
|
453
|
+
}>>;
|
|
454
|
+
}, z.core.$strip>;
|
|
455
|
+
type CategoryOperationDeclaration = z.infer<typeof CategoryOperationDeclarationSchema>;
|
|
456
|
+
type CategoryOperationDeclarationInput = z.input<typeof CategoryOperationDeclarationSchema>;
|
|
457
|
+
declare const CategoryOperationCatalogEntrySchema: z.ZodObject<{
|
|
458
|
+
alias: z.ZodString;
|
|
459
|
+
capability: z.ZodString;
|
|
460
|
+
label: z.ZodOptional<z.ZodString>;
|
|
461
|
+
description: z.ZodOptional<z.ZodString>;
|
|
462
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
463
|
+
providerObjects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
464
|
+
kind: z.ZodString;
|
|
465
|
+
label: z.ZodOptional<z.ZodString>;
|
|
466
|
+
description: z.ZodOptional<z.ZodString>;
|
|
467
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
468
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
469
|
+
}, z.core.$strip>>>;
|
|
470
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
471
|
+
"customer-facing": "customer-facing";
|
|
472
|
+
"internal-support": "internal-support";
|
|
473
|
+
mixed: "mixed";
|
|
474
|
+
}>>;
|
|
475
|
+
audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
476
|
+
"customer-facing": "customer-facing";
|
|
477
|
+
"internal-support": "internal-support";
|
|
478
|
+
mixed: "mixed";
|
|
479
|
+
}>>>;
|
|
480
|
+
requiresCredential: z.ZodOptional<z.ZodBoolean>;
|
|
481
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
482
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
483
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
484
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
485
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
486
|
+
requiredPolicyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
487
|
+
inputSchemaName: z.ZodOptional<z.ZodString>;
|
|
488
|
+
outputSchemaName: z.ZodOptional<z.ZodString>;
|
|
489
|
+
inputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
490
|
+
outputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
491
|
+
inputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
492
|
+
outputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
493
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
494
|
+
level: z.ZodDefault<z.ZodEnum<{
|
|
495
|
+
required: "required";
|
|
496
|
+
recommended: "recommended";
|
|
497
|
+
optional: "optional";
|
|
498
|
+
extension: "extension";
|
|
499
|
+
}>>;
|
|
500
|
+
}, z.core.$strip>;
|
|
501
|
+
type CategoryOperationCatalogEntry = CategoryOperationDeclaration;
|
|
502
|
+
type CategoryOperationCatalogEntryInput = CategoryOperationDeclarationInput;
|
|
503
|
+
declare const CategoryOperationCatalogSchema: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
504
|
+
alias: z.ZodString;
|
|
505
|
+
capability: z.ZodString;
|
|
506
|
+
label: z.ZodOptional<z.ZodString>;
|
|
507
|
+
description: z.ZodOptional<z.ZodString>;
|
|
508
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
509
|
+
providerObjects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
510
|
+
kind: z.ZodString;
|
|
511
|
+
label: z.ZodOptional<z.ZodString>;
|
|
512
|
+
description: z.ZodOptional<z.ZodString>;
|
|
513
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
514
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
515
|
+
}, z.core.$strip>>>;
|
|
516
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
517
|
+
"customer-facing": "customer-facing";
|
|
518
|
+
"internal-support": "internal-support";
|
|
519
|
+
mixed: "mixed";
|
|
520
|
+
}>>;
|
|
521
|
+
audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
522
|
+
"customer-facing": "customer-facing";
|
|
523
|
+
"internal-support": "internal-support";
|
|
524
|
+
mixed: "mixed";
|
|
525
|
+
}>>>;
|
|
526
|
+
requiresCredential: z.ZodOptional<z.ZodBoolean>;
|
|
527
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
528
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
529
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
530
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
531
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
532
|
+
requiredPolicyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
533
|
+
inputSchemaName: z.ZodOptional<z.ZodString>;
|
|
534
|
+
outputSchemaName: z.ZodOptional<z.ZodString>;
|
|
535
|
+
inputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
536
|
+
outputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
537
|
+
inputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
538
|
+
outputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
539
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
540
|
+
level: z.ZodDefault<z.ZodEnum<{
|
|
541
|
+
required: "required";
|
|
542
|
+
recommended: "recommended";
|
|
543
|
+
optional: "optional";
|
|
544
|
+
extension: "extension";
|
|
545
|
+
}>>;
|
|
546
|
+
}, z.core.$strip>>>;
|
|
547
|
+
type CategoryOperationCatalog = z.infer<typeof CategoryOperationCatalogSchema>;
|
|
548
|
+
type CategoryOperationCatalogInput = z.input<typeof CategoryOperationCatalogSchema>;
|
|
549
|
+
declare const ProviderOperationDeclarationSchema: z.ZodObject<{
|
|
550
|
+
alias: z.ZodString;
|
|
551
|
+
capability: z.ZodString;
|
|
552
|
+
label: z.ZodOptional<z.ZodString>;
|
|
553
|
+
description: z.ZodOptional<z.ZodString>;
|
|
554
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
555
|
+
providerObjects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
556
|
+
kind: z.ZodString;
|
|
557
|
+
label: z.ZodOptional<z.ZodString>;
|
|
558
|
+
description: z.ZodOptional<z.ZodString>;
|
|
559
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
560
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
561
|
+
}, z.core.$strip>>>;
|
|
562
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
563
|
+
"customer-facing": "customer-facing";
|
|
564
|
+
"internal-support": "internal-support";
|
|
565
|
+
mixed: "mixed";
|
|
566
|
+
}>>;
|
|
567
|
+
audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
568
|
+
"customer-facing": "customer-facing";
|
|
569
|
+
"internal-support": "internal-support";
|
|
570
|
+
mixed: "mixed";
|
|
571
|
+
}>>>;
|
|
572
|
+
requiresCredential: z.ZodOptional<z.ZodBoolean>;
|
|
573
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
574
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
575
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
576
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
577
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
578
|
+
requiredPolicyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
579
|
+
inputSchemaName: z.ZodOptional<z.ZodString>;
|
|
580
|
+
outputSchemaName: z.ZodOptional<z.ZodString>;
|
|
581
|
+
inputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
582
|
+
outputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
583
|
+
inputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
584
|
+
outputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
585
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
586
|
+
providerOperation: z.ZodOptional<z.ZodString>;
|
|
587
|
+
extension: z.ZodDefault<z.ZodBoolean>;
|
|
588
|
+
}, z.core.$strip>;
|
|
589
|
+
type ProviderOperationDeclaration = z.infer<typeof ProviderOperationDeclarationSchema>;
|
|
590
|
+
type ProviderOperationDeclarationInput = z.input<typeof ProviderOperationDeclarationSchema>;
|
|
591
|
+
declare const CategoryEventDeclarationSchema: z.ZodObject<{
|
|
592
|
+
kind: z.ZodString;
|
|
593
|
+
label: z.ZodOptional<z.ZodString>;
|
|
594
|
+
description: z.ZodOptional<z.ZodString>;
|
|
595
|
+
direction: z.ZodEnum<{
|
|
596
|
+
bidirectional: "bidirectional";
|
|
597
|
+
inbound: "inbound";
|
|
598
|
+
outbound: "outbound";
|
|
599
|
+
internal: "internal";
|
|
600
|
+
}>;
|
|
601
|
+
capability: z.ZodOptional<z.ZodString>;
|
|
602
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
603
|
+
operationAlias: z.ZodOptional<z.ZodString>;
|
|
604
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
605
|
+
}, z.core.$strip>;
|
|
606
|
+
type CategoryEventDeclaration = z.infer<typeof CategoryEventDeclarationSchema>;
|
|
607
|
+
type CategoryEventDeclarationInput = z.input<typeof CategoryEventDeclarationSchema>;
|
|
608
|
+
declare const CategoryOutputDeclarationSchema: z.ZodObject<{
|
|
609
|
+
intent: z.ZodString;
|
|
610
|
+
label: z.ZodOptional<z.ZodString>;
|
|
611
|
+
description: z.ZodOptional<z.ZodString>;
|
|
612
|
+
capability: z.ZodString;
|
|
613
|
+
operationAlias: z.ZodOptional<z.ZodString>;
|
|
614
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
615
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
616
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
617
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
618
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
619
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
620
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
621
|
+
}, z.core.$strip>;
|
|
622
|
+
type CategoryOutputDeclaration = z.infer<typeof CategoryOutputDeclarationSchema>;
|
|
623
|
+
type CategoryOutputDeclarationInput = z.input<typeof CategoryOutputDeclarationSchema>;
|
|
624
|
+
declare const CategoryDataSourceDeclarationSchema: z.ZodObject<{
|
|
625
|
+
id: z.ZodString;
|
|
626
|
+
label: z.ZodOptional<z.ZodString>;
|
|
627
|
+
description: z.ZodOptional<z.ZodString>;
|
|
628
|
+
capability: z.ZodString;
|
|
629
|
+
operationAlias: z.ZodOptional<z.ZodString>;
|
|
630
|
+
providerObjects: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
631
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
632
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
633
|
+
}, z.core.$strip>;
|
|
634
|
+
type CategoryDataSourceDeclaration = z.infer<typeof CategoryDataSourceDeclarationSchema>;
|
|
635
|
+
type CategoryDataSourceDeclarationInput = z.input<typeof CategoryDataSourceDeclarationSchema>;
|
|
636
|
+
declare const IntegrationCategoryProfileSchema: z.ZodObject<{
|
|
637
|
+
id: z.ZodOptional<z.ZodString>;
|
|
638
|
+
category: z.ZodString;
|
|
639
|
+
label: z.ZodOptional<z.ZodString>;
|
|
640
|
+
description: z.ZodOptional<z.ZodString>;
|
|
641
|
+
providerObjects: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
642
|
+
kind: z.ZodString;
|
|
643
|
+
label: z.ZodOptional<z.ZodString>;
|
|
644
|
+
description: z.ZodOptional<z.ZodString>;
|
|
645
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
646
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
647
|
+
}, z.core.$strip>>>;
|
|
648
|
+
capabilities: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
649
|
+
capability: z.ZodString;
|
|
650
|
+
label: z.ZodOptional<z.ZodString>;
|
|
651
|
+
description: z.ZodOptional<z.ZodString>;
|
|
652
|
+
audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
653
|
+
"customer-facing": "customer-facing";
|
|
654
|
+
"internal-support": "internal-support";
|
|
655
|
+
mixed: "mixed";
|
|
656
|
+
}>>>;
|
|
657
|
+
providerObjects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
658
|
+
kind: z.ZodString;
|
|
659
|
+
label: z.ZodOptional<z.ZodString>;
|
|
660
|
+
description: z.ZodOptional<z.ZodString>;
|
|
661
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
662
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
663
|
+
}, z.core.$strip>>>;
|
|
664
|
+
requiresCredential: z.ZodOptional<z.ZodBoolean>;
|
|
665
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
666
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
667
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
668
|
+
extension: z.ZodOptional<z.ZodBoolean>;
|
|
669
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
670
|
+
}, z.core.$strip>>>;
|
|
671
|
+
operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
672
|
+
alias: z.ZodString;
|
|
673
|
+
capability: z.ZodString;
|
|
674
|
+
label: z.ZodOptional<z.ZodString>;
|
|
675
|
+
description: z.ZodOptional<z.ZodString>;
|
|
676
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
677
|
+
providerObjects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
678
|
+
kind: z.ZodString;
|
|
679
|
+
label: z.ZodOptional<z.ZodString>;
|
|
680
|
+
description: z.ZodOptional<z.ZodString>;
|
|
681
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
682
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
683
|
+
}, z.core.$strip>>>;
|
|
684
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
685
|
+
"customer-facing": "customer-facing";
|
|
686
|
+
"internal-support": "internal-support";
|
|
687
|
+
mixed: "mixed";
|
|
688
|
+
}>>;
|
|
689
|
+
audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
690
|
+
"customer-facing": "customer-facing";
|
|
691
|
+
"internal-support": "internal-support";
|
|
692
|
+
mixed: "mixed";
|
|
693
|
+
}>>>;
|
|
694
|
+
requiresCredential: z.ZodOptional<z.ZodBoolean>;
|
|
695
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
696
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
697
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
698
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
699
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
700
|
+
requiredPolicyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
701
|
+
inputSchemaName: z.ZodOptional<z.ZodString>;
|
|
702
|
+
outputSchemaName: z.ZodOptional<z.ZodString>;
|
|
703
|
+
inputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
704
|
+
outputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
705
|
+
inputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
706
|
+
outputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
707
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
708
|
+
level: z.ZodDefault<z.ZodEnum<{
|
|
709
|
+
required: "required";
|
|
710
|
+
recommended: "recommended";
|
|
711
|
+
optional: "optional";
|
|
712
|
+
extension: "extension";
|
|
713
|
+
}>>;
|
|
714
|
+
}, z.core.$strip>>>;
|
|
715
|
+
events: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
716
|
+
kind: z.ZodString;
|
|
717
|
+
label: z.ZodOptional<z.ZodString>;
|
|
718
|
+
description: z.ZodOptional<z.ZodString>;
|
|
719
|
+
direction: z.ZodEnum<{
|
|
720
|
+
bidirectional: "bidirectional";
|
|
721
|
+
inbound: "inbound";
|
|
722
|
+
outbound: "outbound";
|
|
723
|
+
internal: "internal";
|
|
724
|
+
}>;
|
|
725
|
+
capability: z.ZodOptional<z.ZodString>;
|
|
726
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
727
|
+
operationAlias: z.ZodOptional<z.ZodString>;
|
|
728
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
729
|
+
}, z.core.$strip>>>;
|
|
730
|
+
outputs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
731
|
+
intent: z.ZodString;
|
|
732
|
+
label: z.ZodOptional<z.ZodString>;
|
|
733
|
+
description: z.ZodOptional<z.ZodString>;
|
|
734
|
+
capability: z.ZodString;
|
|
735
|
+
operationAlias: z.ZodOptional<z.ZodString>;
|
|
736
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
737
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
738
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
739
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
740
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
741
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
742
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
743
|
+
}, z.core.$strip>>>;
|
|
744
|
+
dataSources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
745
|
+
id: z.ZodString;
|
|
746
|
+
label: z.ZodOptional<z.ZodString>;
|
|
747
|
+
description: z.ZodOptional<z.ZodString>;
|
|
748
|
+
capability: z.ZodString;
|
|
749
|
+
operationAlias: z.ZodOptional<z.ZodString>;
|
|
750
|
+
providerObjects: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
751
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
752
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
753
|
+
}, z.core.$strip>>>;
|
|
754
|
+
notes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
755
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
756
|
+
}, z.core.$strip>;
|
|
757
|
+
type IntegrationCategoryProfile = z.infer<typeof IntegrationCategoryProfileSchema>;
|
|
758
|
+
type IntegrationCategoryProfileInput = z.input<typeof IntegrationCategoryProfileSchema>;
|
|
759
|
+
declare const ProviderOperationCoverageMismatchSchema: z.ZodObject<{
|
|
760
|
+
alias: z.ZodString;
|
|
761
|
+
reason: z.ZodEnum<{
|
|
762
|
+
missing: "missing";
|
|
763
|
+
"capability-mismatch": "capability-mismatch";
|
|
764
|
+
"provider-object-mismatch": "provider-object-mismatch";
|
|
765
|
+
}>;
|
|
766
|
+
expectedCapability: z.ZodOptional<z.ZodString>;
|
|
767
|
+
actualCapability: z.ZodOptional<z.ZodString>;
|
|
768
|
+
expectedProviderObject: z.ZodOptional<z.ZodString>;
|
|
769
|
+
actualProviderObject: z.ZodOptional<z.ZodString>;
|
|
770
|
+
}, z.core.$strip>;
|
|
771
|
+
type ProviderOperationCoverageMismatch = z.infer<typeof ProviderOperationCoverageMismatchSchema>;
|
|
772
|
+
declare const ProviderCapabilityCoverageReportSchema: z.ZodObject<{
|
|
773
|
+
providerPackageId: z.ZodString;
|
|
774
|
+
category: z.ZodString;
|
|
775
|
+
expectedCategory: z.ZodString;
|
|
776
|
+
categoryMatches: z.ZodBoolean;
|
|
777
|
+
coverage: z.ZodEnum<{
|
|
778
|
+
full: "full";
|
|
779
|
+
partial: "partial";
|
|
780
|
+
standard: "standard";
|
|
781
|
+
}>;
|
|
782
|
+
conformant: z.ZodBoolean;
|
|
783
|
+
matchedOperations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
784
|
+
missingRequiredOperations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
785
|
+
missingRecommendedOperations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
786
|
+
missingOptionalOperations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
787
|
+
extensionOperations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
788
|
+
mismatchedOperations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
789
|
+
alias: z.ZodString;
|
|
790
|
+
reason: z.ZodEnum<{
|
|
791
|
+
missing: "missing";
|
|
792
|
+
"capability-mismatch": "capability-mismatch";
|
|
793
|
+
"provider-object-mismatch": "provider-object-mismatch";
|
|
794
|
+
}>;
|
|
795
|
+
expectedCapability: z.ZodOptional<z.ZodString>;
|
|
796
|
+
actualCapability: z.ZodOptional<z.ZodString>;
|
|
797
|
+
expectedProviderObject: z.ZodOptional<z.ZodString>;
|
|
798
|
+
actualProviderObject: z.ZodOptional<z.ZodString>;
|
|
799
|
+
}, z.core.$strip>>>;
|
|
800
|
+
}, z.core.$strip>;
|
|
801
|
+
type ProviderCapabilityCoverageReport = z.infer<typeof ProviderCapabilityCoverageReportSchema>;
|
|
802
|
+
declare const ProviderCredentialRequirementSchema: z.ZodObject<{
|
|
803
|
+
id: z.ZodString;
|
|
804
|
+
label: z.ZodOptional<z.ZodString>;
|
|
805
|
+
description: z.ZodOptional<z.ZodString>;
|
|
806
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
807
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
808
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
809
|
+
}, z.core.$strip>;
|
|
810
|
+
type ProviderCredentialRequirement = z.infer<typeof ProviderCredentialRequirementSchema>;
|
|
811
|
+
declare const ProviderCoverageScopeSchema: z.ZodEnum<{
|
|
812
|
+
"support-workflow-subset": "support-workflow-subset";
|
|
813
|
+
"provider-api-subset": "provider-api-subset";
|
|
814
|
+
"connector-required": "connector-required";
|
|
815
|
+
"local-protocol": "local-protocol";
|
|
816
|
+
"full-provider-api": "full-provider-api";
|
|
817
|
+
}>;
|
|
818
|
+
type ProviderCoverageScope = z.infer<typeof ProviderCoverageScopeSchema>;
|
|
819
|
+
declare const ProviderCoverageSchema: z.ZodObject<{
|
|
820
|
+
scope: z.ZodDefault<z.ZodEnum<{
|
|
821
|
+
"support-workflow-subset": "support-workflow-subset";
|
|
822
|
+
"provider-api-subset": "provider-api-subset";
|
|
823
|
+
"connector-required": "connector-required";
|
|
824
|
+
"local-protocol": "local-protocol";
|
|
825
|
+
"full-provider-api": "full-provider-api";
|
|
826
|
+
}>>;
|
|
827
|
+
notes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
828
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
829
|
+
label: z.ZodString;
|
|
830
|
+
url: z.ZodOptional<z.ZodString>;
|
|
831
|
+
}, z.core.$strip>>>;
|
|
832
|
+
}, z.core.$strip>;
|
|
833
|
+
type ProviderCoverage = z.infer<typeof ProviderCoverageSchema>;
|
|
834
|
+
type ProviderCoverageInput = z.input<typeof ProviderCoverageSchema>;
|
|
835
|
+
declare const ProviderManifestSchema: z.ZodObject<{
|
|
836
|
+
id: z.ZodString;
|
|
837
|
+
name: z.ZodString;
|
|
838
|
+
packageName: z.ZodString;
|
|
839
|
+
provider: z.ZodString;
|
|
840
|
+
category: z.ZodString;
|
|
841
|
+
trustLevel: z.ZodDefault<z.ZodEnum<{
|
|
842
|
+
community: "community";
|
|
843
|
+
official: "official";
|
|
844
|
+
verified: "verified";
|
|
845
|
+
experimental: "experimental";
|
|
846
|
+
}>>;
|
|
847
|
+
directions: z.ZodArray<z.ZodEnum<{
|
|
848
|
+
"receive-only": "receive-only";
|
|
849
|
+
"send-only": "send-only";
|
|
850
|
+
"inbound-only": "inbound-only";
|
|
851
|
+
"outbound-only": "outbound-only";
|
|
852
|
+
bidirectional: "bidirectional";
|
|
853
|
+
}>>;
|
|
854
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
855
|
+
capability: z.ZodString;
|
|
856
|
+
label: z.ZodOptional<z.ZodString>;
|
|
857
|
+
description: z.ZodOptional<z.ZodString>;
|
|
858
|
+
audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
859
|
+
"customer-facing": "customer-facing";
|
|
860
|
+
"internal-support": "internal-support";
|
|
861
|
+
mixed: "mixed";
|
|
862
|
+
}>>>;
|
|
863
|
+
providerObjects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
864
|
+
kind: z.ZodString;
|
|
865
|
+
label: z.ZodOptional<z.ZodString>;
|
|
866
|
+
description: z.ZodOptional<z.ZodString>;
|
|
867
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
868
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
869
|
+
}, z.core.$strip>>>;
|
|
870
|
+
requiresCredential: z.ZodOptional<z.ZodBoolean>;
|
|
871
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
872
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
873
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
874
|
+
extension: z.ZodOptional<z.ZodBoolean>;
|
|
875
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
876
|
+
}, z.core.$strip>>;
|
|
877
|
+
operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
878
|
+
alias: z.ZodString;
|
|
879
|
+
capability: z.ZodString;
|
|
880
|
+
label: z.ZodOptional<z.ZodString>;
|
|
881
|
+
description: z.ZodOptional<z.ZodString>;
|
|
882
|
+
providerObject: z.ZodOptional<z.ZodString>;
|
|
883
|
+
providerObjects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
884
|
+
kind: z.ZodString;
|
|
885
|
+
label: z.ZodOptional<z.ZodString>;
|
|
886
|
+
description: z.ZodOptional<z.ZodString>;
|
|
887
|
+
schemaName: z.ZodOptional<z.ZodString>;
|
|
888
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
889
|
+
}, z.core.$strip>>>;
|
|
890
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
891
|
+
"customer-facing": "customer-facing";
|
|
892
|
+
"internal-support": "internal-support";
|
|
893
|
+
mixed: "mixed";
|
|
894
|
+
}>>;
|
|
895
|
+
audiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
896
|
+
"customer-facing": "customer-facing";
|
|
897
|
+
"internal-support": "internal-support";
|
|
898
|
+
mixed: "mixed";
|
|
899
|
+
}>>>;
|
|
900
|
+
requiresCredential: z.ZodOptional<z.ZodBoolean>;
|
|
901
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
902
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
903
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
904
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
905
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
906
|
+
requiredPolicyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
907
|
+
inputSchemaName: z.ZodOptional<z.ZodString>;
|
|
908
|
+
outputSchemaName: z.ZodOptional<z.ZodString>;
|
|
909
|
+
inputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
910
|
+
outputSchemaRef: z.ZodOptional<z.ZodString>;
|
|
911
|
+
inputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
912
|
+
outputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
913
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
914
|
+
providerOperation: z.ZodOptional<z.ZodString>;
|
|
915
|
+
extension: z.ZodDefault<z.ZodBoolean>;
|
|
916
|
+
}, z.core.$strip>>>;
|
|
917
|
+
channelAudiences: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
918
|
+
"customer-facing": "customer-facing";
|
|
919
|
+
"internal-support": "internal-support";
|
|
920
|
+
mixed: "mixed";
|
|
921
|
+
}>>>;
|
|
922
|
+
credentialRequirements: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
923
|
+
id: z.ZodString;
|
|
924
|
+
label: z.ZodOptional<z.ZodString>;
|
|
925
|
+
description: z.ZodOptional<z.ZodString>;
|
|
926
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
927
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
928
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
929
|
+
}, z.core.$strip>>>;
|
|
930
|
+
coverage: z.ZodDefault<z.ZodObject<{
|
|
931
|
+
scope: z.ZodDefault<z.ZodEnum<{
|
|
932
|
+
"support-workflow-subset": "support-workflow-subset";
|
|
933
|
+
"provider-api-subset": "provider-api-subset";
|
|
934
|
+
"connector-required": "connector-required";
|
|
935
|
+
"local-protocol": "local-protocol";
|
|
936
|
+
"full-provider-api": "full-provider-api";
|
|
937
|
+
}>>;
|
|
938
|
+
notes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
939
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
940
|
+
label: z.ZodString;
|
|
941
|
+
url: z.ZodOptional<z.ZodString>;
|
|
942
|
+
}, z.core.$strip>>>;
|
|
943
|
+
}, z.core.$strip>>;
|
|
944
|
+
privacyNotes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
945
|
+
limitations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
946
|
+
maintainers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
947
|
+
name: z.ZodString;
|
|
948
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
949
|
+
community: "community";
|
|
950
|
+
official: "official";
|
|
951
|
+
unknown: "unknown";
|
|
952
|
+
partner: "partner";
|
|
953
|
+
}>>;
|
|
954
|
+
url: z.ZodOptional<z.ZodString>;
|
|
955
|
+
}, z.core.$strip>>>;
|
|
956
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
957
|
+
}, z.core.$strip>;
|
|
958
|
+
type ProviderManifest = z.infer<typeof ProviderManifestSchema>;
|
|
959
|
+
type ProviderManifestInput = z.input<typeof ProviderManifestSchema>;
|
|
960
|
+
declare const ProviderRegistryQuerySchema: z.ZodObject<{
|
|
961
|
+
category: z.ZodOptional<z.ZodString>;
|
|
962
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
963
|
+
trustLevels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
964
|
+
community: "community";
|
|
965
|
+
official: "official";
|
|
966
|
+
verified: "verified";
|
|
967
|
+
experimental: "experimental";
|
|
968
|
+
}>>>;
|
|
969
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
970
|
+
directions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
971
|
+
"receive-only": "receive-only";
|
|
972
|
+
"send-only": "send-only";
|
|
973
|
+
"inbound-only": "inbound-only";
|
|
974
|
+
"outbound-only": "outbound-only";
|
|
975
|
+
bidirectional: "bidirectional";
|
|
976
|
+
}>>>;
|
|
977
|
+
channelAudiences: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
978
|
+
"customer-facing": "customer-facing";
|
|
979
|
+
"internal-support": "internal-support";
|
|
980
|
+
mixed: "mixed";
|
|
981
|
+
}>>>;
|
|
982
|
+
packageNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
983
|
+
}, z.core.$strip>;
|
|
984
|
+
type ProviderRegistryQuery = z.infer<typeof ProviderRegistryQuerySchema>;
|
|
985
|
+
type ProviderRegistryQueryInput = z.input<typeof ProviderRegistryQuerySchema>;
|
|
986
|
+
interface ProviderRegistry {
|
|
987
|
+
register(manifest: ProviderManifestInput): ProviderManifest;
|
|
988
|
+
list(query?: ProviderRegistryQueryInput): ProviderManifest[];
|
|
989
|
+
get(id: string): ProviderManifest | undefined;
|
|
990
|
+
require(id: string): ProviderManifest;
|
|
991
|
+
}
|
|
992
|
+
declare function defineProviderPackage(manifest: ProviderManifestInput): ProviderManifest;
|
|
993
|
+
declare function defineIntegrationCategoryProfile(profile: IntegrationCategoryProfileInput): IntegrationCategoryProfile;
|
|
994
|
+
declare function deriveProviderCapabilityCoverage(input: {
|
|
995
|
+
profile: IntegrationCategoryProfileInput;
|
|
996
|
+
manifest: ProviderManifestInput;
|
|
997
|
+
}): ProviderCapabilityCoverageReport;
|
|
998
|
+
declare function checkProviderCapabilityCoverage(input: {
|
|
999
|
+
profile: IntegrationCategoryProfileInput;
|
|
1000
|
+
manifest: ProviderManifestInput;
|
|
1001
|
+
}): boolean;
|
|
1002
|
+
declare function createProviderRegistry(manifests?: ProviderManifestInput[]): ProviderRegistry;
|
|
1003
|
+
declare function isCoreChannelCapability(capability: string): capability is CoreChannelCapability;
|
|
1004
|
+
|
|
1005
|
+
declare const CapabilityAvailabilitySchema: z.ZodObject<{
|
|
1006
|
+
providerPackageId: z.ZodOptional<z.ZodString>;
|
|
1007
|
+
capability: z.ZodOptional<z.ZodString>;
|
|
1008
|
+
status: z.ZodEnum<{
|
|
1009
|
+
"registry-available": "registry-available";
|
|
1010
|
+
installed: "installed";
|
|
1011
|
+
configured: "configured";
|
|
1012
|
+
enabled: "enabled";
|
|
1013
|
+
blocked: "blocked";
|
|
1014
|
+
}>;
|
|
1015
|
+
enabledForChannels: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1016
|
+
enabledForAgents: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1017
|
+
enabledForJourneys: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1018
|
+
enabledForTools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1019
|
+
blockers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1020
|
+
code: z.ZodString;
|
|
1021
|
+
message: z.ZodString;
|
|
1022
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
1023
|
+
"permission-blocked": "permission-blocked";
|
|
1024
|
+
unknown: "unknown";
|
|
1025
|
+
"missing-policy": "missing-policy";
|
|
1026
|
+
"missing-configuration": "missing-configuration";
|
|
1027
|
+
"missing-credentials": "missing-credentials";
|
|
1028
|
+
"provider-unsupported": "provider-unsupported";
|
|
1029
|
+
}>>;
|
|
1030
|
+
}, z.core.$strip>>>;
|
|
1031
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1032
|
+
}, z.core.$strip>;
|
|
1033
|
+
type CapabilityAvailability = z.infer<typeof CapabilityAvailabilitySchema>;
|
|
1034
|
+
type CapabilityAvailabilityInput = z.input<typeof CapabilityAvailabilitySchema>;
|
|
1035
|
+
declare const ProviderCredentialStatusSchema: z.ZodObject<{
|
|
1036
|
+
providerPackageId: z.ZodOptional<z.ZodString>;
|
|
1037
|
+
requirementId: z.ZodString;
|
|
1038
|
+
state: z.ZodEnum<{
|
|
1039
|
+
required: "required";
|
|
1040
|
+
configured: "configured";
|
|
1041
|
+
"not-required": "not-required";
|
|
1042
|
+
missing: "missing";
|
|
1043
|
+
expired: "expired";
|
|
1044
|
+
"insufficient-scope": "insufficient-scope";
|
|
1045
|
+
"permission-blocked": "permission-blocked";
|
|
1046
|
+
unavailable: "unavailable";
|
|
1047
|
+
}>;
|
|
1048
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1049
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
1050
|
+
message: z.ZodOptional<z.ZodString>;
|
|
1051
|
+
}, z.core.$strip>;
|
|
1052
|
+
type ProviderCredentialStatus = z.infer<typeof ProviderCredentialStatusSchema>;
|
|
1053
|
+
type ProviderCredentialStatusInput = z.input<typeof ProviderCredentialStatusSchema>;
|
|
1054
|
+
declare const ChannelFlowActivationSchema: z.ZodObject<{
|
|
1055
|
+
journeyId: z.ZodString;
|
|
1056
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1057
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1058
|
+
providerPackageIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1059
|
+
policyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1060
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1061
|
+
}, z.core.$strip>;
|
|
1062
|
+
type ChannelFlowActivation = z.infer<typeof ChannelFlowActivationSchema>;
|
|
1063
|
+
type ChannelFlowActivationInput = z.input<typeof ChannelFlowActivationSchema>;
|
|
1064
|
+
declare const ChannelOutboundPolicySchema: z.ZodObject<{
|
|
1065
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1066
|
+
providerPackageIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1067
|
+
requiresProviderOutboundSupport: z.ZodDefault<z.ZodBoolean>;
|
|
1068
|
+
policyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1069
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1070
|
+
}, z.core.$strip>;
|
|
1071
|
+
type ChannelOutboundPolicy = z.infer<typeof ChannelOutboundPolicySchema>;
|
|
1072
|
+
type ChannelOutboundPolicyInput = z.input<typeof ChannelOutboundPolicySchema>;
|
|
1073
|
+
declare const ChannelBehaviorPolicySchema: z.ZodObject<{
|
|
1074
|
+
tone: z.ZodOptional<z.ZodString>;
|
|
1075
|
+
maxWords: z.ZodOptional<z.ZodNumber>;
|
|
1076
|
+
maxCharacters: z.ZodOptional<z.ZodNumber>;
|
|
1077
|
+
allowMarkdown: z.ZodOptional<z.ZodBoolean>;
|
|
1078
|
+
allowWidgets: z.ZodOptional<z.ZodBoolean>;
|
|
1079
|
+
draftFirst: z.ZodOptional<z.ZodBoolean>;
|
|
1080
|
+
approval: z.ZodOptional<z.ZodUnknown>;
|
|
1081
|
+
sensitiveData: z.ZodOptional<z.ZodUnknown>;
|
|
1082
|
+
media: z.ZodOptional<z.ZodUnknown>;
|
|
1083
|
+
handoff: z.ZodOptional<z.ZodUnknown>;
|
|
1084
|
+
}, z.core.$loose>;
|
|
1085
|
+
type ChannelBehaviorPolicy = z.infer<typeof ChannelBehaviorPolicySchema>;
|
|
1086
|
+
type ChannelBehaviorPolicyInput = z.input<typeof ChannelBehaviorPolicySchema>;
|
|
1087
|
+
declare const ChannelHandoffPolicySchema: z.ZodObject<{
|
|
1088
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1089
|
+
providerPackageIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1090
|
+
destinations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1091
|
+
sdkControlled: z.ZodOptional<z.ZodBoolean>;
|
|
1092
|
+
policyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1093
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1094
|
+
}, z.core.$strip>;
|
|
1095
|
+
type ChannelHandoffPolicy = z.infer<typeof ChannelHandoffPolicySchema>;
|
|
1096
|
+
type ChannelHandoffPolicyInput = z.input<typeof ChannelHandoffPolicySchema>;
|
|
1097
|
+
declare const ChannelSetConfigSchema: z.ZodObject<{
|
|
1098
|
+
id: z.ZodString;
|
|
1099
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1100
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1101
|
+
channelIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1102
|
+
channels: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1103
|
+
conversationContinuity: z.ZodOptional<z.ZodObject<{
|
|
1104
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
1105
|
+
"new-conversation": "new-conversation";
|
|
1106
|
+
"link-existing": "link-existing";
|
|
1107
|
+
"sdk-decides": "sdk-decides";
|
|
1108
|
+
}>>;
|
|
1109
|
+
crossChannel: z.ZodDefault<z.ZodBoolean>;
|
|
1110
|
+
policy: z.ZodOptional<z.ZodString>;
|
|
1111
|
+
}, z.core.$strip>>;
|
|
1112
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1113
|
+
}, z.core.$strip>;
|
|
1114
|
+
type ChannelSetConfig = z.infer<typeof ChannelSetConfigSchema>;
|
|
1115
|
+
type ChannelSetConfigInput = z.input<typeof ChannelSetConfigSchema>;
|
|
1116
|
+
declare const ProviderReadinessSchema: z.ZodObject<{
|
|
1117
|
+
providerPackageId: z.ZodString;
|
|
1118
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
1119
|
+
configured: "configured";
|
|
1120
|
+
blocked: "blocked";
|
|
1121
|
+
unknown: "unknown";
|
|
1122
|
+
"not-configured": "not-configured";
|
|
1123
|
+
ready: "ready";
|
|
1124
|
+
"live-verified": "live-verified";
|
|
1125
|
+
"sandbox-verified": "sandbox-verified";
|
|
1126
|
+
"scoped-verified": "scoped-verified";
|
|
1127
|
+
"full-api-verified": "full-api-verified";
|
|
1128
|
+
}>>;
|
|
1129
|
+
checkedAt: z.ZodOptional<z.ZodString>;
|
|
1130
|
+
checkSource: z.ZodOptional<z.ZodString>;
|
|
1131
|
+
live: z.ZodOptional<z.ZodBoolean>;
|
|
1132
|
+
sandbox: z.ZodOptional<z.ZodBoolean>;
|
|
1133
|
+
blockers: z.ZodDefault<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1134
|
+
code: z.ZodString;
|
|
1135
|
+
message: z.ZodString;
|
|
1136
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
1137
|
+
"permission-blocked": "permission-blocked";
|
|
1138
|
+
unknown: "unknown";
|
|
1139
|
+
"missing-policy": "missing-policy";
|
|
1140
|
+
"missing-configuration": "missing-configuration";
|
|
1141
|
+
"missing-credentials": "missing-credentials";
|
|
1142
|
+
"provider-unsupported": "provider-unsupported";
|
|
1143
|
+
}>>;
|
|
1144
|
+
}, z.core.$strip>>>>;
|
|
1145
|
+
remediationActions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1146
|
+
id: z.ZodString;
|
|
1147
|
+
label: z.ZodString;
|
|
1148
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
1149
|
+
custom: "custom";
|
|
1150
|
+
configure: "configure";
|
|
1151
|
+
authorize: "authorize";
|
|
1152
|
+
verify: "verify";
|
|
1153
|
+
"read-docs": "read-docs";
|
|
1154
|
+
"contact-provider": "contact-provider";
|
|
1155
|
+
}>>;
|
|
1156
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1157
|
+
}, z.core.$strip>>>;
|
|
1158
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1159
|
+
}, z.core.$strip>;
|
|
1160
|
+
type ProviderReadiness = z.infer<typeof ProviderReadinessSchema>;
|
|
1161
|
+
type ProviderReadinessInput = z.input<typeof ProviderReadinessSchema>;
|
|
1162
|
+
declare const ChannelPolicyConfigSchema: z.ZodObject<{
|
|
1163
|
+
id: z.ZodString;
|
|
1164
|
+
channel: z.ZodString;
|
|
1165
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1166
|
+
audience: z.ZodOptional<z.ZodEnum<{
|
|
1167
|
+
"customer-facing": "customer-facing";
|
|
1168
|
+
"internal-support": "internal-support";
|
|
1169
|
+
mixed: "mixed";
|
|
1170
|
+
}>>;
|
|
1171
|
+
channelSetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1172
|
+
providerPackageIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1173
|
+
enabledCapabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1174
|
+
flowActivations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1175
|
+
journeyId: z.ZodString;
|
|
1176
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1177
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1178
|
+
providerPackageIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1179
|
+
policyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1180
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1181
|
+
}, z.core.$strip>>>;
|
|
1182
|
+
behavior: z.ZodOptional<z.ZodObject<{
|
|
1183
|
+
tone: z.ZodOptional<z.ZodString>;
|
|
1184
|
+
maxWords: z.ZodOptional<z.ZodNumber>;
|
|
1185
|
+
maxCharacters: z.ZodOptional<z.ZodNumber>;
|
|
1186
|
+
allowMarkdown: z.ZodOptional<z.ZodBoolean>;
|
|
1187
|
+
allowWidgets: z.ZodOptional<z.ZodBoolean>;
|
|
1188
|
+
draftFirst: z.ZodOptional<z.ZodBoolean>;
|
|
1189
|
+
approval: z.ZodOptional<z.ZodUnknown>;
|
|
1190
|
+
sensitiveData: z.ZodOptional<z.ZodUnknown>;
|
|
1191
|
+
media: z.ZodOptional<z.ZodUnknown>;
|
|
1192
|
+
handoff: z.ZodOptional<z.ZodUnknown>;
|
|
1193
|
+
}, z.core.$loose>>;
|
|
1194
|
+
outbound: z.ZodOptional<z.ZodObject<{
|
|
1195
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1196
|
+
providerPackageIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1197
|
+
requiresProviderOutboundSupport: z.ZodDefault<z.ZodBoolean>;
|
|
1198
|
+
policyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1199
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1200
|
+
}, z.core.$strip>>;
|
|
1201
|
+
handoff: z.ZodOptional<z.ZodObject<{
|
|
1202
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1203
|
+
providerPackageIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1204
|
+
destinations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1205
|
+
sdkControlled: z.ZodOptional<z.ZodBoolean>;
|
|
1206
|
+
policyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1207
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1208
|
+
}, z.core.$strip>>;
|
|
1209
|
+
policies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1210
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1211
|
+
}, z.core.$strip>;
|
|
1212
|
+
type ChannelPolicyConfig = z.infer<typeof ChannelPolicyConfigSchema>;
|
|
1213
|
+
type ChannelPolicyConfigInput = z.input<typeof ChannelPolicyConfigSchema>;
|
|
1214
|
+
declare const CapabilityUseRequestSchema: z.ZodObject<{
|
|
1215
|
+
channel: z.ZodString;
|
|
1216
|
+
channelId: z.ZodOptional<z.ZodString>;
|
|
1217
|
+
capability: z.ZodString;
|
|
1218
|
+
providerPackageId: z.ZodOptional<z.ZodString>;
|
|
1219
|
+
actionAudience: z.ZodOptional<z.ZodEnum<{
|
|
1220
|
+
"customer-facing": "customer-facing";
|
|
1221
|
+
"internal-support": "internal-support";
|
|
1222
|
+
mixed: "mixed";
|
|
1223
|
+
}>>;
|
|
1224
|
+
outbound: z.ZodOptional<z.ZodBoolean>;
|
|
1225
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
1226
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
1227
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
1228
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
1229
|
+
requiredPolicyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1230
|
+
}, z.core.$strip>;
|
|
1231
|
+
type CapabilityUseRequest = z.infer<typeof CapabilityUseRequestSchema>;
|
|
1232
|
+
type CapabilityUseRequestInput = z.input<typeof CapabilityUseRequestSchema>;
|
|
1233
|
+
type CapabilityUseDecision = {
|
|
1234
|
+
allowed: true;
|
|
1235
|
+
policy: ChannelPolicyConfig;
|
|
1236
|
+
} | {
|
|
1237
|
+
allowed: false;
|
|
1238
|
+
code: "missing-channel-configuration" | "capability-not-enabled" | "capability-blocked" | "outbound-disabled" | "provider-direction-not-supported" | "missing-policy";
|
|
1239
|
+
message: string;
|
|
1240
|
+
blockers: Array<{
|
|
1241
|
+
code: string;
|
|
1242
|
+
message: string;
|
|
1243
|
+
kind?: string;
|
|
1244
|
+
}>;
|
|
1245
|
+
};
|
|
1246
|
+
declare function defineChannelPolicy(config: z.input<typeof ChannelPolicyConfigSchema>): ChannelPolicyConfig;
|
|
1247
|
+
declare function defineCapabilityAvailability(input: CapabilityAvailabilityInput): CapabilityAvailability;
|
|
1248
|
+
declare function evaluateCapabilityUse(input: {
|
|
1249
|
+
request: CapabilityUseRequestInput;
|
|
1250
|
+
channels: ChannelPolicyConfigInput[];
|
|
1251
|
+
availability?: CapabilityAvailabilityInput[];
|
|
1252
|
+
providerPackages?: ProviderManifestInput[];
|
|
1253
|
+
}): CapabilityUseDecision;
|
|
1254
|
+
|
|
198
1255
|
type Primitive = string | number | boolean | bigint | symbol | null | undefined | Date;
|
|
199
1256
|
type StringKey<T> = Extract<keyof T, string>;
|
|
200
1257
|
type ContextPath<T> = T extends Primitive ? never : T extends readonly unknown[] ? never : {
|
|
@@ -227,6 +1284,38 @@ interface ToolExecutionContext<TInput, TApp = unknown> {
|
|
|
227
1284
|
idempotencyKey?: string;
|
|
228
1285
|
signal?: AbortSignal;
|
|
229
1286
|
}
|
|
1287
|
+
type ApprovalRequirement = "never" | "policy" | "required";
|
|
1288
|
+
type ApprovalResolutionMode = "approve" | "deny" | "edit" | "expire" | "cancel" | "return-to-agent";
|
|
1289
|
+
interface ToolApprovalOptions {
|
|
1290
|
+
requirement?: ApprovalRequirement;
|
|
1291
|
+
supportedResolutions?: ApprovalResolutionMode[];
|
|
1292
|
+
editableFields?: string[];
|
|
1293
|
+
reason?: string;
|
|
1294
|
+
expiresAt?: string;
|
|
1295
|
+
metadata?: Record<string, unknown>;
|
|
1296
|
+
}
|
|
1297
|
+
type RuntimeApprovalOutcome = "allow" | "require-approval" | "draft" | "deny" | "defer" | "handoff";
|
|
1298
|
+
interface RuntimeApprovalDecision {
|
|
1299
|
+
outcome: RuntimeApprovalOutcome;
|
|
1300
|
+
reason?: string;
|
|
1301
|
+
supportedResolutions?: ApprovalResolutionMode[];
|
|
1302
|
+
editableFields?: string[];
|
|
1303
|
+
expiresAt?: string;
|
|
1304
|
+
metadata?: Record<string, unknown>;
|
|
1305
|
+
}
|
|
1306
|
+
interface ToolPolicyOptions {
|
|
1307
|
+
capability?: ChannelCapability;
|
|
1308
|
+
providerPackageId?: string;
|
|
1309
|
+
operationAlias?: string;
|
|
1310
|
+
providerOperation?: string;
|
|
1311
|
+
actionAudience?: ActionAudience;
|
|
1312
|
+
outbound?: boolean;
|
|
1313
|
+
externallyVisible?: boolean;
|
|
1314
|
+
exposesSensitiveData?: boolean;
|
|
1315
|
+
changesWorkflow?: boolean;
|
|
1316
|
+
requiredPolicyIds?: string[];
|
|
1317
|
+
approval?: ToolApprovalOptions;
|
|
1318
|
+
}
|
|
230
1319
|
interface ToolDefinition<TName extends string = string, TInputSchema extends z.ZodType = z.ZodType, TOutputSchema extends z.ZodType = z.ZodType, TSideEffect extends boolean = boolean> {
|
|
231
1320
|
kind: "tool";
|
|
232
1321
|
name: TName;
|
|
@@ -234,6 +1323,7 @@ interface ToolDefinition<TName extends string = string, TInputSchema extends z.Z
|
|
|
234
1323
|
input: TInputSchema;
|
|
235
1324
|
output: TOutputSchema;
|
|
236
1325
|
sideEffect: TSideEffect;
|
|
1326
|
+
policy?: ToolPolicyOptions;
|
|
237
1327
|
idempotencyKey?: (args: {
|
|
238
1328
|
input: z.infer<TInputSchema>;
|
|
239
1329
|
conversationId: string;
|
|
@@ -278,380 +1368,793 @@ interface CustomRuntimeEventDefinition<TName extends string = string, TPayloadSc
|
|
|
278
1368
|
}
|
|
279
1369
|
type AnyCustomRuntimeEvent = CustomRuntimeEventDefinition<string, z.ZodType>;
|
|
280
1370
|
|
|
281
|
-
interface
|
|
282
|
-
|
|
283
|
-
conversationId: string;
|
|
284
|
-
offset: number;
|
|
285
|
-
type: TType;
|
|
286
|
-
createdAt: string;
|
|
287
|
-
telemetry?: RuntimeEventTelemetry;
|
|
288
|
-
data: TData;
|
|
1371
|
+
interface EmailQuoteTrimOptions {
|
|
1372
|
+
includeQuotedText?: boolean;
|
|
289
1373
|
}
|
|
290
|
-
|
|
291
|
-
interface MessageSegment {
|
|
292
|
-
id: string;
|
|
1374
|
+
interface EmailQuoteTrimResult {
|
|
293
1375
|
text: string;
|
|
294
|
-
|
|
1376
|
+
removedQuote: boolean;
|
|
1377
|
+
quotedText?: string;
|
|
1378
|
+
reason?: "reply-header" | "original-message" | "forwarded-message" | "quoted-block" | "metadata-header";
|
|
295
1379
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
1380
|
+
interface EmailAttachmentMetadataInput {
|
|
1381
|
+
id?: string;
|
|
1382
|
+
providerObjectId?: string;
|
|
1383
|
+
filename?: string | null;
|
|
1384
|
+
name?: string | null;
|
|
1385
|
+
contentType?: string | null;
|
|
1386
|
+
mimeType?: string | null;
|
|
1387
|
+
sizeBytes?: number | null;
|
|
1388
|
+
size?: number | null;
|
|
1389
|
+
inline?: boolean | null;
|
|
1390
|
+
disposition?: string | null;
|
|
1391
|
+
contentId?: string | null;
|
|
1392
|
+
checksum?: string | null;
|
|
1393
|
+
metadata?: Record<string, unknown>;
|
|
1394
|
+
}
|
|
1395
|
+
interface EmailAttachmentMetadata {
|
|
1396
|
+
id?: string;
|
|
1397
|
+
providerObjectId?: string;
|
|
1398
|
+
filename: string;
|
|
1399
|
+
contentType: string;
|
|
1400
|
+
sizeBytes?: number;
|
|
1401
|
+
disposition: "attachment" | "inline";
|
|
1402
|
+
contentId?: string;
|
|
1403
|
+
checksum?: string;
|
|
1404
|
+
metadata?: Record<string, unknown>;
|
|
1405
|
+
}
|
|
1406
|
+
interface EmailThreadMessageInput {
|
|
1407
|
+
id?: string;
|
|
1408
|
+
providerObjectId?: string;
|
|
1409
|
+
messageId?: string;
|
|
1410
|
+
inReplyTo?: string;
|
|
1411
|
+
references?: string[];
|
|
1412
|
+
from?: string;
|
|
1413
|
+
to?: string[];
|
|
1414
|
+
cc?: string[];
|
|
1415
|
+
bcc?: string[];
|
|
1416
|
+
subject?: string;
|
|
1417
|
+
sentAt?: string | Date;
|
|
1418
|
+
text?: string;
|
|
1419
|
+
html?: string;
|
|
1420
|
+
attachments?: EmailAttachmentMetadataInput[];
|
|
1421
|
+
metadata?: Record<string, unknown>;
|
|
1422
|
+
}
|
|
1423
|
+
interface EmailThreadContextOptions {
|
|
1424
|
+
trimQuotes?: boolean;
|
|
1425
|
+
maxMessages?: number;
|
|
1426
|
+
}
|
|
1427
|
+
interface EmailThreadContextMessage {
|
|
1428
|
+
id?: string;
|
|
1429
|
+
providerObjectId?: string;
|
|
1430
|
+
messageId?: string;
|
|
1431
|
+
inReplyTo?: string;
|
|
1432
|
+
references: string[];
|
|
1433
|
+
from?: string;
|
|
1434
|
+
to: string[];
|
|
1435
|
+
cc: string[];
|
|
1436
|
+
bcc: string[];
|
|
1437
|
+
subject?: string;
|
|
1438
|
+
sentAt?: string;
|
|
311
1439
|
text: string;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
1440
|
+
quotedTextRemoved: boolean;
|
|
1441
|
+
attachments: EmailAttachmentMetadata[];
|
|
1442
|
+
metadata?: Record<string, unknown>;
|
|
1443
|
+
}
|
|
1444
|
+
interface EmailThreadContext {
|
|
1445
|
+
subject?: string;
|
|
1446
|
+
participants: string[];
|
|
1447
|
+
messageIds: string[];
|
|
1448
|
+
references: string[];
|
|
1449
|
+
attachmentCount: number;
|
|
1450
|
+
messages: EmailThreadContextMessage[];
|
|
1451
|
+
}
|
|
1452
|
+
declare function trimEmailQuote(input: string, options?: EmailQuoteTrimOptions): EmailQuoteTrimResult;
|
|
1453
|
+
declare function normalizeEmailAttachmentMetadata(input: EmailAttachmentMetadataInput): EmailAttachmentMetadata;
|
|
1454
|
+
declare function collectEmailAttachmentMetadata(attachments?: EmailAttachmentMetadataInput[]): EmailAttachmentMetadata[];
|
|
1455
|
+
declare function createEmailThreadContext(messages: EmailThreadMessageInput[], options?: EmailThreadContextOptions): EmailThreadContext;
|
|
1456
|
+
|
|
1457
|
+
type Extensible<T extends string> = T | (string & {});
|
|
1458
|
+
declare const coreChannelEventNatures: readonly ["message", "voice.session.started", "voice.turn.finalized", "provider.object.updated", "operator.resume", "outbound.contact.requested", "channel.handoff.requested", "schedule.due", "output.resolution", "delivery.updated", "custom"];
|
|
1459
|
+
declare const channelEventDirections: readonly ["inbound", "outbound", "internal"];
|
|
1460
|
+
declare const channelEventActorTypes: readonly ["customer", "agent", "operator", "provider", "system", "scheduler", "application"];
|
|
1461
|
+
declare const coreChannelEventIntents: readonly ["customer-message", "agent-message", "customer-voice-turn", "provider-update", "operator-resume", "outbound-contact", "channel-handoff", "scheduled-support-action", "output-resolution", "delivery-update", "handoff-review", "record-only"];
|
|
1462
|
+
declare const channelEventSourceTypes: readonly ["provider-adapter", "application", "schedule-adapter", "operator-surface"];
|
|
1463
|
+
declare const channelEventIntakeStatuses: readonly ["accepted", "ignored", "deferred", "handoff-review", "blocked"];
|
|
1464
|
+
declare const channelEventBindingStatuses: readonly ["bound", "created", "unbound", "not-required", "blocked"];
|
|
1465
|
+
declare const channelEventBindingOutcomes: readonly ["start-new", "resume-existing", "link-and-start-new", "ignore", "defer", "handoff-review", "blocked"];
|
|
1466
|
+
declare const channelEventHandlingDispositionKinds: readonly ["no-op", "record-only", "deterministic-journey-event", "model-turn", "output-resolution", "provider-operation", "handoff-review"];
|
|
1467
|
+
declare const coreChannelOutputIntentKinds: readonly ["message.reply", "message.draft", "internal.note", "voice.reply", "provider.operation", "provider.object.update", "approval.request", "artifact.create", "notification.send", "handoff.review", "custom"];
|
|
1468
|
+
declare const channelOutputProducerTypes: readonly ["agent", "journey", "tool", "operator", "policy", "schedule", "application", "provider-adapter"];
|
|
1469
|
+
declare const channelOutputDeliveryModes: readonly ["send", "draft", "provider-operation", "approval", "artifact", "notify", "handoff-review", "none"];
|
|
1470
|
+
declare const channelOutputResolutionOutcomes: readonly ["send", "draft", "approval-required", "provider-operation", "artifact", "notify", "handoff-review", "defer", "block", "drop", "no-op"];
|
|
1471
|
+
declare const channelOutputResolutionStatuses: readonly ["resolved", "pending", "deferred", "blocked", "no-op"];
|
|
1472
|
+
declare const coreChannelEventKinds: readonly ["message", "voice.session.started", "voice.turn.finalized", "provider.object.updated", "operator.resume", "outbound.contact.requested", "channel.handoff.requested", "schedule.due", "output.resolution", "delivery.updated", "custom"];
|
|
1473
|
+
declare const coreChannelEventDirections: readonly ["inbound", "outbound", "internal"];
|
|
1474
|
+
declare const coreChannelEventActors: readonly ["customer", "agent", "operator", "provider", "system", "scheduler", "application"];
|
|
1475
|
+
type CoreChannelEventNature = typeof coreChannelEventNatures[number];
|
|
1476
|
+
type ChannelEventNature = Extensible<CoreChannelEventNature>;
|
|
1477
|
+
type CoreChannelEventKind = CoreChannelEventNature;
|
|
1478
|
+
type ChannelEventKind = ChannelEventNature;
|
|
1479
|
+
type ChannelEventDirection = typeof channelEventDirections[number];
|
|
1480
|
+
type ChannelEventActorType = typeof channelEventActorTypes[number];
|
|
1481
|
+
type CoreChannelEventDirection = ChannelEventDirection;
|
|
1482
|
+
type CoreChannelEventActor = ChannelEventActorType;
|
|
1483
|
+
type CoreChannelEventIntent = typeof coreChannelEventIntents[number];
|
|
1484
|
+
type ChannelEventIntent = Extensible<CoreChannelEventIntent>;
|
|
1485
|
+
type ChannelEventSourceType = typeof channelEventSourceTypes[number];
|
|
1486
|
+
type ChannelEventIntakeStatus = typeof channelEventIntakeStatuses[number];
|
|
1487
|
+
type ChannelEventBindingStatus = typeof channelEventBindingStatuses[number];
|
|
1488
|
+
type ChannelEventBindingOutcome = typeof channelEventBindingOutcomes[number];
|
|
1489
|
+
type ChannelEventHandlingDispositionKind = typeof channelEventHandlingDispositionKinds[number];
|
|
1490
|
+
type ChannelEventHandlingDisposition = ChannelEventHandlingDispositionKind;
|
|
1491
|
+
type CoreChannelOutputIntentKind = typeof coreChannelOutputIntentKinds[number];
|
|
1492
|
+
type ChannelOutputIntentKind = Extensible<CoreChannelOutputIntentKind>;
|
|
1493
|
+
type ChannelOutputProducerType = typeof channelOutputProducerTypes[number];
|
|
1494
|
+
type ChannelOutputDeliveryMode = typeof channelOutputDeliveryModes[number];
|
|
1495
|
+
type ChannelOutputResolutionOutcome = typeof channelOutputResolutionOutcomes[number];
|
|
1496
|
+
type ChannelOutputResolutionStatus = typeof channelOutputResolutionStatuses[number];
|
|
1497
|
+
|
|
1498
|
+
interface ChannelEventActor {
|
|
1499
|
+
type: ChannelEventActorType;
|
|
1500
|
+
id?: string;
|
|
1501
|
+
displayName?: string;
|
|
1502
|
+
metadata?: Record<string, unknown>;
|
|
1503
|
+
}
|
|
1504
|
+
interface NormalizedChannelPayload {
|
|
1505
|
+
text?: string;
|
|
1506
|
+
subject?: string;
|
|
1507
|
+
body?: string;
|
|
1508
|
+
summary?: string;
|
|
1509
|
+
attachments?: unknown[];
|
|
1510
|
+
providerObject?: unknown;
|
|
1511
|
+
status?: string;
|
|
1512
|
+
metadata?: Record<string, unknown>;
|
|
1513
|
+
}
|
|
1514
|
+
type NormalizedChannelPayloadInput = NormalizedChannelPayload & Record<string, unknown>;
|
|
1515
|
+
interface ChannelEventSourceEvidence<TRawPayload = unknown> {
|
|
1516
|
+
sourceType?: ChannelEventSourceType;
|
|
1517
|
+
sourceId?: string;
|
|
323
1518
|
provider?: string;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
1519
|
+
providerPackageId?: string;
|
|
1520
|
+
eventId?: string;
|
|
1521
|
+
streamId?: string;
|
|
1522
|
+
deliveryId?: string;
|
|
1523
|
+
receivedAt?: string;
|
|
1524
|
+
verified?: boolean;
|
|
1525
|
+
externalObjectIds?: Record<string, string>;
|
|
1526
|
+
raw?: TRawPayload;
|
|
1527
|
+
metadata?: Record<string, unknown>;
|
|
1528
|
+
}
|
|
1529
|
+
interface ChannelEventIdentity {
|
|
1530
|
+
key?: string;
|
|
1531
|
+
dedupeKey?: string;
|
|
1532
|
+
streamId?: string;
|
|
1533
|
+
sequence?: string | number;
|
|
1534
|
+
idempotencyKey?: string;
|
|
1535
|
+
metadata?: Record<string, unknown>;
|
|
1536
|
+
}
|
|
1537
|
+
interface ChannelEventEnvelope<TPayload = NormalizedChannelPayload, TRawPayload = unknown> {
|
|
1538
|
+
id?: string;
|
|
1539
|
+
kind: ChannelEventKind;
|
|
1540
|
+
nature: ChannelEventNature;
|
|
1541
|
+
direction: ChannelEventDirection;
|
|
1542
|
+
intent?: ChannelEventIntent;
|
|
1543
|
+
actor?: ChannelEventActor;
|
|
1544
|
+
channel: ChannelContext;
|
|
1545
|
+
occurredAt?: string;
|
|
1546
|
+
payload?: TPayload;
|
|
1547
|
+
identity?: ChannelEventIdentity;
|
|
1548
|
+
source?: ChannelEventSourceEvidence<TRawPayload>;
|
|
1549
|
+
metadata?: Record<string, unknown>;
|
|
1550
|
+
}
|
|
1551
|
+
type ChannelEvent<TPayload = NormalizedChannelPayload, TRawPayload = unknown> = ChannelEventEnvelope<TPayload, TRawPayload>;
|
|
1552
|
+
type ChannelSourceEvidence<TRawPayload = unknown> = ChannelEventSourceEvidence<TRawPayload>;
|
|
1553
|
+
interface ChannelEventEnvelopeInput<TPayload = NormalizedChannelPayloadInput, TRawPayload = unknown> {
|
|
1554
|
+
id?: string;
|
|
1555
|
+
kind?: ChannelEventKind;
|
|
1556
|
+
nature?: ChannelEventNature;
|
|
1557
|
+
direction?: ChannelEventDirection;
|
|
1558
|
+
intent?: ChannelEventIntent;
|
|
1559
|
+
actor?: ChannelEventActor;
|
|
1560
|
+
channel: ConversationChannelInput;
|
|
1561
|
+
occurredAt?: string;
|
|
1562
|
+
payload?: TPayload;
|
|
1563
|
+
identity?: ChannelEventIdentity;
|
|
1564
|
+
source?: ChannelEventSourceEvidence<TRawPayload>;
|
|
1565
|
+
metadata?: Record<string, unknown>;
|
|
1566
|
+
}
|
|
1567
|
+
interface ChannelEventBindingResult {
|
|
1568
|
+
outcome: ChannelEventBindingOutcome;
|
|
1569
|
+
status?: ChannelEventBindingStatus;
|
|
1570
|
+
channel?: ChannelContext;
|
|
1571
|
+
conversationId?: string;
|
|
327
1572
|
reason?: string;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}> | RuntimeEventBase<"voice.interrupted", {
|
|
335
|
-
channelSegmentId: string;
|
|
336
|
-
connectionId?: string;
|
|
337
|
-
interruptedMessageId?: string;
|
|
338
|
-
source?: "userSpeech" | "adapter" | "provider";
|
|
1573
|
+
}
|
|
1574
|
+
interface ChannelEventIntakeResult {
|
|
1575
|
+
outcome: ChannelEventIntakeStatus;
|
|
1576
|
+
bindingOutcome: ChannelEventBindingOutcome;
|
|
1577
|
+
conversationId?: string;
|
|
1578
|
+
handling: "started" | "queued" | "not-required";
|
|
339
1579
|
reason?: string;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}> | RuntimeEventBase<"voice.recording.completed", {
|
|
347
|
-
channelSegmentId: string;
|
|
348
|
-
recordingReferenceId: string;
|
|
349
|
-
uri?: string;
|
|
350
|
-
startedAt?: string;
|
|
351
|
-
endedAt?: string;
|
|
352
|
-
metadata?: unknown;
|
|
353
|
-
}> | RuntimeEventBase<"voice.transcript.committed", {
|
|
354
|
-
channelSegmentId: string;
|
|
355
|
-
speaker: "user" | "assistant";
|
|
356
|
-
messageEventId: string;
|
|
357
|
-
recordingReferenceId?: string;
|
|
358
|
-
startedAtMs?: number;
|
|
359
|
-
endedAtMs?: number;
|
|
360
|
-
transcriptionSource?: string;
|
|
361
|
-
metadata?: unknown;
|
|
362
|
-
}> | RuntimeEventBase<"journey.candidates.retrieved", {
|
|
363
|
-
journeyIds: string[];
|
|
364
|
-
}> | RuntimeEventBase<"journey.matched", {
|
|
365
|
-
candidates: Array<{
|
|
366
|
-
journeyId: string;
|
|
367
|
-
confidence: number;
|
|
368
|
-
reason?: string;
|
|
1580
|
+
reasonCode?: string;
|
|
1581
|
+
reasonLabel?: string;
|
|
1582
|
+
blockers?: Array<{
|
|
1583
|
+
code: string;
|
|
1584
|
+
message: string;
|
|
1585
|
+
kind?: string;
|
|
369
1586
|
}>;
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
1587
|
+
metadata?: Record<string, unknown>;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
interface ChannelOutputIntentProducer {
|
|
1591
|
+
type: ChannelOutputProducerType;
|
|
1592
|
+
id?: string;
|
|
1593
|
+
name?: string;
|
|
1594
|
+
metadata?: Record<string, unknown>;
|
|
1595
|
+
}
|
|
1596
|
+
interface ChannelOutputPolicyReason {
|
|
376
1597
|
reason?: string;
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
1598
|
+
reasonCode?: string;
|
|
1599
|
+
reasonLabel?: string;
|
|
1600
|
+
policyId?: string;
|
|
1601
|
+
policyIds?: string[];
|
|
1602
|
+
blockers?: Array<{
|
|
1603
|
+
code: string;
|
|
1604
|
+
message: string;
|
|
1605
|
+
kind?: string;
|
|
1606
|
+
}>;
|
|
382
1607
|
metadata?: Record<string, unknown>;
|
|
383
|
-
}> | RuntimeEventBase<"journey.event.emitted", {
|
|
384
|
-
name: string;
|
|
385
|
-
payload: unknown;
|
|
386
|
-
routing: "none" | "activeJourneyOnly" | "full" | "targeted";
|
|
387
|
-
target?: {
|
|
388
|
-
journeyId?: string;
|
|
389
|
-
stateId?: string;
|
|
390
|
-
};
|
|
391
|
-
}> | RuntimeEventBase<"journey.state.entered", {
|
|
392
|
-
journeyId: string;
|
|
393
|
-
stateId: string;
|
|
394
|
-
}> | RuntimeEventBase<"journey.extraction.proposed", {
|
|
395
|
-
journeyId: string;
|
|
396
|
-
stateId: string;
|
|
397
|
-
fields: string[];
|
|
398
|
-
}> | RuntimeEventBase<"journey.extraction.accepted", {
|
|
399
|
-
journeyId: string;
|
|
400
|
-
stateId: string;
|
|
401
|
-
fields: string[];
|
|
402
|
-
}> | RuntimeEventBase<"action.started", {
|
|
403
|
-
actionName: string;
|
|
404
|
-
journeyId?: string;
|
|
405
|
-
stateId?: string;
|
|
406
|
-
}> | RuntimeEventBase<"action.completed", {
|
|
407
|
-
actionName: string;
|
|
408
|
-
success: boolean;
|
|
409
|
-
journeyId?: string;
|
|
410
|
-
stateId?: string;
|
|
411
|
-
error?: string;
|
|
412
|
-
}> | RuntimeEventBase<"tool.started", {
|
|
413
|
-
toolName: string;
|
|
414
|
-
journeyId?: string;
|
|
415
|
-
stateId?: string;
|
|
416
|
-
}> | RuntimeEventBase<"tool.completed", {
|
|
417
|
-
toolName: string;
|
|
418
|
-
success: boolean;
|
|
419
|
-
journeyId?: string;
|
|
420
|
-
stateId?: string;
|
|
421
|
-
result?: unknown;
|
|
422
|
-
error?: string;
|
|
423
|
-
}> | RuntimeEventBase<"knowledge.retrieved", {
|
|
424
|
-
sourceName: string;
|
|
425
|
-
itemIds: string[];
|
|
426
|
-
}> | RuntimeEventBase<"ui.prompted", {
|
|
427
|
-
promptId: string;
|
|
428
|
-
widgetKind: string;
|
|
429
|
-
input: unknown;
|
|
430
|
-
}> | RuntimeEventBase<"ui.submitted", {
|
|
431
|
-
promptId: string;
|
|
432
|
-
widgetKind: string;
|
|
433
|
-
output: unknown;
|
|
434
|
-
}> | RuntimeEventBase<"conversation.compaction.started", {
|
|
435
|
-
fromOffset: number;
|
|
436
|
-
toOffset: number;
|
|
437
|
-
}> | RuntimeEventBase<"conversation.compaction.completed", {
|
|
438
|
-
fromOffset: number;
|
|
439
|
-
toOffset: number;
|
|
440
|
-
schemaVersion: string;
|
|
441
|
-
}> | RuntimeEventBase<"handoff.requested", {
|
|
442
|
-
reason: string;
|
|
443
|
-
summary?: string;
|
|
444
|
-
payload?: unknown;
|
|
445
|
-
}> | RuntimeEventBase<"handoff.resumed", {
|
|
446
|
-
reason?: string;
|
|
447
|
-
payload?: unknown;
|
|
448
|
-
}> | RuntimeEventBase<"conversation.closed", {
|
|
449
|
-
reason?: string;
|
|
450
|
-
}> | RuntimeEventBase<"error", {
|
|
451
|
-
code: string;
|
|
452
|
-
message: string;
|
|
453
|
-
details?: unknown;
|
|
454
|
-
}> | RuntimeEventBase<`custom.${string}`, unknown>;
|
|
455
|
-
|
|
456
|
-
interface ConversationRecord<TConversationContext = unknown> {
|
|
457
|
-
id: string;
|
|
458
|
-
agentId: string;
|
|
459
|
-
lifecycle: ConversationLifecycle;
|
|
460
|
-
context: TConversationContext;
|
|
461
|
-
createdAt: string;
|
|
462
|
-
updatedAt: string;
|
|
463
|
-
}
|
|
464
|
-
type RuntimeEventInput<TType extends RuntimeEvent["type"] = RuntimeEvent["type"]> = Omit<Extract<RuntimeEvent, {
|
|
465
|
-
type: TType;
|
|
466
|
-
}>, "id" | "offset" | "createdAt" | "telemetry"> & {
|
|
467
|
-
id?: string;
|
|
468
|
-
createdAt?: string;
|
|
469
|
-
telemetry?: RuntimeEvent["telemetry"];
|
|
470
|
-
};
|
|
471
|
-
interface ListEventsOptions {
|
|
472
|
-
conversationId: string;
|
|
473
|
-
afterOffset?: number;
|
|
474
|
-
limit?: number;
|
|
475
1608
|
}
|
|
476
|
-
interface
|
|
1609
|
+
interface ChannelOutputIntent<TPayload = NormalizedChannelPayload, TRawPayload = unknown> extends ChannelOutputPolicyReason {
|
|
477
1610
|
id?: string;
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
interface VoiceRecordingPolicy {
|
|
501
|
-
enabled?: boolean;
|
|
502
|
-
requireConsent?: boolean;
|
|
503
|
-
mode?: "input" | "both";
|
|
504
|
-
metadata?: Record<string, unknown>;
|
|
505
|
-
}
|
|
506
|
-
interface VoiceSelection {
|
|
507
|
-
provider: string;
|
|
508
|
-
voice: string;
|
|
509
|
-
}
|
|
510
|
-
interface VoiceModelSet {
|
|
511
|
-
provider: string;
|
|
512
|
-
model: string;
|
|
513
|
-
voice?: string;
|
|
514
|
-
settings?: Record<string, unknown>;
|
|
515
|
-
}
|
|
516
|
-
interface VoiceProfile {
|
|
517
|
-
instructions?: string;
|
|
518
|
-
modelSet?: VoiceModelSet;
|
|
519
|
-
recording?: VoiceRecordingPolicy;
|
|
520
|
-
metadata?: Record<string, unknown>;
|
|
1611
|
+
kind: ChannelOutputIntentKind;
|
|
1612
|
+
producer?: ChannelOutputIntentProducer;
|
|
1613
|
+
channel?: ChannelContext;
|
|
1614
|
+
deliveryMode?: ChannelOutputDeliveryMode;
|
|
1615
|
+
capability?: ChannelCapability;
|
|
1616
|
+
providerPackageId?: string;
|
|
1617
|
+
operationAlias?: string;
|
|
1618
|
+
providerOperation?: string;
|
|
1619
|
+
actionAudience?: ActionAudience;
|
|
1620
|
+
outbound?: boolean;
|
|
1621
|
+
sideEffect?: boolean;
|
|
1622
|
+
externallyVisible?: boolean;
|
|
1623
|
+
exposesSensitiveData?: boolean;
|
|
1624
|
+
changesWorkflow?: boolean;
|
|
1625
|
+
requiredPolicyIds?: string[];
|
|
1626
|
+
text?: string;
|
|
1627
|
+
subject?: string;
|
|
1628
|
+
body?: string;
|
|
1629
|
+
attachments?: unknown[];
|
|
1630
|
+
payload?: TPayload;
|
|
1631
|
+
source?: ChannelEventSourceEvidence<TRawPayload>;
|
|
521
1632
|
}
|
|
522
|
-
interface
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
channel: "voice";
|
|
526
|
-
startedAt: string;
|
|
527
|
-
endedAt?: string;
|
|
1633
|
+
interface ChannelOutputIntentInput<TPayload = NormalizedChannelPayloadInput, TRawPayload = unknown> extends Omit<ChannelOutputIntent<TPayload, TRawPayload>, "kind" | "channel"> {
|
|
1634
|
+
kind?: ChannelOutputIntentKind;
|
|
1635
|
+
channel?: ConversationChannelInput;
|
|
528
1636
|
}
|
|
529
|
-
interface
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
1637
|
+
interface ChannelOutputResolutionDecision<TPayload = unknown> extends ChannelOutputPolicyReason {
|
|
1638
|
+
outcome: ChannelOutputResolutionOutcome;
|
|
1639
|
+
status?: ChannelOutputResolutionStatus;
|
|
1640
|
+
deliveryMode?: ChannelOutputDeliveryMode;
|
|
1641
|
+
capability?: ChannelCapability;
|
|
1642
|
+
providerPackageId?: string;
|
|
1643
|
+
operationAlias?: string;
|
|
1644
|
+
providerOperation?: string;
|
|
1645
|
+
actionAudience?: ActionAudience;
|
|
1646
|
+
supportedApprovalResolutions?: string[];
|
|
1647
|
+
editableFields?: string[];
|
|
536
1648
|
expiresAt?: string;
|
|
1649
|
+
payload?: TPayload;
|
|
537
1650
|
}
|
|
538
|
-
interface
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
metadata?: Record<string, unknown>;
|
|
1651
|
+
interface ChannelOutputResolution<TPayload = unknown> extends ChannelOutputResolutionDecision<TPayload> {
|
|
1652
|
+
id: string;
|
|
1653
|
+
intentId?: string;
|
|
1654
|
+
status: ChannelOutputResolutionStatus;
|
|
1655
|
+
channel?: ChannelContext;
|
|
1656
|
+
resolvedAt: string;
|
|
1657
|
+
externalMessageId?: string;
|
|
1658
|
+
deliveryStatus?: string;
|
|
1659
|
+
providerResult?: unknown;
|
|
548
1660
|
}
|
|
549
|
-
interface
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
context: TConversationContext;
|
|
553
|
-
client?: VoiceStartClientHints;
|
|
554
|
-
app?: unknown;
|
|
1661
|
+
interface ChannelOutputResolutionPayload<TPayload = unknown> {
|
|
1662
|
+
outputIntent: ChannelOutputIntent<TPayload>;
|
|
1663
|
+
resolution: ChannelOutputResolution;
|
|
555
1664
|
}
|
|
556
|
-
interface
|
|
1665
|
+
interface ChannelOutputResolverInput<TPayload = unknown> {
|
|
557
1666
|
conversationId: string;
|
|
558
|
-
|
|
559
|
-
|
|
1667
|
+
channel: ChannelContext;
|
|
1668
|
+
outputIntent: ChannelOutputIntent<TPayload>;
|
|
1669
|
+
app: unknown;
|
|
1670
|
+
signal?: AbortSignal;
|
|
560
1671
|
}
|
|
561
|
-
interface
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
socket?: VoiceSocketMetadata;
|
|
566
|
-
events: RuntimeEvent[];
|
|
1672
|
+
interface ChannelOutputResolverResult<TPayload = unknown> extends ChannelOutputResolutionDecision<TPayload> {
|
|
1673
|
+
externalMessageId?: string;
|
|
1674
|
+
deliveryStatus?: string;
|
|
1675
|
+
providerResult?: unknown;
|
|
567
1676
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
1677
|
+
|
|
1678
|
+
declare const ChannelEventNatureSchema: z.ZodString;
|
|
1679
|
+
declare const ChannelEventDirectionSchema: z.ZodEnum<{
|
|
1680
|
+
inbound: "inbound";
|
|
1681
|
+
outbound: "outbound";
|
|
1682
|
+
internal: "internal";
|
|
1683
|
+
}>;
|
|
1684
|
+
declare const ChannelEventActorTypeSchema: z.ZodEnum<{
|
|
1685
|
+
system: "system";
|
|
1686
|
+
provider: "provider";
|
|
1687
|
+
customer: "customer";
|
|
1688
|
+
agent: "agent";
|
|
1689
|
+
operator: "operator";
|
|
1690
|
+
scheduler: "scheduler";
|
|
1691
|
+
application: "application";
|
|
1692
|
+
}>;
|
|
1693
|
+
declare const ChannelEventIntentSchema: z.ZodString;
|
|
1694
|
+
declare const ChannelEventSourceTypeSchema: z.ZodEnum<{
|
|
1695
|
+
application: "application";
|
|
1696
|
+
"provider-adapter": "provider-adapter";
|
|
1697
|
+
"schedule-adapter": "schedule-adapter";
|
|
1698
|
+
"operator-surface": "operator-surface";
|
|
1699
|
+
}>;
|
|
1700
|
+
declare const ChannelEventIntakeStatusSchema: z.ZodEnum<{
|
|
1701
|
+
blocked: "blocked";
|
|
1702
|
+
"handoff-review": "handoff-review";
|
|
1703
|
+
accepted: "accepted";
|
|
1704
|
+
ignored: "ignored";
|
|
1705
|
+
deferred: "deferred";
|
|
1706
|
+
}>;
|
|
1707
|
+
declare const ChannelEventBindingStatusSchema: z.ZodEnum<{
|
|
1708
|
+
blocked: "blocked";
|
|
1709
|
+
"not-required": "not-required";
|
|
1710
|
+
bound: "bound";
|
|
1711
|
+
created: "created";
|
|
1712
|
+
unbound: "unbound";
|
|
1713
|
+
}>;
|
|
1714
|
+
declare const ChannelEventBindingOutcomeSchema: z.ZodEnum<{
|
|
1715
|
+
blocked: "blocked";
|
|
1716
|
+
defer: "defer";
|
|
1717
|
+
"handoff-review": "handoff-review";
|
|
1718
|
+
"start-new": "start-new";
|
|
1719
|
+
"resume-existing": "resume-existing";
|
|
1720
|
+
"link-and-start-new": "link-and-start-new";
|
|
1721
|
+
ignore: "ignore";
|
|
1722
|
+
}>;
|
|
1723
|
+
declare const ChannelEventHandlingDispositionKindSchema: z.ZodEnum<{
|
|
1724
|
+
"output-resolution": "output-resolution";
|
|
1725
|
+
"handoff-review": "handoff-review";
|
|
1726
|
+
"record-only": "record-only";
|
|
1727
|
+
"no-op": "no-op";
|
|
1728
|
+
"deterministic-journey-event": "deterministic-journey-event";
|
|
1729
|
+
"model-turn": "model-turn";
|
|
1730
|
+
"provider-operation": "provider-operation";
|
|
1731
|
+
}>;
|
|
1732
|
+
declare const ChannelOutputIntentKindSchema: z.ZodString;
|
|
1733
|
+
declare const ChannelOutputProducerTypeSchema: z.ZodEnum<{
|
|
1734
|
+
tool: "tool";
|
|
1735
|
+
schedule: "schedule";
|
|
1736
|
+
policy: "policy";
|
|
1737
|
+
agent: "agent";
|
|
1738
|
+
operator: "operator";
|
|
1739
|
+
application: "application";
|
|
1740
|
+
"provider-adapter": "provider-adapter";
|
|
1741
|
+
journey: "journey";
|
|
1742
|
+
}>;
|
|
1743
|
+
declare const ChannelOutputDeliveryModeSchema: z.ZodEnum<{
|
|
1744
|
+
none: "none";
|
|
1745
|
+
send: "send";
|
|
1746
|
+
draft: "draft";
|
|
1747
|
+
notify: "notify";
|
|
1748
|
+
artifact: "artifact";
|
|
1749
|
+
approval: "approval";
|
|
1750
|
+
"handoff-review": "handoff-review";
|
|
1751
|
+
"provider-operation": "provider-operation";
|
|
1752
|
+
}>;
|
|
1753
|
+
declare const ChannelOutputResolutionOutcomeSchema: z.ZodEnum<{
|
|
1754
|
+
send: "send";
|
|
1755
|
+
draft: "draft";
|
|
1756
|
+
notify: "notify";
|
|
1757
|
+
artifact: "artifact";
|
|
1758
|
+
defer: "defer";
|
|
1759
|
+
"handoff-review": "handoff-review";
|
|
1760
|
+
"no-op": "no-op";
|
|
1761
|
+
"provider-operation": "provider-operation";
|
|
1762
|
+
"approval-required": "approval-required";
|
|
1763
|
+
block: "block";
|
|
1764
|
+
drop: "drop";
|
|
1765
|
+
}>;
|
|
1766
|
+
declare const ChannelOutputResolutionStatusSchema: z.ZodEnum<{
|
|
1767
|
+
blocked: "blocked";
|
|
1768
|
+
deferred: "deferred";
|
|
1769
|
+
"no-op": "no-op";
|
|
1770
|
+
resolved: "resolved";
|
|
1771
|
+
pending: "pending";
|
|
1772
|
+
}>;
|
|
1773
|
+
declare const ChannelEventActorSchema: z.ZodObject<{
|
|
1774
|
+
type: z.ZodEnum<{
|
|
1775
|
+
system: "system";
|
|
1776
|
+
provider: "provider";
|
|
1777
|
+
customer: "customer";
|
|
1778
|
+
agent: "agent";
|
|
1779
|
+
operator: "operator";
|
|
1780
|
+
scheduler: "scheduler";
|
|
1781
|
+
application: "application";
|
|
1782
|
+
}>;
|
|
1783
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1784
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1785
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1786
|
+
}, z.core.$strip>;
|
|
1787
|
+
declare const NormalizedChannelPayloadSchema: z.ZodObject<{
|
|
1788
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1789
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
1790
|
+
body: z.ZodOptional<z.ZodString>;
|
|
1791
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
1792
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
1793
|
+
providerObject: z.ZodOptional<z.ZodUnknown>;
|
|
1794
|
+
status: z.ZodOptional<z.ZodString>;
|
|
1795
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1796
|
+
}, z.core.$loose>;
|
|
1797
|
+
declare const ChannelEventSourceEvidenceSchema: z.ZodObject<{
|
|
1798
|
+
sourceType: z.ZodOptional<z.ZodEnum<{
|
|
1799
|
+
application: "application";
|
|
1800
|
+
"provider-adapter": "provider-adapter";
|
|
1801
|
+
"schedule-adapter": "schedule-adapter";
|
|
1802
|
+
"operator-surface": "operator-surface";
|
|
1803
|
+
}>>;
|
|
1804
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
1805
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
1806
|
+
providerPackageId: z.ZodOptional<z.ZodString>;
|
|
1807
|
+
eventId: z.ZodOptional<z.ZodString>;
|
|
1808
|
+
streamId: z.ZodOptional<z.ZodString>;
|
|
1809
|
+
deliveryId: z.ZodOptional<z.ZodString>;
|
|
1810
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
1811
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1812
|
+
externalObjectIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1813
|
+
raw: z.ZodOptional<z.ZodUnknown>;
|
|
1814
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1815
|
+
}, z.core.$strip>;
|
|
1816
|
+
declare const ChannelEventIdentitySchema: z.ZodObject<{
|
|
1817
|
+
key: z.ZodOptional<z.ZodString>;
|
|
1818
|
+
dedupeKey: z.ZodOptional<z.ZodString>;
|
|
1819
|
+
streamId: z.ZodOptional<z.ZodString>;
|
|
1820
|
+
sequence: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1821
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
1822
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1823
|
+
}, z.core.$strip>;
|
|
1824
|
+
declare const ChannelEventEnvelopeInputSchema: z.ZodObject<{
|
|
1825
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1826
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
1827
|
+
nature: z.ZodOptional<z.ZodString>;
|
|
1828
|
+
direction: z.ZodDefault<z.ZodEnum<{
|
|
1829
|
+
inbound: "inbound";
|
|
1830
|
+
outbound: "outbound";
|
|
1831
|
+
internal: "internal";
|
|
1832
|
+
}>>;
|
|
1833
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
1834
|
+
actor: z.ZodOptional<z.ZodObject<{
|
|
1835
|
+
type: z.ZodEnum<{
|
|
1836
|
+
system: "system";
|
|
1837
|
+
provider: "provider";
|
|
1838
|
+
customer: "customer";
|
|
1839
|
+
agent: "agent";
|
|
1840
|
+
operator: "operator";
|
|
1841
|
+
scheduler: "scheduler";
|
|
1842
|
+
application: "application";
|
|
1843
|
+
}>;
|
|
1844
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1845
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1846
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1847
|
+
}, z.core.$strip>>;
|
|
1848
|
+
channel: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1849
|
+
channelId: z.ZodString;
|
|
1850
|
+
kind: z.ZodString;
|
|
1851
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
1852
|
+
externalThreadId: z.ZodOptional<z.ZodString>;
|
|
1853
|
+
externalConversationId: z.ZodOptional<z.ZodString>;
|
|
1854
|
+
externalMessageId: z.ZodOptional<z.ZodString>;
|
|
1855
|
+
externalUserId: z.ZodOptional<z.ZodString>;
|
|
1856
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
1857
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
1858
|
+
capabilities: z.ZodDefault<z.ZodDefault<z.ZodObject<{
|
|
1859
|
+
realtime: z.ZodDefault<z.ZodBoolean>;
|
|
1860
|
+
async: z.ZodDefault<z.ZodBoolean>;
|
|
1861
|
+
voice: z.ZodDefault<z.ZodBoolean>;
|
|
1862
|
+
audioInput: z.ZodDefault<z.ZodBoolean>;
|
|
1863
|
+
audioOutput: z.ZodDefault<z.ZodBoolean>;
|
|
1864
|
+
richText: z.ZodDefault<z.ZodBoolean>;
|
|
1865
|
+
markdown: z.ZodDefault<z.ZodBoolean>;
|
|
1866
|
+
html: z.ZodDefault<z.ZodBoolean>;
|
|
1867
|
+
attachments: z.ZodDefault<z.ZodBoolean>;
|
|
1868
|
+
images: z.ZodDefault<z.ZodBoolean>;
|
|
1869
|
+
files: z.ZodDefault<z.ZodBoolean>;
|
|
1870
|
+
widgets: z.ZodDefault<z.ZodBoolean>;
|
|
1871
|
+
buttons: z.ZodDefault<z.ZodBoolean>;
|
|
1872
|
+
quickReplies: z.ZodDefault<z.ZodBoolean>;
|
|
1873
|
+
templates: z.ZodDefault<z.ZodBoolean>;
|
|
1874
|
+
publicReplies: z.ZodDefault<z.ZodBoolean>;
|
|
1875
|
+
privateReplies: z.ZodDefault<z.ZodBoolean>;
|
|
1876
|
+
typingIndicator: z.ZodDefault<z.ZodBoolean>;
|
|
1877
|
+
readReceipts: z.ZodDefault<z.ZodBoolean>;
|
|
1878
|
+
deliveryReceipts: z.ZodDefault<z.ZodBoolean>;
|
|
1879
|
+
threaded: z.ZodDefault<z.ZodBoolean>;
|
|
1880
|
+
supportsHumanTransfer: z.ZodDefault<z.ZodBoolean>;
|
|
1881
|
+
}, z.core.$strip>>>;
|
|
1882
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1883
|
+
}, z.core.$strip>]>;
|
|
1884
|
+
occurredAt: z.ZodOptional<z.ZodString>;
|
|
1885
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
1886
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
1887
|
+
key: z.ZodOptional<z.ZodString>;
|
|
1888
|
+
dedupeKey: z.ZodOptional<z.ZodString>;
|
|
1889
|
+
streamId: z.ZodOptional<z.ZodString>;
|
|
1890
|
+
sequence: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
1891
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
1892
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1893
|
+
}, z.core.$strip>>;
|
|
1894
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
1895
|
+
sourceType: z.ZodOptional<z.ZodEnum<{
|
|
1896
|
+
application: "application";
|
|
1897
|
+
"provider-adapter": "provider-adapter";
|
|
1898
|
+
"schedule-adapter": "schedule-adapter";
|
|
1899
|
+
"operator-surface": "operator-surface";
|
|
1900
|
+
}>>;
|
|
1901
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
1902
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
1903
|
+
providerPackageId: z.ZodOptional<z.ZodString>;
|
|
1904
|
+
eventId: z.ZodOptional<z.ZodString>;
|
|
1905
|
+
streamId: z.ZodOptional<z.ZodString>;
|
|
1906
|
+
deliveryId: z.ZodOptional<z.ZodString>;
|
|
1907
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
1908
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1909
|
+
externalObjectIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1910
|
+
raw: z.ZodOptional<z.ZodUnknown>;
|
|
1911
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1912
|
+
}, z.core.$strip>>;
|
|
1913
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1914
|
+
}, z.core.$loose>;
|
|
1915
|
+
declare const ChannelOutputIntentProducerSchema: z.ZodObject<{
|
|
1916
|
+
type: z.ZodEnum<{
|
|
1917
|
+
tool: "tool";
|
|
1918
|
+
schedule: "schedule";
|
|
1919
|
+
policy: "policy";
|
|
1920
|
+
agent: "agent";
|
|
1921
|
+
operator: "operator";
|
|
1922
|
+
application: "application";
|
|
1923
|
+
"provider-adapter": "provider-adapter";
|
|
1924
|
+
journey: "journey";
|
|
1925
|
+
}>;
|
|
1926
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1927
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1928
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1929
|
+
}, z.core.$strip>;
|
|
1930
|
+
declare const ChannelOutputPolicyReasonSchema: z.ZodObject<{
|
|
1931
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1932
|
+
reasonCode: z.ZodOptional<z.ZodString>;
|
|
1933
|
+
reasonLabel: z.ZodOptional<z.ZodString>;
|
|
1934
|
+
policyId: z.ZodOptional<z.ZodString>;
|
|
1935
|
+
policyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1936
|
+
blockers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1937
|
+
code: z.ZodString;
|
|
1938
|
+
message: z.ZodString;
|
|
1939
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
1940
|
+
}, z.core.$strip>>>;
|
|
1941
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1942
|
+
}, z.core.$strip>;
|
|
1943
|
+
declare const ChannelOutputIntentInputSchema: z.ZodObject<{
|
|
1944
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1945
|
+
reasonCode: z.ZodOptional<z.ZodString>;
|
|
1946
|
+
reasonLabel: z.ZodOptional<z.ZodString>;
|
|
1947
|
+
policyId: z.ZodOptional<z.ZodString>;
|
|
1948
|
+
policyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1949
|
+
blockers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1950
|
+
code: z.ZodString;
|
|
1951
|
+
message: z.ZodString;
|
|
1952
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
1953
|
+
}, z.core.$strip>>>;
|
|
1954
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1955
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1956
|
+
kind: z.ZodDefault<z.ZodString>;
|
|
1957
|
+
producer: z.ZodOptional<z.ZodObject<{
|
|
1958
|
+
type: z.ZodEnum<{
|
|
1959
|
+
tool: "tool";
|
|
1960
|
+
schedule: "schedule";
|
|
1961
|
+
policy: "policy";
|
|
1962
|
+
agent: "agent";
|
|
1963
|
+
operator: "operator";
|
|
1964
|
+
application: "application";
|
|
1965
|
+
"provider-adapter": "provider-adapter";
|
|
1966
|
+
journey: "journey";
|
|
1967
|
+
}>;
|
|
1968
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1969
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1970
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1971
|
+
}, z.core.$strip>>;
|
|
1972
|
+
channel: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1973
|
+
channelId: z.ZodString;
|
|
1974
|
+
kind: z.ZodString;
|
|
1975
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
1976
|
+
externalThreadId: z.ZodOptional<z.ZodString>;
|
|
1977
|
+
externalConversationId: z.ZodOptional<z.ZodString>;
|
|
1978
|
+
externalMessageId: z.ZodOptional<z.ZodString>;
|
|
1979
|
+
externalUserId: z.ZodOptional<z.ZodString>;
|
|
1980
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
1981
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
1982
|
+
capabilities: z.ZodDefault<z.ZodDefault<z.ZodObject<{
|
|
1983
|
+
realtime: z.ZodDefault<z.ZodBoolean>;
|
|
1984
|
+
async: z.ZodDefault<z.ZodBoolean>;
|
|
1985
|
+
voice: z.ZodDefault<z.ZodBoolean>;
|
|
1986
|
+
audioInput: z.ZodDefault<z.ZodBoolean>;
|
|
1987
|
+
audioOutput: z.ZodDefault<z.ZodBoolean>;
|
|
1988
|
+
richText: z.ZodDefault<z.ZodBoolean>;
|
|
1989
|
+
markdown: z.ZodDefault<z.ZodBoolean>;
|
|
1990
|
+
html: z.ZodDefault<z.ZodBoolean>;
|
|
1991
|
+
attachments: z.ZodDefault<z.ZodBoolean>;
|
|
1992
|
+
images: z.ZodDefault<z.ZodBoolean>;
|
|
1993
|
+
files: z.ZodDefault<z.ZodBoolean>;
|
|
1994
|
+
widgets: z.ZodDefault<z.ZodBoolean>;
|
|
1995
|
+
buttons: z.ZodDefault<z.ZodBoolean>;
|
|
1996
|
+
quickReplies: z.ZodDefault<z.ZodBoolean>;
|
|
1997
|
+
templates: z.ZodDefault<z.ZodBoolean>;
|
|
1998
|
+
publicReplies: z.ZodDefault<z.ZodBoolean>;
|
|
1999
|
+
privateReplies: z.ZodDefault<z.ZodBoolean>;
|
|
2000
|
+
typingIndicator: z.ZodDefault<z.ZodBoolean>;
|
|
2001
|
+
readReceipts: z.ZodDefault<z.ZodBoolean>;
|
|
2002
|
+
deliveryReceipts: z.ZodDefault<z.ZodBoolean>;
|
|
2003
|
+
threaded: z.ZodDefault<z.ZodBoolean>;
|
|
2004
|
+
supportsHumanTransfer: z.ZodDefault<z.ZodBoolean>;
|
|
2005
|
+
}, z.core.$strip>>>;
|
|
2006
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2007
|
+
}, z.core.$strip>]>>;
|
|
2008
|
+
deliveryMode: z.ZodOptional<z.ZodEnum<{
|
|
2009
|
+
none: "none";
|
|
2010
|
+
send: "send";
|
|
2011
|
+
draft: "draft";
|
|
2012
|
+
notify: "notify";
|
|
2013
|
+
artifact: "artifact";
|
|
2014
|
+
approval: "approval";
|
|
2015
|
+
"handoff-review": "handoff-review";
|
|
2016
|
+
"provider-operation": "provider-operation";
|
|
2017
|
+
}>>;
|
|
2018
|
+
capability: z.ZodOptional<z.ZodString>;
|
|
2019
|
+
providerPackageId: z.ZodOptional<z.ZodString>;
|
|
2020
|
+
operationAlias: z.ZodOptional<z.ZodString>;
|
|
2021
|
+
providerOperation: z.ZodOptional<z.ZodString>;
|
|
2022
|
+
actionAudience: z.ZodOptional<z.ZodEnum<{
|
|
2023
|
+
"customer-facing": "customer-facing";
|
|
2024
|
+
"internal-support": "internal-support";
|
|
2025
|
+
mixed: "mixed";
|
|
2026
|
+
}>>;
|
|
2027
|
+
outbound: z.ZodOptional<z.ZodBoolean>;
|
|
2028
|
+
sideEffect: z.ZodOptional<z.ZodBoolean>;
|
|
2029
|
+
externallyVisible: z.ZodOptional<z.ZodBoolean>;
|
|
2030
|
+
exposesSensitiveData: z.ZodOptional<z.ZodBoolean>;
|
|
2031
|
+
changesWorkflow: z.ZodOptional<z.ZodBoolean>;
|
|
2032
|
+
requiredPolicyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2033
|
+
text: z.ZodOptional<z.ZodString>;
|
|
2034
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
2035
|
+
body: z.ZodOptional<z.ZodString>;
|
|
2036
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
2037
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
2038
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
2039
|
+
sourceType: z.ZodOptional<z.ZodEnum<{
|
|
2040
|
+
application: "application";
|
|
2041
|
+
"provider-adapter": "provider-adapter";
|
|
2042
|
+
"schedule-adapter": "schedule-adapter";
|
|
2043
|
+
"operator-surface": "operator-surface";
|
|
2044
|
+
}>>;
|
|
2045
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
2046
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
2047
|
+
providerPackageId: z.ZodOptional<z.ZodString>;
|
|
2048
|
+
eventId: z.ZodOptional<z.ZodString>;
|
|
2049
|
+
streamId: z.ZodOptional<z.ZodString>;
|
|
2050
|
+
deliveryId: z.ZodOptional<z.ZodString>;
|
|
2051
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
2052
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
2053
|
+
externalObjectIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2054
|
+
raw: z.ZodOptional<z.ZodUnknown>;
|
|
2055
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2056
|
+
}, z.core.$strip>>;
|
|
2057
|
+
}, z.core.$loose>;
|
|
2058
|
+
declare const ChannelOutputResolutionDecisionInputSchema: z.ZodObject<{
|
|
2059
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
2060
|
+
reasonCode: z.ZodOptional<z.ZodString>;
|
|
2061
|
+
reasonLabel: z.ZodOptional<z.ZodString>;
|
|
2062
|
+
policyId: z.ZodOptional<z.ZodString>;
|
|
2063
|
+
policyIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2064
|
+
blockers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2065
|
+
code: z.ZodString;
|
|
2066
|
+
message: z.ZodString;
|
|
2067
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
2068
|
+
}, z.core.$strip>>>;
|
|
2069
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2070
|
+
outcome: z.ZodEnum<{
|
|
2071
|
+
send: "send";
|
|
2072
|
+
draft: "draft";
|
|
2073
|
+
notify: "notify";
|
|
2074
|
+
artifact: "artifact";
|
|
2075
|
+
defer: "defer";
|
|
2076
|
+
"handoff-review": "handoff-review";
|
|
2077
|
+
"no-op": "no-op";
|
|
2078
|
+
"provider-operation": "provider-operation";
|
|
2079
|
+
"approval-required": "approval-required";
|
|
2080
|
+
block: "block";
|
|
2081
|
+
drop: "drop";
|
|
2082
|
+
}>;
|
|
2083
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
2084
|
+
blocked: "blocked";
|
|
2085
|
+
deferred: "deferred";
|
|
2086
|
+
"no-op": "no-op";
|
|
2087
|
+
resolved: "resolved";
|
|
2088
|
+
pending: "pending";
|
|
2089
|
+
}>>;
|
|
2090
|
+
deliveryMode: z.ZodOptional<z.ZodEnum<{
|
|
2091
|
+
none: "none";
|
|
2092
|
+
send: "send";
|
|
2093
|
+
draft: "draft";
|
|
2094
|
+
notify: "notify";
|
|
2095
|
+
artifact: "artifact";
|
|
2096
|
+
approval: "approval";
|
|
2097
|
+
"handoff-review": "handoff-review";
|
|
2098
|
+
"provider-operation": "provider-operation";
|
|
2099
|
+
}>>;
|
|
2100
|
+
capability: z.ZodOptional<z.ZodString>;
|
|
2101
|
+
providerPackageId: z.ZodOptional<z.ZodString>;
|
|
2102
|
+
operationAlias: z.ZodOptional<z.ZodString>;
|
|
2103
|
+
providerOperation: z.ZodOptional<z.ZodString>;
|
|
2104
|
+
actionAudience: z.ZodOptional<z.ZodEnum<{
|
|
2105
|
+
"customer-facing": "customer-facing";
|
|
2106
|
+
"internal-support": "internal-support";
|
|
2107
|
+
mixed: "mixed";
|
|
2108
|
+
}>>;
|
|
2109
|
+
supportedApprovalResolutions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2110
|
+
editableFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2111
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
2112
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
2113
|
+
}, z.core.$loose>;
|
|
2114
|
+
|
|
2115
|
+
declare function defineChannelEvent<TPayload = NormalizedChannelPayload, TRawPayload = unknown>(input: ChannelEventEnvelopeInput<TPayload, TRawPayload>): ChannelEventEnvelope<TPayload, TRawPayload>;
|
|
2116
|
+
declare function channelEventDedupeKey(event: ChannelEventEnvelopeInput<unknown> | ChannelEventEnvelope<unknown>): string | undefined;
|
|
2117
|
+
declare function createMessageChannelEvent(input: {
|
|
2118
|
+
id?: string;
|
|
2119
|
+
channel: ConversationChannelInput;
|
|
572
2120
|
text: string;
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
2121
|
+
direction?: ChannelEventDirection;
|
|
2122
|
+
intent?: ChannelEventIntent;
|
|
2123
|
+
actor?: ChannelEventActor | ChannelEventActor["type"];
|
|
2124
|
+
payload?: NormalizedChannelPayloadInput;
|
|
2125
|
+
identity?: ChannelEventIdentity;
|
|
2126
|
+
source?: ChannelEventSourceEvidence;
|
|
577
2127
|
metadata?: Record<string, unknown>;
|
|
2128
|
+
}): ChannelEventEnvelopeInput;
|
|
2129
|
+
declare function createScheduledChannelEvent(input: {
|
|
2130
|
+
scheduleId: string;
|
|
2131
|
+
conversationId?: string;
|
|
2132
|
+
channel?: ConversationChannelInput;
|
|
2133
|
+
dueAt: string;
|
|
2134
|
+
scheduledFor?: string;
|
|
2135
|
+
eventName: string;
|
|
2136
|
+
payload?: unknown;
|
|
2137
|
+
intent?: unknown;
|
|
2138
|
+
metadata?: Record<string, unknown>;
|
|
2139
|
+
}): ChannelEventEnvelopeInput;
|
|
2140
|
+
declare function defineChannelOutputIntent<TPayload = NormalizedChannelPayload, TRawPayload = unknown>(input: ChannelOutputIntentInput<TPayload, TRawPayload>): ChannelOutputIntent<TPayload, TRawPayload>;
|
|
2141
|
+
declare function defineChannelOutputResolutionDecision<TPayload = unknown>(input: ChannelOutputResolutionDecision<TPayload>): ChannelOutputResolutionDecision<TPayload>;
|
|
2142
|
+
|
|
2143
|
+
declare class CapabilityScope<TItem> {
|
|
2144
|
+
private readonly items;
|
|
2145
|
+
private onlyItems;
|
|
2146
|
+
private readonly excludedItems;
|
|
2147
|
+
add(...items: TItem[]): this;
|
|
2148
|
+
only(...items: TItem[]): this;
|
|
2149
|
+
exclude(...items: TItem[]): this;
|
|
2150
|
+
list(inherited?: TItem[]): TItem[];
|
|
578
2151
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
interface
|
|
583
|
-
message
|
|
584
|
-
|
|
585
|
-
events: RuntimeEvent[];
|
|
586
|
-
}
|
|
587
|
-
interface RecordVoiceInterruptionInput {
|
|
588
|
-
conversationId: string;
|
|
589
|
-
channelSegmentId: string;
|
|
590
|
-
connectionId?: string;
|
|
591
|
-
interruptedMessageId?: string;
|
|
592
|
-
source?: "userSpeech" | "adapter" | "provider";
|
|
593
|
-
reason?: string;
|
|
594
|
-
recordingReferenceId?: string;
|
|
595
|
-
offsetMs?: number;
|
|
596
|
-
}
|
|
597
|
-
type VoiceRuntimeEventInput = Extract<RuntimeEventInput, {
|
|
598
|
-
type: `voice.${string}`;
|
|
599
|
-
}>;
|
|
600
|
-
|
|
601
|
-
interface RuntimeSnapshot {
|
|
602
|
-
conversationId: string;
|
|
603
|
-
lifecycle: ConversationLifecycle;
|
|
604
|
-
activeJourneyId?: string;
|
|
605
|
-
activeStateIds: string[];
|
|
606
|
-
journeyContext?: unknown;
|
|
607
|
-
journeyContexts?: JourneyContextRecord[];
|
|
608
|
-
journeySummaries?: JourneySummary[];
|
|
609
|
-
compactionSummary?: unknown;
|
|
610
|
-
definitionHash?: string;
|
|
611
|
-
updatedAt: string;
|
|
612
|
-
}
|
|
613
|
-
interface JourneySummary {
|
|
614
|
-
journeyId: string;
|
|
615
|
-
kind: "stateMachine" | "delegation";
|
|
616
|
-
summary: string;
|
|
617
|
-
completedAt: string;
|
|
618
|
-
stateId?: string;
|
|
619
|
-
reason?: string;
|
|
620
|
-
}
|
|
621
|
-
interface JourneyContextRecord {
|
|
622
|
-
journeyId: string;
|
|
623
|
-
context: unknown;
|
|
624
|
-
updatedAt: string;
|
|
625
|
-
stateId?: string;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
declare class DefinitionError extends Error {
|
|
629
|
-
constructor(message: string);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
declare const conversationCompactionSummarySchema: z.ZodObject<{
|
|
633
|
-
summary: z.ZodString;
|
|
634
|
-
stableFacts: z.ZodArray<z.ZodString>;
|
|
635
|
-
openQuestions: z.ZodArray<z.ZodString>;
|
|
636
|
-
activeCommitments: z.ZodArray<z.ZodString>;
|
|
637
|
-
}, z.core.$strip>;
|
|
638
|
-
type ConversationCompactionSummary = z.infer<typeof conversationCompactionSummarySchema>;
|
|
639
|
-
|
|
640
|
-
declare class CapabilityScope<TItem> {
|
|
641
|
-
private readonly items;
|
|
642
|
-
private onlyItems;
|
|
643
|
-
private readonly excludedItems;
|
|
644
|
-
add(...items: TItem[]): this;
|
|
645
|
-
only(...items: TItem[]): this;
|
|
646
|
-
exclude(...items: TItem[]): this;
|
|
647
|
-
list(inherited?: TItem[]): TItem[];
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
type MaybePromise$1<T> = T | Promise<T>;
|
|
651
|
-
type FieldWidgetOption = WidgetDefinition | WidgetPromptDefinition;
|
|
652
|
-
interface ConfirmationPolicy {
|
|
653
|
-
message?: string;
|
|
654
|
-
widget?: WidgetDefinition;
|
|
2152
|
+
|
|
2153
|
+
type MaybePromise$1<T> = T | Promise<T>;
|
|
2154
|
+
type FieldWidgetOption = WidgetDefinition | WidgetPromptDefinition;
|
|
2155
|
+
interface ConfirmationPolicy {
|
|
2156
|
+
message?: string;
|
|
2157
|
+
widget?: WidgetDefinition;
|
|
655
2158
|
reason?: string;
|
|
656
2159
|
}
|
|
657
2160
|
interface FieldCollectionOptions<TContext> {
|
|
@@ -726,6 +2229,7 @@ declare function tool<const TName extends string, TInputSchema extends z.ZodType
|
|
|
726
2229
|
input: TInputSchema;
|
|
727
2230
|
output: TOutputSchema;
|
|
728
2231
|
sideEffect?: TSideEffect;
|
|
2232
|
+
policy?: ToolPolicyOptions;
|
|
729
2233
|
idempotencyKey?: (args: {
|
|
730
2234
|
input: z.infer<TInputSchema>;
|
|
731
2235
|
conversationId: string;
|
|
@@ -738,8 +2242,8 @@ declare function widget<const TKind extends string, TInputSchema extends z.ZodTy
|
|
|
738
2242
|
}): WidgetDefinition<TKind, TInputSchema, TOutputSchema>;
|
|
739
2243
|
declare function widgetPrompt<TWidget extends WidgetDefinition>(widgetDefinition: TWidget, input: z.infer<TWidget["input"]>): WidgetPromptDefinition<TWidget>;
|
|
740
2244
|
declare function knowledgeSource<const TName extends string, TQuerySchema extends z.ZodType, TMetadataSchema extends z.ZodType>(name: TName, config: Omit<KnowledgeSource<TName, TQuerySchema, TMetadataSchema>, "kind" | "name">): {
|
|
741
|
-
query: TQuerySchema;
|
|
742
2245
|
metadata: TMetadataSchema;
|
|
2246
|
+
query: TQuerySchema;
|
|
743
2247
|
retrieve: (input: {
|
|
744
2248
|
query: z.core.output<TQuerySchema>;
|
|
745
2249
|
signal?: AbortSignal;
|
|
@@ -777,6 +2281,10 @@ interface CompiledAgent {
|
|
|
777
2281
|
id: string;
|
|
778
2282
|
instructions: string;
|
|
779
2283
|
logLevel?: AgentLogLevel;
|
|
2284
|
+
persona?: AgentPersonaOptions;
|
|
2285
|
+
channels?: AgentChannelPolicyMap;
|
|
2286
|
+
configuration?: AgentConfigurationOptions;
|
|
2287
|
+
handoff?: AgentHandoffPolicyOptions;
|
|
780
2288
|
behavior: AgentBehaviorOptions;
|
|
781
2289
|
postProcessing: AgentPostProcessingOptions;
|
|
782
2290
|
voice?: VoiceProfile;
|
|
@@ -995,9 +2503,29 @@ interface AgentPostProcessingOptions {
|
|
|
995
2503
|
citations?: boolean;
|
|
996
2504
|
}
|
|
997
2505
|
type AgentLogLevel = "trace" | "debug" | "info" | "error";
|
|
2506
|
+
type AgentPolicyValue = string | number | boolean | null | AgentPolicyValue[] | {
|
|
2507
|
+
[key: string]: AgentPolicyValue;
|
|
2508
|
+
};
|
|
2509
|
+
type AgentPersonaOptions = Record<string, AgentPolicyValue>;
|
|
2510
|
+
type AgentChannelPolicyOptions = Record<string, AgentPolicyValue>;
|
|
2511
|
+
type AgentChannelPolicyMap = Record<string, AgentChannelPolicyOptions>;
|
|
2512
|
+
type AgentHandoffPolicyOptions = Record<string, AgentPolicyValue>;
|
|
2513
|
+
interface AgentConfigurationOptions {
|
|
2514
|
+
channelSets?: ChannelSetConfigInput[];
|
|
2515
|
+
channels?: ChannelPolicyConfigInput[];
|
|
2516
|
+
providerPackages?: ProviderManifestInput[];
|
|
2517
|
+
capabilityAvailability?: CapabilityAvailabilityInput[];
|
|
2518
|
+
credentialStatuses?: ProviderCredentialStatusInput[];
|
|
2519
|
+
providerReadiness?: ProviderReadinessInput[];
|
|
2520
|
+
policyIds?: string[];
|
|
2521
|
+
}
|
|
998
2522
|
interface AgentOptions {
|
|
999
2523
|
instructions: string;
|
|
1000
2524
|
logLevel?: AgentLogLevel;
|
|
2525
|
+
persona?: AgentPersonaOptions;
|
|
2526
|
+
channels?: AgentChannelPolicyMap;
|
|
2527
|
+
configuration?: AgentConfigurationOptions;
|
|
2528
|
+
handoff?: AgentHandoffPolicyOptions;
|
|
1001
2529
|
behavior?: AgentBehaviorOptions;
|
|
1002
2530
|
postProcessing?: AgentPostProcessingOptions;
|
|
1003
2531
|
}
|
|
@@ -1286,6 +2814,46 @@ declare function selectJourneyCandidates<TApp, TConversation, TTurn>(options: Se
|
|
|
1286
2814
|
|
|
1287
2815
|
declare function validateJourneyIndex(agent: CompiledAgent, index: JourneyIndex, options?: ValidateJourneyIndexOptions): JourneyIndexValidationResult;
|
|
1288
2816
|
|
|
2817
|
+
interface ConversationRecord<TConversationContext = unknown> {
|
|
2818
|
+
id: string;
|
|
2819
|
+
agentId: string;
|
|
2820
|
+
lifecycle: ConversationLifecycle;
|
|
2821
|
+
context: TConversationContext;
|
|
2822
|
+
channel?: ConversationChannel;
|
|
2823
|
+
createdAt: string;
|
|
2824
|
+
updatedAt: string;
|
|
2825
|
+
}
|
|
2826
|
+
type RuntimeEventInput<TType extends RuntimeEvent["type"] = RuntimeEvent["type"]> = Omit<Extract<RuntimeEvent, {
|
|
2827
|
+
type: TType;
|
|
2828
|
+
}>, "id" | "offset" | "createdAt" | "telemetry"> & {
|
|
2829
|
+
id?: string;
|
|
2830
|
+
createdAt?: string;
|
|
2831
|
+
telemetry?: RuntimeEvent["telemetry"];
|
|
2832
|
+
};
|
|
2833
|
+
interface ListEventsOptions {
|
|
2834
|
+
conversationId: string;
|
|
2835
|
+
afterOffset?: number;
|
|
2836
|
+
limit?: number;
|
|
2837
|
+
}
|
|
2838
|
+
interface CreateConversationInput<TConversationContext = unknown> {
|
|
2839
|
+
id?: string;
|
|
2840
|
+
agentId: string;
|
|
2841
|
+
context: TConversationContext;
|
|
2842
|
+
channel?: ConversationChannelInput;
|
|
2843
|
+
}
|
|
2844
|
+
interface StorageAdapter {
|
|
2845
|
+
initialize?(): Promise<void> | void;
|
|
2846
|
+
createConversation<TConversationContext = unknown>(input: CreateConversationInput<TConversationContext>): Promise<ConversationRecord<TConversationContext>>;
|
|
2847
|
+
getConversation<TConversationContext = unknown>(conversationId: string): Promise<ConversationRecord<TConversationContext> | null>;
|
|
2848
|
+
updateConversationLifecycle(conversationId: string, lifecycle: ConversationLifecycle): Promise<ConversationRecord | null>;
|
|
2849
|
+
appendEvent<TEvent extends RuntimeEventInput>(event: TEvent): Promise<RuntimeEvent>;
|
|
2850
|
+
appendEventIfApprovalPending?<TEvent extends RuntimeEventInput<"approval.resolved">>(event: TEvent): Promise<RuntimeEvent | null>;
|
|
2851
|
+
appendEventIfNoActiveVoiceSegment?<TEvent extends RuntimeEventInput<"voice.segment.started">>(event: TEvent): Promise<RuntimeEvent | null>;
|
|
2852
|
+
listEvents(options: ListEventsOptions): Promise<RuntimeEvent[]>;
|
|
2853
|
+
saveSnapshot(snapshot: RuntimeSnapshot): Promise<void>;
|
|
2854
|
+
getSnapshot(conversationId: string): Promise<RuntimeSnapshot | null>;
|
|
2855
|
+
}
|
|
2856
|
+
|
|
1289
2857
|
interface ReplayedMessage {
|
|
1290
2858
|
id: string;
|
|
1291
2859
|
offset: number;
|
|
@@ -1303,6 +2871,140 @@ interface ReplayedPrompt {
|
|
|
1303
2871
|
input: unknown;
|
|
1304
2872
|
}
|
|
1305
2873
|
|
|
2874
|
+
declare const conversationCompactionSummarySchema: z.ZodObject<{
|
|
2875
|
+
summary: z.ZodString;
|
|
2876
|
+
stableFacts: z.ZodArray<z.ZodString>;
|
|
2877
|
+
openQuestions: z.ZodArray<z.ZodString>;
|
|
2878
|
+
activeCommitments: z.ZodArray<z.ZodString>;
|
|
2879
|
+
}, z.core.$strip>;
|
|
2880
|
+
type ConversationCompactionSummary = z.infer<typeof conversationCompactionSummarySchema>;
|
|
2881
|
+
|
|
2882
|
+
interface RuntimeApprovalEvaluationInput {
|
|
2883
|
+
conversation: ConversationRecord;
|
|
2884
|
+
tool: AnyTool;
|
|
2885
|
+
input: unknown;
|
|
2886
|
+
channel?: ChannelContext;
|
|
2887
|
+
}
|
|
2888
|
+
interface PendingSupportAction {
|
|
2889
|
+
approvalId: string;
|
|
2890
|
+
conversationId: string;
|
|
2891
|
+
requestedEventId: string;
|
|
2892
|
+
requestedAt: string;
|
|
2893
|
+
toolName: string;
|
|
2894
|
+
input: unknown;
|
|
2895
|
+
channel?: ChannelContext;
|
|
2896
|
+
providerPackageId?: string;
|
|
2897
|
+
operationAlias?: string;
|
|
2898
|
+
providerOperation?: string;
|
|
2899
|
+
capability?: string;
|
|
2900
|
+
actionAudience?: string;
|
|
2901
|
+
sideEffect?: boolean;
|
|
2902
|
+
outbound?: boolean;
|
|
2903
|
+
externallyVisible?: boolean;
|
|
2904
|
+
exposesSensitiveData?: boolean;
|
|
2905
|
+
changesWorkflow?: boolean;
|
|
2906
|
+
reason?: string;
|
|
2907
|
+
supportedResolutions: ApprovalResolutionMode[];
|
|
2908
|
+
editableFields?: string[];
|
|
2909
|
+
expiresAt?: string;
|
|
2910
|
+
journeyId?: string;
|
|
2911
|
+
stateId?: string;
|
|
2912
|
+
metadata?: Record<string, unknown>;
|
|
2913
|
+
}
|
|
2914
|
+
interface ListPendingSupportActionsInput {
|
|
2915
|
+
conversationId: string;
|
|
2916
|
+
}
|
|
2917
|
+
interface ResolvePendingSupportActionInput {
|
|
2918
|
+
conversationId: string;
|
|
2919
|
+
approvalId: string;
|
|
2920
|
+
resolution: ApprovalResolutionMode;
|
|
2921
|
+
editedInput?: unknown;
|
|
2922
|
+
resolvedBy?: string;
|
|
2923
|
+
reason?: string;
|
|
2924
|
+
metadata?: Record<string, unknown>;
|
|
2925
|
+
signal?: AbortSignal;
|
|
2926
|
+
}
|
|
2927
|
+
interface ResolvePendingSupportActionResult {
|
|
2928
|
+
action: PendingSupportAction;
|
|
2929
|
+
resolution: RuntimeEvent;
|
|
2930
|
+
events: RuntimeEvent[];
|
|
2931
|
+
executed: boolean;
|
|
2932
|
+
result?: unknown;
|
|
2933
|
+
}
|
|
2934
|
+
interface EmitCustomEventInput<TEvent extends CustomRuntimeEventDefinition = CustomRuntimeEventDefinition> {
|
|
2935
|
+
conversationId: string;
|
|
2936
|
+
event: TEvent;
|
|
2937
|
+
payload: z.infer<TEvent["payload"]>;
|
|
2938
|
+
}
|
|
2939
|
+
interface EmitJourneyEventInput<TEvent extends JourneyEventDefinition = JourneyEventDefinition> {
|
|
2940
|
+
conversationId: string;
|
|
2941
|
+
event: TEvent;
|
|
2942
|
+
payload: z.infer<TEvent["payload"]>;
|
|
2943
|
+
routing?: EventRoutingMode;
|
|
2944
|
+
target?: {
|
|
2945
|
+
journeyId?: string;
|
|
2946
|
+
stateId?: string;
|
|
2947
|
+
};
|
|
2948
|
+
app?: unknown;
|
|
2949
|
+
signal?: AbortSignal;
|
|
2950
|
+
}
|
|
2951
|
+
interface EmitJourneyEventResult {
|
|
2952
|
+
event: RuntimeEvent;
|
|
2953
|
+
snapshot: RuntimeSnapshot | null;
|
|
2954
|
+
events: RuntimeEvent[];
|
|
2955
|
+
}
|
|
2956
|
+
interface EmitScheduledEventInput<TEvent extends JourneyEventDefinition = JourneyEventDefinition> {
|
|
2957
|
+
conversationId: string;
|
|
2958
|
+
scheduleId: string;
|
|
2959
|
+
event: TEvent;
|
|
2960
|
+
payload: z.infer<TEvent["payload"]>;
|
|
2961
|
+
scheduledFor?: string;
|
|
2962
|
+
dueAt?: string;
|
|
2963
|
+
routing?: EventRoutingMode;
|
|
2964
|
+
target?: {
|
|
2965
|
+
journeyId?: string;
|
|
2966
|
+
stateId?: string;
|
|
2967
|
+
};
|
|
2968
|
+
intent?: {
|
|
2969
|
+
operationAlias?: string;
|
|
2970
|
+
providerPackageId?: string;
|
|
2971
|
+
capability?: string;
|
|
2972
|
+
reason?: string;
|
|
2973
|
+
};
|
|
2974
|
+
metadata?: Record<string, unknown>;
|
|
2975
|
+
app?: unknown;
|
|
2976
|
+
signal?: AbortSignal;
|
|
2977
|
+
}
|
|
2978
|
+
interface EmitScheduledEventResult extends EmitJourneyEventResult {
|
|
2979
|
+
channelEvent: ChannelEvent;
|
|
2980
|
+
intake: ChannelEventIntakeResult;
|
|
2981
|
+
scheduleEvent: RuntimeEvent;
|
|
2982
|
+
}
|
|
2983
|
+
interface RequestHandoffInput {
|
|
2984
|
+
conversationId: string;
|
|
2985
|
+
reason: string;
|
|
2986
|
+
summary?: string;
|
|
2987
|
+
target?: {
|
|
2988
|
+
providerPackageId?: string;
|
|
2989
|
+
destination?: string;
|
|
2990
|
+
channelId?: string;
|
|
2991
|
+
queue?: string;
|
|
2992
|
+
externalConversationId?: string;
|
|
2993
|
+
policyId?: string;
|
|
2994
|
+
};
|
|
2995
|
+
payload?: unknown;
|
|
2996
|
+
}
|
|
2997
|
+
interface ResumeConversationInput {
|
|
2998
|
+
conversationId: string;
|
|
2999
|
+
reason?: string;
|
|
3000
|
+
payload?: unknown;
|
|
3001
|
+
}
|
|
3002
|
+
interface CompactConversationResult<TSummary = ConversationCompactionSummary> {
|
|
3003
|
+
summary: TSummary;
|
|
3004
|
+
snapshot: RuntimeSnapshot;
|
|
3005
|
+
events: RuntimeEvent[];
|
|
3006
|
+
}
|
|
3007
|
+
|
|
1306
3008
|
type MaybePromise<T> = Promise<T> | T;
|
|
1307
3009
|
interface PrivacyHookContext {
|
|
1308
3010
|
conversationId: string;
|
|
@@ -1321,6 +3023,14 @@ interface PrivacyHooks {
|
|
|
1321
3023
|
redactConversationContext?(input: PrivacyHookContext & {
|
|
1322
3024
|
context: unknown;
|
|
1323
3025
|
}): MaybePromise<unknown>;
|
|
3026
|
+
redactInboundChannelEvent?(input: PrivacyHookContext & {
|
|
3027
|
+
event: RuntimeEventInput<"channel.received">;
|
|
3028
|
+
channel: ChannelContext;
|
|
3029
|
+
}): MaybePromise<RuntimeEventInput<"channel.received">>;
|
|
3030
|
+
redactOutboundChannelMessage?(input: PrivacyHookContext & {
|
|
3031
|
+
event: RuntimeEventInput<"channel.sent">;
|
|
3032
|
+
channel: ChannelContext;
|
|
3033
|
+
}): MaybePromise<RuntimeEventInput<"channel.sent">>;
|
|
1324
3034
|
redactRuntimeEvent?(input: PrivacyHookContext & {
|
|
1325
3035
|
event: RuntimeEventInput;
|
|
1326
3036
|
}): MaybePromise<RuntimeEventInput>;
|
|
@@ -1332,6 +3042,18 @@ interface PrivacyHooks {
|
|
|
1332
3042
|
}): MaybePromise<TextGenerationInput>;
|
|
1333
3043
|
}
|
|
1334
3044
|
|
|
3045
|
+
interface RuntimeContextResolveInput<TTurn = unknown> {
|
|
3046
|
+
conversation: ConversationRecord;
|
|
3047
|
+
turn: TTurn;
|
|
3048
|
+
channel?: ChannelContext;
|
|
3049
|
+
app: unknown;
|
|
3050
|
+
text: string;
|
|
3051
|
+
}
|
|
3052
|
+
interface RuntimeContextOptions<TTurn = unknown> {
|
|
3053
|
+
resolve?(input: RuntimeContextResolveInput<TTurn>): unknown | Promise<unknown>;
|
|
3054
|
+
schema?: z.ZodType;
|
|
3055
|
+
redact?: string[];
|
|
3056
|
+
}
|
|
1335
3057
|
interface RuntimeOptions {
|
|
1336
3058
|
storage: StorageAdapter;
|
|
1337
3059
|
agent?: CompiledAgent;
|
|
@@ -1339,6 +3061,7 @@ interface RuntimeOptions {
|
|
|
1339
3061
|
journeyIndex?: JourneyIndex;
|
|
1340
3062
|
topKJourneys?: number;
|
|
1341
3063
|
app?: unknown;
|
|
3064
|
+
context?: RuntimeContextOptions;
|
|
1342
3065
|
knowledgeLimit?: number;
|
|
1343
3066
|
privacy?: PrivacyHooks;
|
|
1344
3067
|
telemetry?: RuntimeTelemetryOptions;
|
|
@@ -1355,129 +3078,769 @@ interface RuntimeOptions {
|
|
|
1355
3078
|
postProcessing?: {
|
|
1356
3079
|
citations?: boolean;
|
|
1357
3080
|
};
|
|
1358
|
-
streaming?: {
|
|
1359
|
-
syntheticDeltas?: boolean;
|
|
3081
|
+
streaming?: {
|
|
3082
|
+
syntheticDeltas?: boolean;
|
|
3083
|
+
};
|
|
3084
|
+
toolRetry?: {
|
|
3085
|
+
maxAttempts?: number;
|
|
3086
|
+
notice?: string;
|
|
3087
|
+
};
|
|
3088
|
+
approval?: {
|
|
3089
|
+
evaluate?(input: RuntimeApprovalEvaluationInput): RuntimeApprovalDecision | null | undefined;
|
|
3090
|
+
};
|
|
3091
|
+
channelOutput?: {
|
|
3092
|
+
resolve?(input: ChannelOutputResolutionPolicyInput): ChannelOutputResolutionDecision | null | undefined | Promise<ChannelOutputResolutionDecision | null | undefined>;
|
|
3093
|
+
execute?(input: ChannelOutputResolverInput): ChannelOutputResolverResult | Promise<ChannelOutputResolverResult>;
|
|
3094
|
+
};
|
|
3095
|
+
channelSets?: ChannelSetConfig[];
|
|
3096
|
+
channels?: ChannelPolicyConfig[];
|
|
3097
|
+
providerPackages?: ProviderManifest[];
|
|
3098
|
+
capabilityAvailability?: CapabilityAvailability[];
|
|
3099
|
+
providerCredentialStatuses?: ProviderCredentialStatus[];
|
|
3100
|
+
providerReadiness?: ProviderReadiness[];
|
|
3101
|
+
}
|
|
3102
|
+
interface RuntimeConfigurationSource {
|
|
3103
|
+
channelSets?: ChannelSetConfig[];
|
|
3104
|
+
channels?: ChannelPolicyConfig[];
|
|
3105
|
+
providerPackages?: ProviderManifest[];
|
|
3106
|
+
capabilityAvailability?: CapabilityAvailability[];
|
|
3107
|
+
credentialStatuses?: ProviderCredentialStatus[];
|
|
3108
|
+
providerReadiness?: ProviderReadiness[];
|
|
3109
|
+
}
|
|
3110
|
+
interface CreateRuntimeConversationInput<TConversationContext = unknown> extends CreateConversationInput<TConversationContext> {
|
|
3111
|
+
}
|
|
3112
|
+
interface HandleUserMessageInput<TTurn = unknown> {
|
|
3113
|
+
conversationId: string;
|
|
3114
|
+
text: string;
|
|
3115
|
+
channel?: ConversationChannel;
|
|
3116
|
+
turn?: TTurn;
|
|
3117
|
+
app?: unknown;
|
|
3118
|
+
signal?: AbortSignal;
|
|
3119
|
+
recordUserMessage?: boolean;
|
|
3120
|
+
assistantMessageMode?: "canonical" | "intermediate" | "none";
|
|
3121
|
+
onAssistantTextDelta?(textDelta: string): Promise<void> | void;
|
|
3122
|
+
}
|
|
3123
|
+
interface HandleUserMessageResult {
|
|
3124
|
+
conversation: ConversationRecord;
|
|
3125
|
+
snapshot: RuntimeSnapshot;
|
|
3126
|
+
events: RuntimeEvent[];
|
|
3127
|
+
text: string;
|
|
3128
|
+
activeJourneyId?: string;
|
|
3129
|
+
}
|
|
3130
|
+
interface ChannelEventBindingInput {
|
|
3131
|
+
outcome?: ChannelEventBindingOutcome;
|
|
3132
|
+
conversationId?: string;
|
|
3133
|
+
agentId?: string;
|
|
3134
|
+
conversationContext?: unknown;
|
|
3135
|
+
linkedConversationId?: string;
|
|
3136
|
+
reason?: string;
|
|
3137
|
+
reasonCode?: string;
|
|
3138
|
+
reasonLabel?: string;
|
|
3139
|
+
blockers?: Array<{
|
|
3140
|
+
code: string;
|
|
3141
|
+
message: string;
|
|
3142
|
+
kind?: string;
|
|
3143
|
+
}>;
|
|
3144
|
+
metadata?: Record<string, unknown>;
|
|
3145
|
+
}
|
|
3146
|
+
interface ChannelEventHandlingInput<TTurn = unknown> {
|
|
3147
|
+
disposition?: ChannelEventHandlingDisposition;
|
|
3148
|
+
text?: string;
|
|
3149
|
+
turn?: TTurn;
|
|
3150
|
+
recordUserMessage?: HandleUserMessageInput<TTurn>["recordUserMessage"];
|
|
3151
|
+
assistantMessageMode?: HandleUserMessageInput<TTurn>["assistantMessageMode"];
|
|
3152
|
+
}
|
|
3153
|
+
interface HandleChannelEventInput<TPayload = unknown, TTurn = unknown> {
|
|
3154
|
+
event: ChannelEventEnvelopeInput<TPayload>;
|
|
3155
|
+
conversationId?: string;
|
|
3156
|
+
agentId?: string;
|
|
3157
|
+
conversationContext?: unknown;
|
|
3158
|
+
createConversation?: CreateRuntimeConversationInput;
|
|
3159
|
+
binding?: ChannelEventBindingInput;
|
|
3160
|
+
handling?: ChannelEventHandlingInput<TTurn>;
|
|
3161
|
+
app?: unknown;
|
|
3162
|
+
signal?: AbortSignal;
|
|
3163
|
+
onAssistantTextDelta?(textDelta: string): Promise<void> | void;
|
|
3164
|
+
}
|
|
3165
|
+
interface HandleChannelEventResult<TPayload = unknown> {
|
|
3166
|
+
channelEvent: ChannelEvent<TPayload>;
|
|
3167
|
+
intake: ChannelEventIntakeResult;
|
|
3168
|
+
disposition: ChannelEventHandlingDisposition;
|
|
3169
|
+
conversation?: ConversationRecord;
|
|
3170
|
+
turn?: HandleUserMessageResult;
|
|
3171
|
+
snapshot?: RuntimeSnapshot;
|
|
3172
|
+
events: RuntimeEvent[];
|
|
3173
|
+
text?: string;
|
|
3174
|
+
activeJourneyId?: string;
|
|
3175
|
+
}
|
|
3176
|
+
interface RequestOutboundContactInput<TPayload = unknown> {
|
|
3177
|
+
conversationId?: string;
|
|
3178
|
+
agentId?: string;
|
|
3179
|
+
conversationContext?: unknown;
|
|
3180
|
+
channel: ConversationChannelInput;
|
|
3181
|
+
text?: string;
|
|
3182
|
+
payload?: TPayload;
|
|
3183
|
+
app?: unknown;
|
|
3184
|
+
signal?: AbortSignal;
|
|
3185
|
+
binding?: ChannelEventBindingInput;
|
|
3186
|
+
handling?: ChannelEventHandlingInput;
|
|
3187
|
+
}
|
|
3188
|
+
interface RequestChannelHandoffReviewInput<TPayload = unknown> {
|
|
3189
|
+
conversationId?: string;
|
|
3190
|
+
agentId?: string;
|
|
3191
|
+
conversationContext?: unknown;
|
|
3192
|
+
channel: ConversationChannelInput;
|
|
3193
|
+
payload?: TPayload;
|
|
3194
|
+
reason?: string;
|
|
3195
|
+
reasonCode?: string;
|
|
3196
|
+
reasonLabel?: string;
|
|
3197
|
+
app?: unknown;
|
|
3198
|
+
signal?: AbortSignal;
|
|
3199
|
+
binding?: ChannelEventBindingInput;
|
|
3200
|
+
handling?: ChannelEventHandlingInput;
|
|
3201
|
+
}
|
|
3202
|
+
interface RequestChannelHandoffInput<TPayload = unknown> {
|
|
3203
|
+
conversationId: string;
|
|
3204
|
+
fromChannel?: ConversationChannelInput;
|
|
3205
|
+
toChannel: ConversationChannelInput;
|
|
3206
|
+
payload?: TPayload;
|
|
3207
|
+
reason?: string;
|
|
3208
|
+
reasonCode?: string;
|
|
3209
|
+
reasonLabel?: string;
|
|
3210
|
+
app?: unknown;
|
|
3211
|
+
signal?: AbortSignal;
|
|
3212
|
+
binding?: ChannelEventBindingInput;
|
|
3213
|
+
handling?: ChannelEventHandlingInput;
|
|
3214
|
+
}
|
|
3215
|
+
interface ChannelOutputResolutionPolicyInput<TPayload = unknown> {
|
|
3216
|
+
conversation: ConversationRecord;
|
|
3217
|
+
intent: ChannelOutputIntent<TPayload>;
|
|
3218
|
+
channel: ChannelContext;
|
|
3219
|
+
defaultResolution: ChannelOutputResolutionDecision;
|
|
3220
|
+
capabilityDecision?: CapabilityUseDecision;
|
|
3221
|
+
app: unknown;
|
|
3222
|
+
}
|
|
3223
|
+
interface ResolveChannelOutputInput<TPayload = unknown> {
|
|
3224
|
+
conversationId: string;
|
|
3225
|
+
intent: ChannelOutputIntentInput<TPayload>;
|
|
3226
|
+
resolution?: ChannelOutputResolutionDecision;
|
|
3227
|
+
app?: unknown;
|
|
3228
|
+
signal?: AbortSignal;
|
|
3229
|
+
}
|
|
3230
|
+
interface ResolveChannelOutputResult<TPayload = unknown> {
|
|
3231
|
+
conversation?: ConversationRecord;
|
|
3232
|
+
outputIntent: ChannelOutputIntent<TPayload>;
|
|
3233
|
+
resolution: ChannelOutputResolution;
|
|
3234
|
+
channelEvent?: ChannelEvent<ChannelOutputResolutionPayload<TPayload>>;
|
|
3235
|
+
event?: RuntimeEvent;
|
|
3236
|
+
events: RuntimeEvent[];
|
|
3237
|
+
shouldExecute: boolean;
|
|
3238
|
+
execution?: ChannelOutputResolverResult;
|
|
3239
|
+
}
|
|
3240
|
+
interface HandleVoiceUserMessageInput<TTurn = unknown> extends HandleUserMessageInput<TTurn> {
|
|
3241
|
+
channelSegmentId: string;
|
|
3242
|
+
connectionId?: string;
|
|
3243
|
+
recordingReferenceId?: string;
|
|
3244
|
+
startedAtMs?: number;
|
|
3245
|
+
endedAtMs?: number;
|
|
3246
|
+
transcriptionSource?: string;
|
|
3247
|
+
metadata?: Record<string, unknown>;
|
|
3248
|
+
}
|
|
3249
|
+
interface HandleVoiceUserMessageResult extends HandleUserMessageResult {
|
|
3250
|
+
voiceEvents: RuntimeEvent[];
|
|
3251
|
+
}
|
|
3252
|
+
interface CompactConversationInput {
|
|
3253
|
+
conversationId: string;
|
|
3254
|
+
fromOffset?: number;
|
|
3255
|
+
toOffset?: number;
|
|
3256
|
+
schemaVersion?: string;
|
|
3257
|
+
signal?: AbortSignal;
|
|
3258
|
+
}
|
|
3259
|
+
interface ReplayConversationInput {
|
|
3260
|
+
conversationId: string;
|
|
3261
|
+
afterOffset?: number;
|
|
3262
|
+
}
|
|
3263
|
+
interface ReplayConversationResult {
|
|
3264
|
+
conversation: ConversationRecord;
|
|
3265
|
+
snapshot: RuntimeSnapshot | null;
|
|
3266
|
+
events: RuntimeEvent[];
|
|
3267
|
+
messages: ReplayedMessage[];
|
|
3268
|
+
openPrompts: ReplayedPrompt[];
|
|
3269
|
+
}
|
|
3270
|
+
interface ExplainTurnInput<TTurn = unknown> extends HandleUserMessageInput<TTurn> {
|
|
3271
|
+
}
|
|
3272
|
+
interface ExplainTurnResult {
|
|
3273
|
+
conversationId: string;
|
|
3274
|
+
agentId: string;
|
|
3275
|
+
channel?: ChannelContext;
|
|
3276
|
+
persona?: unknown;
|
|
3277
|
+
agentChannelPolicy?: unknown;
|
|
3278
|
+
channelPolicy?: unknown;
|
|
3279
|
+
handoffPolicy?: unknown;
|
|
3280
|
+
conversationContext?: unknown;
|
|
3281
|
+
resolvedContext?: unknown;
|
|
3282
|
+
resolvedContextKeys: string[];
|
|
3283
|
+
policyEventData: Record<string, unknown>;
|
|
3284
|
+
}
|
|
3285
|
+
interface SubmitWidgetInput {
|
|
3286
|
+
conversationId: string;
|
|
3287
|
+
promptId: string;
|
|
3288
|
+
widgetKind: string;
|
|
3289
|
+
output: unknown;
|
|
3290
|
+
}
|
|
3291
|
+
interface EmitIntermediateMessageInput {
|
|
3292
|
+
conversationId: string;
|
|
3293
|
+
text: string;
|
|
3294
|
+
visibleToModel?: boolean;
|
|
3295
|
+
}
|
|
3296
|
+
interface EmitGeneratedPreambleInput {
|
|
3297
|
+
conversationId: string;
|
|
3298
|
+
purpose?: string;
|
|
3299
|
+
maxWords?: number;
|
|
3300
|
+
signal?: AbortSignal;
|
|
3301
|
+
}
|
|
3302
|
+
interface EmitGeneratedPreambleResult {
|
|
3303
|
+
text: string;
|
|
3304
|
+
events: RuntimeEvent[];
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3307
|
+
type ChannelAdapterVerificationResult = {
|
|
3308
|
+
verified: true;
|
|
3309
|
+
evidence?: Record<string, unknown>;
|
|
3310
|
+
} | {
|
|
3311
|
+
verified: false;
|
|
3312
|
+
reason?: string;
|
|
3313
|
+
reasonCode?: string;
|
|
3314
|
+
metadata?: Record<string, unknown>;
|
|
3315
|
+
};
|
|
3316
|
+
interface ChannelEventSourceNormalizeInput<TRaw = unknown> {
|
|
3317
|
+
raw: TRaw;
|
|
3318
|
+
channel?: ConversationChannelInput;
|
|
3319
|
+
source?: ChannelEventSourceEvidence<TRaw>;
|
|
3320
|
+
app?: unknown;
|
|
3321
|
+
}
|
|
3322
|
+
interface ChannelEventSourceBindInput {
|
|
3323
|
+
event: ChannelEventEnvelopeInput;
|
|
3324
|
+
app?: unknown;
|
|
3325
|
+
}
|
|
3326
|
+
interface ChannelEventSourceBinding {
|
|
3327
|
+
conversationId?: string;
|
|
3328
|
+
agentId?: string;
|
|
3329
|
+
conversationContext?: unknown;
|
|
3330
|
+
outcome?: "start-new" | "resume-existing" | "link-and-start-new" | "ignore" | "defer" | "handoff-review" | "blocked";
|
|
3331
|
+
reason?: string;
|
|
3332
|
+
reasonCode?: string;
|
|
3333
|
+
reasonLabel?: string;
|
|
3334
|
+
metadata?: Record<string, unknown>;
|
|
3335
|
+
}
|
|
3336
|
+
interface ChannelEventSource<TRaw = unknown> {
|
|
3337
|
+
id: string;
|
|
3338
|
+
channel?: ConversationChannelInput;
|
|
3339
|
+
sourceType?: ChannelEventSourceEvidence<TRaw>["sourceType"];
|
|
3340
|
+
verify?(raw: TRaw): ChannelAdapterVerificationResult | Promise<ChannelAdapterVerificationResult>;
|
|
3341
|
+
normalize(input: ChannelEventSourceNormalizeInput<TRaw>): ChannelEventEnvelopeInput | Promise<ChannelEventEnvelopeInput>;
|
|
3342
|
+
identity?(event: ChannelEventEnvelopeInput, raw: TRaw): ChannelEventIdentity | string | undefined | Promise<ChannelEventIdentity | string | undefined>;
|
|
3343
|
+
bind?(input: ChannelEventSourceBindInput): ChannelEventSourceBinding | Promise<ChannelEventSourceBinding>;
|
|
3344
|
+
}
|
|
3345
|
+
interface ChannelProviderAdapter<TRaw = unknown> extends ChannelEventSource<TRaw> {
|
|
3346
|
+
provider: string;
|
|
3347
|
+
providerPackageId?: string;
|
|
3348
|
+
resolveOutput?(input: ChannelOutputResolverInput): Promise<ChannelOutputResolverResult>;
|
|
3349
|
+
}
|
|
3350
|
+
interface ChannelEventSourceHandleInput<TRaw = unknown, TTurn = unknown> {
|
|
3351
|
+
raw: TRaw;
|
|
3352
|
+
channel?: ConversationChannelInput;
|
|
3353
|
+
conversationId?: string;
|
|
3354
|
+
agentId?: string;
|
|
3355
|
+
conversationContext?: unknown;
|
|
3356
|
+
createConversation?: CreateRuntimeConversationInput;
|
|
3357
|
+
binding?: ChannelEventBindingInput;
|
|
3358
|
+
handling?: ChannelEventHandlingInput<TTurn>;
|
|
3359
|
+
app?: unknown;
|
|
3360
|
+
signal?: AbortSignal;
|
|
3361
|
+
onAssistantTextDelta?(textDelta: string): Promise<void> | void;
|
|
3362
|
+
}
|
|
3363
|
+
interface ChannelEventRuntimeReceiver {
|
|
3364
|
+
handleChannelEvent<TPayload = unknown, TTurn = unknown>(input: HandleChannelEventInput<TPayload, TTurn>): Promise<HandleChannelEventResult<TPayload>>;
|
|
3365
|
+
}
|
|
3366
|
+
declare function defineChannelEventSource<TRaw = unknown>(source: ChannelEventSource<TRaw>): ChannelEventSource<TRaw>;
|
|
3367
|
+
declare function defineChannelProviderAdapter<TRaw = unknown>(adapter: ChannelProviderAdapter<TRaw>): ChannelProviderAdapter<TRaw>;
|
|
3368
|
+
declare function createChannelEventInputFromSource<TRaw = unknown, TTurn = unknown>(source: ChannelEventSource<TRaw>, input: ChannelEventSourceHandleInput<TRaw, TTurn>): Promise<HandleChannelEventInput<unknown, TTurn>>;
|
|
3369
|
+
declare function handleChannelEventFromSource<TRaw = unknown, TTurn = unknown>(runtime: ChannelEventRuntimeReceiver, source: ChannelEventSource<TRaw>, input: ChannelEventSourceHandleInput<TRaw, TTurn>): Promise<HandleChannelEventResult>;
|
|
3370
|
+
|
|
3371
|
+
interface RuntimeEventBase<TType extends string, TData> {
|
|
3372
|
+
id: string;
|
|
3373
|
+
conversationId: string;
|
|
3374
|
+
offset: number;
|
|
3375
|
+
type: TType;
|
|
3376
|
+
createdAt: string;
|
|
3377
|
+
telemetry?: RuntimeEventTelemetry;
|
|
3378
|
+
data: TData;
|
|
3379
|
+
}
|
|
3380
|
+
type ConversationLifecycle = "active" | "handoff" | "closed";
|
|
3381
|
+
interface MessageSegment {
|
|
3382
|
+
id: string;
|
|
3383
|
+
text: string;
|
|
3384
|
+
references?: SupportReference[];
|
|
3385
|
+
}
|
|
3386
|
+
type SupportReference = {
|
|
3387
|
+
type: "knowledge";
|
|
3388
|
+
id: string;
|
|
3389
|
+
sourceName?: string;
|
|
3390
|
+
title?: string;
|
|
3391
|
+
metadata?: unknown;
|
|
3392
|
+
} | {
|
|
3393
|
+
type: "toolResult";
|
|
3394
|
+
id: string;
|
|
3395
|
+
};
|
|
3396
|
+
type RuntimeEvent = RuntimeEventBase<"message.started", {
|
|
3397
|
+
role: "assistant" | "user";
|
|
3398
|
+
}> | RuntimeEventBase<"message.delta", {
|
|
3399
|
+
textDelta: string;
|
|
3400
|
+
}> | RuntimeEventBase<"message.completed", {
|
|
3401
|
+
text: string;
|
|
3402
|
+
segments?: MessageSegment[];
|
|
3403
|
+
usage?: UsageRecord;
|
|
3404
|
+
intermediate?: boolean;
|
|
3405
|
+
visibleToModel?: boolean;
|
|
3406
|
+
}> | RuntimeEventBase<"message.generated", {
|
|
3407
|
+
textLength: number;
|
|
3408
|
+
toolCallCount?: number;
|
|
3409
|
+
usage?: UsageRecord;
|
|
3410
|
+
channel?: ChannelContext;
|
|
3411
|
+
policyApplied?: {
|
|
3412
|
+
truncated?: boolean;
|
|
3413
|
+
maxWords?: number;
|
|
3414
|
+
maxCharacters?: number;
|
|
3415
|
+
};
|
|
3416
|
+
}> | RuntimeEventBase<"message.aborted", {
|
|
3417
|
+
reason: string;
|
|
3418
|
+
partialText?: string;
|
|
3419
|
+
}> | RuntimeEventBase<"channel.event.received", {
|
|
3420
|
+
eventId?: string;
|
|
3421
|
+
kind: ChannelEventKind;
|
|
3422
|
+
direction?: ChannelEventDirection;
|
|
3423
|
+
intent?: ChannelEventIntent;
|
|
3424
|
+
actor?: ChannelEventActor;
|
|
3425
|
+
channel: ChannelContext;
|
|
3426
|
+
bindingOutcome: ChannelEventBindingOutcome;
|
|
3427
|
+
handlingDisposition: ChannelEventHandlingDisposition;
|
|
3428
|
+
occurredAt?: string;
|
|
3429
|
+
payload?: unknown;
|
|
3430
|
+
identity?: ChannelEventIdentity;
|
|
3431
|
+
source?: ChannelSourceEvidence;
|
|
3432
|
+
metadata?: Record<string, unknown>;
|
|
3433
|
+
}> | RuntimeEventBase<"channel.received", {
|
|
3434
|
+
channel: ChannelContext;
|
|
3435
|
+
text?: string;
|
|
3436
|
+
payload?: unknown;
|
|
3437
|
+
}> | RuntimeEventBase<"channel.sent", {
|
|
3438
|
+
channel: ChannelContext;
|
|
3439
|
+
text?: string;
|
|
3440
|
+
payload?: unknown;
|
|
3441
|
+
}> | RuntimeEventBase<"channel.delivery.updated", {
|
|
3442
|
+
channel: ChannelContext;
|
|
3443
|
+
status: string;
|
|
3444
|
+
payload?: unknown;
|
|
3445
|
+
}> | RuntimeEventBase<"channel.thread.linked", {
|
|
3446
|
+
channel: ChannelContext;
|
|
3447
|
+
previousChannel?: ChannelContext;
|
|
3448
|
+
reason?: string;
|
|
3449
|
+
}> | RuntimeEventBase<"voice.segment.started", {
|
|
3450
|
+
channelSegmentId: string;
|
|
3451
|
+
connectionId: string;
|
|
3452
|
+
adapter: string;
|
|
3453
|
+
provider?: string;
|
|
3454
|
+
}> | RuntimeEventBase<"voice.segment.ended", {
|
|
3455
|
+
channelSegmentId: string;
|
|
3456
|
+
connectionId?: string;
|
|
3457
|
+
reason?: string;
|
|
3458
|
+
}> | RuntimeEventBase<"voice.connection.failed", {
|
|
3459
|
+
channelSegmentId: string;
|
|
3460
|
+
connectionId?: string;
|
|
3461
|
+
code: string;
|
|
3462
|
+
message: string;
|
|
3463
|
+
retryable?: boolean;
|
|
3464
|
+
}> | RuntimeEventBase<"voice.interrupted", {
|
|
3465
|
+
channelSegmentId: string;
|
|
3466
|
+
connectionId?: string;
|
|
3467
|
+
interruptedMessageId?: string;
|
|
3468
|
+
source?: "userSpeech" | "adapter" | "provider";
|
|
3469
|
+
reason?: string;
|
|
3470
|
+
recordingReferenceId?: string;
|
|
3471
|
+
offsetMs?: number;
|
|
3472
|
+
}> | RuntimeEventBase<"voice.recording.started", {
|
|
3473
|
+
channelSegmentId: string;
|
|
3474
|
+
recordingReferenceId: string;
|
|
3475
|
+
policy?: unknown;
|
|
3476
|
+
}> | RuntimeEventBase<"voice.recording.completed", {
|
|
3477
|
+
channelSegmentId: string;
|
|
3478
|
+
recordingReferenceId: string;
|
|
3479
|
+
uri?: string;
|
|
3480
|
+
startedAt?: string;
|
|
3481
|
+
endedAt?: string;
|
|
3482
|
+
metadata?: unknown;
|
|
3483
|
+
}> | RuntimeEventBase<"voice.transcript.committed", {
|
|
3484
|
+
channelSegmentId: string;
|
|
3485
|
+
speaker: "user" | "assistant";
|
|
3486
|
+
messageEventId: string;
|
|
3487
|
+
recordingReferenceId?: string;
|
|
3488
|
+
startedAtMs?: number;
|
|
3489
|
+
endedAtMs?: number;
|
|
3490
|
+
transcriptionSource?: string;
|
|
3491
|
+
metadata?: unknown;
|
|
3492
|
+
}> | RuntimeEventBase<"journey.candidates.retrieved", {
|
|
3493
|
+
journeyIds: string[];
|
|
3494
|
+
}> | RuntimeEventBase<"journey.matched", {
|
|
3495
|
+
candidates: Array<{
|
|
3496
|
+
journeyId: string;
|
|
3497
|
+
confidence: number;
|
|
3498
|
+
reason?: string;
|
|
3499
|
+
}>;
|
|
3500
|
+
}> | RuntimeEventBase<"journey.activated", {
|
|
3501
|
+
journeyId: string;
|
|
3502
|
+
previousJourneyId?: string;
|
|
3503
|
+
}> | RuntimeEventBase<"journey.completed", {
|
|
3504
|
+
journeyId: string;
|
|
3505
|
+
stateId?: string;
|
|
3506
|
+
reason?: string;
|
|
3507
|
+
}> | RuntimeEventBase<"journey.guard.denied", {
|
|
3508
|
+
journeyId: string;
|
|
3509
|
+
stateId?: string;
|
|
3510
|
+
code: string;
|
|
3511
|
+
message?: string;
|
|
3512
|
+
metadata?: Record<string, unknown>;
|
|
3513
|
+
}> | RuntimeEventBase<"journey.event.emitted", {
|
|
3514
|
+
name: string;
|
|
3515
|
+
payload: unknown;
|
|
3516
|
+
routing: "none" | "activeJourneyOnly" | "full" | "targeted";
|
|
3517
|
+
target?: {
|
|
3518
|
+
journeyId?: string;
|
|
3519
|
+
stateId?: string;
|
|
3520
|
+
};
|
|
3521
|
+
}> | RuntimeEventBase<"journey.state.entered", {
|
|
3522
|
+
journeyId: string;
|
|
3523
|
+
stateId: string;
|
|
3524
|
+
}> | RuntimeEventBase<"journey.extraction.proposed", {
|
|
3525
|
+
journeyId: string;
|
|
3526
|
+
stateId: string;
|
|
3527
|
+
fields: string[];
|
|
3528
|
+
}> | RuntimeEventBase<"journey.extraction.accepted", {
|
|
3529
|
+
journeyId: string;
|
|
3530
|
+
stateId: string;
|
|
3531
|
+
fields: string[];
|
|
3532
|
+
}> | RuntimeEventBase<"action.started", {
|
|
3533
|
+
actionName: string;
|
|
3534
|
+
journeyId?: string;
|
|
3535
|
+
stateId?: string;
|
|
3536
|
+
}> | RuntimeEventBase<"action.completed", {
|
|
3537
|
+
actionName: string;
|
|
3538
|
+
success: boolean;
|
|
3539
|
+
journeyId?: string;
|
|
3540
|
+
stateId?: string;
|
|
3541
|
+
error?: string;
|
|
3542
|
+
}> | RuntimeEventBase<"tool.started", {
|
|
3543
|
+
toolName: string;
|
|
3544
|
+
journeyId?: string;
|
|
3545
|
+
stateId?: string;
|
|
3546
|
+
}> | RuntimeEventBase<"tool.completed", {
|
|
3547
|
+
toolName: string;
|
|
3548
|
+
success: boolean;
|
|
3549
|
+
journeyId?: string;
|
|
3550
|
+
stateId?: string;
|
|
3551
|
+
result?: unknown;
|
|
3552
|
+
error?: string;
|
|
3553
|
+
policyBlock?: {
|
|
3554
|
+
code: string;
|
|
3555
|
+
message: string;
|
|
3556
|
+
blockers: Array<{
|
|
3557
|
+
code: string;
|
|
3558
|
+
message: string;
|
|
3559
|
+
kind?: string;
|
|
3560
|
+
}>;
|
|
3561
|
+
};
|
|
3562
|
+
approval?: {
|
|
3563
|
+
approvalId: string;
|
|
3564
|
+
status: "requested" | "resolved";
|
|
3565
|
+
};
|
|
3566
|
+
}> | RuntimeEventBase<"approval.requested", {
|
|
3567
|
+
approvalId: string;
|
|
3568
|
+
toolName: string;
|
|
3569
|
+
input: unknown;
|
|
3570
|
+
channel?: ChannelContext;
|
|
3571
|
+
providerPackageId?: string;
|
|
3572
|
+
operationAlias?: string;
|
|
3573
|
+
providerOperation?: string;
|
|
3574
|
+
capability?: string;
|
|
3575
|
+
actionAudience?: string;
|
|
3576
|
+
sideEffect?: boolean;
|
|
3577
|
+
outbound?: boolean;
|
|
3578
|
+
externallyVisible?: boolean;
|
|
3579
|
+
exposesSensitiveData?: boolean;
|
|
3580
|
+
changesWorkflow?: boolean;
|
|
3581
|
+
reason?: string;
|
|
3582
|
+
supportedResolutions: ApprovalResolutionMode[];
|
|
3583
|
+
editableFields?: string[];
|
|
3584
|
+
expiresAt?: string;
|
|
3585
|
+
journeyId?: string;
|
|
3586
|
+
stateId?: string;
|
|
3587
|
+
metadata?: Record<string, unknown>;
|
|
3588
|
+
}> | RuntimeEventBase<"approval.resolved", {
|
|
3589
|
+
approvalId: string;
|
|
3590
|
+
resolution: ApprovalResolutionMode;
|
|
3591
|
+
toolName?: string;
|
|
3592
|
+
resolvedBy?: string;
|
|
3593
|
+
reason?: string;
|
|
3594
|
+
editedInput?: unknown;
|
|
3595
|
+
executed?: boolean;
|
|
3596
|
+
result?: unknown;
|
|
3597
|
+
error?: string;
|
|
3598
|
+
policyBlock?: {
|
|
3599
|
+
code: string;
|
|
3600
|
+
message: string;
|
|
3601
|
+
blockers: Array<{
|
|
3602
|
+
code: string;
|
|
3603
|
+
message: string;
|
|
3604
|
+
kind?: string;
|
|
3605
|
+
}>;
|
|
3606
|
+
};
|
|
3607
|
+
metadata?: Record<string, unknown>;
|
|
3608
|
+
}> | RuntimeEventBase<"knowledge.retrieved", {
|
|
3609
|
+
sourceName: string;
|
|
3610
|
+
itemIds: string[];
|
|
3611
|
+
}> | RuntimeEventBase<"context.resolved", {
|
|
3612
|
+
keys: string[];
|
|
3613
|
+
channel?: ChannelContext;
|
|
3614
|
+
}> | RuntimeEventBase<"policy.evaluated", {
|
|
3615
|
+
channel?: ChannelContext;
|
|
3616
|
+
channelPolicyId?: string;
|
|
3617
|
+
configuredPolicyIds?: string[];
|
|
3618
|
+
enabledCapabilities?: string[];
|
|
3619
|
+
outboundEnabled?: boolean;
|
|
3620
|
+
handoffEnabled?: boolean;
|
|
3621
|
+
responseConstraints?: {
|
|
3622
|
+
maxWords?: number;
|
|
3623
|
+
maxCharacters?: number;
|
|
3624
|
+
};
|
|
3625
|
+
agentChannelPolicyKeys?: string[];
|
|
3626
|
+
hasAgentHandoffPolicy?: boolean;
|
|
3627
|
+
}> | RuntimeEventBase<"ui.prompted", {
|
|
3628
|
+
promptId: string;
|
|
3629
|
+
widgetKind: string;
|
|
3630
|
+
input: unknown;
|
|
3631
|
+
}> | RuntimeEventBase<"ui.submitted", {
|
|
3632
|
+
promptId: string;
|
|
3633
|
+
widgetKind: string;
|
|
3634
|
+
output: unknown;
|
|
3635
|
+
}> | RuntimeEventBase<"conversation.compaction.started", {
|
|
3636
|
+
fromOffset: number;
|
|
3637
|
+
toOffset: number;
|
|
3638
|
+
}> | RuntimeEventBase<"conversation.compaction.completed", {
|
|
3639
|
+
fromOffset: number;
|
|
3640
|
+
toOffset: number;
|
|
3641
|
+
schemaVersion: string;
|
|
3642
|
+
}> | RuntimeEventBase<"handoff.requested", {
|
|
3643
|
+
reason: string;
|
|
3644
|
+
summary?: string;
|
|
3645
|
+
target?: {
|
|
3646
|
+
providerPackageId?: string;
|
|
3647
|
+
destination?: string;
|
|
3648
|
+
channelId?: string;
|
|
3649
|
+
queue?: string;
|
|
3650
|
+
externalConversationId?: string;
|
|
3651
|
+
policyId?: string;
|
|
3652
|
+
};
|
|
3653
|
+
payload?: unknown;
|
|
3654
|
+
}> | RuntimeEventBase<"handoff.completed", {
|
|
3655
|
+
target?: {
|
|
3656
|
+
providerPackageId?: string;
|
|
3657
|
+
destination?: string;
|
|
3658
|
+
channelId?: string;
|
|
3659
|
+
queue?: string;
|
|
3660
|
+
externalConversationId?: string;
|
|
3661
|
+
policyId?: string;
|
|
1360
3662
|
};
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
3663
|
+
channel?: ChannelContext;
|
|
3664
|
+
policyId?: string;
|
|
3665
|
+
status: "accepted" | "adapter-completed";
|
|
3666
|
+
payload?: unknown;
|
|
3667
|
+
}> | RuntimeEventBase<"handoff.resumed", {
|
|
3668
|
+
reason?: string;
|
|
3669
|
+
payload?: unknown;
|
|
3670
|
+
}> | RuntimeEventBase<"schedule.due", {
|
|
3671
|
+
scheduleId: string;
|
|
3672
|
+
scheduledFor?: string;
|
|
3673
|
+
dueAt: string;
|
|
3674
|
+
eventName: string;
|
|
3675
|
+
payload?: unknown;
|
|
3676
|
+
intent?: {
|
|
3677
|
+
operationAlias?: string;
|
|
3678
|
+
providerPackageId?: string;
|
|
3679
|
+
capability?: string;
|
|
3680
|
+
reason?: string;
|
|
1364
3681
|
};
|
|
3682
|
+
metadata?: Record<string, unknown>;
|
|
3683
|
+
}> | RuntimeEventBase<"conversation.closed", {
|
|
3684
|
+
reason?: string;
|
|
3685
|
+
}> | RuntimeEventBase<"error", {
|
|
3686
|
+
code: string;
|
|
3687
|
+
message: string;
|
|
3688
|
+
details?: unknown;
|
|
3689
|
+
}> | RuntimeEventBase<"eval.completed", {
|
|
3690
|
+
scenarioId?: string;
|
|
3691
|
+
success: boolean;
|
|
3692
|
+
score?: number;
|
|
3693
|
+
details?: unknown;
|
|
3694
|
+
}> | RuntimeEventBase<`custom.${string}`, unknown>;
|
|
3695
|
+
|
|
3696
|
+
type VoiceConnectionStatus = "starting" | "connected" | "ended" | "failed";
|
|
3697
|
+
type VoiceSpeaker = "user" | "assistant";
|
|
3698
|
+
interface VoiceIceServer {
|
|
3699
|
+
urls: string | string[];
|
|
3700
|
+
username?: string;
|
|
3701
|
+
credential?: string;
|
|
1365
3702
|
}
|
|
1366
|
-
interface
|
|
3703
|
+
interface VoiceRecordingPolicy {
|
|
3704
|
+
enabled?: boolean;
|
|
3705
|
+
requireConsent?: boolean;
|
|
3706
|
+
mode?: "input" | "both";
|
|
3707
|
+
metadata?: Record<string, unknown>;
|
|
1367
3708
|
}
|
|
1368
|
-
interface
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
channel?: ConversationChannel;
|
|
1372
|
-
turn?: TTurn;
|
|
1373
|
-
app?: unknown;
|
|
1374
|
-
signal?: AbortSignal;
|
|
1375
|
-
recordUserMessage?: boolean;
|
|
1376
|
-
assistantMessageMode?: "canonical" | "intermediate" | "none";
|
|
1377
|
-
onAssistantTextDelta?(textDelta: string): Promise<void> | void;
|
|
3709
|
+
interface VoiceSelection {
|
|
3710
|
+
provider: string;
|
|
3711
|
+
voice: string;
|
|
1378
3712
|
}
|
|
1379
|
-
interface
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
activeJourneyId?: string;
|
|
3713
|
+
interface VoiceModelSet {
|
|
3714
|
+
provider: string;
|
|
3715
|
+
model: string;
|
|
3716
|
+
voice?: string;
|
|
3717
|
+
settings?: Record<string, unknown>;
|
|
1385
3718
|
}
|
|
1386
|
-
interface
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
startedAtMs?: number;
|
|
1391
|
-
endedAtMs?: number;
|
|
1392
|
-
transcriptionSource?: string;
|
|
3719
|
+
interface VoiceProfile {
|
|
3720
|
+
instructions?: string;
|
|
3721
|
+
modelSet?: VoiceModelSet;
|
|
3722
|
+
recording?: VoiceRecordingPolicy;
|
|
1393
3723
|
metadata?: Record<string, unknown>;
|
|
1394
3724
|
}
|
|
1395
|
-
interface
|
|
1396
|
-
|
|
1397
|
-
}
|
|
1398
|
-
interface CompactConversationInput {
|
|
3725
|
+
interface VoiceChannelSegment {
|
|
3726
|
+
id: string;
|
|
1399
3727
|
conversationId: string;
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
signal?: AbortSignal;
|
|
3728
|
+
channel: "voice";
|
|
3729
|
+
startedAt: string;
|
|
3730
|
+
endedAt?: string;
|
|
1404
3731
|
}
|
|
1405
|
-
interface
|
|
1406
|
-
|
|
1407
|
-
|
|
3732
|
+
interface VoiceConnection {
|
|
3733
|
+
id: string;
|
|
3734
|
+
channelSegmentId: string;
|
|
3735
|
+
status: VoiceConnectionStatus;
|
|
3736
|
+
adapter: string;
|
|
3737
|
+
provider?: string;
|
|
3738
|
+
providerSessionId?: string;
|
|
3739
|
+
expiresAt?: string;
|
|
1408
3740
|
}
|
|
1409
|
-
interface
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
openPrompts: ReplayedPrompt[];
|
|
3741
|
+
interface VoiceSocketMetadata {
|
|
3742
|
+
url: string;
|
|
3743
|
+
token: string;
|
|
3744
|
+
expiresAt: string;
|
|
3745
|
+
protocol: "cognidesk.voice.v1";
|
|
1415
3746
|
}
|
|
1416
|
-
interface
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
output: unknown;
|
|
3747
|
+
interface VoiceStartClientHints {
|
|
3748
|
+
userAgent?: string;
|
|
3749
|
+
locale?: string;
|
|
3750
|
+
metadata?: Record<string, unknown>;
|
|
1421
3751
|
}
|
|
1422
|
-
interface
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
3752
|
+
interface StartVoiceConversationInput<TConversationContext = unknown> {
|
|
3753
|
+
id?: string;
|
|
3754
|
+
agentId: string;
|
|
3755
|
+
context: TConversationContext;
|
|
3756
|
+
client?: VoiceStartClientHints;
|
|
3757
|
+
app?: unknown;
|
|
1426
3758
|
}
|
|
1427
|
-
interface
|
|
3759
|
+
interface StartVoiceSegmentInput {
|
|
1428
3760
|
conversationId: string;
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
signal?: AbortSignal;
|
|
3761
|
+
client?: VoiceStartClientHints;
|
|
3762
|
+
app?: unknown;
|
|
1432
3763
|
}
|
|
1433
|
-
interface
|
|
1434
|
-
|
|
3764
|
+
interface StartVoiceResult {
|
|
3765
|
+
conversation: ConversationRecord;
|
|
3766
|
+
channelSegment: VoiceChannelSegment;
|
|
3767
|
+
connection: VoiceConnection;
|
|
3768
|
+
socket?: VoiceSocketMetadata;
|
|
1435
3769
|
events: RuntimeEvent[];
|
|
1436
3770
|
}
|
|
1437
|
-
interface
|
|
3771
|
+
interface CommitVoiceTranscriptInput {
|
|
1438
3772
|
conversationId: string;
|
|
1439
|
-
|
|
1440
|
-
|
|
3773
|
+
channelSegmentId: string;
|
|
3774
|
+
speaker: VoiceSpeaker;
|
|
3775
|
+
text: string;
|
|
3776
|
+
recordingReferenceId?: string;
|
|
3777
|
+
startedAtMs?: number;
|
|
3778
|
+
endedAtMs?: number;
|
|
3779
|
+
transcriptionSource?: string;
|
|
3780
|
+
metadata?: Record<string, unknown>;
|
|
1441
3781
|
}
|
|
1442
|
-
interface
|
|
1443
|
-
|
|
1444
|
-
event: TEvent;
|
|
1445
|
-
payload: z.infer<TEvent["payload"]>;
|
|
1446
|
-
routing?: EventRoutingMode;
|
|
1447
|
-
target?: {
|
|
1448
|
-
journeyId?: string;
|
|
1449
|
-
stateId?: string;
|
|
1450
|
-
};
|
|
1451
|
-
app?: unknown;
|
|
1452
|
-
signal?: AbortSignal;
|
|
3782
|
+
interface CommitVoiceTranscriptReferenceInput extends CommitVoiceTranscriptInput {
|
|
3783
|
+
messageEventId: string;
|
|
1453
3784
|
}
|
|
1454
|
-
interface
|
|
3785
|
+
interface CommitVoiceTranscriptResult {
|
|
3786
|
+
message: RuntimeEvent;
|
|
1455
3787
|
event: RuntimeEvent;
|
|
1456
|
-
snapshot: RuntimeSnapshot | null;
|
|
1457
3788
|
events: RuntimeEvent[];
|
|
1458
3789
|
}
|
|
1459
|
-
interface
|
|
3790
|
+
interface RecordVoiceInterruptionInput {
|
|
1460
3791
|
conversationId: string;
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
3792
|
+
channelSegmentId: string;
|
|
3793
|
+
connectionId?: string;
|
|
3794
|
+
interruptedMessageId?: string;
|
|
3795
|
+
source?: "userSpeech" | "adapter" | "provider";
|
|
3796
|
+
reason?: string;
|
|
3797
|
+
recordingReferenceId?: string;
|
|
3798
|
+
offsetMs?: number;
|
|
1464
3799
|
}
|
|
1465
|
-
|
|
3800
|
+
type VoiceRuntimeEventInput = Extract<RuntimeEventInput, {
|
|
3801
|
+
type: `voice.${string}`;
|
|
3802
|
+
}>;
|
|
3803
|
+
|
|
3804
|
+
interface RuntimeSnapshot {
|
|
1466
3805
|
conversationId: string;
|
|
3806
|
+
lifecycle: ConversationLifecycle;
|
|
3807
|
+
activeJourneyId?: string;
|
|
3808
|
+
activeStateIds: string[];
|
|
3809
|
+
journeyContext?: unknown;
|
|
3810
|
+
journeyContexts?: JourneyContextRecord[];
|
|
3811
|
+
journeySummaries?: JourneySummary[];
|
|
3812
|
+
compactionSummary?: unknown;
|
|
3813
|
+
definitionHash?: string;
|
|
3814
|
+
updatedAt: string;
|
|
3815
|
+
}
|
|
3816
|
+
interface JourneySummary {
|
|
3817
|
+
journeyId: string;
|
|
3818
|
+
kind: "stateMachine" | "delegation";
|
|
3819
|
+
summary: string;
|
|
3820
|
+
completedAt: string;
|
|
3821
|
+
stateId?: string;
|
|
1467
3822
|
reason?: string;
|
|
1468
|
-
payload?: unknown;
|
|
1469
3823
|
}
|
|
1470
|
-
interface
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
3824
|
+
interface JourneyContextRecord {
|
|
3825
|
+
journeyId: string;
|
|
3826
|
+
context: unknown;
|
|
3827
|
+
updatedAt: string;
|
|
3828
|
+
stateId?: string;
|
|
3829
|
+
}
|
|
3830
|
+
|
|
3831
|
+
declare class DefinitionError extends Error {
|
|
3832
|
+
constructor(message: string);
|
|
1474
3833
|
}
|
|
1475
3834
|
|
|
1476
3835
|
declare class CognideskRuntime {
|
|
1477
3836
|
private readonly activeTurns;
|
|
1478
3837
|
private readonly kernel;
|
|
1479
3838
|
private readonly options;
|
|
3839
|
+
readonly debug: {
|
|
3840
|
+
explainTurn: <TTurn = unknown>(input: ExplainTurnInput<TTurn>) => Promise<ExplainTurnResult>;
|
|
3841
|
+
};
|
|
1480
3842
|
constructor(options: RuntimeOptions);
|
|
3843
|
+
configurationSource(): RuntimeConfigurationSource;
|
|
1481
3844
|
initialize(): Promise<void>;
|
|
1482
3845
|
createConversation<TConversationContext = unknown>(input: CreateRuntimeConversationInput<TConversationContext>): Promise<ConversationRecord<TConversationContext>>;
|
|
1483
3846
|
emit<TEvent extends RuntimeEventInput>(event: TEvent): Promise<RuntimeEvent>;
|
|
@@ -1487,10 +3850,18 @@ declare class CognideskRuntime {
|
|
|
1487
3850
|
emitGeneratedPreamble(input: EmitGeneratedPreambleInput): Promise<EmitGeneratedPreambleResult>;
|
|
1488
3851
|
emitCustomEvent<TEvent extends CustomRuntimeEventDefinition>(input: EmitCustomEventInput<TEvent>): Promise<RuntimeEvent>;
|
|
1489
3852
|
emitJourneyEvent<TEvent extends JourneyEventDefinition>(input: EmitJourneyEventInput<TEvent>): Promise<EmitJourneyEventResult>;
|
|
3853
|
+
emitScheduledEvent<TEvent extends JourneyEventDefinition>(input: EmitScheduledEventInput<TEvent>): Promise<EmitScheduledEventResult>;
|
|
1490
3854
|
listEvents(conversationId: string, afterOffset?: number): Promise<RuntimeEvent[]>;
|
|
3855
|
+
listPendingSupportActions(input: ListPendingSupportActionsInput | string): Promise<PendingSupportAction[]>;
|
|
3856
|
+
resolvePendingSupportAction(input: ResolvePendingSupportActionInput): Promise<ResolvePendingSupportActionResult>;
|
|
1491
3857
|
replayConversation(input: ReplayConversationInput): Promise<ReplayConversationResult>;
|
|
1492
3858
|
submitWidget(input: SubmitWidgetInput): Promise<RuntimeEvent>;
|
|
1493
3859
|
getSnapshot(conversationId: string): Promise<RuntimeSnapshot | null>;
|
|
3860
|
+
handleChannelEvent<TPayload = unknown, TTurn = unknown>(input: HandleChannelEventInput<TPayload, TTurn>): Promise<HandleChannelEventResult<TPayload>>;
|
|
3861
|
+
requestOutboundContact<TPayload = unknown>(input: RequestOutboundContactInput<TPayload>): Promise<HandleChannelEventResult<TPayload>>;
|
|
3862
|
+
requestChannelHandoff<TPayload = unknown>(input: RequestChannelHandoffInput<TPayload>): Promise<HandleChannelEventResult<TPayload>>;
|
|
3863
|
+
requestChannelHandoffReview<TPayload = unknown>(input: RequestChannelHandoffReviewInput<TPayload>): Promise<HandleChannelEventResult<TPayload>>;
|
|
3864
|
+
resolveChannelOutput<TPayload = unknown>(input: ResolveChannelOutputInput<TPayload>): Promise<ResolveChannelOutputResult<TPayload>>;
|
|
1494
3865
|
handleUserMessage<TTurn = unknown>(input: HandleUserMessageInput<TTurn>): Promise<HandleUserMessageResult>;
|
|
1495
3866
|
handleVoiceUserMessage<TTurn = unknown>(input: HandleVoiceUserMessageInput<TTurn>): Promise<HandleVoiceUserMessageResult>;
|
|
1496
3867
|
startVoiceConversation<TConversationContext = unknown>(input: StartVoiceConversationInput<TConversationContext>): Promise<StartVoiceResult>;
|
|
@@ -1513,7 +3884,10 @@ declare class CognideskRuntime {
|
|
|
1513
3884
|
event: RuntimeEvent;
|
|
1514
3885
|
}>;
|
|
1515
3886
|
compactConversation<TSummary = ConversationCompactionSummary>(input: CompactConversationInput): Promise<CompactConversationResult<TSummary>>;
|
|
3887
|
+
private explainTurn;
|
|
1516
3888
|
private runtimeOperation;
|
|
3889
|
+
private channelFacadeContext;
|
|
3890
|
+
private bindChannelEvent;
|
|
1517
3891
|
}
|
|
1518
3892
|
declare function createRuntime(options: RuntimeOptions): CognideskRuntime;
|
|
1519
3893
|
|
|
@@ -1568,10 +3942,10 @@ declare const formWidget: WidgetDefinition<"form", z.ZodObject<{
|
|
|
1568
3942
|
description: z.ZodOptional<z.ZodString>;
|
|
1569
3943
|
type: z.ZodEnum<{
|
|
1570
3944
|
number: "number";
|
|
3945
|
+
email: "email";
|
|
1571
3946
|
date: "date";
|
|
1572
3947
|
text: "text";
|
|
1573
3948
|
choice: "choice";
|
|
1574
|
-
email: "email";
|
|
1575
3949
|
}>;
|
|
1576
3950
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
1577
3951
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -1645,10 +4019,10 @@ declare const builtInWidgets: {
|
|
|
1645
4019
|
description: z.ZodOptional<z.ZodString>;
|
|
1646
4020
|
type: z.ZodEnum<{
|
|
1647
4021
|
number: "number";
|
|
4022
|
+
email: "email";
|
|
1648
4023
|
date: "date";
|
|
1649
4024
|
text: "text";
|
|
1650
4025
|
choice: "choice";
|
|
1651
|
-
email: "email";
|
|
1652
4026
|
}>;
|
|
1653
4027
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
1654
4028
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -1685,4 +4059,70 @@ declare const builtInTools: {
|
|
|
1685
4059
|
}, z.core.$strip>, false>;
|
|
1686
4060
|
};
|
|
1687
4061
|
|
|
1688
|
-
|
|
4062
|
+
type ScheduleTrigger = {
|
|
4063
|
+
kind: "at";
|
|
4064
|
+
at: string | Date;
|
|
4065
|
+
} | {
|
|
4066
|
+
kind: "after";
|
|
4067
|
+
milliseconds: number;
|
|
4068
|
+
} | {
|
|
4069
|
+
kind: "cron";
|
|
4070
|
+
expression: string;
|
|
4071
|
+
timezone?: string;
|
|
4072
|
+
};
|
|
4073
|
+
interface ScheduledOperationIntent {
|
|
4074
|
+
operationAlias?: string;
|
|
4075
|
+
providerPackageId?: string;
|
|
4076
|
+
capability?: string;
|
|
4077
|
+
reason?: string;
|
|
4078
|
+
}
|
|
4079
|
+
interface ScheduleDefinition<TId extends string = string, TEvent extends JourneyEventDefinition = JourneyEventDefinition> {
|
|
4080
|
+
kind: "schedule";
|
|
4081
|
+
id: TId;
|
|
4082
|
+
trigger: ScheduleTrigger;
|
|
4083
|
+
event: TEvent;
|
|
4084
|
+
payload?: z.infer<TEvent["payload"]> | ((input: {
|
|
4085
|
+
now: Date;
|
|
4086
|
+
}) => z.infer<TEvent["payload"]>);
|
|
4087
|
+
intent?: ScheduledOperationIntent;
|
|
4088
|
+
metadata?: Record<string, unknown>;
|
|
4089
|
+
}
|
|
4090
|
+
interface ScheduledSupportAction {
|
|
4091
|
+
id: string;
|
|
4092
|
+
scheduleId: string;
|
|
4093
|
+
conversationId: string;
|
|
4094
|
+
dueAt: string;
|
|
4095
|
+
eventName: string;
|
|
4096
|
+
payload: unknown;
|
|
4097
|
+
intent?: ScheduledOperationIntent;
|
|
4098
|
+
metadata?: Record<string, unknown>;
|
|
4099
|
+
status: "scheduled" | "cancelled" | "delivered";
|
|
4100
|
+
}
|
|
4101
|
+
interface ScheduleAdapter {
|
|
4102
|
+
schedule(input: Omit<ScheduledSupportAction, "id" | "status"> & {
|
|
4103
|
+
id?: string;
|
|
4104
|
+
}): Promise<ScheduledSupportAction>;
|
|
4105
|
+
cancel(id: string): Promise<boolean>;
|
|
4106
|
+
list?(conversationId?: string): Promise<ScheduledSupportAction[]>;
|
|
4107
|
+
}
|
|
4108
|
+
interface InMemoryScheduleAdapterOptions {
|
|
4109
|
+
now?: () => Date;
|
|
4110
|
+
createId?: () => string;
|
|
4111
|
+
onDue?(action: ScheduledSupportAction): Promise<void> | void;
|
|
4112
|
+
}
|
|
4113
|
+
declare function defineSchedule<const TId extends string, TEvent extends JourneyEventDefinition>(id: TId, options: Omit<ScheduleDefinition<TId, TEvent>, "kind" | "id">): ScheduleDefinition<TId, TEvent>;
|
|
4114
|
+
declare function at(atDate: string | Date): ScheduleTrigger;
|
|
4115
|
+
declare function after(input: {
|
|
4116
|
+
milliseconds?: number;
|
|
4117
|
+
seconds?: number;
|
|
4118
|
+
minutes?: number;
|
|
4119
|
+
hours?: number;
|
|
4120
|
+
days?: number;
|
|
4121
|
+
}): ScheduleTrigger;
|
|
4122
|
+
declare function cron(expression: string, options?: {
|
|
4123
|
+
timezone?: string;
|
|
4124
|
+
}): ScheduleTrigger;
|
|
4125
|
+
declare function resolveScheduleDueAt(trigger: ScheduleTrigger, now?: Date): Date;
|
|
4126
|
+
declare function createInMemoryScheduleAdapter(options?: InMemoryScheduleAdapterOptions): ScheduleAdapter;
|
|
4127
|
+
|
|
4128
|
+
export { type ActionAudience, ActionAudienceSchema, type ActionDefinition, type ActivationMetadata, type AgentBehaviorOptions, AgentBuilder, type AgentChannelPolicyMap, type AgentChannelPolicyOptions, type AgentConfigurationOptions, type AgentHandoffPolicyOptions, type AgentLogLevel, type AgentModelAdapters, type AgentModelSet, type AgentOptions, type AgentPersonaOptions, type AgentPolicyValue, type AgentPostProcessingOptions, type AnyCustomRuntimeEvent, type AnyTool, type ApplicationContextParts, type ApprovalRequirement, type ApprovalResolutionMode, type BuildJourneyIndexOptions, type CandidateFilterPredicate, type CapabilityAvailability, type CapabilityAvailabilityInput, CapabilityAvailabilitySchema, type CapabilityAvailabilityStatus, CapabilityAvailabilityStatusSchema, CapabilityScope, type CapabilityUseDecision, type CapabilityUseRequest, type CapabilityUseRequestInput, CapabilityUseRequestSchema, type CategoryDataSourceDeclaration, type CategoryDataSourceDeclarationInput, CategoryDataSourceDeclarationSchema, type CategoryEventDeclaration, type CategoryEventDeclarationInput, CategoryEventDeclarationSchema, type CategoryEventDirection, CategoryEventDirectionSchema, type CategoryOperationCatalog, type CategoryOperationCatalogEntry, type CategoryOperationCatalogEntryInput, CategoryOperationCatalogEntrySchema, type CategoryOperationCatalogInput, CategoryOperationCatalogSchema, type CategoryOperationDeclaration, type CategoryOperationDeclarationInput, CategoryOperationDeclarationSchema, type CategoryOperationLevel, CategoryOperationLevelSchema, type CategoryOutputDeclaration, type CategoryOutputDeclarationInput, CategoryOutputDeclarationSchema, type ChannelAdapterVerificationResult, type ChannelAudience, ChannelAudienceSchema, type ChannelBehaviorPolicy, type ChannelBehaviorPolicyInput, ChannelBehaviorPolicySchema, type ChannelCapability, type ChannelCapabilityDeclaration, ChannelCapabilityDeclarationSchema, type ChannelCapabilityFlags, type ChannelCapabilityFlagsInput, ChannelCapabilityFlagsSchema, ChannelCapabilitySchema, type ChannelContext, type ChannelContextInput, ChannelContextSchema, type ChannelEvent, type ChannelEventActor, ChannelEventActorSchema, type ChannelEventActorType, ChannelEventActorTypeSchema, type ChannelEventBindingInput, type ChannelEventBindingOutcome, ChannelEventBindingOutcomeSchema, type ChannelEventBindingResult, type ChannelEventBindingStatus, ChannelEventBindingStatusSchema, type ChannelEventDirection, ChannelEventDirectionSchema, type ChannelEventEnvelope, type ChannelEventEnvelopeInput, ChannelEventEnvelopeInputSchema, type ChannelEventHandlingDisposition, type ChannelEventHandlingDispositionKind, ChannelEventHandlingDispositionKindSchema, type ChannelEventHandlingInput, type ChannelEventIdentity, ChannelEventIdentitySchema, type ChannelEventIntakeResult, type ChannelEventIntakeStatus, ChannelEventIntakeStatusSchema, type ChannelEventIntent, ChannelEventIntentSchema, type ChannelEventKind, type ChannelEventNature, ChannelEventNatureSchema, type ChannelEventRuntimeReceiver, type ChannelEventSource, type ChannelEventSourceBindInput, type ChannelEventSourceBinding, type ChannelEventSourceEvidence, ChannelEventSourceEvidenceSchema, type ChannelEventSourceHandleInput, type ChannelEventSourceNormalizeInput, type ChannelEventSourceType, ChannelEventSourceTypeSchema, type ChannelFlowActivation, type ChannelFlowActivationInput, ChannelFlowActivationSchema, type ChannelHandoffPolicy, type ChannelHandoffPolicyInput, ChannelHandoffPolicySchema, type ChannelOutboundPolicy, type ChannelOutboundPolicyInput, ChannelOutboundPolicySchema, type ChannelOutputDeliveryMode, ChannelOutputDeliveryModeSchema, type ChannelOutputIntent, type ChannelOutputIntentInput, ChannelOutputIntentInputSchema, type ChannelOutputIntentKind, ChannelOutputIntentKindSchema, type ChannelOutputIntentProducer, ChannelOutputIntentProducerSchema, type ChannelOutputPolicyReason, ChannelOutputPolicyReasonSchema, type ChannelOutputProducerType, ChannelOutputProducerTypeSchema, type ChannelOutputResolution, type ChannelOutputResolutionDecision, ChannelOutputResolutionDecisionInputSchema, type ChannelOutputResolutionOutcome, ChannelOutputResolutionOutcomeSchema, type ChannelOutputResolutionPayload, type ChannelOutputResolutionPolicyInput, type ChannelOutputResolutionStatus, ChannelOutputResolutionStatusSchema, type ChannelOutputResolverInput, type ChannelOutputResolverResult, type ChannelPolicyConfig, type ChannelPolicyConfigInput, ChannelPolicyConfigSchema, type ChannelProviderAdapter, type ChannelSetConfig, type ChannelSetConfigInput, ChannelSetConfigSchema, type ChannelSourceEvidence, CognideskRuntime, type CommitVoiceTranscriptInput, type CommitVoiceTranscriptReferenceInput, type CommitVoiceTranscriptResult, type CompactConversationInput, type CompactConversationResult, type CompiledActionRun, type CompiledAgent, type CompiledContextReusePolicy, type CompiledDelegation, type CompiledJourney, type CompiledJourneyEntry, type CompiledState, type CompiledToolRun, type CompiledTransition, type ConfirmationPolicy, type ContextPath, type ContextReusePolicy, type ContextReusePredicate, type ConversationChannel, type ConversationChannelInput, type ConversationChannelKind, ConversationChannelKindSchema, type ConversationCompactionSummary, type ConversationLifecycle, type ConversationRecord, type CoreChannelCapability, CoreChannelCapabilitySchema, type CoreChannelEventActor, type CoreChannelEventDirection, type CoreChannelEventIntent, type CoreChannelEventKind, type CoreChannelEventNature, type CoreChannelOutputIntentKind, type CoreConversationChannel, type CoreProviderCategory, type CreateConversationInput, type CreateRuntimeConversationInput, type CustomRuntimeEventDefinition, DefinitionError, DelegationJourneyBuilder, type DelegationJourneyOptions, type EmailAttachmentMetadata, type EmailAttachmentMetadataInput, type EmailQuoteTrimOptions, type EmailQuoteTrimResult, type EmailThreadContext, type EmailThreadContextMessage, type EmailThreadContextOptions, type EmailThreadMessageInput, type EmbeddingInput, type EmbeddingOutput, type EmitCustomEventInput, type EmitGeneratedPreambleInput, type EmitGeneratedPreambleResult, type EmitIntermediateMessageInput, type EmitJourneyEventInput, type EmitJourneyEventResult, type EmitScheduledEventInput, type EmitScheduledEventResult, type EventRoutingMode, type ExplainTurnInput, type ExplainTurnResult, type FieldCollectionOptions, type GuardContext, type GuardResult, type HandleChannelEventInput, type HandleChannelEventResult, type HandleUserMessageInput, type HandleUserMessageResult, type HandleVoiceUserMessageInput, type HandleVoiceUserMessageResult, type InMemoryScheduleAdapterOptions, type InferSchema, type IntegrationCategoryProfile, type IntegrationCategoryProfileInput, IntegrationCategoryProfileSchema, JOURNEY_INDEX_PROJECTION_VERSION, type JourneyActivationPredicate, type JourneyCandidate, type JourneyContextRecord, type JourneyEntryOptions, type JourneyEntryPredicate, type JourneyEventDefinition, type JourneyFragment, type JourneyFragmentOptions, type JourneyGraph, type JourneyGraphState, type JourneyGuardPredicate, type JourneyIndex, type JourneyIndexEmbedding, type JourneyIndexEntry, type JourneyIndexValidationResult, type JourneySummary, type KnowledgeItem, type KnowledgeSource, type ListCollectionOptions, type ListEventsOptions, type ListPendingSupportActionsInput, type MessageSegment, type ModelAdapter, type ModelMessage, type ModelPromptProfile, type ModelPromptProfileRender, type ModelPromptProfileRenderInput, type ModelRole, type ModelToolCall, type ModelToolDefinition, type ModelVisiblePromptPayload, type NormalizedChannelPayload, type NormalizedChannelPayloadInput, NormalizedChannelPayloadSchema, type ObjectSchema, type PendingSupportAction, type PrivacyHookContext, type PrivacyHooks, type PromptProfileRole, type PromptTask, type ProviderCapabilityCoverage, type ProviderCapabilityCoverageReport, ProviderCapabilityCoverageReportSchema, ProviderCapabilityCoverageSchema, type ProviderCategory, ProviderCategorySchema, type ProviderCoverage, type ProviderCoverageInput, ProviderCoverageSchema, type ProviderCoverageScope, ProviderCoverageScopeSchema, type ProviderCredentialRequirement, ProviderCredentialRequirementSchema, type ProviderCredentialState, ProviderCredentialStateSchema, type ProviderCredentialStatus, type ProviderCredentialStatusInput, ProviderCredentialStatusSchema, type ProviderDirection, ProviderDirectionSchema, type ProviderManifest, type ProviderManifestInput, ProviderManifestSchema, type ProviderObjectDescriptor, ProviderObjectDescriptorSchema, type ProviderOperationCoverageMismatch, ProviderOperationCoverageMismatchSchema, type ProviderOperationDeclaration, type ProviderOperationDeclarationInput, ProviderOperationDeclarationSchema, type ProviderReadiness, type ProviderReadinessInput, ProviderReadinessSchema, type ProviderRegistry, type ProviderRegistryQuery, type ProviderRegistryQueryInput, ProviderRegistryQuerySchema, type ProviderTrustLevel, ProviderTrustLevelSchema, type RecordVoiceInterruptionInput, type ReplayConversationInput, type ReplayConversationResult, type ReplayedMessage, type ReplayedPrompt, type RequestChannelHandoffInput, type RequestChannelHandoffReviewInput, type RequestHandoffInput, type RequestOutboundContactInput, type ResolveChannelOutputInput, type ResolveChannelOutputResult, type ResolvePendingSupportActionInput, type ResolvePendingSupportActionResult, type ResumeConversationInput, type RuntimeApprovalDecision, type RuntimeApprovalEvaluationInput, type RuntimeApprovalOutcome, type RuntimeConfigurationSource, type RuntimeContextOptions, type RuntimeContextResolveInput, type RuntimeEvent, type RuntimeEventBase, type RuntimeEventInput, type RuntimeEventTelemetry, type RuntimeLogContext, type RuntimeOptions, type RuntimeSnapshot, type RuntimeTelemetryOptions, type ScheduleAdapter, type ScheduleDefinition, type ScheduleTrigger, type ScheduledOperationIntent, type ScheduledSupportAction, type SdkLogLevel, type SdkLogger, type SelectJourneyCandidatesOptions, type SideEffectTool, type StartVoiceConversationInput, type StartVoiceResult, type StartVoiceSegmentInput, type StateActionUseOptions, StateBuilder, StateCollection, StateMachineJourneyBuilder, type StateMachineJourneyOptions, type StateReference, type StorageAdapter, type StructuredOutputPromptMetadata, type SubmitWidgetInput, type SupportReference, type TelemetryContentMode, type TelemetryContext, type TelemetryContextSpanOptions, type TelemetrySpanOptions, type TelemetrySpanRunner, type TextGenerationInput, type TextGenerationOutput, type ToolApprovalOptions, type ToolDefinition, type ToolExecutionContext, type ToolPolicyOptions, type ToolRunOptions, type ToolRunOptionsFor, type TransitionOptions, TypedStateRegistry, type UsageRecord, type ValidateJourneyIndexOptions, type VoiceChannelSegment, type VoiceConnection, type VoiceConnectionStatus, type VoiceIceServer, type VoiceModelSet, type VoiceProfile, type VoiceProfileOptions, type VoiceRecordingPolicy, type VoiceRuntimeEventInput, type VoiceSelection, type VoiceSocketMetadata, type VoiceSpeaker, type VoiceStartClientHints, type WidgetDefinition, type WidgetPromptDefinition, action, activeRuntimeEventTelemetry, addTelemetryContentEvent, after, at, buildJourneyIndex, builtInTools, builtInWidgets, capabilityAvailabilityStatuses, categoryEventDirections, categoryOperationLevels, channelAudiences, channelEventActorTypes, channelEventBindingOutcomes, channelEventBindingStatuses, channelEventDedupeKey, channelEventDirections, channelEventHandlingDispositionKinds, channelEventIntakeStatuses, channelEventSourceTypes, channelKindOf, channelOutputDeliveryModes, channelOutputProducerTypes, channelOutputResolutionOutcomes, channelOutputResolutionStatuses, checkProviderCapabilityCoverage, choiceWidget, collectEmailAttachmentMetadata, confirmationWidget, conversationCompactionSummarySchema, coreChannelCapabilities, coreChannelEventActors, coreChannelEventDirections, coreChannelEventIntents, coreChannelEventKinds, coreChannelEventNatures, coreChannelOutputIntentKinds, coreConversationChannels, coreProviderCategories, createAgent, createChannelEventInputFromSource, createEmailThreadContext, createInMemoryScheduleAdapter, createJourneyRoutingText, createMessageChannelEvent, createProviderRegistry, createRuntime, createRuntimeLogger, createScheduledChannelEvent, createTelemetryContext, cron, customRuntimeEvent, datePickerWidget, defaultChannelCapabilityFlags, defineCapabilityAvailability, defineChannelContext, defineChannelEvent, defineChannelEventSource, defineChannelOutputIntent, defineChannelOutputResolutionDecision, defineChannelPolicy, defineChannelProviderAdapter, defineIntegrationCategoryProfile, defineProviderPackage, defineSchedule, deriveProviderCapabilityCoverage, endConversationTool, evaluateCapabilityUse, formWidget, handleChannelEventFromSource, handoffTool, hashAgentRoutingDefinition, hashJourneyDefinition, isCoreChannelCapability, journeyContextViewerTool, journeyEvent, journeyFragment, journeyIndexEmbeddingSchema, journeyIndexEntrySchema, journeyIndexSchema, knowledgeSource, normalizeEmailAttachmentMetadata, providerCapabilityCoverageLevels, providerCredentialStatuses, providerDirections, providerTrustLevels, recordRuntimeEventMetric, resolveScheduleDueAt, runtimeLogger, selectJourneyCandidates, telemetryAttributes, telemetryContentMode, telemetryEnabled, telemetryEventNames, telemetrySpanNames, textInputWidget, tool, trimEmailQuote, validateJourneyIndex, widget, widgetPrompt, withTelemetrySpan };
|