@pikku/cli 0.12.96 → 0.12.100
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-Icjp9hnB.js +1 -0
- package/console-app/assets/arc-BfGls--L.js +1 -0
- package/console-app/assets/architecture-TIHT7OUA-C8l7I5Lm.js +1 -0
- package/console-app/assets/architectureDiagram-ZJ3FMSHR-CpnsLBns.js +36 -0
- package/console-app/assets/array-BifhSqXX.js +1 -0
- package/console-app/assets/blockDiagram-677ZJIJ3-ByKRMGSr.js +132 -0
- package/console-app/assets/c4Diagram-LMCZKHZV-CzJSbsUo.js +10 -0
- package/console-app/assets/channel-BgJ-Z0cx.js +1 -0
- package/console-app/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/console-app/assets/chunk-32BRIVSS-D_tc4HCY.js +1 -0
- package/console-app/assets/chunk-52WLFC77-wkQkuUXG.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-BFW3xG3R.js +1 -0
- package/console-app/assets/chunk-EX3LRPZG-Car090Sw.js +231 -0
- package/console-app/assets/chunk-FWX5IMBZ-c2ud9kQ-.js +2 -0
- package/console-app/assets/chunk-HOUHSVGY-RYmQka5R.js +1 -0
- package/console-app/assets/chunk-ICXQ74PX-C-dqYC_9.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-Cu3FUWwl.js +88 -0
- package/console-app/assets/chunk-OGEWGWER-Z7f1yArD.js +1 -0
- package/console-app/assets/chunk-PUDLZKDR-Bp68DuRj.js +156 -0
- package/console-app/assets/chunk-Q4XR5HBZ-CdKSYWZ4.js +70 -0
- package/console-app/assets/chunk-RYQCIY6F-9ISCAKm2.js +1 -0
- package/console-app/assets/chunk-V7JOEXUC-2EOc1nQB.js +206 -0
- package/console-app/assets/chunk-VAUOI2AC-DwKsbf70.js +1 -0
- package/console-app/assets/chunk-VR4S4FIN-BPvN0PUm.js +1 -0
- package/console-app/assets/chunk-WYO6CB5R-DOpurCTP.js +127 -0
- package/console-app/assets/chunk-XXDRQBXY-RuYSFsQb.js +1 -0
- package/console-app/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/console-app/assets/chunk-ZGVPDNZ5-Bu2weVOL.js +62 -0
- package/console-app/assets/chunk-ZIRB5QZD-H-kepumB.js +32 -0
- package/console-app/assets/classDiagram-OUVF2IWQ-ohoLCI8g.js +1 -0
- package/console-app/assets/classDiagram-v2-EOCWNBFH-ohoLCI8g.js +1 -0
- package/console-app/assets/cose-bilkent-JH36ORCC-nau-QGCX.js +1 -0
- package/console-app/assets/cynefin-VYW2F7L2-BBw-E7lg.js +1 -0
- package/console-app/assets/cynefinDiagram-TSTJHNR4-BvnMvOvH.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-CHEqPR29.js +4 -0
- package/console-app/assets/defaultLocale-C8Fc0cco.js +1 -0
- package/console-app/assets/diagram-FQU43EPY-JijKRWyb.js +3 -0
- package/console-app/assets/diagram-G47NLZAW-G5UsB31f.js +24 -0
- package/console-app/assets/diagram-NH7WQ7WH-BhuJ6fPu.js +24 -0
- package/console-app/assets/diagram-OA4YK3LP-DaUF-8N4.js +30 -0
- package/console-app/assets/diagram-WEI45ONY-wLsJIhoM.js +41 -0
- package/console-app/assets/dist-fbBkbDNG.js +1 -0
- package/console-app/assets/ebnfDiagram-CCIWWBDH-BZCEa3Dz.js +1 -0
- package/console-app/assets/erDiagram-Q63AITRT-4XoEUtEh.js +85 -0
- package/console-app/assets/eventmodeling-45OFAUF4-DZ7z4YJO.js +1 -0
- package/console-app/assets/flowDiagram-23GEKE2U-rd7-NwZT.js +1 -0
- package/console-app/assets/ganttDiagram-NO4QXBWP-BXU7pfq6.js +292 -0
- package/console-app/assets/gitGraph-TEB2WS4Q-BdMAmvpU.js +1 -0
- package/console-app/assets/gitGraphDiagram-IHSO6WYX-3Hn0zwZR.js +106 -0
- package/console-app/assets/graphlib-B8gBHxth.js +1 -0
- package/console-app/assets/{index-CyYHTGWZ.css → index-BXMjqLQ5.css} +1 -1
- package/console-app/assets/{index-CeQodYfg.js → index-Din2vBeb.js} +153 -165
- package/console-app/assets/info-DKCQHKI2-Dc_oQkp5.js +1 -0
- package/console-app/assets/infoDiagram-FWYZ7A6U-B3v4xCUn.js +2 -0
- package/console-app/assets/init-D6jRqBbL.js +1 -0
- package/console-app/assets/ishikawaDiagram-FXEZZL3T-DzWq9Vtp.js +70 -0
- package/console-app/assets/journeyDiagram-5HDEW3XC-C0buWi_a.js +139 -0
- package/console-app/assets/kanban-definition-HUTT4EX6-DRAN9HhV.js +89 -0
- package/console-app/assets/katex-Vhh-h91d.js +257 -0
- package/console-app/assets/line-UqgRNiAC.js +1 -0
- package/console-app/assets/linear-FTAGuk_3.js +1 -0
- package/console-app/assets/map-DsCK-0Cs.js +1 -0
- package/console-app/assets/mermaid-parser.core-DIHI27FL.js +7 -0
- package/console-app/assets/mermaid.core-D4q8kvcu.js +11 -0
- package/console-app/assets/mindmap-definition-LN4V7U3C-DN-_CNLb.js +96 -0
- package/console-app/assets/ordinal-hYBb2elL.js +1 -0
- package/console-app/assets/packet-7NZHBO7P-8a3PoQAb.js +1 -0
- package/console-app/assets/path-BWPyau1x.js +1 -0
- package/console-app/assets/pegDiagram-2B236MQR-Bh2MhzCN.js +1 -0
- package/console-app/assets/pie-RZYD4A2V-Bi6zbJDl.js +1 -0
- package/console-app/assets/pieDiagram-ENE6RG2P-D2Z0W5UU.js +39 -0
- package/console-app/assets/quadrantDiagram-ABIIQ3AL-DNOKka0p.js +7 -0
- package/console-app/assets/radar-I7S5WNFK-CAxa68Sg.js +1 -0
- package/console-app/assets/railroad-3IZDKUUU-CZb1usP7.js +1 -0
- package/console-app/assets/railroad-abnf-AHOZXSZD-DkQZciri.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-CPBeASA9.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-CXEVIZ0g.js +1 -0
- package/console-app/assets/railroadDiagram-RFXS5EU6-B1K2hbTD.js +1 -0
- package/console-app/assets/requirementDiagram-TGXJPOKE-K8wcOO0Q.js +84 -0
- package/console-app/assets/rough.esm-CSKSodPl.js +1 -0
- package/console-app/assets/sankeyDiagram-HTMAVEWB-WBPBkgNx.js +40 -0
- package/console-app/assets/sequenceDiagram-DBY2YBRQ-Dz80qZZv.js +162 -0
- package/console-app/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
- package/console-app/assets/src-CnJCXDL0.js +1 -0
- package/console-app/assets/stateDiagram-2N3HPSRC-DMur7lZf.js +1 -0
- package/console-app/assets/stateDiagram-v2-6OUMAXLB-BDgLCrot.js +1 -0
- package/console-app/assets/swimlanes-5IMT3BWC-BlLdYcPU.js +2 -0
- package/console-app/assets/swimlanesDiagram-G3AALYLV-CZ5rQIcE.js +8 -0
- package/console-app/assets/timeline-definition-FHXFAJF6-CBOit0JY.js +120 -0
- package/console-app/assets/treeView-QDETBFTQ-DM1i1ast.js +1 -0
- package/console-app/assets/treemap-6X3UGDF4-ACrBEfY6.js +1 -0
- package/console-app/assets/vennDiagram-L72KCM5P-BmeFWb5N.js +34 -0
- package/console-app/assets/wardley-OPB4EBWU-BpIbeh58.js +1 -0
- package/console-app/assets/wardleyDiagram-EHGQE667-CxL7Mv7y.js +78 -0
- package/console-app/assets/xychartDiagram-FW5EYKEG-DkV75xT2.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 +11 -2
- package/dist/.pikku/cli/pikku-cli-channel.js +23 -8
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +36 -9
- 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 +2 -2
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +7 -8
- 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 +24 -9
- package/dist/.pikku/function/pikku-function-types.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions-meta.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions-meta.gen.json +48 -39
- package/dist/.pikku/function/pikku-functions.gen.js +3 -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 +2 -2
- 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 +2 -2
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +2 -2
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +2 -2
- 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 +3 -3
- package/dist/.pikku/schemas/schemas/DbResetInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/{DbSeedInput.schema.json → PikkuVirtualUserFunctionsOutput.schema.json} +1 -1
- package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- 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 +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- 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 +20 -14
- package/dist/.pikku/workflow/pikku-personas.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +29 -13
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +2 -2
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/cli.wiring.js +8 -7
- package/dist/src/deploy/analyzer/analyzer.js +0 -6
- package/dist/src/deploy/codegen/per-unit-codegen.js +0 -3
- package/dist/src/deploy/server-entry.js +1 -1
- package/dist/src/fabric/fabric-commands.d.ts +26 -26
- package/dist/src/fabric/functions/add.function.d.ts +1 -1
- package/dist/src/fabric/functions/addon-verify.function.d.ts +1 -1
- package/dist/src/fabric/functions/db-schema.function.d.ts +1 -1
- package/dist/src/fabric/functions/deploy-list.function.d.ts +1 -1
- package/dist/src/fabric/functions/deploy-units.function.d.ts +1 -1
- package/dist/src/fabric/functions/deploy.function.d.ts +2 -2
- package/dist/src/fabric/functions/domains-add.function.d.ts +1 -1
- package/dist/src/fabric/functions/domains-list.function.d.ts +1 -1
- package/dist/src/fabric/functions/domains-remove.function.d.ts +1 -1
- package/dist/src/fabric/functions/errors.function.d.ts +1 -1
- package/dist/src/fabric/functions/init.function.d.ts +1 -1
- package/dist/src/fabric/functions/link.function.d.ts +1 -1
- package/dist/src/fabric/functions/llm-key.function.d.ts +1 -1
- package/dist/src/fabric/functions/login.function.d.ts +1 -1
- package/dist/src/fabric/functions/logs.function.d.ts +1 -1
- package/dist/src/fabric/functions/metrics.function.d.ts +1 -1
- package/dist/src/fabric/functions/publish.function.d.ts +1 -1
- package/dist/src/fabric/functions/rollback.function.d.ts +1 -1
- package/dist/src/fabric/functions/secrets-list.function.d.ts +1 -1
- package/dist/src/fabric/functions/secrets-rotate.function.d.ts +1 -1
- package/dist/src/fabric/functions/secrets-set.function.d.ts +1 -1
- package/dist/src/fabric/functions/smoke.function.d.ts +1 -1
- package/dist/src/fabric/functions/status.function.d.ts +1 -1
- package/dist/src/fabric/functions/trace.function.d.ts +1 -1
- package/dist/src/fabric/functions/validate.function.d.ts +1 -1
- package/dist/src/fabric/functions/validate.function.js +76 -176
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/audit.d.ts +1 -1
- package/dist/src/functions/commands/binary.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/db-audit.d.ts +1 -1
- package/dist/src/functions/commands/db-audit.js +1 -1
- package/dist/src/functions/commands/db-baseline.d.ts +1 -1
- package/dist/src/functions/commands/db-baseline.js +1 -1
- package/dist/src/functions/commands/db-check.d.ts +1 -1
- package/dist/src/functions/commands/db-check.js +6 -5
- package/dist/src/functions/commands/db-codegen.d.ts +1 -1
- package/dist/src/functions/commands/db-codegen.js +1 -1
- package/dist/src/functions/commands/db-export.d.ts +1 -1
- package/dist/src/functions/commands/db-generate.d.ts +1 -1
- package/dist/src/functions/commands/db-generate.js +1 -1
- package/dist/src/functions/commands/db-migrate.d.ts +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-apply.d.ts +1 -1
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/deploy-plan.d.ts +1 -1
- package/dist/src/functions/commands/dev.d.ts +1 -1
- package/dist/src/functions/commands/dev.js +2 -2
- package/dist/src/functions/commands/emails-init.d.ts +1 -1
- package/dist/src/functions/commands/enable.d.ts +8 -8
- package/dist/src/functions/commands/import-n8n.d.ts +1 -1
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/knowledge-index.d.ts +1 -1
- package/dist/src/functions/commands/knowledge-validate.d.ts +1 -1
- package/dist/src/functions/commands/login.d.ts +3 -3
- package/dist/src/functions/commands/meta.d.ts +19 -19
- package/dist/src/functions/commands/new-addon.d.ts +1 -1
- package/dist/src/functions/commands/new-addon.js +2 -2
- package/dist/src/functions/commands/new-function.d.ts +1 -1
- package/dist/src/functions/commands/new-middleware.d.ts +1 -1
- package/dist/src/functions/commands/new-permission.d.ts +1 -1
- package/dist/src/functions/commands/new-wiring.d.ts +1 -1
- package/dist/src/functions/commands/persona-sync.d.ts +2 -2
- package/dist/src/functions/commands/persona-sync.js +1 -1
- package/dist/src/functions/commands/persona.d.ts +2 -2
- package/dist/src/functions/commands/persona.js +16 -18
- package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/roles-audit.d.ts +1 -1
- package/dist/src/functions/commands/roles-prune.d.ts +1 -1
- package/dist/src/functions/commands/scenario-ladder.js +1 -1
- package/dist/src/functions/commands/scenario.d.ts +2 -2
- package/dist/src/functions/commands/scenario.js +40 -11
- package/dist/src/functions/commands/scopes-audit.d.ts +1 -1
- package/dist/src/functions/commands/scopes-prune.d.ts +1 -1
- package/dist/src/functions/commands/scopes-shared.d.ts +4 -0
- package/dist/src/functions/commands/scopes-shared.js +1 -1
- package/dist/src/functions/commands/serve.d.ts +1 -1
- package/dist/src/functions/commands/serve.js +2 -2
- package/dist/src/functions/commands/skills.d.ts +2 -2
- package/dist/src/functions/commands/versions-check.d.ts +1 -1
- package/dist/src/functions/commands/versions-check.js +3 -3
- package/dist/src/functions/commands/versions-init.d.ts +1 -1
- package/dist/src/functions/commands/versions-update.d.ts +1 -1
- package/dist/src/functions/commands/watch.d.ts +1 -1
- package/dist/src/functions/commands/workspace-validate.d.ts +1 -1
- 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 +202 -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/runtimes/fetch/index.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -1
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -1
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +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-ai-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.js +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/auth/pikku-command-auth.d.ts +1 -1
- package/dist/src/functions/wirings/auth/serialize-auth-gen.js +16 -1
- 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/pikku-channels.js +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +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.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +9 -4
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +32 -10
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +4 -4
- 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/pikku-command-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-node-types.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
- package/dist/src/functions/wirings/console/serialize-console-functions.js +1 -1
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/emails/pikku-command-emails.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-addon-types.js +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +37 -9
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
- package/dist/src/functions/wirings/graph/pikku-command-graph-wirings.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.js +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -1
- package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +3 -3
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/package/serialize-package.js +1 -1
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- 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 +1 -1
- package/dist/src/functions/wirings/personas/pikku-command-personas.js +14 -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/queue/pikku-command-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -1
- package/dist/src/functions/wirings/roles/pikku-command-roles.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-react-query.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +3 -3
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +1 -1
- package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.js +1 -1
- package/dist/src/functions/wirings/scenarios/serialize-scenario-meta.js +2 -2
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.d.ts +1 -1
- package/dist/src/functions/wirings/scopes/pikku-command-scopes.d.ts +1 -1
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/serialize-trigger-meta.js +2 -2
- package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.d.ts +1 -1
- package/dist/src/functions/wirings/variables/pikku-command-variables.d.ts +1 -1
- 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/webhook/pikku-command-webhook.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-scenario-step-map.js +2 -2
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +2 -2
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +15 -32
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +36 -23
- package/dist/src/functions/workflows/all.workflow.js +49 -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/services/cli-logger.service.d.ts +28 -16
- package/dist/src/services/cli-logger.service.js +25 -16
- package/dist/src/services.d.ts +1 -1
- package/dist/src/services.js +8 -0
- package/dist/src/utils/file-import-path.js +9 -0
- package/dist/src/utils/pikku-cli-config.js +7 -0
- package/dist/src/utils/resolve-personas.d.ts +4 -9
- package/dist/src/utils/resolve-personas.js +4 -15
- package/dist/src/utils/serialize-meta-ts.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/dist/.pikku/schemas/schemas/BootstrapInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +0 -1
- 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
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import type { PikkuWorkflowWire, PikkuScenarioWire, WorkflowStepOptions, ScenarioStepOptions } from '@pikku/core/workflow'
|
|
10
10
|
|
|
11
11
|
export { WorkflowCancelledException }
|
|
12
|
-
import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '${functionTypesImportPath}'
|
|
12
|
+
import type { PikkuFunctionSessionless, PikkuFunctionConfig, WiredServices } from '${functionTypesImportPath}'
|
|
13
13
|
import type { FlattenedRPCMap } from '${rpcMapImportPath}'
|
|
14
14
|
import type { FlattenedWorkflowMap } from '${workflowMapImportPath}'
|
|
15
15
|
import type { AgentMap as FlattenedAgentMap } from '${agentMapImportPath}'
|
|
@@ -43,18 +43,12 @@ export interface TypedWorkflow extends PikkuWorkflowWire {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* The typed half of a scenario wire: \`
|
|
47
|
-
*
|
|
48
|
-
*
|
|
46
|
+
* The typed half of a scenario wire: \`given\`/\`when\`/\`then\`, narrowed to the
|
|
47
|
+
* names declared by \`pikkuScenarioStep\` in this project. \`given\` and \`when\`
|
|
48
|
+
* differ only in the prose the reporter renders; \`then\` additionally makes the
|
|
49
|
+
* step's bindings witnesses rather than alternatives.
|
|
49
50
|
*/
|
|
50
51
|
export interface TypedScenarioSteps {
|
|
51
|
-
step<K extends keyof FlattenedScenarioStepMap>(
|
|
52
|
-
stepName: string,
|
|
53
|
-
stepFunc: K,
|
|
54
|
-
data?: FlattenedScenarioStepMap[K]['input'],
|
|
55
|
-
options?: ScenarioStepOptions
|
|
56
|
-
): Promise<FlattenedScenarioStepMap[K]['output']>
|
|
57
|
-
|
|
58
52
|
given<K extends keyof FlattenedScenarioStepMap>(
|
|
59
53
|
stepName: string,
|
|
60
54
|
stepFunc: K,
|
|
@@ -77,8 +71,12 @@ export interface TypedScenarioSteps {
|
|
|
77
71
|
): Promise<FlattenedScenarioStepMap[K]['output']>
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
/**
|
|
75
|
+
* \`Out\` types \`scenario.context\` — the scratch the body shares with its
|
|
76
|
+
* \`before\`/\`after\` hooks — as a partial of what a completed run produces.
|
|
77
|
+
*/
|
|
78
|
+
export type TypedScenario<Out = unknown> = TypedWorkflow &
|
|
79
|
+
Omit<PikkuScenarioWire<Out>, keyof PikkuWorkflowWire | keyof TypedScenarioSteps> &
|
|
82
80
|
TypedScenarioSteps
|
|
83
81
|
|
|
84
82
|
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
@@ -92,10 +90,16 @@ export type PikkuFunctionWorkflow<
|
|
|
92
90
|
Out = never
|
|
93
91
|
> = PikkuFunctionSessionless<In, Out, 'workflow'>
|
|
94
92
|
|
|
93
|
+
/**
|
|
94
|
+
* \`Ctx\` types \`scenario.context\` and defaults to the function's own output,
|
|
95
|
+
* which is what a scenario body wants. A hook returns void but shares the
|
|
96
|
+
* scenario's context, so it passes the scenario's output here instead.
|
|
97
|
+
*/
|
|
95
98
|
export type PikkuFunctionScenario<
|
|
96
99
|
In = unknown,
|
|
97
|
-
Out = never
|
|
98
|
-
|
|
100
|
+
Out = never,
|
|
101
|
+
Ctx = Out
|
|
102
|
+
> = PikkuFunctionSessionless<In, Out, 'scenario' | 'actors', WiredServices, Ctx>
|
|
99
103
|
|
|
100
104
|
export type PikkuWorkflowConfigWithSchema<
|
|
101
105
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
@@ -176,14 +180,17 @@ export type PikkuScenarioConfigWithSchema<
|
|
|
176
180
|
* on the ladder. Throwing skips the body and fails the run; \`after\` still
|
|
177
181
|
* runs.
|
|
178
182
|
*/
|
|
179
|
-
before?: PikkuScenarioHook<InputSchema>
|
|
183
|
+
before?: PikkuScenarioHook<InputSchema, OutputSchema>
|
|
180
184
|
/**
|
|
181
185
|
* Always runs after the scenario body, in a \`finally\`, whether it passed or
|
|
182
186
|
* failed. Throwing fails a run that would otherwise have passed; on an
|
|
183
187
|
* already-failed run it attaches as the \`cause\` and never replaces the
|
|
184
188
|
* original error.
|
|
189
|
+
*
|
|
190
|
+
* Reads \`scenario.context\` for whatever the body managed to record before it
|
|
191
|
+
* stopped — that is how teardown learns the ids a failed run created.
|
|
185
192
|
*/
|
|
186
|
-
after?: PikkuScenarioHook<InputSchema>
|
|
193
|
+
after?: PikkuScenarioHook<InputSchema, OutputSchema>
|
|
187
194
|
/**
|
|
188
195
|
* Why this scenario is held out of a default run, stated where the scenario
|
|
189
196
|
* is. The scenario still appears in the plan and is reported as skipped
|
|
@@ -196,12 +203,18 @@ export type PikkuScenarioConfigWithSchema<
|
|
|
196
203
|
/**
|
|
197
204
|
* A scenario lifecycle hook: the scenario's own \`(services, data, wire)\`
|
|
198
205
|
* signature with its result discarded.
|
|
206
|
+
*
|
|
207
|
+
* The hook returns void but shares the scenario's \`context\`, so the output
|
|
208
|
+
* schema types \`scenario.context\` while the return type stays \`void\` — a hook
|
|
209
|
+
* is setup and teardown, never a step, and nothing it returns is recorded.
|
|
199
210
|
*/
|
|
200
211
|
export type PikkuScenarioHook<
|
|
201
|
-
InputSchema extends StandardSchemaV1 | undefined = undefined
|
|
212
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
213
|
+
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
202
214
|
> = PikkuFunctionScenario<
|
|
203
215
|
InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
|
|
204
|
-
void
|
|
216
|
+
void,
|
|
217
|
+
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
|
|
205
218
|
>
|
|
206
219
|
|
|
207
220
|
/**
|
|
@@ -209,9 +222,9 @@ export type PikkuScenarioHook<
|
|
|
209
222
|
* registered, so this exists purely to give an inline hook a call site to be
|
|
210
223
|
* contextually typed from, the way every other pikku primitive is.
|
|
211
224
|
*/
|
|
212
|
-
export function pikkuScenarioHook<In = unknown>(
|
|
213
|
-
hook: PikkuFunctionScenario<In, void>
|
|
214
|
-
): PikkuFunctionScenario<In, void> {
|
|
225
|
+
export function pikkuScenarioHook<In = unknown, Ctx = unknown>(
|
|
226
|
+
hook: PikkuFunctionScenario<In, void, Ctx>
|
|
227
|
+
): PikkuFunctionScenario<In, void, Ctx> {
|
|
215
228
|
return hook
|
|
216
229
|
}
|
|
217
230
|
|
|
@@ -329,7 +342,7 @@ export type PikkuScenarioStepConfigWithSchema<
|
|
|
329
342
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
330
343
|
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
331
344
|
> = {
|
|
332
|
-
/** Registered name — this is the string \`scenario.
|
|
345
|
+
/** Registered name — this is the string \`scenario.given()\` references. */
|
|
333
346
|
name: string
|
|
334
347
|
/**
|
|
335
348
|
* What this step does, for the console and for whoever reads the source. It
|
|
@@ -22,6 +22,11 @@ const scaffoldFiles = (config) => {
|
|
|
22
22
|
file: config.userAdminFunctionsFile,
|
|
23
23
|
generator: 'pikkuUserAdminFunctions',
|
|
24
24
|
});
|
|
25
|
+
if (config.scaffold?.virtualUser && config.virtualUserFunctionsFile)
|
|
26
|
+
files.push({
|
|
27
|
+
file: config.virtualUserFunctionsFile,
|
|
28
|
+
generator: 'pikkuVirtualUserFunctions',
|
|
29
|
+
});
|
|
25
30
|
if (config.scaffold?.agent && config.publicAgentFile)
|
|
26
31
|
files.push({
|
|
27
32
|
file: config.publicAgentFile,
|
|
@@ -46,7 +51,17 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
46
51
|
let typesDeclarationFileExists = true;
|
|
47
52
|
if (!existsSync(config.outDir)) {
|
|
48
53
|
logger.debug(`• .pikku directory not found, running bootstrap first...`);
|
|
49
|
-
|
|
54
|
+
// Every `getInspectorState` step below discards its result on purpose. A
|
|
55
|
+
// step's return value is stored as the step result and stays reachable for
|
|
56
|
+
// the life of the run, and an InspectorState holds a whole ts.Program — so
|
|
57
|
+
// returning it pins one TypeScript program per inspection instead of
|
|
58
|
+
// letting the previous one be collected. On a large project that is the
|
|
59
|
+
// difference between ~1.7GB and ~2.6GB peak RSS, i.e. between fitting in a
|
|
60
|
+
// 2GB CI heap and dying in it. Callers that need the state call
|
|
61
|
+
// `getInspectorState()` directly (it caches), never through a step.
|
|
62
|
+
await workflow.do('Bootstrap inspect', async () => {
|
|
63
|
+
await getInspectorState(false, true, true);
|
|
64
|
+
});
|
|
50
65
|
// Both before function types: pikku-types.gen.ts re-exports the scope
|
|
51
66
|
// definition types and imports ScopeId from the scopes codegen, so any
|
|
52
67
|
// later import of '#pikku' — the inspector reading a project's zod
|
|
@@ -90,7 +105,9 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
90
105
|
bootstrap: true,
|
|
91
106
|
});
|
|
92
107
|
}
|
|
93
|
-
await workflow.do('Bootstrap re-inspect', async () =>
|
|
108
|
+
await workflow.do('Bootstrap re-inspect', async () => {
|
|
109
|
+
await getInspectorState(true, true);
|
|
110
|
+
});
|
|
94
111
|
}
|
|
95
112
|
if (!existsSync(config.typesDeclarationFile)) {
|
|
96
113
|
typesDeclarationFileExists = false;
|
|
@@ -104,7 +121,9 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
104
121
|
await workflow.do('Generate function types', 'pikkuFunctionTypes', {});
|
|
105
122
|
if (!typesDeclarationFileExists || missingScaffolds.length > 0) {
|
|
106
123
|
logger.debug(`• Type file or scaffolds first created, inspecting again...`);
|
|
107
|
-
await workflow.do('Re-inspect after types', async () =>
|
|
124
|
+
await workflow.do('Re-inspect after types', async () => {
|
|
125
|
+
await getInspectorState(true);
|
|
126
|
+
});
|
|
108
127
|
}
|
|
109
128
|
// Type generators are independent of each other
|
|
110
129
|
const typeGenerators = [
|
|
@@ -151,6 +170,7 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
151
170
|
workflow.do('Public RPC', 'pikkuPublicRPC', null),
|
|
152
171
|
workflow.do('Console functions', 'pikkuConsoleFunctions', null),
|
|
153
172
|
workflow.do('User admin functions', 'pikkuUserAdminFunctions', null),
|
|
173
|
+
workflow.do('Virtual user functions', 'pikkuVirtualUserFunctions', null),
|
|
154
174
|
workflow.do('Events scaffold', 'pikkuEventsScaffold', null),
|
|
155
175
|
workflow.do('Emails', 'pikkuEmails', null),
|
|
156
176
|
workflow.do('Secret definition types', 'pikkuSecretDefinitionTypes', null),
|
|
@@ -169,18 +189,25 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
169
189
|
allImports.push(config.rpcInternalWiringMetaFile);
|
|
170
190
|
}
|
|
171
191
|
if (agents || !config.addon) {
|
|
172
|
-
await workflow.do('Re-inspect after agents', async () =>
|
|
192
|
+
await workflow.do('Re-inspect after agents', async () => {
|
|
193
|
+
await getInspectorState(true);
|
|
194
|
+
});
|
|
173
195
|
}
|
|
174
|
-
// pikkuAuth generates auth-secrets.gen.ts
|
|
175
|
-
//
|
|
176
|
-
//
|
|
177
|
-
//
|
|
178
|
-
//
|
|
179
|
-
|
|
196
|
+
// pikkuAuth generates auth-secrets.gen.ts and pikkuPersonas generates
|
|
197
|
+
// pikku-personas-secrets.gen.ts (both full of defineSecret calls) inside the
|
|
198
|
+
// Promise.all above, but pikkuSecrets runs concurrently from the inspector
|
|
199
|
+
// state as it was before either wrote anything. Re-run secret/credential/
|
|
200
|
+
// variable codegen now so those freshly-generated files — just picked up by
|
|
201
|
+
// Re-inspect above — are reflected in pikku-secrets-meta.gen.json. Without
|
|
202
|
+
// this the declaration only lands on a second `pikku` run, and a cold
|
|
203
|
+
// project deploys without ever being asked for the value.
|
|
204
|
+
const stateAfterScaffold = await getInspectorState();
|
|
205
|
+
if (stateAfterScaffold.auth.definition ||
|
|
206
|
+
stateAfterScaffold.personas.definitions.length > 0) {
|
|
180
207
|
await Promise.all([
|
|
181
|
-
workflow.do('Secrets (post-
|
|
182
|
-
workflow.do('Credentials (post-
|
|
183
|
-
workflow.do('Variables (post-
|
|
208
|
+
workflow.do('Secrets (post-scaffold)', 'pikkuSecrets', null),
|
|
209
|
+
workflow.do('Credentials (post-scaffold)', 'pikkuCredentials', null),
|
|
210
|
+
workflow.do('Variables (post-scaffold)', 'pikkuVariables', null),
|
|
184
211
|
]);
|
|
185
212
|
}
|
|
186
213
|
const schemas = await workflow.do('Schemas', 'pikkuSchemas', null);
|
|
@@ -204,7 +231,9 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
204
231
|
}
|
|
205
232
|
}
|
|
206
233
|
if (workflows || remoteRPC || webhook || workflowRoutes) {
|
|
207
|
-
await workflow.do('Re-inspect after workflows', async () =>
|
|
234
|
+
await workflow.do('Re-inspect after workflows', async () => {
|
|
235
|
+
await getInspectorState(true);
|
|
236
|
+
});
|
|
208
237
|
const regeneratedSchemas = await workflow.do('Re-generate schemas', 'pikkuSchemas', null);
|
|
209
238
|
if (regeneratedSchemas && !schemas) {
|
|
210
239
|
allImports.push(`${config.schemaDirectory}/register.gen.ts`);
|
|
@@ -282,7 +311,9 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
282
311
|
const cliChannelGenerated = await workflow.do('CLI entry', 'pikkuCLIEntry', null);
|
|
283
312
|
allImports.push(config.cliWiringMetaFile, config.cliWiringsFile);
|
|
284
313
|
if (cliChannelGenerated) {
|
|
285
|
-
await workflow.do('Re-inspect after CLI channel', async () =>
|
|
314
|
+
await workflow.do('Re-inspect after CLI channel', async () => {
|
|
315
|
+
await getInspectorState(true);
|
|
316
|
+
});
|
|
286
317
|
const cliChannels = await workflow.do('Channels after CLI', 'pikkuCommandChannels', null);
|
|
287
318
|
await workflow.do('Functions after CLI', 'pikkuFunctions', null);
|
|
288
319
|
await workflow.do('Schemas after CLI', 'pikkuSchemas', null);
|
|
@@ -302,7 +333,9 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
302
333
|
}
|
|
303
334
|
if (config.openAPI) {
|
|
304
335
|
logger.debug(`• OpenAPI requires a reinspection to pickup new generated types..`);
|
|
305
|
-
await workflow.do('OpenAPI re-inspect', async () =>
|
|
336
|
+
await workflow.do('OpenAPI re-inspect', async () => {
|
|
337
|
+
await getInspectorState(true);
|
|
338
|
+
});
|
|
306
339
|
await workflow.do('OpenAPI', 'pikkuOpenAPI', null);
|
|
307
340
|
}
|
|
308
341
|
await workflow.do('Versions update', 'pikkuVersionsUpdate', null);
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { EventHubService } from '@pikku/core';
|
|
10
10
|
import type { Logger } from '@pikku/core/services';
|
|
11
|
-
import type { DevServerRunner, DevServerInstance, DevServerConfig } from './dev-server-runner.interface.js';
|
|
11
|
+
import type { DevServerRunner, DevServerInstance, DevServerConfig, DevServerOptions } from './dev-server-runner.interface.js';
|
|
12
12
|
export declare class BunServerRunner implements DevServerRunner {
|
|
13
13
|
private mod?;
|
|
14
14
|
private eventHub?;
|
|
15
15
|
createEventHub(): Promise<EventHubService<any>>;
|
|
16
|
-
createServer(config: DevServerConfig, logger: Logger): DevServerInstance;
|
|
16
|
+
createServer(config: DevServerConfig, logger: Logger, options?: DevServerOptions): DevServerInstance;
|
|
17
17
|
}
|
|
@@ -14,12 +14,16 @@ export class BunServerRunner {
|
|
|
14
14
|
this.eventHub = new this.mod.BunEventHubService();
|
|
15
15
|
return this.eventHub;
|
|
16
16
|
}
|
|
17
|
-
createServer(config, logger) {
|
|
17
|
+
createServer(config, logger, options = {}) {
|
|
18
18
|
if (!this.mod || !this.eventHub) {
|
|
19
19
|
throw new Error('createEventHub() must be called before createServer()');
|
|
20
20
|
}
|
|
21
21
|
return new this.mod.PikkuBunServer(config, logger, {
|
|
22
22
|
eventHub: this.eventHub,
|
|
23
|
+
// Dropped here until now, which silently disabled signed asset reads for
|
|
24
|
+
// every Bun project: `config.content` arrived, but the service that
|
|
25
|
+
// verifies its signatures did not.
|
|
26
|
+
contentSigningJWT: options.contentSigningJWT,
|
|
23
27
|
});
|
|
24
28
|
}
|
|
25
29
|
}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import type { Logger } from '@pikku/core/services';
|
|
2
|
+
import type { Safe } from '@pikku/core';
|
|
2
3
|
import { LogLevel } from '@pikku/core/services';
|
|
3
4
|
import type { ErrorCode, DiagnosticSeverity, CodedDiagnostic } from '@pikku/inspector';
|
|
4
5
|
export type CLIOutputMode = 'text' | 'json';
|
|
6
|
+
/**
|
|
7
|
+
* The structured form a CLI log line may take. The `Record<string, any>` arm
|
|
8
|
+
* mirrors the `Logger` interface, which admits any object as a message.
|
|
9
|
+
*/
|
|
10
|
+
export type CLILogMessage = string | {
|
|
11
|
+
message: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
data?: Record<string, unknown>;
|
|
14
|
+
} | Record<string, any>;
|
|
5
15
|
export declare class CLILogger implements Logger {
|
|
6
16
|
private silent;
|
|
7
17
|
private level;
|
|
@@ -23,25 +33,27 @@ export declare class CLILogger implements Logger {
|
|
|
23
33
|
private ensureJSONFlushHook;
|
|
24
34
|
flushJSONBuffer(): void;
|
|
25
35
|
private emit;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Splits a log line into the parts `emit` needs.
|
|
38
|
+
*
|
|
39
|
+
* The public methods declare their message as `Safe<M>`, which distributes
|
|
40
|
+
* over the `CLILogMessage` union and cannot be narrowed by `typeof`. The
|
|
41
|
+
* guard's job is done once the call site has been checked, so the message is
|
|
42
|
+
* converted back to its domain type here — in one place rather than in each
|
|
43
|
+
* method.
|
|
44
|
+
*/
|
|
45
|
+
private messageParts;
|
|
46
|
+
info<M extends CLILogMessage, A extends unknown[]>(message: Safe<M>, ...__meta: {
|
|
47
|
+
[K in keyof A]: Safe<A[K]>;
|
|
30
48
|
}): void;
|
|
31
|
-
error
|
|
32
|
-
|
|
33
|
-
type?: string;
|
|
34
|
-
data?: Record<string, unknown>;
|
|
49
|
+
error<M extends CLILogMessage | Error, A extends unknown[]>(message: Safe<M>, ...__meta: {
|
|
50
|
+
[K in keyof A]: Safe<A[K]>;
|
|
35
51
|
}): void;
|
|
36
|
-
warn(message:
|
|
37
|
-
|
|
38
|
-
type?: string;
|
|
39
|
-
data?: Record<string, unknown>;
|
|
52
|
+
warn<M extends CLILogMessage, A extends unknown[]>(message: Safe<M>, ...__meta: {
|
|
53
|
+
[K in keyof A]: Safe<A[K]>;
|
|
40
54
|
}): void;
|
|
41
|
-
debug(message:
|
|
42
|
-
|
|
43
|
-
type?: string;
|
|
44
|
-
data?: Record<string, unknown>;
|
|
55
|
+
debug<M extends CLILogMessage, A extends unknown[]>(message: Safe<M>, ...__meta: {
|
|
56
|
+
[K in keyof A]: Safe<A[K]>;
|
|
45
57
|
}): void;
|
|
46
58
|
diagnostic({ severity, code, message }: CodedDiagnostic): void;
|
|
47
59
|
/** Sugar for `diagnostic({ severity: 'critical', code, message })`. */
|
|
@@ -108,15 +108,30 @@ export class CLILogger {
|
|
|
108
108
|
}
|
|
109
109
|
console.log(c(normalizedMessage));
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Splits a log line into the parts `emit` needs.
|
|
113
|
+
*
|
|
114
|
+
* The public methods declare their message as `Safe<M>`, which distributes
|
|
115
|
+
* over the `CLILogMessage` union and cannot be narrowed by `typeof`. The
|
|
116
|
+
* guard's job is done once the call site has been checked, so the message is
|
|
117
|
+
* converted back to its domain type here — in one place rather than in each
|
|
118
|
+
* method.
|
|
119
|
+
*/
|
|
120
|
+
messageParts(message) {
|
|
121
|
+
const value = message;
|
|
122
|
+
return {
|
|
123
|
+
msg: typeof value === 'string' ? value : value.message,
|
|
124
|
+
type: typeof value === 'string' ? undefined : value.type,
|
|
125
|
+
data: typeof value === 'string' ? undefined : value.data,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
info(message, ...__meta) {
|
|
112
129
|
if (this.level > LogLevel.info || this.silent)
|
|
113
130
|
return;
|
|
114
|
-
const msg
|
|
115
|
-
const type = typeof message === 'string' ? undefined : message.type;
|
|
116
|
-
const data = typeof message === 'string' ? undefined : message.data;
|
|
131
|
+
const { msg, type, data } = this.messageParts(message);
|
|
117
132
|
this.emit('info', msg, type, undefined, data);
|
|
118
133
|
}
|
|
119
|
-
error(message) {
|
|
134
|
+
error(message, ...__meta) {
|
|
120
135
|
if (this.level > LogLevel.error)
|
|
121
136
|
return;
|
|
122
137
|
if (message instanceof Error) {
|
|
@@ -128,25 +143,19 @@ export class CLILogger {
|
|
|
128
143
|
: (message.stack ?? message.message));
|
|
129
144
|
return;
|
|
130
145
|
}
|
|
131
|
-
const msg
|
|
132
|
-
const type = typeof message === 'string' ? undefined : message.type;
|
|
133
|
-
const data = typeof message === 'string' ? undefined : message.data;
|
|
146
|
+
const { msg, type, data } = this.messageParts(message);
|
|
134
147
|
this.emit('error', msg, type, undefined, data);
|
|
135
148
|
}
|
|
136
|
-
warn(message) {
|
|
149
|
+
warn(message, ...__meta) {
|
|
137
150
|
if (this.level > LogLevel.warn)
|
|
138
151
|
return;
|
|
139
|
-
const msg
|
|
140
|
-
const type = typeof message === 'string' ? undefined : message.type;
|
|
141
|
-
const data = typeof message === 'string' ? undefined : message.data;
|
|
152
|
+
const { msg, type, data } = this.messageParts(message);
|
|
142
153
|
this.emit('warn', msg, type, undefined, data);
|
|
143
154
|
}
|
|
144
|
-
debug(message) {
|
|
155
|
+
debug(message, ...__meta) {
|
|
145
156
|
if (this.level > LogLevel.debug || this.silent)
|
|
146
157
|
return;
|
|
147
|
-
const msg
|
|
148
|
-
const type = typeof message === 'string' ? undefined : message.type;
|
|
149
|
-
const data = typeof message === 'string' ? undefined : message.data;
|
|
158
|
+
const { msg, type, data } = this.messageParts(message);
|
|
150
159
|
this.emit('debug', msg, type, undefined, data);
|
|
151
160
|
}
|
|
152
161
|
diagnostic({ severity, code, message }) {
|
package/dist/src/services.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config, Services, SingletonServices, UserSession } from '../types/application-types.js';
|
|
2
2
|
import type { CreateConfig } from '@pikku/core';
|
|
3
|
-
import type { CreateWireServices, CreateSingletonServices } from '@pikku/core/
|
|
3
|
+
import type { CreateWireServices, CreateSingletonServices } from '@pikku/core/ecosystem';
|
|
4
4
|
import { LogLevel } from '@pikku/core/services';
|
|
5
5
|
import { CLILogger } from './services/cli-logger.service.js';
|
|
6
6
|
import type { InspectorDiagnostic } from '@pikku/inspector';
|
package/dist/src/services.js
CHANGED
|
@@ -17,6 +17,7 @@ import { BunBundler } from './deploy/bundler/bun-bundler.js';
|
|
|
17
17
|
import { NodeServerRunner } from './server/node-server-runner.js';
|
|
18
18
|
import { BunServerRunner } from './server/bun-server-runner.js';
|
|
19
19
|
import { parseCLIFilters } from './utils/parse-cli-filters.js';
|
|
20
|
+
import { personasSecretsFilePath } from './functions/wirings/personas/personas-secrets-file.js';
|
|
20
21
|
const DIAGNOSTIC_CODE_TO_LINT_KEY = {
|
|
21
22
|
[ErrorCode.SERVICES_NOT_DESTRUCTURED]: 'servicesNotDestructured',
|
|
22
23
|
[ErrorCode.WIRES_NOT_DESTRUCTURED]: 'wiresNotDestructured',
|
|
@@ -228,6 +229,12 @@ export const createSingletonServices = async (config) => {
|
|
|
228
229
|
config.authFile
|
|
229
230
|
? path.join(path.dirname(config.authFile), 'auth-middleware.gen.ts')
|
|
230
231
|
: undefined,
|
|
232
|
+
// The personas scaffold's sibling secrets file (SCENARIO_ACTOR_SECRET),
|
|
233
|
+
// generated into outDir where nothing imports it — same reasoning as the
|
|
234
|
+
// auth files above.
|
|
235
|
+
config.personasFile
|
|
236
|
+
? personasSecretsFilePath(config.personasFile)
|
|
237
|
+
: undefined,
|
|
231
238
|
];
|
|
232
239
|
for (const file of scaffoldFiles) {
|
|
233
240
|
if (file && !wiringFiles.includes(file) && existsSync(file)) {
|
|
@@ -260,6 +267,7 @@ export const createSingletonServices = async (config) => {
|
|
|
260
267
|
// cost. Never runs during a plain `pikku all`.
|
|
261
268
|
classificationCheck: !setupOnly && !!config.security,
|
|
262
269
|
strictMeta: !!config.strictMeta,
|
|
270
|
+
allow: config.allow ?? {},
|
|
263
271
|
schemaConfig: !setupOnly
|
|
264
272
|
? {
|
|
265
273
|
tsconfig: config.tsconfig,
|
|
@@ -4,6 +4,15 @@ export const getFileImportRelativePath = (from, to, packageMappings,
|
|
|
4
4
|
* Use for generated files that live outside the workspace (e.g. .deploy/)
|
|
5
5
|
* where package-name imports can't be resolved by the bundler. */
|
|
6
6
|
forceRelative = false) => {
|
|
7
|
+
// `to` is normally a file on disk, but the bootstrap zero state records core's
|
|
8
|
+
// types as `typePath: '@pikku/core'` — already an import specifier. Doing path
|
|
9
|
+
// arithmetic on one yields a directory that does not exist ('../../@pikku/core')
|
|
10
|
+
// and, being extensionless, one that nodenext then refuses to resolve. The
|
|
11
|
+
// node_modules branch below cannot catch these: a bare specifier has no
|
|
12
|
+
// 'node_modules/' in it to key off.
|
|
13
|
+
if (!to.startsWith('.') && !to.startsWith('/') && !/^[a-zA-Z]:/.test(to)) {
|
|
14
|
+
return to;
|
|
15
|
+
}
|
|
7
16
|
let filePath = relative(dirname(from), to);
|
|
8
17
|
if (!/^\.+\//.test(filePath)) {
|
|
9
18
|
filePath = `./${filePath}`;
|
|
@@ -245,6 +245,7 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
245
245
|
console: 'consoleFunctionsFile',
|
|
246
246
|
scenarios: 'scenariosFunctionsFile',
|
|
247
247
|
userAdmin: 'userAdminFunctionsFile',
|
|
248
|
+
virtualUser: 'virtualUserFunctionsFile',
|
|
248
249
|
workflow: 'workflowRoutesFile',
|
|
249
250
|
events: 'eventsChannelFile',
|
|
250
251
|
remoteRpc: 'remoteRpcWorkersFile',
|
|
@@ -303,6 +304,12 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
303
304
|
if (result.scaffold?.userAdmin && !result.userAdminSchemasFile) {
|
|
304
305
|
result.userAdminSchemasFile = join(resolvedScaffoldDir, 'admin', 'user-admin.schemas.gen.ts');
|
|
305
306
|
}
|
|
307
|
+
if (result.scaffold?.virtualUser && !result.virtualUserFunctionsFile) {
|
|
308
|
+
result.virtualUserFunctionsFile = join(resolvedScaffoldDir, 'virtual-user', 'virtual-user.gen.ts');
|
|
309
|
+
}
|
|
310
|
+
if (result.scaffold?.virtualUser && !result.virtualUserSchemasFile) {
|
|
311
|
+
result.virtualUserSchemasFile = join(resolvedScaffoldDir, 'virtual-user', 'virtual-user.schemas.gen.ts');
|
|
312
|
+
}
|
|
306
313
|
if (result.scaffold?.scenarios && !result.scenariosFunctionsFile) {
|
|
307
314
|
result.scenariosFunctionsFile = join(resolvedScaffoldDir, 'scenarios', 'scenarios.gen.ts');
|
|
308
315
|
}
|
|
@@ -20,13 +20,8 @@ export declare const DEFAULT_PERSONA_EMAIL_DOMAIN = "personas.invalid";
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const resolvePersonas: (definitions: PersonaDefinitions, domain?: string, runId?: string) => Record<string, ResolvedPersona>;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* checks. Narrowing a virtual user's catalogue needs the second, so the
|
|
27
|
-
* expansion happens once, here, against the same `defineSystemRole` definitions
|
|
28
|
-
* the seed grants from.
|
|
23
|
+
* Re-exported rather than declared here: the scaffolded `runVirtualUser` RPC
|
|
24
|
+
* needs the same expansion at runtime, so it lives in core beside
|
|
25
|
+
* `prepareVirtualUserRun` and this keeps the CLI's existing import sites.
|
|
29
26
|
*/
|
|
30
|
-
export
|
|
31
|
-
roles?: readonly string[];
|
|
32
|
-
}, roleScopes: Record<string, readonly string[]>) => string[];
|
|
27
|
+
export { personaScopes } from '@pikku/core/virtual-user';
|
|
@@ -28,19 +28,8 @@ export const resolvePersonas = (definitions, domain = DEFAULT_PERSONA_EMAIL_DOMA
|
|
|
28
28
|
return resolved;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* checks. Narrowing a virtual user's catalogue needs the second, so the
|
|
35
|
-
* expansion happens once, here, against the same `defineSystemRole` definitions
|
|
36
|
-
* the seed grants from.
|
|
31
|
+
* Re-exported rather than declared here: the scaffolded `runVirtualUser` RPC
|
|
32
|
+
* needs the same expansion at runtime, so it lives in core beside
|
|
33
|
+
* `prepareVirtualUserRun` and this keeps the CLI's existing import sites.
|
|
37
34
|
*/
|
|
38
|
-
export
|
|
39
|
-
const scopes = new Set();
|
|
40
|
-
for (const role of persona.roles ?? []) {
|
|
41
|
-
for (const scope of roleScopes[role] ?? []) {
|
|
42
|
-
scopes.add(scope);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return [...scopes].sort();
|
|
46
|
-
};
|
|
35
|
+
export { personaScopes } from '@pikku/core/virtual-user';
|
|
@@ -3,7 +3,7 @@ export function serializeMetaTS({ jsonImportPath, supportsImportAttributes, pikk
|
|
|
3
3
|
? `import metaData from '${jsonImportPath}' with { type: 'json' }`
|
|
4
4
|
: `import metaData from '${jsonImportPath}'`;
|
|
5
5
|
const serializedOutput = [];
|
|
6
|
-
serializedOutput.push("import { pikkuState } from '@pikku/core/
|
|
6
|
+
serializedOutput.push("import { pikkuState } from '@pikku/core/ecosystem'");
|
|
7
7
|
serializedOutput.push(`import { ${metaTypeName} } from '${metaTypeImport}'`);
|
|
8
8
|
serializedOutput.push(importStatement);
|
|
9
9
|
serializedOutput.push('');
|