@cosmicdrift/kumiko-server-runtime 0.398.0 → 0.400.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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// dry-run exit, KMS health gate, connections, schema-drift gate, boot-crypto
|
|
4
4
|
// and extraContext. Both processes must write rows the API can read, so they
|
|
5
5
|
// share every step that decides ciphers, blind indexes and config encryption.
|
|
6
|
-
import { loadJwtSecretOrKeyring } from "@cosmicdrift/kumiko-framework/api";
|
|
6
|
+
import { createDefaultSseBroker, loadJwtSecretOrKeyring } from "@cosmicdrift/kumiko-framework/api";
|
|
7
7
|
import { configureBlindIndexKey, configurePiiSubjectKms, resolvePlatformKeks, } from "@cosmicdrift/kumiko-framework/crypto";
|
|
8
8
|
import { assertRowLevelSecurityBootState, configureEntityFieldEncryption, knownTablesOf, } from "@cosmicdrift/kumiko-framework/db";
|
|
9
9
|
import { createRegistry, validateBoot, } from "@cosmicdrift/kumiko-framework/engine";
|
|
@@ -179,7 +179,9 @@ export async function bootWorkerProcess(options, envSource, profile) {
|
|
|
179
179
|
});
|
|
180
180
|
const extraContext = addConfigAccessorFactory({ ...autoExtraContext, ...resolvedExtraContext }, registry);
|
|
181
181
|
const jobLogger = jobRunLoggerCallbacks(registry, db);
|
|
182
|
+
const { sseBroker, ownedRedisSseBroker } = createDefaultSseBroker(envSource);
|
|
182
183
|
const entrypoint = createWorkerEntrypoint({
|
|
184
|
+
sseBroker,
|
|
183
185
|
registry,
|
|
184
186
|
rowLevelSecurity,
|
|
185
187
|
context: { db, redis, entityCache, registry, ...extraContext },
|
|
@@ -206,6 +208,11 @@ export async function bootWorkerProcess(options, envSource, profile) {
|
|
|
206
208
|
entrypoint.lifecycle.registerShutdownHook("workerCacheSync", async () => {
|
|
207
209
|
await cacheSync.close();
|
|
208
210
|
});
|
|
211
|
+
if (ownedRedisSseBroker) {
|
|
212
|
+
entrypoint.lifecycle.registerShutdownHook("workerRedisSseBroker", async () => {
|
|
213
|
+
await ownedRedisSseBroker.close();
|
|
214
|
+
});
|
|
215
|
+
}
|
|
209
216
|
return {
|
|
210
217
|
kind: "booted",
|
|
211
218
|
db,
|
package/dist/run-worker-app.d.ts
CHANGED
|
@@ -63,8 +63,8 @@ export type RunWorkerAppOptions = {
|
|
|
63
63
|
readonly dir: string;
|
|
64
64
|
} | false;
|
|
65
65
|
/** Extra AppContext keys — same factory-union pattern as
|
|
66
|
-
* RunProdAppOptions["extraContext"], without sseBroker (the worker
|
|
67
|
-
*
|
|
66
|
+
* RunProdAppOptions["extraContext"], without sseBroker (the worker builds its own: with
|
|
67
|
+
* REDIS_URL in the env it publishes its SSE signals over Redis to the API's clients). */
|
|
68
68
|
readonly extraContext?: WorkerContextOption;
|
|
69
69
|
/** MasterKeyProvider replacing the env KEK for ctx.services.secrets, encrypted
|
|
70
70
|
* config keys and `encrypted: true` entity fields; with it set,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-server-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.400.0",
|
|
4
4
|
"description": "Production server-boot runtime for Kumiko apps: connections, schema-drift-gate, seeds, lifecycle, graceful shutdown. Symmetric to kumiko-dev-server's runDevApp, without dev/scaffold tooling.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -96,11 +96,11 @@
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
100
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
101
|
-
"@cosmicdrift/kumiko-renderer": "0.
|
|
102
|
-
"@cosmicdrift/kumiko-renderer-mail-html": "0.
|
|
103
|
-
"@cosmicdrift/kumiko-types": "0.
|
|
99
|
+
"@cosmicdrift/kumiko-bundled-features": "0.400.0",
|
|
100
|
+
"@cosmicdrift/kumiko-framework": "0.400.0",
|
|
101
|
+
"@cosmicdrift/kumiko-renderer": "0.400.0",
|
|
102
|
+
"@cosmicdrift/kumiko-renderer-mail-html": "0.400.0",
|
|
103
|
+
"@cosmicdrift/kumiko-types": "0.400.0",
|
|
104
104
|
"ioredis": "^5.10.1",
|
|
105
105
|
"temporal-polyfill": "^0.3.2",
|
|
106
106
|
"zod": "^4.6.7"
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"bun-types": "^1.4.4"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
112
|
+
"@cosmicdrift/kumiko-testing": "0.400.0",
|
|
113
113
|
"bun-types": "^1.4.4"
|
|
114
114
|
},
|
|
115
115
|
"publishConfig": {
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.399.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "Worker SSE signals reach the API clients when the env comes from envSource",
|
|
6
|
+
"detail": "The worker built its SSE broker from process.env only. A worker started with `runWorkerApp({ envSource })` and no REDIS_URL in process.env kept an in-memory broker, so signals from jobs and consumers never reached the SSE clients connected to the API process. The worker boot now builds the broker from the same env source as the API and closes it on shutdown. `WorkerEntrypointOptions` gets an optional `sseBroker`."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.390.0",
|
|
4
10
|
"type": "fix",
|