@itphx/synth-shared 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/config/defaults.js +51 -1
  2. package/dist/config/env-overrides.d.ts +68 -0
  3. package/dist/config/env-overrides.js +165 -0
  4. package/dist/config/index.d.ts +1 -0
  5. package/dist/config/index.js +1 -0
  6. package/dist/config/loader.d.ts +3 -1
  7. package/dist/config/loader.js +12 -4
  8. package/dist/config/resolve.d.ts +23 -6
  9. package/dist/config/resolve.js +33 -12
  10. package/dist/config/types.d.ts +699 -146
  11. package/dist/config/types.js +195 -28
  12. package/dist/i18n/index.d.ts +1 -1
  13. package/dist/i18n/index.js +50 -8
  14. package/dist/index.d.ts +4 -2
  15. package/dist/index.js +3 -2
  16. package/dist/interfaces/index.d.ts +8 -1
  17. package/dist/schemas/index.d.ts +1723 -45
  18. package/dist/schemas/index.js +403 -29
  19. package/dist/skills/frontmatter.js +1 -1
  20. package/dist/types/agent.d.ts +30 -0
  21. package/dist/types/agent.js +1 -0
  22. package/dist/types/bus-events.d.ts +7 -0
  23. package/dist/types/bus-events.js +1 -0
  24. package/dist/types/commands.d.ts +10 -10
  25. package/dist/types/commands.js +2 -2
  26. package/dist/types/decision.d.ts +502 -0
  27. package/dist/types/decision.js +98 -0
  28. package/dist/types/events.d.ts +219 -0
  29. package/dist/types/events.js +1 -0
  30. package/dist/types/fs.d.ts +44 -0
  31. package/dist/types/fs.js +16 -0
  32. package/dist/types/git.d.ts +63 -0
  33. package/dist/types/git.js +1 -0
  34. package/dist/types/hooks.d.ts +96 -0
  35. package/dist/types/hooks.js +1 -0
  36. package/dist/types/index.d.ts +18 -1097
  37. package/dist/types/index.js +44 -215
  38. package/dist/types/llm.d.ts +32 -0
  39. package/dist/types/llm.js +8 -0
  40. package/dist/types/mcp.d.ts +104 -0
  41. package/dist/types/mcp.js +40 -0
  42. package/dist/types/message.d.ts +63 -0
  43. package/dist/types/message.js +12 -0
  44. package/dist/types/permission.d.ts +2 -2
  45. package/dist/types/permission.js +1 -1
  46. package/dist/types/project.d.ts +134 -0
  47. package/dist/types/project.js +67 -0
  48. package/dist/types/prompt.d.ts +236 -0
  49. package/dist/types/prompt.js +15 -0
  50. package/dist/types/provider.d.ts +84 -0
  51. package/dist/types/provider.js +35 -0
  52. package/dist/types/schedules.d.ts +109 -0
  53. package/dist/types/schedules.js +9 -0
  54. package/dist/types/service-keys.d.ts +106 -0
  55. package/dist/types/service-keys.js +72 -0
  56. package/dist/types/session.d.ts +269 -0
  57. package/dist/types/session.js +13 -0
  58. package/dist/types/skills.d.ts +11 -11
  59. package/dist/types/skills.js +6 -6
  60. package/dist/types/tools.d.ts +4 -3
  61. package/dist/types/tools.js +2 -0
  62. package/dist/types/user.d.ts +113 -0
  63. package/dist/types/user.js +31 -0
  64. package/dist/types/webhooks.d.ts +97 -0
  65. package/dist/types/webhooks.js +53 -0
  66. package/dist/utils/glob.d.ts +1 -1
  67. package/dist/utils/glob.js +1 -1
  68. package/dist/utils/index.js +2 -2
  69. package/dist/utils/workspace.js +1 -1
  70. package/dist/version.d.ts +1 -1
  71. package/dist/version.js +1 -1
  72. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { permissionConfigSchema } from '../types/permission.js';
3
- import { createToolsDisabledSchema } from '../schemas/index.js';
3
+ import { createToolsDisabledSchema, globalRoleSchema, serviceScopeSchema } from '../schemas/index.js';
4
4
  import { TOOLS_POLICIES, MCP_NETWORK_POLICY_MODES, COMMAND_CONFLICT_MODES, DEFAULT_MCP_PRIVATE_CIDRS, DEFAULT_MCP_NETWORK_POLICY, DEFAULT_LLM_GATEWAY_RATE_LIMIT, ToolCapability, } from '../types/index.js';
5
5
  const toolCapabilityValues = Object.values(ToolCapability);
6
6
  // --- SynthConfig: единый конфиг для всех компонентов ---
@@ -16,7 +16,7 @@ export const storageConfigSchema = z.object({
16
16
  /** Рабочий каталог по умолчанию для сессий без проекта. Резолвится от dataDir: {dataDir}/workspaces/default. */
17
17
  defaultWorkspace: z.string().default(''),
18
18
  /**
19
- * AD-075: политика для абсолютного `project.workspace` вне `workspacesRoot`
19
+ * ADR-075: политика для абсолютного `project.workspace` вне `workspacesRoot`
20
20
  * (`confirm` — подтверждение, `deny` — запрет). `''` — не задано (эффективно
21
21
  * `confirm`), читать через `resolveWorkspaceOutsideRootPolicy`.
22
22
  */
@@ -51,7 +51,7 @@ export const llmConfigSchema = z.object({
51
51
  defaultModel: z.string().default(''),
52
52
  maxRetries: z.number().int().min(0).default(3),
53
53
  timeout: z.number().int().min(1).default(60),
54
- /** AD-070 §2.2: политика prompt-cache — auto (ставить маркеры) | none (отключить). */
54
+ /** ADR-070 §2.2: политика prompt-cache — auto (ставить маркеры) | none (отключить). */
55
55
  cache: z.enum(['auto', 'none']).default('auto'),
56
56
  });
57
57
  export const coreConfigSchema = z.object({
@@ -86,7 +86,7 @@ export const tsmConfigSchema = z.object({
86
86
  maxIterations: z.number().int().min(1).default(50),
87
87
  validationTimeout: z.number().int().min(1).default(30),
88
88
  });
89
- // --- Session (AD-025 / AD-028): настройки по умолчанию для сессий ---
89
+ // --- Session (ADR-025 / ADR-028): настройки по умолчанию для сессий ---
90
90
  export const sessionConfigSchema = z.object({
91
91
  /** Строгость цикла Plan→Build по умолчанию для новых сессий: auto | strict | off. */
92
92
  planMode: z.enum(['auto', 'strict', 'off']).default('auto'),
@@ -102,7 +102,7 @@ export const summarizationConfigSchema = z.object({
102
102
  });
103
103
  export const mcpServerConfigSchema = z.object({
104
104
  type: z.enum(['stdio', 'sse', 'http']),
105
- /** AD-071 §2.2: человекочитаемое описание сервера (попадает в блок `mcp.servers`). */
105
+ /** ADR-071 §2.2: человекочитаемое описание сервера (попадает в блок `mcp.servers`). */
106
106
  description: z.string().optional(),
107
107
  command: z.string().optional(),
108
108
  args: z.array(z.string()).optional(),
@@ -124,7 +124,7 @@ export const mcpServerConfigSchema = z.object({
124
124
  connectTimeout: z.number().int().min(1).optional(),
125
125
  });
126
126
  /**
127
- * AD-071 §2.3.1: политика сетевого доступа пользовательских HTTP MCP-серверов.
127
+ * ADR-071 §2.3.1: политика сетевого доступа пользовательских HTTP MCP-серверов.
128
128
  * Дефолт — `deny` приватных/служебных диапазонов (SSRF/egress).
129
129
  */
130
130
  export const mcpNetworkPolicySchema = z.object({
@@ -135,32 +135,32 @@ export const mcpConfigSchema = z.object({
135
135
  servers: z.record(z.string(), mcpServerConfigSchema).default({}),
136
136
  networkPolicy: mcpNetworkPolicySchema.default({}),
137
137
  /**
138
- * AD-071 §2.3: глобальная админская политика включения **MCP**-инструментов.
138
+ * ADR-071 §2.3: глобальная админская политика включения **MCP**-инструментов.
139
139
  * Независима от `tools.policy` (только встроенные). Per-session override —
140
140
  * `SessionSettings.mcpPolicy`.
141
141
  */
142
142
  policy: z.enum(TOOLS_POLICIES).default('auto'),
143
143
  });
144
- // --- Инструменты (AD-071 §2.3) ---
144
+ // --- Инструменты (ADR-071 §2.3) ---
145
145
  /**
146
- * AD-071 §2.6: instance-wide жёсткое отключение инструментов администратором.
146
+ * ADR-071 §2.6: instance-wide жёсткое отключение инструментов администратором.
147
147
  * Отключённые тулы не попадают в запрос независимо от `tools.policy`.
148
148
  * `runtime`-capability неотключаема (ядро сессии).
149
149
  */
150
150
  export const toolsDisabledConfigSchema = createToolsDisabledSchema(false);
151
151
  /**
152
- * AD-071 §2.3: глобальная админская политика включения **встроенных**
152
+ * ADR-071 §2.3: глобальная админская политика включения **встроенных**
153
153
  * инструментов (MCP — отдельная `mcp.policy`). Per-session override —
154
154
  * `SessionSettings.toolsPolicy`.
155
155
  */
156
156
  export const toolsConfigSchema = z.object({
157
157
  policy: z.enum(TOOLS_POLICIES).default('auto'),
158
- /** AD-071 §2.6: instance-wide отключение инструментов (admin). */
158
+ /** ADR-071 §2.6: instance-wide отключение инструментов (admin). */
159
159
  disabled: toolsDisabledConfigSchema.default({}),
160
160
  });
161
- // --- Скиллы (AD-046) ---
161
+ // --- Скиллы (ADR-046) ---
162
162
  /**
163
- * AD-046 §4.2/§4.4/§7.4: конфигурация механизма скиллов.
163
+ * ADR-046 §4.2/§4.4/§7.4: конфигурация механизма скиллов.
164
164
  * `paths` — дополнительные пользовательские каталоги; `trustedProjectDirs` —
165
165
  * доверенные проектные каталоги (бинарный trust); `inlineShell` — выключатель
166
166
  * `!`cmd`` в шаблонных командах (по умолчанию выключено).
@@ -168,27 +168,27 @@ export const toolsConfigSchema = z.object({
168
168
  * `urls` — внешние удалённые каталоги (opencode-совместимый `index.json`):
169
169
  * **только read-only индексация** — скачиваются в `{dataDir}/skills-cache/urls`,
170
170
  * видны в реестре/диагностике, но `trusted: false` (в каталог для модели не
171
- * попадают, тело не грузится). Установка/доверие/подписи/`lock.json` — AD-068.
171
+ * попадают, тело не грузится). Установка/доверие/подписи/`lock.json` — PROP-068.
172
172
  *
173
173
  * Внешние локальные каталоги совместимости (`.opencode`, `.claude`, `.agents`,
174
- * `~/.config/opencode`) подключаются как read-only discovery в core (AD-046 §4.2).
174
+ * `~/.config/opencode`) подключаются как read-only discovery в core (ADR-046 §4.2).
175
175
  */
176
176
  export const skillsConfigSchema = z.object({
177
177
  paths: z.array(z.string()).default([]),
178
- /** AD-046 §4.2/§4.3: удалённые каталоги — read-only индексация (`trusted: false`). */
178
+ /** ADR-046 §4.2/§4.3: удалённые каталоги — read-only индексация (`trusted: false`). */
179
179
  urls: z.array(z.string()).default([]),
180
180
  trustedProjectDirs: z.array(z.string()).default([]),
181
181
  inlineShell: z.boolean().default(false),
182
182
  /**
183
- * AD-046 §3.2/§12: именованные группы тулов → capabilities. Используется
183
+ * ADR-046 §3.2/§12: именованные группы тулов → capabilities. Используется
184
184
  * для экспансии `metadata.synth.requires_toolsets` в проверку доступности
185
185
  * скилла (union с `requires_capabilities`).
186
186
  */
187
187
  toolsets: z.record(z.string(), z.array(z.enum(toolCapabilityValues))).default({}),
188
188
  });
189
- // --- Slash-команды (AD-046 §7) ---
189
+ // --- Slash-команды (ADR-046 §7) ---
190
190
  /**
191
- * AD-046 §7/§9.4: конфигурация slash-команд. `paths` — дополнительные каталоги
191
+ * ADR-046 §7/§9.4: конфигурация slash-команд. `paths` — дополнительные каталоги
192
192
  * шаблонных `.md`-команд; `bundlesPath` — подкаталог `{dataDir}` для YAML-бандлов;
193
193
  * `conflict` — режим разрешения конфликтов имён (см. resolver).
194
194
  */
@@ -204,9 +204,150 @@ export const commandsConfigSchema = z.object({
204
204
  maxArgumentsLength: z.number().int().min(1).default(10_000),
205
205
  maxRenderedBytes: z.number().int().min(1).default(200_000),
206
206
  });
207
- // --- Проектные инструкции (AD-069) ---
207
+ // --- Внешние события (ADR-089) ---
208
208
  /**
209
- * AD-069 §3.4/§11: дополнительный источник проектных инструкций.
209
+ * ADR-089: конфигурация приёма внешних событий.
210
+ * - `enabled` — мастер-выключатель приёма событий;
211
+ * - `defaultMode` — режим по умолчанию, если Router не выбрал иной;
212
+ * - `ephemeralTtl` — TTL ephemeral-сессий по умолчанию;
213
+ * - `journalRetentionDays` — срок хранения журнала событий (0 — без ограничения);
214
+ * - `allowedSources` — белый список источников (пусто — разрешены все);
215
+ * - `dedupStore` — источник дедупа событий: `memory` (in-process `Set`, поведение
216
+ * single-process) | `file` (межпроцессный атомарный claim файлами-маркерами на
217
+ * общем `dataDir`). Default — `memory` (OFF): поведение single-process не меняется;
218
+ * - `unknownAgentTemplate` — поведение, если `agentTemplate` события/правила не
219
+ * резолвится в существующего enabled-агента: `drop` — не создавать сессию и
220
+ * зафиксировать ошибку `agent_not_found` в журнале (fail-safe, default) |
221
+ * `default-agent` — не задавать `agentRole` (сессия возьмёт агента по умолчанию);
222
+ * - `keyRateLimitPerMinute` — глобальный дефолт лимита запросов/мин на API-ключ
223
+ * привязки (0 — без лимита; конкретный ключ может переопределить);
224
+ * - `decisionRouting` — ADR-084 × ADR-089: умная классификация внешних событий
225
+ * decision-моделью. `false` (default, opt-in) — только декларативные правила
226
+ * (`ProjectRuleProvider`); `true` — при промахе правил decision-модель выбирает
227
+ * шаблон агента для ephemeral-сессии. Fail-safe: ошибка/неуверенность/пустой
228
+ * список агентов → фоллбек Router (`defaultMode`);
229
+ * - `autoBind` — ADR-089: фоллбек Router закрепляет событие с `identity.chatKey`/
230
+ * `threadKey` за новой сессией (`EventBinding` `mode='bound'`) вместо
231
+ * `defaultMode`. `false` (default) — поведение не меняется; влияет только на
232
+ * фоллбек;
233
+ * - `autoBindAgentTemplate` — шаблон агента для auto-bind-сессий (пусто — агент
234
+ * по умолчанию);
235
+ * - `identityMap` — ADR-089: маппинг идентичности внешнего отправителя на
236
+ * владельца синт-сессии. Ключ — `identity.chatKey` (`chat:telegram:<id>`) или
237
+ * `identity.principalId` (`tg:<id>`), значение — id пользователя
238
+ * синт-инстанса. Применяется при материализации сессий `ephemeral`/`bind`:
239
+ * совпадение (сначала `chatKey`, затем `principalId`) задаёт владельца сессии.
240
+ * Пусто (default) — сессия принадлежит аутентифицированному пользователю
241
+ * запроса (или `identity.principalId`/`resolveOwnerId`), прежнее поведение.
242
+ */
243
+ export const eventsConfigSchema = z.object({
244
+ enabled: z.boolean().default(true),
245
+ defaultMode: z.enum(['bound', 'ephemeral']).default('bound'),
246
+ ephemeralTtl: z.string().default('24h'),
247
+ journalRetentionDays: z.number().int().min(0).default(30),
248
+ allowedSources: z.array(z.string()).default([]),
249
+ dedupStore: z.enum(['memory', 'file']).default('memory'),
250
+ unknownAgentTemplate: z.enum(['drop', 'default-agent']).default('drop'),
251
+ /**
252
+ * Глобальный дефолт лимита запросов/мин на API-ключ привязки (ADR-089/ADR-052).
253
+ * `0` — без лимита; конкретный ключ может переопределить своим
254
+ * `rateLimitPerMinute`.
255
+ */
256
+ keyRateLimitPerMinute: z.number().int().min(0).default(0),
257
+ /**
258
+ * ADR-084 × ADR-089: decision-маршрутизация внешних событий. По умолчанию
259
+ * выключена (поведение не меняется) — включение требует настроенного
260
+ * decision-провайдера (`decision.enabled`).
261
+ */
262
+ decisionRouting: z.boolean().default(false),
263
+ /**
264
+ * ADR-089 (auto-bind): фоллбек Router — если у события есть `identity.chatKey`
265
+ * или `identity.threadKey`, закрепить его за новой сессией (создать
266
+ * `EventBinding` `mode='bound'`) вместо `defaultMode`. По умолчанию выключено
267
+ * (поведение не меняется). Влияет **только** на фоллбек — явный binding,
268
+ * правила и decision-маршрутизация сохраняют своё поведение.
269
+ */
270
+ autoBind: z.boolean().default(false),
271
+ /**
272
+ * ADR-089 (auto-bind): шаблон агента для auto-bind-сессий (пусто — агент по
273
+ * умолчанию; резолвится через `AgentRegistry` с политикой `unknownAgentTemplate`).
274
+ */
275
+ autoBindAgentTemplate: z.string().default(''),
276
+ /**
277
+ * ADR-089: маппинг идентичности внешнего отправителя (`identity.chatKey` или
278
+ * `identity.principalId`) на владельца синт-сессии (id пользователя
279
+ * инстанса). Применяется при материализации `ephemeral`/`bind`; пусто —
280
+ * владелец не переопределяется (аутентифицированный пользователь запроса,
281
+ * `identity.principalId` или `resolveOwnerId`).
282
+ */
283
+ identityMap: z.record(z.string(), z.string()).default({}),
284
+ });
285
+ // --- Планировщик расписаний (ADR-051 срез / ADR-089) ---
286
+ /**
287
+ * ADR-051 (минимальный срез) / ADR-089: конфигурация cron/interval-планировщика.
288
+ * - `enabled` — мастер-выключатель сервиса (в standalone гейтит `start()`);
289
+ * - `tickSec` — период тика, секунды (1..3600);
290
+ * - `catchUp` — дефолт поведения при пропущенном срабатывании (`skip`/`once`);
291
+ * - `jobRetentionDays` — срок хранения Job-истории (дни, `prune` на старте);
292
+ * - `leaderElection` — выбор лидера-владельца тикера: `none` (каждый процесс
293
+ * считает себя лидером, поведение single-process) | `file` (file-based lock на
294
+ * общем `dataDir`). Default — `none` (OFF);
295
+ * - `crossProcessLocks` — межпроцессная сериализация мутаций `ScheduleStore`
296
+ * (file-мьютекс поверх in-process `AsyncLock`). Default — `false` (OFF):
297
+ * поведение single-process не меняется.
298
+ */
299
+ export const schedulerConfigSchema = z.object({
300
+ enabled: z.boolean().default(true),
301
+ tickSec: z.number().int().min(1).max(3600).default(60),
302
+ catchUp: z.enum(['skip', 'once']).default('skip'),
303
+ jobRetentionDays: z.number().int().min(0).default(30),
304
+ leaderElection: z.enum(['none', 'file']).default('none'),
305
+ crossProcessLocks: z.boolean().default(false),
306
+ });
307
+ // --- Decision-модели (ADR-084) ---
308
+ /**
309
+ * ADR-084: конфигурация класса decision-моделей (System One: Clef/Jev/…).
310
+ * - `enabled` — мастер-выключатель decision-слоя (по умолчанию выключен);
311
+ * - `provider` — имя провайдера decision-типа (`decision`/`systemone`);
312
+ * - `model` — модель decision-слоя (напр. `clef-flash`);
313
+ * - `confidenceThreshold` — порог уверенности, ниже — fallback (fail-safe);
314
+ * - `escalationProvider`/`escalationModel` — необязательный точный тир на
315
+ * эскалацию (вторая пара provider/model, напр. Clef): при промахе primary
316
+ * decision-каскад пробует эскалацию. Пусто — эскалации нет.
317
+ *
318
+ * Транспорт задаётся типом провайдера (`decision` → `POST {base}/decisions`,
319
+ * `systemone` → `POST {base}/v1/systemone`), а таймаут — свойством провайдера.
320
+ */
321
+ export const decisionConfigSchema = z.object({
322
+ enabled: z.boolean().default(false),
323
+ provider: z.string().default(''),
324
+ model: z.string().default(''),
325
+ confidenceThreshold: z.number().min(0).max(1).default(0.6),
326
+ /** ADR-084: провайдер тира эскалации; пусто — эскалации нет. */
327
+ escalationProvider: z.string().default(''),
328
+ /** ADR-084: модель тира эскалации; пусто — эскалации нет. */
329
+ escalationModel: z.string().default(''),
330
+ });
331
+ // --- Webhooks (ADR-052, этап II) ---
332
+ /**
333
+ * ADR-052 (этап II): конфигурация исходящих webhooks.
334
+ * - `enabled` — мастер-выключатель доставки (по умолчанию выключен);
335
+ * - `maxAttempts` — число HTTP-попыток на доставку (экспоненциальный backoff с джиттером);
336
+ * - `timeoutMs` — таймаут одного HTTP-запроса;
337
+ * - `allowPrivateTargets` — разрешить http и приватные/loopback адреса (для dev;
338
+ * по умолчанию `false` — только https и публичные адреса, защита от SSRF);
339
+ * - `deliveryRetentionDays` — срок хранения журнала доставок (0 — без ограничения).
340
+ */
341
+ export const webhooksConfigSchema = z.object({
342
+ enabled: z.boolean().default(false),
343
+ maxAttempts: z.number().int().min(1).max(10).default(5),
344
+ timeoutMs: z.number().int().min(1).default(10_000),
345
+ allowPrivateTargets: z.boolean().default(false),
346
+ deliveryRetentionDays: z.number().int().min(0).default(30),
347
+ });
348
+ // --- Проектные инструкции (ADR-069) ---
349
+ /**
350
+ * ADR-069 §3.4/§11: дополнительный источник проектных инструкций.
210
351
  * `position` задаёт место в порядке: `before` — перед merged chain, `after` —
211
352
  * после. `ttlSec` (только для URL) переопределяет `instructions.fetch.cacheTtlSec`.
212
353
  */
@@ -218,7 +359,7 @@ export const instructionSourceConfigSchema = z.object({
218
359
  ttlSec: z.number().int().min(0).optional(),
219
360
  });
220
361
  /**
221
- * AD-069 §4: параметры lazy-догрузки подкаталогов (реализация — Фаза 2;
362
+ * ADR-069 §4: параметры lazy-догрузки подкаталогов (реализация — Фаза 2;
222
363
  * схема заводится в Фазе 1).
223
364
  */
224
365
  export const instructionsLazyConfigSchema = z.object({
@@ -230,7 +371,7 @@ export const instructionsLazyConfigSchema = z.object({
230
371
  .default(['node_modules', '.git', 'vendor', 'dist', 'build', '.next', 'coverage', 'tmp', '.cache']),
231
372
  });
232
373
  /**
233
- * AD-069 §5.1/§9.1: параметры fetch URL-источников (без фонового таймера —
374
+ * ADR-069 §5.1/§9.1: параметры fetch URL-источников (без фонового таймера —
234
375
  * загрузка при старте + TTL-кэш). Реализация fetch — Фаза 2.
235
376
  */
236
377
  export const instructionsFetchConfigSchema = z.object({
@@ -239,7 +380,7 @@ export const instructionsFetchConfigSchema = z.object({
239
380
  maxBytes: z.number().int().min(1).default(262_144),
240
381
  });
241
382
  /**
242
- * AD-069 §5.1/§9.1: конфигурация проектных инструкций (`AGENTS.md` и совместимые).
383
+ * ADR-069 §5.1/§9.1: конфигурация проектных инструкций (`AGENTS.md` и совместимые).
243
384
  * Порядок: `sources` с `position: before` → merged chain (`git root → … → cwd`) →
244
385
  * `sources` с `position: after`. Кап — динамический от окна модели.
245
386
  */
@@ -283,17 +424,39 @@ export const protectedPathsConfigSchema = z.object({
283
424
  /** Глобальный выключатель защиты защищённых путей (сквозная проверка файловых тулов). */
284
425
  enabled: z.boolean().default(true),
285
426
  });
427
+ /**
428
+ * ADR-052/O1: installer service-key, провижининг которого делается при старте из
429
+ * конфига/Secret (идемпотентно). `secret` — plaintext-секрет `synth_svc_…`
430
+ * (приходит из env/Secret; in config.yaml держать не рекомендуется). `scopes` —
431
+ * только известные (`serviceScopeSchema`); `roles` не заданы — дефолт хранилища.
432
+ */
433
+ export const bootstrapServiceKeySchema = z.object({
434
+ label: z.string().trim().min(1),
435
+ secret: z.string().min(1),
436
+ scopes: z.array(serviceScopeSchema).min(1),
437
+ roles: z.array(globalRoleSchema).optional(),
438
+ description: z.string().optional(),
439
+ });
440
+ export const bootstrapServiceKeysSchema = z.array(bootstrapServiceKeySchema);
286
441
  export const securityConfigSchema = z.object({
287
442
  promptInjection: promptInjectionConfigSchema.default({}),
288
443
  protectedPaths: protectedPathsConfigSchema.default({}),
289
444
  /**
290
- * AD-076: мастер-ключ для шифрования секретов at-rest (SSH-ключи, AES-256-GCM).
445
+ * ADR-076: мастер-ключ для шифрования секретов at-rest (SSH-ключи, AES-256-GCM).
291
446
  * Приоритет — env `SYNTH_SECRET_KEY` (читать через `resolveSecretKey`).
292
447
  * Пусто — core использует файл `{dataDir}/secrets/master.key`.
293
448
  */
294
449
  secretKey: z.string().default(''),
450
+ /**
451
+ * ADR-052/O1: installer service-key'и, провижининг которых выполняется
452
+ * идемпотентно при старте (core standalone и backend). Может задаваться
453
+ * JSON-строкой через env `SYNTH_BOOTSTRAP_SERVICE_KEYS` (приоритетнее
454
+ * config.yaml) — так секрет не попадает в файл конфигурации.
455
+ * Опционально (legacy/литеральные SecurityConfig без поля — валидны).
456
+ */
457
+ bootstrapServiceKeys: bootstrapServiceKeysSchema.optional(),
295
458
  });
296
- // --- LLM Gateway (AD-036) ---
459
+ // --- LLM Gateway (ADR-036) ---
297
460
  export const llmGatewayRateLimitConfigSchema = z.object({
298
461
  userPerMinute: z.number().int().min(1).default(DEFAULT_LLM_GATEWAY_RATE_LIMIT.userPerMinute),
299
462
  providerPerMinute: z.number().int().min(1).default(DEFAULT_LLM_GATEWAY_RATE_LIMIT.providerPerMinute),
@@ -314,7 +477,7 @@ export const llmGatewayConfigSchema = z.object({
314
477
  rateLimit: llmGatewayRateLimitConfigSchema.default({}),
315
478
  audit: llmGatewayAuditConfigSchema.default({}),
316
479
  });
317
- // --- Router (AD-034) ---
480
+ // --- Router (ADR-034) ---
318
481
  export const routerContentConfigSchema = z.object({
319
482
  coding: z.object({
320
483
  provider: z.string().default(''),
@@ -350,7 +513,7 @@ export const routerSubagentConfigSchema = z.object({
350
513
  model: z.string().default(''),
351
514
  provider: z.string().default(''),
352
515
  });
353
- // --- Micro-first (AD-035) ---
516
+ // --- Micro-first (ADR-035) ---
354
517
  export const microFirstConfigSchema = z.object({
355
518
  enabled: z.boolean().default(false),
356
519
  confidenceThreshold: z.number().min(0).max(1).default(0.8),
@@ -416,6 +579,10 @@ export const synthConfigSchema = z.object({
416
579
  tools: toolsConfigSchema.default({}),
417
580
  skills: skillsConfigSchema.default({}),
418
581
  commands: commandsConfigSchema.default({}),
582
+ events: eventsConfigSchema.default({}),
583
+ scheduler: schedulerConfigSchema.default({}),
584
+ decision: decisionConfigSchema.default({}),
585
+ webhooks: webhooksConfigSchema.default({}),
419
586
  instructions: instructionsConfigSchema.default({}),
420
587
  router: routerConfigSchema.default({}),
421
588
  remote: remoteConfigSchema.default({}),
@@ -11,7 +11,7 @@
11
11
  * - `ENGINE_MESSAGE_PARAMS` — для каждого ключа имена {param}-плейсхолдеров en-шаблона.
12
12
  * - `extractParams` — утилита извлечения плейсхолдеров (без логики движка).
13
13
  */
14
- export declare const ENGINE_MESSAGE_KEYS: readonly ["session.max_iterations", "session.stopped", "session.stopped_reason_denied", "session.denied_blocked", "session.empty_response", "session.dialog_title", "session.default_title", "session.reference_label", "session.reference_link", "session.retry_cancelled", "session.subtask_title", "task.stopped_by_user", "task.stopped_before_completion", "task.stopped_by_deny", "task.empty_response", "task.subagent_exec_error", "task.subagent_not_found", "task.subagent_not_allowed", "task.deps_unavailable", "task.subagent_exec_error_after_retries", "task.resume_marker", "task.resume_result", "task.resume_failed", "task.resume_aborted", "task.resume_session_not_found", "task.resume_no_parent", "task.resume_parent_not_found", "task.resume_locked", "task.resume_agent_not_found", "task.resume_provider_unavailable", "tool.args_error", "tool.exec_error", "tool.not_found", "tool.permission_denied_default", "tool.doom_loop", "tool.empty_output", "tool.output_truncated", "tool.shell_error", "tool.command_failed_default", "tool.aborted", "tool.binary_missing", "fs.file_written", "fs.file_edited", "fs.replace_not_found", "fs.replace_multiple", "fs.dir_created", "fs.file_deleted", "fsread.empty_directory", "fsread.no_files", "fsread.glob_error", "web.duckduckgo_blocked", "web.search_failed", "web.search_results", "web.fetch_args_url_required", "web.js_framework_warning", "web.low_content_warning", "web.content_truncated", "web.block_timeout", "web.block_error", "web.fetch_all_failed", "web.no_results", "web.search_error", "search.no_matches", "search.matches_truncated", "search.rg_not_installed", "search.error", "plan.enter_success", "plan.exit_success", "plan.session_manager_unavailable", "plan.enter_failed", "plan.exit_failed", "plan.project_store_unavailable", "plan.no_project", "plan.no_project_read", "plan.column_not_found", "plan.item_not_found", "plan.save_error", "plan.markdown_title", "plan.markdown_empty", "plan.markdown_column_empty", "plan.markdown_dependencies", "plan.default_column_backlog", "plan.default_column_todo", "plan.default_column_in_progress", "plan.default_column_done", "todo.save_error", "todo.read_error", "todo.list_empty", "todo.list", "todo.item_not_found", "todo.items_not_found", "todo.status_pending", "todo.status_in_progress", "todo.status_completed", "todo.status_cancelled", "todo.priority_high", "todo.priority_medium", "todo.priority_low", "project.deps_unavailable", "project.session_read_error", "project.session_not_found", "project.save_error", "project.workspace_create_error", "project.created", "project.read_error", "project.not_found", "project.attached", "project.log_no_project", "project.log_save_error", "project.log_added", "project.log_empty", "project.log_list", "project.invariants_no_project", "project.invariants_empty", "project.invariants_saved", "project.invariants_save_error", "project.write_forbidden", "project.updated", "project.updated_ok", "project.invalid_icon", "project.invalid_color", "project.no_project", "project.workspace_set", "project.workspace_invalid", "project.workspace_denied", "project.workspace_confirm_required", "project.workspace_missing", "project.repo_cloned", "project.repo_initialized", "project.repo_registered", "project.repo_fetched", "project.repo_removed", "project.repo_not_found", "projectctx.info_title", "projectctx.info_id", "projectctx.info_workspace", "projectctx.info_description", "projectctx.not_found", "projectctx.missing", "projectctx.working_dir", "projectctx.no_plan_hint", "projectctx.git_section", "projectctx.repo_branch", "projectctx.repo_remote", "projectctx.repo_state", "projectctx.repo_state_dirty", "projectctx.repo_state_clean", "projectctx.repo_last_commit", "projectctx.repos_title", "projectctx.repo_not_found", "projectctx.repos_none", "projectctx.repos_found", "projectctx.repo_destination", "projectctx.repo_name", "projectctx.repo_url", "projectctx.repo_type", "projectctx.repo_default_branch", "projectctx.repo_ssh_key", "projectctx.repo_last_fetch", "tool.classified", "reference.session_manager_unavailable", "reference.session_not_found", "reference.no_messages", "reference.session_title", "permission.yolo_auto_approved", "permission.plan_write_blocked", "permission.plan_source_mode", "permission.plan_source_strict", "permission.plan_shell_denied", "permission.mcp_unavailable", "permission.dep_unavailable", "permission.workspace_unavailable", "permission.no_rules", "permission.rule_matched", "permission.rule_pattern_matched", "permission.rule_prefix_matched", "permission.rule_command_matched", "permission.ask_timeout", "permission.ask_no_subscribers", "permission.ask_denied", "shellguard.allow_default", "shellguard.deny_prefix", "shellguard.deny_path", "shellguard.ask_path", "shellguard.deny_dir", "protectedpaths.unresolvable", "protectedpaths.dynamic", "protectedpaths.allow_default", "security.warn_prefix", "security.injection_blocked", "gateway.input_blocked", "gateway.rate_limit_warning", "gateway.output_secrets_reason", "router.timeout", "router.network_error", "router.provider_not_found", "router.provider_unspecified", "router.escalation", "router.context_length_exceeded", "router.rate_limit_exceeded", "qc.min_length_ok", "qc.min_length_fail_detail", "qc.min_length_fail", "qc.constraint_empty", "qc.constraint_parse_error", "qc.constraint_ok", "qc.self_check_skipped", "qc.self_check_unparsed", "qc.self_check_low", "qc.self_check_low_reason", "qc.self_check_ok", "qc.self_check_error", "qc.all_passed", "micro.greeting", "micro.farewell", "micro.thanks", "micro.enum.yes", "micro.enum.no", "micro.enum.approve", "micro.enum.reject", "micro.enum.mode_plan", "micro.enum.mode_act", "micro.intent.question", "micro.intent.command", "micro.intent.review", "micro.intent.explain", "micro.intent.debug", "micro.intent.fix", "micro.intent.test", "skill.args_error", "skill.not_found", "skill.untrusted", "skill.delegation", "skill.file_not_found", "skill.scope_disabled", "command.unknown", "command.denied", "command.unavailable", "command.help", "command.list_empty", "command.skills_empty", "command.summary_enqueued", "command.summary_unavailable", "command.inline_shell_disabled", "command.inline_shell_denied", "command.inline_shell_failed", "command.inline_shell_truncated", "command.inline_shell_unavailable", "sshkey.not_found", "sshkey.name_exists", "sshkey.encryption_unavailable", "sshkey.decrypt_failed", "sshkey.env_failed", "git.ssh_key_required", "git.repo_path_invalid", "git.repo_exists"];
14
+ export declare const ENGINE_MESSAGE_KEYS: readonly ["session.max_iterations", "session.stopped", "session.stopped_reason_denied", "session.denied_blocked", "session.empty_response", "session.dialog_title", "session.default_title", "session.reference_label", "session.reference_link", "session.retry_cancelled", "session.subtask_title", "task.stopped_by_user", "task.stopped_before_completion", "task.stopped_by_deny", "task.empty_response", "task.subagent_exec_error", "task.subagent_not_found", "task.subagent_not_allowed", "task.deps_unavailable", "task.subagent_exec_error_after_retries", "task.resume_marker", "task.resume_result", "task.resume_failed", "task.resume_aborted", "task.resume_session_not_found", "task.resume_no_parent", "task.resume_parent_not_found", "task.resume_locked", "task.resume_agent_not_found", "task.resume_provider_unavailable", "tool.args_error", "tool.exec_error", "tool.not_found", "tool.permission_denied_default", "tool.doom_loop", "tool.empty_output", "tool.output_truncated", "tool.shell_error", "tool.command_failed_default", "tool.aborted", "tool.binary_missing", "fs.file_written", "fs.file_edited", "fs.replace_not_found", "fs.replace_multiple", "fs.dir_created", "fs.file_deleted", "fsread.empty_directory", "fsread.no_files", "fsread.glob_error", "web.duckduckgo_blocked", "web.search_failed", "web.search_results", "web.fetch_args_url_required", "web.js_framework_warning", "web.low_content_warning", "web.content_truncated", "web.block_timeout", "web.block_error", "web.fetch_all_failed", "web.no_results", "web.search_error", "web.ssrf_blocked", "web.too_many_redirects", "search.no_matches", "search.matches_truncated", "search.rg_not_installed", "search.error", "plan.enter_success", "plan.exit_success", "plan.session_manager_unavailable", "plan.enter_failed", "plan.exit_failed", "plan.project_store_unavailable", "plan.no_project", "plan.no_project_read", "plan.column_not_found", "plan.item_not_found", "plan.save_error", "plan.markdown_title", "plan.markdown_empty", "plan.markdown_column_empty", "plan.markdown_dependencies", "plan.default_column_backlog", "plan.default_column_todo", "plan.default_column_in_progress", "plan.default_column_done", "todo.save_error", "todo.read_error", "todo.list_empty", "todo.list", "todo.item_not_found", "todo.items_not_found", "todo.status_pending", "todo.status_in_progress", "todo.status_completed", "todo.status_cancelled", "todo.priority_high", "todo.priority_medium", "todo.priority_low", "project.deps_unavailable", "project.session_read_error", "project.session_not_found", "project.save_error", "project.workspace_create_error", "project.created", "project.read_error", "project.not_found", "project.attached", "project.log_no_project", "project.log_save_error", "project.log_added", "project.log_empty", "project.log_list", "project.invariants_no_project", "project.invariants_empty", "project.invariants_saved", "project.invariants_save_error", "project.write_forbidden", "project.updated", "project.updated_ok", "project.invalid_icon", "project.invalid_color", "project.no_project", "project.workspace_set", "project.workspace_invalid", "project.workspace_denied", "project.workspace_confirm_required", "project.workspace_missing", "project.repo_cloned", "project.repo_initialized", "project.repo_registered", "project.repo_fetched", "project.repo_removed", "project.repo_not_found", "projectctx.info_title", "projectctx.info_id", "projectctx.info_workspace", "projectctx.info_description", "projectctx.not_found", "projectctx.missing", "projectctx.working_dir", "projectctx.no_plan_hint", "projectctx.git_section", "projectctx.repo_branch", "projectctx.repo_remote", "projectctx.repo_state", "projectctx.repo_state_dirty", "projectctx.repo_state_clean", "projectctx.repo_last_commit", "projectctx.repos_title", "projectctx.repo_not_found", "projectctx.repos_none", "projectctx.repos_found", "projectctx.repo_destination", "projectctx.repo_name", "projectctx.repo_url", "projectctx.repo_type", "projectctx.repo_default_branch", "projectctx.repo_ssh_key", "projectctx.repo_last_fetch", "tool.classified", "reference.session_manager_unavailable", "reference.session_not_found", "reference.no_messages", "reference.session_title", "permission.yolo_auto_approved", "permission.plan_write_blocked", "permission.plan_source_mode", "permission.plan_source_strict", "permission.plan_shell_denied", "permission.mcp_unavailable", "permission.dep_unavailable", "permission.workspace_unavailable", "permission.external_directory_default", "permission.no_rules", "permission.rule_matched", "permission.rule_pattern_matched", "permission.rule_prefix_matched", "permission.rule_command_matched", "permission.ask_timeout", "permission.ask_no_subscribers", "permission.ask_denied", "shellguard.allow_default", "shellguard.deny_prefix", "shellguard.deny_path", "shellguard.ask_path", "shellguard.deny_dir", "protectedpaths.unresolvable", "protectedpaths.dynamic", "protectedpaths.allow_default", "security.warn_prefix", "security.injection_blocked", "gateway.input_blocked", "gateway.rate_limit_warning", "gateway.output_secrets_reason", "router.timeout", "router.network_error", "router.provider_not_found", "router.provider_unspecified", "router.escalation", "router.context_length_exceeded", "router.rate_limit_exceeded", "router.no_user_query", "qc.min_length_ok", "qc.min_length_fail_detail", "qc.min_length_fail", "qc.constraint_empty", "qc.constraint_parse_error", "qc.constraint_ok", "qc.self_check_skipped", "qc.self_check_unparsed", "qc.self_check_low", "qc.self_check_low_reason", "qc.self_check_ok", "qc.self_check_error", "qc.all_passed", "micro.greeting", "micro.farewell", "micro.thanks", "micro.enum.yes", "micro.enum.no", "micro.enum.approve", "micro.enum.reject", "micro.enum.mode_plan", "micro.enum.mode_act", "micro.intent.question", "micro.intent.command", "micro.intent.review", "micro.intent.explain", "micro.intent.debug", "micro.intent.fix", "micro.intent.test", "skill.args_error", "skill.not_found", "skill.untrusted", "skill.delegation", "skill.file_not_found", "skill.scope_disabled", "command.unknown", "command.denied", "command.unavailable", "command.help", "command.list_empty", "command.skills_empty", "command.summary_enqueued", "command.summary_unavailable", "command.inline_shell_disabled", "command.inline_shell_denied", "command.inline_shell_failed", "command.inline_shell_truncated", "command.inline_shell_unavailable", "sshkey.not_found", "sshkey.name_exists", "sshkey.encryption_unavailable", "sshkey.decrypt_failed", "sshkey.env_failed", "git.ssh_key_required", "git.repo_path_invalid", "git.repo_exists", "event.ingested", "event.routed.bound", "event.routed.ephemeral", "event.routed.queue", "event.routed.drop", "event.binding.not_found", "event.source_not_allowed", "event.duplicate", "hook.blocked", "profile.deps_unavailable", "profile.session_read_error", "profile.session_not_found", "profile.user_unavailable", "profile.save_error", "profile.updated"];
15
15
  export type EngineMessageKey = (typeof ENGINE_MESSAGE_KEYS)[number];
16
16
  export declare const ENGINE_MESSAGE_PARAMS: Record<EngineMessageKey, readonly string[]>;
17
17
  /** Достаёт имена {param}-плейсхолдеров из шаблона. Уникальные, в порядке появления. */
@@ -74,6 +74,8 @@ export const ENGINE_MESSAGE_KEYS = [
74
74
  'web.fetch_all_failed',
75
75
  'web.no_results',
76
76
  'web.search_error',
77
+ 'web.ssrf_blocked',
78
+ 'web.too_many_redirects',
77
79
  'search.no_matches',
78
80
  'search.matches_truncated',
79
81
  'search.rg_not_installed',
@@ -184,6 +186,7 @@ export const ENGINE_MESSAGE_KEYS = [
184
186
  'permission.mcp_unavailable',
185
187
  'permission.dep_unavailable',
186
188
  'permission.workspace_unavailable',
189
+ 'permission.external_directory_default',
187
190
  'permission.no_rules',
188
191
  'permission.rule_matched',
189
192
  'permission.rule_pattern_matched',
@@ -212,6 +215,7 @@ export const ENGINE_MESSAGE_KEYS = [
212
215
  'router.escalation',
213
216
  'router.context_length_exceeded',
214
217
  'router.rate_limit_exceeded',
218
+ 'router.no_user_query',
215
219
  'qc.min_length_ok',
216
220
  'qc.min_length_fail_detail',
217
221
  'qc.min_length_fail',
@@ -241,14 +245,14 @@ export const ENGINE_MESSAGE_KEYS = [
241
245
  'micro.intent.debug',
242
246
  'micro.intent.fix',
243
247
  'micro.intent.test',
244
- // --- Скиллы (AD-046) ---
248
+ // --- Скиллы (ADR-046) ---
245
249
  'skill.args_error',
246
250
  'skill.not_found',
247
251
  'skill.untrusted',
248
252
  'skill.delegation',
249
253
  'skill.file_not_found',
250
254
  'skill.scope_disabled',
251
- // --- Slash-команды (AD-046 §7) ---
255
+ // --- Slash-команды (ADR-046 §7) ---
252
256
  'command.unknown',
253
257
  'command.denied',
254
258
  'command.unavailable',
@@ -257,13 +261,13 @@ export const ENGINE_MESSAGE_KEYS = [
257
261
  'command.skills_empty',
258
262
  'command.summary_enqueued',
259
263
  'command.summary_unavailable',
260
- // --- Inline shell (AD-046 §7.4) ---
264
+ // --- Inline shell (ADR-046 §7.4) ---
261
265
  'command.inline_shell_disabled',
262
266
  'command.inline_shell_denied',
263
267
  'command.inline_shell_failed',
264
268
  'command.inline_shell_truncated',
265
269
  'command.inline_shell_unavailable',
266
- // --- Git-репозитории и SSH-ключи (AD-076) ---
270
+ // --- Git-репозитории и SSH-ключи (ADR-076) ---
267
271
  'sshkey.not_found',
268
272
  'sshkey.name_exists',
269
273
  'sshkey.encryption_unavailable',
@@ -272,6 +276,23 @@ export const ENGINE_MESSAGE_KEYS = [
272
276
  'git.ssh_key_required',
273
277
  'git.repo_path_invalid',
274
278
  'git.repo_exists',
279
+ // --- Внешние события и хуки (ADR-030 / ADR-089) ---
280
+ 'event.ingested',
281
+ 'event.routed.bound',
282
+ 'event.routed.ephemeral',
283
+ 'event.routed.queue',
284
+ 'event.routed.drop',
285
+ 'event.binding.not_found',
286
+ 'event.source_not_allowed',
287
+ 'event.duplicate',
288
+ 'hook.blocked',
289
+ // --- Профиль пользователя и онбординг ---
290
+ 'profile.deps_unavailable',
291
+ 'profile.session_read_error',
292
+ 'profile.session_not_found',
293
+ 'profile.user_unavailable',
294
+ 'profile.save_error',
295
+ 'profile.updated',
275
296
  ];
276
297
  export const ENGINE_MESSAGE_PARAMS = {
277
298
  'session.max_iterations': [],
@@ -336,6 +357,8 @@ export const ENGINE_MESSAGE_PARAMS = {
336
357
  'web.fetch_all_failed': [],
337
358
  'web.no_results': ["query"],
338
359
  'web.search_error': ["error"],
360
+ 'web.ssrf_blocked': ["reason"],
361
+ 'web.too_many_redirects': [],
339
362
  'search.no_matches': [],
340
363
  'search.matches_truncated': ["total"],
341
364
  'search.rg_not_installed': [],
@@ -446,6 +469,7 @@ export const ENGINE_MESSAGE_PARAMS = {
446
469
  'permission.mcp_unavailable': ["mode"],
447
470
  'permission.dep_unavailable': ["binary"],
448
471
  'permission.workspace_unavailable': [],
472
+ 'permission.external_directory_default': ["path", "action"],
449
473
  'permission.no_rules': ["tool"],
450
474
  'permission.rule_matched': ["key", "action"],
451
475
  'permission.rule_pattern_matched': ["key", "pattern", "action", "path"],
@@ -474,6 +498,7 @@ export const ENGINE_MESSAGE_PARAMS = {
474
498
  'router.escalation': ["provider", "model", "reason"],
475
499
  'router.context_length_exceeded': [],
476
500
  'router.rate_limit_exceeded': [],
501
+ 'router.no_user_query': [],
477
502
  'qc.min_length_ok': ["length", "min"],
478
503
  'qc.min_length_fail_detail': ["min", "length"],
479
504
  'qc.min_length_fail': ["min"],
@@ -503,14 +528,14 @@ export const ENGINE_MESSAGE_PARAMS = {
503
528
  'micro.intent.debug': [],
504
529
  'micro.intent.fix': [],
505
530
  'micro.intent.test': [],
506
- // --- Скиллы (AD-046) ---
531
+ // --- Скиллы (ADR-046) ---
507
532
  'skill.args_error': ["issues"],
508
533
  'skill.not_found': ["name"],
509
534
  'skill.untrusted': ["name"],
510
535
  'skill.delegation': ["name", "capabilities", "agent"],
511
536
  'skill.file_not_found': ["path"],
512
537
  'skill.scope_disabled': ["name", "reason"],
513
- // --- Slash-команды (AD-046 §7) ---
538
+ // --- Slash-команды (ADR-046 §7) ---
514
539
  'command.unknown': ["name"],
515
540
  'command.denied': ["name"],
516
541
  'command.unavailable': ["name", "capabilities"],
@@ -519,13 +544,13 @@ export const ENGINE_MESSAGE_PARAMS = {
519
544
  'command.skills_empty': [],
520
545
  'command.summary_enqueued': [],
521
546
  'command.summary_unavailable': [],
522
- // --- Inline shell (AD-046 §7.4) ---
547
+ // --- Inline shell (ADR-046 §7.4) ---
523
548
  'command.inline_shell_disabled': [],
524
549
  'command.inline_shell_denied': ["command", "reason"],
525
550
  'command.inline_shell_failed': ["output"],
526
551
  'command.inline_shell_truncated': ["limit"],
527
552
  'command.inline_shell_unavailable': [],
528
- // --- Git-репозитории и SSH-ключи (AD-076) ---
553
+ // --- Git-репозитории и SSH-ключи (ADR-076) ---
529
554
  'sshkey.not_found': ["id"],
530
555
  'sshkey.name_exists': ["name"],
531
556
  'sshkey.encryption_unavailable': [],
@@ -534,6 +559,23 @@ export const ENGINE_MESSAGE_PARAMS = {
534
559
  'git.ssh_key_required': ["path"],
535
560
  'git.repo_path_invalid': ["path"],
536
561
  'git.repo_exists': ["path"],
562
+ // --- Внешние события и хуки (ADR-030 / ADR-089) ---
563
+ 'event.ingested': ["id", "source"],
564
+ 'event.routed.bound': ["sessionId"],
565
+ 'event.routed.ephemeral': ["agentTemplate"],
566
+ 'event.routed.queue': ["owner", "reason"],
567
+ 'event.routed.drop': ["reason"],
568
+ 'event.binding.not_found': ["key"],
569
+ 'event.source_not_allowed': ["source"],
570
+ 'event.duplicate': ["dedupKey"],
571
+ 'hook.blocked': ["hook", "reason"],
572
+ // --- Профиль пользователя и онбординг ---
573
+ 'profile.deps_unavailable': ["tool"],
574
+ 'profile.session_read_error': [],
575
+ 'profile.session_not_found': [],
576
+ 'profile.user_unavailable': [],
577
+ 'profile.save_error': ["error"],
578
+ 'profile.updated': ["fields"],
537
579
  };
538
580
  /** Достаёт имена {param}-плейсхолдеров из шаблона. Уникальные, в порядке появления. */
539
581
  export function extractParams(template) {
package/dist/index.d.ts CHANGED
@@ -8,7 +8,9 @@ export * from './utils/index.js';
8
8
  export * from './skills/frontmatter.js';
9
9
  export { SYNTH_VERSION } from './version.js';
10
10
  export * from './model-metadata.js';
11
- export { type SynthConfig, type ServerConfig, type StorageConfig, type AuthConfig as SynthAuthConfig, type LLMConfig, type CoreConfig, type RunnerConfig, type UIConfig, type I18nConfig, type LoggingConfig, type TsmConfig, type ContextConfigSchema, type SummarizationConfig, type McpServerConfig, type McpConfig, type ToolsDisabledConfig, toolsDisabledConfigSchema, type SkillsConfig, skillsConfigSchema, type CommandsConfig, commandsConfigSchema, type InstructionsConfig, type InstructionsLazyConfig, type InstructionsFetchConfig, type InstructionSourceConfig, instructionsConfigSchema, instructionSourceConfigSchema, type RouterConfig, type RouterContentConfig, type RouterEscalationConfig, type RouterCostConfig, type RouterSubagentConfig, type RemoteConfig, type MicroFirstConfig, type SecurityConfig, type PromptInjectionConfig, type ProtectedPathsConfig, type LLMGatewayConfig, type LLMGatewayRateLimitConfig, type LLMGatewayAuditConfig, } from './config/index.js';
11
+ export { type SynthConfig, type ServerConfig, type StorageConfig, type AuthConfig as SynthAuthConfig, type LLMConfig, type CoreConfig, type RunnerConfig, type UIConfig, type I18nConfig, type LoggingConfig, type TsmConfig, type ContextConfigSchema, type SummarizationConfig, type McpServerConfig, type McpConfig, type ToolsDisabledConfig, toolsDisabledConfigSchema, type SkillsConfig, skillsConfigSchema, type CommandsConfig, commandsConfigSchema, type InstructionsConfig, type InstructionsLazyConfig, type InstructionsFetchConfig, type InstructionSourceConfig, instructionsConfigSchema, instructionSourceConfigSchema, type RouterConfig, type RouterContentConfig, type RouterEscalationConfig, type RouterCostConfig, type RouterSubagentConfig, type DecisionConfig, decisionConfigSchema, type WebhooksConfig, webhooksConfigSchema, type RemoteConfig, type MicroFirstConfig, type SecurityConfig, type PromptInjectionConfig, type ProtectedPathsConfig, type LLMGatewayConfig, type LLMGatewayRateLimitConfig, type LLMGatewayAuditConfig, } from './config/index.js';
12
12
  export { defaultConfig, loadConfig } from './config/index.js';
13
- export { resolveDataDir, resolvePort, resolveWorkspacesRoot, resolveDefaultWorkspace, resolveWorkspaceOutsideRootPolicy, resolveSecretKey, resolveIgnoreRules, resolveHome, resolveProfilesPath, resolveCredentialsPath, ensureDataDir, createDefaultConfig, resolveDeployMode, findConfigPath, defaultConfigPath, ensureConfigFile, ensureFirstRun } from './config/index.js';
13
+ export { resolveDataDir, resolvePort, resolveWorkspacesRoot, resolveDefaultWorkspace, resolveWorkspaceOutsideRootPolicy, resolveSecretKey, resolveIgnoreRules, resolveHome, resolveProfilesPath, resolveCredentialsPath, ensureDataDir, createDefaultConfig, resolveDeployMode, findConfigPath, defaultConfigPath, ensureConfigFile, ensureFirstRun, resolveDecisionProvider, resolveDecisionModel } from './config/index.js';
14
+ export { applyEnvOverrides, envOverrideName, toSnakeCase, parseEnvValue, ENV_OVERRIDES } from './config/index.js';
14
15
  export type { DeployMode } from './config/index.js';
16
+ export type { EnvOverrideDefinition, EnvOverrideType, ParsedEnvValue } from './config/index.js';
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export * from './skills/frontmatter.js';
10
10
  export { SYNTH_VERSION } from './version.js';
11
11
  export * from './model-metadata.js';
12
12
  // Конфигурация — выборочный экспорт (избегаем конфликта AuthConfig/TestUser)
13
- export { toolsDisabledConfigSchema, skillsConfigSchema, commandsConfigSchema, instructionsConfigSchema, instructionSourceConfigSchema, } from './config/index.js';
13
+ export { toolsDisabledConfigSchema, skillsConfigSchema, commandsConfigSchema, instructionsConfigSchema, instructionSourceConfigSchema, decisionConfigSchema, webhooksConfigSchema, } from './config/index.js';
14
14
  export { defaultConfig, loadConfig } from './config/index.js';
15
- export { resolveDataDir, resolvePort, resolveWorkspacesRoot, resolveDefaultWorkspace, resolveWorkspaceOutsideRootPolicy, resolveSecretKey, resolveIgnoreRules, resolveHome, resolveProfilesPath, resolveCredentialsPath, ensureDataDir, createDefaultConfig, resolveDeployMode, findConfigPath, defaultConfigPath, ensureConfigFile, ensureFirstRun } from './config/index.js';
15
+ export { resolveDataDir, resolvePort, resolveWorkspacesRoot, resolveDefaultWorkspace, resolveWorkspaceOutsideRootPolicy, resolveSecretKey, resolveIgnoreRules, resolveHome, resolveProfilesPath, resolveCredentialsPath, ensureDataDir, createDefaultConfig, resolveDeployMode, findConfigPath, defaultConfigPath, ensureConfigFile, ensureFirstRun, resolveDecisionProvider, resolveDecisionModel } from './config/index.js';
16
+ export { applyEnvOverrides, envOverrideName, toSnakeCase, parseEnvValue, ENV_OVERRIDES } from './config/index.js';