@itphx/synth-shared 0.9.0 → 0.10.0
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 +50 -0
- package/dist/config/env-overrides.d.ts +68 -0
- package/dist/config/env-overrides.js +165 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/loader.d.ts +2 -0
- package/dist/config/loader.js +10 -2
- package/dist/config/resolve.d.ts +17 -0
- package/dist/config/resolve.js +21 -0
- package/dist/config/types.d.ts +589 -36
- package/dist/config/types.js +168 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +36 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -2
- package/dist/interfaces/index.d.ts +8 -1
- package/dist/schemas/index.d.ts +1678 -0
- package/dist/schemas/index.js +375 -1
- package/dist/types/decision.d.ts +502 -0
- package/dist/types/decision.js +98 -0
- package/dist/types/events.d.ts +219 -0
- package/dist/types/events.js +1 -0
- package/dist/types/hooks.d.ts +96 -0
- package/dist/types/hooks.js +1 -0
- package/dist/types/index.d.ts +75 -1
- package/dist/types/index.js +35 -0
- package/dist/types/schedules.d.ts +109 -0
- package/dist/types/schedules.js +9 -0
- package/dist/types/service-keys.d.ts +106 -0
- package/dist/types/service-keys.js +72 -0
- package/dist/types/tools.d.ts +1 -0
- package/dist/types/tools.js +2 -0
- package/dist/types/webhooks.d.ts +97 -0
- package/dist/types/webhooks.js +53 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/config/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { permissionConfigSchema } from '../types/permission.js';
|
|
3
|
-
import { createToolsDisabledSchema } from '../schemas/index.js';
|
|
3
|
+
import { createToolsDisabledSchema, globalRoleSchema, serviceScopeSchema } from '../schemas/index.js';
|
|
4
4
|
import { TOOLS_POLICIES, MCP_NETWORK_POLICY_MODES, COMMAND_CONFLICT_MODES, DEFAULT_MCP_PRIVATE_CIDRS, DEFAULT_MCP_NETWORK_POLICY, DEFAULT_LLM_GATEWAY_RATE_LIMIT, ToolCapability, } from '../types/index.js';
|
|
5
5
|
const toolCapabilityValues = Object.values(ToolCapability);
|
|
6
6
|
// --- SynthConfig: единый конфиг для всех компонентов ---
|
|
@@ -204,6 +204,147 @@ export const commandsConfigSchema = z.object({
|
|
|
204
204
|
maxArgumentsLength: z.number().int().min(1).default(10_000),
|
|
205
205
|
maxRenderedBytes: z.number().int().min(1).default(200_000),
|
|
206
206
|
});
|
|
207
|
+
// --- Внешние события (AD-089) ---
|
|
208
|
+
/**
|
|
209
|
+
* AD-089: конфигурация приёма внешних событий.
|
|
210
|
+
* - `enabled` — мастер-выключатель приёма событий;
|
|
211
|
+
* - `defaultMode` — режим по умолчанию, если Router не выбрал иной;
|
|
212
|
+
* - `ephemeralTtl` — TTL ephemeral-сессий по умолчанию;
|
|
213
|
+
* - `journalRetentionDays` — срок хранения журнала событий (0 — без ограничения);
|
|
214
|
+
* - `allowedSources` — белый список источников (пусто — разрешены все);
|
|
215
|
+
* - `dedupStore` — источник дедупа событий: `memory` (in-process `Set`, поведение
|
|
216
|
+
* single-process) | `file` (межпроцессный атомарный claim файлами-маркерами на
|
|
217
|
+
* общем `dataDir`). Default — `memory` (OFF): поведение single-process не меняется;
|
|
218
|
+
* - `unknownAgentTemplate` — поведение, если `agentTemplate` события/правила не
|
|
219
|
+
* резолвится в существующего enabled-агента: `drop` — не создавать сессию и
|
|
220
|
+
* зафиксировать ошибку `agent_not_found` в журнале (fail-safe, default) |
|
|
221
|
+
* `default-agent` — не задавать `agentRole` (сессия возьмёт агента по умолчанию);
|
|
222
|
+
* - `keyRateLimitPerMinute` — глобальный дефолт лимита запросов/мин на API-ключ
|
|
223
|
+
* привязки (0 — без лимита; конкретный ключ может переопределить);
|
|
224
|
+
* - `decisionRouting` — AD-084 × AD-089: умная классификация внешних событий
|
|
225
|
+
* decision-моделью. `false` (default, opt-in) — только декларативные правила
|
|
226
|
+
* (`ProjectRuleProvider`); `true` — при промахе правил decision-модель выбирает
|
|
227
|
+
* шаблон агента для ephemeral-сессии. Fail-safe: ошибка/неуверенность/пустой
|
|
228
|
+
* список агентов → фоллбек Router (`defaultMode`);
|
|
229
|
+
* - `autoBind` — AD-089: фоллбек Router закрепляет событие с `identity.chatKey`/
|
|
230
|
+
* `threadKey` за новой сессией (`EventBinding` `mode='bound'`) вместо
|
|
231
|
+
* `defaultMode`. `false` (default) — поведение не меняется; влияет только на
|
|
232
|
+
* фоллбек;
|
|
233
|
+
* - `autoBindAgentTemplate` — шаблон агента для auto-bind-сессий (пусто — агент
|
|
234
|
+
* по умолчанию);
|
|
235
|
+
* - `identityMap` — AD-089: маппинг идентичности внешнего отправителя на
|
|
236
|
+
* владельца синт-сессии. Ключ — `identity.chatKey` (`chat:telegram:<id>`) или
|
|
237
|
+
* `identity.principalId` (`tg:<id>`), значение — id пользователя
|
|
238
|
+
* синт-инстанса. Применяется при материализации сессий `ephemeral`/`bind`:
|
|
239
|
+
* совпадение (сначала `chatKey`, затем `principalId`) задаёт владельца сессии.
|
|
240
|
+
* Пусто (default) — сессия принадлежит аутентифицированному пользователю
|
|
241
|
+
* запроса (или `identity.principalId`/`resolveOwnerId`), прежнее поведение.
|
|
242
|
+
*/
|
|
243
|
+
export const eventsConfigSchema = z.object({
|
|
244
|
+
enabled: z.boolean().default(true),
|
|
245
|
+
defaultMode: z.enum(['bound', 'ephemeral']).default('bound'),
|
|
246
|
+
ephemeralTtl: z.string().default('24h'),
|
|
247
|
+
journalRetentionDays: z.number().int().min(0).default(30),
|
|
248
|
+
allowedSources: z.array(z.string()).default([]),
|
|
249
|
+
dedupStore: z.enum(['memory', 'file']).default('memory'),
|
|
250
|
+
unknownAgentTemplate: z.enum(['drop', 'default-agent']).default('drop'),
|
|
251
|
+
/**
|
|
252
|
+
* Глобальный дефолт лимита запросов/мин на API-ключ привязки (AD-089/AD-052).
|
|
253
|
+
* `0` — без лимита; конкретный ключ может переопределить своим
|
|
254
|
+
* `rateLimitPerMinute`.
|
|
255
|
+
*/
|
|
256
|
+
keyRateLimitPerMinute: z.number().int().min(0).default(0),
|
|
257
|
+
/**
|
|
258
|
+
* AD-084 × AD-089: decision-маршрутизация внешних событий. По умолчанию
|
|
259
|
+
* выключена (поведение не меняется) — включение требует настроенного
|
|
260
|
+
* decision-провайдера (`decision.enabled`).
|
|
261
|
+
*/
|
|
262
|
+
decisionRouting: z.boolean().default(false),
|
|
263
|
+
/**
|
|
264
|
+
* AD-089 (auto-bind): фоллбек Router — если у события есть `identity.chatKey`
|
|
265
|
+
* или `identity.threadKey`, закрепить его за новой сессией (создать
|
|
266
|
+
* `EventBinding` `mode='bound'`) вместо `defaultMode`. По умолчанию выключено
|
|
267
|
+
* (поведение не меняется). Влияет **только** на фоллбек — явный binding,
|
|
268
|
+
* правила и decision-маршрутизация сохраняют своё поведение.
|
|
269
|
+
*/
|
|
270
|
+
autoBind: z.boolean().default(false),
|
|
271
|
+
/**
|
|
272
|
+
* AD-089 (auto-bind): шаблон агента для auto-bind-сессий (пусто — агент по
|
|
273
|
+
* умолчанию; резолвится через `AgentRegistry` с политикой `unknownAgentTemplate`).
|
|
274
|
+
*/
|
|
275
|
+
autoBindAgentTemplate: z.string().default(''),
|
|
276
|
+
/**
|
|
277
|
+
* AD-089: маппинг идентичности внешнего отправителя (`identity.chatKey` или
|
|
278
|
+
* `identity.principalId`) на владельца синт-сессии (id пользователя
|
|
279
|
+
* инстанса). Применяется при материализации `ephemeral`/`bind`; пусто —
|
|
280
|
+
* владелец не переопределяется (аутентифицированный пользователь запроса,
|
|
281
|
+
* `identity.principalId` или `resolveOwnerId`).
|
|
282
|
+
*/
|
|
283
|
+
identityMap: z.record(z.string(), z.string()).default({}),
|
|
284
|
+
});
|
|
285
|
+
// --- Планировщик расписаний (AD-051 срез / AD-089) ---
|
|
286
|
+
/**
|
|
287
|
+
* AD-051 (минимальный срез) / AD-089: конфигурация cron/interval-планировщика.
|
|
288
|
+
* - `enabled` — мастер-выключатель сервиса (в standalone гейтит `start()`);
|
|
289
|
+
* - `tickSec` — период тика, секунды (1..3600);
|
|
290
|
+
* - `catchUp` — дефолт поведения при пропущенном срабатывании (`skip`/`once`);
|
|
291
|
+
* - `jobRetentionDays` — срок хранения Job-истории (дни, `prune` на старте);
|
|
292
|
+
* - `leaderElection` — выбор лидера-владельца тикера: `none` (каждый процесс
|
|
293
|
+
* считает себя лидером, поведение single-process) | `file` (file-based lock на
|
|
294
|
+
* общем `dataDir`). Default — `none` (OFF);
|
|
295
|
+
* - `crossProcessLocks` — межпроцессная сериализация мутаций `ScheduleStore`
|
|
296
|
+
* (file-мьютекс поверх in-process `AsyncLock`). Default — `false` (OFF):
|
|
297
|
+
* поведение single-process не меняется.
|
|
298
|
+
*/
|
|
299
|
+
export const schedulerConfigSchema = z.object({
|
|
300
|
+
enabled: z.boolean().default(true),
|
|
301
|
+
tickSec: z.number().int().min(1).max(3600).default(60),
|
|
302
|
+
catchUp: z.enum(['skip', 'once']).default('skip'),
|
|
303
|
+
jobRetentionDays: z.number().int().min(0).default(30),
|
|
304
|
+
leaderElection: z.enum(['none', 'file']).default('none'),
|
|
305
|
+
crossProcessLocks: z.boolean().default(false),
|
|
306
|
+
});
|
|
307
|
+
// --- Decision-модели (AD-084) ---
|
|
308
|
+
/**
|
|
309
|
+
* AD-084: конфигурация класса decision-моделей (System One: Clef/Jev/…).
|
|
310
|
+
* - `enabled` — мастер-выключатель decision-слоя (по умолчанию выключен);
|
|
311
|
+
* - `provider` — имя провайдера decision-типа (`decision`/`systemone`);
|
|
312
|
+
* - `model` — модель decision-слоя (напр. `clef-flash`);
|
|
313
|
+
* - `confidenceThreshold` — порог уверенности, ниже — fallback (fail-safe);
|
|
314
|
+
* - `escalationProvider`/`escalationModel` — необязательный точный тир на
|
|
315
|
+
* эскалацию (вторая пара provider/model, напр. Clef): при промахе primary
|
|
316
|
+
* decision-каскад пробует эскалацию. Пусто — эскалации нет.
|
|
317
|
+
*
|
|
318
|
+
* Транспорт задаётся типом провайдера (`decision` → `POST {base}/decisions`,
|
|
319
|
+
* `systemone` → `POST {base}/v1/systemone`), а таймаут — свойством провайдера.
|
|
320
|
+
*/
|
|
321
|
+
export const decisionConfigSchema = z.object({
|
|
322
|
+
enabled: z.boolean().default(false),
|
|
323
|
+
provider: z.string().default(''),
|
|
324
|
+
model: z.string().default(''),
|
|
325
|
+
confidenceThreshold: z.number().min(0).max(1).default(0.6),
|
|
326
|
+
/** AD-084: провайдер тира эскалации; пусто — эскалации нет. */
|
|
327
|
+
escalationProvider: z.string().default(''),
|
|
328
|
+
/** AD-084: модель тира эскалации; пусто — эскалации нет. */
|
|
329
|
+
escalationModel: z.string().default(''),
|
|
330
|
+
});
|
|
331
|
+
// --- Webhooks (AD-052, этап II) ---
|
|
332
|
+
/**
|
|
333
|
+
* AD-052 (этап II): конфигурация исходящих webhooks.
|
|
334
|
+
* - `enabled` — мастер-выключатель доставки (по умолчанию выключен);
|
|
335
|
+
* - `maxAttempts` — число HTTP-попыток на доставку (экспоненциальный backoff с джиттером);
|
|
336
|
+
* - `timeoutMs` — таймаут одного HTTP-запроса;
|
|
337
|
+
* - `allowPrivateTargets` — разрешить http и приватные/loopback адреса (для dev;
|
|
338
|
+
* по умолчанию `false` — только https и публичные адреса, защита от SSRF);
|
|
339
|
+
* - `deliveryRetentionDays` — срок хранения журнала доставок (0 — без ограничения).
|
|
340
|
+
*/
|
|
341
|
+
export const webhooksConfigSchema = z.object({
|
|
342
|
+
enabled: z.boolean().default(false),
|
|
343
|
+
maxAttempts: z.number().int().min(1).max(10).default(5),
|
|
344
|
+
timeoutMs: z.number().int().min(1).default(10_000),
|
|
345
|
+
allowPrivateTargets: z.boolean().default(false),
|
|
346
|
+
deliveryRetentionDays: z.number().int().min(0).default(30),
|
|
347
|
+
});
|
|
207
348
|
// --- Проектные инструкции (AD-069) ---
|
|
208
349
|
/**
|
|
209
350
|
* AD-069 §3.4/§11: дополнительный источник проектных инструкций.
|
|
@@ -283,6 +424,20 @@ export const protectedPathsConfigSchema = z.object({
|
|
|
283
424
|
/** Глобальный выключатель защиты защищённых путей (сквозная проверка файловых тулов). */
|
|
284
425
|
enabled: z.boolean().default(true),
|
|
285
426
|
});
|
|
427
|
+
/**
|
|
428
|
+
* AD-052/O1: installer service-key, провижининг которого делается при старте из
|
|
429
|
+
* конфига/Secret (идемпотентно). `secret` — plaintext-секрет `synth_svc_…`
|
|
430
|
+
* (приходит из env/Secret; in config.yaml держать не рекомендуется). `scopes` —
|
|
431
|
+
* только известные (`serviceScopeSchema`); `roles` не заданы — дефолт хранилища.
|
|
432
|
+
*/
|
|
433
|
+
export const bootstrapServiceKeySchema = z.object({
|
|
434
|
+
label: z.string().trim().min(1),
|
|
435
|
+
secret: z.string().min(1),
|
|
436
|
+
scopes: z.array(serviceScopeSchema).min(1),
|
|
437
|
+
roles: z.array(globalRoleSchema).optional(),
|
|
438
|
+
description: z.string().optional(),
|
|
439
|
+
});
|
|
440
|
+
export const bootstrapServiceKeysSchema = z.array(bootstrapServiceKeySchema);
|
|
286
441
|
export const securityConfigSchema = z.object({
|
|
287
442
|
promptInjection: promptInjectionConfigSchema.default({}),
|
|
288
443
|
protectedPaths: protectedPathsConfigSchema.default({}),
|
|
@@ -292,6 +447,14 @@ export const securityConfigSchema = z.object({
|
|
|
292
447
|
* Пусто — core использует файл `{dataDir}/secrets/master.key`.
|
|
293
448
|
*/
|
|
294
449
|
secretKey: z.string().default(''),
|
|
450
|
+
/**
|
|
451
|
+
* AD-052/O1: installer service-key'и, провижининг которых выполняется
|
|
452
|
+
* идемпотентно при старте (core standalone и backend). Может задаваться
|
|
453
|
+
* JSON-строкой через env `SYNTH_BOOTSTRAP_SERVICE_KEYS` (приоритетнее
|
|
454
|
+
* config.yaml) — так секрет не попадает в файл конфигурации.
|
|
455
|
+
* Опционально (legacy/литеральные SecurityConfig без поля — валидны).
|
|
456
|
+
*/
|
|
457
|
+
bootstrapServiceKeys: bootstrapServiceKeysSchema.optional(),
|
|
295
458
|
});
|
|
296
459
|
// --- LLM Gateway (AD-036) ---
|
|
297
460
|
export const llmGatewayRateLimitConfigSchema = z.object({
|
|
@@ -416,6 +579,10 @@ export const synthConfigSchema = z.object({
|
|
|
416
579
|
tools: toolsConfigSchema.default({}),
|
|
417
580
|
skills: skillsConfigSchema.default({}),
|
|
418
581
|
commands: commandsConfigSchema.default({}),
|
|
582
|
+
events: eventsConfigSchema.default({}),
|
|
583
|
+
scheduler: schedulerConfigSchema.default({}),
|
|
584
|
+
decision: decisionConfigSchema.default({}),
|
|
585
|
+
webhooks: webhooksConfigSchema.default({}),
|
|
419
586
|
instructions: instructionsConfigSchema.default({}),
|
|
420
587
|
router: routerConfigSchema.default({}),
|
|
421
588
|
remote: remoteConfigSchema.default({}),
|
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", "qc.min_length_ok", "qc.min_length_fail_detail", "qc.min_length_fail", "qc.constraint_empty", "qc.constraint_parse_error", "qc.constraint_ok", "qc.self_check_skipped", "qc.self_check_unparsed", "qc.self_check_low", "qc.self_check_low_reason", "qc.self_check_ok", "qc.self_check_error", "qc.all_passed", "micro.greeting", "micro.farewell", "micro.thanks", "micro.enum.yes", "micro.enum.no", "micro.enum.approve", "micro.enum.reject", "micro.enum.mode_plan", "micro.enum.mode_act", "micro.intent.question", "micro.intent.command", "micro.intent.review", "micro.intent.explain", "micro.intent.debug", "micro.intent.fix", "micro.intent.test", "skill.args_error", "skill.not_found", "skill.untrusted", "skill.delegation", "skill.file_not_found", "skill.scope_disabled", "command.unknown", "command.denied", "command.unavailable", "command.help", "command.list_empty", "command.skills_empty", "command.summary_enqueued", "command.summary_unavailable", "command.inline_shell_disabled", "command.inline_shell_denied", "command.inline_shell_failed", "command.inline_shell_truncated", "command.inline_shell_unavailable", "sshkey.not_found", "sshkey.name_exists", "sshkey.encryption_unavailable", "sshkey.decrypt_failed", "sshkey.env_failed", "git.ssh_key_required", "git.repo_path_invalid", "git.repo_exists"];
|
|
14
|
+
export declare const ENGINE_MESSAGE_KEYS: readonly ["session.max_iterations", "session.stopped", "session.stopped_reason_denied", "session.denied_blocked", "session.empty_response", "session.dialog_title", "session.default_title", "session.reference_label", "session.reference_link", "session.retry_cancelled", "session.subtask_title", "task.stopped_by_user", "task.stopped_before_completion", "task.stopped_by_deny", "task.empty_response", "task.subagent_exec_error", "task.subagent_not_found", "task.subagent_not_allowed", "task.deps_unavailable", "task.subagent_exec_error_after_retries", "task.resume_marker", "task.resume_result", "task.resume_failed", "task.resume_aborted", "task.resume_session_not_found", "task.resume_no_parent", "task.resume_parent_not_found", "task.resume_locked", "task.resume_agent_not_found", "task.resume_provider_unavailable", "tool.args_error", "tool.exec_error", "tool.not_found", "tool.permission_denied_default", "tool.doom_loop", "tool.empty_output", "tool.output_truncated", "tool.shell_error", "tool.command_failed_default", "tool.aborted", "tool.binary_missing", "fs.file_written", "fs.file_edited", "fs.replace_not_found", "fs.replace_multiple", "fs.dir_created", "fs.file_deleted", "fsread.empty_directory", "fsread.no_files", "fsread.glob_error", "web.duckduckgo_blocked", "web.search_failed", "web.search_results", "web.fetch_args_url_required", "web.js_framework_warning", "web.low_content_warning", "web.content_truncated", "web.block_timeout", "web.block_error", "web.fetch_all_failed", "web.no_results", "web.search_error", "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"];
|
|
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
|
@@ -212,6 +212,7 @@ export const ENGINE_MESSAGE_KEYS = [
|
|
|
212
212
|
'router.escalation',
|
|
213
213
|
'router.context_length_exceeded',
|
|
214
214
|
'router.rate_limit_exceeded',
|
|
215
|
+
'router.no_user_query',
|
|
215
216
|
'qc.min_length_ok',
|
|
216
217
|
'qc.min_length_fail_detail',
|
|
217
218
|
'qc.min_length_fail',
|
|
@@ -272,6 +273,23 @@ export const ENGINE_MESSAGE_KEYS = [
|
|
|
272
273
|
'git.ssh_key_required',
|
|
273
274
|
'git.repo_path_invalid',
|
|
274
275
|
'git.repo_exists',
|
|
276
|
+
// --- Внешние события и хуки (AD-030 / AD-089) ---
|
|
277
|
+
'event.ingested',
|
|
278
|
+
'event.routed.bound',
|
|
279
|
+
'event.routed.ephemeral',
|
|
280
|
+
'event.routed.queue',
|
|
281
|
+
'event.routed.drop',
|
|
282
|
+
'event.binding.not_found',
|
|
283
|
+
'event.source_not_allowed',
|
|
284
|
+
'event.duplicate',
|
|
285
|
+
'hook.blocked',
|
|
286
|
+
// --- Профиль пользователя и онбординг ---
|
|
287
|
+
'profile.deps_unavailable',
|
|
288
|
+
'profile.session_read_error',
|
|
289
|
+
'profile.session_not_found',
|
|
290
|
+
'profile.user_unavailable',
|
|
291
|
+
'profile.save_error',
|
|
292
|
+
'profile.updated',
|
|
275
293
|
];
|
|
276
294
|
export const ENGINE_MESSAGE_PARAMS = {
|
|
277
295
|
'session.max_iterations': [],
|
|
@@ -474,6 +492,7 @@ export const ENGINE_MESSAGE_PARAMS = {
|
|
|
474
492
|
'router.escalation': ["provider", "model", "reason"],
|
|
475
493
|
'router.context_length_exceeded': [],
|
|
476
494
|
'router.rate_limit_exceeded': [],
|
|
495
|
+
'router.no_user_query': [],
|
|
477
496
|
'qc.min_length_ok': ["length", "min"],
|
|
478
497
|
'qc.min_length_fail_detail': ["min", "length"],
|
|
479
498
|
'qc.min_length_fail': ["min"],
|
|
@@ -534,6 +553,23 @@ export const ENGINE_MESSAGE_PARAMS = {
|
|
|
534
553
|
'git.ssh_key_required': ["path"],
|
|
535
554
|
'git.repo_path_invalid': ["path"],
|
|
536
555
|
'git.repo_exists': ["path"],
|
|
556
|
+
// --- Внешние события и хуки (AD-030 / AD-089) ---
|
|
557
|
+
'event.ingested': ["id", "source"],
|
|
558
|
+
'event.routed.bound': ["sessionId"],
|
|
559
|
+
'event.routed.ephemeral': ["agentTemplate"],
|
|
560
|
+
'event.routed.queue': ["owner", "reason"],
|
|
561
|
+
'event.routed.drop': ["reason"],
|
|
562
|
+
'event.binding.not_found': ["key"],
|
|
563
|
+
'event.source_not_allowed': ["source"],
|
|
564
|
+
'event.duplicate': ["dedupKey"],
|
|
565
|
+
'hook.blocked': ["hook", "reason"],
|
|
566
|
+
// --- Профиль пользователя и онбординг ---
|
|
567
|
+
'profile.deps_unavailable': ["tool"],
|
|
568
|
+
'profile.session_read_error': [],
|
|
569
|
+
'profile.session_not_found': [],
|
|
570
|
+
'profile.user_unavailable': [],
|
|
571
|
+
'profile.save_error': ["error"],
|
|
572
|
+
'profile.updated': ["fields"],
|
|
537
573
|
};
|
|
538
574
|
/** Достаёт имена {param}-плейсхолдеров из шаблона. Уникальные, в порядке появления. */
|
|
539
575
|
export function extractParams(template) {
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export * from './utils/index.js';
|
|
|
8
8
|
export * from './skills/frontmatter.js';
|
|
9
9
|
export { SYNTH_VERSION } from './version.js';
|
|
10
10
|
export * from './model-metadata.js';
|
|
11
|
-
export { type SynthConfig, type ServerConfig, type StorageConfig, type AuthConfig as SynthAuthConfig, type LLMConfig, type CoreConfig, type RunnerConfig, type UIConfig, type I18nConfig, type LoggingConfig, type TsmConfig, type ContextConfigSchema, type SummarizationConfig, type McpServerConfig, type McpConfig, type ToolsDisabledConfig, toolsDisabledConfigSchema, type SkillsConfig, skillsConfigSchema, type CommandsConfig, commandsConfigSchema, type InstructionsConfig, type InstructionsLazyConfig, type InstructionsFetchConfig, type InstructionSourceConfig, instructionsConfigSchema, instructionSourceConfigSchema, type RouterConfig, type RouterContentConfig, type RouterEscalationConfig, type RouterCostConfig, type RouterSubagentConfig, type RemoteConfig, type MicroFirstConfig, type SecurityConfig, type PromptInjectionConfig, type ProtectedPathsConfig, type LLMGatewayConfig, type LLMGatewayRateLimitConfig, type LLMGatewayAuditConfig, } from './config/index.js';
|
|
11
|
+
export { type SynthConfig, type ServerConfig, type StorageConfig, type AuthConfig as SynthAuthConfig, type LLMConfig, type CoreConfig, type RunnerConfig, type UIConfig, type I18nConfig, type LoggingConfig, type TsmConfig, type ContextConfigSchema, type SummarizationConfig, type McpServerConfig, type McpConfig, type ToolsDisabledConfig, toolsDisabledConfigSchema, type SkillsConfig, skillsConfigSchema, type CommandsConfig, commandsConfigSchema, type InstructionsConfig, type InstructionsLazyConfig, type InstructionsFetchConfig, type InstructionSourceConfig, instructionsConfigSchema, instructionSourceConfigSchema, type RouterConfig, type RouterContentConfig, type RouterEscalationConfig, type RouterCostConfig, type RouterSubagentConfig, type DecisionConfig, decisionConfigSchema, type WebhooksConfig, webhooksConfigSchema, type RemoteConfig, type MicroFirstConfig, type SecurityConfig, type PromptInjectionConfig, type ProtectedPathsConfig, type LLMGatewayConfig, type LLMGatewayRateLimitConfig, type LLMGatewayAuditConfig, } from './config/index.js';
|
|
12
12
|
export { defaultConfig, loadConfig } from './config/index.js';
|
|
13
|
-
export { resolveDataDir, resolvePort, resolveWorkspacesRoot, resolveDefaultWorkspace, resolveWorkspaceOutsideRootPolicy, resolveSecretKey, resolveIgnoreRules, resolveHome, resolveProfilesPath, resolveCredentialsPath, ensureDataDir, createDefaultConfig, resolveDeployMode, findConfigPath, defaultConfigPath, ensureConfigFile, ensureFirstRun } from './config/index.js';
|
|
13
|
+
export { resolveDataDir, resolvePort, resolveWorkspacesRoot, resolveDefaultWorkspace, resolveWorkspaceOutsideRootPolicy, resolveSecretKey, resolveIgnoreRules, resolveHome, resolveProfilesPath, resolveCredentialsPath, ensureDataDir, createDefaultConfig, resolveDeployMode, findConfigPath, defaultConfigPath, ensureConfigFile, ensureFirstRun, resolveDecisionProvider, resolveDecisionModel } from './config/index.js';
|
|
14
|
+
export { applyEnvOverrides, envOverrideName, toSnakeCase, parseEnvValue, ENV_OVERRIDES } from './config/index.js';
|
|
14
15
|
export type { DeployMode } from './config/index.js';
|
|
16
|
+
export type { EnvOverrideDefinition, EnvOverrideType, ParsedEnvValue } from './config/index.js';
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from './skills/frontmatter.js';
|
|
|
10
10
|
export { SYNTH_VERSION } from './version.js';
|
|
11
11
|
export * from './model-metadata.js';
|
|
12
12
|
// Конфигурация — выборочный экспорт (избегаем конфликта AuthConfig/TestUser)
|
|
13
|
-
export { toolsDisabledConfigSchema, skillsConfigSchema, commandsConfigSchema, instructionsConfigSchema, instructionSourceConfigSchema, } from './config/index.js';
|
|
13
|
+
export { toolsDisabledConfigSchema, skillsConfigSchema, commandsConfigSchema, instructionsConfigSchema, instructionSourceConfigSchema, decisionConfigSchema, webhooksConfigSchema, } from './config/index.js';
|
|
14
14
|
export { defaultConfig, loadConfig } from './config/index.js';
|
|
15
|
-
export { resolveDataDir, resolvePort, resolveWorkspacesRoot, resolveDefaultWorkspace, resolveWorkspaceOutsideRootPolicy, resolveSecretKey, resolveIgnoreRules, resolveHome, resolveProfilesPath, resolveCredentialsPath, ensureDataDir, createDefaultConfig, resolveDeployMode, findConfigPath, defaultConfigPath, ensureConfigFile, ensureFirstRun } from './config/index.js';
|
|
15
|
+
export { resolveDataDir, resolvePort, resolveWorkspacesRoot, resolveDefaultWorkspace, resolveWorkspaceOutsideRootPolicy, resolveSecretKey, resolveIgnoreRules, resolveHome, resolveProfilesPath, resolveCredentialsPath, ensureDataDir, createDefaultConfig, resolveDeployMode, findConfigPath, defaultConfigPath, ensureConfigFile, ensureFirstRun, resolveDecisionProvider, resolveDecisionModel } from './config/index.js';
|
|
16
|
+
export { applyEnvOverrides, envOverrideName, toSnakeCase, parseEnvValue, ENV_OVERRIDES } from './config/index.js';
|
|
@@ -76,12 +76,13 @@ export interface ToolRegistry {
|
|
|
76
76
|
};
|
|
77
77
|
}>;
|
|
78
78
|
}
|
|
79
|
-
import type { ProfileData } from '../types/index.js';
|
|
79
|
+
import type { ProfileData, ExternalIdentity } from '../types/index.js';
|
|
80
80
|
export interface CreateProfileParams {
|
|
81
81
|
username: string;
|
|
82
82
|
email?: string;
|
|
83
83
|
roles?: string[];
|
|
84
84
|
teamRoles?: string[];
|
|
85
|
+
interviewCompleted?: boolean;
|
|
85
86
|
}
|
|
86
87
|
export interface ProfileStore {
|
|
87
88
|
loadProfile(id: string): Promise<ProfileData | null>;
|
|
@@ -92,6 +93,12 @@ export interface ProfileStore {
|
|
|
92
93
|
getProfileByEmail(email: string): Promise<ProfileData | null>;
|
|
93
94
|
getOrCreateProfile(params: CreateProfileParams): Promise<ProfileData>;
|
|
94
95
|
updateLastLogin(id: string): Promise<void>;
|
|
96
|
+
/** AD-089: профиль по внешней идентичности (provider+externalId); null — нет. */
|
|
97
|
+
findProfileByExternalId(provider: string, externalId: string): Promise<ProfileData | null>;
|
|
98
|
+
/** AD-089: привязать идентичность (идемпотентно). Занята другим профилем → null (конфликт). */
|
|
99
|
+
linkIdentity(userId: string, identity: ExternalIdentity): Promise<ProfileData | null>;
|
|
100
|
+
/** AD-089: отвязать идентичность; null — профиля/идентичности нет. */
|
|
101
|
+
unlinkIdentity(userId: string, provider: string, externalId: string): Promise<ProfileData | null>;
|
|
95
102
|
}
|
|
96
103
|
import type { BusEvent } from '../types/index.js';
|
|
97
104
|
export type { BusEvent };
|