@pikku/cli 0.12.93 → 0.12.99

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 (346) hide show
  1. package/console-app/assets/abnfDiagram-VRR7QNED-CytV-CG1.js +1 -0
  2. package/console-app/assets/arc-C5PvmnaA.js +1 -0
  3. package/console-app/assets/architecture-TIHT7OUA-C1_ScvPX.js +1 -0
  4. package/console-app/assets/architectureDiagram-ZJ3FMSHR-CJ2xb7C-.js +36 -0
  5. package/console-app/assets/array-BifhSqXX.js +1 -0
  6. package/console-app/assets/blockDiagram-677ZJIJ3-CCecrBrk.js +132 -0
  7. package/console-app/assets/c4Diagram-LMCZKHZV-CBnpukvQ.js +10 -0
  8. package/console-app/assets/channel-CwDOkXGI.js +1 -0
  9. package/console-app/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  10. package/console-app/assets/chunk-32BRIVSS-D8qWWZRQ.js +1 -0
  11. package/console-app/assets/chunk-52WLFC77-BEpXHMsp.js +10 -0
  12. package/console-app/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
  13. package/console-app/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
  14. package/console-app/assets/chunk-C7G6YPKG-DsHUMkOp.js +1 -0
  15. package/console-app/assets/chunk-EX3LRPZG-mM7TjVx9.js +231 -0
  16. package/console-app/assets/chunk-FWX5IMBZ-CndRAn18.js +2 -0
  17. package/console-app/assets/chunk-HOUHSVGY-D1kT8umn.js +1 -0
  18. package/console-app/assets/chunk-ICXQ74PX-CeSaGyro.js +2 -0
  19. package/console-app/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  20. package/console-app/assets/chunk-KEIR6QF5-DNzq6p3w.js +161 -0
  21. package/console-app/assets/chunk-MOJQB5TN-CaZOCHYr.js +88 -0
  22. package/console-app/assets/chunk-OGEWGWER-CnB1CsPt.js +1 -0
  23. package/console-app/assets/chunk-PUDLZKDR-BbGulHJm.js +156 -0
  24. package/console-app/assets/chunk-Q4XR5HBZ-BywwzeeR.js +70 -0
  25. package/console-app/assets/chunk-RYQCIY6F-CV0R1Adv.js +1 -0
  26. package/console-app/assets/chunk-V7JOEXUC-DGFaAWzB.js +206 -0
  27. package/console-app/assets/chunk-VAUOI2AC-DxPUd8Yb.js +1 -0
  28. package/console-app/assets/chunk-VR4S4FIN-D4-UaW_J.js +1 -0
  29. package/console-app/assets/chunk-WYO6CB5R-D_TFN0d9.js +127 -0
  30. package/console-app/assets/chunk-XXDRQBXY-BzVuweA_.js +1 -0
  31. package/console-app/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  32. package/console-app/assets/chunk-ZGVPDNZ5-C6hdkGQb.js +62 -0
  33. package/console-app/assets/chunk-ZIRB5QZD-H-kepumB.js +32 -0
  34. package/console-app/assets/classDiagram-OUVF2IWQ-CTYJkTT0.js +1 -0
  35. package/console-app/assets/classDiagram-v2-EOCWNBFH-CTYJkTT0.js +1 -0
  36. package/console-app/assets/cose-bilkent-JH36ORCC-B6ZPxN6v.js +1 -0
  37. package/console-app/assets/cynefin-VYW2F7L2-D_nmxNz_.js +1 -0
  38. package/console-app/assets/cynefinDiagram-TSTJHNR4-CHy5QN0S.js +62 -0
  39. package/console-app/assets/cytoscape.esm-h6BdjjI9.js +321 -0
  40. package/console-app/assets/dagre-CXRCoUWR.js +1 -0
  41. package/console-app/assets/dagre-VKFMJZFB-DYfukM34.js +4 -0
  42. package/console-app/assets/defaultLocale-C8Fc0cco.js +1 -0
  43. package/console-app/assets/diagram-FQU43EPY-Dgb9TPSB.js +3 -0
  44. package/console-app/assets/diagram-G47NLZAW-CnFNZs9Z.js +24 -0
  45. package/console-app/assets/diagram-NH7WQ7WH-DN7h2DU-.js +24 -0
  46. package/console-app/assets/diagram-OA4YK3LP-RLaQaNtK.js +30 -0
  47. package/console-app/assets/diagram-WEI45ONY-DxHWhVGd.js +41 -0
  48. package/console-app/assets/dist-BaJNIo4I.js +1 -0
  49. package/console-app/assets/ebnfDiagram-CCIWWBDH-UN3Z81-l.js +1 -0
  50. package/console-app/assets/erDiagram-Q63AITRT-C9lGAY3i.js +85 -0
  51. package/console-app/assets/eventmodeling-45OFAUF4-Dc5wNSSK.js +1 -0
  52. package/console-app/assets/flowDiagram-23GEKE2U-zPyGHMi4.js +1 -0
  53. package/console-app/assets/ganttDiagram-NO4QXBWP-CvBjBcdK.js +292 -0
  54. package/console-app/assets/gitGraph-TEB2WS4Q-Cs5Z9jMo.js +1 -0
  55. package/console-app/assets/gitGraphDiagram-IHSO6WYX-B0i_IJ5r.js +106 -0
  56. package/console-app/assets/graphlib-B8gBHxth.js +1 -0
  57. package/console-app/assets/{index-CmAplHjZ.js → index-71U8EEj7.js} +155 -153
  58. package/console-app/assets/{index-BYj7ZbUU.css → index-BXMjqLQ5.css} +1 -1
  59. package/console-app/assets/info-DKCQHKI2-DHL0afNl.js +1 -0
  60. package/console-app/assets/infoDiagram-FWYZ7A6U-CBWykodX.js +2 -0
  61. package/console-app/assets/init-D6jRqBbL.js +1 -0
  62. package/console-app/assets/ishikawaDiagram-FXEZZL3T-DM377eW_.js +70 -0
  63. package/console-app/assets/journeyDiagram-5HDEW3XC-BpX_-Cns.js +139 -0
  64. package/console-app/assets/kanban-definition-HUTT4EX6-D3xFsQkO.js +89 -0
  65. package/console-app/assets/katex-Vhh-h91d.js +257 -0
  66. package/console-app/assets/line-CTSKHTE0.js +1 -0
  67. package/console-app/assets/linear-R5GlBvXT.js +1 -0
  68. package/console-app/assets/map-DsCK-0Cs.js +1 -0
  69. package/console-app/assets/mermaid-parser.core-CkHk4BPi.js +7 -0
  70. package/console-app/assets/mermaid.core-CcjGXuV6.js +11 -0
  71. package/console-app/assets/mindmap-definition-LN4V7U3C-CtolazqQ.js +96 -0
  72. package/console-app/assets/ordinal-hYBb2elL.js +1 -0
  73. package/console-app/assets/packet-7NZHBO7P-BxSOj_Ny.js +1 -0
  74. package/console-app/assets/path-BWPyau1x.js +1 -0
  75. package/console-app/assets/pegDiagram-2B236MQR-BNsMtxsM.js +1 -0
  76. package/console-app/assets/pie-RZYD4A2V-BbkKQBA5.js +1 -0
  77. package/console-app/assets/pieDiagram-ENE6RG2P-BAZLIz2f.js +39 -0
  78. package/console-app/assets/quadrantDiagram-ABIIQ3AL-Dpvn-1Fs.js +7 -0
  79. package/console-app/assets/radar-I7S5WNFK-B-uKXIAH.js +1 -0
  80. package/console-app/assets/railroad-3IZDKUUU-BHXXK04t.js +1 -0
  81. package/console-app/assets/railroad-abnf-AHOZXSZD-tXSQaBvY.js +1 -0
  82. package/console-app/assets/railroad-ebnf-EBAXGLYW-DG3aohR0.js +1 -0
  83. package/console-app/assets/railroad-peg-LSFZ7HO6-DY_gBA-x.js +1 -0
  84. package/console-app/assets/railroadDiagram-RFXS5EU6-DfUApEQj.js +1 -0
  85. package/console-app/assets/requirementDiagram-TGXJPOKE-B2zX0jqo.js +84 -0
  86. package/console-app/assets/rough.esm-CSKSodPl.js +1 -0
  87. package/console-app/assets/sankeyDiagram-HTMAVEWB-CbQ2zc7z.js +40 -0
  88. package/console-app/assets/sequenceDiagram-DBY2YBRQ-BLT8PXI_.js +162 -0
  89. package/console-app/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
  90. package/console-app/assets/src-BLuPUFWW.js +1 -0
  91. package/console-app/assets/stateDiagram-2N3HPSRC-BvEyVp85.js +1 -0
  92. package/console-app/assets/stateDiagram-v2-6OUMAXLB-RGKS9iU4.js +1 -0
  93. package/console-app/assets/swimlanes-5IMT3BWC-1AZ459s6.js +2 -0
  94. package/console-app/assets/swimlanesDiagram-G3AALYLV-Ck_0-rfN.js +8 -0
  95. package/console-app/assets/timeline-definition-FHXFAJF6-dLuvH4s2.js +120 -0
  96. package/console-app/assets/treeView-QDETBFTQ-xL2msjo2.js +1 -0
  97. package/console-app/assets/treemap-6X3UGDF4-C98ichVP.js +1 -0
  98. package/console-app/assets/vennDiagram-L72KCM5P-HbUmidhv.js +34 -0
  99. package/console-app/assets/wardley-OPB4EBWU-C4gJS-m2.js +1 -0
  100. package/console-app/assets/wardleyDiagram-EHGQE667-B7b-LB02.js +78 -0
  101. package/console-app/assets/xychartDiagram-FW5EYKEG-Cm03zUGy.js +7 -0
  102. package/console-app/index.html +2 -2
  103. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  104. package/dist/.pikku/auth/auth.types.d.ts +1 -1
  105. package/dist/.pikku/auth/auth.types.js +1 -1
  106. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  107. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  108. package/dist/.pikku/cli/pikku-cli-channel.d.ts +13 -15
  109. package/dist/.pikku/cli/pikku-cli-channel.js +62 -8
  110. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +14 -4
  111. package/dist/.pikku/cli/pikku-cli-client.gen.js +55 -18
  112. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  113. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  114. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  115. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  116. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  117. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +136 -10
  118. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  119. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  120. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  121. package/dist/.pikku/cli/pikku-cli.gen.js +18 -2
  122. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  123. package/dist/.pikku/function/pikku-function-types.gen.d.ts +64 -23
  124. package/dist/.pikku/function/pikku-function-types.gen.js +27 -1
  125. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  126. package/dist/.pikku/function/pikku-functions-meta.gen.json +171 -37
  127. package/dist/.pikku/function/pikku-functions.gen.js +13 -3
  128. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  129. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  130. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  131. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  132. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  133. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
  134. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  135. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  136. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  137. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  138. package/dist/.pikku/pikku-services.gen.d.ts +2 -1
  139. package/dist/.pikku/pikku-services.gen.js +1 -0
  140. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  141. package/dist/.pikku/pikku-types.gen.js +1 -1
  142. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  143. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  144. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  145. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  146. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  147. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  148. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +8 -1
  149. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  150. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  151. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  152. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  153. package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
  154. package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
  155. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  156. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  157. package/dist/.pikku/schemas/register.gen.js +15 -5
  158. package/dist/.pikku/schemas/schemas/DbResetInput.schema.json +1 -1
  159. package/dist/.pikku/schemas/schemas/PersonaRunInput.schema.json +1 -0
  160. package/dist/.pikku/schemas/schemas/PersonaSyncInput.schema.json +1 -0
  161. package/dist/.pikku/schemas/schemas/PikkuPersonasInput.schema.json +1 -0
  162. package/dist/.pikku/schemas/schemas/PikkuRolesInput.schema.json +1 -0
  163. package/dist/.pikku/schemas/schemas/PikkuVirtualUserFunctionsOutput.schema.json +1 -0
  164. package/dist/.pikku/schemas/schemas/RolesPruneInput.schema.json +1 -0
  165. package/dist/.pikku/scopes/pikku-personas-meta.gen.json +1 -0
  166. package/dist/.pikku/scopes/pikku-personas.gen.d.ts +36 -0
  167. package/dist/.pikku/scopes/pikku-personas.gen.js +17 -0
  168. package/dist/.pikku/scopes/pikku-roles-meta.gen.json +1 -0
  169. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +30 -0
  170. package/dist/.pikku/scopes/pikku-roles.gen.js +18 -0
  171. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +4 -2
  172. package/dist/.pikku/scopes/pikku-scope-types.gen.js +3 -2
  173. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  174. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +2 -2
  175. package/dist/.pikku/secrets/pikku-secret-types.gen.js +2 -2
  176. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  177. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  178. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  179. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  180. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +2 -2
  181. package/dist/.pikku/variables/pikku-variable-types.gen.js +2 -2
  182. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  183. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  184. package/dist/.pikku/workflow/meta/allWorkflow.gen.json +46 -16
  185. package/dist/.pikku/workflow/pikku-personas.gen.d.ts +15 -0
  186. package/dist/.pikku/workflow/pikku-personas.gen.js +17 -0
  187. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +101 -24
  188. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +22 -2
  189. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  190. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  191. package/dist/bin/pikku-bin.mjs +2 -2
  192. package/dist/bin/pikku.js +0 -0
  193. package/dist/src/cli.wiring.js +108 -8
  194. package/dist/src/deploy/analyzer/analyzer.js +14 -0
  195. package/dist/src/deploy/analyzer/manifest.d.ts +11 -0
  196. package/dist/src/fabric/functions/validate.function.js +77 -177
  197. package/dist/src/functions/commands/all.d.ts +1 -1
  198. package/dist/src/functions/commands/bootstrap.d.ts +1 -1
  199. package/dist/src/functions/commands/bootstrap.js +3 -0
  200. package/dist/src/functions/commands/db-audit.js +1 -1
  201. package/dist/src/functions/commands/db-baseline.js +1 -1
  202. package/dist/src/functions/commands/db-check.js +6 -5
  203. package/dist/src/functions/commands/db-codegen.js +1 -1
  204. package/dist/src/functions/commands/db-generate.js +1 -1
  205. package/dist/src/functions/commands/db-migrate.js +1 -1
  206. package/dist/src/functions/commands/db-reset.d.ts +15 -1
  207. package/dist/src/functions/commands/db-reset.js +18 -6
  208. package/dist/src/functions/commands/db-shared.d.ts +14 -0
  209. package/dist/src/functions/commands/deploy-info.d.ts +1 -1
  210. package/dist/src/functions/commands/dev-ai-runner.d.ts +16 -4
  211. package/dist/src/functions/commands/dev-ai-runner.js +63 -29
  212. package/dist/src/functions/commands/dev.js +10 -5
  213. package/dist/src/functions/commands/enable.d.ts +8 -8
  214. package/dist/src/functions/commands/enable.js +15 -19
  215. package/dist/src/functions/commands/{scenario-environment.d.ts → environment.d.ts} +9 -6
  216. package/dist/src/functions/commands/{scenario-environment.js → environment.js} +5 -4
  217. package/dist/src/functions/commands/new-addon.js +14 -14
  218. package/dist/src/functions/commands/persona-sync.d.ts +33 -0
  219. package/dist/src/functions/commands/persona-sync.js +151 -0
  220. package/dist/src/functions/commands/persona.d.ts +58 -0
  221. package/dist/src/functions/commands/persona.js +215 -0
  222. package/dist/src/functions/commands/roles-audit.d.ts +1 -0
  223. package/dist/src/functions/commands/roles-audit.js +37 -0
  224. package/dist/src/functions/commands/roles-prune.d.ts +16 -0
  225. package/dist/src/functions/commands/roles-prune.js +52 -0
  226. package/dist/src/functions/commands/roles-shared.d.ts +40 -0
  227. package/dist/src/functions/commands/roles-shared.js +77 -0
  228. package/dist/src/functions/commands/scenario-browser.d.ts +3 -3
  229. package/dist/src/functions/commands/scenario-browser.js +1 -1
  230. package/dist/src/functions/commands/scenario-ladder.d.ts +44 -2
  231. package/dist/src/functions/commands/scenario-ladder.js +52 -3
  232. package/dist/src/functions/commands/scenario.d.ts +7 -0
  233. package/dist/src/functions/commands/scenario.js +82 -18
  234. package/dist/src/functions/commands/scopes-shared.d.ts +12 -0
  235. package/dist/src/functions/commands/scopes-shared.js +2 -2
  236. package/dist/src/functions/commands/serve.js +8 -4
  237. package/dist/src/functions/commands/versions-check.js +3 -3
  238. package/dist/src/functions/commands/virtual-user-formatter.d.ts +30 -0
  239. package/dist/src/functions/commands/virtual-user-formatter.js +65 -0
  240. package/dist/src/functions/db/annotation-parser.d.ts +14 -0
  241. package/dist/src/functions/db/annotation-parser.js +50 -2
  242. package/dist/src/functions/db/better-auth-schema.js +2 -1
  243. package/dist/src/functions/db/db-codegen.d.ts +12 -0
  244. package/dist/src/functions/db/db-codegen.js +149 -16
  245. package/dist/src/functions/db/local-db.d.ts +87 -6
  246. package/dist/src/functions/db/local-db.js +239 -35
  247. package/dist/src/functions/db/sqlite/dev-seed.d.ts +12 -0
  248. package/dist/src/functions/db/sqlite/dev-seed.js +23 -0
  249. package/dist/src/functions/db/sqlite/sqlite-runtime-bun.js +1 -1
  250. package/dist/src/functions/validate/bootstrap-checks.d.ts +19 -0
  251. package/dist/src/functions/validate/bootstrap-checks.js +90 -0
  252. package/dist/src/functions/validate/persona-checks.d.ts +24 -0
  253. package/dist/src/functions/validate/persona-checks.js +136 -0
  254. package/dist/src/functions/validate/scenario-file-checks.d.ts +17 -0
  255. package/dist/src/functions/validate/scenario-file-checks.js +123 -0
  256. package/dist/src/functions/validate/shared-checks.d.ts +59 -0
  257. package/dist/src/functions/validate/shared-checks.js +311 -0
  258. package/dist/src/functions/validate/workspace-validate.d.ts +1 -2
  259. package/dist/src/functions/validate/workspace-validate.js +4 -196
  260. package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.js +2 -1
  261. package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +1 -0
  262. package/dist/src/functions/wirings/auth/serialize-auth-gen.d.ts +2 -2
  263. package/dist/src/functions/wirings/auth/serialize-auth-gen.js +24 -9
  264. package/dist/src/functions/wirings/auth/serialize-auth-types.d.ts +3 -1
  265. package/dist/src/functions/wirings/auth/serialize-auth-types.js +3 -1
  266. package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -1
  267. package/dist/src/functions/wirings/channels/serialize-typed-channel-map.js +10 -2
  268. package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +9 -4
  269. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.d.ts +7 -3
  270. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +64 -28
  271. package/dist/src/functions/wirings/cli/serialize-channel-cli.js +63 -6
  272. package/dist/src/functions/wirings/cli/serialize-cli-entrypoint-guard.d.ts +12 -0
  273. package/dist/src/functions/wirings/cli/serialize-cli-entrypoint-guard.js +28 -0
  274. package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +4 -1
  275. package/dist/src/functions/wirings/console/serialize-console-functions.js +5 -8
  276. package/dist/src/functions/wirings/functions/serialize-addon-types.js +1 -1
  277. package/dist/src/functions/wirings/functions/serialize-function-types.js +106 -32
  278. package/dist/src/functions/wirings/middleware/serialize-middleware-imports.js +25 -9
  279. package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +3 -3
  280. package/dist/src/functions/wirings/package/serialize-package-types.js +5 -3
  281. package/dist/src/functions/wirings/personas/personas-secrets-file.d.ts +8 -0
  282. package/dist/src/functions/wirings/personas/personas-secrets-file.js +9 -0
  283. package/dist/src/functions/wirings/personas/pikku-command-personas.d.ts +7 -0
  284. package/dist/src/functions/wirings/personas/pikku-command-personas.js +57 -0
  285. package/dist/src/functions/wirings/personas/serialize-personas-secrets.d.ts +16 -0
  286. package/dist/src/functions/wirings/personas/serialize-personas-secrets.js +34 -0
  287. package/dist/src/functions/wirings/personas/serialize-personas-types.d.ts +18 -0
  288. package/dist/src/functions/wirings/personas/serialize-personas-types.js +76 -0
  289. package/dist/src/functions/wirings/queue/serialize-queue-map.js +2 -1
  290. package/dist/src/functions/wirings/queue/serialize-queue-wrapper.js +2 -1
  291. package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +2 -1
  292. package/dist/src/functions/wirings/roles/pikku-command-roles.d.ts +7 -0
  293. package/dist/src/functions/wirings/roles/pikku-command-roles.js +33 -0
  294. package/dist/src/functions/wirings/roles/serialize-roles-types.d.ts +14 -0
  295. package/dist/src/functions/wirings/roles/serialize-roles-types.js +55 -0
  296. package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +2 -1
  297. package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.d.ts +3 -3
  298. package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.js +3 -3
  299. package/dist/src/functions/wirings/scopes/serialize-scopes-types.d.ts +1 -1
  300. package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +1 -1
  301. package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.js +2 -1
  302. package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.js +2 -2
  303. package/dist/src/functions/wirings/virtual-user/pikku-command-virtual-user-functions.d.ts +1 -0
  304. package/dist/src/functions/wirings/virtual-user/pikku-command-virtual-user-functions.js +42 -0
  305. package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.d.ts +28 -0
  306. package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.js +439 -0
  307. package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +2 -1
  308. package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +13 -13
  309. package/dist/src/functions/wirings/workflow/serialize-personas.d.ts +10 -0
  310. package/dist/src/functions/wirings/workflow/serialize-personas.js +46 -0
  311. package/dist/src/functions/wirings/workflow/serialize-scenario-step-map.js +13 -4
  312. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +170 -40
  313. package/dist/src/functions/workflows/all.workflow.js +55 -16
  314. package/dist/src/server/bun-server-runner.d.ts +2 -2
  315. package/dist/src/server/bun-server-runner.js +5 -1
  316. package/dist/src/server/content-signing-jwt.d.ts +13 -0
  317. package/dist/src/server/content-signing-jwt.js +51 -0
  318. package/dist/src/server/dev-server-runner.interface.d.ts +10 -2
  319. package/dist/src/server/node-server-runner.d.ts +2 -2
  320. package/dist/src/server/node-server-runner.js +2 -1
  321. package/dist/src/services/cli-logger.service.d.ts +28 -16
  322. package/dist/src/services/cli-logger.service.js +25 -16
  323. package/dist/src/services.d.ts +3 -1
  324. package/dist/src/services.js +10 -1
  325. package/dist/src/utils/file-import-path.js +9 -0
  326. package/dist/src/utils/pikku-cli-config.js +52 -2
  327. package/dist/src/utils/resolve-personas.d.ts +27 -0
  328. package/dist/src/utils/resolve-personas.js +35 -0
  329. package/dist/src/utils/resolve-scaffold-feature.d.ts +19 -0
  330. package/dist/src/utils/resolve-scaffold-feature.js +49 -0
  331. package/dist/tsconfig.tsbuildinfo +1 -1
  332. package/package.json +20 -17
  333. package/dist/.pikku/schemas/schemas/BootstrapInput.schema.json +0 -1
  334. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +0 -1
  335. package/dist/.pikku/schemas/schemas/ScenarioRunInput.schema.json +0 -1
  336. package/dist/.pikku/workflow/pikku-scenario-actors.gen.d.ts +0 -19
  337. package/dist/.pikku/workflow/pikku-scenario-actors.gen.js +0 -17
  338. package/dist/src/functions/commands/db-seed.d.ts +0 -1
  339. package/dist/src/functions/commands/db-seed.js +0 -24
  340. package/dist/src/functions/db/sqlite/seed.d.ts +0 -11
  341. package/dist/src/functions/db/sqlite/seed.js +0 -22
  342. package/dist/src/functions/wirings/workflow/serialize-scenario-actors.d.ts +0 -2
  343. package/dist/src/functions/wirings/workflow/serialize-scenario-actors.js +0 -40
  344. package/dist/src/utils/resolve-scenario-actors.d.ts +0 -23
  345. package/dist/src/utils/resolve-scenario-actors.js +0 -74
  346. /package/dist/.pikku/schemas/schemas/{DbSeedInput.schema.json → RolesAuditInput.schema.json} +0 -0
@@ -6,7 +6,7 @@ import { createRequire } from 'node:module';
6
6
  import { pikkuSessionlessFunc } from '../../../.pikku/pikku-types.gen.js';
7
7
  import { added, changed, removed, dim } from '../lib/output.js';
8
8
  import { typeCheckFrontends } from '../lib/frontend-typecheck.js';
9
- import { runKnowledgeValidate } from '@pikku/knowledge';
9
+ import { readJsonSafe, readTextSafe, runSharedProjectChecks, } from '../../functions/validate/shared-checks.js';
10
10
  const FindingSchema = z.object({
11
11
  id: z.string(),
12
12
  severity: z.enum(['error', 'warn', 'info']),
@@ -47,26 +47,6 @@ async function findProjectRoot(startDir) {
47
47
  dir = parent;
48
48
  }
49
49
  }
50
- async function readJsonSafe(path) {
51
- if (!existsSync(path))
52
- return null;
53
- try {
54
- return JSON.parse(await readFile(path, 'utf8'));
55
- }
56
- catch {
57
- return null;
58
- }
59
- }
60
- async function readTextSafe(path) {
61
- if (!existsSync(path))
62
- return null;
63
- try {
64
- return await readFile(path, 'utf8');
65
- }
66
- catch {
67
- return null;
68
- }
69
- }
70
50
  // List .ts/.tsx source files under a directory (skips node_modules). Used to
71
51
  // scan an app for raw @mantine/core imports and i18n usage.
72
52
  async function listSourceFiles(dir) {
@@ -141,6 +121,23 @@ const SINGLETON_SENSITIVE_PKGS = [
141
121
  'react',
142
122
  'react-dom',
143
123
  ];
124
+ // A file whose name says "this is the login surface". Used to decide whether an
125
+ // app needs the actor quick-login control — an app with no login screen has
126
+ // nothing to attach it to. Matched against the path relative to the app root, so
127
+ // it covers src/pages/LoginPage.tsx as well as Next's app/login/page.tsx.
128
+ const LOGIN_FILE_PATTERN = /(?:^|\/)[\w[\]-]*(?:login|sign-?in)[\w[\]-]*(?:\/|\.)/i;
129
+ // Fingerprints of the dev-only "Sign in as …" quick login (the actor switcher):
130
+ // one click signs in as a declared scenario persona, no password. Any one of
131
+ // these means the app actually wires actor sign-in — the component's own
132
+ // definition is excluded, since defining it without rendering it locks the
133
+ // reviewer out just as thoroughly.
134
+ // Canonical implementation: starter-template's DevActorSwitcher, rendered from
135
+ // LoginPage and backed by signInAsActor() → POST /auth/sign-in/actor.
136
+ const ACTOR_QUICK_LOGIN_PATTERNS = [
137
+ /<\s*DevActorSwitcher\b/,
138
+ /(?<!function\s)\bsignInAsActor\s*\(/,
139
+ /\/auth\/sign-in\/actor/,
140
+ ];
144
141
  // Minimum @pikku/* versions Fabric requires. The pikku packages are versioned
145
142
  // independently (e.g. @pikku/cli moves faster than @pikku/core), so this is a
146
143
  // per-package floor map, not a single number. Only listed packages are
@@ -202,6 +199,19 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
202
199
  findings.push({ id, severity: 'info', message, path, fixHint });
203
200
  };
204
201
  const lines = (...parts) => parts.join('\n');
202
+ // ── everything true of any pikku project ───────────────────────────────
203
+ // Fabric validate is workspace validate plus the deploy-shaped checks. The
204
+ // two used to be separate walks over the same project that duplicated sixteen
205
+ // findings verbatim, and each carried checks the other lacked for no reason
206
+ // anyone could name.
207
+ //
208
+ // knowledge: decisions/internals/one-project-shape-check-two-validators.md
209
+ const shared = await runSharedProjectChecks(root);
210
+ findings.push(...shared.findings);
211
+ const { pikkuConfig, dbEngine } = shared;
212
+ const pikkuConfigPath = join(root, 'pikku.config.json');
213
+ const rootPkgPath = join(root, 'package.json');
214
+ const rootPkg = await readJsonSafe(rootPkgPath);
205
215
  // ── pikkufabric.config.json ────────────────────────────────────────────
206
216
  // Not required to run validate — downgraded to info so any pikku project
207
217
  // can be checked for compatibility before it is linked to a fabric account.
@@ -216,69 +226,6 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
216
226
  else if (fabricConfig.projectId === '__PROJECT_ID__') {
217
227
  info('fabric-config-placeholder-project-id', 'pikkufabric.config.json has a placeholder projectId ("__PROJECT_ID__") — project is not linked', fabricConfigPath, lines('The file exists but still contains the placeholder project id.', 'Run `pikku fabric link` to replace it automatically, or edit the file and set:', '"projectId": "<real-project-id>"'));
218
228
  }
219
- // ── root pikku.config.json ─────────────────────────────────────────────
220
- const pikkuConfigPath = join(root, 'pikku.config.json');
221
- const pikkuConfig = await readJsonSafe(pikkuConfigPath);
222
- if (!pikkuConfig) {
223
- e('pikku-config-missing', 'pikku.config.json not found at project root', pikkuConfigPath, lines('Create `pikku.config.json` at the repo root.', 'Minimum useful shape:', '{', ' "srcDirectories": ["packages/functions/src"],', ' "outDir": "packages/functions/.pikku",', ' "clientFiles": {', ' "rpcMapDeclarationFile": "packages/functions-sdk/src/pikku/rpc-map.gen.d.ts",', ' "reactQueryFile": "packages/functions-sdk/src/pikku/api.gen.ts"', ' }', '}'));
224
- }
225
- else {
226
- if (!pikkuConfig.srcDirectories) {
227
- e('pikku-config-no-src-dirs', 'pikku.config.json missing "srcDirectories"', pikkuConfigPath, 'Add "srcDirectories": ["packages/functions/src"] to pikku.config.json');
228
- }
229
- if (!pikkuConfig.outDir) {
230
- e('pikku-config-no-out-dir', 'pikku.config.json missing "outDir"', pikkuConfigPath, 'Add "outDir": "packages/functions/.pikku" to pikku.config.json');
231
- }
232
- if (!pikkuConfig.clientFiles) {
233
- info('pikku-config-no-client-files', 'pikku.config.json missing "clientFiles" — generated RPC client files and React Query hooks will not be written', pikkuConfigPath, lines('Add a `clientFiles` block to `pikku.config.json`.', 'Recommended values:', '"clientFiles": {', ' "rpcMapDeclarationFile": "packages/functions-sdk/src/pikku/rpc-map.gen.d.ts",', ' "reactQueryFile": "packages/functions-sdk/src/pikku/api.gen.ts"', '}', 'Those files should live in `packages/functions-sdk/src/pikku/` and are generated by Pikku.'));
234
- }
235
- // Each scaffold key gates generation of a public surface the Fabric console
236
- // calls. Missing one means those endpoints are never generated, so the
237
- // console 404s even though the functions/agents/workflows are wired. The
238
- // generated file paths auto-derive from the flag (see pikku-cli-config), so
239
- // setting the flag is sufficient. console/rpc/agent/workflow gate HTTP/RPC
240
- // endpoints the console hits directly → error; events gates the realtime
241
- // channel (feature-dependent, no template ships it yet) → warn.
242
- const REQUIRED_SCAFFOLD = [
243
- {
244
- key: 'console',
245
- severity: 'error',
246
- surface: 'app introspection (console:getFunctionsMeta and friends) — the sandbox builder shows no functions',
247
- value: '"auth"',
248
- },
249
- {
250
- key: 'rpc',
251
- severity: 'error',
252
- surface: 'the generic /rpc/:name endpoint',
253
- value: 'true',
254
- },
255
- {
256
- key: 'agent',
257
- severity: 'error',
258
- surface: 'the agent endpoints (/rpc/agent/:agentName) — the agent playground 404s',
259
- value: '"no-auth"',
260
- },
261
- {
262
- key: 'workflow',
263
- severity: 'error',
264
- surface: 'the workflow endpoints (/workflow/:workflowName/start) — triggering a workflow 404s',
265
- value: '"no-auth"',
266
- },
267
- {
268
- key: 'events',
269
- severity: 'warn',
270
- surface: 'the realtime events channel',
271
- value: 'true',
272
- },
273
- ];
274
- for (const s of REQUIRED_SCAFFOLD) {
275
- if (pikkuConfig.scaffold?.[s.key])
276
- continue;
277
- const report = s.severity === 'error' ? e : w;
278
- report(`pikku-config-no-scaffold-${s.key}`, `pikku.config.json scaffold is missing "${s.key}" — ${s.surface} is never generated, so the Fabric console 404s for it`, pikkuConfigPath, lines(`Add "${s.key}" to the scaffold block in pikku.config.json:`, '"scaffold": {', ' "pikkuDir": "packages/functions/src/scaffold",', ` "${s.key}": ${s.value}`, '}', 'Then re-run codegen (`pikku all`) and restart the dev server.'));
279
- }
280
- }
281
- const dbEngine = pikkuConfig?.db?.engine ?? 'sqlite';
282
229
  // ── .gitignore must ignore generated/runtime artifacts ─────────────────
283
230
  // These are regenerated on every dev boot / scaffold / codegen. Committing
284
231
  // them lets a stale copy shadow the freshly generated one — a committed
@@ -318,45 +265,6 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
318
265
  w(`missing-required-file-${relPath.replace(/[^a-z0-9]/gi, '-')}`, `${relPath} is missing — this file must be committed to the project`, join(root, relPath), lines(`Create ${relPath} and commit it.`, 'The starter-template ships a stub you can copy as a starting point.'));
319
266
  }
320
267
  }
321
- // ── knowledge base ─────────────────────────────────────────────────────
322
- // Delegated to the shared checker rather than asserting a list of filenames.
323
- // The three flat files this used to require (design-language.md, security.md,
324
- // technology.md) are not a knowledge base — they are three documents nothing
325
- // can link into, and the profile now organises the same content into sections
326
- // of notes. Fabric adds decisions/design/ on top of what is checked here.
327
- const knowledge = await runKnowledgeValidate(root, join(root, typeof pikkuConfig?.outDir === 'string' ? pikkuConfig.outDir : '.pikku'));
328
- for (const finding of knowledge.findings) {
329
- findings.push({ ...finding, path: join(root, finding.path) });
330
- }
331
- const rootPkgPath = join(root, 'package.json');
332
- const rootPkg = await readJsonSafe(rootPkgPath);
333
- if (!rootPkg) {
334
- e('root-package-missing', 'root package.json not found', rootPkgPath, 'Create a root package.json with workspaces: {"workspaces": ["packages/*", "apps/*"]}');
335
- }
336
- else {
337
- if (!rootPkg.workspaces) {
338
- w('root-package-no-workspaces', 'root package.json missing "workspaces"', rootPkgPath, 'Add "workspaces": ["packages/*", "apps/*"] to enable yarn workspaces');
339
- }
340
- const allDeps = {
341
- ...rootPkg.dependencies,
342
- ...rootPkg.devDependencies,
343
- };
344
- if (!allDeps['@pikku/core']) {
345
- e('missing-core', '@pikku/core not in dependencies', rootPkgPath, 'Add "@pikku/core": "file:./vendor/pikku-core.tgz" to dependencies');
346
- }
347
- // Vendor tgz presence — only check file: deps that reference a vendor/ path
348
- for (const [pkg, spec] of Object.entries(allDeps)) {
349
- if (typeof spec !== 'string' || !spec.startsWith('file:'))
350
- continue;
351
- const relPath = spec.slice(5); // strip 'file:'
352
- if (!relPath.includes('vendor'))
353
- continue;
354
- const absPath = join(root, relPath);
355
- if (!existsSync(absPath)) {
356
- w(`vendor-missing-${pkg.replace(/[@/]/g, '-')}`, `Vendor file missing for ${pkg}: ${relPath}`, absPath, `Run \`pikku pack\` in the pikku source repo and copy the output to ${relPath}`);
357
- }
358
- }
359
- }
360
268
  // ── @pikku/* minimum versions ──────────────────────────────────────────
361
269
  // Scan every workspace manifest for @pikku/* deps below the required floor.
362
270
  // A stale @pikku/cli hangs `pikku dev`; a stale @pikku/core duplicates
@@ -589,16 +497,12 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
589
497
  const functionsSdkPkgName = (await readJsonSafe(join(root, 'packages', 'functions-sdk', 'package.json')))?.name;
590
498
  const themePkgName = (await readJsonSafe(join(root, 'packages', 'mantine-theme', 'package.json')))?.name;
591
499
  const componentsPkgName = (await readJsonSafe(join(root, 'packages', 'components', 'package.json')))?.name;
592
- if (!existsSync(fnDir)) {
593
- e('functions-pkg-missing', 'packages/functions/ directory not found', fnDir, 'Create packages/functions/ as a yarn workspace containing pikku.config.json, src/, and db/sqlite/');
594
- }
595
- else {
500
+ // packages/functions/ presence, its package.json, ESM, zod and layout are all
501
+ // asserted by runSharedProjectChecks everything below is Fabric-specific.
502
+ if (existsSync(fnDir)) {
596
503
  const fnPkgPath = join(fnDir, 'package.json');
597
504
  const fnPkg = await readJsonSafe(fnPkgPath);
598
505
  if (fnPkg) {
599
- if (fnPkg.type !== 'module') {
600
- w('functions-pkg-no-esm', 'packages/functions/package.json is missing "type": "module"', fnPkgPath, 'Add "type": "module" to packages/functions/package.json — Cloudflare Workers require ES modules');
601
- }
602
506
  // #pikku bare import — required by the injected fabric-telemetry.wiring.ts
603
507
  if (!fnPkg.imports?.['#pikku']) {
604
508
  e('functions-pkg-missing-pikku-import', 'packages/functions/package.json is missing a bare "#pikku" entry in "imports" — the Fabric-injected telemetry middleware imports from "#pikku" and will fail to bundle without it', fnPkgPath, 'Add to "imports": { "#pikku": "./.pikku/pikku-types.gen.ts", "#pikku/*": "./.pikku/*" }');
@@ -660,13 +564,11 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
660
564
  e('missing-ai-sdk-core', 'Project declares agent units but `ai` (the Vercel AI SDK) is not in packages/functions dependencies — it is a peer dependency of @pikku/ai-vercel and is not installed automatically', fnPkgPath, 'Run `yarn add ai` in packages/functions — must be in dependencies, not devDependencies');
661
565
  }
662
566
  }
663
- // services.ts
567
+ // services.ts — its absence is reported by runSharedProjectChecks; what
568
+ // Fabric adds is which dialect it builds and whether it reads process.env.
664
569
  const servicesPath = join(fnDir, 'src', 'services.ts');
665
570
  const servicesText = await readTextSafe(servicesPath);
666
- if (!servicesText) {
667
- w('services-missing', 'packages/functions/src/services.ts not found', servicesPath, 'Create services.ts using pikkuServices() with LibsqlWebDialect from @pikku/kysely-sqlite — fabric injects DATABASE_URL at runtime');
668
- }
669
- else {
571
+ if (servicesText) {
670
572
  const usesKysely = /\bKysely\b/.test(servicesText);
671
573
  const usesLibsql = servicesText.includes('@pikku/kysely-sqlite') ||
672
574
  servicesText.includes('LibsqlWebDialect');
@@ -684,7 +586,7 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
684
586
  e('services-wrong-db-adapter', 'services.ts uses Kysely but not LibsqlWebDialect — Fabric injects a Turso/libSQL DATABASE_URL at runtime, not a PostgreSQL URL', servicesPath, 'Import LibsqlWebDialect from @pikku/kysely-sqlite and replace the dialect: new Kysely({ dialect: new LibsqlWebDialect({ url: databaseUrl }) })');
685
587
  }
686
588
  if (usesProcessEnv) {
687
- info('services-process-env', 'services.ts reads process.env directly — prefer variables.get() for portable secret/variable access', servicesPath, 'Replace process.env.SOME_VAR with await variables.get("SOME_VAR") — declare the binding with wireVariable/wireSecret; process.env is fine for optional/non-secret config');
589
+ info('services-process-env', 'services.ts reads process.env directly — prefer variables.get() for portable secret/variable access', servicesPath, 'Replace process.env.SOME_VAR with await variables.get("SOME_VAR") — declare the binding with defineVariable/defineSecret; process.env is fine for optional/non-secret config');
688
590
  }
689
591
  if (dbEngine !== 'postgres' &&
690
592
  usesLibsql &&
@@ -785,13 +687,6 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
785
687
  if (m)
786
688
  nums.push(parseInt(m[1], 10));
787
689
  }
788
- for (let idx = 1; idx < nums.length; idx++) {
789
- if (nums[idx] !== nums[idx - 1] + 1) {
790
- const missing = `${nums[idx - 1] + 1}..${nums[idx] - 1}`;
791
- e('migration-gap', `Migration numbering gap: IDs ${missing} are missing`, migrationsDir, 'Migrations must be consecutive. Add the missing .sql file or renumber if not yet applied.');
792
- break;
793
- }
794
- }
795
690
  if (dbEngine !== 'postgres') {
796
691
  // Check for PostgreSQL-specific syntax — Fabric uses Turso (SQLite/libSQL)
797
692
  for (const f of files) {
@@ -809,13 +704,13 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
809
704
  // readdir failure — skip
810
705
  }
811
706
  }
812
- const seedPath = join(root, 'db', dbEngine === 'postgres' ? 'postgres-seed.sql' : 'sqlite-seed.sql');
813
- if (!existsSync(seedPath)) {
814
- e('seed-sql-missing', dbEngine === 'postgres'
815
- ? 'db/postgres-seed.sql not found'
816
- : 'db/sqlite-seed.sql not found', seedPath, dbEngine === 'postgres'
817
- ? lines('Create `db/postgres-seed.sql`.', 'Use idempotent INSERT statements suitable for local/dev/test setup.', 'Keep it safe to re-run.')
818
- : lines('Create `db/sqlite-seed.sql`.', 'Use idempotent `INSERT OR IGNORE` statements for local/dev/test data.', 'Keep it safe to re-run.'));
707
+ const devSeedPath = join(root, 'db', dbEngine === 'postgres' ? 'postgres-dev-seed.sql' : 'sqlite-dev-seed.sql');
708
+ if (!existsSync(devSeedPath)) {
709
+ e('dev-seed-sql-missing', dbEngine === 'postgres'
710
+ ? 'db/postgres-dev-seed.sql not found'
711
+ : 'db/sqlite-dev-seed.sql not found', devSeedPath, dbEngine === 'postgres'
712
+ ? lines('Create `db/postgres-dev-seed.sql`.', 'Use idempotent INSERT statements suitable for local/dev/test setup.', 'Keep it safe to re-run.')
713
+ : lines('Create `db/sqlite-dev-seed.sql`.', 'Use idempotent `INSERT OR IGNORE` statements for local/dev/test data.', 'Keep it safe to re-run.'));
819
714
  }
820
715
  // audit table — info if not present (optional feature)
821
716
  if (existsSync(migrationsDir)) {
@@ -831,27 +726,6 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
831
726
  // readdir failure — skip
832
727
  }
833
728
  }
834
- // db.types.ts — should only re-export from .pikku
835
- const dbTypesPath = join(fnDir, 'src', 'types', 'db.types.ts');
836
- const dbTypesText = await readTextSafe(dbTypesPath);
837
- if (dbTypesText) {
838
- const isReexport = dbTypesText.includes('.pikku/db/schema') ||
839
- dbTypesText.includes('.pikku\\db\\schema');
840
- const hasInlineTypes = /(?:^|\n)\s*(?:export\s+)?(?:interface\s+\w|type\s+\w+\s*=)/.test(dbTypesText);
841
- if (hasInlineTypes && !isReexport) {
842
- w('db-types-hand-edited', 'src/types/db.types.ts contains inline type definitions — it should only re-export from .pikku', dbTypesPath, "Replace the file with a single line: export type { DB } from '../../.pikku/db/schema.gen.js' then run `yarn db:types` to regenerate");
843
- }
844
- }
845
- // Structure: src/functions/, src/wirings/, src/config.ts
846
- if (!existsSync(join(fnDir, 'src', 'functions'))) {
847
- info('functions-dir-missing', 'packages/functions/src/functions/ not found', join(fnDir, 'src', 'functions'), 'Create src/functions/ to hold pikkuSessionlessFunc definitions (one function per file)');
848
- }
849
- if (!existsSync(join(fnDir, 'src', 'wirings'))) {
850
- info('wirings-dir-missing', 'packages/functions/src/wirings/ not found', join(fnDir, 'src', 'wirings'), 'Create src/wirings/ for transport bindings: *.http.ts, *.queue.ts, *.schedule.ts, *.channel.ts, *.cli.ts');
851
- }
852
- if (!existsSync(join(fnDir, 'src', 'config.ts'))) {
853
- info('config-missing', 'packages/functions/src/config.ts not found', join(fnDir, 'src', 'config.ts'), "Create src/config.ts: export const createConfig = pikkuConfig(async () => ({ sqliteDb: '.pikku-runtime/dev.db' }))");
854
- }
855
729
  }
856
730
  // ── declared frontends ────────────────────────────────────────────────
857
731
  // pikkufabric.config.json is unvalidated JSON, so every field below is a
@@ -957,7 +831,7 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
957
831
  const rel = file.slice(appPath.length + 1);
958
832
  const norm = rel.replace(/\\/g, '/');
959
833
  // Paraglide usage: the reactive useLocale() hook or an import from the
960
- // local `@/i18n` scaffold (messages `m`, mKey/mList) — either means
834
+ // local `@/i18n` scaffold (the typed `m` namespace) — either means
961
835
  // strings flow through compiled messages.
962
836
  if (/\buseLocale\s*\(/.test(text) ||
963
837
  /from\s+['"]@\/i18n(?:\/[\w-]+)?['"]/.test(text)) {
@@ -1009,6 +883,37 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
1009
883
  ? [` …and ${rawMantineFiles.length - 10} more`]
1010
884
  : []), 'Keep "@mantine/core/styles.css", @mantine/hooks and @mantine/notifications imports as-is.'));
1011
885
  }
886
+ // ── one-click actor sign-in (the "Sign in as …" quick login) ────────
887
+ // Any frontend that ships a login screen must also ship the dev-only
888
+ // actor switcher, so the app can be reviewed as each scenario persona
889
+ // without knowing a password. Without it the reviewer is locked out of
890
+ // their own sandbox. Only fires when a login surface exists — an app
891
+ // with no auth has nothing to attach the control to.
892
+ // Next.js keeps its routes outside src/, so scan app/ and pages/ too.
893
+ const isNextApp = !!appAllDeps['next'];
894
+ const uiFiles = isNextApp
895
+ ? [
896
+ ...srcFiles,
897
+ ...(await listSourceFiles(join(appPath, 'app'))),
898
+ ...(await listSourceFiles(join(appPath, 'pages'))),
899
+ ]
900
+ : srcFiles;
901
+ const loginFiles = [];
902
+ let hasQuickLogin = false;
903
+ for (const file of uiFiles) {
904
+ const text = await readTextSafe(file);
905
+ if (!text)
906
+ continue;
907
+ const rel = file.slice(appPath.length + 1).replace(/\\/g, '/');
908
+ if (LOGIN_FILE_PATTERN.test(rel))
909
+ loginFiles.push(rel);
910
+ if (ACTOR_QUICK_LOGIN_PATTERNS.some((p) => p.test(text))) {
911
+ hasQuickLogin = true;
912
+ }
913
+ }
914
+ if (loginFiles.length > 0 && !hasQuickLogin) {
915
+ e(`app-missing-actor-quick-login-${name}`, `apps/${name} has a login screen (${loginFiles[0]}) but no one-click actor sign-in — nobody can view the app as a scenario persona without a password`, join(appPath, loginFiles[0]), lines('Add the dev-only "Sign in as …" switcher and render it from the login screen:', '1. lib/auth: devActors() reading the DEV_ACTORS env var, and', ' signInAsActor(email) → POST `${apiUrl()}/auth/sign-in/actor`', ' with { email, secret } and credentials: "include".', '2. components/DevActorSwitcher.tsx: a Menu of the declared actors,', ' each Menu.Item signing in as that persona. Render null when', ' devActors() is empty, so it disappears in production.', `3. Render <DevActorSwitcher /> from ${loginFiles[0]}.`, 'Reference: templates/starter-template/apps/app/src/components/DevActorSwitcher.tsx.'));
916
+ }
1012
917
  }
1013
918
  }
1014
919
  // ── singleton-sensitive deps must resolve to ONE physical copy ─────────
@@ -1155,11 +1060,6 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
1155
1060
  if (!existsSync(join(root, 'packages', 'components'))) {
1156
1061
  info('components-missing', 'packages/components/ not found — Fabric design features require a components package', join(root, 'packages', 'components'), `Create packages/components/ with your shared UI components. See ${designDocUrl}`);
1157
1062
  }
1158
- // ── packages/functions-sdk/ ───────────────────────────────────────────
1159
- const sdkDir = join(root, 'packages', 'functions-sdk');
1160
- if (!existsSync(sdkDir)) {
1161
- info('functions-sdk-missing', 'packages/functions-sdk/ not found — generated RPC client and React Query hooks will not be available', sdkDir, lines('Create a workspace at `packages/functions-sdk/`.', 'Minimum structure:', '- packages/functions-sdk/package.json', '- packages/functions-sdk/src/pikku/', 'Point `pikku.config.json` clientFiles to:', '- packages/functions-sdk/src/pikku/rpc-map.gen.d.ts', '- packages/functions-sdk/src/pikku/api.gen.ts', 'This package is the home for generated client artifacts, not handwritten server code.'));
1162
- }
1163
1063
  // ── frontend type-check (what the build container actually runs) ───────
1164
1064
  // Every check above is a heuristic standing in for this compile. The build
1165
1065
  // container type-checks each deployable frontend and aborts the deploy on a
@@ -1 +1 @@
1
- export declare const all: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
1
+ export declare const all: import("#pikku").PikkuFunctionSessionlessConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
@@ -1 +1 @@
1
- export declare const bootstrap: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
1
+ export declare const bootstrap: import("#pikku").PikkuFunctionSessionlessConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
@@ -5,6 +5,9 @@ export const bootstrap = pikkuVoidFunc({
5
5
  await getInspectorState(false, true, true);
6
6
  // Before function types: they import ScopeId from the scopes codegen.
7
7
  await rpc.invoke('pikkuScopes', { bootstrap: true });
8
+ // Before function types too: personas import SystemRoleName.
9
+ await rpc.invoke('pikkuRoles', { bootstrap: true });
10
+ await rpc.invoke('pikkuPersonas', { bootstrap: true });
8
11
  await rpc.invoke('pikkuFunctionTypesSplit', { bootstrap: true });
9
12
  // Stub auth.types.ts (if better-auth is used) so the pikkuBetterAuth
10
13
  // re-export resolves before any user file is imported.
@@ -7,7 +7,7 @@ export const dbAudit = pikkuSessionlessFunc({
7
7
  const userConfig = await loadUserConfigForDb({ config, logger });
8
8
  if (!userConfig)
9
9
  return;
10
- const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
10
+ const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir, config.db);
11
11
  if (!resolved) {
12
12
  logger.error('pikku db audit: no database configured — set sqliteDb or postgresUrl in your createConfig.');
13
13
  throw new Error('no database configured');
@@ -19,7 +19,7 @@ export const dbBaseline = pikkuSessionlessFunc({
19
19
  const userConfig = await loadUserConfigForDb({ config, logger });
20
20
  if (!userConfig)
21
21
  return;
22
- const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
22
+ const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir, config.db);
23
23
  if (!resolved) {
24
24
  logger.error('pikku db baseline: no database configured — set sqliteDb or postgresUrl in your createConfig.');
25
25
  throw new Error('no database configured');
@@ -18,17 +18,18 @@ export const dbCheck = pikkuSessionlessFunc({
18
18
  const userConfig = await loadUserConfigForDb({ config, logger });
19
19
  if (!userConfig)
20
20
  return;
21
- const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
21
+ const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir, config.db);
22
22
  if (!resolved) {
23
23
  logger.error('pikku db check: no database configured — set sqliteDb or postgresUrl in your createConfig.');
24
24
  throw new Error('no database configured');
25
25
  }
26
26
  const drift = await computeSchemaDrift(resolved, config.rootDir, config.srcDirectories, logger);
27
- // Table names elide the `public` schema, which reads as ambiguous in a
28
- // report whose whole point can be a second copy of `app.orders` sitting in
29
- // `public`. Put the schema back for display only.
27
+ // Table names elide the schema they landed in, which reads as ambiguous in
28
+ // a report whose whole point can be a second copy of `app.orders` sitting
29
+ // in `public`. Put the schema back for display only — the configured one
30
+ // when there is one, since that is where these tables belong.
30
31
  const qualify = (table) => resolved.dialect === 'postgres' && !table.includes('.')
31
- ? `public.${table}`
32
+ ? `${resolved.schema ?? 'public'}.${table}`
32
33
  : table;
33
34
  if (drift.runtimeTables.length) {
34
35
  logger.info(`db check: ${drift.runtimeTables.length} table(s) the pikku runtime created at boot, which no migration records:`);
@@ -17,7 +17,7 @@ export const dbCodegen = pikkuSessionlessFunc({
17
17
  const userConfig = await loadUserConfigForDb({ config, logger });
18
18
  if (!userConfig)
19
19
  return;
20
- const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
20
+ const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir, config.db);
21
21
  if (!resolved) {
22
22
  logger.error('pikku db codegen: no database configured — set sqliteDb or postgresUrl in your createConfig.');
23
23
  throw new Error('no database configured');
@@ -7,7 +7,7 @@ export const dbGenerate = pikkuSessionlessFunc({
7
7
  const userConfig = await loadUserConfigForDb({ config, logger });
8
8
  if (!userConfig)
9
9
  return;
10
- const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
10
+ const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir, config.db);
11
11
  if (!resolved) {
12
12
  logger.error('pikku db generate: no database configured — set sqliteDb or postgresUrl in your createConfig.');
13
13
  throw new Error('no database configured');
@@ -7,7 +7,7 @@ export const dbMigrate = pikkuSessionlessFunc({
7
7
  const userConfig = await loadUserConfigForDb({ config, logger });
8
8
  if (!userConfig)
9
9
  return;
10
- const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
10
+ const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir, config.db);
11
11
  if (!resolved) {
12
12
  logger.error('pikku db migrate: no database configured — set sqliteDb or postgresUrl in your createConfig.');
13
13
  throw new Error('no database configured');
@@ -1 +1,15 @@
1
- export declare const dbReset: import("#pikku").PikkuFunctionConfig<{}, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{}, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<{}, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
1
+ /**
2
+ * Wipe the dev database, replay every migration, then apply the dev seed.
3
+ *
4
+ * Seeding lives here rather than in a command of its own so it only ever meets
5
+ * a freshly migrated, empty database. That is what lets a seed file be plain
6
+ * `INSERT`s: there is no path that applies it twice, so it never has to defend
7
+ * itself with `INSERT OR IGNORE` or `ON CONFLICT DO NOTHING`.
8
+ */
9
+ export declare const dbReset: import("#pikku").PikkuFunctionConfig<{
10
+ noSeed?: boolean;
11
+ }, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
12
+ noSeed?: boolean;
13
+ }, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<{
14
+ noSeed?: boolean;
15
+ }, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
@@ -1,9 +1,17 @@
1
1
  import { pikkuSessionlessFunc } from '#pikku';
2
- import { resolveDb, reset, migrateAndCodegen, seed } from '../db/local-db.js';
2
+ import { resolveDb, reset, migrateAndCodegen, devSeed } from '../db/local-db.js';
3
3
  import { loadUserConfigForDb } from './db-shared.js';
4
+ /**
5
+ * Wipe the dev database, replay every migration, then apply the dev seed.
6
+ *
7
+ * Seeding lives here rather than in a command of its own so it only ever meets
8
+ * a freshly migrated, empty database. That is what lets a seed file be plain
9
+ * `INSERT`s: there is no path that applies it twice, so it never has to defend
10
+ * itself with `INSERT OR IGNORE` or `ON CONFLICT DO NOTHING`.
11
+ */
4
12
  export const dbReset = pikkuSessionlessFunc({
5
13
  remote: true,
6
- func: async ({ logger, config }) => {
14
+ func: async ({ logger, config }, { noSeed }) => {
7
15
  if (process.env.NODE_ENV === 'production') {
8
16
  logger.error('pikku db reset refused: NODE_ENV=production. This command only runs in dev.');
9
17
  throw new Error('pikku db reset refused: NODE_ENV=production');
@@ -11,7 +19,7 @@ export const dbReset = pikkuSessionlessFunc({
11
19
  const userConfig = await loadUserConfigForDb({ config, logger });
12
20
  if (!userConfig)
13
21
  return;
14
- const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
22
+ const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir, config.db);
15
23
  if (!resolved) {
16
24
  logger.error('pikku db reset: no database configured — set sqliteDb or postgresUrl in your createConfig.');
17
25
  throw new Error('no database configured');
@@ -35,9 +43,13 @@ export const dbReset = pikkuSessionlessFunc({
35
43
  logger.info(zod.written
36
44
  ? `db reset: regenerated ${zod.outFile} (${zod.tables.length} tables)`
37
45
  : `db reset: ${zod.outFile} unchanged`);
38
- const seedResult = await seed(resolved);
39
- if (seedResult.applied) {
40
- logger.info(`db reset: seeded ${resolved.seedFile} (${seedResult.bytes} bytes)`);
46
+ if (noSeed) {
47
+ logger.info('db reset: --no-seed, leaving the database empty');
48
+ return;
41
49
  }
50
+ const devSeedResult = await devSeed(resolved);
51
+ logger.info(devSeedResult.applied
52
+ ? `db reset: seeded ${resolved.devSeedFile} (${devSeedResult.bytes} bytes)`
53
+ : `db reset: no ${resolved.devSeedFile} found, database is empty`);
42
54
  },
43
55
  });
@@ -1,6 +1,20 @@
1
1
  export interface UserConfigShape {
2
2
  sqliteDb?: string;
3
3
  postgresUrl?: string;
4
+ /**
5
+ * Postgres extensions the CLI's embedded PGlite databases must load — the
6
+ * local dev database, and the shadow one every `db` command migrates to type
7
+ * and diff a schema.
8
+ *
9
+ * A bare name is one of PGlite's bundled contrib extensions (`hstore`,
10
+ * `citext`, `uuid_ossp`, …) and needs nothing installed. Anything else is a
11
+ * package the project depends on, such as `@electric-sql/pglite-pgvector`.
12
+ *
13
+ * Needed even when `postgresUrl` points at a server that already has the
14
+ * extension: the shadow database is PGlite regardless, so a `CREATE EXTENSION`
15
+ * in a migration fails there unless it is declared here.
16
+ */
17
+ pgliteExtensions?: string[];
4
18
  [key: string]: unknown;
5
19
  }
6
20
  interface LoadOptions {
@@ -1 +1 @@
1
- export declare const deployInfo: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
1
+ export declare const deployInfo: import("#pikku").PikkuFunctionSessionlessConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
@@ -7,10 +7,22 @@ import type { AIAgentRunnerService } from '@pikku/core/services';
7
7
  * has no equivalent, so agents 503 with AIProviderNotConfiguredError unless we
8
8
  * construct one here. When an OpenAI-compatible base URL + key are present
9
9
  * (fabric injects LITELLM_PROXY_URL/LITELLM_API_KEY; the standard OPENAI_*
10
- * vars are also honored) we point a single openai-compatible provider at it and
11
- * register it under every common provider prefix. Returns undefined when no AI
12
- * env is configured (agents stay disabled, with the clear downstream error) or
13
- * when the AI SDK packages aren't installed in the project.
10
+ * vars are also honored) we point one provider at it and register it under
11
+ * `'*'`, so every provider prefix resolves to it. The CLI ships the SDK rather
12
+ * than asking the project for it behind a proxy one openai-compatible
13
+ * provider answers for `openai/…`, `anthropic/…` and `google/…` alike, so there
14
+ * was never a per-vendor package worth making somebody install. The project's
15
+ * own copies still win when it has them. Returns undefined when no AI env is
16
+ * configured (agents stay disabled, with the clear downstream error) or when
17
+ * the SDK packages cannot be loaded from either place.
18
+ *
19
+ * Audio does not work here: `@ai-sdk/openai-compatible` exposes only
20
+ * language/embedding/image models, so a voice agent under `pikku dev` throws
21
+ * `Provider does not support transcription models`. Fixing that means the full
22
+ * `@ai-sdk/openai` provider, which assumes OpenAI's own request specifics — a
23
+ * bad default for a path whose entire purpose is fronting arbitrary gateways.
24
+ * If it becomes worth it, delegate just `transcription`/`speech` to the full
25
+ * provider and leave everything else on this one.
14
26
  */
15
27
  export declare function createDevAIAgentRunner({ logger, projectRoot, variables, }: {
16
28
  logger: Logger;