@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.
- package/console-app/assets/abnfDiagram-VRR7QNED-CytV-CG1.js +1 -0
- package/console-app/assets/arc-C5PvmnaA.js +1 -0
- package/console-app/assets/architecture-TIHT7OUA-C1_ScvPX.js +1 -0
- package/console-app/assets/architectureDiagram-ZJ3FMSHR-CJ2xb7C-.js +36 -0
- package/console-app/assets/array-BifhSqXX.js +1 -0
- package/console-app/assets/blockDiagram-677ZJIJ3-CCecrBrk.js +132 -0
- package/console-app/assets/c4Diagram-LMCZKHZV-CBnpukvQ.js +10 -0
- package/console-app/assets/channel-CwDOkXGI.js +1 -0
- package/console-app/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/console-app/assets/chunk-32BRIVSS-D8qWWZRQ.js +1 -0
- package/console-app/assets/chunk-52WLFC77-BEpXHMsp.js +10 -0
- package/console-app/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/console-app/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
- package/console-app/assets/chunk-C7G6YPKG-DsHUMkOp.js +1 -0
- package/console-app/assets/chunk-EX3LRPZG-mM7TjVx9.js +231 -0
- package/console-app/assets/chunk-FWX5IMBZ-CndRAn18.js +2 -0
- package/console-app/assets/chunk-HOUHSVGY-D1kT8umn.js +1 -0
- package/console-app/assets/chunk-ICXQ74PX-CeSaGyro.js +2 -0
- package/console-app/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/console-app/assets/chunk-KEIR6QF5-DNzq6p3w.js +161 -0
- package/console-app/assets/chunk-MOJQB5TN-CaZOCHYr.js +88 -0
- package/console-app/assets/chunk-OGEWGWER-CnB1CsPt.js +1 -0
- package/console-app/assets/chunk-PUDLZKDR-BbGulHJm.js +156 -0
- package/console-app/assets/chunk-Q4XR5HBZ-BywwzeeR.js +70 -0
- package/console-app/assets/chunk-RYQCIY6F-CV0R1Adv.js +1 -0
- package/console-app/assets/chunk-V7JOEXUC-DGFaAWzB.js +206 -0
- package/console-app/assets/chunk-VAUOI2AC-DxPUd8Yb.js +1 -0
- package/console-app/assets/chunk-VR4S4FIN-D4-UaW_J.js +1 -0
- package/console-app/assets/chunk-WYO6CB5R-D_TFN0d9.js +127 -0
- package/console-app/assets/chunk-XXDRQBXY-BzVuweA_.js +1 -0
- package/console-app/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/console-app/assets/chunk-ZGVPDNZ5-C6hdkGQb.js +62 -0
- package/console-app/assets/chunk-ZIRB5QZD-H-kepumB.js +32 -0
- package/console-app/assets/classDiagram-OUVF2IWQ-CTYJkTT0.js +1 -0
- package/console-app/assets/classDiagram-v2-EOCWNBFH-CTYJkTT0.js +1 -0
- package/console-app/assets/cose-bilkent-JH36ORCC-B6ZPxN6v.js +1 -0
- package/console-app/assets/cynefin-VYW2F7L2-D_nmxNz_.js +1 -0
- package/console-app/assets/cynefinDiagram-TSTJHNR4-CHy5QN0S.js +62 -0
- package/console-app/assets/cytoscape.esm-h6BdjjI9.js +321 -0
- package/console-app/assets/dagre-CXRCoUWR.js +1 -0
- package/console-app/assets/dagre-VKFMJZFB-DYfukM34.js +4 -0
- package/console-app/assets/defaultLocale-C8Fc0cco.js +1 -0
- package/console-app/assets/diagram-FQU43EPY-Dgb9TPSB.js +3 -0
- package/console-app/assets/diagram-G47NLZAW-CnFNZs9Z.js +24 -0
- package/console-app/assets/diagram-NH7WQ7WH-DN7h2DU-.js +24 -0
- package/console-app/assets/diagram-OA4YK3LP-RLaQaNtK.js +30 -0
- package/console-app/assets/diagram-WEI45ONY-DxHWhVGd.js +41 -0
- package/console-app/assets/dist-BaJNIo4I.js +1 -0
- package/console-app/assets/ebnfDiagram-CCIWWBDH-UN3Z81-l.js +1 -0
- package/console-app/assets/erDiagram-Q63AITRT-C9lGAY3i.js +85 -0
- package/console-app/assets/eventmodeling-45OFAUF4-Dc5wNSSK.js +1 -0
- package/console-app/assets/flowDiagram-23GEKE2U-zPyGHMi4.js +1 -0
- package/console-app/assets/ganttDiagram-NO4QXBWP-CvBjBcdK.js +292 -0
- package/console-app/assets/gitGraph-TEB2WS4Q-Cs5Z9jMo.js +1 -0
- package/console-app/assets/gitGraphDiagram-IHSO6WYX-B0i_IJ5r.js +106 -0
- package/console-app/assets/graphlib-B8gBHxth.js +1 -0
- package/console-app/assets/{index-CmAplHjZ.js → index-71U8EEj7.js} +155 -153
- package/console-app/assets/{index-BYj7ZbUU.css → index-BXMjqLQ5.css} +1 -1
- package/console-app/assets/info-DKCQHKI2-DHL0afNl.js +1 -0
- package/console-app/assets/infoDiagram-FWYZ7A6U-CBWykodX.js +2 -0
- package/console-app/assets/init-D6jRqBbL.js +1 -0
- package/console-app/assets/ishikawaDiagram-FXEZZL3T-DM377eW_.js +70 -0
- package/console-app/assets/journeyDiagram-5HDEW3XC-BpX_-Cns.js +139 -0
- package/console-app/assets/kanban-definition-HUTT4EX6-D3xFsQkO.js +89 -0
- package/console-app/assets/katex-Vhh-h91d.js +257 -0
- package/console-app/assets/line-CTSKHTE0.js +1 -0
- package/console-app/assets/linear-R5GlBvXT.js +1 -0
- package/console-app/assets/map-DsCK-0Cs.js +1 -0
- package/console-app/assets/mermaid-parser.core-CkHk4BPi.js +7 -0
- package/console-app/assets/mermaid.core-CcjGXuV6.js +11 -0
- package/console-app/assets/mindmap-definition-LN4V7U3C-CtolazqQ.js +96 -0
- package/console-app/assets/ordinal-hYBb2elL.js +1 -0
- package/console-app/assets/packet-7NZHBO7P-BxSOj_Ny.js +1 -0
- package/console-app/assets/path-BWPyau1x.js +1 -0
- package/console-app/assets/pegDiagram-2B236MQR-BNsMtxsM.js +1 -0
- package/console-app/assets/pie-RZYD4A2V-BbkKQBA5.js +1 -0
- package/console-app/assets/pieDiagram-ENE6RG2P-BAZLIz2f.js +39 -0
- package/console-app/assets/quadrantDiagram-ABIIQ3AL-Dpvn-1Fs.js +7 -0
- package/console-app/assets/radar-I7S5WNFK-B-uKXIAH.js +1 -0
- package/console-app/assets/railroad-3IZDKUUU-BHXXK04t.js +1 -0
- package/console-app/assets/railroad-abnf-AHOZXSZD-tXSQaBvY.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-DG3aohR0.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-DY_gBA-x.js +1 -0
- package/console-app/assets/railroadDiagram-RFXS5EU6-DfUApEQj.js +1 -0
- package/console-app/assets/requirementDiagram-TGXJPOKE-B2zX0jqo.js +84 -0
- package/console-app/assets/rough.esm-CSKSodPl.js +1 -0
- package/console-app/assets/sankeyDiagram-HTMAVEWB-CbQ2zc7z.js +40 -0
- package/console-app/assets/sequenceDiagram-DBY2YBRQ-BLT8PXI_.js +162 -0
- package/console-app/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
- package/console-app/assets/src-BLuPUFWW.js +1 -0
- package/console-app/assets/stateDiagram-2N3HPSRC-BvEyVp85.js +1 -0
- package/console-app/assets/stateDiagram-v2-6OUMAXLB-RGKS9iU4.js +1 -0
- package/console-app/assets/swimlanes-5IMT3BWC-1AZ459s6.js +2 -0
- package/console-app/assets/swimlanesDiagram-G3AALYLV-Ck_0-rfN.js +8 -0
- package/console-app/assets/timeline-definition-FHXFAJF6-dLuvH4s2.js +120 -0
- package/console-app/assets/treeView-QDETBFTQ-xL2msjo2.js +1 -0
- package/console-app/assets/treemap-6X3UGDF4-C98ichVP.js +1 -0
- package/console-app/assets/vennDiagram-L72KCM5P-HbUmidhv.js +34 -0
- package/console-app/assets/wardley-OPB4EBWU-C4gJS-m2.js +1 -0
- package/console-app/assets/wardleyDiagram-EHGQE667-B7b-LB02.js +78 -0
- package/console-app/assets/xychartDiagram-FW5EYKEG-Cm03zUGy.js +7 -0
- package/console-app/index.html +2 -2
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/auth/auth.types.d.ts +1 -1
- package/dist/.pikku/auth/auth.types.js +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +13 -15
- package/dist/.pikku/cli/pikku-cli-channel.js +62 -8
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +14 -4
- package/dist/.pikku/cli/pikku-cli-client.gen.js +55 -18
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +136 -10
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +18 -2
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +64 -23
- package/dist/.pikku/function/pikku-function-types.gen.js +27 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +171 -37
- package/dist/.pikku/function/pikku-functions.gen.js +13 -3
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +2 -1
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +8 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +15 -5
- package/dist/.pikku/schemas/schemas/DbResetInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PersonaRunInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PersonaSyncInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuPersonasInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuRolesInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuVirtualUserFunctionsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/RolesPruneInput.schema.json +1 -0
- package/dist/.pikku/scopes/pikku-personas-meta.gen.json +1 -0
- package/dist/.pikku/scopes/pikku-personas.gen.d.ts +36 -0
- package/dist/.pikku/scopes/pikku-personas.gen.js +17 -0
- package/dist/.pikku/scopes/pikku-roles-meta.gen.json +1 -0
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +30 -0
- package/dist/.pikku/scopes/pikku-roles.gen.js +18 -0
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +4 -2
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +3 -2
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +2 -2
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +2 -2
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +2 -2
- package/dist/.pikku/variables/pikku-variable-types.gen.js +2 -2
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +46 -16
- package/dist/.pikku/workflow/pikku-personas.gen.d.ts +15 -0
- package/dist/.pikku/workflow/pikku-personas.gen.js +17 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +101 -24
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +22 -2
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/bin/pikku.js +0 -0
- package/dist/src/cli.wiring.js +108 -8
- package/dist/src/deploy/analyzer/analyzer.js +14 -0
- package/dist/src/deploy/analyzer/manifest.d.ts +11 -0
- package/dist/src/fabric/functions/validate.function.js +77 -177
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +3 -0
- package/dist/src/functions/commands/db-audit.js +1 -1
- package/dist/src/functions/commands/db-baseline.js +1 -1
- package/dist/src/functions/commands/db-check.js +6 -5
- package/dist/src/functions/commands/db-codegen.js +1 -1
- package/dist/src/functions/commands/db-generate.js +1 -1
- package/dist/src/functions/commands/db-migrate.js +1 -1
- package/dist/src/functions/commands/db-reset.d.ts +15 -1
- package/dist/src/functions/commands/db-reset.js +18 -6
- package/dist/src/functions/commands/db-shared.d.ts +14 -0
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/dev-ai-runner.d.ts +16 -4
- package/dist/src/functions/commands/dev-ai-runner.js +63 -29
- package/dist/src/functions/commands/dev.js +10 -5
- package/dist/src/functions/commands/enable.d.ts +8 -8
- package/dist/src/functions/commands/enable.js +15 -19
- package/dist/src/functions/commands/{scenario-environment.d.ts → environment.d.ts} +9 -6
- package/dist/src/functions/commands/{scenario-environment.js → environment.js} +5 -4
- package/dist/src/functions/commands/new-addon.js +14 -14
- package/dist/src/functions/commands/persona-sync.d.ts +33 -0
- package/dist/src/functions/commands/persona-sync.js +151 -0
- package/dist/src/functions/commands/persona.d.ts +58 -0
- package/dist/src/functions/commands/persona.js +215 -0
- package/dist/src/functions/commands/roles-audit.d.ts +1 -0
- package/dist/src/functions/commands/roles-audit.js +37 -0
- package/dist/src/functions/commands/roles-prune.d.ts +16 -0
- package/dist/src/functions/commands/roles-prune.js +52 -0
- package/dist/src/functions/commands/roles-shared.d.ts +40 -0
- package/dist/src/functions/commands/roles-shared.js +77 -0
- package/dist/src/functions/commands/scenario-browser.d.ts +3 -3
- package/dist/src/functions/commands/scenario-browser.js +1 -1
- package/dist/src/functions/commands/scenario-ladder.d.ts +44 -2
- package/dist/src/functions/commands/scenario-ladder.js +52 -3
- package/dist/src/functions/commands/scenario.d.ts +7 -0
- package/dist/src/functions/commands/scenario.js +82 -18
- package/dist/src/functions/commands/scopes-shared.d.ts +12 -0
- package/dist/src/functions/commands/scopes-shared.js +2 -2
- package/dist/src/functions/commands/serve.js +8 -4
- package/dist/src/functions/commands/versions-check.js +3 -3
- package/dist/src/functions/commands/virtual-user-formatter.d.ts +30 -0
- package/dist/src/functions/commands/virtual-user-formatter.js +65 -0
- package/dist/src/functions/db/annotation-parser.d.ts +14 -0
- package/dist/src/functions/db/annotation-parser.js +50 -2
- package/dist/src/functions/db/better-auth-schema.js +2 -1
- package/dist/src/functions/db/db-codegen.d.ts +12 -0
- package/dist/src/functions/db/db-codegen.js +149 -16
- package/dist/src/functions/db/local-db.d.ts +87 -6
- package/dist/src/functions/db/local-db.js +239 -35
- package/dist/src/functions/db/sqlite/dev-seed.d.ts +12 -0
- package/dist/src/functions/db/sqlite/dev-seed.js +23 -0
- package/dist/src/functions/db/sqlite/sqlite-runtime-bun.js +1 -1
- package/dist/src/functions/validate/bootstrap-checks.d.ts +19 -0
- package/dist/src/functions/validate/bootstrap-checks.js +90 -0
- package/dist/src/functions/validate/persona-checks.d.ts +24 -0
- package/dist/src/functions/validate/persona-checks.js +136 -0
- package/dist/src/functions/validate/scenario-file-checks.d.ts +17 -0
- package/dist/src/functions/validate/scenario-file-checks.js +123 -0
- package/dist/src/functions/validate/shared-checks.d.ts +59 -0
- package/dist/src/functions/validate/shared-checks.js +311 -0
- package/dist/src/functions/validate/workspace-validate.d.ts +1 -2
- package/dist/src/functions/validate/workspace-validate.js +4 -196
- package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.js +2 -1
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +1 -0
- package/dist/src/functions/wirings/auth/serialize-auth-gen.d.ts +2 -2
- package/dist/src/functions/wirings/auth/serialize-auth-gen.js +24 -9
- package/dist/src/functions/wirings/auth/serialize-auth-types.d.ts +3 -1
- package/dist/src/functions/wirings/auth/serialize-auth-types.js +3 -1
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.js +10 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +9 -4
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.d.ts +7 -3
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +64 -28
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +63 -6
- package/dist/src/functions/wirings/cli/serialize-cli-entrypoint-guard.d.ts +12 -0
- package/dist/src/functions/wirings/cli/serialize-cli-entrypoint-guard.js +28 -0
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +4 -1
- package/dist/src/functions/wirings/console/serialize-console-functions.js +5 -8
- package/dist/src/functions/wirings/functions/serialize-addon-types.js +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +106 -32
- package/dist/src/functions/wirings/middleware/serialize-middleware-imports.js +25 -9
- package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +3 -3
- package/dist/src/functions/wirings/package/serialize-package-types.js +5 -3
- package/dist/src/functions/wirings/personas/personas-secrets-file.d.ts +8 -0
- package/dist/src/functions/wirings/personas/personas-secrets-file.js +9 -0
- package/dist/src/functions/wirings/personas/pikku-command-personas.d.ts +7 -0
- package/dist/src/functions/wirings/personas/pikku-command-personas.js +57 -0
- package/dist/src/functions/wirings/personas/serialize-personas-secrets.d.ts +16 -0
- package/dist/src/functions/wirings/personas/serialize-personas-secrets.js +34 -0
- package/dist/src/functions/wirings/personas/serialize-personas-types.d.ts +18 -0
- package/dist/src/functions/wirings/personas/serialize-personas-types.js +76 -0
- package/dist/src/functions/wirings/queue/serialize-queue-map.js +2 -1
- package/dist/src/functions/wirings/queue/serialize-queue-wrapper.js +2 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +2 -1
- package/dist/src/functions/wirings/roles/pikku-command-roles.d.ts +7 -0
- package/dist/src/functions/wirings/roles/pikku-command-roles.js +33 -0
- package/dist/src/functions/wirings/roles/serialize-roles-types.d.ts +14 -0
- package/dist/src/functions/wirings/roles/serialize-roles-types.js +55 -0
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +2 -1
- package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.d.ts +3 -3
- package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.js +3 -3
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.d.ts +1 -1
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +1 -1
- package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.js +2 -1
- package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.js +2 -2
- package/dist/src/functions/wirings/virtual-user/pikku-command-virtual-user-functions.d.ts +1 -0
- package/dist/src/functions/wirings/virtual-user/pikku-command-virtual-user-functions.js +42 -0
- package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.d.ts +28 -0
- package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.js +439 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +2 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +13 -13
- package/dist/src/functions/wirings/workflow/serialize-personas.d.ts +10 -0
- package/dist/src/functions/wirings/workflow/serialize-personas.js +46 -0
- package/dist/src/functions/wirings/workflow/serialize-scenario-step-map.js +13 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +170 -40
- package/dist/src/functions/workflows/all.workflow.js +55 -16
- package/dist/src/server/bun-server-runner.d.ts +2 -2
- package/dist/src/server/bun-server-runner.js +5 -1
- package/dist/src/server/content-signing-jwt.d.ts +13 -0
- package/dist/src/server/content-signing-jwt.js +51 -0
- package/dist/src/server/dev-server-runner.interface.d.ts +10 -2
- package/dist/src/server/node-server-runner.d.ts +2 -2
- package/dist/src/server/node-server-runner.js +2 -1
- package/dist/src/services/cli-logger.service.d.ts +28 -16
- package/dist/src/services/cli-logger.service.js +25 -16
- package/dist/src/services.d.ts +3 -1
- package/dist/src/services.js +10 -1
- package/dist/src/utils/file-import-path.js +9 -0
- package/dist/src/utils/pikku-cli-config.js +52 -2
- package/dist/src/utils/resolve-personas.d.ts +27 -0
- package/dist/src/utils/resolve-personas.js +35 -0
- package/dist/src/utils/resolve-scaffold-feature.d.ts +19 -0
- package/dist/src/utils/resolve-scaffold-feature.js +49 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -17
- package/dist/.pikku/schemas/schemas/BootstrapInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/ScenarioRunInput.schema.json +0 -1
- package/dist/.pikku/workflow/pikku-scenario-actors.gen.d.ts +0 -19
- package/dist/.pikku/workflow/pikku-scenario-actors.gen.js +0 -17
- package/dist/src/functions/commands/db-seed.d.ts +0 -1
- package/dist/src/functions/commands/db-seed.js +0 -24
- package/dist/src/functions/db/sqlite/seed.d.ts +0 -11
- package/dist/src/functions/db/sqlite/seed.js +0 -22
- package/dist/src/functions/wirings/workflow/serialize-scenario-actors.d.ts +0 -2
- package/dist/src/functions/wirings/workflow/serialize-scenario-actors.js +0 -40
- package/dist/src/utils/resolve-scenario-actors.d.ts +0 -23
- package/dist/src/utils/resolve-scenario-actors.js +0 -74
- /package/dist/.pikku/schemas/schemas/{DbSeedInput.schema.json → RolesAuditInput.schema.json} +0 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { readFile, readdir } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { runKnowledgeValidate } from '@pikku/knowledge';
|
|
5
|
+
import { runBootstrapChecks } from './bootstrap-checks.js';
|
|
6
|
+
import { runPersonaChecks } from './persona-checks.js';
|
|
7
|
+
import { runScenarioFileChecks } from './scenario-file-checks.js';
|
|
8
|
+
/**
|
|
9
|
+
* A malformed config is named, never reported as absent.
|
|
10
|
+
*
|
|
11
|
+
* `pikku fabric validate` used to swallow the parse error and report
|
|
12
|
+
* `pikku-config-missing` for a file that is right there — the one message
|
|
13
|
+
* guaranteed to send you looking in the wrong place.
|
|
14
|
+
*/
|
|
15
|
+
export async function readJsonSafe(path) {
|
|
16
|
+
if (!existsSync(path))
|
|
17
|
+
return null;
|
|
18
|
+
try {
|
|
19
|
+
return JSON.parse(await readFile(path, 'utf8'));
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
23
|
+
throw new Error(`Invalid JSON in ${path}: ${message}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export async function readTextSafe(path) {
|
|
27
|
+
if (!existsSync(path))
|
|
28
|
+
return null;
|
|
29
|
+
try {
|
|
30
|
+
return await readFile(path, 'utf8');
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Whether this app authenticates HTTP requests at all.
|
|
38
|
+
*
|
|
39
|
+
* Matches any `betterAuth*Session` definition rather than the literal
|
|
40
|
+
* `betterAuthSession`. The stateless variant is a separate definition id that
|
|
41
|
+
* the CLI wires whenever `session.cookieCache` is enabled, which is the
|
|
42
|
+
* configuration Fabric asks for — so an exact-match check saw no auth on
|
|
43
|
+
* precisely the apps most likely to have it, and silently skipped every auth
|
|
44
|
+
* schema check below.
|
|
45
|
+
*/
|
|
46
|
+
async function hasAuthSessionMiddleware(fnDir) {
|
|
47
|
+
const meta = await readJsonSafe(join(fnDir, '.pikku', 'middleware', 'pikku-middleware-groups-meta.gen.json'));
|
|
48
|
+
if (!meta?.instances)
|
|
49
|
+
return false;
|
|
50
|
+
return Object.values(meta.instances).some((instance) => /^betterAuth\w*Session$/.test(instance.definitionId ?? ''));
|
|
51
|
+
}
|
|
52
|
+
function migrationCreatesTable(sql, tableName) {
|
|
53
|
+
const escapedTable = tableName.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
54
|
+
const re = new RegExp(`\\bcreate\\s+table\\s+(?:if\\s+not\\s+exists\\s+)?["'\`]?${escapedTable}["'\`]?\\b`, 'i');
|
|
55
|
+
return re.test(sql);
|
|
56
|
+
}
|
|
57
|
+
/** better-auth's core schema — the tables its adapter queries on every request. */
|
|
58
|
+
const BETTER_AUTH_TABLES = ['user', 'session', 'account', 'verification'];
|
|
59
|
+
/**
|
|
60
|
+
* Scaffold flags that gate a generated surface the pikku console calls.
|
|
61
|
+
*
|
|
62
|
+
* `console` gates app introspection, so nothing renders without it;
|
|
63
|
+
* `rpc`/`agent`/`workflow` gate endpoints the console hits directly; `events`
|
|
64
|
+
* gates the realtime channel, which no template ships yet — hence the warning.
|
|
65
|
+
*/
|
|
66
|
+
const REQUIRED_SCAFFOLD = [
|
|
67
|
+
{
|
|
68
|
+
key: 'console',
|
|
69
|
+
severity: 'error',
|
|
70
|
+
surface: 'app introspection (console:getFunctionsMeta and friends) — the console shows no functions',
|
|
71
|
+
},
|
|
72
|
+
{ key: 'rpc', severity: 'error', surface: 'the generic /rpc/:name endpoint' },
|
|
73
|
+
{
|
|
74
|
+
key: 'agent',
|
|
75
|
+
severity: 'error',
|
|
76
|
+
surface: 'the agent endpoints (/rpc/agent/:agentName) — the agent playground 404s',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: 'workflow',
|
|
80
|
+
severity: 'error',
|
|
81
|
+
surface: 'the workflow endpoints (/workflow/:workflowName/start) — triggering a workflow 404s',
|
|
82
|
+
},
|
|
83
|
+
{ key: 'events', severity: 'warn', surface: 'the realtime events channel' },
|
|
84
|
+
];
|
|
85
|
+
/**
|
|
86
|
+
* Every check that is true of any pikku project, regardless of where it deploys.
|
|
87
|
+
*
|
|
88
|
+
* `pikku workspace validate` is exactly this; `pikku fabric validate` is this
|
|
89
|
+
* plus the deploy-shaped checks (themes, frontends, the Cloudflare adapter, the
|
|
90
|
+
* .gitignore contract). Before this module the two were separate walks over the
|
|
91
|
+
* same project that duplicated sixteen findings verbatim, and each carried
|
|
92
|
+
* checks the other lacked for no reason anyone could name.
|
|
93
|
+
*
|
|
94
|
+
* knowledge: decisions/internals/one-project-shape-check-two-validators.md
|
|
95
|
+
*/
|
|
96
|
+
export async function runSharedProjectChecks(root) {
|
|
97
|
+
const findings = [];
|
|
98
|
+
const lines = (...parts) => parts.join('\n');
|
|
99
|
+
const e = (id, message, path, fixHint) => {
|
|
100
|
+
findings.push({ id, severity: 'error', message, path, fixHint });
|
|
101
|
+
};
|
|
102
|
+
const w = (id, message, path, fixHint) => {
|
|
103
|
+
findings.push({ id, severity: 'warn', message, path, fixHint });
|
|
104
|
+
};
|
|
105
|
+
const info = (id, message, path, fixHint) => {
|
|
106
|
+
findings.push({ id, severity: 'info', message, path, fixHint });
|
|
107
|
+
};
|
|
108
|
+
// ── pikku.config.json ──────────────────────────────────────────────────
|
|
109
|
+
const pikkuConfigPath = join(root, 'pikku.config.json');
|
|
110
|
+
const pikkuConfig = await readJsonSafe(pikkuConfigPath);
|
|
111
|
+
if (!pikkuConfig) {
|
|
112
|
+
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"', ' }', '}'));
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
if (!pikkuConfig.srcDirectories) {
|
|
116
|
+
e('pikku-config-no-src-dirs', 'pikku.config.json missing "srcDirectories"', pikkuConfigPath, 'Add "srcDirectories": ["packages/functions/src"] to pikku.config.json');
|
|
117
|
+
}
|
|
118
|
+
if (!pikkuConfig.outDir) {
|
|
119
|
+
e('pikku-config-no-out-dir', 'pikku.config.json missing "outDir"', pikkuConfigPath, 'Add "outDir": "packages/functions/.pikku" to pikku.config.json');
|
|
120
|
+
}
|
|
121
|
+
if (!pikkuConfig.clientFiles) {
|
|
122
|
+
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.'));
|
|
123
|
+
}
|
|
124
|
+
for (const s of REQUIRED_SCAFFOLD) {
|
|
125
|
+
if (pikkuConfig.scaffold?.[s.key])
|
|
126
|
+
continue;
|
|
127
|
+
const report = s.severity === 'error' ? e : w;
|
|
128
|
+
report(`pikku-config-no-scaffold-${s.key}`, `pikku.config.json scaffold is missing "${s.key}" — ${s.surface} is never generated, so the 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}": true`, '}', 'true means enabled and authenticated; write { "auth": false } to go public.', 'Then re-run codegen (`pikku all`) and restart the dev server.'));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const dbEngine = pikkuConfig?.db?.engine ?? 'sqlite';
|
|
132
|
+
const rootPkgPath = join(root, 'package.json');
|
|
133
|
+
const rootPkg = await readJsonSafe(rootPkgPath);
|
|
134
|
+
if (!rootPkg) {
|
|
135
|
+
e('root-package-missing', 'root package.json not found', rootPkgPath, 'Create a root package.json with workspaces: {"workspaces": ["packages/*", "apps/*"]}');
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
if (!rootPkg.workspaces) {
|
|
139
|
+
w('root-package-no-workspaces', 'root package.json missing "workspaces"', rootPkgPath, 'Add "workspaces": ["packages/*", "apps/*"] to enable yarn workspaces');
|
|
140
|
+
}
|
|
141
|
+
const allDeps = { ...rootPkg.dependencies, ...rootPkg.devDependencies };
|
|
142
|
+
if (!allDeps['@pikku/core']) {
|
|
143
|
+
e('missing-core', '@pikku/core not in dependencies', rootPkgPath, 'Add "@pikku/core" to dependencies');
|
|
144
|
+
}
|
|
145
|
+
// Vendor tgz presence — only file: deps that reference a vendor/ path.
|
|
146
|
+
for (const [pkg, spec] of Object.entries(allDeps)) {
|
|
147
|
+
if (typeof spec !== 'string' || !spec.startsWith('file:'))
|
|
148
|
+
continue;
|
|
149
|
+
const relPath = spec.slice(5);
|
|
150
|
+
if (!relPath.includes('vendor'))
|
|
151
|
+
continue;
|
|
152
|
+
const absPath = join(root, relPath);
|
|
153
|
+
if (!existsSync(absPath)) {
|
|
154
|
+
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}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// ── packages/functions/ ────────────────────────────────────────────────
|
|
159
|
+
const fnDir = join(root, 'packages', 'functions');
|
|
160
|
+
const fnPkgPath = join(fnDir, 'package.json');
|
|
161
|
+
let fnPkg = null;
|
|
162
|
+
// Migrations live at the repo root, which is where `pikku db migrate` reads
|
|
163
|
+
// them from (see local-db.ts). Workspace validate used to look inside
|
|
164
|
+
// packages/functions/db, so every auth schema check it made ran against a
|
|
165
|
+
// directory that does not exist in any project the CLI can migrate.
|
|
166
|
+
const migrationsDir = join(root, 'db', dbEngine);
|
|
167
|
+
if (!existsSync(fnDir)) {
|
|
168
|
+
e('functions-pkg-missing', 'packages/functions/ directory not found', fnDir, 'Create packages/functions/ as a workspace containing src/, tests/, config.ts, and any local db assets you use');
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
fnPkg = await readJsonSafe(fnPkgPath);
|
|
172
|
+
if (!fnPkg) {
|
|
173
|
+
e('functions-package-json-missing', 'packages/functions/package.json not found', fnPkgPath, 'Create packages/functions/package.json and declare the workspace package');
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
if (fnPkg.type !== 'module') {
|
|
177
|
+
w('functions-pkg-no-esm', 'packages/functions/package.json is missing "type": "module"', fnPkgPath, 'Add "type": "module" to packages/functions/package.json');
|
|
178
|
+
}
|
|
179
|
+
// zod v4 must be installed in the functions package: pikku's generated
|
|
180
|
+
// schemas and the auth scaffold (auth-secrets.gen.ts) both `import { z }
|
|
181
|
+
// from 'zod'`, so a missing/old zod fails codegen (PKU489) or type-checks.
|
|
182
|
+
const fnDeps = { ...fnPkg.dependencies, ...fnPkg.devDependencies };
|
|
183
|
+
const zodRange = fnDeps.zod;
|
|
184
|
+
const zodMajor = zodRange?.match(/(\d+)/)?.[1];
|
|
185
|
+
if (!zodRange) {
|
|
186
|
+
e('functions-missing-zod', 'packages/functions/package.json does not declare "zod" — pikku schemas and the generated auth scaffold import it', fnPkgPath, 'Add "zod": "^4" to packages/functions dependencies');
|
|
187
|
+
}
|
|
188
|
+
else if (zodMajor !== '4') {
|
|
189
|
+
e('functions-zod-not-v4', `packages/functions requires zod v4 but found "${zodRange}"`, fnPkgPath, 'Set "zod": "^4" in packages/functions dependencies');
|
|
190
|
+
}
|
|
191
|
+
// @pikku/playwright earns its keep by declaration merging: it is what
|
|
192
|
+
// puts `page`, `context` and `locate` on a step's `PikkuBrowserWire`. A
|
|
193
|
+
// merge only applies if the compiler loads the module, and a tsconfig
|
|
194
|
+
// with an explicit `types` array loads nothing it is not told to. A step
|
|
195
|
+
// that reaches for `wire.page` without importing the package anywhere in
|
|
196
|
+
// the program then fails to type-check with a message about a property
|
|
197
|
+
// that does not exist — which reads like the step is wrong, not the
|
|
198
|
+
// tsconfig. Listing the package in `types` loads it either way.
|
|
199
|
+
if (fnDeps['@pikku/playwright']) {
|
|
200
|
+
const tsconfigPath = join(fnDir, 'tsconfig.json');
|
|
201
|
+
const tsconfig = await readJsonSafe(tsconfigPath);
|
|
202
|
+
const types = tsconfig?.compilerOptions?.types;
|
|
203
|
+
if (types && !types.includes('@pikku/playwright')) {
|
|
204
|
+
w('playwright-types-not-loaded', 'packages/functions depends on @pikku/playwright but does not list it in "compilerOptions.types" — the browser bindings it adds to a step (page, context, locate) will not be typed', tsconfigPath, lines('Add it to the types array in packages/functions/tsconfig.json:', ` "types": ${JSON.stringify([...types, '@pikku/playwright'])}`, 'The package declaration-merges PikkuBrowserWire, and an explicit', '`types` array means the compiler only loads what it is told to.'));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const servicesPath = join(fnDir, 'src', 'services.ts');
|
|
209
|
+
if (!(await readTextSafe(servicesPath))) {
|
|
210
|
+
w('services-missing', 'packages/functions/src/services.ts not found', servicesPath, 'Create services.ts and export your service factory for the workspace');
|
|
211
|
+
}
|
|
212
|
+
// ── auth schema ──────────────────────────────────────────────────────
|
|
213
|
+
// The tables are better-auth's own (`user`, `session`, `account`,
|
|
214
|
+
// `verification`) because those are what the adapter queries. This check
|
|
215
|
+
// used to look for `app_user` and `auth_verification_token`, two names that
|
|
216
|
+
// appear nowhere else in pikku or in any template — it never fired against a
|
|
217
|
+
// real app, and would have been wrong for every one of them if it had.
|
|
218
|
+
const authEnabled = await hasAuthSessionMiddleware(fnDir);
|
|
219
|
+
const configText = await readTextSafe(join(fnDir, 'src', 'config.ts'));
|
|
220
|
+
const missingAuthTables = [];
|
|
221
|
+
if (existsSync(migrationsDir)) {
|
|
222
|
+
try {
|
|
223
|
+
const files = (await readdir(migrationsDir))
|
|
224
|
+
.filter((f) => f.endsWith('.sql'))
|
|
225
|
+
.sort();
|
|
226
|
+
const nums = [];
|
|
227
|
+
for (const f of files) {
|
|
228
|
+
const m = f.match(/^(\d+)/);
|
|
229
|
+
if (m)
|
|
230
|
+
nums.push(parseInt(m[1], 10));
|
|
231
|
+
}
|
|
232
|
+
for (let idx = 1; idx < nums.length; idx++) {
|
|
233
|
+
if (nums[idx] !== nums[idx - 1] + 1) {
|
|
234
|
+
const missing = `${nums[idx - 1] + 1}..${nums[idx] - 1}`;
|
|
235
|
+
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.');
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (authEnabled) {
|
|
240
|
+
const allSql = (await Promise.all(files.map((f) => readTextSafe(join(migrationsDir, f)))))
|
|
241
|
+
.filter((sql) => Boolean(sql))
|
|
242
|
+
.join('\n');
|
|
243
|
+
for (const table of BETTER_AUTH_TABLES) {
|
|
244
|
+
if (!migrationCreatesTable(allSql, table)) {
|
|
245
|
+
missingAuthTables.push(table);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
// readdir failure — skip
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else if (authEnabled) {
|
|
255
|
+
missingAuthTables.push(...BETTER_AUTH_TABLES);
|
|
256
|
+
}
|
|
257
|
+
// `pikku db migrate` falls back to .pikku-runtime/dev.db whenever db/sqlite
|
|
258
|
+
// exists (see db-shared.ts), so sqliteDb in createConfig is only required
|
|
259
|
+
// when the project has no conventional db assets at all. Demanding it
|
|
260
|
+
// unconditionally failed every project using the layout the CLI expects.
|
|
261
|
+
const hasConventionalDbAssets = existsSync(join(root, 'db', 'sqlite')) ||
|
|
262
|
+
existsSync(join(root, 'db', 'postgres'));
|
|
263
|
+
if (authEnabled &&
|
|
264
|
+
dbEngine !== 'postgres' &&
|
|
265
|
+
!/sqliteDb/.test(configText ?? '') &&
|
|
266
|
+
!hasConventionalDbAssets) {
|
|
267
|
+
e('auth-dev-db-missing', 'Auth middleware is registered, but there is no db/sqlite directory and createConfig does not set sqliteDb — `pikku db migrate` has no database to create', join(fnDir, 'src', 'config.ts'), 'Add db/sqlite/ with numbered migrations, or set sqliteDb in createConfig');
|
|
268
|
+
}
|
|
269
|
+
if (missingAuthTables.length > 0) {
|
|
270
|
+
e('auth-schema-missing-tables', `Auth middleware is registered, but no SQL migration creates: ${missingAuthTables.join(', ')} — better-auth queries these tables on every request`, migrationsDir, lines(`Add a migration under db/${dbEngine}/ that creates the better-auth core schema:`, ' user, session, account, verification', 'The pikku-better-auth skill generates one for the dialect you are on.'));
|
|
271
|
+
}
|
|
272
|
+
// ── generated types must stay generated ──────────────────────────────
|
|
273
|
+
const dbTypesPath = join(fnDir, 'src', 'types', 'db.types.ts');
|
|
274
|
+
const dbTypesText = await readTextSafe(dbTypesPath);
|
|
275
|
+
if (dbTypesText) {
|
|
276
|
+
const isReexport = dbTypesText.includes('.pikku/db/schema') ||
|
|
277
|
+
dbTypesText.includes('.pikku\\db\\schema');
|
|
278
|
+
const hasInlineTypes = /(?:^|\n)\s*(?:export\s+)?(?:interface\s+\w|type\s+\w+\s*=)/.test(dbTypesText);
|
|
279
|
+
if (hasInlineTypes && !isReexport) {
|
|
280
|
+
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 regenerate");
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
// ── layout ───────────────────────────────────────────────────────────
|
|
284
|
+
if (!existsSync(join(fnDir, 'src', 'functions'))) {
|
|
285
|
+
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)');
|
|
286
|
+
}
|
|
287
|
+
if (!existsSync(join(fnDir, 'src', 'wirings'))) {
|
|
288
|
+
info('wirings-dir-missing', 'packages/functions/src/wirings/ not found', join(fnDir, 'src', 'wirings'), 'Create src/wirings/ for transport bindings such as *.http.ts or *.queue.ts');
|
|
289
|
+
}
|
|
290
|
+
if (!existsSync(join(fnDir, 'src', 'config.ts'))) {
|
|
291
|
+
info('config-missing', 'packages/functions/src/config.ts not found', join(fnDir, 'src', 'config.ts'), 'Create src/config.ts and export your workspace config factory');
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const sdkDir = join(root, 'packages', 'functions-sdk');
|
|
295
|
+
if (!existsSync(sdkDir)) {
|
|
296
|
+
info('functions-sdk-missing', 'packages/functions-sdk/ not found — generated RPC client and React Query hooks will not be available', sdkDir, 'Create packages/functions-sdk/ as a workspace with src/pikku/ as the generated output root; point clientFiles.rpcMapDeclarationFile and clientFiles.reactQueryFile there');
|
|
297
|
+
}
|
|
298
|
+
// ── server bootstrap ───────────────────────────────────────────────────
|
|
299
|
+
findings.push(...(await runBootstrapChecks(root, rootPkg, pikkuConfig)));
|
|
300
|
+
// ── personas, scenario files and the knowledge base ────────────────────
|
|
301
|
+
findings.push(...(await runPersonaChecks(root, pikkuConfig)));
|
|
302
|
+
const srcDirectories = Array.isArray(pikkuConfig?.srcDirectories)
|
|
303
|
+
? pikkuConfig.srcDirectories.filter((d) => typeof d === 'string')
|
|
304
|
+
: [];
|
|
305
|
+
findings.push(...(await runScenarioFileChecks(root, srcDirectories)));
|
|
306
|
+
const knowledge = await runKnowledgeValidate(root, join(root, typeof pikkuConfig?.outDir === 'string' ? pikkuConfig.outDir : '.pikku'));
|
|
307
|
+
for (const finding of knowledge.findings) {
|
|
308
|
+
findings.push({ ...finding, path: join(root, finding.path) });
|
|
309
|
+
}
|
|
310
|
+
return { findings, pikkuConfig, fnPkg, fnDir, dbEngine, migrationsDir };
|
|
311
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export { readJsonSafe, readTextSafe } from './shared-checks.js';
|
|
2
3
|
export declare const FindingSchema: z.ZodObject<{
|
|
3
4
|
id: z.ZodString;
|
|
4
5
|
severity: z.ZodEnum<{
|
|
@@ -28,7 +29,5 @@ export declare const WorkspaceValidateOutput: z.ZodObject<{
|
|
|
28
29
|
}, z.core.$strip>>;
|
|
29
30
|
}, z.core.$strip>;
|
|
30
31
|
export declare function findProjectRoot(startDir: string): Promise<string>;
|
|
31
|
-
export declare function readJsonSafe<T>(path: string): Promise<T | null>;
|
|
32
|
-
export declare function readTextSafe(path: string): Promise<string | null>;
|
|
33
32
|
export declare function runWorkspaceValidate(startDir?: string): Promise<z.infer<typeof WorkspaceValidateOutput>>;
|
|
34
33
|
export declare const renderWorkspaceValidate: (_s: unknown, { ok, root, findings }: z.infer<typeof WorkspaceValidateOutput>) => void;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import { readFile
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { dirname, join } from 'node:path';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { added, changed, dim, removed } from '../../fabric/lib/output.js';
|
|
6
|
+
import { runSharedProjectChecks } from './shared-checks.js';
|
|
7
|
+
export { readJsonSafe, readTextSafe } from './shared-checks.js';
|
|
6
8
|
export const FindingSchema = z.object({
|
|
7
9
|
id: z.string(),
|
|
8
10
|
severity: z.enum(['error', 'warn', 'info']),
|
|
@@ -35,203 +37,9 @@ export async function findProjectRoot(startDir) {
|
|
|
35
37
|
dir = parent;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
|
-
export async function readJsonSafe(path) {
|
|
39
|
-
if (!existsSync(path))
|
|
40
|
-
return null;
|
|
41
|
-
try {
|
|
42
|
-
return JSON.parse(await readFile(path, 'utf8'));
|
|
43
|
-
}
|
|
44
|
-
catch (err) {
|
|
45
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
46
|
-
throw new Error(`Invalid JSON in ${path}: ${message}`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export async function readTextSafe(path) {
|
|
50
|
-
if (!existsSync(path))
|
|
51
|
-
return null;
|
|
52
|
-
try {
|
|
53
|
-
return await readFile(path, 'utf8');
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
async function hasAuthSessionMiddleware(fnDir) {
|
|
60
|
-
const metaPath = join(fnDir, '.pikku', 'middleware', 'pikku-middleware-groups-meta.gen.json');
|
|
61
|
-
const meta = await readJsonSafe(metaPath);
|
|
62
|
-
if (!meta?.instances)
|
|
63
|
-
return false;
|
|
64
|
-
return Object.values(meta.instances).some((instance) => instance.definitionId === 'betterAuthSession');
|
|
65
|
-
}
|
|
66
|
-
function migrationCreatesTable(sql, tableName) {
|
|
67
|
-
const escapedTable = tableName.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
68
|
-
const re = new RegExp(`\\bcreate\\s+table\\s+(?:if\\s+not\\s+exists\\s+)?["'\`]?${escapedTable}["'\`]?\\b`, 'i');
|
|
69
|
-
return re.test(sql);
|
|
70
|
-
}
|
|
71
40
|
export async function runWorkspaceValidate(startDir = process.cwd()) {
|
|
72
41
|
const root = await findProjectRoot(startDir);
|
|
73
|
-
const findings =
|
|
74
|
-
const e = (id, message, path, fixHint) => {
|
|
75
|
-
findings.push({ id, severity: 'error', message, path, fixHint });
|
|
76
|
-
};
|
|
77
|
-
const w = (id, message, path, fixHint) => {
|
|
78
|
-
findings.push({ id, severity: 'warn', message, path, fixHint });
|
|
79
|
-
};
|
|
80
|
-
const info = (id, message, path, fixHint) => {
|
|
81
|
-
findings.push({ id, severity: 'info', message, path, fixHint });
|
|
82
|
-
};
|
|
83
|
-
const pikkuConfigPath = join(root, 'pikku.config.json');
|
|
84
|
-
const pikkuConfig = await readJsonSafe(pikkuConfigPath);
|
|
85
|
-
if (!pikkuConfig) {
|
|
86
|
-
e('pikku-config-missing', 'pikku.config.json not found at project root', pikkuConfigPath, 'Create pikku.config.json with srcDirectories pointing to packages/functions/src, outDir, and clientFiles');
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
if (!pikkuConfig.srcDirectories) {
|
|
90
|
-
e('pikku-config-no-src-dirs', 'pikku.config.json missing "srcDirectories"', pikkuConfigPath, 'Add "srcDirectories": ["packages/functions/src"] to pikku.config.json');
|
|
91
|
-
}
|
|
92
|
-
if (!pikkuConfig.outDir) {
|
|
93
|
-
e('pikku-config-no-out-dir', 'pikku.config.json missing "outDir"', pikkuConfigPath, 'Add "outDir": "packages/functions/.pikku" to pikku.config.json');
|
|
94
|
-
}
|
|
95
|
-
if (!pikkuConfig.clientFiles) {
|
|
96
|
-
info('pikku-config-no-client-files', 'pikku.config.json missing "clientFiles" — generated RPC client files and React Query hooks will not be written', pikkuConfigPath, 'Add clientFiles.rpcMapDeclarationFile and clientFiles.reactQueryFile pointing to packages/functions-sdk/src/pikku/ (for example: rpc-map.gen.d.ts and api.gen.ts)');
|
|
97
|
-
}
|
|
98
|
-
const scaffold = pikkuConfig.scaffold;
|
|
99
|
-
if (!scaffold?.console) {
|
|
100
|
-
e('pikku-config-no-console-scaffold', 'pikku.config.json missing "scaffold.console" — Fabric cannot introspect the running app (console:getFunctionsMeta and friends 404), so the sandbox builder shows no functions', pikkuConfigPath, 'Add "console": "auth" under "scaffold" in pikku.config.json — the console requires an authenticated session, so Better Auth must be set up (see the pikku-better-auth skill)');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
const rootPkgPath = join(root, 'package.json');
|
|
104
|
-
const rootPkg = await readJsonSafe(rootPkgPath);
|
|
105
|
-
if (!rootPkg) {
|
|
106
|
-
e('root-package-missing', 'root package.json not found', rootPkgPath, 'Create a root package.json with workspaces: {"workspaces": ["packages/*", "apps/*"]}');
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
if (!rootPkg.workspaces) {
|
|
110
|
-
w('root-package-no-workspaces', 'root package.json missing "workspaces"', rootPkgPath, 'Add "workspaces": ["packages/*", "apps/*"] to enable yarn workspaces');
|
|
111
|
-
}
|
|
112
|
-
const allDeps = {
|
|
113
|
-
...rootPkg.dependencies,
|
|
114
|
-
...rootPkg.devDependencies,
|
|
115
|
-
};
|
|
116
|
-
if (!allDeps['@pikku/core']) {
|
|
117
|
-
e('missing-core', '@pikku/core not in dependencies', rootPkgPath, 'Add "@pikku/core" to dependencies');
|
|
118
|
-
}
|
|
119
|
-
for (const [pkg, spec] of Object.entries(allDeps)) {
|
|
120
|
-
if (typeof spec !== 'string' || !spec.startsWith('file:'))
|
|
121
|
-
continue;
|
|
122
|
-
const relPath = spec.slice(5);
|
|
123
|
-
if (!relPath.includes('vendor'))
|
|
124
|
-
continue;
|
|
125
|
-
const absPath = join(root, relPath);
|
|
126
|
-
if (!existsSync(absPath)) {
|
|
127
|
-
w(`vendor-missing-${pkg.replace(/[@/]/g, '-')}`, `Vendor file missing for ${pkg}: ${relPath}`, absPath, `Restore or replace the missing vendor package at ${relPath}`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
const fnDir = join(root, 'packages', 'functions');
|
|
132
|
-
if (!existsSync(fnDir)) {
|
|
133
|
-
e('functions-pkg-missing', 'packages/functions/ directory not found', fnDir, 'Create packages/functions/ as a workspace containing src/, tests/, config.ts, and any local db assets you use');
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
const fnPkgPath = join(fnDir, 'package.json');
|
|
137
|
-
const fnPkg = await readJsonSafe(fnPkgPath);
|
|
138
|
-
if (!fnPkg) {
|
|
139
|
-
e('functions-package-json-missing', 'packages/functions/package.json not found', fnPkgPath, 'Create packages/functions/package.json and declare the workspace package');
|
|
140
|
-
}
|
|
141
|
-
else if (fnPkg.type !== 'module') {
|
|
142
|
-
w('functions-pkg-no-esm', 'packages/functions/package.json is missing "type": "module"', fnPkgPath, 'Add "type": "module" to packages/functions/package.json');
|
|
143
|
-
}
|
|
144
|
-
// zod v4 must be installed in the functions package: pikku's generated
|
|
145
|
-
// schemas and the auth scaffold (auth-secrets.gen.ts) both `import { z }
|
|
146
|
-
// from 'zod'`, so a missing/old zod fails codegen (PKU489) or type-checks.
|
|
147
|
-
if (fnPkg) {
|
|
148
|
-
const fnDeps = { ...fnPkg.dependencies, ...fnPkg.devDependencies };
|
|
149
|
-
const zodRange = fnDeps.zod;
|
|
150
|
-
const zodMajor = zodRange?.match(/(\d+)/)?.[1];
|
|
151
|
-
if (!zodRange) {
|
|
152
|
-
e('functions-missing-zod', 'packages/functions/package.json does not declare "zod" — pikku schemas and the generated auth scaffold import it', fnPkgPath, 'Add "zod": "^4" to packages/functions dependencies');
|
|
153
|
-
}
|
|
154
|
-
else if (zodMajor !== '4') {
|
|
155
|
-
e('functions-zod-not-v4', `packages/functions requires zod v4 but found "${zodRange}"`, fnPkgPath, 'Set "zod": "^4" in packages/functions dependencies');
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
const servicesPath = join(fnDir, 'src', 'services.ts');
|
|
159
|
-
const servicesText = await readTextSafe(servicesPath);
|
|
160
|
-
if (!servicesText) {
|
|
161
|
-
w('services-missing', 'packages/functions/src/services.ts not found', servicesPath, 'Create services.ts and export your service factory for the workspace');
|
|
162
|
-
}
|
|
163
|
-
const authEnabled = await hasAuthSessionMiddleware(fnDir);
|
|
164
|
-
const configText = await readTextSafe(join(fnDir, 'src', 'config.ts'));
|
|
165
|
-
const hasConfiguredDevDb = /sqliteDb/.test(configText ?? '');
|
|
166
|
-
const hasPostgresUrl = /postgresUrl/.test(configText ?? '');
|
|
167
|
-
const migrationsDir = hasPostgresUrl
|
|
168
|
-
? join(fnDir, 'db', 'postgres')
|
|
169
|
-
: join(fnDir, 'db', 'sqlite');
|
|
170
|
-
let createsAppUser = false;
|
|
171
|
-
let createsAuthVerificationToken = false;
|
|
172
|
-
if (existsSync(migrationsDir)) {
|
|
173
|
-
try {
|
|
174
|
-
const files = (await readdir(migrationsDir))
|
|
175
|
-
.filter((f) => f.endsWith('.sql'))
|
|
176
|
-
.sort();
|
|
177
|
-
const nums = [];
|
|
178
|
-
for (const f of files) {
|
|
179
|
-
const m = f.match(/^(\d+)/);
|
|
180
|
-
if (m)
|
|
181
|
-
nums.push(parseInt(m[1], 10));
|
|
182
|
-
}
|
|
183
|
-
for (let idx = 1; idx < nums.length; idx++) {
|
|
184
|
-
if (nums[idx] !== nums[idx - 1] + 1) {
|
|
185
|
-
const missing = `${nums[idx - 1] + 1}..${nums[idx] - 1}`;
|
|
186
|
-
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.');
|
|
187
|
-
break;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
for (const f of files) {
|
|
191
|
-
const sql = await readTextSafe(join(migrationsDir, f));
|
|
192
|
-
if (!sql)
|
|
193
|
-
continue;
|
|
194
|
-
createsAppUser ||= migrationCreatesTable(sql, 'app_user');
|
|
195
|
-
createsAuthVerificationToken ||= migrationCreatesTable(sql, 'auth_verification_token');
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
catch {
|
|
199
|
-
// readdir failure — skip
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
if (authEnabled && !hasConfiguredDevDb) {
|
|
203
|
-
e('auth-dev-db-missing', 'Auth middleware is registered, but createConfig is missing sqliteDb so local auth schema validation and db migrate cannot run', pikkuConfigPath, 'Add sqliteDb to createConfig so `pikku db migrate` can create and validate the local auth schema');
|
|
204
|
-
}
|
|
205
|
-
if (authEnabled && !createsAppUser) {
|
|
206
|
-
e('auth-schema-missing-app-user', 'Auth middleware is registered, but no SQL migration creates the app_user table', migrationsDir, 'Add a migration that creates app_user before enabling auth');
|
|
207
|
-
}
|
|
208
|
-
if (authEnabled && !createsAuthVerificationToken) {
|
|
209
|
-
e('auth-schema-missing-verification-token', 'Auth middleware is registered, but no SQL migration creates the auth_verification_token table', migrationsDir, 'Add a migration that creates auth_verification_token before enabling auth');
|
|
210
|
-
}
|
|
211
|
-
const dbTypesPath = join(fnDir, 'src', 'types', 'db.types.ts');
|
|
212
|
-
const dbTypesText = await readTextSafe(dbTypesPath);
|
|
213
|
-
if (dbTypesText) {
|
|
214
|
-
const isReexport = dbTypesText.includes('.pikku/db/schema') ||
|
|
215
|
-
dbTypesText.includes('.pikku\\db\\schema');
|
|
216
|
-
const hasInlineTypes = /(?:^|\n)\s*(?:export\s+)?(?:interface\s+\w|type\s+\w+\s*=)/.test(dbTypesText);
|
|
217
|
-
if (hasInlineTypes && !isReexport) {
|
|
218
|
-
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 regenerate");
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
if (!existsSync(join(fnDir, 'src', 'functions'))) {
|
|
222
|
-
info('functions-dir-missing', 'packages/functions/src/functions/ not found', join(fnDir, 'src', 'functions'), 'Create src/functions/ to hold pikkuSessionlessFunc definitions');
|
|
223
|
-
}
|
|
224
|
-
if (!existsSync(join(fnDir, 'src', 'wirings'))) {
|
|
225
|
-
info('wirings-dir-missing', 'packages/functions/src/wirings/ not found', join(fnDir, 'src', 'wirings'), 'Create src/wirings/ for transport bindings such as *.http.ts or *.queue.ts');
|
|
226
|
-
}
|
|
227
|
-
if (!existsSync(join(fnDir, 'src', 'config.ts'))) {
|
|
228
|
-
info('config-missing', 'packages/functions/src/config.ts not found', join(fnDir, 'src', 'config.ts'), 'Create src/config.ts and export your workspace config factory');
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
const sdkDir = join(root, 'packages', 'functions-sdk');
|
|
232
|
-
if (!existsSync(sdkDir)) {
|
|
233
|
-
info('functions-sdk-missing', 'packages/functions-sdk/ not found — generated RPC client and React Query hooks will not be available', sdkDir, 'Create packages/functions-sdk/ as a workspace with src/pikku/ as the generated output root; point clientFiles.rpcMapDeclarationFile and clientFiles.reactQueryFile there');
|
|
234
|
-
}
|
|
42
|
+
const { findings } = await runSharedProjectChecks(root);
|
|
235
43
|
const ok = !findings.some((f) => f.severity === 'error');
|
|
236
44
|
return { ok, root, findings };
|
|
237
45
|
}
|
|
@@ -4,11 +4,12 @@ import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { removeLegacyScaffoldFile } from '../../../utils/remove-legacy-scaffold-file.js';
|
|
6
6
|
import { serializePublicAgent } from './serialize-public-agent.js';
|
|
7
|
+
import { resolveScaffoldFeature } from '../../../utils/resolve-scaffold-feature.js';
|
|
7
8
|
export const pikkuPublicAgent = pikkuSessionlessFunc({
|
|
8
9
|
func: async ({ logger, config }) => {
|
|
9
10
|
if (config.scaffold?.agent && config.publicAgentSchemasFile) {
|
|
10
11
|
const pathToPikkuTypes = getFileImportRelativePath(config.publicAgentFile, config.typesDeclarationFile, config.packageMappings);
|
|
11
|
-
const { schemas, functions } = serializePublicAgent(pathToPikkuTypes, config.scaffold.agent
|
|
12
|
+
const { schemas, functions } = serializePublicAgent(pathToPikkuTypes, resolveScaffoldFeature('agent', config.scaffold.agent).auth, config.globalHTTPPrefix || '');
|
|
12
13
|
await writeFileInDir(logger, config.publicAgentSchemasFile, schemas);
|
|
13
14
|
await writeFileInDir(logger, config.publicAgentFile, functions);
|
|
14
15
|
await removeLegacyScaffoldFile(config.publicAgentFile);
|
|
@@ -81,6 +81,7 @@ export const isThreadOwner = pikkuPermission<{ threadId: string }>(
|
|
|
81
81
|
)
|
|
82
82
|
|
|
83
83
|
export const agentCaller = pikkuSessionlessFunc({
|
|
84
|
+
description: 'Run a named AI agent with a message and return its reply',
|
|
84
85
|
tags: ['pikku'],
|
|
85
86
|
auth: ${authFlag},
|
|
86
87
|
input: AgentCall,
|
|
@@ -5,14 +5,14 @@ import type { AuthDefinition } from '@pikku/inspector';
|
|
|
5
5
|
* They are split because the CLI's schema/wiring-separation rule (PKU490)
|
|
6
6
|
* forbids a file from declaring Zod schemas AND `wireHTTPRoutes` together —
|
|
7
7
|
* schema files are imported at runtime, which would fire HTTP wiring
|
|
8
|
-
* side-effects without a server context. `
|
|
8
|
+
* side-effects without a server context. `defineSecret`/`defineVariable` are NOT
|
|
9
9
|
* HTTP wiring, so schemas may sit alongside them; only the route wiring must be
|
|
10
10
|
* separated out.
|
|
11
11
|
*/
|
|
12
12
|
export interface AuthGenOutput {
|
|
13
13
|
/** Handler + catch-all routes (+ session middleware, unless split out). */
|
|
14
14
|
wiring: string;
|
|
15
|
-
/** The secrets file: Zod schemas +
|
|
15
|
+
/** The secrets file: Zod schemas + defineSecret/defineVariable. */
|
|
16
16
|
secrets: string;
|
|
17
17
|
/** Global session-middleware registration, split into its own file only when
|
|
18
18
|
* `session.cookieCache` is enabled (stateless path); undefined otherwise. */
|