@itphx/synth-shared 0.10.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.
- package/dist/config/defaults.js +11 -11
- package/dist/config/env-overrides.d.ts +3 -3
- package/dist/config/env-overrides.js +9 -9
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/loader.js +4 -4
- package/dist/config/resolve.d.ts +10 -10
- package/dist/config/resolve.js +16 -16
- package/dist/config/types.d.ts +190 -190
- package/dist/config/types.js +47 -47
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +16 -10
- package/dist/interfaces/index.d.ts +3 -3
- package/dist/schemas/index.d.ts +96 -96
- package/dist/schemas/index.js +70 -70
- package/dist/skills/frontmatter.js +1 -1
- package/dist/types/agent.d.ts +30 -0
- package/dist/types/agent.js +1 -0
- package/dist/types/bus-events.d.ts +7 -0
- package/dist/types/bus-events.js +1 -0
- package/dist/types/commands.d.ts +10 -10
- package/dist/types/commands.js +2 -2
- package/dist/types/decision.d.ts +16 -16
- package/dist/types/decision.js +4 -4
- package/dist/types/events.d.ts +22 -22
- package/dist/types/fs.d.ts +44 -0
- package/dist/types/fs.js +16 -0
- package/dist/types/git.d.ts +63 -0
- package/dist/types/git.js +1 -0
- package/dist/types/hooks.d.ts +4 -4
- package/dist/types/index.d.ts +12 -1165
- package/dist/types/index.js +38 -244
- package/dist/types/llm.d.ts +32 -0
- package/dist/types/llm.js +8 -0
- package/dist/types/mcp.d.ts +104 -0
- package/dist/types/mcp.js +40 -0
- package/dist/types/message.d.ts +63 -0
- package/dist/types/message.js +12 -0
- package/dist/types/permission.d.ts +2 -2
- package/dist/types/permission.js +1 -1
- package/dist/types/project.d.ts +134 -0
- package/dist/types/project.js +67 -0
- package/dist/types/prompt.d.ts +236 -0
- package/dist/types/prompt.js +15 -0
- package/dist/types/provider.d.ts +84 -0
- package/dist/types/provider.js +35 -0
- package/dist/types/schedules.d.ts +8 -8
- package/dist/types/schedules.js +1 -1
- package/dist/types/service-keys.d.ts +10 -10
- package/dist/types/service-keys.js +3 -3
- package/dist/types/session.d.ts +269 -0
- package/dist/types/session.js +13 -0
- package/dist/types/skills.d.ts +11 -11
- package/dist/types/skills.js +6 -6
- package/dist/types/tools.d.ts +3 -3
- package/dist/types/user.d.ts +113 -0
- package/dist/types/user.js +31 -0
- package/dist/types/webhooks.d.ts +5 -5
- package/dist/types/webhooks.js +1 -1
- package/dist/utils/glob.d.ts +1 -1
- package/dist/utils/glob.js +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/workspace.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/config/types.js
CHANGED
|
@@ -16,7 +16,7 @@ export const storageConfigSchema = z.object({
|
|
|
16
16
|
/** Рабочий каталог по умолчанию для сессий без проекта. Резолвится от dataDir: {dataDir}/workspaces/default. */
|
|
17
17
|
defaultWorkspace: z.string().default(''),
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
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
|
-
/**
|
|
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 (
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
// --- Инструменты (
|
|
144
|
+
// --- Инструменты (ADR-071 §2.3) ---
|
|
145
145
|
/**
|
|
146
|
-
*
|
|
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
|
-
*
|
|
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
|
-
/**
|
|
158
|
+
/** ADR-071 §2.6: instance-wide отключение инструментов (admin). */
|
|
159
159
|
disabled: toolsDisabledConfigSchema.default({}),
|
|
160
160
|
});
|
|
161
|
-
// --- Скиллы (
|
|
161
|
+
// --- Скиллы (ADR-046) ---
|
|
162
162
|
/**
|
|
163
|
-
*
|
|
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` —
|
|
171
|
+
* попадают, тело не грузится). Установка/доверие/подписи/`lock.json` — PROP-068.
|
|
172
172
|
*
|
|
173
173
|
* Внешние локальные каталоги совместимости (`.opencode`, `.claude`, `.agents`,
|
|
174
|
-
* `~/.config/opencode`) подключаются как read-only discovery в core (
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
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-команды (
|
|
189
|
+
// --- Slash-команды (ADR-046 §7) ---
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
191
|
+
* ADR-046 §7/§9.4: конфигурация slash-команд. `paths` — дополнительные каталоги
|
|
192
192
|
* шаблонных `.md`-команд; `bundlesPath` — подкаталог `{dataDir}` для YAML-бандлов;
|
|
193
193
|
* `conflict` — режим разрешения конфликтов имён (см. resolver).
|
|
194
194
|
*/
|
|
@@ -204,9 +204,9 @@ 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
|
-
// --- Внешние события (
|
|
207
|
+
// --- Внешние события (ADR-089) ---
|
|
208
208
|
/**
|
|
209
|
-
*
|
|
209
|
+
* ADR-089: конфигурация приёма внешних событий.
|
|
210
210
|
* - `enabled` — мастер-выключатель приёма событий;
|
|
211
211
|
* - `defaultMode` — режим по умолчанию, если Router не выбрал иной;
|
|
212
212
|
* - `ephemeralTtl` — TTL ephemeral-сессий по умолчанию;
|
|
@@ -221,18 +221,18 @@ export const commandsConfigSchema = z.object({
|
|
|
221
221
|
* `default-agent` — не задавать `agentRole` (сессия возьмёт агента по умолчанию);
|
|
222
222
|
* - `keyRateLimitPerMinute` — глобальный дефолт лимита запросов/мин на API-ключ
|
|
223
223
|
* привязки (0 — без лимита; конкретный ключ может переопределить);
|
|
224
|
-
* - `decisionRouting` —
|
|
224
|
+
* - `decisionRouting` — ADR-084 × ADR-089: умная классификация внешних событий
|
|
225
225
|
* decision-моделью. `false` (default, opt-in) — только декларативные правила
|
|
226
226
|
* (`ProjectRuleProvider`); `true` — при промахе правил decision-модель выбирает
|
|
227
227
|
* шаблон агента для ephemeral-сессии. Fail-safe: ошибка/неуверенность/пустой
|
|
228
228
|
* список агентов → фоллбек Router (`defaultMode`);
|
|
229
|
-
* - `autoBind` —
|
|
229
|
+
* - `autoBind` — ADR-089: фоллбек Router закрепляет событие с `identity.chatKey`/
|
|
230
230
|
* `threadKey` за новой сессией (`EventBinding` `mode='bound'`) вместо
|
|
231
231
|
* `defaultMode`. `false` (default) — поведение не меняется; влияет только на
|
|
232
232
|
* фоллбек;
|
|
233
233
|
* - `autoBindAgentTemplate` — шаблон агента для auto-bind-сессий (пусто — агент
|
|
234
234
|
* по умолчанию);
|
|
235
|
-
* - `identityMap` —
|
|
235
|
+
* - `identityMap` — ADR-089: маппинг идентичности внешнего отправителя на
|
|
236
236
|
* владельца синт-сессии. Ключ — `identity.chatKey` (`chat:telegram:<id>`) или
|
|
237
237
|
* `identity.principalId` (`tg:<id>`), значение — id пользователя
|
|
238
238
|
* синт-инстанса. Применяется при материализации сессий `ephemeral`/`bind`:
|
|
@@ -249,19 +249,19 @@ export const eventsConfigSchema = z.object({
|
|
|
249
249
|
dedupStore: z.enum(['memory', 'file']).default('memory'),
|
|
250
250
|
unknownAgentTemplate: z.enum(['drop', 'default-agent']).default('drop'),
|
|
251
251
|
/**
|
|
252
|
-
* Глобальный дефолт лимита запросов/мин на API-ключ привязки (
|
|
252
|
+
* Глобальный дефолт лимита запросов/мин на API-ключ привязки (ADR-089/ADR-052).
|
|
253
253
|
* `0` — без лимита; конкретный ключ может переопределить своим
|
|
254
254
|
* `rateLimitPerMinute`.
|
|
255
255
|
*/
|
|
256
256
|
keyRateLimitPerMinute: z.number().int().min(0).default(0),
|
|
257
257
|
/**
|
|
258
|
-
*
|
|
258
|
+
* ADR-084 × ADR-089: decision-маршрутизация внешних событий. По умолчанию
|
|
259
259
|
* выключена (поведение не меняется) — включение требует настроенного
|
|
260
260
|
* decision-провайдера (`decision.enabled`).
|
|
261
261
|
*/
|
|
262
262
|
decisionRouting: z.boolean().default(false),
|
|
263
263
|
/**
|
|
264
|
-
*
|
|
264
|
+
* ADR-089 (auto-bind): фоллбек Router — если у события есть `identity.chatKey`
|
|
265
265
|
* или `identity.threadKey`, закрепить его за новой сессией (создать
|
|
266
266
|
* `EventBinding` `mode='bound'`) вместо `defaultMode`. По умолчанию выключено
|
|
267
267
|
* (поведение не меняется). Влияет **только** на фоллбек — явный binding,
|
|
@@ -269,12 +269,12 @@ export const eventsConfigSchema = z.object({
|
|
|
269
269
|
*/
|
|
270
270
|
autoBind: z.boolean().default(false),
|
|
271
271
|
/**
|
|
272
|
-
*
|
|
272
|
+
* ADR-089 (auto-bind): шаблон агента для auto-bind-сессий (пусто — агент по
|
|
273
273
|
* умолчанию; резолвится через `AgentRegistry` с политикой `unknownAgentTemplate`).
|
|
274
274
|
*/
|
|
275
275
|
autoBindAgentTemplate: z.string().default(''),
|
|
276
276
|
/**
|
|
277
|
-
*
|
|
277
|
+
* ADR-089: маппинг идентичности внешнего отправителя (`identity.chatKey` или
|
|
278
278
|
* `identity.principalId`) на владельца синт-сессии (id пользователя
|
|
279
279
|
* инстанса). Применяется при материализации `ephemeral`/`bind`; пусто —
|
|
280
280
|
* владелец не переопределяется (аутентифицированный пользователь запроса,
|
|
@@ -282,9 +282,9 @@ export const eventsConfigSchema = z.object({
|
|
|
282
282
|
*/
|
|
283
283
|
identityMap: z.record(z.string(), z.string()).default({}),
|
|
284
284
|
});
|
|
285
|
-
// --- Планировщик расписаний (
|
|
285
|
+
// --- Планировщик расписаний (ADR-051 срез / ADR-089) ---
|
|
286
286
|
/**
|
|
287
|
-
*
|
|
287
|
+
* ADR-051 (минимальный срез) / ADR-089: конфигурация cron/interval-планировщика.
|
|
288
288
|
* - `enabled` — мастер-выключатель сервиса (в standalone гейтит `start()`);
|
|
289
289
|
* - `tickSec` — период тика, секунды (1..3600);
|
|
290
290
|
* - `catchUp` — дефолт поведения при пропущенном срабатывании (`skip`/`once`);
|
|
@@ -304,9 +304,9 @@ export const schedulerConfigSchema = z.object({
|
|
|
304
304
|
leaderElection: z.enum(['none', 'file']).default('none'),
|
|
305
305
|
crossProcessLocks: z.boolean().default(false),
|
|
306
306
|
});
|
|
307
|
-
// --- Decision-модели (
|
|
307
|
+
// --- Decision-модели (ADR-084) ---
|
|
308
308
|
/**
|
|
309
|
-
*
|
|
309
|
+
* ADR-084: конфигурация класса decision-моделей (System One: Clef/Jev/…).
|
|
310
310
|
* - `enabled` — мастер-выключатель decision-слоя (по умолчанию выключен);
|
|
311
311
|
* - `provider` — имя провайдера decision-типа (`decision`/`systemone`);
|
|
312
312
|
* - `model` — модель decision-слоя (напр. `clef-flash`);
|
|
@@ -323,14 +323,14 @@ export const decisionConfigSchema = z.object({
|
|
|
323
323
|
provider: z.string().default(''),
|
|
324
324
|
model: z.string().default(''),
|
|
325
325
|
confidenceThreshold: z.number().min(0).max(1).default(0.6),
|
|
326
|
-
/**
|
|
326
|
+
/** ADR-084: провайдер тира эскалации; пусто — эскалации нет. */
|
|
327
327
|
escalationProvider: z.string().default(''),
|
|
328
|
-
/**
|
|
328
|
+
/** ADR-084: модель тира эскалации; пусто — эскалации нет. */
|
|
329
329
|
escalationModel: z.string().default(''),
|
|
330
330
|
});
|
|
331
|
-
// --- Webhooks (
|
|
331
|
+
// --- Webhooks (ADR-052, этап II) ---
|
|
332
332
|
/**
|
|
333
|
-
*
|
|
333
|
+
* ADR-052 (этап II): конфигурация исходящих webhooks.
|
|
334
334
|
* - `enabled` — мастер-выключатель доставки (по умолчанию выключен);
|
|
335
335
|
* - `maxAttempts` — число HTTP-попыток на доставку (экспоненциальный backoff с джиттером);
|
|
336
336
|
* - `timeoutMs` — таймаут одного HTTP-запроса;
|
|
@@ -345,9 +345,9 @@ export const webhooksConfigSchema = z.object({
|
|
|
345
345
|
allowPrivateTargets: z.boolean().default(false),
|
|
346
346
|
deliveryRetentionDays: z.number().int().min(0).default(30),
|
|
347
347
|
});
|
|
348
|
-
// --- Проектные инструкции (
|
|
348
|
+
// --- Проектные инструкции (ADR-069) ---
|
|
349
349
|
/**
|
|
350
|
-
*
|
|
350
|
+
* ADR-069 §3.4/§11: дополнительный источник проектных инструкций.
|
|
351
351
|
* `position` задаёт место в порядке: `before` — перед merged chain, `after` —
|
|
352
352
|
* после. `ttlSec` (только для URL) переопределяет `instructions.fetch.cacheTtlSec`.
|
|
353
353
|
*/
|
|
@@ -359,7 +359,7 @@ export const instructionSourceConfigSchema = z.object({
|
|
|
359
359
|
ttlSec: z.number().int().min(0).optional(),
|
|
360
360
|
});
|
|
361
361
|
/**
|
|
362
|
-
*
|
|
362
|
+
* ADR-069 §4: параметры lazy-догрузки подкаталогов (реализация — Фаза 2;
|
|
363
363
|
* схема заводится в Фазе 1).
|
|
364
364
|
*/
|
|
365
365
|
export const instructionsLazyConfigSchema = z.object({
|
|
@@ -371,7 +371,7 @@ export const instructionsLazyConfigSchema = z.object({
|
|
|
371
371
|
.default(['node_modules', '.git', 'vendor', 'dist', 'build', '.next', 'coverage', 'tmp', '.cache']),
|
|
372
372
|
});
|
|
373
373
|
/**
|
|
374
|
-
*
|
|
374
|
+
* ADR-069 §5.1/§9.1: параметры fetch URL-источников (без фонового таймера —
|
|
375
375
|
* загрузка при старте + TTL-кэш). Реализация fetch — Фаза 2.
|
|
376
376
|
*/
|
|
377
377
|
export const instructionsFetchConfigSchema = z.object({
|
|
@@ -380,7 +380,7 @@ export const instructionsFetchConfigSchema = z.object({
|
|
|
380
380
|
maxBytes: z.number().int().min(1).default(262_144),
|
|
381
381
|
});
|
|
382
382
|
/**
|
|
383
|
-
*
|
|
383
|
+
* ADR-069 §5.1/§9.1: конфигурация проектных инструкций (`AGENTS.md` и совместимые).
|
|
384
384
|
* Порядок: `sources` с `position: before` → merged chain (`git root → … → cwd`) →
|
|
385
385
|
* `sources` с `position: after`. Кап — динамический от окна модели.
|
|
386
386
|
*/
|
|
@@ -425,7 +425,7 @@ export const protectedPathsConfigSchema = z.object({
|
|
|
425
425
|
enabled: z.boolean().default(true),
|
|
426
426
|
});
|
|
427
427
|
/**
|
|
428
|
-
*
|
|
428
|
+
* ADR-052/O1: installer service-key, провижининг которого делается при старте из
|
|
429
429
|
* конфига/Secret (идемпотентно). `secret` — plaintext-секрет `synth_svc_…`
|
|
430
430
|
* (приходит из env/Secret; in config.yaml держать не рекомендуется). `scopes` —
|
|
431
431
|
* только известные (`serviceScopeSchema`); `roles` не заданы — дефолт хранилища.
|
|
@@ -442,13 +442,13 @@ export const securityConfigSchema = z.object({
|
|
|
442
442
|
promptInjection: promptInjectionConfigSchema.default({}),
|
|
443
443
|
protectedPaths: protectedPathsConfigSchema.default({}),
|
|
444
444
|
/**
|
|
445
|
-
*
|
|
445
|
+
* ADR-076: мастер-ключ для шифрования секретов at-rest (SSH-ключи, AES-256-GCM).
|
|
446
446
|
* Приоритет — env `SYNTH_SECRET_KEY` (читать через `resolveSecretKey`).
|
|
447
447
|
* Пусто — core использует файл `{dataDir}/secrets/master.key`.
|
|
448
448
|
*/
|
|
449
449
|
secretKey: z.string().default(''),
|
|
450
450
|
/**
|
|
451
|
-
*
|
|
451
|
+
* ADR-052/O1: installer service-key'и, провижининг которых выполняется
|
|
452
452
|
* идемпотентно при старте (core standalone и backend). Может задаваться
|
|
453
453
|
* JSON-строкой через env `SYNTH_BOOTSTRAP_SERVICE_KEYS` (приоритетнее
|
|
454
454
|
* config.yaml) — так секрет не попадает в файл конфигурации.
|
|
@@ -456,7 +456,7 @@ export const securityConfigSchema = z.object({
|
|
|
456
456
|
*/
|
|
457
457
|
bootstrapServiceKeys: bootstrapServiceKeysSchema.optional(),
|
|
458
458
|
});
|
|
459
|
-
// --- LLM Gateway (
|
|
459
|
+
// --- LLM Gateway (ADR-036) ---
|
|
460
460
|
export const llmGatewayRateLimitConfigSchema = z.object({
|
|
461
461
|
userPerMinute: z.number().int().min(1).default(DEFAULT_LLM_GATEWAY_RATE_LIMIT.userPerMinute),
|
|
462
462
|
providerPerMinute: z.number().int().min(1).default(DEFAULT_LLM_GATEWAY_RATE_LIMIT.providerPerMinute),
|
|
@@ -477,7 +477,7 @@ export const llmGatewayConfigSchema = z.object({
|
|
|
477
477
|
rateLimit: llmGatewayRateLimitConfigSchema.default({}),
|
|
478
478
|
audit: llmGatewayAuditConfigSchema.default({}),
|
|
479
479
|
});
|
|
480
|
-
// --- Router (
|
|
480
|
+
// --- Router (ADR-034) ---
|
|
481
481
|
export const routerContentConfigSchema = z.object({
|
|
482
482
|
coding: z.object({
|
|
483
483
|
provider: z.string().default(''),
|
|
@@ -513,7 +513,7 @@ export const routerSubagentConfigSchema = z.object({
|
|
|
513
513
|
model: z.string().default(''),
|
|
514
514
|
provider: z.string().default(''),
|
|
515
515
|
});
|
|
516
|
-
// --- Micro-first (
|
|
516
|
+
// --- Micro-first (ADR-035) ---
|
|
517
517
|
export const microFirstConfigSchema = z.object({
|
|
518
518
|
enabled: z.boolean().default(false),
|
|
519
519
|
confidenceThreshold: z.number().min(0).max(1).default(0.8),
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -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", "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"];
|
|
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}-плейсхолдеров из шаблона. Уникальные, в порядке появления. */
|
package/dist/i18n/index.js
CHANGED
|
@@ -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',
|
|
@@ -242,14 +245,14 @@ export const ENGINE_MESSAGE_KEYS = [
|
|
|
242
245
|
'micro.intent.debug',
|
|
243
246
|
'micro.intent.fix',
|
|
244
247
|
'micro.intent.test',
|
|
245
|
-
// --- Скиллы (
|
|
248
|
+
// --- Скиллы (ADR-046) ---
|
|
246
249
|
'skill.args_error',
|
|
247
250
|
'skill.not_found',
|
|
248
251
|
'skill.untrusted',
|
|
249
252
|
'skill.delegation',
|
|
250
253
|
'skill.file_not_found',
|
|
251
254
|
'skill.scope_disabled',
|
|
252
|
-
// --- Slash-команды (
|
|
255
|
+
// --- Slash-команды (ADR-046 §7) ---
|
|
253
256
|
'command.unknown',
|
|
254
257
|
'command.denied',
|
|
255
258
|
'command.unavailable',
|
|
@@ -258,13 +261,13 @@ export const ENGINE_MESSAGE_KEYS = [
|
|
|
258
261
|
'command.skills_empty',
|
|
259
262
|
'command.summary_enqueued',
|
|
260
263
|
'command.summary_unavailable',
|
|
261
|
-
// --- Inline shell (
|
|
264
|
+
// --- Inline shell (ADR-046 §7.4) ---
|
|
262
265
|
'command.inline_shell_disabled',
|
|
263
266
|
'command.inline_shell_denied',
|
|
264
267
|
'command.inline_shell_failed',
|
|
265
268
|
'command.inline_shell_truncated',
|
|
266
269
|
'command.inline_shell_unavailable',
|
|
267
|
-
// --- Git-репозитории и SSH-ключи (
|
|
270
|
+
// --- Git-репозитории и SSH-ключи (ADR-076) ---
|
|
268
271
|
'sshkey.not_found',
|
|
269
272
|
'sshkey.name_exists',
|
|
270
273
|
'sshkey.encryption_unavailable',
|
|
@@ -273,7 +276,7 @@ export const ENGINE_MESSAGE_KEYS = [
|
|
|
273
276
|
'git.ssh_key_required',
|
|
274
277
|
'git.repo_path_invalid',
|
|
275
278
|
'git.repo_exists',
|
|
276
|
-
// --- Внешние события и хуки (
|
|
279
|
+
// --- Внешние события и хуки (ADR-030 / ADR-089) ---
|
|
277
280
|
'event.ingested',
|
|
278
281
|
'event.routed.bound',
|
|
279
282
|
'event.routed.ephemeral',
|
|
@@ -354,6 +357,8 @@ export const ENGINE_MESSAGE_PARAMS = {
|
|
|
354
357
|
'web.fetch_all_failed': [],
|
|
355
358
|
'web.no_results': ["query"],
|
|
356
359
|
'web.search_error': ["error"],
|
|
360
|
+
'web.ssrf_blocked': ["reason"],
|
|
361
|
+
'web.too_many_redirects': [],
|
|
357
362
|
'search.no_matches': [],
|
|
358
363
|
'search.matches_truncated': ["total"],
|
|
359
364
|
'search.rg_not_installed': [],
|
|
@@ -464,6 +469,7 @@ export const ENGINE_MESSAGE_PARAMS = {
|
|
|
464
469
|
'permission.mcp_unavailable': ["mode"],
|
|
465
470
|
'permission.dep_unavailable': ["binary"],
|
|
466
471
|
'permission.workspace_unavailable': [],
|
|
472
|
+
'permission.external_directory_default': ["path", "action"],
|
|
467
473
|
'permission.no_rules': ["tool"],
|
|
468
474
|
'permission.rule_matched': ["key", "action"],
|
|
469
475
|
'permission.rule_pattern_matched': ["key", "pattern", "action", "path"],
|
|
@@ -522,14 +528,14 @@ export const ENGINE_MESSAGE_PARAMS = {
|
|
|
522
528
|
'micro.intent.debug': [],
|
|
523
529
|
'micro.intent.fix': [],
|
|
524
530
|
'micro.intent.test': [],
|
|
525
|
-
// --- Скиллы (
|
|
531
|
+
// --- Скиллы (ADR-046) ---
|
|
526
532
|
'skill.args_error': ["issues"],
|
|
527
533
|
'skill.not_found': ["name"],
|
|
528
534
|
'skill.untrusted': ["name"],
|
|
529
535
|
'skill.delegation': ["name", "capabilities", "agent"],
|
|
530
536
|
'skill.file_not_found': ["path"],
|
|
531
537
|
'skill.scope_disabled': ["name", "reason"],
|
|
532
|
-
// --- Slash-команды (
|
|
538
|
+
// --- Slash-команды (ADR-046 §7) ---
|
|
533
539
|
'command.unknown': ["name"],
|
|
534
540
|
'command.denied': ["name"],
|
|
535
541
|
'command.unavailable': ["name", "capabilities"],
|
|
@@ -538,13 +544,13 @@ export const ENGINE_MESSAGE_PARAMS = {
|
|
|
538
544
|
'command.skills_empty': [],
|
|
539
545
|
'command.summary_enqueued': [],
|
|
540
546
|
'command.summary_unavailable': [],
|
|
541
|
-
// --- Inline shell (
|
|
547
|
+
// --- Inline shell (ADR-046 §7.4) ---
|
|
542
548
|
'command.inline_shell_disabled': [],
|
|
543
549
|
'command.inline_shell_denied': ["command", "reason"],
|
|
544
550
|
'command.inline_shell_failed': ["output"],
|
|
545
551
|
'command.inline_shell_truncated': ["limit"],
|
|
546
552
|
'command.inline_shell_unavailable': [],
|
|
547
|
-
// --- Git-репозитории и SSH-ключи (
|
|
553
|
+
// --- Git-репозитории и SSH-ключи (ADR-076) ---
|
|
548
554
|
'sshkey.not_found': ["id"],
|
|
549
555
|
'sshkey.name_exists': ["name"],
|
|
550
556
|
'sshkey.encryption_unavailable': [],
|
|
@@ -553,7 +559,7 @@ export const ENGINE_MESSAGE_PARAMS = {
|
|
|
553
559
|
'git.ssh_key_required': ["path"],
|
|
554
560
|
'git.repo_path_invalid': ["path"],
|
|
555
561
|
'git.repo_exists': ["path"],
|
|
556
|
-
// --- Внешние события и хуки (
|
|
562
|
+
// --- Внешние события и хуки (ADR-030 / ADR-089) ---
|
|
557
563
|
'event.ingested': ["id", "source"],
|
|
558
564
|
'event.routed.bound': ["sessionId"],
|
|
559
565
|
'event.routed.ephemeral': ["agentTemplate"],
|
|
@@ -93,11 +93,11 @@ export interface ProfileStore {
|
|
|
93
93
|
getProfileByEmail(email: string): Promise<ProfileData | null>;
|
|
94
94
|
getOrCreateProfile(params: CreateProfileParams): Promise<ProfileData>;
|
|
95
95
|
updateLastLogin(id: string): Promise<void>;
|
|
96
|
-
/**
|
|
96
|
+
/** ADR-089: профиль по внешней идентичности (provider+externalId); null — нет. */
|
|
97
97
|
findProfileByExternalId(provider: string, externalId: string): Promise<ProfileData | null>;
|
|
98
|
-
/**
|
|
98
|
+
/** ADR-089: привязать идентичность (идемпотентно). Занята другим профилем → null (конфликт). */
|
|
99
99
|
linkIdentity(userId: string, identity: ExternalIdentity): Promise<ProfileData | null>;
|
|
100
|
-
/**
|
|
100
|
+
/** ADR-089: отвязать идентичность; null — профиля/идентичности нет. */
|
|
101
101
|
unlinkIdentity(userId: string, provider: string, externalId: string): Promise<ProfileData | null>;
|
|
102
102
|
}
|
|
103
103
|
import type { BusEvent } from '../types/index.js';
|