@itphx/synth-shared 0.10.1 → 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 (46) hide show
  1. package/dist/config/defaults.js +49 -3
  2. package/dist/config/env-overrides.d.ts +4 -1
  3. package/dist/config/env-overrides.js +37 -4
  4. package/dist/config/index.d.ts +3 -0
  5. package/dist/config/index.js +3 -0
  6. package/dist/config/loader.js +19 -0
  7. package/dist/config/proxy.d.ts +415 -0
  8. package/dist/config/proxy.js +1565 -0
  9. package/dist/config/resolve.d.ts +67 -0
  10. package/dist/config/resolve.js +187 -1
  11. package/dist/config/tls-runtime.d.ts +78 -0
  12. package/dist/config/tls-runtime.js +356 -0
  13. package/dist/config/tls.d.ts +215 -0
  14. package/dist/config/tls.js +394 -0
  15. package/dist/config/types.d.ts +1536 -50
  16. package/dist/config/types.js +273 -7
  17. package/dist/i18n/index.d.ts +1 -1
  18. package/dist/i18n/index.js +2 -0
  19. package/dist/index.d.ts +11 -2
  20. package/dist/index.js +11 -2
  21. package/dist/protocols/index.d.ts +0 -1
  22. package/dist/schemas/index.d.ts +134 -9
  23. package/dist/schemas/index.js +51 -4
  24. package/dist/types/analytics.d.ts +113 -0
  25. package/dist/types/analytics.js +61 -0
  26. package/dist/types/egress.d.ts +114 -0
  27. package/dist/types/egress.js +68 -0
  28. package/dist/types/events.d.ts +0 -1
  29. package/dist/types/fs.d.ts +11 -0
  30. package/dist/types/fs.js +11 -0
  31. package/dist/types/hooks.d.ts +20 -0
  32. package/dist/types/index.d.ts +3 -0
  33. package/dist/types/index.js +6 -0
  34. package/dist/types/maintenance.d.ts +39 -0
  35. package/dist/types/maintenance.js +11 -0
  36. package/dist/types/mcp.d.ts +68 -3
  37. package/dist/types/mcp.js +83 -4
  38. package/dist/types/permission.d.ts +7 -5
  39. package/dist/types/prompt.d.ts +3 -2
  40. package/dist/types/session.d.ts +0 -1
  41. package/dist/types/webhooks.d.ts +1 -1
  42. package/dist/utils/index.d.ts +15 -0
  43. package/dist/utils/index.js +53 -0
  44. package/dist/version.d.ts +1 -1
  45. package/dist/version.js +1 -1
  46. package/package.json +1 -1
@@ -17,8 +17,144 @@ 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>;
@@ -28,16 +164,54 @@ export declare const storageConfigSchema: z.ZodObject<{
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>;
@@ -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
  }>;
@@ -316,12 +490,16 @@ export declare const mcpServerConfigSchema: z.ZodObject<{
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<{
@@ -374,12 +552,16 @@ 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
567
  * ADR-071 §2.3: глобальная админская политика включения **MCP**-инструментов.
@@ -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,6 +607,7 @@ 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
  /**
@@ -661,31 +845,33 @@ export declare const eventsConfigSchema: z.ZodObject<{
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: "none" | "file";
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?: "none" | "file" | undefined;
874
+ leaderElection?: "none" | "file" | "postgres" | undefined;
689
875
  crossProcessLocks?: boolean | undefined;
690
876
  }>;
691
877
  /**
@@ -725,34 +911,172 @@ export declare const decisionConfigSchema: z.ZodObject<{
725
911
  escalationProvider?: string | undefined;
726
912
  escalationModel?: string | undefined;
727
913
  }>;
914
+ /**
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
+ }>;
728
943
  /**
729
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
1081
  * ADR-069 §3.4/§11: дополнительный источник проектных инструкций.
758
1082
  * `position` задаёт место в порядке: `before` — перед merged chain, `after` —
@@ -1019,6 +1343,44 @@ export declare const bootstrapServiceKeysSchema: z.ZodArray<z.ZodObject<{
1019
1343
  description?: string | undefined;
1020
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,6 +1406,31 @@ 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
1435
  * ADR-076: мастер-ключ для шифрования секретов at-rest (SSH-ключи, AES-256-GCM).
1049
1436
  * Приоритет — env `SYNTH_SECRET_KEY` (читать через `resolveSecretKey`).
@@ -1086,6 +1473,13 @@ 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[];
@@ -1102,6 +1496,13 @@ 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;
@@ -1111,6 +1512,411 @@ export declare const securityConfigSchema: z.ZodObject<{
1111
1512
  roles?: import("../types/user.js").GlobalRole[] | undefined;
1112
1513
  }[] | undefined;
1113
1514
  }>;
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>;
1526
+ }, "strip", z.ZodTypeAny, {
1527
+ type: "basic" | "ntlm" | "negotiate";
1528
+ username: string;
1529
+ }, {
1530
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1531
+ username?: string | undefined;
1532
+ }>;
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>;
1544
+ }, "strip", z.ZodTypeAny, {
1545
+ caFile?: string | undefined;
1546
+ caPem?: string | undefined;
1547
+ certFile?: string | undefined;
1548
+ keyFile?: string | undefined;
1549
+ rejectUnauthorized?: boolean | undefined;
1550
+ }, {
1551
+ caFile?: string | undefined;
1552
+ caPem?: string | undefined;
1553
+ certFile?: string | undefined;
1554
+ keyFile?: string | undefined;
1555
+ rejectUnauthorized?: boolean | undefined;
1556
+ }>;
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>;
1581
+ }, "strip", z.ZodTypeAny, {
1582
+ type: "basic" | "ntlm" | "negotiate";
1583
+ username: string;
1584
+ }, {
1585
+ type?: "basic" | "ntlm" | "negotiate" | undefined;
1586
+ username?: string | undefined;
1587
+ }>>;
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>;
1594
+ }, "strip", z.ZodTypeAny, {
1595
+ caFile?: string | undefined;
1596
+ caPem?: string | undefined;
1597
+ certFile?: string | undefined;
1598
+ keyFile?: string | undefined;
1599
+ rejectUnauthorized?: boolean | undefined;
1600
+ }, {
1601
+ caFile?: string | undefined;
1602
+ caPem?: string | undefined;
1603
+ certFile?: string | undefined;
1604
+ keyFile?: string | undefined;
1605
+ rejectUnauthorized?: boolean | undefined;
1606
+ }>>;
1607
+ }, "strip", z.ZodTypeAny, {
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;
1624
+ }, {
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;
1633
+ } | 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;
1640
+ } | undefined;
1641
+ }>;
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
+ }>;
1114
1920
  export declare const llmGatewayRateLimitConfigSchema: z.ZodObject<{
1115
1921
  userPerMinute: z.ZodDefault<z.ZodNumber>;
1116
1922
  providerPerMinute: z.ZodDefault<z.ZodNumber>;
@@ -1618,6 +2424,83 @@ 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>;
@@ -1627,16 +2510,54 @@ export declare const synthConfigSchema: z.ZodObject<{
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>;
@@ -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
  }>>;
@@ -1912,12 +2833,16 @@ 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
2848
  * ADR-071 §2.3: глобальная админская политика включения **MCP**-инструментов.
@@ -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,6 +2888,7 @@ 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<{
@@ -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: "none" | "file";
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?: "none" | "file" | undefined;
3066
+ leaderElection?: "none" | "file" | "postgres" | undefined;
2140
3067
  crossProcessLocks?: boolean | undefined;
2141
3068
  }>>;
2142
3069
  decision: z.ZodDefault<z.ZodObject<{
@@ -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<{
@@ -2509,6 +3515,240 @@ export declare const synthConfigSchema: z.ZodObject<{
2509
3515
  checks?: ("min_length" | "constraint" | "self_check")[] | undefined;
2510
3516
  } | undefined;
2511
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;
3683
+ } | 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;
3720
+ } | 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;
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;
3751
+ }>>;
2512
3752
  remote: z.ZodDefault<z.ZodObject<{
2513
3753
  /** Включён ли гибридный режим: локальный core подключается к удалённому backend. */
2514
3754
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -2702,6 +3942,31 @@ 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
3971
  * ADR-076: мастер-ключ для шифрования секретов at-rest (SSH-ключи, AES-256-GCM).
2707
3972
  * Приоритет — env `SYNTH_SECRET_KEY` (читать через `resolveSecretKey`).
@@ -2744,6 +4009,13 @@ 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[];
@@ -2760,6 +4032,13 @@ 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;
@@ -2770,6 +4049,27 @@ export declare const synthConfigSchema: z.ZodObject<{
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
+ };
2773
4073
  summarization: {
2774
4074
  provider: string;
2775
4075
  model: string;
@@ -2804,6 +4104,7 @@ export declare const synthConfigSchema: z.ZodObject<{
2804
4104
  networkPolicy: {
2805
4105
  mode: "allow" | "deny";
2806
4106
  list: string[];
4107
+ exceptions: string[];
2807
4108
  };
2808
4109
  };
2809
4110
  server: {
@@ -2841,6 +4142,12 @@ export declare const synthConfigSchema: z.ZodObject<{
2841
4142
  escalationProvider: string;
2842
4143
  escalationModel: string;
2843
4144
  };
4145
+ webhooks: {
4146
+ enabled: boolean;
4147
+ maxAttempts: number;
4148
+ timeoutMs: number;
4149
+ deliveryRetentionDays: number;
4150
+ };
2844
4151
  auth: {
2845
4152
  debugMode: boolean;
2846
4153
  sessionMaxAgeMinutes: number;
@@ -2860,6 +4167,55 @@ export declare const synthConfigSchema: z.ZodObject<{
2860
4167
  cliClientId: string;
2861
4168
  } | undefined;
2862
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
+ };
2863
4219
  llm: {
2864
4220
  defaultProvider: string;
2865
4221
  defaultModel: string;
@@ -2884,12 +4240,6 @@ export declare const synthConfigSchema: z.ZodObject<{
2884
4240
  };
2885
4241
  credentialsPath: string;
2886
4242
  };
2887
- storage: {
2888
- dataDir: string;
2889
- workspacesRoot: string;
2890
- defaultWorkspace: string;
2891
- workspaceOutsideRoot: "" | "deny" | "confirm";
2892
- };
2893
4243
  core: {
2894
4244
  apiKey: string;
2895
4245
  port: number;
@@ -2898,9 +4248,9 @@ export declare const synthConfigSchema: z.ZodObject<{
2898
4248
  port: number;
2899
4249
  backendUrl: string;
2900
4250
  enginePorts: {
2901
- synth: number;
2902
4251
  opencode: number;
2903
4252
  cline: number;
4253
+ synth: number;
2904
4254
  };
2905
4255
  proxyPort: number;
2906
4256
  };
@@ -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: "none" | "file";
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;
@@ -3059,6 +4424,13 @@ 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[];
@@ -3068,6 +4440,27 @@ export declare const synthConfigSchema: z.ZodObject<{
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;
3071
4464
  summarization?: {
3072
4465
  provider?: string | undefined;
3073
4466
  model?: string | undefined;
@@ -3102,6 +4495,7 @@ export declare const synthConfigSchema: z.ZodObject<{
3102
4495
  networkPolicy?: {
3103
4496
  mode?: "allow" | "deny" | undefined;
3104
4497
  list?: string[] | undefined;
4498
+ exceptions?: string[] | undefined;
3105
4499
  } | undefined;
3106
4500
  } | undefined;
3107
4501
  server?: {
@@ -3139,6 +4533,12 @@ export declare const synthConfigSchema: z.ZodObject<{
3139
4533
  escalationProvider?: string | undefined;
3140
4534
  escalationModel?: string | undefined;
3141
4535
  } | undefined;
4536
+ webhooks?: {
4537
+ enabled?: boolean | undefined;
4538
+ maxAttempts?: number | undefined;
4539
+ timeoutMs?: number | undefined;
4540
+ deliveryRetentionDays?: number | undefined;
4541
+ } | undefined;
3142
4542
  auth?: {
3143
4543
  apiKey?: string | undefined;
3144
4544
  debugMode?: boolean | undefined;
@@ -3158,6 +4558,55 @@ export declare const synthConfigSchema: z.ZodObject<{
3158
4558
  cliClientId?: string | undefined;
3159
4559
  } | undefined;
3160
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;
3161
4610
  llm?: {
3162
4611
  defaultProvider?: string | undefined;
3163
4612
  defaultModel?: string | undefined;
@@ -3182,12 +4631,6 @@ export declare const synthConfigSchema: z.ZodObject<{
3182
4631
  } | undefined;
3183
4632
  credentialsPath?: string | undefined;
3184
4633
  } | undefined;
3185
- storage?: {
3186
- dataDir?: string | undefined;
3187
- workspacesRoot?: string | undefined;
3188
- defaultWorkspace?: string | undefined;
3189
- workspaceOutsideRoot?: "" | "deny" | "confirm" | undefined;
3190
- } | undefined;
3191
4634
  core?: {
3192
4635
  apiKey?: string | undefined;
3193
4636
  port?: number | undefined;
@@ -3196,9 +4639,9 @@ export declare const synthConfigSchema: z.ZodObject<{
3196
4639
  port?: number | undefined;
3197
4640
  backendUrl?: string | undefined;
3198
4641
  enginePorts?: {
3199
- synth?: number | undefined;
3200
4642
  opencode?: number | undefined;
3201
4643
  cline?: number | undefined;
4644
+ synth?: number | undefined;
3202
4645
  } | undefined;
3203
4646
  proxyPort?: number | undefined;
3204
4647
  } | 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?: "none" | "file" | 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;
@@ -3356,6 +4814,13 @@ 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;
@@ -3368,6 +4833,8 @@ export declare const synthConfigSchema: z.ZodObject<{
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>;