@beignet/cli 0.0.48 → 0.0.50

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 (111) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +117 -22
  3. package/dist/analysis/contract-factories.d.ts +17 -0
  4. package/dist/analysis/contract-factories.d.ts.map +1 -0
  5. package/dist/analysis/contract-factories.js +176 -0
  6. package/dist/analysis/contract-factories.js.map +1 -0
  7. package/dist/analysis/layers.d.ts +5 -0
  8. package/dist/analysis/layers.d.ts.map +1 -0
  9. package/dist/analysis/layers.js +172 -0
  10. package/dist/analysis/layers.js.map +1 -0
  11. package/dist/analysis/port-wiring.d.ts +23 -0
  12. package/dist/analysis/port-wiring.d.ts.map +1 -0
  13. package/dist/analysis/port-wiring.js +379 -0
  14. package/dist/analysis/port-wiring.js.map +1 -0
  15. package/dist/analysis/source-index.d.ts +5 -0
  16. package/dist/analysis/source-index.d.ts.map +1 -1
  17. package/dist/analysis/source-index.js +171 -42
  18. package/dist/analysis/source-index.js.map +1 -1
  19. package/dist/analysis/workspace.d.ts +11 -4
  20. package/dist/analysis/workspace.d.ts.map +1 -1
  21. package/dist/analysis/workspace.js +78 -8
  22. package/dist/analysis/workspace.js.map +1 -1
  23. package/dist/app-map-changes.d.ts +103 -0
  24. package/dist/app-map-changes.d.ts.map +1 -0
  25. package/dist/app-map-changes.js +949 -0
  26. package/dist/app-map-changes.js.map +1 -0
  27. package/dist/app-map.d.ts.map +1 -1
  28. package/dist/app-map.js +311 -92
  29. package/dist/app-map.js.map +1 -1
  30. package/dist/check.js +37 -3
  31. package/dist/check.js.map +1 -1
  32. package/dist/explain.js +4 -4
  33. package/dist/explain.js.map +1 -1
  34. package/dist/git-changes.d.ts +30 -0
  35. package/dist/git-changes.d.ts.map +1 -0
  36. package/dist/git-changes.js +367 -0
  37. package/dist/git-changes.js.map +1 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +26 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/inspect.d.ts.map +1 -1
  42. package/dist/inspect.js +706 -186
  43. package/dist/inspect.js.map +1 -1
  44. package/dist/lib.d.ts +3 -0
  45. package/dist/lib.d.ts.map +1 -1
  46. package/dist/lib.js +1 -0
  47. package/dist/lib.js.map +1 -1
  48. package/dist/lint.d.ts.map +1 -1
  49. package/dist/lint.js +309 -487
  50. package/dist/lint.js.map +1 -1
  51. package/dist/make/inbox.d.ts.map +1 -1
  52. package/dist/make/inbox.js +11 -4
  53. package/dist/make/inbox.js.map +1 -1
  54. package/dist/make/payments.js +2 -2
  55. package/dist/make/shared.d.ts.map +1 -1
  56. package/dist/make/shared.js +31 -27
  57. package/dist/make/shared.js.map +1 -1
  58. package/dist/make.d.ts.map +1 -1
  59. package/dist/make.js +144 -8
  60. package/dist/make.js.map +1 -1
  61. package/dist/mcp.d.ts +1 -1
  62. package/dist/mcp.d.ts.map +1 -1
  63. package/dist/mcp.js +43 -21
  64. package/dist/mcp.js.map +1 -1
  65. package/dist/provider-add.d.ts.map +1 -1
  66. package/dist/provider-add.js +142 -7
  67. package/dist/provider-add.js.map +1 -1
  68. package/dist/registry-edits.d.ts +7 -0
  69. package/dist/registry-edits.d.ts.map +1 -1
  70. package/dist/registry-edits.js +237 -53
  71. package/dist/registry-edits.js.map +1 -1
  72. package/dist/templates/agents.d.ts.map +1 -1
  73. package/dist/templates/agents.js +37 -1
  74. package/dist/templates/agents.js.map +1 -1
  75. package/dist/templates/base.d.ts.map +1 -1
  76. package/dist/templates/base.js +13 -2
  77. package/dist/templates/base.js.map +1 -1
  78. package/dist/templates/server.d.ts.map +1 -1
  79. package/dist/templates/server.js +2 -0
  80. package/dist/templates/server.js.map +1 -1
  81. package/dist/templates/shared.d.ts +1 -0
  82. package/dist/templates/shared.d.ts.map +1 -1
  83. package/dist/templates/shared.js +3 -2
  84. package/dist/templates/shared.js.map +1 -1
  85. package/package.json +7 -6
  86. package/skills/app-structure/SKILL.md +71 -7
  87. package/src/analysis/contract-factories.ts +256 -0
  88. package/src/analysis/layers.ts +266 -0
  89. package/src/analysis/port-wiring.ts +506 -0
  90. package/src/analysis/source-index.ts +225 -57
  91. package/src/analysis/workspace.ts +134 -9
  92. package/src/app-map-changes.ts +1462 -0
  93. package/src/app-map.ts +418 -109
  94. package/src/check.ts +51 -3
  95. package/src/explain.ts +4 -4
  96. package/src/git-changes.ts +511 -0
  97. package/src/index.ts +39 -1
  98. package/src/inspect.ts +1005 -238
  99. package/src/lib.ts +21 -0
  100. package/src/lint.ts +393 -643
  101. package/src/make/inbox.ts +11 -4
  102. package/src/make/payments.ts +2 -2
  103. package/src/make/shared.ts +31 -27
  104. package/src/make.ts +225 -8
  105. package/src/mcp.ts +51 -24
  106. package/src/provider-add.ts +186 -7
  107. package/src/registry-edits.ts +313 -63
  108. package/src/templates/agents.ts +37 -1
  109. package/src/templates/base.ts +13 -2
  110. package/src/templates/server.ts +2 -0
  111. package/src/templates/shared.ts +3 -2
@@ -41,6 +41,9 @@ https://beignetjs.com (agent-friendly index at https://beignetjs.com/llms.txt).
41
41
  README.md covers setup and the app map; this file covers what is not
42
42
  discoverable from the code.
43
43
 
44
+ This app requires Node.js 22.12 or newer. Bun 1.3.14 or newer is supported for
45
+ Beignet commands.
46
+
44
47
  ## Registration is explicit
45
48
 
46
49
  Hand-writing an artifact file does not wire it into the app. Non-registration
@@ -54,8 +57,15 @@ is a silent failure — the file exists but never runs:
54
57
  - Tasks must be added to \`defineTasks([...])\` in \`server/tasks.ts\`.
55
58
  - Outbox events and jobs must be registered in \`defineOutboxRegistry({...})\`
56
59
  in \`server/outbox.ts\`.
60
+ - An outbox registry containing jobs also requires \`jobs: JobDispatcherPort\`
61
+ to be bound directly or deferred to a provider. \`${cli} make job\` installs
62
+ an app-owned inline dispatcher only when no dispatcher is already wired;
63
+ adding an Inngest or BullMQ preset later replaces only that marked generated
64
+ fallback and rejects unmarked custom inline wiring as a conflict.
57
65
  - Listeners must be added to the \`listeners\` array in \`server/listeners.ts\`
58
66
  and wired through a \`registerListeners(...)\` call in server provider wiring.
67
+ Register them in \`start()\`, await \`registration.ready\`, and await
68
+ \`registration.unsubscribe()\` in \`stop()\`.
59
69
  - Apps using Inngest must also spread feature job registries into
60
70
  \`inngestJobs\` in \`server/inngest.ts\`.
61
71
  - Apps using runtime integrity must list workflow registries in
@@ -106,6 +116,7 @@ apps have reimplemented by accident:
106
116
 
107
117
  | Need | Use |
108
118
  | --- | --- |${capabilityClientRow}
119
+ | Query parameters on an HTTP contract | Pass both the Standard Schema and an explicit \`defineQueryTransport({ ... })\` to \`.query(schema, transport)\`. Use \`query.string()\`, \`query.number()\`, \`query.integer()\`, \`query.boolean()\`, \`query.dateTime()\`, \`query.date()\`, repeated scalar arrays, or one flat \`deepObject\`; never make schema coercion define the URL format. |
109
120
  | App context outside HTTP — agents, queues, scripts, backfills | \`server.createServiceContext(input)\`, or \`server.runServiceContext(input, fn)\` in one-off scripts. Never hand-assemble a context or call \`gate.attach(...)\` — the server owns gate attachment. |
110
121
  | Ports outside a request — auth callbacks, module-level helpers | \`const { ports } = await getServer()\` (dynamic \`import("@/server")\` breaks module cycles). Do not construct parallel provider clients or fall back to \`console.*\` when \`ports.logger\` exists. |
111
122
  | Routes that cannot be contracts — webhooks, third-party callbacks, streaming | \`createWebhookRoute\`, \`createPaymentWebhookRoute\`, \`createScheduleRoute\`, \`createOutboxDrainRoute\` from \`@beignet/next\`; \`server.rawRoute(...)\` for anything else. All run the hooks pipeline — never hand-enforce rate limits in a route body. |
@@ -133,6 +144,13 @@ formatting. The individual commands (\`${lint}\`, \`${cli} lint\`,
133
144
  \`${cli} doctor --strict\`, \`${test}\`, \`${typecheck}\`) still work when you
134
145
  need one check alone.
135
146
 
147
+ Beignet's architecture lint parses TypeScript imports and re-exports,
148
+ \`require()\`, import assignments, and literal dynamic imports, then follows
149
+ local value imports through feature-root helpers. When lint cannot verify a
150
+ computed module reference inside a constrained layer, use a string-literal
151
+ specifier or move runtime loading behind an allowed boundary. Move near-miss
152
+ feature layers to the canonical path named in the diagnostic.
153
+
136
154
  Before exploring unfamiliar code, run \`${cli} map\` for the human inventory
137
155
  or \`${cli} map --json --feature <name>\` for an evidence-backed graph scoped
138
156
  to one feature. The graph honors the app's complete TypeScript \`baseUrl\` and
@@ -141,6 +159,15 @@ to one feature. The graph honors the app's complete TypeScript \`baseUrl\` and
141
159
  edges as proof that no relationship exists. Registration diagnostics expose
142
160
  the declaration as \`subject.file\` and \`subject.exportName\`.
143
161
 
162
+ After editing in a Git worktree, run \`${cli} map --changed\` before the full
163
+ check. It reports direct changes, reverse imports, one-hop semantic consumers,
164
+ feature context, and unresolved evidence without claiming that the change is
165
+ correct. Use \`--base <local-ref>\` for branch-wide impact from the merge base;
166
+ Beignet never fetches the ref. Recognized guide files and
167
+ root documentation-directory content stay non-impacting; other \`.mdx\` and
168
+ \`.txt\` paths remain application changes. Changed files with no mapped concept
169
+ appear as explicit gaps.
170
+
144
171
  ## Package skills
145
172
 
146
173
  This app trusts Beignet's package-shipped agent skills through
@@ -157,6 +184,12 @@ skill-loading block.
157
184
 
158
185
  ## Placement rules
159
186
 
187
+ - Checked-in SQL migrations and Drizzle metadata live in root \`drizzle/\`.
188
+ - Seed generators compose feature seeds through the optional
189
+ \`server/seed.ts\` entrypoint.
190
+ - Long-running runtime entrypoints such as BullMQ workers live under optional
191
+ \`server/workers/\`; never start worker loops in lifecycle providers or
192
+ serverless route modules.
160
193
  - Feature artifacts live under \`features/<feature>/\`, with tests in
161
194
  \`features/<feature>/tests/\` (not \`__tests__/\`).
162
195
  - Feature-specific client data-fetching helpers, query options, mutation
@@ -188,7 +221,10 @@ stable operation IDs, hashes, exact patches, and current diagnostics before
188
221
  passing its \`planId\` and optional \`fixIds\` to \`doctor_fix\`. Guarded
189
222
  apply returns the same plan metadata and inspection payload as the CLI. Use
190
223
  \`app_map\` before broad code search and pass a feature
191
- or node kinds to keep context focused. Use \`explain\` for source-backed
224
+ or node kinds to keep context focused. After edits, pass
225
+ \`{ changed: true, base?: string }\` for the same report as
226
+ \`${cli} map --changed --json\`; changed mode rejects projection and diagnostic
227
+ inputs. Use \`explain\` for source-backed
192
228
  relationships, conventions, findings, and suggested files for any mapped
193
229
  concept or diagnostic; its kinds match the app map. Use \`check\` after edits
194
230
  to run the complete validation loop; it returns the same versioned result as
@@ -111,6 +111,9 @@ export function packageJson(ctx: TemplateContext): string {
111
111
  version: "0.1.0",
112
112
  private: true,
113
113
  type: "module",
114
+ engines: {
115
+ node: ">=22.12.0",
116
+ },
114
117
  scripts,
115
118
  intent: {
116
119
  skills: intentSkillPackages(ctx),
@@ -244,6 +247,9 @@ route groups such as \`app/(app)\` are not part of the URL.
244
247
 
245
248
  Beignet app scaffolded with \`@beignet/cli\`.
246
249
 
250
+ Node.js 22.12 or newer is required. Bun 1.3.14 or newer is supported for
251
+ Beignet commands.
252
+
247
253
  ## Getting started
248
254
 
249
255
  \`\`\`bash
@@ -282,7 +288,9 @@ use cases, workflows, ports, providers, and tests connect. \`check\` runs the
282
288
  whole validation loop in one pass: \`${cli} lint\` (dependency direction),
283
289
  \`${cli} doctor --strict\` (route, OpenAPI, and resource drift), and the
284
290
  \`lint\`, \`typecheck\`, and \`test\` package scripts. Use \`${format}\` to
285
- apply Biome formatting.
291
+ apply Biome formatting. Beignet lint uses the TypeScript import graph, follows
292
+ feature-root helpers, and reports unverifiable computed module references in
293
+ constrained layers.
286
294
  ${testingNotes}
287
295
  ## Coding agents
288
296
 
@@ -316,7 +324,10 @@ Use \`${cli} make feature projects --recipe full-slice\` when you want a richer
316
324
 
317
325
  Run \`${cli} map\` for the current architecture or \`${cli} map --json\` for
318
326
  the versioned graph used by coding agents. Add \`--feature todos\` to focus on
319
- one slice and its direct relationships.
327
+ one slice and its direct relationships. After editing in a Git worktree, run
328
+ \`${cli} map --changed\` to inspect direct changes, potential semantic
329
+ consumers, feature context, and unresolved evidence before \`${cli} check\`.
330
+ The changed map is report-only and does not prove correctness.
320
331
 
321
332
  - \`features/todos/contracts.ts\` owns the HTTP contract and reuses shared feature schemas.
322
333
  - \`features/todos/schemas.ts\` owns shared DTO and validation schemas used by contracts, use cases, ports, tests, and clients.
@@ -696,6 +696,8 @@ export const { GET, POST } = createDevtoolsRoute(
696
696
  {
697
697
  basePath: "/api/devtools",
698
698
  enabled: env.DEVTOOLS_ENABLED,
699
+ authorize: async (req) =>
700
+ Boolean(await (await getServer()).ports.auth.getSession(req)),
699
701
  },
700
702
  );
701
703
  `,
@@ -37,7 +37,7 @@ export const externalVersions = {
37
37
  reactDom: "^19.2.5",
38
38
  tsx: "^4.22.4",
39
39
  typescript: "^5.3.0",
40
- typesNode: "^20.10.0",
40
+ typesNode: "^22.0.0",
41
41
  typesReact: "^19.0.0",
42
42
  typesReactDom: "^19.0.0",
43
43
  zod: "^4.0.0",
@@ -62,7 +62,8 @@ export const externalVersions = {
62
62
  openFeatureServerSdk: "^1.22.0",
63
63
  typesPg: "^8.11.0",
64
64
  ioredis: "^5.0.0",
65
- awsSdkS3: "^3.955.0",
65
+ awsSdkS3: "^3.1050.0",
66
+ awsSdkLibStorage: "3.1050.0",
66
67
  upstashRateLimit: "^2.0.0",
67
68
  upstashRedis: "^1.0.0",
68
69
  };