@itphx/synth-shared 0.9.0 → 0.10.1

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 (72) hide show
  1. package/dist/config/defaults.js +51 -1
  2. package/dist/config/env-overrides.d.ts +68 -0
  3. package/dist/config/env-overrides.js +165 -0
  4. package/dist/config/index.d.ts +1 -0
  5. package/dist/config/index.js +1 -0
  6. package/dist/config/loader.d.ts +3 -1
  7. package/dist/config/loader.js +12 -4
  8. package/dist/config/resolve.d.ts +23 -6
  9. package/dist/config/resolve.js +33 -12
  10. package/dist/config/types.d.ts +699 -146
  11. package/dist/config/types.js +195 -28
  12. package/dist/i18n/index.d.ts +1 -1
  13. package/dist/i18n/index.js +50 -8
  14. package/dist/index.d.ts +4 -2
  15. package/dist/index.js +3 -2
  16. package/dist/interfaces/index.d.ts +8 -1
  17. package/dist/schemas/index.d.ts +1723 -45
  18. package/dist/schemas/index.js +403 -29
  19. package/dist/skills/frontmatter.js +1 -1
  20. package/dist/types/agent.d.ts +30 -0
  21. package/dist/types/agent.js +1 -0
  22. package/dist/types/bus-events.d.ts +7 -0
  23. package/dist/types/bus-events.js +1 -0
  24. package/dist/types/commands.d.ts +10 -10
  25. package/dist/types/commands.js +2 -2
  26. package/dist/types/decision.d.ts +502 -0
  27. package/dist/types/decision.js +98 -0
  28. package/dist/types/events.d.ts +219 -0
  29. package/dist/types/events.js +1 -0
  30. package/dist/types/fs.d.ts +44 -0
  31. package/dist/types/fs.js +16 -0
  32. package/dist/types/git.d.ts +63 -0
  33. package/dist/types/git.js +1 -0
  34. package/dist/types/hooks.d.ts +96 -0
  35. package/dist/types/hooks.js +1 -0
  36. package/dist/types/index.d.ts +18 -1097
  37. package/dist/types/index.js +44 -215
  38. package/dist/types/llm.d.ts +32 -0
  39. package/dist/types/llm.js +8 -0
  40. package/dist/types/mcp.d.ts +104 -0
  41. package/dist/types/mcp.js +40 -0
  42. package/dist/types/message.d.ts +63 -0
  43. package/dist/types/message.js +12 -0
  44. package/dist/types/permission.d.ts +2 -2
  45. package/dist/types/permission.js +1 -1
  46. package/dist/types/project.d.ts +134 -0
  47. package/dist/types/project.js +67 -0
  48. package/dist/types/prompt.d.ts +236 -0
  49. package/dist/types/prompt.js +15 -0
  50. package/dist/types/provider.d.ts +84 -0
  51. package/dist/types/provider.js +35 -0
  52. package/dist/types/schedules.d.ts +109 -0
  53. package/dist/types/schedules.js +9 -0
  54. package/dist/types/service-keys.d.ts +106 -0
  55. package/dist/types/service-keys.js +72 -0
  56. package/dist/types/session.d.ts +269 -0
  57. package/dist/types/session.js +13 -0
  58. package/dist/types/skills.d.ts +11 -11
  59. package/dist/types/skills.js +6 -6
  60. package/dist/types/tools.d.ts +4 -3
  61. package/dist/types/tools.js +2 -0
  62. package/dist/types/user.d.ts +113 -0
  63. package/dist/types/user.js +31 -0
  64. package/dist/types/webhooks.d.ts +97 -0
  65. package/dist/types/webhooks.js +53 -0
  66. package/dist/utils/glob.d.ts +1 -1
  67. package/dist/utils/glob.js +1 -1
  68. package/dist/utils/index.js +2 -2
  69. package/dist/utils/workspace.js +1 -1
  70. package/dist/version.d.ts +1 -1
  71. package/dist/version.js +1 -1
  72. package/package.json +1 -1
@@ -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
+ /** ADR-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;
@@ -82,7 +84,7 @@ export declare const sessionSettingsSchema: z.ZodObject<{
82
84
  websocketEnabled: boolean;
83
85
  provider?: string | undefined;
84
86
  model?: string | undefined;
85
- reasoningLevel?: "default" | "none" | "low" | "medium" | "high" | undefined;
87
+ reasoningLevel?: "high" | "medium" | "low" | "default" | "none" | undefined;
86
88
  systemPrompt?: string | undefined;
87
89
  agentRole?: string | undefined;
88
90
  mcpServers?: string[] | undefined;
@@ -91,10 +93,11 @@ 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;
97
- reasoningLevel?: "default" | "none" | "low" | "medium" | "high" | undefined;
100
+ reasoningLevel?: "high" | "medium" | "low" | "default" | "none" | undefined;
98
101
  temperature?: number | undefined;
99
102
  maxTokens?: number | undefined;
100
103
  systemPrompt?: string | undefined;
@@ -119,6 +122,7 @@ 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>;
@@ -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
+ /** ADR-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;
@@ -174,7 +180,7 @@ export declare const sessionCreateSchema: z.ZodObject<{
174
180
  websocketEnabled: boolean;
175
181
  provider?: string | undefined;
176
182
  model?: string | undefined;
177
- reasoningLevel?: "default" | "none" | "low" | "medium" | "high" | undefined;
183
+ reasoningLevel?: "high" | "medium" | "low" | "default" | "none" | undefined;
178
184
  systemPrompt?: string | undefined;
179
185
  agentRole?: string | undefined;
180
186
  mcpServers?: string[] | undefined;
@@ -183,10 +189,11 @@ 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;
189
- reasoningLevel?: "default" | "none" | "low" | "medium" | "high" | undefined;
196
+ reasoningLevel?: "high" | "medium" | "low" | "default" | "none" | undefined;
190
197
  temperature?: number | undefined;
191
198
  maxTokens?: number | undefined;
192
199
  systemPrompt?: string | undefined;
@@ -211,12 +218,13 @@ 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
- 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;
227
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
220
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?: {
@@ -238,7 +246,7 @@ export declare const sessionCreateSchema: z.ZodObject<{
238
246
  websocketEnabled: boolean;
239
247
  provider?: string | undefined;
240
248
  model?: string | undefined;
241
- reasoningLevel?: "default" | "none" | "low" | "medium" | "high" | undefined;
249
+ reasoningLevel?: "high" | "medium" | "low" | "default" | "none" | undefined;
242
250
  systemPrompt?: string | undefined;
243
251
  agentRole?: string | undefined;
244
252
  mcpServers?: string[] | undefined;
@@ -247,18 +255,19 @@ 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
- 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;
263
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
255
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?: {
259
268
  provider?: string | undefined;
260
269
  model?: string | undefined;
261
- reasoningLevel?: "default" | "none" | "low" | "medium" | "high" | undefined;
270
+ reasoningLevel?: "high" | "medium" | "low" | "default" | "none" | undefined;
262
271
  temperature?: number | undefined;
263
272
  maxTokens?: number | undefined;
264
273
  systemPrompt?: string | undefined;
@@ -283,6 +292,7 @@ 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<{
@@ -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,10 +387,11 @@ 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
- 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;
394
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
382
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;
@@ -410,10 +423,11 @@ 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
- 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;
430
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
417
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;
@@ -445,10 +459,11 @@ 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
  /**
451
- * AD-076: запись реестра git-репозиториев. `path` обязателен, остальные поля
466
+ * ADR-076: запись реестра git-репозиториев. `path` обязателен, остальные поля
452
467
  * опциональны; старые формы (`string` / `{ path }`) принимаются через
453
468
  * `normalizeGitRepoConfig` и union в `repos`.
454
469
  */
@@ -481,7 +496,7 @@ export declare const gitRepoConfigSchema: z.ZodObject<{
481
496
  lastFetch?: string | undefined;
482
497
  }>;
483
498
  /**
484
- * AD-076: нормализация legacy-значения `repos` к `GitRepoConfig`.
499
+ * ADR-076: нормализация legacy-значения `repos` к `GitRepoConfig`.
485
500
  * `string` → `{ path }`; объект → прогон через `gitRepoConfigSchema`
486
501
  * (невалидный → `null`). Всё прочее → `null`.
487
502
  */
@@ -524,7 +539,7 @@ export declare const projectCreateSchema: z.ZodObject<{
524
539
  name: string;
525
540
  description: string;
526
541
  workspace?: string | undefined;
527
- 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;
542
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
528
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;
@@ -539,7 +554,7 @@ export declare const projectCreateSchema: z.ZodObject<{
539
554
  }, {
540
555
  name: string;
541
556
  workspace?: string | undefined;
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;
557
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
543
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 | {
@@ -592,7 +607,7 @@ export declare const projectUpdateSchema: z.ZodObject<{
592
607
  }, "strip", z.ZodTypeAny, {
593
608
  workspace?: string | undefined;
594
609
  name?: string | undefined;
595
- 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;
610
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
596
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 | {
@@ -610,7 +625,7 @@ export declare const projectUpdateSchema: z.ZodObject<{
610
625
  }, {
611
626
  workspace?: string | undefined;
612
627
  name?: string | undefined;
613
- 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;
628
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "cpu" | "file" | "file-code" | "docs" | "todo" | "bug" | "robot" | "brain" | "git" | "repo" | "test" | "chart" | "star" | "image" | "calendar" | null | undefined;
614
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 | {
@@ -626,7 +641,7 @@ export declare const projectUpdateSchema: z.ZodObject<{
626
641
  currentTask?: string | undefined;
627
642
  invariants?: string | undefined;
628
643
  }>;
629
- /** AD-076: тело создания SSH-ключа (`POST /api/v2/ssh-keys`). */
644
+ /** ADR-076: тело создания SSH-ключа (`POST /api/v2/ssh-keys`). */
630
645
  export declare const sshKeyCreateSchema: z.ZodObject<{
631
646
  name: z.ZodString;
632
647
  type: z.ZodOptional<z.ZodString>;
@@ -646,7 +661,7 @@ export declare const sshKeyCreateSchema: z.ZodObject<{
646
661
  passphrase?: string | undefined;
647
662
  agentIds?: string[] | undefined;
648
663
  }>;
649
- /** AD-076: тело обновления SSH-ключа (без id/createdAt). */
664
+ /** ADR-076: тело обновления SSH-ключа (без id/createdAt). */
650
665
  export declare const sshKeyUpdateSchema: z.ZodObject<{
651
666
  name: z.ZodOptional<z.ZodString>;
652
667
  type: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -667,7 +682,7 @@ export declare const sshKeyUpdateSchema: z.ZodObject<{
667
682
  agentIds?: string[] | undefined;
668
683
  }>;
669
684
  /**
670
- * AD-071 §2.4: проектный скоуп MCP (ссылки на реестр по имени).
685
+ * ADR-071 §2.4: проектный скоуп MCP (ссылки на реестр по имени).
671
686
  * PUT-семантика: `undefined` ≠ `[]` — отсутствующее поле сохраняет текущее
672
687
  * значение, поэтому `.default([])` здесь недопустим.
673
688
  */
@@ -682,7 +697,7 @@ export declare const projectMcpUpdateSchema: z.ZodObject<{
682
697
  defaultOn?: string[] | undefined;
683
698
  }>;
684
699
  /**
685
- * AD-075: тело `PUT /api/v2/settings/workspace-policy` — политика для
700
+ * ADR-075: тело `PUT /api/v2/settings/workspace-policy` — политика для
686
701
  * абсолютного workspace вне `workspacesRoot`.
687
702
  */
688
703
  export declare const workspacePolicySchema: z.ZodObject<{
@@ -704,19 +719,19 @@ export declare const promptRequestSchema: z.ZodObject<{
704
719
  }, "strip", z.ZodTypeAny, {
705
720
  content: string;
706
721
  stream: boolean;
722
+ system?: string | undefined;
707
723
  provider?: string | undefined;
708
724
  model?: string | undefined;
709
725
  messageId?: string | undefined;
710
726
  agent?: string | undefined;
711
- system?: string | undefined;
712
727
  }, {
713
728
  content: string;
729
+ system?: string | undefined;
714
730
  provider?: string | undefined;
715
731
  model?: string | undefined;
716
732
  messageId?: string | undefined;
717
733
  stream?: boolean | undefined;
718
734
  agent?: string | undefined;
719
- system?: string | undefined;
720
735
  }>;
721
736
  export declare const spaLoginSchema: z.ZodObject<{
722
737
  apiKey: z.ZodString;
@@ -760,12 +775,12 @@ export declare const fsWriteBodySchema: z.ZodObject<{
760
775
  content: z.ZodString;
761
776
  }, "strip", z.ZodTypeAny, {
762
777
  path: string;
763
- projectId: string;
764
778
  content: string;
779
+ projectId: string;
765
780
  }, {
766
781
  path: string;
767
- projectId: string;
768
782
  content: string;
783
+ projectId: string;
769
784
  }>;
770
785
  export declare const fsDeleteQuerySchema: z.ZodObject<{
771
786
  project_id: z.ZodString;
@@ -798,7 +813,7 @@ export declare const fsDownloadQuerySchema: z.ZodObject<{
798
813
  project_id: string;
799
814
  }>;
800
815
  /**
801
- * AD-075: запрос навигации по корню workspace (`GET /fs/workspace-root/browse`,
816
+ * ADR-075: запрос навигации по корню workspace (`GET /fs/workspace-root/browse`,
802
817
  * `GET /fs/workspace-root`). `includeHidden` принимает строковые `true`/`false`
803
818
  * (query-параметры) — `z.coerce.boolean()` не подходит, т.к. `'false'` → `true`.
804
819
  */
@@ -812,7 +827,7 @@ export declare const fsWorkspaceBrowseQuerySchema: z.ZodObject<{
812
827
  path?: string | undefined;
813
828
  includeHidden?: unknown;
814
829
  }>;
815
- /** AD-075: тело `POST /fs/workspace-root/mkdir` — создание каталога в корне workspace. */
830
+ /** ADR-075: тело `POST /fs/workspace-root/mkdir` — создание каталога в корне workspace. */
816
831
  export declare const fsWorkspaceMkdirBodySchema: z.ZodObject<{
817
832
  path: z.ZodString;
818
833
  /** `confirm`-политика: явное подтверждение создания каталога вне `workspacesRoot`. */
@@ -873,7 +888,7 @@ export declare const gitCloneBodySchema: z.ZodObject<{
873
888
  branch?: string | undefined;
874
889
  }>;
875
890
  /**
876
- * AD-076: тело `POST /api/v2/git/repos/register` — upsert записи реестра
891
+ * ADR-076: тело `POST /api/v2/git/repos/register` — upsert записи реестра
877
892
  * (идемпотентно по `path`). Используется UI для добавления уже существующего
878
893
  * локально репозитория.
879
894
  */
@@ -903,7 +918,7 @@ export declare const gitReposRegisterBodySchema: z.ZodObject<{
903
918
  sshKeyId?: string | undefined;
904
919
  }>;
905
920
  /**
906
- * AD-076: тело `POST /api/v2/git/repos/remove` — удаление записи реестра;
921
+ * ADR-076: тело `POST /api/v2/git/repos/remove` — удаление записи реестра;
907
922
  * обязателен `id` либо `path`. `deleteLocal` — удалить каталог репозитория.
908
923
  */
909
924
  export declare const gitReposRemoveBodySchema: z.ZodEffects<z.ZodObject<{
@@ -932,7 +947,7 @@ export declare const gitReposRemoveBodySchema: z.ZodEffects<z.ZodObject<{
932
947
  id?: string | undefined;
933
948
  deleteLocal?: boolean | undefined;
934
949
  }>;
935
- /** AD-076: тело `POST /api/v2/git/repos/fetch` — обязателен `id` либо `path`. */
950
+ /** ADR-076: тело `POST /api/v2/git/repos/fetch` — обязателен `id` либо `path`. */
936
951
  export declare const gitReposFetchBodySchema: z.ZodEffects<z.ZodObject<{
937
952
  projectId: z.ZodString;
938
953
  id: z.ZodOptional<z.ZodString>;
@@ -981,7 +996,7 @@ export declare const gitCommitQuerySchema: z.ZodObject<{
981
996
  repo_path?: string | undefined;
982
997
  }>;
983
998
  /**
984
- * AD-071 §2.6: фабрика схемы `tools.disabled` (единый источник значений
999
+ * ADR-071 §2.6: фабрика схемы `tools.disabled` (единый источник значений
985
1000
  * на базе `ToolCapability`).
986
1001
  *
987
1002
  * - `strictCapabilities: true` (API, `PUT /settings/tools-disabled`) — закрытый
@@ -993,14 +1008,14 @@ export declare function createToolsDisabledSchema(strictCapabilities: boolean):
993
1008
  capabilities: z.ZodDefault<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">> | z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
994
1009
  tools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
995
1010
  }, "strip", z.ZodTypeAny, {
996
- capabilities: string[];
997
1011
  tools: string[];
1012
+ capabilities: string[];
998
1013
  }, {
999
- capabilities?: string[] | undefined;
1000
1014
  tools?: string[] | undefined;
1015
+ capabilities?: string[] | undefined;
1001
1016
  }>;
1002
1017
  /**
1003
- * AD-071 §2.6: тело `PUT /api/v2/settings/tools-disabled`. Неизвестная
1018
+ * ADR-071 §2.6: тело `PUT /api/v2/settings/tools-disabled`. Неизвестная
1004
1019
  * capability — ошибка (закрытый набор: опечатка молча ничего не отключит).
1005
1020
  * Имена инструментов принимаются как строки (реестр динамический — MCP-тулы
1006
1021
  * регистрируются лениво); непустые.
@@ -1009,14 +1024,14 @@ export declare const toolsDisabledSchema: z.ZodObject<{
1009
1024
  capabilities: z.ZodDefault<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">> | z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1010
1025
  tools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1011
1026
  }, "strip", z.ZodTypeAny, {
1012
- capabilities: string[];
1013
1027
  tools: string[];
1028
+ capabilities: string[];
1014
1029
  }, {
1015
- capabilities?: string[] | undefined;
1016
1030
  tools?: string[] | undefined;
1031
+ capabilities?: string[] | undefined;
1017
1032
  }>;
1018
1033
  /**
1019
- * AD-071 §2.4: базовый контракт MCP-скоупа сессии (ссылки на реестр по имени).
1034
+ * ADR-071 §2.4: базовый контракт MCP-скоупа сессии (ссылки на реестр по имени).
1020
1035
  * `undefined` ≠ `[]`: отсутствующее поле сохраняет текущее значение.
1021
1036
  */
1022
1037
  export declare const sessionMcpScopeSchema: z.ZodEffects<z.ZodObject<{
@@ -1036,7 +1051,7 @@ export declare const sessionMcpScopeSchema: z.ZodEffects<z.ZodObject<{
1036
1051
  mcpDisabledServers?: string[] | undefined;
1037
1052
  }>;
1038
1053
  /**
1039
- * AD-071 §2.4: тело `PUT /api/v2/sessions/:id/mcp`: точечный toggle
1054
+ * ADR-071 §2.4: тело `PUT /api/v2/sessions/:id/mcp`: точечный toggle
1040
1055
  * (`{ name, enabled }`, в т.ч. opt-out системного сервера) или полная/частичная
1041
1056
  * замена (`{ mcpServers?, mcpDisabledServers? }`).
1042
1057
  */
@@ -1093,11 +1108,11 @@ export type GitReposRemoveBody = z.infer<typeof gitReposRemoveBodySchema>;
1093
1108
  export type GitReposFetchBody = z.infer<typeof gitReposFetchBodySchema>;
1094
1109
  export type GitLogQuery = z.infer<typeof gitLogQuerySchema>;
1095
1110
  export type GitCommitQuery = z.infer<typeof gitCommitQuerySchema>;
1096
- /** AD-046 §3.2: имя скилла — 1–64, `^[a-z0-9]+(-[a-z0-9]+)*$`. */
1111
+ /** ADR-046 §3.2: имя скилла — 1–64, `^[a-z0-9]+(-[a-z0-9]+)*$`. */
1097
1112
  export declare const SKILL_NAME_REGEX: RegExp;
1098
1113
  export declare const SKILL_NAME_MIN = 1;
1099
1114
  export declare const SKILL_NAME_MAX = 64;
1100
- /** AD-046 §3.2: длина `description`. */
1115
+ /** ADR-046 §3.2: длина `description`. */
1101
1116
  export declare const SKILL_DESCRIPTION_MIN = 1;
1102
1117
  export declare const SKILL_DESCRIPTION_MAX = 1024;
1103
1118
  export declare const skillNameSchema: z.ZodString;
@@ -1149,7 +1164,7 @@ export declare const skillFileWriteSchema: z.ZodObject<{
1149
1164
  content: string;
1150
1165
  }>;
1151
1166
  /**
1152
- * AD-046 §4.5: per-session enable/disable скиллов (по образцу MCP-скоупа).
1167
+ * ADR-046 §4.5: per-session enable/disable скиллов (по образцу MCP-скоупа).
1153
1168
  * `undefined` ≠ `[]`: отсутствующее поле сохраняет текущее значение.
1154
1169
  */
1155
1170
  export declare const skillSessionOverrideSchema: z.ZodObject<{
@@ -1166,7 +1181,7 @@ export type SkillCreateRequest = z.infer<typeof skillCreateSchema>;
1166
1181
  export type SkillUpdateRequest = z.infer<typeof skillUpdateSchema>;
1167
1182
  export type SkillFileWriteRequest = z.infer<typeof skillFileWriteSchema>;
1168
1183
  export type SkillSessionOverrideRequest = z.infer<typeof skillSessionOverrideSchema>;
1169
- /** AD-046 §7.3: тело `POST/PATCH /api/v2/skill-bundles` (YAML-группа скиллов). */
1184
+ /** ADR-046 §7.3: тело `POST/PATCH /api/v2/skill-bundles` (YAML-группа скиллов). */
1170
1185
  export declare const skillBundleSchema: z.ZodObject<{
1171
1186
  name: z.ZodString;
1172
1187
  description: z.ZodString;
@@ -1184,7 +1199,7 @@ export declare const skillBundleSchema: z.ZodObject<{
1184
1199
  instruction?: string | undefined;
1185
1200
  }>;
1186
1201
  export type SkillBundleRequest = z.infer<typeof skillBundleSchema>;
1187
- /** AD-046 §7.4: тело `PUT /api/v2/settings/skills-disabled` (группы/имена). */
1202
+ /** ADR-046 §7.4: тело `PUT /api/v2/settings/skills-disabled` (группы/имена). */
1188
1203
  export declare const skillsDisabledSchema: z.ZodObject<{
1189
1204
  categories: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1190
1205
  groups: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -1200,7 +1215,7 @@ export declare const skillsDisabledSchema: z.ZodObject<{
1200
1215
  }>;
1201
1216
  export type SkillsDisabledRequest = z.infer<typeof skillsDisabledSchema>;
1202
1217
  /**
1203
- * AD-046 §4.5: тело `PUT /api/v2/settings/skills` — системные настройки:
1218
+ * ADR-046 §4.5: тело `PUT /api/v2/settings/skills` — системные настройки:
1204
1219
  * - `disabled` — hard-gate: скиллы, недоступные НИГДЕ;
1205
1220
  * - `disabledForNewProjects` — сид для НОВЫХ проектов (снимок при создании);
1206
1221
  * - `policy` — политика доступности (строкой, валидируется роутом).
@@ -1260,7 +1275,7 @@ export declare const skillsSystemSettingsSchema: z.ZodObject<{
1260
1275
  }>;
1261
1276
  export type SkillsSystemSettingsRequest = z.infer<typeof skillsSystemSettingsSchema>;
1262
1277
  /**
1263
- * AD-046 §4.5: тело `PUT /api/v2/sessions/:id/skills`: точечный toggle
1278
+ * ADR-046 §4.5: тело `PUT /api/v2/sessions/:id/skills`: точечный toggle
1264
1279
  * (`{ name, enabled }`) или полная/частичная замена (`{ skills?, skillsDisabled? }`).
1265
1280
  */
1266
1281
  export declare const sessionSkillUpdateSchema: z.ZodEffects<z.ZodObject<{
@@ -1289,7 +1304,7 @@ export declare const sessionSkillUpdateSchema: z.ZodEffects<z.ZodObject<{
1289
1304
  name?: string | undefined;
1290
1305
  enabled?: boolean | undefined;
1291
1306
  }>;
1292
- /** AD-046 §4.5: тело `PUT /api/v2/projects/:id/skills`. */
1307
+ /** ADR-046 §4.5: тело `PUT /api/v2/projects/:id/skills`. */
1293
1308
  export declare const projectSkillUpdateSchema: z.ZodObject<{
1294
1309
  enabled: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1295
1310
  defaultOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -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
+ /** ADR-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
+ /** ADR-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
+ /** ADR-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
+ /** ADR-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" | "system" | "agent" | "external";
1436
+ intent: "explicit" | "event";
1437
+ mode?: "bound" | "ephemeral" | "queue" | undefined;
1438
+ title?: string | undefined;
1439
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "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" | "system" | "agent" | "external";
1452
+ intent: "explicit" | "event";
1453
+ mode?: "bound" | "ephemeral" | "queue" | undefined;
1454
+ title?: string | undefined;
1455
+ icon?: "code" | "chat" | "task" | "terminal" | "rocket" | "flask" | "gamepad" | "briefcase" | "home" | "globe" | "leaf" | "shield" | "palette" | "server" | "phone" | "database" | "lightbulb" | "music" | "camera" | "book" | "heart" | "folder" | "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
+ * ADR-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
+ /** ADR-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
+ * ADR-089/ADR-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
+ /** ADR-089/ADR-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
+ * ADR-089/ADR-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
+ /** ADR-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
+ * ADR-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
+ * ADR-052: каталог скоупов service-key + wildcard-семейства. Глобальный `*` не
1724
+ * принимается (`isKnownScope`).
1725
+ */
1726
+ export declare const serviceScopeSchema: z.ZodEffects<z.ZodString, string, string>;
1727
+ /**
1728
+ * ADR-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
+ /** ADR-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
+ * ADR-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
+ /** ADR-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
+ /** ADR-052 (этап II): паттерн события подписки — exact либо `prefix.*`. */
1882
+ export declare const webhookEventPatternSchema: z.ZodEffects<z.ZodString, string, string>;
1883
+ /** ADR-052 (этап II): целевой URL — только http/https (SSRF-политика — в core). */
1884
+ export declare const webhookUrlSchema: z.ZodEffects<z.ZodString, string, string>;
1885
+ /**
1886
+ * ADR-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
+ /** ADR-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
+ * ADR-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
+ /** ADR-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
+ /** ADR-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: "pending" | "ok" | "failed";
2034
+ id: string;
2035
+ createdAt: string;
2036
+ subscriptionId: string;
2037
+ eventType: string;
2038
+ attempts: number;
2039
+ error?: string | undefined;
2040
+ responseStatus?: number | undefined;
2041
+ completedAt?: string | undefined;
2042
+ }, {
2043
+ status: "pending" | "ok" | "failed";
2044
+ id: string;
2045
+ createdAt: string;
2046
+ subscriptionId: string;
2047
+ eventType: string;
2048
+ attempts: number;
2049
+ error?: string | undefined;
2050
+ responseStatus?: number | undefined;
2051
+ completedAt?: string | undefined;
2052
+ }>;
2053
+ export type WebhookDeliveryMeta = z.infer<typeof webhookDeliverySchema>;
2054
+ /** ADR-051/ADR-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
+ * ADR-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
+ /** ADR-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
+ /** ADR-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
+ /** ADR-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
+ * ADR-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
+ /** ADR-051/ADR-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
+ /** ADR-051/ADR-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?: "error" | "ok" | "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?: "error" | "ok" | "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?: "error" | "ok" | "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?: "error" | "ok" | "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
+ /** ADR-051: триггер срабатывания расписания в Job-истории. */
2879
+ export declare const scheduleJobTriggerSchema: z.ZodEnum<["cron", "manual", "catchup"]>;
2880
+ /** ADR-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: "error" | "ok" | "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
+ error?: string | undefined;
2951
+ dedupKey?: string | undefined;
2952
+ sessionId?: string | undefined;
2953
+ decision?: "bound" | "ephemeral" | "queue" | "bind" | "drop" | undefined;
2954
+ reason?: string | undefined;
2955
+ }, {
2956
+ status: "error" | "ok" | "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
+ error?: string | undefined;
2977
+ dedupKey?: string | undefined;
2978
+ sessionId?: string | undefined;
2979
+ decision?: "bound" | "ephemeral" | "queue" | "bind" | "drop" | undefined;
2980
+ reason?: string | undefined;
2981
+ }>;
2982
+ export type ScheduleJobRequest = z.infer<typeof scheduleJobSchema>;