@itphx/synth-backend 0.10.1 → 0.11.3
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/app/bootstrap.d.ts +2 -2
- package/dist/app/deps.d.ts +50 -32
- package/dist/app/deps.js +233 -99
- package/dist/app/listen.d.ts +7 -2
- package/dist/app/listen.js +12 -1
- package/dist/app/mount-routes.d.ts +16 -3
- package/dist/app/mount-routes.js +258 -28
- package/dist/app.d.ts +16 -7
- package/dist/app.js +104 -11
- package/dist/auth/guards.d.ts +2 -1
- package/dist/auth/guards.js +9 -1
- package/dist/auth/middleware.d.ts +2 -12
- package/dist/auth/middleware.js +20 -2
- package/dist/auth/oidc.d.ts +7 -0
- package/dist/auth/oidc.js +27 -6
- package/dist/auth/service-scope.d.ts +7 -3
- package/dist/auth/service-scope.js +8 -4
- package/dist/events/hub.js +3 -38
- package/dist/lib/app-config.d.ts +2 -0
- package/dist/lib/app-config.js +3 -2
- package/dist/lib/defaults-store.d.ts +2 -25
- package/dist/lib/defaults-store.js +5 -87
- package/dist/lib/i18n.js +48 -0
- package/dist/main.js +19 -3
- package/dist/routes/agents.d.ts +2 -2
- package/dist/routes/auth.d.ts +2 -2
- package/dist/routes/context.d.ts +2 -2
- package/dist/routes/gateway-patterns.d.ts +2 -2
- package/dist/routes/llm.d.ts +8 -2
- package/dist/routes/llm.js +4 -1
- package/dist/routes/mcp-registry.d.ts +3 -3
- package/dist/routes/mcp-registry.js +2 -2
- package/dist/routes/messages.d.ts +5 -4
- package/dist/routes/messages.js +30 -3
- package/dist/routes/models.d.ts +7 -2
- package/dist/routes/models.js +3 -1
- package/dist/routes/projects.d.ts +3 -3
- package/dist/routes/providers.d.ts +15 -3
- package/dist/routes/providers.js +33 -21
- package/dist/routes/queue.d.ts +5 -4
- package/dist/routes/queue.js +30 -3
- package/dist/routes/sessions.d.ts +13 -3
- package/dist/routes/sessions.js +197 -73
- package/dist/test-helpers/close-server.d.ts +33 -0
- package/dist/test-helpers/close-server.js +50 -0
- package/package.json +3 -3
package/dist/app/bootstrap.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthConfig } from '@itphx/synth-shared';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProfileRepository } from '@itphx/synth-core';
|
|
3
3
|
/**
|
|
4
4
|
* Сидировать профили тестовых пользователей (debug mode). Fire-and-forget
|
|
5
5
|
* (паритет с прежним `app.ts`): старт не блокируется, ошибки пишутся в лог.
|
|
@@ -8,4 +8,4 @@ import type { FileProfileStore } from '@itphx/synth-core';
|
|
|
8
8
|
* построения рантайма (оркестратор/события/шедулер) — как в прежнем `app.ts`,
|
|
9
9
|
* где сид стоял между хранилищами и рантаймом.
|
|
10
10
|
*/
|
|
11
|
-
export declare function seedDebugTestUsers(profilesStore:
|
|
11
|
+
export declare function seedDebugTestUsers(profilesStore: ProfileRepository, auth: AuthConfig): void;
|
package/dist/app/deps.d.ts
CHANGED
|
@@ -1,43 +1,64 @@
|
|
|
1
|
-
import type { ProviderConfig, ModelConfig,
|
|
2
|
-
import { SessionManager, EventBus, QueueProcessorManager,
|
|
3
|
-
import type { EventsRuntimeSettings } from '@itphx/synth-core';
|
|
1
|
+
import type { ProviderConfig, ModelConfig, DecisionConfig } from '@itphx/synth-shared';
|
|
2
|
+
import { SessionManager, EventBus, QueueProcessorManager, ContextOptimizer, ChatOrchestrator, McpManager, AuditLogger, SkillService, CommandService, EventRouter, RequestSessionService, EventIngress, SchedulerService, WebhookService, AnalyticsRecorder } from '@itphx/synth-core';
|
|
3
|
+
import type { EventsRuntimeSettings, MetricsRegistry, StorageContext } from '@itphx/synth-core';
|
|
4
4
|
import type { BackendConfig } from '../lib/app-config.js';
|
|
5
|
-
import { DefaultsStore } from '../lib/defaults-store.js';
|
|
6
5
|
import { EventHub } from '../events/hub.js';
|
|
6
|
+
/**
|
|
7
|
+
* PROP-032 (W2.4): единая точка сборки слоя хранения backend — `app.ts` строит
|
|
8
|
+
* её до `auth` (реестр `serviceKeys` нужен резолверу ключа, `mcpRegistry` —
|
|
9
|
+
* сидированию instance-серверов), а `createBackendDeps` переиспользует инстанс.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createBackendStorage(config: BackendConfig): Promise<StorageContext>;
|
|
7
12
|
/**
|
|
8
13
|
* Собрать зависимости backend-приложения (хранилища/менеджеры/оркестратор/
|
|
9
14
|
* событийное ядро/планировщик/webhooks). Роуты монтирует вызывающий
|
|
10
15
|
* (`mountBackendRoutes`), поэтому здесь нет ни одного `app.*`-вызова.
|
|
11
16
|
*/
|
|
12
|
-
export declare function createBackendDeps(config: BackendConfig): Promise<{
|
|
17
|
+
export declare function createBackendDeps(config: BackendConfig, storage?: StorageContext, metrics?: MetricsRegistry): Promise<{
|
|
13
18
|
dataDir: string;
|
|
14
|
-
|
|
19
|
+
storageContext: StorageContext;
|
|
20
|
+
metrics: MetricsRegistry | undefined;
|
|
21
|
+
stopMetricsCollectors: (() => void)[];
|
|
22
|
+
projectStore: import("@itphx/synth-core").ProjectRepository;
|
|
15
23
|
sessionManager: SessionManager;
|
|
16
24
|
stopEphemeralSweeper: () => void;
|
|
17
|
-
sshKeyStore:
|
|
18
|
-
providerStore:
|
|
19
|
-
modelStore:
|
|
20
|
-
agentStore:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
sshKeyStore: import("@itphx/synth-core").SSHKeyRepository;
|
|
26
|
+
providerStore: import("@itphx/synth-core").DocumentRepository<ProviderConfig>;
|
|
27
|
+
modelStore: import("@itphx/synth-core").DocumentRepository<ModelConfig>;
|
|
28
|
+
agentStore: import("@itphx/synth-core").DocumentRepository<import("@itphx/synth-shared").AgentDefinition>;
|
|
29
|
+
dictionaries: import("@itphx/synth-core").DictionaryRepository;
|
|
30
|
+
serviceApiKeyStore: import("@itphx/synth-core").ServiceKeyRepository;
|
|
31
|
+
contextConfig: import("@itphx/synth-core").ContextFileRepository;
|
|
32
|
+
profilesStore: import("@itphx/synth-shared").ProfileStore;
|
|
33
|
+
patternStore: import("@itphx/synth-core").SecretPatternRepository;
|
|
34
|
+
settingsStore: import("@itphx/synth-core").SettingsRepository;
|
|
35
|
+
defaultsStore: import("@itphx/synth-core").DefaultsRepository;
|
|
26
36
|
defaultWorkingDir: string;
|
|
27
37
|
getDefaultAgentId: () => Promise<string>;
|
|
38
|
+
egressResolver: import("@itphx/synth-core").EgressPolicyResolver;
|
|
39
|
+
egressLogConfig: {
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
retentionDays: number;
|
|
42
|
+
};
|
|
43
|
+
securityAudit: import("@itphx/synth-core").SecurityAuditRepository;
|
|
44
|
+
egressRequests: import("@itphx/synth-core").EgressRequestLogRepository;
|
|
45
|
+
analyticsRollups: import("@itphx/synth-core").AnalyticsRollupRepository;
|
|
46
|
+
analytics: AnalyticsRecorder | undefined;
|
|
47
|
+
detachAnalyticsHooks: () => void;
|
|
48
|
+
stopAnalyticsRollupPruner: () => void;
|
|
49
|
+
stopEgressLogPruner: () => void;
|
|
28
50
|
mcpManager: McpManager;
|
|
29
|
-
mcpRegistryStore:
|
|
51
|
+
mcpRegistryStore: import("@itphx/synth-core").McpRegistryRepository;
|
|
30
52
|
eventBus: EventBus;
|
|
31
53
|
queueManager: QueueProcessorManager;
|
|
32
|
-
webhookStore:
|
|
33
|
-
webhookDeliveryStore:
|
|
54
|
+
webhookStore: import("@itphx/synth-core").WebhookRepository;
|
|
55
|
+
webhookDeliveryStore: import("@itphx/synth-core").WebhookDeliveryRepository;
|
|
34
56
|
webhookService: WebhookService;
|
|
35
57
|
stopWebhookDeliveryPruner: () => void;
|
|
36
58
|
webhooksConfig: {
|
|
37
59
|
enabled: boolean;
|
|
38
60
|
maxAttempts: number;
|
|
39
61
|
timeoutMs: number;
|
|
40
|
-
allowPrivateTargets: boolean;
|
|
41
62
|
deliveryRetentionDays: number;
|
|
42
63
|
};
|
|
43
64
|
providerLoader: (name: string) => ProviderConfig | null;
|
|
@@ -62,23 +83,24 @@ export declare function createBackendDeps(config: BackendConfig): Promise<{
|
|
|
62
83
|
logPath: string;
|
|
63
84
|
};
|
|
64
85
|
} | undefined;
|
|
65
|
-
protectedPathsStore:
|
|
86
|
+
protectedPathsStore: import("@itphx/synth-core").ProtectedPathsRepository;
|
|
66
87
|
toolRegistry: import("@itphx/synth-core").ToolRegistry;
|
|
67
88
|
agentRegistry: import("@itphx/synth-core").AgentRegistry;
|
|
68
89
|
skillService: SkillService;
|
|
69
|
-
bundleStore:
|
|
90
|
+
bundleStore: import("@itphx/synth-core").SkillBundleRepository;
|
|
70
91
|
commandService: CommandService;
|
|
71
92
|
orchestrator: ChatOrchestrator;
|
|
72
93
|
processMessage: (session: import("@itphx/synth-shared").Session, message: import("@itphx/synth-shared").Message, signal: AbortSignal, publishChunk: (event: string, data: Record<string, unknown>) => void, attempt?: number) => Promise<import("@itphx/synth-core").ProcessMessageResult>;
|
|
73
|
-
eventBindingStore:
|
|
74
|
-
eventApiKeyStore:
|
|
75
|
-
eventJournal:
|
|
76
|
-
routeRuleStore:
|
|
77
|
-
identityClaimStore:
|
|
94
|
+
eventBindingStore: import("@itphx/synth-core").EventBindingRepository;
|
|
95
|
+
eventApiKeyStore: import("@itphx/synth-core").EventApiKeyRepository;
|
|
96
|
+
eventJournal: import("@itphx/synth-core").EventJournalRepository;
|
|
97
|
+
routeRuleStore: import("@itphx/synth-core").EventRouteRepository;
|
|
98
|
+
identityClaimStore: import("@itphx/synth-core").IdentityClaimRepository;
|
|
78
99
|
eventRouter: EventRouter;
|
|
79
100
|
stopEventJournalPruner: () => void;
|
|
80
|
-
scheduleStore:
|
|
81
|
-
jobStore:
|
|
101
|
+
scheduleStore: import("@itphx/synth-core").ScheduleRepository;
|
|
102
|
+
jobStore: import("@itphx/synth-core").JobRepository;
|
|
103
|
+
maintenanceAudit: import("@itphx/synth-core").MaintenanceAuditRepository;
|
|
82
104
|
resolveAgentTemplate: (template: string) => string | null;
|
|
83
105
|
eventHub: EventHub;
|
|
84
106
|
requestSessionService: RequestSessionService;
|
|
@@ -90,10 +112,6 @@ export declare function createBackendDeps(config: BackendConfig): Promise<{
|
|
|
90
112
|
* потребителями через замыкания (ADR-071 §2.3.1 / ADR-084 / ADR-089).
|
|
91
113
|
*/
|
|
92
114
|
live: {
|
|
93
|
-
/** ADR-071 §2.3.1: эффективная политика сетевого доступа MCP. */
|
|
94
|
-
getNetworkPolicy: () => McpNetworkPolicy | undefined;
|
|
95
|
-
/** ADR-071 §2.3.1: live-применение политики (админка → менеджер MCP). */
|
|
96
|
-
setNetworkPolicy: (policy: McpNetworkPolicy) => void;
|
|
97
115
|
/** ADR-089: runtime-настройки «События» (`enabled`/per-key лимит — роуты). */
|
|
98
116
|
getEvents: () => EventsRuntimeSettings;
|
|
99
117
|
/** ADR-089: live-применение runtime-настроек «События» — Router/funnel/pruner. */
|