@stacklink/sdk 0.2.2 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +50 -1
  2. package/compatibility.json +3 -1
  3. package/dist/src/domain/bot-contract.d.ts +4336 -0
  4. package/dist/src/domain/bot-contract.d.ts.map +1 -0
  5. package/dist/src/domain/bot-contract.js +382 -0
  6. package/dist/src/domain/bot-contract.js.map +1 -0
  7. package/dist/src/domain/memory-contract.d.ts +452 -452
  8. package/dist/src/domain/memory-contract.js +1 -1
  9. package/dist/src/domain/memory-contract.js.map +1 -1
  10. package/dist/src/domain/platform-approval-contract.d.ts +508 -0
  11. package/dist/src/domain/platform-approval-contract.d.ts.map +1 -0
  12. package/dist/src/domain/platform-approval-contract.js +77 -0
  13. package/dist/src/domain/platform-approval-contract.js.map +1 -0
  14. package/dist/src/domain/provider-branding.d.ts.map +1 -1
  15. package/dist/src/domain/provider-branding.js +17 -0
  16. package/dist/src/domain/provider-branding.js.map +1 -1
  17. package/dist/src/domain/stacklink-meta-tools.d.ts +2 -2
  18. package/dist/src/domain/stacklink-meta-tools.d.ts.map +1 -1
  19. package/dist/src/domain/stacklink-meta-tools.js +15 -4
  20. package/dist/src/domain/stacklink-meta-tools.js.map +1 -1
  21. package/dist/src/sdk/framework-tools.d.ts +21 -0
  22. package/dist/src/sdk/framework-tools.d.ts.map +1 -1
  23. package/dist/src/sdk/framework-tools.js +49 -0
  24. package/dist/src/sdk/framework-tools.js.map +1 -1
  25. package/dist/src/sdk/index.d.ts +225 -6
  26. package/dist/src/sdk/index.d.ts.map +1 -1
  27. package/dist/src/sdk/index.js +215 -21
  28. package/dist/src/sdk/index.js.map +1 -1
  29. package/dist/src/sdk/vercel-ai.d.ts +4 -0
  30. package/dist/src/sdk/vercel-ai.d.ts.map +1 -1
  31. package/dist/src/sdk/vercel-ai.js +13 -4
  32. package/dist/src/sdk/vercel-ai.js.map +1 -1
  33. package/dist/src/sdk/x-chat.d.ts +143 -0
  34. package/dist/src/sdk/x-chat.d.ts.map +1 -0
  35. package/dist/src/sdk/x-chat.js +160 -0
  36. package/dist/src/sdk/x-chat.js.map +1 -0
  37. package/package.json +15 -3
@@ -0,0 +1,4336 @@
1
+ import { z } from "zod";
2
+ import { type ApprovalAudience } from "./platform-approval-contract.js";
3
+ /** Shared, versioned contract for Bots across the dashboard, API and SDK. */
4
+ /** What the list shows. Working and Needs attention are derived, never set by a person. */
5
+ export type BotStatus = "working" | "on" | "attention" | "paused" | "draft";
6
+ /** The only two states an owner can set. */
7
+ export type BotRunState = "on" | "paused";
8
+ export declare const botTerminalStatuses: Set<string>;
9
+ export type PauseFor = "1h" | "tomorrow" | "manual";
10
+ export type ModelEffort = "low" | "medium" | "high";
11
+ export type AnswerFormat = "text" | "json";
12
+ export type AnswerDelivery = "stream" | "once" | "webhook";
13
+ export type SkillLoad = "auto" | "always";
14
+ /** Allow, Ask first, Block. Used by apps, MCP tool groups and Workbench. */
15
+ export type ActionRule = "allow" | "ask" | "block";
16
+ export type AppKey = string;
17
+ export type BotListItem = {
18
+ id: string;
19
+ name: string;
20
+ description: string;
21
+ status: BotStatus;
22
+ statusLine: string;
23
+ modelId: string;
24
+ reads: {
25
+ yourApi: boolean;
26
+ apps: AppKey[];
27
+ mcp?: boolean;
28
+ knowledge?: boolean;
29
+ };
30
+ runsNow?: number;
31
+ editedAt?: string;
32
+ pauseAuthor?: string | null;
33
+ runsToday: number | null;
34
+ /** Display label, like "now", "1 h ago", "Edited yesterday". */
35
+ lastRun: string;
36
+ };
37
+ export type BotsListResponse = {
38
+ summary: {
39
+ runsInProgress: number;
40
+ botsOn: number;
41
+ botsTotal: number;
42
+ needsAttention: number;
43
+ };
44
+ bots: BotListItem[];
45
+ };
46
+ export type SkillIcon = "refund" | "link" | "person" | "voice" | "mail" | "term" | "box" | "pencil";
47
+ export type SkillCase = {
48
+ text: string;
49
+ };
50
+ export type SkillCondition = {
51
+ field: string;
52
+ check: "is one of" | "is" | "is not";
53
+ values: string;
54
+ };
55
+ export type BotSkill = {
56
+ instructions: string;
57
+ files: {
58
+ name: string;
59
+ content: string;
60
+ }[];
61
+ id: string;
62
+ name: string;
63
+ /** Short line under the name in the rail, like "Loads when someone asks about refunds". */
64
+ summary: string;
65
+ icon: SkillIcon;
66
+ load: SkillLoad;
67
+ cases: SkillCase[];
68
+ exceptions: SkillCase[];
69
+ examples: {
70
+ use: string[];
71
+ notFor: string[];
72
+ };
73
+ onlyIf: SkillCondition[];
74
+ };
75
+ export type ProjectSkill = {
76
+ id: string;
77
+ name: string;
78
+ source: "Project" | "Stacklink";
79
+ description: string;
80
+ icon: SkillIcon;
81
+ };
82
+ export type MemoryWho = "customer" | "company" | "bot";
83
+ export type BotMemory = {
84
+ enabled: boolean;
85
+ /** False until the Memory dialog is saved once. The rail shows a switch until then. */
86
+ configured: boolean;
87
+ who: Record<MemoryWho, boolean>;
88
+ what: string;
89
+ never: string[];
90
+ forgetAfter: "1 year" | "6 months" | "90 days" | "Never";
91
+ };
92
+ export type WorkbenchSize = "small" | "medium" | "large";
93
+ export type BotWorkbench = {
94
+ enabled: boolean;
95
+ configured: boolean;
96
+ size: WorkbenchSize;
97
+ access: ActionRule;
98
+ languages: string[];
99
+ files: "per_customer" | "per_run";
100
+ longestRun: "1 minute" | "3 minutes" | "10 minutes";
101
+ };
102
+ export type ApiKind = "http" | "graphql" | "openapi";
103
+ export type ApiAuth = "one" | "each" | "oauth" | "none";
104
+ export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
105
+ export type ApiBodyType = "json" | "form" | "xml" | "gql";
106
+ export type ApiReadAs = "auto" | "json" | "xml" | "text";
107
+ export type ApiCall = {
108
+ id: string;
109
+ name: string;
110
+ method: HttpMethod;
111
+ path: string;
112
+ bodyType: ApiBodyType;
113
+ readAs: ApiReadAs;
114
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
115
+ /** Shown under the call in the rail, like "Plan, orders and tickets". */
116
+ summary: string;
117
+ latencyMs: number | null;
118
+ /** Response fields the bot may see. */
119
+ visibleFields: string[];
120
+ effects: "read" | "write" | "unclassified";
121
+ /** A bot may tighten the caller's policy, never loosen it. */
122
+ permission?: ActionRule | undefined;
123
+ /** Arguments supplied by the model, separate from trusted identity bindings. */
124
+ inputSchema?: Record<string, unknown> | undefined;
125
+ headers: Record<string, string>;
126
+ query: Record<string, string>;
127
+ body: string;
128
+ bindings: BotBinding[];
129
+ responseSchema?: Record<string, unknown> | undefined;
130
+ sample?: unknown;
131
+ };
132
+ export type ContextApi = {
133
+ id: string;
134
+ name: string;
135
+ host: string;
136
+ baseUrl: string;
137
+ kind: ApiKind;
138
+ auth: ApiAuth;
139
+ sendCustomerIdentity: boolean;
140
+ credentialId?: string | undefined;
141
+ authHeader?: string | undefined;
142
+ calls: ApiCall[];
143
+ };
144
+ export type SavedBotApi = ContextApi & {
145
+ revision: number;
146
+ usedBy: Array<{
147
+ botId: string;
148
+ name: string;
149
+ draft: boolean;
150
+ published: boolean;
151
+ }>;
152
+ };
153
+ export declare const botApiSigningKeyRequestSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
154
+ action: z.ZodLiteral<"read">;
155
+ }, "strict", z.ZodTypeAny, {
156
+ action: "read";
157
+ }, {
158
+ action: "read";
159
+ }>, z.ZodObject<{
160
+ action: z.ZodLiteral<"prepare">;
161
+ overlapSeconds: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<3600>, z.ZodLiteral<86400>]>>;
162
+ }, "strict", z.ZodTypeAny, {
163
+ action: "prepare";
164
+ overlapSeconds: 0 | 3600 | 86400;
165
+ }, {
166
+ action: "prepare";
167
+ overlapSeconds?: 0 | 3600 | 86400 | undefined;
168
+ }>, z.ZodObject<{
169
+ action: z.ZodLiteral<"activate">;
170
+ keyId: z.ZodString;
171
+ }, "strict", z.ZodTypeAny, {
172
+ action: "activate";
173
+ keyId: string;
174
+ }, {
175
+ action: "activate";
176
+ keyId: string;
177
+ }>, z.ZodObject<{
178
+ action: z.ZodLiteral<"cancel">;
179
+ keyId: z.ZodString;
180
+ }, "strict", z.ZodTypeAny, {
181
+ action: "cancel";
182
+ keyId: string;
183
+ }, {
184
+ action: "cancel";
185
+ keyId: string;
186
+ }>]>;
187
+ export type BotApiSigningKeyRequest = z.input<typeof botApiSigningKeyRequestSchema>;
188
+ export type BotApiSigningKey = {
189
+ keyId: string;
190
+ signingSecret: string;
191
+ previousValidUntil: string | null;
192
+ pending: {
193
+ keyId: string;
194
+ signingSecret: string;
195
+ overlapSeconds: number;
196
+ } | null;
197
+ verificationKeys: Array<{
198
+ keyId: string;
199
+ secret: string;
200
+ validUntil: string | null;
201
+ }>;
202
+ };
203
+ /** Versioned byte contract shared by the signer and SDK receiver verification. */
204
+ export declare function botApiSignaturePayload(input: {
205
+ method: string;
206
+ url: string;
207
+ requestId: string;
208
+ timestamp: string;
209
+ keyId: string;
210
+ projectId: string;
211
+ tenantId: string;
212
+ userId: string;
213
+ bodySha256: string;
214
+ }): string;
215
+ export type ContextApp = {
216
+ key: AppKey;
217
+ account: "project" | "customer";
218
+ accountId?: string | undefined;
219
+ rules: {
220
+ read: ActionRule;
221
+ change: ActionRule;
222
+ delete: ActionRule;
223
+ };
224
+ actionRules: Record<string, ActionRule>;
225
+ askWho?: Record<string, ApprovalAudience> | undefined;
226
+ pinned: string[];
227
+ };
228
+ export type McpToolGroup = {
229
+ name: "Read" | "Change" | "Delete";
230
+ count: number;
231
+ rule: ActionRule;
232
+ tools: string[];
233
+ };
234
+ export type ContextMcp = {
235
+ id: string;
236
+ name: string;
237
+ url: string;
238
+ status: "connecting" | "connected";
239
+ credentialId?: string | undefined;
240
+ toolCount: number;
241
+ definitions: Array<{
242
+ name: string;
243
+ description: string;
244
+ inputSchema: Record<string, unknown>;
245
+ outputSchema?: Record<string, unknown> | undefined;
246
+ }>;
247
+ groups: McpToolGroup[];
248
+ };
249
+ export type KnowledgeSource = {
250
+ id: string;
251
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
252
+ scope?: "project" | "customer" | undefined;
253
+ connectedSource?: {
254
+ accountId: string;
255
+ resourceId: string;
256
+ } | undefined;
257
+ name: string;
258
+ detail: string;
259
+ status: "ready" | "syncing" | "failed";
260
+ error?: string | undefined;
261
+ url?: string | undefined;
262
+ pages?: {
263
+ done: number;
264
+ total: number;
265
+ } | undefined;
266
+ progress?: {
267
+ stage: string;
268
+ done: number;
269
+ total: number;
270
+ retryable: boolean;
271
+ } | undefined;
272
+ syncedLabel: string;
273
+ };
274
+ export type WebSearchProvider = "builtin" | "exa" | "firecrawl";
275
+ export type BotContext = {
276
+ readPages?: boolean;
277
+ searchPastChats?: boolean;
278
+ /** Days after the last admitted message; applies even when Memory is off. */
279
+ conversationRetentionDays?: number;
280
+ apis: ContextApi[];
281
+ apps: ContextApp[];
282
+ mcpServers: ContextMcp[];
283
+ knowledge: KnowledgeSource[];
284
+ webSearch: {
285
+ enabled: boolean;
286
+ provider: WebSearchProvider;
287
+ preferSites: string[];
288
+ };
289
+ };
290
+ export type VariableType = "Text" | "Number" | "Yes or no" | "One of…";
291
+ export type VariableUse = "instructions" | "api" | "run_plan";
292
+ export type BotVariable = {
293
+ name: string;
294
+ type: VariableType;
295
+ required: boolean;
296
+ defaultValue: string;
297
+ values?: string[] | undefined;
298
+ usedIn: VariableUse[];
299
+ /** Chip text in the rail, like "fills Acme API · optional". */
300
+ chipNote: string;
301
+ /** Line on the Use it page, like "Sent to Acme API as ?order= when present." */
302
+ description: string;
303
+ };
304
+ export type ShapeFieldType = "text" | "number" | "bool" | "enum" | "list" | "group" | "date";
305
+ export type ShapeField = {
306
+ id: string;
307
+ name: string;
308
+ type: ShapeFieldType;
309
+ required: boolean;
310
+ description: string;
311
+ level: number;
312
+ items?: Record<string, unknown> | undefined;
313
+ values?: string[] | undefined;
314
+ };
315
+ export type BotAnswer = {
316
+ format: AnswerFormat;
317
+ delivery: AnswerDelivery;
318
+ webhookUrl: string;
319
+ shape: ShapeField[];
320
+ schema?: Record<string, unknown> | undefined;
321
+ };
322
+ /** Step ids come from the run plan catalog (Get customer, Recall this customer, …). */
323
+ export type BotPreparation = {
324
+ id: string;
325
+ kind: 'app' | 'mcp' | 'workbench';
326
+ capabilityId: string;
327
+ toolKey: string;
328
+ name: string;
329
+ input: Record<string, unknown>;
330
+ bindings: Array<{
331
+ source: 'variable' | 'context' | 'message';
332
+ path: string[];
333
+ target: string[];
334
+ }>;
335
+ };
336
+ export type RunPlan = {
337
+ preparations?: BotPreparation[];
338
+ before: string[];
339
+ after: string[];
340
+ /** Model-side steps the model may not use. */
341
+ off: string[];
342
+ /** Before-steps that stop the run when they fail (default: answer without it). */
343
+ stopOnFail: string[];
344
+ /** Older drafts may contain null; acceptance normalizes it to 100. */
345
+ stepLimit: number | null;
346
+ };
347
+ export type TestCustomer = {
348
+ id: string;
349
+ initials: string;
350
+ name: string;
351
+ summary: string;
352
+ customerId: string | null;
353
+ };
354
+ export type TestDataMode = "sample" | "live";
355
+ export type TestStepKind = "api" | "app" | "skill" | "memory" | "web" | "knowledge" | "mcp" | "workbench";
356
+ export type TestStep = {
357
+ id?: string;
358
+ status?: 'pending' | 'running' | 'waiting' | 'completed' | 'failed' | 'skipped';
359
+ kind: TestStepKind;
360
+ label: string;
361
+ detail: string;
362
+ durationMs: number;
363
+ app?: AppKey;
364
+ };
365
+ export type BotTest = {
366
+ id: string;
367
+ platformSessionId?: string | null;
368
+ revision?: number;
369
+ message: string;
370
+ customerName: string;
371
+ customerId: string | null;
372
+ steps: TestStep[];
373
+ status?: string;
374
+ error?: unknown;
375
+ dataMode?: TestDataMode;
376
+ answer: {
377
+ /** e.g. "Matches your 4 fields" or "Answered". */
378
+ verdict: string;
379
+ durationMs: number;
380
+ costUsd: number | null;
381
+ modelLabel: string;
382
+ json?: Record<string, unknown>;
383
+ text?: string;
384
+ };
385
+ createdAt: string;
386
+ };
387
+ /** Setup changes shown between tests in the thread. */
388
+ export type BotActivity = {
389
+ id: string;
390
+ kind: "context" | "skill" | "model";
391
+ /** Rendered as: {before} <b>{strong}</b>{after} */
392
+ before: string;
393
+ strong: string;
394
+ after: string;
395
+ ago: string | null;
396
+ modelId?: string;
397
+ /** Shown before the test at this index (tests.length = after the last test). */
398
+ beforeTest: number;
399
+ };
400
+ export type Bot = {
401
+ workbenchSuggestion?: {
402
+ size: WorkbenchSize;
403
+ reason: string;
404
+ };
405
+ readiness: BotReadinessIssue[];
406
+ triggers: BotTrigger[];
407
+ triggerStates: BotTriggerState[];
408
+ revision: number;
409
+ channels: PublishChannels;
410
+ publishedRevision: number | null;
411
+ id: string;
412
+ projectId: string;
413
+ name: string;
414
+ publishedAt: string | null;
415
+ publishedConfiguration?: BotConfiguration | null;
416
+ runState: BotRunState;
417
+ pause: {
418
+ reason: string;
419
+ expiresAt: string | null;
420
+ } | null;
421
+ savedAt: string | null;
422
+ live: {
423
+ runsNow: number;
424
+ runsToday: number;
425
+ } | null;
426
+ model: {
427
+ id: string;
428
+ effort: ModelEffort;
429
+ };
430
+ instructions: {
431
+ text: string;
432
+ editedAt: string | null;
433
+ };
434
+ skills: BotSkill[];
435
+ memory: BotMemory;
436
+ workbench: BotWorkbench;
437
+ context: BotContext;
438
+ variables: BotVariable[];
439
+ answer: BotAnswer;
440
+ runPlan: RunPlan;
441
+ testing: {
442
+ customers: TestCustomer[];
443
+ customerId: string;
444
+ dataMode: TestDataMode;
445
+ };
446
+ tests: BotTest[];
447
+ activity: BotActivity[];
448
+ };
449
+ export type BotReadinessIssue = {
450
+ id: string;
451
+ tab: 'behaviour' | 'context';
452
+ target: string;
453
+ chip: string;
454
+ badge: string;
455
+ tone: 'bad' | 'warn' | 'wait';
456
+ code: string;
457
+ message: string;
458
+ };
459
+ /** Partial update. Nested objects replace the stored value for that key. */
460
+ export type BotConfiguration = Pick<Bot, "name" | "model" | "instructions" | "skills" | "memory" | "workbench" | "context" | "variables" | "answer" | "runPlan" | "triggers">;
461
+ export type BotPatch = Partial<BotConfiguration>;
462
+ export declare const botTriggerSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
463
+ kind: z.ZodLiteral<"app">;
464
+ subscriptionId: z.ZodString;
465
+ label: z.ZodString;
466
+ providerKey: z.ZodString;
467
+ eventTypes: z.ZodArray<z.ZodString, "many">;
468
+ runsAs: z.ZodEnum<["none", "field"]>;
469
+ customerField: z.ZodString;
470
+ id: z.ZodString;
471
+ name: z.ZodString;
472
+ instruction: z.ZodString;
473
+ enabled: z.ZodBoolean;
474
+ answerTo: z.ZodEnum<["webhook", "none"]>;
475
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
476
+ }, "strict", z.ZodTypeAny, {
477
+ kind: "app";
478
+ id: string;
479
+ enabled: boolean;
480
+ name: string;
481
+ subscriptionId: string;
482
+ label: string;
483
+ providerKey: string;
484
+ eventTypes: string[];
485
+ runsAs: "none" | "field";
486
+ customerField: string;
487
+ instruction: string;
488
+ answerTo: "webhook" | "none";
489
+ variables: Record<string, unknown>;
490
+ }, {
491
+ kind: "app";
492
+ id: string;
493
+ enabled: boolean;
494
+ name: string;
495
+ subscriptionId: string;
496
+ label: string;
497
+ providerKey: string;
498
+ eventTypes: string[];
499
+ runsAs: "none" | "field";
500
+ customerField: string;
501
+ instruction: string;
502
+ answerTo: "webhook" | "none";
503
+ variables?: Record<string, unknown> | undefined;
504
+ }>, z.ZodObject<{
505
+ kind: z.ZodLiteral<"webhook">;
506
+ tenantId: z.ZodString;
507
+ runsAs: z.ZodEnum<["none", "field"]>;
508
+ customerField: z.ZodString;
509
+ id: z.ZodString;
510
+ name: z.ZodString;
511
+ instruction: z.ZodString;
512
+ enabled: z.ZodBoolean;
513
+ answerTo: z.ZodEnum<["webhook", "none"]>;
514
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
515
+ }, "strict", z.ZodTypeAny, {
516
+ kind: "webhook";
517
+ id: string;
518
+ tenantId: string;
519
+ enabled: boolean;
520
+ name: string;
521
+ runsAs: "none" | "field";
522
+ customerField: string;
523
+ instruction: string;
524
+ answerTo: "webhook" | "none";
525
+ variables: Record<string, unknown>;
526
+ }, {
527
+ kind: "webhook";
528
+ id: string;
529
+ tenantId: string;
530
+ enabled: boolean;
531
+ name: string;
532
+ runsAs: "none" | "field";
533
+ customerField: string;
534
+ instruction: string;
535
+ answerTo: "webhook" | "none";
536
+ variables?: Record<string, unknown> | undefined;
537
+ }>, z.ZodObject<{
538
+ kind: z.ZodLiteral<"schedule">;
539
+ tenantId: z.ZodString;
540
+ repeat: z.ZodEnum<["repeat", "once"]>;
541
+ every: z.ZodEnum<["week", "day", "hour"]>;
542
+ days: z.ZodArray<z.ZodNumber, "many">;
543
+ time: z.ZodString;
544
+ date: z.ZodString;
545
+ timezone: z.ZodString;
546
+ runsAs: z.ZodEnum<["none", "one"]>;
547
+ customerId: z.ZodString;
548
+ id: z.ZodString;
549
+ name: z.ZodString;
550
+ instruction: z.ZodString;
551
+ enabled: z.ZodBoolean;
552
+ answerTo: z.ZodEnum<["webhook", "none"]>;
553
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
554
+ }, "strict", z.ZodTypeAny, {
555
+ every: "week" | "day" | "hour";
556
+ kind: "schedule";
557
+ date: string;
558
+ id: string;
559
+ tenantId: string;
560
+ enabled: boolean;
561
+ name: string;
562
+ runsAs: "one" | "none";
563
+ instruction: string;
564
+ answerTo: "webhook" | "none";
565
+ variables: Record<string, unknown>;
566
+ repeat: "once" | "repeat";
567
+ days: number[];
568
+ time: string;
569
+ timezone: string;
570
+ customerId: string;
571
+ }, {
572
+ every: "week" | "day" | "hour";
573
+ kind: "schedule";
574
+ date: string;
575
+ id: string;
576
+ tenantId: string;
577
+ enabled: boolean;
578
+ name: string;
579
+ runsAs: "one" | "none";
580
+ instruction: string;
581
+ answerTo: "webhook" | "none";
582
+ repeat: "once" | "repeat";
583
+ days: number[];
584
+ time: string;
585
+ timezone: string;
586
+ customerId: string;
587
+ variables?: Record<string, unknown> | undefined;
588
+ }>]>;
589
+ export type BotTrigger = z.infer<typeof botTriggerSchema>;
590
+ export type BotTriggerState = {
591
+ id: string;
592
+ nextRunAt: string | null;
593
+ lastRunId: string | null;
594
+ lastError: string | null;
595
+ webhookUrl: string | null;
596
+ };
597
+ export type ModelOption = {
598
+ id: string;
599
+ name: string;
600
+ provider: string;
601
+ line: string;
602
+ price: string;
603
+ auto?: boolean;
604
+ logo?: string;
605
+ mono?: string;
606
+ bg?: string;
607
+ more?: boolean;
608
+ efforts?: ModelEffort[];
609
+ };
610
+ export type CatalogApp = {
611
+ key: AppKey;
612
+ name: string;
613
+ description: string;
614
+ logo?: string;
615
+ mono?: string;
616
+ bg?: string;
617
+ connected: boolean;
618
+ actionCount: number;
619
+ split: [number, number, number] | null;
620
+ pins: string[];
621
+ actions: [string[], string[], string[]];
622
+ };
623
+ export type PublishChannels = {
624
+ app: boolean;
625
+ mcp: boolean;
626
+ team: boolean;
627
+ };
628
+ export type PublishCheck = {
629
+ name: string;
630
+ result: string;
631
+ };
632
+ export type PublishResult = {
633
+ botId: string;
634
+ publishedAt: string;
635
+ checks: PublishCheck[];
636
+ };
637
+ export type WebhookCheck = {
638
+ ok: true;
639
+ status: number;
640
+ ms: number;
641
+ } | {
642
+ ok: false;
643
+ reason: string;
644
+ status?: number;
645
+ ms?: number;
646
+ };
647
+ export type ApiTestResult = {
648
+ status: number;
649
+ ms: number;
650
+ responseType: string;
651
+ detected: string;
652
+ request: {
653
+ method: HttpMethod;
654
+ url: string;
655
+ contentType: string;
656
+ identity: boolean;
657
+ };
658
+ body: string;
659
+ };
660
+ export type KnowledgeHit = {
661
+ from: string;
662
+ before: string;
663
+ mark: string;
664
+ after: string;
665
+ };
666
+ export type FirstCall = {
667
+ status: number;
668
+ seconds: number;
669
+ message: string;
670
+ words: number;
671
+ };
672
+ export type BotBinding = {
673
+ source: "identity" | "variable" | "context" | "model";
674
+ path: string[];
675
+ target: "path" | "query" | "header" | "body";
676
+ key: string;
677
+ };
678
+ export type BotRunInput = {
679
+ runId?: string;
680
+ conversationId?: string;
681
+ message: string;
682
+ variables?: Record<string, unknown>;
683
+ revision?: number;
684
+ dataMode?: TestDataMode;
685
+ customerSessionId?: string;
686
+ };
687
+ export type BotRun = {
688
+ channel: string;
689
+ dataMode: TestDataMode;
690
+ callerKey: string;
691
+ id: string;
692
+ botId: string;
693
+ conversationId: string;
694
+ status: string;
695
+ message: string;
696
+ finalText: string | null;
697
+ output: unknown;
698
+ error: unknown;
699
+ usage: unknown;
700
+ model: {
701
+ id: string;
702
+ provider: string;
703
+ };
704
+ createdAt: string;
705
+ completedAt: string | null;
706
+ platformSessionId: string | null;
707
+ waitingOperation: unknown;
708
+ /** Server projection of the accepted snapshot and durable execution records. */
709
+ display?: BotRunDisplay;
710
+ };
711
+ export type BotPlanCapability = {
712
+ id: string;
713
+ kind: 'api' | 'app' | 'mcp' | 'skill' | 'memory' | 'web' | 'knowledge' | 'workbench';
714
+ name: string;
715
+ lane: 'before' | 'during' | 'after';
716
+ skipped: 'disabled' | 'sample' | null;
717
+ };
718
+ export type BotDelivery = {
719
+ id: string;
720
+ status: string;
721
+ attemptCount: number;
722
+ maxAttempts: number;
723
+ nextAttemptAt: string | null;
724
+ failureReason: string | null;
725
+ processedAt: string | null;
726
+ };
727
+ export type BotRunDisplay = {
728
+ turnNumber: number;
729
+ trigger: {
730
+ id: string;
731
+ kind: BotTrigger['kind'];
732
+ } | null;
733
+ waitingLabel: string | null;
734
+ customer: {
735
+ tenant: string;
736
+ user: string | null;
737
+ label: string;
738
+ } | null;
739
+ modelLabel: string;
740
+ revision: number;
741
+ startedAt: string | null;
742
+ stepLimit: number | null;
743
+ modelSteps: number;
744
+ plan: BotPlanCapability[];
745
+ steps: TestStep[];
746
+ followups: {
747
+ status: 'not_required' | 'pending' | 'running' | 'waiting' | 'completed' | 'failed';
748
+ settled: boolean;
749
+ };
750
+ delivery: {
751
+ expected: boolean;
752
+ settled: boolean;
753
+ url: string | null;
754
+ items: BotDelivery[];
755
+ };
756
+ pricing: {
757
+ status: 'pending';
758
+ modelCostUsd: number | null;
759
+ };
760
+ };
761
+ export type DraftedSkill = {
762
+ name: string;
763
+ useWhen: string;
764
+ steps: string;
765
+ check: null;
766
+ };
767
+ export type UploadedSkill = {
768
+ checks: Array<{
769
+ kind: 'entry_point' | 'package_limits' | 'metadata' | 'private_key_blocks';
770
+ passed: boolean;
771
+ }>;
772
+ name: string;
773
+ useWhen: string;
774
+ fileName: string;
775
+ steps: string;
776
+ files: Array<{
777
+ name: string;
778
+ content: string;
779
+ meta: string;
780
+ kind: 'doc' | 'script';
781
+ }>;
782
+ needsWorkbench: boolean;
783
+ };
784
+ export declare const botBindingSchema: z.ZodObject<{
785
+ source: z.ZodEnum<["identity", "variable", "context", "model"]>;
786
+ path: z.ZodArray<z.ZodString, "many">;
787
+ target: z.ZodEnum<["path", "query", "header", "body"]>;
788
+ key: z.ZodString;
789
+ }, "strict", z.ZodTypeAny, {
790
+ path: string[];
791
+ source: "variable" | "context" | "model" | "identity";
792
+ target: "path" | "query" | "header" | "body";
793
+ key: string;
794
+ }, {
795
+ path: string[];
796
+ source: "variable" | "context" | "model" | "identity";
797
+ target: "path" | "query" | "header" | "body";
798
+ key: string;
799
+ }>;
800
+ export declare const botApiCallSchema: z.ZodObject<{
801
+ id: z.ZodString;
802
+ name: z.ZodString;
803
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
804
+ path: z.ZodString;
805
+ bodyType: z.ZodEnum<["json", "form", "xml", "gql"]>;
806
+ readAs: z.ZodEnum<["auto", "json", "xml", "text"]>;
807
+ timeout: z.ZodEnum<["2 seconds", "5 seconds", "10 seconds"]>;
808
+ summary: z.ZodString;
809
+ latencyMs: z.ZodNullable<z.ZodNumber>;
810
+ visibleFields: z.ZodArray<z.ZodString, "many">;
811
+ effects: z.ZodEnum<["read", "write", "unclassified"]>;
812
+ permission: z.ZodDefault<z.ZodEnum<["allow", "ask", "block"]>>;
813
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
814
+ headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
815
+ query: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
816
+ body: z.ZodDefault<z.ZodString>;
817
+ bindings: z.ZodDefault<z.ZodArray<z.ZodObject<{
818
+ source: z.ZodEnum<["identity", "variable", "context", "model"]>;
819
+ path: z.ZodArray<z.ZodString, "many">;
820
+ target: z.ZodEnum<["path", "query", "header", "body"]>;
821
+ key: z.ZodString;
822
+ }, "strict", z.ZodTypeAny, {
823
+ path: string[];
824
+ source: "variable" | "context" | "model" | "identity";
825
+ target: "path" | "query" | "header" | "body";
826
+ key: string;
827
+ }, {
828
+ path: string[];
829
+ source: "variable" | "context" | "model" | "identity";
830
+ target: "path" | "query" | "header" | "body";
831
+ key: string;
832
+ }>, "many">>;
833
+ responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
834
+ sample: z.ZodOptional<z.ZodUnknown>;
835
+ }, "strict", z.ZodTypeAny, {
836
+ path: string;
837
+ id: string;
838
+ name: string;
839
+ query: Record<string, string>;
840
+ body: string;
841
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
842
+ bodyType: "json" | "form" | "xml" | "gql";
843
+ readAs: "text" | "json" | "auto" | "xml";
844
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
845
+ summary: string;
846
+ latencyMs: number | null;
847
+ visibleFields: string[];
848
+ effects: "read" | "write" | "unclassified";
849
+ permission: "allow" | "ask" | "block";
850
+ headers: Record<string, string>;
851
+ bindings: {
852
+ path: string[];
853
+ source: "variable" | "context" | "model" | "identity";
854
+ target: "path" | "query" | "header" | "body";
855
+ key: string;
856
+ }[];
857
+ sample?: unknown;
858
+ inputSchema?: Record<string, unknown> | undefined;
859
+ responseSchema?: Record<string, unknown> | undefined;
860
+ }, {
861
+ path: string;
862
+ id: string;
863
+ name: string;
864
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
865
+ bodyType: "json" | "form" | "xml" | "gql";
866
+ readAs: "text" | "json" | "auto" | "xml";
867
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
868
+ summary: string;
869
+ latencyMs: number | null;
870
+ visibleFields: string[];
871
+ effects: "read" | "write" | "unclassified";
872
+ sample?: unknown;
873
+ query?: Record<string, string> | undefined;
874
+ body?: string | undefined;
875
+ permission?: "allow" | "ask" | "block" | undefined;
876
+ inputSchema?: Record<string, unknown> | undefined;
877
+ headers?: Record<string, string> | undefined;
878
+ bindings?: {
879
+ path: string[];
880
+ source: "variable" | "context" | "model" | "identity";
881
+ target: "path" | "query" | "header" | "body";
882
+ key: string;
883
+ }[] | undefined;
884
+ responseSchema?: Record<string, unknown> | undefined;
885
+ }>;
886
+ export declare const botApiSchema: z.ZodObject<{
887
+ id: z.ZodString;
888
+ name: z.ZodString;
889
+ host: z.ZodString;
890
+ baseUrl: z.ZodString;
891
+ kind: z.ZodEnum<["http", "graphql", "openapi"]>;
892
+ auth: z.ZodEnum<["one", "each", "oauth", "none"]>;
893
+ sendCustomerIdentity: z.ZodBoolean;
894
+ credentialId: z.ZodOptional<z.ZodString>;
895
+ authHeader: z.ZodOptional<z.ZodString>;
896
+ calls: z.ZodArray<z.ZodObject<{
897
+ id: z.ZodString;
898
+ name: z.ZodString;
899
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
900
+ path: z.ZodString;
901
+ bodyType: z.ZodEnum<["json", "form", "xml", "gql"]>;
902
+ readAs: z.ZodEnum<["auto", "json", "xml", "text"]>;
903
+ timeout: z.ZodEnum<["2 seconds", "5 seconds", "10 seconds"]>;
904
+ summary: z.ZodString;
905
+ latencyMs: z.ZodNullable<z.ZodNumber>;
906
+ visibleFields: z.ZodArray<z.ZodString, "many">;
907
+ effects: z.ZodEnum<["read", "write", "unclassified"]>;
908
+ permission: z.ZodDefault<z.ZodEnum<["allow", "ask", "block"]>>;
909
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
910
+ headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
911
+ query: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
912
+ body: z.ZodDefault<z.ZodString>;
913
+ bindings: z.ZodDefault<z.ZodArray<z.ZodObject<{
914
+ source: z.ZodEnum<["identity", "variable", "context", "model"]>;
915
+ path: z.ZodArray<z.ZodString, "many">;
916
+ target: z.ZodEnum<["path", "query", "header", "body"]>;
917
+ key: z.ZodString;
918
+ }, "strict", z.ZodTypeAny, {
919
+ path: string[];
920
+ source: "variable" | "context" | "model" | "identity";
921
+ target: "path" | "query" | "header" | "body";
922
+ key: string;
923
+ }, {
924
+ path: string[];
925
+ source: "variable" | "context" | "model" | "identity";
926
+ target: "path" | "query" | "header" | "body";
927
+ key: string;
928
+ }>, "many">>;
929
+ responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
930
+ sample: z.ZodOptional<z.ZodUnknown>;
931
+ }, "strict", z.ZodTypeAny, {
932
+ path: string;
933
+ id: string;
934
+ name: string;
935
+ query: Record<string, string>;
936
+ body: string;
937
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
938
+ bodyType: "json" | "form" | "xml" | "gql";
939
+ readAs: "text" | "json" | "auto" | "xml";
940
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
941
+ summary: string;
942
+ latencyMs: number | null;
943
+ visibleFields: string[];
944
+ effects: "read" | "write" | "unclassified";
945
+ permission: "allow" | "ask" | "block";
946
+ headers: Record<string, string>;
947
+ bindings: {
948
+ path: string[];
949
+ source: "variable" | "context" | "model" | "identity";
950
+ target: "path" | "query" | "header" | "body";
951
+ key: string;
952
+ }[];
953
+ sample?: unknown;
954
+ inputSchema?: Record<string, unknown> | undefined;
955
+ responseSchema?: Record<string, unknown> | undefined;
956
+ }, {
957
+ path: string;
958
+ id: string;
959
+ name: string;
960
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
961
+ bodyType: "json" | "form" | "xml" | "gql";
962
+ readAs: "text" | "json" | "auto" | "xml";
963
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
964
+ summary: string;
965
+ latencyMs: number | null;
966
+ visibleFields: string[];
967
+ effects: "read" | "write" | "unclassified";
968
+ sample?: unknown;
969
+ query?: Record<string, string> | undefined;
970
+ body?: string | undefined;
971
+ permission?: "allow" | "ask" | "block" | undefined;
972
+ inputSchema?: Record<string, unknown> | undefined;
973
+ headers?: Record<string, string> | undefined;
974
+ bindings?: {
975
+ path: string[];
976
+ source: "variable" | "context" | "model" | "identity";
977
+ target: "path" | "query" | "header" | "body";
978
+ key: string;
979
+ }[] | undefined;
980
+ responseSchema?: Record<string, unknown> | undefined;
981
+ }>, "many">;
982
+ }, "strict", z.ZodTypeAny, {
983
+ kind: "http" | "graphql" | "openapi";
984
+ id: string;
985
+ name: string;
986
+ host: string;
987
+ baseUrl: string;
988
+ auth: "one" | "each" | "oauth" | "none";
989
+ sendCustomerIdentity: boolean;
990
+ calls: {
991
+ path: string;
992
+ id: string;
993
+ name: string;
994
+ query: Record<string, string>;
995
+ body: string;
996
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
997
+ bodyType: "json" | "form" | "xml" | "gql";
998
+ readAs: "text" | "json" | "auto" | "xml";
999
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
1000
+ summary: string;
1001
+ latencyMs: number | null;
1002
+ visibleFields: string[];
1003
+ effects: "read" | "write" | "unclassified";
1004
+ permission: "allow" | "ask" | "block";
1005
+ headers: Record<string, string>;
1006
+ bindings: {
1007
+ path: string[];
1008
+ source: "variable" | "context" | "model" | "identity";
1009
+ target: "path" | "query" | "header" | "body";
1010
+ key: string;
1011
+ }[];
1012
+ sample?: unknown;
1013
+ inputSchema?: Record<string, unknown> | undefined;
1014
+ responseSchema?: Record<string, unknown> | undefined;
1015
+ }[];
1016
+ credentialId?: string | undefined;
1017
+ authHeader?: string | undefined;
1018
+ }, {
1019
+ kind: "http" | "graphql" | "openapi";
1020
+ id: string;
1021
+ name: string;
1022
+ host: string;
1023
+ baseUrl: string;
1024
+ auth: "one" | "each" | "oauth" | "none";
1025
+ sendCustomerIdentity: boolean;
1026
+ calls: {
1027
+ path: string;
1028
+ id: string;
1029
+ name: string;
1030
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1031
+ bodyType: "json" | "form" | "xml" | "gql";
1032
+ readAs: "text" | "json" | "auto" | "xml";
1033
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
1034
+ summary: string;
1035
+ latencyMs: number | null;
1036
+ visibleFields: string[];
1037
+ effects: "read" | "write" | "unclassified";
1038
+ sample?: unknown;
1039
+ query?: Record<string, string> | undefined;
1040
+ body?: string | undefined;
1041
+ permission?: "allow" | "ask" | "block" | undefined;
1042
+ inputSchema?: Record<string, unknown> | undefined;
1043
+ headers?: Record<string, string> | undefined;
1044
+ bindings?: {
1045
+ path: string[];
1046
+ source: "variable" | "context" | "model" | "identity";
1047
+ target: "path" | "query" | "header" | "body";
1048
+ key: string;
1049
+ }[] | undefined;
1050
+ responseSchema?: Record<string, unknown> | undefined;
1051
+ }[];
1052
+ credentialId?: string | undefined;
1053
+ authHeader?: string | undefined;
1054
+ }>;
1055
+ export declare const botConfigurationSchema: z.ZodObject<{
1056
+ name: z.ZodString;
1057
+ triggers: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1058
+ kind: z.ZodLiteral<"app">;
1059
+ subscriptionId: z.ZodString;
1060
+ label: z.ZodString;
1061
+ providerKey: z.ZodString;
1062
+ eventTypes: z.ZodArray<z.ZodString, "many">;
1063
+ runsAs: z.ZodEnum<["none", "field"]>;
1064
+ customerField: z.ZodString;
1065
+ id: z.ZodString;
1066
+ name: z.ZodString;
1067
+ instruction: z.ZodString;
1068
+ enabled: z.ZodBoolean;
1069
+ answerTo: z.ZodEnum<["webhook", "none"]>;
1070
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1071
+ }, "strict", z.ZodTypeAny, {
1072
+ kind: "app";
1073
+ id: string;
1074
+ enabled: boolean;
1075
+ name: string;
1076
+ subscriptionId: string;
1077
+ label: string;
1078
+ providerKey: string;
1079
+ eventTypes: string[];
1080
+ runsAs: "none" | "field";
1081
+ customerField: string;
1082
+ instruction: string;
1083
+ answerTo: "webhook" | "none";
1084
+ variables: Record<string, unknown>;
1085
+ }, {
1086
+ kind: "app";
1087
+ id: string;
1088
+ enabled: boolean;
1089
+ name: string;
1090
+ subscriptionId: string;
1091
+ label: string;
1092
+ providerKey: string;
1093
+ eventTypes: string[];
1094
+ runsAs: "none" | "field";
1095
+ customerField: string;
1096
+ instruction: string;
1097
+ answerTo: "webhook" | "none";
1098
+ variables?: Record<string, unknown> | undefined;
1099
+ }>, z.ZodObject<{
1100
+ kind: z.ZodLiteral<"webhook">;
1101
+ tenantId: z.ZodString;
1102
+ runsAs: z.ZodEnum<["none", "field"]>;
1103
+ customerField: z.ZodString;
1104
+ id: z.ZodString;
1105
+ name: z.ZodString;
1106
+ instruction: z.ZodString;
1107
+ enabled: z.ZodBoolean;
1108
+ answerTo: z.ZodEnum<["webhook", "none"]>;
1109
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1110
+ }, "strict", z.ZodTypeAny, {
1111
+ kind: "webhook";
1112
+ id: string;
1113
+ tenantId: string;
1114
+ enabled: boolean;
1115
+ name: string;
1116
+ runsAs: "none" | "field";
1117
+ customerField: string;
1118
+ instruction: string;
1119
+ answerTo: "webhook" | "none";
1120
+ variables: Record<string, unknown>;
1121
+ }, {
1122
+ kind: "webhook";
1123
+ id: string;
1124
+ tenantId: string;
1125
+ enabled: boolean;
1126
+ name: string;
1127
+ runsAs: "none" | "field";
1128
+ customerField: string;
1129
+ instruction: string;
1130
+ answerTo: "webhook" | "none";
1131
+ variables?: Record<string, unknown> | undefined;
1132
+ }>, z.ZodObject<{
1133
+ kind: z.ZodLiteral<"schedule">;
1134
+ tenantId: z.ZodString;
1135
+ repeat: z.ZodEnum<["repeat", "once"]>;
1136
+ every: z.ZodEnum<["week", "day", "hour"]>;
1137
+ days: z.ZodArray<z.ZodNumber, "many">;
1138
+ time: z.ZodString;
1139
+ date: z.ZodString;
1140
+ timezone: z.ZodString;
1141
+ runsAs: z.ZodEnum<["none", "one"]>;
1142
+ customerId: z.ZodString;
1143
+ id: z.ZodString;
1144
+ name: z.ZodString;
1145
+ instruction: z.ZodString;
1146
+ enabled: z.ZodBoolean;
1147
+ answerTo: z.ZodEnum<["webhook", "none"]>;
1148
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1149
+ }, "strict", z.ZodTypeAny, {
1150
+ every: "week" | "day" | "hour";
1151
+ kind: "schedule";
1152
+ date: string;
1153
+ id: string;
1154
+ tenantId: string;
1155
+ enabled: boolean;
1156
+ name: string;
1157
+ runsAs: "one" | "none";
1158
+ instruction: string;
1159
+ answerTo: "webhook" | "none";
1160
+ variables: Record<string, unknown>;
1161
+ repeat: "once" | "repeat";
1162
+ days: number[];
1163
+ time: string;
1164
+ timezone: string;
1165
+ customerId: string;
1166
+ }, {
1167
+ every: "week" | "day" | "hour";
1168
+ kind: "schedule";
1169
+ date: string;
1170
+ id: string;
1171
+ tenantId: string;
1172
+ enabled: boolean;
1173
+ name: string;
1174
+ runsAs: "one" | "none";
1175
+ instruction: string;
1176
+ answerTo: "webhook" | "none";
1177
+ repeat: "once" | "repeat";
1178
+ days: number[];
1179
+ time: string;
1180
+ timezone: string;
1181
+ customerId: string;
1182
+ variables?: Record<string, unknown> | undefined;
1183
+ }>]>, "many">>;
1184
+ model: z.ZodObject<{
1185
+ id: z.ZodString;
1186
+ effort: z.ZodEnum<["low", "medium", "high"]>;
1187
+ }, "strict", z.ZodTypeAny, {
1188
+ id: string;
1189
+ effort: "low" | "medium" | "high";
1190
+ }, {
1191
+ id: string;
1192
+ effort: "low" | "medium" | "high";
1193
+ }>;
1194
+ instructions: z.ZodObject<{
1195
+ text: z.ZodString;
1196
+ editedAt: z.ZodNullable<z.ZodString>;
1197
+ }, "strict", z.ZodTypeAny, {
1198
+ text: string;
1199
+ editedAt: string | null;
1200
+ }, {
1201
+ text: string;
1202
+ editedAt: string | null;
1203
+ }>;
1204
+ skills: z.ZodArray<z.ZodObject<{
1205
+ id: z.ZodString;
1206
+ name: z.ZodString;
1207
+ summary: z.ZodString;
1208
+ icon: z.ZodEnum<["refund", "link", "person", "voice", "mail", "term", "box", "pencil"]>;
1209
+ load: z.ZodEnum<["auto", "always"]>;
1210
+ cases: z.ZodArray<z.ZodObject<{
1211
+ text: z.ZodString;
1212
+ }, "strict", z.ZodTypeAny, {
1213
+ text: string;
1214
+ }, {
1215
+ text: string;
1216
+ }>, "many">;
1217
+ exceptions: z.ZodArray<z.ZodObject<{
1218
+ text: z.ZodString;
1219
+ }, "strict", z.ZodTypeAny, {
1220
+ text: string;
1221
+ }, {
1222
+ text: string;
1223
+ }>, "many">;
1224
+ examples: z.ZodObject<{
1225
+ use: z.ZodArray<z.ZodString, "many">;
1226
+ notFor: z.ZodArray<z.ZodString, "many">;
1227
+ }, "strict", z.ZodTypeAny, {
1228
+ use: string[];
1229
+ notFor: string[];
1230
+ }, {
1231
+ use: string[];
1232
+ notFor: string[];
1233
+ }>;
1234
+ onlyIf: z.ZodArray<z.ZodObject<{
1235
+ field: z.ZodString;
1236
+ check: z.ZodEnum<["is one of", "is", "is not"]>;
1237
+ values: z.ZodString;
1238
+ }, "strict", z.ZodTypeAny, {
1239
+ values: string;
1240
+ field: string;
1241
+ check: "is one of" | "is" | "is not";
1242
+ }, {
1243
+ values: string;
1244
+ field: string;
1245
+ check: "is one of" | "is" | "is not";
1246
+ }>, "many">;
1247
+ instructions: z.ZodDefault<z.ZodString>;
1248
+ files: z.ZodDefault<z.ZodArray<z.ZodObject<{
1249
+ name: z.ZodString;
1250
+ content: z.ZodString;
1251
+ }, "strict", z.ZodTypeAny, {
1252
+ name: string;
1253
+ content: string;
1254
+ }, {
1255
+ name: string;
1256
+ content: string;
1257
+ }>, "many">>;
1258
+ }, "strict", z.ZodTypeAny, {
1259
+ id: string;
1260
+ name: string;
1261
+ files: {
1262
+ name: string;
1263
+ content: string;
1264
+ }[];
1265
+ instructions: string;
1266
+ summary: string;
1267
+ icon: "refund" | "link" | "person" | "voice" | "mail" | "term" | "box" | "pencil";
1268
+ load: "auto" | "always";
1269
+ cases: {
1270
+ text: string;
1271
+ }[];
1272
+ exceptions: {
1273
+ text: string;
1274
+ }[];
1275
+ examples: {
1276
+ use: string[];
1277
+ notFor: string[];
1278
+ };
1279
+ onlyIf: {
1280
+ values: string;
1281
+ field: string;
1282
+ check: "is one of" | "is" | "is not";
1283
+ }[];
1284
+ }, {
1285
+ id: string;
1286
+ name: string;
1287
+ summary: string;
1288
+ icon: "refund" | "link" | "person" | "voice" | "mail" | "term" | "box" | "pencil";
1289
+ load: "auto" | "always";
1290
+ cases: {
1291
+ text: string;
1292
+ }[];
1293
+ exceptions: {
1294
+ text: string;
1295
+ }[];
1296
+ examples: {
1297
+ use: string[];
1298
+ notFor: string[];
1299
+ };
1300
+ onlyIf: {
1301
+ values: string;
1302
+ field: string;
1303
+ check: "is one of" | "is" | "is not";
1304
+ }[];
1305
+ files?: {
1306
+ name: string;
1307
+ content: string;
1308
+ }[] | undefined;
1309
+ instructions?: string | undefined;
1310
+ }>, "many">;
1311
+ memory: z.ZodObject<{
1312
+ enabled: z.ZodBoolean;
1313
+ configured: z.ZodBoolean;
1314
+ who: z.ZodObject<{
1315
+ customer: z.ZodBoolean;
1316
+ company: z.ZodBoolean;
1317
+ bot: z.ZodBoolean;
1318
+ }, "strict", z.ZodTypeAny, {
1319
+ customer: boolean;
1320
+ company: boolean;
1321
+ bot: boolean;
1322
+ }, {
1323
+ customer: boolean;
1324
+ company: boolean;
1325
+ bot: boolean;
1326
+ }>;
1327
+ what: z.ZodString;
1328
+ never: z.ZodArray<z.ZodString, "many">;
1329
+ forgetAfter: z.ZodEnum<["1 year", "6 months", "90 days", "Never"]>;
1330
+ }, "strict", z.ZodTypeAny, {
1331
+ never: string[];
1332
+ enabled: boolean;
1333
+ configured: boolean;
1334
+ who: {
1335
+ customer: boolean;
1336
+ company: boolean;
1337
+ bot: boolean;
1338
+ };
1339
+ what: string;
1340
+ forgetAfter: "1 year" | "6 months" | "90 days" | "Never";
1341
+ }, {
1342
+ never: string[];
1343
+ enabled: boolean;
1344
+ configured: boolean;
1345
+ who: {
1346
+ customer: boolean;
1347
+ company: boolean;
1348
+ bot: boolean;
1349
+ };
1350
+ what: string;
1351
+ forgetAfter: "1 year" | "6 months" | "90 days" | "Never";
1352
+ }>;
1353
+ workbench: z.ZodObject<{
1354
+ enabled: z.ZodBoolean;
1355
+ configured: z.ZodBoolean;
1356
+ size: z.ZodEnum<["small", "medium", "large"]>;
1357
+ access: z.ZodEnum<["allow", "ask", "block"]>;
1358
+ languages: z.ZodArray<z.ZodString, "many">;
1359
+ files: z.ZodEnum<["per_customer", "per_run"]>;
1360
+ longestRun: z.ZodEnum<["1 minute", "3 minutes", "10 minutes"]>;
1361
+ }, "strict", z.ZodTypeAny, {
1362
+ enabled: boolean;
1363
+ files: "per_customer" | "per_run";
1364
+ configured: boolean;
1365
+ size: "medium" | "small" | "large";
1366
+ access: "allow" | "ask" | "block";
1367
+ languages: string[];
1368
+ longestRun: "1 minute" | "3 minutes" | "10 minutes";
1369
+ }, {
1370
+ enabled: boolean;
1371
+ files: "per_customer" | "per_run";
1372
+ configured: boolean;
1373
+ size: "medium" | "small" | "large";
1374
+ access: "allow" | "ask" | "block";
1375
+ languages: string[];
1376
+ longestRun: "1 minute" | "3 minutes" | "10 minutes";
1377
+ }>;
1378
+ context: z.ZodObject<{
1379
+ readPages: z.ZodDefault<z.ZodBoolean>;
1380
+ searchPastChats: z.ZodDefault<z.ZodBoolean>;
1381
+ conversationRetentionDays: z.ZodDefault<z.ZodNumber>;
1382
+ apis: z.ZodArray<z.ZodObject<{
1383
+ id: z.ZodString;
1384
+ name: z.ZodString;
1385
+ host: z.ZodString;
1386
+ baseUrl: z.ZodString;
1387
+ kind: z.ZodEnum<["http", "graphql", "openapi"]>;
1388
+ auth: z.ZodEnum<["one", "each", "oauth", "none"]>;
1389
+ sendCustomerIdentity: z.ZodBoolean;
1390
+ credentialId: z.ZodOptional<z.ZodString>;
1391
+ authHeader: z.ZodOptional<z.ZodString>;
1392
+ calls: z.ZodArray<z.ZodObject<{
1393
+ id: z.ZodString;
1394
+ name: z.ZodString;
1395
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
1396
+ path: z.ZodString;
1397
+ bodyType: z.ZodEnum<["json", "form", "xml", "gql"]>;
1398
+ readAs: z.ZodEnum<["auto", "json", "xml", "text"]>;
1399
+ timeout: z.ZodEnum<["2 seconds", "5 seconds", "10 seconds"]>;
1400
+ summary: z.ZodString;
1401
+ latencyMs: z.ZodNullable<z.ZodNumber>;
1402
+ visibleFields: z.ZodArray<z.ZodString, "many">;
1403
+ effects: z.ZodEnum<["read", "write", "unclassified"]>;
1404
+ permission: z.ZodDefault<z.ZodEnum<["allow", "ask", "block"]>>;
1405
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1406
+ headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1407
+ query: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1408
+ body: z.ZodDefault<z.ZodString>;
1409
+ bindings: z.ZodDefault<z.ZodArray<z.ZodObject<{
1410
+ source: z.ZodEnum<["identity", "variable", "context", "model"]>;
1411
+ path: z.ZodArray<z.ZodString, "many">;
1412
+ target: z.ZodEnum<["path", "query", "header", "body"]>;
1413
+ key: z.ZodString;
1414
+ }, "strict", z.ZodTypeAny, {
1415
+ path: string[];
1416
+ source: "variable" | "context" | "model" | "identity";
1417
+ target: "path" | "query" | "header" | "body";
1418
+ key: string;
1419
+ }, {
1420
+ path: string[];
1421
+ source: "variable" | "context" | "model" | "identity";
1422
+ target: "path" | "query" | "header" | "body";
1423
+ key: string;
1424
+ }>, "many">>;
1425
+ responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1426
+ sample: z.ZodOptional<z.ZodUnknown>;
1427
+ }, "strict", z.ZodTypeAny, {
1428
+ path: string;
1429
+ id: string;
1430
+ name: string;
1431
+ query: Record<string, string>;
1432
+ body: string;
1433
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1434
+ bodyType: "json" | "form" | "xml" | "gql";
1435
+ readAs: "text" | "json" | "auto" | "xml";
1436
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
1437
+ summary: string;
1438
+ latencyMs: number | null;
1439
+ visibleFields: string[];
1440
+ effects: "read" | "write" | "unclassified";
1441
+ permission: "allow" | "ask" | "block";
1442
+ headers: Record<string, string>;
1443
+ bindings: {
1444
+ path: string[];
1445
+ source: "variable" | "context" | "model" | "identity";
1446
+ target: "path" | "query" | "header" | "body";
1447
+ key: string;
1448
+ }[];
1449
+ sample?: unknown;
1450
+ inputSchema?: Record<string, unknown> | undefined;
1451
+ responseSchema?: Record<string, unknown> | undefined;
1452
+ }, {
1453
+ path: string;
1454
+ id: string;
1455
+ name: string;
1456
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1457
+ bodyType: "json" | "form" | "xml" | "gql";
1458
+ readAs: "text" | "json" | "auto" | "xml";
1459
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
1460
+ summary: string;
1461
+ latencyMs: number | null;
1462
+ visibleFields: string[];
1463
+ effects: "read" | "write" | "unclassified";
1464
+ sample?: unknown;
1465
+ query?: Record<string, string> | undefined;
1466
+ body?: string | undefined;
1467
+ permission?: "allow" | "ask" | "block" | undefined;
1468
+ inputSchema?: Record<string, unknown> | undefined;
1469
+ headers?: Record<string, string> | undefined;
1470
+ bindings?: {
1471
+ path: string[];
1472
+ source: "variable" | "context" | "model" | "identity";
1473
+ target: "path" | "query" | "header" | "body";
1474
+ key: string;
1475
+ }[] | undefined;
1476
+ responseSchema?: Record<string, unknown> | undefined;
1477
+ }>, "many">;
1478
+ }, "strict", z.ZodTypeAny, {
1479
+ kind: "http" | "graphql" | "openapi";
1480
+ id: string;
1481
+ name: string;
1482
+ host: string;
1483
+ baseUrl: string;
1484
+ auth: "one" | "each" | "oauth" | "none";
1485
+ sendCustomerIdentity: boolean;
1486
+ calls: {
1487
+ path: string;
1488
+ id: string;
1489
+ name: string;
1490
+ query: Record<string, string>;
1491
+ body: string;
1492
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1493
+ bodyType: "json" | "form" | "xml" | "gql";
1494
+ readAs: "text" | "json" | "auto" | "xml";
1495
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
1496
+ summary: string;
1497
+ latencyMs: number | null;
1498
+ visibleFields: string[];
1499
+ effects: "read" | "write" | "unclassified";
1500
+ permission: "allow" | "ask" | "block";
1501
+ headers: Record<string, string>;
1502
+ bindings: {
1503
+ path: string[];
1504
+ source: "variable" | "context" | "model" | "identity";
1505
+ target: "path" | "query" | "header" | "body";
1506
+ key: string;
1507
+ }[];
1508
+ sample?: unknown;
1509
+ inputSchema?: Record<string, unknown> | undefined;
1510
+ responseSchema?: Record<string, unknown> | undefined;
1511
+ }[];
1512
+ credentialId?: string | undefined;
1513
+ authHeader?: string | undefined;
1514
+ }, {
1515
+ kind: "http" | "graphql" | "openapi";
1516
+ id: string;
1517
+ name: string;
1518
+ host: string;
1519
+ baseUrl: string;
1520
+ auth: "one" | "each" | "oauth" | "none";
1521
+ sendCustomerIdentity: boolean;
1522
+ calls: {
1523
+ path: string;
1524
+ id: string;
1525
+ name: string;
1526
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1527
+ bodyType: "json" | "form" | "xml" | "gql";
1528
+ readAs: "text" | "json" | "auto" | "xml";
1529
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
1530
+ summary: string;
1531
+ latencyMs: number | null;
1532
+ visibleFields: string[];
1533
+ effects: "read" | "write" | "unclassified";
1534
+ sample?: unknown;
1535
+ query?: Record<string, string> | undefined;
1536
+ body?: string | undefined;
1537
+ permission?: "allow" | "ask" | "block" | undefined;
1538
+ inputSchema?: Record<string, unknown> | undefined;
1539
+ headers?: Record<string, string> | undefined;
1540
+ bindings?: {
1541
+ path: string[];
1542
+ source: "variable" | "context" | "model" | "identity";
1543
+ target: "path" | "query" | "header" | "body";
1544
+ key: string;
1545
+ }[] | undefined;
1546
+ responseSchema?: Record<string, unknown> | undefined;
1547
+ }[];
1548
+ credentialId?: string | undefined;
1549
+ authHeader?: string | undefined;
1550
+ }>, "many">;
1551
+ apps: z.ZodArray<z.ZodObject<{
1552
+ key: z.ZodString;
1553
+ account: z.ZodEnum<["project", "customer"]>;
1554
+ accountId: z.ZodOptional<z.ZodString>;
1555
+ rules: z.ZodObject<{
1556
+ read: z.ZodEnum<["allow", "ask", "block"]>;
1557
+ change: z.ZodEnum<["allow", "ask", "block"]>;
1558
+ delete: z.ZodEnum<["allow", "ask", "block"]>;
1559
+ }, "strict", z.ZodTypeAny, {
1560
+ read: "allow" | "ask" | "block";
1561
+ change: "allow" | "ask" | "block";
1562
+ delete: "allow" | "ask" | "block";
1563
+ }, {
1564
+ read: "allow" | "ask" | "block";
1565
+ change: "allow" | "ask" | "block";
1566
+ delete: "allow" | "ask" | "block";
1567
+ }>;
1568
+ actionRules: z.ZodRecord<z.ZodString, z.ZodEnum<["allow", "ask", "block"]>>;
1569
+ askWho: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["approvers", "customer", "customer-approvers"]>>>;
1570
+ pinned: z.ZodArray<z.ZodString, "many">;
1571
+ }, "strict", z.ZodTypeAny, {
1572
+ key: string;
1573
+ account: "customer" | "project";
1574
+ rules: {
1575
+ read: "allow" | "ask" | "block";
1576
+ change: "allow" | "ask" | "block";
1577
+ delete: "allow" | "ask" | "block";
1578
+ };
1579
+ actionRules: Record<string, "allow" | "ask" | "block">;
1580
+ pinned: string[];
1581
+ accountId?: string | undefined;
1582
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
1583
+ }, {
1584
+ key: string;
1585
+ account: "customer" | "project";
1586
+ rules: {
1587
+ read: "allow" | "ask" | "block";
1588
+ change: "allow" | "ask" | "block";
1589
+ delete: "allow" | "ask" | "block";
1590
+ };
1591
+ actionRules: Record<string, "allow" | "ask" | "block">;
1592
+ pinned: string[];
1593
+ accountId?: string | undefined;
1594
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
1595
+ }>, "many">;
1596
+ mcpServers: z.ZodArray<z.ZodObject<{
1597
+ id: z.ZodString;
1598
+ name: z.ZodString;
1599
+ url: z.ZodString;
1600
+ status: z.ZodEnum<["connecting", "connected"]>;
1601
+ credentialId: z.ZodOptional<z.ZodString>;
1602
+ toolCount: z.ZodNumber;
1603
+ definitions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1604
+ name: z.ZodString;
1605
+ description: z.ZodString;
1606
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1607
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1608
+ }, "strict", z.ZodTypeAny, {
1609
+ name: string;
1610
+ inputSchema: Record<string, unknown>;
1611
+ description: string;
1612
+ outputSchema?: Record<string, unknown> | undefined;
1613
+ }, {
1614
+ name: string;
1615
+ inputSchema: Record<string, unknown>;
1616
+ description: string;
1617
+ outputSchema?: Record<string, unknown> | undefined;
1618
+ }>, "many">>;
1619
+ groups: z.ZodArray<z.ZodObject<{
1620
+ name: z.ZodEnum<["Read", "Change", "Delete"]>;
1621
+ count: z.ZodNumber;
1622
+ rule: z.ZodEnum<["allow", "ask", "block"]>;
1623
+ tools: z.ZodArray<z.ZodString, "many">;
1624
+ }, "strict", z.ZodTypeAny, {
1625
+ name: "Read" | "Change" | "Delete";
1626
+ count: number;
1627
+ rule: "allow" | "ask" | "block";
1628
+ tools: string[];
1629
+ }, {
1630
+ name: "Read" | "Change" | "Delete";
1631
+ count: number;
1632
+ rule: "allow" | "ask" | "block";
1633
+ tools: string[];
1634
+ }>, "many">;
1635
+ }, "strict", z.ZodTypeAny, {
1636
+ status: "connecting" | "connected";
1637
+ id: string;
1638
+ name: string;
1639
+ url: string;
1640
+ toolCount: number;
1641
+ definitions: {
1642
+ name: string;
1643
+ inputSchema: Record<string, unknown>;
1644
+ description: string;
1645
+ outputSchema?: Record<string, unknown> | undefined;
1646
+ }[];
1647
+ groups: {
1648
+ name: "Read" | "Change" | "Delete";
1649
+ count: number;
1650
+ rule: "allow" | "ask" | "block";
1651
+ tools: string[];
1652
+ }[];
1653
+ credentialId?: string | undefined;
1654
+ }, {
1655
+ status: "connecting" | "connected";
1656
+ id: string;
1657
+ name: string;
1658
+ url: string;
1659
+ toolCount: number;
1660
+ groups: {
1661
+ name: "Read" | "Change" | "Delete";
1662
+ count: number;
1663
+ rule: "allow" | "ask" | "block";
1664
+ tools: string[];
1665
+ }[];
1666
+ credentialId?: string | undefined;
1667
+ definitions?: {
1668
+ name: string;
1669
+ inputSchema: Record<string, unknown>;
1670
+ description: string;
1671
+ outputSchema?: Record<string, unknown> | undefined;
1672
+ }[] | undefined;
1673
+ }>, "many">;
1674
+ knowledge: z.ZodArray<z.ZodObject<{
1675
+ id: z.ZodString;
1676
+ kind: z.ZodEnum<["help_center", "website", "files", "note", "notion", "google_drive"]>;
1677
+ scope: z.ZodDefault<z.ZodEnum<["project", "customer"]>>;
1678
+ connectedSource: z.ZodOptional<z.ZodObject<{
1679
+ accountId: z.ZodString;
1680
+ resourceId: z.ZodString;
1681
+ }, "strict", z.ZodTypeAny, {
1682
+ accountId: string;
1683
+ resourceId: string;
1684
+ }, {
1685
+ accountId: string;
1686
+ resourceId: string;
1687
+ }>>;
1688
+ name: z.ZodString;
1689
+ detail: z.ZodString;
1690
+ status: z.ZodEnum<["ready", "syncing", "failed"]>;
1691
+ error: z.ZodOptional<z.ZodString>;
1692
+ url: z.ZodOptional<z.ZodString>;
1693
+ pages: z.ZodOptional<z.ZodObject<{
1694
+ done: z.ZodNumber;
1695
+ total: z.ZodNumber;
1696
+ }, "strip", z.ZodTypeAny, {
1697
+ done: number;
1698
+ total: number;
1699
+ }, {
1700
+ done: number;
1701
+ total: number;
1702
+ }>>;
1703
+ progress: z.ZodOptional<z.ZodObject<{
1704
+ stage: z.ZodString;
1705
+ done: z.ZodNumber;
1706
+ total: z.ZodNumber;
1707
+ retryable: z.ZodBoolean;
1708
+ }, "strip", z.ZodTypeAny, {
1709
+ done: number;
1710
+ total: number;
1711
+ stage: string;
1712
+ retryable: boolean;
1713
+ }, {
1714
+ done: number;
1715
+ total: number;
1716
+ stage: string;
1717
+ retryable: boolean;
1718
+ }>>;
1719
+ syncedLabel: z.ZodString;
1720
+ }, "strict", z.ZodTypeAny, {
1721
+ status: "failed" | "ready" | "syncing";
1722
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
1723
+ id: string;
1724
+ name: string;
1725
+ scope: "customer" | "project";
1726
+ detail: string;
1727
+ syncedLabel: string;
1728
+ error?: string | undefined;
1729
+ url?: string | undefined;
1730
+ connectedSource?: {
1731
+ accountId: string;
1732
+ resourceId: string;
1733
+ } | undefined;
1734
+ pages?: {
1735
+ done: number;
1736
+ total: number;
1737
+ } | undefined;
1738
+ progress?: {
1739
+ done: number;
1740
+ total: number;
1741
+ stage: string;
1742
+ retryable: boolean;
1743
+ } | undefined;
1744
+ }, {
1745
+ status: "failed" | "ready" | "syncing";
1746
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
1747
+ id: string;
1748
+ name: string;
1749
+ detail: string;
1750
+ syncedLabel: string;
1751
+ error?: string | undefined;
1752
+ url?: string | undefined;
1753
+ scope?: "customer" | "project" | undefined;
1754
+ connectedSource?: {
1755
+ accountId: string;
1756
+ resourceId: string;
1757
+ } | undefined;
1758
+ pages?: {
1759
+ done: number;
1760
+ total: number;
1761
+ } | undefined;
1762
+ progress?: {
1763
+ done: number;
1764
+ total: number;
1765
+ stage: string;
1766
+ retryable: boolean;
1767
+ } | undefined;
1768
+ }>, "many">;
1769
+ webSearch: z.ZodObject<{
1770
+ enabled: z.ZodBoolean;
1771
+ provider: z.ZodEffects<z.ZodEnum<["builtin", "exa", "firecrawl"]>, "builtin", "builtin" | "exa" | "firecrawl">;
1772
+ preferSites: z.ZodArray<z.ZodString, "many">;
1773
+ }, "strict", z.ZodTypeAny, {
1774
+ enabled: boolean;
1775
+ provider: "builtin";
1776
+ preferSites: string[];
1777
+ }, {
1778
+ enabled: boolean;
1779
+ provider: "builtin" | "exa" | "firecrawl";
1780
+ preferSites: string[];
1781
+ }>;
1782
+ }, "strict", z.ZodTypeAny, {
1783
+ knowledge: {
1784
+ status: "failed" | "ready" | "syncing";
1785
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
1786
+ id: string;
1787
+ name: string;
1788
+ scope: "customer" | "project";
1789
+ detail: string;
1790
+ syncedLabel: string;
1791
+ error?: string | undefined;
1792
+ url?: string | undefined;
1793
+ connectedSource?: {
1794
+ accountId: string;
1795
+ resourceId: string;
1796
+ } | undefined;
1797
+ pages?: {
1798
+ done: number;
1799
+ total: number;
1800
+ } | undefined;
1801
+ progress?: {
1802
+ done: number;
1803
+ total: number;
1804
+ stage: string;
1805
+ retryable: boolean;
1806
+ } | undefined;
1807
+ }[];
1808
+ readPages: boolean;
1809
+ searchPastChats: boolean;
1810
+ conversationRetentionDays: number;
1811
+ apis: {
1812
+ kind: "http" | "graphql" | "openapi";
1813
+ id: string;
1814
+ name: string;
1815
+ host: string;
1816
+ baseUrl: string;
1817
+ auth: "one" | "each" | "oauth" | "none";
1818
+ sendCustomerIdentity: boolean;
1819
+ calls: {
1820
+ path: string;
1821
+ id: string;
1822
+ name: string;
1823
+ query: Record<string, string>;
1824
+ body: string;
1825
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1826
+ bodyType: "json" | "form" | "xml" | "gql";
1827
+ readAs: "text" | "json" | "auto" | "xml";
1828
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
1829
+ summary: string;
1830
+ latencyMs: number | null;
1831
+ visibleFields: string[];
1832
+ effects: "read" | "write" | "unclassified";
1833
+ permission: "allow" | "ask" | "block";
1834
+ headers: Record<string, string>;
1835
+ bindings: {
1836
+ path: string[];
1837
+ source: "variable" | "context" | "model" | "identity";
1838
+ target: "path" | "query" | "header" | "body";
1839
+ key: string;
1840
+ }[];
1841
+ sample?: unknown;
1842
+ inputSchema?: Record<string, unknown> | undefined;
1843
+ responseSchema?: Record<string, unknown> | undefined;
1844
+ }[];
1845
+ credentialId?: string | undefined;
1846
+ authHeader?: string | undefined;
1847
+ }[];
1848
+ apps: {
1849
+ key: string;
1850
+ account: "customer" | "project";
1851
+ rules: {
1852
+ read: "allow" | "ask" | "block";
1853
+ change: "allow" | "ask" | "block";
1854
+ delete: "allow" | "ask" | "block";
1855
+ };
1856
+ actionRules: Record<string, "allow" | "ask" | "block">;
1857
+ pinned: string[];
1858
+ accountId?: string | undefined;
1859
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
1860
+ }[];
1861
+ mcpServers: {
1862
+ status: "connecting" | "connected";
1863
+ id: string;
1864
+ name: string;
1865
+ url: string;
1866
+ toolCount: number;
1867
+ definitions: {
1868
+ name: string;
1869
+ inputSchema: Record<string, unknown>;
1870
+ description: string;
1871
+ outputSchema?: Record<string, unknown> | undefined;
1872
+ }[];
1873
+ groups: {
1874
+ name: "Read" | "Change" | "Delete";
1875
+ count: number;
1876
+ rule: "allow" | "ask" | "block";
1877
+ tools: string[];
1878
+ }[];
1879
+ credentialId?: string | undefined;
1880
+ }[];
1881
+ webSearch: {
1882
+ enabled: boolean;
1883
+ provider: "builtin";
1884
+ preferSites: string[];
1885
+ };
1886
+ }, {
1887
+ knowledge: {
1888
+ status: "failed" | "ready" | "syncing";
1889
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
1890
+ id: string;
1891
+ name: string;
1892
+ detail: string;
1893
+ syncedLabel: string;
1894
+ error?: string | undefined;
1895
+ url?: string | undefined;
1896
+ scope?: "customer" | "project" | undefined;
1897
+ connectedSource?: {
1898
+ accountId: string;
1899
+ resourceId: string;
1900
+ } | undefined;
1901
+ pages?: {
1902
+ done: number;
1903
+ total: number;
1904
+ } | undefined;
1905
+ progress?: {
1906
+ done: number;
1907
+ total: number;
1908
+ stage: string;
1909
+ retryable: boolean;
1910
+ } | undefined;
1911
+ }[];
1912
+ apis: {
1913
+ kind: "http" | "graphql" | "openapi";
1914
+ id: string;
1915
+ name: string;
1916
+ host: string;
1917
+ baseUrl: string;
1918
+ auth: "one" | "each" | "oauth" | "none";
1919
+ sendCustomerIdentity: boolean;
1920
+ calls: {
1921
+ path: string;
1922
+ id: string;
1923
+ name: string;
1924
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1925
+ bodyType: "json" | "form" | "xml" | "gql";
1926
+ readAs: "text" | "json" | "auto" | "xml";
1927
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
1928
+ summary: string;
1929
+ latencyMs: number | null;
1930
+ visibleFields: string[];
1931
+ effects: "read" | "write" | "unclassified";
1932
+ sample?: unknown;
1933
+ query?: Record<string, string> | undefined;
1934
+ body?: string | undefined;
1935
+ permission?: "allow" | "ask" | "block" | undefined;
1936
+ inputSchema?: Record<string, unknown> | undefined;
1937
+ headers?: Record<string, string> | undefined;
1938
+ bindings?: {
1939
+ path: string[];
1940
+ source: "variable" | "context" | "model" | "identity";
1941
+ target: "path" | "query" | "header" | "body";
1942
+ key: string;
1943
+ }[] | undefined;
1944
+ responseSchema?: Record<string, unknown> | undefined;
1945
+ }[];
1946
+ credentialId?: string | undefined;
1947
+ authHeader?: string | undefined;
1948
+ }[];
1949
+ apps: {
1950
+ key: string;
1951
+ account: "customer" | "project";
1952
+ rules: {
1953
+ read: "allow" | "ask" | "block";
1954
+ change: "allow" | "ask" | "block";
1955
+ delete: "allow" | "ask" | "block";
1956
+ };
1957
+ actionRules: Record<string, "allow" | "ask" | "block">;
1958
+ pinned: string[];
1959
+ accountId?: string | undefined;
1960
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
1961
+ }[];
1962
+ mcpServers: {
1963
+ status: "connecting" | "connected";
1964
+ id: string;
1965
+ name: string;
1966
+ url: string;
1967
+ toolCount: number;
1968
+ groups: {
1969
+ name: "Read" | "Change" | "Delete";
1970
+ count: number;
1971
+ rule: "allow" | "ask" | "block";
1972
+ tools: string[];
1973
+ }[];
1974
+ credentialId?: string | undefined;
1975
+ definitions?: {
1976
+ name: string;
1977
+ inputSchema: Record<string, unknown>;
1978
+ description: string;
1979
+ outputSchema?: Record<string, unknown> | undefined;
1980
+ }[] | undefined;
1981
+ }[];
1982
+ webSearch: {
1983
+ enabled: boolean;
1984
+ provider: "builtin" | "exa" | "firecrawl";
1985
+ preferSites: string[];
1986
+ };
1987
+ readPages?: boolean | undefined;
1988
+ searchPastChats?: boolean | undefined;
1989
+ conversationRetentionDays?: number | undefined;
1990
+ }>;
1991
+ variables: z.ZodArray<z.ZodObject<{
1992
+ name: z.ZodString;
1993
+ type: z.ZodEnum<["Text", "Number", "Yes or no", "One of…"]>;
1994
+ required: z.ZodBoolean;
1995
+ defaultValue: z.ZodString;
1996
+ values: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1997
+ usedIn: z.ZodArray<z.ZodEnum<["instructions", "api", "run_plan"]>, "many">;
1998
+ chipNote: z.ZodString;
1999
+ description: z.ZodString;
2000
+ }, "strict", z.ZodTypeAny, {
2001
+ type: "Text" | "Number" | "Yes or no" | "One of…";
2002
+ name: string;
2003
+ description: string;
2004
+ required: boolean;
2005
+ defaultValue: string;
2006
+ usedIn: ("instructions" | "api" | "run_plan")[];
2007
+ chipNote: string;
2008
+ values?: string[] | undefined;
2009
+ }, {
2010
+ type: "Text" | "Number" | "Yes or no" | "One of…";
2011
+ name: string;
2012
+ description: string;
2013
+ required: boolean;
2014
+ defaultValue: string;
2015
+ usedIn: ("instructions" | "api" | "run_plan")[];
2016
+ chipNote: string;
2017
+ values?: string[] | undefined;
2018
+ }>, "many">;
2019
+ answer: z.ZodObject<{
2020
+ format: z.ZodEnum<["text", "json"]>;
2021
+ delivery: z.ZodEnum<["stream", "once", "webhook"]>;
2022
+ webhookUrl: z.ZodString;
2023
+ shape: z.ZodArray<z.ZodObject<{
2024
+ id: z.ZodString;
2025
+ name: z.ZodString;
2026
+ type: z.ZodEnum<["text", "number", "bool", "enum", "list", "group", "date"]>;
2027
+ required: z.ZodBoolean;
2028
+ description: z.ZodString;
2029
+ level: z.ZodNumber;
2030
+ values: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2031
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2032
+ }, "strict", z.ZodTypeAny, {
2033
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
2034
+ id: string;
2035
+ name: string;
2036
+ description: string;
2037
+ required: boolean;
2038
+ level: number;
2039
+ values?: string[] | undefined;
2040
+ items?: Record<string, unknown> | undefined;
2041
+ }, {
2042
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
2043
+ id: string;
2044
+ name: string;
2045
+ description: string;
2046
+ required: boolean;
2047
+ level: number;
2048
+ values?: string[] | undefined;
2049
+ items?: Record<string, unknown> | undefined;
2050
+ }>, "many">;
2051
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2052
+ }, "strict", z.ZodTypeAny, {
2053
+ shape: {
2054
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
2055
+ id: string;
2056
+ name: string;
2057
+ description: string;
2058
+ required: boolean;
2059
+ level: number;
2060
+ values?: string[] | undefined;
2061
+ items?: Record<string, unknown> | undefined;
2062
+ }[];
2063
+ format: "text" | "json";
2064
+ delivery: "stream" | "once" | "webhook";
2065
+ webhookUrl: string;
2066
+ schema?: Record<string, unknown> | undefined;
2067
+ }, {
2068
+ shape: {
2069
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
2070
+ id: string;
2071
+ name: string;
2072
+ description: string;
2073
+ required: boolean;
2074
+ level: number;
2075
+ values?: string[] | undefined;
2076
+ items?: Record<string, unknown> | undefined;
2077
+ }[];
2078
+ format: "text" | "json";
2079
+ delivery: "stream" | "once" | "webhook";
2080
+ webhookUrl: string;
2081
+ schema?: Record<string, unknown> | undefined;
2082
+ }>;
2083
+ runPlan: z.ZodObject<{
2084
+ preparations: z.ZodDefault<z.ZodArray<z.ZodObject<{
2085
+ id: z.ZodString;
2086
+ kind: z.ZodEnum<["app", "mcp", "workbench"]>;
2087
+ capabilityId: z.ZodString;
2088
+ toolKey: z.ZodString;
2089
+ name: z.ZodString;
2090
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2091
+ bindings: z.ZodArray<z.ZodObject<{
2092
+ source: z.ZodEnum<["variable", "context", "message"]>;
2093
+ path: z.ZodArray<z.ZodString, "many">;
2094
+ target: z.ZodArray<z.ZodString, "many">;
2095
+ }, "strict", z.ZodTypeAny, {
2096
+ path: string[];
2097
+ source: "message" | "variable" | "context";
2098
+ target: string[];
2099
+ }, {
2100
+ path: string[];
2101
+ source: "message" | "variable" | "context";
2102
+ target: string[];
2103
+ }>, "many">;
2104
+ }, "strict", z.ZodTypeAny, {
2105
+ kind: "workbench" | "mcp" | "app";
2106
+ id: string;
2107
+ name: string;
2108
+ bindings: {
2109
+ path: string[];
2110
+ source: "message" | "variable" | "context";
2111
+ target: string[];
2112
+ }[];
2113
+ capabilityId: string;
2114
+ toolKey: string;
2115
+ input: Record<string, unknown>;
2116
+ }, {
2117
+ kind: "workbench" | "mcp" | "app";
2118
+ id: string;
2119
+ name: string;
2120
+ bindings: {
2121
+ path: string[];
2122
+ source: "message" | "variable" | "context";
2123
+ target: string[];
2124
+ }[];
2125
+ capabilityId: string;
2126
+ toolKey: string;
2127
+ input: Record<string, unknown>;
2128
+ }>, "many">>;
2129
+ before: z.ZodArray<z.ZodString, "many">;
2130
+ after: z.ZodArray<z.ZodString, "many">;
2131
+ off: z.ZodArray<z.ZodString, "many">;
2132
+ stopOnFail: z.ZodArray<z.ZodString, "many">;
2133
+ stepLimit: z.ZodEffects<z.ZodNullable<z.ZodNumber>, number, number | null>;
2134
+ }, "strict", z.ZodTypeAny, {
2135
+ before: string[];
2136
+ after: string[];
2137
+ preparations: {
2138
+ kind: "workbench" | "mcp" | "app";
2139
+ id: string;
2140
+ name: string;
2141
+ bindings: {
2142
+ path: string[];
2143
+ source: "message" | "variable" | "context";
2144
+ target: string[];
2145
+ }[];
2146
+ capabilityId: string;
2147
+ toolKey: string;
2148
+ input: Record<string, unknown>;
2149
+ }[];
2150
+ off: string[];
2151
+ stopOnFail: string[];
2152
+ stepLimit: number;
2153
+ }, {
2154
+ before: string[];
2155
+ after: string[];
2156
+ off: string[];
2157
+ stopOnFail: string[];
2158
+ stepLimit: number | null;
2159
+ preparations?: {
2160
+ kind: "workbench" | "mcp" | "app";
2161
+ id: string;
2162
+ name: string;
2163
+ bindings: {
2164
+ path: string[];
2165
+ source: "message" | "variable" | "context";
2166
+ target: string[];
2167
+ }[];
2168
+ capabilityId: string;
2169
+ toolKey: string;
2170
+ input: Record<string, unknown>;
2171
+ }[] | undefined;
2172
+ }>;
2173
+ }, "strict", z.ZodTypeAny, {
2174
+ name: string;
2175
+ workbench: {
2176
+ enabled: boolean;
2177
+ files: "per_customer" | "per_run";
2178
+ configured: boolean;
2179
+ size: "medium" | "small" | "large";
2180
+ access: "allow" | "ask" | "block";
2181
+ languages: string[];
2182
+ longestRun: "1 minute" | "3 minutes" | "10 minutes";
2183
+ };
2184
+ instructions: {
2185
+ text: string;
2186
+ editedAt: string | null;
2187
+ };
2188
+ context: {
2189
+ knowledge: {
2190
+ status: "failed" | "ready" | "syncing";
2191
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
2192
+ id: string;
2193
+ name: string;
2194
+ scope: "customer" | "project";
2195
+ detail: string;
2196
+ syncedLabel: string;
2197
+ error?: string | undefined;
2198
+ url?: string | undefined;
2199
+ connectedSource?: {
2200
+ accountId: string;
2201
+ resourceId: string;
2202
+ } | undefined;
2203
+ pages?: {
2204
+ done: number;
2205
+ total: number;
2206
+ } | undefined;
2207
+ progress?: {
2208
+ done: number;
2209
+ total: number;
2210
+ stage: string;
2211
+ retryable: boolean;
2212
+ } | undefined;
2213
+ }[];
2214
+ readPages: boolean;
2215
+ searchPastChats: boolean;
2216
+ conversationRetentionDays: number;
2217
+ apis: {
2218
+ kind: "http" | "graphql" | "openapi";
2219
+ id: string;
2220
+ name: string;
2221
+ host: string;
2222
+ baseUrl: string;
2223
+ auth: "one" | "each" | "oauth" | "none";
2224
+ sendCustomerIdentity: boolean;
2225
+ calls: {
2226
+ path: string;
2227
+ id: string;
2228
+ name: string;
2229
+ query: Record<string, string>;
2230
+ body: string;
2231
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2232
+ bodyType: "json" | "form" | "xml" | "gql";
2233
+ readAs: "text" | "json" | "auto" | "xml";
2234
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
2235
+ summary: string;
2236
+ latencyMs: number | null;
2237
+ visibleFields: string[];
2238
+ effects: "read" | "write" | "unclassified";
2239
+ permission: "allow" | "ask" | "block";
2240
+ headers: Record<string, string>;
2241
+ bindings: {
2242
+ path: string[];
2243
+ source: "variable" | "context" | "model" | "identity";
2244
+ target: "path" | "query" | "header" | "body";
2245
+ key: string;
2246
+ }[];
2247
+ sample?: unknown;
2248
+ inputSchema?: Record<string, unknown> | undefined;
2249
+ responseSchema?: Record<string, unknown> | undefined;
2250
+ }[];
2251
+ credentialId?: string | undefined;
2252
+ authHeader?: string | undefined;
2253
+ }[];
2254
+ apps: {
2255
+ key: string;
2256
+ account: "customer" | "project";
2257
+ rules: {
2258
+ read: "allow" | "ask" | "block";
2259
+ change: "allow" | "ask" | "block";
2260
+ delete: "allow" | "ask" | "block";
2261
+ };
2262
+ actionRules: Record<string, "allow" | "ask" | "block">;
2263
+ pinned: string[];
2264
+ accountId?: string | undefined;
2265
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
2266
+ }[];
2267
+ mcpServers: {
2268
+ status: "connecting" | "connected";
2269
+ id: string;
2270
+ name: string;
2271
+ url: string;
2272
+ toolCount: number;
2273
+ definitions: {
2274
+ name: string;
2275
+ inputSchema: Record<string, unknown>;
2276
+ description: string;
2277
+ outputSchema?: Record<string, unknown> | undefined;
2278
+ }[];
2279
+ groups: {
2280
+ name: "Read" | "Change" | "Delete";
2281
+ count: number;
2282
+ rule: "allow" | "ask" | "block";
2283
+ tools: string[];
2284
+ }[];
2285
+ credentialId?: string | undefined;
2286
+ }[];
2287
+ webSearch: {
2288
+ enabled: boolean;
2289
+ provider: "builtin";
2290
+ preferSites: string[];
2291
+ };
2292
+ };
2293
+ memory: {
2294
+ never: string[];
2295
+ enabled: boolean;
2296
+ configured: boolean;
2297
+ who: {
2298
+ customer: boolean;
2299
+ company: boolean;
2300
+ bot: boolean;
2301
+ };
2302
+ what: string;
2303
+ forgetAfter: "1 year" | "6 months" | "90 days" | "Never";
2304
+ };
2305
+ model: {
2306
+ id: string;
2307
+ effort: "low" | "medium" | "high";
2308
+ };
2309
+ variables: {
2310
+ type: "Text" | "Number" | "Yes or no" | "One of…";
2311
+ name: string;
2312
+ description: string;
2313
+ required: boolean;
2314
+ defaultValue: string;
2315
+ usedIn: ("instructions" | "api" | "run_plan")[];
2316
+ chipNote: string;
2317
+ values?: string[] | undefined;
2318
+ }[];
2319
+ skills: {
2320
+ id: string;
2321
+ name: string;
2322
+ files: {
2323
+ name: string;
2324
+ content: string;
2325
+ }[];
2326
+ instructions: string;
2327
+ summary: string;
2328
+ icon: "refund" | "link" | "person" | "voice" | "mail" | "term" | "box" | "pencil";
2329
+ load: "auto" | "always";
2330
+ cases: {
2331
+ text: string;
2332
+ }[];
2333
+ exceptions: {
2334
+ text: string;
2335
+ }[];
2336
+ examples: {
2337
+ use: string[];
2338
+ notFor: string[];
2339
+ };
2340
+ onlyIf: {
2341
+ values: string;
2342
+ field: string;
2343
+ check: "is one of" | "is" | "is not";
2344
+ }[];
2345
+ }[];
2346
+ answer: {
2347
+ shape: {
2348
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
2349
+ id: string;
2350
+ name: string;
2351
+ description: string;
2352
+ required: boolean;
2353
+ level: number;
2354
+ values?: string[] | undefined;
2355
+ items?: Record<string, unknown> | undefined;
2356
+ }[];
2357
+ format: "text" | "json";
2358
+ delivery: "stream" | "once" | "webhook";
2359
+ webhookUrl: string;
2360
+ schema?: Record<string, unknown> | undefined;
2361
+ };
2362
+ runPlan: {
2363
+ before: string[];
2364
+ after: string[];
2365
+ preparations: {
2366
+ kind: "workbench" | "mcp" | "app";
2367
+ id: string;
2368
+ name: string;
2369
+ bindings: {
2370
+ path: string[];
2371
+ source: "message" | "variable" | "context";
2372
+ target: string[];
2373
+ }[];
2374
+ capabilityId: string;
2375
+ toolKey: string;
2376
+ input: Record<string, unknown>;
2377
+ }[];
2378
+ off: string[];
2379
+ stopOnFail: string[];
2380
+ stepLimit: number;
2381
+ };
2382
+ triggers: ({
2383
+ kind: "app";
2384
+ id: string;
2385
+ enabled: boolean;
2386
+ name: string;
2387
+ subscriptionId: string;
2388
+ label: string;
2389
+ providerKey: string;
2390
+ eventTypes: string[];
2391
+ runsAs: "none" | "field";
2392
+ customerField: string;
2393
+ instruction: string;
2394
+ answerTo: "webhook" | "none";
2395
+ variables: Record<string, unknown>;
2396
+ } | {
2397
+ kind: "webhook";
2398
+ id: string;
2399
+ tenantId: string;
2400
+ enabled: boolean;
2401
+ name: string;
2402
+ runsAs: "none" | "field";
2403
+ customerField: string;
2404
+ instruction: string;
2405
+ answerTo: "webhook" | "none";
2406
+ variables: Record<string, unknown>;
2407
+ } | {
2408
+ every: "week" | "day" | "hour";
2409
+ kind: "schedule";
2410
+ date: string;
2411
+ id: string;
2412
+ tenantId: string;
2413
+ enabled: boolean;
2414
+ name: string;
2415
+ runsAs: "one" | "none";
2416
+ instruction: string;
2417
+ answerTo: "webhook" | "none";
2418
+ variables: Record<string, unknown>;
2419
+ repeat: "once" | "repeat";
2420
+ days: number[];
2421
+ time: string;
2422
+ timezone: string;
2423
+ customerId: string;
2424
+ })[];
2425
+ }, {
2426
+ name: string;
2427
+ workbench: {
2428
+ enabled: boolean;
2429
+ files: "per_customer" | "per_run";
2430
+ configured: boolean;
2431
+ size: "medium" | "small" | "large";
2432
+ access: "allow" | "ask" | "block";
2433
+ languages: string[];
2434
+ longestRun: "1 minute" | "3 minutes" | "10 minutes";
2435
+ };
2436
+ instructions: {
2437
+ text: string;
2438
+ editedAt: string | null;
2439
+ };
2440
+ context: {
2441
+ knowledge: {
2442
+ status: "failed" | "ready" | "syncing";
2443
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
2444
+ id: string;
2445
+ name: string;
2446
+ detail: string;
2447
+ syncedLabel: string;
2448
+ error?: string | undefined;
2449
+ url?: string | undefined;
2450
+ scope?: "customer" | "project" | undefined;
2451
+ connectedSource?: {
2452
+ accountId: string;
2453
+ resourceId: string;
2454
+ } | undefined;
2455
+ pages?: {
2456
+ done: number;
2457
+ total: number;
2458
+ } | undefined;
2459
+ progress?: {
2460
+ done: number;
2461
+ total: number;
2462
+ stage: string;
2463
+ retryable: boolean;
2464
+ } | undefined;
2465
+ }[];
2466
+ apis: {
2467
+ kind: "http" | "graphql" | "openapi";
2468
+ id: string;
2469
+ name: string;
2470
+ host: string;
2471
+ baseUrl: string;
2472
+ auth: "one" | "each" | "oauth" | "none";
2473
+ sendCustomerIdentity: boolean;
2474
+ calls: {
2475
+ path: string;
2476
+ id: string;
2477
+ name: string;
2478
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2479
+ bodyType: "json" | "form" | "xml" | "gql";
2480
+ readAs: "text" | "json" | "auto" | "xml";
2481
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
2482
+ summary: string;
2483
+ latencyMs: number | null;
2484
+ visibleFields: string[];
2485
+ effects: "read" | "write" | "unclassified";
2486
+ sample?: unknown;
2487
+ query?: Record<string, string> | undefined;
2488
+ body?: string | undefined;
2489
+ permission?: "allow" | "ask" | "block" | undefined;
2490
+ inputSchema?: Record<string, unknown> | undefined;
2491
+ headers?: Record<string, string> | undefined;
2492
+ bindings?: {
2493
+ path: string[];
2494
+ source: "variable" | "context" | "model" | "identity";
2495
+ target: "path" | "query" | "header" | "body";
2496
+ key: string;
2497
+ }[] | undefined;
2498
+ responseSchema?: Record<string, unknown> | undefined;
2499
+ }[];
2500
+ credentialId?: string | undefined;
2501
+ authHeader?: string | undefined;
2502
+ }[];
2503
+ apps: {
2504
+ key: string;
2505
+ account: "customer" | "project";
2506
+ rules: {
2507
+ read: "allow" | "ask" | "block";
2508
+ change: "allow" | "ask" | "block";
2509
+ delete: "allow" | "ask" | "block";
2510
+ };
2511
+ actionRules: Record<string, "allow" | "ask" | "block">;
2512
+ pinned: string[];
2513
+ accountId?: string | undefined;
2514
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
2515
+ }[];
2516
+ mcpServers: {
2517
+ status: "connecting" | "connected";
2518
+ id: string;
2519
+ name: string;
2520
+ url: string;
2521
+ toolCount: number;
2522
+ groups: {
2523
+ name: "Read" | "Change" | "Delete";
2524
+ count: number;
2525
+ rule: "allow" | "ask" | "block";
2526
+ tools: string[];
2527
+ }[];
2528
+ credentialId?: string | undefined;
2529
+ definitions?: {
2530
+ name: string;
2531
+ inputSchema: Record<string, unknown>;
2532
+ description: string;
2533
+ outputSchema?: Record<string, unknown> | undefined;
2534
+ }[] | undefined;
2535
+ }[];
2536
+ webSearch: {
2537
+ enabled: boolean;
2538
+ provider: "builtin" | "exa" | "firecrawl";
2539
+ preferSites: string[];
2540
+ };
2541
+ readPages?: boolean | undefined;
2542
+ searchPastChats?: boolean | undefined;
2543
+ conversationRetentionDays?: number | undefined;
2544
+ };
2545
+ memory: {
2546
+ never: string[];
2547
+ enabled: boolean;
2548
+ configured: boolean;
2549
+ who: {
2550
+ customer: boolean;
2551
+ company: boolean;
2552
+ bot: boolean;
2553
+ };
2554
+ what: string;
2555
+ forgetAfter: "1 year" | "6 months" | "90 days" | "Never";
2556
+ };
2557
+ model: {
2558
+ id: string;
2559
+ effort: "low" | "medium" | "high";
2560
+ };
2561
+ variables: {
2562
+ type: "Text" | "Number" | "Yes or no" | "One of…";
2563
+ name: string;
2564
+ description: string;
2565
+ required: boolean;
2566
+ defaultValue: string;
2567
+ usedIn: ("instructions" | "api" | "run_plan")[];
2568
+ chipNote: string;
2569
+ values?: string[] | undefined;
2570
+ }[];
2571
+ skills: {
2572
+ id: string;
2573
+ name: string;
2574
+ summary: string;
2575
+ icon: "refund" | "link" | "person" | "voice" | "mail" | "term" | "box" | "pencil";
2576
+ load: "auto" | "always";
2577
+ cases: {
2578
+ text: string;
2579
+ }[];
2580
+ exceptions: {
2581
+ text: string;
2582
+ }[];
2583
+ examples: {
2584
+ use: string[];
2585
+ notFor: string[];
2586
+ };
2587
+ onlyIf: {
2588
+ values: string;
2589
+ field: string;
2590
+ check: "is one of" | "is" | "is not";
2591
+ }[];
2592
+ files?: {
2593
+ name: string;
2594
+ content: string;
2595
+ }[] | undefined;
2596
+ instructions?: string | undefined;
2597
+ }[];
2598
+ answer: {
2599
+ shape: {
2600
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
2601
+ id: string;
2602
+ name: string;
2603
+ description: string;
2604
+ required: boolean;
2605
+ level: number;
2606
+ values?: string[] | undefined;
2607
+ items?: Record<string, unknown> | undefined;
2608
+ }[];
2609
+ format: "text" | "json";
2610
+ delivery: "stream" | "once" | "webhook";
2611
+ webhookUrl: string;
2612
+ schema?: Record<string, unknown> | undefined;
2613
+ };
2614
+ runPlan: {
2615
+ before: string[];
2616
+ after: string[];
2617
+ off: string[];
2618
+ stopOnFail: string[];
2619
+ stepLimit: number | null;
2620
+ preparations?: {
2621
+ kind: "workbench" | "mcp" | "app";
2622
+ id: string;
2623
+ name: string;
2624
+ bindings: {
2625
+ path: string[];
2626
+ source: "message" | "variable" | "context";
2627
+ target: string[];
2628
+ }[];
2629
+ capabilityId: string;
2630
+ toolKey: string;
2631
+ input: Record<string, unknown>;
2632
+ }[] | undefined;
2633
+ };
2634
+ triggers?: ({
2635
+ kind: "app";
2636
+ id: string;
2637
+ enabled: boolean;
2638
+ name: string;
2639
+ subscriptionId: string;
2640
+ label: string;
2641
+ providerKey: string;
2642
+ eventTypes: string[];
2643
+ runsAs: "none" | "field";
2644
+ customerField: string;
2645
+ instruction: string;
2646
+ answerTo: "webhook" | "none";
2647
+ variables?: Record<string, unknown> | undefined;
2648
+ } | {
2649
+ kind: "webhook";
2650
+ id: string;
2651
+ tenantId: string;
2652
+ enabled: boolean;
2653
+ name: string;
2654
+ runsAs: "none" | "field";
2655
+ customerField: string;
2656
+ instruction: string;
2657
+ answerTo: "webhook" | "none";
2658
+ variables?: Record<string, unknown> | undefined;
2659
+ } | {
2660
+ every: "week" | "day" | "hour";
2661
+ kind: "schedule";
2662
+ date: string;
2663
+ id: string;
2664
+ tenantId: string;
2665
+ enabled: boolean;
2666
+ name: string;
2667
+ runsAs: "one" | "none";
2668
+ instruction: string;
2669
+ answerTo: "webhook" | "none";
2670
+ repeat: "once" | "repeat";
2671
+ days: number[];
2672
+ time: string;
2673
+ timezone: string;
2674
+ customerId: string;
2675
+ variables?: Record<string, unknown> | undefined;
2676
+ })[] | undefined;
2677
+ }>;
2678
+ export declare const botPatchSchema: z.ZodObject<{
2679
+ name: z.ZodOptional<z.ZodString>;
2680
+ triggers: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2681
+ kind: z.ZodLiteral<"app">;
2682
+ subscriptionId: z.ZodString;
2683
+ label: z.ZodString;
2684
+ providerKey: z.ZodString;
2685
+ eventTypes: z.ZodArray<z.ZodString, "many">;
2686
+ runsAs: z.ZodEnum<["none", "field"]>;
2687
+ customerField: z.ZodString;
2688
+ id: z.ZodString;
2689
+ name: z.ZodString;
2690
+ instruction: z.ZodString;
2691
+ enabled: z.ZodBoolean;
2692
+ answerTo: z.ZodEnum<["webhook", "none"]>;
2693
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2694
+ }, "strict", z.ZodTypeAny, {
2695
+ kind: "app";
2696
+ id: string;
2697
+ enabled: boolean;
2698
+ name: string;
2699
+ subscriptionId: string;
2700
+ label: string;
2701
+ providerKey: string;
2702
+ eventTypes: string[];
2703
+ runsAs: "none" | "field";
2704
+ customerField: string;
2705
+ instruction: string;
2706
+ answerTo: "webhook" | "none";
2707
+ variables: Record<string, unknown>;
2708
+ }, {
2709
+ kind: "app";
2710
+ id: string;
2711
+ enabled: boolean;
2712
+ name: string;
2713
+ subscriptionId: string;
2714
+ label: string;
2715
+ providerKey: string;
2716
+ eventTypes: string[];
2717
+ runsAs: "none" | "field";
2718
+ customerField: string;
2719
+ instruction: string;
2720
+ answerTo: "webhook" | "none";
2721
+ variables?: Record<string, unknown> | undefined;
2722
+ }>, z.ZodObject<{
2723
+ kind: z.ZodLiteral<"webhook">;
2724
+ tenantId: z.ZodString;
2725
+ runsAs: z.ZodEnum<["none", "field"]>;
2726
+ customerField: z.ZodString;
2727
+ id: z.ZodString;
2728
+ name: z.ZodString;
2729
+ instruction: z.ZodString;
2730
+ enabled: z.ZodBoolean;
2731
+ answerTo: z.ZodEnum<["webhook", "none"]>;
2732
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2733
+ }, "strict", z.ZodTypeAny, {
2734
+ kind: "webhook";
2735
+ id: string;
2736
+ tenantId: string;
2737
+ enabled: boolean;
2738
+ name: string;
2739
+ runsAs: "none" | "field";
2740
+ customerField: string;
2741
+ instruction: string;
2742
+ answerTo: "webhook" | "none";
2743
+ variables: Record<string, unknown>;
2744
+ }, {
2745
+ kind: "webhook";
2746
+ id: string;
2747
+ tenantId: string;
2748
+ enabled: boolean;
2749
+ name: string;
2750
+ runsAs: "none" | "field";
2751
+ customerField: string;
2752
+ instruction: string;
2753
+ answerTo: "webhook" | "none";
2754
+ variables?: Record<string, unknown> | undefined;
2755
+ }>, z.ZodObject<{
2756
+ kind: z.ZodLiteral<"schedule">;
2757
+ tenantId: z.ZodString;
2758
+ repeat: z.ZodEnum<["repeat", "once"]>;
2759
+ every: z.ZodEnum<["week", "day", "hour"]>;
2760
+ days: z.ZodArray<z.ZodNumber, "many">;
2761
+ time: z.ZodString;
2762
+ date: z.ZodString;
2763
+ timezone: z.ZodString;
2764
+ runsAs: z.ZodEnum<["none", "one"]>;
2765
+ customerId: z.ZodString;
2766
+ id: z.ZodString;
2767
+ name: z.ZodString;
2768
+ instruction: z.ZodString;
2769
+ enabled: z.ZodBoolean;
2770
+ answerTo: z.ZodEnum<["webhook", "none"]>;
2771
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2772
+ }, "strict", z.ZodTypeAny, {
2773
+ every: "week" | "day" | "hour";
2774
+ kind: "schedule";
2775
+ date: string;
2776
+ id: string;
2777
+ tenantId: string;
2778
+ enabled: boolean;
2779
+ name: string;
2780
+ runsAs: "one" | "none";
2781
+ instruction: string;
2782
+ answerTo: "webhook" | "none";
2783
+ variables: Record<string, unknown>;
2784
+ repeat: "once" | "repeat";
2785
+ days: number[];
2786
+ time: string;
2787
+ timezone: string;
2788
+ customerId: string;
2789
+ }, {
2790
+ every: "week" | "day" | "hour";
2791
+ kind: "schedule";
2792
+ date: string;
2793
+ id: string;
2794
+ tenantId: string;
2795
+ enabled: boolean;
2796
+ name: string;
2797
+ runsAs: "one" | "none";
2798
+ instruction: string;
2799
+ answerTo: "webhook" | "none";
2800
+ repeat: "once" | "repeat";
2801
+ days: number[];
2802
+ time: string;
2803
+ timezone: string;
2804
+ customerId: string;
2805
+ variables?: Record<string, unknown> | undefined;
2806
+ }>]>, "many">>>;
2807
+ model: z.ZodOptional<z.ZodObject<{
2808
+ id: z.ZodString;
2809
+ effort: z.ZodEnum<["low", "medium", "high"]>;
2810
+ }, "strict", z.ZodTypeAny, {
2811
+ id: string;
2812
+ effort: "low" | "medium" | "high";
2813
+ }, {
2814
+ id: string;
2815
+ effort: "low" | "medium" | "high";
2816
+ }>>;
2817
+ instructions: z.ZodOptional<z.ZodObject<{
2818
+ text: z.ZodString;
2819
+ editedAt: z.ZodNullable<z.ZodString>;
2820
+ }, "strict", z.ZodTypeAny, {
2821
+ text: string;
2822
+ editedAt: string | null;
2823
+ }, {
2824
+ text: string;
2825
+ editedAt: string | null;
2826
+ }>>;
2827
+ skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
2828
+ id: z.ZodString;
2829
+ name: z.ZodString;
2830
+ summary: z.ZodString;
2831
+ icon: z.ZodEnum<["refund", "link", "person", "voice", "mail", "term", "box", "pencil"]>;
2832
+ load: z.ZodEnum<["auto", "always"]>;
2833
+ cases: z.ZodArray<z.ZodObject<{
2834
+ text: z.ZodString;
2835
+ }, "strict", z.ZodTypeAny, {
2836
+ text: string;
2837
+ }, {
2838
+ text: string;
2839
+ }>, "many">;
2840
+ exceptions: z.ZodArray<z.ZodObject<{
2841
+ text: z.ZodString;
2842
+ }, "strict", z.ZodTypeAny, {
2843
+ text: string;
2844
+ }, {
2845
+ text: string;
2846
+ }>, "many">;
2847
+ examples: z.ZodObject<{
2848
+ use: z.ZodArray<z.ZodString, "many">;
2849
+ notFor: z.ZodArray<z.ZodString, "many">;
2850
+ }, "strict", z.ZodTypeAny, {
2851
+ use: string[];
2852
+ notFor: string[];
2853
+ }, {
2854
+ use: string[];
2855
+ notFor: string[];
2856
+ }>;
2857
+ onlyIf: z.ZodArray<z.ZodObject<{
2858
+ field: z.ZodString;
2859
+ check: z.ZodEnum<["is one of", "is", "is not"]>;
2860
+ values: z.ZodString;
2861
+ }, "strict", z.ZodTypeAny, {
2862
+ values: string;
2863
+ field: string;
2864
+ check: "is one of" | "is" | "is not";
2865
+ }, {
2866
+ values: string;
2867
+ field: string;
2868
+ check: "is one of" | "is" | "is not";
2869
+ }>, "many">;
2870
+ instructions: z.ZodDefault<z.ZodString>;
2871
+ files: z.ZodDefault<z.ZodArray<z.ZodObject<{
2872
+ name: z.ZodString;
2873
+ content: z.ZodString;
2874
+ }, "strict", z.ZodTypeAny, {
2875
+ name: string;
2876
+ content: string;
2877
+ }, {
2878
+ name: string;
2879
+ content: string;
2880
+ }>, "many">>;
2881
+ }, "strict", z.ZodTypeAny, {
2882
+ id: string;
2883
+ name: string;
2884
+ files: {
2885
+ name: string;
2886
+ content: string;
2887
+ }[];
2888
+ instructions: string;
2889
+ summary: string;
2890
+ icon: "refund" | "link" | "person" | "voice" | "mail" | "term" | "box" | "pencil";
2891
+ load: "auto" | "always";
2892
+ cases: {
2893
+ text: string;
2894
+ }[];
2895
+ exceptions: {
2896
+ text: string;
2897
+ }[];
2898
+ examples: {
2899
+ use: string[];
2900
+ notFor: string[];
2901
+ };
2902
+ onlyIf: {
2903
+ values: string;
2904
+ field: string;
2905
+ check: "is one of" | "is" | "is not";
2906
+ }[];
2907
+ }, {
2908
+ id: string;
2909
+ name: string;
2910
+ summary: string;
2911
+ icon: "refund" | "link" | "person" | "voice" | "mail" | "term" | "box" | "pencil";
2912
+ load: "auto" | "always";
2913
+ cases: {
2914
+ text: string;
2915
+ }[];
2916
+ exceptions: {
2917
+ text: string;
2918
+ }[];
2919
+ examples: {
2920
+ use: string[];
2921
+ notFor: string[];
2922
+ };
2923
+ onlyIf: {
2924
+ values: string;
2925
+ field: string;
2926
+ check: "is one of" | "is" | "is not";
2927
+ }[];
2928
+ files?: {
2929
+ name: string;
2930
+ content: string;
2931
+ }[] | undefined;
2932
+ instructions?: string | undefined;
2933
+ }>, "many">>;
2934
+ memory: z.ZodOptional<z.ZodObject<{
2935
+ enabled: z.ZodBoolean;
2936
+ configured: z.ZodBoolean;
2937
+ who: z.ZodObject<{
2938
+ customer: z.ZodBoolean;
2939
+ company: z.ZodBoolean;
2940
+ bot: z.ZodBoolean;
2941
+ }, "strict", z.ZodTypeAny, {
2942
+ customer: boolean;
2943
+ company: boolean;
2944
+ bot: boolean;
2945
+ }, {
2946
+ customer: boolean;
2947
+ company: boolean;
2948
+ bot: boolean;
2949
+ }>;
2950
+ what: z.ZodString;
2951
+ never: z.ZodArray<z.ZodString, "many">;
2952
+ forgetAfter: z.ZodEnum<["1 year", "6 months", "90 days", "Never"]>;
2953
+ }, "strict", z.ZodTypeAny, {
2954
+ never: string[];
2955
+ enabled: boolean;
2956
+ configured: boolean;
2957
+ who: {
2958
+ customer: boolean;
2959
+ company: boolean;
2960
+ bot: boolean;
2961
+ };
2962
+ what: string;
2963
+ forgetAfter: "1 year" | "6 months" | "90 days" | "Never";
2964
+ }, {
2965
+ never: string[];
2966
+ enabled: boolean;
2967
+ configured: boolean;
2968
+ who: {
2969
+ customer: boolean;
2970
+ company: boolean;
2971
+ bot: boolean;
2972
+ };
2973
+ what: string;
2974
+ forgetAfter: "1 year" | "6 months" | "90 days" | "Never";
2975
+ }>>;
2976
+ workbench: z.ZodOptional<z.ZodObject<{
2977
+ enabled: z.ZodBoolean;
2978
+ configured: z.ZodBoolean;
2979
+ size: z.ZodEnum<["small", "medium", "large"]>;
2980
+ access: z.ZodEnum<["allow", "ask", "block"]>;
2981
+ languages: z.ZodArray<z.ZodString, "many">;
2982
+ files: z.ZodEnum<["per_customer", "per_run"]>;
2983
+ longestRun: z.ZodEnum<["1 minute", "3 minutes", "10 minutes"]>;
2984
+ }, "strict", z.ZodTypeAny, {
2985
+ enabled: boolean;
2986
+ files: "per_customer" | "per_run";
2987
+ configured: boolean;
2988
+ size: "medium" | "small" | "large";
2989
+ access: "allow" | "ask" | "block";
2990
+ languages: string[];
2991
+ longestRun: "1 minute" | "3 minutes" | "10 minutes";
2992
+ }, {
2993
+ enabled: boolean;
2994
+ files: "per_customer" | "per_run";
2995
+ configured: boolean;
2996
+ size: "medium" | "small" | "large";
2997
+ access: "allow" | "ask" | "block";
2998
+ languages: string[];
2999
+ longestRun: "1 minute" | "3 minutes" | "10 minutes";
3000
+ }>>;
3001
+ context: z.ZodOptional<z.ZodObject<{
3002
+ readPages: z.ZodDefault<z.ZodBoolean>;
3003
+ searchPastChats: z.ZodDefault<z.ZodBoolean>;
3004
+ conversationRetentionDays: z.ZodDefault<z.ZodNumber>;
3005
+ apis: z.ZodArray<z.ZodObject<{
3006
+ id: z.ZodString;
3007
+ name: z.ZodString;
3008
+ host: z.ZodString;
3009
+ baseUrl: z.ZodString;
3010
+ kind: z.ZodEnum<["http", "graphql", "openapi"]>;
3011
+ auth: z.ZodEnum<["one", "each", "oauth", "none"]>;
3012
+ sendCustomerIdentity: z.ZodBoolean;
3013
+ credentialId: z.ZodOptional<z.ZodString>;
3014
+ authHeader: z.ZodOptional<z.ZodString>;
3015
+ calls: z.ZodArray<z.ZodObject<{
3016
+ id: z.ZodString;
3017
+ name: z.ZodString;
3018
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
3019
+ path: z.ZodString;
3020
+ bodyType: z.ZodEnum<["json", "form", "xml", "gql"]>;
3021
+ readAs: z.ZodEnum<["auto", "json", "xml", "text"]>;
3022
+ timeout: z.ZodEnum<["2 seconds", "5 seconds", "10 seconds"]>;
3023
+ summary: z.ZodString;
3024
+ latencyMs: z.ZodNullable<z.ZodNumber>;
3025
+ visibleFields: z.ZodArray<z.ZodString, "many">;
3026
+ effects: z.ZodEnum<["read", "write", "unclassified"]>;
3027
+ permission: z.ZodDefault<z.ZodEnum<["allow", "ask", "block"]>>;
3028
+ inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3029
+ headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
3030
+ query: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
3031
+ body: z.ZodDefault<z.ZodString>;
3032
+ bindings: z.ZodDefault<z.ZodArray<z.ZodObject<{
3033
+ source: z.ZodEnum<["identity", "variable", "context", "model"]>;
3034
+ path: z.ZodArray<z.ZodString, "many">;
3035
+ target: z.ZodEnum<["path", "query", "header", "body"]>;
3036
+ key: z.ZodString;
3037
+ }, "strict", z.ZodTypeAny, {
3038
+ path: string[];
3039
+ source: "variable" | "context" | "model" | "identity";
3040
+ target: "path" | "query" | "header" | "body";
3041
+ key: string;
3042
+ }, {
3043
+ path: string[];
3044
+ source: "variable" | "context" | "model" | "identity";
3045
+ target: "path" | "query" | "header" | "body";
3046
+ key: string;
3047
+ }>, "many">>;
3048
+ responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3049
+ sample: z.ZodOptional<z.ZodUnknown>;
3050
+ }, "strict", z.ZodTypeAny, {
3051
+ path: string;
3052
+ id: string;
3053
+ name: string;
3054
+ query: Record<string, string>;
3055
+ body: string;
3056
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
3057
+ bodyType: "json" | "form" | "xml" | "gql";
3058
+ readAs: "text" | "json" | "auto" | "xml";
3059
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
3060
+ summary: string;
3061
+ latencyMs: number | null;
3062
+ visibleFields: string[];
3063
+ effects: "read" | "write" | "unclassified";
3064
+ permission: "allow" | "ask" | "block";
3065
+ headers: Record<string, string>;
3066
+ bindings: {
3067
+ path: string[];
3068
+ source: "variable" | "context" | "model" | "identity";
3069
+ target: "path" | "query" | "header" | "body";
3070
+ key: string;
3071
+ }[];
3072
+ sample?: unknown;
3073
+ inputSchema?: Record<string, unknown> | undefined;
3074
+ responseSchema?: Record<string, unknown> | undefined;
3075
+ }, {
3076
+ path: string;
3077
+ id: string;
3078
+ name: string;
3079
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
3080
+ bodyType: "json" | "form" | "xml" | "gql";
3081
+ readAs: "text" | "json" | "auto" | "xml";
3082
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
3083
+ summary: string;
3084
+ latencyMs: number | null;
3085
+ visibleFields: string[];
3086
+ effects: "read" | "write" | "unclassified";
3087
+ sample?: unknown;
3088
+ query?: Record<string, string> | undefined;
3089
+ body?: string | undefined;
3090
+ permission?: "allow" | "ask" | "block" | undefined;
3091
+ inputSchema?: Record<string, unknown> | undefined;
3092
+ headers?: Record<string, string> | undefined;
3093
+ bindings?: {
3094
+ path: string[];
3095
+ source: "variable" | "context" | "model" | "identity";
3096
+ target: "path" | "query" | "header" | "body";
3097
+ key: string;
3098
+ }[] | undefined;
3099
+ responseSchema?: Record<string, unknown> | undefined;
3100
+ }>, "many">;
3101
+ }, "strict", z.ZodTypeAny, {
3102
+ kind: "http" | "graphql" | "openapi";
3103
+ id: string;
3104
+ name: string;
3105
+ host: string;
3106
+ baseUrl: string;
3107
+ auth: "one" | "each" | "oauth" | "none";
3108
+ sendCustomerIdentity: boolean;
3109
+ calls: {
3110
+ path: string;
3111
+ id: string;
3112
+ name: string;
3113
+ query: Record<string, string>;
3114
+ body: string;
3115
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
3116
+ bodyType: "json" | "form" | "xml" | "gql";
3117
+ readAs: "text" | "json" | "auto" | "xml";
3118
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
3119
+ summary: string;
3120
+ latencyMs: number | null;
3121
+ visibleFields: string[];
3122
+ effects: "read" | "write" | "unclassified";
3123
+ permission: "allow" | "ask" | "block";
3124
+ headers: Record<string, string>;
3125
+ bindings: {
3126
+ path: string[];
3127
+ source: "variable" | "context" | "model" | "identity";
3128
+ target: "path" | "query" | "header" | "body";
3129
+ key: string;
3130
+ }[];
3131
+ sample?: unknown;
3132
+ inputSchema?: Record<string, unknown> | undefined;
3133
+ responseSchema?: Record<string, unknown> | undefined;
3134
+ }[];
3135
+ credentialId?: string | undefined;
3136
+ authHeader?: string | undefined;
3137
+ }, {
3138
+ kind: "http" | "graphql" | "openapi";
3139
+ id: string;
3140
+ name: string;
3141
+ host: string;
3142
+ baseUrl: string;
3143
+ auth: "one" | "each" | "oauth" | "none";
3144
+ sendCustomerIdentity: boolean;
3145
+ calls: {
3146
+ path: string;
3147
+ id: string;
3148
+ name: string;
3149
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
3150
+ bodyType: "json" | "form" | "xml" | "gql";
3151
+ readAs: "text" | "json" | "auto" | "xml";
3152
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
3153
+ summary: string;
3154
+ latencyMs: number | null;
3155
+ visibleFields: string[];
3156
+ effects: "read" | "write" | "unclassified";
3157
+ sample?: unknown;
3158
+ query?: Record<string, string> | undefined;
3159
+ body?: string | undefined;
3160
+ permission?: "allow" | "ask" | "block" | undefined;
3161
+ inputSchema?: Record<string, unknown> | undefined;
3162
+ headers?: Record<string, string> | undefined;
3163
+ bindings?: {
3164
+ path: string[];
3165
+ source: "variable" | "context" | "model" | "identity";
3166
+ target: "path" | "query" | "header" | "body";
3167
+ key: string;
3168
+ }[] | undefined;
3169
+ responseSchema?: Record<string, unknown> | undefined;
3170
+ }[];
3171
+ credentialId?: string | undefined;
3172
+ authHeader?: string | undefined;
3173
+ }>, "many">;
3174
+ apps: z.ZodArray<z.ZodObject<{
3175
+ key: z.ZodString;
3176
+ account: z.ZodEnum<["project", "customer"]>;
3177
+ accountId: z.ZodOptional<z.ZodString>;
3178
+ rules: z.ZodObject<{
3179
+ read: z.ZodEnum<["allow", "ask", "block"]>;
3180
+ change: z.ZodEnum<["allow", "ask", "block"]>;
3181
+ delete: z.ZodEnum<["allow", "ask", "block"]>;
3182
+ }, "strict", z.ZodTypeAny, {
3183
+ read: "allow" | "ask" | "block";
3184
+ change: "allow" | "ask" | "block";
3185
+ delete: "allow" | "ask" | "block";
3186
+ }, {
3187
+ read: "allow" | "ask" | "block";
3188
+ change: "allow" | "ask" | "block";
3189
+ delete: "allow" | "ask" | "block";
3190
+ }>;
3191
+ actionRules: z.ZodRecord<z.ZodString, z.ZodEnum<["allow", "ask", "block"]>>;
3192
+ askWho: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["approvers", "customer", "customer-approvers"]>>>;
3193
+ pinned: z.ZodArray<z.ZodString, "many">;
3194
+ }, "strict", z.ZodTypeAny, {
3195
+ key: string;
3196
+ account: "customer" | "project";
3197
+ rules: {
3198
+ read: "allow" | "ask" | "block";
3199
+ change: "allow" | "ask" | "block";
3200
+ delete: "allow" | "ask" | "block";
3201
+ };
3202
+ actionRules: Record<string, "allow" | "ask" | "block">;
3203
+ pinned: string[];
3204
+ accountId?: string | undefined;
3205
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
3206
+ }, {
3207
+ key: string;
3208
+ account: "customer" | "project";
3209
+ rules: {
3210
+ read: "allow" | "ask" | "block";
3211
+ change: "allow" | "ask" | "block";
3212
+ delete: "allow" | "ask" | "block";
3213
+ };
3214
+ actionRules: Record<string, "allow" | "ask" | "block">;
3215
+ pinned: string[];
3216
+ accountId?: string | undefined;
3217
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
3218
+ }>, "many">;
3219
+ mcpServers: z.ZodArray<z.ZodObject<{
3220
+ id: z.ZodString;
3221
+ name: z.ZodString;
3222
+ url: z.ZodString;
3223
+ status: z.ZodEnum<["connecting", "connected"]>;
3224
+ credentialId: z.ZodOptional<z.ZodString>;
3225
+ toolCount: z.ZodNumber;
3226
+ definitions: z.ZodDefault<z.ZodArray<z.ZodObject<{
3227
+ name: z.ZodString;
3228
+ description: z.ZodString;
3229
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3230
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3231
+ }, "strict", z.ZodTypeAny, {
3232
+ name: string;
3233
+ inputSchema: Record<string, unknown>;
3234
+ description: string;
3235
+ outputSchema?: Record<string, unknown> | undefined;
3236
+ }, {
3237
+ name: string;
3238
+ inputSchema: Record<string, unknown>;
3239
+ description: string;
3240
+ outputSchema?: Record<string, unknown> | undefined;
3241
+ }>, "many">>;
3242
+ groups: z.ZodArray<z.ZodObject<{
3243
+ name: z.ZodEnum<["Read", "Change", "Delete"]>;
3244
+ count: z.ZodNumber;
3245
+ rule: z.ZodEnum<["allow", "ask", "block"]>;
3246
+ tools: z.ZodArray<z.ZodString, "many">;
3247
+ }, "strict", z.ZodTypeAny, {
3248
+ name: "Read" | "Change" | "Delete";
3249
+ count: number;
3250
+ rule: "allow" | "ask" | "block";
3251
+ tools: string[];
3252
+ }, {
3253
+ name: "Read" | "Change" | "Delete";
3254
+ count: number;
3255
+ rule: "allow" | "ask" | "block";
3256
+ tools: string[];
3257
+ }>, "many">;
3258
+ }, "strict", z.ZodTypeAny, {
3259
+ status: "connecting" | "connected";
3260
+ id: string;
3261
+ name: string;
3262
+ url: string;
3263
+ toolCount: number;
3264
+ definitions: {
3265
+ name: string;
3266
+ inputSchema: Record<string, unknown>;
3267
+ description: string;
3268
+ outputSchema?: Record<string, unknown> | undefined;
3269
+ }[];
3270
+ groups: {
3271
+ name: "Read" | "Change" | "Delete";
3272
+ count: number;
3273
+ rule: "allow" | "ask" | "block";
3274
+ tools: string[];
3275
+ }[];
3276
+ credentialId?: string | undefined;
3277
+ }, {
3278
+ status: "connecting" | "connected";
3279
+ id: string;
3280
+ name: string;
3281
+ url: string;
3282
+ toolCount: number;
3283
+ groups: {
3284
+ name: "Read" | "Change" | "Delete";
3285
+ count: number;
3286
+ rule: "allow" | "ask" | "block";
3287
+ tools: string[];
3288
+ }[];
3289
+ credentialId?: string | undefined;
3290
+ definitions?: {
3291
+ name: string;
3292
+ inputSchema: Record<string, unknown>;
3293
+ description: string;
3294
+ outputSchema?: Record<string, unknown> | undefined;
3295
+ }[] | undefined;
3296
+ }>, "many">;
3297
+ knowledge: z.ZodArray<z.ZodObject<{
3298
+ id: z.ZodString;
3299
+ kind: z.ZodEnum<["help_center", "website", "files", "note", "notion", "google_drive"]>;
3300
+ scope: z.ZodDefault<z.ZodEnum<["project", "customer"]>>;
3301
+ connectedSource: z.ZodOptional<z.ZodObject<{
3302
+ accountId: z.ZodString;
3303
+ resourceId: z.ZodString;
3304
+ }, "strict", z.ZodTypeAny, {
3305
+ accountId: string;
3306
+ resourceId: string;
3307
+ }, {
3308
+ accountId: string;
3309
+ resourceId: string;
3310
+ }>>;
3311
+ name: z.ZodString;
3312
+ detail: z.ZodString;
3313
+ status: z.ZodEnum<["ready", "syncing", "failed"]>;
3314
+ error: z.ZodOptional<z.ZodString>;
3315
+ url: z.ZodOptional<z.ZodString>;
3316
+ pages: z.ZodOptional<z.ZodObject<{
3317
+ done: z.ZodNumber;
3318
+ total: z.ZodNumber;
3319
+ }, "strip", z.ZodTypeAny, {
3320
+ done: number;
3321
+ total: number;
3322
+ }, {
3323
+ done: number;
3324
+ total: number;
3325
+ }>>;
3326
+ progress: z.ZodOptional<z.ZodObject<{
3327
+ stage: z.ZodString;
3328
+ done: z.ZodNumber;
3329
+ total: z.ZodNumber;
3330
+ retryable: z.ZodBoolean;
3331
+ }, "strip", z.ZodTypeAny, {
3332
+ done: number;
3333
+ total: number;
3334
+ stage: string;
3335
+ retryable: boolean;
3336
+ }, {
3337
+ done: number;
3338
+ total: number;
3339
+ stage: string;
3340
+ retryable: boolean;
3341
+ }>>;
3342
+ syncedLabel: z.ZodString;
3343
+ }, "strict", z.ZodTypeAny, {
3344
+ status: "failed" | "ready" | "syncing";
3345
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
3346
+ id: string;
3347
+ name: string;
3348
+ scope: "customer" | "project";
3349
+ detail: string;
3350
+ syncedLabel: string;
3351
+ error?: string | undefined;
3352
+ url?: string | undefined;
3353
+ connectedSource?: {
3354
+ accountId: string;
3355
+ resourceId: string;
3356
+ } | undefined;
3357
+ pages?: {
3358
+ done: number;
3359
+ total: number;
3360
+ } | undefined;
3361
+ progress?: {
3362
+ done: number;
3363
+ total: number;
3364
+ stage: string;
3365
+ retryable: boolean;
3366
+ } | undefined;
3367
+ }, {
3368
+ status: "failed" | "ready" | "syncing";
3369
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
3370
+ id: string;
3371
+ name: string;
3372
+ detail: string;
3373
+ syncedLabel: string;
3374
+ error?: string | undefined;
3375
+ url?: string | undefined;
3376
+ scope?: "customer" | "project" | undefined;
3377
+ connectedSource?: {
3378
+ accountId: string;
3379
+ resourceId: string;
3380
+ } | undefined;
3381
+ pages?: {
3382
+ done: number;
3383
+ total: number;
3384
+ } | undefined;
3385
+ progress?: {
3386
+ done: number;
3387
+ total: number;
3388
+ stage: string;
3389
+ retryable: boolean;
3390
+ } | undefined;
3391
+ }>, "many">;
3392
+ webSearch: z.ZodObject<{
3393
+ enabled: z.ZodBoolean;
3394
+ provider: z.ZodEffects<z.ZodEnum<["builtin", "exa", "firecrawl"]>, "builtin", "builtin" | "exa" | "firecrawl">;
3395
+ preferSites: z.ZodArray<z.ZodString, "many">;
3396
+ }, "strict", z.ZodTypeAny, {
3397
+ enabled: boolean;
3398
+ provider: "builtin";
3399
+ preferSites: string[];
3400
+ }, {
3401
+ enabled: boolean;
3402
+ provider: "builtin" | "exa" | "firecrawl";
3403
+ preferSites: string[];
3404
+ }>;
3405
+ }, "strict", z.ZodTypeAny, {
3406
+ knowledge: {
3407
+ status: "failed" | "ready" | "syncing";
3408
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
3409
+ id: string;
3410
+ name: string;
3411
+ scope: "customer" | "project";
3412
+ detail: string;
3413
+ syncedLabel: string;
3414
+ error?: string | undefined;
3415
+ url?: string | undefined;
3416
+ connectedSource?: {
3417
+ accountId: string;
3418
+ resourceId: string;
3419
+ } | undefined;
3420
+ pages?: {
3421
+ done: number;
3422
+ total: number;
3423
+ } | undefined;
3424
+ progress?: {
3425
+ done: number;
3426
+ total: number;
3427
+ stage: string;
3428
+ retryable: boolean;
3429
+ } | undefined;
3430
+ }[];
3431
+ readPages: boolean;
3432
+ searchPastChats: boolean;
3433
+ conversationRetentionDays: number;
3434
+ apis: {
3435
+ kind: "http" | "graphql" | "openapi";
3436
+ id: string;
3437
+ name: string;
3438
+ host: string;
3439
+ baseUrl: string;
3440
+ auth: "one" | "each" | "oauth" | "none";
3441
+ sendCustomerIdentity: boolean;
3442
+ calls: {
3443
+ path: string;
3444
+ id: string;
3445
+ name: string;
3446
+ query: Record<string, string>;
3447
+ body: string;
3448
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
3449
+ bodyType: "json" | "form" | "xml" | "gql";
3450
+ readAs: "text" | "json" | "auto" | "xml";
3451
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
3452
+ summary: string;
3453
+ latencyMs: number | null;
3454
+ visibleFields: string[];
3455
+ effects: "read" | "write" | "unclassified";
3456
+ permission: "allow" | "ask" | "block";
3457
+ headers: Record<string, string>;
3458
+ bindings: {
3459
+ path: string[];
3460
+ source: "variable" | "context" | "model" | "identity";
3461
+ target: "path" | "query" | "header" | "body";
3462
+ key: string;
3463
+ }[];
3464
+ sample?: unknown;
3465
+ inputSchema?: Record<string, unknown> | undefined;
3466
+ responseSchema?: Record<string, unknown> | undefined;
3467
+ }[];
3468
+ credentialId?: string | undefined;
3469
+ authHeader?: string | undefined;
3470
+ }[];
3471
+ apps: {
3472
+ key: string;
3473
+ account: "customer" | "project";
3474
+ rules: {
3475
+ read: "allow" | "ask" | "block";
3476
+ change: "allow" | "ask" | "block";
3477
+ delete: "allow" | "ask" | "block";
3478
+ };
3479
+ actionRules: Record<string, "allow" | "ask" | "block">;
3480
+ pinned: string[];
3481
+ accountId?: string | undefined;
3482
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
3483
+ }[];
3484
+ mcpServers: {
3485
+ status: "connecting" | "connected";
3486
+ id: string;
3487
+ name: string;
3488
+ url: string;
3489
+ toolCount: number;
3490
+ definitions: {
3491
+ name: string;
3492
+ inputSchema: Record<string, unknown>;
3493
+ description: string;
3494
+ outputSchema?: Record<string, unknown> | undefined;
3495
+ }[];
3496
+ groups: {
3497
+ name: "Read" | "Change" | "Delete";
3498
+ count: number;
3499
+ rule: "allow" | "ask" | "block";
3500
+ tools: string[];
3501
+ }[];
3502
+ credentialId?: string | undefined;
3503
+ }[];
3504
+ webSearch: {
3505
+ enabled: boolean;
3506
+ provider: "builtin";
3507
+ preferSites: string[];
3508
+ };
3509
+ }, {
3510
+ knowledge: {
3511
+ status: "failed" | "ready" | "syncing";
3512
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
3513
+ id: string;
3514
+ name: string;
3515
+ detail: string;
3516
+ syncedLabel: string;
3517
+ error?: string | undefined;
3518
+ url?: string | undefined;
3519
+ scope?: "customer" | "project" | undefined;
3520
+ connectedSource?: {
3521
+ accountId: string;
3522
+ resourceId: string;
3523
+ } | undefined;
3524
+ pages?: {
3525
+ done: number;
3526
+ total: number;
3527
+ } | undefined;
3528
+ progress?: {
3529
+ done: number;
3530
+ total: number;
3531
+ stage: string;
3532
+ retryable: boolean;
3533
+ } | undefined;
3534
+ }[];
3535
+ apis: {
3536
+ kind: "http" | "graphql" | "openapi";
3537
+ id: string;
3538
+ name: string;
3539
+ host: string;
3540
+ baseUrl: string;
3541
+ auth: "one" | "each" | "oauth" | "none";
3542
+ sendCustomerIdentity: boolean;
3543
+ calls: {
3544
+ path: string;
3545
+ id: string;
3546
+ name: string;
3547
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
3548
+ bodyType: "json" | "form" | "xml" | "gql";
3549
+ readAs: "text" | "json" | "auto" | "xml";
3550
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
3551
+ summary: string;
3552
+ latencyMs: number | null;
3553
+ visibleFields: string[];
3554
+ effects: "read" | "write" | "unclassified";
3555
+ sample?: unknown;
3556
+ query?: Record<string, string> | undefined;
3557
+ body?: string | undefined;
3558
+ permission?: "allow" | "ask" | "block" | undefined;
3559
+ inputSchema?: Record<string, unknown> | undefined;
3560
+ headers?: Record<string, string> | undefined;
3561
+ bindings?: {
3562
+ path: string[];
3563
+ source: "variable" | "context" | "model" | "identity";
3564
+ target: "path" | "query" | "header" | "body";
3565
+ key: string;
3566
+ }[] | undefined;
3567
+ responseSchema?: Record<string, unknown> | undefined;
3568
+ }[];
3569
+ credentialId?: string | undefined;
3570
+ authHeader?: string | undefined;
3571
+ }[];
3572
+ apps: {
3573
+ key: string;
3574
+ account: "customer" | "project";
3575
+ rules: {
3576
+ read: "allow" | "ask" | "block";
3577
+ change: "allow" | "ask" | "block";
3578
+ delete: "allow" | "ask" | "block";
3579
+ };
3580
+ actionRules: Record<string, "allow" | "ask" | "block">;
3581
+ pinned: string[];
3582
+ accountId?: string | undefined;
3583
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
3584
+ }[];
3585
+ mcpServers: {
3586
+ status: "connecting" | "connected";
3587
+ id: string;
3588
+ name: string;
3589
+ url: string;
3590
+ toolCount: number;
3591
+ groups: {
3592
+ name: "Read" | "Change" | "Delete";
3593
+ count: number;
3594
+ rule: "allow" | "ask" | "block";
3595
+ tools: string[];
3596
+ }[];
3597
+ credentialId?: string | undefined;
3598
+ definitions?: {
3599
+ name: string;
3600
+ inputSchema: Record<string, unknown>;
3601
+ description: string;
3602
+ outputSchema?: Record<string, unknown> | undefined;
3603
+ }[] | undefined;
3604
+ }[];
3605
+ webSearch: {
3606
+ enabled: boolean;
3607
+ provider: "builtin" | "exa" | "firecrawl";
3608
+ preferSites: string[];
3609
+ };
3610
+ readPages?: boolean | undefined;
3611
+ searchPastChats?: boolean | undefined;
3612
+ conversationRetentionDays?: number | undefined;
3613
+ }>>;
3614
+ variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
3615
+ name: z.ZodString;
3616
+ type: z.ZodEnum<["Text", "Number", "Yes or no", "One of…"]>;
3617
+ required: z.ZodBoolean;
3618
+ defaultValue: z.ZodString;
3619
+ values: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3620
+ usedIn: z.ZodArray<z.ZodEnum<["instructions", "api", "run_plan"]>, "many">;
3621
+ chipNote: z.ZodString;
3622
+ description: z.ZodString;
3623
+ }, "strict", z.ZodTypeAny, {
3624
+ type: "Text" | "Number" | "Yes or no" | "One of…";
3625
+ name: string;
3626
+ description: string;
3627
+ required: boolean;
3628
+ defaultValue: string;
3629
+ usedIn: ("instructions" | "api" | "run_plan")[];
3630
+ chipNote: string;
3631
+ values?: string[] | undefined;
3632
+ }, {
3633
+ type: "Text" | "Number" | "Yes or no" | "One of…";
3634
+ name: string;
3635
+ description: string;
3636
+ required: boolean;
3637
+ defaultValue: string;
3638
+ usedIn: ("instructions" | "api" | "run_plan")[];
3639
+ chipNote: string;
3640
+ values?: string[] | undefined;
3641
+ }>, "many">>;
3642
+ answer: z.ZodOptional<z.ZodObject<{
3643
+ format: z.ZodEnum<["text", "json"]>;
3644
+ delivery: z.ZodEnum<["stream", "once", "webhook"]>;
3645
+ webhookUrl: z.ZodString;
3646
+ shape: z.ZodArray<z.ZodObject<{
3647
+ id: z.ZodString;
3648
+ name: z.ZodString;
3649
+ type: z.ZodEnum<["text", "number", "bool", "enum", "list", "group", "date"]>;
3650
+ required: z.ZodBoolean;
3651
+ description: z.ZodString;
3652
+ level: z.ZodNumber;
3653
+ values: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3654
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3655
+ }, "strict", z.ZodTypeAny, {
3656
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
3657
+ id: string;
3658
+ name: string;
3659
+ description: string;
3660
+ required: boolean;
3661
+ level: number;
3662
+ values?: string[] | undefined;
3663
+ items?: Record<string, unknown> | undefined;
3664
+ }, {
3665
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
3666
+ id: string;
3667
+ name: string;
3668
+ description: string;
3669
+ required: boolean;
3670
+ level: number;
3671
+ values?: string[] | undefined;
3672
+ items?: Record<string, unknown> | undefined;
3673
+ }>, "many">;
3674
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3675
+ }, "strict", z.ZodTypeAny, {
3676
+ shape: {
3677
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
3678
+ id: string;
3679
+ name: string;
3680
+ description: string;
3681
+ required: boolean;
3682
+ level: number;
3683
+ values?: string[] | undefined;
3684
+ items?: Record<string, unknown> | undefined;
3685
+ }[];
3686
+ format: "text" | "json";
3687
+ delivery: "stream" | "once" | "webhook";
3688
+ webhookUrl: string;
3689
+ schema?: Record<string, unknown> | undefined;
3690
+ }, {
3691
+ shape: {
3692
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
3693
+ id: string;
3694
+ name: string;
3695
+ description: string;
3696
+ required: boolean;
3697
+ level: number;
3698
+ values?: string[] | undefined;
3699
+ items?: Record<string, unknown> | undefined;
3700
+ }[];
3701
+ format: "text" | "json";
3702
+ delivery: "stream" | "once" | "webhook";
3703
+ webhookUrl: string;
3704
+ schema?: Record<string, unknown> | undefined;
3705
+ }>>;
3706
+ runPlan: z.ZodOptional<z.ZodObject<{
3707
+ preparations: z.ZodDefault<z.ZodArray<z.ZodObject<{
3708
+ id: z.ZodString;
3709
+ kind: z.ZodEnum<["app", "mcp", "workbench"]>;
3710
+ capabilityId: z.ZodString;
3711
+ toolKey: z.ZodString;
3712
+ name: z.ZodString;
3713
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3714
+ bindings: z.ZodArray<z.ZodObject<{
3715
+ source: z.ZodEnum<["variable", "context", "message"]>;
3716
+ path: z.ZodArray<z.ZodString, "many">;
3717
+ target: z.ZodArray<z.ZodString, "many">;
3718
+ }, "strict", z.ZodTypeAny, {
3719
+ path: string[];
3720
+ source: "message" | "variable" | "context";
3721
+ target: string[];
3722
+ }, {
3723
+ path: string[];
3724
+ source: "message" | "variable" | "context";
3725
+ target: string[];
3726
+ }>, "many">;
3727
+ }, "strict", z.ZodTypeAny, {
3728
+ kind: "workbench" | "mcp" | "app";
3729
+ id: string;
3730
+ name: string;
3731
+ bindings: {
3732
+ path: string[];
3733
+ source: "message" | "variable" | "context";
3734
+ target: string[];
3735
+ }[];
3736
+ capabilityId: string;
3737
+ toolKey: string;
3738
+ input: Record<string, unknown>;
3739
+ }, {
3740
+ kind: "workbench" | "mcp" | "app";
3741
+ id: string;
3742
+ name: string;
3743
+ bindings: {
3744
+ path: string[];
3745
+ source: "message" | "variable" | "context";
3746
+ target: string[];
3747
+ }[];
3748
+ capabilityId: string;
3749
+ toolKey: string;
3750
+ input: Record<string, unknown>;
3751
+ }>, "many">>;
3752
+ before: z.ZodArray<z.ZodString, "many">;
3753
+ after: z.ZodArray<z.ZodString, "many">;
3754
+ off: z.ZodArray<z.ZodString, "many">;
3755
+ stopOnFail: z.ZodArray<z.ZodString, "many">;
3756
+ stepLimit: z.ZodEffects<z.ZodNullable<z.ZodNumber>, number, number | null>;
3757
+ }, "strict", z.ZodTypeAny, {
3758
+ before: string[];
3759
+ after: string[];
3760
+ preparations: {
3761
+ kind: "workbench" | "mcp" | "app";
3762
+ id: string;
3763
+ name: string;
3764
+ bindings: {
3765
+ path: string[];
3766
+ source: "message" | "variable" | "context";
3767
+ target: string[];
3768
+ }[];
3769
+ capabilityId: string;
3770
+ toolKey: string;
3771
+ input: Record<string, unknown>;
3772
+ }[];
3773
+ off: string[];
3774
+ stopOnFail: string[];
3775
+ stepLimit: number;
3776
+ }, {
3777
+ before: string[];
3778
+ after: string[];
3779
+ off: string[];
3780
+ stopOnFail: string[];
3781
+ stepLimit: number | null;
3782
+ preparations?: {
3783
+ kind: "workbench" | "mcp" | "app";
3784
+ id: string;
3785
+ name: string;
3786
+ bindings: {
3787
+ path: string[];
3788
+ source: "message" | "variable" | "context";
3789
+ target: string[];
3790
+ }[];
3791
+ capabilityId: string;
3792
+ toolKey: string;
3793
+ input: Record<string, unknown>;
3794
+ }[] | undefined;
3795
+ }>>;
3796
+ }, "strict", z.ZodTypeAny, {
3797
+ name?: string | undefined;
3798
+ workbench?: {
3799
+ enabled: boolean;
3800
+ files: "per_customer" | "per_run";
3801
+ configured: boolean;
3802
+ size: "medium" | "small" | "large";
3803
+ access: "allow" | "ask" | "block";
3804
+ languages: string[];
3805
+ longestRun: "1 minute" | "3 minutes" | "10 minutes";
3806
+ } | undefined;
3807
+ instructions?: {
3808
+ text: string;
3809
+ editedAt: string | null;
3810
+ } | undefined;
3811
+ context?: {
3812
+ knowledge: {
3813
+ status: "failed" | "ready" | "syncing";
3814
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
3815
+ id: string;
3816
+ name: string;
3817
+ scope: "customer" | "project";
3818
+ detail: string;
3819
+ syncedLabel: string;
3820
+ error?: string | undefined;
3821
+ url?: string | undefined;
3822
+ connectedSource?: {
3823
+ accountId: string;
3824
+ resourceId: string;
3825
+ } | undefined;
3826
+ pages?: {
3827
+ done: number;
3828
+ total: number;
3829
+ } | undefined;
3830
+ progress?: {
3831
+ done: number;
3832
+ total: number;
3833
+ stage: string;
3834
+ retryable: boolean;
3835
+ } | undefined;
3836
+ }[];
3837
+ readPages: boolean;
3838
+ searchPastChats: boolean;
3839
+ conversationRetentionDays: number;
3840
+ apis: {
3841
+ kind: "http" | "graphql" | "openapi";
3842
+ id: string;
3843
+ name: string;
3844
+ host: string;
3845
+ baseUrl: string;
3846
+ auth: "one" | "each" | "oauth" | "none";
3847
+ sendCustomerIdentity: boolean;
3848
+ calls: {
3849
+ path: string;
3850
+ id: string;
3851
+ name: string;
3852
+ query: Record<string, string>;
3853
+ body: string;
3854
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
3855
+ bodyType: "json" | "form" | "xml" | "gql";
3856
+ readAs: "text" | "json" | "auto" | "xml";
3857
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
3858
+ summary: string;
3859
+ latencyMs: number | null;
3860
+ visibleFields: string[];
3861
+ effects: "read" | "write" | "unclassified";
3862
+ permission: "allow" | "ask" | "block";
3863
+ headers: Record<string, string>;
3864
+ bindings: {
3865
+ path: string[];
3866
+ source: "variable" | "context" | "model" | "identity";
3867
+ target: "path" | "query" | "header" | "body";
3868
+ key: string;
3869
+ }[];
3870
+ sample?: unknown;
3871
+ inputSchema?: Record<string, unknown> | undefined;
3872
+ responseSchema?: Record<string, unknown> | undefined;
3873
+ }[];
3874
+ credentialId?: string | undefined;
3875
+ authHeader?: string | undefined;
3876
+ }[];
3877
+ apps: {
3878
+ key: string;
3879
+ account: "customer" | "project";
3880
+ rules: {
3881
+ read: "allow" | "ask" | "block";
3882
+ change: "allow" | "ask" | "block";
3883
+ delete: "allow" | "ask" | "block";
3884
+ };
3885
+ actionRules: Record<string, "allow" | "ask" | "block">;
3886
+ pinned: string[];
3887
+ accountId?: string | undefined;
3888
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
3889
+ }[];
3890
+ mcpServers: {
3891
+ status: "connecting" | "connected";
3892
+ id: string;
3893
+ name: string;
3894
+ url: string;
3895
+ toolCount: number;
3896
+ definitions: {
3897
+ name: string;
3898
+ inputSchema: Record<string, unknown>;
3899
+ description: string;
3900
+ outputSchema?: Record<string, unknown> | undefined;
3901
+ }[];
3902
+ groups: {
3903
+ name: "Read" | "Change" | "Delete";
3904
+ count: number;
3905
+ rule: "allow" | "ask" | "block";
3906
+ tools: string[];
3907
+ }[];
3908
+ credentialId?: string | undefined;
3909
+ }[];
3910
+ webSearch: {
3911
+ enabled: boolean;
3912
+ provider: "builtin";
3913
+ preferSites: string[];
3914
+ };
3915
+ } | undefined;
3916
+ memory?: {
3917
+ never: string[];
3918
+ enabled: boolean;
3919
+ configured: boolean;
3920
+ who: {
3921
+ customer: boolean;
3922
+ company: boolean;
3923
+ bot: boolean;
3924
+ };
3925
+ what: string;
3926
+ forgetAfter: "1 year" | "6 months" | "90 days" | "Never";
3927
+ } | undefined;
3928
+ model?: {
3929
+ id: string;
3930
+ effort: "low" | "medium" | "high";
3931
+ } | undefined;
3932
+ variables?: {
3933
+ type: "Text" | "Number" | "Yes or no" | "One of…";
3934
+ name: string;
3935
+ description: string;
3936
+ required: boolean;
3937
+ defaultValue: string;
3938
+ usedIn: ("instructions" | "api" | "run_plan")[];
3939
+ chipNote: string;
3940
+ values?: string[] | undefined;
3941
+ }[] | undefined;
3942
+ skills?: {
3943
+ id: string;
3944
+ name: string;
3945
+ files: {
3946
+ name: string;
3947
+ content: string;
3948
+ }[];
3949
+ instructions: string;
3950
+ summary: string;
3951
+ icon: "refund" | "link" | "person" | "voice" | "mail" | "term" | "box" | "pencil";
3952
+ load: "auto" | "always";
3953
+ cases: {
3954
+ text: string;
3955
+ }[];
3956
+ exceptions: {
3957
+ text: string;
3958
+ }[];
3959
+ examples: {
3960
+ use: string[];
3961
+ notFor: string[];
3962
+ };
3963
+ onlyIf: {
3964
+ values: string;
3965
+ field: string;
3966
+ check: "is one of" | "is" | "is not";
3967
+ }[];
3968
+ }[] | undefined;
3969
+ answer?: {
3970
+ shape: {
3971
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
3972
+ id: string;
3973
+ name: string;
3974
+ description: string;
3975
+ required: boolean;
3976
+ level: number;
3977
+ values?: string[] | undefined;
3978
+ items?: Record<string, unknown> | undefined;
3979
+ }[];
3980
+ format: "text" | "json";
3981
+ delivery: "stream" | "once" | "webhook";
3982
+ webhookUrl: string;
3983
+ schema?: Record<string, unknown> | undefined;
3984
+ } | undefined;
3985
+ runPlan?: {
3986
+ before: string[];
3987
+ after: string[];
3988
+ preparations: {
3989
+ kind: "workbench" | "mcp" | "app";
3990
+ id: string;
3991
+ name: string;
3992
+ bindings: {
3993
+ path: string[];
3994
+ source: "message" | "variable" | "context";
3995
+ target: string[];
3996
+ }[];
3997
+ capabilityId: string;
3998
+ toolKey: string;
3999
+ input: Record<string, unknown>;
4000
+ }[];
4001
+ off: string[];
4002
+ stopOnFail: string[];
4003
+ stepLimit: number;
4004
+ } | undefined;
4005
+ triggers?: ({
4006
+ kind: "app";
4007
+ id: string;
4008
+ enabled: boolean;
4009
+ name: string;
4010
+ subscriptionId: string;
4011
+ label: string;
4012
+ providerKey: string;
4013
+ eventTypes: string[];
4014
+ runsAs: "none" | "field";
4015
+ customerField: string;
4016
+ instruction: string;
4017
+ answerTo: "webhook" | "none";
4018
+ variables: Record<string, unknown>;
4019
+ } | {
4020
+ kind: "webhook";
4021
+ id: string;
4022
+ tenantId: string;
4023
+ enabled: boolean;
4024
+ name: string;
4025
+ runsAs: "none" | "field";
4026
+ customerField: string;
4027
+ instruction: string;
4028
+ answerTo: "webhook" | "none";
4029
+ variables: Record<string, unknown>;
4030
+ } | {
4031
+ every: "week" | "day" | "hour";
4032
+ kind: "schedule";
4033
+ date: string;
4034
+ id: string;
4035
+ tenantId: string;
4036
+ enabled: boolean;
4037
+ name: string;
4038
+ runsAs: "one" | "none";
4039
+ instruction: string;
4040
+ answerTo: "webhook" | "none";
4041
+ variables: Record<string, unknown>;
4042
+ repeat: "once" | "repeat";
4043
+ days: number[];
4044
+ time: string;
4045
+ timezone: string;
4046
+ customerId: string;
4047
+ })[] | undefined;
4048
+ }, {
4049
+ name?: string | undefined;
4050
+ workbench?: {
4051
+ enabled: boolean;
4052
+ files: "per_customer" | "per_run";
4053
+ configured: boolean;
4054
+ size: "medium" | "small" | "large";
4055
+ access: "allow" | "ask" | "block";
4056
+ languages: string[];
4057
+ longestRun: "1 minute" | "3 minutes" | "10 minutes";
4058
+ } | undefined;
4059
+ instructions?: {
4060
+ text: string;
4061
+ editedAt: string | null;
4062
+ } | undefined;
4063
+ context?: {
4064
+ knowledge: {
4065
+ status: "failed" | "ready" | "syncing";
4066
+ kind: "help_center" | "website" | "files" | "note" | "notion" | "google_drive";
4067
+ id: string;
4068
+ name: string;
4069
+ detail: string;
4070
+ syncedLabel: string;
4071
+ error?: string | undefined;
4072
+ url?: string | undefined;
4073
+ scope?: "customer" | "project" | undefined;
4074
+ connectedSource?: {
4075
+ accountId: string;
4076
+ resourceId: string;
4077
+ } | undefined;
4078
+ pages?: {
4079
+ done: number;
4080
+ total: number;
4081
+ } | undefined;
4082
+ progress?: {
4083
+ done: number;
4084
+ total: number;
4085
+ stage: string;
4086
+ retryable: boolean;
4087
+ } | undefined;
4088
+ }[];
4089
+ apis: {
4090
+ kind: "http" | "graphql" | "openapi";
4091
+ id: string;
4092
+ name: string;
4093
+ host: string;
4094
+ baseUrl: string;
4095
+ auth: "one" | "each" | "oauth" | "none";
4096
+ sendCustomerIdentity: boolean;
4097
+ calls: {
4098
+ path: string;
4099
+ id: string;
4100
+ name: string;
4101
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
4102
+ bodyType: "json" | "form" | "xml" | "gql";
4103
+ readAs: "text" | "json" | "auto" | "xml";
4104
+ timeout: "2 seconds" | "5 seconds" | "10 seconds";
4105
+ summary: string;
4106
+ latencyMs: number | null;
4107
+ visibleFields: string[];
4108
+ effects: "read" | "write" | "unclassified";
4109
+ sample?: unknown;
4110
+ query?: Record<string, string> | undefined;
4111
+ body?: string | undefined;
4112
+ permission?: "allow" | "ask" | "block" | undefined;
4113
+ inputSchema?: Record<string, unknown> | undefined;
4114
+ headers?: Record<string, string> | undefined;
4115
+ bindings?: {
4116
+ path: string[];
4117
+ source: "variable" | "context" | "model" | "identity";
4118
+ target: "path" | "query" | "header" | "body";
4119
+ key: string;
4120
+ }[] | undefined;
4121
+ responseSchema?: Record<string, unknown> | undefined;
4122
+ }[];
4123
+ credentialId?: string | undefined;
4124
+ authHeader?: string | undefined;
4125
+ }[];
4126
+ apps: {
4127
+ key: string;
4128
+ account: "customer" | "project";
4129
+ rules: {
4130
+ read: "allow" | "ask" | "block";
4131
+ change: "allow" | "ask" | "block";
4132
+ delete: "allow" | "ask" | "block";
4133
+ };
4134
+ actionRules: Record<string, "allow" | "ask" | "block">;
4135
+ pinned: string[];
4136
+ accountId?: string | undefined;
4137
+ askWho?: Record<string, "approvers" | "customer" | "customer-approvers"> | undefined;
4138
+ }[];
4139
+ mcpServers: {
4140
+ status: "connecting" | "connected";
4141
+ id: string;
4142
+ name: string;
4143
+ url: string;
4144
+ toolCount: number;
4145
+ groups: {
4146
+ name: "Read" | "Change" | "Delete";
4147
+ count: number;
4148
+ rule: "allow" | "ask" | "block";
4149
+ tools: string[];
4150
+ }[];
4151
+ credentialId?: string | undefined;
4152
+ definitions?: {
4153
+ name: string;
4154
+ inputSchema: Record<string, unknown>;
4155
+ description: string;
4156
+ outputSchema?: Record<string, unknown> | undefined;
4157
+ }[] | undefined;
4158
+ }[];
4159
+ webSearch: {
4160
+ enabled: boolean;
4161
+ provider: "builtin" | "exa" | "firecrawl";
4162
+ preferSites: string[];
4163
+ };
4164
+ readPages?: boolean | undefined;
4165
+ searchPastChats?: boolean | undefined;
4166
+ conversationRetentionDays?: number | undefined;
4167
+ } | undefined;
4168
+ memory?: {
4169
+ never: string[];
4170
+ enabled: boolean;
4171
+ configured: boolean;
4172
+ who: {
4173
+ customer: boolean;
4174
+ company: boolean;
4175
+ bot: boolean;
4176
+ };
4177
+ what: string;
4178
+ forgetAfter: "1 year" | "6 months" | "90 days" | "Never";
4179
+ } | undefined;
4180
+ model?: {
4181
+ id: string;
4182
+ effort: "low" | "medium" | "high";
4183
+ } | undefined;
4184
+ variables?: {
4185
+ type: "Text" | "Number" | "Yes or no" | "One of…";
4186
+ name: string;
4187
+ description: string;
4188
+ required: boolean;
4189
+ defaultValue: string;
4190
+ usedIn: ("instructions" | "api" | "run_plan")[];
4191
+ chipNote: string;
4192
+ values?: string[] | undefined;
4193
+ }[] | undefined;
4194
+ skills?: {
4195
+ id: string;
4196
+ name: string;
4197
+ summary: string;
4198
+ icon: "refund" | "link" | "person" | "voice" | "mail" | "term" | "box" | "pencil";
4199
+ load: "auto" | "always";
4200
+ cases: {
4201
+ text: string;
4202
+ }[];
4203
+ exceptions: {
4204
+ text: string;
4205
+ }[];
4206
+ examples: {
4207
+ use: string[];
4208
+ notFor: string[];
4209
+ };
4210
+ onlyIf: {
4211
+ values: string;
4212
+ field: string;
4213
+ check: "is one of" | "is" | "is not";
4214
+ }[];
4215
+ files?: {
4216
+ name: string;
4217
+ content: string;
4218
+ }[] | undefined;
4219
+ instructions?: string | undefined;
4220
+ }[] | undefined;
4221
+ answer?: {
4222
+ shape: {
4223
+ type: "number" | "date" | "text" | "bool" | "enum" | "list" | "group";
4224
+ id: string;
4225
+ name: string;
4226
+ description: string;
4227
+ required: boolean;
4228
+ level: number;
4229
+ values?: string[] | undefined;
4230
+ items?: Record<string, unknown> | undefined;
4231
+ }[];
4232
+ format: "text" | "json";
4233
+ delivery: "stream" | "once" | "webhook";
4234
+ webhookUrl: string;
4235
+ schema?: Record<string, unknown> | undefined;
4236
+ } | undefined;
4237
+ runPlan?: {
4238
+ before: string[];
4239
+ after: string[];
4240
+ off: string[];
4241
+ stopOnFail: string[];
4242
+ stepLimit: number | null;
4243
+ preparations?: {
4244
+ kind: "workbench" | "mcp" | "app";
4245
+ id: string;
4246
+ name: string;
4247
+ bindings: {
4248
+ path: string[];
4249
+ source: "message" | "variable" | "context";
4250
+ target: string[];
4251
+ }[];
4252
+ capabilityId: string;
4253
+ toolKey: string;
4254
+ input: Record<string, unknown>;
4255
+ }[] | undefined;
4256
+ } | undefined;
4257
+ triggers?: ({
4258
+ kind: "app";
4259
+ id: string;
4260
+ enabled: boolean;
4261
+ name: string;
4262
+ subscriptionId: string;
4263
+ label: string;
4264
+ providerKey: string;
4265
+ eventTypes: string[];
4266
+ runsAs: "none" | "field";
4267
+ customerField: string;
4268
+ instruction: string;
4269
+ answerTo: "webhook" | "none";
4270
+ variables?: Record<string, unknown> | undefined;
4271
+ } | {
4272
+ kind: "webhook";
4273
+ id: string;
4274
+ tenantId: string;
4275
+ enabled: boolean;
4276
+ name: string;
4277
+ runsAs: "none" | "field";
4278
+ customerField: string;
4279
+ instruction: string;
4280
+ answerTo: "webhook" | "none";
4281
+ variables?: Record<string, unknown> | undefined;
4282
+ } | {
4283
+ every: "week" | "day" | "hour";
4284
+ kind: "schedule";
4285
+ date: string;
4286
+ id: string;
4287
+ tenantId: string;
4288
+ enabled: boolean;
4289
+ name: string;
4290
+ runsAs: "one" | "none";
4291
+ instruction: string;
4292
+ answerTo: "webhook" | "none";
4293
+ repeat: "once" | "repeat";
4294
+ days: number[];
4295
+ time: string;
4296
+ timezone: string;
4297
+ customerId: string;
4298
+ variables?: Record<string, unknown> | undefined;
4299
+ })[] | undefined;
4300
+ }>;
4301
+ export declare const botRunInputSchema: z.ZodObject<{
4302
+ runId: z.ZodOptional<z.ZodString>;
4303
+ conversationId: z.ZodOptional<z.ZodString>;
4304
+ message: z.ZodString;
4305
+ variables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4306
+ revision: z.ZodOptional<z.ZodNumber>;
4307
+ dataMode: z.ZodDefault<z.ZodEnum<["sample", "live"]>>;
4308
+ customerSessionId: z.ZodOptional<z.ZodString>;
4309
+ }, "strict", z.ZodTypeAny, {
4310
+ message: string;
4311
+ variables: Record<string, unknown>;
4312
+ dataMode: "sample" | "live";
4313
+ revision?: number | undefined;
4314
+ runId?: string | undefined;
4315
+ conversationId?: string | undefined;
4316
+ customerSessionId?: string | undefined;
4317
+ }, {
4318
+ message: string;
4319
+ revision?: number | undefined;
4320
+ variables?: Record<string, unknown> | undefined;
4321
+ runId?: string | undefined;
4322
+ conversationId?: string | undefined;
4323
+ dataMode?: "sample" | "live" | undefined;
4324
+ customerSessionId?: string | undefined;
4325
+ }>;
4326
+ export declare function defaultBotConfiguration(name: string): BotConfiguration;
4327
+ /** Infer only structural JSON types; values are never classified by their text. */
4328
+ export declare function botSchemaFromExample(value: unknown): Record<string, unknown>;
4329
+ export declare function botSchemaExample(schema: Record<string, unknown>): unknown;
4330
+ /** Exact provider-tool policy shared by discovery and execution. */
4331
+ export declare function botApplicationToolRule(config: BotConfiguration, tool: {
4332
+ key: string;
4333
+ toolkitKey: string;
4334
+ mutationLevel: string;
4335
+ }): ActionRule;
4336
+ //# sourceMappingURL=bot-contract.d.ts.map