@pikku/cli 0.12.100 → 0.12.102
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 → abnfDiagram-VRR7QNED-BneJZPuq.js} +1 -1
- package/console-app/assets/{arc-BfGls--L.js → arc-B6oXAx95.js} +1 -1
- package/console-app/assets/architecture-TIHT7OUA-BIpQbDwm.js +1 -0
- package/console-app/assets/{architectureDiagram-ZJ3FMSHR-CpnsLBns.js → architectureDiagram-ZJ3FMSHR-Dn6JKcGL.js} +1 -1
- package/console-app/assets/{blockDiagram-677ZJIJ3-ByKRMGSr.js → blockDiagram-677ZJIJ3-CQtakjN5.js} +1 -1
- package/console-app/assets/{c4Diagram-LMCZKHZV-CzJSbsUo.js → c4Diagram-LMCZKHZV-DRBlz-sO.js} +1 -1
- package/console-app/assets/channel-D9eZ2wja.js +1 -0
- package/console-app/assets/{chunk-32BRIVSS-D_tc4HCY.js → chunk-32BRIVSS-DIionvWe.js} +1 -1
- package/console-app/assets/{chunk-52WLFC77-wkQkuUXG.js → chunk-52WLFC77-DwrMMV53.js} +1 -1
- package/console-app/assets/{chunk-C7G6YPKG-BFW3xG3R.js → chunk-C7G6YPKG-C7_SHoee.js} +1 -1
- package/console-app/assets/{chunk-EX3LRPZG-Car090Sw.js → chunk-EX3LRPZG-Brqi3de0.js} +1 -1
- package/console-app/assets/{chunk-FWX5IMBZ-c2ud9kQ-.js → chunk-FWX5IMBZ-CGXYdLJv.js} +2 -2
- package/console-app/assets/{chunk-HOUHSVGY-RYmQka5R.js → chunk-HOUHSVGY-C-mHnXIa.js} +1 -1
- package/console-app/assets/{chunk-ICXQ74PX-C-dqYC_9.js → chunk-ICXQ74PX-x3psPzuY.js} +1 -1
- package/console-app/assets/{chunk-MOJQB5TN-Cu3FUWwl.js → chunk-MOJQB5TN-2uXUItkq.js} +1 -1
- package/console-app/assets/{chunk-OGEWGWER-Z7f1yArD.js → chunk-OGEWGWER-eXRvfFkE.js} +1 -1
- package/console-app/assets/{chunk-PUDLZKDR-Bp68DuRj.js → chunk-PUDLZKDR-CyN33Wwe.js} +1 -1
- package/console-app/assets/{chunk-Q4XR5HBZ-CdKSYWZ4.js → chunk-Q4XR5HBZ-uyzxeIyh.js} +1 -1
- package/console-app/assets/{chunk-RYQCIY6F-9ISCAKm2.js → chunk-RYQCIY6F-CB9wv1YB.js} +1 -1
- package/console-app/assets/{chunk-V7JOEXUC-2EOc1nQB.js → chunk-V7JOEXUC-DLMzjIkb.js} +1 -1
- package/console-app/assets/chunk-VAUOI2AC--YVrsYCZ.js +1 -0
- package/console-app/assets/{chunk-VR4S4FIN-BPvN0PUm.js → chunk-VR4S4FIN-DtBvdHYI.js} +1 -1
- package/console-app/assets/{chunk-WYO6CB5R-DOpurCTP.js → chunk-WYO6CB5R-B_EVxwHf.js} +1 -1
- package/console-app/assets/chunk-XXDRQBXY-By-5aH9h.js +1 -0
- package/console-app/assets/{chunk-ZGVPDNZ5-Bu2weVOL.js → chunk-ZGVPDNZ5-CGfMGxHR.js} +1 -1
- package/console-app/assets/classDiagram-OUVF2IWQ-Bg6U871E.js +1 -0
- package/console-app/assets/classDiagram-v2-EOCWNBFH-Bg6U871E.js +1 -0
- package/console-app/assets/{cose-bilkent-JH36ORCC-nau-QGCX.js → cose-bilkent-JH36ORCC-B_3kCkWC.js} +1 -1
- package/console-app/assets/{cynefin-VYW2F7L2-BBw-E7lg.js → cynefin-VYW2F7L2-Buqf60VA.js} +1 -1
- package/console-app/assets/{cynefinDiagram-TSTJHNR4-BvnMvOvH.js → cynefinDiagram-TSTJHNR4-DOjw2x6X.js} +1 -1
- package/console-app/assets/{dagre-VKFMJZFB-CHEqPR29.js → dagre-VKFMJZFB-CTZTYT0b.js} +1 -1
- package/console-app/assets/{diagram-FQU43EPY-JijKRWyb.js → diagram-FQU43EPY-BZh4LC_G.js} +1 -1
- package/console-app/assets/{diagram-G47NLZAW-G5UsB31f.js → diagram-G47NLZAW-DDHD69gC.js} +1 -1
- package/console-app/assets/{diagram-NH7WQ7WH-BhuJ6fPu.js → diagram-NH7WQ7WH-YnfI_N0A.js} +1 -1
- package/console-app/assets/{diagram-OA4YK3LP-DaUF-8N4.js → diagram-OA4YK3LP-ByfLxp7x.js} +1 -1
- package/console-app/assets/{diagram-WEI45ONY-wLsJIhoM.js → diagram-WEI45ONY-CghNIRYp.js} +1 -1
- package/console-app/assets/{dist-fbBkbDNG.js → dist-DCLZxlZv.js} +1 -1
- package/console-app/assets/{ebnfDiagram-CCIWWBDH-BZCEa3Dz.js → ebnfDiagram-CCIWWBDH-D5_G_ZqU.js} +1 -1
- package/console-app/assets/{erDiagram-Q63AITRT-4XoEUtEh.js → erDiagram-Q63AITRT-B5ZtoDJs.js} +1 -1
- package/console-app/assets/eventmodeling-45OFAUF4-eU2Q2DYK.js +1 -0
- package/console-app/assets/flowDiagram-23GEKE2U-CtRJ8nYJ.js +1 -0
- package/console-app/assets/{ganttDiagram-NO4QXBWP-BXU7pfq6.js → ganttDiagram-NO4QXBWP-R-TggPMB.js} +1 -1
- package/console-app/assets/{gitGraph-TEB2WS4Q-BdMAmvpU.js → gitGraph-TEB2WS4Q-Cjhl-pwb.js} +1 -1
- package/console-app/assets/{gitGraphDiagram-IHSO6WYX-3Hn0zwZR.js → gitGraphDiagram-IHSO6WYX-DnQe5wWr.js} +1 -1
- package/console-app/assets/{index-Din2vBeb.js → index-BZTTf18Y.js} +150 -150
- package/console-app/assets/{index-BXMjqLQ5.css → index-r763CZB4.css} +1 -1
- package/console-app/assets/{info-DKCQHKI2-Dc_oQkp5.js → info-DKCQHKI2-DlSWT4UP.js} +1 -1
- package/console-app/assets/{infoDiagram-FWYZ7A6U-B3v4xCUn.js → infoDiagram-FWYZ7A6U-xqpfzGnj.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-FXEZZL3T-DzWq9Vtp.js → ishikawaDiagram-FXEZZL3T-M_pUeGWs.js} +1 -1
- package/console-app/assets/{journeyDiagram-5HDEW3XC-C0buWi_a.js → journeyDiagram-5HDEW3XC-Dm6FR2DD.js} +1 -1
- package/console-app/assets/{kanban-definition-HUTT4EX6-DRAN9HhV.js → kanban-definition-HUTT4EX6-CbhkDdQH.js} +1 -1
- package/console-app/assets/{line-UqgRNiAC.js → line-C98Z2IVv.js} +1 -1
- package/console-app/assets/{linear-FTAGuk_3.js → linear-fYIkDCbB.js} +1 -1
- package/console-app/assets/{mermaid-parser.core-DIHI27FL.js → mermaid-parser.core-Dkioi2z2.js} +3 -3
- package/console-app/assets/{mermaid.core-D4q8kvcu.js → mermaid.core-CeJcbw8_.js} +3 -3
- package/console-app/assets/{mindmap-definition-LN4V7U3C-DN-_CNLb.js → mindmap-definition-LN4V7U3C-DDitGESW.js} +1 -1
- package/console-app/assets/{packet-7NZHBO7P-8a3PoQAb.js → packet-7NZHBO7P-DWZKJ9Us.js} +1 -1
- package/console-app/assets/{pegDiagram-2B236MQR-Bh2MhzCN.js → pegDiagram-2B236MQR-CZGjPLXH.js} +1 -1
- package/console-app/assets/{pie-RZYD4A2V-Bi6zbJDl.js → pie-RZYD4A2V-DT4-E-uE.js} +1 -1
- package/console-app/assets/{pieDiagram-ENE6RG2P-D2Z0W5UU.js → pieDiagram-ENE6RG2P-bgr82Jyt.js} +1 -1
- package/console-app/assets/{quadrantDiagram-ABIIQ3AL-DNOKka0p.js → quadrantDiagram-ABIIQ3AL-Dcw3uNG0.js} +1 -1
- package/console-app/assets/{radar-I7S5WNFK-CAxa68Sg.js → radar-I7S5WNFK-CFAbRVFk.js} +1 -1
- package/console-app/assets/{railroad-3IZDKUUU-CZb1usP7.js → railroad-3IZDKUUU-CjkCoEjH.js} +1 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-BM21cj3I.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-CDjo5TUI.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-CiKQmfgW.js +1 -0
- package/console-app/assets/{railroadDiagram-RFXS5EU6-B1K2hbTD.js → railroadDiagram-RFXS5EU6-BUoL0dsw.js} +1 -1
- package/console-app/assets/{requirementDiagram-TGXJPOKE-K8wcOO0Q.js → requirementDiagram-TGXJPOKE-C27qMKlr.js} +1 -1
- package/console-app/assets/{sankeyDiagram-HTMAVEWB-WBPBkgNx.js → sankeyDiagram-HTMAVEWB-BYEhrrY0.js} +1 -1
- package/console-app/assets/{sequenceDiagram-DBY2YBRQ-Dz80qZZv.js → sequenceDiagram-DBY2YBRQ-BCuL4Pl6.js} +1 -1
- package/console-app/assets/{src-CnJCXDL0.js → src-jNbD6Nj3.js} +1 -1
- package/console-app/assets/{stateDiagram-2N3HPSRC-DMur7lZf.js → stateDiagram-2N3HPSRC-C8Ywa3Ah.js} +1 -1
- package/console-app/assets/stateDiagram-v2-6OUMAXLB-BIGwMDyj.js +1 -0
- package/console-app/assets/{swimlanes-5IMT3BWC-BlLdYcPU.js → swimlanes-5IMT3BWC-C12iYfdp.js} +1 -1
- package/console-app/assets/swimlanesDiagram-G3AALYLV-BsoUfqN-.js +8 -0
- package/console-app/assets/{timeline-definition-FHXFAJF6-CBOit0JY.js → timeline-definition-FHXFAJF6-BFQotHp7.js} +1 -1
- package/console-app/assets/{treeView-QDETBFTQ-DM1i1ast.js → treeView-QDETBFTQ-CGbwDLTd.js} +1 -1
- package/console-app/assets/{treemap-6X3UGDF4-ACrBEfY6.js → treemap-6X3UGDF4-DxSGskiF.js} +1 -1
- package/console-app/assets/{vennDiagram-L72KCM5P-BmeFWb5N.js → vennDiagram-L72KCM5P-D4hlUYc9.js} +1 -1
- package/console-app/assets/{wardley-OPB4EBWU-BpIbeh58.js → wardley-OPB4EBWU-XlXl32Vn.js} +1 -1
- package/console-app/assets/{wardleyDiagram-EHGQE667-CxL7Mv7y.js → wardleyDiagram-EHGQE667-ttCeFzYx.js} +1 -1
- package/console-app/assets/{xychartDiagram-FW5EYKEG-DkV75xT2.js → xychartDiagram-FW5EYKEG-BMG4kbfv.js} +1 -1
- package/console-app/index.html +2 -2
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -2
- package/dist/.pikku/agent/pikku-agent-types.gen.js +3 -0
- package/dist/.pikku/agent/pikku-model-aliases.gen.d.ts +1 -0
- package/dist/.pikku/agent/pikku-model-aliases.gen.js +5 -0
- 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.js +13 -8
- 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 +18 -12
- 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/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +6 -25
- 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 +51 -27
- package/dist/.pikku/function/pikku-functions.gen.js +3 -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/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 +2 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +2 -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 +1 -1
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +2 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +7 -5
- package/dist/.pikku/schemas/schemas/DevInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuAIScorerOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/ServeInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/ValidateOutput.schema.json +1 -0
- 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 +8 -2
- package/dist/.pikku/workflow/pikku-personas.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +9 -17
- 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 +20 -11
- package/dist/src/deploy/analyzer/analyzer.js +21 -0
- package/dist/src/deploy/analyzer/manifest.d.ts +18 -0
- package/dist/src/fabric/functions/smoke.function.js +7 -4
- package/dist/src/fabric/functions/validate.function.js +1 -1
- package/dist/src/functions/commands/db-export.js +1 -1
- package/dist/src/functions/commands/db-shared.d.ts +0 -14
- package/dist/src/functions/commands/dev.d.ts +3 -0
- package/dist/src/functions/commands/dev.js +41 -2
- package/dist/src/functions/commands/knowledge-index.d.ts +3 -3
- package/dist/src/functions/commands/new-addon.js +6 -3
- package/dist/src/functions/commands/scenario-browser.d.ts +24 -1
- package/dist/src/functions/commands/scenario-browser.js +5 -1
- package/dist/src/functions/commands/scenario.d.ts +6 -0
- package/dist/src/functions/commands/scenario.js +26 -5
- package/dist/src/functions/commands/serve.d.ts +3 -0
- package/dist/src/functions/commands/serve.js +15 -1
- package/dist/src/functions/commands/{workspace-validate.d.ts → validate.d.ts} +18 -3
- package/dist/src/functions/commands/validate.js +9 -0
- package/dist/src/functions/db/local-db.d.ts +2 -1
- package/dist/src/functions/db/local-db.js +2 -2
- package/dist/src/functions/validate/addon-package-checks.d.ts +26 -0
- package/dist/src/functions/validate/addon-package-checks.js +258 -0
- package/dist/src/functions/validate/persona-checks.d.ts +1 -1
- package/dist/src/functions/validate/persona-checks.js +1 -1
- package/dist/src/functions/validate/scenario-file-checks.js +33 -0
- package/dist/src/functions/validate/shared-checks.d.ts +1 -1
- package/dist/src/functions/validate/shared-checks.js +1 -1
- package/dist/src/functions/validate/validate-registry.d.ts +52 -0
- package/dist/src/functions/validate/validate-registry.js +100 -0
- package/dist/src/functions/validate/validate.d.ts +47 -0
- package/dist/src/functions/validate/{workspace-validate.js → validate.js} +46 -12
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.js +3 -2
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.js +5 -1
- package/dist/src/functions/wirings/ai-agent/serialize-ai-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/serialize-ai-agent-types.js +15 -2
- package/dist/src/functions/wirings/ai-agent/serialize-model-aliases.d.ts +5 -0
- package/dist/src/functions/wirings/ai-agent/serialize-model-aliases.js +12 -0
- package/dist/src/functions/wirings/ai-scorer/pikku-command-ai-scorer.d.ts +1 -0
- package/dist/src/functions/wirings/ai-scorer/pikku-command-ai-scorer.js +51 -0
- package/dist/src/functions/wirings/ai-scorer/serialize-scorer-names.d.ts +10 -0
- package/dist/src/functions/wirings/ai-scorer/serialize-scorer-names.js +17 -0
- package/dist/src/functions/wirings/auth/serialize-auth-gen.js +27 -10
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +9 -4
- package/dist/src/functions/wirings/console/serialize-console-functions.js +9 -56
- package/dist/src/functions/wirings/functions/serialize-function-types.js +7 -30
- package/dist/src/functions/wirings/middleware/serialize-middleware-imports.js +5 -1
- package/dist/src/functions/wirings/package/pikku-command-package.js +12 -1
- package/dist/src/functions/wirings/package/serialize-package.d.ts +1 -1
- package/dist/src/functions/wirings/package/serialize-package.js +5 -2
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +1 -6
- package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.js +30 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +12 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +8 -16
- package/dist/src/functions/workflows/all.workflow.js +6 -1
- package/dist/src/server/bun-server-runner.js +3 -0
- package/dist/src/server/dev-server-runner.interface.d.ts +10 -0
- package/dist/src/server/node-server-runner.js +3 -0
- package/dist/src/services.js +1 -0
- package/dist/src/utils/meta-diff.d.ts +1 -1
- package/dist/src/utils/meta-diff.js +2 -0
- package/dist/src/utils/model-alias-override.d.ts +7 -0
- package/dist/src/utils/model-alias-override.js +33 -0
- package/dist/src/utils/pikku-cli-config.js +16 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/console-app/assets/architecture-TIHT7OUA-C8l7I5Lm.js +0 -1
- package/console-app/assets/channel-BgJ-Z0cx.js +0 -1
- package/console-app/assets/chunk-VAUOI2AC-DwKsbf70.js +0 -1
- package/console-app/assets/chunk-XXDRQBXY-RuYSFsQb.js +0 -1
- package/console-app/assets/classDiagram-OUVF2IWQ-ohoLCI8g.js +0 -1
- package/console-app/assets/classDiagram-v2-EOCWNBFH-ohoLCI8g.js +0 -1
- package/console-app/assets/eventmodeling-45OFAUF4-DZ7z4YJO.js +0 -1
- package/console-app/assets/flowDiagram-23GEKE2U-rd7-NwZT.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-DkQZciri.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-CPBeASA9.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-CXEVIZ0g.js +0 -1
- package/console-app/assets/stateDiagram-v2-6OUMAXLB-BDgLCrot.js +0 -1
- package/console-app/assets/swimlanesDiagram-G3AALYLV-CZ5rQIcE.js +0 -8
- package/dist/.pikku/schemas/schemas/WorkspaceValidateOutput.schema.json +0 -1
- package/dist/src/functions/commands/workspace-validate.js +0 -9
- package/dist/src/functions/validate/workspace-validate.d.ts +0 -33
- /package/dist/.pikku/schemas/schemas/{WorkspaceValidateInput.schema.json → ValidateInput.schema.json} +0 -0
|
@@ -5,13 +5,6 @@ export const serializeConsoleFunctions = (pathToPikkuTypes, _pathToAgentTypes, g
|
|
|
5
5
|
*/
|
|
6
6
|
import { z } from 'zod'
|
|
7
7
|
|
|
8
|
-
export const SecretRef = z.object({ secretId: z.string() })
|
|
9
|
-
|
|
10
|
-
export const SetSecret = z.object({
|
|
11
|
-
secretId: z.string(),
|
|
12
|
-
value: z.unknown(),
|
|
13
|
-
})
|
|
14
|
-
|
|
15
8
|
export const VariableRef = z.object({ variableId: z.string() })
|
|
16
9
|
|
|
17
10
|
export const SetVariable = z.object({
|
|
@@ -24,34 +17,16 @@ export const ValueResult = z.object({
|
|
|
24
17
|
value: z.unknown().nullable(),
|
|
25
18
|
})
|
|
26
19
|
|
|
27
|
-
export const Exists = z.object({ exists: z.boolean() })
|
|
28
|
-
|
|
29
20
|
export const Success = z.object({ success: z.boolean() })
|
|
30
21
|
`;
|
|
31
22
|
const functions = `import { pikkuFunc, defineHTTPRoutes, wireHTTPRoutes, ref, wireAddon } from '${pathToPikkuTypes}'
|
|
32
23
|
import {
|
|
33
|
-
SecretRef,
|
|
34
|
-
SetSecret,
|
|
35
24
|
VariableRef,
|
|
36
25
|
SetVariable,
|
|
37
26
|
ValueResult,
|
|
38
|
-
Exists,
|
|
39
27
|
Success,
|
|
40
28
|
} from './console.schemas.gen.js'
|
|
41
29
|
|
|
42
|
-
export const pikkuConsoleSetSecret = pikkuFunc({
|
|
43
|
-
secretBroker: true,
|
|
44
|
-
tags: ['pikku'],
|
|
45
|
-
description: 'Set the value of a secret',
|
|
46
|
-
expose: true,
|
|
47
|
-
input: SetSecret,
|
|
48
|
-
output: Success,
|
|
49
|
-
func: async ({ secrets }, { secretId, value }) => {
|
|
50
|
-
await secrets.setSecret(secretId, value)
|
|
51
|
-
return { success: true }
|
|
52
|
-
},
|
|
53
|
-
})
|
|
54
|
-
|
|
55
30
|
export const pikkuConsoleGetVariable = pikkuFunc({
|
|
56
31
|
tags: ['pikku'],
|
|
57
32
|
description: 'Get the current value of a variable',
|
|
@@ -89,36 +64,6 @@ export const pikkuConsoleSetVariable = pikkuFunc({
|
|
|
89
64
|
},
|
|
90
65
|
})
|
|
91
66
|
|
|
92
|
-
export const pikkuConsoleHasSecret = pikkuFunc({
|
|
93
|
-
secretBroker: true,
|
|
94
|
-
tags: ['pikku'],
|
|
95
|
-
description: 'Check if a secret exists without reading its value',
|
|
96
|
-
expose: true,
|
|
97
|
-
input: SecretRef,
|
|
98
|
-
output: Exists,
|
|
99
|
-
func: async ({ secrets }, { secretId }) => {
|
|
100
|
-
const exists = await secrets.hasSecret(secretId)
|
|
101
|
-
return { exists }
|
|
102
|
-
},
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
export const pikkuConsoleGetSecret = pikkuFunc({
|
|
106
|
-
secretBroker: true,
|
|
107
|
-
tags: ['pikku'],
|
|
108
|
-
description: 'Get the current value of a secret',
|
|
109
|
-
expose: true,
|
|
110
|
-
input: SecretRef,
|
|
111
|
-
output: ValueResult,
|
|
112
|
-
func: async ({ secrets }, { secretId }) => {
|
|
113
|
-
const exists = await secrets.hasSecret(secretId)
|
|
114
|
-
if (!exists) {
|
|
115
|
-
return { exists: false, value: null }
|
|
116
|
-
}
|
|
117
|
-
const value = await secrets.getSecret(secretId)
|
|
118
|
-
return { exists: true, value: value.reveal() }
|
|
119
|
-
},
|
|
120
|
-
})
|
|
121
|
-
|
|
122
67
|
export const consoleRoutes = defineHTTPRoutes({
|
|
123
68
|
auth: false,
|
|
124
69
|
tags: ['pikku'],
|
|
@@ -132,7 +77,15 @@ export const consoleRoutes = defineHTTPRoutes({
|
|
|
132
77
|
},
|
|
133
78
|
})
|
|
134
79
|
|
|
135
|
-
wireAddon({
|
|
80
|
+
wireAddon({
|
|
81
|
+
name: 'console',
|
|
82
|
+
package: '@pikku/addon-console',
|
|
83
|
+
scopes: ['admin'],
|
|
84
|
+
globalSecrets:
|
|
85
|
+
'the console administers secrets an operator names at runtime, so no static declaration can cover them',
|
|
86
|
+
globalCredentials:
|
|
87
|
+
'the console lists and links credentials across every user, so it cannot be scoped to a declared set',
|
|
88
|
+
})
|
|
136
89
|
wireHTTPRoutes({ basePath: '${globalHTTPPrefix}', routes: { console: consoleRoutes } })
|
|
137
90
|
`;
|
|
138
91
|
return { schemas, functions };
|
|
@@ -15,7 +15,7 @@ export const serializeFunctionTypes = (userSessionTypeImport, userSessionTypeNam
|
|
|
15
15
|
* Core function, middleware, and permission types for all wirings
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import type { CorePikkuMiddleware, CorePermissionGroup, ListInput, ListOutput, PikkuWire, PickRequired, SecretlessServices
|
|
18
|
+
import type { CorePikkuMiddleware, CorePermissionGroup, ListInput, ListOutput, PikkuWire, PickRequired, SecretlessServices } from '@pikku/core'
|
|
19
19
|
import type { CorePikkuFunctionConfig, CorePikkuSessionlessFunctionConfig, CorePikkuAuth, CorePikkuAuthConfig, CorePikkuPermission } from '@pikku/core/function'
|
|
20
20
|
import { pikkuAuth as pikkuAuthCore } from '@pikku/core/function'
|
|
21
21
|
import {
|
|
@@ -56,16 +56,6 @@ export type WiredServices = SecretlessServices<RequiredSingletonServices & Servi
|
|
|
56
56
|
/** \`WiredSingletonServices\` without \`secrets\`, for auth gates. */
|
|
57
57
|
export type WiredAuthServices = SecretlessServices<WiredSingletonServices>
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
* \`WiredServices\` with \`secrets\` restored, for the console's secret-admin
|
|
61
|
-
* functions. Reached by declaring \`secretBroker: true\` on a \`pikkuFunc\` config.
|
|
62
|
-
*
|
|
63
|
-
* Declaring it does not grant the service. The runner hands out the real
|
|
64
|
-
* \`SecretService\` only to the functions the inspector marks as secret brokers;
|
|
65
|
-
* every other function still receives the throwing accessor.
|
|
66
|
-
*/
|
|
67
|
-
export type WiredSecretBrokerServices = WiredServices & { secrets: SecretService }
|
|
68
|
-
|
|
69
59
|
/**
|
|
70
60
|
* Inline node configuration for function definitions.
|
|
71
61
|
*/
|
|
@@ -301,15 +291,10 @@ export const pikkuApprovalDescription = <In = unknown, RequiredServices extends
|
|
|
301
291
|
* @template In - The input type
|
|
302
292
|
* @template Out - The output type that the function returns
|
|
303
293
|
* @template RequiredServices - Services required by this function
|
|
304
|
-
* @template ScenarioOut - Types \`scenario.context
|
|
305
|
-
* \`
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
* It deliberately does NOT default to \`Out\`. That would make every ordinary
|
|
309
|
-
* function's wire type vary with its return type, and a \`func\` written
|
|
310
|
-
* against the \`PikkuFunction | PikkuFunctionSessionless\` union then loses
|
|
311
|
-
* contextual typing — its parameters fall back to \`any\` and the assignment
|
|
312
|
-
* fails with no hint as to why.
|
|
294
|
+
* @template ScenarioOut - Types \`scenario.context\`; only scenarios set it.
|
|
295
|
+
* Not defaulted to \`Out\`, which would make every ordinary function's wire
|
|
296
|
+
* type vary with its return type and cost a \`func\` written against the
|
|
297
|
+
* \`PikkuFunction | PikkuFunctionSessionless\` union its contextual typing.
|
|
313
298
|
*/
|
|
314
299
|
export type PikkuFunctionSessionless<
|
|
315
300
|
In = unknown,
|
|
@@ -363,10 +348,8 @@ export type PikkuFunctionConfig<
|
|
|
363
348
|
In = unknown,
|
|
364
349
|
Out = unknown,
|
|
365
350
|
RequiredWires extends keyof PikkuWire = never,
|
|
366
|
-
// \`any\` in the ScenarioOut slot
|
|
367
|
-
//
|
|
368
|
-
// would refuse it. \`ScenarioContext<any>\` collapses to \`any\`, so the
|
|
369
|
-
// constraint stays open on that axis alone.
|
|
351
|
+
// \`any\` in the ScenarioOut slot: a constraint pinned to one context type
|
|
352
|
+
// would refuse a scenario body, which types its context as its own output.
|
|
370
353
|
PikkuFunc extends PikkuFunction<In, Out, RequiredWires, any> | PikkuFunctionSessionless<In, Out, RequiredWires, any, any> = PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires>,
|
|
371
354
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
372
355
|
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
@@ -454,12 +437,6 @@ export type PikkuFunctionConfigWithSchema<
|
|
|
454
437
|
* })
|
|
455
438
|
* \`\`\`
|
|
456
439
|
*/
|
|
457
|
-
export function pikkuFunc<
|
|
458
|
-
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
459
|
-
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
460
|
-
>(
|
|
461
|
-
config: PikkuFunctionConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc', WiredSecretBrokerServices> & { secretBroker: true }
|
|
462
|
-
): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'session' | 'rpc'>
|
|
463
440
|
export function pikkuFunc<
|
|
464
441
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
465
442
|
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
@@ -60,8 +60,12 @@ export const serializeMiddlewareImports = (outputPath, middlewareState, httpStat
|
|
|
60
60
|
// it here, into the always-bootstrap-imported pikku-middleware.gen.ts,
|
|
61
61
|
// guarantees global middleware registers in every unit. A duplicate import
|
|
62
62
|
// in full builds is harmless — module bodies evaluate once.
|
|
63
|
+
//
|
|
64
|
+
// `isFactoryCall` is not consulted: it distinguishes `mw()` from `mw` as an
|
|
65
|
+
// array element, not a deferred registration behind an exported factory, and
|
|
66
|
+
// addGlobalMiddleware registers at module evaluation under either form.
|
|
63
67
|
for (const [instanceId, instance] of Object.entries(middlewareState.instances)) {
|
|
64
|
-
if (instanceId.startsWith('global:')
|
|
68
|
+
if (instanceId.startsWith('global:')) {
|
|
65
69
|
directImports.add(getFileImportRelativePath(outputPath, instance.sourceFile, packageMappings));
|
|
66
70
|
}
|
|
67
71
|
}
|
|
@@ -35,6 +35,17 @@ export const pikkuPackage = pikkuSessionlessFunc({
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
// A secret read the inspector could not resolve to a literal is absent by
|
|
39
|
+
// construction — such an addon needs `globalSecrets` on its `wireAddon`.
|
|
40
|
+
const declaredSecrets = new Set();
|
|
41
|
+
for (const definition of state.secrets?.definitions ?? []) {
|
|
42
|
+
declaredSecrets.add(definition.secretId);
|
|
43
|
+
}
|
|
44
|
+
for (const usage of state.secrets?.usage?.values() ?? []) {
|
|
45
|
+
for (const key of usage.keys) {
|
|
46
|
+
declaredSecrets.add(key);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
38
49
|
const content = serializePackageFactories(packageFile, addonName, pikkuConfigFactory
|
|
39
50
|
? {
|
|
40
51
|
file: pikkuConfigFactory.file,
|
|
@@ -50,7 +61,7 @@ export const pikkuPackage = pikkuSessionlessFunc({
|
|
|
50
61
|
file: wireServicesFactory.file,
|
|
51
62
|
variable: wireServicesFactory.variable,
|
|
52
63
|
}
|
|
53
|
-
: undefined, packageMappings, Object.keys(credentialsMeta).length > 0 ? credentialsMeta : undefined, state.addonRequiredParentServices);
|
|
64
|
+
: undefined, packageMappings, Object.keys(credentialsMeta).length > 0 ? credentialsMeta : undefined, state.addonRequiredParentServices, [...declaredSecrets].sort());
|
|
54
65
|
if (!content) {
|
|
55
66
|
logger.info({
|
|
56
67
|
message: 'Skipping package factories - no service factories found',
|
|
@@ -8,4 +8,4 @@ export interface CredentialMetaForPackage {
|
|
|
8
8
|
type: 'singleton' | 'wire';
|
|
9
9
|
oauth2?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare const serializePackageFactories: (outputPath: string, packageName: string, configFactory: PackageFactoryInfo | undefined, singletonServicesFactory: PackageFactoryInfo | undefined, wireServicesFactory: PackageFactoryInfo | undefined, packageMappings?: Record<string, string>, credentialsMeta?: Record<string, CredentialMetaForPackage>, requiredParentServices?: string[]) => string | null;
|
|
11
|
+
export declare const serializePackageFactories: (outputPath: string, packageName: string, configFactory: PackageFactoryInfo | undefined, singletonServicesFactory: PackageFactoryInfo | undefined, wireServicesFactory: PackageFactoryInfo | undefined, packageMappings?: Record<string, string>, credentialsMeta?: Record<string, CredentialMetaForPackage>, requiredParentServices?: string[], declaredSecrets?: string[]) => string | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
2
|
-
export const serializePackageFactories = (outputPath, packageName, configFactory, singletonServicesFactory, wireServicesFactory, packageMappings = {}, credentialsMeta, requiredParentServices) => {
|
|
2
|
+
export const serializePackageFactories = (outputPath, packageName, configFactory, singletonServicesFactory, wireServicesFactory, packageMappings = {}, credentialsMeta, requiredParentServices, declaredSecrets) => {
|
|
3
3
|
const imports = [
|
|
4
4
|
`import { pikkuState } from '@pikku/core/ecosystem'`,
|
|
5
5
|
];
|
|
@@ -29,10 +29,13 @@ export const serializePackageFactories = (outputPath, packageName, configFactory
|
|
|
29
29
|
const requiredParentServicesLine = requiredParentServices && requiredParentServices.length > 0
|
|
30
30
|
? `\npikkuState('${packageName}', 'package', 'requiredParentServices', ${JSON.stringify(requiredParentServices)})\n`
|
|
31
31
|
: '';
|
|
32
|
+
const declaredSecretsLine = declaredSecrets
|
|
33
|
+
? `\npikkuState('${packageName}', 'package', 'declaredSecrets', ${JSON.stringify(declaredSecrets)})\n`
|
|
34
|
+
: '';
|
|
32
35
|
return `${imports.join('\n')}
|
|
33
36
|
|
|
34
37
|
pikkuState('${packageName}', 'package', 'factories', {
|
|
35
38
|
${factoryEntries.join('\n')}
|
|
36
39
|
})
|
|
37
|
-
${credentialsLine}${requiredParentServicesLine}`;
|
|
40
|
+
${credentialsLine}${requiredParentServicesLine}${declaredSecretsLine}`;
|
|
38
41
|
};
|
|
@@ -59,12 +59,7 @@ ${generateAddonAgentImports(wireAddonDeclarations)}
|
|
|
59
59
|
${generateMergedAgentMap(wireAddonDeclarations)}
|
|
60
60
|
|
|
61
61
|
import type { PikkuRPC } from '@pikku/core/rpc'
|
|
62
|
-
|
|
63
|
-
interface AIAgentInput {
|
|
64
|
-
message: string
|
|
65
|
-
threadId: string
|
|
66
|
-
resourceId: string
|
|
67
|
-
}
|
|
62
|
+
import type { AIAgentInput } from '@pikku/core/ai-agent'
|
|
68
63
|
|
|
69
64
|
export type TypedStartWorkflow = <Name extends keyof FlattenedWorkflowMap>(
|
|
70
65
|
name: Name,
|
|
@@ -3,6 +3,7 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { addFunction } from '@pikku/core/function';
|
|
4
4
|
import { pikkuState } from '@pikku/core/ecosystem';
|
|
5
5
|
import { getStubTracker, isTestRun, } from '@pikku/core/services';
|
|
6
|
+
import { enableScoreSnapshots, getScoreSnapshot, gradeRun as coreGradeRun, } from '@pikku/core/ai-scorer';
|
|
6
7
|
/**
|
|
7
8
|
* The instrumentation `pikku scenario run` calls on the server under test:
|
|
8
9
|
* snapshot/reset live coverage, and reset/read recorded stub calls.
|
|
@@ -52,6 +53,26 @@ const resetStubs = {
|
|
|
52
53
|
const getStubCalls = {
|
|
53
54
|
func: async (_services, data) => getStubTracker().getCalls(data?.service ?? undefined),
|
|
54
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Grade a finished agent run on demand, from the snapshot the runtime kept.
|
|
58
|
+
*
|
|
59
|
+
* Deliberately not sampled and not persisted: a scenario asserting on a grade
|
|
60
|
+
* needs that grade every time, and the assertion is the outcome — writing a
|
|
61
|
+
* test's score alongside production's would make the live figures unreadable.
|
|
62
|
+
*/
|
|
63
|
+
const gradeRun = {
|
|
64
|
+
func: async (services, data) => {
|
|
65
|
+
const run = getScoreSnapshot(data.runId);
|
|
66
|
+
if (!run) {
|
|
67
|
+
throw new Error(`No finished run '${data.runId}' is available to grade. A run is gradeable only from the server that produced it, and only while it is among the most recent — check the scenario graded the run it just triggered.`);
|
|
68
|
+
}
|
|
69
|
+
return await coreGradeRun({
|
|
70
|
+
...run,
|
|
71
|
+
...(data.reference !== undefined ? { reference: data.reference } : {}),
|
|
72
|
+
scorerName: data.scorer,
|
|
73
|
+
}, services, { persist: false });
|
|
74
|
+
},
|
|
75
|
+
};
|
|
55
76
|
const instrumentation = {
|
|
56
77
|
pikkuScenarioTakeLiveCoverage: {
|
|
57
78
|
...takeLiveCoverage,
|
|
@@ -73,6 +94,11 @@ const instrumentation = {
|
|
|
73
94
|
title: 'Get Stub Calls',
|
|
74
95
|
description: 'Returns calls recorded against stubbed/spied services (via the stub()/spy() core utils). Empty unless the server records service calls (pikku dev --test).',
|
|
75
96
|
},
|
|
97
|
+
pikkuScenarioGradeRun: {
|
|
98
|
+
...gradeRun,
|
|
99
|
+
title: 'Grade Run',
|
|
100
|
+
description: "Runs one declared scorer against a finished agent run and returns the grade, ignoring the scorer's live sample rate. Accepts a reference answer, which is the only way a reference-based judge is reachable. The grade is returned, never recorded.",
|
|
101
|
+
},
|
|
76
102
|
};
|
|
77
103
|
/**
|
|
78
104
|
* Register the instrumentation into the running dev server's state, so the
|
|
@@ -85,6 +111,10 @@ const instrumentation = {
|
|
|
85
111
|
*/
|
|
86
112
|
export const registerScenarioInstrumentation = (requireAuth) => {
|
|
87
113
|
const meta = pikkuState(null, 'function', 'meta');
|
|
114
|
+
// Retaining finished runs is what makes them gradeable, and this is the only
|
|
115
|
+
// place that can grade one — so the buffer is turned on here rather than by a
|
|
116
|
+
// flag someone has to remember, and stays absent from every other process.
|
|
117
|
+
enableScoreSnapshots();
|
|
88
118
|
for (const [name, { func, title, description }] of Object.entries(instrumentation)) {
|
|
89
119
|
addFunction(name, { func, auth: requireAuth });
|
|
90
120
|
meta[name] = {
|
|
@@ -274,10 +274,18 @@ export const workflowStatusStreamFull = pikkuSessionlessFunc({
|
|
|
274
274
|
* The decision is validated on replay inside the workflow body — the only place
|
|
275
275
|
* the approval's schema value is in scope — so this route deliberately accepts
|
|
276
276
|
* an unknown payload. An invalid one re-closes the gate rather than failing the
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
277
|
+
* request.
|
|
278
|
+
*
|
|
279
|
+
* WHO may approve is likewise the gate's own business, declared with
|
|
280
|
+
* \`approvers\`/\`approverScope\` on \`workflow.approval()\`, and enforced in two
|
|
281
|
+
* places. Once the run has reached the gate it has published its policy, so this
|
|
282
|
+
* route judges the caller against it and refuses with a 403. A decision arriving
|
|
283
|
+
* before the gate has no policy to judge against yet, so it is accepted here and
|
|
284
|
+
* judged on replay instead, where failing discards the decision and leaves the
|
|
285
|
+
* gate closed. A caller sees either outcome depending on that timing.
|
|
286
|
+
*
|
|
287
|
+
* A gate that declares neither accepts a decision from anyone this route lets
|
|
288
|
+
* through — gate the route with your own auth/permissions to narrow that.
|
|
281
289
|
*/
|
|
282
290
|
export const workflowApprover = pikkuSessionlessFunc({
|
|
283
291
|
tags: ['pikku'],
|
|
@@ -71,10 +71,7 @@ export interface TypedScenarioSteps {
|
|
|
71
71
|
): Promise<FlattenedScenarioStepMap[K]['output']>
|
|
72
72
|
}
|
|
73
73
|
|
|
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
|
-
*/
|
|
74
|
+
/** \`Out\` types \`scenario.context\`. */
|
|
78
75
|
export type TypedScenario<Out = unknown> = TypedWorkflow &
|
|
79
76
|
Omit<PikkuScenarioWire<Out>, keyof PikkuWorkflowWire | keyof TypedScenarioSteps> &
|
|
80
77
|
TypedScenarioSteps
|
|
@@ -91,9 +88,9 @@ export type PikkuFunctionWorkflow<
|
|
|
91
88
|
> = PikkuFunctionSessionless<In, Out, 'workflow'>
|
|
92
89
|
|
|
93
90
|
/**
|
|
94
|
-
* \`Ctx\` types \`scenario.context
|
|
95
|
-
*
|
|
96
|
-
*
|
|
91
|
+
* \`Ctx\` types \`scenario.context\`, defaulting to the body's own output. A hook
|
|
92
|
+
* returns void but shares the scenario's context, so it passes that scenario's
|
|
93
|
+
* output here instead.
|
|
97
94
|
*/
|
|
98
95
|
export type PikkuFunctionScenario<
|
|
99
96
|
In = unknown,
|
|
@@ -185,10 +182,8 @@ export type PikkuScenarioConfigWithSchema<
|
|
|
185
182
|
* Always runs after the scenario body, in a \`finally\`, whether it passed or
|
|
186
183
|
* failed. Throwing fails a run that would otherwise have passed; on an
|
|
187
184
|
* already-failed run it attaches as the \`cause\` and never replaces the
|
|
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
|
+
* original error. Reads \`scenario.context\` for whatever the body managed to
|
|
186
|
+
* record before it stopped.
|
|
192
187
|
*/
|
|
193
188
|
after?: PikkuScenarioHook<InputSchema, OutputSchema>
|
|
194
189
|
/**
|
|
@@ -202,11 +197,8 @@ export type PikkuScenarioConfigWithSchema<
|
|
|
202
197
|
|
|
203
198
|
/**
|
|
204
199
|
* A scenario lifecycle hook: the scenario's own \`(services, data, wire)\`
|
|
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.
|
|
200
|
+
* signature with its result discarded. \`OutputSchema\` types
|
|
201
|
+
* \`scenario.context\` while the return type stays \`void\`.
|
|
210
202
|
*/
|
|
211
203
|
export type PikkuScenarioHook<
|
|
212
204
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
@@ -154,16 +154,21 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
154
154
|
if (hasPackageFactories) {
|
|
155
155
|
allImports.push(config.packageFile);
|
|
156
156
|
}
|
|
157
|
-
const [hasInternalRPCs, agents] = await Promise.all([
|
|
157
|
+
const [hasInternalRPCs, agents, scorers] = await Promise.all([
|
|
158
158
|
workflow.do('RPC', 'pikkuRPC', null),
|
|
159
159
|
workflow.do('AI agent', 'pikkuAIAgent', null),
|
|
160
|
+
workflow.do('AI scorer', 'pikkuAIScorer', null),
|
|
160
161
|
]);
|
|
162
|
+
allImports.push(config.modelAliasesFile);
|
|
161
163
|
if (agents) {
|
|
162
164
|
allImports.push(config.agentWiringMetaFile, config.agentWiringsFile);
|
|
163
165
|
if (config.scaffold?.agent) {
|
|
164
166
|
await workflow.do('Public agent scaffold', 'pikkuPublicAgent', null);
|
|
165
167
|
}
|
|
166
168
|
}
|
|
169
|
+
if (scorers) {
|
|
170
|
+
allImports.push(config.scorerWiringMetaFile, config.scorerWiringsFile);
|
|
171
|
+
}
|
|
167
172
|
// Scaffold and definition generators are all independent
|
|
168
173
|
await Promise.all([
|
|
169
174
|
workflow.do('Graph wirings', 'pikkuGraphWirings', null),
|
|
@@ -24,6 +24,9 @@ export class BunServerRunner {
|
|
|
24
24
|
// every Bun project: `config.content` arrived, but the service that
|
|
25
25
|
// verifies its signatures did not.
|
|
26
26
|
contentSigningJWT: options.contentSigningJWT,
|
|
27
|
+
// Read off this options object by the transport, not off `config` — so it
|
|
28
|
+
// has to be forwarded here explicitly, exactly like the JWT above.
|
|
29
|
+
mcpJson: options.mcpJson,
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
32
|
}
|
|
@@ -26,6 +26,16 @@ export type DevServerOptions = {
|
|
|
26
26
|
* instance — otherwise every signed URL is rejected.
|
|
27
27
|
*/
|
|
28
28
|
contentSigningJWT?: JWTService;
|
|
29
|
+
/**
|
|
30
|
+
* The generated MCP manifest. Handed straight to the transport, which mounts
|
|
31
|
+
* the MCP endpoint only when it is present — so a runner that forgets to
|
|
32
|
+
* forward this serves a 404 with no error anywhere.
|
|
33
|
+
*/
|
|
34
|
+
mcpJson?: {
|
|
35
|
+
tools?: unknown[];
|
|
36
|
+
resources?: unknown[];
|
|
37
|
+
prompts?: unknown[];
|
|
38
|
+
};
|
|
29
39
|
};
|
|
30
40
|
export interface DevServerRunner {
|
|
31
41
|
/**
|
|
@@ -18,6 +18,9 @@ export class NodeServerRunner {
|
|
|
18
18
|
pikkuWebsocketHandler({ server: httpServer, wss, logger });
|
|
19
19
|
},
|
|
20
20
|
contentSigningJWT: options.contentSigningJWT,
|
|
21
|
+
// Read off this options object by the transport, not off `config` — so it
|
|
22
|
+
// has to be forwarded here explicitly, exactly like the JWT above.
|
|
23
|
+
mcpJson: options.mcpJson,
|
|
21
24
|
});
|
|
22
25
|
return {
|
|
23
26
|
init: () => server.init(),
|
package/dist/src/services.js
CHANGED
|
@@ -267,6 +267,7 @@ export const createSingletonServices = async (config) => {
|
|
|
267
267
|
// cost. Never runs during a plain `pikku all`.
|
|
268
268
|
classificationCheck: !setupOnly && !!config.security,
|
|
269
269
|
strictMeta: !!config.strictMeta,
|
|
270
|
+
modelAliases: config.models ?? {},
|
|
270
271
|
allow: config.allow ?? {},
|
|
271
272
|
schemaConfig: !setupOnly
|
|
272
273
|
? {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* second inspection pass. Only user-visible buildable surfaces are included;
|
|
7
7
|
* plumbing (secrets/variables/middleware/permissions) is intentionally omitted.
|
|
8
8
|
*/
|
|
9
|
-
export type MetaDiffCategoryName = 'functions' | 'http' | 'workflow' | 'email' | 'scheduler' | 'queue' | 'channel' | 'trigger' | 'mcp' | 'agent';
|
|
9
|
+
export type MetaDiffCategoryName = 'functions' | 'http' | 'workflow' | 'email' | 'scheduler' | 'queue' | 'channel' | 'trigger' | 'mcp' | 'agent' | 'scorer';
|
|
10
10
|
export interface MetaDiffEntry {
|
|
11
11
|
id: string;
|
|
12
12
|
status: 'added' | 'removed' | 'modified';
|
|
@@ -12,12 +12,14 @@ const SINGLE_FILE = {
|
|
|
12
12
|
trigger: 'trigger/pikku-trigger-meta.gen.json',
|
|
13
13
|
mcp: 'mcp/pikku-mcp-wirings-meta.gen.json',
|
|
14
14
|
agent: 'agent/pikku-agent-wirings-meta.gen.json',
|
|
15
|
+
scorer: 'agent/pikku-scorer-wirings-meta.gen.json',
|
|
15
16
|
};
|
|
16
17
|
// A few meta files wrap their real entities under a single key rather than
|
|
17
18
|
// keying them at the top level — unwrap to that map so ids are the entities.
|
|
18
19
|
const UNWRAP = {
|
|
19
20
|
email: 'templates',
|
|
20
21
|
agent: 'agentsMeta',
|
|
22
|
+
scorer: 'scorersMeta',
|
|
21
23
|
};
|
|
22
24
|
// Workflows (incl. scenarios) are written one file per workflow under
|
|
23
25
|
// this dir; the file basename (sans `.gen.json`) is the id, `-verbose` excluded.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies `--model cheap:openai/gpt-5-nano` to a `pikku dev` / `pikku serve`
|
|
3
|
+
* run, via PIKKU_MODEL_ALIASES so it leaves no trace in generated output.
|
|
4
|
+
*/
|
|
5
|
+
export declare const applyModelAliasOverride: (logger: {
|
|
6
|
+
warn: (message: string) => void;
|
|
7
|
+
}, model: string | undefined, configuredAliases?: Record<string, string>) => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies `--model cheap:openai/gpt-5-nano` to a `pikku dev` / `pikku serve`
|
|
3
|
+
* run, via PIKKU_MODEL_ALIASES so it leaves no trace in generated output.
|
|
4
|
+
*/
|
|
5
|
+
export const applyModelAliasOverride = (logger, model, configuredAliases = {}) => {
|
|
6
|
+
if (!model)
|
|
7
|
+
return;
|
|
8
|
+
for (const entry of model.split(',')) {
|
|
9
|
+
const separator = entry.indexOf(':');
|
|
10
|
+
if (separator === -1) {
|
|
11
|
+
throw new Error(`--model expects alias:provider/model (e.g. 'cheap:openai/gpt-5-nano'), got '${entry}'.`);
|
|
12
|
+
}
|
|
13
|
+
const alias = entry.slice(0, separator).trim();
|
|
14
|
+
const target = entry.slice(separator + 1).trim();
|
|
15
|
+
// An empty half still contains the separator, so it survives the check
|
|
16
|
+
// above. `cheap:` is the damaging one: the core resolver prefers the
|
|
17
|
+
// environment override, finds nothing behind the alias, and fails later
|
|
18
|
+
// with an unknown-alias error naming a model the user never typed.
|
|
19
|
+
if (!alias || !target) {
|
|
20
|
+
throw new Error(`--model expects alias:provider/model (e.g. 'cheap:openai/gpt-5-nano'), got '${entry}' with ${alias ? 'no model' : 'no alias'}.`);
|
|
21
|
+
}
|
|
22
|
+
if (alias.includes('/')) {
|
|
23
|
+
throw new Error(`--model repoints an alias, and '${alias}' is not an alias but a provider-qualified model. Name the alias whose model you want to change, e.g. 'cheap:${target}'.`);
|
|
24
|
+
}
|
|
25
|
+
// A warning, not an error: the table may come from an addon config this
|
|
26
|
+
// run has not loaded.
|
|
27
|
+
if (Object.keys(configuredAliases).length > 0 &&
|
|
28
|
+
!configuredAliases[alias]) {
|
|
29
|
+
logger.warn(`--model overrides alias '${alias}', which is not in the "models" table of pikku.config.json (${Object.keys(configuredAliases).sort().join(', ')}) — nothing may use it.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
process.env.PIKKU_MODEL_ALIASES = model;
|
|
33
|
+
};
|
|
@@ -489,12 +489,28 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
489
489
|
if (!result.agentWiringMetaJsonFile) {
|
|
490
490
|
result.agentWiringMetaJsonFile = join(agentDir, 'pikku-agent-wirings-meta.gen.json');
|
|
491
491
|
}
|
|
492
|
+
if (!result.modelAliasesFile) {
|
|
493
|
+
result.modelAliasesFile = join(agentDir, 'pikku-model-aliases.gen.ts');
|
|
494
|
+
}
|
|
492
495
|
if (!result.agentTypesFile) {
|
|
493
496
|
result.agentTypesFile = join(agentDir, 'pikku-agent-types.gen.ts');
|
|
494
497
|
}
|
|
495
498
|
if (!result.agentMapDeclarationFile) {
|
|
496
499
|
result.agentMapDeclarationFile = join(agentDir, 'pikku-agent-map.gen.d.ts');
|
|
497
500
|
}
|
|
501
|
+
// AI Scorer — the same directory as agents: a scorer exists to grade one.
|
|
502
|
+
if (!result.scorerWiringsFile) {
|
|
503
|
+
result.scorerWiringsFile = join(agentDir, 'pikku-scorer-wirings.gen.ts');
|
|
504
|
+
}
|
|
505
|
+
if (!result.scorerWiringMetaFile) {
|
|
506
|
+
result.scorerWiringMetaFile = join(agentDir, 'pikku-scorer-wirings-meta.gen.ts');
|
|
507
|
+
}
|
|
508
|
+
if (!result.scorerWiringMetaJsonFile) {
|
|
509
|
+
result.scorerWiringMetaJsonFile = join(agentDir, 'pikku-scorer-wirings-meta.gen.json');
|
|
510
|
+
}
|
|
511
|
+
if (!result.scorerNamesDeclarationFile) {
|
|
512
|
+
result.scorerNamesDeclarationFile = join(agentDir, 'pikku-scorer-names.gen.d.ts');
|
|
513
|
+
}
|
|
498
514
|
// CLI
|
|
499
515
|
if (!result.cliWiringsFile) {
|
|
500
516
|
result.cliWiringsFile = join(cliDir, 'pikku-cli-wirings.gen.ts');
|