@quickback-dev/cli 0.70.45 → 0.72.3

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.
Files changed (232) hide show
  1. package/dist/commands/build.d.ts.map +1 -1
  2. package/dist/commands/build.js +10 -1
  3. package/dist/commands/build.js.map +1 -1
  4. package/dist/commands/deploy.d.ts.map +1 -1
  5. package/dist/commands/deploy.js +7 -1
  6. package/dist/commands/deploy.js.map +1 -1
  7. package/dist/commands/mcp.d.ts.map +1 -1
  8. package/dist/commands/mcp.js +6 -5
  9. package/dist/commands/mcp.js.map +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/lib/access-manifest-diff.d.ts +6 -0
  13. package/dist/lib/access-manifest-diff.d.ts.map +1 -1
  14. package/dist/lib/access-manifest-diff.js +10 -0
  15. package/dist/lib/access-manifest-diff.js.map +1 -1
  16. package/dist/lib/action-harvest.d.ts.map +1 -1
  17. package/dist/lib/action-harvest.js +36 -0
  18. package/dist/lib/action-harvest.js.map +1 -1
  19. package/dist/lib/api-client.d.ts +8 -0
  20. package/dist/lib/api-client.d.ts.map +1 -1
  21. package/dist/lib/api-client.js.map +1 -1
  22. package/dist/lib/deployment-target.d.ts +13 -0
  23. package/dist/lib/deployment-target.d.ts.map +1 -1
  24. package/dist/lib/deployment-target.js +4 -0
  25. package/dist/lib/deployment-target.js.map +1 -1
  26. package/dist/lib/file-loader.d.ts +22 -0
  27. package/dist/lib/file-loader.d.ts.map +1 -1
  28. package/dist/lib/file-loader.js +80 -18
  29. package/dist/lib/file-loader.js.map +1 -1
  30. package/dist/lib/file-writer.js +9 -0
  31. package/dist/lib/file-writer.js.map +1 -1
  32. package/dist/lib/harness.d.ts +10 -0
  33. package/dist/lib/harness.d.ts.map +1 -1
  34. package/dist/lib/harness.js +31 -0
  35. package/dist/lib/harness.js.map +1 -1
  36. package/dist/lib/migrations/executor.js +5 -1
  37. package/dist/lib/migrations/executor.js.map +1 -1
  38. package/dist/lib/migrations/plan.js +3 -0
  39. package/dist/lib/migrations/plan.js.map +1 -1
  40. package/dist/lib/migrations/postprocessors/index.d.ts.map +1 -1
  41. package/dist/lib/migrations/postprocessors/index.js +23 -2
  42. package/dist/lib/migrations/postprocessors/index.js.map +1 -1
  43. package/dist/lib/migrations/postprocessors/tenant-bundle.d.ts +30 -0
  44. package/dist/lib/migrations/postprocessors/tenant-bundle.d.ts.map +1 -0
  45. package/dist/lib/migrations/postprocessors/tenant-bundle.js +109 -0
  46. package/dist/lib/migrations/postprocessors/tenant-bundle.js.map +1 -0
  47. package/dist/lib/migrations/prior-state.d.ts +13 -1
  48. package/dist/lib/migrations/prior-state.d.ts.map +1 -1
  49. package/dist/lib/migrations/prior-state.js +33 -2
  50. package/dist/lib/migrations/prior-state.js.map +1 -1
  51. package/dist/lib/migrations/types.d.ts +2 -2
  52. package/dist/lib/migrations/types.d.ts.map +1 -1
  53. package/dist/lib/migrations/types.js +3 -0
  54. package/dist/lib/migrations/types.js.map +1 -1
  55. package/dist/lib/wrangler-resources.d.ts +14 -1
  56. package/dist/lib/wrangler-resources.d.ts.map +1 -1
  57. package/dist/lib/wrangler-resources.js +29 -7
  58. package/dist/lib/wrangler-resources.js.map +1 -1
  59. package/dist/skill/SKILL.md +64 -0
  60. package/dist/skill/docs/api/actions.md +73 -2
  61. package/dist/skill/docs/api/batch-operations.md +2 -0
  62. package/dist/skill/docs/api/caching.md +2 -2
  63. package/dist/skill/docs/api/crud.md +13 -0
  64. package/dist/skill/docs/api/errors.md +111 -10
  65. package/dist/skill/docs/api/index.md +24 -0
  66. package/dist/skill/docs/api/openapi.md +8 -0
  67. package/dist/skill/docs/api/query-params.md +6 -0
  68. package/dist/skill/docs/configure/agents.md +73 -1
  69. package/dist/skill/docs/configure/auth.md +7 -1
  70. package/dist/skill/docs/configure/bindings.md +55 -0
  71. package/dist/skill/docs/configure/cloudflare-access.md +191 -0
  72. package/dist/skill/docs/configure/domains.md +1 -1
  73. package/dist/skill/docs/configure/index.md +4 -2
  74. package/dist/skill/docs/configure/providers.md +2 -1
  75. package/dist/skill/docs/configure/tenancy.md +3 -0
  76. package/dist/skill/docs/configure/tenant-databases.md +2407 -0
  77. package/dist/skill/docs/define/access.md +33 -1
  78. package/dist/skill/docs/define/actions/defining.md +118 -1
  79. package/dist/skill/docs/define/actions/scoped-db.md +32 -8
  80. package/dist/skill/docs/define/areas.md +145 -2
  81. package/dist/skill/docs/define/diagnostics.md +160 -21
  82. package/dist/skill/docs/define/encryption.md +13 -2
  83. package/dist/skill/docs/define/fga.md +320 -42
  84. package/dist/skill/docs/define/firewall.md +4 -0
  85. package/dist/skill/docs/define/index.md +1 -0
  86. package/dist/skill/docs/define/read.md +46 -5
  87. package/dist/skill/docs/define/relationships.md +30 -12
  88. package/dist/skill/docs/define/schema.md +2 -0
  89. package/dist/skill/docs/define/scopes.md +393 -9
  90. package/dist/skill/docs/define/sealed-protocol.md +67 -12
  91. package/dist/skill/docs/define/transitions.md +4 -1
  92. package/dist/skill/docs/define/triggers.md +55 -1
  93. package/dist/skill/docs/platform/api-contract/index.md +9 -3
  94. package/dist/skill/docs/platform/auth/jwt-optimization.md +13 -1
  95. package/dist/skill/docs/platform/auth/using-auth.md +1 -1
  96. package/dist/skill/docs/platform/database/d1.md +112 -3
  97. package/dist/skill/docs/platform/database/data-migrations.md +3 -1
  98. package/dist/skill/docs/platform/database/neon.md +10 -2
  99. package/dist/skill/docs/platform/queues/handlers.md +48 -16
  100. package/dist/skill/docs/platform/queues/using-queues.md +16 -0
  101. package/dist/skill/docs/platform/realtime/durable-objects.md +294 -17
  102. package/dist/skill/docs/platform/realtime/index.md +9 -6
  103. package/dist/skill/docs/platform/realtime/named-invalidations.md +3 -1
  104. package/dist/skill/docs/platform/realtime/using-realtime.md +28 -3
  105. package/dist/skill/docs/platform/schedules/index.md +1 -1
  106. package/dist/skill/docs/platform/storage/r2.md +10 -1
  107. package/dist/skill/docs/platform/storage/using-r2.md +42 -1
  108. package/dist/skill/docs/tooling/output.md +9 -2
  109. package/dist/skill/docs/ui/account/features/admin.md +5 -3
  110. package/dist/skill/docs/ui/account/hooks.md +9 -2
  111. package/dist/skill/docs/ui/admin/connecting.md +3 -3
  112. package/dist/skill/docs/ui/admin/index.md +1 -1
  113. package/package.json +1 -1
  114. package/src/skill/SKILL.md +64 -0
  115. package/src/skill/docs/api/actions.md +73 -2
  116. package/src/skill/docs/api/batch-operations.md +2 -0
  117. package/src/skill/docs/api/caching.md +2 -2
  118. package/src/skill/docs/api/crud.md +13 -0
  119. package/src/skill/docs/api/errors.md +111 -10
  120. package/src/skill/docs/api/index.md +24 -0
  121. package/src/skill/docs/api/openapi.md +8 -0
  122. package/src/skill/docs/api/query-params.md +6 -0
  123. package/src/skill/docs/configure/agents.md +73 -1
  124. package/src/skill/docs/configure/auth.md +7 -1
  125. package/src/skill/docs/configure/bindings.md +55 -0
  126. package/src/skill/docs/configure/cloudflare-access.md +191 -0
  127. package/src/skill/docs/configure/domains.md +1 -1
  128. package/src/skill/docs/configure/index.md +4 -2
  129. package/src/skill/docs/configure/providers.md +2 -1
  130. package/src/skill/docs/configure/tenancy.md +3 -0
  131. package/src/skill/docs/configure/tenant-databases.md +2407 -0
  132. package/src/skill/docs/define/access.md +33 -1
  133. package/src/skill/docs/define/actions/defining.md +118 -1
  134. package/src/skill/docs/define/actions/scoped-db.md +32 -8
  135. package/src/skill/docs/define/areas.md +145 -2
  136. package/src/skill/docs/define/diagnostics.md +160 -21
  137. package/src/skill/docs/define/encryption.md +13 -2
  138. package/src/skill/docs/define/fga.md +320 -42
  139. package/src/skill/docs/define/firewall.md +4 -0
  140. package/src/skill/docs/define/index.md +1 -0
  141. package/src/skill/docs/define/read.md +46 -5
  142. package/src/skill/docs/define/relationships.md +30 -12
  143. package/src/skill/docs/define/schema.md +2 -0
  144. package/src/skill/docs/define/scopes.md +393 -9
  145. package/src/skill/docs/define/sealed-protocol.md +67 -12
  146. package/src/skill/docs/define/transitions.md +4 -1
  147. package/src/skill/docs/define/triggers.md +55 -1
  148. package/src/skill/docs/platform/api-contract/index.md +9 -3
  149. package/src/skill/docs/platform/auth/jwt-optimization.md +13 -1
  150. package/src/skill/docs/platform/auth/using-auth.md +1 -1
  151. package/src/skill/docs/platform/database/d1.md +112 -3
  152. package/src/skill/docs/platform/database/data-migrations.md +3 -1
  153. package/src/skill/docs/platform/database/neon.md +10 -2
  154. package/src/skill/docs/platform/queues/handlers.md +48 -16
  155. package/src/skill/docs/platform/queues/using-queues.md +16 -0
  156. package/src/skill/docs/platform/realtime/durable-objects.md +294 -17
  157. package/src/skill/docs/platform/realtime/index.md +9 -6
  158. package/src/skill/docs/platform/realtime/named-invalidations.md +3 -1
  159. package/src/skill/docs/platform/realtime/using-realtime.md +28 -3
  160. package/src/skill/docs/platform/schedules/index.md +1 -1
  161. package/src/skill/docs/platform/storage/r2.md +10 -1
  162. package/src/skill/docs/platform/storage/using-r2.md +42 -1
  163. package/src/skill/docs/tooling/output.md +9 -2
  164. package/src/skill/docs/ui/account/features/admin.md +5 -3
  165. package/src/skill/docs/ui/account/hooks.md +9 -2
  166. package/src/skill/docs/ui/admin/connecting.md +3 -3
  167. package/src/skill/docs/ui/admin/index.md +1 -1
  168. package/dist/codex/AGENTS.md +0 -290
  169. package/dist/commands/build.test.d.ts.map +0 -1
  170. package/dist/commands/codex.d.ts +0 -16
  171. package/dist/commands/codex.d.ts.map +0 -1
  172. package/dist/commands/codex.js +0 -159
  173. package/dist/commands/codex.js.map +0 -1
  174. package/dist/commands/compile.d.ts +0 -62
  175. package/dist/commands/compile.d.ts.map +0 -1
  176. package/dist/commands/compile.js +0 -830
  177. package/dist/commands/compile.js.map +0 -1
  178. package/dist/commands/compile.test.d.ts.map +0 -1
  179. package/dist/commands/init.d.ts +0 -6
  180. package/dist/commands/init.d.ts.map +0 -1
  181. package/dist/commands/init.js +0 -405
  182. package/dist/commands/init.js.map +0 -1
  183. package/dist/commands/migrate.test.d.ts.map +0 -1
  184. package/dist/commands/migrations.test.d.ts.map +0 -1
  185. package/dist/commands/push.test.d.ts.map +0 -1
  186. package/dist/commands/schema.test.d.ts.map +0 -1
  187. package/dist/docs/content.d.ts +0 -7
  188. package/dist/docs/content.d.ts.map +0 -1
  189. package/dist/docs/content.js +0 -672
  190. package/dist/docs/content.js.map +0 -1
  191. package/dist/docs/index.test.d.ts.map +0 -1
  192. package/dist/lib/action-harvest.test.d.ts.map +0 -1
  193. package/dist/lib/api-client.test.d.ts.map +0 -1
  194. package/dist/lib/artifact-routing.test.d.ts.map +0 -1
  195. package/dist/lib/auth.test.d.ts.map +0 -1
  196. package/dist/lib/compile-next-steps.test.d.ts.map +0 -1
  197. package/dist/lib/compiler-floor.test.d.ts.map +0 -1
  198. package/dist/lib/config-id-splice.test.d.ts.map +0 -1
  199. package/dist/lib/config-sync.test.d.ts.map +0 -1
  200. package/dist/lib/copy-public-assets.test.d.ts.map +0 -1
  201. package/dist/lib/copy-source-apps.test.d.ts.map +0 -1
  202. package/dist/lib/drizzle-meta-routing.test.d.ts.map +0 -1
  203. package/dist/lib/file-loader-typescript-fallback.test.d.ts.map +0 -1
  204. package/dist/lib/file-loader.test.d.ts.map +0 -1
  205. package/dist/lib/file-writer.test.d.ts.map +0 -1
  206. package/dist/lib/helpers.d.ts +0 -39
  207. package/dist/lib/helpers.d.ts.map +0 -1
  208. package/dist/lib/helpers.js +0 -299
  209. package/dist/lib/helpers.js.map +0 -1
  210. package/dist/lib/migrations/drizzle-prompts.test.d.ts.map +0 -1
  211. package/dist/lib/migrations/drizzle.test.d.ts.map +0 -1
  212. package/dist/lib/migrations/executor.test.d.ts.map +0 -1
  213. package/dist/lib/migrations/inventory.test.d.ts.map +0 -1
  214. package/dist/lib/migrations/lock.test.d.ts.map +0 -1
  215. package/dist/lib/migrations/paths.test.d.ts.map +0 -1
  216. package/dist/lib/migrations/plan.test.d.ts.map +0 -1
  217. package/dist/lib/migrations/postprocessors/index.test.d.ts.map +0 -1
  218. package/dist/lib/migrations/prompt-runner.test.d.ts.map +0 -1
  219. package/dist/lib/migrations/staging.test.d.ts.map +0 -1
  220. package/dist/lib/neon-canary.test.d.ts.map +0 -1
  221. package/dist/lib/neon-target.test.d.ts.map +0 -1
  222. package/dist/lib/neon.test.d.ts.map +0 -1
  223. package/dist/lib/prepare-output.test.d.ts.map +0 -1
  224. package/dist/lib/prepare-state-output.test.d.ts.map +0 -1
  225. package/dist/lib/schema-sync/index.test.d.ts.map +0 -1
  226. package/dist/lib/shell.test.d.ts.map +0 -1
  227. package/dist/lib/sweep-stale.d.ts +0 -25
  228. package/dist/lib/sweep-stale.d.ts.map +0 -1
  229. package/dist/lib/sweep-stale.js +0 -179
  230. package/dist/lib/sweep-stale.js.map +0 -1
  231. package/dist/lib/sweep-stale.test.d.ts.map +0 -1
  232. package/dist/lib/wrangler-resources.test.d.ts.map +0 -1
@@ -29,7 +29,8 @@ src/
29
29
  │ └── .quickback/
30
30
  │ └── define-action.ts # Typed per-feature `defineAction` helper
31
31
  ├── routes/
32
- │ └── {feature}.ts # Mount re-export consumed by src/index.ts
32
+ │ ├── {feature}.ts # Mount re-export consumed by src/index.ts
33
+ │ └── __legacy-{feature}.routes.ts # Legacy forwards of namespace-claimed tables/actions (when `legacy` is set)
33
34
  ├── lib/
34
35
  │ ├── auth.ts # Better Auth instance & config
35
36
  │ ├── auth.schema-gen.ts # Copy of auth.ts with hooks/email templates stubbed — what `better-auth generate` reads
@@ -41,6 +42,7 @@ src/
41
42
  │ ├── services.ts # Service layer
42
43
  │ ├── q.ts # Generated Drizzle query-operator namespace for actions
43
44
  │ ├── audit-wrapper.ts # Stamps the managed audit columns on write
45
+ │ ├── legacy-forward.ts # Legacy-forward runtime: org-only check, instance pre-check, in-process dispatch, deprecation headers (when `legacy` is set)
44
46
  │ └── security-audit.ts # Unsafe cross-tenant audit logger (when needed)
45
47
  └── middleware/
46
48
  ├── auth.ts # Auth context middleware
@@ -193,6 +195,8 @@ than replaced:
193
195
  compile; scripts and fields the compiler does not emit are kept. Because owned
194
196
  scripts converge, a hand-deleted `db:migrate:auth:*` step comes back — declare
195
197
  [`authMigrations: 'external'`](/configure/providers#cloudflare-d1) instead.
198
+ A package the compiler owns in `dependencies` or `devDependencies` is removed
199
+ from the other field, so a stale pin cannot shadow the compiler's version.
196
200
  - **`.gitignore`** — a union: your entries stay, missing compiler entries are
197
201
  appended.
198
202
  - **`README.md`** — written once; an existing README is never touched.
@@ -391,7 +395,10 @@ environments: {
391
395
  ```
392
396
 
393
397
  Omitting `filesWorker.domain` emits `routes = []` for that target — the explicit
394
- workers.dev-only opt-out, so it cannot inherit a sibling's hostname.
398
+ workers.dev-only opt-out, so it cannot inherit a sibling's hostname. The files
399
+ Worker's top-level `name` is an inert placeholder, `<name>-files-unselected`,
400
+ which no target may use. Without it, Wrangler would name a bare deploy from
401
+ `package.json`, which is the production edge.
395
402
 
396
403
  ### Webhooks
397
404
 
@@ -36,7 +36,7 @@ When `auth.admin` is `false` (the default), the admin surface does not exist for
36
36
  - **Create an organization** — you name the **owner**; the operator creating it is deliberately not seated (see below)
37
37
  - **Seat, re-role and remove members** — manage a tenant's roster without joining it
38
38
 
39
- These run on `/auth/v1/admin/*`, emitted by Quickback because Better Auth's organization plugin cannot serve them: every one of its endpoints resolves through the *caller's* membership, and an operator administers organizations it does not belong to.
39
+ These run on `/api/v1/operator/organizations` (under `/auth/v1/admin/*` before 0.72; see [Moved routes](/api#moved-routes-072)), emitted by Quickback because Better Auth's organization plugin cannot serve them: every one of its endpoints resolves through the *caller's* membership, and an operator administers organizations it does not belong to. Put them behind [Cloudflare Access](/configure/cloudflare-access#the-operator-plane) with one path rule.
40
40
 
41
41
  > **Users sign themselves up.** Self-serve signup stays on — a new account simply has no organization, and lands on a screen saying so until someone invites or seats them. What operators control is *organizations*, not accounts.
42
42
 
@@ -56,7 +56,7 @@ The admin panel is restricted to platform roles on the Better Auth user record:
56
56
  >
57
57
  > Equal tier is allowed, so an appmanager can still make another appmanager (the example below). Only a `sysadmin` can grant `sysadmin`.
58
58
  >
59
- > `set-organization-member` refuses to seat its caller with `403 OPERATOR_SELF_SEAT`: operators are never seated by their own control-plane calls.
59
+ > Seating a member (`PUT /api/v1/operator/organizations/:id/members/:userId`) refuses to seat its caller with `403 OPERATOR_SELF_SEAT`: operators are never seated by their own control-plane calls.
60
60
 
61
61
 
62
62
  To grant operator access to a user:
@@ -89,7 +89,7 @@ providers: {
89
89
  },
90
90
  ```
91
91
 
92
- With it on, an `appmanager` or `sysadmin` whose session was **not** established by a passkey assertion or a two-factor verification is treated as a plain `user` for that request. Every operator surface refuses with `403 MFA_REQUIRED`: the CMS and `/api/v1/schema`, the `/auth/v1/admin/*` operator routes, Better Auth's own admin endpoints (`list-users`, `set-role`, `ban-user`), and the sysadmin cross-tenant bypass. The Account UI keeps working, so the enrolment path is short:
92
+ With it on, an `appmanager` or `sysadmin` whose session was **not** established by a passkey assertion or a two-factor verification is treated as a plain `user` for that request. Every operator surface refuses with `403 MFA_REQUIRED`: the CMS and `/api/v1/schema`, the `/api/v1/operator/*` routes, Better Auth's own admin endpoints (`list-users`, `set-role`, `ban-user`), and the sysadmin cross-tenant bypass. The Account UI keeps working, so the enrolment path is short:
93
93
 
94
94
  1. Sign in with a password (or magic link / OTP) as usual.
95
95
  2. Register a passkey at `/account/passkeys/setup`.
@@ -97,6 +97,8 @@ With it on, an `appmanager` or `sysadmin` whose session was **not** established
97
97
 
98
98
  How it works: the compiler adds a `session.amr` column (RFC 8176, *Authentication Methods Reference*) and a `session.create.before` hook that stamps `passkey` when the session comes from `/passkey/verify-authentication` and `mfa` when it comes from `/two-factor/verify-*`. Nothing else sets it, and it is not client-settable. The auth middleware reads it on the session lane and copies it into the JWT fast-path claims, so bearer callers are gated identically.
99
99
 
100
+ Cloudflare Access is recommended additionally for `/api/v1/operator`. It does not replace `operatorMfa`: Better Auth admin endpoints and the other operator powers still need the application second factor. Configuring Access with `operatorMfa` off emits a compile warning.
101
+
100
102
  Things to know:
101
103
 
102
104
  - **Requires `passkey` or `twoFactor`.** The compile fails otherwise: without a second factor to enrol, every operator would be locked out.
@@ -142,6 +142,10 @@ before calling `quickback/hooks/resolve-oauth-context.ts`. Use this trusted
142
142
  server hook when tenant selection cannot be derived solely from the session's
143
143
  active organization.
144
144
 
145
+ It never runs for an [instance-bound token](/define/scopes#instance-bound-oauth-tokens)
146
+ (audience = a scope kind's resource): that principal is confined to one
147
+ instance and gets no tenant context.
148
+
145
149
  ```ts title="quickback/hooks/resolve-oauth-context.ts"
146
150
  import type { OAuthContextResolver } from '@quickback/compiler';
147
151
 
@@ -328,7 +332,7 @@ type HookCtx = {
328
332
  };
329
333
  ```
330
334
 
331
- `authDb` is the load-bearing piece: hooks must write to the auth DB via Drizzle directly. See the [CSRF caveat](#csrf-caveat-server-side-org-create) below. `authSchema` is the namespace export of the generated auth schema module; destructure the tables you need.
335
+ `authDb` is the Drizzle connection to the auth DB. Read through it freely; for writes, prefer Better Auth's API (`auth.api.*`; `ctx.auth` in actions), which runs Better Auth's own hooks and revokes sessions. A direct insert, update, or delete on a Better Auth table is flagged [`ACTION_AUTH_DB_WRITE`](/define/diagnostics#action_auth_db_write) — in `hooks/` as a **warning**, never a compile error. Where no endpoint fits, such as the server-side org create below (see the [CSRF caveat](#csrf-caveat-server-side-org-create)), keep the write and mark it with `// quickback-allow ACTION_AUTH_DB_WRITE: <reason>`. `authSchema` is the namespace export of the generated auth schema module; destructure the tables you need.
332
336
 
333
337
  This injection is unique to account hooks. Actions reach AUTH_DB via `c.get("authDb")` ([Scoped DB](/define/actions/scoped-db#reaching-better-auth-tables-authdb)). Trigger handlers on a table file get neither — use `ctx` for the acting user, and do not import `../../auth/schema` from the table file.
334
338
 
@@ -393,6 +397,7 @@ export default async (user, { authDb, authSchema }) => {
393
397
  .where(eq(organization.id, orgId));
394
398
  if (existing.length > 0) return;
395
399
 
400
+ // quickback-allow ACTION_AUTH_DB_WRITE: server-side org create has no Origin for auth.api.createOrganization
396
401
  await authDb.insert(organization).values({
397
402
  id: orgId,
398
403
  name: `${user.name ?? 'Personal'} Workspace`,
@@ -400,6 +405,7 @@ export default async (user, { authDb, authSchema }) => {
400
405
  createdAt: new Date(),
401
406
  });
402
407
 
408
+ // quickback-allow ACTION_AUTH_DB_WRITE: membership for the org created above, same reason
403
409
  await authDb.insert(member).values({
404
410
  id: crypto.randomUUID(),
405
411
  userId: user.id,
@@ -430,6 +436,7 @@ export default async (newSession, { authDb, authSchema }) => {
430
436
 
431
437
  if (memberships.length === 0) return;
432
438
 
439
+ // quickback-allow ACTION_AUTH_DB_WRITE: setActiveOrganization needs a request; this hook has none
433
440
  await authDb
434
441
  .update(session)
435
442
  .set({ activeOrganizationId: memberships[0].organizationId })
@@ -458,7 +465,7 @@ The compiler-generated wrapper merges your `data` onto the original entity, so y
458
465
 
459
466
  `POST /auth/v1/organization/create` (and Better Auth's `auth.api.createOrganization(...)` server helper) require an `Origin` header. A hook running inside `databaseHooks.user.create.after` is server-side — there is no incoming request, so no `Origin`. Calling those APIs from a hook may also validate `Origin` internally and reject.
460
467
 
461
- **The only safe path is direct Drizzle writes via `authDb`.** Treat the org/member tables as your source of truth and let the SPA call the BA API for user-initiated org creation.
468
+ **Here, direct Drizzle writes via `authDb` are the working path.** Mark each with `// quickback-allow ACTION_AUTH_DB_WRITE: <reason>` so the warning records why. Treat the org/member tables as your source of truth and let the SPA call the BA API for user-initiated org creation.
462
469
 
463
470
  ## Generated output
464
471
 
@@ -120,7 +120,7 @@ export default defineConfig({
120
120
  ```
121
121
 
122
122
  When you run `quickback build`, the CLI:
123
- 1. Builds the CMS SPA from source and places assets in `src/apps/cms/`
123
+ 1. Copies the prebuilt CMS SPA into `src/apps/cms/` (the compiler ships one generic bundle; per-project settings reach it at serve time)
124
124
  2. Adds `[assets]` config to `wrangler.toml` with `run_worker_first = true`
125
125
  3. Generates Worker routing to serve the CMS SPA
126
126
 
@@ -139,8 +139,8 @@ This adds a custom domain route to `wrangler.toml`. Both `api.example.com` and `
139
139
  CMS access defaults to `access: "sysadmin"` — only `user.role === "sysadmin"` (the cross-tenant data-plane tier) can use `/cms/*`. Set `access: "member"` to also admit anyone holding an organization membership. `user.role === "appmanager"` opens the CMS in neither mode: it is the control-plane tier and belongs at `/account/admin`. The gate is enforced at multiple layers:
140
140
 
141
141
  - **Account UI** hides the "Go to CMS" button for callers outside those roles.
142
- - **CMS SPA shell** — the Worker returns `403` (or redirects unauthenticated requests to login) before serving `index.html` to a non-operator. A non-operator who types the CMS URL directly cannot load the app.
143
- - **`/api/v1/schema`** returns `403 Platform operator access required` to callers outside those roles, so schema metadata can't be scraped by hitting the API directly.
142
+ - **CMS SPA shell** — the Worker redirects unauthenticated requests to login. Sign-in is the only shell-level gate; the app itself is a generic bundle. For a caller `/api/v1/schema` would admit, the Worker also inlines the schema registry in the shell as a non-executing `<script type="application/json" id="__qb-cms-bootstrap">` block, so the CMS starts without fetching it. The block uses the same admission check as `/api/v1/schema`, so it never carries anything that route would refuse. With [Cloudflare Access](/configure/cloudflare-access), it is inlined only when `/api/v1/schema` needs no Access application or the same one the shell request passed. The CMS shell is served `Cache-Control: private, no-store`.
143
+ - **`/api/v1/schema`** returns `401 AUTH_MISSING` to anonymous callers `403 CMS_ACCESS_DENIED` (naming the role required) to signed-in callers outside those roles, and `403 MFA_REQUIRED` to an operator whose session lacks the second factor `auth.operatorMfa` demands, so schema metadata can't be scraped by hitting the API directly.
144
144
  - **`custom_view` routes** are gated on `userRole: ["appmanager"]` rather than org membership, so saved views can't be listed or modified without platform-control-plane rights.
145
145
  - **In-SPA screen** — a signed-in caller who isn't admitted is served the shell and shown a screen naming what they'd need. There is no wrong-role redirect.
146
146
 
@@ -217,7 +217,7 @@ The shell is served to any signed-in caller, and the SPA resolves one of six sta
217
217
  | State | Screen |
218
218
  |-------|--------|
219
219
  | Not signed in | Redirect to sign-in (the one redirect that remains — it is where you were going anyway) |
220
- | `sysadmin`, no tenant chosen | Tenant picker, filterable, with **All organizations** as a first-class choice |
220
+ | `sysadmin`, no tenant chosen | Tenant picker (from `GET /api/v1/operator/organizations`), filterable, with **All organizations** as a first-class choice |
221
221
  | `sysadmin`, tenant chosen | The CMS, scoped to that tenant |
222
222
  | `appmanager`, `access: "sysadmin"` | *"The CMS shows organization data"* → **Go to admin** |
223
223
  | Anyone else, `access: "sysadmin"` | *"This CMS is restricted"* — names the config value that would admit them |
@@ -1,290 +0,0 @@
1
- # Quickback
2
-
3
- Quickback is two things:
4
-
5
- 1. **Compiler** — Transforms declarative TypeScript definitions into secure, production-ready APIs
6
- 2. **Stack** — A Supabase alternative running entirely on Cloudflare (D1, R2, KV, Durable Objects, Queues, Workers AI)
7
-
8
- The output is standard TypeScript (Hono, Drizzle, Better Auth) running on your own infrastructure.
9
-
10
- ## Project Structure
11
-
12
- ```
13
- my-app/
14
- ├── quickback/
15
- │ ├── quickback.config.ts
16
- │ └── features/
17
- │ └── {feature-name}/
18
- │ ├── {table}.ts # Schema + security (defineTable)
19
- │ ├── actions/ # One file per action — defineAction({...}) (optional)
20
- │ │ ├── {action}.ts # Binds to primary table (or standalone if path: is set)
21
- │ │ └── {table}/{action}.ts # Binds to sibling <table>.ts (multi-table features)
22
- │ └── lib/ # Feature-local helpers, copied verbatim (optional)
23
- └── ...
24
- ```
25
-
26
- ## quickback.config.ts
27
-
28
- ```typescript
29
- import { defineConfig, defineRuntime, defineDatabase, defineAuth } from '@quickback/compiler';
30
-
31
- export default defineConfig({
32
- name: "my-saas-app",
33
- providers: {
34
- runtime: defineRuntime("cloudflare"),
35
- database: defineDatabase("cloudflare-d1"),
36
- auth: defineAuth("better-auth"),
37
- },
38
- });
39
- ```
40
-
41
- ## Automatic Audit Fields
42
-
43
- Quickback auto-injects: `createdAt`, `modifiedAt`, `deletedAt`, `createdBy`, `modifiedBy`, `deletedBy`. Do NOT define these in schemas.
44
-
45
- ## defineTable() — Schema + Security
46
-
47
- Each feature file exports a Drizzle table and a `defineTable()` default export with security config:
48
-
49
- ```typescript
50
- import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
51
- import { defineTable } from "@quickback/compiler";
52
-
53
- export const todos = sqliteTable("todos", {
54
- id: integer("id").primaryKey(),
55
- title: text("title").notNull(),
56
- description: text("description"),
57
- completed: integer("completed", { mode: "boolean" }).default(false),
58
- userId: text("user_id").notNull(),
59
- organizationId: text("organization_id").notNull(),
60
- });
61
-
62
- export default defineTable(todos, {
63
- firewall: [
64
- { field: "organizationId", equals: "ctx.activeOrgId" },
65
- { field: "userId", equals: "ctx.userId" },
66
- { field: "deletedAt", isNull: true },
67
- ],
68
- read: { access: { roles: ["member", "admin"] } },
69
- create: { access: { roles: ["member", "admin"] } },
70
- update: { access: { roles: ["admin"] } },
71
- delete: { access: { roles: ["admin"] }, mode: "soft" },
72
- guards: {
73
- createable: ["title", "description", "completed"],
74
- updatable: ["title", "description", "completed"],
75
- },
76
- masking: {
77
- userId: { type: "redact", show: { roles: ["admin"] } },
78
- },
79
- });
80
- ```
81
-
82
- ## Four Security Layers
83
-
84
- Every request passes through: `Request → Firewall → Access → Guards → Database → Masking → Response`
85
-
86
- ### 1. Firewall — Data Isolation
87
-
88
- Auto WHERE clauses for tenant isolation. Predicates are AND'd:
89
-
90
- ```typescript
91
- firewall: [
92
- { field: 'organizationId', equals: 'ctx.activeOrgId' }, // WHERE organizationId = ctx.activeOrgId
93
- { field: 'ownerId', equals: 'ctx.userId' }, // AND ownerId = ctx.userId
94
- { field: 'teamId', equals: 'ctx.activeTeamId' }, // AND teamId = ctx.activeTeamId
95
- { field: 'deletedAt', isNull: true }, // AND deletedAt IS NULL
96
- ]
97
-
98
- // Public/system resources opt out of tenant scoping (soft-delete still applied):
99
- firewall: [{ exception: true }]
100
- ```
101
-
102
- Auto-derived when omitted: scans the schema for `organizationId` / `ownerId` / `teamId` and emits matching predicates. Two or more isolation columns → declare explicitly.
103
-
104
- ### 2. Access — Permission Checks
105
-
106
- Role-based and record-based (deny by default). Reads (`GET /` and `GET /:id`) gate via `read.access`; mutations gate via `create.access`, `update.access`, `delete.access`, and `upsert.access`.
107
-
108
- ```typescript
109
- read: { access: { roles: ['member'] } }, // gates GET / and GET /:id
110
- create: { access: { roles: ['admin'] } },
111
- update: {
112
- access: {
113
- or: [
114
- { roles: ['admin'] },
115
- { record: { createdBy: { equals: '$ctx.userId' } } },
116
- ],
117
- },
118
- },
119
- delete: { access: { roles: ['admin'] } },
120
- ```
121
-
122
- > **DSL v2:** `crud.list` and `crud.get` are rejected at compile time. Move them to `read.access`.
123
-
124
- Operators: `equals`, `notEquals`, `in`, `notIn`, `greaterThan`, `lessThan`
125
- Context: `$ctx.userId`, `$ctx.activeOrgId`, `$ctx.roles`
126
-
127
- ### 3. Guards — Field Protection
128
-
129
- ```typescript
130
- guards: {
131
- createable: ['name', 'description'],
132
- updatable: ['description'],
133
- immutable: ['invoiceNumber'],
134
- protected: { status: ['approve'] }, // Only via named actions
135
- }
136
- ```
137
-
138
- ### 4. Masking — PII Redaction
139
-
140
- ```typescript
141
- masking: {
142
- ssn: { type: 'ssn', show: { roles: ['admin'] } },
143
- email: { type: 'email', show: { roles: ['admin'], or: 'owner' } },
144
- }
145
- ```
146
-
147
- Types: `email`, `phone`, `ssn`, `creditCard`, `name`, `redact`, `custom`
148
-
149
- ## Views — Column Projections
150
-
151
- ```typescript
152
- views: {
153
- summary: { fields: ['id', 'name'], access: { roles: ['member'] } },
154
- full: { fields: ['id', 'name', 'phone', 'ssn'], access: { roles: ['admin'] } },
155
- }
156
- ```
157
-
158
- ## Validation
159
-
160
- ```typescript
161
- validation: {
162
- name: { minLength: 1, maxLength: 100 },
163
- capacity: { min: 1, max: 1000 },
164
- roomType: { enum: ['meeting', 'conference'] },
165
- email: { email: true },
166
- }
167
- ```
168
-
169
- ## Actions — Custom Business Logic
170
-
171
- One file per action under `actions/<name>.ts`. The filename is the action name AND URL segment. `actions/<name>.ts` binds to the feature's primary table; `actions/<table>/<name>.ts` binds to a sibling table. Setting `path:` makes the action standalone.
172
-
173
- ```typescript
174
- // features/todos/actions/complete.ts
175
- import { z } from "zod";
176
- import { eq } from "drizzle-orm";
177
- import { defineAction } from "../.quickback/define-action";
178
- import { todos } from "../todos";
179
-
180
- export default defineAction({
181
- description: "Mark todo as complete",
182
- input: z.object({ completedAt: z.string().datetime().optional() }),
183
- access: { roles: ["member", "admin"], record: { completed: { equals: false } } },
184
- async execute({ db, record, auditFields }) {
185
- await db.update(todos)
186
- .set({ completed: true, modifiedAt: auditFields!.modifiedAt })
187
- .where(eq(todos.id, record.id));
188
- return { success: true };
189
- },
190
- });
191
- ```
192
-
193
- Record-based (no `path:`): `POST /api/v1/{resource}/:id/{action}`
194
- Standalone (`path:` set): custom `path` and `method`
195
-
196
- `execute:` must be an `async (ctx) => { … }` arrow function. Retired (rejected at load time): bundled `actions.ts`, `_feature.ts`, `handlers/` directory, `defineActions()`.
197
-
198
- ### Actions-Only Features (no tables)
199
-
200
- A feature with no top-level `*.ts` files is "tableless" — every action must be standalone (have `path:`).
201
-
202
- ```typescript
203
- // quickback/features/utilities/actions/health-check.ts
204
- import { z } from "zod";
205
- import { defineAction } from "../.quickback/define-action";
206
-
207
- export default defineAction({
208
- description: "Health check",
209
- path: "/health",
210
- method: "GET",
211
- input: z.object({}),
212
- access: { roles: ["member", "admin"] },
213
- async execute() { return { ok: true }; },
214
- });
215
- ```
216
-
217
- ### Public Actions
218
-
219
- Use `roles: ["PUBLIC"]` for unauthenticated endpoints. Mandatory audit logged. The wildcard `"*"` is not supported.
220
-
221
- ```typescript
222
- access: { roles: ["PUBLIC"] } // No auth, audit logged
223
- access: { roles: ["member"] } // Requires auth + role
224
- ```
225
-
226
- ## Custom Dependencies
227
-
228
- ```typescript
229
- export default defineConfig({
230
- build: {
231
- dependencies: {
232
- "fast-xml-parser": "^4.5.0",
233
- },
234
- },
235
- });
236
- ```
237
-
238
- ## CMS Layouts
239
-
240
- ```typescript
241
- layouts: {
242
- default: {
243
- sections: [
244
- { label: "Details", columns: 2, fields: ["name", "email"] },
245
- { label: "Notes", collapsed: true, fields: ["notes"] },
246
- ],
247
- },
248
- }
249
- ```
250
-
251
- ## API Reference
252
-
253
- | Method | Endpoint | Description |
254
- |--------|----------|-------------|
255
- | `GET` | `/api/v1/{resource}` | List |
256
- | `GET` | `/api/v1/{resource}/:id` | Get |
257
- | `POST` | `/api/v1/{resource}` | Create |
258
- | `PATCH` | `/api/v1/{resource}/:id` | Update |
259
- | `DELETE` | `/api/v1/{resource}/:id` | Delete |
260
-
261
- Query params: `?limit=50&offset=0`, `?status=active`, `?sort=-createdAt`, `?fields=id,name`, `?search=text`
262
- Filter operators: `.gt`, `.gte`, `.lt`, `.lte`, `.ne`, `.like`, `.in`
263
-
264
- ## Database Dialects
265
-
266
- | Stack | Import | Table Function |
267
- |-------|--------|----------------|
268
- | Cloudflare D1 / SQLite | `drizzle-orm/sqlite-core` | `sqliteTable` |
269
- | Supabase / PostgreSQL | `drizzle-orm/pg-core` | `pgTable` |
270
-
271
- ## Migrations are generated — never hand-merge them
272
-
273
- The files under `quickback/drizzle/` (`*.sql`, `meta/_journal.json`, `meta/*_snapshot.json`) are **generated artifacts**, not source. Never hand-edit them, and never resolve a merge or rebase conflict inside them.
274
-
275
- When integrating a branch: get the feature/schema `.ts` files in first, then run `quickback compile`. The compiler regenerates the migrations from the merged schema and journals them in the correct (append-only) order. Hand-merging migration SQL or snapshots produces schema drift and broken ordering that only surfaces at deploy time. If a migration file conflicts during a merge, take either side to unblock, then recompile and let the compiler restate the migrations.
276
-
277
- ## CLI Commands
278
-
279
- ```bash
280
- quickback create <template> <name> # Create project
281
- quickback compile # Compile definitions
282
- quickback docs [topic] # Show documentation
283
- quickback claude install # Install Claude Code skill
284
- quickback cursor install # Install Cursor rules
285
- quickback codex install # Install Codex AGENTS.md rules
286
- ```
287
-
288
- ## Full Documentation
289
-
290
- https://docs.quickback.dev
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.test.d.ts","sourceRoot":"","sources":["../../src/commands/build.test.ts"],"names":[],"mappings":""}
@@ -1,16 +0,0 @@
1
- /**
2
- * Codex command - manage ChatGPT Codex AGENTS.md rules.
3
- *
4
- * Codex reads `AGENTS.md` from the project root (merging up the tree), so unlike
5
- * Cursor's dedicated .mdc file the rules live in a file the user may also own.
6
- * We therefore manage only a delimited block, leaving the rest of AGENTS.md
7
- * untouched.
8
- *
9
- * Usage:
10
- * quickback codex install # Add/update the Quickback block in ./AGENTS.md
11
- * quickback codex update # Alias for install (refresh the block)
12
- * quickback codex remove # Strip the Quickback block
13
- * quickback codex status # Check installation status
14
- */
15
- export declare function codex(args: string[]): Promise<void>;
16
- //# sourceMappingURL=codex.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/commands/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAwIH,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBzD"}
@@ -1,159 +0,0 @@
1
- /**
2
- * Codex command - manage ChatGPT Codex AGENTS.md rules.
3
- *
4
- * Codex reads `AGENTS.md` from the project root (merging up the tree), so unlike
5
- * Cursor's dedicated .mdc file the rules live in a file the user may also own.
6
- * We therefore manage only a delimited block, leaving the rest of AGENTS.md
7
- * untouched.
8
- *
9
- * Usage:
10
- * quickback codex install # Add/update the Quickback block in ./AGENTS.md
11
- * quickback codex update # Alias for install (refresh the block)
12
- * quickback codex remove # Strip the Quickback block
13
- * quickback codex status # Check installation status
14
- */
15
- import { readFileSync, writeFileSync, existsSync } from "fs";
16
- import { join, dirname } from "path";
17
- import { fileURLToPath } from "url";
18
- import pc from "picocolors";
19
- const __filename = fileURLToPath(import.meta.url);
20
- const __dirname = dirname(__filename);
21
- const CODEX_BUNDLE = join(__dirname, "..", "codex");
22
- const AGENTS_FILE = join(process.cwd(), "AGENTS.md");
23
- const BEGIN = "<!-- BEGIN QUICKBACK RULES (managed by `quickback codex`) -->";
24
- const END = "<!-- END QUICKBACK RULES -->";
25
- function bundledRules() {
26
- const file = join(CODEX_BUNDLE, "AGENTS.md");
27
- if (!existsSync(file)) {
28
- console.log(pc.red("\nCodex rules not found in CLI bundle."));
29
- console.log(pc.dim("This may indicate an incomplete CLI installation."));
30
- console.log(pc.dim("Try reinstalling: npm install -g @quickback-dev/cli\n"));
31
- return null;
32
- }
33
- return readFileSync(file, "utf-8").trim();
34
- }
35
- function escapeRegExp(s) {
36
- return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
37
- }
38
- /** Returns the AGENTS.md content with the Quickback block removed (trimmed). */
39
- function stripBlock(content) {
40
- const re = new RegExp(`\\n*${escapeRegExp(BEGIN)}[\\s\\S]*?${escapeRegExp(END)}\\n*`, "g");
41
- return content.replace(re, "\n").trim();
42
- }
43
- function hasBlock(content) {
44
- return content.includes(BEGIN) && content.includes(END);
45
- }
46
- function installRules() {
47
- const rules = bundledRules();
48
- if (rules === null)
49
- process.exit(1);
50
- const block = `${BEGIN}\n${rules}\n${END}`;
51
- let next;
52
- if (existsSync(AGENTS_FILE)) {
53
- const current = readFileSync(AGENTS_FILE, "utf-8");
54
- if (hasBlock(current)) {
55
- // Replace the existing managed block in place.
56
- const re = new RegExp(`${escapeRegExp(BEGIN)}[\\s\\S]*?${escapeRegExp(END)}`);
57
- next = current.replace(re, block).trimEnd() + "\n";
58
- }
59
- else {
60
- // Preserve the user's AGENTS.md; append our block.
61
- next = current.trimEnd() + `\n\n${block}\n`;
62
- }
63
- }
64
- else {
65
- next = `${block}\n`;
66
- }
67
- writeFileSync(AGENTS_FILE, next);
68
- console.log(pc.green(` ✓ Quickback rules block → ${AGENTS_FILE}`));
69
- console.log("");
70
- console.log(pc.green("✓ Quickback rules installed for Codex (AGENTS.md)"));
71
- console.log(pc.dim("Consider committing AGENTS.md to your repository.\n"));
72
- }
73
- async function install() {
74
- console.log("");
75
- console.log(pc.bold("Installing Quickback rules for Codex"));
76
- console.log("");
77
- installRules();
78
- }
79
- async function remove() {
80
- if (!existsSync(AGENTS_FILE) || !hasBlock(readFileSync(AGENTS_FILE, "utf-8"))) {
81
- console.log(pc.yellow("\nNo Quickback block found in AGENTS.md.\n"));
82
- return;
83
- }
84
- console.log("");
85
- console.log(pc.bold("Remove Quickback Codex rules"));
86
- console.log("");
87
- const stripped = stripBlock(readFileSync(AGENTS_FILE, "utf-8"));
88
- if (stripped === "") {
89
- // The file held only our block — remove it entirely.
90
- const { rmSync } = await import("fs");
91
- rmSync(AGENTS_FILE, { force: true });
92
- console.log(pc.yellow(` ✓ Removed ${AGENTS_FILE}`));
93
- }
94
- else {
95
- writeFileSync(AGENTS_FILE, stripped + "\n");
96
- console.log(pc.yellow(` ✓ Stripped Quickback block from ${AGENTS_FILE}`));
97
- }
98
- console.log("");
99
- console.log(pc.green("✓ Quickback Codex rules removed.\n"));
100
- }
101
- async function status() {
102
- console.log("");
103
- console.log(pc.bold("Quickback Codex Rules (AGENTS.md)"));
104
- console.log("");
105
- const installed = existsSync(AGENTS_FILE) && hasBlock(readFileSync(AGENTS_FILE, "utf-8"));
106
- if (installed) {
107
- console.log(` ${pc.green("●")} Installed`);
108
- console.log(pc.dim(` ${AGENTS_FILE}`));
109
- }
110
- else {
111
- console.log(` ${pc.dim("○")} Not installed`);
112
- console.log(pc.dim("Run 'quickback codex install' to install the rules.\n"));
113
- }
114
- console.log("");
115
- }
116
- function printHelp() {
117
- console.log(`
118
- ${pc.bold("Quickback Codex Rules (AGENTS.md)")}
119
-
120
- ${pc.bold("USAGE")}
121
- quickback codex <command>
122
-
123
- ${pc.bold("COMMANDS")}
124
- ${pc.cyan("install")} Add/update the Quickback block in ./AGENTS.md
125
- ${pc.cyan("update")} Refresh the block to the latest version
126
- ${pc.cyan("remove")} Strip the Quickback block
127
- ${pc.cyan("status")} Check installation status
128
-
129
- ${pc.bold("EXAMPLES")}
130
- ${pc.gray("# Install rules")}
131
- quickback codex install
132
- `);
133
- }
134
- export async function codex(args) {
135
- const subcommand = args[0];
136
- switch (subcommand) {
137
- case "install":
138
- case "update":
139
- await install();
140
- break;
141
- case "remove":
142
- case "uninstall":
143
- await remove();
144
- break;
145
- case "status":
146
- await status();
147
- break;
148
- case "--help":
149
- case "-h":
150
- case undefined:
151
- printHelp();
152
- break;
153
- default:
154
- console.log(pc.red(`\nUnknown subcommand: ${subcommand}`));
155
- printHelp();
156
- process.exit(1);
157
- }
158
- }
159
- //# sourceMappingURL=codex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/commands/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACpD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;AAErD,MAAM,KAAK,GAAG,+DAA+D,CAAC;AAC9E,MAAM,GAAG,GAAG,8BAA8B,CAAC;AAE3C,SAAS,YAAY;IACnB,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,mDAA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