@pikku/cli 0.12.107 → 0.12.110
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/CHANGELOG.md +137 -0
- package/console-app/assets/{abnfDiagram-N423BO3Z-C5uToS9v.js → abnfDiagram-N423BO3Z-Bz2Ycfpe.js} +1 -1
- package/console-app/assets/architecture-TIHT7OUA-5QhJKy4P.js +1 -0
- package/console-app/assets/{architectureDiagram-T3A2C74G-BzJDRfv4.js → architectureDiagram-T3A2C74G-CvAkxhy0.js} +1 -1
- package/console-app/assets/{blockDiagram-VBNYF7ZC-X5G9Ch-D.js → blockDiagram-VBNYF7ZC-CuVOo2PB.js} +1 -1
- package/console-app/assets/{c4Diagram-5PPSVZJV-B59aO2Sc.js → c4Diagram-5PPSVZJV-4Vg8SxCa.js} +1 -1
- package/console-app/assets/channel-DoE3nnYB.js +1 -0
- package/console-app/assets/{chunk-2GRJ4B5K-Bwe32j_R.js → chunk-2GRJ4B5K-CKKR4_dC.js} +1 -1
- package/console-app/assets/{chunk-4I5QYGJK-Beg_uQQN.js → chunk-4I5QYGJK-C-m_kVjm.js} +1 -1
- package/console-app/assets/{chunk-5RXB4S5H-0HaMiv3k.js → chunk-5RXB4S5H-CyUGtd0h.js} +1 -1
- package/console-app/assets/{chunk-6Q2QTUOP-CXxkExOq.js → chunk-6Q2QTUOP-BuzItInf.js} +1 -1
- package/console-app/assets/{chunk-7Z6QIM7H-zUqPbrvp.js → chunk-7Z6QIM7H-BGiBPuWt.js} +1 -1
- package/console-app/assets/{chunk-GF5L2VYU-CY0wGPcJ.js → chunk-GF5L2VYU-D8jaliB9.js} +1 -1
- package/console-app/assets/{chunk-I66GZJ75-BP5UNkJY.js → chunk-I66GZJ75-C-Lq_UXl.js} +1 -1
- package/console-app/assets/{chunk-JQJVKLGR-3dvnUUZN.js → chunk-JQJVKLGR-D7viK-tf.js} +1 -1
- package/console-app/assets/{chunk-KBJHAD2P-ChD7o2bf.js → chunk-KBJHAD2P-BS9N9gG4.js} +1 -1
- package/console-app/assets/{chunk-NSK5VX7P-oG1nh33f.js → chunk-NSK5VX7P-Fi_H0vaS.js} +1 -1
- package/console-app/assets/{chunk-QR6OTTB3-D_uKJrj6.js → chunk-QR6OTTB3-BJdg-tcL.js} +1 -1
- package/console-app/assets/{chunk-RYQCIY6F-CtYhP8W5.js → chunk-RYQCIY6F-CVbGA6YZ.js} +1 -1
- package/console-app/assets/{chunk-UBXNYLIW-CMgD3fvL.js → chunk-UBXNYLIW-BF-sAqEK.js} +1 -1
- package/console-app/assets/{chunk-W5SLKNZC-cjI56NCs.js → chunk-W5SLKNZC-CXrJJ0BX.js} +1 -1
- package/console-app/assets/{chunk-WRU74C26-BQqHgerX.js → chunk-WRU74C26-CGzysGBy.js} +1 -1
- package/console-app/assets/chunk-XXDRQBXY-BDALKVU4.js +1 -0
- package/console-app/assets/classDiagram-JCYQIIEL-BgrrHQtN.js +1 -0
- package/console-app/assets/classDiagram-v2-OCEON4UE-BgrrHQtN.js +1 -0
- package/console-app/assets/{cose-bilkent-JH36ORCC-DcHzDpDb.js → cose-bilkent-JH36ORCC-BvFZIDHb.js} +1 -1
- package/console-app/assets/{cynefin-VYW2F7L2-Cn2zn-8-.js → cynefin-VYW2F7L2-DRQ8xGmN.js} +1 -1
- package/console-app/assets/{cynefinDiagram-MW4NZA55-C00zINdu.js → cynefinDiagram-MW4NZA55-BwxQ4C1z.js} +1 -1
- package/console-app/assets/{dagre-DE2imcyX.js → dagre-J22zmNeE.js} +1 -1
- package/console-app/assets/{dagre-VZM6K2ZE-Bb2uZ7tL.js → dagre-VZM6K2ZE-DPtUyvjD.js} +1 -1
- package/console-app/assets/{diagram-7IWD3JNH-DUN-JIa1.js → diagram-7IWD3JNH-DGAzJ2Ln.js} +1 -1
- package/console-app/assets/{diagram-B4RE2ZJO-Ct5iRFhI.js → diagram-B4RE2ZJO-D14cIfto.js} +1 -1
- package/console-app/assets/{diagram-LBJQPF4R-BZ2Hrr-9.js → diagram-LBJQPF4R-CUscJ_pO.js} +1 -1
- package/console-app/assets/{diagram-Q27KOJAE-BHaThj6T.js → diagram-Q27KOJAE-CehBHMt3.js} +1 -1
- package/console-app/assets/{diagram-UB23O5K3-CH-SzBoh.js → diagram-UB23O5K3-BvazI_qH.js} +1 -1
- package/console-app/assets/{ebnfDiagram-BXEA7PRR-BkjeNaQH.js → ebnfDiagram-BXEA7PRR-CBZPYFwZ.js} +1 -1
- package/console-app/assets/{erDiagram-JOGREHBK-BdL77bY3.js → erDiagram-JOGREHBK-BN3FevvT.js} +1 -1
- package/console-app/assets/eventmodeling-45OFAUF4-D2SxzJUl.js +1 -0
- package/console-app/assets/flowDiagram-UKHOOZJN-CQXuJ0z2.js +1 -0
- package/console-app/assets/{ganttDiagram-PKOTCBZU-DfgO68Ez.js → ganttDiagram-PKOTCBZU-03mWH2kB.js} +1 -1
- package/console-app/assets/{gitGraph-TEB2WS4Q-BNbepAzP.js → gitGraph-TEB2WS4Q-By2486wn.js} +1 -1
- package/console-app/assets/{gitGraphDiagram-DS77QQ5N-Crb8obGB.js → gitGraphDiagram-DS77QQ5N-CCzKPRBJ.js} +1 -1
- package/console-app/assets/{index-g8jA8DJo.js → index-snBzz_U8.js} +3 -3
- package/console-app/assets/{index-Dsydm-nw.css → index-suVNAhyL.css} +1 -1
- package/console-app/assets/{info-DKCQHKI2-D9tXUXel.js → info-DKCQHKI2-C_vsavqC.js} +1 -1
- package/console-app/assets/{infoDiagram-6WML65LV-BvG8ufLa.js → infoDiagram-6WML65LV-BKvU8du7.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-WSZJBQD7-BWoGxEjO.js → ishikawaDiagram-WSZJBQD7-CnF0qm0n.js} +1 -1
- package/console-app/assets/{journeyDiagram-NVQOT4AX-CR4YcPHg.js → journeyDiagram-NVQOT4AX-DxKe9OZ7.js} +1 -1
- package/console-app/assets/{kanban-definition-27J2QSJJ-DYfc5EZe.js → kanban-definition-27J2QSJJ-CB8lgPxU.js} +1 -1
- package/console-app/assets/{line-NIaf8Mfw.js → line-DFNLso1I.js} +1 -1
- package/console-app/assets/{linear-DB_1BE-l.js → linear-D1cspVtk.js} +1 -1
- package/console-app/assets/{mermaid-parser.core-BqCVMHRZ.js → mermaid-parser.core-BtmN233C.js} +3 -3
- package/console-app/assets/{mermaid.core-CYaeERjF.js → mermaid.core-37H5_HoB.js} +4 -4
- package/console-app/assets/{mindmap-definition-FAOFIHXS-BCjT2v4F.js → mindmap-definition-FAOFIHXS-Czf82JOB.js} +1 -1
- package/console-app/assets/{packet-7NZHBO7P-CzFZvntp.js → packet-7NZHBO7P-CErYxAQM.js} +1 -1
- package/console-app/assets/{pegDiagram-VL7TDLO6-3iMotW64.js → pegDiagram-VL7TDLO6-CRKX6HOt.js} +1 -1
- package/console-app/assets/{pie-RZYD4A2V-CXIoUTJn.js → pie-RZYD4A2V-YmMmh6Nq.js} +1 -1
- package/console-app/assets/{pieDiagram-7S7Q4E2Y-B-EOKkdd.js → pieDiagram-7S7Q4E2Y-Cot0Fu5q.js} +1 -1
- package/console-app/assets/{quadrantDiagram-CIZ2JOQS-DDdq8l2N.js → quadrantDiagram-CIZ2JOQS-DPEonVYT.js} +1 -1
- package/console-app/assets/{radar-I7S5WNFK-9SLSkJ73.js → radar-I7S5WNFK-Pf_KiQJM.js} +1 -1
- package/console-app/assets/{railroad-3IZDKUUU-DdJ88Ord.js → railroad-3IZDKUUU-BYoOMoQY.js} +1 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-CCRXsRRD.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-DVRSVgn8.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-COUBoNH3.js +1 -0
- package/console-app/assets/{railroadDiagram-AXF67PYL-BMW_s9QW.js → railroadDiagram-AXF67PYL-Di8N9tHD.js} +1 -1
- package/console-app/assets/{requirementDiagram-LRYGKXZP-BzcnEvjk.js → requirementDiagram-LRYGKXZP-2yZZ753q.js} +1 -1
- package/console-app/assets/{sankeyDiagram-W5VNT64P-Dh2TFvuG.js → sankeyDiagram-W5VNT64P-BwYA-xq1.js} +1 -1
- package/console-app/assets/{sequenceDiagram-SI44F4Z6-b-m-tQYz.js → sequenceDiagram-SI44F4Z6-odIxlx8J.js} +1 -1
- package/console-app/assets/{src-Dm8O0hiD.js → src-CxJwpjvz.js} +1 -1
- package/console-app/assets/{stateDiagram-OKZ733FA-W98kCkqj.js → stateDiagram-OKZ733FA-Du2S0qU9.js} +1 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-CTXOGDRR.js +1 -0
- package/console-app/assets/{swimlanes-SLNWSIFB-0q_y6cLu.js → swimlanes-SLNWSIFB-JZ3swzI2.js} +1 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-DRrggQgK.js +8 -0
- package/console-app/assets/{timeline-definition-Z64GVDOM-DmsNlhwe.js → timeline-definition-Z64GVDOM-CsppAEWi.js} +1 -1
- package/console-app/assets/{treeView-QDETBFTQ-DY7A9uJm.js → treeView-QDETBFTQ-DkkO8peQ.js} +1 -1
- package/console-app/assets/{treemap-6X3UGDF4-DI73Vm90.js → treemap-6X3UGDF4-hjLkPCJI.js} +1 -1
- package/console-app/assets/{vennDiagram-T6HMQDX7-Czpr9diJ.js → vennDiagram-T6HMQDX7-BOfgM1xp.js} +1 -1
- package/console-app/assets/{wardley-OPB4EBWU-C39AmDqd.js → wardley-OPB4EBWU-C5ZtGfBa.js} +1 -1
- package/console-app/assets/{wardleyDiagram-T6FBY63Y-DOtWBvnk.js → wardleyDiagram-T6FBY63Y-ymf3Vm6A.js} +1 -1
- package/console-app/assets/{xychartDiagram-ELKLHX3M-VHHuGrWV.js → xychartDiagram-ELKLHX3M-DdxXIoKz.js} +1 -1
- package/console-app/index.html +2 -2
- package/dist/.pikku/addon/index.d.ts +1 -1
- package/dist/.pikku/addon/index.js +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
- package/dist/.pikku/agent/index.d.ts +1 -1
- package/dist/.pikku/agent/index.js +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/auth/index.d.ts +1 -1
- package/dist/.pikku/auth/index.js +1 -1
- package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +1 -1
- package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
- package/dist/.pikku/channel/index.d.ts +1 -1
- package/dist/.pikku/channel/index.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/index.d.ts +1 -1
- package/dist/.pikku/cli/index.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- 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 +7 -42
- 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 +1 -1
- package/dist/.pikku/error/index.d.ts +1 -1
- package/dist/.pikku/error/index.js +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/function/index.d.ts +1 -1
- package/dist/.pikku/function/index.js +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +18 -18
- package/dist/.pikku/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/gateway/index.d.ts +1 -1
- package/dist/.pikku/gateway/index.js +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
- package/dist/.pikku/http/index.d.ts +1 -1
- package/dist/.pikku/http/index.js +1 -1
- 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/index.d.ts +1 -1
- package/dist/.pikku/mcp/index.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/middleware/index.d.ts +1 -1
- package/dist/.pikku/middleware/index.js +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +2 -2
- package/dist/.pikku/middleware/pikku-middleware-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-services.gen.d.ts +1 -1
- package/dist/.pikku/queue/index.d.ts +1 -1
- package/dist/.pikku/queue/index.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/scenarios/index.d.ts +1 -1
- package/dist/.pikku/scenarios/index.js +1 -1
- package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -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-types.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/index.d.ts +1 -1
- package/dist/.pikku/scheduler/index.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 +1 -1
- package/dist/.pikku/scopes/index.d.ts +1 -1
- package/dist/.pikku/scopes/index.js +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/index.d.ts +1 -1
- package/dist/.pikku/secrets/index.js +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/services/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/setup/index.d.ts +1 -1
- package/dist/.pikku/setup/index.js +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
- package/dist/.pikku/trigger/index.d.ts +1 -1
- package/dist/.pikku/trigger/index.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/index.d.ts +1 -1
- package/dist/.pikku/variables/index.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/index.d.ts +1 -1
- package/dist/.pikku/workflow/index.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- 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/src/cli.wiring.js +0 -42
- package/dist/src/deploy/bundler/bun-bundler.js +18 -2
- package/dist/src/fabric/functions/validate.function.js +24 -4
- package/dist/src/functions/commands/dev-agent-runner.js +48 -13
- package/dist/src/functions/commands/dev.js +1 -2
- package/dist/src/functions/commands/enable.js +11 -27
- package/dist/src/functions/commands/serve.js +1 -2
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.js +6 -6
- package/dist/src/functions/validate/shared-checks.js +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-public-agent.js +1 -2
- package/dist/src/functions/wirings/agent/serialize-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/agent/serialize-public-agent.js +10 -11
- package/dist/src/functions/wirings/emails/pikku-command-emails.js +2 -2
- package/dist/src/functions/wirings/emails/serialize-emails.js +112 -42
- package/dist/src/functions/wirings/middleware/serialize-middleware-types.js +1 -1
- package/dist/src/functions/wirings/personas/serialize-personas-secrets.d.ts +5 -0
- package/dist/src/functions/wirings/personas/serialize-personas-secrets.js +6 -0
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +1 -3
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.js +3 -4
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +1 -2
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +3 -4
- package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.d.ts +4 -5
- package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.js +5 -6
- package/dist/src/functions/wirings/scopes/pikku-command-scopes.js +5 -0
- package/dist/src/functions/wirings/scopes/serialize-scopes-client.d.ts +16 -0
- package/dist/src/functions/wirings/scopes/serialize-scopes-client.js +72 -0
- package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.js +1 -2
- package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.d.ts +1 -1
- package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.js +1 -8
- package/dist/src/functions/wirings/virtual-user/pikku-command-virtual-user-functions.js +1 -2
- package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.d.ts +1 -1
- package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.js +1 -4
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +1 -2
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +8 -9
- package/dist/src/utils/pikku-cli-config.js +8 -4
- package/dist/src/utils/resolve-scaffold-feature.d.ts +7 -6
- package/dist/src/utils/resolve-scaffold-feature.js +11 -35
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/surface.json +1 -1
- package/console-app/assets/architecture-TIHT7OUA-B1IpeRpl.js +0 -1
- package/console-app/assets/channel-sTJGzqn9.js +0 -1
- package/console-app/assets/chunk-XXDRQBXY-CLdTtHL4.js +0 -1
- package/console-app/assets/classDiagram-JCYQIIEL-Dh0wx8TK.js +0 -1
- package/console-app/assets/classDiagram-v2-OCEON4UE-Dh0wx8TK.js +0 -1
- package/console-app/assets/eventmodeling-45OFAUF4-C6PNVeIU.js +0 -1
- package/console-app/assets/flowDiagram-UKHOOZJN-CmURPvo2.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-D2QiLT8B.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-CSMqj9L2.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-Cg1-F8im.js +0 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-DpnoMNHC.js +0 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-BmGtOaWo.js +0 -8
|
@@ -14,7 +14,6 @@ import { InMemorySchedulerService } from '@pikku/schedule';
|
|
|
14
14
|
import { resolveDb, createKysely, parseDatabaseUrl, } from '../db/local-db.js';
|
|
15
15
|
import { loadUserBootstrap, loadUserModule } from './load-user-project.js';
|
|
16
16
|
import { registerScenarioInstrumentation } from '../wirings/scenarios/register-scenario-instrumentation.js';
|
|
17
|
-
import { resolveScaffoldFeature } from '../../utils/resolve-scaffold-feature.js';
|
|
18
17
|
import { createDevAgentRunner } from './dev-agent-runner.js';
|
|
19
18
|
import { resolveConsoleMount } from './serve-console.js';
|
|
20
19
|
import { serverReadyLine } from '../../server/server-ready.js';
|
|
@@ -42,7 +41,7 @@ export const serve = pikkuSessionlessFunc({
|
|
|
42
41
|
// into the project — an app bootstrap is what a deployed bundle imports,
|
|
43
42
|
// and coverage endpoints have no business in one.
|
|
44
43
|
if (config.scaffold?.scenarios) {
|
|
45
|
-
registerScenarioInstrumentation(
|
|
44
|
+
registerScenarioInstrumentation();
|
|
46
45
|
}
|
|
47
46
|
const workflowService = new InMemoryWorkflowService();
|
|
48
47
|
const configModule = await loadUserModule(pikkuConfigFactory.file);
|
|
@@ -5,23 +5,23 @@ import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-
|
|
|
5
5
|
import { serializeTanStackStartShim } from './serialize-tanstack-start-shim.js';
|
|
6
6
|
export const pikkuTanStackStart = pikkuSessionlessFunc({
|
|
7
7
|
func: async ({ logger, config }) => {
|
|
8
|
-
const
|
|
8
|
+
const tanstackStartFile = config.clientFiles?.tanstackStartFile;
|
|
9
9
|
const rpcWiringsFile = config.clientFiles?.rpcWiringsFile;
|
|
10
10
|
const { packageMappings } = config;
|
|
11
|
-
if (!
|
|
11
|
+
if (!tanstackStartFile) {
|
|
12
12
|
logger.debug({
|
|
13
|
-
message: "Skipping generating TanStack Start shim since
|
|
13
|
+
message: "Skipping generating TanStack Start shim since tanstackStartFile isn't set in the pikku config.",
|
|
14
14
|
type: 'skip',
|
|
15
15
|
});
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
if (!rpcWiringsFile) {
|
|
19
|
-
logger.warn('Skipping TanStack Start shim:
|
|
19
|
+
logger.warn('Skipping TanStack Start shim: tanstackStartFile is set but rpcWiringsFile is not — the shim imports the PikkuRPC class from rpcWiringsFile.');
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
const rpcWiringsPath = getFileImportRelativePath(
|
|
22
|
+
const rpcWiringsPath = getFileImportRelativePath(tanstackStartFile, rpcWiringsFile, packageMappings);
|
|
23
23
|
const content = serializeTanStackStartShim(rpcWiringsPath);
|
|
24
|
-
await writeFileInDir(logger,
|
|
24
|
+
await writeFileInDir(logger, tanstackStartFile, content);
|
|
25
25
|
},
|
|
26
26
|
middleware: [
|
|
27
27
|
logCommandInfoAndTime({
|
|
@@ -139,7 +139,7 @@ export async function runSharedProjectChecks(root) {
|
|
|
139
139
|
if (pikkuConfig.scaffold?.[s.key])
|
|
140
140
|
continue;
|
|
141
141
|
const report = s.severity === 'error' ? e : w;
|
|
142
|
-
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`, '}', '
|
|
142
|
+
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`, '}', 'Then re-run codegen (`pikku all`) and restart the dev server.'));
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
const dbEngine = pikkuConfig?.db?.engine ?? 'sqlite';
|
|
@@ -4,12 +4,11 @@ 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';
|
|
8
7
|
export const pikkuPublicAgent = pikkuSessionlessFunc({
|
|
9
8
|
func: async ({ logger, config }) => {
|
|
10
9
|
if (config.scaffold?.agent && config.publicAgentSchemasFile) {
|
|
11
10
|
const leaf = (name) => getLeafImportPath(config.publicAgentFile, name, config);
|
|
12
|
-
const { schemas, functions } = serializePublicAgent(leaf,
|
|
11
|
+
const { schemas, functions } = serializePublicAgent(leaf, config.globalHTTPPrefix || '');
|
|
13
12
|
await writeFileInDir(logger, config.publicAgentSchemasFile, schemas);
|
|
14
13
|
await writeFileInDir(logger, config.publicAgentFile, functions);
|
|
15
14
|
await removeLegacyScaffoldFile(config.publicAgentFile);
|
|
@@ -2,4 +2,4 @@ export interface PublicAgentGenOutput {
|
|
|
2
2
|
schemas: string;
|
|
3
3
|
functions: string;
|
|
4
4
|
}
|
|
5
|
-
export declare const serializePublicAgent: (leaf: (name: string) => string,
|
|
5
|
+
export declare const serializePublicAgent: (leaf: (name: string) => string, globalHTTPPrefix?: string) => PublicAgentGenOutput;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export const serializePublicAgent = (leaf,
|
|
2
|
-
const authFlag = requireAuth ? 'true' : 'false';
|
|
1
|
+
export const serializePublicAgent = (leaf, globalHTTPPrefix = '') => {
|
|
3
2
|
const schemas = `/**
|
|
4
3
|
* Auto-generated public agent schemas
|
|
5
4
|
* Do not edit manually - regenerate with 'npx pikku'
|
|
@@ -85,7 +84,7 @@ export const isThreadOwner = pikkuPermission<{ threadId: string }>(
|
|
|
85
84
|
export const agentCaller = pikkuSessionlessFunc({
|
|
86
85
|
description: 'Run a named AI agent with a message and return its reply',
|
|
87
86
|
tags: ['pikku'],
|
|
88
|
-
auth:
|
|
87
|
+
auth: false,
|
|
89
88
|
input: AgentCall,
|
|
90
89
|
func: async (_services, data, { rpc }) => {
|
|
91
90
|
return await rpc.agent.run(data.agentName as any, {
|
|
@@ -102,7 +101,7 @@ export const agentCaller = pikkuSessionlessFunc({
|
|
|
102
101
|
|
|
103
102
|
export const agentStreamCaller = pikkuSessionlessFunc({
|
|
104
103
|
tags: ['pikku'],
|
|
105
|
-
auth:
|
|
104
|
+
auth: false,
|
|
106
105
|
input: AgentCall,
|
|
107
106
|
func: async (_services, data, { rpc }) => {
|
|
108
107
|
await rpc.agent.stream(data.agentName as any, {
|
|
@@ -119,7 +118,7 @@ export const agentStreamCaller = pikkuSessionlessFunc({
|
|
|
119
118
|
|
|
120
119
|
export const agentApproveCaller = pikkuSessionlessFunc({
|
|
121
120
|
tags: ['pikku'],
|
|
122
|
-
auth:
|
|
121
|
+
auth: false,
|
|
123
122
|
input: AgentApproval,
|
|
124
123
|
func: async (_services, { runId, approvals, agentName }, { rpc }) => {
|
|
125
124
|
return await rpc.agent.approve(runId, approvals, agentName)
|
|
@@ -128,7 +127,7 @@ export const agentApproveCaller = pikkuSessionlessFunc({
|
|
|
128
127
|
|
|
129
128
|
export const agentResumeCaller = pikkuSessionlessFunc({
|
|
130
129
|
tags: ['pikku'],
|
|
131
|
-
auth:
|
|
130
|
+
auth: false,
|
|
132
131
|
input: AgentResume,
|
|
133
132
|
func: async (_services, data, { rpc }) => {
|
|
134
133
|
await rpc.agent.resume(data.runId, {
|
|
@@ -145,7 +144,7 @@ export const getAgentThreads = pikkuSessionlessFunc({
|
|
|
145
144
|
description:
|
|
146
145
|
'Returns the caller\\'s AI agent threads from storage. Accepts optional filters: agentName, resourceId, limit, and offset for pagination.',
|
|
147
146
|
expose: true,
|
|
148
|
-
auth:
|
|
147
|
+
auth: false,
|
|
149
148
|
func: async ({ agentRunService }, input, { session }) => {
|
|
150
149
|
// \`owners\` is an authorization constraint derived from the session, never
|
|
151
150
|
// from input — \`resourceId\` remains a caller-supplied filter within it.
|
|
@@ -166,7 +165,7 @@ export const getAgentThreadMessages = pikkuSessionlessFunc({
|
|
|
166
165
|
description:
|
|
167
166
|
'Returns all messages for a given AI agent thread, ordered by creation time.',
|
|
168
167
|
expose: true,
|
|
169
|
-
auth:
|
|
168
|
+
auth: false,
|
|
170
169
|
permissions: { owner: isThreadOwner },
|
|
171
170
|
func: async ({ agentRunService }, input) => {
|
|
172
171
|
return await agentRunService.getThreadMessages(input.threadId)
|
|
@@ -180,7 +179,7 @@ export const getAgentThreadRuns = pikkuSessionlessFunc({
|
|
|
180
179
|
description:
|
|
181
180
|
'Returns the run history for a given AI agent thread, ordered by creation time.',
|
|
182
181
|
expose: true,
|
|
183
|
-
auth:
|
|
182
|
+
auth: false,
|
|
184
183
|
permissions: { owner: isThreadOwner },
|
|
185
184
|
func: async ({ agentRunService }, input) => {
|
|
186
185
|
return await agentRunService.getThreadRuns(input.threadId)
|
|
@@ -195,7 +194,7 @@ export const deleteAgentThread = pikkuSessionlessFunc({
|
|
|
195
194
|
description:
|
|
196
195
|
'Deletes an AI agent thread and all of its persisted state.',
|
|
197
196
|
expose: true,
|
|
198
|
-
auth:
|
|
197
|
+
auth: false,
|
|
199
198
|
permissions: { owner: isThreadOwner },
|
|
200
199
|
func: async ({ agentRunService }, input) => {
|
|
201
200
|
const deleted = await agentRunService.deleteThread(input.threadId)
|
|
@@ -204,7 +203,7 @@ export const deleteAgentThread = pikkuSessionlessFunc({
|
|
|
204
203
|
})
|
|
205
204
|
|
|
206
205
|
export const agentRoutes = defineHTTPRoutes({
|
|
207
|
-
auth:
|
|
206
|
+
auth: false,
|
|
208
207
|
tags: ['pikku:public'],
|
|
209
208
|
routes: {
|
|
210
209
|
agentRun: {
|
|
@@ -27,8 +27,8 @@ function collectTemplateVariables(rootSources, locales, partials) {
|
|
|
27
27
|
const source = queue.shift();
|
|
28
28
|
if (!source)
|
|
29
29
|
continue;
|
|
30
|
-
for (const match of source.matchAll(/\{\{\s*([^}]+?)\s*\}\}/g)) {
|
|
31
|
-
const key = String(match[1]).trim();
|
|
30
|
+
for (const match of source.matchAll(/\{\{\{\s*([^{}]+?)\s*\}\}\}|\{\{\s*([^}]+?)\s*\}\}/g)) {
|
|
31
|
+
const key = String(match[1] ?? match[2]).trim();
|
|
32
32
|
if (!key)
|
|
33
33
|
continue;
|
|
34
34
|
if (key.startsWith('>')) {
|
|
@@ -62,32 +62,103 @@ function getNestedValue(source: Record<string, unknown>, path: string): string {
|
|
|
62
62
|
: ''
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
const HTML_ESCAPES: Record<string, string> = {
|
|
66
|
+
'&': '&',
|
|
67
|
+
'<': '<',
|
|
68
|
+
'>': '>',
|
|
69
|
+
'"': '"',
|
|
70
|
+
"'": ''',
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function escapeHtml(value: string): string {
|
|
74
|
+
return value.replace(/[&<>"']/g, (char) => HTML_ESCAPES[char] ?? char)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Matches the raw {{{ value }}} form before the escaped {{ value }} form, so the
|
|
78
|
+
// opt-in escape hatch is never mistaken for a normal substitution.
|
|
79
|
+
const TEMPLATE_TOKEN = /\\{\\{\\{\\s*([^{}]+?)\\s*\\}\\}\\}|\\{\\{\\s*([^}]+?)\\s*\\}\\}/g
|
|
80
|
+
|
|
81
|
+
const PARTIAL_TOKEN = /\\{\\{\\s*>\\s*([a-zA-Z0-9-_/.]+)\\s*\\}\\}/g
|
|
82
|
+
|
|
83
|
+
const MAX_TEMPLATE_DEPTH = 5
|
|
84
|
+
|
|
85
|
+
// theme.json and the locale files ship with the templates, so they are treated as
|
|
86
|
+
// template-author input: expanded before caller data and allowed to contain their
|
|
87
|
+
// own placeholders. Everything else is caller-supplied.
|
|
88
|
+
const TRUSTED_ROOTS = ['theme', 't']
|
|
89
|
+
|
|
90
|
+
function isTrustedKey(key: string): boolean {
|
|
91
|
+
return TRUSTED_ROOTS.includes(String(key.split('.')[0]))
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function readToken(rawTriple: unknown, rawDouble: unknown) {
|
|
95
|
+
const raw = typeof rawTriple === 'string'
|
|
96
|
+
return { raw, key: String(raw ? rawTriple : rawDouble).trim() }
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function expandPartials(source: string, depth = 0): string {
|
|
100
|
+
if (depth >= MAX_TEMPLATE_DEPTH) return source
|
|
101
|
+
let found = false
|
|
102
|
+
const expanded = source.replace(PARTIAL_TOKEN, (_match, partialName) => {
|
|
103
|
+
found = true
|
|
104
|
+
const partial =
|
|
105
|
+
EMAIL_PARTIALS[String(partialName).trim() as keyof typeof EMAIL_PARTIALS]
|
|
106
|
+
return typeof partial === 'string' ? partial : ''
|
|
75
107
|
})
|
|
108
|
+
return found ? expandPartials(expanded, depth + 1) : expanded
|
|
76
109
|
}
|
|
77
110
|
|
|
78
|
-
function
|
|
111
|
+
function expandTrusted(
|
|
112
|
+
source: string,
|
|
113
|
+
context: Record<string, unknown>,
|
|
114
|
+
escape: boolean
|
|
115
|
+
): string {
|
|
79
116
|
let rendered = source
|
|
80
|
-
for (let i = 0; i <
|
|
81
|
-
|
|
82
|
-
|
|
117
|
+
for (let i = 0; i < MAX_TEMPLATE_DEPTH; i += 1) {
|
|
118
|
+
let found = false
|
|
119
|
+
const next = rendered.replace(
|
|
120
|
+
TEMPLATE_TOKEN,
|
|
121
|
+
(match, rawTriple, rawDouble) => {
|
|
122
|
+
const { raw, key } = readToken(rawTriple, rawDouble)
|
|
123
|
+
if (!isTrustedKey(key)) return match
|
|
124
|
+
found = true
|
|
125
|
+
const value = getNestedValue(context, key)
|
|
126
|
+
return raw || !escape ? value : escapeHtml(value)
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
if (!found || next === rendered) break
|
|
83
130
|
rendered = next
|
|
84
131
|
}
|
|
85
132
|
return rendered
|
|
86
133
|
}
|
|
87
134
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
135
|
+
// A single substitution pass — the replacement text is never rescanned, so a
|
|
136
|
+
// caller-supplied value can never be reinterpreted as a template.
|
|
137
|
+
function substitute(
|
|
138
|
+
source: string,
|
|
139
|
+
context: Record<string, unknown>,
|
|
140
|
+
escape: boolean
|
|
141
|
+
): string {
|
|
142
|
+
return source.replace(TEMPLATE_TOKEN, (_match, rawTriple, rawDouble) => {
|
|
143
|
+
const { raw, key } = readToken(rawTriple, rawDouble)
|
|
144
|
+
if (key === 'content') {
|
|
145
|
+
return typeof context.content === 'string' ? context.content : ''
|
|
146
|
+
}
|
|
147
|
+
if (key.startsWith('>')) {
|
|
148
|
+
return ''
|
|
149
|
+
}
|
|
150
|
+
const value = getNestedValue(context, key)
|
|
151
|
+
return raw || !escape ? value : escapeHtml(value)
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function renderTemplate(
|
|
156
|
+
source: string,
|
|
157
|
+
context: Record<string, unknown>,
|
|
158
|
+
escape: boolean
|
|
159
|
+
): string {
|
|
160
|
+
const composed = expandTrusted(expandPartials(source), context, escape)
|
|
161
|
+
return substitute(composed, context, escape)
|
|
91
162
|
}
|
|
92
163
|
|
|
93
164
|
export const EMAILS = EMAIL_TEMPLATES
|
|
@@ -119,39 +190,38 @@ export function renderEmailTemplate<TName extends EmailTemplateName>(
|
|
|
119
190
|
appName,
|
|
120
191
|
}
|
|
121
192
|
|
|
122
|
-
const subject = renderTemplate(template.subject, baseContext).trim()
|
|
123
|
-
const htmlWithPartials = template.html.replace(
|
|
124
|
-
/\\{\\{\\s*>\\s*([a-zA-Z0-9-_/.]+)\\s*\\}\\}/g,
|
|
125
|
-
(_match, partialName) => \`@@PARTIAL:\${String(partialName).trim()}@@\`
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
let htmlBody = renderTemplate(htmlWithPartials, {
|
|
129
|
-
...baseContext,
|
|
130
|
-
subject,
|
|
131
|
-
})
|
|
193
|
+
const subject = renderTemplate(template.subject, baseContext, false).trim()
|
|
132
194
|
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
195
|
+
const htmlBody = renderTemplate(
|
|
196
|
+
template.html,
|
|
197
|
+
{
|
|
136
198
|
...baseContext,
|
|
137
199
|
subject,
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
200
|
+
},
|
|
201
|
+
true
|
|
202
|
+
)
|
|
141
203
|
|
|
142
204
|
const html = EMAIL_PARTIALS.layout
|
|
143
|
-
? renderTemplate(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
205
|
+
? renderTemplate(
|
|
206
|
+
EMAIL_PARTIALS.layout,
|
|
207
|
+
{
|
|
208
|
+
...baseContext,
|
|
209
|
+
subject,
|
|
210
|
+
content: htmlBody,
|
|
211
|
+
},
|
|
212
|
+
true
|
|
213
|
+
)
|
|
148
214
|
: htmlBody
|
|
149
215
|
|
|
150
216
|
const text = template.text
|
|
151
|
-
? renderTemplate(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
217
|
+
? renderTemplate(
|
|
218
|
+
template.text,
|
|
219
|
+
{
|
|
220
|
+
...baseContext,
|
|
221
|
+
subject,
|
|
222
|
+
},
|
|
223
|
+
false
|
|
224
|
+
).trim()
|
|
155
225
|
: undefined
|
|
156
226
|
const hash = (template.hashes[locale]?.contentHash ??
|
|
157
227
|
'') as RenderedEmail<TName>['hash']
|
|
@@ -168,7 +168,7 @@ export const addChannelMiddleware = (tag: string, middleware: PikkuChannelMiddle
|
|
|
168
168
|
|
|
169
169
|
export const pikkuAgentMiddleware = <
|
|
170
170
|
State extends Record<string, unknown> = Record<string, unknown>,
|
|
171
|
-
RequiredServices extends
|
|
171
|
+
RequiredServices extends SingletonServices = WiredSingletonServices,
|
|
172
172
|
>(
|
|
173
173
|
hooks: PikkuAgentMiddlewareHooks<State, RequiredServices>
|
|
174
174
|
): PikkuAgentMiddlewareHooks<State, RequiredServices> => hooks
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
* regardless of what the user wired should be collected by the platform, not
|
|
11
11
|
* discovered missing at the first sign-in.
|
|
12
12
|
*
|
|
13
|
+
* It is `optional` because a stage that runs no scenarios is a supported state:
|
|
14
|
+
* the actor sign-in then refuses every request, which is how the surface is
|
|
15
|
+
* switched off. A required declaration fails the deploy config gate on every
|
|
16
|
+
* such stage instead.
|
|
17
|
+
*
|
|
13
18
|
* The schema is a named const because the inspector only accepts a variable
|
|
14
19
|
* reference for `schema`, never an inline expression.
|
|
15
20
|
*/
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
* regardless of what the user wired should be collected by the platform, not
|
|
11
11
|
* discovered missing at the first sign-in.
|
|
12
12
|
*
|
|
13
|
+
* It is `optional` because a stage that runs no scenarios is a supported state:
|
|
14
|
+
* the actor sign-in then refuses every request, which is how the surface is
|
|
15
|
+
* switched off. A required declaration fails the deploy config gate on every
|
|
16
|
+
* such stage instead.
|
|
17
|
+
*
|
|
13
18
|
* The schema is a named const because the inspector only accepts a variable
|
|
14
19
|
* reference for `schema`, never an inline expression.
|
|
15
20
|
*/
|
|
@@ -27,6 +32,7 @@ defineSecret({
|
|
|
27
32
|
displayName: 'Scenario Actor Secret',
|
|
28
33
|
description:
|
|
29
34
|
'Signing secret that lets scenarios and virtual users sign in as a declared persona',
|
|
35
|
+
optional: true,
|
|
30
36
|
secretId: 'SCENARIO_ACTOR_SECRET',
|
|
31
37
|
schema: ScenarioActorSecretSchema,
|
|
32
38
|
})
|
|
@@ -4,7 +4,6 @@ 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 { serializeEventsScaffold } from './serialize-events-scaffold.js';
|
|
7
|
-
import { resolveScaffoldFeature } from '../../../utils/resolve-scaffold-feature.js';
|
|
8
7
|
export const pikkuEventsScaffold = pikkuSessionlessFunc({
|
|
9
8
|
func: async ({ logger, config }) => {
|
|
10
9
|
if (!config.scaffold?.events ||
|
|
@@ -16,8 +15,7 @@ export const pikkuEventsScaffold = pikkuSessionlessFunc({
|
|
|
16
15
|
});
|
|
17
16
|
return false;
|
|
18
17
|
}
|
|
19
|
-
const
|
|
20
|
-
const { schemas, functions } = serializeEventsScaffold(authRequired, (name) => getLeafImportPath(config.eventsChannelFile, name, config));
|
|
18
|
+
const { schemas, functions } = serializeEventsScaffold((name) => getLeafImportPath(config.eventsChannelFile, name, config));
|
|
21
19
|
await writeFileInDir(logger, config.eventsSchemasFile, schemas);
|
|
22
20
|
await writeFileInDir(logger, config.eventsChannelFile, functions);
|
|
23
21
|
await removeLegacyScaffoldFile(config.eventsChannelFile);
|
|
@@ -21,4 +21,4 @@ export interface EventsGenOutput {
|
|
|
21
21
|
* publish-side ergonomics (envelope shape) are documented in the
|
|
22
22
|
* pikku-realtime skill.
|
|
23
23
|
*/
|
|
24
|
-
export declare const serializeEventsScaffold: (
|
|
24
|
+
export declare const serializeEventsScaffold: (leaf: (name: string) => string) => EventsGenOutput;
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
* publish-side ergonomics (envelope shape) are documented in the
|
|
18
18
|
* pikku-realtime skill.
|
|
19
19
|
*/
|
|
20
|
-
export const serializeEventsScaffold = (
|
|
21
|
-
const auth = authRequired ? 'true' : 'false';
|
|
20
|
+
export const serializeEventsScaffold = (leaf) => {
|
|
22
21
|
const schemas = `/**
|
|
23
22
|
* Auto-generated realtime event schemas
|
|
24
23
|
* Do not edit manually - regenerate with 'npx pikku'
|
|
@@ -67,7 +66,7 @@ export const realtimeRoutes = defineChannelRoutes({
|
|
|
67
66
|
wireChannel({
|
|
68
67
|
name: 'events',
|
|
69
68
|
route: '/events',
|
|
70
|
-
auth:
|
|
69
|
+
auth: false,
|
|
71
70
|
onMessageWiring: {
|
|
72
71
|
action: realtimeRoutes,
|
|
73
72
|
},
|
|
@@ -95,7 +94,7 @@ wireHTTP({
|
|
|
95
94
|
method: 'get',
|
|
96
95
|
route: '/events/:topic',
|
|
97
96
|
func: realtimeEventStream,
|
|
98
|
-
auth:
|
|
97
|
+
auth: false,
|
|
99
98
|
sse: true,
|
|
100
99
|
tags: ['pikku:realtime', 'sse'],
|
|
101
100
|
})
|
|
@@ -4,7 +4,6 @@ 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 { serializePublicRPC } from './serialize-public-rpc.js';
|
|
7
|
-
import { resolveScaffoldFeature } from '../../../utils/resolve-scaffold-feature.js';
|
|
8
7
|
import { isDeployCodegen } from '../../../utils/is-deploy-codegen.js';
|
|
9
8
|
export const pikkuPublicRPC = pikkuSessionlessFunc({
|
|
10
9
|
func: async ({ logger, config, variables }) => {
|
|
@@ -13,7 +12,7 @@ export const pikkuPublicRPC = pikkuSessionlessFunc({
|
|
|
13
12
|
}
|
|
14
13
|
if (config.scaffold?.rpc && config.publicRpcSchemasFile) {
|
|
15
14
|
const leaf = (name) => getLeafImportPath(config.publicRpcFile, name, config);
|
|
16
|
-
const { schemas, functions } = serializePublicRPC(leaf,
|
|
15
|
+
const { schemas, functions } = serializePublicRPC(leaf, config.globalHTTPPrefix || '');
|
|
17
16
|
await writeFileInDir(logger, config.publicRpcSchemasFile, schemas);
|
|
18
17
|
await writeFileInDir(logger, config.publicRpcFile, functions);
|
|
19
18
|
await removeLegacyScaffoldFile(config.publicRpcFile);
|
|
@@ -5,4 +5,4 @@ export interface PublicRPCGenOutput {
|
|
|
5
5
|
/**
|
|
6
6
|
* Generate public RPC HTTP endpoint
|
|
7
7
|
*/
|
|
8
|
-
export declare const serializePublicRPC: (leaf: (name: string) => string,
|
|
8
|
+
export declare const serializePublicRPC: (leaf: (name: string) => string, globalHTTPPrefix?: string) => PublicRPCGenOutput;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generate public RPC HTTP endpoint
|
|
3
3
|
*/
|
|
4
|
-
export const serializePublicRPC = (leaf,
|
|
5
|
-
const authFlag = requireAuth ? 'true' : 'false';
|
|
4
|
+
export const serializePublicRPC = (leaf, globalHTTPPrefix = '') => {
|
|
6
5
|
const schemas = `/**
|
|
7
6
|
* Auto-generated public RPC endpoint schemas
|
|
8
7
|
* Do not edit manually - regenerate with 'npx pikku'
|
|
@@ -24,7 +23,7 @@ import { RPCCall } from './rpc-public.schemas.gen.js'
|
|
|
24
23
|
|
|
25
24
|
export const rpcCaller = pikkuSessionlessFunc({
|
|
26
25
|
tags: ['pikku'],
|
|
27
|
-
auth:
|
|
26
|
+
auth: false,
|
|
28
27
|
input: RPCCall,
|
|
29
28
|
func: async (_services, { rpcName, data }, { rpc }) => {
|
|
30
29
|
return await rpc.exposed(rpcName, data)
|
|
@@ -34,7 +33,7 @@ export const rpcCaller = pikkuSessionlessFunc({
|
|
|
34
33
|
wireHTTP({
|
|
35
34
|
route: '${globalHTTPPrefix}/rpc/:rpcName',
|
|
36
35
|
method: 'post',
|
|
37
|
-
auth:
|
|
36
|
+
auth: false,
|
|
38
37
|
tags: ['pikku'],
|
|
39
38
|
func: rpcCaller,
|
|
40
39
|
})
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* Register the instrumentation into the running dev server's state, so the
|
|
3
3
|
* scenario runner can reach it over `/rpc/<name>` exactly as before.
|
|
4
4
|
*
|
|
5
|
-
* They are registered sessionless
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* what opens them.
|
|
5
|
+
* They are registered sessionless with `auth: true`, so a caller still needs a
|
|
6
|
+
* session: the `/rpc/:rpcName` dispatcher declines to gate, which leaves each
|
|
7
|
+
* function to answer for itself.
|
|
9
8
|
*/
|
|
10
|
-
export declare const registerScenarioInstrumentation: (
|
|
9
|
+
export declare const registerScenarioInstrumentation: () => void;
|
|
@@ -104,19 +104,18 @@ const instrumentation = {
|
|
|
104
104
|
* Register the instrumentation into the running dev server's state, so the
|
|
105
105
|
* scenario runner can reach it over `/rpc/<name>` exactly as before.
|
|
106
106
|
*
|
|
107
|
-
* They are registered sessionless
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* what opens them.
|
|
107
|
+
* They are registered sessionless with `auth: true`, so a caller still needs a
|
|
108
|
+
* session: the `/rpc/:rpcName` dispatcher declines to gate, which leaves each
|
|
109
|
+
* function to answer for itself.
|
|
111
110
|
*/
|
|
112
|
-
export const registerScenarioInstrumentation = (
|
|
111
|
+
export const registerScenarioInstrumentation = () => {
|
|
113
112
|
const meta = pikkuState(null, 'function', 'meta');
|
|
114
113
|
// Retaining finished runs is what makes them gradeable, and this is the only
|
|
115
114
|
// place that can grade one — so the buffer is turned on here rather than by a
|
|
116
115
|
// flag someone has to remember, and stays absent from every other process.
|
|
117
116
|
enableScoreSnapshots();
|
|
118
117
|
for (const [name, { func, title, description }] of Object.entries(instrumentation)) {
|
|
119
|
-
addFunction(name, { func, auth:
|
|
118
|
+
addFunction(name, { func, auth: true });
|
|
120
119
|
meta[name] = {
|
|
121
120
|
pikkuFuncId: name,
|
|
122
121
|
inputSchemaName: null,
|
|
@@ -2,10 +2,12 @@ import { pikkuSessionlessFunc } from '#pikku/function';
|
|
|
2
2
|
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
3
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
4
4
|
import { serializeScopesTypes } from './serialize-scopes-types.js';
|
|
5
|
+
import { serializeScopesClient } from './serialize-scopes-client.js';
|
|
5
6
|
import { validateAndBuildScopeDefinitionsMeta } from '@pikku/core/scope';
|
|
6
7
|
export const pikkuScopes = pikkuSessionlessFunc({
|
|
7
8
|
func: async ({ logger, config, getInspectorState }, data) => {
|
|
8
9
|
const { scopesFile, scopesMetaJsonFile } = config;
|
|
10
|
+
const scopesClientFile = config.clientFiles?.scopesFile;
|
|
9
11
|
if (!scopesFile) {
|
|
10
12
|
return;
|
|
11
13
|
}
|
|
@@ -21,6 +23,9 @@ export const pikkuScopes = pikkuSessionlessFunc({
|
|
|
21
23
|
definitions: state.scopes.definitions,
|
|
22
24
|
});
|
|
23
25
|
await writeFileInDir(logger, scopesFile, content);
|
|
26
|
+
if (scopesClientFile) {
|
|
27
|
+
await writeFileInDir(logger, scopesClientFile, serializeScopesClient({ definitions: state.scopes.definitions }));
|
|
28
|
+
}
|
|
24
29
|
if (scopesMetaJsonFile) {
|
|
25
30
|
const meta = validateAndBuildScopeDefinitionsMeta(state.scopes.definitions);
|
|
26
31
|
await writeFileInDir(logger, scopesMetaJsonFile, JSON.stringify(meta, null, 2));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ScopeDefinitions } from '@pikku/core/scope';
|
|
2
|
+
export interface SerializeScopesClientOptions {
|
|
3
|
+
definitions: ScopeDefinitions;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Generates the browser-side scope client: the `ScopeId` union and a
|
|
7
|
+
* `hasScopes` that decides whether held grants satisfy a requirement.
|
|
8
|
+
*
|
|
9
|
+
* The cascade is emitted inline rather than imported, so the file a frontend
|
|
10
|
+
* bundles has no imports at all. `@pikku/core` is a server package — it pulls
|
|
11
|
+
* AsyncLocalStorage and the wiring runtime behind it — so a UI reaching for
|
|
12
|
+
* `@pikku/core/scope` to render a permission drags the server into the bundle.
|
|
13
|
+
* `serialize-scopes-client.test.ts` checks this copy against core's over a
|
|
14
|
+
* shared case table.
|
|
15
|
+
*/
|
|
16
|
+
export declare const serializeScopesClient: ({ definitions, }: SerializeScopesClientOptions) => string;
|