@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.
- package/dist/config/defaults.js +125 -5
- package/dist/config/env-overrides.d.ts +23 -4
- package/dist/config/env-overrides.js +103 -4
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/loader.d.ts +8 -0
- package/dist/config/loader.js +6 -1
- package/dist/config/redact.d.ts +22 -0
- package/dist/config/redact.js +53 -0
- package/dist/config/resolve.d.ts +17 -0
- package/dist/config/resolve.js +40 -1
- package/dist/config/tls.d.ts +7 -4
- package/dist/config/tls.js +10 -23
- package/dist/config/types.d.ts +496 -11
- package/dist/config/types.js +348 -6
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +317 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/model-metadata.d.ts +10 -0
- package/dist/model-metadata.js +10 -0
- package/dist/schemas/index.d.ts +378 -21
- package/dist/schemas/index.js +282 -5
- package/dist/types/agent.d.ts +8 -1
- package/dist/types/bus-events.d.ts +60 -2
- package/dist/types/egress.d.ts +2 -2
- package/dist/types/egress.js +2 -2
- package/dist/types/file-kind.d.ts +40 -0
- package/dist/types/file-kind.js +157 -0
- package/dist/types/fs.d.ts +54 -1
- package/dist/types/fs.js +43 -0
- package/dist/types/git.d.ts +88 -0
- package/dist/types/git.js +101 -1
- package/dist/types/host-pattern.d.ts +41 -0
- package/dist/types/host-pattern.js +143 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +13 -1
- package/dist/types/llm.d.ts +95 -0
- package/dist/types/llm.js +58 -0
- package/dist/types/maintenance.d.ts +1 -1
- package/dist/types/mcp.d.ts +90 -0
- package/dist/types/mcp.js +11 -0
- package/dist/types/message-stream.d.ts +389 -0
- package/dist/types/message-stream.js +41 -0
- package/dist/types/message.d.ts +49 -0
- package/dist/types/pack.d.ts +6 -6
- package/dist/types/permission.d.ts +39 -3
- package/dist/types/pipeline-engine.d.ts +2 -2
- package/dist/types/project.d.ts +30 -0
- package/dist/types/project.js +16 -0
- package/dist/types/prompt.d.ts +4 -2
- package/dist/types/provider.d.ts +280 -0
- package/dist/types/provider.js +289 -0
- package/dist/types/service-keys.d.ts +6 -3
- package/dist/types/service-keys.js +6 -1
- package/dist/types/session.d.ts +178 -3
- package/dist/types/skills.d.ts +6 -0
- package/dist/types/tools.d.ts +57 -0
- package/dist/types/tools.js +49 -1
- package/dist/types/user.d.ts +7 -0
- package/dist/types/worktree.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/reasoning.d.ts +18 -2
- package/dist/utils/reasoning.js +16 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -3
package/dist/config/tls.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
/**
|
|
125
|
+
* ADR-099: семантика шаблона хоста — общая (см. `types/host-pattern.ts`):
|
|
126
|
+
* `normalizeTlsHost`/`matchTlsHostPattern` переиспользуются оттуда, второй
|
|
127
|
+
* матчер в подсистемах не заводится.
|
|
128
|
+
*/
|
|
126
129
|
/**
|
|
127
130
|
* Эффективное доверие с прочитанным CA. Fail-closed: `caFile` задан, но файл
|
|
128
131
|
* отсутствует/не читается/не PEM → внятная ошибка (никакого тихого фоллбэка на
|
package/dist/config/tls.js
CHANGED
|
@@ -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
|
-
/**
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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 → внятная ошибка (никакого тихого фоллбэка на
|