gencow 0.1.298 → 0.2.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/bin/gencow.mjs +0 -6
- package/core/index.js +261 -1447
- package/core/package.json +1 -1
- package/dashboard/assets/{index-BnBn8uo4.js → index-DYqUzCmS.js} +3 -3
- package/dashboard/assets/index-OH2xW1ZG.css +2 -0
- package/dashboard/index.html +2 -2
- package/docs/packaging.md +14 -4
- package/lib/cli-artifact-guard.mjs +53 -3
- package/lib/cli-command-runner.d.mts +11 -0
- package/lib/cli-dev-runtime.mjs +1 -0
- package/lib/cli-project-runtime.mjs +26 -14
- package/lib/codegen-command.mjs +16 -0
- package/lib/coding-guardrails.mjs +2 -0
- package/lib/component-readme.mjs +4 -4
- package/lib/dashboard-artifact.mjs +65 -0
- package/lib/dashboard-assets.mjs +20 -0
- package/lib/db-command.mjs +121 -80
- package/lib/db-migration-command-steps.mjs +19 -16
- package/lib/db-push-command.mjs +1 -1
- package/lib/deploy-codegen-preflight.mjs +1 -0
- package/lib/deploy-cron-manifest-diagnostic.mjs +93 -0
- package/lib/deploy-failure-diagnostic.mjs +4 -43
- package/lib/deploy-route-target-rejection-diagnostic.mjs +43 -0
- package/lib/dev-cloud-command.mjs +1 -1
- package/lib/dev-local-command.mjs +19 -56
- package/lib/document-local-converter.mjs +11 -0
- package/lib/jobs-command.mjs +33 -1
- package/lib/local-dashboard-plan.mjs +60 -0
- package/lib/local-database-commands.mjs +127 -0
- package/lib/local-development-migrations.mjs +157 -0
- package/lib/local-drizzle-database.config.mjs +10 -0
- package/lib/local-runtime-features.mjs +12 -0
- package/lib/rag-selection.mjs +7 -0
- package/lib/readme-codegen.mjs +2 -2
- package/lib/runtime-local-worker.mjs +116 -0
- package/lib/runtime-mode.mjs +3 -0
- package/lib/standalone-codegen-adapter.mjs +91 -0
- package/lib/ts-codegen-import-extension.mjs +228 -19
- package/package.json +16 -9
- package/runtime/config.mjs +218 -2
- package/runtime/dependency-lock.mjs +5 -1
- package/runtime/engine/chunk-2HA4CUMS.mjs +90 -0
- package/runtime/engine/chunk-2JLO3KMM.mjs +305 -0
- package/runtime/engine/chunk-2SR2M7SR.mjs +1045 -0
- package/runtime/engine/chunk-3D7MHEUC.mjs +253 -0
- package/runtime/engine/chunk-3R7COBWG.mjs +309 -0
- package/runtime/engine/chunk-3ZKA54UW.mjs +1560 -0
- package/runtime/engine/chunk-45I4YR2J.mjs +9 -0
- package/runtime/engine/chunk-4MLRXO7F.mjs +74 -0
- package/runtime/engine/chunk-5575APCJ.mjs +215 -0
- package/runtime/engine/chunk-5GUJZQF3.mjs +114 -0
- package/runtime/engine/chunk-5MXY3T75.mjs +428 -0
- package/runtime/engine/chunk-5TACQ2US.mjs +44 -0
- package/runtime/engine/chunk-66G4YEDT.mjs +3104 -0
- package/runtime/engine/chunk-67YO53WW.mjs +1426 -0
- package/runtime/engine/chunk-6GQRM7XY.mjs +87 -0
- package/runtime/engine/chunk-6JO72SPP.mjs +68 -0
- package/runtime/engine/chunk-6W653LXI.mjs +13 -0
- package/runtime/engine/chunk-7ITSMI3S.mjs +69 -0
- package/runtime/engine/chunk-7KUJ2H2S.mjs +128 -0
- package/runtime/engine/chunk-A5BMQ5IC.mjs +45 -0
- package/runtime/engine/chunk-ADF3UR6L.mjs +428 -0
- package/runtime/engine/chunk-AEBW7XZJ.mjs +4510 -0
- package/runtime/engine/chunk-AGPQ5XIV.mjs +156 -0
- package/runtime/engine/chunk-CPU4OZSX.mjs +753 -0
- package/runtime/engine/chunk-CSWPPWBL.mjs +50 -0
- package/runtime/engine/chunk-DPWXSMWO.mjs +53 -0
- package/runtime/engine/chunk-EAIELFKU.mjs +151 -0
- package/runtime/engine/chunk-EDU5CBKT.mjs +10 -0
- package/runtime/engine/chunk-EQCTAET7.mjs +173 -0
- package/runtime/engine/chunk-EQCXDF2Z.mjs +70 -0
- package/runtime/engine/chunk-F3G4UGV4.mjs +330 -0
- package/runtime/engine/chunk-F62NUNOO.mjs +26 -0
- package/runtime/engine/chunk-FKPNIFRP.mjs +2492 -0
- package/runtime/engine/chunk-FM23RGVI.mjs +81 -0
- package/runtime/engine/chunk-FW5AK4YP.mjs +1041 -0
- package/runtime/engine/chunk-GDWYAGWV.mjs +23 -0
- package/runtime/engine/chunk-GO5PZUYW.mjs +53 -0
- package/runtime/engine/chunk-GOLP7OSG.mjs +340 -0
- package/runtime/engine/chunk-GSLM44EF.mjs +242 -0
- package/runtime/engine/chunk-GYAJ7OX2.mjs +125 -0
- package/runtime/engine/chunk-I3GWR43K.mjs +14 -0
- package/runtime/engine/chunk-IFMOTJNU.mjs +106 -0
- package/runtime/engine/chunk-IKQKBE2G.mjs +128 -0
- package/runtime/engine/chunk-ITH2NEKM.mjs +282 -0
- package/runtime/engine/chunk-J6SDRCG4.mjs +96 -0
- package/runtime/engine/chunk-JODRNM3S.mjs +29596 -0
- package/runtime/engine/chunk-JUDKX53X.mjs +137 -0
- package/runtime/engine/chunk-K2YZVPJ4.mjs +827 -0
- package/runtime/engine/chunk-KEZJUXEE.mjs +151 -0
- package/runtime/engine/chunk-KVLTJFCH.mjs +234 -0
- package/runtime/engine/chunk-KX2PRQPS.mjs +126 -0
- package/runtime/engine/chunk-LEW5ZMLR.mjs +76 -0
- package/runtime/engine/chunk-LINVSJEM.mjs +175 -0
- package/runtime/engine/chunk-M7K2ICSM.mjs +11 -0
- package/runtime/engine/chunk-MZXDXSDC.mjs +292 -0
- package/runtime/engine/chunk-N2TA2IK2.mjs +678 -0
- package/runtime/engine/chunk-N4LTCKJP.mjs +695 -0
- package/runtime/engine/chunk-N6GCLOUX.mjs +13 -0
- package/runtime/engine/chunk-NAG2OXS5.mjs +37 -0
- package/runtime/engine/chunk-NNZ2QJUG.mjs +381 -0
- package/runtime/engine/chunk-NZPPLDNW.mjs +15 -0
- package/runtime/engine/chunk-ODWM57W6.mjs +138 -0
- package/runtime/engine/chunk-P5IIXAIE.mjs +23 -0
- package/runtime/engine/chunk-PBOXB2BV.mjs +6 -0
- package/runtime/engine/chunk-PMOJLN2P.mjs +8 -0
- package/runtime/engine/chunk-PZFMKFHO.mjs +180 -0
- package/runtime/engine/chunk-QL2TQX2N.mjs +114 -0
- package/runtime/engine/chunk-RITT2RSJ.mjs +258 -0
- package/runtime/engine/chunk-RODBVJ5M.mjs +135 -0
- package/runtime/engine/chunk-RW65MPVY.mjs +261 -0
- package/runtime/engine/chunk-S67UYPB6.mjs +25 -0
- package/runtime/engine/chunk-SVJCOUI3.mjs +47 -0
- package/runtime/engine/chunk-TCN3ZASV.mjs +957 -0
- package/runtime/engine/chunk-U2NRG6KC.mjs +32 -0
- package/runtime/engine/chunk-UM3F7HUV.mjs +432 -0
- package/runtime/engine/chunk-VWU7JJ3P.mjs +146 -0
- package/runtime/engine/chunk-WDTKPPMU.mjs +310 -0
- package/runtime/engine/chunk-WJOO4XTB.mjs +31 -0
- package/runtime/engine/chunk-XNFVL2OY.mjs +63 -0
- package/runtime/engine/chunk-XPWJXP2J.mjs +58 -0
- package/runtime/engine/chunk-Y3HSBJ3I.mjs +1132 -0
- package/runtime/engine/chunk-YMH4RYSX.mjs +317 -0
- package/runtime/engine/chunk-YNOMPSGS.mjs +8 -0
- package/runtime/engine/chunk-YRBAYTEZ.mjs +251 -0
- package/runtime/engine/chunk-YRHM272W.mjs +528 -0
- package/runtime/engine/chunk-ZQUZAGIQ.mjs +149 -0
- package/runtime/engine/chunk-ZXMM7QFP.mjs +176 -0
- package/runtime/engine/chunk-ZZJSIPV2.mjs +262 -0
- package/runtime/engine/composition.mjs +325 -0
- package/runtime/engine/document-local.mjs +504 -0
- package/runtime/engine/graph.json +4134 -0
- package/runtime/engine/index.mjs +265 -0
- package/runtime/engine/local-postgres-support.mjs +69 -0
- package/runtime/engine/local.mjs +3275 -0
- package/runtime/engine/pglite-directory-lock.mjs +8 -0
- package/runtime/engine/rag.mjs +11 -0
- package/runtime/engine/search.mjs +18 -0
- package/runtime/framework-migrations/foundation-bootstrap/rag.sql +115 -0
- package/runtime/framework-migrations/foundation-bootstrap/workflow.sql +194 -0
- package/runtime/framework-migrations/journal-bootstrap/migration.sql +26 -0
- package/runtime/framework-migrations/manifest.json +56 -0
- package/runtime/framework-migrations/rag/20261006111509_mushy_warhawk/migration.sql +121 -0
- package/runtime/framework-migrations/rag/20261013234621_rag_v2_lifecycle_markers/migration.sql +6 -0
- package/runtime/framework-migrations/workflow/20261006111508_perpetual_star_brand/migration.sql +31 -0
- package/runtime/runtime-metadata.json +27 -0
- package/runtime/tooling.mjs +10549 -10543
- package/scripts/bundle-runtime-config.mjs +23 -0
- package/scripts/bundle-runtime.mjs +100 -0
- package/scripts/bundle-runtime.test.mjs +33 -0
- package/scripts/bundle-shared.mjs +3 -0
- package/scripts/copy-dashboard.mjs +16 -0
- package/scripts/pre-publish-check.mjs +23 -11
- package/templateFeature/ai/ai-embedding-result.ts +82 -0
- package/templateFeature/ai/ai-facade.ts +24 -7
- package/templateFeature/ai/ai-provider.ts +17 -1
- package/templateFeature/ai/ai.ts +1 -0
- package/templateFeature/ai/manifest.json +4 -3
- package/templateFeature/reranker/manifest.json +1 -1
- package/templateFeature/reranker/reranker.ts +4 -3
- package/templateFeature/sso/sso-auth-callback.tsx +37 -5
- package/templateFeature/tools/manifest.json +2 -1
- package/templateFeature/tools/tools.ts +3 -3
- package/dashboard/assets/index-C6-BpKKR.css +0 -2
- package/runtime/server.mjs +0 -14320
- package/scripts/bundle-server.mjs +0 -223
- package/server/config.js +0 -1
- package/server/index.js +0 -1
- package/server/package.json +0 -6
|
@@ -0,0 +1,957 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RuntimeRealtimeDeclarationError,
|
|
3
|
+
assertRuntimeWorkflowBuiltinDeclarations,
|
|
4
|
+
assertSupportedApiDeclaration,
|
|
5
|
+
captureLegacyRegistrationSource,
|
|
6
|
+
collectRuntimeOperations,
|
|
7
|
+
collectRuntimeRealtimeCatalog,
|
|
8
|
+
collectRuntimeWorkflowCatalog,
|
|
9
|
+
hasOperations,
|
|
10
|
+
immutableRuntimeMap,
|
|
11
|
+
markLoaderProducedRuntimeApplication,
|
|
12
|
+
runtimeWorkflowBuiltins,
|
|
13
|
+
workflowBuiltinNames
|
|
14
|
+
} from "./chunk-JODRNM3S.mjs";
|
|
15
|
+
import {
|
|
16
|
+
isSupportedCronPattern
|
|
17
|
+
} from "./chunk-2SR2M7SR.mjs";
|
|
18
|
+
import {
|
|
19
|
+
invalidCronDeclaration
|
|
20
|
+
} from "./chunk-NAG2OXS5.mjs";
|
|
21
|
+
import {
|
|
22
|
+
RuntimeDiagnosticError,
|
|
23
|
+
captureLegacyRealtimeChannels,
|
|
24
|
+
formatRuntimeDiagnostic,
|
|
25
|
+
getRegisteredWorkflows,
|
|
26
|
+
runtimeDiagnostic,
|
|
27
|
+
selectLegacyRealtimeChannelSnapshot
|
|
28
|
+
} from "./chunk-AEBW7XZJ.mjs";
|
|
29
|
+
|
|
30
|
+
// ../runtime/dist/app/loader.js
|
|
31
|
+
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
32
|
+
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
33
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
34
|
+
import { dirname as dirname3, resolve as resolve6 } from "node:path";
|
|
35
|
+
|
|
36
|
+
// ../runtime/dist/realtime/registration-capture.js
|
|
37
|
+
function beginRuntimeRealtimeImport() {
|
|
38
|
+
const state = globalThis;
|
|
39
|
+
return {
|
|
40
|
+
channels: captureLegacyRealtimeChannels(),
|
|
41
|
+
channelIdentities: new Map(state.__gencow_realtimeChannelRegistry),
|
|
42
|
+
queryIdentities: new Map(state.__gencow_realtimeQuerySubscriptionRegistry)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function captureRuntimeRealtimeRegistrations(before) {
|
|
46
|
+
const state = globalThis;
|
|
47
|
+
const after = captureLegacyRealtimeChannels();
|
|
48
|
+
const selectedNames = new Set((before ? selectLegacyRealtimeChannelSnapshot(before.channels, after) : after).map((definition) => definition.name));
|
|
49
|
+
const channels = after.filter((definition) => !before || selectedNames.has(definition.name) || state.__gencow_realtimeChannelRegistry?.get(definition.name) !== before.channelIdentities.get(definition.name));
|
|
50
|
+
const queries = [...state.__gencow_realtimeQuerySubscriptionRegistry?.values() ?? []].filter((definition) => !before || definition !== before.queryIdentities.get(definition.name)).map((definition) => Object.freeze({ ...definition }));
|
|
51
|
+
return Object.freeze({
|
|
52
|
+
channels: Object.freeze(channels.map((definition) => Object.freeze({ ...definition }))),
|
|
53
|
+
queries: Object.freeze(queries)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ../runtime/dist/app/app-load-isolation.js
|
|
58
|
+
var importing = Promise.resolve();
|
|
59
|
+
var moduleRegistrations = /* @__PURE__ */ new WeakMap();
|
|
60
|
+
function capture() {
|
|
61
|
+
const realtime = beginRuntimeRealtimeImport();
|
|
62
|
+
const legacy = captureLegacyRegistrationSource();
|
|
63
|
+
return {
|
|
64
|
+
realtime,
|
|
65
|
+
legacy,
|
|
66
|
+
workflows: new Map(getRegisteredWorkflows().map((definition) => [definition.name, definition])),
|
|
67
|
+
httpActions: new Set(legacy?.httpActions ?? []),
|
|
68
|
+
workflowBridge: globalThis.__gencow_workflowsApiRegistered
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function evaluateRuntimeApp(importModule) {
|
|
72
|
+
const result = importing.then(async () => {
|
|
73
|
+
const before = capture();
|
|
74
|
+
globalThis.__gencow_workflowsApiRegistered = void 0;
|
|
75
|
+
let moduleValue;
|
|
76
|
+
try {
|
|
77
|
+
moduleValue = await importModule();
|
|
78
|
+
} finally {
|
|
79
|
+
globalThis.__gencow_workflowsApiRegistered ??= before.workflowBridge;
|
|
80
|
+
}
|
|
81
|
+
const after = capture();
|
|
82
|
+
const key = moduleValue && (typeof moduleValue === "object" || typeof moduleValue === "function") ? moduleValue : void 0;
|
|
83
|
+
const previous = key && moduleRegistrations.get(key);
|
|
84
|
+
if (previous)
|
|
85
|
+
return { moduleValue, registrations: previous };
|
|
86
|
+
const queries = new Map([...after.legacy?.queries ?? []].filter(([name, definition]) => before.legacy?.queries.get(name) !== definition));
|
|
87
|
+
const mutations = new Map([...after.legacy?.mutations ?? []].filter(([name, definition]) => before.legacy?.mutations.get(name) !== definition));
|
|
88
|
+
const httpActions = Object.freeze([...after.httpActions].filter((action) => !before.httpActions.has(action)));
|
|
89
|
+
const registrations = Object.freeze({
|
|
90
|
+
...queries.size || mutations.size || httpActions.length ? { legacy: Object.freeze({ queries, mutations, httpActions }) } : {},
|
|
91
|
+
...after.workflowBridge !== before.workflowBridge ? { workflowBridge: after.workflowBridge } : {},
|
|
92
|
+
realtime: captureRuntimeRealtimeRegistrations(before.realtime),
|
|
93
|
+
workflows: Object.freeze([...after.workflows].filter(([name, definition]) => before.workflows.get(name) !== definition).map(([, definition]) => definition)),
|
|
94
|
+
httpActions
|
|
95
|
+
});
|
|
96
|
+
if (key)
|
|
97
|
+
moduleRegistrations.set(key, registrations);
|
|
98
|
+
return { moduleValue, registrations };
|
|
99
|
+
});
|
|
100
|
+
importing = result.then(() => {
|
|
101
|
+
}, () => {
|
|
102
|
+
});
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
function currentRuntimeLegacyRegistrations() {
|
|
106
|
+
const legacy = captureLegacyRegistrationSource();
|
|
107
|
+
return {
|
|
108
|
+
realtime: { channels: [], queries: [] },
|
|
109
|
+
legacy,
|
|
110
|
+
workflowBridge: globalThis.__gencow_workflowsApiRegistered,
|
|
111
|
+
workflows: [],
|
|
112
|
+
httpActions: [...legacy?.httpActions ?? []]
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ../runtime/dist/workflow/registration.js
|
|
117
|
+
function registerRuntimeWorkflows(input) {
|
|
118
|
+
const operations = Object.freeze({
|
|
119
|
+
...input.operations,
|
|
120
|
+
...input.operations.legacy ? {
|
|
121
|
+
legacy: Object.freeze({
|
|
122
|
+
queries: immutableRuntimeMap([...input.operations.legacy.queries].filter(([name]) => !workflowBuiltinNames.some((builtin) => builtin === name))),
|
|
123
|
+
mutations: immutableRuntimeMap([...input.operations.legacy.mutations].filter(([name]) => !workflowBuiltinNames.some((builtin) => builtin === name)))
|
|
124
|
+
})
|
|
125
|
+
} : {}
|
|
126
|
+
});
|
|
127
|
+
const workflows = collectRuntimeWorkflowCatalog({
|
|
128
|
+
bag: input.api?.workflows,
|
|
129
|
+
operations,
|
|
130
|
+
legacyDefinitions: input.legacyDefinitions,
|
|
131
|
+
assertHostContract: input.assertHostContract
|
|
132
|
+
});
|
|
133
|
+
if (workflows.byName.size === 0)
|
|
134
|
+
return { operations: input.operations, workflows };
|
|
135
|
+
assertRuntimeWorkflowBuiltinDeclarations(input.legacySource, input.legacyBridge);
|
|
136
|
+
const builtins = runtimeWorkflowBuiltins(input.legacySource, workflows);
|
|
137
|
+
for (const name of workflowBuiltinNames) {
|
|
138
|
+
if (operations.procedureQueries.has(name) || operations.procedureMutations.has(name))
|
|
139
|
+
throw new Error("RUNTIME_APP_DECLARATION_INVALID");
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
workflows,
|
|
143
|
+
operations: Object.freeze({
|
|
144
|
+
...operations,
|
|
145
|
+
procedureQueries: immutableRuntimeMap([...operations.procedureQueries, ...builtins.queries]),
|
|
146
|
+
procedureMutations: immutableRuntimeMap([
|
|
147
|
+
...operations.procedureMutations,
|
|
148
|
+
...workflows.explicitStarts,
|
|
149
|
+
...builtins.mutations
|
|
150
|
+
]),
|
|
151
|
+
procedureOnlyMutations: workflows.explicitStarts,
|
|
152
|
+
legacy: Object.freeze({
|
|
153
|
+
queries: builtins.legacy.queries,
|
|
154
|
+
mutations: immutableRuntimeMap([...builtins.legacy.mutations, ...workflows.legacyStarts])
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ../runtime/dist/workflow/local-host-contract.js
|
|
161
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
162
|
+
|
|
163
|
+
// ../shared/dist/src/introspection/functions-entrypoint.js
|
|
164
|
+
import { existsSync, statSync } from "fs";
|
|
165
|
+
import { dirname, resolve } from "path";
|
|
166
|
+
var SOURCE_ENTRY_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"];
|
|
167
|
+
function resolveFunctionsImportPath(functionsPath) {
|
|
168
|
+
const resolvedPath = resolve(functionsPath);
|
|
169
|
+
try {
|
|
170
|
+
if (existsSync(resolvedPath) && statSync(resolvedPath).isFile())
|
|
171
|
+
return resolvedPath;
|
|
172
|
+
} catch {
|
|
173
|
+
}
|
|
174
|
+
for (const extension of SOURCE_ENTRY_EXTENSIONS) {
|
|
175
|
+
const candidate = `${resolvedPath}${extension}`;
|
|
176
|
+
if (existsSync(candidate))
|
|
177
|
+
return candidate;
|
|
178
|
+
}
|
|
179
|
+
for (const extension of SOURCE_ENTRY_EXTENSIONS) {
|
|
180
|
+
const candidate = resolve(resolvedPath, `index${extension}`);
|
|
181
|
+
if (existsSync(candidate))
|
|
182
|
+
return candidate;
|
|
183
|
+
}
|
|
184
|
+
return resolvedPath;
|
|
185
|
+
}
|
|
186
|
+
function resolveFunctionsSourceBaseDir(functionsPath) {
|
|
187
|
+
const resolvedPath = resolve(functionsPath);
|
|
188
|
+
try {
|
|
189
|
+
if (existsSync(resolvedPath) && statSync(resolvedPath).isDirectory())
|
|
190
|
+
return resolvedPath;
|
|
191
|
+
} catch {
|
|
192
|
+
}
|
|
193
|
+
const importPath = resolveFunctionsImportPath(resolvedPath);
|
|
194
|
+
if (importPath !== resolvedPath) {
|
|
195
|
+
return dirname(importPath);
|
|
196
|
+
}
|
|
197
|
+
return resolvedPath;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// ../shared/dist/src/introspection/realtime-channel-catalog.js
|
|
201
|
+
function appApi(appModule) {
|
|
202
|
+
let candidate = appModule;
|
|
203
|
+
for (let index = 0; index < 2 && candidate && typeof candidate === "object"; index += 1) {
|
|
204
|
+
if (candidate.default && typeof candidate.default === "object") {
|
|
205
|
+
candidate = candidate.default;
|
|
206
|
+
} else
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
return candidate && typeof candidate === "object" ? candidate : void 0;
|
|
210
|
+
}
|
|
211
|
+
function assertName(name, label) {
|
|
212
|
+
if (typeof name !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name)) {
|
|
213
|
+
throw new Error(`REALTIME_CHANNEL_DEFINITION_INVALID: ${label} has an invalid public channel name`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function isExplicit(value) {
|
|
217
|
+
return !!value && typeof value === "object" && value.kind === "realtime_channel";
|
|
218
|
+
}
|
|
219
|
+
function immutableLookup(map) {
|
|
220
|
+
return Object.freeze({
|
|
221
|
+
get: (key) => map.get(key),
|
|
222
|
+
has: (key) => map.has(key),
|
|
223
|
+
entries: () => map.entries()
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function collectRealtimeChannelCatalog(appModule, legacyChannels = []) {
|
|
227
|
+
const api = appApi(appModule);
|
|
228
|
+
const bag = api?.realtimeChannels;
|
|
229
|
+
if (bag !== void 0 && (!bag || typeof bag !== "object" || Array.isArray(bag))) {
|
|
230
|
+
throw new Error("REALTIME_CHANNEL_DEFINITION_INVALID: realtimeChannels must be an object");
|
|
231
|
+
}
|
|
232
|
+
const selected = [];
|
|
233
|
+
const byName = /* @__PURE__ */ new Map();
|
|
234
|
+
const add = (entry) => {
|
|
235
|
+
const name = entry.definition.name;
|
|
236
|
+
assertName(name, `${entry.source} realtime channel "${entry.declarationKey}"`);
|
|
237
|
+
if (typeof entry.definition.authorize !== "function") {
|
|
238
|
+
throw new Error(`REALTIME_CHANNEL_DEFINITION_INVALID: channel "${name}" is missing authorize()`);
|
|
239
|
+
}
|
|
240
|
+
if (entry.source === "explicit") {
|
|
241
|
+
if (!isExplicit(entry.definition) || typeof entry.definition.channelKey === "object") {
|
|
242
|
+
throw new Error(`REALTIME_CHANNEL_DEFINITION_INVALID: channel "${name}" is not a completed builder definition`);
|
|
243
|
+
}
|
|
244
|
+
if (entry.definition.channelKey !== void 0 && typeof entry.definition.channelKey !== "function") {
|
|
245
|
+
throw new Error(`REALTIME_CHANNEL_DEFINITION_INVALID: channel "${name}" has an invalid channelKey()`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (byName.has(name)) {
|
|
249
|
+
throw new Error(`REALTIME_CHANNEL_DEFINITION_INVALID: duplicate channel name "${name}"`);
|
|
250
|
+
}
|
|
251
|
+
selected.push(entry);
|
|
252
|
+
byName.set(name, entry);
|
|
253
|
+
};
|
|
254
|
+
for (const [declarationKey, definition] of Object.entries(bag ?? {})) {
|
|
255
|
+
if (!isExplicit(definition)) {
|
|
256
|
+
throw new Error(`REALTIME_CHANNEL_DEFINITION_INVALID: realtimeChannels.${declarationKey} is not a completed builder definition`);
|
|
257
|
+
}
|
|
258
|
+
add({ source: "explicit", declarationKey, definition });
|
|
259
|
+
}
|
|
260
|
+
for (const definition of legacyChannels) {
|
|
261
|
+
add({ source: "legacy", declarationKey: definition.name, definition });
|
|
262
|
+
}
|
|
263
|
+
return Object.freeze({
|
|
264
|
+
ordered: Object.freeze(selected),
|
|
265
|
+
byName: immutableLookup(byName),
|
|
266
|
+
clientRefs: Object.freeze(selected.filter((entry) => entry.source === "explicit").map(({ declarationKey, definition }) => ({
|
|
267
|
+
declarationKey,
|
|
268
|
+
name: definition.name,
|
|
269
|
+
inputRequired: definition.inputSchema !== void 0,
|
|
270
|
+
...definition.inputSchema ? { inputSchema: definition.inputSchema } : {},
|
|
271
|
+
...definition.eventSchema ? { eventSchema: definition.eventSchema } : {}
|
|
272
|
+
})))
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ../shared/dist/src/introspection/workflow-builtin-procedure-maps.js
|
|
277
|
+
var WORKFLOW_BUILTIN_OPERATION_NAMES = [
|
|
278
|
+
"workflows.get",
|
|
279
|
+
"workflows.list",
|
|
280
|
+
"workflows.signal",
|
|
281
|
+
"workflows.cancel"
|
|
282
|
+
];
|
|
283
|
+
|
|
284
|
+
// ../shared/dist/src/introspection/workflow-runtime-catalog.js
|
|
285
|
+
var FRAMEWORK_WORKFLOW_NAMES = new Set(WORKFLOW_BUILTIN_OPERATION_NAMES);
|
|
286
|
+
|
|
287
|
+
// ../shared/dist/src/introspection/schema-paths.js
|
|
288
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
289
|
+
import { join, resolve as resolve2 } from "node:path";
|
|
290
|
+
|
|
291
|
+
// ../shared/dist/src/codegen/domain/auth-schema.js
|
|
292
|
+
var USER_AUTH_SCHEMA_FILENAME = "schema-auth.ts";
|
|
293
|
+
|
|
294
|
+
// ../shared/dist/src/introspection/schema-paths.js
|
|
295
|
+
function resolveConfiguredSchemaPaths(projectRoot, functionsDirAbs, schema) {
|
|
296
|
+
if (Array.isArray(schema)) {
|
|
297
|
+
return schema.map((entry) => resolve2(projectRoot, entry));
|
|
298
|
+
}
|
|
299
|
+
if (typeof schema === "string" && schema.trim()) {
|
|
300
|
+
return [resolve2(projectRoot, schema)];
|
|
301
|
+
}
|
|
302
|
+
return [resolve2(resolveFunctionsSourceBaseDir(functionsDirAbs), "schema.ts")];
|
|
303
|
+
}
|
|
304
|
+
function resolveServerCodegenDirAbs(projectRoot, functionsDirAbs, serverPublishDir) {
|
|
305
|
+
if (typeof serverPublishDir === "string" && serverPublishDir.trim().length > 0) {
|
|
306
|
+
return resolve2(projectRoot, serverPublishDir.trim());
|
|
307
|
+
}
|
|
308
|
+
return join(resolveFunctionsSourceBaseDir(functionsDirAbs), "generated");
|
|
309
|
+
}
|
|
310
|
+
function isMigratedAuthSchemaLayout(functionsDirAbs, configuredPathsAbs, existsSyncImpl = existsSync2) {
|
|
311
|
+
const functionsSourceBaseDir = resolveFunctionsSourceBaseDir(functionsDirAbs);
|
|
312
|
+
const userAuthSchemaTs = join(functionsSourceBaseDir, USER_AUTH_SCHEMA_FILENAME);
|
|
313
|
+
if (existsSyncImpl(userAuthSchemaTs))
|
|
314
|
+
return true;
|
|
315
|
+
const userAuthSchemaJs = join(functionsSourceBaseDir, "schema-auth.js");
|
|
316
|
+
if (existsSyncImpl(userAuthSchemaJs))
|
|
317
|
+
return true;
|
|
318
|
+
return configuredPathsAbs.some((schemaPath) => {
|
|
319
|
+
const normalized = schemaPath.replace(/\\/g, "/");
|
|
320
|
+
return normalized.endsWith("/schema-auth.ts") || normalized.endsWith("/schema-auth.js");
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function mergeSchemaPathsWithImplicitAuth(projectRoot, functionsDirAbs, schema, serverCodegenAuthSchemaAbs, existsSyncImpl = existsSync2) {
|
|
324
|
+
const functionsSourceBaseDir = resolveFunctionsSourceBaseDir(functionsDirAbs);
|
|
325
|
+
const base = resolveConfiguredSchemaPaths(projectRoot, functionsDirAbs, schema);
|
|
326
|
+
if (isMigratedAuthSchemaLayout(functionsDirAbs, base, existsSyncImpl)) {
|
|
327
|
+
return dedupeResolvedPaths(base);
|
|
328
|
+
}
|
|
329
|
+
const authInFunctions = join(functionsSourceBaseDir, "auth-schema.ts");
|
|
330
|
+
const legacyCandidates = [authInFunctions, serverCodegenAuthSchemaAbs];
|
|
331
|
+
const hasLegacyAuth = legacyCandidates.some((candidate) => existsSyncImpl(candidate));
|
|
332
|
+
if (!hasLegacyAuth) {
|
|
333
|
+
return dedupeResolvedPaths(base);
|
|
334
|
+
}
|
|
335
|
+
return dedupeResolvedPaths([...base, ...legacyCandidates]);
|
|
336
|
+
}
|
|
337
|
+
function resolveAuthSchemaPaths(projectRoot, functionsDirAbs, schema, serverCodegenDirAbs, existsSyncImpl = existsSync2, options = {}) {
|
|
338
|
+
if (options.includeImplicitAuthSchema === false) {
|
|
339
|
+
return dedupeResolvedPaths(resolveConfiguredSchemaPaths(projectRoot, functionsDirAbs, schema));
|
|
340
|
+
}
|
|
341
|
+
return mergeSchemaPathsWithImplicitAuth(projectRoot, functionsDirAbs, schema, join(serverCodegenDirAbs, "auth-schema.ts"), existsSyncImpl);
|
|
342
|
+
}
|
|
343
|
+
function dedupeResolvedPaths(paths) {
|
|
344
|
+
const seen = /* @__PURE__ */ new Set();
|
|
345
|
+
const out = [];
|
|
346
|
+
for (const p of paths) {
|
|
347
|
+
const key = resolve2(p);
|
|
348
|
+
if (seen.has(key))
|
|
349
|
+
continue;
|
|
350
|
+
seen.add(key);
|
|
351
|
+
out.push(key);
|
|
352
|
+
}
|
|
353
|
+
return out;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// ../shared/dist/src/introspection/source-entrypoints.js
|
|
357
|
+
import { isAbsolute, resolve as resolve3 } from "node:path";
|
|
358
|
+
|
|
359
|
+
// ../shared/dist/src/introspection/table-introspector.js
|
|
360
|
+
import { randomUUID } from "node:crypto";
|
|
361
|
+
import { delimiter, relative, resolve as resolve4 } from "node:path";
|
|
362
|
+
|
|
363
|
+
// ../shared/dist/src/introspection/workflow-host-contract.js
|
|
364
|
+
var workflowHostContract = /* @__PURE__ */ Symbol.for("@gencow/core/workflow-host-contract");
|
|
365
|
+
function hasUnsupportedWorkflowHostContract(workflows, supportedContracts) {
|
|
366
|
+
for (const workflow of workflows) {
|
|
367
|
+
const marker = Object.getOwnPropertyDescriptor(workflow, workflowHostContract);
|
|
368
|
+
if (marker && (typeof marker.value !== "number" || !supportedContracts.includes(marker.value)))
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// ../runtime/dist/workflow/local-host-contract.js
|
|
375
|
+
var supportedWorkflowHostContracts = [];
|
|
376
|
+
function assertLocalWorkflowHostContract(workflows) {
|
|
377
|
+
if (!hasUnsupportedWorkflowHostContract(workflows, supportedWorkflowHostContracts))
|
|
378
|
+
return;
|
|
379
|
+
throw new RuntimeDiagnosticError({
|
|
380
|
+
code: "LOCAL_WORKFLOW_HOST_INCOMPATIBLE",
|
|
381
|
+
stage: "startup",
|
|
382
|
+
capability: "workflow",
|
|
383
|
+
servingStarted: false,
|
|
384
|
+
dataImpact: "unknown",
|
|
385
|
+
retryable: false,
|
|
386
|
+
correlationId: `startup_${randomUUID2()}`,
|
|
387
|
+
retryPrecondition: "Use a local Runtime compatible with the app's Core workflow contract.",
|
|
388
|
+
nextAction: "Inspect installed versions with `pnpm why @gencow/runtime @gencow/core`, install a compatible Runtime, and restart. Earlier app import effects may remain."
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// ../runtime/dist/app/types.js
|
|
393
|
+
var RuntimeLoadError = class extends Error {
|
|
394
|
+
diagnostic;
|
|
395
|
+
constructor(message, diagnostic) {
|
|
396
|
+
super(`${formatRuntimeDiagnostic(diagnostic)}
|
|
397
|
+
${message}`);
|
|
398
|
+
this.name = "RuntimeLoadError";
|
|
399
|
+
this.diagnostic = diagnostic;
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
// ../runtime/dist/app/realtime-inventory.js
|
|
404
|
+
function collectRuntimeRealtimeInventory(api, legacy) {
|
|
405
|
+
const channels = collectRealtimeChannelCatalog(api, (legacy?.channels ?? []).map((def) => Object.freeze({ ...def })));
|
|
406
|
+
const subscriptions = new Map([...legacy?.subscriptions ?? []].map(([name, def]) => [name, Object.freeze({ ...def })]));
|
|
407
|
+
const entries = channels.ordered.map((entry) => Object.freeze({ ...entry }));
|
|
408
|
+
const byName = new Map(entries.map((entry) => [entry.definition.name, entry]));
|
|
409
|
+
return Object.freeze({
|
|
410
|
+
channels: Object.freeze({
|
|
411
|
+
...channels,
|
|
412
|
+
clientRefs: Object.freeze(channels.clientRefs.map((ref) => Object.freeze({ ...ref }))),
|
|
413
|
+
ordered: Object.freeze(entries),
|
|
414
|
+
byName: Object.freeze({
|
|
415
|
+
get: (name) => byName.get(name),
|
|
416
|
+
has: (name) => byName.has(name),
|
|
417
|
+
entries: () => byName.entries()
|
|
418
|
+
})
|
|
419
|
+
}),
|
|
420
|
+
subscriptions: Object.freeze({
|
|
421
|
+
get: (name) => subscriptions.get(name),
|
|
422
|
+
has: (name) => subscriptions.has(name),
|
|
423
|
+
entries: () => subscriptions.entries()
|
|
424
|
+
})
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// ../runtime/dist/scheduler/declarations.js
|
|
429
|
+
import { types } from "node:util";
|
|
430
|
+
function assertSchedulerIdentifier(value) {
|
|
431
|
+
if (typeof value !== "string" || !value || Buffer.byteLength(value, "utf8") > 256 || /[\u0000-\u001f\u007f-\u009f]/u.test(value)) {
|
|
432
|
+
throw invalidCronDeclaration();
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
function snapshotCronDeclarations(input, operations) {
|
|
436
|
+
const definitions = [];
|
|
437
|
+
const names = /* @__PURE__ */ new Set();
|
|
438
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
439
|
+
let nodes = 0;
|
|
440
|
+
function visit(value, depth) {
|
|
441
|
+
if (++nodes > 1e4 || depth > 64 || !value || typeof value !== "object" || visiting.has(value))
|
|
442
|
+
throw invalidCronDeclaration();
|
|
443
|
+
visiting.add(value);
|
|
444
|
+
try {
|
|
445
|
+
const properties = Object.getOwnPropertyDescriptors(value);
|
|
446
|
+
if (Reflect.ownKeys(properties).some((key) => typeof key !== "string" ? Object.prototype.propertyIsEnumerable.call(value, key) : !("value" in properties[key])))
|
|
447
|
+
throw invalidCronDeclaration();
|
|
448
|
+
const record2 = value;
|
|
449
|
+
if (typeof record2.getJobs === "function") {
|
|
450
|
+
const jobs = record2.getJobs();
|
|
451
|
+
if (!Array.isArray(jobs))
|
|
452
|
+
throw invalidCronDeclaration();
|
|
453
|
+
visit(jobs, depth + 1);
|
|
454
|
+
} else if ("name" in record2 || "pattern" in record2) {
|
|
455
|
+
assertSchedulerIdentifier(record2.name);
|
|
456
|
+
if (names.has(record2.name) || !isSupportedCronPattern(record2.pattern))
|
|
457
|
+
throw invalidCronDeclaration();
|
|
458
|
+
let action;
|
|
459
|
+
const raw = "procedureName" in record2 ? record2.procedureName : record2.action;
|
|
460
|
+
if (typeof raw === "function") {
|
|
461
|
+
action = raw;
|
|
462
|
+
} else if (typeof raw === "string") {
|
|
463
|
+
assertSchedulerIdentifier(raw);
|
|
464
|
+
if (!operations.internalProcedures?.has(raw) && !operations.procedureMutations.has(raw) && !operations.legacy?.mutations.has(raw))
|
|
465
|
+
throw invalidCronDeclaration();
|
|
466
|
+
action = raw;
|
|
467
|
+
} else {
|
|
468
|
+
if (!raw || typeof raw !== "object")
|
|
469
|
+
throw invalidCronDeclaration();
|
|
470
|
+
const descriptors = Object.getOwnPropertyDescriptors(raw);
|
|
471
|
+
if (["kind", "name", "handler"].some((key) => !descriptors[key] || !("value" in descriptors[key])))
|
|
472
|
+
throw invalidCronDeclaration();
|
|
473
|
+
const ref = raw;
|
|
474
|
+
assertSchedulerIdentifier(ref.name);
|
|
475
|
+
const target = operations.internalProcedures?.get(ref.name);
|
|
476
|
+
if (ref.kind !== "internal" || !target || target.handler !== ref.handler)
|
|
477
|
+
throw invalidCronDeclaration();
|
|
478
|
+
action = ref.name;
|
|
479
|
+
}
|
|
480
|
+
names.add(record2.name);
|
|
481
|
+
definitions.push(Object.freeze({
|
|
482
|
+
name: record2.name,
|
|
483
|
+
pattern: record2.pattern,
|
|
484
|
+
action,
|
|
485
|
+
transitional: typeof raw === "string"
|
|
486
|
+
}));
|
|
487
|
+
} else {
|
|
488
|
+
const prototype = Object.getPrototypeOf(value);
|
|
489
|
+
if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null && !types.isModuleNamespaceObject(value))
|
|
490
|
+
throw invalidCronDeclaration();
|
|
491
|
+
if (Array.isArray(value) && Object.keys(value).length !== value.length)
|
|
492
|
+
throw invalidCronDeclaration();
|
|
493
|
+
for (const child of Object.values(value)) {
|
|
494
|
+
if (child === void 0 && !Array.isArray(value))
|
|
495
|
+
continue;
|
|
496
|
+
visit(child, depth + 1);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
} finally {
|
|
500
|
+
visiting.delete(value);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
visit(input, 0);
|
|
504
|
+
return Object.freeze(definitions);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// ../runtime/dist/app/relations-schema.js
|
|
508
|
+
import { existsSync as existsSync3, realpathSync, statSync as statSync2 } from "node:fs";
|
|
509
|
+
import { basename, dirname as dirname2, isAbsolute as isAbsolute2, relative as relative2, resolve as resolve5, sep } from "node:path";
|
|
510
|
+
import { pathToFileURL } from "node:url";
|
|
511
|
+
import { is, Relation, Table, View } from "drizzle-orm";
|
|
512
|
+
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
513
|
+
function failure() {
|
|
514
|
+
return new RuntimeDiagnosticError({
|
|
515
|
+
code: "RUNTIME_RELATIONS_SCHEMA_INVALID",
|
|
516
|
+
stage: "load",
|
|
517
|
+
capability: "database",
|
|
518
|
+
servingStarted: false,
|
|
519
|
+
dataImpact: "unknown",
|
|
520
|
+
retryable: false,
|
|
521
|
+
retryPrecondition: "Correct the app's schema declaration and restart this Runtime generation; no database provider was opened.",
|
|
522
|
+
nextAction: "Check the app schema setting and its single named relations export, then restart. Preserve the existing database and do not retry until the source/configuration is corrected.",
|
|
523
|
+
correlationId: randomUUID3()
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
async function loadRuntimeApplicationRelations(input) {
|
|
527
|
+
const project = input.project ? resolveProjectConfig(input.project) : await loadProjectConfig(input.entryPath, input.importModule);
|
|
528
|
+
const sourceRoot = project.sourceRoot ?? resolveSourceRoot(input.entryPath);
|
|
529
|
+
const importRelationsModule = input.importRelationsModule ?? input.importModule;
|
|
530
|
+
if (project.schemaExplicit && Array.isArray(project.config?.schema) && project.config.schema.length === 0)
|
|
531
|
+
return void 0;
|
|
532
|
+
const primaryPaths = project.schemaExplicit ? configuredPaths(project.projectRoot, sourceRoot, project.config?.schema) : [resolve5(sourceRoot, "schema.ts")];
|
|
533
|
+
const primary = await loadRoots(primaryPaths, project.projectRoot, !project.schemaExplicit, importRelationsModule);
|
|
534
|
+
if (primary !== void 0)
|
|
535
|
+
return primary;
|
|
536
|
+
if (project.schemaExplicit && (!project.config?.schema || primaryPaths.length === 0))
|
|
537
|
+
return void 0;
|
|
538
|
+
const legacy = legacyAuthPaths(project, sourceRoot, primaryPaths);
|
|
539
|
+
return legacy.length ? loadRoots(legacy, project.projectRoot, true, importRelationsModule) : void 0;
|
|
540
|
+
}
|
|
541
|
+
function resolveProjectConfig(input) {
|
|
542
|
+
if (!input || typeof input !== "object" || typeof input.projectRoot !== "string" || typeof input.sourceRoot !== "string" || typeof input.schemaExplicit !== "boolean")
|
|
543
|
+
throw failure();
|
|
544
|
+
const projectRoot = canonicalRoot(resolve5(input.projectRoot));
|
|
545
|
+
const sourceRootPath = resolve5(input.sourceRoot);
|
|
546
|
+
const sourceRoot = canonicalSource(sourceRootPath, projectRoot);
|
|
547
|
+
let sourceIsDirectory = false;
|
|
548
|
+
try {
|
|
549
|
+
sourceIsDirectory = statSync2(sourceRoot).isDirectory();
|
|
550
|
+
} catch {
|
|
551
|
+
}
|
|
552
|
+
if (!sourceIsDirectory)
|
|
553
|
+
throw failure();
|
|
554
|
+
const config = input.config;
|
|
555
|
+
if (config !== void 0 && !validProjectConfig(config))
|
|
556
|
+
throw failure();
|
|
557
|
+
return {
|
|
558
|
+
projectRoot,
|
|
559
|
+
sourceRoot,
|
|
560
|
+
...config ? { config } : {},
|
|
561
|
+
schemaExplicit: input.schemaExplicit
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
async function loadProjectConfig(entryPath, importer) {
|
|
565
|
+
const sourceRoot = resolveSourceRoot(entryPath);
|
|
566
|
+
const projectRoot = canonicalRoot(resolveProjectRoot(sourceRoot));
|
|
567
|
+
const configPath = [
|
|
568
|
+
resolve5(projectRoot, "gencow.config.js"),
|
|
569
|
+
resolve5(projectRoot, "gencow.config.ts")
|
|
570
|
+
].find(existsSync3);
|
|
571
|
+
if (!configPath)
|
|
572
|
+
return { projectRoot, schemaExplicit: false };
|
|
573
|
+
const canonicalConfig = canonicalSource(configPath, projectRoot);
|
|
574
|
+
let raw;
|
|
575
|
+
try {
|
|
576
|
+
const loaded = await importer(pathToFileURL(canonicalConfig).href);
|
|
577
|
+
raw = loaded?.default ?? {};
|
|
578
|
+
} catch {
|
|
579
|
+
throw failure();
|
|
580
|
+
}
|
|
581
|
+
if (!record(raw) || !validProjectConfig(raw))
|
|
582
|
+
throw failure();
|
|
583
|
+
const schemaExplicit = Object.hasOwn(raw, "schema") && raw.schema !== void 0;
|
|
584
|
+
return {
|
|
585
|
+
projectRoot,
|
|
586
|
+
schemaExplicit,
|
|
587
|
+
config: raw
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
function validProjectConfig(value) {
|
|
591
|
+
if (!record(value))
|
|
592
|
+
return false;
|
|
593
|
+
if (value.schema !== void 0 && typeof value.schema !== "string" && (!Array.isArray(value.schema) || value.schema.some((path) => typeof path !== "string")))
|
|
594
|
+
return false;
|
|
595
|
+
if (value.codegen !== void 0 && (!record(value.codegen) || value.codegen.serverOutDir !== void 0 && typeof value.codegen.serverOutDir !== "string" || value.codegen.authSchema !== void 0 && typeof value.codegen.authSchema !== "boolean" && (!record(value.codegen.authSchema) || value.codegen.authSchema.emitRelations !== void 0 && typeof value.codegen.authSchema.emitRelations !== "boolean")))
|
|
596
|
+
return false;
|
|
597
|
+
return true;
|
|
598
|
+
}
|
|
599
|
+
async function loadRoots(paths, projectRoot, missingAllowed, importer) {
|
|
600
|
+
const seenPaths = /* @__PURE__ */ new Set();
|
|
601
|
+
const roots = /* @__PURE__ */ new Set();
|
|
602
|
+
for (const path of paths) {
|
|
603
|
+
const canonical = existingSource(path, projectRoot, missingAllowed);
|
|
604
|
+
if (!canonical || seenPaths.has(canonical))
|
|
605
|
+
continue;
|
|
606
|
+
seenPaths.add(canonical);
|
|
607
|
+
let moduleValue;
|
|
608
|
+
try {
|
|
609
|
+
moduleValue = await importer(pathToFileURL(canonical).href);
|
|
610
|
+
} catch {
|
|
611
|
+
throw failure();
|
|
612
|
+
}
|
|
613
|
+
try {
|
|
614
|
+
if (!Object.hasOwn(moduleValue, "relations"))
|
|
615
|
+
continue;
|
|
616
|
+
const graph = moduleValue.relations;
|
|
617
|
+
if (!isRelationsGraph(graph))
|
|
618
|
+
throw failure();
|
|
619
|
+
roots.add(graph);
|
|
620
|
+
} catch {
|
|
621
|
+
throw failure();
|
|
622
|
+
}
|
|
623
|
+
if (roots.size > 1)
|
|
624
|
+
throw failure();
|
|
625
|
+
}
|
|
626
|
+
return roots.values().next().value;
|
|
627
|
+
}
|
|
628
|
+
function configuredPaths(projectRoot, sourceRoot, schema) {
|
|
629
|
+
if (Array.isArray(schema))
|
|
630
|
+
return schema.map((path) => resolve5(projectRoot, path));
|
|
631
|
+
if (typeof schema === "string" && schema.trim())
|
|
632
|
+
return [resolve5(projectRoot, schema)];
|
|
633
|
+
return [resolve5(sourceRoot, "schema.ts")];
|
|
634
|
+
}
|
|
635
|
+
function legacyAuthPaths(project, sourceRoot, primaryPaths) {
|
|
636
|
+
if (project.config?.codegen?.authSchema === false)
|
|
637
|
+
return [];
|
|
638
|
+
const codegenDir = project.config?.codegen?.serverOutDir?.trim() ? resolve5(project.projectRoot, project.config.codegen.serverOutDir.trim()) : resolve5(sourceRoot, "generated");
|
|
639
|
+
const migrated = existsSync3(resolve5(sourceRoot, "schema-auth.ts")) || existsSync3(resolve5(sourceRoot, "schema-auth.js")) || primaryPaths.some((path) => /(?:^|[\\/])schema-auth\.(?:ts|js)$/u.test(path));
|
|
640
|
+
if (migrated)
|
|
641
|
+
return [];
|
|
642
|
+
const primary = new Set(primaryPaths.map((path) => resolve5(path)));
|
|
643
|
+
return [resolve5(sourceRoot, "auth-schema.ts"), resolve5(codegenDir, "auth-schema.ts")].filter((path) => !primary.has(path) && existsSync3(path));
|
|
644
|
+
}
|
|
645
|
+
function resolveSourceRoot(entryPath) {
|
|
646
|
+
const resolved = resolve5(entryPath);
|
|
647
|
+
let base = resolved;
|
|
648
|
+
try {
|
|
649
|
+
if (!statSync2(resolved).isDirectory())
|
|
650
|
+
base = dirname2(resolved);
|
|
651
|
+
} catch {
|
|
652
|
+
base = dirname2(resolved);
|
|
653
|
+
}
|
|
654
|
+
if (basename(base) === "gencow-bc") {
|
|
655
|
+
const source = resolve5(dirname2(base), "gencow");
|
|
656
|
+
if (existsSync3(source))
|
|
657
|
+
return source;
|
|
658
|
+
}
|
|
659
|
+
return base;
|
|
660
|
+
}
|
|
661
|
+
function resolveProjectRoot(sourceRoot) {
|
|
662
|
+
let current = sourceRoot;
|
|
663
|
+
while (true) {
|
|
664
|
+
if (existsSync3(resolve5(current, "gencow.config.js")) || existsSync3(resolve5(current, "gencow.config.ts")) || existsSync3(resolve5(current, "package.json")))
|
|
665
|
+
return current;
|
|
666
|
+
const parent = dirname2(current);
|
|
667
|
+
if (parent === current)
|
|
668
|
+
return sourceRoot;
|
|
669
|
+
current = parent;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
function canonicalRoot(path) {
|
|
673
|
+
try {
|
|
674
|
+
return realpathSync(path);
|
|
675
|
+
} catch {
|
|
676
|
+
return resolve5(path);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
function canonicalSource(path, projectRoot) {
|
|
680
|
+
let canonical;
|
|
681
|
+
try {
|
|
682
|
+
canonical = realpathSync(path);
|
|
683
|
+
} catch {
|
|
684
|
+
throw failure();
|
|
685
|
+
}
|
|
686
|
+
if (!within(projectRoot, canonical))
|
|
687
|
+
throw failure();
|
|
688
|
+
return canonical;
|
|
689
|
+
}
|
|
690
|
+
function existingSource(path, projectRoot, missingAllowed) {
|
|
691
|
+
if (!existsSync3(path)) {
|
|
692
|
+
if (missingAllowed)
|
|
693
|
+
return null;
|
|
694
|
+
throw failure();
|
|
695
|
+
}
|
|
696
|
+
return canonicalSource(path, projectRoot);
|
|
697
|
+
}
|
|
698
|
+
function within(root, candidate) {
|
|
699
|
+
const fromRoot = relative2(root, candidate);
|
|
700
|
+
return fromRoot === "" || !isAbsolute2(fromRoot) && fromRoot !== ".." && !fromRoot.startsWith(`..${sep}`);
|
|
701
|
+
}
|
|
702
|
+
function record(value) {
|
|
703
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
704
|
+
}
|
|
705
|
+
function isRelationsGraph(value) {
|
|
706
|
+
if (!record(value))
|
|
707
|
+
return false;
|
|
708
|
+
const tableNames = new Set(Object.keys(value));
|
|
709
|
+
for (const [name, entry] of Object.entries(value)) {
|
|
710
|
+
const entryRecord = record(entry) ? entry : void 0;
|
|
711
|
+
const relations = entryRecord?.relations;
|
|
712
|
+
if (!entryRecord || entryRecord.name !== name || !is(entryRecord.table, Table) && !is(entryRecord.table, View) || !record(relations))
|
|
713
|
+
return false;
|
|
714
|
+
for (const [relationName, relation] of Object.entries(relations)) {
|
|
715
|
+
const relationRecord = record(relation) ? relation : void 0;
|
|
716
|
+
if (!relationRecord || !is(relationRecord, Relation) || relationRecord.fieldName !== relationName || relationRecord.sourceTable !== entryRecord.table || typeof relationRecord.targetTableName !== "string" || !tableNames.has(relationRecord.targetTableName))
|
|
717
|
+
return false;
|
|
718
|
+
const target = value[relationRecord.targetTableName];
|
|
719
|
+
if (!record(target) || target.table !== relationRecord.targetTable)
|
|
720
|
+
return false;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
return true;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// ../runtime/dist/app/loader.js
|
|
727
|
+
function defaultImporter(specifier) {
|
|
728
|
+
return import(specifier);
|
|
729
|
+
}
|
|
730
|
+
function defaultExport(moduleValue) {
|
|
731
|
+
if (!moduleValue || typeof moduleValue !== "object")
|
|
732
|
+
return void 0;
|
|
733
|
+
let candidate = moduleValue.default;
|
|
734
|
+
const seen = /* @__PURE__ */ new Set();
|
|
735
|
+
while (candidate && typeof candidate === "object" && "default" in candidate) {
|
|
736
|
+
if (seen.has(candidate))
|
|
737
|
+
throw loadError("Invalid app export.", "RUNTIME_APP_DECLARATION_INVALID", "declaration");
|
|
738
|
+
seen.add(candidate);
|
|
739
|
+
candidate = candidate.default;
|
|
740
|
+
}
|
|
741
|
+
return candidate && typeof candidate === "object" ? candidate : void 0;
|
|
742
|
+
}
|
|
743
|
+
function loadError(message, code, stage) {
|
|
744
|
+
const schedulerMissing = code === "RUNTIME_SCHEDULER_INTEGRATION_UNAVAILABLE";
|
|
745
|
+
const legacyHttpAction = code === "RUNTIME_HTTP_ACTION_UNSUPPORTED";
|
|
746
|
+
return new RuntimeLoadError(legacyHttpAction ? "Legacy httpAction declarations are not supported by this Runtime." : message, {
|
|
747
|
+
code,
|
|
748
|
+
stage,
|
|
749
|
+
servingStarted: false,
|
|
750
|
+
retryable: false,
|
|
751
|
+
retryPrecondition: schedulerMissing ? "Restart only after the trusted scheduler/cron adapter owner provides the required integration; inspect any earlier application initialization effects first." : legacyHttpAction ? "Replace legacy httpAction declarations with supported defineApi.httpRoutes declarations; inspect earlier module initialization effects before restarting." : stage === "load" ? "Correct the application entry before restarting this Runtime generation." : "Correct the application declaration before restarting this Runtime generation.",
|
|
752
|
+
nextAction: schedulerMissing ? "The selected Runtime does not provide the required scheduler/cron integration. Restore that capability through its trusted owner before restarting. Do not rewrite tenant declarations or use a local hosted fallback; inspect earlier initialization effects." : legacyHttpAction ? "Replace legacy httpAction registrations with defineApi({ httpRoutes: ... }); verify earlier module initialization effects, then restart." : stage === "load" ? "Correct the app entry and restart the Runtime generation." : code === "RUNTIME_APP_EMPTY" ? "Declare at least one procedure, workflow, HTTP operation, cron, or realtime declaration." : "Export a supported declaration or correct the legacy declaration.",
|
|
753
|
+
capability: "application",
|
|
754
|
+
// Import/declaration evaluation may already have performed application effects.
|
|
755
|
+
dataImpact: "unknown",
|
|
756
|
+
correlationId: randomUUID4()
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
function createRuntimeApplicationLoader(params) {
|
|
760
|
+
return createApplicationLoader(params, false);
|
|
761
|
+
}
|
|
762
|
+
function createLocalRuntimeApplicationLoader(params) {
|
|
763
|
+
return createApplicationLoader(params, true);
|
|
764
|
+
}
|
|
765
|
+
function createApplicationLoader(params, local) {
|
|
766
|
+
let result;
|
|
767
|
+
return {
|
|
768
|
+
loadApplicationOnce() {
|
|
769
|
+
result ??= loadApplicationForGeneration(params, local);
|
|
770
|
+
return result;
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
async function loadApplicationForGeneration(params, local) {
|
|
775
|
+
const specifier = pathToFileURL2(params.entryPath).href;
|
|
776
|
+
let evaluated;
|
|
777
|
+
let legacyCrons;
|
|
778
|
+
let relations;
|
|
779
|
+
try {
|
|
780
|
+
evaluated = await evaluateRuntimeApp(async () => {
|
|
781
|
+
relations = await loadRuntimeApplicationRelations({
|
|
782
|
+
entryPath: params.entryPath,
|
|
783
|
+
importModule: params.importModule ?? defaultImporter,
|
|
784
|
+
...params.project ? { project: params.project } : {},
|
|
785
|
+
...params.importRelationsModule ? { importRelationsModule: params.importRelationsModule } : {}
|
|
786
|
+
});
|
|
787
|
+
const moduleValue = await (params.importModule ?? defaultImporter)(specifier);
|
|
788
|
+
const api = defaultExport(moduleValue);
|
|
789
|
+
if (!api || !("crons" in api)) {
|
|
790
|
+
const directory = dirname3(params.entryPath);
|
|
791
|
+
const path = [resolve6(directory, "crons.ts"), resolve6(directory, "crons.js")].find(existsSync4);
|
|
792
|
+
if (path) {
|
|
793
|
+
try {
|
|
794
|
+
const legacy = await (params.importModule ?? defaultImporter)(pathToFileURL2(path).href);
|
|
795
|
+
legacyCrons = defaultExport(legacy);
|
|
796
|
+
} catch {
|
|
797
|
+
throw loadError("Unable to load the cron module.", "RUNTIME_APP_LOAD_FAILED", "load");
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
return moduleValue;
|
|
802
|
+
});
|
|
803
|
+
} catch (error) {
|
|
804
|
+
if (error instanceof RuntimeLoadError)
|
|
805
|
+
throw error;
|
|
806
|
+
const diagnostic = runtimeDiagnostic(error);
|
|
807
|
+
if (diagnostic)
|
|
808
|
+
throw new RuntimeLoadError("The Runtime application schema is not supported.", diagnostic);
|
|
809
|
+
throw loadError("Unable to load the Runtime application.", "RUNTIME_APP_LOAD_FAILED", "load");
|
|
810
|
+
}
|
|
811
|
+
return buildLoadedApplication(evaluated.moduleValue, params.entryPath, evaluated.registrations, legacyCrons, relations, local ? assertLocalWorkflowHostContract : void 0);
|
|
812
|
+
}
|
|
813
|
+
async function loadRuntimeApplication(params) {
|
|
814
|
+
return createRuntimeApplicationLoader(params).loadApplicationOnce();
|
|
815
|
+
}
|
|
816
|
+
function loadRuntimeApplicationFromModule(moduleValue, modulePath, legacyCrons, legacyRealtime, legacyOperations) {
|
|
817
|
+
const registrations = currentRuntimeLegacyRegistrations();
|
|
818
|
+
return buildLoadedApplication(moduleValue, modulePath, {
|
|
819
|
+
...registrations,
|
|
820
|
+
...legacyOperations !== void 0 ? { legacy: legacyOperations ?? void 0 } : {},
|
|
821
|
+
realtime: legacyRealtime ? "queries" in legacyRealtime ? legacyRealtime : { channels: legacyRealtime.channels, queries: [...legacyRealtime.subscriptions.values()] } : { channels: [], queries: [] }
|
|
822
|
+
}, legacyCrons);
|
|
823
|
+
}
|
|
824
|
+
function buildLoadedApplication(moduleValue, modulePath, registrations, legacyCrons, relations, assertHostContract) {
|
|
825
|
+
try {
|
|
826
|
+
const api = defaultExport(moduleValue);
|
|
827
|
+
assertSupportedApiDeclaration(api, { __gencow_httpActionRegistry: [...registrations.httpActions] });
|
|
828
|
+
const { operations, workflows } = registerRuntimeWorkflows({
|
|
829
|
+
api,
|
|
830
|
+
operations: collectRuntimeOperations(api, registrations.legacy),
|
|
831
|
+
legacySource: registrations.legacy,
|
|
832
|
+
legacyBridge: registrations.workflowBridge,
|
|
833
|
+
legacyDefinitions: registrations.workflows,
|
|
834
|
+
assertHostContract
|
|
835
|
+
});
|
|
836
|
+
const selected = collectRuntimeRealtimeCatalog(api, registrations.realtime, operations.legacy?.queries);
|
|
837
|
+
const inventory = collectRuntimeRealtimeInventory(api, {
|
|
838
|
+
channels: registrations.realtime.channels,
|
|
839
|
+
subscriptions: new Map(registrations.realtime.queries.map((definition) => [definition.name, definition]))
|
|
840
|
+
});
|
|
841
|
+
const source = api && "crons" in api ? api.crons : legacyCrons;
|
|
842
|
+
const crons = source === void 0 ? Object.freeze([]) : snapshotCronDeclarations(source, operations);
|
|
843
|
+
const realtime = Object.freeze({
|
|
844
|
+
...selected,
|
|
845
|
+
channels: Object.freeze({ ...selected.channels, ...inventory.channels }),
|
|
846
|
+
subscriptions: inventory.subscriptions
|
|
847
|
+
});
|
|
848
|
+
if (!hasOperations(operations) && realtime.channels.size === 0 && realtime.queries.size === 0 && crons.length === 0)
|
|
849
|
+
throw loadError("No supported operations were declared.", "RUNTIME_APP_EMPTY", "declaration");
|
|
850
|
+
const loaded = Object.freeze({
|
|
851
|
+
operations,
|
|
852
|
+
workflows,
|
|
853
|
+
realtime,
|
|
854
|
+
crons,
|
|
855
|
+
...relations ? { relations } : {},
|
|
856
|
+
...modulePath ? { modulePath } : {}
|
|
857
|
+
});
|
|
858
|
+
markLoaderProducedRuntimeApplication(loaded);
|
|
859
|
+
return loaded;
|
|
860
|
+
} catch (error) {
|
|
861
|
+
if (error instanceof RuntimeLoadError)
|
|
862
|
+
throw error;
|
|
863
|
+
if (runtimeDiagnostic(error))
|
|
864
|
+
throw error;
|
|
865
|
+
if (error instanceof RuntimeRealtimeDeclarationError) {
|
|
866
|
+
throw new RuntimeLoadError("The Runtime realtime declaration is not supported.", {
|
|
867
|
+
code: error.code,
|
|
868
|
+
stage: "declaration",
|
|
869
|
+
capability: "realtime",
|
|
870
|
+
correlationId: randomUUID4(),
|
|
871
|
+
servingStarted: false,
|
|
872
|
+
dataImpact: "none",
|
|
873
|
+
retryable: false,
|
|
874
|
+
retryPrecondition: "Correct realtime declarations before restarting this generation.",
|
|
875
|
+
nextAction: "Correct realtime declarations and rerun codegen/build before restarting."
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
const code = error instanceof Error && error.message === "RUNTIME_FEATURE_UNSUPPORTED: scheduler" ? "RUNTIME_SCHEDULER_INTEGRATION_UNAVAILABLE" : error instanceof Error && error.message === "RUNTIME_HTTP_ACTION_UNSUPPORTED" ? "RUNTIME_HTTP_ACTION_UNSUPPORTED" : "RUNTIME_APP_DECLARATION_INVALID";
|
|
879
|
+
throw loadError(code === "RUNTIME_SCHEDULER_INTEGRATION_UNAVAILABLE" ? "Scheduler/cron execution is unavailable in the selected Runtime." : code === "RUNTIME_HTTP_ACTION_UNSUPPORTED" ? "Legacy httpAction declarations are not supported by this Runtime." : "The Runtime application declaration is not supported.", code, "declaration");
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
// ../runtime/dist/app/console-runtime-logging.js
|
|
884
|
+
function attribute(record2, key) {
|
|
885
|
+
return record2.attributes[key];
|
|
886
|
+
}
|
|
887
|
+
function databaseLabel(adapters) {
|
|
888
|
+
if (!Array.isArray(adapters))
|
|
889
|
+
return "No database";
|
|
890
|
+
if (adapters.includes("database:pglite"))
|
|
891
|
+
return "PGlite";
|
|
892
|
+
if (adapters.includes("database:postgres"))
|
|
893
|
+
return "PostgreSQL";
|
|
894
|
+
return "No database";
|
|
895
|
+
}
|
|
896
|
+
function targetLabel(target) {
|
|
897
|
+
if (target === "node")
|
|
898
|
+
return "Node.js";
|
|
899
|
+
if (target === "bun")
|
|
900
|
+
return "Bun";
|
|
901
|
+
return "Runtime";
|
|
902
|
+
}
|
|
903
|
+
function safeText(value) {
|
|
904
|
+
return value.replace(/[\p{Cc}\p{Cf}\p{Cs}\u2028\u2029]/gu, (character) => {
|
|
905
|
+
const code = character.codePointAt(0);
|
|
906
|
+
return code <= 65535 ? `\\u${code.toString(16).padStart(4, "0")}` : `\\u{${code.toString(16)}}`;
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
function formatStartupBanner(record2) {
|
|
910
|
+
const width = 58;
|
|
911
|
+
const pad = (value) => ` ${value.padEnd(width)}`;
|
|
912
|
+
const line = "\u2550".repeat(width + 2);
|
|
913
|
+
return [
|
|
914
|
+
"",
|
|
915
|
+
`\u2554${line}\u2557`,
|
|
916
|
+
`\u2551${pad("\u{1F680} Gencow Runtime Server Running")}\u2551`,
|
|
917
|
+
`\u2551${pad("")}\u2551`,
|
|
918
|
+
`\u2551${pad(`API: http://localhost:${formatValue(attribute(record2, "runtime.port"))}`)}\u2551`,
|
|
919
|
+
`\u2551${pad("")}\u2551`,
|
|
920
|
+
`\u2551${pad(`Stack: ${targetLabel(attribute(record2, "runtime.target"))} + Hono + ${databaseLabel(attribute(record2, "runtime.adapters"))}`)}\u2551`,
|
|
921
|
+
`\u255A${line}\u255D`,
|
|
922
|
+
""
|
|
923
|
+
].join("\n");
|
|
924
|
+
}
|
|
925
|
+
function formatValue(value) {
|
|
926
|
+
return safeText(Array.isArray(value) ? value.join(",") : String(value));
|
|
927
|
+
}
|
|
928
|
+
function formatRecord(record2) {
|
|
929
|
+
const attributes = Object.entries(record2.attributes).map(([key, value]) => `${safeText(key)}=${formatValue(value)}`).join(" ");
|
|
930
|
+
return `[gencow] ${safeText(record2.level.toUpperCase())} ${safeText(record2.event)}${attributes ? ` ${attributes}` : ""}`;
|
|
931
|
+
}
|
|
932
|
+
function createConsoleRuntimeLogSink(output) {
|
|
933
|
+
return {
|
|
934
|
+
emit(record2) {
|
|
935
|
+
if (record2.event === "runtime.listener.ready") {
|
|
936
|
+
output.write(formatStartupBanner(record2));
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
if (record2.event === "runtime.shutdown.received") {
|
|
940
|
+
output.write(`[gencow] Runtime ${formatValue(attribute(record2, "runtime.signal"))} received \u2014 shutting down...`);
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
const write = record2.level === "error" ? output.writeError ?? output.write : output.write;
|
|
944
|
+
write(formatRecord(record2));
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
export {
|
|
950
|
+
resolveServerCodegenDirAbs,
|
|
951
|
+
resolveAuthSchemaPaths,
|
|
952
|
+
createRuntimeApplicationLoader,
|
|
953
|
+
createLocalRuntimeApplicationLoader,
|
|
954
|
+
loadRuntimeApplication,
|
|
955
|
+
loadRuntimeApplicationFromModule,
|
|
956
|
+
createConsoleRuntimeLogSink
|
|
957
|
+
};
|