@itphx/synth-shared 0.10.0 → 0.11.3

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 (83) hide show
  1. package/dist/config/defaults.js +60 -14
  2. package/dist/config/env-overrides.d.ts +7 -4
  3. package/dist/config/env-overrides.js +46 -13
  4. package/dist/config/index.d.ts +3 -0
  5. package/dist/config/index.js +3 -0
  6. package/dist/config/loader.d.ts +2 -2
  7. package/dist/config/loader.js +23 -4
  8. package/dist/config/proxy.d.ts +415 -0
  9. package/dist/config/proxy.js +1565 -0
  10. package/dist/config/resolve.d.ts +77 -10
  11. package/dist/config/resolve.js +203 -17
  12. package/dist/config/tls-runtime.d.ts +78 -0
  13. package/dist/config/tls-runtime.js +356 -0
  14. package/dist/config/tls.d.ts +215 -0
  15. package/dist/config/tls.js +394 -0
  16. package/dist/config/types.d.ts +1820 -334
  17. package/dist/config/types.js +320 -54
  18. package/dist/i18n/index.d.ts +1 -1
  19. package/dist/i18n/index.js +18 -10
  20. package/dist/index.d.ts +11 -2
  21. package/dist/index.js +11 -2
  22. package/dist/interfaces/index.d.ts +3 -3
  23. package/dist/protocols/index.d.ts +0 -1
  24. package/dist/schemas/index.d.ts +230 -105
  25. package/dist/schemas/index.js +121 -74
  26. package/dist/skills/frontmatter.js +1 -1
  27. package/dist/types/agent.d.ts +30 -0
  28. package/dist/types/agent.js +1 -0
  29. package/dist/types/analytics.d.ts +113 -0
  30. package/dist/types/analytics.js +61 -0
  31. package/dist/types/bus-events.d.ts +7 -0
  32. package/dist/types/bus-events.js +1 -0
  33. package/dist/types/commands.d.ts +10 -10
  34. package/dist/types/commands.js +2 -2
  35. package/dist/types/decision.d.ts +16 -16
  36. package/dist/types/decision.js +4 -4
  37. package/dist/types/egress.d.ts +114 -0
  38. package/dist/types/egress.js +68 -0
  39. package/dist/types/events.d.ts +22 -23
  40. package/dist/types/fs.d.ts +55 -0
  41. package/dist/types/fs.js +27 -0
  42. package/dist/types/git.d.ts +63 -0
  43. package/dist/types/git.js +1 -0
  44. package/dist/types/hooks.d.ts +24 -4
  45. package/dist/types/index.d.ts +15 -1165
  46. package/dist/types/index.js +44 -244
  47. package/dist/types/llm.d.ts +32 -0
  48. package/dist/types/llm.js +8 -0
  49. package/dist/types/maintenance.d.ts +39 -0
  50. package/dist/types/maintenance.js +11 -0
  51. package/dist/types/mcp.d.ts +169 -0
  52. package/dist/types/mcp.js +119 -0
  53. package/dist/types/message.d.ts +63 -0
  54. package/dist/types/message.js +12 -0
  55. package/dist/types/permission.d.ts +9 -7
  56. package/dist/types/permission.js +1 -1
  57. package/dist/types/project.d.ts +134 -0
  58. package/dist/types/project.js +67 -0
  59. package/dist/types/prompt.d.ts +237 -0
  60. package/dist/types/prompt.js +15 -0
  61. package/dist/types/provider.d.ts +84 -0
  62. package/dist/types/provider.js +35 -0
  63. package/dist/types/schedules.d.ts +8 -8
  64. package/dist/types/schedules.js +1 -1
  65. package/dist/types/service-keys.d.ts +10 -10
  66. package/dist/types/service-keys.js +3 -3
  67. package/dist/types/session.d.ts +268 -0
  68. package/dist/types/session.js +13 -0
  69. package/dist/types/skills.d.ts +11 -11
  70. package/dist/types/skills.js +6 -6
  71. package/dist/types/tools.d.ts +3 -3
  72. package/dist/types/user.d.ts +113 -0
  73. package/dist/types/user.js +31 -0
  74. package/dist/types/webhooks.d.ts +6 -6
  75. package/dist/types/webhooks.js +1 -1
  76. package/dist/utils/glob.d.ts +1 -1
  77. package/dist/utils/glob.js +1 -1
  78. package/dist/utils/index.d.ts +15 -0
  79. package/dist/utils/index.js +55 -2
  80. package/dist/utils/workspace.js +1 -1
  81. package/dist/version.d.ts +1 -1
  82. package/dist/version.js +1 -1
  83. package/package.json +1 -1
@@ -17,27 +17,201 @@ export declare const serverConfigSchema: z.ZodObject<{
17
17
  corsOrigin?: string | undefined;
18
18
  allowedOrigins?: string[] | undefined;
19
19
  }>;
20
+ /**
21
+ * PROP-032: параметры подключения к PostgreSQL (секция `storage.postgres`).
22
+ *
23
+ * Пароль здесь **не хранится** (инвариант 13) — его читает резолвер
24
+ * `resolvePostgresPassword` (env `SYNTH_POSTGRES_PASSWORD` → файл
25
+ * `{dataDir}/secrets/postgres-password`); решение об ошибке отсутствия пароля
26
+ * принимает драйвер (`@itphx/synth-storage-postgres`). `dsn` задан —
27
+ * приоритетнее отдельных `host`/`port`/`database`/`user`.
28
+ */
29
+ export declare const postgresStorageConfigSchema: z.ZodObject<{
30
+ /** Полная строка подключения; задана — приоритетнее host/port/database/user. */
31
+ dsn: z.ZodOptional<z.ZodString>;
32
+ host: z.ZodOptional<z.ZodString>;
33
+ port: z.ZodOptional<z.ZodNumber>;
34
+ database: z.ZodOptional<z.ZodString>;
35
+ user: z.ZodOptional<z.ZodString>;
36
+ /** Схема БД (namespace таблиц). */
37
+ schema: z.ZodOptional<z.ZodString>;
38
+ /**
39
+ * ADR-099/PROP-032: TLS-режим соединения с БД.
40
+ * `disable` — без TLS; `require` — шифрование без проверки сертификата;
41
+ * `verify-full` — проверка сертификата сервера по CA из `security.tls`.
42
+ * `verify-ca` принимается как **алиас** `verify-full` (нормализуется с
43
+ * предупреждением). **Не задано — прежнее поведение (`ssl: false`, без TLS)**,
44
+ * чтобы не сломать dev/существующие установки (dev-сервер без TLS).
45
+ * Читать/мапить — `resolvePostgresConfig` + `buildPostgresSslOptions`
46
+ * (`resolve.ts`/`tls.ts`, core — `storage/storage-context.ts`).
47
+ * TLS-параметры (`sslmode`/`sslrootcert`/…) **запрещены в `dsn`** — `pg`
48
+ * накладывает DSN поверх конфига и молча перекрывает `ssl`.
49
+ */
50
+ sslmode: z.ZodOptional<z.ZodEnum<["disable", "require", "verify-full", "verify-ca"]>>;
51
+ /**
52
+ * Legacy-флаг TLS (`true`/`false`); используется, только если `sslmode` не
53
+ * задан (обратная совместимость). Новые установки — через `sslmode`.
54
+ */
55
+ ssl: z.ZodOptional<z.ZodBoolean>;
56
+ /** Максимальный размер пула соединений. */
57
+ poolMax: z.ZodOptional<z.ZodNumber>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ user?: string | undefined;
60
+ database?: string | undefined;
61
+ host?: string | undefined;
62
+ port?: number | undefined;
63
+ dsn?: string | undefined;
64
+ schema?: string | undefined;
65
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
66
+ ssl?: boolean | undefined;
67
+ poolMax?: number | undefined;
68
+ }, {
69
+ user?: string | undefined;
70
+ database?: string | undefined;
71
+ host?: string | undefined;
72
+ port?: number | undefined;
73
+ dsn?: string | undefined;
74
+ schema?: string | undefined;
75
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
76
+ ssl?: boolean | undefined;
77
+ poolMax?: number | undefined;
78
+ }>;
20
79
  export declare const storageConfigSchema: z.ZodObject<{
21
80
  dataDir: z.ZodDefault<z.ZodString>;
81
+ /**
82
+ * PROP-032: физический backend хранения. `file` — JSON-файлы с атомарной
83
+ * записью tmp→rename (ADR-005, дефолт); `memory` — in-memory (энергонезависимо
84
+ * НЕ сохраняется, для герметичных тестов); `postgres` — БД (драйвер —
85
+ * in-tree опциональный пакет `@itphx/synth-storage-postgres`). Читать через
86
+ * `resolveStorageBackend` (env `SYNTH_STORAGE_BACKEND` > это поле > `file`,
87
+ * fail-closed на неизвестном явно заданном значении).
88
+ *
89
+ * Необязательно: частичные override-объекты (`{ dataDir, workspacesRoot, … }`)
90
+ * остаются валидными, а дефолт `file` задают `defaults.ts`/`resolveStorageBackend`.
91
+ */
92
+ backend: z.ZodOptional<z.ZodEnum<["file", "memory", "postgres"]>>;
93
+ /** PROP-032: параметры PostgreSQL-backend (используются при `backend: postgres`). */
94
+ postgres: z.ZodDefault<z.ZodObject<{
95
+ /** Полная строка подключения; задана — приоритетнее host/port/database/user. */
96
+ dsn: z.ZodOptional<z.ZodString>;
97
+ host: z.ZodOptional<z.ZodString>;
98
+ port: z.ZodOptional<z.ZodNumber>;
99
+ database: z.ZodOptional<z.ZodString>;
100
+ user: z.ZodOptional<z.ZodString>;
101
+ /** Схема БД (namespace таблиц). */
102
+ schema: z.ZodOptional<z.ZodString>;
103
+ /**
104
+ * ADR-099/PROP-032: TLS-режим соединения с БД.
105
+ * `disable` — без TLS; `require` — шифрование без проверки сертификата;
106
+ * `verify-full` — проверка сертификата сервера по CA из `security.tls`.
107
+ * `verify-ca` принимается как **алиас** `verify-full` (нормализуется с
108
+ * предупреждением). **Не задано — прежнее поведение (`ssl: false`, без TLS)**,
109
+ * чтобы не сломать dev/существующие установки (dev-сервер без TLS).
110
+ * Читать/мапить — `resolvePostgresConfig` + `buildPostgresSslOptions`
111
+ * (`resolve.ts`/`tls.ts`, core — `storage/storage-context.ts`).
112
+ * TLS-параметры (`sslmode`/`sslrootcert`/…) **запрещены в `dsn`** — `pg`
113
+ * накладывает DSN поверх конфига и молча перекрывает `ssl`.
114
+ */
115
+ sslmode: z.ZodOptional<z.ZodEnum<["disable", "require", "verify-full", "verify-ca"]>>;
116
+ /**
117
+ * Legacy-флаг TLS (`true`/`false`); используется, только если `sslmode` не
118
+ * задан (обратная совместимость). Новые установки — через `sslmode`.
119
+ */
120
+ ssl: z.ZodOptional<z.ZodBoolean>;
121
+ /** Максимальный размер пула соединений. */
122
+ poolMax: z.ZodOptional<z.ZodNumber>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ user?: string | undefined;
125
+ database?: string | undefined;
126
+ host?: string | undefined;
127
+ port?: number | undefined;
128
+ dsn?: string | undefined;
129
+ schema?: string | undefined;
130
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
131
+ ssl?: boolean | undefined;
132
+ poolMax?: number | undefined;
133
+ }, {
134
+ user?: string | undefined;
135
+ database?: string | undefined;
136
+ host?: string | undefined;
137
+ port?: number | undefined;
138
+ dsn?: string | undefined;
139
+ schema?: string | undefined;
140
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
141
+ ssl?: boolean | undefined;
142
+ poolMax?: number | undefined;
143
+ }>>;
144
+ /**
145
+ * PROP-032 (волна 5): поведение при недоступности выбранного backend —
146
+ * `fallback-file` (перейти на файловое хранилище в `fallbackDir`, default) |
147
+ * `halt` (остановить старт). Читать через `resolveDegradedMode`
148
+ * (приоритет env `SYNTH_DEGRADED_MODE` > это поле > `fallback-file`).
149
+ */
150
+ degradedMode: z.ZodDefault<z.ZodEnum<["fallback-file", "halt"]>>;
151
+ /**
152
+ * PROP-032 (волна 5): каталог файлового фоллбека при деградации.
153
+ * `''` — не задано (эффективно `{dataDir}/fallback`), читать через
154
+ * `resolveStorageFallbackDir` (приоритет env `SYNTH_STORAGE_FALLBACK_DIR` >
155
+ * это поле > `{dataDir}/fallback`).
156
+ */
157
+ fallbackDir: z.ZodDefault<z.ZodString>;
22
158
  workspacesRoot: z.ZodDefault<z.ZodString>;
23
159
  /** Рабочий каталог по умолчанию для сессий без проекта. Резолвится от dataDir: {dataDir}/workspaces/default. */
24
160
  defaultWorkspace: z.ZodDefault<z.ZodString>;
25
161
  /**
26
- * AD-075: политика для абсолютного `project.workspace` вне `workspacesRoot`
162
+ * ADR-075: политика для абсолютного `project.workspace` вне `workspacesRoot`
27
163
  * (`confirm` — подтверждение, `deny` — запрет). `''` — не задано (эффективно
28
164
  * `confirm`), читать через `resolveWorkspaceOutsideRootPolicy`.
29
165
  */
30
166
  workspaceOutsideRoot: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["confirm", "deny"]>, z.ZodLiteral<"">]>>;
167
+ /**
168
+ * Максимальный размер загружаемого файла (`POST /api/v2/fs/upload`), в байтах.
169
+ * Валидируется (положительное целое в границах `MIN_UPLOAD_BYTES`…
170
+ * `MAX_UPLOAD_BYTES_LIMIT`), читать через `resolveMaxUploadBytes` (env
171
+ * `SYNTH_MAX_UPLOAD_BYTES` > это поле > `DEFAULT_MAX_UPLOAD_BYTES`).
172
+ * Не задано — резолвер подставляет `DEFAULT_MAX_UPLOAD_BYTES` (100 МиБ).
173
+ */
174
+ maxUploadBytes: z.ZodOptional<z.ZodNumber>;
31
175
  }, "strip", z.ZodTypeAny, {
32
176
  dataDir: string;
177
+ postgres: {
178
+ user?: string | undefined;
179
+ database?: string | undefined;
180
+ host?: string | undefined;
181
+ port?: number | undefined;
182
+ dsn?: string | undefined;
183
+ schema?: string | undefined;
184
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
185
+ ssl?: boolean | undefined;
186
+ poolMax?: number | undefined;
187
+ };
188
+ degradedMode: "fallback-file" | "halt";
189
+ fallbackDir: string;
33
190
  workspacesRoot: string;
34
191
  defaultWorkspace: string;
35
192
  workspaceOutsideRoot: "" | "deny" | "confirm";
193
+ backend?: "file" | "memory" | "postgres" | undefined;
194
+ maxUploadBytes?: number | undefined;
36
195
  }, {
37
196
  dataDir?: string | undefined;
197
+ postgres?: {
198
+ user?: string | undefined;
199
+ database?: string | undefined;
200
+ host?: string | undefined;
201
+ port?: number | undefined;
202
+ dsn?: string | undefined;
203
+ schema?: string | undefined;
204
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
205
+ ssl?: boolean | undefined;
206
+ poolMax?: number | undefined;
207
+ } | undefined;
208
+ backend?: "file" | "memory" | "postgres" | undefined;
209
+ degradedMode?: "fallback-file" | "halt" | undefined;
210
+ fallbackDir?: string | undefined;
38
211
  workspacesRoot?: string | undefined;
39
212
  defaultWorkspace?: string | undefined;
40
213
  workspaceOutsideRoot?: "" | "deny" | "confirm" | undefined;
214
+ maxUploadBytes?: number | undefined;
41
215
  }>;
42
216
  export declare const authConfigSchema: z.ZodObject<{
43
217
  debugMode: z.ZodDefault<z.ZodBoolean>;
@@ -124,20 +298,20 @@ export declare const llmConfigSchema: z.ZodObject<{
124
298
  defaultModel: z.ZodDefault<z.ZodString>;
125
299
  maxRetries: z.ZodDefault<z.ZodNumber>;
126
300
  timeout: z.ZodDefault<z.ZodNumber>;
127
- /** AD-070 §2.2: политика prompt-cache — auto (ставить маркеры) | none (отключить). */
301
+ /** ADR-070 §2.2: политика prompt-cache — auto (ставить маркеры) | none (отключить). */
128
302
  cache: z.ZodDefault<z.ZodEnum<["auto", "none"]>>;
129
303
  }, "strip", z.ZodTypeAny, {
130
304
  defaultProvider: string;
131
305
  defaultModel: string;
132
306
  maxRetries: number;
133
307
  timeout: number;
134
- cache: "none" | "auto";
308
+ cache: "auto" | "none";
135
309
  }, {
136
310
  defaultProvider?: string | undefined;
137
311
  defaultModel?: string | undefined;
138
312
  maxRetries?: number | undefined;
139
313
  timeout?: number | undefined;
140
- cache?: "none" | "auto" | undefined;
314
+ cache?: "auto" | "none" | undefined;
141
315
  }>;
142
316
  export declare const coreConfigSchema: z.ZodObject<{
143
317
  port: z.ZodDefault<z.ZodNumber>;
@@ -157,31 +331,31 @@ export declare const runnerConfigSchema: z.ZodObject<{
157
331
  cline: z.ZodDefault<z.ZodNumber>;
158
332
  synth: z.ZodDefault<z.ZodNumber>;
159
333
  }, "strip", z.ZodTypeAny, {
160
- synth: number;
161
334
  opencode: number;
162
335
  cline: number;
336
+ synth: number;
163
337
  }, {
164
- synth?: number | undefined;
165
338
  opencode?: number | undefined;
166
339
  cline?: number | undefined;
340
+ synth?: number | undefined;
167
341
  }>>;
168
342
  proxyPort: z.ZodDefault<z.ZodNumber>;
169
343
  }, "strip", z.ZodTypeAny, {
170
344
  port: number;
171
345
  backendUrl: string;
172
346
  enginePorts: {
173
- synth: number;
174
347
  opencode: number;
175
348
  cline: number;
349
+ synth: number;
176
350
  };
177
351
  proxyPort: number;
178
352
  }, {
179
353
  port?: number | undefined;
180
354
  backendUrl?: string | undefined;
181
355
  enginePorts?: {
182
- synth?: number | undefined;
183
356
  opencode?: number | undefined;
184
357
  cline?: number | undefined;
358
+ synth?: number | undefined;
185
359
  } | undefined;
186
360
  proxyPort?: number | undefined;
187
361
  }>;
@@ -264,7 +438,7 @@ export declare const summarizationConfigSchema: z.ZodObject<{
264
438
  }>;
265
439
  export declare const mcpServerConfigSchema: z.ZodObject<{
266
440
  type: z.ZodEnum<["stdio", "sse", "http"]>;
267
- /** AD-071 §2.2: человекочитаемое описание сервера (попадает в блок `mcp.servers`). */
441
+ /** ADR-071 §2.2: человекочитаемое описание сервера (попадает в блок `mcp.servers`). */
268
442
  description: z.ZodOptional<z.ZodString>;
269
443
  command: z.ZodOptional<z.ZodString>;
270
444
  args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -310,23 +484,27 @@ export declare const mcpServerConfigSchema: z.ZodObject<{
310
484
  connectTimeout?: number | undefined;
311
485
  }>;
312
486
  /**
313
- * AD-071 §2.3.1: политика сетевого доступа пользовательских HTTP MCP-серверов.
487
+ * ADR-071 §2.3.1: политика сетевого доступа пользовательских HTTP MCP-серверов.
314
488
  * Дефолт — `deny` приватных/служебных диапазонов (SSRF/egress).
315
489
  */
316
490
  export declare const mcpNetworkPolicySchema: z.ZodObject<{
317
491
  mode: z.ZodDefault<z.ZodEnum<["allow", "deny"]>>;
318
492
  list: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
493
+ /** Allow-правила-исключения (общий формат с `egress.*`). */
494
+ exceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
319
495
  }, "strip", z.ZodTypeAny, {
320
496
  mode: "allow" | "deny";
321
497
  list: string[];
498
+ exceptions: string[];
322
499
  }, {
323
500
  mode?: "allow" | "deny" | undefined;
324
501
  list?: string[] | undefined;
502
+ exceptions?: string[] | undefined;
325
503
  }>;
326
504
  export declare const mcpConfigSchema: z.ZodObject<{
327
505
  servers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
328
506
  type: z.ZodEnum<["stdio", "sse", "http"]>;
329
- /** AD-071 §2.2: человекочитаемое описание сервера (попадает в блок `mcp.servers`). */
507
+ /** ADR-071 §2.2: человекочитаемое описание сервера (попадает в блок `mcp.servers`). */
330
508
  description: z.ZodOptional<z.ZodString>;
331
509
  command: z.ZodOptional<z.ZodString>;
332
510
  args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -374,15 +552,19 @@ export declare const mcpConfigSchema: z.ZodObject<{
374
552
  networkPolicy: z.ZodDefault<z.ZodObject<{
375
553
  mode: z.ZodDefault<z.ZodEnum<["allow", "deny"]>>;
376
554
  list: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
555
+ /** Allow-правила-исключения (общий формат с `egress.*`). */
556
+ exceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
377
557
  }, "strip", z.ZodTypeAny, {
378
558
  mode: "allow" | "deny";
379
559
  list: string[];
560
+ exceptions: string[];
380
561
  }, {
381
562
  mode?: "allow" | "deny" | undefined;
382
563
  list?: string[] | undefined;
564
+ exceptions?: string[] | undefined;
383
565
  }>>;
384
566
  /**
385
- * AD-071 §2.3: глобальная админская политика включения **MCP**-инструментов.
567
+ * ADR-071 §2.3: глобальная админская политика включения **MCP**-инструментов.
386
568
  * Независима от `tools.policy` (только встроенные). Per-session override —
387
569
  * `SessionSettings.mcpPolicy`.
388
570
  */
@@ -405,6 +587,7 @@ export declare const mcpConfigSchema: z.ZodObject<{
405
587
  networkPolicy: {
406
588
  mode: "allow" | "deny";
407
589
  list: string[];
590
+ exceptions: string[];
408
591
  };
409
592
  }, {
410
593
  policy?: "auto" | "consistency" | "available" | undefined;
@@ -424,10 +607,11 @@ export declare const mcpConfigSchema: z.ZodObject<{
424
607
  networkPolicy?: {
425
608
  mode?: "allow" | "deny" | undefined;
426
609
  list?: string[] | undefined;
610
+ exceptions?: string[] | undefined;
427
611
  } | undefined;
428
612
  }>;
429
613
  /**
430
- * AD-071 §2.6: instance-wide жёсткое отключение инструментов администратором.
614
+ * ADR-071 §2.6: instance-wide жёсткое отключение инструментов администратором.
431
615
  * Отключённые тулы не попадают в запрос независимо от `tools.policy`.
432
616
  * `runtime`-capability неотключаема (ядро сессии).
433
617
  */
@@ -435,45 +619,45 @@ export declare const toolsDisabledConfigSchema: z.ZodObject<{
435
619
  capabilities: z.ZodDefault<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">> | z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
436
620
  tools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
437
621
  }, "strip", z.ZodTypeAny, {
438
- capabilities: string[];
439
622
  tools: string[];
623
+ capabilities: string[];
440
624
  }, {
441
- capabilities?: string[] | undefined;
442
625
  tools?: string[] | undefined;
626
+ capabilities?: string[] | undefined;
443
627
  }>;
444
628
  /**
445
- * AD-071 §2.3: глобальная админская политика включения **встроенных**
629
+ * ADR-071 §2.3: глобальная админская политика включения **встроенных**
446
630
  * инструментов (MCP — отдельная `mcp.policy`). Per-session override —
447
631
  * `SessionSettings.toolsPolicy`.
448
632
  */
449
633
  export declare const toolsConfigSchema: z.ZodObject<{
450
634
  policy: z.ZodDefault<z.ZodEnum<["consistency", "available", "auto"]>>;
451
- /** AD-071 §2.6: instance-wide отключение инструментов (admin). */
635
+ /** ADR-071 §2.6: instance-wide отключение инструментов (admin). */
452
636
  disabled: z.ZodDefault<z.ZodObject<{
453
637
  capabilities: z.ZodDefault<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">> | z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
454
638
  tools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
455
639
  }, "strip", z.ZodTypeAny, {
456
- capabilities: string[];
457
640
  tools: string[];
641
+ capabilities: string[];
458
642
  }, {
459
- capabilities?: string[] | undefined;
460
643
  tools?: string[] | undefined;
644
+ capabilities?: string[] | undefined;
461
645
  }>>;
462
646
  }, "strip", z.ZodTypeAny, {
463
647
  disabled: {
464
- capabilities: string[];
465
648
  tools: string[];
649
+ capabilities: string[];
466
650
  };
467
651
  policy: "auto" | "consistency" | "available";
468
652
  }, {
469
653
  disabled?: {
470
- capabilities?: string[] | undefined;
471
654
  tools?: string[] | undefined;
655
+ capabilities?: string[] | undefined;
472
656
  } | undefined;
473
657
  policy?: "auto" | "consistency" | "available" | undefined;
474
658
  }>;
475
659
  /**
476
- * AD-046 §4.2/§4.4/§7.4: конфигурация механизма скиллов.
660
+ * ADR-046 §4.2/§4.4/§7.4: конфигурация механизма скиллов.
477
661
  * `paths` — дополнительные пользовательские каталоги; `trustedProjectDirs` —
478
662
  * доверенные проектные каталоги (бинарный trust); `inlineShell` — выключатель
479
663
  * `!`cmd`` в шаблонных командах (по умолчанию выключено).
@@ -481,19 +665,19 @@ export declare const toolsConfigSchema: z.ZodObject<{
481
665
  * `urls` — внешние удалённые каталоги (opencode-совместимый `index.json`):
482
666
  * **только read-only индексация** — скачиваются в `{dataDir}/skills-cache/urls`,
483
667
  * видны в реестре/диагностике, но `trusted: false` (в каталог для модели не
484
- * попадают, тело не грузится). Установка/доверие/подписи/`lock.json` — AD-068.
668
+ * попадают, тело не грузится). Установка/доверие/подписи/`lock.json` — PROP-068.
485
669
  *
486
670
  * Внешние локальные каталоги совместимости (`.opencode`, `.claude`, `.agents`,
487
- * `~/.config/opencode`) подключаются как read-only discovery в core (AD-046 §4.2).
671
+ * `~/.config/opencode`) подключаются как read-only discovery в core (ADR-046 §4.2).
488
672
  */
489
673
  export declare const skillsConfigSchema: z.ZodObject<{
490
674
  paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
491
- /** AD-046 §4.2/§4.3: удалённые каталоги — read-only индексация (`trusted: false`). */
675
+ /** ADR-046 §4.2/§4.3: удалённые каталоги — read-only индексация (`trusted: false`). */
492
676
  urls: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
493
677
  trustedProjectDirs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
494
678
  inlineShell: z.ZodDefault<z.ZodBoolean>;
495
679
  /**
496
- * AD-046 §3.2/§12: именованные группы тулов → capabilities. Используется
680
+ * ADR-046 §3.2/§12: именованные группы тулов → capabilities. Используется
497
681
  * для экспансии `metadata.synth.requires_toolsets` в проверку доступности
498
682
  * скилла (union с `requires_capabilities`).
499
683
  */
@@ -512,7 +696,7 @@ export declare const skillsConfigSchema: z.ZodObject<{
512
696
  toolsets?: Record<string, ToolCapability[]> | undefined;
513
697
  }>;
514
698
  /**
515
- * AD-046 §7/§9.4: конфигурация slash-команд. `paths` — дополнительные каталоги
699
+ * ADR-046 §7/§9.4: конфигурация slash-команд. `paths` — дополнительные каталоги
516
700
  * шаблонных `.md`-команд; `bundlesPath` — подкаталог `{dataDir}` для YAML-бандлов;
517
701
  * `conflict` — режим разрешения конфликтов имён (см. resolver).
518
702
  */
@@ -551,7 +735,7 @@ export declare const commandsConfigSchema: z.ZodObject<{
551
735
  maxRenderedBytes?: number | undefined;
552
736
  }>;
553
737
  /**
554
- * AD-089: конфигурация приёма внешних событий.
738
+ * ADR-089: конфигурация приёма внешних событий.
555
739
  * - `enabled` — мастер-выключатель приёма событий;
556
740
  * - `defaultMode` — режим по умолчанию, если Router не выбрал иной;
557
741
  * - `ephemeralTtl` — TTL ephemeral-сессий по умолчанию;
@@ -566,18 +750,18 @@ export declare const commandsConfigSchema: z.ZodObject<{
566
750
  * `default-agent` — не задавать `agentRole` (сессия возьмёт агента по умолчанию);
567
751
  * - `keyRateLimitPerMinute` — глобальный дефолт лимита запросов/мин на API-ключ
568
752
  * привязки (0 — без лимита; конкретный ключ может переопределить);
569
- * - `decisionRouting` — AD-084 × AD-089: умная классификация внешних событий
753
+ * - `decisionRouting` — ADR-084 × ADR-089: умная классификация внешних событий
570
754
  * decision-моделью. `false` (default, opt-in) — только декларативные правила
571
755
  * (`ProjectRuleProvider`); `true` — при промахе правил decision-модель выбирает
572
756
  * шаблон агента для ephemeral-сессии. Fail-safe: ошибка/неуверенность/пустой
573
757
  * список агентов → фоллбек Router (`defaultMode`);
574
- * - `autoBind` — AD-089: фоллбек Router закрепляет событие с `identity.chatKey`/
758
+ * - `autoBind` — ADR-089: фоллбек Router закрепляет событие с `identity.chatKey`/
575
759
  * `threadKey` за новой сессией (`EventBinding` `mode='bound'`) вместо
576
760
  * `defaultMode`. `false` (default) — поведение не меняется; влияет только на
577
761
  * фоллбек;
578
762
  * - `autoBindAgentTemplate` — шаблон агента для auto-bind-сессий (пусто — агент
579
763
  * по умолчанию);
580
- * - `identityMap` — AD-089: маппинг идентичности внешнего отправителя на
764
+ * - `identityMap` — ADR-089: маппинг идентичности внешнего отправителя на
581
765
  * владельца синт-сессии. Ключ — `identity.chatKey` (`chat:telegram:<id>`) или
582
766
  * `identity.principalId` (`tg:<id>`), значение — id пользователя
583
767
  * синт-инстанса. Применяется при материализации сессий `ephemeral`/`bind`:
@@ -594,19 +778,19 @@ export declare const eventsConfigSchema: z.ZodObject<{
594
778
  dedupStore: z.ZodDefault<z.ZodEnum<["memory", "file"]>>;
595
779
  unknownAgentTemplate: z.ZodDefault<z.ZodEnum<["drop", "default-agent"]>>;
596
780
  /**
597
- * Глобальный дефолт лимита запросов/мин на API-ключ привязки (AD-089/AD-052).
781
+ * Глобальный дефолт лимита запросов/мин на API-ключ привязки (ADR-089/ADR-052).
598
782
  * `0` — без лимита; конкретный ключ может переопределить своим
599
783
  * `rateLimitPerMinute`.
600
784
  */
601
785
  keyRateLimitPerMinute: z.ZodDefault<z.ZodNumber>;
602
786
  /**
603
- * AD-084 × AD-089: decision-маршрутизация внешних событий. По умолчанию
787
+ * ADR-084 × ADR-089: decision-маршрутизация внешних событий. По умолчанию
604
788
  * выключена (поведение не меняется) — включение требует настроенного
605
789
  * decision-провайдера (`decision.enabled`).
606
790
  */
607
791
  decisionRouting: z.ZodDefault<z.ZodBoolean>;
608
792
  /**
609
- * AD-089 (auto-bind): фоллбек Router — если у события есть `identity.chatKey`
793
+ * ADR-089 (auto-bind): фоллбек Router — если у события есть `identity.chatKey`
610
794
  * или `identity.threadKey`, закрепить его за новой сессией (создать
611
795
  * `EventBinding` `mode='bound'`) вместо `defaultMode`. По умолчанию выключено
612
796
  * (поведение не меняется). Влияет **только** на фоллбек — явный binding,
@@ -614,12 +798,12 @@ export declare const eventsConfigSchema: z.ZodObject<{
614
798
  */
615
799
  autoBind: z.ZodDefault<z.ZodBoolean>;
616
800
  /**
617
- * AD-089 (auto-bind): шаблон агента для auto-bind-сессий (пусто — агент по
801
+ * ADR-089 (auto-bind): шаблон агента для auto-bind-сессий (пусто — агент по
618
802
  * умолчанию; резолвится через `AgentRegistry` с политикой `unknownAgentTemplate`).
619
803
  */
620
804
  autoBindAgentTemplate: z.ZodDefault<z.ZodString>;
621
805
  /**
622
- * AD-089: маппинг идентичности внешнего отправителя (`identity.chatKey` или
806
+ * ADR-089: маппинг идентичности внешнего отправителя (`identity.chatKey` или
623
807
  * `identity.principalId`) на владельца синт-сессии (id пользователя
624
808
  * инстанса). Применяется при материализации `ephemeral`/`bind`; пусто —
625
809
  * владелец не переопределяется (аутентифицированный пользователь запроса,
@@ -654,42 +838,44 @@ export declare const eventsConfigSchema: z.ZodObject<{
654
838
  identityMap?: Record<string, string> | undefined;
655
839
  }>;
656
840
  /**
657
- * AD-051 (минимальный срез) / AD-089: конфигурация cron/interval-планировщика.
841
+ * ADR-051 (минимальный срез) / ADR-089: конфигурация cron/interval-планировщика.
658
842
  * - `enabled` — мастер-выключатель сервиса (в standalone гейтит `start()`);
659
843
  * - `tickSec` — период тика, секунды (1..3600);
660
844
  * - `catchUp` — дефолт поведения при пропущенном срабатывании (`skip`/`once`);
661
845
  * - `jobRetentionDays` — срок хранения Job-истории (дни, `prune` на старте);
662
846
  * - `leaderElection` — выбор лидера-владельца тикера: `none` (каждый процесс
663
847
  * считает себя лидером, поведение single-process) | `file` (file-based lock на
664
- * общем `dataDir`). Default — `none` (OFF);
848
+ * общем `dataDir`) | `postgres` (session-level advisory-lock БД; требует
849
+ * `storage.backend=postgres`, иначе — `AlwaysLeader`). Default — `none` (OFF);
665
850
  * - `crossProcessLocks` — межпроцессная сериализация мутаций `ScheduleStore`
666
851
  * (file-мьютекс поверх in-process `AsyncLock`). Default — `false` (OFF):
667
- * поведение single-process не меняется.
852
+ * поведение single-process не меняется. Под `storage.backend=postgres`
853
+ * `ScheduleStore` не используется (мутации — атомарные SQL), лок не создаётся.
668
854
  */
669
855
  export declare const schedulerConfigSchema: z.ZodObject<{
670
856
  enabled: z.ZodDefault<z.ZodBoolean>;
671
857
  tickSec: z.ZodDefault<z.ZodNumber>;
672
858
  catchUp: z.ZodDefault<z.ZodEnum<["skip", "once"]>>;
673
859
  jobRetentionDays: z.ZodDefault<z.ZodNumber>;
674
- leaderElection: z.ZodDefault<z.ZodEnum<["none", "file"]>>;
860
+ leaderElection: z.ZodDefault<z.ZodEnum<["none", "file", "postgres"]>>;
675
861
  crossProcessLocks: z.ZodDefault<z.ZodBoolean>;
676
862
  }, "strip", z.ZodTypeAny, {
677
863
  enabled: boolean;
678
864
  catchUp: "skip" | "once";
679
865
  tickSec: number;
680
866
  jobRetentionDays: number;
681
- leaderElection: "file" | "none";
867
+ leaderElection: "none" | "file" | "postgres";
682
868
  crossProcessLocks: boolean;
683
869
  }, {
684
870
  enabled?: boolean | undefined;
685
871
  catchUp?: "skip" | "once" | undefined;
686
872
  tickSec?: number | undefined;
687
873
  jobRetentionDays?: number | undefined;
688
- leaderElection?: "file" | "none" | undefined;
874
+ leaderElection?: "none" | "file" | "postgres" | undefined;
689
875
  crossProcessLocks?: boolean | undefined;
690
876
  }>;
691
877
  /**
692
- * AD-084: конфигурация класса decision-моделей (System One: Clef/Jev/…).
878
+ * ADR-084: конфигурация класса decision-моделей (System One: Clef/Jev/…).
693
879
  * - `enabled` — мастер-выключатель decision-слоя (по умолчанию выключен);
694
880
  * - `provider` — имя провайдера decision-типа (`decision`/`systemone`);
695
881
  * - `model` — модель decision-слоя (напр. `clef-flash`);
@@ -706,9 +892,9 @@ export declare const decisionConfigSchema: z.ZodObject<{
706
892
  provider: z.ZodDefault<z.ZodString>;
707
893
  model: z.ZodDefault<z.ZodString>;
708
894
  confidenceThreshold: z.ZodDefault<z.ZodNumber>;
709
- /** AD-084: провайдер тира эскалации; пусто — эскалации нет. */
895
+ /** ADR-084: провайдер тира эскалации; пусто — эскалации нет. */
710
896
  escalationProvider: z.ZodDefault<z.ZodString>;
711
- /** AD-084: модель тира эскалации; пусто — эскалации нет. */
897
+ /** ADR-084: модель тира эскалации; пусто — эскалации нет. */
712
898
  escalationModel: z.ZodDefault<z.ZodString>;
713
899
  }, "strip", z.ZodTypeAny, {
714
900
  provider: string;
@@ -726,35 +912,173 @@ export declare const decisionConfigSchema: z.ZodObject<{
726
912
  escalationModel?: string | undefined;
727
913
  }>;
728
914
  /**
729
- * AD-052 (этап II): конфигурация исходящих webhooks.
915
+ * PROP-102: конфигурация аналитики инстанса.
916
+ * - `retentionDays` — срок хранения суточных роллапов (UTC-дни): бакеты со
917
+ * `day < utcDay(now) - retentionDays` удаляются прунером. `<= 0` — без
918
+ * ограничения. Default — 400.
919
+ */
920
+ export declare const analyticsConfigSchema: z.ZodObject<{
921
+ retentionDays: z.ZodDefault<z.ZodNumber>;
922
+ }, "strip", z.ZodTypeAny, {
923
+ retentionDays: number;
924
+ }, {
925
+ retentionDays?: number | undefined;
926
+ }>;
927
+ /**
928
+ * ADR-094: конфигурация экспорта метрик.
929
+ * - `enabled` — включает `GET /metrics` и сбор HTTP/процессных метрик
930
+ * (по умолчанию выключено — контракт «эндпоинта нет, пока не включили»).
931
+ *
932
+ * Bearer-токен в конфиге **не хранится** (инвариант 13): env
933
+ * `SYNTH_METRICS_TOKEN` либо файл `{dataDir}/secrets/metrics-token`.
934
+ * Имя env совпадает с Helm-чартом (`SYNTH_METRICS_ENABLED`).
935
+ */
936
+ export declare const metricsConfigSchema: z.ZodObject<{
937
+ enabled: z.ZodDefault<z.ZodBoolean>;
938
+ }, "strip", z.ZodTypeAny, {
939
+ enabled: boolean;
940
+ }, {
941
+ enabled?: boolean | undefined;
942
+ }>;
943
+ /**
944
+ * ADR-052 (этап II): конфигурация исходящих webhooks.
730
945
  * - `enabled` — мастер-выключатель доставки (по умолчанию выключен);
731
946
  * - `maxAttempts` — число HTTP-попыток на доставку (экспоненциальный backoff с джиттером);
732
947
  * - `timeoutMs` — таймаут одного HTTP-запроса;
733
- * - `allowPrivateTargets` — разрешить http и приватные/loopback адреса (для dev;
734
- * по умолчанию `false` — только https и публичные адреса, защита от SSRF);
735
948
  * - `deliveryRetentionDays` — срок хранения журнала доставок (0 — без ограничения).
949
+ *
950
+ * Политика egress (https/приватные адреса) вынесена в `egress.webhooks`
951
+ * (`mode: 'off'` заменяет удалённый `allowPrivateTargets`).
736
952
  */
737
953
  export declare const webhooksConfigSchema: z.ZodObject<{
738
954
  enabled: z.ZodDefault<z.ZodBoolean>;
739
955
  maxAttempts: z.ZodDefault<z.ZodNumber>;
740
956
  timeoutMs: z.ZodDefault<z.ZodNumber>;
741
- allowPrivateTargets: z.ZodDefault<z.ZodBoolean>;
742
957
  deliveryRetentionDays: z.ZodDefault<z.ZodNumber>;
743
958
  }, "strip", z.ZodTypeAny, {
744
959
  enabled: boolean;
745
960
  maxAttempts: number;
746
961
  timeoutMs: number;
747
- allowPrivateTargets: boolean;
748
962
  deliveryRetentionDays: number;
749
963
  }, {
750
964
  enabled?: boolean | undefined;
751
965
  maxAttempts?: number | undefined;
752
966
  timeoutMs?: number | undefined;
753
- allowPrivateTargets?: boolean | undefined;
754
967
  deliveryRetentionDays?: number | undefined;
755
968
  }>;
969
+ /** Общий формат политики egress (`mode` + `list` + `exceptions`). */
970
+ export declare const egressPolicySchema: z.ZodObject<{
971
+ mode: z.ZodDefault<z.ZodEnum<["deny", "allow"]>>;
972
+ list: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
973
+ exceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
974
+ }, "strip", z.ZodTypeAny, {
975
+ mode: "allow" | "deny";
976
+ list: string[];
977
+ exceptions: string[];
978
+ }, {
979
+ mode?: "allow" | "deny" | undefined;
980
+ list?: string[] | undefined;
981
+ exceptions?: string[] | undefined;
982
+ }>;
983
+ /** Политика webhooks: дополнительно `off` (dev — без проверок и без https). */
984
+ export declare const webhooksEgressPolicySchema: z.ZodObject<{
985
+ mode: z.ZodDefault<z.ZodEnum<["deny", "allow", "off"]>>;
986
+ list: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
987
+ exceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
988
+ }, "strip", z.ZodTypeAny, {
989
+ mode: "allow" | "deny" | "off";
990
+ list: string[];
991
+ exceptions: string[];
992
+ }, {
993
+ mode?: "allow" | "deny" | "off" | undefined;
994
+ list?: string[] | undefined;
995
+ exceptions?: string[] | undefined;
996
+ }>;
997
+ export declare const egressLogConfigSchema: z.ZodObject<{
998
+ enabled: z.ZodDefault<z.ZodBoolean>;
999
+ retentionDays: z.ZodDefault<z.ZodNumber>;
1000
+ }, "strip", z.ZodTypeAny, {
1001
+ enabled: boolean;
1002
+ retentionDays: number;
1003
+ }, {
1004
+ enabled?: boolean | undefined;
1005
+ retentionDays?: number | undefined;
1006
+ }>;
1007
+ /**
1008
+ * `egress` — настраиваемая политика исходящих запросов (tools/webhooks) и
1009
+ * журнал внешних запросов. `mcp.networkPolicy` остаётся отдельным ключом, но
1010
+ * использует тот же формат (mode `deny|allow` + `exceptions`).
1011
+ */
1012
+ export declare const egressConfigSchema: z.ZodObject<{
1013
+ tools: z.ZodDefault<z.ZodObject<{
1014
+ mode: z.ZodDefault<z.ZodEnum<["deny", "allow"]>>;
1015
+ list: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1016
+ exceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1017
+ }, "strip", z.ZodTypeAny, {
1018
+ mode: "allow" | "deny";
1019
+ list: string[];
1020
+ exceptions: string[];
1021
+ }, {
1022
+ mode?: "allow" | "deny" | undefined;
1023
+ list?: string[] | undefined;
1024
+ exceptions?: string[] | undefined;
1025
+ }>>;
1026
+ webhooks: z.ZodDefault<z.ZodObject<{
1027
+ mode: z.ZodDefault<z.ZodEnum<["deny", "allow", "off"]>>;
1028
+ list: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1029
+ exceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1030
+ }, "strip", z.ZodTypeAny, {
1031
+ mode: "allow" | "deny" | "off";
1032
+ list: string[];
1033
+ exceptions: string[];
1034
+ }, {
1035
+ mode?: "allow" | "deny" | "off" | undefined;
1036
+ list?: string[] | undefined;
1037
+ exceptions?: string[] | undefined;
1038
+ }>>;
1039
+ log: z.ZodDefault<z.ZodObject<{
1040
+ enabled: z.ZodDefault<z.ZodBoolean>;
1041
+ retentionDays: z.ZodDefault<z.ZodNumber>;
1042
+ }, "strip", z.ZodTypeAny, {
1043
+ enabled: boolean;
1044
+ retentionDays: number;
1045
+ }, {
1046
+ enabled?: boolean | undefined;
1047
+ retentionDays?: number | undefined;
1048
+ }>>;
1049
+ }, "strip", z.ZodTypeAny, {
1050
+ tools: {
1051
+ mode: "allow" | "deny";
1052
+ list: string[];
1053
+ exceptions: string[];
1054
+ };
1055
+ webhooks: {
1056
+ mode: "allow" | "deny" | "off";
1057
+ list: string[];
1058
+ exceptions: string[];
1059
+ };
1060
+ log: {
1061
+ enabled: boolean;
1062
+ retentionDays: number;
1063
+ };
1064
+ }, {
1065
+ tools?: {
1066
+ mode?: "allow" | "deny" | undefined;
1067
+ list?: string[] | undefined;
1068
+ exceptions?: string[] | undefined;
1069
+ } | undefined;
1070
+ webhooks?: {
1071
+ mode?: "allow" | "deny" | "off" | undefined;
1072
+ list?: string[] | undefined;
1073
+ exceptions?: string[] | undefined;
1074
+ } | undefined;
1075
+ log?: {
1076
+ enabled?: boolean | undefined;
1077
+ retentionDays?: number | undefined;
1078
+ } | undefined;
1079
+ }>;
756
1080
  /**
757
- * AD-069 §3.4/§11: дополнительный источник проектных инструкций.
1081
+ * ADR-069 §3.4/§11: дополнительный источник проектных инструкций.
758
1082
  * `position` задаёт место в порядке: `before` — перед merged chain, `after` —
759
1083
  * после. `ttlSec` (только для URL) переопределяет `instructions.fetch.cacheTtlSec`.
760
1084
  */
@@ -778,7 +1102,7 @@ export declare const instructionSourceConfigSchema: z.ZodObject<{
778
1102
  ttlSec?: number | undefined;
779
1103
  }>;
780
1104
  /**
781
- * AD-069 §4: параметры lazy-догрузки подкаталогов (реализация — Фаза 2;
1105
+ * ADR-069 §4: параметры lazy-догрузки подкаталогов (реализация — Фаза 2;
782
1106
  * схема заводится в Фазе 1).
783
1107
  */
784
1108
  export declare const instructionsLazyConfigSchema: z.ZodObject<{
@@ -798,7 +1122,7 @@ export declare const instructionsLazyConfigSchema: z.ZodObject<{
798
1122
  excludeDirs?: string[] | undefined;
799
1123
  }>;
800
1124
  /**
801
- * AD-069 §5.1/§9.1: параметры fetch URL-источников (без фонового таймера —
1125
+ * ADR-069 §5.1/§9.1: параметры fetch URL-источников (без фонового таймера —
802
1126
  * загрузка при старте + TTL-кэш). Реализация fetch — Фаза 2.
803
1127
  */
804
1128
  export declare const instructionsFetchConfigSchema: z.ZodObject<{
@@ -815,7 +1139,7 @@ export declare const instructionsFetchConfigSchema: z.ZodObject<{
815
1139
  maxBytes?: number | undefined;
816
1140
  }>;
817
1141
  /**
818
- * AD-069 §5.1/§9.1: конфигурация проектных инструкций (`AGENTS.md` и совместимые).
1142
+ * ADR-069 §5.1/§9.1: конфигурация проектных инструкций (`AGENTS.md` и совместимые).
819
1143
  * Порядок: `sources` с `position: before` → merged chain (`git root → … → cwd`) →
820
1144
  * `sources` с `position: after`. Кап — динамический от окна модели.
821
1145
  */
@@ -976,7 +1300,7 @@ export declare const protectedPathsConfigSchema: z.ZodObject<{
976
1300
  enabled?: boolean | undefined;
977
1301
  }>;
978
1302
  /**
979
- * AD-052/O1: installer service-key, провижининг которого делается при старте из
1303
+ * ADR-052/O1: installer service-key, провижининг которого делается при старте из
980
1304
  * конфига/Secret (идемпотентно). `secret` — plaintext-секрет `synth_svc_…`
981
1305
  * (приходит из env/Secret; in config.yaml держать не рекомендуется). `scopes` —
982
1306
  * только известные (`serviceScopeSchema`); `roles` не заданы — дефолт хранилища.
@@ -985,40 +1309,78 @@ export declare const bootstrapServiceKeySchema: z.ZodObject<{
985
1309
  label: z.ZodString;
986
1310
  secret: z.ZodString;
987
1311
  scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
988
- roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof import("../types/index.js").GlobalRole>, "many">>;
1312
+ roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof import("../types/user.js").GlobalRole>, "many">>;
989
1313
  description: z.ZodOptional<z.ZodString>;
990
1314
  }, "strip", z.ZodTypeAny, {
991
1315
  label: string;
992
1316
  scopes: string[];
993
1317
  secret: string;
994
1318
  description?: string | undefined;
995
- roles?: import("../types/index.js").GlobalRole[] | undefined;
1319
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
996
1320
  }, {
997
1321
  label: string;
998
1322
  scopes: string[];
999
1323
  secret: string;
1000
1324
  description?: string | undefined;
1001
- roles?: import("../types/index.js").GlobalRole[] | undefined;
1325
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
1002
1326
  }>;
1003
1327
  export declare const bootstrapServiceKeysSchema: z.ZodArray<z.ZodObject<{
1004
1328
  label: z.ZodString;
1005
1329
  secret: z.ZodString;
1006
1330
  scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
1007
- roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof import("../types/index.js").GlobalRole>, "many">>;
1331
+ roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof import("../types/user.js").GlobalRole>, "many">>;
1008
1332
  description: z.ZodOptional<z.ZodString>;
1009
1333
  }, "strip", z.ZodTypeAny, {
1010
1334
  label: string;
1011
1335
  scopes: string[];
1012
1336
  secret: string;
1013
1337
  description?: string | undefined;
1014
- roles?: import("../types/index.js").GlobalRole[] | undefined;
1338
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
1015
1339
  }, {
1016
1340
  label: string;
1017
1341
  scopes: string[];
1018
1342
  secret: string;
1019
1343
  description?: string | undefined;
1020
- roles?: import("../types/index.js").GlobalRole[] | undefined;
1344
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
1021
1345
  }>, "many">;
1346
+ /**
1347
+ * ADR-099 (единый механизм доверия TLS/CA): секция `security.tls`.
1348
+ *
1349
+ * Задаёт доверие для **исходящих** соединений Synth (https-провайдеры, MCP,
1350
+ * webhooks, гибридный backend, OIDC, git, загрузка иконок/обновлений):
1351
+ * - `caFile` — путь к PEM-файлу с доверенным CA-сертификатом (корпоративный CA);
1352
+ * - `caPem` — сам PEM-сертификат (например из Secret) — **взаимоисключающ** с `caFile`;
1353
+ * - `certFile`/`keyFile` — клиентский сертификат и ключ (mTLS);
1354
+ * - `rejectUnauthorized` — проверять сертификат сервера (по умолчанию `true`).
1355
+ *
1356
+ * Читать эффективные значения через `resolveTlsConfig`/`resolveTlsTrust` (ADR-023:
1357
+ * env > config.yaml > defaults). Пусто — системное доверие (поведение не меняется).
1358
+ * Опционально — литеральные `SecurityConfig` без поля валидны.
1359
+ */
1360
+ export declare const securityTlsConfigSchema: z.ZodObject<{
1361
+ /** Путь к PEM-файлу доверенного CA. Взаимоисключающ с `caPem`. */
1362
+ caFile: z.ZodOptional<z.ZodString>;
1363
+ /** PEM доверенного CA (приоритетно над файлом; взаимоисключающ с `caFile`). */
1364
+ caPem: z.ZodOptional<z.ZodString>;
1365
+ /** Путь к PEM-файлу клиентского сертификата (mTLS). */
1366
+ certFile: z.ZodOptional<z.ZodString>;
1367
+ /** Путь к PEM-файлу приватного ключа клиента (mTLS). */
1368
+ keyFile: z.ZodOptional<z.ZodString>;
1369
+ /** Проверять сертификат сервера (по умолчанию `true`). */
1370
+ rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
1371
+ }, "strip", z.ZodTypeAny, {
1372
+ caFile?: string | undefined;
1373
+ caPem?: string | undefined;
1374
+ certFile?: string | undefined;
1375
+ keyFile?: string | undefined;
1376
+ rejectUnauthorized?: boolean | undefined;
1377
+ }, {
1378
+ caFile?: string | undefined;
1379
+ caPem?: string | undefined;
1380
+ certFile?: string | undefined;
1381
+ keyFile?: string | undefined;
1382
+ rejectUnauthorized?: boolean | undefined;
1383
+ }>;
1022
1384
  export declare const securityConfigSchema: z.ZodObject<{
1023
1385
  promptInjection: z.ZodDefault<z.ZodObject<{
1024
1386
  /** Глобальный выключатель защиты от Indirect Prompt Injection. */
@@ -1044,14 +1406,39 @@ export declare const securityConfigSchema: z.ZodObject<{
1044
1406
  }, {
1045
1407
  enabled?: boolean | undefined;
1046
1408
  }>>;
1409
+ /** ADR-099: единый механизм доверия TLS/CA для исходящих соединений. */
1410
+ tls: z.ZodOptional<z.ZodObject<{
1411
+ /** Путь к PEM-файлу доверенного CA. Взаимоисключающ с `caPem`. */
1412
+ caFile: z.ZodOptional<z.ZodString>;
1413
+ /** PEM доверенного CA (приоритетно над файлом; взаимоисключающ с `caFile`). */
1414
+ caPem: z.ZodOptional<z.ZodString>;
1415
+ /** Путь к PEM-файлу клиентского сертификата (mTLS). */
1416
+ certFile: z.ZodOptional<z.ZodString>;
1417
+ /** Путь к PEM-файлу приватного ключа клиента (mTLS). */
1418
+ keyFile: z.ZodOptional<z.ZodString>;
1419
+ /** Проверять сертификат сервера (по умолчанию `true`). */
1420
+ rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
1421
+ }, "strip", z.ZodTypeAny, {
1422
+ caFile?: string | undefined;
1423
+ caPem?: string | undefined;
1424
+ certFile?: string | undefined;
1425
+ keyFile?: string | undefined;
1426
+ rejectUnauthorized?: boolean | undefined;
1427
+ }, {
1428
+ caFile?: string | undefined;
1429
+ caPem?: string | undefined;
1430
+ certFile?: string | undefined;
1431
+ keyFile?: string | undefined;
1432
+ rejectUnauthorized?: boolean | undefined;
1433
+ }>>;
1047
1434
  /**
1048
- * AD-076: мастер-ключ для шифрования секретов at-rest (SSH-ключи, AES-256-GCM).
1435
+ * ADR-076: мастер-ключ для шифрования секретов at-rest (SSH-ключи, AES-256-GCM).
1049
1436
  * Приоритет — env `SYNTH_SECRET_KEY` (читать через `resolveSecretKey`).
1050
1437
  * Пусто — core использует файл `{dataDir}/secrets/master.key`.
1051
1438
  */
1052
1439
  secretKey: z.ZodDefault<z.ZodString>;
1053
1440
  /**
1054
- * AD-052/O1: installer service-key'и, провижининг которых выполняется
1441
+ * ADR-052/O1: installer service-key'и, провижининг которых выполняется
1055
1442
  * идемпотентно при старте (core standalone и backend). Может задаваться
1056
1443
  * JSON-строкой через env `SYNTH_BOOTSTRAP_SERVICE_KEYS` (приоритетнее
1057
1444
  * config.yaml) — так секрет не попадает в файл конфигурации.
@@ -1061,20 +1448,20 @@ export declare const securityConfigSchema: z.ZodObject<{
1061
1448
  label: z.ZodString;
1062
1449
  secret: z.ZodString;
1063
1450
  scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
1064
- roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof import("../types/index.js").GlobalRole>, "many">>;
1451
+ roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof import("../types/user.js").GlobalRole>, "many">>;
1065
1452
  description: z.ZodOptional<z.ZodString>;
1066
1453
  }, "strip", z.ZodTypeAny, {
1067
1454
  label: string;
1068
1455
  scopes: string[];
1069
1456
  secret: string;
1070
1457
  description?: string | undefined;
1071
- roles?: import("../types/index.js").GlobalRole[] | undefined;
1458
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
1072
1459
  }, {
1073
1460
  label: string;
1074
1461
  scopes: string[];
1075
1462
  secret: string;
1076
1463
  description?: string | undefined;
1077
- roles?: import("../types/index.js").GlobalRole[] | undefined;
1464
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
1078
1465
  }>, "many">>;
1079
1466
  }, "strip", z.ZodTypeAny, {
1080
1467
  promptInjection: {
@@ -1086,12 +1473,19 @@ export declare const securityConfigSchema: z.ZodObject<{
1086
1473
  enabled: boolean;
1087
1474
  };
1088
1475
  secretKey: string;
1476
+ tls?: {
1477
+ caFile?: string | undefined;
1478
+ caPem?: string | undefined;
1479
+ certFile?: string | undefined;
1480
+ keyFile?: string | undefined;
1481
+ rejectUnauthorized?: boolean | undefined;
1482
+ } | undefined;
1089
1483
  bootstrapServiceKeys?: {
1090
1484
  label: string;
1091
1485
  scopes: string[];
1092
1486
  secret: string;
1093
1487
  description?: string | undefined;
1094
- roles?: import("../types/index.js").GlobalRole[] | undefined;
1488
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
1095
1489
  }[] | undefined;
1096
1490
  }, {
1097
1491
  promptInjection?: {
@@ -1102,128 +1496,540 @@ export declare const securityConfigSchema: z.ZodObject<{
1102
1496
  protectedPaths?: {
1103
1497
  enabled?: boolean | undefined;
1104
1498
  } | undefined;
1499
+ tls?: {
1500
+ caFile?: string | undefined;
1501
+ caPem?: string | undefined;
1502
+ certFile?: string | undefined;
1503
+ keyFile?: string | undefined;
1504
+ rejectUnauthorized?: boolean | undefined;
1505
+ } | undefined;
1105
1506
  secretKey?: string | undefined;
1106
1507
  bootstrapServiceKeys?: {
1107
1508
  label: string;
1108
1509
  scopes: string[];
1109
1510
  secret: string;
1110
1511
  description?: string | undefined;
1111
- roles?: import("../types/index.js").GlobalRole[] | undefined;
1512
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
1112
1513
  }[] | undefined;
1113
1514
  }>;
1114
- export declare const llmGatewayRateLimitConfigSchema: z.ZodObject<{
1115
- userPerMinute: z.ZodDefault<z.ZodNumber>;
1116
- providerPerMinute: z.ZodDefault<z.ZodNumber>;
1515
+ /** Тип аутентификации прокси: D2a — только `basic` (NTLM/Negotiate — D3/D4). */
1516
+ export declare const PROXY_AUTH_TYPES: readonly ["basic", "ntlm", "negotiate"];
1517
+ export type ProxyAuthType = (typeof PROXY_AUTH_TYPES)[number];
1518
+ /**
1519
+ * Basic-аутентификация прокси (D2a). Пароль **не хранится в config**
1520
+ * (инвариант 13): только env `SYNTH_PROXY_PASSWORD` или файл
1521
+ * `{dataDir}/secrets/proxy-password`. Username также может быть в userinfo URL.
1522
+ */
1523
+ export declare const proxyAuthConfigSchema: z.ZodObject<{
1524
+ type: z.ZodDefault<z.ZodEnum<["basic", "ntlm", "negotiate"]>>;
1525
+ username: z.ZodDefault<z.ZodString>;
1117
1526
  }, "strip", z.ZodTypeAny, {
1118
- userPerMinute: number;
1119
- providerPerMinute: number;
1527
+ type: "basic" | "ntlm" | "negotiate";
1528
+ username: string;
1120
1529
  }, {
1121
- userPerMinute?: number | undefined;
1122
- providerPerMinute?: number | undefined;
1530
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1531
+ username?: string | undefined;
1123
1532
  }>;
1124
- export declare const llmGatewayAuditConfigSchema: z.ZodObject<{
1125
- enabled: z.ZodDefault<z.ZodBoolean>;
1126
- logPath: z.ZodDefault<z.ZodString>;
1533
+ /**
1534
+ * TLS к **самому прокси** (D2a) — схема как у `security.tls` (ADR-099):
1535
+ * `caFile`/`caPem` (взаимоисключающие), `certFile`/`keyFile` (mTLS к прокси),
1536
+ * `rejectUnauthorized`. Доверие к цели по-прежнему задаёт `security.tls`.
1537
+ */
1538
+ export declare const proxyTlsConfigSchema: z.ZodObject<{
1539
+ caFile: z.ZodOptional<z.ZodString>;
1540
+ caPem: z.ZodOptional<z.ZodString>;
1541
+ certFile: z.ZodOptional<z.ZodString>;
1542
+ keyFile: z.ZodOptional<z.ZodString>;
1543
+ rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
1127
1544
  }, "strip", z.ZodTypeAny, {
1128
- enabled: boolean;
1129
- logPath: string;
1545
+ caFile?: string | undefined;
1546
+ caPem?: string | undefined;
1547
+ certFile?: string | undefined;
1548
+ keyFile?: string | undefined;
1549
+ rejectUnauthorized?: boolean | undefined;
1130
1550
  }, {
1131
- enabled?: boolean | undefined;
1132
- logPath?: string | undefined;
1551
+ caFile?: string | undefined;
1552
+ caPem?: string | undefined;
1553
+ certFile?: string | undefined;
1554
+ keyFile?: string | undefined;
1555
+ rejectUnauthorized?: boolean | undefined;
1133
1556
  }>;
1134
- export declare const llmGatewayConfigSchema: z.ZodObject<{
1135
- /** Глобальный выключатель LLM Gateway. */
1136
- enabled: z.ZodDefault<z.ZodBoolean>;
1137
- /** Режим Input Guard: obfuscate (замена на плейсхолдер) | block (запрос блокируется). */
1138
- inputMode: z.ZodDefault<z.ZodEnum<["obfuscate", "block"]>>;
1139
- /** Полное логирование запросов и ответов LLM (после обфускации) в JSONL. */
1140
- logPayloads: z.ZodDefault<z.ZodBoolean>;
1141
- /** Путь к JSONL полного лога; по умолчанию {dataDir}/audit/llm-payloads.jsonl. */
1142
- payloadLogPath: z.ZodDefault<z.ZodString>;
1143
- rateLimit: z.ZodDefault<z.ZodObject<{
1144
- userPerMinute: z.ZodDefault<z.ZodNumber>;
1145
- providerPerMinute: z.ZodDefault<z.ZodNumber>;
1557
+ /** Режим маршрутизации прокси: `all` — default для всех, `selected` — только правила. */
1558
+ export declare const PROXY_MODES: readonly ["all", "selected"];
1559
+ export type ProxyMode = (typeof PROXY_MODES)[number];
1560
+ /** Имя профиля прокси: lower-case буква, далее `[a-z0-9_-]`, длина 1..32. */
1561
+ export declare const PROXY_PROFILE_NAME_RE: RegExp;
1562
+ export declare const proxyProfileNameSchema: z.ZodString;
1563
+ /**
1564
+ * Именованный профиль прокси (ADR-099, per-host маршрутизация).
1565
+ *
1566
+ * Набор URL-полей тот же, что у top-level legacy-конфига (`url` и/или
1567
+ * `httpProxy`/`httpsProxy`/`allProxy`); профиль обязан задавать хотя бы один URL
1568
+ * (проверяется резолвером). `auth` — только Basic; пароль в config не хранится —
1569
+ * env/файл: `SYNTH_PROXY_<PROFILE>_PASSWORD` / `{dataDir}/secrets/proxy/<profile>.password`
1570
+ * (для `default` — legacy `SYNTH_PROXY_PASSWORD` / `{dataDir}/secrets/proxy-password`).
1571
+ */
1572
+ export declare const proxyProfileSchema: z.ZodObject<{
1573
+ label: z.ZodOptional<z.ZodString>;
1574
+ url: z.ZodOptional<z.ZodString>;
1575
+ httpProxy: z.ZodOptional<z.ZodString>;
1576
+ httpsProxy: z.ZodOptional<z.ZodString>;
1577
+ allProxy: z.ZodOptional<z.ZodString>;
1578
+ auth: z.ZodOptional<z.ZodObject<{
1579
+ type: z.ZodDefault<z.ZodEnum<["basic", "ntlm", "negotiate"]>>;
1580
+ username: z.ZodDefault<z.ZodString>;
1146
1581
  }, "strip", z.ZodTypeAny, {
1147
- userPerMinute: number;
1148
- providerPerMinute: number;
1582
+ type: "basic" | "ntlm" | "negotiate";
1583
+ username: string;
1149
1584
  }, {
1150
- userPerMinute?: number | undefined;
1151
- providerPerMinute?: number | undefined;
1585
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1586
+ username?: string | undefined;
1152
1587
  }>>;
1153
- audit: z.ZodDefault<z.ZodObject<{
1154
- enabled: z.ZodDefault<z.ZodBoolean>;
1155
- logPath: z.ZodDefault<z.ZodString>;
1588
+ tls: z.ZodOptional<z.ZodObject<{
1589
+ caFile: z.ZodOptional<z.ZodString>;
1590
+ caPem: z.ZodOptional<z.ZodString>;
1591
+ certFile: z.ZodOptional<z.ZodString>;
1592
+ keyFile: z.ZodOptional<z.ZodString>;
1593
+ rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
1156
1594
  }, "strip", z.ZodTypeAny, {
1157
- enabled: boolean;
1158
- logPath: string;
1595
+ caFile?: string | undefined;
1596
+ caPem?: string | undefined;
1597
+ certFile?: string | undefined;
1598
+ keyFile?: string | undefined;
1599
+ rejectUnauthorized?: boolean | undefined;
1159
1600
  }, {
1160
- enabled?: boolean | undefined;
1161
- logPath?: string | undefined;
1601
+ caFile?: string | undefined;
1602
+ caPem?: string | undefined;
1603
+ certFile?: string | undefined;
1604
+ keyFile?: string | undefined;
1605
+ rejectUnauthorized?: boolean | undefined;
1162
1606
  }>>;
1163
1607
  }, "strip", z.ZodTypeAny, {
1164
- enabled: boolean;
1165
- inputMode: "block" | "obfuscate";
1166
- logPayloads: boolean;
1167
- payloadLogPath: string;
1168
- rateLimit: {
1169
- userPerMinute: number;
1170
- providerPerMinute: number;
1171
- };
1172
- audit: {
1173
- enabled: boolean;
1174
- logPath: string;
1175
- };
1608
+ url?: string | undefined;
1609
+ label?: string | undefined;
1610
+ tls?: {
1611
+ caFile?: string | undefined;
1612
+ caPem?: string | undefined;
1613
+ certFile?: string | undefined;
1614
+ keyFile?: string | undefined;
1615
+ rejectUnauthorized?: boolean | undefined;
1616
+ } | undefined;
1617
+ httpProxy?: string | undefined;
1618
+ httpsProxy?: string | undefined;
1619
+ allProxy?: string | undefined;
1620
+ auth?: {
1621
+ type: "basic" | "ntlm" | "negotiate";
1622
+ username: string;
1623
+ } | undefined;
1176
1624
  }, {
1177
- enabled?: boolean | undefined;
1178
- inputMode?: "block" | "obfuscate" | undefined;
1179
- logPayloads?: boolean | undefined;
1180
- payloadLogPath?: string | undefined;
1181
- rateLimit?: {
1182
- userPerMinute?: number | undefined;
1183
- providerPerMinute?: number | undefined;
1625
+ url?: string | undefined;
1626
+ label?: string | undefined;
1627
+ tls?: {
1628
+ caFile?: string | undefined;
1629
+ caPem?: string | undefined;
1630
+ certFile?: string | undefined;
1631
+ keyFile?: string | undefined;
1632
+ rejectUnauthorized?: boolean | undefined;
1184
1633
  } | undefined;
1185
- audit?: {
1186
- enabled?: boolean | undefined;
1187
- logPath?: string | undefined;
1634
+ httpProxy?: string | undefined;
1635
+ httpsProxy?: string | undefined;
1636
+ allProxy?: string | undefined;
1637
+ auth?: {
1638
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1639
+ username?: string | undefined;
1188
1640
  } | undefined;
1189
1641
  }>;
1190
- export declare const routerContentConfigSchema: z.ZodObject<{
1191
- coding: z.ZodDefault<z.ZodObject<{
1192
- provider: z.ZodDefault<z.ZodString>;
1193
- model: z.ZodDefault<z.ZodString>;
1194
- }, "strip", z.ZodTypeAny, {
1195
- provider: string;
1196
- model: string;
1197
- }, {
1198
- provider?: string | undefined;
1199
- model?: string | undefined;
1200
- }>>;
1201
- chat: z.ZodDefault<z.ZodObject<{
1202
- provider: z.ZodDefault<z.ZodString>;
1203
- model: z.ZodDefault<z.ZodString>;
1204
- }, "strip", z.ZodTypeAny, {
1205
- provider: string;
1206
- model: string;
1207
- }, {
1208
- provider?: string | undefined;
1209
- model?: string | undefined;
1210
- }>>;
1211
- research: z.ZodDefault<z.ZodObject<{
1212
- provider: z.ZodDefault<z.ZodString>;
1213
- model: z.ZodDefault<z.ZodString>;
1214
- }, "strip", z.ZodTypeAny, {
1215
- provider: string;
1216
- model: string;
1642
+ /** Действие правила маршрутизации: через прокси либо напрямую. */
1643
+ export declare const proxyRuleActionSchema: z.ZodEnum<["proxy", "direct"]>;
1644
+ /**
1645
+ * Правило маршрутизации по хосту (порядок = приоритет, первое совпадение).
1646
+ * `hosts` — exact, `.suffix` (apex+sub), `*.suffix` (sub), `host:port`, IP, CIDR, `*`.
1647
+ * `action: direct` несовместим с `profile`.
1648
+ */
1649
+ export declare const proxyRuleSchema: z.ZodObject<{
1650
+ id: z.ZodOptional<z.ZodString>;
1651
+ label: z.ZodOptional<z.ZodString>;
1652
+ hosts: z.ZodArray<z.ZodString, "many">;
1653
+ action: z.ZodEnum<["proxy", "direct"]>;
1654
+ profile: z.ZodOptional<z.ZodString>;
1655
+ }, "strip", z.ZodTypeAny, {
1656
+ hosts: string[];
1657
+ action: "proxy" | "direct";
1658
+ id?: string | undefined;
1659
+ label?: string | undefined;
1660
+ profile?: string | undefined;
1661
+ }, {
1662
+ hosts: string[];
1663
+ action: "proxy" | "direct";
1664
+ id?: string | undefined;
1665
+ label?: string | undefined;
1666
+ profile?: string | undefined;
1667
+ }>;
1668
+ /**
1669
+ * ADR-099 (D1/D2a): HTTP/HTTPS-прокси единого egress-слоя.
1670
+ *
1671
+ * - `enabled` — явный выключатель; **не задан** — прокси включается наличием
1672
+ * URL (в т.ч. из стандартных env при `fromEnv`); явный `false` подавляет
1673
+ * стандартные `HTTP_PROXY`/… (прокси не включается «из окружения»);
1674
+ * - `url` + `httpProxy`/`httpsProxy`/`allProxy` — URL прокси (`http`/`https`;
1675
+ * userinfo допускается, креды вырезаются в resolved-конфиг; SOCKS5 — D2b);
1676
+ * - `auth` — Basic-аутентификация (`username`; пароль — env/файл, не config);
1677
+ * - `tls` — TLS/mTLS к самому прокси (`proxyTls`);
1678
+ * - `noProxy` — исключения (host, `.suffix`, `*.suffix`, `host:port`, IP, CIDR, `*`);
1679
+ * - `fromEnv` — учитывать стандартные `HTTP_PROXY`/`HTTPS_PROXY`/`ALL_PROXY`/`NO_PROXY`;
1680
+ * - `fallbackDirect` — явный opt-in: при недоступном прокси идти напрямую (warn);
1681
+ * - `connectTimeoutMs` — таймаут соединения с прокси.
1682
+ *
1683
+ * Эффективные значения — `resolveProxyConfig` (`config/proxy.ts`), приоритет
1684
+ * `SYNTH_PROXY_*` > config.yaml > стандартные env > defaults (ADR-023).
1685
+ */
1686
+ export declare const proxyConfigSchema: z.ZodObject<{
1687
+ enabled: z.ZodOptional<z.ZodBoolean>;
1688
+ /**
1689
+ * Per-host маршрутизация: `all` — `defaultProfile` для всех, кроме `noProxy`
1690
+ * (правила могут переопределить); `selected` — только правила, остальное напрямую.
1691
+ */
1692
+ mode: z.ZodDefault<z.ZodEnum<["all", "selected"]>>;
1693
+ /** Профиль для `mode: all` и правил без явного `profile` (по умолчанию `default`). */
1694
+ defaultProfile: z.ZodOptional<z.ZodString>;
1695
+ /** Именованные профили. При наличии top-level URL/auth/tls запрещены. */
1696
+ profiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1697
+ label: z.ZodOptional<z.ZodString>;
1698
+ url: z.ZodOptional<z.ZodString>;
1699
+ httpProxy: z.ZodOptional<z.ZodString>;
1700
+ httpsProxy: z.ZodOptional<z.ZodString>;
1701
+ allProxy: z.ZodOptional<z.ZodString>;
1702
+ auth: z.ZodOptional<z.ZodObject<{
1703
+ type: z.ZodDefault<z.ZodEnum<["basic", "ntlm", "negotiate"]>>;
1704
+ username: z.ZodDefault<z.ZodString>;
1705
+ }, "strip", z.ZodTypeAny, {
1706
+ type: "basic" | "ntlm" | "negotiate";
1707
+ username: string;
1708
+ }, {
1709
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1710
+ username?: string | undefined;
1711
+ }>>;
1712
+ tls: z.ZodOptional<z.ZodObject<{
1713
+ caFile: z.ZodOptional<z.ZodString>;
1714
+ caPem: z.ZodOptional<z.ZodString>;
1715
+ certFile: z.ZodOptional<z.ZodString>;
1716
+ keyFile: z.ZodOptional<z.ZodString>;
1717
+ rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
1718
+ }, "strip", z.ZodTypeAny, {
1719
+ caFile?: string | undefined;
1720
+ caPem?: string | undefined;
1721
+ certFile?: string | undefined;
1722
+ keyFile?: string | undefined;
1723
+ rejectUnauthorized?: boolean | undefined;
1724
+ }, {
1725
+ caFile?: string | undefined;
1726
+ caPem?: string | undefined;
1727
+ certFile?: string | undefined;
1728
+ keyFile?: string | undefined;
1729
+ rejectUnauthorized?: boolean | undefined;
1730
+ }>>;
1731
+ }, "strip", z.ZodTypeAny, {
1732
+ url?: string | undefined;
1733
+ label?: string | undefined;
1734
+ tls?: {
1735
+ caFile?: string | undefined;
1736
+ caPem?: string | undefined;
1737
+ certFile?: string | undefined;
1738
+ keyFile?: string | undefined;
1739
+ rejectUnauthorized?: boolean | undefined;
1740
+ } | undefined;
1741
+ httpProxy?: string | undefined;
1742
+ httpsProxy?: string | undefined;
1743
+ allProxy?: string | undefined;
1744
+ auth?: {
1745
+ type: "basic" | "ntlm" | "negotiate";
1746
+ username: string;
1747
+ } | undefined;
1748
+ }, {
1749
+ url?: string | undefined;
1750
+ label?: string | undefined;
1751
+ tls?: {
1752
+ caFile?: string | undefined;
1753
+ caPem?: string | undefined;
1754
+ certFile?: string | undefined;
1755
+ keyFile?: string | undefined;
1756
+ rejectUnauthorized?: boolean | undefined;
1757
+ } | undefined;
1758
+ httpProxy?: string | undefined;
1759
+ httpsProxy?: string | undefined;
1760
+ allProxy?: string | undefined;
1761
+ auth?: {
1762
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1763
+ username?: string | undefined;
1764
+ } | undefined;
1765
+ }>>>;
1766
+ /** Правила маршрутизации (первое совпадение). */
1767
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
1768
+ id: z.ZodOptional<z.ZodString>;
1769
+ label: z.ZodOptional<z.ZodString>;
1770
+ hosts: z.ZodArray<z.ZodString, "many">;
1771
+ action: z.ZodEnum<["proxy", "direct"]>;
1772
+ profile: z.ZodOptional<z.ZodString>;
1773
+ }, "strip", z.ZodTypeAny, {
1774
+ hosts: string[];
1775
+ action: "proxy" | "direct";
1776
+ id?: string | undefined;
1777
+ label?: string | undefined;
1778
+ profile?: string | undefined;
1779
+ }, {
1780
+ hosts: string[];
1781
+ action: "proxy" | "direct";
1782
+ id?: string | undefined;
1783
+ label?: string | undefined;
1784
+ profile?: string | undefined;
1785
+ }>, "many">>;
1786
+ url: z.ZodOptional<z.ZodString>;
1787
+ httpProxy: z.ZodOptional<z.ZodString>;
1788
+ httpsProxy: z.ZodOptional<z.ZodString>;
1789
+ allProxy: z.ZodOptional<z.ZodString>;
1790
+ auth: z.ZodOptional<z.ZodObject<{
1791
+ type: z.ZodDefault<z.ZodEnum<["basic", "ntlm", "negotiate"]>>;
1792
+ username: z.ZodDefault<z.ZodString>;
1793
+ }, "strip", z.ZodTypeAny, {
1794
+ type: "basic" | "ntlm" | "negotiate";
1795
+ username: string;
1796
+ }, {
1797
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1798
+ username?: string | undefined;
1799
+ }>>;
1800
+ tls: z.ZodOptional<z.ZodObject<{
1801
+ caFile: z.ZodOptional<z.ZodString>;
1802
+ caPem: z.ZodOptional<z.ZodString>;
1803
+ certFile: z.ZodOptional<z.ZodString>;
1804
+ keyFile: z.ZodOptional<z.ZodString>;
1805
+ rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
1806
+ }, "strip", z.ZodTypeAny, {
1807
+ caFile?: string | undefined;
1808
+ caPem?: string | undefined;
1809
+ certFile?: string | undefined;
1810
+ keyFile?: string | undefined;
1811
+ rejectUnauthorized?: boolean | undefined;
1812
+ }, {
1813
+ caFile?: string | undefined;
1814
+ caPem?: string | undefined;
1815
+ certFile?: string | undefined;
1816
+ keyFile?: string | undefined;
1817
+ rejectUnauthorized?: boolean | undefined;
1818
+ }>>;
1819
+ noProxy: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1820
+ fromEnv: z.ZodDefault<z.ZodBoolean>;
1821
+ fallbackDirect: z.ZodDefault<z.ZodBoolean>;
1822
+ connectTimeoutMs: z.ZodDefault<z.ZodNumber>;
1823
+ }, "strip", z.ZodTypeAny, {
1824
+ mode: "all" | "selected";
1825
+ noProxy: string[];
1826
+ fromEnv: boolean;
1827
+ fallbackDirect: boolean;
1828
+ connectTimeoutMs: number;
1829
+ rules?: {
1830
+ hosts: string[];
1831
+ action: "proxy" | "direct";
1832
+ id?: string | undefined;
1833
+ label?: string | undefined;
1834
+ profile?: string | undefined;
1835
+ }[] | undefined;
1836
+ url?: string | undefined;
1837
+ enabled?: boolean | undefined;
1838
+ tls?: {
1839
+ caFile?: string | undefined;
1840
+ caPem?: string | undefined;
1841
+ certFile?: string | undefined;
1842
+ keyFile?: string | undefined;
1843
+ rejectUnauthorized?: boolean | undefined;
1844
+ } | undefined;
1845
+ httpProxy?: string | undefined;
1846
+ httpsProxy?: string | undefined;
1847
+ allProxy?: string | undefined;
1848
+ auth?: {
1849
+ type: "basic" | "ntlm" | "negotiate";
1850
+ username: string;
1851
+ } | undefined;
1852
+ defaultProfile?: string | undefined;
1853
+ profiles?: Record<string, {
1854
+ url?: string | undefined;
1855
+ label?: string | undefined;
1856
+ tls?: {
1857
+ caFile?: string | undefined;
1858
+ caPem?: string | undefined;
1859
+ certFile?: string | undefined;
1860
+ keyFile?: string | undefined;
1861
+ rejectUnauthorized?: boolean | undefined;
1862
+ } | undefined;
1863
+ httpProxy?: string | undefined;
1864
+ httpsProxy?: string | undefined;
1865
+ allProxy?: string | undefined;
1866
+ auth?: {
1867
+ type: "basic" | "ntlm" | "negotiate";
1868
+ username: string;
1869
+ } | undefined;
1870
+ }> | undefined;
1871
+ }, {
1872
+ rules?: {
1873
+ hosts: string[];
1874
+ action: "proxy" | "direct";
1875
+ id?: string | undefined;
1876
+ label?: string | undefined;
1877
+ profile?: string | undefined;
1878
+ }[] | undefined;
1879
+ mode?: "all" | "selected" | undefined;
1880
+ url?: string | undefined;
1881
+ enabled?: boolean | undefined;
1882
+ tls?: {
1883
+ caFile?: string | undefined;
1884
+ caPem?: string | undefined;
1885
+ certFile?: string | undefined;
1886
+ keyFile?: string | undefined;
1887
+ rejectUnauthorized?: boolean | undefined;
1888
+ } | undefined;
1889
+ httpProxy?: string | undefined;
1890
+ httpsProxy?: string | undefined;
1891
+ allProxy?: string | undefined;
1892
+ auth?: {
1893
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1894
+ username?: string | undefined;
1895
+ } | undefined;
1896
+ defaultProfile?: string | undefined;
1897
+ profiles?: Record<string, {
1898
+ url?: string | undefined;
1899
+ label?: string | undefined;
1900
+ tls?: {
1901
+ caFile?: string | undefined;
1902
+ caPem?: string | undefined;
1903
+ certFile?: string | undefined;
1904
+ keyFile?: string | undefined;
1905
+ rejectUnauthorized?: boolean | undefined;
1906
+ } | undefined;
1907
+ httpProxy?: string | undefined;
1908
+ httpsProxy?: string | undefined;
1909
+ allProxy?: string | undefined;
1910
+ auth?: {
1911
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1912
+ username?: string | undefined;
1913
+ } | undefined;
1914
+ }> | undefined;
1915
+ noProxy?: string[] | undefined;
1916
+ fromEnv?: boolean | undefined;
1917
+ fallbackDirect?: boolean | undefined;
1918
+ connectTimeoutMs?: number | undefined;
1919
+ }>;
1920
+ export declare const llmGatewayRateLimitConfigSchema: z.ZodObject<{
1921
+ userPerMinute: z.ZodDefault<z.ZodNumber>;
1922
+ providerPerMinute: z.ZodDefault<z.ZodNumber>;
1923
+ }, "strip", z.ZodTypeAny, {
1924
+ userPerMinute: number;
1925
+ providerPerMinute: number;
1926
+ }, {
1927
+ userPerMinute?: number | undefined;
1928
+ providerPerMinute?: number | undefined;
1929
+ }>;
1930
+ export declare const llmGatewayAuditConfigSchema: z.ZodObject<{
1931
+ enabled: z.ZodDefault<z.ZodBoolean>;
1932
+ logPath: z.ZodDefault<z.ZodString>;
1933
+ }, "strip", z.ZodTypeAny, {
1934
+ enabled: boolean;
1935
+ logPath: string;
1936
+ }, {
1937
+ enabled?: boolean | undefined;
1938
+ logPath?: string | undefined;
1939
+ }>;
1940
+ export declare const llmGatewayConfigSchema: z.ZodObject<{
1941
+ /** Глобальный выключатель LLM Gateway. */
1942
+ enabled: z.ZodDefault<z.ZodBoolean>;
1943
+ /** Режим Input Guard: obfuscate (замена на плейсхолдер) | block (запрос блокируется). */
1944
+ inputMode: z.ZodDefault<z.ZodEnum<["obfuscate", "block"]>>;
1945
+ /** Полное логирование запросов и ответов LLM (после обфускации) в JSONL. */
1946
+ logPayloads: z.ZodDefault<z.ZodBoolean>;
1947
+ /** Путь к JSONL полного лога; по умолчанию {dataDir}/audit/llm-payloads.jsonl. */
1948
+ payloadLogPath: z.ZodDefault<z.ZodString>;
1949
+ rateLimit: z.ZodDefault<z.ZodObject<{
1950
+ userPerMinute: z.ZodDefault<z.ZodNumber>;
1951
+ providerPerMinute: z.ZodDefault<z.ZodNumber>;
1952
+ }, "strip", z.ZodTypeAny, {
1953
+ userPerMinute: number;
1954
+ providerPerMinute: number;
1955
+ }, {
1956
+ userPerMinute?: number | undefined;
1957
+ providerPerMinute?: number | undefined;
1958
+ }>>;
1959
+ audit: z.ZodDefault<z.ZodObject<{
1960
+ enabled: z.ZodDefault<z.ZodBoolean>;
1961
+ logPath: z.ZodDefault<z.ZodString>;
1962
+ }, "strip", z.ZodTypeAny, {
1963
+ enabled: boolean;
1964
+ logPath: string;
1965
+ }, {
1966
+ enabled?: boolean | undefined;
1967
+ logPath?: string | undefined;
1968
+ }>>;
1969
+ }, "strip", z.ZodTypeAny, {
1970
+ enabled: boolean;
1971
+ inputMode: "block" | "obfuscate";
1972
+ logPayloads: boolean;
1973
+ payloadLogPath: string;
1974
+ rateLimit: {
1975
+ userPerMinute: number;
1976
+ providerPerMinute: number;
1977
+ };
1978
+ audit: {
1979
+ enabled: boolean;
1980
+ logPath: string;
1981
+ };
1982
+ }, {
1983
+ enabled?: boolean | undefined;
1984
+ inputMode?: "block" | "obfuscate" | undefined;
1985
+ logPayloads?: boolean | undefined;
1986
+ payloadLogPath?: string | undefined;
1987
+ rateLimit?: {
1988
+ userPerMinute?: number | undefined;
1989
+ providerPerMinute?: number | undefined;
1990
+ } | undefined;
1991
+ audit?: {
1992
+ enabled?: boolean | undefined;
1993
+ logPath?: string | undefined;
1994
+ } | undefined;
1995
+ }>;
1996
+ export declare const routerContentConfigSchema: z.ZodObject<{
1997
+ coding: z.ZodDefault<z.ZodObject<{
1998
+ provider: z.ZodDefault<z.ZodString>;
1999
+ model: z.ZodDefault<z.ZodString>;
2000
+ }, "strip", z.ZodTypeAny, {
2001
+ provider: string;
2002
+ model: string;
2003
+ }, {
2004
+ provider?: string | undefined;
2005
+ model?: string | undefined;
2006
+ }>>;
2007
+ chat: z.ZodDefault<z.ZodObject<{
2008
+ provider: z.ZodDefault<z.ZodString>;
2009
+ model: z.ZodDefault<z.ZodString>;
2010
+ }, "strip", z.ZodTypeAny, {
2011
+ provider: string;
2012
+ model: string;
2013
+ }, {
2014
+ provider?: string | undefined;
2015
+ model?: string | undefined;
2016
+ }>>;
2017
+ research: z.ZodDefault<z.ZodObject<{
2018
+ provider: z.ZodDefault<z.ZodString>;
2019
+ model: z.ZodDefault<z.ZodString>;
2020
+ }, "strip", z.ZodTypeAny, {
2021
+ provider: string;
2022
+ model: string;
1217
2023
  }, {
1218
2024
  provider?: string | undefined;
1219
2025
  model?: string | undefined;
1220
2026
  }>>;
1221
2027
  }, "strip", z.ZodTypeAny, {
1222
- chat: {
2028
+ coding: {
1223
2029
  provider: string;
1224
2030
  model: string;
1225
2031
  };
1226
- coding: {
2032
+ chat: {
1227
2033
  provider: string;
1228
2034
  model: string;
1229
2035
  };
@@ -1232,11 +2038,11 @@ export declare const routerContentConfigSchema: z.ZodObject<{
1232
2038
  model: string;
1233
2039
  };
1234
2040
  }, {
1235
- chat?: {
2041
+ coding?: {
1236
2042
  provider?: string | undefined;
1237
2043
  model?: string | undefined;
1238
2044
  } | undefined;
1239
- coding?: {
2045
+ chat?: {
1240
2046
  provider?: string | undefined;
1241
2047
  model?: string | undefined;
1242
2048
  } | undefined;
@@ -1368,11 +2174,11 @@ export declare const routerConfigSchema: z.ZodObject<{
1368
2174
  model?: string | undefined;
1369
2175
  }>>;
1370
2176
  }, "strip", z.ZodTypeAny, {
1371
- chat: {
2177
+ coding: {
1372
2178
  provider: string;
1373
2179
  model: string;
1374
2180
  };
1375
- coding: {
2181
+ chat: {
1376
2182
  provider: string;
1377
2183
  model: string;
1378
2184
  };
@@ -1381,11 +2187,11 @@ export declare const routerConfigSchema: z.ZodObject<{
1381
2187
  model: string;
1382
2188
  };
1383
2189
  }, {
1384
- chat?: {
2190
+ coding?: {
1385
2191
  provider?: string | undefined;
1386
2192
  model?: string | undefined;
1387
2193
  } | undefined;
1388
- coding?: {
2194
+ chat?: {
1389
2195
  provider?: string | undefined;
1390
2196
  model?: string | undefined;
1391
2197
  } | undefined;
@@ -1452,13 +2258,17 @@ export declare const routerConfigSchema: z.ZodObject<{
1452
2258
  enabled?: boolean | undefined;
1453
2259
  }>>;
1454
2260
  }, "strip", z.ZodTypeAny, {
1455
- enabled: boolean;
2261
+ subagent: {
2262
+ provider: string;
2263
+ model: string;
2264
+ enabled: boolean;
2265
+ };
1456
2266
  content: {
1457
- chat: {
2267
+ coding: {
1458
2268
  provider: string;
1459
2269
  model: string;
1460
2270
  };
1461
- coding: {
2271
+ chat: {
1462
2272
  provider: string;
1463
2273
  model: string;
1464
2274
  };
@@ -1467,11 +2277,6 @@ export declare const routerConfigSchema: z.ZodObject<{
1467
2277
  model: string;
1468
2278
  };
1469
2279
  };
1470
- subagent: {
1471
- provider: string;
1472
- model: string;
1473
- enabled: boolean;
1474
- };
1475
2280
  cost: {
1476
2281
  enabled: boolean;
1477
2282
  cheapProvider: string;
@@ -1480,6 +2285,7 @@ export declare const routerConfigSchema: z.ZodObject<{
1480
2285
  expensiveModel: string;
1481
2286
  maxCheapTokens: number;
1482
2287
  };
2288
+ enabled: boolean;
1483
2289
  strategy: "auto" | "content" | "cost" | "content+cost";
1484
2290
  escalation: {
1485
2291
  enabled: boolean;
@@ -1490,13 +2296,17 @@ export declare const routerConfigSchema: z.ZodObject<{
1490
2296
  checks: ("min_length" | "constraint" | "self_check")[];
1491
2297
  };
1492
2298
  }, {
1493
- enabled?: boolean | undefined;
2299
+ subagent?: {
2300
+ provider?: string | undefined;
2301
+ model?: string | undefined;
2302
+ enabled?: boolean | undefined;
2303
+ } | undefined;
1494
2304
  content?: {
1495
- chat?: {
2305
+ coding?: {
1496
2306
  provider?: string | undefined;
1497
2307
  model?: string | undefined;
1498
2308
  } | undefined;
1499
- coding?: {
2309
+ chat?: {
1500
2310
  provider?: string | undefined;
1501
2311
  model?: string | undefined;
1502
2312
  } | undefined;
@@ -1505,11 +2315,6 @@ export declare const routerConfigSchema: z.ZodObject<{
1505
2315
  model?: string | undefined;
1506
2316
  } | undefined;
1507
2317
  } | undefined;
1508
- subagent?: {
1509
- provider?: string | undefined;
1510
- model?: string | undefined;
1511
- enabled?: boolean | undefined;
1512
- } | undefined;
1513
2318
  cost?: {
1514
2319
  enabled?: boolean | undefined;
1515
2320
  cheapProvider?: string | undefined;
@@ -1518,6 +2323,7 @@ export declare const routerConfigSchema: z.ZodObject<{
1518
2323
  expensiveModel?: string | undefined;
1519
2324
  maxCheapTokens?: number | undefined;
1520
2325
  } | undefined;
2326
+ enabled?: boolean | undefined;
1521
2327
  strategy?: "auto" | "content" | "cost" | "content+cost" | undefined;
1522
2328
  escalation?: {
1523
2329
  enabled?: boolean | undefined;
@@ -1576,7 +2382,7 @@ export declare const remoteConfigSchema: z.ZodObject<{
1576
2382
  issuer: string;
1577
2383
  clientId: string;
1578
2384
  };
1579
- llm: "server" | "local";
2385
+ llm: "local" | "server";
1580
2386
  worlds: {
1581
2387
  local: boolean;
1582
2388
  remote: boolean;
@@ -1592,7 +2398,7 @@ export declare const remoteConfigSchema: z.ZodObject<{
1592
2398
  issuer?: string | undefined;
1593
2399
  clientId?: string | undefined;
1594
2400
  } | undefined;
1595
- llm?: "server" | "local" | undefined;
2401
+ llm?: "local" | "server" | undefined;
1596
2402
  worlds?: {
1597
2403
  local?: boolean | undefined;
1598
2404
  remote?: boolean | undefined;
@@ -1618,25 +2424,140 @@ export declare const synthConfigSchema: z.ZodObject<{
1618
2424
  }>>;
1619
2425
  storage: z.ZodDefault<z.ZodObject<{
1620
2426
  dataDir: z.ZodDefault<z.ZodString>;
2427
+ /**
2428
+ * PROP-032: физический backend хранения. `file` — JSON-файлы с атомарной
2429
+ * записью tmp→rename (ADR-005, дефолт); `memory` — in-memory (энергонезависимо
2430
+ * НЕ сохраняется, для герметичных тестов); `postgres` — БД (драйвер —
2431
+ * in-tree опциональный пакет `@itphx/synth-storage-postgres`). Читать через
2432
+ * `resolveStorageBackend` (env `SYNTH_STORAGE_BACKEND` > это поле > `file`,
2433
+ * fail-closed на неизвестном явно заданном значении).
2434
+ *
2435
+ * Необязательно: частичные override-объекты (`{ dataDir, workspacesRoot, … }`)
2436
+ * остаются валидными, а дефолт `file` задают `defaults.ts`/`resolveStorageBackend`.
2437
+ */
2438
+ backend: z.ZodOptional<z.ZodEnum<["file", "memory", "postgres"]>>;
2439
+ /** PROP-032: параметры PostgreSQL-backend (используются при `backend: postgres`). */
2440
+ postgres: z.ZodDefault<z.ZodObject<{
2441
+ /** Полная строка подключения; задана — приоритетнее host/port/database/user. */
2442
+ dsn: z.ZodOptional<z.ZodString>;
2443
+ host: z.ZodOptional<z.ZodString>;
2444
+ port: z.ZodOptional<z.ZodNumber>;
2445
+ database: z.ZodOptional<z.ZodString>;
2446
+ user: z.ZodOptional<z.ZodString>;
2447
+ /** Схема БД (namespace таблиц). */
2448
+ schema: z.ZodOptional<z.ZodString>;
2449
+ /**
2450
+ * ADR-099/PROP-032: TLS-режим соединения с БД.
2451
+ * `disable` — без TLS; `require` — шифрование без проверки сертификата;
2452
+ * `verify-full` — проверка сертификата сервера по CA из `security.tls`.
2453
+ * `verify-ca` принимается как **алиас** `verify-full` (нормализуется с
2454
+ * предупреждением). **Не задано — прежнее поведение (`ssl: false`, без TLS)**,
2455
+ * чтобы не сломать dev/существующие установки (dev-сервер без TLS).
2456
+ * Читать/мапить — `resolvePostgresConfig` + `buildPostgresSslOptions`
2457
+ * (`resolve.ts`/`tls.ts`, core — `storage/storage-context.ts`).
2458
+ * TLS-параметры (`sslmode`/`sslrootcert`/…) **запрещены в `dsn`** — `pg`
2459
+ * накладывает DSN поверх конфига и молча перекрывает `ssl`.
2460
+ */
2461
+ sslmode: z.ZodOptional<z.ZodEnum<["disable", "require", "verify-full", "verify-ca"]>>;
2462
+ /**
2463
+ * Legacy-флаг TLS (`true`/`false`); используется, только если `sslmode` не
2464
+ * задан (обратная совместимость). Новые установки — через `sslmode`.
2465
+ */
2466
+ ssl: z.ZodOptional<z.ZodBoolean>;
2467
+ /** Максимальный размер пула соединений. */
2468
+ poolMax: z.ZodOptional<z.ZodNumber>;
2469
+ }, "strip", z.ZodTypeAny, {
2470
+ user?: string | undefined;
2471
+ database?: string | undefined;
2472
+ host?: string | undefined;
2473
+ port?: number | undefined;
2474
+ dsn?: string | undefined;
2475
+ schema?: string | undefined;
2476
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
2477
+ ssl?: boolean | undefined;
2478
+ poolMax?: number | undefined;
2479
+ }, {
2480
+ user?: string | undefined;
2481
+ database?: string | undefined;
2482
+ host?: string | undefined;
2483
+ port?: number | undefined;
2484
+ dsn?: string | undefined;
2485
+ schema?: string | undefined;
2486
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
2487
+ ssl?: boolean | undefined;
2488
+ poolMax?: number | undefined;
2489
+ }>>;
2490
+ /**
2491
+ * PROP-032 (волна 5): поведение при недоступности выбранного backend —
2492
+ * `fallback-file` (перейти на файловое хранилище в `fallbackDir`, default) |
2493
+ * `halt` (остановить старт). Читать через `resolveDegradedMode`
2494
+ * (приоритет env `SYNTH_DEGRADED_MODE` > это поле > `fallback-file`).
2495
+ */
2496
+ degradedMode: z.ZodDefault<z.ZodEnum<["fallback-file", "halt"]>>;
2497
+ /**
2498
+ * PROP-032 (волна 5): каталог файлового фоллбека при деградации.
2499
+ * `''` — не задано (эффективно `{dataDir}/fallback`), читать через
2500
+ * `resolveStorageFallbackDir` (приоритет env `SYNTH_STORAGE_FALLBACK_DIR` >
2501
+ * это поле > `{dataDir}/fallback`).
2502
+ */
2503
+ fallbackDir: z.ZodDefault<z.ZodString>;
1621
2504
  workspacesRoot: z.ZodDefault<z.ZodString>;
1622
2505
  /** Рабочий каталог по умолчанию для сессий без проекта. Резолвится от dataDir: {dataDir}/workspaces/default. */
1623
2506
  defaultWorkspace: z.ZodDefault<z.ZodString>;
1624
2507
  /**
1625
- * AD-075: политика для абсолютного `project.workspace` вне `workspacesRoot`
2508
+ * ADR-075: политика для абсолютного `project.workspace` вне `workspacesRoot`
1626
2509
  * (`confirm` — подтверждение, `deny` — запрет). `''` — не задано (эффективно
1627
2510
  * `confirm`), читать через `resolveWorkspaceOutsideRootPolicy`.
1628
2511
  */
1629
2512
  workspaceOutsideRoot: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["confirm", "deny"]>, z.ZodLiteral<"">]>>;
2513
+ /**
2514
+ * Максимальный размер загружаемого файла (`POST /api/v2/fs/upload`), в байтах.
2515
+ * Валидируется (положительное целое в границах `MIN_UPLOAD_BYTES`…
2516
+ * `MAX_UPLOAD_BYTES_LIMIT`), читать через `resolveMaxUploadBytes` (env
2517
+ * `SYNTH_MAX_UPLOAD_BYTES` > это поле > `DEFAULT_MAX_UPLOAD_BYTES`).
2518
+ * Не задано — резолвер подставляет `DEFAULT_MAX_UPLOAD_BYTES` (100 МиБ).
2519
+ */
2520
+ maxUploadBytes: z.ZodOptional<z.ZodNumber>;
1630
2521
  }, "strip", z.ZodTypeAny, {
1631
2522
  dataDir: string;
2523
+ postgres: {
2524
+ user?: string | undefined;
2525
+ database?: string | undefined;
2526
+ host?: string | undefined;
2527
+ port?: number | undefined;
2528
+ dsn?: string | undefined;
2529
+ schema?: string | undefined;
2530
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
2531
+ ssl?: boolean | undefined;
2532
+ poolMax?: number | undefined;
2533
+ };
2534
+ degradedMode: "fallback-file" | "halt";
2535
+ fallbackDir: string;
1632
2536
  workspacesRoot: string;
1633
2537
  defaultWorkspace: string;
1634
2538
  workspaceOutsideRoot: "" | "deny" | "confirm";
2539
+ backend?: "file" | "memory" | "postgres" | undefined;
2540
+ maxUploadBytes?: number | undefined;
1635
2541
  }, {
1636
2542
  dataDir?: string | undefined;
2543
+ postgres?: {
2544
+ user?: string | undefined;
2545
+ database?: string | undefined;
2546
+ host?: string | undefined;
2547
+ port?: number | undefined;
2548
+ dsn?: string | undefined;
2549
+ schema?: string | undefined;
2550
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
2551
+ ssl?: boolean | undefined;
2552
+ poolMax?: number | undefined;
2553
+ } | undefined;
2554
+ backend?: "file" | "memory" | "postgres" | undefined;
2555
+ degradedMode?: "fallback-file" | "halt" | undefined;
2556
+ fallbackDir?: string | undefined;
1637
2557
  workspacesRoot?: string | undefined;
1638
2558
  defaultWorkspace?: string | undefined;
1639
2559
  workspaceOutsideRoot?: "" | "deny" | "confirm" | undefined;
2560
+ maxUploadBytes?: number | undefined;
1640
2561
  }>>;
1641
2562
  auth: z.ZodDefault<z.ZodObject<{
1642
2563
  debugMode: z.ZodDefault<z.ZodBoolean>;
@@ -1723,20 +2644,20 @@ export declare const synthConfigSchema: z.ZodObject<{
1723
2644
  defaultModel: z.ZodDefault<z.ZodString>;
1724
2645
  maxRetries: z.ZodDefault<z.ZodNumber>;
1725
2646
  timeout: z.ZodDefault<z.ZodNumber>;
1726
- /** AD-070 §2.2: политика prompt-cache — auto (ставить маркеры) | none (отключить). */
2647
+ /** ADR-070 §2.2: политика prompt-cache — auto (ставить маркеры) | none (отключить). */
1727
2648
  cache: z.ZodDefault<z.ZodEnum<["auto", "none"]>>;
1728
2649
  }, "strip", z.ZodTypeAny, {
1729
2650
  defaultProvider: string;
1730
2651
  defaultModel: string;
1731
2652
  maxRetries: number;
1732
2653
  timeout: number;
1733
- cache: "none" | "auto";
2654
+ cache: "auto" | "none";
1734
2655
  }, {
1735
2656
  defaultProvider?: string | undefined;
1736
2657
  defaultModel?: string | undefined;
1737
2658
  maxRetries?: number | undefined;
1738
2659
  timeout?: number | undefined;
1739
- cache?: "none" | "auto" | undefined;
2660
+ cache?: "auto" | "none" | undefined;
1740
2661
  }>>;
1741
2662
  core: z.ZodDefault<z.ZodObject<{
1742
2663
  port: z.ZodDefault<z.ZodNumber>;
@@ -1756,31 +2677,31 @@ export declare const synthConfigSchema: z.ZodObject<{
1756
2677
  cline: z.ZodDefault<z.ZodNumber>;
1757
2678
  synth: z.ZodDefault<z.ZodNumber>;
1758
2679
  }, "strip", z.ZodTypeAny, {
1759
- synth: number;
1760
2680
  opencode: number;
1761
2681
  cline: number;
2682
+ synth: number;
1762
2683
  }, {
1763
- synth?: number | undefined;
1764
2684
  opencode?: number | undefined;
1765
2685
  cline?: number | undefined;
2686
+ synth?: number | undefined;
1766
2687
  }>>;
1767
2688
  proxyPort: z.ZodDefault<z.ZodNumber>;
1768
2689
  }, "strip", z.ZodTypeAny, {
1769
2690
  port: number;
1770
2691
  backendUrl: string;
1771
2692
  enginePorts: {
1772
- synth: number;
1773
2693
  opencode: number;
1774
2694
  cline: number;
2695
+ synth: number;
1775
2696
  };
1776
2697
  proxyPort: number;
1777
2698
  }, {
1778
2699
  port?: number | undefined;
1779
2700
  backendUrl?: string | undefined;
1780
2701
  enginePorts?: {
1781
- synth?: number | undefined;
1782
2702
  opencode?: number | undefined;
1783
2703
  cline?: number | undefined;
2704
+ synth?: number | undefined;
1784
2705
  } | undefined;
1785
2706
  proxyPort?: number | undefined;
1786
2707
  }>>;
@@ -1864,7 +2785,7 @@ export declare const synthConfigSchema: z.ZodObject<{
1864
2785
  mcp: z.ZodDefault<z.ZodObject<{
1865
2786
  servers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1866
2787
  type: z.ZodEnum<["stdio", "sse", "http"]>;
1867
- /** AD-071 §2.2: человекочитаемое описание сервера (попадает в блок `mcp.servers`). */
2788
+ /** ADR-071 §2.2: человекочитаемое описание сервера (попадает в блок `mcp.servers`). */
1868
2789
  description: z.ZodOptional<z.ZodString>;
1869
2790
  command: z.ZodOptional<z.ZodString>;
1870
2791
  args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1912,15 +2833,19 @@ export declare const synthConfigSchema: z.ZodObject<{
1912
2833
  networkPolicy: z.ZodDefault<z.ZodObject<{
1913
2834
  mode: z.ZodDefault<z.ZodEnum<["allow", "deny"]>>;
1914
2835
  list: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2836
+ /** Allow-правила-исключения (общий формат с `egress.*`). */
2837
+ exceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1915
2838
  }, "strip", z.ZodTypeAny, {
1916
2839
  mode: "allow" | "deny";
1917
2840
  list: string[];
2841
+ exceptions: string[];
1918
2842
  }, {
1919
2843
  mode?: "allow" | "deny" | undefined;
1920
2844
  list?: string[] | undefined;
2845
+ exceptions?: string[] | undefined;
1921
2846
  }>>;
1922
2847
  /**
1923
- * AD-071 §2.3: глобальная админская политика включения **MCP**-инструментов.
2848
+ * ADR-071 §2.3: глобальная админская политика включения **MCP**-инструментов.
1924
2849
  * Независима от `tools.policy` (только встроенные). Per-session override —
1925
2850
  * `SessionSettings.mcpPolicy`.
1926
2851
  */
@@ -1943,6 +2868,7 @@ export declare const synthConfigSchema: z.ZodObject<{
1943
2868
  networkPolicy: {
1944
2869
  mode: "allow" | "deny";
1945
2870
  list: string[];
2871
+ exceptions: string[];
1946
2872
  };
1947
2873
  }, {
1948
2874
  policy?: "auto" | "consistency" | "available" | undefined;
@@ -1962,42 +2888,43 @@ export declare const synthConfigSchema: z.ZodObject<{
1962
2888
  networkPolicy?: {
1963
2889
  mode?: "allow" | "deny" | undefined;
1964
2890
  list?: string[] | undefined;
2891
+ exceptions?: string[] | undefined;
1965
2892
  } | undefined;
1966
2893
  }>>;
1967
2894
  tools: z.ZodDefault<z.ZodObject<{
1968
2895
  policy: z.ZodDefault<z.ZodEnum<["consistency", "available", "auto"]>>;
1969
- /** AD-071 §2.6: instance-wide отключение инструментов (admin). */
2896
+ /** ADR-071 §2.6: instance-wide отключение инструментов (admin). */
1970
2897
  disabled: z.ZodDefault<z.ZodObject<{
1971
2898
  capabilities: z.ZodDefault<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">> | z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1972
2899
  tools: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1973
2900
  }, "strip", z.ZodTypeAny, {
1974
- capabilities: string[];
1975
2901
  tools: string[];
2902
+ capabilities: string[];
1976
2903
  }, {
1977
- capabilities?: string[] | undefined;
1978
2904
  tools?: string[] | undefined;
2905
+ capabilities?: string[] | undefined;
1979
2906
  }>>;
1980
2907
  }, "strip", z.ZodTypeAny, {
1981
2908
  disabled: {
1982
- capabilities: string[];
1983
2909
  tools: string[];
2910
+ capabilities: string[];
1984
2911
  };
1985
2912
  policy: "auto" | "consistency" | "available";
1986
2913
  }, {
1987
2914
  disabled?: {
1988
- capabilities?: string[] | undefined;
1989
2915
  tools?: string[] | undefined;
2916
+ capabilities?: string[] | undefined;
1990
2917
  } | undefined;
1991
2918
  policy?: "auto" | "consistency" | "available" | undefined;
1992
2919
  }>>;
1993
2920
  skills: z.ZodDefault<z.ZodObject<{
1994
2921
  paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1995
- /** AD-046 §4.2/§4.3: удалённые каталоги — read-only индексация (`trusted: false`). */
2922
+ /** ADR-046 §4.2/§4.3: удалённые каталоги — read-only индексация (`trusted: false`). */
1996
2923
  urls: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1997
2924
  trustedProjectDirs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1998
2925
  inlineShell: z.ZodDefault<z.ZodBoolean>;
1999
2926
  /**
2000
- * AD-046 §3.2/§12: именованные группы тулов → capabilities. Используется
2927
+ * ADR-046 §3.2/§12: именованные группы тулов → capabilities. Используется
2001
2928
  * для экспансии `metadata.synth.requires_toolsets` в проверку доступности
2002
2929
  * скилла (union с `requires_capabilities`).
2003
2930
  */
@@ -2058,19 +2985,19 @@ export declare const synthConfigSchema: z.ZodObject<{
2058
2985
  dedupStore: z.ZodDefault<z.ZodEnum<["memory", "file"]>>;
2059
2986
  unknownAgentTemplate: z.ZodDefault<z.ZodEnum<["drop", "default-agent"]>>;
2060
2987
  /**
2061
- * Глобальный дефолт лимита запросов/мин на API-ключ привязки (AD-089/AD-052).
2988
+ * Глобальный дефолт лимита запросов/мин на API-ключ привязки (ADR-089/ADR-052).
2062
2989
  * `0` — без лимита; конкретный ключ может переопределить своим
2063
2990
  * `rateLimitPerMinute`.
2064
2991
  */
2065
2992
  keyRateLimitPerMinute: z.ZodDefault<z.ZodNumber>;
2066
2993
  /**
2067
- * AD-084 × AD-089: decision-маршрутизация внешних событий. По умолчанию
2994
+ * ADR-084 × ADR-089: decision-маршрутизация внешних событий. По умолчанию
2068
2995
  * выключена (поведение не меняется) — включение требует настроенного
2069
2996
  * decision-провайдера (`decision.enabled`).
2070
2997
  */
2071
2998
  decisionRouting: z.ZodDefault<z.ZodBoolean>;
2072
2999
  /**
2073
- * AD-089 (auto-bind): фоллбек Router — если у события есть `identity.chatKey`
3000
+ * ADR-089 (auto-bind): фоллбек Router — если у события есть `identity.chatKey`
2074
3001
  * или `identity.threadKey`, закрепить его за новой сессией (создать
2075
3002
  * `EventBinding` `mode='bound'`) вместо `defaultMode`. По умолчанию выключено
2076
3003
  * (поведение не меняется). Влияет **только** на фоллбек — явный binding,
@@ -2078,12 +3005,12 @@ export declare const synthConfigSchema: z.ZodObject<{
2078
3005
  */
2079
3006
  autoBind: z.ZodDefault<z.ZodBoolean>;
2080
3007
  /**
2081
- * AD-089 (auto-bind): шаблон агента для auto-bind-сессий (пусто — агент по
3008
+ * ADR-089 (auto-bind): шаблон агента для auto-bind-сессий (пусто — агент по
2082
3009
  * умолчанию; резолвится через `AgentRegistry` с политикой `unknownAgentTemplate`).
2083
3010
  */
2084
3011
  autoBindAgentTemplate: z.ZodDefault<z.ZodString>;
2085
3012
  /**
2086
- * AD-089: маппинг идентичности внешнего отправителя (`identity.chatKey` или
3013
+ * ADR-089: маппинг идентичности внешнего отправителя (`identity.chatKey` или
2087
3014
  * `identity.principalId`) на владельца синт-сессии (id пользователя
2088
3015
  * инстанса). Применяется при материализации `ephemeral`/`bind`; пусто —
2089
3016
  * владелец не переопределяется (аутентифицированный пользователь запроса,
@@ -2122,21 +3049,21 @@ export declare const synthConfigSchema: z.ZodObject<{
2122
3049
  tickSec: z.ZodDefault<z.ZodNumber>;
2123
3050
  catchUp: z.ZodDefault<z.ZodEnum<["skip", "once"]>>;
2124
3051
  jobRetentionDays: z.ZodDefault<z.ZodNumber>;
2125
- leaderElection: z.ZodDefault<z.ZodEnum<["none", "file"]>>;
3052
+ leaderElection: z.ZodDefault<z.ZodEnum<["none", "file", "postgres"]>>;
2126
3053
  crossProcessLocks: z.ZodDefault<z.ZodBoolean>;
2127
3054
  }, "strip", z.ZodTypeAny, {
2128
3055
  enabled: boolean;
2129
3056
  catchUp: "skip" | "once";
2130
3057
  tickSec: number;
2131
3058
  jobRetentionDays: number;
2132
- leaderElection: "file" | "none";
3059
+ leaderElection: "none" | "file" | "postgres";
2133
3060
  crossProcessLocks: boolean;
2134
3061
  }, {
2135
3062
  enabled?: boolean | undefined;
2136
3063
  catchUp?: "skip" | "once" | undefined;
2137
3064
  tickSec?: number | undefined;
2138
3065
  jobRetentionDays?: number | undefined;
2139
- leaderElection?: "file" | "none" | undefined;
3066
+ leaderElection?: "none" | "file" | "postgres" | undefined;
2140
3067
  crossProcessLocks?: boolean | undefined;
2141
3068
  }>>;
2142
3069
  decision: z.ZodDefault<z.ZodObject<{
@@ -2144,9 +3071,9 @@ export declare const synthConfigSchema: z.ZodObject<{
2144
3071
  provider: z.ZodDefault<z.ZodString>;
2145
3072
  model: z.ZodDefault<z.ZodString>;
2146
3073
  confidenceThreshold: z.ZodDefault<z.ZodNumber>;
2147
- /** AD-084: провайдер тира эскалации; пусто — эскалации нет. */
3074
+ /** ADR-084: провайдер тира эскалации; пусто — эскалации нет. */
2148
3075
  escalationProvider: z.ZodDefault<z.ZodString>;
2149
- /** AD-084: модель тира эскалации; пусто — эскалации нет. */
3076
+ /** ADR-084: модель тира эскалации; пусто — эскалации нет. */
2150
3077
  escalationModel: z.ZodDefault<z.ZodString>;
2151
3078
  }, "strip", z.ZodTypeAny, {
2152
3079
  provider: string;
@@ -2163,23 +3090,102 @@ export declare const synthConfigSchema: z.ZodObject<{
2163
3090
  escalationProvider?: string | undefined;
2164
3091
  escalationModel?: string | undefined;
2165
3092
  }>>;
3093
+ analytics: z.ZodDefault<z.ZodObject<{
3094
+ retentionDays: z.ZodDefault<z.ZodNumber>;
3095
+ }, "strip", z.ZodTypeAny, {
3096
+ retentionDays: number;
3097
+ }, {
3098
+ retentionDays?: number | undefined;
3099
+ }>>;
3100
+ metrics: z.ZodDefault<z.ZodObject<{
3101
+ enabled: z.ZodDefault<z.ZodBoolean>;
3102
+ }, "strip", z.ZodTypeAny, {
3103
+ enabled: boolean;
3104
+ }, {
3105
+ enabled?: boolean | undefined;
3106
+ }>>;
3107
+ egress: z.ZodDefault<z.ZodObject<{
3108
+ tools: z.ZodDefault<z.ZodObject<{
3109
+ mode: z.ZodDefault<z.ZodEnum<["deny", "allow"]>>;
3110
+ list: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3111
+ exceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3112
+ }, "strip", z.ZodTypeAny, {
3113
+ mode: "allow" | "deny";
3114
+ list: string[];
3115
+ exceptions: string[];
3116
+ }, {
3117
+ mode?: "allow" | "deny" | undefined;
3118
+ list?: string[] | undefined;
3119
+ exceptions?: string[] | undefined;
3120
+ }>>;
3121
+ webhooks: z.ZodDefault<z.ZodObject<{
3122
+ mode: z.ZodDefault<z.ZodEnum<["deny", "allow", "off"]>>;
3123
+ list: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3124
+ exceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3125
+ }, "strip", z.ZodTypeAny, {
3126
+ mode: "allow" | "deny" | "off";
3127
+ list: string[];
3128
+ exceptions: string[];
3129
+ }, {
3130
+ mode?: "allow" | "deny" | "off" | undefined;
3131
+ list?: string[] | undefined;
3132
+ exceptions?: string[] | undefined;
3133
+ }>>;
3134
+ log: z.ZodDefault<z.ZodObject<{
3135
+ enabled: z.ZodDefault<z.ZodBoolean>;
3136
+ retentionDays: z.ZodDefault<z.ZodNumber>;
3137
+ }, "strip", z.ZodTypeAny, {
3138
+ enabled: boolean;
3139
+ retentionDays: number;
3140
+ }, {
3141
+ enabled?: boolean | undefined;
3142
+ retentionDays?: number | undefined;
3143
+ }>>;
3144
+ }, "strip", z.ZodTypeAny, {
3145
+ tools: {
3146
+ mode: "allow" | "deny";
3147
+ list: string[];
3148
+ exceptions: string[];
3149
+ };
3150
+ webhooks: {
3151
+ mode: "allow" | "deny" | "off";
3152
+ list: string[];
3153
+ exceptions: string[];
3154
+ };
3155
+ log: {
3156
+ enabled: boolean;
3157
+ retentionDays: number;
3158
+ };
3159
+ }, {
3160
+ tools?: {
3161
+ mode?: "allow" | "deny" | undefined;
3162
+ list?: string[] | undefined;
3163
+ exceptions?: string[] | undefined;
3164
+ } | undefined;
3165
+ webhooks?: {
3166
+ mode?: "allow" | "deny" | "off" | undefined;
3167
+ list?: string[] | undefined;
3168
+ exceptions?: string[] | undefined;
3169
+ } | undefined;
3170
+ log?: {
3171
+ enabled?: boolean | undefined;
3172
+ retentionDays?: number | undefined;
3173
+ } | undefined;
3174
+ }>>;
2166
3175
  webhooks: z.ZodDefault<z.ZodObject<{
2167
3176
  enabled: z.ZodDefault<z.ZodBoolean>;
2168
3177
  maxAttempts: z.ZodDefault<z.ZodNumber>;
2169
3178
  timeoutMs: z.ZodDefault<z.ZodNumber>;
2170
- allowPrivateTargets: z.ZodDefault<z.ZodBoolean>;
2171
3179
  deliveryRetentionDays: z.ZodDefault<z.ZodNumber>;
2172
3180
  }, "strip", z.ZodTypeAny, {
2173
3181
  enabled: boolean;
2174
3182
  maxAttempts: number;
2175
3183
  timeoutMs: number;
2176
- allowPrivateTargets: boolean;
2177
3184
  deliveryRetentionDays: number;
2178
3185
  }, {
2179
3186
  enabled?: boolean | undefined;
2180
3187
  maxAttempts?: number | undefined;
2181
3188
  timeoutMs?: number | undefined;
2182
- allowPrivateTargets?: boolean | undefined;
2183
3189
  deliveryRetentionDays?: number | undefined;
2184
3190
  }>>;
2185
3191
  instructions: z.ZodDefault<z.ZodObject<{
@@ -2349,11 +3355,11 @@ export declare const synthConfigSchema: z.ZodObject<{
2349
3355
  model?: string | undefined;
2350
3356
  }>>;
2351
3357
  }, "strip", z.ZodTypeAny, {
2352
- chat: {
3358
+ coding: {
2353
3359
  provider: string;
2354
3360
  model: string;
2355
3361
  };
2356
- coding: {
3362
+ chat: {
2357
3363
  provider: string;
2358
3364
  model: string;
2359
3365
  };
@@ -2362,11 +3368,11 @@ export declare const synthConfigSchema: z.ZodObject<{
2362
3368
  model: string;
2363
3369
  };
2364
3370
  }, {
2365
- chat?: {
3371
+ coding?: {
2366
3372
  provider?: string | undefined;
2367
3373
  model?: string | undefined;
2368
3374
  } | undefined;
2369
- coding?: {
3375
+ chat?: {
2370
3376
  provider?: string | undefined;
2371
3377
  model?: string | undefined;
2372
3378
  } | undefined;
@@ -2433,13 +3439,17 @@ export declare const synthConfigSchema: z.ZodObject<{
2433
3439
  enabled?: boolean | undefined;
2434
3440
  }>>;
2435
3441
  }, "strip", z.ZodTypeAny, {
2436
- enabled: boolean;
3442
+ subagent: {
3443
+ provider: string;
3444
+ model: string;
3445
+ enabled: boolean;
3446
+ };
2437
3447
  content: {
2438
- chat: {
3448
+ coding: {
2439
3449
  provider: string;
2440
3450
  model: string;
2441
3451
  };
2442
- coding: {
3452
+ chat: {
2443
3453
  provider: string;
2444
3454
  model: string;
2445
3455
  };
@@ -2448,11 +3458,6 @@ export declare const synthConfigSchema: z.ZodObject<{
2448
3458
  model: string;
2449
3459
  };
2450
3460
  };
2451
- subagent: {
2452
- provider: string;
2453
- model: string;
2454
- enabled: boolean;
2455
- };
2456
3461
  cost: {
2457
3462
  enabled: boolean;
2458
3463
  cheapProvider: string;
@@ -2461,6 +3466,7 @@ export declare const synthConfigSchema: z.ZodObject<{
2461
3466
  expensiveModel: string;
2462
3467
  maxCheapTokens: number;
2463
3468
  };
3469
+ enabled: boolean;
2464
3470
  strategy: "auto" | "content" | "cost" | "content+cost";
2465
3471
  escalation: {
2466
3472
  enabled: boolean;
@@ -2471,13 +3477,17 @@ export declare const synthConfigSchema: z.ZodObject<{
2471
3477
  checks: ("min_length" | "constraint" | "self_check")[];
2472
3478
  };
2473
3479
  }, {
2474
- enabled?: boolean | undefined;
3480
+ subagent?: {
3481
+ provider?: string | undefined;
3482
+ model?: string | undefined;
3483
+ enabled?: boolean | undefined;
3484
+ } | undefined;
2475
3485
  content?: {
2476
- chat?: {
3486
+ coding?: {
2477
3487
  provider?: string | undefined;
2478
3488
  model?: string | undefined;
2479
3489
  } | undefined;
2480
- coding?: {
3490
+ chat?: {
2481
3491
  provider?: string | undefined;
2482
3492
  model?: string | undefined;
2483
3493
  } | undefined;
@@ -2486,28 +3496,258 @@ export declare const synthConfigSchema: z.ZodObject<{
2486
3496
  model?: string | undefined;
2487
3497
  } | undefined;
2488
3498
  } | undefined;
2489
- subagent?: {
2490
- provider?: string | undefined;
2491
- model?: string | undefined;
2492
- enabled?: boolean | undefined;
3499
+ cost?: {
3500
+ enabled?: boolean | undefined;
3501
+ cheapProvider?: string | undefined;
3502
+ cheapModel?: string | undefined;
3503
+ expensiveProvider?: string | undefined;
3504
+ expensiveModel?: string | undefined;
3505
+ maxCheapTokens?: number | undefined;
3506
+ } | undefined;
3507
+ enabled?: boolean | undefined;
3508
+ strategy?: "auto" | "content" | "cost" | "content+cost" | undefined;
3509
+ escalation?: {
3510
+ enabled?: boolean | undefined;
3511
+ minLength?: number | undefined;
3512
+ maxRetries?: number | undefined;
3513
+ fallbackProvider?: string | undefined;
3514
+ fallbackModel?: string | undefined;
3515
+ checks?: ("min_length" | "constraint" | "self_check")[] | undefined;
3516
+ } | undefined;
3517
+ }>>;
3518
+ proxy: z.ZodDefault<z.ZodObject<{
3519
+ enabled: z.ZodOptional<z.ZodBoolean>;
3520
+ /**
3521
+ * Per-host маршрутизация: `all` — `defaultProfile` для всех, кроме `noProxy`
3522
+ * (правила могут переопределить); `selected` — только правила, остальное напрямую.
3523
+ */
3524
+ mode: z.ZodDefault<z.ZodEnum<["all", "selected"]>>;
3525
+ /** Профиль для `mode: all` и правил без явного `profile` (по умолчанию `default`). */
3526
+ defaultProfile: z.ZodOptional<z.ZodString>;
3527
+ /** Именованные профили. При наличии top-level URL/auth/tls запрещены. */
3528
+ profiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3529
+ label: z.ZodOptional<z.ZodString>;
3530
+ url: z.ZodOptional<z.ZodString>;
3531
+ httpProxy: z.ZodOptional<z.ZodString>;
3532
+ httpsProxy: z.ZodOptional<z.ZodString>;
3533
+ allProxy: z.ZodOptional<z.ZodString>;
3534
+ auth: z.ZodOptional<z.ZodObject<{
3535
+ type: z.ZodDefault<z.ZodEnum<["basic", "ntlm", "negotiate"]>>;
3536
+ username: z.ZodDefault<z.ZodString>;
3537
+ }, "strip", z.ZodTypeAny, {
3538
+ type: "basic" | "ntlm" | "negotiate";
3539
+ username: string;
3540
+ }, {
3541
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
3542
+ username?: string | undefined;
3543
+ }>>;
3544
+ tls: z.ZodOptional<z.ZodObject<{
3545
+ caFile: z.ZodOptional<z.ZodString>;
3546
+ caPem: z.ZodOptional<z.ZodString>;
3547
+ certFile: z.ZodOptional<z.ZodString>;
3548
+ keyFile: z.ZodOptional<z.ZodString>;
3549
+ rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
3550
+ }, "strip", z.ZodTypeAny, {
3551
+ caFile?: string | undefined;
3552
+ caPem?: string | undefined;
3553
+ certFile?: string | undefined;
3554
+ keyFile?: string | undefined;
3555
+ rejectUnauthorized?: boolean | undefined;
3556
+ }, {
3557
+ caFile?: string | undefined;
3558
+ caPem?: string | undefined;
3559
+ certFile?: string | undefined;
3560
+ keyFile?: string | undefined;
3561
+ rejectUnauthorized?: boolean | undefined;
3562
+ }>>;
3563
+ }, "strip", z.ZodTypeAny, {
3564
+ url?: string | undefined;
3565
+ label?: string | undefined;
3566
+ tls?: {
3567
+ caFile?: string | undefined;
3568
+ caPem?: string | undefined;
3569
+ certFile?: string | undefined;
3570
+ keyFile?: string | undefined;
3571
+ rejectUnauthorized?: boolean | undefined;
3572
+ } | undefined;
3573
+ httpProxy?: string | undefined;
3574
+ httpsProxy?: string | undefined;
3575
+ allProxy?: string | undefined;
3576
+ auth?: {
3577
+ type: "basic" | "ntlm" | "negotiate";
3578
+ username: string;
3579
+ } | undefined;
3580
+ }, {
3581
+ url?: string | undefined;
3582
+ label?: string | undefined;
3583
+ tls?: {
3584
+ caFile?: string | undefined;
3585
+ caPem?: string | undefined;
3586
+ certFile?: string | undefined;
3587
+ keyFile?: string | undefined;
3588
+ rejectUnauthorized?: boolean | undefined;
3589
+ } | undefined;
3590
+ httpProxy?: string | undefined;
3591
+ httpsProxy?: string | undefined;
3592
+ allProxy?: string | undefined;
3593
+ auth?: {
3594
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
3595
+ username?: string | undefined;
3596
+ } | undefined;
3597
+ }>>>;
3598
+ /** Правила маршрутизации (первое совпадение). */
3599
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
3600
+ id: z.ZodOptional<z.ZodString>;
3601
+ label: z.ZodOptional<z.ZodString>;
3602
+ hosts: z.ZodArray<z.ZodString, "many">;
3603
+ action: z.ZodEnum<["proxy", "direct"]>;
3604
+ profile: z.ZodOptional<z.ZodString>;
3605
+ }, "strip", z.ZodTypeAny, {
3606
+ hosts: string[];
3607
+ action: "proxy" | "direct";
3608
+ id?: string | undefined;
3609
+ label?: string | undefined;
3610
+ profile?: string | undefined;
3611
+ }, {
3612
+ hosts: string[];
3613
+ action: "proxy" | "direct";
3614
+ id?: string | undefined;
3615
+ label?: string | undefined;
3616
+ profile?: string | undefined;
3617
+ }>, "many">>;
3618
+ url: z.ZodOptional<z.ZodString>;
3619
+ httpProxy: z.ZodOptional<z.ZodString>;
3620
+ httpsProxy: z.ZodOptional<z.ZodString>;
3621
+ allProxy: z.ZodOptional<z.ZodString>;
3622
+ auth: z.ZodOptional<z.ZodObject<{
3623
+ type: z.ZodDefault<z.ZodEnum<["basic", "ntlm", "negotiate"]>>;
3624
+ username: z.ZodDefault<z.ZodString>;
3625
+ }, "strip", z.ZodTypeAny, {
3626
+ type: "basic" | "ntlm" | "negotiate";
3627
+ username: string;
3628
+ }, {
3629
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
3630
+ username?: string | undefined;
3631
+ }>>;
3632
+ tls: z.ZodOptional<z.ZodObject<{
3633
+ caFile: z.ZodOptional<z.ZodString>;
3634
+ caPem: z.ZodOptional<z.ZodString>;
3635
+ certFile: z.ZodOptional<z.ZodString>;
3636
+ keyFile: z.ZodOptional<z.ZodString>;
3637
+ rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
3638
+ }, "strip", z.ZodTypeAny, {
3639
+ caFile?: string | undefined;
3640
+ caPem?: string | undefined;
3641
+ certFile?: string | undefined;
3642
+ keyFile?: string | undefined;
3643
+ rejectUnauthorized?: boolean | undefined;
3644
+ }, {
3645
+ caFile?: string | undefined;
3646
+ caPem?: string | undefined;
3647
+ certFile?: string | undefined;
3648
+ keyFile?: string | undefined;
3649
+ rejectUnauthorized?: boolean | undefined;
3650
+ }>>;
3651
+ noProxy: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3652
+ fromEnv: z.ZodDefault<z.ZodBoolean>;
3653
+ fallbackDirect: z.ZodDefault<z.ZodBoolean>;
3654
+ connectTimeoutMs: z.ZodDefault<z.ZodNumber>;
3655
+ }, "strip", z.ZodTypeAny, {
3656
+ mode: "all" | "selected";
3657
+ noProxy: string[];
3658
+ fromEnv: boolean;
3659
+ fallbackDirect: boolean;
3660
+ connectTimeoutMs: number;
3661
+ rules?: {
3662
+ hosts: string[];
3663
+ action: "proxy" | "direct";
3664
+ id?: string | undefined;
3665
+ label?: string | undefined;
3666
+ profile?: string | undefined;
3667
+ }[] | undefined;
3668
+ url?: string | undefined;
3669
+ enabled?: boolean | undefined;
3670
+ tls?: {
3671
+ caFile?: string | undefined;
3672
+ caPem?: string | undefined;
3673
+ certFile?: string | undefined;
3674
+ keyFile?: string | undefined;
3675
+ rejectUnauthorized?: boolean | undefined;
3676
+ } | undefined;
3677
+ httpProxy?: string | undefined;
3678
+ httpsProxy?: string | undefined;
3679
+ allProxy?: string | undefined;
3680
+ auth?: {
3681
+ type: "basic" | "ntlm" | "negotiate";
3682
+ username: string;
2493
3683
  } | undefined;
2494
- cost?: {
2495
- enabled?: boolean | undefined;
2496
- cheapProvider?: string | undefined;
2497
- cheapModel?: string | undefined;
2498
- expensiveProvider?: string | undefined;
2499
- expensiveModel?: string | undefined;
2500
- maxCheapTokens?: number | undefined;
3684
+ defaultProfile?: string | undefined;
3685
+ profiles?: Record<string, {
3686
+ url?: string | undefined;
3687
+ label?: string | undefined;
3688
+ tls?: {
3689
+ caFile?: string | undefined;
3690
+ caPem?: string | undefined;
3691
+ certFile?: string | undefined;
3692
+ keyFile?: string | undefined;
3693
+ rejectUnauthorized?: boolean | undefined;
3694
+ } | undefined;
3695
+ httpProxy?: string | undefined;
3696
+ httpsProxy?: string | undefined;
3697
+ allProxy?: string | undefined;
3698
+ auth?: {
3699
+ type: "basic" | "ntlm" | "negotiate";
3700
+ username: string;
3701
+ } | undefined;
3702
+ }> | undefined;
3703
+ }, {
3704
+ rules?: {
3705
+ hosts: string[];
3706
+ action: "proxy" | "direct";
3707
+ id?: string | undefined;
3708
+ label?: string | undefined;
3709
+ profile?: string | undefined;
3710
+ }[] | undefined;
3711
+ mode?: "all" | "selected" | undefined;
3712
+ url?: string | undefined;
3713
+ enabled?: boolean | undefined;
3714
+ tls?: {
3715
+ caFile?: string | undefined;
3716
+ caPem?: string | undefined;
3717
+ certFile?: string | undefined;
3718
+ keyFile?: string | undefined;
3719
+ rejectUnauthorized?: boolean | undefined;
2501
3720
  } | undefined;
2502
- strategy?: "auto" | "content" | "cost" | "content+cost" | undefined;
2503
- escalation?: {
2504
- enabled?: boolean | undefined;
2505
- minLength?: number | undefined;
2506
- maxRetries?: number | undefined;
2507
- fallbackProvider?: string | undefined;
2508
- fallbackModel?: string | undefined;
2509
- checks?: ("min_length" | "constraint" | "self_check")[] | undefined;
3721
+ httpProxy?: string | undefined;
3722
+ httpsProxy?: string | undefined;
3723
+ allProxy?: string | undefined;
3724
+ auth?: {
3725
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
3726
+ username?: string | undefined;
2510
3727
  } | undefined;
3728
+ defaultProfile?: string | undefined;
3729
+ profiles?: Record<string, {
3730
+ url?: string | undefined;
3731
+ label?: string | undefined;
3732
+ tls?: {
3733
+ caFile?: string | undefined;
3734
+ caPem?: string | undefined;
3735
+ certFile?: string | undefined;
3736
+ keyFile?: string | undefined;
3737
+ rejectUnauthorized?: boolean | undefined;
3738
+ } | undefined;
3739
+ httpProxy?: string | undefined;
3740
+ httpsProxy?: string | undefined;
3741
+ allProxy?: string | undefined;
3742
+ auth?: {
3743
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
3744
+ username?: string | undefined;
3745
+ } | undefined;
3746
+ }> | undefined;
3747
+ noProxy?: string[] | undefined;
3748
+ fromEnv?: boolean | undefined;
3749
+ fallbackDirect?: boolean | undefined;
3750
+ connectTimeoutMs?: number | undefined;
2511
3751
  }>>;
2512
3752
  remote: z.ZodDefault<z.ZodObject<{
2513
3753
  /** Включён ли гибридный режим: локальный core подключается к удалённому backend. */
@@ -2557,7 +3797,7 @@ export declare const synthConfigSchema: z.ZodObject<{
2557
3797
  issuer: string;
2558
3798
  clientId: string;
2559
3799
  };
2560
- llm: "server" | "local";
3800
+ llm: "local" | "server";
2561
3801
  worlds: {
2562
3802
  local: boolean;
2563
3803
  remote: boolean;
@@ -2573,7 +3813,7 @@ export declare const synthConfigSchema: z.ZodObject<{
2573
3813
  issuer?: string | undefined;
2574
3814
  clientId?: string | undefined;
2575
3815
  } | undefined;
2576
- llm?: "server" | "local" | undefined;
3816
+ llm?: "local" | "server" | undefined;
2577
3817
  worlds?: {
2578
3818
  local?: boolean | undefined;
2579
3819
  remote?: boolean | undefined;
@@ -2702,14 +3942,39 @@ export declare const synthConfigSchema: z.ZodObject<{
2702
3942
  }, {
2703
3943
  enabled?: boolean | undefined;
2704
3944
  }>>;
3945
+ /** ADR-099: единый механизм доверия TLS/CA для исходящих соединений. */
3946
+ tls: z.ZodOptional<z.ZodObject<{
3947
+ /** Путь к PEM-файлу доверенного CA. Взаимоисключающ с `caPem`. */
3948
+ caFile: z.ZodOptional<z.ZodString>;
3949
+ /** PEM доверенного CA (приоритетно над файлом; взаимоисключающ с `caFile`). */
3950
+ caPem: z.ZodOptional<z.ZodString>;
3951
+ /** Путь к PEM-файлу клиентского сертификата (mTLS). */
3952
+ certFile: z.ZodOptional<z.ZodString>;
3953
+ /** Путь к PEM-файлу приватного ключа клиента (mTLS). */
3954
+ keyFile: z.ZodOptional<z.ZodString>;
3955
+ /** Проверять сертификат сервера (по умолчанию `true`). */
3956
+ rejectUnauthorized: z.ZodOptional<z.ZodBoolean>;
3957
+ }, "strip", z.ZodTypeAny, {
3958
+ caFile?: string | undefined;
3959
+ caPem?: string | undefined;
3960
+ certFile?: string | undefined;
3961
+ keyFile?: string | undefined;
3962
+ rejectUnauthorized?: boolean | undefined;
3963
+ }, {
3964
+ caFile?: string | undefined;
3965
+ caPem?: string | undefined;
3966
+ certFile?: string | undefined;
3967
+ keyFile?: string | undefined;
3968
+ rejectUnauthorized?: boolean | undefined;
3969
+ }>>;
2705
3970
  /**
2706
- * AD-076: мастер-ключ для шифрования секретов at-rest (SSH-ключи, AES-256-GCM).
3971
+ * ADR-076: мастер-ключ для шифрования секретов at-rest (SSH-ключи, AES-256-GCM).
2707
3972
  * Приоритет — env `SYNTH_SECRET_KEY` (читать через `resolveSecretKey`).
2708
3973
  * Пусто — core использует файл `{dataDir}/secrets/master.key`.
2709
3974
  */
2710
3975
  secretKey: z.ZodDefault<z.ZodString>;
2711
3976
  /**
2712
- * AD-052/O1: installer service-key'и, провижининг которых выполняется
3977
+ * ADR-052/O1: installer service-key'и, провижининг которых выполняется
2713
3978
  * идемпотентно при старте (core standalone и backend). Может задаваться
2714
3979
  * JSON-строкой через env `SYNTH_BOOTSTRAP_SERVICE_KEYS` (приоритетнее
2715
3980
  * config.yaml) — так секрет не попадает в файл конфигурации.
@@ -2719,20 +3984,20 @@ export declare const synthConfigSchema: z.ZodObject<{
2719
3984
  label: z.ZodString;
2720
3985
  secret: z.ZodString;
2721
3986
  scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
2722
- roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof import("../types/index.js").GlobalRole>, "many">>;
3987
+ roles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof import("../types/user.js").GlobalRole>, "many">>;
2723
3988
  description: z.ZodOptional<z.ZodString>;
2724
3989
  }, "strip", z.ZodTypeAny, {
2725
3990
  label: string;
2726
3991
  scopes: string[];
2727
3992
  secret: string;
2728
3993
  description?: string | undefined;
2729
- roles?: import("../types/index.js").GlobalRole[] | undefined;
3994
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
2730
3995
  }, {
2731
3996
  label: string;
2732
3997
  scopes: string[];
2733
3998
  secret: string;
2734
3999
  description?: string | undefined;
2735
- roles?: import("../types/index.js").GlobalRole[] | undefined;
4000
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
2736
4001
  }>, "many">>;
2737
4002
  }, "strip", z.ZodTypeAny, {
2738
4003
  promptInjection: {
@@ -2744,12 +4009,19 @@ export declare const synthConfigSchema: z.ZodObject<{
2744
4009
  enabled: boolean;
2745
4010
  };
2746
4011
  secretKey: string;
4012
+ tls?: {
4013
+ caFile?: string | undefined;
4014
+ caPem?: string | undefined;
4015
+ certFile?: string | undefined;
4016
+ keyFile?: string | undefined;
4017
+ rejectUnauthorized?: boolean | undefined;
4018
+ } | undefined;
2747
4019
  bootstrapServiceKeys?: {
2748
4020
  label: string;
2749
4021
  scopes: string[];
2750
4022
  secret: string;
2751
4023
  description?: string | undefined;
2752
- roles?: import("../types/index.js").GlobalRole[] | undefined;
4024
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
2753
4025
  }[] | undefined;
2754
4026
  }, {
2755
4027
  promptInjection?: {
@@ -2760,16 +4032,60 @@ export declare const synthConfigSchema: z.ZodObject<{
2760
4032
  protectedPaths?: {
2761
4033
  enabled?: boolean | undefined;
2762
4034
  } | undefined;
4035
+ tls?: {
4036
+ caFile?: string | undefined;
4037
+ caPem?: string | undefined;
4038
+ certFile?: string | undefined;
4039
+ keyFile?: string | undefined;
4040
+ rejectUnauthorized?: boolean | undefined;
4041
+ } | undefined;
2763
4042
  secretKey?: string | undefined;
2764
4043
  bootstrapServiceKeys?: {
2765
4044
  label: string;
2766
4045
  scopes: string[];
2767
4046
  secret: string;
2768
4047
  description?: string | undefined;
2769
- roles?: import("../types/index.js").GlobalRole[] | undefined;
4048
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
2770
4049
  }[] | undefined;
2771
4050
  }>>;
2772
4051
  }, "strip", z.ZodTypeAny, {
4052
+ storage: {
4053
+ dataDir: string;
4054
+ postgres: {
4055
+ user?: string | undefined;
4056
+ database?: string | undefined;
4057
+ host?: string | undefined;
4058
+ port?: number | undefined;
4059
+ dsn?: string | undefined;
4060
+ schema?: string | undefined;
4061
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
4062
+ ssl?: boolean | undefined;
4063
+ poolMax?: number | undefined;
4064
+ };
4065
+ degradedMode: "fallback-file" | "halt";
4066
+ fallbackDir: string;
4067
+ workspacesRoot: string;
4068
+ defaultWorkspace: string;
4069
+ workspaceOutsideRoot: "" | "deny" | "confirm";
4070
+ backend?: "file" | "memory" | "postgres" | undefined;
4071
+ maxUploadBytes?: number | undefined;
4072
+ };
4073
+ summarization: {
4074
+ provider: string;
4075
+ model: string;
4076
+ temperature: number;
4077
+ promptFile: string;
4078
+ };
4079
+ context: {
4080
+ enabledFiles: string[];
4081
+ };
4082
+ tools: {
4083
+ disabled: {
4084
+ tools: string[];
4085
+ capabilities: string[];
4086
+ };
4087
+ policy: "auto" | "consistency" | "available";
4088
+ };
2773
4089
  mcp: {
2774
4090
  policy: "auto" | "consistency" | "available";
2775
4091
  servers: Record<string, {
@@ -2788,6 +4104,7 @@ export declare const synthConfigSchema: z.ZodObject<{
2788
4104
  networkPolicy: {
2789
4105
  mode: "allow" | "deny";
2790
4106
  list: string[];
4107
+ exceptions: string[];
2791
4108
  };
2792
4109
  };
2793
4110
  server: {
@@ -2796,12 +4113,6 @@ export declare const synthConfigSchema: z.ZodObject<{
2796
4113
  corsOrigin: string;
2797
4114
  allowedOrigins: string[];
2798
4115
  };
2799
- summarization: {
2800
- provider: string;
2801
- model: string;
2802
- temperature: number;
2803
- promptFile: string;
2804
- };
2805
4116
  skills: {
2806
4117
  paths: string[];
2807
4118
  urls: string[];
@@ -2809,13 +4120,6 @@ export declare const synthConfigSchema: z.ZodObject<{
2809
4120
  inlineShell: boolean;
2810
4121
  toolsets: Record<string, ToolCapability[]>;
2811
4122
  };
2812
- tools: {
2813
- disabled: {
2814
- capabilities: string[];
2815
- tools: string[];
2816
- };
2817
- policy: "auto" | "consistency" | "available";
2818
- };
2819
4123
  events: {
2820
4124
  enabled: boolean;
2821
4125
  defaultMode: "bound" | "ephemeral";
@@ -2838,6 +4142,12 @@ export declare const synthConfigSchema: z.ZodObject<{
2838
4142
  escalationProvider: string;
2839
4143
  escalationModel: string;
2840
4144
  };
4145
+ webhooks: {
4146
+ enabled: boolean;
4147
+ maxAttempts: number;
4148
+ timeoutMs: number;
4149
+ deliveryRetentionDays: number;
4150
+ };
2841
4151
  auth: {
2842
4152
  debugMode: boolean;
2843
4153
  sessionMaxAgeMinutes: number;
@@ -2857,12 +4167,61 @@ export declare const synthConfigSchema: z.ZodObject<{
2857
4167
  cliClientId: string;
2858
4168
  } | undefined;
2859
4169
  };
4170
+ proxy: {
4171
+ mode: "all" | "selected";
4172
+ noProxy: string[];
4173
+ fromEnv: boolean;
4174
+ fallbackDirect: boolean;
4175
+ connectTimeoutMs: number;
4176
+ rules?: {
4177
+ hosts: string[];
4178
+ action: "proxy" | "direct";
4179
+ id?: string | undefined;
4180
+ label?: string | undefined;
4181
+ profile?: string | undefined;
4182
+ }[] | undefined;
4183
+ url?: string | undefined;
4184
+ enabled?: boolean | undefined;
4185
+ tls?: {
4186
+ caFile?: string | undefined;
4187
+ caPem?: string | undefined;
4188
+ certFile?: string | undefined;
4189
+ keyFile?: string | undefined;
4190
+ rejectUnauthorized?: boolean | undefined;
4191
+ } | undefined;
4192
+ httpProxy?: string | undefined;
4193
+ httpsProxy?: string | undefined;
4194
+ allProxy?: string | undefined;
4195
+ auth?: {
4196
+ type: "basic" | "ntlm" | "negotiate";
4197
+ username: string;
4198
+ } | undefined;
4199
+ defaultProfile?: string | undefined;
4200
+ profiles?: Record<string, {
4201
+ url?: string | undefined;
4202
+ label?: string | undefined;
4203
+ tls?: {
4204
+ caFile?: string | undefined;
4205
+ caPem?: string | undefined;
4206
+ certFile?: string | undefined;
4207
+ keyFile?: string | undefined;
4208
+ rejectUnauthorized?: boolean | undefined;
4209
+ } | undefined;
4210
+ httpProxy?: string | undefined;
4211
+ httpsProxy?: string | undefined;
4212
+ allProxy?: string | undefined;
4213
+ auth?: {
4214
+ type: "basic" | "ntlm" | "negotiate";
4215
+ username: string;
4216
+ } | undefined;
4217
+ }> | undefined;
4218
+ };
2860
4219
  llm: {
2861
4220
  defaultProvider: string;
2862
4221
  defaultModel: string;
2863
4222
  maxRetries: number;
2864
4223
  timeout: number;
2865
- cache: "none" | "auto";
4224
+ cache: "auto" | "none";
2866
4225
  };
2867
4226
  remote: {
2868
4227
  enabled: boolean;
@@ -2874,19 +4233,13 @@ export declare const synthConfigSchema: z.ZodObject<{
2874
4233
  issuer: string;
2875
4234
  clientId: string;
2876
4235
  };
2877
- llm: "server" | "local";
4236
+ llm: "local" | "server";
2878
4237
  worlds: {
2879
4238
  local: boolean;
2880
4239
  remote: boolean;
2881
4240
  };
2882
4241
  credentialsPath: string;
2883
4242
  };
2884
- storage: {
2885
- dataDir: string;
2886
- workspacesRoot: string;
2887
- defaultWorkspace: string;
2888
- workspaceOutsideRoot: "" | "deny" | "confirm";
2889
- };
2890
4243
  core: {
2891
4244
  apiKey: string;
2892
4245
  port: number;
@@ -2895,9 +4248,9 @@ export declare const synthConfigSchema: z.ZodObject<{
2895
4248
  port: number;
2896
4249
  backendUrl: string;
2897
4250
  enginePorts: {
2898
- synth: number;
2899
4251
  opencode: number;
2900
4252
  cline: number;
4253
+ synth: number;
2901
4254
  };
2902
4255
  proxyPort: number;
2903
4256
  };
@@ -2922,9 +4275,6 @@ export declare const synthConfigSchema: z.ZodObject<{
2922
4275
  session: {
2923
4276
  planMode: "auto" | "strict" | "off";
2924
4277
  };
2925
- context: {
2926
- enabledFiles: string[];
2927
- };
2928
4278
  commands: {
2929
4279
  paths: string[];
2930
4280
  bundlesPath: string;
@@ -2940,15 +4290,30 @@ export declare const synthConfigSchema: z.ZodObject<{
2940
4290
  catchUp: "skip" | "once";
2941
4291
  tickSec: number;
2942
4292
  jobRetentionDays: number;
2943
- leaderElection: "file" | "none";
4293
+ leaderElection: "none" | "file" | "postgres";
2944
4294
  crossProcessLocks: boolean;
2945
4295
  };
2946
- webhooks: {
4296
+ analytics: {
4297
+ retentionDays: number;
4298
+ };
4299
+ metrics: {
2947
4300
  enabled: boolean;
2948
- maxAttempts: number;
2949
- timeoutMs: number;
2950
- allowPrivateTargets: boolean;
2951
- deliveryRetentionDays: number;
4301
+ };
4302
+ egress: {
4303
+ tools: {
4304
+ mode: "allow" | "deny";
4305
+ list: string[];
4306
+ exceptions: string[];
4307
+ };
4308
+ webhooks: {
4309
+ mode: "allow" | "deny" | "off";
4310
+ list: string[];
4311
+ exceptions: string[];
4312
+ };
4313
+ log: {
4314
+ enabled: boolean;
4315
+ retentionDays: number;
4316
+ };
2952
4317
  };
2953
4318
  instructions: {
2954
4319
  enabled: boolean;
@@ -2982,13 +4347,17 @@ export declare const synthConfigSchema: z.ZodObject<{
2982
4347
  maxChars?: number | undefined;
2983
4348
  };
2984
4349
  router: {
2985
- enabled: boolean;
4350
+ subagent: {
4351
+ provider: string;
4352
+ model: string;
4353
+ enabled: boolean;
4354
+ };
2986
4355
  content: {
2987
- chat: {
4356
+ coding: {
2988
4357
  provider: string;
2989
4358
  model: string;
2990
4359
  };
2991
- coding: {
4360
+ chat: {
2992
4361
  provider: string;
2993
4362
  model: string;
2994
4363
  };
@@ -2997,11 +4366,6 @@ export declare const synthConfigSchema: z.ZodObject<{
2997
4366
  model: string;
2998
4367
  };
2999
4368
  };
3000
- subagent: {
3001
- provider: string;
3002
- model: string;
3003
- enabled: boolean;
3004
- };
3005
4369
  cost: {
3006
4370
  enabled: boolean;
3007
4371
  cheapProvider: string;
@@ -3010,6 +4374,7 @@ export declare const synthConfigSchema: z.ZodObject<{
3010
4374
  expensiveModel: string;
3011
4375
  maxCheapTokens: number;
3012
4376
  };
4377
+ enabled: boolean;
3013
4378
  strategy: "auto" | "content" | "cost" | "content+cost";
3014
4379
  escalation: {
3015
4380
  enabled: boolean;
@@ -3059,15 +4424,59 @@ export declare const synthConfigSchema: z.ZodObject<{
3059
4424
  enabled: boolean;
3060
4425
  };
3061
4426
  secretKey: string;
4427
+ tls?: {
4428
+ caFile?: string | undefined;
4429
+ caPem?: string | undefined;
4430
+ certFile?: string | undefined;
4431
+ keyFile?: string | undefined;
4432
+ rejectUnauthorized?: boolean | undefined;
4433
+ } | undefined;
3062
4434
  bootstrapServiceKeys?: {
3063
4435
  label: string;
3064
4436
  scopes: string[];
3065
4437
  secret: string;
3066
4438
  description?: string | undefined;
3067
- roles?: import("../types/index.js").GlobalRole[] | undefined;
4439
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
3068
4440
  }[] | undefined;
3069
4441
  };
3070
4442
  }, {
4443
+ storage?: {
4444
+ dataDir?: string | undefined;
4445
+ postgres?: {
4446
+ user?: string | undefined;
4447
+ database?: string | undefined;
4448
+ host?: string | undefined;
4449
+ port?: number | undefined;
4450
+ dsn?: string | undefined;
4451
+ schema?: string | undefined;
4452
+ sslmode?: "disable" | "require" | "verify-full" | "verify-ca" | undefined;
4453
+ ssl?: boolean | undefined;
4454
+ poolMax?: number | undefined;
4455
+ } | undefined;
4456
+ backend?: "file" | "memory" | "postgres" | undefined;
4457
+ degradedMode?: "fallback-file" | "halt" | undefined;
4458
+ fallbackDir?: string | undefined;
4459
+ workspacesRoot?: string | undefined;
4460
+ defaultWorkspace?: string | undefined;
4461
+ workspaceOutsideRoot?: "" | "deny" | "confirm" | undefined;
4462
+ maxUploadBytes?: number | undefined;
4463
+ } | undefined;
4464
+ summarization?: {
4465
+ provider?: string | undefined;
4466
+ model?: string | undefined;
4467
+ temperature?: number | undefined;
4468
+ promptFile?: string | undefined;
4469
+ } | undefined;
4470
+ context?: {
4471
+ enabledFiles?: string[] | undefined;
4472
+ } | undefined;
4473
+ tools?: {
4474
+ disabled?: {
4475
+ tools?: string[] | undefined;
4476
+ capabilities?: string[] | undefined;
4477
+ } | undefined;
4478
+ policy?: "auto" | "consistency" | "available" | undefined;
4479
+ } | undefined;
3071
4480
  mcp?: {
3072
4481
  policy?: "auto" | "consistency" | "available" | undefined;
3073
4482
  servers?: Record<string, {
@@ -3086,6 +4495,7 @@ export declare const synthConfigSchema: z.ZodObject<{
3086
4495
  networkPolicy?: {
3087
4496
  mode?: "allow" | "deny" | undefined;
3088
4497
  list?: string[] | undefined;
4498
+ exceptions?: string[] | undefined;
3089
4499
  } | undefined;
3090
4500
  } | undefined;
3091
4501
  server?: {
@@ -3094,12 +4504,6 @@ export declare const synthConfigSchema: z.ZodObject<{
3094
4504
  corsOrigin?: string | undefined;
3095
4505
  allowedOrigins?: string[] | undefined;
3096
4506
  } | undefined;
3097
- summarization?: {
3098
- provider?: string | undefined;
3099
- model?: string | undefined;
3100
- temperature?: number | undefined;
3101
- promptFile?: string | undefined;
3102
- } | undefined;
3103
4507
  skills?: {
3104
4508
  paths?: string[] | undefined;
3105
4509
  urls?: string[] | undefined;
@@ -3107,13 +4511,6 @@ export declare const synthConfigSchema: z.ZodObject<{
3107
4511
  inlineShell?: boolean | undefined;
3108
4512
  toolsets?: Record<string, ToolCapability[]> | undefined;
3109
4513
  } | undefined;
3110
- tools?: {
3111
- disabled?: {
3112
- capabilities?: string[] | undefined;
3113
- tools?: string[] | undefined;
3114
- } | undefined;
3115
- policy?: "auto" | "consistency" | "available" | undefined;
3116
- } | undefined;
3117
4514
  events?: {
3118
4515
  enabled?: boolean | undefined;
3119
4516
  defaultMode?: "bound" | "ephemeral" | undefined;
@@ -3136,6 +4533,12 @@ export declare const synthConfigSchema: z.ZodObject<{
3136
4533
  escalationProvider?: string | undefined;
3137
4534
  escalationModel?: string | undefined;
3138
4535
  } | undefined;
4536
+ webhooks?: {
4537
+ enabled?: boolean | undefined;
4538
+ maxAttempts?: number | undefined;
4539
+ timeoutMs?: number | undefined;
4540
+ deliveryRetentionDays?: number | undefined;
4541
+ } | undefined;
3139
4542
  auth?: {
3140
4543
  apiKey?: string | undefined;
3141
4544
  debugMode?: boolean | undefined;
@@ -3155,12 +4558,61 @@ export declare const synthConfigSchema: z.ZodObject<{
3155
4558
  cliClientId?: string | undefined;
3156
4559
  } | undefined;
3157
4560
  } | undefined;
4561
+ proxy?: {
4562
+ rules?: {
4563
+ hosts: string[];
4564
+ action: "proxy" | "direct";
4565
+ id?: string | undefined;
4566
+ label?: string | undefined;
4567
+ profile?: string | undefined;
4568
+ }[] | undefined;
4569
+ mode?: "all" | "selected" | undefined;
4570
+ url?: string | undefined;
4571
+ enabled?: boolean | undefined;
4572
+ tls?: {
4573
+ caFile?: string | undefined;
4574
+ caPem?: string | undefined;
4575
+ certFile?: string | undefined;
4576
+ keyFile?: string | undefined;
4577
+ rejectUnauthorized?: boolean | undefined;
4578
+ } | undefined;
4579
+ httpProxy?: string | undefined;
4580
+ httpsProxy?: string | undefined;
4581
+ allProxy?: string | undefined;
4582
+ auth?: {
4583
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
4584
+ username?: string | undefined;
4585
+ } | undefined;
4586
+ defaultProfile?: string | undefined;
4587
+ profiles?: Record<string, {
4588
+ url?: string | undefined;
4589
+ label?: string | undefined;
4590
+ tls?: {
4591
+ caFile?: string | undefined;
4592
+ caPem?: string | undefined;
4593
+ certFile?: string | undefined;
4594
+ keyFile?: string | undefined;
4595
+ rejectUnauthorized?: boolean | undefined;
4596
+ } | undefined;
4597
+ httpProxy?: string | undefined;
4598
+ httpsProxy?: string | undefined;
4599
+ allProxy?: string | undefined;
4600
+ auth?: {
4601
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
4602
+ username?: string | undefined;
4603
+ } | undefined;
4604
+ }> | undefined;
4605
+ noProxy?: string[] | undefined;
4606
+ fromEnv?: boolean | undefined;
4607
+ fallbackDirect?: boolean | undefined;
4608
+ connectTimeoutMs?: number | undefined;
4609
+ } | undefined;
3158
4610
  llm?: {
3159
4611
  defaultProvider?: string | undefined;
3160
4612
  defaultModel?: string | undefined;
3161
4613
  maxRetries?: number | undefined;
3162
4614
  timeout?: number | undefined;
3163
- cache?: "none" | "auto" | undefined;
4615
+ cache?: "auto" | "none" | undefined;
3164
4616
  } | undefined;
3165
4617
  remote?: {
3166
4618
  enabled?: boolean | undefined;
@@ -3172,19 +4624,13 @@ export declare const synthConfigSchema: z.ZodObject<{
3172
4624
  issuer?: string | undefined;
3173
4625
  clientId?: string | undefined;
3174
4626
  } | undefined;
3175
- llm?: "server" | "local" | undefined;
4627
+ llm?: "local" | "server" | undefined;
3176
4628
  worlds?: {
3177
4629
  local?: boolean | undefined;
3178
4630
  remote?: boolean | undefined;
3179
4631
  } | undefined;
3180
4632
  credentialsPath?: string | undefined;
3181
4633
  } | undefined;
3182
- storage?: {
3183
- dataDir?: string | undefined;
3184
- workspacesRoot?: string | undefined;
3185
- defaultWorkspace?: string | undefined;
3186
- workspaceOutsideRoot?: "" | "deny" | "confirm" | undefined;
3187
- } | undefined;
3188
4634
  core?: {
3189
4635
  apiKey?: string | undefined;
3190
4636
  port?: number | undefined;
@@ -3193,9 +4639,9 @@ export declare const synthConfigSchema: z.ZodObject<{
3193
4639
  port?: number | undefined;
3194
4640
  backendUrl?: string | undefined;
3195
4641
  enginePorts?: {
3196
- synth?: number | undefined;
3197
4642
  opencode?: number | undefined;
3198
4643
  cline?: number | undefined;
4644
+ synth?: number | undefined;
3199
4645
  } | undefined;
3200
4646
  proxyPort?: number | undefined;
3201
4647
  } | undefined;
@@ -3220,9 +4666,6 @@ export declare const synthConfigSchema: z.ZodObject<{
3220
4666
  session?: {
3221
4667
  planMode?: "auto" | "strict" | "off" | undefined;
3222
4668
  } | undefined;
3223
- context?: {
3224
- enabledFiles?: string[] | undefined;
3225
- } | undefined;
3226
4669
  commands?: {
3227
4670
  paths?: string[] | undefined;
3228
4671
  bundlesPath?: string | undefined;
@@ -3238,15 +4681,30 @@ export declare const synthConfigSchema: z.ZodObject<{
3238
4681
  catchUp?: "skip" | "once" | undefined;
3239
4682
  tickSec?: number | undefined;
3240
4683
  jobRetentionDays?: number | undefined;
3241
- leaderElection?: "file" | "none" | undefined;
4684
+ leaderElection?: "none" | "file" | "postgres" | undefined;
3242
4685
  crossProcessLocks?: boolean | undefined;
3243
4686
  } | undefined;
3244
- webhooks?: {
4687
+ analytics?: {
4688
+ retentionDays?: number | undefined;
4689
+ } | undefined;
4690
+ metrics?: {
3245
4691
  enabled?: boolean | undefined;
3246
- maxAttempts?: number | undefined;
3247
- timeoutMs?: number | undefined;
3248
- allowPrivateTargets?: boolean | undefined;
3249
- deliveryRetentionDays?: number | undefined;
4692
+ } | undefined;
4693
+ egress?: {
4694
+ tools?: {
4695
+ mode?: "allow" | "deny" | undefined;
4696
+ list?: string[] | undefined;
4697
+ exceptions?: string[] | undefined;
4698
+ } | undefined;
4699
+ webhooks?: {
4700
+ mode?: "allow" | "deny" | "off" | undefined;
4701
+ list?: string[] | undefined;
4702
+ exceptions?: string[] | undefined;
4703
+ } | undefined;
4704
+ log?: {
4705
+ enabled?: boolean | undefined;
4706
+ retentionDays?: number | undefined;
4707
+ } | undefined;
3250
4708
  } | undefined;
3251
4709
  instructions?: {
3252
4710
  enabled?: boolean | undefined;
@@ -3280,13 +4738,17 @@ export declare const synthConfigSchema: z.ZodObject<{
3280
4738
  allowInstallTreeFallback?: boolean | undefined;
3281
4739
  } | undefined;
3282
4740
  router?: {
3283
- enabled?: boolean | undefined;
4741
+ subagent?: {
4742
+ provider?: string | undefined;
4743
+ model?: string | undefined;
4744
+ enabled?: boolean | undefined;
4745
+ } | undefined;
3284
4746
  content?: {
3285
- chat?: {
4747
+ coding?: {
3286
4748
  provider?: string | undefined;
3287
4749
  model?: string | undefined;
3288
4750
  } | undefined;
3289
- coding?: {
4751
+ chat?: {
3290
4752
  provider?: string | undefined;
3291
4753
  model?: string | undefined;
3292
4754
  } | undefined;
@@ -3295,11 +4757,6 @@ export declare const synthConfigSchema: z.ZodObject<{
3295
4757
  model?: string | undefined;
3296
4758
  } | undefined;
3297
4759
  } | undefined;
3298
- subagent?: {
3299
- provider?: string | undefined;
3300
- model?: string | undefined;
3301
- enabled?: boolean | undefined;
3302
- } | undefined;
3303
4760
  cost?: {
3304
4761
  enabled?: boolean | undefined;
3305
4762
  cheapProvider?: string | undefined;
@@ -3308,6 +4765,7 @@ export declare const synthConfigSchema: z.ZodObject<{
3308
4765
  expensiveModel?: string | undefined;
3309
4766
  maxCheapTokens?: number | undefined;
3310
4767
  } | undefined;
4768
+ enabled?: boolean | undefined;
3311
4769
  strategy?: "auto" | "content" | "cost" | "content+cost" | undefined;
3312
4770
  escalation?: {
3313
4771
  enabled?: boolean | undefined;
@@ -3356,18 +4814,27 @@ export declare const synthConfigSchema: z.ZodObject<{
3356
4814
  protectedPaths?: {
3357
4815
  enabled?: boolean | undefined;
3358
4816
  } | undefined;
4817
+ tls?: {
4818
+ caFile?: string | undefined;
4819
+ caPem?: string | undefined;
4820
+ certFile?: string | undefined;
4821
+ keyFile?: string | undefined;
4822
+ rejectUnauthorized?: boolean | undefined;
4823
+ } | undefined;
3359
4824
  secretKey?: string | undefined;
3360
4825
  bootstrapServiceKeys?: {
3361
4826
  label: string;
3362
4827
  scopes: string[];
3363
4828
  secret: string;
3364
4829
  description?: string | undefined;
3365
- roles?: import("../types/index.js").GlobalRole[] | undefined;
4830
+ roles?: import("../types/user.js").GlobalRole[] | undefined;
3366
4831
  }[] | undefined;
3367
4832
  } | undefined;
3368
4833
  }>;
3369
4834
  export type ServerConfig = z.infer<typeof serverConfigSchema>;
3370
4835
  export type StorageConfig = z.infer<typeof storageConfigSchema>;
4836
+ /** PROP-032: параметры PostgreSQL-backend (`storage.postgres`). */
4837
+ export type PostgresStorageConfig = z.infer<typeof postgresStorageConfigSchema>;
3371
4838
  export type AuthConfig = z.infer<typeof authConfigSchema>;
3372
4839
  export type LLMConfig = z.infer<typeof llmConfigSchema>;
3373
4840
  export type CoreConfig = z.infer<typeof coreConfigSchema>;
@@ -3388,7 +4855,14 @@ export type CommandsConfig = z.infer<typeof commandsConfigSchema>;
3388
4855
  export type EventsConfig = z.infer<typeof eventsConfigSchema>;
3389
4856
  export type SchedulerConfig = z.infer<typeof schedulerConfigSchema>;
3390
4857
  export type DecisionConfig = z.infer<typeof decisionConfigSchema>;
4858
+ export type AnalyticsConfig = z.infer<typeof analyticsConfigSchema>;
4859
+ /** ADR-094: секция `metrics` (`enabled`). */
4860
+ export type MetricsConfig = z.infer<typeof metricsConfigSchema>;
3391
4861
  export type WebhooksConfig = z.infer<typeof webhooksConfigSchema>;
4862
+ export type EgressPolicyConfig = z.infer<typeof egressPolicySchema>;
4863
+ export type WebhooksEgressPolicyConfig = z.infer<typeof webhooksEgressPolicySchema>;
4864
+ export type EgressLogConfig = z.infer<typeof egressLogConfigSchema>;
4865
+ export type EgressConfig = z.infer<typeof egressConfigSchema>;
3392
4866
  export type InstructionSourceConfig = z.infer<typeof instructionSourceConfigSchema>;
3393
4867
  export type InstructionsLazyConfig = z.infer<typeof instructionsLazyConfigSchema>;
3394
4868
  export type InstructionsFetchConfig = z.infer<typeof instructionsFetchConfigSchema>;
@@ -3399,12 +4873,24 @@ export type RouterCostConfig = z.infer<typeof routerCostConfigSchema>;
3399
4873
  export type RouterSubagentConfig = z.infer<typeof routerSubagentConfigSchema>;
3400
4874
  export type RouterConfig = z.infer<typeof routerConfigSchema>;
3401
4875
  export type RemoteConfig = z.infer<typeof remoteConfigSchema>;
4876
+ /** ADR-099 (D1): секция `proxy` — HTTP/HTTPS-прокси единого egress-слоя. */
4877
+ export type ProxyConfig = z.infer<typeof proxyConfigSchema>;
4878
+ /** ADR-099 (D2a): Basic-аутентификация прокси (пароль — env/файл). */
4879
+ export type ProxyAuthConfig = z.infer<typeof proxyAuthConfigSchema>;
4880
+ /** ADR-099 (D2a): TLS/mTLS к самому прокси. */
4881
+ export type ProxyTlsConfig = z.infer<typeof proxyTlsConfigSchema>;
4882
+ /** ADR-099: именованный профиль прокси (per-host маршрутизация). */
4883
+ export type ProxyProfileConfig = z.infer<typeof proxyProfileSchema>;
4884
+ /** ADR-099: правило маршрутизации прокси по хостам. */
4885
+ export type ProxyRuleConfig = z.infer<typeof proxyRuleSchema>;
3402
4886
  export type MicroFirstConfig = z.infer<typeof microFirstConfigSchema>;
3403
4887
  export type SynthConfig = z.infer<typeof synthConfigSchema>;
3404
4888
  export type PermissionConfig = z.infer<typeof permissionConfigSchema>;
3405
4889
  export type PromptInjectionConfig = z.infer<typeof promptInjectionConfigSchema>;
3406
4890
  export type ProtectedPathsConfig = z.infer<typeof protectedPathsConfigSchema>;
3407
4891
  export type SecurityConfig = z.infer<typeof securityConfigSchema>;
4892
+ /** ADR-099: секция `security.tls` — доверие TLS/CA исходящих соединений. */
4893
+ export type SecurityTlsConfig = z.infer<typeof securityTlsConfigSchema>;
3408
4894
  export type BootstrapServiceKeyConfig = z.infer<typeof bootstrapServiceKeySchema>;
3409
4895
  export type LLMGatewayRateLimitConfig = z.infer<typeof llmGatewayRateLimitConfigSchema>;
3410
4896
  export type LLMGatewayAuditConfig = z.infer<typeof llmGatewayAuditConfigSchema>;