33// (CL-6405) generalized to any catalog entry with a source package
44// under `workflows/<name>` (CL-7073), not just `code-review`.
55//
6- // HONEST GAP (CL-7585): the only build step this module ever adapted —
7- // the deleted seeding package's per-workflow `buildJson` closures (each
6+ // Runtime wiring (CL-7585): the per-workflow `buildJson` closures (each
87// one closing over its workflow package's trigger address and turn
9- // timeouts) — has no native home yet. Nothing in `apps/hub` may rebuild
10- // it (the lane fence), and rebuilding it inside the instantiate path
11- // would re-own seed behavior under a new name, so this builder answers
12- // `undefined` for every asset name. The route (`./template-block-routes.ts`) turns that into
13- // its existing 404 — no silent no-op, no fake deploy. The new home for
14- // the per-workflow builders is a follow-up lane's call (sibling
15- // template/instantiate owner); when it lands, it reimplements this
16- // builder against the tenant's real, ordered inference preferences and
17- // these 404s become deploys again — see the gap tests in
18- // `./template-block-routes.test.ts`.
8+ // timeouts) live on `@workbench/onboarding`'s tenant-seed
9+ // `CATALOG_WORKFLOWS` entries, reached here through
10+ // `deployableCatalogWorkflow` — the hub names no builder of its own, so
11+ // the catalog's deployable set and the block sources served here can
12+ // never drift apart silently. `assistant` (seeded, never redeployed
13+ // here) and `heartbeat` (test-only, never deployed onto a real bench)
14+ // are outside `CATALOG_WORKFLOWS`, so they answer `undefined` here, same
15+ // as any name outside the catalog entirely — a route answering
16+ // `undefined` as a 404 is the honest statement of that.
1917//
20- // Server-only, on purpose: a future builder pulls in its workflow
21- // package (e.g. `@corbits/granola-call-workflow`) and with it
22- // `@intx/agent`/`@intx/workflow` — the heavy graph `./templates.ts`
23- // keeps every manifest consumer off. Only `./template-block-routes.ts`
18+ // Server-only, on purpose: each `buildJson` closure pulls in its
19+ // workflow package (e.g. `@corbits/granola-call-workflow`) and with it
20+ // `@intx/agent`/`@intx/workflow`. Only `./template-block-routes.ts`
2421// (mounted in `apps/hub`) imports this; it is deliberately not
2522// re-exported from the package root.
23+ import { deployableCatalogWorkflow } from "@workbench/onboarding/tenant-seed" ;
2624
2725export interface BlockWorkflowBuildInput {
2826 readonly tenantDomain : string ;
@@ -40,16 +38,25 @@ export interface BlockWorkflowSource {
4038
4139/**
4240 * The serialized source-form definition for one catalog workflow — or
43- * `undefined`, for every asset name, until the per-workflow builders get
44- * their new home (see above). `assistant` (seeded, never redeployed
45- * here) and `heartbeat` (test-only, never deployed onto a real bench)
46- * always answer `undefined`, same as any name outside the catalog
47- * entirely. A route answering `undefined` as a 404 is the honest
48- * statement of that gap.
41+ * `undefined` for `assistant`, `heartbeat`, and any name outside the
42+ * catalog. `buildJson` is a required field on every `CATALOG_WORKFLOWS`
43+ * entry, so a catalog name always answers here: the deployable set and
44+ * the served sources cannot drift apart silently.
4945 */
5046export function buildBlockWorkflowSource (
51- _assetName : string ,
52- _input : BlockWorkflowBuildInput ,
47+ assetName : string ,
48+ input : BlockWorkflowBuildInput ,
5349) : BlockWorkflowSource | undefined {
54- return undefined ;
50+ const workflow = deployableCatalogWorkflow ( assetName ) ;
51+ if ( workflow === undefined ) {
52+ return undefined ;
53+ }
54+ return {
55+ assetName : workflow . assetName ,
56+ displayName : workflow . displayName ,
57+ workflowJson : workflow . buildJson (
58+ input . tenantDomain ,
59+ input . inferencePreferences ,
60+ ) ,
61+ } ;
5562}
0 commit comments