@itphx/synth-shared 0.12.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 (67) hide show
  1. package/dist/config/defaults.js +125 -5
  2. package/dist/config/env-overrides.d.ts +23 -4
  3. package/dist/config/env-overrides.js +103 -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/resolve.d.ts +17 -0
  11. package/dist/config/resolve.js +40 -1
  12. package/dist/config/tls.d.ts +7 -4
  13. package/dist/config/tls.js +10 -23
  14. package/dist/config/types.d.ts +496 -11
  15. package/dist/config/types.js +348 -6
  16. package/dist/i18n/index.d.ts +1 -1
  17. package/dist/i18n/index.js +317 -3
  18. package/dist/index.d.ts +4 -4
  19. package/dist/index.js +4 -4
  20. package/dist/model-metadata.d.ts +10 -0
  21. package/dist/model-metadata.js +10 -0
  22. package/dist/schemas/index.d.ts +378 -21
  23. package/dist/schemas/index.js +282 -5
  24. package/dist/types/agent.d.ts +8 -1
  25. package/dist/types/bus-events.d.ts +60 -2
  26. package/dist/types/egress.d.ts +2 -2
  27. package/dist/types/egress.js +2 -2
  28. package/dist/types/file-kind.d.ts +40 -0
  29. package/dist/types/file-kind.js +157 -0
  30. package/dist/types/fs.d.ts +54 -1
  31. package/dist/types/fs.js +43 -0
  32. package/dist/types/git.d.ts +88 -0
  33. package/dist/types/git.js +101 -1
  34. package/dist/types/host-pattern.d.ts +41 -0
  35. package/dist/types/host-pattern.js +143 -0
  36. package/dist/types/index.d.ts +4 -0
  37. package/dist/types/index.js +13 -1
  38. package/dist/types/llm.d.ts +95 -0
  39. package/dist/types/llm.js +58 -0
  40. package/dist/types/maintenance.d.ts +1 -1
  41. package/dist/types/mcp.d.ts +90 -0
  42. package/dist/types/mcp.js +11 -0
  43. package/dist/types/message-stream.d.ts +389 -0
  44. package/dist/types/message-stream.js +41 -0
  45. package/dist/types/message.d.ts +49 -0
  46. package/dist/types/pack.d.ts +6 -6
  47. package/dist/types/permission.d.ts +39 -3
  48. package/dist/types/pipeline-engine.d.ts +2 -2
  49. package/dist/types/project.d.ts +30 -0
  50. package/dist/types/project.js +16 -0
  51. package/dist/types/prompt.d.ts +4 -2
  52. package/dist/types/provider.d.ts +280 -0
  53. package/dist/types/provider.js +289 -0
  54. package/dist/types/service-keys.d.ts +6 -3
  55. package/dist/types/service-keys.js +6 -1
  56. package/dist/types/session.d.ts +178 -3
  57. package/dist/types/skills.d.ts +6 -0
  58. package/dist/types/tools.d.ts +57 -0
  59. package/dist/types/tools.js +49 -1
  60. package/dist/types/user.d.ts +7 -0
  61. package/dist/types/worktree.d.ts +1 -1
  62. package/dist/utils/index.js +1 -1
  63. package/dist/utils/reasoning.d.ts +18 -2
  64. package/dist/utils/reasoning.js +16 -7
  65. package/dist/version.d.ts +1 -1
  66. package/dist/version.js +1 -1
  67. package/package.json +4 -3
@@ -1,4 +1,6 @@
1
1
  import type { SecurityTlsConfig } from './types.js';
2
+ import { matchTlsHostPattern, normalizeTlsHost } from '../types/host-pattern.js';
3
+ export { matchTlsHostPattern, normalizeTlsHost };
2
4
  /** Минимальный срез конфига, достаточный резолверу (совместим с `SynthConfig`). */
3
5
  export interface TlsConfigSource {
4
6
  security?: {
@@ -119,10 +121,11 @@ export declare function resolveTlsProfiles(config: TlsConfigSource | undefined,
119
121
  * маппингов, затем профиль по умолчанию, иначе `undefined` (без клиентского серта).
120
122
  */
121
123
  export declare function selectTlsClientProfile(profiles: Pick<ResolvedTlsProfiles, 'default' | 'mappings'>, host: string | undefined): TlsClientProfile | undefined;
122
- /** Матчинг одного паттерна (`host` | `*.suffix` | `*`); регистронезависимо. */
123
- export declare function matchTlsHostPattern(pattern: string, rawHost: string): boolean;
124
- /** Нормализует host (нижний регистр, без точки в конце и скобок IPv6). */
125
- export declare function normalizeTlsHost(rawHost: string | undefined): string | undefined;
124
+ /**
125
+ * ADR-099: семантика шаблона хоста — общая (см. `types/host-pattern.ts`):
126
+ * `normalizeTlsHost`/`matchTlsHostPattern` переиспользуются оттуда, второй
127
+ * матчер в подсистемах не заводится.
128
+ */
126
129
  /**
127
130
  * Эффективное доверие с прочитанным CA. Fail-closed: `caFile` задан, но файл
128
131
  * отсутствует/не читается/не PEM → внятная ошибка (никакого тихого фоллбэка на
@@ -11,6 +11,11 @@
11
11
  */
12
12
  import { readFileSync } from 'node:fs';
13
13
  import { isIP } from 'node:net';
14
+ // ADR-099: семантика шаблона хоста — общая для всех подсистем (TLS, egress,
15
+ // SSH-политика PROP-124). Реализация живёт в browser-safe модуле
16
+ // `types/host-pattern.ts` (его читает и UI) — второй матчер не заводим.
17
+ import { matchTlsHostPattern, normalizeTlsHost } from '../types/host-pattern.js';
18
+ export { matchTlsHostPattern, normalizeTlsHost };
14
19
  /** Env-имена секции `security.tls` (ADR-023). */
15
20
  export const TLS_ENV = {
16
21
  caFile: 'SYNTH_TLS_CA_FILE',
@@ -155,29 +160,11 @@ export function selectTlsClientProfile(profiles, host) {
155
160
  }
156
161
  return profiles.default;
157
162
  }
158
- /** Матчинг одного паттерна (`host` | `*.suffix` | `*`); регистронезависимо. */
159
- export function matchTlsHostPattern(pattern, rawHost) {
160
- const host = normalizeTlsHost(rawHost);
161
- if (host === undefined)
162
- return false;
163
- const value = pattern.trim().toLowerCase().replace(/\.$/, '');
164
- if (value === '*')
165
- return true;
166
- if (value.startsWith('*.')) {
167
- const suffix = value.slice(2);
168
- return suffix !== '' && host.endsWith(`.${suffix}`);
169
- }
170
- return host === value;
171
- }
172
- /** Нормализует host (нижний регистр, без точки в конце и скобок IPv6). */
173
- export function normalizeTlsHost(rawHost) {
174
- if (typeof rawHost !== 'string')
175
- return undefined;
176
- let host = rawHost.trim().toLowerCase().replace(/\.$/, '');
177
- if (host.startsWith('[') && host.endsWith(']'))
178
- host = host.slice(1, -1);
179
- return host === '' ? undefined : host;
180
- }
163
+ /**
164
+ * ADR-099: семантика шаблона хоста — общая (см. `types/host-pattern.ts`):
165
+ * `normalizeTlsHost`/`matchTlsHostPattern` переиспользуются оттуда, второй
166
+ * матчер в подсистемах не заводится.
167
+ */
181
168
  /**
182
169
  * Эффективное доверие с прочитанным CA. Fail-closed: `caFile` задан, но файл
183
170
  * отсутствует/не читается/не PEM → внятная ошибка (никакого тихого фоллбэка на