@itphx/synth-shared 0.8.8 → 0.10.0

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.
@@ -7,10 +7,10 @@ export declare const projectRoleSchema: z.ZodNativeEnum<typeof ProjectRole>;
7
7
  export declare const statusMessageTypeSchema: z.ZodNativeEnum<typeof StatusMessageType>;
8
8
  /** Zod-схемы канонических ключей иконок/цветов (единые для project и session). */
9
9
  export declare const projectIconKeySchema: z.ZodEnum<["code", "terminal", "rocket", "flask", "gamepad", "briefcase", "home", "globe", "leaf", "shield", "palette", "server", "phone", "database", "lightbulb", "music", "camera", "book", "heart", "folder", "chat", "cpu", "file", "file-code", "docs", "task", "todo", "bug", "robot", "brain", "git", "repo", "test", "chart", "star", "image", "calendar"]>;
10
- export declare const projectColorKeySchema: z.ZodEnum<["keyword", "string", "number", "type", "comment", "error", "primary", "success"]>;
11
- /** true, если значение — канонический ключ иконки (без алиасов; для записи). */
10
+ export declare const projectColorKeySchema: z.ZodEnum<["a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", "a16"]>;
11
+ /** true, если значение — канонический ключ иконки (для записи и чтения). */
12
12
  export declare function isProjectIconKey(value: unknown): value is ProjectIconKey;
13
- /** true, если значение — канонический ключ цвета (без алиасов; для записи). */
13
+ /** true, если значение — канонический ключ цвета (без алиасов; для записи и чтения). */
14
14
  export declare function isProjectColorKey(value: unknown): value is ProjectColorKey;
15
15
  /**
16
16
  * Нормализация иконки при ЧТЕНИИ. Канонический ключ → как есть; всё прочее
@@ -18,8 +18,8 @@ export declare function isProjectColorKey(value: unknown): value is ProjectColor
18
18
  */
19
19
  export declare function normalizeIconKey(value: unknown): ProjectIconKey | undefined;
20
20
  /**
21
- * Нормализация цвета при ЧТЕНИИ: канонический ключ или legacy-алиас → ключ
22
- * палитры; всё прочее → `undefined`.
21
+ * Нормализация цвета при ЧТЕНИИ: канонический ключ палитры → как есть; всё
22
+ * прочее (включая legacy-алиасы) → `undefined`.
23
23
  */
24
24
  export declare function normalizeColorKey(value: unknown): ProjectColorKey | undefined;
25
25
  export declare const tokenUsageSchema: z.ZodObject<{
@@ -63,6 +63,8 @@ export declare const sessionSettingsSchema: z.ZodObject<{
63
63
  planMode: z.ZodOptional<z.ZodEnum<["auto", "strict", "off"]>>;
64
64
  skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
65
65
  skillsDisabled: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
66
+ /** AD-084: per-session гейт decision-уровня микро-каскада (undefined → config.decision.enabled). */
67
+ decisionFirst: z.ZodOptional<z.ZodBoolean>;
66
68
  }, "strip", z.ZodTypeAny, {
67
69
  temperature: number;
68
70
  maxTokens: number;
@@ -91,6 +93,7 @@ export declare const sessionSettingsSchema: z.ZodObject<{
91
93
  planMode?: "auto" | "strict" | "off" | undefined;
92
94
  skills?: string[] | undefined;
93
95
  skillsDisabled?: string[] | undefined;
96
+ decisionFirst?: boolean | undefined;
94
97
  }, {
95
98
  provider?: string | undefined;
96
99
  model?: string | undefined;
@@ -119,12 +122,13 @@ export declare const sessionSettingsSchema: z.ZodObject<{
119
122
  planMode?: "auto" | "strict" | "off" | undefined;
120
123
  skills?: string[] | undefined;
121
124
  skillsDisabled?: string[] | undefined;
125
+ decisionFirst?: boolean | undefined;
122
126
  }>;
123
127
  export declare const sessionCreateSchema: z.ZodObject<{
124
128
  name: z.ZodOptional<z.ZodString>;
125
129
  title: z.ZodOptional<z.ZodString>;
126
130
  icon: z.ZodNullable<z.ZodOptional<z.ZodEnum<["code", "terminal", "rocket", "flask", "gamepad", "briefcase", "home", "globe", "leaf", "shield", "palette", "server", "phone", "database", "lightbulb", "music", "camera", "book", "heart", "folder", "chat", "cpu", "file", "file-code", "docs", "task", "todo", "bug", "robot", "brain", "git", "repo", "test", "chart", "star", "image", "calendar"]>>>;
127
- color: z.ZodNullable<z.ZodOptional<z.ZodEnum<["keyword", "string", "number", "type", "comment", "error", "primary", "success"]>>>;
131
+ color: z.ZodNullable<z.ZodOptional<z.ZodEnum<["a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", "a16"]>>>;
128
132
  projectId: z.ZodOptional<z.ZodString>;
129
133
  engine: z.ZodDefault<z.ZodEnum<["synth", "opencode", "cline"]>>;
130
134
  settings: z.ZodOptional<z.ZodObject<{
@@ -155,6 +159,8 @@ export declare const sessionCreateSchema: z.ZodObject<{
155
159
  planMode: z.ZodOptional<z.ZodEnum<["auto", "strict", "off"]>>;
156
160
  skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
157
161
  skillsDisabled: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
162
+ /** AD-084: per-session гейт decision-уровня микро-каскада (undefined → config.decision.enabled). */
163
+ decisionFirst: z.ZodOptional<z.ZodBoolean>;
158
164
  }, "strip", z.ZodTypeAny, {
159
165
  temperature: number;
160
166
  maxTokens: number;
@@ -183,6 +189,7 @@ export declare const sessionCreateSchema: z.ZodObject<{
183
189
  planMode?: "auto" | "strict" | "off" | undefined;
184
190
  skills?: string[] | undefined;
185
191
  skillsDisabled?: string[] | undefined;
192
+ decisionFirst?: boolean | undefined;
186
193
  }, {
187
194
  provider?: string | undefined;
188
195
  model?: string | undefined;
@@ -211,13 +218,14 @@ export declare const sessionCreateSchema: z.ZodObject<{
211
218
  planMode?: "auto" | "strict" | "off" | undefined;
212
219
  skills?: string[] | undefined;
213
220
  skillsDisabled?: string[] | undefined;
221
+ decisionFirst?: boolean | undefined;
214
222
  }>>;
215
223
  }, "strip", z.ZodTypeAny, {
216
224
  engine: "synth" | "opencode" | "cline";
217
225
  name?: string | undefined;
218
226
  title?: string | undefined;
219
227
  icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
220
- color?: "string" | "number" | "type" | "keyword" | "comment" | "error" | "primary" | "success" | null | undefined;
228
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | null | undefined;
221
229
  projectId?: string | undefined;
222
230
  settings?: {
223
231
  temperature: number;
@@ -247,12 +255,13 @@ export declare const sessionCreateSchema: z.ZodObject<{
247
255
  planMode?: "auto" | "strict" | "off" | undefined;
248
256
  skills?: string[] | undefined;
249
257
  skillsDisabled?: string[] | undefined;
258
+ decisionFirst?: boolean | undefined;
250
259
  } | undefined;
251
260
  }, {
252
261
  name?: string | undefined;
253
262
  title?: string | undefined;
254
263
  icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
255
- color?: "string" | "number" | "type" | "keyword" | "comment" | "error" | "primary" | "success" | null | undefined;
264
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | null | undefined;
256
265
  projectId?: string | undefined;
257
266
  engine?: "synth" | "opencode" | "cline" | undefined;
258
267
  settings?: {
@@ -283,12 +292,13 @@ export declare const sessionCreateSchema: z.ZodObject<{
283
292
  planMode?: "auto" | "strict" | "off" | undefined;
284
293
  skills?: string[] | undefined;
285
294
  skillsDisabled?: string[] | undefined;
295
+ decisionFirst?: boolean | undefined;
286
296
  } | undefined;
287
297
  }>;
288
298
  export declare const sessionUpdateSchema: z.ZodObject<{
289
299
  name: z.ZodOptional<z.ZodString>;
290
300
  icon: z.ZodNullable<z.ZodOptional<z.ZodEnum<["code", "terminal", "rocket", "flask", "gamepad", "briefcase", "home", "globe", "leaf", "shield", "palette", "server", "phone", "database", "lightbulb", "music", "camera", "book", "heart", "folder", "chat", "cpu", "file", "file-code", "docs", "task", "todo", "bug", "robot", "brain", "git", "repo", "test", "chart", "star", "image", "calendar"]>>>;
291
- color: z.ZodNullable<z.ZodOptional<z.ZodEnum<["keyword", "string", "number", "type", "comment", "error", "primary", "success"]>>>;
301
+ color: z.ZodNullable<z.ZodOptional<z.ZodEnum<["a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", "a16"]>>>;
292
302
  projectId: z.ZodOptional<z.ZodString>;
293
303
  engine: z.ZodOptional<z.ZodEnum<["synth", "opencode", "cline"]>>;
294
304
  settings: z.ZodOptional<z.ZodObject<{
@@ -319,6 +329,7 @@ export declare const sessionUpdateSchema: z.ZodObject<{
319
329
  planMode: z.ZodOptional<z.ZodOptional<z.ZodEnum<["auto", "strict", "off"]>>>;
320
330
  skills: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
321
331
  skillsDisabled: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
332
+ decisionFirst: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
322
333
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
323
334
  provider: z.ZodOptional<z.ZodOptional<z.ZodString>>;
324
335
  model: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -347,6 +358,7 @@ export declare const sessionUpdateSchema: z.ZodObject<{
347
358
  planMode: z.ZodOptional<z.ZodOptional<z.ZodEnum<["auto", "strict", "off"]>>>;
348
359
  skills: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
349
360
  skillsDisabled: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
361
+ decisionFirst: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
350
362
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
351
363
  provider: z.ZodOptional<z.ZodOptional<z.ZodString>>;
352
364
  model: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -375,11 +387,12 @@ export declare const sessionUpdateSchema: z.ZodObject<{
375
387
  planMode: z.ZodOptional<z.ZodOptional<z.ZodEnum<["auto", "strict", "off"]>>>;
376
388
  skills: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
377
389
  skillsDisabled: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
390
+ decisionFirst: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
378
391
  }, z.ZodTypeAny, "passthrough">>>;
379
392
  }, "strip", z.ZodTypeAny, {
380
393
  name?: string | undefined;
381
394
  icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
382
- color?: "string" | "number" | "type" | "keyword" | "comment" | "error" | "primary" | "success" | null | undefined;
395
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | null | undefined;
383
396
  projectId?: string | undefined;
384
397
  engine?: "synth" | "opencode" | "cline" | undefined;
385
398
  settings?: z.objectOutputType<{
@@ -410,11 +423,12 @@ export declare const sessionUpdateSchema: z.ZodObject<{
410
423
  planMode: z.ZodOptional<z.ZodOptional<z.ZodEnum<["auto", "strict", "off"]>>>;
411
424
  skills: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
412
425
  skillsDisabled: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
426
+ decisionFirst: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
413
427
  }, z.ZodTypeAny, "passthrough"> | undefined;
414
428
  }, {
415
429
  name?: string | undefined;
416
430
  icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
417
- color?: "string" | "number" | "type" | "keyword" | "comment" | "error" | "primary" | "success" | null | undefined;
431
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | null | undefined;
418
432
  projectId?: string | undefined;
419
433
  engine?: "synth" | "opencode" | "cline" | undefined;
420
434
  settings?: z.objectInputType<{
@@ -445,6 +459,7 @@ export declare const sessionUpdateSchema: z.ZodObject<{
445
459
  planMode: z.ZodOptional<z.ZodOptional<z.ZodEnum<["auto", "strict", "off"]>>>;
446
460
  skills: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
447
461
  skillsDisabled: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
462
+ decisionFirst: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
448
463
  }, z.ZodTypeAny, "passthrough"> | undefined;
449
464
  }>;
450
465
  /**
@@ -490,7 +505,7 @@ export declare const projectCreateSchema: z.ZodObject<{
490
505
  name: z.ZodString;
491
506
  description: z.ZodDefault<z.ZodString>;
492
507
  icon: z.ZodNullable<z.ZodOptional<z.ZodEnum<["code", "terminal", "rocket", "flask", "gamepad", "briefcase", "home", "globe", "leaf", "shield", "palette", "server", "phone", "database", "lightbulb", "music", "camera", "book", "heart", "folder", "chat", "cpu", "file", "file-code", "docs", "task", "todo", "bug", "robot", "brain", "git", "repo", "test", "chart", "star", "image", "calendar"]>>>;
493
- color: z.ZodNullable<z.ZodOptional<z.ZodEnum<["keyword", "string", "number", "type", "comment", "error", "primary", "success"]>>>;
508
+ color: z.ZodNullable<z.ZodOptional<z.ZodEnum<["a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", "a16"]>>>;
494
509
  workspace: z.ZodOptional<z.ZodString>;
495
510
  repos: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
496
511
  id: z.ZodOptional<z.ZodString>;
@@ -525,7 +540,7 @@ export declare const projectCreateSchema: z.ZodObject<{
525
540
  description: string;
526
541
  workspace?: string | undefined;
527
542
  icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
528
- color?: "string" | "number" | "type" | "keyword" | "comment" | "error" | "primary" | "success" | null | undefined;
543
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | null | undefined;
529
544
  repos?: (string | {
530
545
  path: string;
531
546
  type?: "https" | "ssh" | undefined;
@@ -540,7 +555,7 @@ export declare const projectCreateSchema: z.ZodObject<{
540
555
  name: string;
541
556
  workspace?: string | undefined;
542
557
  icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
543
- color?: "string" | "number" | "type" | "keyword" | "comment" | "error" | "primary" | "success" | null | undefined;
558
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | null | undefined;
544
559
  description?: string | undefined;
545
560
  repos?: (string | {
546
561
  path: string;
@@ -559,7 +574,7 @@ export declare const projectUpdateSchema: z.ZodObject<{
559
574
  currentTask: z.ZodOptional<z.ZodString>;
560
575
  invariants: z.ZodOptional<z.ZodString>;
561
576
  icon: z.ZodNullable<z.ZodOptional<z.ZodEnum<["code", "terminal", "rocket", "flask", "gamepad", "briefcase", "home", "globe", "leaf", "shield", "palette", "server", "phone", "database", "lightbulb", "music", "camera", "book", "heart", "folder", "chat", "cpu", "file", "file-code", "docs", "task", "todo", "bug", "robot", "brain", "git", "repo", "test", "chart", "star", "image", "calendar"]>>>;
562
- color: z.ZodNullable<z.ZodOptional<z.ZodEnum<["keyword", "string", "number", "type", "comment", "error", "primary", "success"]>>>;
577
+ color: z.ZodNullable<z.ZodOptional<z.ZodEnum<["a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", "a16"]>>>;
563
578
  workspace: z.ZodOptional<z.ZodString>;
564
579
  repos: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
565
580
  id: z.ZodOptional<z.ZodString>;
@@ -593,7 +608,7 @@ export declare const projectUpdateSchema: z.ZodObject<{
593
608
  workspace?: string | undefined;
594
609
  name?: string | undefined;
595
610
  icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
596
- color?: "string" | "number" | "type" | "keyword" | "comment" | "error" | "primary" | "success" | null | undefined;
611
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | null | undefined;
597
612
  description?: string | undefined;
598
613
  repos?: (string | {
599
614
  path: string;
@@ -611,7 +626,7 @@ export declare const projectUpdateSchema: z.ZodObject<{
611
626
  workspace?: string | undefined;
612
627
  name?: string | undefined;
613
628
  icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
614
- color?: "string" | "number" | "type" | "keyword" | "comment" | "error" | "primary" | "success" | null | undefined;
629
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | null | undefined;
615
630
  description?: string | undefined;
616
631
  repos?: (string | {
617
632
  path: string;
@@ -1302,3 +1317,1666 @@ export declare const projectSkillUpdateSchema: z.ZodObject<{
1302
1317
  }>;
1303
1318
  export type SessionSkillUpdateRequest = z.infer<typeof sessionSkillUpdateSchema>;
1304
1319
  export type ProjectSkillUpdateRequest = z.infer<typeof projectSkillUpdateSchema>;
1320
+ /** AD-089: схема идентичности отправителя внешнего события. */
1321
+ export declare const eventIdentitySchema: z.ZodObject<{
1322
+ principalId: z.ZodOptional<z.ZodString>;
1323
+ chatKey: z.ZodOptional<z.ZodString>;
1324
+ threadKey: z.ZodOptional<z.ZodString>;
1325
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1326
+ }, "strip", z.ZodTypeAny, {
1327
+ principalId?: string | undefined;
1328
+ chatKey?: string | undefined;
1329
+ threadKey?: string | undefined;
1330
+ roles?: string[] | undefined;
1331
+ }, {
1332
+ principalId?: string | undefined;
1333
+ chatKey?: string | undefined;
1334
+ threadKey?: string | undefined;
1335
+ roles?: string[] | undefined;
1336
+ }>;
1337
+ /** AD-089: схема нормализованного внешнего события (`payload` не типизируется). */
1338
+ export declare const synthEventSchema: z.ZodObject<{
1339
+ id: z.ZodString;
1340
+ source: z.ZodString;
1341
+ type: z.ZodString;
1342
+ payload: z.ZodUnknown;
1343
+ identity: z.ZodDefault<z.ZodObject<{
1344
+ principalId: z.ZodOptional<z.ZodString>;
1345
+ chatKey: z.ZodOptional<z.ZodString>;
1346
+ threadKey: z.ZodOptional<z.ZodString>;
1347
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1348
+ }, "strip", z.ZodTypeAny, {
1349
+ principalId?: string | undefined;
1350
+ chatKey?: string | undefined;
1351
+ threadKey?: string | undefined;
1352
+ roles?: string[] | undefined;
1353
+ }, {
1354
+ principalId?: string | undefined;
1355
+ chatKey?: string | undefined;
1356
+ threadKey?: string | undefined;
1357
+ roles?: string[] | undefined;
1358
+ }>>;
1359
+ dedupKey: z.ZodString;
1360
+ ts: z.ZodString;
1361
+ }, "strip", z.ZodTypeAny, {
1362
+ type: string;
1363
+ id: string;
1364
+ source: string;
1365
+ identity: {
1366
+ principalId?: string | undefined;
1367
+ chatKey?: string | undefined;
1368
+ threadKey?: string | undefined;
1369
+ roles?: string[] | undefined;
1370
+ };
1371
+ dedupKey: string;
1372
+ ts: string;
1373
+ payload?: unknown;
1374
+ }, {
1375
+ type: string;
1376
+ id: string;
1377
+ source: string;
1378
+ dedupKey: string;
1379
+ ts: string;
1380
+ payload?: unknown;
1381
+ identity?: {
1382
+ principalId?: string | undefined;
1383
+ chatKey?: string | undefined;
1384
+ threadKey?: string | undefined;
1385
+ roles?: string[] | undefined;
1386
+ } | undefined;
1387
+ }>;
1388
+ /** AD-089: схема устойчивой привязки внешнего адреса к сессии/шаблону. */
1389
+ export declare const eventBindingSchema: z.ZodObject<{
1390
+ id: z.ZodString;
1391
+ source: z.ZodString;
1392
+ chatKey: z.ZodOptional<z.ZodString>;
1393
+ threadKey: z.ZodOptional<z.ZodString>;
1394
+ sessionId: z.ZodOptional<z.ZodString>;
1395
+ mode: z.ZodEnum<["bound", "ephemeral", "queue"]>;
1396
+ agentTemplate: z.ZodOptional<z.ZodString>;
1397
+ project: z.ZodOptional<z.ZodString>;
1398
+ }, "strip", z.ZodTypeAny, {
1399
+ mode: "bound" | "ephemeral" | "queue";
1400
+ id: string;
1401
+ source: string;
1402
+ chatKey?: string | undefined;
1403
+ threadKey?: string | undefined;
1404
+ sessionId?: string | undefined;
1405
+ agentTemplate?: string | undefined;
1406
+ project?: string | undefined;
1407
+ }, {
1408
+ mode: "bound" | "ephemeral" | "queue";
1409
+ id: string;
1410
+ source: string;
1411
+ chatKey?: string | undefined;
1412
+ threadKey?: string | undefined;
1413
+ sessionId?: string | undefined;
1414
+ agentTemplate?: string | undefined;
1415
+ project?: string | undefined;
1416
+ }>;
1417
+ /** AD-089: схема запроса создания/привязки сессии — единый funnel. */
1418
+ export declare const sessionRequestSchema: z.ZodObject<{
1419
+ initiator: z.ZodEnum<["user", "agent", "external", "system"]>;
1420
+ intent: z.ZodEnum<["explicit", "event"]>;
1421
+ projectId: z.ZodOptional<z.ZodString>;
1422
+ parentId: z.ZodOptional<z.ZodString>;
1423
+ agentTemplate: z.ZodOptional<z.ZodString>;
1424
+ mode: z.ZodOptional<z.ZodEnum<["bound", "ephemeral", "queue"]>>;
1425
+ ttl: z.ZodOptional<z.ZodString>;
1426
+ title: z.ZodOptional<z.ZodString>;
1427
+ icon: z.ZodOptional<z.ZodEnum<["code", "terminal", "rocket", "flask", "gamepad", "briefcase", "home", "globe", "leaf", "shield", "palette", "server", "phone", "database", "lightbulb", "music", "camera", "book", "heart", "folder", "chat", "cpu", "file", "file-code", "docs", "task", "todo", "bug", "robot", "brain", "git", "repo", "test", "chart", "star", "image", "calendar"]>>;
1428
+ color: z.ZodOptional<z.ZodEnum<["a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", "a16"]>>;
1429
+ engine: z.ZodOptional<z.ZodEnum<["synth", "opencode", "cline"]>>;
1430
+ sessionOrigin: z.ZodOptional<z.ZodEnum<["user", "fork", "subagent"]>>;
1431
+ settings: z.ZodOptional<z.ZodUnknown>;
1432
+ sourceEventId: z.ZodOptional<z.ZodString>;
1433
+ dedupKey: z.ZodOptional<z.ZodString>;
1434
+ }, "strip", z.ZodTypeAny, {
1435
+ initiator: "user" | "agent" | "system" | "external";
1436
+ intent: "explicit" | "event";
1437
+ mode?: "bound" | "ephemeral" | "queue" | undefined;
1438
+ title?: string | undefined;
1439
+ icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | undefined;
1440
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | undefined;
1441
+ projectId?: string | undefined;
1442
+ engine?: "synth" | "opencode" | "cline" | undefined;
1443
+ settings?: unknown;
1444
+ dedupKey?: string | undefined;
1445
+ agentTemplate?: string | undefined;
1446
+ parentId?: string | undefined;
1447
+ ttl?: string | undefined;
1448
+ sessionOrigin?: "user" | "fork" | "subagent" | undefined;
1449
+ sourceEventId?: string | undefined;
1450
+ }, {
1451
+ initiator: "user" | "agent" | "system" | "external";
1452
+ intent: "explicit" | "event";
1453
+ mode?: "bound" | "ephemeral" | "queue" | undefined;
1454
+ title?: string | undefined;
1455
+ icon?: "task" | "code" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "chat" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | undefined;
1456
+ color?: "a1" | "a2" | "a3" | "a4" | "a5" | "a6" | "a7" | "a8" | "a9" | "a10" | "a11" | "a12" | "a13" | "a14" | "a15" | "a16" | undefined;
1457
+ projectId?: string | undefined;
1458
+ engine?: "synth" | "opencode" | "cline" | undefined;
1459
+ settings?: unknown;
1460
+ dedupKey?: string | undefined;
1461
+ agentTemplate?: string | undefined;
1462
+ parentId?: string | undefined;
1463
+ ttl?: string | undefined;
1464
+ sessionOrigin?: "user" | "fork" | "subagent" | undefined;
1465
+ sourceEventId?: string | undefined;
1466
+ }>;
1467
+ /**
1468
+ * AD-089: вход приёма внешнего события (`POST /api/v2/events`). `id`/`dedupKey`/`ts`
1469
+ * нормализуются `EventIngress`, поэтому здесь опциональны.
1470
+ */
1471
+ export declare const eventIngestSchema: z.ZodObject<{
1472
+ source: z.ZodString;
1473
+ type: z.ZodString;
1474
+ payload: z.ZodOptional<z.ZodUnknown>;
1475
+ identity: z.ZodOptional<z.ZodObject<{
1476
+ principalId: z.ZodOptional<z.ZodString>;
1477
+ chatKey: z.ZodOptional<z.ZodString>;
1478
+ threadKey: z.ZodOptional<z.ZodString>;
1479
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1480
+ }, "strip", z.ZodTypeAny, {
1481
+ principalId?: string | undefined;
1482
+ chatKey?: string | undefined;
1483
+ threadKey?: string | undefined;
1484
+ roles?: string[] | undefined;
1485
+ }, {
1486
+ principalId?: string | undefined;
1487
+ chatKey?: string | undefined;
1488
+ threadKey?: string | undefined;
1489
+ roles?: string[] | undefined;
1490
+ }>>;
1491
+ dedupKey: z.ZodOptional<z.ZodString>;
1492
+ ts: z.ZodOptional<z.ZodString>;
1493
+ }, "strip", z.ZodTypeAny, {
1494
+ type: string;
1495
+ source: string;
1496
+ payload?: unknown;
1497
+ identity?: {
1498
+ principalId?: string | undefined;
1499
+ chatKey?: string | undefined;
1500
+ threadKey?: string | undefined;
1501
+ roles?: string[] | undefined;
1502
+ } | undefined;
1503
+ dedupKey?: string | undefined;
1504
+ ts?: string | undefined;
1505
+ }, {
1506
+ type: string;
1507
+ source: string;
1508
+ payload?: unknown;
1509
+ identity?: {
1510
+ principalId?: string | undefined;
1511
+ chatKey?: string | undefined;
1512
+ threadKey?: string | undefined;
1513
+ roles?: string[] | undefined;
1514
+ } | undefined;
1515
+ dedupKey?: string | undefined;
1516
+ ts?: string | undefined;
1517
+ }>;
1518
+ export type EventIngestRequest = z.infer<typeof eventIngestSchema>;
1519
+ /** AD-089: вход upsert биндинга (`POST /api/v2/events/bindings`) — без `id`. */
1520
+ export declare const eventBindingInputSchema: z.ZodObject<{
1521
+ source: z.ZodString;
1522
+ chatKey: z.ZodOptional<z.ZodString>;
1523
+ threadKey: z.ZodOptional<z.ZodString>;
1524
+ sessionId: z.ZodOptional<z.ZodString>;
1525
+ mode: z.ZodEnum<["bound", "ephemeral", "queue"]>;
1526
+ agentTemplate: z.ZodOptional<z.ZodString>;
1527
+ project: z.ZodOptional<z.ZodString>;
1528
+ }, "strip", z.ZodTypeAny, {
1529
+ mode: "bound" | "ephemeral" | "queue";
1530
+ source: string;
1531
+ chatKey?: string | undefined;
1532
+ threadKey?: string | undefined;
1533
+ sessionId?: string | undefined;
1534
+ agentTemplate?: string | undefined;
1535
+ project?: string | undefined;
1536
+ }, {
1537
+ mode: "bound" | "ephemeral" | "queue";
1538
+ source: string;
1539
+ chatKey?: string | undefined;
1540
+ threadKey?: string | undefined;
1541
+ sessionId?: string | undefined;
1542
+ agentTemplate?: string | undefined;
1543
+ project?: string | undefined;
1544
+ }>;
1545
+ export type EventBindingInputRequest = z.infer<typeof eventBindingInputSchema>;
1546
+ /**
1547
+ * AD-089/AD-052: метаданные API-ключа привязки для приёма событий.
1548
+ * Секрет (`key`) и его хеш здесь отсутствуют — наружу не отдаются.
1549
+ */
1550
+ export declare const eventBindingApiKeySchema: z.ZodObject<{
1551
+ id: z.ZodString;
1552
+ bindingId: z.ZodString;
1553
+ label: z.ZodString;
1554
+ description: z.ZodOptional<z.ZodString>;
1555
+ rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
1556
+ createdBy: z.ZodString;
1557
+ createdAt: z.ZodString;
1558
+ lastUsedAt: z.ZodOptional<z.ZodString>;
1559
+ prefix: z.ZodString;
1560
+ expiresAt: z.ZodOptional<z.ZodString>;
1561
+ revokedAt: z.ZodOptional<z.ZodString>;
1562
+ }, "strip", z.ZodTypeAny, {
1563
+ id: string;
1564
+ bindingId: string;
1565
+ label: string;
1566
+ createdBy: string;
1567
+ createdAt: string;
1568
+ prefix: string;
1569
+ description?: string | undefined;
1570
+ rateLimitPerMinute?: number | undefined;
1571
+ lastUsedAt?: string | undefined;
1572
+ expiresAt?: string | undefined;
1573
+ revokedAt?: string | undefined;
1574
+ }, {
1575
+ id: string;
1576
+ bindingId: string;
1577
+ label: string;
1578
+ createdBy: string;
1579
+ createdAt: string;
1580
+ prefix: string;
1581
+ description?: string | undefined;
1582
+ rateLimitPerMinute?: number | undefined;
1583
+ lastUsedAt?: string | undefined;
1584
+ expiresAt?: string | undefined;
1585
+ revokedAt?: string | undefined;
1586
+ }>;
1587
+ export type EventBindingApiKeyMeta = z.infer<typeof eventBindingApiKeySchema>;
1588
+ /** AD-089/AD-052: тело создания API-ключа привязки — обязательная уникальная `label`. */
1589
+ export declare const eventBindingApiKeyCreateSchema: z.ZodObject<{
1590
+ label: z.ZodString;
1591
+ description: z.ZodOptional<z.ZodString>;
1592
+ expiresAt: z.ZodOptional<z.ZodString>;
1593
+ rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
1594
+ }, "strip", z.ZodTypeAny, {
1595
+ label: string;
1596
+ description?: string | undefined;
1597
+ rateLimitPerMinute?: number | undefined;
1598
+ expiresAt?: string | undefined;
1599
+ }, {
1600
+ label: string;
1601
+ description?: string | undefined;
1602
+ rateLimitPerMinute?: number | undefined;
1603
+ expiresAt?: string | undefined;
1604
+ }>;
1605
+ export type EventBindingApiKeyCreateRequest = z.infer<typeof eventBindingApiKeyCreateSchema>;
1606
+ /**
1607
+ * AD-089/AD-052: тело обновления API-ключа привязки. Все поля опциональны;
1608
+ * `null` для `description`/`expiresAt`/`rateLimitPerMinute` — сброс значения.
1609
+ */
1610
+ export declare const eventBindingApiKeyUpdateSchema: z.ZodObject<{
1611
+ label: z.ZodOptional<z.ZodString>;
1612
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1613
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1614
+ rateLimitPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1615
+ }, "strip", z.ZodTypeAny, {
1616
+ description?: string | null | undefined;
1617
+ label?: string | undefined;
1618
+ rateLimitPerMinute?: number | null | undefined;
1619
+ expiresAt?: string | null | undefined;
1620
+ }, {
1621
+ description?: string | null | undefined;
1622
+ label?: string | undefined;
1623
+ rateLimitPerMinute?: number | null | undefined;
1624
+ expiresAt?: string | null | undefined;
1625
+ }>;
1626
+ export type EventBindingApiKeyUpdateRequest = z.infer<typeof eventBindingApiKeyUpdateSchema>;
1627
+ /** AD-089: ответ создания ключа — метаданные + plaintext-секрет (единожды). */
1628
+ export declare const eventBindingApiKeyCreatedSchema: z.ZodObject<{
1629
+ id: z.ZodString;
1630
+ bindingId: z.ZodString;
1631
+ label: z.ZodString;
1632
+ description: z.ZodOptional<z.ZodString>;
1633
+ rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
1634
+ createdBy: z.ZodString;
1635
+ createdAt: z.ZodString;
1636
+ lastUsedAt: z.ZodOptional<z.ZodString>;
1637
+ prefix: z.ZodString;
1638
+ expiresAt: z.ZodOptional<z.ZodString>;
1639
+ revokedAt: z.ZodOptional<z.ZodString>;
1640
+ } & {
1641
+ key: z.ZodString;
1642
+ }, "strip", z.ZodTypeAny, {
1643
+ id: string;
1644
+ bindingId: string;
1645
+ label: string;
1646
+ createdBy: string;
1647
+ createdAt: string;
1648
+ prefix: string;
1649
+ key: string;
1650
+ description?: string | undefined;
1651
+ rateLimitPerMinute?: number | undefined;
1652
+ lastUsedAt?: string | undefined;
1653
+ expiresAt?: string | undefined;
1654
+ revokedAt?: string | undefined;
1655
+ }, {
1656
+ id: string;
1657
+ bindingId: string;
1658
+ label: string;
1659
+ createdBy: string;
1660
+ createdAt: string;
1661
+ prefix: string;
1662
+ key: string;
1663
+ description?: string | undefined;
1664
+ rateLimitPerMinute?: number | undefined;
1665
+ lastUsedAt?: string | undefined;
1666
+ expiresAt?: string | undefined;
1667
+ revokedAt?: string | undefined;
1668
+ }>;
1669
+ export type EventBindingApiKeyCreatedRequest = z.infer<typeof eventBindingApiKeyCreatedSchema>;
1670
+ /**
1671
+ * AD-089: вход `POST /events` при аутентификации API-ключом привязки. Как
1672
+ * `eventIngestSchema`, но `source` опционален — источник берётся из привязки.
1673
+ */
1674
+ export declare const eventKeyIngestSchema: z.ZodObject<{
1675
+ type: z.ZodString;
1676
+ source: z.ZodOptional<z.ZodString>;
1677
+ payload: z.ZodOptional<z.ZodUnknown>;
1678
+ identity: z.ZodOptional<z.ZodObject<{
1679
+ principalId: z.ZodOptional<z.ZodString>;
1680
+ chatKey: z.ZodOptional<z.ZodString>;
1681
+ threadKey: z.ZodOptional<z.ZodString>;
1682
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1683
+ }, "strip", z.ZodTypeAny, {
1684
+ principalId?: string | undefined;
1685
+ chatKey?: string | undefined;
1686
+ threadKey?: string | undefined;
1687
+ roles?: string[] | undefined;
1688
+ }, {
1689
+ principalId?: string | undefined;
1690
+ chatKey?: string | undefined;
1691
+ threadKey?: string | undefined;
1692
+ roles?: string[] | undefined;
1693
+ }>>;
1694
+ dedupKey: z.ZodOptional<z.ZodString>;
1695
+ ts: z.ZodOptional<z.ZodString>;
1696
+ }, "strip", z.ZodTypeAny, {
1697
+ type: string;
1698
+ source?: string | undefined;
1699
+ payload?: unknown;
1700
+ identity?: {
1701
+ principalId?: string | undefined;
1702
+ chatKey?: string | undefined;
1703
+ threadKey?: string | undefined;
1704
+ roles?: string[] | undefined;
1705
+ } | undefined;
1706
+ dedupKey?: string | undefined;
1707
+ ts?: string | undefined;
1708
+ }, {
1709
+ type: string;
1710
+ source?: string | undefined;
1711
+ payload?: unknown;
1712
+ identity?: {
1713
+ principalId?: string | undefined;
1714
+ chatKey?: string | undefined;
1715
+ threadKey?: string | undefined;
1716
+ roles?: string[] | undefined;
1717
+ } | undefined;
1718
+ dedupKey?: string | undefined;
1719
+ ts?: string | undefined;
1720
+ }>;
1721
+ export type EventKeyIngestRequest = z.infer<typeof eventKeyIngestSchema>;
1722
+ /**
1723
+ * AD-052: каталог скоупов service-key + wildcard-семейства. Глобальный `*` не
1724
+ * принимается (`isKnownScope`).
1725
+ */
1726
+ export declare const serviceScopeSchema: z.ZodEffects<z.ZodString, string, string>;
1727
+ /**
1728
+ * AD-052: метаданные service-key (ответы API). Секрет (`key`) и его хеш здесь
1729
+ * отсутствуют — наружу не отдаются (в списке — `prefix`).
1730
+ */
1731
+ export declare const serviceApiKeySchema: z.ZodObject<{
1732
+ id: z.ZodString;
1733
+ label: z.ZodString;
1734
+ description: z.ZodOptional<z.ZodString>;
1735
+ roles: z.ZodArray<z.ZodNativeEnum<typeof GlobalRole>, "many">;
1736
+ scopes: z.ZodArray<z.ZodString, "many">;
1737
+ allowedProjects: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1738
+ rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
1739
+ expiresAt: z.ZodOptional<z.ZodString>;
1740
+ revokedAt: z.ZodOptional<z.ZodString>;
1741
+ createdBy: z.ZodString;
1742
+ createdAt: z.ZodString;
1743
+ lastUsedAt: z.ZodOptional<z.ZodString>;
1744
+ prefix: z.ZodString;
1745
+ }, "strip", z.ZodTypeAny, {
1746
+ id: string;
1747
+ roles: GlobalRole[];
1748
+ label: string;
1749
+ createdBy: string;
1750
+ createdAt: string;
1751
+ prefix: string;
1752
+ scopes: string[];
1753
+ description?: string | undefined;
1754
+ rateLimitPerMinute?: number | undefined;
1755
+ lastUsedAt?: string | undefined;
1756
+ expiresAt?: string | undefined;
1757
+ revokedAt?: string | undefined;
1758
+ allowedProjects?: string[] | undefined;
1759
+ }, {
1760
+ id: string;
1761
+ roles: GlobalRole[];
1762
+ label: string;
1763
+ createdBy: string;
1764
+ createdAt: string;
1765
+ prefix: string;
1766
+ scopes: string[];
1767
+ description?: string | undefined;
1768
+ rateLimitPerMinute?: number | undefined;
1769
+ lastUsedAt?: string | undefined;
1770
+ expiresAt?: string | undefined;
1771
+ revokedAt?: string | undefined;
1772
+ allowedProjects?: string[] | undefined;
1773
+ }>;
1774
+ export type ServiceApiKeyMeta = z.infer<typeof serviceApiKeySchema>;
1775
+ /** AD-052: тело создания service-key. `roles` не заданы — дефолт хранилища. */
1776
+ export declare const serviceApiKeyCreateSchema: z.ZodObject<{
1777
+ label: z.ZodString;
1778
+ description: z.ZodOptional<z.ZodString>;
1779
+ roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof GlobalRole>, "many">>;
1780
+ scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
1781
+ allowedProjects: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1782
+ rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
1783
+ expiresAt: z.ZodOptional<z.ZodString>;
1784
+ }, "strip", z.ZodTypeAny, {
1785
+ label: string;
1786
+ scopes: string[];
1787
+ description?: string | undefined;
1788
+ roles?: GlobalRole[] | undefined;
1789
+ rateLimitPerMinute?: number | undefined;
1790
+ expiresAt?: string | undefined;
1791
+ allowedProjects?: string[] | undefined;
1792
+ }, {
1793
+ label: string;
1794
+ scopes: string[];
1795
+ description?: string | undefined;
1796
+ roles?: GlobalRole[] | undefined;
1797
+ rateLimitPerMinute?: number | undefined;
1798
+ expiresAt?: string | undefined;
1799
+ allowedProjects?: string[] | undefined;
1800
+ }>;
1801
+ export type ServiceApiKeyCreateRequest = z.infer<typeof serviceApiKeyCreateSchema>;
1802
+ /**
1803
+ * AD-052: тело обновления service-key. Все поля опциональны; `null` для
1804
+ * `description`/`allowedProjects`/`rateLimitPerMinute`/`expiresAt` — сброс.
1805
+ */
1806
+ export declare const serviceApiKeyUpdateSchema: z.ZodObject<{
1807
+ label: z.ZodOptional<z.ZodString>;
1808
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1809
+ roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof GlobalRole>, "many">>;
1810
+ scopes: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
1811
+ allowedProjects: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
1812
+ rateLimitPerMinute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1813
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1814
+ }, "strip", z.ZodTypeAny, {
1815
+ description?: string | null | undefined;
1816
+ roles?: GlobalRole[] | undefined;
1817
+ label?: string | undefined;
1818
+ rateLimitPerMinute?: number | null | undefined;
1819
+ expiresAt?: string | null | undefined;
1820
+ scopes?: string[] | undefined;
1821
+ allowedProjects?: string[] | null | undefined;
1822
+ }, {
1823
+ description?: string | null | undefined;
1824
+ roles?: GlobalRole[] | undefined;
1825
+ label?: string | undefined;
1826
+ rateLimitPerMinute?: number | null | undefined;
1827
+ expiresAt?: string | null | undefined;
1828
+ scopes?: string[] | undefined;
1829
+ allowedProjects?: string[] | null | undefined;
1830
+ }>;
1831
+ export type ServiceApiKeyUpdateRequest = z.infer<typeof serviceApiKeyUpdateSchema>;
1832
+ /** AD-052: ответ создания service-key — метаданные + plaintext-секрет (единожды). */
1833
+ export declare const serviceApiKeyCreatedSchema: z.ZodObject<{
1834
+ id: z.ZodString;
1835
+ label: z.ZodString;
1836
+ description: z.ZodOptional<z.ZodString>;
1837
+ roles: z.ZodArray<z.ZodNativeEnum<typeof GlobalRole>, "many">;
1838
+ scopes: z.ZodArray<z.ZodString, "many">;
1839
+ allowedProjects: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1840
+ rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
1841
+ expiresAt: z.ZodOptional<z.ZodString>;
1842
+ revokedAt: z.ZodOptional<z.ZodString>;
1843
+ createdBy: z.ZodString;
1844
+ createdAt: z.ZodString;
1845
+ lastUsedAt: z.ZodOptional<z.ZodString>;
1846
+ prefix: z.ZodString;
1847
+ } & {
1848
+ key: z.ZodString;
1849
+ }, "strip", z.ZodTypeAny, {
1850
+ id: string;
1851
+ roles: GlobalRole[];
1852
+ label: string;
1853
+ createdBy: string;
1854
+ createdAt: string;
1855
+ prefix: string;
1856
+ key: string;
1857
+ scopes: string[];
1858
+ description?: string | undefined;
1859
+ rateLimitPerMinute?: number | undefined;
1860
+ lastUsedAt?: string | undefined;
1861
+ expiresAt?: string | undefined;
1862
+ revokedAt?: string | undefined;
1863
+ allowedProjects?: string[] | undefined;
1864
+ }, {
1865
+ id: string;
1866
+ roles: GlobalRole[];
1867
+ label: string;
1868
+ createdBy: string;
1869
+ createdAt: string;
1870
+ prefix: string;
1871
+ key: string;
1872
+ scopes: string[];
1873
+ description?: string | undefined;
1874
+ rateLimitPerMinute?: number | undefined;
1875
+ lastUsedAt?: string | undefined;
1876
+ expiresAt?: string | undefined;
1877
+ revokedAt?: string | undefined;
1878
+ allowedProjects?: string[] | undefined;
1879
+ }>;
1880
+ export type ServiceApiKeyCreatedRequest = z.infer<typeof serviceApiKeyCreatedSchema>;
1881
+ /** AD-052 (этап II): паттерн события подписки — exact либо `prefix.*`. */
1882
+ export declare const webhookEventPatternSchema: z.ZodEffects<z.ZodString, string, string>;
1883
+ /** AD-052 (этап II): целевой URL — только http/https (SSRF-политика — в core). */
1884
+ export declare const webhookUrlSchema: z.ZodEffects<z.ZodString, string, string>;
1885
+ /**
1886
+ * AD-052 (этап II): метаданные подписки (ответы API). Секрет (`secret`) и его
1887
+ * хеш здесь отсутствуют — наружу не отдаются (в списке — `secretPrefix`).
1888
+ */
1889
+ export declare const webhookSubscriptionSchema: z.ZodObject<{
1890
+ id: z.ZodString;
1891
+ label: z.ZodString;
1892
+ description: z.ZodOptional<z.ZodString>;
1893
+ url: z.ZodEffects<z.ZodString, string, string>;
1894
+ events: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
1895
+ enabled: z.ZodBoolean;
1896
+ secretPrefix: z.ZodString;
1897
+ createdBy: z.ZodString;
1898
+ createdAt: z.ZodString;
1899
+ lastDeliveryAt: z.ZodOptional<z.ZodString>;
1900
+ lastStatus: z.ZodOptional<z.ZodEnum<["ok", "failed"]>>;
1901
+ disabledAt: z.ZodOptional<z.ZodString>;
1902
+ }, "strip", z.ZodTypeAny, {
1903
+ id: string;
1904
+ url: string;
1905
+ enabled: boolean;
1906
+ label: string;
1907
+ createdBy: string;
1908
+ createdAt: string;
1909
+ events: string[];
1910
+ secretPrefix: string;
1911
+ description?: string | undefined;
1912
+ lastDeliveryAt?: string | undefined;
1913
+ lastStatus?: "ok" | "failed" | undefined;
1914
+ disabledAt?: string | undefined;
1915
+ }, {
1916
+ id: string;
1917
+ url: string;
1918
+ enabled: boolean;
1919
+ label: string;
1920
+ createdBy: string;
1921
+ createdAt: string;
1922
+ events: string[];
1923
+ secretPrefix: string;
1924
+ description?: string | undefined;
1925
+ lastDeliveryAt?: string | undefined;
1926
+ lastStatus?: "ok" | "failed" | undefined;
1927
+ disabledAt?: string | undefined;
1928
+ }>;
1929
+ export type WebhookSubscriptionMeta = z.infer<typeof webhookSubscriptionSchema>;
1930
+ /** AD-052 (этап II): тело создания подписки. `enabled` не задан — активна. */
1931
+ export declare const webhookSubscriptionCreateSchema: z.ZodObject<{
1932
+ label: z.ZodString;
1933
+ description: z.ZodOptional<z.ZodString>;
1934
+ url: z.ZodEffects<z.ZodString, string, string>;
1935
+ events: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
1936
+ enabled: z.ZodOptional<z.ZodBoolean>;
1937
+ }, "strip", z.ZodTypeAny, {
1938
+ url: string;
1939
+ label: string;
1940
+ description?: string | undefined;
1941
+ enabled?: boolean | undefined;
1942
+ events?: string[] | undefined;
1943
+ }, {
1944
+ url: string;
1945
+ label: string;
1946
+ description?: string | undefined;
1947
+ enabled?: boolean | undefined;
1948
+ events?: string[] | undefined;
1949
+ }>;
1950
+ export type WebhookSubscriptionCreateRequest = z.infer<typeof webhookSubscriptionCreateSchema>;
1951
+ /**
1952
+ * AD-052 (этап II): тело обновления подписки. Все поля опциональны; `null` для
1953
+ * `description` — сброс.
1954
+ */
1955
+ export declare const webhookSubscriptionUpdateSchema: z.ZodObject<{
1956
+ label: z.ZodOptional<z.ZodString>;
1957
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1958
+ url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1959
+ events: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
1960
+ enabled: z.ZodOptional<z.ZodBoolean>;
1961
+ }, "strip", z.ZodTypeAny, {
1962
+ url?: string | undefined;
1963
+ description?: string | null | undefined;
1964
+ enabled?: boolean | undefined;
1965
+ label?: string | undefined;
1966
+ events?: string[] | undefined;
1967
+ }, {
1968
+ url?: string | undefined;
1969
+ description?: string | null | undefined;
1970
+ enabled?: boolean | undefined;
1971
+ label?: string | undefined;
1972
+ events?: string[] | undefined;
1973
+ }>;
1974
+ export type WebhookSubscriptionUpdateRequest = z.infer<typeof webhookSubscriptionUpdateSchema>;
1975
+ /** AD-052 (этап II): ответ создания/ротации подписки — метаданные + секрет (единожды). */
1976
+ export declare const webhookSubscriptionCreatedSchema: z.ZodObject<{
1977
+ id: z.ZodString;
1978
+ label: z.ZodString;
1979
+ description: z.ZodOptional<z.ZodString>;
1980
+ url: z.ZodEffects<z.ZodString, string, string>;
1981
+ events: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
1982
+ enabled: z.ZodBoolean;
1983
+ secretPrefix: z.ZodString;
1984
+ createdBy: z.ZodString;
1985
+ createdAt: z.ZodString;
1986
+ lastDeliveryAt: z.ZodOptional<z.ZodString>;
1987
+ lastStatus: z.ZodOptional<z.ZodEnum<["ok", "failed"]>>;
1988
+ disabledAt: z.ZodOptional<z.ZodString>;
1989
+ } & {
1990
+ secret: z.ZodString;
1991
+ }, "strip", z.ZodTypeAny, {
1992
+ id: string;
1993
+ url: string;
1994
+ enabled: boolean;
1995
+ label: string;
1996
+ createdBy: string;
1997
+ createdAt: string;
1998
+ events: string[];
1999
+ secretPrefix: string;
2000
+ secret: string;
2001
+ description?: string | undefined;
2002
+ lastDeliveryAt?: string | undefined;
2003
+ lastStatus?: "ok" | "failed" | undefined;
2004
+ disabledAt?: string | undefined;
2005
+ }, {
2006
+ id: string;
2007
+ url: string;
2008
+ enabled: boolean;
2009
+ label: string;
2010
+ createdBy: string;
2011
+ createdAt: string;
2012
+ events: string[];
2013
+ secretPrefix: string;
2014
+ secret: string;
2015
+ description?: string | undefined;
2016
+ lastDeliveryAt?: string | undefined;
2017
+ lastStatus?: "ok" | "failed" | undefined;
2018
+ disabledAt?: string | undefined;
2019
+ }>;
2020
+ export type WebhookSubscriptionCreatedRequest = z.infer<typeof webhookSubscriptionCreatedSchema>;
2021
+ /** AD-052 (этап II): запись журнала доставки. */
2022
+ export declare const webhookDeliverySchema: z.ZodObject<{
2023
+ id: z.ZodString;
2024
+ subscriptionId: z.ZodString;
2025
+ eventType: z.ZodString;
2026
+ status: z.ZodEnum<["ok", "failed", "pending"]>;
2027
+ attempts: z.ZodNumber;
2028
+ responseStatus: z.ZodOptional<z.ZodNumber>;
2029
+ error: z.ZodOptional<z.ZodString>;
2030
+ createdAt: z.ZodString;
2031
+ completedAt: z.ZodOptional<z.ZodString>;
2032
+ }, "strip", z.ZodTypeAny, {
2033
+ status: "ok" | "failed" | "pending";
2034
+ id: string;
2035
+ createdAt: string;
2036
+ subscriptionId: string;
2037
+ eventType: string;
2038
+ attempts: number;
2039
+ responseStatus?: number | undefined;
2040
+ error?: string | undefined;
2041
+ completedAt?: string | undefined;
2042
+ }, {
2043
+ status: "ok" | "failed" | "pending";
2044
+ id: string;
2045
+ createdAt: string;
2046
+ subscriptionId: string;
2047
+ eventType: string;
2048
+ attempts: number;
2049
+ responseStatus?: number | undefined;
2050
+ error?: string | undefined;
2051
+ completedAt?: string | undefined;
2052
+ }>;
2053
+ export type WebhookDeliveryMeta = z.infer<typeof webhookDeliverySchema>;
2054
+ /** AD-051/AD-089: цель расписания (дискриминированный союз по `mode`). */
2055
+ export declare const scheduleTargetSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2056
+ mode: z.ZodLiteral<"bound">;
2057
+ sessionId: z.ZodString;
2058
+ }, "strip", z.ZodTypeAny, {
2059
+ mode: "bound";
2060
+ sessionId: string;
2061
+ }, {
2062
+ mode: "bound";
2063
+ sessionId: string;
2064
+ }>, z.ZodObject<{
2065
+ mode: z.ZodLiteral<"ephemeral">;
2066
+ agentTemplate: z.ZodOptional<z.ZodString>;
2067
+ project: z.ZodOptional<z.ZodString>;
2068
+ ttl: z.ZodOptional<z.ZodString>;
2069
+ }, "strip", z.ZodTypeAny, {
2070
+ mode: "ephemeral";
2071
+ agentTemplate?: string | undefined;
2072
+ project?: string | undefined;
2073
+ ttl?: string | undefined;
2074
+ }, {
2075
+ mode: "ephemeral";
2076
+ agentTemplate?: string | undefined;
2077
+ project?: string | undefined;
2078
+ ttl?: string | undefined;
2079
+ }>, z.ZodObject<{
2080
+ mode: z.ZodLiteral<"queue">;
2081
+ sessionId: z.ZodString;
2082
+ }, "strip", z.ZodTypeAny, {
2083
+ mode: "queue";
2084
+ sessionId: string;
2085
+ }, {
2086
+ mode: "queue";
2087
+ sessionId: string;
2088
+ }>]>;
2089
+ /**
2090
+ * AD-089: цель правила маршрутизации — дискриминированный союз по `mode`
2091
+ * (семантика та же, что у `scheduleTargetSchema`).
2092
+ */
2093
+ export declare const eventRouteTargetSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2094
+ mode: z.ZodLiteral<"bound">;
2095
+ sessionId: z.ZodString;
2096
+ }, "strip", z.ZodTypeAny, {
2097
+ mode: "bound";
2098
+ sessionId: string;
2099
+ }, {
2100
+ mode: "bound";
2101
+ sessionId: string;
2102
+ }>, z.ZodObject<{
2103
+ mode: z.ZodLiteral<"ephemeral">;
2104
+ agentTemplate: z.ZodOptional<z.ZodString>;
2105
+ project: z.ZodOptional<z.ZodString>;
2106
+ ttl: z.ZodOptional<z.ZodString>;
2107
+ }, "strip", z.ZodTypeAny, {
2108
+ mode: "ephemeral";
2109
+ agentTemplate?: string | undefined;
2110
+ project?: string | undefined;
2111
+ ttl?: string | undefined;
2112
+ }, {
2113
+ mode: "ephemeral";
2114
+ agentTemplate?: string | undefined;
2115
+ project?: string | undefined;
2116
+ ttl?: string | undefined;
2117
+ }>, z.ZodObject<{
2118
+ mode: z.ZodLiteral<"queue">;
2119
+ sessionId: z.ZodString;
2120
+ }, "strip", z.ZodTypeAny, {
2121
+ mode: "queue";
2122
+ sessionId: string;
2123
+ }, {
2124
+ mode: "queue";
2125
+ sessionId: string;
2126
+ }>, z.ZodObject<{
2127
+ mode: z.ZodLiteral<"bind">;
2128
+ agentTemplate: z.ZodOptional<z.ZodString>;
2129
+ project: z.ZodOptional<z.ZodString>;
2130
+ }, "strip", z.ZodTypeAny, {
2131
+ mode: "bind";
2132
+ agentTemplate?: string | undefined;
2133
+ project?: string | undefined;
2134
+ }, {
2135
+ mode: "bind";
2136
+ agentTemplate?: string | undefined;
2137
+ project?: string | undefined;
2138
+ }>]>;
2139
+ /** AD-089: условие срабатывания правила (AND по заполненным полям). */
2140
+ export declare const eventRouteMatchSchema: z.ZodObject<{
2141
+ source: z.ZodOptional<z.ZodString>;
2142
+ type: z.ZodOptional<z.ZodString>;
2143
+ chatKey: z.ZodOptional<z.ZodString>;
2144
+ threadKey: z.ZodOptional<z.ZodString>;
2145
+ principalId: z.ZodOptional<z.ZodString>;
2146
+ label: z.ZodOptional<z.ZodString>;
2147
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2148
+ }, "strip", z.ZodTypeAny, {
2149
+ type?: string | undefined;
2150
+ principalId?: string | undefined;
2151
+ chatKey?: string | undefined;
2152
+ threadKey?: string | undefined;
2153
+ source?: string | undefined;
2154
+ label?: string | undefined;
2155
+ keywords?: string[] | undefined;
2156
+ }, {
2157
+ type?: string | undefined;
2158
+ principalId?: string | undefined;
2159
+ chatKey?: string | undefined;
2160
+ threadKey?: string | undefined;
2161
+ source?: string | undefined;
2162
+ label?: string | undefined;
2163
+ keywords?: string[] | undefined;
2164
+ }>;
2165
+ /** AD-089: полная сущность правила маршрутизации событий (ответы API). */
2166
+ export declare const eventRouteRuleSchema: z.ZodObject<{
2167
+ id: z.ZodString;
2168
+ name: z.ZodOptional<z.ZodString>;
2169
+ priority: z.ZodDefault<z.ZodNumber>;
2170
+ enabled: z.ZodDefault<z.ZodBoolean>;
2171
+ match: z.ZodObject<{
2172
+ source: z.ZodOptional<z.ZodString>;
2173
+ type: z.ZodOptional<z.ZodString>;
2174
+ chatKey: z.ZodOptional<z.ZodString>;
2175
+ threadKey: z.ZodOptional<z.ZodString>;
2176
+ principalId: z.ZodOptional<z.ZodString>;
2177
+ label: z.ZodOptional<z.ZodString>;
2178
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2179
+ }, "strip", z.ZodTypeAny, {
2180
+ type?: string | undefined;
2181
+ principalId?: string | undefined;
2182
+ chatKey?: string | undefined;
2183
+ threadKey?: string | undefined;
2184
+ source?: string | undefined;
2185
+ label?: string | undefined;
2186
+ keywords?: string[] | undefined;
2187
+ }, {
2188
+ type?: string | undefined;
2189
+ principalId?: string | undefined;
2190
+ chatKey?: string | undefined;
2191
+ threadKey?: string | undefined;
2192
+ source?: string | undefined;
2193
+ label?: string | undefined;
2194
+ keywords?: string[] | undefined;
2195
+ }>;
2196
+ target: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2197
+ mode: z.ZodLiteral<"bound">;
2198
+ sessionId: z.ZodString;
2199
+ }, "strip", z.ZodTypeAny, {
2200
+ mode: "bound";
2201
+ sessionId: string;
2202
+ }, {
2203
+ mode: "bound";
2204
+ sessionId: string;
2205
+ }>, z.ZodObject<{
2206
+ mode: z.ZodLiteral<"ephemeral">;
2207
+ agentTemplate: z.ZodOptional<z.ZodString>;
2208
+ project: z.ZodOptional<z.ZodString>;
2209
+ ttl: z.ZodOptional<z.ZodString>;
2210
+ }, "strip", z.ZodTypeAny, {
2211
+ mode: "ephemeral";
2212
+ agentTemplate?: string | undefined;
2213
+ project?: string | undefined;
2214
+ ttl?: string | undefined;
2215
+ }, {
2216
+ mode: "ephemeral";
2217
+ agentTemplate?: string | undefined;
2218
+ project?: string | undefined;
2219
+ ttl?: string | undefined;
2220
+ }>, z.ZodObject<{
2221
+ mode: z.ZodLiteral<"queue">;
2222
+ sessionId: z.ZodString;
2223
+ }, "strip", z.ZodTypeAny, {
2224
+ mode: "queue";
2225
+ sessionId: string;
2226
+ }, {
2227
+ mode: "queue";
2228
+ sessionId: string;
2229
+ }>, z.ZodObject<{
2230
+ mode: z.ZodLiteral<"bind">;
2231
+ agentTemplate: z.ZodOptional<z.ZodString>;
2232
+ project: z.ZodOptional<z.ZodString>;
2233
+ }, "strip", z.ZodTypeAny, {
2234
+ mode: "bind";
2235
+ agentTemplate?: string | undefined;
2236
+ project?: string | undefined;
2237
+ }, {
2238
+ mode: "bind";
2239
+ agentTemplate?: string | undefined;
2240
+ project?: string | undefined;
2241
+ }>]>;
2242
+ }, "strip", z.ZodTypeAny, {
2243
+ id: string;
2244
+ enabled: boolean;
2245
+ priority: number;
2246
+ match: {
2247
+ type?: string | undefined;
2248
+ principalId?: string | undefined;
2249
+ chatKey?: string | undefined;
2250
+ threadKey?: string | undefined;
2251
+ source?: string | undefined;
2252
+ label?: string | undefined;
2253
+ keywords?: string[] | undefined;
2254
+ };
2255
+ target: {
2256
+ mode: "bound";
2257
+ sessionId: string;
2258
+ } | {
2259
+ mode: "ephemeral";
2260
+ agentTemplate?: string | undefined;
2261
+ project?: string | undefined;
2262
+ ttl?: string | undefined;
2263
+ } | {
2264
+ mode: "queue";
2265
+ sessionId: string;
2266
+ } | {
2267
+ mode: "bind";
2268
+ agentTemplate?: string | undefined;
2269
+ project?: string | undefined;
2270
+ };
2271
+ name?: string | undefined;
2272
+ }, {
2273
+ id: string;
2274
+ match: {
2275
+ type?: string | undefined;
2276
+ principalId?: string | undefined;
2277
+ chatKey?: string | undefined;
2278
+ threadKey?: string | undefined;
2279
+ source?: string | undefined;
2280
+ label?: string | undefined;
2281
+ keywords?: string[] | undefined;
2282
+ };
2283
+ target: {
2284
+ mode: "bound";
2285
+ sessionId: string;
2286
+ } | {
2287
+ mode: "ephemeral";
2288
+ agentTemplate?: string | undefined;
2289
+ project?: string | undefined;
2290
+ ttl?: string | undefined;
2291
+ } | {
2292
+ mode: "queue";
2293
+ sessionId: string;
2294
+ } | {
2295
+ mode: "bind";
2296
+ agentTemplate?: string | undefined;
2297
+ project?: string | undefined;
2298
+ };
2299
+ name?: string | undefined;
2300
+ enabled?: boolean | undefined;
2301
+ priority?: number | undefined;
2302
+ }>;
2303
+ /** AD-089: вход создания/обновления правила (`upsert`) — без `id`. */
2304
+ export declare const eventRouteRuleInputSchema: z.ZodObject<{
2305
+ name: z.ZodOptional<z.ZodString>;
2306
+ priority: z.ZodDefault<z.ZodNumber>;
2307
+ enabled: z.ZodDefault<z.ZodBoolean>;
2308
+ match: z.ZodObject<{
2309
+ source: z.ZodOptional<z.ZodString>;
2310
+ type: z.ZodOptional<z.ZodString>;
2311
+ chatKey: z.ZodOptional<z.ZodString>;
2312
+ threadKey: z.ZodOptional<z.ZodString>;
2313
+ principalId: z.ZodOptional<z.ZodString>;
2314
+ label: z.ZodOptional<z.ZodString>;
2315
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2316
+ }, "strip", z.ZodTypeAny, {
2317
+ type?: string | undefined;
2318
+ principalId?: string | undefined;
2319
+ chatKey?: string | undefined;
2320
+ threadKey?: string | undefined;
2321
+ source?: string | undefined;
2322
+ label?: string | undefined;
2323
+ keywords?: string[] | undefined;
2324
+ }, {
2325
+ type?: string | undefined;
2326
+ principalId?: string | undefined;
2327
+ chatKey?: string | undefined;
2328
+ threadKey?: string | undefined;
2329
+ source?: string | undefined;
2330
+ label?: string | undefined;
2331
+ keywords?: string[] | undefined;
2332
+ }>;
2333
+ target: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2334
+ mode: z.ZodLiteral<"bound">;
2335
+ sessionId: z.ZodString;
2336
+ }, "strip", z.ZodTypeAny, {
2337
+ mode: "bound";
2338
+ sessionId: string;
2339
+ }, {
2340
+ mode: "bound";
2341
+ sessionId: string;
2342
+ }>, z.ZodObject<{
2343
+ mode: z.ZodLiteral<"ephemeral">;
2344
+ agentTemplate: z.ZodOptional<z.ZodString>;
2345
+ project: z.ZodOptional<z.ZodString>;
2346
+ ttl: z.ZodOptional<z.ZodString>;
2347
+ }, "strip", z.ZodTypeAny, {
2348
+ mode: "ephemeral";
2349
+ agentTemplate?: string | undefined;
2350
+ project?: string | undefined;
2351
+ ttl?: string | undefined;
2352
+ }, {
2353
+ mode: "ephemeral";
2354
+ agentTemplate?: string | undefined;
2355
+ project?: string | undefined;
2356
+ ttl?: string | undefined;
2357
+ }>, z.ZodObject<{
2358
+ mode: z.ZodLiteral<"queue">;
2359
+ sessionId: z.ZodString;
2360
+ }, "strip", z.ZodTypeAny, {
2361
+ mode: "queue";
2362
+ sessionId: string;
2363
+ }, {
2364
+ mode: "queue";
2365
+ sessionId: string;
2366
+ }>, z.ZodObject<{
2367
+ mode: z.ZodLiteral<"bind">;
2368
+ agentTemplate: z.ZodOptional<z.ZodString>;
2369
+ project: z.ZodOptional<z.ZodString>;
2370
+ }, "strip", z.ZodTypeAny, {
2371
+ mode: "bind";
2372
+ agentTemplate?: string | undefined;
2373
+ project?: string | undefined;
2374
+ }, {
2375
+ mode: "bind";
2376
+ agentTemplate?: string | undefined;
2377
+ project?: string | undefined;
2378
+ }>]>;
2379
+ }, "strip", z.ZodTypeAny, {
2380
+ enabled: boolean;
2381
+ priority: number;
2382
+ match: {
2383
+ type?: string | undefined;
2384
+ principalId?: string | undefined;
2385
+ chatKey?: string | undefined;
2386
+ threadKey?: string | undefined;
2387
+ source?: string | undefined;
2388
+ label?: string | undefined;
2389
+ keywords?: string[] | undefined;
2390
+ };
2391
+ target: {
2392
+ mode: "bound";
2393
+ sessionId: string;
2394
+ } | {
2395
+ mode: "ephemeral";
2396
+ agentTemplate?: string | undefined;
2397
+ project?: string | undefined;
2398
+ ttl?: string | undefined;
2399
+ } | {
2400
+ mode: "queue";
2401
+ sessionId: string;
2402
+ } | {
2403
+ mode: "bind";
2404
+ agentTemplate?: string | undefined;
2405
+ project?: string | undefined;
2406
+ };
2407
+ name?: string | undefined;
2408
+ }, {
2409
+ match: {
2410
+ type?: string | undefined;
2411
+ principalId?: string | undefined;
2412
+ chatKey?: string | undefined;
2413
+ threadKey?: string | undefined;
2414
+ source?: string | undefined;
2415
+ label?: string | undefined;
2416
+ keywords?: string[] | undefined;
2417
+ };
2418
+ target: {
2419
+ mode: "bound";
2420
+ sessionId: string;
2421
+ } | {
2422
+ mode: "ephemeral";
2423
+ agentTemplate?: string | undefined;
2424
+ project?: string | undefined;
2425
+ ttl?: string | undefined;
2426
+ } | {
2427
+ mode: "queue";
2428
+ sessionId: string;
2429
+ } | {
2430
+ mode: "bind";
2431
+ agentTemplate?: string | undefined;
2432
+ project?: string | undefined;
2433
+ };
2434
+ name?: string | undefined;
2435
+ enabled?: boolean | undefined;
2436
+ priority?: number | undefined;
2437
+ }>;
2438
+ /**
2439
+ * AD-089: тело upsert-запроса правила — вход + необязательный `id` (обновление
2440
+ * существующего правила; отсутствие — создание нового `rule_<uuid>`).
2441
+ */
2442
+ export declare const eventRouteRuleUpsertSchema: z.ZodObject<{
2443
+ name: z.ZodOptional<z.ZodString>;
2444
+ priority: z.ZodDefault<z.ZodNumber>;
2445
+ enabled: z.ZodDefault<z.ZodBoolean>;
2446
+ match: z.ZodObject<{
2447
+ source: z.ZodOptional<z.ZodString>;
2448
+ type: z.ZodOptional<z.ZodString>;
2449
+ chatKey: z.ZodOptional<z.ZodString>;
2450
+ threadKey: z.ZodOptional<z.ZodString>;
2451
+ principalId: z.ZodOptional<z.ZodString>;
2452
+ label: z.ZodOptional<z.ZodString>;
2453
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2454
+ }, "strip", z.ZodTypeAny, {
2455
+ type?: string | undefined;
2456
+ principalId?: string | undefined;
2457
+ chatKey?: string | undefined;
2458
+ threadKey?: string | undefined;
2459
+ source?: string | undefined;
2460
+ label?: string | undefined;
2461
+ keywords?: string[] | undefined;
2462
+ }, {
2463
+ type?: string | undefined;
2464
+ principalId?: string | undefined;
2465
+ chatKey?: string | undefined;
2466
+ threadKey?: string | undefined;
2467
+ source?: string | undefined;
2468
+ label?: string | undefined;
2469
+ keywords?: string[] | undefined;
2470
+ }>;
2471
+ target: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2472
+ mode: z.ZodLiteral<"bound">;
2473
+ sessionId: z.ZodString;
2474
+ }, "strip", z.ZodTypeAny, {
2475
+ mode: "bound";
2476
+ sessionId: string;
2477
+ }, {
2478
+ mode: "bound";
2479
+ sessionId: string;
2480
+ }>, z.ZodObject<{
2481
+ mode: z.ZodLiteral<"ephemeral">;
2482
+ agentTemplate: z.ZodOptional<z.ZodString>;
2483
+ project: z.ZodOptional<z.ZodString>;
2484
+ ttl: z.ZodOptional<z.ZodString>;
2485
+ }, "strip", z.ZodTypeAny, {
2486
+ mode: "ephemeral";
2487
+ agentTemplate?: string | undefined;
2488
+ project?: string | undefined;
2489
+ ttl?: string | undefined;
2490
+ }, {
2491
+ mode: "ephemeral";
2492
+ agentTemplate?: string | undefined;
2493
+ project?: string | undefined;
2494
+ ttl?: string | undefined;
2495
+ }>, z.ZodObject<{
2496
+ mode: z.ZodLiteral<"queue">;
2497
+ sessionId: z.ZodString;
2498
+ }, "strip", z.ZodTypeAny, {
2499
+ mode: "queue";
2500
+ sessionId: string;
2501
+ }, {
2502
+ mode: "queue";
2503
+ sessionId: string;
2504
+ }>, z.ZodObject<{
2505
+ mode: z.ZodLiteral<"bind">;
2506
+ agentTemplate: z.ZodOptional<z.ZodString>;
2507
+ project: z.ZodOptional<z.ZodString>;
2508
+ }, "strip", z.ZodTypeAny, {
2509
+ mode: "bind";
2510
+ agentTemplate?: string | undefined;
2511
+ project?: string | undefined;
2512
+ }, {
2513
+ mode: "bind";
2514
+ agentTemplate?: string | undefined;
2515
+ project?: string | undefined;
2516
+ }>]>;
2517
+ } & {
2518
+ id: z.ZodOptional<z.ZodString>;
2519
+ }, "strip", z.ZodTypeAny, {
2520
+ enabled: boolean;
2521
+ priority: number;
2522
+ match: {
2523
+ type?: string | undefined;
2524
+ principalId?: string | undefined;
2525
+ chatKey?: string | undefined;
2526
+ threadKey?: string | undefined;
2527
+ source?: string | undefined;
2528
+ label?: string | undefined;
2529
+ keywords?: string[] | undefined;
2530
+ };
2531
+ target: {
2532
+ mode: "bound";
2533
+ sessionId: string;
2534
+ } | {
2535
+ mode: "ephemeral";
2536
+ agentTemplate?: string | undefined;
2537
+ project?: string | undefined;
2538
+ ttl?: string | undefined;
2539
+ } | {
2540
+ mode: "queue";
2541
+ sessionId: string;
2542
+ } | {
2543
+ mode: "bind";
2544
+ agentTemplate?: string | undefined;
2545
+ project?: string | undefined;
2546
+ };
2547
+ name?: string | undefined;
2548
+ id?: string | undefined;
2549
+ }, {
2550
+ match: {
2551
+ type?: string | undefined;
2552
+ principalId?: string | undefined;
2553
+ chatKey?: string | undefined;
2554
+ threadKey?: string | undefined;
2555
+ source?: string | undefined;
2556
+ label?: string | undefined;
2557
+ keywords?: string[] | undefined;
2558
+ };
2559
+ target: {
2560
+ mode: "bound";
2561
+ sessionId: string;
2562
+ } | {
2563
+ mode: "ephemeral";
2564
+ agentTemplate?: string | undefined;
2565
+ project?: string | undefined;
2566
+ ttl?: string | undefined;
2567
+ } | {
2568
+ mode: "queue";
2569
+ sessionId: string;
2570
+ } | {
2571
+ mode: "bind";
2572
+ agentTemplate?: string | undefined;
2573
+ project?: string | undefined;
2574
+ };
2575
+ name?: string | undefined;
2576
+ id?: string | undefined;
2577
+ enabled?: boolean | undefined;
2578
+ priority?: number | undefined;
2579
+ }>;
2580
+ export type EventRouteTargetRequest = z.infer<typeof eventRouteTargetSchema>;
2581
+ export type EventRouteRuleInputRequest = z.infer<typeof eventRouteRuleInputSchema>;
2582
+ export type EventRouteRuleUpsertRequest = z.infer<typeof eventRouteRuleUpsertSchema>;
2583
+ /** AD-051/AD-089: вход создания/обновления расписания (`ScheduleInput`). */
2584
+ export declare const scheduleInputSchema: z.ZodEffects<z.ZodObject<{
2585
+ name: z.ZodString;
2586
+ enabled: z.ZodDefault<z.ZodBoolean>;
2587
+ cron: z.ZodOptional<z.ZodString>;
2588
+ every: z.ZodOptional<z.ZodString>;
2589
+ target: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2590
+ mode: z.ZodLiteral<"bound">;
2591
+ sessionId: z.ZodString;
2592
+ }, "strip", z.ZodTypeAny, {
2593
+ mode: "bound";
2594
+ sessionId: string;
2595
+ }, {
2596
+ mode: "bound";
2597
+ sessionId: string;
2598
+ }>, z.ZodObject<{
2599
+ mode: z.ZodLiteral<"ephemeral">;
2600
+ agentTemplate: z.ZodOptional<z.ZodString>;
2601
+ project: z.ZodOptional<z.ZodString>;
2602
+ ttl: z.ZodOptional<z.ZodString>;
2603
+ }, "strip", z.ZodTypeAny, {
2604
+ mode: "ephemeral";
2605
+ agentTemplate?: string | undefined;
2606
+ project?: string | undefined;
2607
+ ttl?: string | undefined;
2608
+ }, {
2609
+ mode: "ephemeral";
2610
+ agentTemplate?: string | undefined;
2611
+ project?: string | undefined;
2612
+ ttl?: string | undefined;
2613
+ }>, z.ZodObject<{
2614
+ mode: z.ZodLiteral<"queue">;
2615
+ sessionId: z.ZodString;
2616
+ }, "strip", z.ZodTypeAny, {
2617
+ mode: "queue";
2618
+ sessionId: string;
2619
+ }, {
2620
+ mode: "queue";
2621
+ sessionId: string;
2622
+ }>]>;
2623
+ prompt: z.ZodOptional<z.ZodString>;
2624
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2625
+ ownerId: z.ZodOptional<z.ZodString>;
2626
+ catchUp: z.ZodOptional<z.ZodEnum<["skip", "once"]>>;
2627
+ }, "strip", z.ZodTypeAny, {
2628
+ name: string;
2629
+ enabled: boolean;
2630
+ target: {
2631
+ mode: "bound";
2632
+ sessionId: string;
2633
+ } | {
2634
+ mode: "ephemeral";
2635
+ agentTemplate?: string | undefined;
2636
+ project?: string | undefined;
2637
+ ttl?: string | undefined;
2638
+ } | {
2639
+ mode: "queue";
2640
+ sessionId: string;
2641
+ };
2642
+ every?: string | undefined;
2643
+ payload?: Record<string, unknown> | undefined;
2644
+ cron?: string | undefined;
2645
+ prompt?: string | undefined;
2646
+ ownerId?: string | undefined;
2647
+ catchUp?: "skip" | "once" | undefined;
2648
+ }, {
2649
+ name: string;
2650
+ target: {
2651
+ mode: "bound";
2652
+ sessionId: string;
2653
+ } | {
2654
+ mode: "ephemeral";
2655
+ agentTemplate?: string | undefined;
2656
+ project?: string | undefined;
2657
+ ttl?: string | undefined;
2658
+ } | {
2659
+ mode: "queue";
2660
+ sessionId: string;
2661
+ };
2662
+ every?: string | undefined;
2663
+ enabled?: boolean | undefined;
2664
+ payload?: Record<string, unknown> | undefined;
2665
+ cron?: string | undefined;
2666
+ prompt?: string | undefined;
2667
+ ownerId?: string | undefined;
2668
+ catchUp?: "skip" | "once" | undefined;
2669
+ }>, {
2670
+ name: string;
2671
+ enabled: boolean;
2672
+ target: {
2673
+ mode: "bound";
2674
+ sessionId: string;
2675
+ } | {
2676
+ mode: "ephemeral";
2677
+ agentTemplate?: string | undefined;
2678
+ project?: string | undefined;
2679
+ ttl?: string | undefined;
2680
+ } | {
2681
+ mode: "queue";
2682
+ sessionId: string;
2683
+ };
2684
+ every?: string | undefined;
2685
+ payload?: Record<string, unknown> | undefined;
2686
+ cron?: string | undefined;
2687
+ prompt?: string | undefined;
2688
+ ownerId?: string | undefined;
2689
+ catchUp?: "skip" | "once" | undefined;
2690
+ }, {
2691
+ name: string;
2692
+ target: {
2693
+ mode: "bound";
2694
+ sessionId: string;
2695
+ } | {
2696
+ mode: "ephemeral";
2697
+ agentTemplate?: string | undefined;
2698
+ project?: string | undefined;
2699
+ ttl?: string | undefined;
2700
+ } | {
2701
+ mode: "queue";
2702
+ sessionId: string;
2703
+ };
2704
+ every?: string | undefined;
2705
+ enabled?: boolean | undefined;
2706
+ payload?: Record<string, unknown> | undefined;
2707
+ cron?: string | undefined;
2708
+ prompt?: string | undefined;
2709
+ ownerId?: string | undefined;
2710
+ catchUp?: "skip" | "once" | undefined;
2711
+ }>;
2712
+ /** AD-051/AD-089: полная сущность расписания (ответы API). */
2713
+ export declare const scheduleSchema: z.ZodEffects<z.ZodObject<{
2714
+ id: z.ZodString;
2715
+ name: z.ZodString;
2716
+ enabled: z.ZodBoolean;
2717
+ cron: z.ZodOptional<z.ZodString>;
2718
+ every: z.ZodOptional<z.ZodString>;
2719
+ target: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2720
+ mode: z.ZodLiteral<"bound">;
2721
+ sessionId: z.ZodString;
2722
+ }, "strip", z.ZodTypeAny, {
2723
+ mode: "bound";
2724
+ sessionId: string;
2725
+ }, {
2726
+ mode: "bound";
2727
+ sessionId: string;
2728
+ }>, z.ZodObject<{
2729
+ mode: z.ZodLiteral<"ephemeral">;
2730
+ agentTemplate: z.ZodOptional<z.ZodString>;
2731
+ project: z.ZodOptional<z.ZodString>;
2732
+ ttl: z.ZodOptional<z.ZodString>;
2733
+ }, "strip", z.ZodTypeAny, {
2734
+ mode: "ephemeral";
2735
+ agentTemplate?: string | undefined;
2736
+ project?: string | undefined;
2737
+ ttl?: string | undefined;
2738
+ }, {
2739
+ mode: "ephemeral";
2740
+ agentTemplate?: string | undefined;
2741
+ project?: string | undefined;
2742
+ ttl?: string | undefined;
2743
+ }>, z.ZodObject<{
2744
+ mode: z.ZodLiteral<"queue">;
2745
+ sessionId: z.ZodString;
2746
+ }, "strip", z.ZodTypeAny, {
2747
+ mode: "queue";
2748
+ sessionId: string;
2749
+ }, {
2750
+ mode: "queue";
2751
+ sessionId: string;
2752
+ }>]>;
2753
+ prompt: z.ZodOptional<z.ZodString>;
2754
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2755
+ ownerId: z.ZodOptional<z.ZodString>;
2756
+ catchUp: z.ZodOptional<z.ZodEnum<["skip", "once"]>>;
2757
+ createdAt: z.ZodString;
2758
+ updatedAt: z.ZodString;
2759
+ lastRunAt: z.ZodOptional<z.ZodString>;
2760
+ nextRunAt: z.ZodOptional<z.ZodString>;
2761
+ lastStatus: z.ZodOptional<z.ZodEnum<["ok", "error", "skipped"]>>;
2762
+ lastError: z.ZodOptional<z.ZodString>;
2763
+ }, "strip", z.ZodTypeAny, {
2764
+ name: string;
2765
+ id: string;
2766
+ enabled: boolean;
2767
+ createdAt: string;
2768
+ target: {
2769
+ mode: "bound";
2770
+ sessionId: string;
2771
+ } | {
2772
+ mode: "ephemeral";
2773
+ agentTemplate?: string | undefined;
2774
+ project?: string | undefined;
2775
+ ttl?: string | undefined;
2776
+ } | {
2777
+ mode: "queue";
2778
+ sessionId: string;
2779
+ };
2780
+ updatedAt: string;
2781
+ every?: string | undefined;
2782
+ payload?: Record<string, unknown> | undefined;
2783
+ lastStatus?: "ok" | "error" | "skipped" | undefined;
2784
+ cron?: string | undefined;
2785
+ prompt?: string | undefined;
2786
+ ownerId?: string | undefined;
2787
+ catchUp?: "skip" | "once" | undefined;
2788
+ lastRunAt?: string | undefined;
2789
+ nextRunAt?: string | undefined;
2790
+ lastError?: string | undefined;
2791
+ }, {
2792
+ name: string;
2793
+ id: string;
2794
+ enabled: boolean;
2795
+ createdAt: string;
2796
+ target: {
2797
+ mode: "bound";
2798
+ sessionId: string;
2799
+ } | {
2800
+ mode: "ephemeral";
2801
+ agentTemplate?: string | undefined;
2802
+ project?: string | undefined;
2803
+ ttl?: string | undefined;
2804
+ } | {
2805
+ mode: "queue";
2806
+ sessionId: string;
2807
+ };
2808
+ updatedAt: string;
2809
+ every?: string | undefined;
2810
+ payload?: Record<string, unknown> | undefined;
2811
+ lastStatus?: "ok" | "error" | "skipped" | undefined;
2812
+ cron?: string | undefined;
2813
+ prompt?: string | undefined;
2814
+ ownerId?: string | undefined;
2815
+ catchUp?: "skip" | "once" | undefined;
2816
+ lastRunAt?: string | undefined;
2817
+ nextRunAt?: string | undefined;
2818
+ lastError?: string | undefined;
2819
+ }>, {
2820
+ name: string;
2821
+ id: string;
2822
+ enabled: boolean;
2823
+ createdAt: string;
2824
+ target: {
2825
+ mode: "bound";
2826
+ sessionId: string;
2827
+ } | {
2828
+ mode: "ephemeral";
2829
+ agentTemplate?: string | undefined;
2830
+ project?: string | undefined;
2831
+ ttl?: string | undefined;
2832
+ } | {
2833
+ mode: "queue";
2834
+ sessionId: string;
2835
+ };
2836
+ updatedAt: string;
2837
+ every?: string | undefined;
2838
+ payload?: Record<string, unknown> | undefined;
2839
+ lastStatus?: "ok" | "error" | "skipped" | undefined;
2840
+ cron?: string | undefined;
2841
+ prompt?: string | undefined;
2842
+ ownerId?: string | undefined;
2843
+ catchUp?: "skip" | "once" | undefined;
2844
+ lastRunAt?: string | undefined;
2845
+ nextRunAt?: string | undefined;
2846
+ lastError?: string | undefined;
2847
+ }, {
2848
+ name: string;
2849
+ id: string;
2850
+ enabled: boolean;
2851
+ createdAt: string;
2852
+ target: {
2853
+ mode: "bound";
2854
+ sessionId: string;
2855
+ } | {
2856
+ mode: "ephemeral";
2857
+ agentTemplate?: string | undefined;
2858
+ project?: string | undefined;
2859
+ ttl?: string | undefined;
2860
+ } | {
2861
+ mode: "queue";
2862
+ sessionId: string;
2863
+ };
2864
+ updatedAt: string;
2865
+ every?: string | undefined;
2866
+ payload?: Record<string, unknown> | undefined;
2867
+ lastStatus?: "ok" | "error" | "skipped" | undefined;
2868
+ cron?: string | undefined;
2869
+ prompt?: string | undefined;
2870
+ ownerId?: string | undefined;
2871
+ catchUp?: "skip" | "once" | undefined;
2872
+ lastRunAt?: string | undefined;
2873
+ nextRunAt?: string | undefined;
2874
+ lastError?: string | undefined;
2875
+ }>;
2876
+ export type ScheduleInputRequest = z.infer<typeof scheduleInputSchema>;
2877
+ export type ScheduleRequest = z.infer<typeof scheduleSchema>;
2878
+ /** AD-051: триггер срабатывания расписания в Job-истории. */
2879
+ export declare const scheduleJobTriggerSchema: z.ZodEnum<["cron", "manual", "catchup"]>;
2880
+ /** AD-051: запись Job-истории (ответы `GET /api/v2/schedules/:id/jobs`). */
2881
+ export declare const scheduleJobSchema: z.ZodObject<{
2882
+ id: z.ZodString;
2883
+ scheduleId: z.ZodString;
2884
+ scheduleName: z.ZodString;
2885
+ trigger: z.ZodEnum<["cron", "manual", "catchup"]>;
2886
+ status: z.ZodEnum<["ok", "error", "skipped"]>;
2887
+ startedAt: z.ZodString;
2888
+ finishedAt: z.ZodString;
2889
+ durationMs: z.ZodNumber;
2890
+ target: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2891
+ mode: z.ZodLiteral<"bound">;
2892
+ sessionId: z.ZodString;
2893
+ }, "strip", z.ZodTypeAny, {
2894
+ mode: "bound";
2895
+ sessionId: string;
2896
+ }, {
2897
+ mode: "bound";
2898
+ sessionId: string;
2899
+ }>, z.ZodObject<{
2900
+ mode: z.ZodLiteral<"ephemeral">;
2901
+ agentTemplate: z.ZodOptional<z.ZodString>;
2902
+ project: z.ZodOptional<z.ZodString>;
2903
+ ttl: z.ZodOptional<z.ZodString>;
2904
+ }, "strip", z.ZodTypeAny, {
2905
+ mode: "ephemeral";
2906
+ agentTemplate?: string | undefined;
2907
+ project?: string | undefined;
2908
+ ttl?: string | undefined;
2909
+ }, {
2910
+ mode: "ephemeral";
2911
+ agentTemplate?: string | undefined;
2912
+ project?: string | undefined;
2913
+ ttl?: string | undefined;
2914
+ }>, z.ZodObject<{
2915
+ mode: z.ZodLiteral<"queue">;
2916
+ sessionId: z.ZodString;
2917
+ }, "strip", z.ZodTypeAny, {
2918
+ mode: "queue";
2919
+ sessionId: string;
2920
+ }, {
2921
+ mode: "queue";
2922
+ sessionId: string;
2923
+ }>]>;
2924
+ dedupKey: z.ZodOptional<z.ZodString>;
2925
+ decision: z.ZodOptional<z.ZodEnum<["bound", "queue", "ephemeral", "bind", "drop"]>>;
2926
+ reason: z.ZodOptional<z.ZodString>;
2927
+ sessionId: z.ZodOptional<z.ZodString>;
2928
+ error: z.ZodOptional<z.ZodString>;
2929
+ }, "strip", z.ZodTypeAny, {
2930
+ status: "ok" | "error" | "skipped";
2931
+ id: string;
2932
+ target: {
2933
+ mode: "bound";
2934
+ sessionId: string;
2935
+ } | {
2936
+ mode: "ephemeral";
2937
+ agentTemplate?: string | undefined;
2938
+ project?: string | undefined;
2939
+ ttl?: string | undefined;
2940
+ } | {
2941
+ mode: "queue";
2942
+ sessionId: string;
2943
+ };
2944
+ scheduleId: string;
2945
+ scheduleName: string;
2946
+ trigger: "cron" | "manual" | "catchup";
2947
+ startedAt: string;
2948
+ finishedAt: string;
2949
+ durationMs: number;
2950
+ dedupKey?: string | undefined;
2951
+ sessionId?: string | undefined;
2952
+ error?: string | undefined;
2953
+ decision?: "bound" | "ephemeral" | "queue" | "bind" | "drop" | undefined;
2954
+ reason?: string | undefined;
2955
+ }, {
2956
+ status: "ok" | "error" | "skipped";
2957
+ id: string;
2958
+ target: {
2959
+ mode: "bound";
2960
+ sessionId: string;
2961
+ } | {
2962
+ mode: "ephemeral";
2963
+ agentTemplate?: string | undefined;
2964
+ project?: string | undefined;
2965
+ ttl?: string | undefined;
2966
+ } | {
2967
+ mode: "queue";
2968
+ sessionId: string;
2969
+ };
2970
+ scheduleId: string;
2971
+ scheduleName: string;
2972
+ trigger: "cron" | "manual" | "catchup";
2973
+ startedAt: string;
2974
+ finishedAt: string;
2975
+ durationMs: number;
2976
+ dedupKey?: string | undefined;
2977
+ sessionId?: string | undefined;
2978
+ error?: string | undefined;
2979
+ decision?: "bound" | "ephemeral" | "queue" | "bind" | "drop" | undefined;
2980
+ reason?: string | undefined;
2981
+ }>;
2982
+ export type ScheduleJobRequest = z.infer<typeof scheduleJobSchema>;