refactor: named exports (run + descriptor), remove build pipeline

- Bundle contract: export const run + export const descriptor (no default export)
- add only accepts .esm.js, extracts descriptor via dynamic import → .yaml
- Removed: build-pipeline, generate-types, json-schema-to-ts
- Worker loads mod.run instead of mod.default
- Biome: no more noDefaultExport overrides for bundles
- 62 tests pass, biome clean

Closes #8
小橘 <xiaoju@shazhou.work>
This commit is contained in:
2026-05-06 06:39:15 +00:00
parent e670047e6a
commit 3467b772e6
27 changed files with 597 additions and 770 deletions
+4 -7
View File
@@ -295,16 +295,13 @@ async function main(): Promise<void> {
// Dynamic import required: user bundle path resolved at runtime
const modUnknown: unknown = await import(pathToFileURL(bundlePath).href);
const modRec = modUnknown as Record<string, unknown>;
const defaultExport = modRec.default;
if (!isWorkflowFnLike(defaultExport)) {
bootLog(
"T4BW9YJX",
"workflow bundle default export must be a function (AsyncGenerator workflow)",
);
const runExport = modRec.run;
if (!isWorkflowFnLike(runExport)) {
bootLog("T4BW9YJX", "workflow bundle must export run as a function (AsyncGenerator workflow)");
process.exit(2);
return;
}
const workflowFn = defaultExport;
const workflowFn = runExport;
const threads = new Map<string, ThreadHandle>();
let activeThreads = 0;