@cat-factory/node-server 0.107.10 → 0.107.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/container-account-deps.d.ts +40 -0
  2. package/dist/container-account-deps.d.ts.map +1 -0
  3. package/dist/container-account-deps.js +142 -0
  4. package/dist/container-account-deps.js.map +1 -0
  5. package/dist/container-executor-deps.d.ts +26 -4
  6. package/dist/container-executor-deps.d.ts.map +1 -1
  7. package/dist/container-executor-deps.js +2 -13
  8. package/dist/container-executor-deps.js.map +1 -1
  9. package/dist/container-github-deps.d.ts +56 -0
  10. package/dist/container-github-deps.d.ts.map +1 -0
  11. package/dist/container-github-deps.js +275 -0
  12. package/dist/container-github-deps.js.map +1 -0
  13. package/dist/container-model-deps.d.ts +50 -0
  14. package/dist/container-model-deps.d.ts.map +1 -0
  15. package/dist/container-model-deps.js +127 -0
  16. package/dist/container-model-deps.js.map +1 -0
  17. package/dist/container-realtime-deps.d.ts +34 -0
  18. package/dist/container-realtime-deps.d.ts.map +1 -0
  19. package/dist/container-realtime-deps.js +112 -0
  20. package/dist/container-realtime-deps.js.map +1 -0
  21. package/dist/container-run-services-deps.d.ts +44 -0
  22. package/dist/container-run-services-deps.d.ts.map +1 -0
  23. package/dist/container-run-services-deps.js +148 -0
  24. package/dist/container-run-services-deps.js.map +1 -0
  25. package/dist/container-transport-deps.d.ts +72 -0
  26. package/dist/container-transport-deps.d.ts.map +1 -0
  27. package/dist/container-transport-deps.js +88 -0
  28. package/dist/container-transport-deps.js.map +1 -0
  29. package/dist/container.d.ts +2 -2
  30. package/dist/container.d.ts.map +1 -1
  31. package/dist/container.js +144 -742
  32. package/dist/container.js.map +1 -1
  33. package/package.json +12 -12
@@ -0,0 +1,112 @@
1
+ import {} from '@cat-factory/agents';
2
+ import { ConsensusAgentExecutor, registerConsensusTraits } from '@cat-factory/consensus';
3
+ import { SLACK_CIPHER_INFO, SlackNotificationChannel } from '@cat-factory/integrations';
4
+ import { CompositeNotificationChannel, } from '@cat-factory/kernel';
5
+ import { FanOutEventPublisher, InAppNotificationChannel, WebCryptoSecretCipher, logger, } from '@cat-factory/server';
6
+ import { NodeEventPublisher } from './realtime.js';
7
+ import { DrizzleSlackConnectionRepository, DrizzleSlackMemberMappingRepository, DrizzleSlackSettingsRepository, } from './repositories/slack.js';
8
+ /** Truthy env flag (`true`/`1`/`yes`). */
9
+ function isTruthy(value) {
10
+ return value === 'true' || value === '1' || value === 'yes';
11
+ }
12
+ /**
13
+ * Wire the Slack integration when enabled: the notification *channel* (an extra
14
+ * delivery transport composed onto the notification mechanism — Node has no in-app
15
+ * channel, so this is its only one) plus the management repositories (per-account
16
+ * connect + per-workspace routing + member map) and the bot-token cipher. The
17
+ * per-account bot token is sealed with the shared ENCRYPTION_KEY under a
18
+ * slack-scoped HKDF info, mirroring the Worker. OAuth credentials are optional.
19
+ */
20
+ function selectNodeSlackDeps(config, repos,
21
+ // The remote-source seam (mothership mode): `sourced('name', build)` returns the remote registry
22
+ // entry when there's no `db`, else builds the Drizzle repo. Routing the three Slack repos through
23
+ // it makes the connect / route / member-map management surface functional in mothership mode —
24
+ // AND keeps the `SlackNotificationChannel` (which captures these repos directly) reading the SAME
25
+ // remote-backed repos, so it can't drift to the broken db-less Drizzle instances. The bot token
26
+ // rides a SEALED `tokenCipher` (sealed/decrypted under the LOCAL key), so the sealed blob — never
27
+ // plaintext — crosses the machine API; the settings + member-mapping rows carry no secrets. The
28
+ // RPC allow-list gates each method by its account/workspace scope. (Mothership-SIDE delivery for a
29
+ // hosted teammate's notification — the mothership decrypting a laptop-sealed token — is the later
30
+ // secrets-delegation slice; local delivery, where the run's own node holds the key, works.)
31
+ sourced) {
32
+ if (!config.slack.enabled || !config.slack.encryptionKey)
33
+ return {};
34
+ const secretCipher = new WebCryptoSecretCipher({
35
+ masterKeyBase64: config.slack.encryptionKey,
36
+ info: SLACK_CIPHER_INFO,
37
+ });
38
+ const slackConnectionRepository = sourced('slackConnectionRepository', (d) => new DrizzleSlackConnectionRepository(d));
39
+ const slackSettingsRepository = sourced('slackSettingsRepository', (d) => new DrizzleSlackSettingsRepository(d));
40
+ const slackMemberMappingRepository = sourced('slackMemberMappingRepository', (d) => new DrizzleSlackMemberMappingRepository(d));
41
+ return {
42
+ notificationChannel: new SlackNotificationChannel({
43
+ workspaceRepository: repos.workspaceRepository,
44
+ slackConnectionRepository,
45
+ slackSettingsRepository,
46
+ slackMemberMappingRepository,
47
+ blockRepository: repos.blockRepository,
48
+ secretCipher,
49
+ // Best-effort delivery still surfaces failures (revoked token, missing channel
50
+ // invite) through the structured logger so a broken route is diagnosable.
51
+ onError: (error, ctx) => logger.warn({ err: error instanceof Error ? error.message : String(error), ...ctx }, 'slack notification delivery failed'),
52
+ }),
53
+ slackConnectionRepository,
54
+ slackSettingsRepository,
55
+ slackMemberMappingRepository,
56
+ slackSecretCipher: secretCipher,
57
+ };
58
+ }
59
+ /**
60
+ * The real-time event-publisher + notification-channel + optional consensus wrap of the Node
61
+ * composition root, lifted out of `buildNodeContainer` so that root stays within the file-size
62
+ * budget. Builds the Slack deps, the fan-out event publisher (when a realtime hub is wired),
63
+ * the (optionally consensus-wrapped) agent executor, and the composite notification channel.
64
+ */
65
+ export function buildNodeRealtimeDeps(input) {
66
+ const { env, config, repos, sourced, realtimeSink, standardAgentExecutor, modelProviderResolver, resolveWorkspaceModelDefault, agentKindRegistry, } = input;
67
+ // Real-time push + notification delivery. When a realtime hub is wired (start()), the
68
+ // engine pushes execution/board/notification events to subscribed browsers via the
69
+ // NodeEventPublisher, decorated with FanOutEventPublisher so a shared service's live
70
+ // events reach EVERY board that mounts it (parity with the Worker's selectEventPublisher).
71
+ // The in-app push is also a notification channel, composed alongside Slack (when
72
+ // enabled) so a raised notification both lands in the inbox live AND fans to Slack.
73
+ const slackDeps = selectNodeSlackDeps(config, repos, sourced);
74
+ const executionEventPublisher = realtimeSink
75
+ ? new FanOutEventPublisher(new NodeEventPublisher(realtimeSink), {
76
+ workspaceMountRepository: repos.workspaceMountRepository,
77
+ })
78
+ : undefined;
79
+ // Optionally wrap the executor with the consensus mechanism (CONSENSUS_ENABLED). Off ⇒
80
+ // the standard composite, unchanged. Registers the capability traits + routes
81
+ // consensus-enabled steps through a multi-model process, persisting + pushing the
82
+ // transcript (same hub as run/board events).
83
+ const agentExecutor = isTruthy(env.CONSENSUS_ENABLED)
84
+ ? (registerConsensusTraits(agentKindRegistry),
85
+ new ConsensusAgentExecutor({
86
+ standard: standardAgentExecutor,
87
+ modelProviderResolver,
88
+ agentRouting: config.agents.routing,
89
+ resolveBlockModel: config.agents.resolveBlockModel,
90
+ resolveWorkspaceModelDefault,
91
+ // Consensus runs its participants INLINE, so in local mode keep an ambient-eligible
92
+ // subscription harness ref (served via the CLI) instead of degrading it; undefined on
93
+ // stock Node/Worker, where such a ref degrades to the routing default as before.
94
+ ...(config.agents.inlineHarnessRef ? { runsInline: config.agents.inlineHarnessRef } : {}),
95
+ sessionRepository: repos.consensusSessionRepository,
96
+ ...(executionEventPublisher ? { eventPublisher: executionEventPublisher } : {}),
97
+ agentKindRegistry,
98
+ }))
99
+ : standardAgentExecutor;
100
+ const notificationChannels = [];
101
+ if (executionEventPublisher)
102
+ notificationChannels.push(new InAppNotificationChannel(executionEventPublisher));
103
+ if (slackDeps.notificationChannel)
104
+ notificationChannels.push(slackDeps.notificationChannel);
105
+ const notificationChannel = notificationChannels.length === 0
106
+ ? undefined
107
+ : notificationChannels.length === 1
108
+ ? notificationChannels[0]
109
+ : new CompositeNotificationChannel(notificationChannels);
110
+ return { slackDeps, executionEventPublisher, agentExecutor, notificationChannel };
111
+ }
112
+ //# sourceMappingURL=container-realtime-deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-realtime-deps.js","sourceRoot":"","sources":["../src/container-realtime-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,uBAA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CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC;YACzB,CAAC,CAAC,IAAI,4BAA4B,CAAC,oBAAoB,CAAC,CAAA;IAE9D,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAA;AACnF,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { RegistrySubscriptionQuotaProvider, TestSecretsService } from '@cat-factory/integrations';
2
+ import type { AppCaches, Clock, IdGenerator, WebSearchAvailability } from '@cat-factory/kernel';
3
+ import { AgentContextObservabilityService, SearchQueryObservabilityService } from '@cat-factory/orchestration';
4
+ import { type AppConfig, WebCryptoSecretCipher } from '@cat-factory/server';
5
+ import type { createDrizzleRepositories } from './repositories/drizzle.js';
6
+ type NodeRepositories = ReturnType<typeof createDrizzleRepositories>;
7
+ /** Inputs {@link buildNodeRunServices} needs from the composition root. */
8
+ export interface NodeRunServicesInput {
9
+ env: NodeJS.ProcessEnv;
10
+ config: AppConfig;
11
+ repos: NodeRepositories;
12
+ idGenerator: IdGenerator;
13
+ clock: Clock;
14
+ caches?: AppCaches;
15
+ }
16
+ /**
17
+ * The per-run agent-observability + web-search + sealed-secret services of the Node
18
+ * composition root, lifted out of `buildNodeContainer` so that root stays within the
19
+ * file-size budget. Builds the agent-context / search-query / harness-call telemetry sinks,
20
+ * the deployment-wide web-search upstream + availability resolver, the package-registry +
21
+ * test-secret dispatch resolvers, and the modeled subscription-quota provider.
22
+ */
23
+ export declare function buildNodeRunServices(input: NodeRunServicesInput): {
24
+ agentContextObservability: AgentContextObservabilityService;
25
+ searchQueryObservability: SearchQueryObservabilityService;
26
+ recordHarnessCalls: (input: import("@cat-factory/orchestration").HarnessCallsRecordInput) => Promise<void>;
27
+ defaultWebSearchUpstream: import("@cat-factory/server").WebSearchUpstream | undefined;
28
+ resolveWebSearchAvailability: ((workspaceId: string) => Promise<WebSearchAvailability>) | undefined;
29
+ packageRegistrySecretCipher: WebCryptoSecretCipher | undefined;
30
+ resolvePackageRegistries: ((workspaceId: string) => Promise<import("@cat-factory/orchestration").DispatchPackageRegistry[]>) | undefined;
31
+ testSecretsService: TestSecretsService | undefined;
32
+ resolveTestSecrets: ((workspaceId: string, blockId: string) => Promise<{
33
+ key: string;
34
+ description: string;
35
+ value: string;
36
+ }[]>) | undefined;
37
+ resolveTestSecretRefs: ((workspaceId: string, blockId: string) => Promise<{
38
+ key: string;
39
+ description: string;
40
+ }[]>) | undefined;
41
+ subscriptionQuotaProvider: RegistrySubscriptionQuotaProvider;
42
+ };
43
+ export {};
44
+ //# sourceMappingURL=container-run-services-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-run-services-deps.d.ts","sourceRoot":"","sources":["../src/container-run-services-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iCAAiC,EAEjC,kBAAkB,EAEnB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC/F,OAAO,EACL,gCAAgC,EAGhC,+BAA+B,EAGhC,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,KAAK,SAAS,EACd,qBAAqB,EAGtB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAE1E,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEpE,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;IACtB,MAAM,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,gBAAgB,CAAA;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,KAAK,EAAE,KAAK,CAAA;IACZ,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB;;;;;iDAkEpC,MAAM,KAAG,OAAO,CAAC,qBAAqB,CAAC;;6CA8B/C,MAAM;;uCAuBN,MAAM,WAAW,MAAM;;;;;0CAIvB,MAAM,WAAW,MAAM;;;;;EA0B1C"}
@@ -0,0 +1,148 @@
1
+ import { ACCOUNT_SETTINGS_CIPHER_INFO, AccountSettingsService, RegistrySubscriptionQuotaProvider, TEST_SECRETS_CIPHER_INFO, TestSecretsService, defaultSubscriptionQuotaRegistry, } from '@cat-factory/integrations';
2
+ import { AgentContextObservabilityService, LlmObservabilityService, PACKAGE_REGISTRY_CIPHER_INFO, SearchQueryObservabilityService, makeHarnessCallRecorder, resolvePackageRegistriesForDispatch, } from '@cat-factory/orchestration';
3
+ import { WebCryptoSecretCipher, createDefaultWebSearchUpstream, createWebSearchUpstream, } from '@cat-factory/server';
4
+ /**
5
+ * The per-run agent-observability + web-search + sealed-secret services of the Node
6
+ * composition root, lifted out of `buildNodeContainer` so that root stays within the
7
+ * file-size budget. Builds the agent-context / search-query / harness-call telemetry sinks,
8
+ * the deployment-wide web-search upstream + availability resolver, the package-registry +
9
+ * test-secret dispatch resolvers, and the modeled subscription-quota provider.
10
+ */
11
+ export function buildNodeRunServices(input) {
12
+ const { env, config, repos, idGenerator, clock, caches } = input;
13
+ // Agent-context observability sink: records the complete, redacted context provided
14
+ // to each container agent (composed prompts + folded-in fragments + injected files).
15
+ // Gated by the deployment prompt-recording switch + the workspace storeAgentContext
16
+ // setting. Wired into the executor (write) AND createCore (read). The telemetry rows
17
+ // live in the `telemetry` Postgres schema (see schema.ts).
18
+ const agentContextObservability = new AgentContextObservabilityService({
19
+ agentContextSnapshotRepository: repos.agentContextSnapshotRepository,
20
+ workspaceSettingsRepository: repos.workspaceSettingsRepository,
21
+ idGenerator,
22
+ clock,
23
+ recordPrompts: config.observability.recordPrompts,
24
+ });
25
+ // Agent-search-query observability sink: records each web search a container agent
26
+ // performed through the search proxy. Same double gate + retention window as the
27
+ // agent-context sink. Wired into the search proxy (write, via the container) AND
28
+ // createCore (read). Telemetry rows live in the `telemetry` Postgres schema.
29
+ const searchQueryObservability = new SearchQueryObservabilityService({
30
+ agentSearchQueryRepository: repos.agentSearchQueryRepository,
31
+ workspaceSettingsRepository: repos.workspaceSettingsRepository,
32
+ idGenerator,
33
+ clock,
34
+ recordPrompts: config.observability.recordPrompts,
35
+ });
36
+ // Record a subscription harness's (Claude Code / Codex) per-call telemetry into the
37
+ // SAME `llm_call_metrics` store the LLM proxy writes for Pi — those harnesses bypass
38
+ // the proxy, so the executor lifts the metrics off the CLI stream and feeds them here.
39
+ const recordHarnessCalls = makeHarnessCallRecorder(new LlmObservabilityService({
40
+ llmCallMetricRepository: repos.llmCallMetricRepository,
41
+ idGenerator,
42
+ clock,
43
+ recordPrompts: config.observability.recordPrompts,
44
+ }));
45
+ // A deployment-wide trusted web-search upstream, built from this facade's own `WEB_SEARCH_*`
46
+ // env, used by the search proxy as a fallback when a run's account has no web-search config
47
+ // (local mode defaults `WEB_SEARCH_SEARXNG_URL` to its self-hosted SearXNG). Distinct from the
48
+ // harness's own `SEARXNG_URL`/`BRAVE_SEARCH_API_KEY` runner-pool autodetect — those are for
49
+ // self-hosted pool containers; these keys stay on the backend. Surfaced on the ServerContainer
50
+ // below and read by `WebSearchProxyController`.
51
+ const defaultWebSearchUpstream = createDefaultWebSearchUpstream({
52
+ braveApiKey: env.WEB_SEARCH_BRAVE_API_KEY,
53
+ searxngUrl: env.WEB_SEARCH_SEARXNG_URL,
54
+ searxngApiKey: env.WEB_SEARCH_SEARXNG_API_KEY,
55
+ });
56
+ // Web-search keys live per-account; advertise Pi's `web_search` tool to a run only when a
57
+ // usable upstream exists — either the deployment default above (⇒ always on) or the run's
58
+ // account has its own keys (else the tool would just fail/return nothing). The per-account
59
+ // check runs off a dedicated account-settings instance (short-TTL cache).
60
+ const webSearchAccountKey = env.ENCRYPTION_KEY?.trim();
61
+ const webSearchAccountSettings = webSearchAccountKey
62
+ ? new AccountSettingsService({
63
+ accountSettingsRepository: repos.accountSettingsRepository,
64
+ secretCipher: new WebCryptoSecretCipher({
65
+ masterKeyBase64: webSearchAccountKey,
66
+ info: ACCOUNT_SETTINGS_CIPHER_INFO,
67
+ }),
68
+ clock,
69
+ ...(caches ? { settingsCache: caches.accountSettings } : {}),
70
+ })
71
+ : undefined;
72
+ const resolveWebSearchAvailability = defaultWebSearchUpstream || webSearchAccountSettings
73
+ ? async (workspaceId) => {
74
+ // Mirror the proxy's own resolution (`accountUpstream ?? defaultWebSearchUpstream`):
75
+ // the run's account keys WIN and the deployment default is only the fallback, so the
76
+ // surfaced provider matches the one that will actually serve the run's searches. Build
77
+ // the account upstream the SAME way the proxy does before falling back to the default.
78
+ if (webSearchAccountSettings) {
79
+ const accountId = await repos.workspaceRepository.accountOf(workspaceId);
80
+ if (accountId) {
81
+ const accountUpstream = createWebSearchUpstream((await webSearchAccountSettings.resolve(accountId)).webSearch ?? {});
82
+ if (accountUpstream)
83
+ return { available: true, provider: accountUpstream.provider };
84
+ }
85
+ }
86
+ if (defaultWebSearchUpstream)
87
+ return { available: true, provider: defaultWebSearchUpstream.provider };
88
+ return { available: false, provider: null };
89
+ }
90
+ : undefined;
91
+ // Private package registries (npm private orgs, GitHub Packages): sealed per-workspace
92
+ // entries decrypted only at container dispatch, rendered by the harness into ~/.npmrc.
93
+ // The cipher is shared by the dispatch resolver here and the management service below.
94
+ const packageRegistryEncryptionKey = env.ENCRYPTION_KEY?.trim();
95
+ const packageRegistrySecretCipher = packageRegistryEncryptionKey
96
+ ? new WebCryptoSecretCipher({
97
+ masterKeyBase64: packageRegistryEncryptionKey,
98
+ info: PACKAGE_REGISTRY_CIPHER_INFO,
99
+ })
100
+ : undefined;
101
+ const resolvePackageRegistries = packageRegistrySecretCipher
102
+ ? (workspaceId) => resolvePackageRegistriesForDispatch(repos.packageRegistryConnectionRepository, packageRegistrySecretCipher, workspaceId)
103
+ : undefined;
104
+ // Sensitive per-service test credentials (sealed): the service backs the CRUD controller, the
105
+ // engine's prompt refs (via `resolveTestSecretRefs`) and the executor's out-of-band value
106
+ // injection (via `resolveTestSecrets`). Guarded by ENCRYPTION_KEY like the other sealed stores.
107
+ const testSecretsEncryptionKey = env.ENCRYPTION_KEY?.trim();
108
+ const testSecretsService = testSecretsEncryptionKey
109
+ ? new TestSecretsService({
110
+ testSecretsRepository: repos.testSecretsRepository,
111
+ secretCipher: new WebCryptoSecretCipher({
112
+ masterKeyBase64: testSecretsEncryptionKey,
113
+ info: TEST_SECRETS_CIPHER_INFO,
114
+ }),
115
+ blockRepository: repos.blockRepository,
116
+ clock,
117
+ })
118
+ : undefined;
119
+ const resolveTestSecrets = testSecretsService
120
+ ? (workspaceId, blockId) => testSecretsService.resolveValuesForBlock(workspaceId, blockId)
121
+ : undefined;
122
+ const resolveTestSecretRefs = testSecretsService
123
+ ? (workspaceId, blockId) => testSecretsService.resolveRefsForBlock(workspaceId, blockId)
124
+ : undefined;
125
+ // Modeled subscription quota-cycle provider (usage-and-quota-tracking, Part B): folds a
126
+ // finished subscription run's tokens into rolling windows (real reads land in B2). The
127
+ // registry of REAL vendor adapters is empty today, so every vendor reports modeled.
128
+ const subscriptionQuotaProvider = new RegistrySubscriptionQuotaProvider({
129
+ subscriptionQuotaCycleRepository: repos.subscriptionQuotaCycleRepository,
130
+ idGenerator,
131
+ clock,
132
+ registry: defaultSubscriptionQuotaRegistry,
133
+ });
134
+ return {
135
+ agentContextObservability,
136
+ searchQueryObservability,
137
+ recordHarnessCalls,
138
+ defaultWebSearchUpstream,
139
+ resolveWebSearchAvailability,
140
+ packageRegistrySecretCipher,
141
+ resolvePackageRegistries,
142
+ testSecretsService,
143
+ resolveTestSecrets,
144
+ resolveTestSecretRefs,
145
+ subscriptionQuotaProvider,
146
+ };
147
+ }
148
+ //# sourceMappingURL=container-run-services-deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-run-services-deps.js","sourceRoot":"","sources":["../src/container-run-services-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,E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,eAAe;YACtC,KAAK;SACN,CAAC;QACJ,CAAC,CAAC,SAAS,CAAA;IACb,MAAM,kBAAkB,GAAG,kBAAkB;QAC3C,CAAC,CAAC,CAAC,WAAmB,EAAE,OAAe,EAAE,EAAE,CACvC,kBAAkB,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC;QAClE,CAAC,CAAC,SAAS,CAAA;IACb,MAAM,qBAAqB,GAAG,kBAAkB;QAC9C,CAAC,CAAC,CAAC,WAAmB,EAAE,OAAe,EAAE,EAAE,CACvC,kBAAkB,CAAC,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC;QAChE,CAAC,CAAC,SAAS,CAAA;IACb,wFAAwF;IACxF,uFAAuF;IACvF,oFAAoF;IACpF,MAAM,yBAAyB,GAAG,IAAI,iCAAiC,CAAC;QACtE,gCAAgC,EAAE,KAAK,CAAC,gCAAgC;QACxE,WAAW;QACX,KAAK;QACL,QAAQ,EAAE,gCAAgC;KAC3C,CAAC,CAAA;IAEF,OAAO;QACL,yBAAyB;QACzB,wBAAwB;QACxB,kBAAkB;QAClB,wBAAwB;QACxB,4BAA4B;QAC5B,2BAA2B;QAC3B,wBAAwB;QACxB,kBAAkB;QAClB,kBAAkB;QAClB,qBAAqB;QACrB,yBAAyB;KAC1B,CAAA;AACH,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { type DeployJobClient, type RunnerBackendRegistry } from '@cat-factory/integrations';
2
+ import type { AppCaches, Clock, DeployCloneTarget, GitHubClient, GitHubInstallationRepository, IdGenerator, RepoProjectionRepository, WorkspaceRepository } from '@cat-factory/kernel';
3
+ import { type AppConfig, type GitHubAppRegistry, type JobPackageRegistrySpec, type ResolveRepoOrigin, type ResolveRepoTarget, type ResolveRunnerTransport } from '@cat-factory/server';
4
+ import type { CoreDependencies } from '@cat-factory/orchestration';
5
+ import { buildNodeResolveTransport } from './container-executor-deps.js';
6
+ import type { DrizzleDb } from './db/client.js';
7
+ import { DrizzleBootstrapJobRepository } from './repositories/bootstrap.js';
8
+ import type { DrizzleRunnerPoolConnectionRepository } from './repositories/containerExecution.js';
9
+ import type { createDrizzleRepositories } from './repositories/drizzle.js';
10
+ type NodeRepositories = ReturnType<typeof createDrizzleRepositories>;
11
+ /** Inputs {@link buildNodeTransportDeploy} needs from the composition root. */
12
+ export interface NodeTransportDeployInput {
13
+ config: AppConfig;
14
+ repos: NodeRepositories;
15
+ idGenerator: IdGenerator;
16
+ clock: Clock;
17
+ runnerPoolConnectionRepository: DrizzleRunnerPoolConnectionRepository;
18
+ runnerBackendRegistry: RunnerBackendRegistry;
19
+ appRegistry: GitHubAppRegistry | undefined;
20
+ resolveRepoTarget: ResolveRepoTarget;
21
+ workspaceRepository: WorkspaceRepository;
22
+ /** Facade overrides (`resolveTransport`, the deploy seams) threaded from `NodeContainerOptions`. */
23
+ resolveTransportOverride?: ResolveRunnerTransport | null;
24
+ runnerPoolProvider?: Parameters<typeof buildNodeResolveTransport>[5];
25
+ skipProvisioningLogWrap?: boolean;
26
+ mintInstallationToken?: (installationId: number) => Promise<string>;
27
+ deployJobClientOverride?: DeployJobClient;
28
+ disableDefaultDeployJobClient?: boolean;
29
+ resolveDeployCloneTargetOverride?: (workspaceId: string, blockId: string, ref?: string) => Promise<DeployCloneTarget | null>;
30
+ resolveRepoOrigin?: ResolveRepoOrigin;
31
+ }
32
+ /**
33
+ * The runner-transport resolver + the container-backed deploy lifecycle seams of the Node
34
+ * composition root, lifted out of `buildNodeContainer` so that root stays within the file-size
35
+ * budget. Resolves the workspace's runner transport (a sibling facade's injected one wins, else
36
+ * the self-hosted pool), wraps it with the provisioning-log decorator, and builds the deploy job
37
+ * client + clone-target resolver (default: the pool-backed client + an App-token github.com origin).
38
+ */
39
+ export declare function buildNodeTransportDeploy(input: NodeTransportDeployInput): {
40
+ resolveTransport: ResolveRunnerTransport | null;
41
+ baseDeployMint: ((installationId: number) => Promise<string>) | undefined;
42
+ deployDeps: Partial<CoreDependencies>;
43
+ };
44
+ /** Inputs {@link buildNodeBootstrapper} needs from the composition root. */
45
+ export interface NodeBootstrapperInput {
46
+ env: NodeJS.ProcessEnv;
47
+ config: AppConfig;
48
+ sourced: <T>(name: string, build: (d: DrizzleDb) => T) => T;
49
+ resolveTransport: ResolveRunnerTransport | null;
50
+ githubInstallationRepository: GitHubInstallationRepository;
51
+ repoProjectionRepository: RepoProjectionRepository;
52
+ appRegistry: GitHubAppRegistry | undefined;
53
+ githubClient: GitHubClient | undefined;
54
+ mintInstallationToken?: (installationId: number) => Promise<string>;
55
+ resolvePackageRegistries?: (workspaceId: string) => Promise<JobPackageRegistrySpec[]>;
56
+ caches?: AppCaches;
57
+ }
58
+ /**
59
+ * The repo-bootstrap slice of the Node composition root (the reference-architecture library +
60
+ * the container-dispatching `repoBootstrapper`), lifted out of `buildNodeContainer` so that root
61
+ * stays within the file-size budget. The bootstrap-job repo is wired unconditionally (the module
62
+ * + ref-arch CRUD then work like the Worker); the `repoBootstrapper` wires only when its
63
+ * prerequisites are met (transport + proxy + token + GitHub client) — the same token source the
64
+ * container executor uses.
65
+ */
66
+ export declare function buildNodeBootstrapper(input: NodeBootstrapperInput): {
67
+ bootstrapJobRepository: DrizzleBootstrapJobRepository;
68
+ bootstrapMintInstallationToken: ((installationId: number) => Promise<string>) | undefined;
69
+ repoBootstrapper: import("@cat-factory/server").ContainerRepoBootstrapper | undefined;
70
+ };
71
+ export {};
72
+ //# sourceMappingURL=container-transport-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-transport-deps.d.ts","sourceRoot":"","sources":["../src/container-transport-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,qBAAqB,EAC3B,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,WAAW,EACX,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,E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CloneTarget, } from '@cat-factory/server';
3
+ import { buildNodeResolveTransport, selectNodeRepoBootstrapper, withProvisioningLog, } from './container-executor-deps.js';
4
+ import { DrizzleBootstrapJobRepository } from './repositories/bootstrap.js';
5
+ /**
6
+ * The runner-transport resolver + the container-backed deploy lifecycle seams of the Node
7
+ * composition root, lifted out of `buildNodeContainer` so that root stays within the file-size
8
+ * budget. Resolves the workspace's runner transport (a sibling facade's injected one wins, else
9
+ * the self-hosted pool), wraps it with the provisioning-log decorator, and builds the deploy job
10
+ * client + clone-target resolver (default: the pool-backed client + an App-token github.com origin).
11
+ */
12
+ export function buildNodeTransportDeploy(input) {
13
+ const { config, repos, idGenerator, clock, runnerPoolConnectionRepository, runnerBackendRegistry, appRegistry, resolveRepoTarget, workspaceRepository, resolveTransportOverride, runnerPoolProvider, skipProvisioningLogWrap, mintInstallationToken, deployJobClientOverride, disableDefaultDeployJobClient, resolveDeployCloneTargetOverride, resolveRepoOrigin, } = input;
14
+ // Best-effort recorder for the provisioning event log (its own Postgres schema).
15
+ // Shared by the env services (via createCore) and the runner/container transport
16
+ // decorator below, so every spin-up/down attempt is logged.
17
+ const provisioningLogRecorder = new ProvisioningLogRecorder({
18
+ repository: repos.provisioningLogRepository,
19
+ idGenerator,
20
+ clock,
21
+ });
22
+ // A sibling facade (local mode) may inject its own transport — even `null` — which
23
+ // replaces the default self-hosted-pool resolution; undefined keeps Node's default
24
+ // (a self-hosted pool, optionally driven by an injected native `runnerPoolProvider`).
25
+ // The injected transport is a per-run container (local mode), the default is a
26
+ // self-hosted pool — tag each accordingly so the logs drawer can filter by subsystem.
27
+ // A facade that pre-wraps its branches with their own subsystem tags (local mode) sets
28
+ // `skipProvisioningLogWrap` so we don't double-wrap.
29
+ const baseResolveTransport = resolveTransportOverride !== undefined
30
+ ? resolveTransportOverride
31
+ : buildNodeResolveTransport(config, runnerPoolConnectionRepository, workspaceRepository, clock, runnerBackendRegistry, runnerPoolProvider);
32
+ const resolveTransport = skipProvisioningLogWrap
33
+ ? baseResolveTransport
34
+ : withProvisioningLog(baseResolveTransport, provisioningLogRecorder, resolveTransportOverride !== undefined ? 'container' : 'runner-pool');
35
+ // The async, container-backed Kubernetes deploy lifecycle (slice 9's `deployJobClient` +
36
+ // `resolveDeployCloneTarget` seams). Node deploys on the workspace's self-hosted runner pool
37
+ // (which pulls the `imageDeploy` variant), so the default deploy client wraps the SAME
38
+ // `resolveTransport` the agent executor uses — the pool is Node's analogue of the Worker's
39
+ // DeployContainer. The clone-target resolver mints a short-lived install token + a github.com
40
+ // origin from the App registry. The local facade injects BOTH (a deploy-dedicated native/
41
+ // container transport + a PAT/GitLab clone target) via `options`, which win here. Absent any
42
+ // backend ⇒ unwired, so a render-needing config fails loudly (the raw REST path is unaffected).
43
+ const baseDeployMint = mintInstallationToken ??
44
+ (appRegistry ? (id) => appRegistry.installationToken(id) : undefined);
45
+ const deployJobClient = deployJobClientOverride ??
46
+ (disableDefaultDeployJobClient || !resolveTransport
47
+ ? undefined
48
+ : new RunnerJobClient(resolveTransport));
49
+ const resolveDeployCloneTarget = resolveDeployCloneTargetOverride ??
50
+ (baseDeployMint
51
+ ? makeResolveDeployCloneTarget(resolveRepoTarget, (id) => baseDeployMint(id), resolveRepoOrigin ? { resolveCloneUrl: (t) => resolveRepoOrigin(t).cloneUrl } : {})
52
+ : undefined);
53
+ const deployDeps = config.environments.encryptionKey
54
+ ? {
55
+ ...(deployJobClient ? { deployJobClient } : {}),
56
+ ...(resolveDeployCloneTarget ? { resolveDeployCloneTarget } : {}),
57
+ }
58
+ : {};
59
+ return { resolveTransport, baseDeployMint, deployDeps };
60
+ }
61
+ /**
62
+ * The repo-bootstrap slice of the Node composition root (the reference-architecture library +
63
+ * the container-dispatching `repoBootstrapper`), lifted out of `buildNodeContainer` so that root
64
+ * stays within the file-size budget. The bootstrap-job repo is wired unconditionally (the module
65
+ * + ref-arch CRUD then work like the Worker); the `repoBootstrapper` wires only when its
66
+ * prerequisites are met (transport + proxy + token + GitHub client) — the same token source the
67
+ * container executor uses.
68
+ */
69
+ export function buildNodeBootstrapper(input) {
70
+ const { env, config, sourced, resolveTransport, githubInstallationRepository, repoProjectionRepository, appRegistry, githubClient, mintInstallationToken, resolvePackageRegistries, caches, } = input;
71
+ const bootstrapJobRepository = sourced('bootstrapJobRepository', (d) => new DrizzleBootstrapJobRepository(d));
72
+ const bootstrapMintInstallationToken = mintInstallationToken ??
73
+ (appRegistry ? (id) => appRegistry.installationToken(id) : undefined);
74
+ const repoBootstrapper = selectNodeRepoBootstrapper({
75
+ env,
76
+ config,
77
+ resolveTransport,
78
+ installationRepository: githubInstallationRepository,
79
+ bootstrapJobRepository,
80
+ repoRepository: repoProjectionRepository,
81
+ ...(caches?.repoProjection ? { repoProjectionCache: caches.repoProjection } : {}),
82
+ githubClient,
83
+ mintInstallationToken: bootstrapMintInstallationToken,
84
+ ...(resolvePackageRegistries ? { resolvePackageRegistries } : {}),
85
+ });
86
+ return { bootstrapJobRepository, bootstrapMintInstallationToken, repoBootstrapper };
87
+ }
88
+ //# sourceMappingURL=container-transport-deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-transport-deps.js","sourceRoot":"","sources":["../src/container-transport-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,GAExB,MAAM,2BAA2B,CAAA;AAWlC,OAAO,EAOL,eAAe,EACf,4BAA4B,GAC7B,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAA;AAgC3E;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAA+B;IACtE,MAAM,EACJ,MAAM,EACN,KAAK,EACL,WAAW,EACX,KAAK,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EA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,CAAC,SAAS,CAAC,CAAA;IAC/E,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;QAClD,GAAG;QACH,MAAM;QACN,gBAAgB;QAChB,sBAAsB,EAAE,4BAA4B;QACpD,sBAAsB;QACtB,cAAc,EAAE,wBAAwB;QACxC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,YAAY;QACZ,qBAAqB,EAAE,8BAA8B;QACrD,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,wBAAwB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClE,CAAC,CAAA;IAEF,OAAO,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,CAAA;AACrF,CAAC"}
@@ -7,7 +7,7 @@ import { type GateProviderOverrides } from '@cat-factory/gates';
7
7
  import type { AppCaches, InitiativePresetRegistry, PipelineRegistry, PreviewTransport, ProviderRegistry, VcsProviderRegistry } from '@cat-factory/kernel';
8
8
  import type { PgBoss } from 'pg-boss';
9
9
  import type { DrizzleDb } from './db/client.js';
10
- import { type LocalEventSink } from './realtime.js';
10
+ import type { LocalEventSink } from './realtime.js';
11
11
  import { createDrizzleRepositories } from './repositories/drizzle.js';
12
12
  import type { ContentStorageBackend } from '@cat-factory/contracts';
13
13
  export { buildNodeResolveTransport, missingContainerExecutorPrereqs, withProvisioningLog, } from './container-executor-deps.js';
@@ -32,7 +32,7 @@ export declare function pickRepoSource<T>(remote: Record<string, unknown> | unde
32
32
  * warm container — the personal per-run activation for an individual vendor, the pooled token
33
33
  * otherwise — mirroring `ContainerAgentExecutor.resolveAuth`.
34
34
  */
35
- interface ModelProviderResolverWrapDeps {
35
+ export interface ModelProviderResolverWrapDeps {
36
36
  leasePersonalSubscriptionToken?: (executionId: string, userId: string, vendor: SubscriptionVendor) => Promise<{
37
37
  secret: string;
38
38
  }>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