@itphx/synth-shared 0.13.4 → 0.13.8

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 (50) hide show
  1. package/dist/config/defaults.js +28 -1
  2. package/dist/config/env-overrides.d.ts +23 -4
  3. package/dist/config/env-overrides.js +74 -4
  4. package/dist/config/index.d.ts +1 -0
  5. package/dist/config/index.js +1 -0
  6. package/dist/config/loader.d.ts +8 -0
  7. package/dist/config/loader.js +6 -1
  8. package/dist/config/redact.d.ts +22 -0
  9. package/dist/config/redact.js +53 -0
  10. package/dist/config/tls.d.ts +7 -4
  11. package/dist/config/tls.js +10 -23
  12. package/dist/config/types.d.ts +102 -4
  13. package/dist/config/types.js +73 -0
  14. package/dist/i18n/index.d.ts +1 -1
  15. package/dist/i18n/index.js +129 -0
  16. package/dist/index.d.ts +3 -3
  17. package/dist/index.js +3 -3
  18. package/dist/model-metadata.d.ts +10 -0
  19. package/dist/model-metadata.js +10 -0
  20. package/dist/schemas/index.d.ts +288 -11
  21. package/dist/schemas/index.js +228 -2
  22. package/dist/types/bus-events.d.ts +2 -2
  23. package/dist/types/egress.d.ts +2 -2
  24. package/dist/types/egress.js +2 -2
  25. package/dist/types/git.d.ts +83 -0
  26. package/dist/types/git.js +101 -1
  27. package/dist/types/host-pattern.d.ts +41 -0
  28. package/dist/types/host-pattern.js +143 -0
  29. package/dist/types/index.d.ts +2 -0
  30. package/dist/types/index.js +7 -1
  31. package/dist/types/maintenance.d.ts +1 -1
  32. package/dist/types/mcp.d.ts +90 -0
  33. package/dist/types/mcp.js +11 -0
  34. package/dist/types/message-stream.d.ts +41 -0
  35. package/dist/types/permission.d.ts +13 -3
  36. package/dist/types/project.d.ts +30 -0
  37. package/dist/types/project.js +16 -0
  38. package/dist/types/prompt.d.ts +4 -2
  39. package/dist/types/service-keys.d.ts +6 -3
  40. package/dist/types/service-keys.js +6 -1
  41. package/dist/types/session.d.ts +8 -0
  42. package/dist/types/skills.d.ts +6 -0
  43. package/dist/types/tools.d.ts +36 -0
  44. package/dist/types/tools.js +48 -0
  45. package/dist/types/user.d.ts +7 -0
  46. package/dist/types/worktree.d.ts +1 -1
  47. package/dist/utils/index.js +1 -1
  48. package/dist/version.d.ts +1 -1
  49. package/dist/version.js +1 -1
  50. package/package.json +3 -2
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { permissionConfigSchema } from '../types/permission.js';
3
+ import { GlobalRole } from '../types/user.js';
3
4
  export declare const serverConfigSchema: z.ZodObject<{
4
5
  host: z.ZodDefault<z.ZodString>;
5
6
  port: z.ZodDefault<z.ZodNumber>;
@@ -140,6 +141,7 @@ export declare const executionConfigSchema: z.ZodObject<{
140
141
  export declare const authConfigSchema: z.ZodObject<{
141
142
  debugMode: z.ZodDefault<z.ZodBoolean>;
142
143
  apiKey: z.ZodOptional<z.ZodString>;
144
+ apiKeyRoles: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof GlobalRole>>>;
143
145
  testUsers: z.ZodOptional<z.ZodArray<z.ZodObject<{
144
146
  username: z.ZodString;
145
147
  apiKey: z.ZodString;
@@ -427,6 +429,7 @@ export declare const skillsConfigSchema: z.ZodObject<{
427
429
  toolsets: z.ZodPrefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
428
430
  user: "user";
429
431
  mcp: "mcp";
432
+ instance: "instance";
430
433
  web: "web";
431
434
  file_read: "file_read";
432
435
  file_write: "file_write";
@@ -442,6 +445,8 @@ export declare const skillsConfigSchema: z.ZodObject<{
442
445
  question: "question";
443
446
  process: "process";
444
447
  models: "models";
448
+ ssh: "ssh";
449
+ todo: "todo";
445
450
  }>>>>;
446
451
  }, z.core.$strip>;
447
452
  /**
@@ -680,6 +685,25 @@ export declare const gitConfigSchema: z.ZodObject<{
680
685
  localTimeoutMs: z.ZodDefault<z.ZodNumber>;
681
686
  networkTimeoutMs: z.ZodDefault<z.ZodNumber>;
682
687
  }, z.core.$strip>;
688
+ /**
689
+ * PROP-124: режим работы инстанса с SSH-ключами.
690
+ *
691
+ * - `tools` — ключ попадает к потребителю через argv адресных тулов (`-i` на
692
+ * время вызова); политика хостов/портов на ключе обязательна;
693
+ * - `agent` — ключ выдаётся через эфемерный `ssh-agent` на время вызова
694
+ * (`SSH_AUTH_SOCK`); фильтрация по хостам не применяется, ограничение —
695
+ * на стороне хоста (`authorized_keys`).
696
+ *
697
+ * Дефолт — **`tools`** (fail-closed: без явного выбора ключ в окружение
698
+ * команд не попадает). Переключение режима — runtime-настройка инстанса
699
+ * (`/api/v2/settings/ssh`), применяется без рестарта.
700
+ */
701
+ export declare const sshConfigSchema: z.ZodObject<{
702
+ mode: z.ZodDefault<z.ZodEnum<{
703
+ tools: "tools";
704
+ agent: "agent";
705
+ }>>;
706
+ }, z.core.$strip>;
683
707
  /**
684
708
  * Конфигурация подсистемы «вопрос пользователю» (`ask_user`).
685
709
  *
@@ -752,6 +776,22 @@ export declare const agentsConfigSchema: z.ZodObject<{
752
776
  subagentMaxInputTokens: z.ZodDefault<z.ZodNumber>;
753
777
  subagentDepth: z.ZodDefault<z.ZodNumber>;
754
778
  }, z.core.$strip>;
779
+ /**
780
+ * Дефолт лимита тяжёлых операций с сессиями (import/export/fork/merge) в
781
+ * минуту на креду: 10. `0` — **без ограничения**.
782
+ */
783
+ export declare const DEFAULT_SESSION_OPS_PER_MINUTE = 10;
784
+ /**
785
+ * Секция `limits` — instance-wide лимиты тяжёлых операций.
786
+ *
787
+ * - `sessionOpsPerMinute` — число тяжёлых операций с сессиями (import/export/
788
+ * fork/merge) в минуту на креду. Применяется ко всем четырём операциям;
789
+ * `0` — без ограничения.
790
+ */
791
+ export declare const limitsConfigSchema: z.ZodObject<{
792
+ sessionOpsPerMinute: z.ZodDefault<z.ZodNumber>;
793
+ }, z.core.$strip>;
794
+ export type LimitsConfig = z.infer<typeof limitsConfigSchema>;
755
795
  /**
756
796
  * ADR-106 Ф1: конфигурация Authority-слоя.
757
797
  *
@@ -1020,6 +1060,38 @@ export declare const attachmentsConfigSchema: z.ZodObject<{
1020
1060
  maxActiveUploadsPerSession: z.ZodDefault<z.ZodNumber>;
1021
1061
  maxActiveUploads: z.ZodDefault<z.ZodNumber>;
1022
1062
  }, z.core.$strip>;
1063
+ /**
1064
+ * ADR-133: канал обновлений — значение настройки `updates.channel`.
1065
+ *
1066
+ * - `auto` (дефолт) — канал выводится из установленной версии: `-beta.` в
1067
+ * `SYNTH_VERSION` ⇒ `beta`, иначе `stable` (файл-маркер не заводится);
1068
+ * - `stable`/`beta` — явный override (в т.ч. для смены канала вручную).
1069
+ */
1070
+ export declare const UPDATE_CHANNEL_CHOICES: readonly ["auto", "stable", "beta"];
1071
+ export type UpdateChannelChoiceSetting = (typeof UPDATE_CHANNEL_CHOICES)[number];
1072
+ /**
1073
+ * ADR-133: секция `updates` — каналы и проверка обновлений.
1074
+ *
1075
+ * - `check` — автопроверка обновлений в фоне (**по умолчанию выключена**:
1076
+ * офлайн-инстансы не должны шуметь запросами к реестрам);
1077
+ * - `channel` — `auto` (по установленной версии) | `stable` | `beta`;
1078
+ * - `intervalHours` — TTL успешной проверки, часы (ошибка кэшируется на 1 ч);
1079
+ * - `stableRegistry` — реестр стабильного канала (`latest`);
1080
+ * - `betaRegistry` — реестр бета-канала (`beta`; Gitea читается без токена,
1081
+ * токен нужен только публикации).
1082
+ */
1083
+ export declare const updatesConfigSchema: z.ZodObject<{
1084
+ check: z.ZodDefault<z.ZodBoolean>;
1085
+ channel: z.ZodDefault<z.ZodEnum<{
1086
+ stable: "stable";
1087
+ auto: "auto";
1088
+ beta: "beta";
1089
+ }>>;
1090
+ intervalHours: z.ZodDefault<z.ZodNumber>;
1091
+ stableRegistry: z.ZodDefault<z.ZodString>;
1092
+ betaRegistry: z.ZodDefault<z.ZodString>;
1093
+ }, z.core.$strip>;
1094
+ export type UpdatesConfig = z.infer<typeof updatesConfigSchema>;
1023
1095
  /**
1024
1096
  * ADR-094: конфигурация экспорта метрик.
1025
1097
  * - `enabled` — включает `GET /metrics` и сбор HTTP/процессных метрик
@@ -1303,14 +1375,14 @@ export declare const bootstrapServiceKeySchema: z.ZodObject<{
1303
1375
  label: z.ZodString;
1304
1376
  secret: z.ZodString;
1305
1377
  scopes: z.ZodArray<z.ZodString>;
1306
- roles: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("../types/user.js").GlobalRole>>>;
1378
+ roles: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof GlobalRole>>>;
1307
1379
  description: z.ZodOptional<z.ZodString>;
1308
1380
  }, z.core.$strip>;
1309
1381
  export declare const bootstrapServiceKeysSchema: z.ZodArray<z.ZodObject<{
1310
1382
  label: z.ZodString;
1311
1383
  secret: z.ZodString;
1312
1384
  scopes: z.ZodArray<z.ZodString>;
1313
- roles: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("../types/user.js").GlobalRole>>>;
1385
+ roles: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof GlobalRole>>>;
1314
1386
  description: z.ZodOptional<z.ZodString>;
1315
1387
  }, z.core.$strip>>;
1316
1388
  /**
@@ -1359,7 +1431,7 @@ export declare const securityConfigSchema: z.ZodObject<{
1359
1431
  label: z.ZodString;
1360
1432
  secret: z.ZodString;
1361
1433
  scopes: z.ZodArray<z.ZodString>;
1362
- roles: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("../types/user.js").GlobalRole>>>;
1434
+ roles: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof GlobalRole>>>;
1363
1435
  description: z.ZodOptional<z.ZodString>;
1364
1436
  }, z.core.$strip>>>;
1365
1437
  }, z.core.$strip>;
@@ -1739,6 +1811,7 @@ export declare const synthConfigSchema: z.ZodObject<{
1739
1811
  auth: z.ZodPrefault<z.ZodObject<{
1740
1812
  debugMode: z.ZodDefault<z.ZodBoolean>;
1741
1813
  apiKey: z.ZodOptional<z.ZodString>;
1814
+ apiKeyRoles: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof GlobalRole>>>;
1742
1815
  testUsers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1743
1816
  username: z.ZodString;
1744
1817
  apiKey: z.ZodString;
@@ -1918,6 +1991,7 @@ export declare const synthConfigSchema: z.ZodObject<{
1918
1991
  toolsets: z.ZodPrefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
1919
1992
  user: "user";
1920
1993
  mcp: "mcp";
1994
+ instance: "instance";
1921
1995
  web: "web";
1922
1996
  file_read: "file_read";
1923
1997
  file_write: "file_write";
@@ -1933,6 +2007,8 @@ export declare const synthConfigSchema: z.ZodObject<{
1933
2007
  question: "question";
1934
2008
  process: "process";
1935
2009
  models: "models";
2010
+ ssh: "ssh";
2011
+ todo: "todo";
1936
2012
  }>>>>;
1937
2013
  }, z.core.$strip>>;
1938
2014
  commands: z.ZodPrefault<z.ZodObject<{
@@ -2020,6 +2096,12 @@ export declare const synthConfigSchema: z.ZodObject<{
2020
2096
  localTimeoutMs: z.ZodDefault<z.ZodNumber>;
2021
2097
  networkTimeoutMs: z.ZodDefault<z.ZodNumber>;
2022
2098
  }, z.core.$strip>>;
2099
+ ssh: z.ZodPrefault<z.ZodObject<{
2100
+ mode: z.ZodDefault<z.ZodEnum<{
2101
+ tools: "tools";
2102
+ agent: "agent";
2103
+ }>>;
2104
+ }, z.core.$strip>>;
2023
2105
  questions: z.ZodPrefault<z.ZodObject<{
2024
2106
  timeoutMs: z.ZodDefault<z.ZodNumber>;
2025
2107
  retentionDays: z.ZodDefault<z.ZodNumber>;
@@ -2036,6 +2118,9 @@ export declare const synthConfigSchema: z.ZodObject<{
2036
2118
  subagentMaxInputTokens: z.ZodDefault<z.ZodNumber>;
2037
2119
  subagentDepth: z.ZodDefault<z.ZodNumber>;
2038
2120
  }, z.core.$strip>>;
2121
+ limits: z.ZodPrefault<z.ZodObject<{
2122
+ sessionOpsPerMinute: z.ZodDefault<z.ZodNumber>;
2123
+ }, z.core.$strip>>;
2039
2124
  attachments: z.ZodPrefault<z.ZodObject<{
2040
2125
  enabled: z.ZodDefault<z.ZodBoolean>;
2041
2126
  modalities: z.ZodPrefault<z.ZodObject<{
@@ -2103,6 +2188,17 @@ export declare const synthConfigSchema: z.ZodObject<{
2103
2188
  metrics: z.ZodPrefault<z.ZodObject<{
2104
2189
  enabled: z.ZodDefault<z.ZodBoolean>;
2105
2190
  }, z.core.$strip>>;
2191
+ updates: z.ZodPrefault<z.ZodObject<{
2192
+ check: z.ZodDefault<z.ZodBoolean>;
2193
+ channel: z.ZodDefault<z.ZodEnum<{
2194
+ stable: "stable";
2195
+ auto: "auto";
2196
+ beta: "beta";
2197
+ }>>;
2198
+ intervalHours: z.ZodDefault<z.ZodNumber>;
2199
+ stableRegistry: z.ZodDefault<z.ZodString>;
2200
+ betaRegistry: z.ZodDefault<z.ZodString>;
2201
+ }, z.core.$strip>>;
2106
2202
  authority: z.ZodPrefault<z.ZodObject<{
2107
2203
  enabled: z.ZodDefault<z.ZodBoolean>;
2108
2204
  shadow: z.ZodDefault<z.ZodBoolean>;
@@ -2413,7 +2509,7 @@ export declare const synthConfigSchema: z.ZodObject<{
2413
2509
  label: z.ZodString;
2414
2510
  secret: z.ZodString;
2415
2511
  scopes: z.ZodArray<z.ZodString>;
2416
- roles: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("../types/user.js").GlobalRole>>>;
2512
+ roles: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof GlobalRole>>>;
2417
2513
  description: z.ZodOptional<z.ZodString>;
2418
2514
  }, z.core.$strip>>>;
2419
2515
  }, z.core.$strip>>;
@@ -2457,6 +2553,8 @@ export type OAuthConfig = z.infer<typeof oauthConfigSchema>;
2457
2553
  export type AnalyticsConfig = z.infer<typeof analyticsConfigSchema>;
2458
2554
  /** ADR-076: секция `git` (таймауты сетевых git-операций: clone/fetch). */
2459
2555
  export type GitConfig = z.infer<typeof gitConfigSchema>;
2556
+ /** PROP-124: секция `ssh` (режим работы инстанса с SSH-ключами). */
2557
+ export type SshConfig = z.infer<typeof sshConfigSchema>;
2460
2558
  /** Этап 1 roadmap 0.13 (блок 3): секция `questions` (таймаут ответа + retention). */
2461
2559
  export type QuestionsConfig = z.infer<typeof questionsConfigSchema>;
2462
2560
  /** Этап 1 roadmap 0.13 (блок 4): секция `background` (реестр фоновых прогонов). */
@@ -4,6 +4,10 @@ import { contextDefaultsSchema, createToolsDisabledSchema, globalRoleSchema, ser
4
4
  import { TOOLS_POLICIES, MCP_NETWORK_POLICY_MODES, COMMAND_CONFLICT_MODES, DEFAULT_MCP_PRIVATE_CIDRS, DEFAULT_MCP_NETWORK_POLICY, DEFAULT_EGRESS_TOOLS_POLICY, DEFAULT_EGRESS_WEBHOOKS_POLICY, DEFAULT_EGRESS_LOG, EGRESS_POLICY_MODES, WEBHOOKS_EGRESS_POLICY_MODES, DEFAULT_LLM_GATEWAY_RATE_LIMIT, DEFAULT_LLM_FILTER_TIMEOUT_MS, MIN_UPLOAD_BYTES, MAX_UPLOAD_BYTES_LIMIT, MIN_READ_BYTES, MAX_READ_BYTES_LIMIT, MIN_PREVIEW_BYTES, MAX_PREVIEW_BYTES_LIMIT, ToolCapability, } from '../types/index.js';
5
5
  import { catalogTrustLevelSchema } from '../types/trust.js';
6
6
  import { PLUGIN_HYBRID_MODES } from '../types/plugin-hybrid.js';
7
+ import { GlobalRole } from '../types/user.js';
8
+ // PROP-124: режимы инстанса для SSH-ключей (`ssh.mode`) — канонический список
9
+ // в типах (browser-safe), чтобы UI и ядро читали один источник.
10
+ import { SSH_MODES } from '../types/git.js';
7
11
  const toolCapabilityValues = Object.values(ToolCapability);
8
12
  // --- SynthConfig: единый конфиг для всех компонентов ---
9
13
  export const serverConfigSchema = z.object({
@@ -173,6 +177,12 @@ export const executionConfigSchema = z.object({
173
177
  export const authConfigSchema = z.object({
174
178
  debugMode: z.boolean().default(false),
175
179
  apiKey: z.string().optional(),
180
+ /**
181
+ * Роли пользователя единого API-ключа (`auth.apiKey`, вне debug/OIDC).
182
+ * Дефолт — `USER`: права ADMIN не выдаются по факту наличия ключа, только
183
+ * явной настройкой (fail-closed). Env — `SYNTH_API_KEY_ROLES` (csv).
184
+ */
185
+ apiKeyRoles: z.array(globalRoleSchema).default([GlobalRole.USER]),
176
186
  testUsers: z
177
187
  .array(z.object({
178
188
  username: z.string(),
@@ -657,6 +667,23 @@ export const gitConfigSchema = z.object({
657
667
  localTimeoutMs: z.number().int().min(0).default(120_000),
658
668
  networkTimeoutMs: z.number().int().min(0).default(300_000),
659
669
  });
670
+ // --- SSH-доступ агента (PROP-124) ---
671
+ /**
672
+ * PROP-124: режим работы инстанса с SSH-ключами.
673
+ *
674
+ * - `tools` — ключ попадает к потребителю через argv адресных тулов (`-i` на
675
+ * время вызова); политика хостов/портов на ключе обязательна;
676
+ * - `agent` — ключ выдаётся через эфемерный `ssh-agent` на время вызова
677
+ * (`SSH_AUTH_SOCK`); фильтрация по хостам не применяется, ограничение —
678
+ * на стороне хоста (`authorized_keys`).
679
+ *
680
+ * Дефолт — **`tools`** (fail-closed: без явного выбора ключ в окружение
681
+ * команд не попадает). Переключение режима — runtime-настройка инстанса
682
+ * (`/api/v2/settings/ssh`), применяется без рестарта.
683
+ */
684
+ export const sshConfigSchema = z.object({
685
+ mode: z.enum(SSH_MODES).default('tools'),
686
+ });
660
687
  // --- Вопросы пользователю (этап 1 roadmap 0.13 — блок 3) ---
661
688
  /**
662
689
  * Конфигурация подсистемы «вопрос пользователю» (`ask_user`).
@@ -732,6 +759,22 @@ export const agentsConfigSchema = z.object({
732
759
  subagentMaxInputTokens: z.number().int().min(0).default(DEFAULT_SUBAGENT_MAX_INPUT_TOKENS),
733
760
  subagentDepth: z.number().int().min(0).default(DEFAULT_SUBAGENT_DEPTH),
734
761
  });
762
+ // --- Лимиты тяжёлых операций с сессиями ---
763
+ /**
764
+ * Дефолт лимита тяжёлых операций с сессиями (import/export/fork/merge) в
765
+ * минуту на креду: 10. `0` — **без ограничения**.
766
+ */
767
+ export const DEFAULT_SESSION_OPS_PER_MINUTE = 10;
768
+ /**
769
+ * Секция `limits` — instance-wide лимиты тяжёлых операций.
770
+ *
771
+ * - `sessionOpsPerMinute` — число тяжёлых операций с сессиями (import/export/
772
+ * fork/merge) в минуту на креду. Применяется ко всем четырём операциям;
773
+ * `0` — без ограничения.
774
+ */
775
+ export const limitsConfigSchema = z.object({
776
+ sessionOpsPerMinute: z.number().int().min(0).default(DEFAULT_SESSION_OPS_PER_MINUTE),
777
+ });
735
778
  // --- Authority-слой (ADR-106) ---
736
779
  /**
737
780
  * ADR-106 Ф1: конфигурация Authority-слоя.
@@ -945,6 +988,33 @@ export const attachmentsConfigSchema = z.object({
945
988
  */
946
989
  maxActiveUploads: z.number().int().min(1).default(256),
947
990
  });
991
+ // --- Обновления пакета (ADR-133) ---
992
+ /**
993
+ * ADR-133: канал обновлений — значение настройки `updates.channel`.
994
+ *
995
+ * - `auto` (дефолт) — канал выводится из установленной версии: `-beta.` в
996
+ * `SYNTH_VERSION` ⇒ `beta`, иначе `stable` (файл-маркер не заводится);
997
+ * - `stable`/`beta` — явный override (в т.ч. для смены канала вручную).
998
+ */
999
+ export const UPDATE_CHANNEL_CHOICES = ['auto', 'stable', 'beta'];
1000
+ /**
1001
+ * ADR-133: секция `updates` — каналы и проверка обновлений.
1002
+ *
1003
+ * - `check` — автопроверка обновлений в фоне (**по умолчанию выключена**:
1004
+ * офлайн-инстансы не должны шуметь запросами к реестрам);
1005
+ * - `channel` — `auto` (по установленной версии) | `stable` | `beta`;
1006
+ * - `intervalHours` — TTL успешной проверки, часы (ошибка кэшируется на 1 ч);
1007
+ * - `stableRegistry` — реестр стабильного канала (`latest`);
1008
+ * - `betaRegistry` — реестр бета-канала (`beta`; Gitea читается без токена,
1009
+ * токен нужен только публикации).
1010
+ */
1011
+ export const updatesConfigSchema = z.object({
1012
+ check: z.boolean().default(false),
1013
+ channel: z.enum(['auto', 'stable', 'beta']).default('auto'),
1014
+ intervalHours: z.number().int().min(1).default(24),
1015
+ stableRegistry: z.string().default('https://registry.npmjs.org'),
1016
+ betaRegistry: z.string().default('https://git.itphx.ru/api/packages/itphx/npm/'),
1017
+ });
948
1018
  // --- Наблюдаемость: Prometheus-метрики (ADR-094) ---
949
1019
  /**
950
1020
  * ADR-094: конфигурация экспорта метрик.
@@ -1501,11 +1571,14 @@ export const synthConfigSchema = z.object({
1501
1571
  oauth: oauthConfigSchema.prefault({}),
1502
1572
  analytics: analyticsConfigSchema.prefault({}),
1503
1573
  git: gitConfigSchema.prefault({}),
1574
+ ssh: sshConfigSchema.prefault({}),
1504
1575
  questions: questionsConfigSchema.prefault({}),
1505
1576
  background: backgroundConfigSchema.prefault({}),
1506
1577
  agents: agentsConfigSchema.prefault({}),
1578
+ limits: limitsConfigSchema.prefault({}),
1507
1579
  attachments: attachmentsConfigSchema.prefault({}),
1508
1580
  metrics: metricsConfigSchema.prefault({}),
1581
+ updates: updatesConfigSchema.prefault({}),
1509
1582
  authority: authorityConfigSchema.prefault({}),
1510
1583
  plugins: pluginsConfigSchema.prefault({}),
1511
1584
  egress: egressConfigSchema.prefault({}),
@@ -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.steps_limit", "session.stopped", "session.stopped_reason_denied", "session.denied_blocked", "session.role_tool_blocked", "session.empty_response", "session.output_limit", "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.model_unavailable", "task.model_not_in_catalog", "task.subagent_exec_error_after_retries", "task.depth_limit", "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", "task.steps_limit", "task.steps_limit_empty", "task.context_budget", "subagent.context_budget", "task.background_started", "task.background_limit", "task.background_disabled", "task.resume_foreign_child", "task.resume_child_busy", "tool.args_error", "tool.exec_error", "tool.malformed_call", "tool.not_found", "tool.permission_denied_default", "tool.doom_loop", "tool.disabled_by_step_limit", "tool.empty_output", "tool.output_truncated", "tool.output_bounded", "tool.shell_error", "tool.shell_timeout", "tool.search_timeout", "tool.command_failed_default", "tool.aborted", "tool.binary_missing", "fs.file_written", "fs.file_edited", "fs.replace_not_found", "fs.replace_multiple", "fs.no_changes", "fs.empty_old_string", "fs.mixed_line_endings", "fs.edit_binary", "fs.write_binary", "fs.file_too_large", "fs.file_not_found", "fs.dir_created", "fs.file_deleted", "fs.patch_applied", "fs.patch_file_line", "fs.patch_not_found", "fs.patch_multiple", "fs.patch_write_failed", "fs.patch_file_missing", "fs.patch_not_regular", "fs.patch_too_large", "fs.patch_binary", "fs.patch_summary", "fs.patch_file_added", "fs.patch_file_deleted", "fs.patch_file_renamed", "fs.patch_add_exists", "fs.patch_delete_missing", "fs.patch_rename_missing", "fs.patch_rename_exists", "fs.patch_path_escapes", "fsread.empty_directory", "fsread.empty_file", "fsread.no_files", "fsread.glob_error", "fsread.truncated", "fsread.directory_truncated", "fsread.line_truncated", "fsread.offset_out_of_range", "fsread.binary", "fsread.glob_truncated", "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.body_truncated", "web.block_timeout", "web.block_error", "web.fetch_all_failed", "web.no_results", "web.search_error", "web.search_rate_limited", "web.search_auth_failed", "web.ssrf_blocked", "web.too_many_redirects", "search.no_matches", "search.matches_truncated", "search.rg_not_installed", "search.error", "search.path_not_found", "search.path_not_directory", "search.invalid_regex", "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", "todo.summary", "todo.line", "todo.more", "todo.added", "todo.updated", "todo.deleted", "todo.hint_priority", "todo.hint_plan", "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.storage_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_cancelled", "permission.ask_no_subscribers", "permission.ask_denied", "permission.authority_denied_unknown", "permission.authority_denied_explicit", "permission.authority_denied_no_grant", "permission.authority_ask", "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", "gateway.filter_denied", "gateway.filter_unavailable", "router.timeout", "router.network_error", "router.provider_not_found", "router.provider_disabled", "router.provider_unspecified", "router.model_disabled", "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", "context.compression_empty", "context.compression_failed", "context.compression_template", "context.compression_output_limit", "context.summary_applied", "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.ssh_key_required_hint", "git.ssh_keys_none", "sshkeys.tool.header", "sshkeys.tool.empty", "sshkeys.tool.deps_unavailable", "git.repo_path_invalid", "git.repo_not_a_repo", "git.repo_exists", "git.repo_occupied_repo", "git.repo_occupied_stub", "git.repo_occupied_dir", "git.repo_path_unreadable", "git.clone_timeout", "git.fetch_timeout", "git.timeout", "worktree.directory_missing", "worktree.tool.deps_unavailable", "worktree.tool.no_project", "worktree.tool.list_empty", "worktree.tool.list_header", "worktree.tool.list_row", "worktree.tool.created", "worktree.tool.removed", "worktree.tool.pruned", "worktree.tool.force_required", "worktree.tool.busy", "worktree.tool.not_found", "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", "steer.injected", "steer.limit_exceeded", "steer.interrupted", "steer.dropped_aborted", "steer.dropped_turn_ended", "steer.requeued_aborted", "steer.requeued_turn_ended", "profile.deps_unavailable", "profile.session_read_error", "profile.session_not_found", "profile.user_unavailable", "profile.save_error", "profile.updated", "pipeline.not_found", "pipeline.not_published", "pipeline.invalid_spec", "pipeline.loop_limit", "pipeline.cancelled", "pipeline.executor_missing", "pipeline.gate_rejected", "pipeline.gate_timeout", "pipeline.step_failed", "pipeline.step_timeout", "pipeline.run_not_found", "pipeline.invalid_state", "pipeline.tool_not_found", "pipeline.tool_failed", "pipeline.script_failed", "pipeline.script_no_command", "pipeline.permission_denied", "pipeline.agent_unavailable", "pipeline.provider_not_found", "pipeline.llm_failed", "pipeline.llm_unrecoverable", "pipeline.tool.deps_unavailable", "pipeline.tool.no_project", "pipeline.tool.forbidden", "pipeline.tool.not_found", "pipeline.tool.already_running", "pipeline.tool.invalid_spec", "pipeline.tool.not_published", "pipeline.tool.run_not_found", "pipeline.tool.run_foreign", "pipeline.tool.run_not_waiting", "pipeline.tool.template_not_found", "pipeline.tool.template_unsupported", "pipeline.tool.saved", "pipeline.tool.published", "pipeline.tool.deleted", "pipeline.tool.run_started", "pipeline.tool.run_resumed", "pipeline.tool.run_cancelled", "pipeline.tool.instantiated", "pipeline.tool.list_empty", "pipeline.tool.runs_empty", "pipeline.tool.templates_empty", "schedule.tool.deps_unavailable", "schedule.tool.forbidden", "schedule.tool.not_found", "schedule.tool.invalid", "schedule.tool.saved", "schedule.tool.deleted", "schedule.tool.ran", "schedule.tool.list_empty", "schedule.tool.jobs_empty", "schedule.tool.target_forbidden", "schedule.tool.not_published", "execution.remote_url_required", "execution.remote_unavailable", "question.answered", "question.cancelled", "question.timeout", "question.deps_unavailable", "process.background_started", "process.deps_unavailable", "process.background_limit", "process.background_unsupported", "process.background_disabled", "process.detached_started", "process.tool.empty", "process.tool.not_found", "process.tool.deps_unavailable", "process.tool.header", "process.tool.no_log", "process.tool.child_history", "process.tool.not_running", "process.tool.running", "process.tool.stopping", "process.tool.deleted", "attach.message.from_workspace", "attach.tool.attached", "attach.tool.deps_unavailable", "attach.tool.delivery_unavailable", "attach.tool.disabled", "attach.tool.not_found", "attach.tool.not_a_file", "attach.tool.too_large", "attach.tool.unsupported_mime", "attach.tool.modality_unsupported", "attach.tool.unrecognized", "attach.tool.queued", "attach.tool.saved", "attach.tool.ambiguous", "attach.tool.no_attachment", "attach.tool.exists", "attach.tool.save_failed", "models.list.header", "models.list.current", "models.list.defaults", "models.list.skipped", "models.list.empty", "models.list.provider_unknown", "models.list.deps_unavailable", "models.list.unavailable"];
14
+ export declare const ENGINE_MESSAGE_KEYS: readonly ["session.max_iterations", "session.steps_limit", "session.stopped", "session.stopped_reason_denied", "session.denied_blocked", "session.role_tool_blocked", "session.empty_response", "session.output_limit", "session.default_title", "session.reference_label", "session.reference_link", "session.retry_cancelled", "session.subtask_title", "session.list", "session.list_empty", "session.details", "session.not_found", "session.rename_ok", "session.save_error", "session.remote_truncated", "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.model_unavailable", "task.model_not_in_catalog", "task.subagent_exec_error_after_retries", "task.depth_limit", "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", "task.steps_limit", "task.steps_limit_empty", "task.context_budget", "subagent.context_budget", "task.background_started", "task.background_limit", "task.background_disabled", "task.resume_foreign_child", "task.resume_child_busy", "tool.args_error", "tool.exec_error", "tool.malformed_call", "tool.not_found", "tool.permission_denied_default", "tool.doom_loop", "tool.disabled_by_step_limit", "tool.empty_output", "tool.output_truncated", "tool.output_bounded", "tool.shell_error", "tool.shell_timeout", "tool.search_timeout", "tool.command_failed_default", "tool.aborted", "tool.binary_missing", "fs.file_written", "fs.file_edited", "fs.replace_not_found", "fs.replace_multiple", "fs.no_changes", "fs.empty_old_string", "fs.mixed_line_endings", "fs.edit_binary", "fs.write_binary", "fs.file_too_large", "fs.file_not_found", "fs.dir_created", "fs.file_deleted", "fs.patch_applied", "fs.patch_file_line", "fs.patch_not_found", "fs.patch_multiple", "fs.patch_write_failed", "fs.patch_file_missing", "fs.patch_not_regular", "fs.patch_too_large", "fs.patch_binary", "fs.patch_summary", "fs.patch_file_added", "fs.patch_file_deleted", "fs.patch_file_renamed", "fs.patch_add_exists", "fs.patch_delete_missing", "fs.patch_rename_missing", "fs.patch_rename_exists", "fs.patch_path_escapes", "fsread.empty_directory", "fsread.empty_file", "fsread.no_files", "fsread.glob_error", "fsread.truncated", "fsread.directory_truncated", "fsread.line_truncated", "fsread.offset_out_of_range", "fsread.binary", "fsread.glob_truncated", "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.body_truncated", "web.block_timeout", "web.block_error", "web.fetch_all_failed", "web.no_results", "web.search_error", "web.search_rate_limited", "web.search_auth_failed", "web.ssrf_blocked", "web.too_many_redirects", "search.no_matches", "search.matches_truncated", "search.line_truncated", "search.matches_excluded", "search.rg_not_installed", "search.error", "search.path_not_found", "search.path_not_directory", "search.invalid_regex", "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", "todo.summary", "todo.line", "todo.more", "todo.added", "todo.updated", "todo.deleted", "todo.hint_priority", "todo.hint_plan", "project.deps_unavailable", "project.session_read_error", "project.query_not_found", "project.query_ambiguous", "project.list", "project.list_empty", "project.details", "project.attached_no_workspace", "project.cross_instance", "project.hybrid_ambiguous", "project.remote_unavailable", "project.remote_truncated", "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.storage_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_cancelled", "permission.ask_no_subscribers", "permission.ask_denied", "permission.authority_denied_unknown", "permission.authority_denied_explicit", "permission.authority_denied_no_grant", "permission.authority_ask", "shellguard.allow_default", "shellguard.deny_prefix", "shellguard.deny_path", "shellguard.ask_path", "shellguard.ask_command", "shellguard.ask_code", "shellguard.ask_stdin_code", "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", "gateway.filter_denied", "gateway.filter_unavailable", "router.timeout", "router.network_error", "router.provider_not_found", "router.provider_disabled", "router.provider_unspecified", "router.model_disabled", "router.escalation", "router.context_length_exceeded", "router.rate_limit_exceeded", "router.no_user_query", "router.remote_auth_expired", "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", "context.compression_empty", "context.compression_failed", "context.compression_template", "context.compression_output_limit", "context.summary_applied", "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", "ssh.access.key_not_found", "ssh.access.usage_denied", "ssh.access.agent_not_linked", "ssh.access.host_denied", "ssh.access.port_denied", "ssh.access.policy_required", "ssh.access.ambiguous", "ssh.copy.uploaded", "ssh.copy.downloaded", "ssh.tunnel.started", "ssh.tunnel.socks_unsupported", "git.ssh_key_required", "git.ssh_key_required_hint", "git.ssh_keys_none", "sshkeys.tool.header", "sshkeys.tool.empty", "sshkeys.tool.deps_unavailable", "git.repo_path_invalid", "git.repo_not_a_repo", "git.repo_exists", "git.repo_occupied_repo", "git.repo_occupied_stub", "git.repo_occupied_dir", "git.repo_path_unreadable", "git.clone_timeout", "git.fetch_timeout", "git.timeout", "worktree.directory_missing", "worktree.tool.deps_unavailable", "worktree.tool.no_project", "worktree.tool.list_empty", "worktree.tool.list_header", "worktree.tool.list_row", "worktree.tool.created", "worktree.tool.removed", "worktree.tool.pruned", "worktree.tool.force_required", "worktree.tool.busy", "worktree.tool.not_found", "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", "steer.injected", "steer.limit_exceeded", "steer.interrupted", "steer.dropped_aborted", "steer.dropped_turn_ended", "steer.requeued_aborted", "steer.requeued_turn_ended", "profile.deps_unavailable", "profile.session_read_error", "profile.session_not_found", "profile.user_unavailable", "profile.save_error", "profile.updated", "pipeline.not_found", "pipeline.not_published", "pipeline.invalid_spec", "pipeline.loop_limit", "pipeline.cancelled", "pipeline.executor_missing", "pipeline.gate_rejected", "pipeline.gate_timeout", "pipeline.step_failed", "pipeline.step_timeout", "pipeline.run_not_found", "pipeline.invalid_state", "pipeline.tool_not_found", "pipeline.tool_failed", "pipeline.script_failed", "pipeline.script_no_command", "pipeline.permission_denied", "pipeline.agent_unavailable", "pipeline.provider_not_found", "pipeline.llm_failed", "pipeline.llm_unrecoverable", "pipeline.tool.deps_unavailable", "pipeline.tool.no_project", "pipeline.tool.forbidden", "pipeline.tool.not_found", "pipeline.tool.already_running", "pipeline.tool.invalid_spec", "pipeline.tool.not_published", "pipeline.tool.run_not_found", "pipeline.tool.run_foreign", "pipeline.tool.run_not_waiting", "pipeline.tool.template_not_found", "pipeline.tool.template_unsupported", "pipeline.tool.saved", "pipeline.tool.published", "pipeline.tool.deleted", "pipeline.tool.run_started", "pipeline.tool.run_resumed", "pipeline.tool.run_cancelled", "pipeline.tool.instantiated", "pipeline.tool.list_empty", "pipeline.tool.runs_empty", "pipeline.tool.templates_empty", "schedule.tool.deps_unavailable", "schedule.tool.forbidden", "schedule.tool.not_found", "schedule.tool.invalid", "schedule.tool.saved", "schedule.tool.deleted", "schedule.tool.ran", "schedule.tool.list_empty", "schedule.tool.jobs_empty", "schedule.tool.target_forbidden", "schedule.tool.not_published", "execution.remote_url_required", "execution.remote_unavailable", "question.answered", "question.cancelled", "question.timeout", "question.deps_unavailable", "process.background_started", "process.deps_unavailable", "process.background_limit", "process.background_unsupported", "process.background_disabled", "process.detached_started", "process.tool.empty", "process.tool.not_found", "process.tool.deps_unavailable", "process.tool.header", "process.tool.no_log", "process.tool.child_history", "process.tool.not_running", "process.tool.running", "process.tool.stopping", "process.tool.deleted", "attach.message.from_workspace", "attach.tool.attached", "attach.tool.deps_unavailable", "attach.tool.delivery_unavailable", "attach.tool.disabled", "attach.tool.not_found", "attach.tool.not_a_file", "attach.tool.too_large", "attach.tool.unsupported_mime", "attach.tool.modality_unsupported", "attach.tool.unrecognized", "attach.tool.queued", "attach.tool.saved", "attach.tool.ambiguous", "attach.tool.no_attachment", "attach.tool.exists", "attach.tool.save_failed", "models.list.header", "models.list.current", "models.list.defaults", "models.list.skipped", "models.list.empty", "models.list.provider_unknown", "models.list.deps_unavailable", "models.list.unavailable", "instance.deps_unavailable", "instance.info", "instance.mcp_list", "instance.mcp_not_found", "instance.mcp_test_ok", "instance.mcp_test_failed", "instance.mcp_add.added", "instance.mcp_update.updated", "instance.mcp_remove.removed", "instance.mcp_enable.session_ok", "instance.mcp_enable.project_ok", "instance.mcp_enable.instance_ok", "instance.mcp_enable.no_project", "instance.mcp_enable.no_session", "instance.mcp_enable.session_forbidden", "instance.mcp_reconnect.ok", "instance.mcp_reconnect.failed", "instance.mcp.forbidden", "instance.mcp.instance_forbidden", "instance.mcp.project_forbidden", "instance.mcp.credential_unsupported", "instance.mcp.secret_header", "instance.mcp.network_denied", "instance.mcp.invalid_config", "instance.mcp.exists"];
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}-плейсхолдеров из шаблона. Уникальные, в порядке появления. */
@@ -25,6 +25,14 @@ export const ENGINE_MESSAGE_KEYS = [
25
25
  'session.reference_link',
26
26
  'session.retry_cancelled',
27
27
  'session.subtask_title',
28
+ // Управление сессиями из чата (list_sessions/get_session_info/session_rename).
29
+ 'session.list',
30
+ 'session.list_empty',
31
+ 'session.details',
32
+ 'session.not_found',
33
+ 'session.rename_ok',
34
+ 'session.save_error',
35
+ 'session.remote_truncated',
28
36
  'task.stopped_by_user',
29
37
  'task.stopped_before_completion',
30
38
  'task.stopped_by_deny',
@@ -141,6 +149,10 @@ export const ENGINE_MESSAGE_KEYS = [
141
149
  'web.too_many_redirects',
142
150
  'search.no_matches',
143
151
  'search.matches_truncated',
152
+ // Кап длины строки совпадения (общий с `read_file`).
153
+ 'search.line_truncated',
154
+ // Скрытые совпадения в исключённых путях (зависимости/артефакты сборки).
155
+ 'search.matches_excluded',
144
156
  'search.rg_not_installed',
145
157
  'search.error',
146
158
  // Различимые причины отказа поиска (ADR-041): путь не найден / путь не
@@ -191,6 +203,17 @@ export const ENGINE_MESSAGE_KEYS = [
191
203
  'todo.hint_plan',
192
204
  'project.deps_unavailable',
193
205
  'project.session_read_error',
206
+ // Поиск/список проектов (list_projects/get_project, project_attach по имени).
207
+ 'project.query_not_found',
208
+ 'project.query_ambiguous',
209
+ 'project.list',
210
+ 'project.list_empty',
211
+ 'project.details',
212
+ 'project.attached_no_workspace',
213
+ 'project.cross_instance',
214
+ 'project.hybrid_ambiguous',
215
+ 'project.remote_unavailable',
216
+ 'project.remote_truncated',
194
217
  'project.session_not_found',
195
218
  'project.save_error',
196
219
  'project.workspace_create_error',
@@ -282,6 +305,9 @@ export const ENGINE_MESSAGE_KEYS = [
282
305
  'shellguard.deny_prefix',
283
306
  'shellguard.deny_path',
284
307
  'shellguard.ask_path',
308
+ 'shellguard.ask_command',
309
+ 'shellguard.ask_code',
310
+ 'shellguard.ask_stdin_code',
285
311
  'shellguard.deny_dir',
286
312
  'protectedpaths.unresolvable',
287
313
  'protectedpaths.dynamic',
@@ -303,6 +329,7 @@ export const ENGINE_MESSAGE_KEYS = [
303
329
  'router.context_length_exceeded',
304
330
  'router.rate_limit_exceeded',
305
331
  'router.no_user_query',
332
+ 'router.remote_auth_expired',
306
333
  'qc.min_length_ok',
307
334
  'qc.min_length_fail_detail',
308
335
  'qc.min_length_fail',
@@ -366,6 +393,20 @@ export const ENGINE_MESSAGE_KEYS = [
366
393
  'sshkey.encryption_unavailable',
367
394
  'sshkey.decrypt_failed',
368
395
  'sshkey.env_failed',
396
+ // Отказы единого гейта SSH-ключей (PROP-124 §3) — по одному ключу на
397
+ // машинный код отказа (`SshAccessErrorCode`).
398
+ 'ssh.access.key_not_found',
399
+ 'ssh.access.usage_denied',
400
+ 'ssh.access.agent_not_linked',
401
+ 'ssh.access.host_denied',
402
+ 'ssh.access.port_denied',
403
+ 'ssh.access.policy_required',
404
+ 'ssh.access.ambiguous',
405
+ 'ssh.copy.uploaded',
406
+ 'ssh.copy.downloaded',
407
+ // PROP-124 §4c: адресный ssh-тул проброса порта (`ssh_tunnel`).
408
+ 'ssh.tunnel.started',
409
+ 'ssh.tunnel.socks_unsupported',
369
410
  'git.ssh_key_required',
370
411
  'git.ssh_key_required_hint',
371
412
  'git.ssh_keys_none',
@@ -534,6 +575,33 @@ export const ENGINE_MESSAGE_KEYS = [
534
575
  'models.list.provider_unknown',
535
576
  'models.list.deps_unavailable',
536
577
  'models.list.unavailable',
578
+ // --- Инстанс и MCP-реестр (Workstream A1): synth_info/synth_mcp_* ---
579
+ 'instance.deps_unavailable',
580
+ 'instance.info',
581
+ 'instance.mcp_list',
582
+ 'instance.mcp_not_found',
583
+ 'instance.mcp_test_ok',
584
+ 'instance.mcp_test_failed',
585
+ // --- Write-мутации MCP (Workstream A2) ---
586
+ 'instance.mcp_add.added',
587
+ 'instance.mcp_update.updated',
588
+ 'instance.mcp_remove.removed',
589
+ 'instance.mcp_enable.session_ok',
590
+ 'instance.mcp_enable.project_ok',
591
+ 'instance.mcp_enable.instance_ok',
592
+ 'instance.mcp_enable.no_project',
593
+ 'instance.mcp_enable.no_session',
594
+ 'instance.mcp_enable.session_forbidden',
595
+ 'instance.mcp_reconnect.ok',
596
+ 'instance.mcp_reconnect.failed',
597
+ 'instance.mcp.forbidden',
598
+ 'instance.mcp.instance_forbidden',
599
+ 'instance.mcp.project_forbidden',
600
+ 'instance.mcp.credential_unsupported',
601
+ 'instance.mcp.secret_header',
602
+ 'instance.mcp.network_denied',
603
+ 'instance.mcp.invalid_config',
604
+ 'instance.mcp.exists',
537
605
  ];
538
606
  export const ENGINE_MESSAGE_PARAMS = {
539
607
  'session.max_iterations': [],
@@ -549,6 +617,13 @@ export const ENGINE_MESSAGE_PARAMS = {
549
617
  'session.reference_link': ["label", "id", "from", "to"],
550
618
  'session.retry_cancelled': [],
551
619
  'session.subtask_title': ["description"],
620
+ 'session.list': ["count", "items"],
621
+ 'session.list_empty': [],
622
+ 'session.details': ["name", "id", "json"],
623
+ 'session.not_found': ["id"],
624
+ 'session.rename_ok': ["title"],
625
+ 'session.save_error': ["error"],
626
+ 'session.remote_truncated': [],
552
627
  'task.stopped_by_user': [],
553
628
  'task.stopped_before_completion': [],
554
629
  'task.stopped_by_deny': [],
@@ -656,6 +731,8 @@ export const ENGINE_MESSAGE_PARAMS = {
656
731
  'web.too_many_redirects': [],
657
732
  'search.no_matches': [],
658
733
  'search.matches_truncated': ["shown", "total"],
734
+ 'search.line_truncated': [],
735
+ 'search.matches_excluded': ["count", "categories"],
659
736
  'search.rg_not_installed': [],
660
737
  'search.error': ["error"],
661
738
  'search.path_not_found': ["path"],
@@ -703,6 +780,16 @@ export const ENGINE_MESSAGE_PARAMS = {
703
780
  'todo.hint_plan': ["plan"],
704
781
  'project.deps_unavailable': ["tool"],
705
782
  'project.session_read_error': [],
783
+ 'project.query_not_found': ["name"],
784
+ 'project.query_ambiguous': ["name", "items"],
785
+ 'project.list': ["count", "items"],
786
+ 'project.list_empty': [],
787
+ 'project.details': ["name", "id", "json"],
788
+ 'project.attached_no_workspace': ["name"],
789
+ 'project.cross_instance': ["name", "id"],
790
+ 'project.hybrid_ambiguous': ["name", "items"],
791
+ 'project.remote_unavailable': [],
792
+ 'project.remote_truncated': [],
706
793
  'project.session_not_found': [],
707
794
  'project.save_error': ["error"],
708
795
  'project.workspace_create_error': ["error"],
@@ -794,6 +881,9 @@ export const ENGINE_MESSAGE_PARAMS = {
794
881
  'shellguard.deny_prefix': ["prefix"],
795
882
  'shellguard.deny_path': ["path"],
796
883
  'shellguard.ask_path': ["path"],
884
+ 'shellguard.ask_command': ["command"],
885
+ 'shellguard.ask_code': ["code"],
886
+ 'shellguard.ask_stdin_code': [],
797
887
  'shellguard.deny_dir': ["path", "dir"],
798
888
  'protectedpaths.unresolvable': [],
799
889
  'protectedpaths.dynamic': [],
@@ -815,6 +905,7 @@ export const ENGINE_MESSAGE_PARAMS = {
815
905
  'router.context_length_exceeded': [],
816
906
  'router.rate_limit_exceeded': [],
817
907
  'router.no_user_query': [],
908
+ 'router.remote_auth_expired': [],
818
909
  'qc.min_length_ok': ["length", "min"],
819
910
  'qc.min_length_fail_detail': ["min", "length"],
820
911
  'qc.min_length_fail': ["min"],
@@ -878,6 +969,19 @@ export const ENGINE_MESSAGE_PARAMS = {
878
969
  'sshkey.encryption_unavailable': [],
879
970
  'sshkey.decrypt_failed': ["id"],
880
971
  'sshkey.env_failed': [],
972
+ // Отказы гейта SSH-ключей (PROP-124 §3).
973
+ 'ssh.access.key_not_found': ["key"],
974
+ 'ssh.access.usage_denied': ["key", "usage"],
975
+ 'ssh.access.agent_not_linked': ["key", "agent"],
976
+ 'ssh.access.host_denied': ["key", "host"],
977
+ 'ssh.access.port_denied': ["key", "port"],
978
+ 'ssh.access.policy_required': ["key"],
979
+ 'ssh.access.ambiguous': ["keys"],
980
+ 'ssh.copy.uploaded': ["local", "remote", "host"],
981
+ 'ssh.copy.downloaded': ["remote", "host", "local"],
982
+ // PROP-124 §4c: адресный ssh-тул проброса порта (`ssh_tunnel`).
983
+ 'ssh.tunnel.started': ["direction", "listen_port", "target", "host", "id", "log"],
984
+ 'ssh.tunnel.socks_unsupported': [],
881
985
  'git.ssh_key_required': ["path"],
882
986
  'git.ssh_key_required_hint': ["path", "keys"],
883
987
  'git.ssh_keys_none': [],
@@ -1040,6 +1144,31 @@ export const ENGINE_MESSAGE_PARAMS = {
1040
1144
  'models.list.provider_unknown': ["provider"],
1041
1145
  'models.list.deps_unavailable': [],
1042
1146
  'models.list.unavailable': ["reason"],
1147
+ 'instance.deps_unavailable': ["tool"],
1148
+ 'instance.info': ["json"],
1149
+ 'instance.mcp_list': ["count", "json"],
1150
+ 'instance.mcp_not_found': ["name", "available"],
1151
+ 'instance.mcp_test_ok': ["name", "count"],
1152
+ 'instance.mcp_test_failed': ["name", "error"],
1153
+ 'instance.mcp_add.added': ["name", "origin"],
1154
+ 'instance.mcp_update.updated': ["name"],
1155
+ 'instance.mcp_remove.removed': ["name"],
1156
+ 'instance.mcp_enable.session_ok': ["name", "enabled"],
1157
+ 'instance.mcp_enable.project_ok': ["name", "enabled"],
1158
+ 'instance.mcp_enable.instance_ok': ["name", "enabled"],
1159
+ 'instance.mcp_enable.no_project': [],
1160
+ 'instance.mcp_enable.no_session': [],
1161
+ 'instance.mcp_enable.session_forbidden': [],
1162
+ 'instance.mcp_reconnect.ok': ["name", "count"],
1163
+ 'instance.mcp_reconnect.failed': ["name", "error"],
1164
+ 'instance.mcp.forbidden': [],
1165
+ 'instance.mcp.instance_forbidden': [],
1166
+ 'instance.mcp.project_forbidden': [],
1167
+ 'instance.mcp.credential_unsupported': [],
1168
+ 'instance.mcp.secret_header': ["error"],
1169
+ 'instance.mcp.network_denied': ["url", "reason"],
1170
+ 'instance.mcp.invalid_config': ["error"],
1171
+ 'instance.mcp.exists': ["name"],
1043
1172
  };
1044
1173
  /** Достаёт имена {param}-плейсхолдеров из шаблона. Уникальные, в порядке появления. */
1045
1174
  export function extractParams(template) {