@fabrika/builder 0.9.0-dev.1 → 0.9.0-dev.10
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/README.md +1 -1
- package/cli/src/inject-skills.ts +2 -2
- package/cli/src/skeletons.ts +2 -2
- package/daemon/src/handlers.ts +1 -1
- package/daemon/src/platform-remote.ts +1 -1
- package/decisions/README.md +20 -20
- package/decisions/patterns/app-deploy.md +6 -6
- package/decisions/patterns/{vozka-app-deploy.md → fabrika-app-deploy.md} +24 -24
- package/decisions/patterns/single-worker-spa.md +2 -2
- package/decisions/patterns/typed-worker-rpc.md +3 -3
- package/decisions/patterns/zerops-control-deploy.md +1 -1
- package/decisions/technologies/buzola.md +2 -2
- package/decisions/technologies/cloudflare-access.md +5 -5
- package/decisions/technologies/cloudflare.md +1 -1
- package/decisions/technologies/contember.md +1 -1
- package/decisions/technologies/{vozka.md → fabrika-control.md} +35 -30
- package/decisions/technologies/{propustka.md → fabrika-iam.md} +17 -17
- package/decisions/technologies/lopata.md +1 -1
- package/decisions/technologies/oblaka.md +6 -6
- package/decisions/technologies/workers-ai.md +1 -1
- package/decisions/technologies/wrangler.md +2 -2
- package/decisions/technologies/zerops-fabrika-auth.md +2 -2
- package/decisions/technologies/zerops-platform.md +4 -3
- package/package.json +12 -11
- package/skill/SKILL.md +1 -1
- package/skill/gates/tech.jsx +1 -1
- package/stacks/README.md +1 -1
- package/stacks/cf-internal-app.md +22 -22
- package/types/cli/src/bin.d.ts +3 -0
- package/types/cli/src/build-status.d.ts +20 -0
- package/types/cli/src/catalog.d.ts +9 -0
- package/types/cli/src/commands/advance.d.ts +1 -0
- package/types/cli/src/commands/build.d.ts +1 -0
- package/types/cli/src/commands/ensure-daemon.d.ts +1 -0
- package/types/cli/src/commands/gate.d.ts +1 -0
- package/types/cli/src/commands/induce.d.ts +1 -0
- package/types/cli/src/commands/init.d.ts +1 -0
- package/types/cli/src/commands/next.d.ts +1 -0
- package/types/cli/src/commands/platform.d.ts +2 -0
- package/types/cli/src/config.d.ts +16 -0
- package/types/cli/src/context.d.ts +13 -0
- package/types/cli/src/daemon-client.d.ts +36 -0
- package/types/cli/src/daemon-lifecycle.d.ts +16 -0
- package/types/cli/src/derive.d.ts +17 -0
- package/types/cli/src/errors.d.ts +2 -0
- package/types/cli/src/index.d.ts +7 -0
- package/types/cli/src/induce.d.ts +16 -0
- package/types/cli/src/inject-skills.d.ts +23 -0
- package/types/cli/src/issues.d.ts +12 -0
- package/types/cli/src/layout.d.ts +21 -0
- package/types/cli/src/packet.d.ts +32 -0
- package/types/cli/src/phase-state.d.ts +6 -0
- package/types/cli/src/platform-client.d.ts +24 -0
- package/types/cli/src/skeletons.d.ts +11 -0
- package/types/daemon/src/admission.d.ts +1 -0
- package/types/daemon/src/bin.d.ts +2 -0
- package/types/daemon/src/build-stream.d.ts +14 -0
- package/types/daemon/src/handlers.d.ts +15 -0
- package/types/daemon/src/index.d.ts +23 -0
- package/types/daemon/src/paths.d.ts +10 -0
- package/types/daemon/src/phases.d.ts +21 -0
- package/types/daemon/src/platform-compiler.d.ts +1 -0
- package/types/daemon/src/platform-remote.d.ts +309 -0
- package/types/daemon/src/platform-routes.d.ts +3 -0
- package/types/daemon/src/platform-source.d.ts +7 -0
- package/types/daemon/src/platform-storage.d.ts +38 -0
- package/types/daemon/src/platform.d.ts +43 -0
- package/types/daemon/src/static.d.ts +2 -0
- package/types/index.d.ts +2 -0
- package/types/shared/index.d.ts +2324 -0
- package/types/shared/phases.d.ts +25 -0
- package/types/shared/urls.d.ts +4 -0
- package/ui/dist/assets/client.mh3w1dvc.js +214 -0
- package/ui/dist/index.html +1 -1
- package/ui/dist/assets/client.j37h210g.js +0 -214
|
@@ -44,7 +44,7 @@ the whole stack run locally with **no CF credentials**.
|
|
|
44
44
|
- `CF=1` can swap lopata → `@cloudflare/vite-plugin` (real workerd) in stacks that
|
|
45
45
|
explicitly implement that seam. The two share the `cf-dev-runtime` slot.
|
|
46
46
|
- Local D1 under `.lopata/d1/*.sqlite`; CLI `bunx lopata d1 migrations apply` / `execute DB --file …`.
|
|
47
|
-
- Generate `wrangler.jsonc` from oblaka/the shared
|
|
47
|
+
- Generate `wrangler.jsonc` from oblaka/the shared Fabrika Control resource builder before
|
|
48
48
|
starting lopata. Never maintain local bindings in a second hand-written config.
|
|
49
49
|
|
|
50
50
|
## Relationships — why
|
|
@@ -12,8 +12,8 @@ status: wip
|
|
|
12
12
|
sources:
|
|
13
13
|
- where: "oblaka (repo) + `oblaka-iac` on npm (installed types)"
|
|
14
14
|
read: "The CURRENT binding API, programmatic deploy surface and how `bunx oblaka <file>` generates wrangler.jsonc. Read the live types — do not guess."
|
|
15
|
-
- where: "
|
|
16
|
-
read: "How
|
|
15
|
+
- where: "the predecessor control plane's packages/core + its config package"
|
|
16
|
+
read: "How Fabrika Control materializes the same oblaka resource graph for production while an app keeps a thin local-dev shim."
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
# oblaka
|
|
@@ -23,23 +23,23 @@ sources:
|
|
|
23
23
|
A TypeScript DSL for Cloudflare IaC: define the Worker + its bindings in
|
|
24
24
|
`oblaka.ts`, run `bunx oblaka oblaka.ts` to **generate `wrangler.jsonc`**. One typed
|
|
25
25
|
source of truth for Workers, D1, KV, R2, Queues, DO, Analytics Engine and cron.
|
|
26
|
-
|
|
26
|
+
Fabrika Control uses oblaka programmatically for production provisioning; standalone
|
|
27
27
|
`oblaka.ts` remains useful as the local lopata config shim.
|
|
28
28
|
|
|
29
29
|
## When & why to use
|
|
30
30
|
|
|
31
31
|
- Any CF stack — declare bindings as code instead of hand-writing `wrangler.jsonc`.
|
|
32
|
-
- A
|
|
32
|
+
- A Fabrika Control app — the resource builder in `fabrika.config.ts` is still an oblaka
|
|
33
33
|
`Worker`; reuse it from the local shim rather than duplicating the graph.
|
|
34
34
|
|
|
35
35
|
## Impacts & gotchas
|
|
36
36
|
|
|
37
37
|
- **`wrangler.jsonc` is GENERATED — never hand-edit it.** Change `oblaka.ts` and regenerate.
|
|
38
38
|
- Standalone/local shape: `define(({ env }) => buildWorker({ env, domain: undefined }))`,
|
|
39
|
-
where `buildWorker` is exported from `
|
|
39
|
+
where `buildWorker` is exported from `fabrika.config.ts`. For a non-Fabrika app,
|
|
40
40
|
build the `Worker` inline as before.
|
|
41
41
|
- **Verify every binding constructor against the installed `oblaka-iac` types** — it's WIP and a stack may use bindings (Queue consumer, AE, cron) the constructor surface for which moves. If a binding type is missing, generate the wrangler entry per Cloudflare docs.
|
|
42
|
-
-
|
|
42
|
+
- `@fabrika/provider-cloudflare` and oblaka publish raw TypeScript in some versions; if the app's
|
|
43
43
|
main `tsc` excludes config files, validate them by actually materializing the
|
|
44
44
|
config and running a wrangler dry-run/config check.
|
|
45
45
|
|
|
@@ -48,7 +48,7 @@ and AI adds a summary, prioritization or explanation afterwards.
|
|
|
48
48
|
result first; store AI status/error separately and retry off the request path.
|
|
49
49
|
- Long inference belongs in `queue()` or `scheduled()`, not an HTTP request's
|
|
50
50
|
critical path.
|
|
51
|
-
- If
|
|
51
|
+
- If `@fabrika/provider-cloudflare`/oblaka lacks a first-class Workers AI resource, use a small
|
|
52
52
|
structural `Bindable` that emits `{ ai: { binding } }`; keep that workaround
|
|
53
53
|
isolated and remove it once the IaC package exposes a supported primitive.
|
|
54
54
|
|
|
@@ -20,7 +20,7 @@ sources:
|
|
|
20
20
|
|
|
21
21
|
Cloudflare's official CLI: local D1 lifecycle (`wrangler d1 migrations apply DB
|
|
22
22
|
--local`, `wrangler d1 execute DB --local --file …`), `wrangler dev` (workerd), and
|
|
23
|
-
`wrangler deploy`. Used directly on the real-CF path and internally by
|
|
23
|
+
`wrangler deploy`. Used directly on the real-CF path and internally by Fabrika Control for
|
|
24
24
|
remote D1 migrations, Worker deploy and secret sync; the local-first path uses
|
|
25
25
|
the `lopata` CLI instead.
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ the `lopata` CLI instead.
|
|
|
28
28
|
|
|
29
29
|
- The real-CF dev/deploy path (alongside `cloudflare-vite-plugin`).
|
|
30
30
|
- Local D1 migrations/seeds when not using `lopata d1`.
|
|
31
|
-
- A
|
|
31
|
+
- A Fabrika-managed app still includes a compatible wrangler dependency because
|
|
32
32
|
the deploy engine invokes its binary against the materialized config.
|
|
33
33
|
|
|
34
34
|
## Impacts & gotchas
|
|
@@ -6,8 +6,8 @@ slot: authz
|
|
|
6
6
|
provides: [authentication, authorization, proxy-enforcement]
|
|
7
7
|
requires: [zerops-platform]
|
|
8
8
|
recommends: []
|
|
9
|
-
conflicts: [
|
|
10
|
-
npm: ["@fabrika/app@0.9.0-dev.
|
|
9
|
+
conflicts: [fabrika-iam, cloudflare-access, auth-password-kv]
|
|
10
|
+
npm: ["@fabrika/app@0.9.0-dev.10", "@fabrika/db@0.9.0-dev.10", "zod@^3.25.76"]
|
|
11
11
|
status: wip
|
|
12
12
|
sources:
|
|
13
13
|
- where: "packages/app/skill/SKILL.md in fabrika-platform (the `fabrika-app` skill)"
|
|
@@ -7,7 +7,7 @@ provides: [platform, private-services, managed-deploy]
|
|
|
7
7
|
requires: [bun, postgres]
|
|
8
8
|
recommends: []
|
|
9
9
|
conflicts: [cloudflare]
|
|
10
|
-
npm: ["@fabrika/provider-zerops@0.9.0-dev.
|
|
10
|
+
npm: ["@fabrika/provider-zerops@0.9.0-dev.10", "@fabrika/app@0.9.0-dev.10", "@fabrika/cli@0.9.0-dev.10"]
|
|
11
11
|
status: wip
|
|
12
12
|
sources:
|
|
13
13
|
- where: "examples/zerops-app/fabrika.config.ts + zerops.yaml in fabrika-platform"
|
|
@@ -43,12 +43,13 @@ truth: stable `id`, `schema`, `pipeline` and `target` with `platform: 'zerops'`.
|
|
|
43
43
|
`zerops.yaml` keeps only `setup`, `build.base`, `build.os` and the SPA's
|
|
44
44
|
`build.buildCommands`; every other key is refused. The platform generates the
|
|
45
45
|
rest: a frozen install, the application's `bun test`, a reinstall, the
|
|
46
|
-
generated entrypoint, `fabrika-check`,
|
|
46
|
+
generated entrypoint, `tsc` (with `web/`), `fabrika-check`, the deploy gate on the contract's
|
|
47
47
|
health path, and the `run` section. Its init commands run `fabrika db migrate`,
|
|
48
48
|
`fabrika db codegen --verify` and `fabrika db test-isolation`, then its
|
|
49
49
|
start script runs `fabrika/entry.generated.ts`; each `c.cron` job becomes a crontab entry
|
|
50
50
|
`fabrika job run <name>`. The build has no database, so the database tests skip
|
|
51
|
-
there
|
|
51
|
+
there; only the generated isolation tests run again, at container start. Run
|
|
52
|
+
the rest against a test database before you push.
|
|
52
53
|
- Commit the Bun lockfile at the app repository root, and commit what
|
|
53
54
|
`fabrika db codegen` and `fabrika db test-scaffold` write. Never edit a
|
|
54
55
|
generated file (`fabrika/entry.generated.ts`, `src/db/schema.generated.ts`, the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/builder",
|
|
3
|
-
"version": "0.9.0-dev.
|
|
3
|
+
"version": "0.9.0-dev.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first guided application design and agent-assisted implementation.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,17 +25,18 @@
|
|
|
25
25
|
"stacks",
|
|
26
26
|
"README.md",
|
|
27
27
|
"BUILD-CONTRACT.md",
|
|
28
|
-
"LICENSE"
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"types"
|
|
29
30
|
],
|
|
30
31
|
"exports": {
|
|
31
32
|
".": {
|
|
32
33
|
"bun": "./index.ts",
|
|
33
|
-
"types": "./index.ts",
|
|
34
|
+
"types": "./types/index.d.ts",
|
|
34
35
|
"default": "./index.ts"
|
|
35
36
|
},
|
|
36
37
|
"./daemon": {
|
|
37
38
|
"bun": "./daemon/src/index.ts",
|
|
38
|
-
"types": "./daemon/src/index.ts",
|
|
39
|
+
"types": "./types/daemon/src/index.d.ts",
|
|
39
40
|
"default": "./daemon/src/index.ts"
|
|
40
41
|
}
|
|
41
42
|
},
|
|
@@ -47,13 +48,13 @@
|
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"zod": "^3.25.76",
|
|
50
|
-
"@fabrika/annotations": "0.9.0-dev.
|
|
51
|
-
"@fabrika/app": "0.9.0-dev.
|
|
52
|
-
"@fabrika/auth-core": "0.9.0-dev.
|
|
53
|
-
"@fabrika/canvas-kernel": "0.9.0-dev.
|
|
54
|
-
"@fabrika/control-contract": "0.9.0-dev.
|
|
55
|
-
"@fabrika/daemon-kit": "0.9.0-dev.
|
|
56
|
-
"@fabrika/provider-zerops": "0.9.0-dev.
|
|
51
|
+
"@fabrika/annotations": "0.9.0-dev.10",
|
|
52
|
+
"@fabrika/app": "0.9.0-dev.10",
|
|
53
|
+
"@fabrika/auth-core": "0.9.0-dev.10",
|
|
54
|
+
"@fabrika/canvas-kernel": "0.9.0-dev.10",
|
|
55
|
+
"@fabrika/control-contract": "0.9.0-dev.10",
|
|
56
|
+
"@fabrika/daemon-kit": "0.9.0-dev.10",
|
|
57
|
+
"@fabrika/provider-zerops": "0.9.0-dev.10",
|
|
57
58
|
"preact": "^10.25.0"
|
|
58
59
|
}
|
|
59
60
|
}
|
package/skill/SKILL.md
CHANGED
|
@@ -38,7 +38,7 @@ ensure daemon → fabrika builder next → do packet work → gate → advance
|
|
|
38
38
|
Claude and Codex repo support by default, starts the daemon, and opens the
|
|
39
39
|
dashboard. Use `--agent claude` or `--agent codex` only when the user wants
|
|
40
40
|
a single host. When the brief explicitly calls for a full internal
|
|
41
|
-
Cloudflare app with native
|
|
41
|
+
Cloudflare app with native Fabrika IAM login and Fabrika Control deployment, select
|
|
42
42
|
`--profile cf-internal-app` instead of the lightweight default.
|
|
43
43
|
- Otherwise run `bunx fabrika builder ensure-daemon`.
|
|
44
44
|
|
package/skill/gates/tech.jsx
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
}
|
|
5
5
|
<Section title="Phase 4 — Tech & scaffold decision">
|
|
6
6
|
<Item id="stack" label="Stack preset" badge="stack" badgeVariant="info">
|
|
7
|
-
e.g. cf-lightweight; for a
|
|
7
|
+
e.g. cf-lightweight; for a Fabrika Control/IAM internal app use cf-internal-app.
|
|
8
8
|
</Item>
|
|
9
9
|
<Item id="data" label="Data layer" badge="data" badgeVariant="neutral">
|
|
10
10
|
Where state lives and how it is seeded for tests.
|
package/stacks/README.md
CHANGED
|
@@ -40,7 +40,7 @@ is a **starting point**, not a lock-in — add/drop decisions freely.
|
|
|
40
40
|
|
|
41
41
|
- **`cf-lightweight`** — buzola SPA + lopata + D1, **no SSR**. The preferred default and simplest end-to-end fabrika stack (bun/lopata path).
|
|
42
42
|
- **`cf-internal-app`** — the full internal-app stack: Buzola SPA +
|
|
43
|
-
Worker API, D1/R2/Queue/Cron/Workers AI, native
|
|
43
|
+
Worker API, D1/R2/Queue/Cron/Workers AI, native Fabrika IAM login and Fabrika Control deploy.
|
|
44
44
|
- **`cf-fat`** — RRv7 **SSR** + vite + `@cloudflare/vite-plugin` (workerd) + the full CF primitive set (D1/KV/R2/Queue/AE/Cron); counts behind `count-store` so it stays locally testable.
|
|
45
45
|
- **`contember-app`** — a Contember (Postgres GraphQL CMS) backend + a buzola/React admin SPA bound via bindx. A Node-backend + static-SPA shape (not Workers/D1).
|
|
46
46
|
- **`content-site`** — a Bun-native static content site: pletivo SSG + Preact islands + Tailwind. No SSR, no vite — fits the bun/non-vite preference.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: cf-internal-app
|
|
3
|
-
title: "Full internal Cloudflare app — Buzola SPA +
|
|
4
|
-
goal: "From empty to a full internal app: Buzola SPA + Worker API, D1/R2/Queue/Cron/Workers AI, local Vite+lopata, native
|
|
3
|
+
title: "Full internal Cloudflare app — Buzola SPA + Fabrika IAM + Fabrika Control"
|
|
4
|
+
goal: "From empty to a full internal app: Buzola SPA + Worker API, D1/R2/Queue/Cron/Workers AI, local Vite+lopata, native Fabrika IAM login, Fabrika-managed production deploy, and green opice tests."
|
|
5
5
|
decisions:
|
|
6
6
|
- cloudflare
|
|
7
7
|
- lopata
|
|
8
8
|
- oblaka
|
|
9
|
-
-
|
|
9
|
+
- fabrika-control
|
|
10
10
|
- wrangler
|
|
11
11
|
- vite
|
|
12
12
|
- react
|
|
@@ -17,12 +17,12 @@ decisions:
|
|
|
17
17
|
- queue
|
|
18
18
|
- cron-triggers
|
|
19
19
|
- workers-ai
|
|
20
|
-
-
|
|
20
|
+
- fabrika-iam
|
|
21
21
|
- bun
|
|
22
22
|
- named-seeds
|
|
23
23
|
- single-worker-spa
|
|
24
24
|
- typed-worker-rpc
|
|
25
|
-
-
|
|
25
|
+
- fabrika-app-deploy
|
|
26
26
|
- opice
|
|
27
27
|
build: "see §build recipe below"
|
|
28
28
|
---
|
|
@@ -32,10 +32,10 @@ build: "see §build recipe below"
|
|
|
32
32
|
The production-grade **internal-app shape**: an internal, client-rendered Buzola/React
|
|
33
33
|
SPA backed by a Cloudflare Worker. It runs as a Vite SPA plus a lopata Worker
|
|
34
34
|
locally, ships as one Worker with static assets in production, logs people in
|
|
35
|
-
through native
|
|
35
|
+
through native Fabrika IAM, and delegates the whole production lifecycle to Fabrika Control.
|
|
36
36
|
|
|
37
37
|
Use `cf-lightweight` when an app only needs SPA + D1 and does not belong to the
|
|
38
|
-
|
|
38
|
+
Fabrika Control/Fabrika IAM ecosystem. This preset deliberately includes the operational
|
|
39
39
|
primitives available to the stack: R2, Queue, Cron and Workers AI. Drop any of those at the
|
|
40
40
|
tech gate when the product has no corresponding workload.
|
|
41
41
|
|
|
@@ -43,27 +43,27 @@ tech gate when the product has no corresponding workload.
|
|
|
43
43
|
|
|
44
44
|
Frontend: `react` + `buzola` + `vite` + `tailwind`. Runtime/data: `cloudflare` +
|
|
45
45
|
`d1` + `r2` + `queue` + `cron-triggers` + `workers-ai`. Local development:
|
|
46
|
-
`lopata` + `oblaka` + `bun`. Authentication/authorization: native `
|
|
47
|
-
Deployment: `
|
|
46
|
+
`lopata` + `oblaka` + `bun`. Authentication/authorization: native `fabrika-iam`.
|
|
47
|
+
Deployment: `fabrika-control` + `wrangler` through the `fabrika-app-deploy` pattern. Delivery:
|
|
48
48
|
`single-worker-spa` + `typed-worker-rpc`. Acceptance: `named-seeds` + `opice`.
|
|
49
49
|
|
|
50
50
|
requires-closure holds:
|
|
51
51
|
|
|
52
|
-
- `
|
|
53
|
-
- `
|
|
52
|
+
- `fabrika-control` → {`cloudflare`, `oblaka`, `wrangler`, `fabrika-iam`};
|
|
53
|
+
- `fabrika-iam` → {`cloudflare`, `d1`};
|
|
54
54
|
- `single-worker-spa` → {`cloudflare`, `vite`, `buzola`};
|
|
55
55
|
- `typed-worker-rpc` → {`cloudflare`, `buzola`};
|
|
56
|
-
- `
|
|
56
|
+
- `fabrika-app-deploy` → {`fabrika-control`, `fabrika-iam`, `oblaka`, `wrangler`};
|
|
57
57
|
- `buzola` → `react`; all CF resources → `cloudflare`; `named-seeds` → `d1`.
|
|
58
58
|
|
|
59
59
|
One per exclusive slot: platform, deploy-control-plane, app-delivery-shape,
|
|
60
60
|
client-worker-api, cf-dev-runtime, bundler, ui-framework, router, styling,
|
|
61
61
|
relational-db, ai-runtime, authz, js-runtime, seed-strategy and e2e-tests. There
|
|
62
62
|
is **no Cloudflare Access**
|
|
63
|
-
and no app-owned password auth; native
|
|
63
|
+
and no app-owned password auth; native Fabrika IAM owns both login and permission
|
|
64
64
|
resolution.
|
|
65
65
|
|
|
66
|
-
**Maturity:**
|
|
66
|
+
**Maturity:** Fabrika Control, Fabrika IAM, Buzola, lopata and opice are 0.x/WIP. This is a
|
|
67
67
|
curated internal production stack, not the generic default. Pin the working
|
|
68
68
|
versions, read installed sources/types before scaffolding, and typecheck the
|
|
69
69
|
actual resource/auth config.
|
|
@@ -80,10 +80,10 @@ actual resource/auth config.
|
|
|
80
80
|
API namespaces through Worker code; those paths return their own 404s and
|
|
81
81
|
never fall through to `index.html`.
|
|
82
82
|
|
|
83
|
-
### Native
|
|
83
|
+
### Native Fabrika IAM login
|
|
84
84
|
|
|
85
85
|
- Define one app id and one action/scope vocabulary shared by runtime auth and
|
|
86
|
-
the schema in `
|
|
86
|
+
the schema in `fabrika.config.ts`.
|
|
87
87
|
- Off-local, bind `IAM` to `propustka-worker` and inject `PROPUSTKA_URL` as the
|
|
88
88
|
token issuer/login origin.
|
|
89
89
|
- Pass ordered `AppGates` to `PropustkaAuth`: normally a `service` rule followed
|
|
@@ -99,16 +99,16 @@ actual resource/auth config.
|
|
|
99
99
|
inferred contract to the SPA through a type-only import.
|
|
100
100
|
- Authenticate once at the dispatcher, then require each feature handler to
|
|
101
101
|
enforce its concrete `auth.can(...)` capability.
|
|
102
|
-
- Preserve
|
|
102
|
+
- Preserve Fabrika IAM's `loginUrl`/`setCookie` across the RPC response seam.
|
|
103
103
|
|
|
104
|
-
###
|
|
104
|
+
### Fabrika Control deploy
|
|
105
105
|
|
|
106
|
-
- `
|
|
106
|
+
- `fabrika.config.ts` is the production source of truth: stable `id`, exported
|
|
107
107
|
resource builder, schema and pipeline.
|
|
108
108
|
- `ctx.domain` owns the custom domain; `pipeline.secrets` lists required runtime
|
|
109
109
|
secrets. Do not recreate deployment in `.github/workflows/deploy.yml`.
|
|
110
110
|
- A thin `oblaka.ts` reuses the resource builder only for the local lopata loop.
|
|
111
|
-
- The account operator registers repo/env/domain/trigger/secrets in
|
|
111
|
+
- The account operator registers repo/env/domain/trigger/secrets in Fabrika Control. That
|
|
112
112
|
is a deployment prerequisite, not a scaffold-time Cloudflare mutation.
|
|
113
113
|
|
|
114
114
|
## Build recipe (per-issue verify stage)
|
|
@@ -119,7 +119,7 @@ actual resource/auth config.
|
|
|
119
119
|
3. run the targeted opice scenario against the Vite URL; auth is the deterministic
|
|
120
120
|
dev operator and external AI/providers use deterministic fakes.
|
|
121
121
|
4. run unit tests + `bun run typecheck` + the SPA production build. Validate
|
|
122
|
-
`
|
|
122
|
+
`fabrika.config.ts`/`oblaka.ts` through their real config-generation command when
|
|
123
123
|
their raw-source type graph is intentionally excluded from `tsc`.
|
|
124
|
-
5. collapse the result. Production deployment remains
|
|
124
|
+
5. collapse the result. Production deployment remains Fabrika Control's responsibility;
|
|
125
125
|
do not deploy from an issue implementation loop.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
export declare const BUILDER_USAGE = "fabrika builder \u2014 guided application builder\n\nUsage:\n fabrika builder init [dir] [--profile <stack>] [--agent all|claude|codex]\n [--session=<id>] [--no-open] [--no-daemon] [--json]\n Scaffold .fabrika/, install agent support, open dashboard\n fabrika builder next [--json] Print the task packet for the current derived phase\n fabrika builder init [dir] --url=<origin> [--no-open] Initialize zerops-app and begin human consent\n [--no-daemon] Offline init only; incompatible with --url\n fabrika builder connect --url=<origin> [--no-open] [--json]\n fabrika builder status [--json] Read connection and deployment status\n fabrika builder disconnect [--json] Remove local custody; revoke separately in console\n fabrika builder deploy [--wait] [--timeout=<seconds>] [--json]\n fabrika builder preview --url=<url> | --clear [--json]\n Platform commands also accept --dir=<project>\n Results are sanitized JSON; wait defaults to 600 seconds\n --no-open returns the local dashboard URL, never approval proof\n All commands accept --help and never prompt for input\n fabrika builder advance [--force] Validate outputs and gate, then print the next phase\n fabrika builder gate open <name> --view <f.jsx> Push a canvas gate and open the dashboard\n fabrika builder gate wait [--gate <n>] [--timeout] Wait for submitted gate feedback\n fabrika builder ensure-daemon Start the daemon if it is not running\n fabrika builder induce [--force] Derive issues from opice skeleton metadata\n fabrika builder build [--issue <ID>] [--assisted] Run the assisted per-issue build driver\n\nEnvironment:\n FABRIKA_PORT Daemon port (default 19410)\n FABRIKA_SESSION_ID Session id (fallback: stable hash of repo abs path)\n FABRIKA_DATA_DIR Persistent daemon/session data (default ~/.fabrika)\n FABRIKA_TIMEOUT gate wait timeout in ms (default 3600000)";
|
|
3
|
+
export declare function runBuilderCli(argv: readonly string[]): Promise<number>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Issue } from './issues';
|
|
2
|
+
export type IssueStatus = 'done' | 'blocked';
|
|
3
|
+
export interface BuildRecord {
|
|
4
|
+
status: IssueStatus;
|
|
5
|
+
reason?: string;
|
|
6
|
+
at: string;
|
|
7
|
+
}
|
|
8
|
+
export type BuildBoard = Record<string, BuildRecord>;
|
|
9
|
+
export declare function readBoard(fabrikaDir: string): BuildBoard;
|
|
10
|
+
export declare function writeBoard(fabrikaDir: string, board: BuildBoard): void;
|
|
11
|
+
export declare function record(fabrikaDir: string, id: string, status: IssueStatus, reason: string | undefined, at: string): BuildBoard;
|
|
12
|
+
export interface BuildPlan {
|
|
13
|
+
done: Issue[];
|
|
14
|
+
blocked: Issue[];
|
|
15
|
+
ready: Issue[];
|
|
16
|
+
waiting: Issue[];
|
|
17
|
+
next: Issue | null;
|
|
18
|
+
complete: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function planBuild(issues: Issue[], board: BuildBoard): BuildPlan;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function resolveCatalogRoot(): string | null;
|
|
2
|
+
export interface StackPointer {
|
|
3
|
+
profile: string;
|
|
4
|
+
root: string;
|
|
5
|
+
stackFile: string;
|
|
6
|
+
stackFileExists: boolean;
|
|
7
|
+
decisionsDir: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function resolveStackPointer(profile: string): StackPointer | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cmdAdvance(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cmdBuild(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cmdEnsureDaemon(_argv: string[]): Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cmdGate(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cmdInduce(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cmdInit(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cmdNext(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const DAEMON_PORT: number;
|
|
2
|
+
export declare const BASE_URL: string;
|
|
3
|
+
export declare const WS_URL: string;
|
|
4
|
+
export declare const TIMEOUT_MS: number;
|
|
5
|
+
export declare const NEUTRAL_DATA_DIR: string;
|
|
6
|
+
export declare const DATA_DIR: string;
|
|
7
|
+
export declare const SESSIONS_DIR: string;
|
|
8
|
+
export declare const TEMP_DIR: string;
|
|
9
|
+
export declare const PID_FILE: string;
|
|
10
|
+
export declare const FABRIKA_DIRNAME = ".fabrika";
|
|
11
|
+
export declare function resolveDataDir(opts?: {
|
|
12
|
+
home?: string;
|
|
13
|
+
explicit?: string;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function getSessionId(explicit?: string, recorded?: string, repoRoot?: string): string;
|
|
16
|
+
export declare function hashRepoPath(repoRoot: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BuilderProjectConnection } from '../../shared';
|
|
2
|
+
export interface CommandContext {
|
|
3
|
+
repoRoot: string;
|
|
4
|
+
fabrikaDir: string;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
profile: string;
|
|
7
|
+
initialized: boolean;
|
|
8
|
+
connection?: BuilderProjectConnection;
|
|
9
|
+
}
|
|
10
|
+
export declare function resolveContext(opts?: {
|
|
11
|
+
dir?: string;
|
|
12
|
+
session?: string;
|
|
13
|
+
}): CommandContext;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PhaseState } from './derive';
|
|
2
|
+
export declare function fetchPhase(fabrikaDir: string, sessionId?: string): Promise<PhaseState | null>;
|
|
3
|
+
export interface PlanResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
browserUrl?: string;
|
|
6
|
+
revision?: number;
|
|
7
|
+
isNew?: boolean;
|
|
8
|
+
canvasFiles?: string[];
|
|
9
|
+
gate?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
errors?: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export type PlanSource = {
|
|
14
|
+
view: string;
|
|
15
|
+
directory?: never;
|
|
16
|
+
} | {
|
|
17
|
+
directory: string;
|
|
18
|
+
view?: never;
|
|
19
|
+
};
|
|
20
|
+
export declare function pushPlan(sessionId: string, body: PlanSource & {
|
|
21
|
+
projectRoot: string;
|
|
22
|
+
label?: string;
|
|
23
|
+
gate?: string;
|
|
24
|
+
}): Promise<PlanResult & {
|
|
25
|
+
reachable: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function peekFeedback(sessionId: string): Promise<string | null>;
|
|
28
|
+
export declare function consumeFeedback(sessionId: string): Promise<string | null>;
|
|
29
|
+
export interface BuildEvent {
|
|
30
|
+
issue?: string;
|
|
31
|
+
status: string;
|
|
32
|
+
message?: string;
|
|
33
|
+
ts?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare function postBuildEvent(event: BuildEvent): Promise<boolean>;
|
|
36
|
+
export declare function waitForFeedback(sessionId: string, timeoutMs?: number): Promise<string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type DaemonLifecycleConfig } from '@fabrika/daemon-kit';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import { healthInfoSchema } from '../../shared';
|
|
4
|
+
export type DaemonHealthInfo = z.output<typeof healthInfoSchema> & {
|
|
5
|
+
pid: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function healthMatchesDataRoot(info: {
|
|
8
|
+
sessionsDir: string;
|
|
9
|
+
}, expectedSessionsDir?: string): boolean;
|
|
10
|
+
export declare const daemonLifecycleConfig: DaemonLifecycleConfig<DaemonHealthInfo>;
|
|
11
|
+
export declare const daemon: import("@fabrika/daemon-kit").DaemonLifecycle<DaemonHealthInfo>;
|
|
12
|
+
export declare function ensureDaemon(opts?: {
|
|
13
|
+
quiet?: boolean;
|
|
14
|
+
}): Promise<boolean>;
|
|
15
|
+
export declare function isDaemonRunning(): Promise<boolean>;
|
|
16
|
+
export declare function openBrowser(url: string, fallbackUrl?: string): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Phase, type PhaseId } from '../../shared/phases';
|
|
2
|
+
export interface PhaseState {
|
|
3
|
+
current: PhaseId;
|
|
4
|
+
index: number;
|
|
5
|
+
completed: PhaseId[];
|
|
6
|
+
reads: string[];
|
|
7
|
+
produces: string[];
|
|
8
|
+
gate: boolean;
|
|
9
|
+
satisfied: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type GateProbe = (phase: Phase) => boolean;
|
|
12
|
+
export declare const offlineGateProbe: GateProbe;
|
|
13
|
+
export declare function matchGlob(repoRoot: string, glob: string): string[];
|
|
14
|
+
export declare function isNonEmptyFile(p: string): boolean;
|
|
15
|
+
export declare function producesSatisfied(repoRoot: string, phase: Phase): boolean;
|
|
16
|
+
export declare function resolveReads(repoRoot: string, phase: Phase): string[];
|
|
17
|
+
export declare function derivePhase(repoRoot: string, gateProbe?: GateProbe): PhaseState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { type Phase, PHASE_COUNT, PHASE_IDS, phaseById, type PhaseId, phaseIndex, PHASES } from '../../shared/phases';
|
|
2
|
+
export { resolveCatalogRoot, resolveStackPointer, type StackPointer } from './catalog';
|
|
3
|
+
export { BASE_URL, DAEMON_PORT, DATA_DIR, FABRIKA_DIRNAME, getSessionId, hashRepoPath, NEUTRAL_DATA_DIR, resolveDataDir, TEMP_DIR, WS_URL, } from './config';
|
|
4
|
+
export { derivePhase, type GateProbe, isNonEmptyFile, matchGlob, offlineGateProbe, type PhaseState, producesSatisfied, resolveReads } from './derive';
|
|
5
|
+
export { type AgentHost, injectAgentSupport, type InjectOptions, type InjectResult, injectSkills, parseAgentHosts, resolveSkillSource, } from './inject-skills';
|
|
6
|
+
export { configPath, EXTERNAL_DIRS, type FabrikaConfig, fabrikaDir, findRepoRoot, type InitResult, isInitialized, LAYER_DIRS, readConfig, scaffold, } from './layout';
|
|
7
|
+
export { type PacketJson, packetJson, type RenderOpts, renderPacket } from './packet';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StackPointer } from './catalog';
|
|
2
|
+
import type { Skeleton } from './skeletons';
|
|
3
|
+
export interface InducedIssue {
|
|
4
|
+
id: string;
|
|
5
|
+
goal: string;
|
|
6
|
+
satisfies: string[];
|
|
7
|
+
dependsOn: string[];
|
|
8
|
+
touches: string[];
|
|
9
|
+
body: string;
|
|
10
|
+
kind: 'foundation' | 'feature';
|
|
11
|
+
}
|
|
12
|
+
export interface InduceOpts {
|
|
13
|
+
stack?: StackPointer;
|
|
14
|
+
}
|
|
15
|
+
export declare function induceIssues(skeletons: Skeleton[], opts?: InduceOpts): InducedIssue[];
|
|
16
|
+
export declare function renderIssue(issue: InducedIssue): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type AgentHost = 'claude' | 'codex';
|
|
2
|
+
export interface InjectOptions {
|
|
3
|
+
hosts?: AgentHost[];
|
|
4
|
+
}
|
|
5
|
+
/** Where the installed `fabrika-app` skill came from: the application's own `@fabrika/app`, or the builder's. */
|
|
6
|
+
export interface AppSkillSource {
|
|
7
|
+
from: 'application' | 'builder';
|
|
8
|
+
version: string;
|
|
9
|
+
}
|
|
10
|
+
export interface InjectResult {
|
|
11
|
+
sourceDir: string | null;
|
|
12
|
+
hosts: AgentHost[];
|
|
13
|
+
appSkill: AppSkillSource | null;
|
|
14
|
+
written: string[];
|
|
15
|
+
updated: string[];
|
|
16
|
+
skipped: string[];
|
|
17
|
+
preserved: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function resolveSkillSource(): string | null;
|
|
20
|
+
export declare function parseAgentHosts(value?: string): AgentHost[];
|
|
21
|
+
export declare function injectAgentSupport(repoRoot: string, opts?: InjectOptions): InjectResult;
|
|
22
|
+
export declare function injectSkills(repoRoot: string): InjectResult;
|
|
23
|
+
export declare function manifestRelativePath(repoRoot: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Issue {
|
|
2
|
+
id: string;
|
|
3
|
+
path: string;
|
|
4
|
+
goal: string;
|
|
5
|
+
satisfies: string[];
|
|
6
|
+
dependsOn: string[];
|
|
7
|
+
touches: string[];
|
|
8
|
+
body: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function readIssues(fabrikaDir: string): Issue[];
|
|
11
|
+
export declare function parseIssue(path: string): Issue;
|
|
12
|
+
export declare function isReady(issue: Issue, knownIds: Set<string>): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type BuilderProjectConfig } from '../../shared';
|
|
2
|
+
export declare const LAYER_DIRS: string[];
|
|
3
|
+
export declare const EXTERNAL_DIRS: string[];
|
|
4
|
+
export type FabrikaConfig = BuilderProjectConfig;
|
|
5
|
+
export declare function fabrikaDir(repoRoot: string): string;
|
|
6
|
+
export declare function configPath(repoRoot: string): string;
|
|
7
|
+
export declare function isInitialized(repoRoot: string): boolean;
|
|
8
|
+
export declare function readConfig(repoRoot: string): FabrikaConfig | null;
|
|
9
|
+
export interface InitResult {
|
|
10
|
+
repoRoot: string;
|
|
11
|
+
fabrikaDir: string;
|
|
12
|
+
config: FabrikaConfig;
|
|
13
|
+
createdDirs: string[];
|
|
14
|
+
createdConfig: boolean;
|
|
15
|
+
alreadyInitialized: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function scaffold(repoRoot: string, opts?: {
|
|
18
|
+
profile?: string;
|
|
19
|
+
sessionId?: string;
|
|
20
|
+
}): InitResult;
|
|
21
|
+
export declare function findRepoRoot(start?: string): string | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { BuilderProjectConnection } from '../../shared';
|
|
2
|
+
import { type PhaseId } from '../../shared/phases';
|
|
3
|
+
import { type StackPointer } from './catalog';
|
|
4
|
+
import type { PhaseState } from './derive';
|
|
5
|
+
export interface RenderOpts {
|
|
6
|
+
profile?: string;
|
|
7
|
+
connection?: BuilderProjectConnection;
|
|
8
|
+
}
|
|
9
|
+
export declare function renderPacket(state: PhaseState, opts?: RenderOpts): string;
|
|
10
|
+
export interface PacketJson {
|
|
11
|
+
phase: PhaseId;
|
|
12
|
+
index: number;
|
|
13
|
+
number: number;
|
|
14
|
+
title: string;
|
|
15
|
+
reads: string[];
|
|
16
|
+
produces: string[];
|
|
17
|
+
gate: boolean;
|
|
18
|
+
gateView: string | null;
|
|
19
|
+
skills: string[];
|
|
20
|
+
completed: PhaseId[];
|
|
21
|
+
satisfied: boolean;
|
|
22
|
+
stack: StackPointer | null;
|
|
23
|
+
platform: ReturnType<typeof connectionContext> | null;
|
|
24
|
+
}
|
|
25
|
+
export declare function packetJson(state: PhaseState, opts?: RenderOpts): PacketJson;
|
|
26
|
+
declare function connectionContext(connection: BuilderProjectConnection): {
|
|
27
|
+
controlOrigin: string;
|
|
28
|
+
provider: string;
|
|
29
|
+
app: import("@fabrika/control-contract").AppDto;
|
|
30
|
+
environment: import("@fabrika/control-contract").BuilderConnectionEnvironmentDto;
|
|
31
|
+
};
|
|
32
|
+
export {};
|