@pikku/cli 0.12.103 → 0.12.105
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-BLi9JHGg.js → abnfDiagram-VRR7QNED-QRjCVsso.js} +1 -1
- package/console-app/assets/{arc-B3b5uYlL.js → arc-CloGjkHW.js} +1 -1
- package/console-app/assets/architecture-TIHT7OUA-Cz78Qi5H.js +1 -0
- package/console-app/assets/{architectureDiagram-ZJ3FMSHR-Dkd8kxIa.js → architectureDiagram-ZJ3FMSHR-Dl10fVqw.js} +1 -1
- package/console-app/assets/{blockDiagram-677ZJIJ3-DnH0nNlb.js → blockDiagram-677ZJIJ3-CMNoQhwm.js} +1 -1
- package/console-app/assets/{c4Diagram-LMCZKHZV-BlelCS5i.js → c4Diagram-LMCZKHZV-C2pWYCa6.js} +1 -1
- package/console-app/assets/channel-Bm4o-pNB.js +1 -0
- package/console-app/assets/{chunk-32BRIVSS-D7tMgtT1.js → chunk-32BRIVSS-DC3ZGIPN.js} +1 -1
- package/console-app/assets/{chunk-52WLFC77-CRepS35y.js → chunk-52WLFC77-DuAheIlc.js} +1 -1
- package/console-app/assets/{chunk-C7G6YPKG-CUldlJz4.js → chunk-C7G6YPKG-BVtRZIEZ.js} +1 -1
- package/console-app/assets/{chunk-EX3LRPZG-DODbrqEj.js → chunk-EX3LRPZG-CWXF7N33.js} +1 -1
- package/console-app/assets/{chunk-FWX5IMBZ-nZa59wGD.js → chunk-FWX5IMBZ-UN3i5qMG.js} +2 -2
- package/console-app/assets/{chunk-HOUHSVGY-BaawVZCa.js → chunk-HOUHSVGY-DMorD8Ib.js} +1 -1
- package/console-app/assets/{chunk-ICXQ74PX-C86LrIRs.js → chunk-ICXQ74PX-BiuzWyj2.js} +1 -1
- package/console-app/assets/{chunk-MOJQB5TN-ovUDQlyW.js → chunk-MOJQB5TN-6BhXmDyj.js} +1 -1
- package/console-app/assets/{chunk-OGEWGWER-ByZKAcGu.js → chunk-OGEWGWER-BNi3Gsmc.js} +1 -1
- package/console-app/assets/{chunk-PUDLZKDR-DdeJN3wJ.js → chunk-PUDLZKDR-DNWGCeoL.js} +1 -1
- package/console-app/assets/{chunk-Q4XR5HBZ-Blp5W9-b.js → chunk-Q4XR5HBZ-i4zkt4cc.js} +1 -1
- package/console-app/assets/{chunk-RYQCIY6F-DehwjyPp.js → chunk-RYQCIY6F-DvRUzuDz.js} +1 -1
- package/console-app/assets/{chunk-V7JOEXUC-Ca1xeVdo.js → chunk-V7JOEXUC-JMjbqEgu.js} +1 -1
- package/console-app/assets/chunk-VAUOI2AC-D4_whP-t.js +1 -0
- package/console-app/assets/{chunk-VR4S4FIN-Cj7ZlsLr.js → chunk-VR4S4FIN-BcHHugM0.js} +1 -1
- package/console-app/assets/{chunk-WYO6CB5R-CsdBQ1HS.js → chunk-WYO6CB5R-COKjEQwP.js} +1 -1
- package/console-app/assets/chunk-XXDRQBXY-mkAF2YHU.js +1 -0
- package/console-app/assets/{chunk-ZGVPDNZ5-DMnFdLEO.js → chunk-ZGVPDNZ5-CENGdlFJ.js} +1 -1
- package/console-app/assets/classDiagram-OUVF2IWQ-B2cEvfK0.js +1 -0
- package/console-app/assets/classDiagram-v2-EOCWNBFH-B2cEvfK0.js +1 -0
- package/console-app/assets/{cose-bilkent-JH36ORCC-CiYBhiBv.js → cose-bilkent-JH36ORCC-D6F1MghO.js} +1 -1
- package/console-app/assets/{cynefin-VYW2F7L2-BXuNC8qm.js → cynefin-VYW2F7L2-BIhff1Ln.js} +1 -1
- package/console-app/assets/{cynefinDiagram-TSTJHNR4-Ck53b-Nr.js → cynefinDiagram-TSTJHNR4-DrlBq_QP.js} +1 -1
- package/console-app/assets/{dagre-VKFMJZFB-C9hZCnOv.js → dagre-VKFMJZFB-Cm2eP0ez.js} +1 -1
- package/console-app/assets/{diagram-FQU43EPY-DuEKSLPE.js → diagram-FQU43EPY-C667dC19.js} +1 -1
- package/console-app/assets/{diagram-G47NLZAW-B_yO-zKt.js → diagram-G47NLZAW-3K3OPEuG.js} +1 -1
- package/console-app/assets/{diagram-NH7WQ7WH-CtKFjoB4.js → diagram-NH7WQ7WH-CUK-d5iT.js} +1 -1
- package/console-app/assets/{diagram-OA4YK3LP-T9eIYXYs.js → diagram-OA4YK3LP-BmjCoGBZ.js} +1 -1
- package/console-app/assets/{diagram-WEI45ONY-BTgu-I69.js → diagram-WEI45ONY-D33qA2d9.js} +1 -1
- package/console-app/assets/{dist-DSVj7qxi.js → dist-jqlCD26w.js} +1 -1
- package/console-app/assets/{ebnfDiagram-CCIWWBDH-BdyNRX2k.js → ebnfDiagram-CCIWWBDH-DUHkt7z6.js} +1 -1
- package/console-app/assets/{erDiagram-Q63AITRT-B0cr0nxe.js → erDiagram-Q63AITRT-BAtdfbq3.js} +1 -1
- package/console-app/assets/eventmodeling-45OFAUF4-iK6rmyk3.js +1 -0
- package/console-app/assets/flowDiagram-23GEKE2U-CSYhKO9Y.js +1 -0
- package/console-app/assets/{ganttDiagram-NO4QXBWP-Cr1R_nGh.js → ganttDiagram-NO4QXBWP-64_vh9rj.js} +1 -1
- package/console-app/assets/{gitGraph-TEB2WS4Q-zcmQoWd4.js → gitGraph-TEB2WS4Q-DlFJY0cQ.js} +1 -1
- package/console-app/assets/{gitGraphDiagram-IHSO6WYX-CHB9Fnch.js → gitGraphDiagram-IHSO6WYX-D9fpmYRm.js} +1 -1
- package/console-app/assets/{index-BbIUXgNl.js → index-Byf4wkdP.js} +159 -153
- package/console-app/assets/{index-C9U-Zyvx.css → index-CTO5cTAD.css} +1 -1
- package/console-app/assets/{info-DKCQHKI2-BGPZGp_E.js → info-DKCQHKI2-DhyT_-b1.js} +1 -1
- package/console-app/assets/{infoDiagram-FWYZ7A6U-Br_p6SR_.js → infoDiagram-FWYZ7A6U-ufTemVSR.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-FXEZZL3T-Ma2d4IuN.js → ishikawaDiagram-FXEZZL3T-CWHvEncb.js} +1 -1
- package/console-app/assets/{journeyDiagram-5HDEW3XC-LdCblEX2.js → journeyDiagram-5HDEW3XC-DKH8UvEq.js} +1 -1
- package/console-app/assets/{kanban-definition-HUTT4EX6-CRWetzV4.js → kanban-definition-HUTT4EX6-BODtp_fB.js} +1 -1
- package/console-app/assets/{line-DrceqMYY.js → line-Do9j3HRL.js} +1 -1
- package/console-app/assets/{linear-acWbtwAj.js → linear-5Z8stnH-.js} +1 -1
- package/console-app/assets/{mermaid-parser.core-n773Jf0G.js → mermaid-parser.core-CYJsdwMO.js} +3 -3
- package/console-app/assets/{mermaid.core-DyTRkSqH.js → mermaid.core-DwI4IdKs.js} +3 -3
- package/console-app/assets/{mindmap-definition-LN4V7U3C-CBU-ehFU.js → mindmap-definition-LN4V7U3C-D7IWNYnf.js} +1 -1
- package/console-app/assets/{packet-7NZHBO7P-DL_fgdX1.js → packet-7NZHBO7P-comMLvz_.js} +1 -1
- package/console-app/assets/{pegDiagram-2B236MQR-CrFaAHHj.js → pegDiagram-2B236MQR-CbqiI_m5.js} +1 -1
- package/console-app/assets/{pie-RZYD4A2V-STtzW8Tz.js → pie-RZYD4A2V-VZXoX73g.js} +1 -1
- package/console-app/assets/{pieDiagram-ENE6RG2P-DsUOr1Ud.js → pieDiagram-ENE6RG2P-SA-sCnrt.js} +1 -1
- package/console-app/assets/{quadrantDiagram-ABIIQ3AL-DmuSe_qW.js → quadrantDiagram-ABIIQ3AL-CI840rae.js} +1 -1
- package/console-app/assets/{radar-I7S5WNFK-L8w2lEOb.js → radar-I7S5WNFK-W0UH9BdP.js} +1 -1
- package/console-app/assets/{railroad-3IZDKUUU-CxqlE5vc.js → railroad-3IZDKUUU-_HEtbruA.js} +1 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-ghLnUEfg.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-D8JHCZD5.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-C9eC4l2D.js +1 -0
- package/console-app/assets/{railroadDiagram-RFXS5EU6-CJ8Lpbeo.js → railroadDiagram-RFXS5EU6-Cm2SfP9Z.js} +1 -1
- package/console-app/assets/{requirementDiagram-TGXJPOKE-8OXQXUud.js → requirementDiagram-TGXJPOKE-CyHrMdrC.js} +1 -1
- package/console-app/assets/{sankeyDiagram-HTMAVEWB-Bezd2CqZ.js → sankeyDiagram-HTMAVEWB-DL0eJ1aK.js} +1 -1
- package/console-app/assets/{sequenceDiagram-DBY2YBRQ-DHb5js3D.js → sequenceDiagram-DBY2YBRQ-B2AvEvXu.js} +1 -1
- package/console-app/assets/{src-DfFamOl-.js → src-72nNqhBu.js} +1 -1
- package/console-app/assets/{stateDiagram-2N3HPSRC-UpyJm2mi.js → stateDiagram-2N3HPSRC-vgyc-CMC.js} +1 -1
- package/console-app/assets/stateDiagram-v2-6OUMAXLB-B2WCkCZh.js +1 -0
- package/console-app/assets/{swimlanes-5IMT3BWC-yUrV5f4O.js → swimlanes-5IMT3BWC-GiOMMhZh.js} +1 -1
- package/console-app/assets/swimlanesDiagram-G3AALYLV-CkCbtoLb.js +8 -0
- package/console-app/assets/{timeline-definition-FHXFAJF6-B6w-rZeZ.js → timeline-definition-FHXFAJF6-DTJQsTn8.js} +1 -1
- package/console-app/assets/{treeView-QDETBFTQ-0k2QpnXc.js → treeView-QDETBFTQ-aizmbgl7.js} +1 -1
- package/console-app/assets/{treemap-6X3UGDF4-ByCuDcGA.js → treemap-6X3UGDF4-DIBl6bfV.js} +1 -1
- package/console-app/assets/{vennDiagram-L72KCM5P-BH4374lw.js → vennDiagram-L72KCM5P-C4Ngu7VX.js} +1 -1
- package/console-app/assets/{wardley-OPB4EBWU-DNVwuJz6.js → wardley-OPB4EBWU-BqdXyJTm.js} +1 -1
- package/console-app/assets/{wardleyDiagram-EHGQE667-EXnQ6lkx.js → wardleyDiagram-EHGQE667-Cw2M8s0p.js} +1 -1
- package/console-app/assets/{xychartDiagram-FW5EYKEG-rFh-UdgH.js → xychartDiagram-FW5EYKEG-BxMLZdbF.js} +1 -1
- package/console-app/index.html +9 -2
- package/console-app/site.webmanifest +19 -8
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +12 -12
- package/dist/.pikku/agent/pikku-agent-types.gen.js +6 -6
- package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +4 -4
- package/dist/.pikku/channel/pikku-channel-types.gen.js +3 -2
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +13 -3
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +2 -2
- package/dist/.pikku/cli/pikku-cli-client.gen.js +2 -2
- 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 +2 -2
- 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 +48 -4
- 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 +2 -2
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +9 -7
- package/dist/.pikku/function/pikku-function-types.gen.js +5 -4
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +97 -54
- package/dist/.pikku/function/pikku-functions.gen.js +8 -8
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +3 -3
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +4 -3
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +4 -4
- package/dist/.pikku/pikku-services.gen.js +3 -3
- 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 +2 -2
- 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 +5 -3
- 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 +2 -2
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +8 -6
- package/dist/.pikku/schemas/schemas/PikkuSemverOutput.schema.json +1 -0
- package/dist/.pikku/scopes/pikku-personas.gen.d.ts +2 -1
- package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +2 -2
- package/dist/.pikku/scopes/pikku-roles.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +5 -5
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +3 -3
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +2 -2
- package/dist/.pikku/scopes/pikku-scopes.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +3 -2
- 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 +3 -3
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +2 -2
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +3 -3
- package/dist/.pikku/variables/pikku-variables.gen.js +2 -2
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +9 -9
- package/dist/.pikku/workflow/pikku-personas.gen.d.ts +3 -2
- package/dist/.pikku/workflow/pikku-personas.gen.js +2 -2
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +6 -6
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +3 -3
- 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 +50 -4
- package/dist/src/deploy/analyzer/analyzer.js +5 -5
- package/dist/src/deploy/bundler/bundler.js +2 -2
- package/dist/src/functions/commands/audit.js +33 -9
- package/dist/src/functions/commands/bootstrap.js +1 -1
- package/dist/src/functions/commands/{dev-ai-runner.d.ts → dev-agent-runner.d.ts} +3 -3
- package/dist/src/functions/commands/{dev-ai-runner.js → dev-agent-runner.js} +4 -4
- package/dist/src/functions/commands/dev.js +29 -23
- package/dist/src/functions/commands/persona-sync.js +2 -2
- package/dist/src/functions/commands/persona.js +7 -6
- package/dist/src/functions/commands/roles-prune.js +1 -1
- package/dist/src/functions/commands/roles-shared.d.ts +1 -1
- package/dist/src/functions/commands/roles-shared.js +1 -1
- package/dist/src/functions/commands/scenario-browser.d.ts +2 -2
- package/dist/src/functions/commands/scenario-formatter.d.ts +1 -1
- package/dist/src/functions/commands/scenario-ladder.d.ts +4 -3
- package/dist/src/functions/commands/scenario-ladder.js +1 -1
- package/dist/src/functions/commands/scenario-plan.d.ts +2 -2
- package/dist/src/functions/commands/scenario-plan.js +1 -1
- package/dist/src/functions/commands/scenario.d.ts +0 -3
- package/dist/src/functions/commands/scenario.js +40 -38
- package/dist/src/functions/commands/scopes-prune.js +1 -1
- package/dist/src/functions/commands/scopes-shared.d.ts +1 -1
- package/dist/src/functions/commands/scopes-shared.js +1 -1
- package/dist/src/functions/commands/semver-render.d.ts +2 -0
- package/dist/src/functions/commands/semver-render.js +60 -0
- package/dist/src/functions/commands/semver.d.ts +25 -0
- package/dist/src/functions/commands/semver.js +50 -0
- package/dist/src/functions/commands/serve.js +20 -19
- package/dist/src/functions/commands/start-coverage.d.ts +1 -1
- package/dist/src/functions/commands/start-coverage.js +2 -2
- package/dist/src/functions/commands/update-render.d.ts +2 -0
- package/dist/src/functions/commands/update-render.js +102 -0
- package/dist/src/functions/commands/update.d.ts +99 -0
- package/dist/src/functions/commands/update.js +392 -0
- package/dist/src/functions/commands/virtual-user-formatter.d.ts +1 -1
- package/dist/src/functions/validate/scenario-file-checks.js +1 -1
- package/dist/src/functions/validate/validate-registry.js +10 -0
- package/dist/src/functions/validate/workspace-exports-checks.d.ts +14 -0
- package/dist/src/functions/validate/workspace-exports-checks.js +211 -0
- package/dist/src/functions/wirings/agent/pikku-command-agent-types.d.ts +1 -0
- package/dist/src/functions/wirings/{ai-agent/pikku-command-ai-agent-types.js → agent/pikku-command-agent-types.js} +3 -3
- package/dist/src/functions/wirings/agent/pikku-command-agent.d.ts +1 -0
- package/dist/src/functions/wirings/{ai-agent/pikku-command-ai-agent.js → agent/pikku-command-agent.js} +5 -5
- package/dist/src/functions/wirings/{ai-agent → agent}/serialize-agent-map.d.ts +2 -2
- package/dist/src/functions/wirings/agent/serialize-agent-types.d.ts +1 -0
- package/dist/src/functions/wirings/{ai-agent/serialize-ai-agent-types.js → agent/serialize-agent-types.js} +21 -32
- package/dist/src/functions/wirings/{ai-agent → agent}/serialize-public-agent.js +1 -1
- package/dist/src/functions/wirings/agent-scorer/pikku-command-agent-scorer.d.ts +1 -0
- package/dist/src/functions/wirings/{ai-scorer/pikku-command-ai-scorer.js → agent-scorer/pikku-command-agent-scorer.js} +5 -5
- package/dist/src/functions/wirings/{ai-scorer → agent-scorer}/serialize-scorer-names.d.ts +1 -1
- package/dist/src/functions/wirings/auth/serialize-auth-gen.js +6 -6
- package/dist/src/functions/wirings/channels/pikku-channels.js +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +1 -1
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +4 -3
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.d.ts +2 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +3 -3
- package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +2 -2
- package/dist/src/functions/wirings/cli/serialize-cli-types.js +2 -1
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.js +1 -1
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.js +1 -1
- package/dist/src/functions/wirings/credentials/serialize-credentials-types.d.ts +1 -1
- package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +4 -3
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +1 -1
- package/dist/src/functions/wirings/functions/serialize-addon-types.js +2 -1
- package/dist/src/functions/wirings/functions/serialize-function-imports.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +11 -12
- package/dist/src/functions/wirings/gateway/serialize-gateway-meta.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +1 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.js +1 -1
- package/dist/src/functions/wirings/http/serialize-http-types.js +3 -2
- package/dist/src/functions/wirings/http/serialize-typed-http-map.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +1 -1
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +3 -11
- package/dist/src/functions/wirings/package/serialize-package-types.js +7 -6
- package/dist/src/functions/wirings/personas/pikku-command-personas.js +1 -1
- package/dist/src/functions/wirings/personas/serialize-personas-types.d.ts +1 -1
- package/dist/src/functions/wirings/personas/serialize-personas-types.js +6 -2
- package/dist/src/functions/wirings/queue/serialize-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +1 -1
- package/dist/src/functions/wirings/queue/serialize-queue-types.js +2 -1
- package/dist/src/functions/wirings/roles/pikku-command-roles.js +1 -1
- package/dist/src/functions/wirings/roles/serialize-roles-types.d.ts +1 -1
- package/dist/src/functions/wirings/roles/serialize-roles-types.js +2 -2
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +5 -5
- package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.js +3 -2
- package/dist/src/functions/wirings/scenarios/scenario-partition.d.ts +1 -1
- package/dist/src/functions/wirings/scenarios/scenario-schema-partition.d.ts +1 -1
- package/dist/src/functions/wirings/scenarios/serialize-feature-meta.d.ts +1 -1
- package/dist/src/functions/wirings/scenarios/serialize-scenario-meta.js +2 -2
- package/dist/src/functions/wirings/scenarios/serialize-scenario-registration.js +1 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +2 -1
- package/dist/src/functions/wirings/scopes/pikku-command-scopes.js +1 -1
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.d.ts +1 -1
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +3 -3
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.js +1 -1
- package/dist/src/functions/wirings/secrets/serialize-secrets-types.d.ts +1 -1
- package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +4 -3
- package/dist/src/functions/wirings/triggers/serialize-trigger-meta.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/serialize-trigger-meta.js +2 -2
- package/dist/src/functions/wirings/triggers/serialize-trigger-types.js +3 -2
- package/dist/src/functions/wirings/variables/pikku-command-variables.js +1 -1
- package/dist/src/functions/wirings/variables/serialize-variables-types.d.ts +1 -1
- package/dist/src/functions/wirings/variables/serialize-variables-types.js +3 -3
- package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.js +7 -13
- package/dist/src/functions/wirings/webhook/serialize-webhook.js +1 -1
- package/dist/src/functions/wirings/workflow/serialize-personas.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-personas.js +4 -3
- package/dist/src/functions/wirings/workflow/serialize-scenario-step-map.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +2 -2
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.js +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +2 -2
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +6 -9
- package/dist/src/functions/workflows/all.workflow.js +6 -5
- package/dist/src/middleware/log-command-info-and-time.d.ts +1 -1
- package/dist/src/server/node-server-runner.js +5 -2
- package/dist/src/services/cli-logger.service.js +1 -1
- package/dist/src/utils/precise-coverage-map.d.ts +1 -1
- package/dist/src/utils/remove-legacy-scaffold-file.d.ts +14 -0
- package/dist/src/utils/remove-legacy-scaffold-file.js +28 -1
- package/dist/src/utils/resolve-personas.d.ts +3 -3
- package/dist/src/utils/resolve-personas.js +2 -2
- package/dist/src/utils/schema-diff.d.ts +22 -0
- package/dist/src/utils/schema-diff.js +190 -0
- package/dist/src/utils/serialize-schemas.d.ts +1 -1
- package/dist/src/utils/serialize-schemas.js +1 -1
- package/dist/src/utils/surface-diff.d.ts +35 -0
- package/dist/src/utils/surface-diff.js +183 -0
- package/dist/src/utils/surface.d.ts +51 -0
- package/dist/src/utils/surface.js +156 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -17
- package/console-app/assets/architecture-TIHT7OUA-BYeDayHv.js +0 -1
- package/console-app/assets/channel-CTa6nggO.js +0 -1
- package/console-app/assets/chunk-VAUOI2AC-BCngaLxk.js +0 -1
- package/console-app/assets/chunk-XXDRQBXY-CGIlOoBU.js +0 -1
- package/console-app/assets/classDiagram-OUVF2IWQ-Bwt1ZVOR.js +0 -1
- package/console-app/assets/classDiagram-v2-EOCWNBFH-Bwt1ZVOR.js +0 -1
- package/console-app/assets/eventmodeling-45OFAUF4-BeHdsPzc.js +0 -1
- package/console-app/assets/flowDiagram-23GEKE2U-6N6mIkfB.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-CkJOR_Em.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-BH_pRGgm.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-B50bKcii.js +0 -1
- package/console-app/assets/stateDiagram-v2-6OUMAXLB-C6gAfg82.js +0 -1
- package/console-app/assets/swimlanesDiagram-G3AALYLV-Ch2_j5W5.js +0 -8
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.d.ts +0 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.d.ts +0 -1
- package/dist/src/functions/wirings/ai-agent/serialize-ai-agent-types.d.ts +0 -1
- package/dist/src/functions/wirings/ai-scorer/pikku-command-ai-scorer.d.ts +0 -1
- /package/dist/.pikku/schemas/schemas/{PikkuAIAgentOutput.schema.json → PikkuAgentOutput.schema.json} +0 -0
- /package/dist/.pikku/schemas/schemas/{PikkuAIScorerOutput.schema.json → PikkuAgentScorerOutput.schema.json} +0 -0
- /package/dist/src/functions/wirings/{ai-agent → agent}/pikku-command-public-agent.d.ts +0 -0
- /package/dist/src/functions/wirings/{ai-agent → agent}/pikku-command-public-agent.js +0 -0
- /package/dist/src/functions/wirings/{ai-agent → agent}/serialize-agent-map.js +0 -0
- /package/dist/src/functions/wirings/{ai-agent → agent}/serialize-model-aliases.d.ts +0 -0
- /package/dist/src/functions/wirings/{ai-agent → agent}/serialize-model-aliases.js +0 -0
- /package/dist/src/functions/wirings/{ai-agent → agent}/serialize-public-agent.d.ts +0 -0
- /package/dist/src/functions/wirings/{ai-scorer → agent-scorer}/serialize-scorer-names.js +0 -0
|
@@ -5,14 +5,17 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { LocalEventHubService } from '@pikku/core/channel/local';
|
|
7
7
|
import { PikkuNodeHTTPServer } from '@pikku/node-http-server';
|
|
8
|
-
import { pikkuWebsocketHandler } from '@pikku/ws';
|
|
8
|
+
import { DEFAULT_WS_MAX_PAYLOAD, pikkuWebsocketHandler } from '@pikku/ws';
|
|
9
9
|
import { WebSocketServer } from 'ws';
|
|
10
10
|
export class NodeServerRunner {
|
|
11
11
|
async createEventHub() {
|
|
12
12
|
return new LocalEventHubService();
|
|
13
13
|
}
|
|
14
14
|
createServer(config, logger, options = {}) {
|
|
15
|
-
const wss = new WebSocketServer({
|
|
15
|
+
const wss = new WebSocketServer({
|
|
16
|
+
noServer: true,
|
|
17
|
+
maxPayload: DEFAULT_WS_MAX_PAYLOAD,
|
|
18
|
+
});
|
|
16
19
|
const server = new PikkuNodeHTTPServer(config, logger, {
|
|
17
20
|
configureServer: (httpServer) => {
|
|
18
21
|
pikkuWebsocketHandler({ server: httpServer, wss, logger });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { LogLevel } from '@pikku/core/services';
|
|
3
|
-
import { isExpectedError } from '@pikku/core';
|
|
3
|
+
import { isExpectedError } from '@pikku/core/ecosystem/types';
|
|
4
4
|
// Compact one-line wordmark — the old multi-line ASCII art got cropped in
|
|
5
5
|
// short/narrow AI-agent panes. Coloured directly (not via the blue `info`
|
|
6
6
|
// path) so the cyan/bold render correctly.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CoverageFunctionMeta, FunctionCoverageReport, ScriptCoverage as ScriptCoverageInput } from '@pikku/core/services';
|
|
1
|
+
import type { CoverageFunctionMeta, FunctionCoverageReport, ScriptCoverage as ScriptCoverageInput } from '@pikku/core/ecosystem/services';
|
|
2
2
|
export type { ScriptCoverageInput };
|
|
3
3
|
export declare function mapPreciseCoverage(scripts: ScriptCoverageInput[], getScriptSource: (scriptId: string) => Promise<string>, functionsMeta: Record<string, CoverageFunctionMeta>): Promise<FunctionCoverageReport>;
|
|
4
4
|
export declare function mapLineHitsToReport(lineHits: Map<string, Map<number, number>>, functionsMeta: Record<string, CoverageFunctionMeta>): FunctionCoverageReport;
|
|
@@ -14,4 +14,18 @@ export declare const removeLegacyScaffoldFile: (file: string) => Promise<void>;
|
|
|
14
14
|
* to write to, this removes a file pikku no longer writes at all.
|
|
15
15
|
*/
|
|
16
16
|
export declare const removeRetiredScaffoldFiles: (config: PikkuCLIConfig) => Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Delete agent scaffolds that import an entry point pikku no longer publishes.
|
|
19
|
+
*
|
|
20
|
+
* A scaffold is written once, when missing, and left alone afterwards so a
|
|
21
|
+
* project can edit it. That is the right default until the import at the top
|
|
22
|
+
* stops resolving: the file then fails to compile and pikku will not replace it,
|
|
23
|
+
* because it is still there. Deleting it puts it back in the missing set, so the
|
|
24
|
+
* same `pikku all` regenerates it against the current entry point.
|
|
25
|
+
*
|
|
26
|
+
* Only the two `@pikku/core` paths #596 renamed count as stale. Anything a
|
|
27
|
+
* project added to the file is lost with it — which is why this is keyed to an
|
|
28
|
+
* import that cannot compile rather than to the file simply being out of date.
|
|
29
|
+
*/
|
|
30
|
+
export declare const refreshScaffoldsImportingRemovedEntryPoints: (config: PikkuCLIConfig) => Promise<void>;
|
|
17
31
|
export declare const pruneLegacyScaffoldFiles: (config: PikkuCLIConfig) => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { rm } from 'node:fs/promises';
|
|
2
|
-
import { existsSync } from 'node:fs';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { basename, dirname, join } from 'node:path';
|
|
4
4
|
const scaffoldFiles = (config) => {
|
|
5
5
|
const authDir = config.authFile ? dirname(config.authFile) : undefined;
|
|
@@ -57,6 +57,33 @@ export const removeRetiredScaffoldFiles = async (config) => {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Entry points a scaffold may still import after #596 renamed them.
|
|
62
|
+
*/
|
|
63
|
+
const REMOVED_ENTRY_POINTS = ['@pikku/core/ai-agent', '@pikku/core/ai-scorer'];
|
|
64
|
+
/**
|
|
65
|
+
* Delete agent scaffolds that import an entry point pikku no longer publishes.
|
|
66
|
+
*
|
|
67
|
+
* A scaffold is written once, when missing, and left alone afterwards so a
|
|
68
|
+
* project can edit it. That is the right default until the import at the top
|
|
69
|
+
* stops resolving: the file then fails to compile and pikku will not replace it,
|
|
70
|
+
* because it is still there. Deleting it puts it back in the missing set, so the
|
|
71
|
+
* same `pikku all` regenerates it against the current entry point.
|
|
72
|
+
*
|
|
73
|
+
* Only the two `@pikku/core` paths #596 renamed count as stale. Anything a
|
|
74
|
+
* project added to the file is lost with it — which is why this is keyed to an
|
|
75
|
+
* import that cannot compile rather than to the file simply being out of date.
|
|
76
|
+
*/
|
|
77
|
+
export const refreshScaffoldsImportingRemovedEntryPoints = async (config) => {
|
|
78
|
+
for (const file of [config.publicAgentFile, config.publicAgentSchemasFile]) {
|
|
79
|
+
if (!file || !existsSync(file))
|
|
80
|
+
continue;
|
|
81
|
+
const contents = readFileSync(file, 'utf-8');
|
|
82
|
+
if (REMOVED_ENTRY_POINTS.some((entry) => contents.includes(entry))) {
|
|
83
|
+
await rm(file, { force: true });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
60
87
|
export const pruneLegacyScaffoldFiles = async (config) => {
|
|
61
88
|
for (const file of scaffoldFiles(config)) {
|
|
62
89
|
if (file) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PersonaDefinitions } from '@pikku/core/persona';
|
|
2
|
-
import type { ResolvedPersona } from '@pikku/core/services';
|
|
1
|
+
import type { PersonaDefinitions } from '@pikku/core/ecosystem/persona';
|
|
2
|
+
import type { ResolvedPersona } from '@pikku/core/ecosystem/services';
|
|
3
3
|
/**
|
|
4
4
|
* Where a persona's mail lands when the project has not said.
|
|
5
5
|
*
|
|
@@ -24,4 +24,4 @@ export declare const resolvePersonas: (definitions: PersonaDefinitions, domain?:
|
|
|
24
24
|
* needs the same expansion at runtime, so it lives in core beside
|
|
25
25
|
* `prepareVirtualUserRun` and this keeps the CLI's existing import sites.
|
|
26
26
|
*/
|
|
27
|
-
export { personaScopes } from '@pikku/core/virtual-user';
|
|
27
|
+
export { personaScopes } from '@pikku/core/ecosystem/virtual-user';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { personaEmails, validateAndBuildPersonasMeta, } from '@pikku/core/persona';
|
|
1
|
+
import { personaEmails, validateAndBuildPersonasMeta, } from '@pikku/core/ecosystem/persona';
|
|
2
2
|
/**
|
|
3
3
|
* Where a persona's mail lands when the project has not said.
|
|
4
4
|
*
|
|
@@ -32,4 +32,4 @@ export const resolvePersonas = (definitions, domain = DEFAULT_PERSONA_EMAIL_DOMA
|
|
|
32
32
|
* needs the same expansion at runtime, so it lives in core beside
|
|
33
33
|
* `prepareVirtualUserRun` and this keeps the CLI's existing import sites.
|
|
34
34
|
*/
|
|
35
|
-
export { personaScopes } from '@pikku/core/virtual-user';
|
|
35
|
+
export { personaScopes } from '@pikku/core/ecosystem/virtual-user';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field-level compatibility diff between two JSON Schemas.
|
|
3
|
+
*
|
|
4
|
+
* Whether a change breaks anyone depends on which way the data flows, so every
|
|
5
|
+
* comparison carries a `direction`. An input schema is contravariant — the
|
|
6
|
+
* caller writes it, so tightening (a new required field, a narrower enum) is
|
|
7
|
+
* what breaks. An output schema is covariant — the caller reads it, so
|
|
8
|
+
* loosening (a field that may now be absent, a new enum member the consumer
|
|
9
|
+
* never handled) is what breaks. Removing a field breaks in both directions.
|
|
10
|
+
*/
|
|
11
|
+
export type SchemaDirection = 'input' | 'output';
|
|
12
|
+
export interface SchemaChange {
|
|
13
|
+
/** Dotted path from the schema root, `[]` marking array items. */
|
|
14
|
+
path: string;
|
|
15
|
+
breaking: boolean;
|
|
16
|
+
reason: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Diff two schemas, either of which may be absent — a function that gained or
|
|
20
|
+
* lost an input/output entirely is a real compatibility event, not a no-op.
|
|
21
|
+
*/
|
|
22
|
+
export declare function diffSchema(before: unknown, after: unknown, direction: SchemaDirection): SchemaChange[];
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field-level compatibility diff between two JSON Schemas.
|
|
3
|
+
*
|
|
4
|
+
* Whether a change breaks anyone depends on which way the data flows, so every
|
|
5
|
+
* comparison carries a `direction`. An input schema is contravariant — the
|
|
6
|
+
* caller writes it, so tightening (a new required field, a narrower enum) is
|
|
7
|
+
* what breaks. An output schema is covariant — the caller reads it, so
|
|
8
|
+
* loosening (a field that may now be absent, a new enum member the consumer
|
|
9
|
+
* never handled) is what breaks. Removing a field breaks in both directions.
|
|
10
|
+
*/
|
|
11
|
+
const isSchema = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
|
|
12
|
+
const joinPath = (parent, key) => parent ? `${parent}.${key}` : key;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve local `#/definitions/...` / `#/$defs/...` pointers against the root
|
|
15
|
+
* they were authored in. Anything non-local is left alone — an unresolvable
|
|
16
|
+
* `$ref` is compared as the opaque object it is rather than guessed at.
|
|
17
|
+
*/
|
|
18
|
+
function deref(schema, root, seen) {
|
|
19
|
+
let current = schema;
|
|
20
|
+
while (typeof current.$ref === 'string') {
|
|
21
|
+
const ref = current.$ref;
|
|
22
|
+
if (!ref.startsWith('#/') || seen.has(ref))
|
|
23
|
+
return current;
|
|
24
|
+
seen.add(ref);
|
|
25
|
+
let target = root;
|
|
26
|
+
for (const rawSegment of ref.slice(2).split('/')) {
|
|
27
|
+
const segment = rawSegment.replace(/~1/g, '/').replace(/~0/g, '~');
|
|
28
|
+
if (!isSchema(target))
|
|
29
|
+
return current;
|
|
30
|
+
target = target[segment];
|
|
31
|
+
}
|
|
32
|
+
if (!isSchema(target))
|
|
33
|
+
return current;
|
|
34
|
+
current = target;
|
|
35
|
+
}
|
|
36
|
+
return current;
|
|
37
|
+
}
|
|
38
|
+
const typeOf = (schema) => {
|
|
39
|
+
const type = schema.type;
|
|
40
|
+
if (typeof type === 'string')
|
|
41
|
+
return type;
|
|
42
|
+
if (Array.isArray(type))
|
|
43
|
+
return [...type].sort().join('|');
|
|
44
|
+
return undefined;
|
|
45
|
+
};
|
|
46
|
+
const requiredSet = (schema) => new Set(Array.isArray(schema.required) ? schema.required : []);
|
|
47
|
+
const propertiesOf = (schema) => isSchema(schema.properties) ? schema.properties : {};
|
|
48
|
+
/**
|
|
49
|
+
* `additionalProperties: false` is what makes an unknown key an error, so a
|
|
50
|
+
* removed input field only breaks callers when the schema is closed.
|
|
51
|
+
*/
|
|
52
|
+
const isClosed = (schema) => schema.additionalProperties === false;
|
|
53
|
+
function compare(beforeRaw, afterRaw, direction, path, beforeRoot, afterRoot, depth, changes) {
|
|
54
|
+
// Deep enough to have left any sane generated schema behind; a cyclic pair of
|
|
55
|
+
// `$ref`s that dodges the per-branch guard stops here rather than recursing.
|
|
56
|
+
if (depth > 24)
|
|
57
|
+
return;
|
|
58
|
+
const before = deref(beforeRaw, beforeRoot, new Set());
|
|
59
|
+
const after = deref(afterRaw, afterRoot, new Set());
|
|
60
|
+
const beforeType = typeOf(before);
|
|
61
|
+
const afterType = typeOf(after);
|
|
62
|
+
if (beforeType !== afterType && (beforeType || afterType)) {
|
|
63
|
+
changes.push({
|
|
64
|
+
path,
|
|
65
|
+
breaking: true,
|
|
66
|
+
reason: `type changed from ${beforeType ?? 'unknown'} to ${afterType ?? 'unknown'}`,
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
compareEnums(before, after, direction, path, changes);
|
|
71
|
+
const beforeProps = propertiesOf(before);
|
|
72
|
+
const afterProps = propertiesOf(after);
|
|
73
|
+
const beforeRequired = requiredSet(before);
|
|
74
|
+
const afterRequired = requiredSet(after);
|
|
75
|
+
for (const key of Object.keys(beforeProps)) {
|
|
76
|
+
const childPath = joinPath(path, key);
|
|
77
|
+
if (!(key in afterProps)) {
|
|
78
|
+
// Dropping an input field only breaks callers that still send it, which
|
|
79
|
+
// is only an error against a closed schema.
|
|
80
|
+
const breaking = direction === 'output' || isClosed(after);
|
|
81
|
+
changes.push({
|
|
82
|
+
path: childPath,
|
|
83
|
+
breaking,
|
|
84
|
+
reason: breaking
|
|
85
|
+
? 'field removed'
|
|
86
|
+
: 'field removed (schema accepts additional properties)',
|
|
87
|
+
});
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (beforeRequired.has(key) && !afterRequired.has(key)) {
|
|
91
|
+
changes.push({
|
|
92
|
+
path: childPath,
|
|
93
|
+
breaking: direction === 'output',
|
|
94
|
+
reason: direction === 'output'
|
|
95
|
+
? 'field is no longer guaranteed to be present'
|
|
96
|
+
: 'field became optional',
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
else if (!beforeRequired.has(key) && afterRequired.has(key)) {
|
|
100
|
+
changes.push({
|
|
101
|
+
path: childPath,
|
|
102
|
+
breaking: direction === 'input',
|
|
103
|
+
reason: direction === 'input'
|
|
104
|
+
? 'optional field became required'
|
|
105
|
+
: 'field is now always present',
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
compare(beforeProps[key], afterProps[key], direction, childPath, beforeRoot, afterRoot, depth + 1, changes);
|
|
109
|
+
}
|
|
110
|
+
for (const key of Object.keys(afterProps)) {
|
|
111
|
+
if (key in beforeProps)
|
|
112
|
+
continue;
|
|
113
|
+
const childPath = joinPath(path, key);
|
|
114
|
+
const required = afterRequired.has(key);
|
|
115
|
+
const breaking = direction === 'input' && required;
|
|
116
|
+
changes.push({
|
|
117
|
+
path: childPath,
|
|
118
|
+
breaking,
|
|
119
|
+
reason: breaking
|
|
120
|
+
? 'required field added'
|
|
121
|
+
: `${required ? 'required' : 'optional'} field added`,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (isSchema(before.items) && isSchema(after.items)) {
|
|
125
|
+
compare(before.items, after.items, direction, `${path}[]`, beforeRoot, afterRoot, depth + 1, changes);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function compareEnums(before, after, direction, path, changes) {
|
|
129
|
+
if (!Array.isArray(before.enum) || !Array.isArray(after.enum))
|
|
130
|
+
return;
|
|
131
|
+
const beforeValues = before.enum.map((v) => JSON.stringify(v));
|
|
132
|
+
const afterValues = new Set(after.enum.map((v) => JSON.stringify(v)));
|
|
133
|
+
const beforeSet = new Set(beforeValues);
|
|
134
|
+
const removed = beforeValues.filter((v) => !afterValues.has(v));
|
|
135
|
+
const added = after.enum
|
|
136
|
+
.map((v) => JSON.stringify(v))
|
|
137
|
+
.filter((v) => !beforeSet.has(v));
|
|
138
|
+
if (removed.length > 0) {
|
|
139
|
+
changes.push({
|
|
140
|
+
path,
|
|
141
|
+
// A value the caller may still send is now rejected; a value the caller
|
|
142
|
+
// will simply never see again is not their problem.
|
|
143
|
+
breaking: direction === 'input',
|
|
144
|
+
reason: `enum values removed: ${removed.join(', ')}`,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (added.length > 0) {
|
|
148
|
+
changes.push({
|
|
149
|
+
path,
|
|
150
|
+
// A new value in a response reaches consumers that never handled it.
|
|
151
|
+
breaking: direction === 'output',
|
|
152
|
+
reason: `enum values added: ${added.join(', ')}`,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Diff two schemas, either of which may be absent — a function that gained or
|
|
158
|
+
* lost an input/output entirely is a real compatibility event, not a no-op.
|
|
159
|
+
*/
|
|
160
|
+
export function diffSchema(before, after, direction) {
|
|
161
|
+
const hasBefore = isSchema(before);
|
|
162
|
+
const hasAfter = isSchema(after);
|
|
163
|
+
if (!hasBefore && !hasAfter)
|
|
164
|
+
return [];
|
|
165
|
+
if (!hasBefore && hasAfter) {
|
|
166
|
+
const required = requiredSet(after);
|
|
167
|
+
const breaking = direction === 'input' && required.size > 0;
|
|
168
|
+
return [
|
|
169
|
+
{
|
|
170
|
+
path: '',
|
|
171
|
+
breaking,
|
|
172
|
+
reason: breaking
|
|
173
|
+
? `${direction} schema added with required fields: ${[...required].join(', ')}`
|
|
174
|
+
: `${direction} schema added`,
|
|
175
|
+
},
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
if (hasBefore && !hasAfter) {
|
|
179
|
+
return [
|
|
180
|
+
{
|
|
181
|
+
path: '',
|
|
182
|
+
breaking: direction === 'output',
|
|
183
|
+
reason: `${direction} schema removed`,
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
}
|
|
187
|
+
const changes = [];
|
|
188
|
+
compare(before, after, direction, '', before, after, 0, changes);
|
|
189
|
+
return changes;
|
|
190
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JSONValue } from '@pikku/core';
|
|
1
|
+
import type { JSONValue } from '@pikku/core/ecosystem/types';
|
|
2
2
|
import type { CLILogger } from '../services/cli-logger.service.js';
|
|
3
3
|
export declare function saveSchemas(logger: CLILogger, schemaParentDir: string, schemas: Record<string, JSONValue>, requiredSchemas: Set<string>, supportsImportAttributes: boolean, packageName?: string | null,
|
|
4
4
|
/** Names the set in log output — there is more than one now (app, scenario). */
|
|
@@ -125,7 +125,7 @@ addSchema('${schema}', ${identifier}${packageNameArg})
|
|
|
125
125
|
})
|
|
126
126
|
.join('\n');
|
|
127
127
|
const importStatement = availableSchemas.length > 0
|
|
128
|
-
? `import { addSchema } from '@pikku/core/schema'`
|
|
128
|
+
? `import { addSchema } from '@pikku/core/ecosystem/schema'`
|
|
129
129
|
: '// No schemas to register';
|
|
130
130
|
await writeFileInDir(logger, `${schemaParentDir}/register.gen.ts`, `${importStatement}
|
|
131
131
|
${schemaImports}`, { logWrite: true });
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Surface, WiringCategory } from './surface.js';
|
|
2
|
+
/**
|
|
3
|
+
* Turn two surfaces into the release verdict and the reasons behind it.
|
|
4
|
+
*
|
|
5
|
+
* The three rules, in order: anything a client depended on that is gone or
|
|
6
|
+
* tightened is **major**; anything new or compatibly loosened is **minor**;
|
|
7
|
+
* a surface that did not move at all is **patch** — the release is internal
|
|
8
|
+
* work, which is the only thing left for it to be.
|
|
9
|
+
*/
|
|
10
|
+
export type Verdict = 'major' | 'minor' | 'patch';
|
|
11
|
+
export type ChangeKind = 'function' | WiringCategory;
|
|
12
|
+
export type ChangeStatus = 'added' | 'removed' | 'modified';
|
|
13
|
+
export interface SurfaceChange {
|
|
14
|
+
kind: ChangeKind;
|
|
15
|
+
id: string;
|
|
16
|
+
status: ChangeStatus;
|
|
17
|
+
breaking: boolean;
|
|
18
|
+
reasons: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface SurfaceChanges {
|
|
21
|
+
schemaVersion: number;
|
|
22
|
+
generatedAt: string;
|
|
23
|
+
/** The `--against` value, recorded so the artifact says what it is relative to. */
|
|
24
|
+
baseline: string;
|
|
25
|
+
verdict: Verdict;
|
|
26
|
+
summary: {
|
|
27
|
+
breaking: number;
|
|
28
|
+
added: number;
|
|
29
|
+
removed: number;
|
|
30
|
+
modified: number;
|
|
31
|
+
};
|
|
32
|
+
changes: SurfaceChange[];
|
|
33
|
+
}
|
|
34
|
+
export declare const CHANGES_SCHEMA_VERSION = 1;
|
|
35
|
+
export declare function computeSurfaceDiff(before: Surface, after: Surface, baseline: string): SurfaceChanges;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { diffSchema } from './schema-diff.js';
|
|
2
|
+
export const CHANGES_SCHEMA_VERSION = 1;
|
|
3
|
+
const STATUS_ORDER = {
|
|
4
|
+
removed: 0,
|
|
5
|
+
modified: 1,
|
|
6
|
+
added: 2,
|
|
7
|
+
};
|
|
8
|
+
const describe = (change, side) => `${side}${change.path ? `.${change.path}` : ''}: ${change.reason}`;
|
|
9
|
+
/**
|
|
10
|
+
* Published versions are immutable, so a function id that vanished from the
|
|
11
|
+
* source is still being served while the manifest records it — that is a `@vN`
|
|
12
|
+
* bump, not a removal.
|
|
13
|
+
*/
|
|
14
|
+
function stillPublished(surface, key, version) {
|
|
15
|
+
return (surface.publishedVersions[key] ?? []).includes(version);
|
|
16
|
+
}
|
|
17
|
+
function diffFunctions(before, after, changes) {
|
|
18
|
+
const ids = new Set([
|
|
19
|
+
...Object.keys(before.functions),
|
|
20
|
+
...Object.keys(after.functions),
|
|
21
|
+
]);
|
|
22
|
+
for (const id of [...ids].sort()) {
|
|
23
|
+
const previous = before.functions[id];
|
|
24
|
+
const current = after.functions[id];
|
|
25
|
+
if (previous && !current) {
|
|
26
|
+
const superseded = stillPublished(after, previous.key, previous.version);
|
|
27
|
+
changes.push({
|
|
28
|
+
kind: 'function',
|
|
29
|
+
id,
|
|
30
|
+
status: 'removed',
|
|
31
|
+
breaking: !superseded,
|
|
32
|
+
reasons: [
|
|
33
|
+
superseded
|
|
34
|
+
? `no longer in the source, but v${previous.version} is still published in versions.pikku.json`
|
|
35
|
+
: 'function removed',
|
|
36
|
+
],
|
|
37
|
+
});
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (!previous && current) {
|
|
41
|
+
const priorVersions = before.publishedVersions[current.key] ?? [];
|
|
42
|
+
changes.push({
|
|
43
|
+
kind: 'function',
|
|
44
|
+
id,
|
|
45
|
+
status: 'added',
|
|
46
|
+
breaking: false,
|
|
47
|
+
reasons: [
|
|
48
|
+
priorVersions.length > 0
|
|
49
|
+
? `new version of ${current.key} (previously v${priorVersions.join(', v')})`
|
|
50
|
+
: 'function added',
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (!previous || !current)
|
|
56
|
+
continue;
|
|
57
|
+
const reasons = [];
|
|
58
|
+
let breaking = false;
|
|
59
|
+
const pairs = [
|
|
60
|
+
{
|
|
61
|
+
side: 'input',
|
|
62
|
+
before: previous.inputSchemaName,
|
|
63
|
+
after: current.inputSchemaName,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
side: 'output',
|
|
67
|
+
before: previous.outputSchemaName,
|
|
68
|
+
after: current.outputSchemaName,
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
let unresolved = false;
|
|
72
|
+
for (const pair of pairs) {
|
|
73
|
+
const beforeSchema = pair.before ? before.schemas[pair.before] : undefined;
|
|
74
|
+
const afterSchema = pair.after ? after.schemas[pair.after] : undefined;
|
|
75
|
+
// A named schema whose body did not travel with the snapshot cannot be
|
|
76
|
+
// compared; fall through to the hash so it is never silently "unchanged".
|
|
77
|
+
if ((pair.before && beforeSchema === undefined) ||
|
|
78
|
+
(pair.after && afterSchema === undefined)) {
|
|
79
|
+
unresolved = true;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
for (const change of diffSchema(beforeSchema, afterSchema, pair.side)) {
|
|
83
|
+
if (change.breaking)
|
|
84
|
+
breaking = true;
|
|
85
|
+
reasons.push(describe(change, pair.side));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (unresolved &&
|
|
89
|
+
previous.contractHash !== undefined &&
|
|
90
|
+
current.contractHash !== undefined &&
|
|
91
|
+
previous.contractHash !== current.contractHash) {
|
|
92
|
+
// The contract moved but the schemas were not available to say how.
|
|
93
|
+
// Treating that as compatible would be a guess in the unsafe direction.
|
|
94
|
+
breaking = true;
|
|
95
|
+
reasons.push('contract hash changed, and the schemas were not available to determine whether it is breaking');
|
|
96
|
+
}
|
|
97
|
+
if (reasons.length > 0) {
|
|
98
|
+
changes.push({
|
|
99
|
+
kind: 'function',
|
|
100
|
+
id,
|
|
101
|
+
status: 'modified',
|
|
102
|
+
breaking,
|
|
103
|
+
reasons,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const authRequired = (meta) => !!meta &&
|
|
109
|
+
typeof meta === 'object' &&
|
|
110
|
+
meta.auth === true;
|
|
111
|
+
function diffWirings(before, after, changes) {
|
|
112
|
+
const categories = new Set([
|
|
113
|
+
...Object.keys(before.wirings),
|
|
114
|
+
...Object.keys(after.wirings),
|
|
115
|
+
]);
|
|
116
|
+
for (const category of [...categories].sort()) {
|
|
117
|
+
const previous = before.wirings[category] ?? {};
|
|
118
|
+
const current = after.wirings[category] ?? {};
|
|
119
|
+
const ids = new Set([...Object.keys(previous), ...Object.keys(current)]);
|
|
120
|
+
for (const id of [...ids].sort()) {
|
|
121
|
+
const inBefore = id in previous;
|
|
122
|
+
const inAfter = id in current;
|
|
123
|
+
if (inBefore && !inAfter) {
|
|
124
|
+
changes.push({
|
|
125
|
+
kind: category,
|
|
126
|
+
id,
|
|
127
|
+
status: 'removed',
|
|
128
|
+
breaking: true,
|
|
129
|
+
reasons: [`${category} wiring removed`],
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else if (!inBefore && inAfter) {
|
|
133
|
+
changes.push({
|
|
134
|
+
kind: category,
|
|
135
|
+
id,
|
|
136
|
+
status: 'added',
|
|
137
|
+
breaking: false,
|
|
138
|
+
reasons: [`${category} wiring added`],
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else if (JSON.stringify(previous[id]) !== JSON.stringify(current[id])) {
|
|
142
|
+
// Requiring a session on something that did not is the one wiring-level
|
|
143
|
+
// change that shuts out existing callers outright.
|
|
144
|
+
const closed = !authRequired(previous[id]) && authRequired(current[id]);
|
|
145
|
+
changes.push({
|
|
146
|
+
kind: category,
|
|
147
|
+
id,
|
|
148
|
+
status: 'modified',
|
|
149
|
+
breaking: closed,
|
|
150
|
+
reasons: [
|
|
151
|
+
closed
|
|
152
|
+
? `${category} wiring now requires authentication`
|
|
153
|
+
: `${category} wiring changed`,
|
|
154
|
+
],
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
export function computeSurfaceDiff(before, after, baseline) {
|
|
161
|
+
const changes = [];
|
|
162
|
+
diffFunctions(before, after, changes);
|
|
163
|
+
diffWirings(before, after, changes);
|
|
164
|
+
changes.sort((a, b) => Number(b.breaking) - Number(a.breaking) ||
|
|
165
|
+
STATUS_ORDER[a.status] - STATUS_ORDER[b.status] ||
|
|
166
|
+
a.kind.localeCompare(b.kind) ||
|
|
167
|
+
a.id.localeCompare(b.id));
|
|
168
|
+
const summary = {
|
|
169
|
+
breaking: changes.filter((c) => c.breaking).length,
|
|
170
|
+
added: changes.filter((c) => c.status === 'added').length,
|
|
171
|
+
removed: changes.filter((c) => c.status === 'removed').length,
|
|
172
|
+
modified: changes.filter((c) => c.status === 'modified').length,
|
|
173
|
+
};
|
|
174
|
+
const verdict = summary.breaking > 0 ? 'major' : changes.length > 0 ? 'minor' : 'patch';
|
|
175
|
+
return {
|
|
176
|
+
schemaVersion: CHANGES_SCHEMA_VERSION,
|
|
177
|
+
generatedAt: new Date().toISOString(),
|
|
178
|
+
baseline,
|
|
179
|
+
verdict,
|
|
180
|
+
summary,
|
|
181
|
+
changes,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { VersionManifest } from '@pikku/inspector';
|
|
2
|
+
import { type MetaDiffCategoryName } from './meta-diff.js';
|
|
3
|
+
/**
|
|
4
|
+
* A "surface" is everything about a build that a client can observe: the
|
|
5
|
+
* functions, the JSON Schemas of what they take and return, and the wirings
|
|
6
|
+
* that expose them. It is derived from `.pikku` rather than stored there, so a
|
|
7
|
+
* baseline can be a checkout on disk or a snapshot published from CI — the
|
|
8
|
+
* comparison is the same either way.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SURFACE_SCHEMA_VERSION = 1;
|
|
11
|
+
/** Meta categories that expose a function to a client. */
|
|
12
|
+
export type WiringCategory = Exclude<MetaDiffCategoryName, 'functions'>;
|
|
13
|
+
export interface SurfaceFunction {
|
|
14
|
+
/** Function id with any `@vN` suffix stripped. */
|
|
15
|
+
key: string;
|
|
16
|
+
version: number;
|
|
17
|
+
inputSchemaName: string | null;
|
|
18
|
+
outputSchemaName: string | null;
|
|
19
|
+
contractHash?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Surface {
|
|
22
|
+
schemaVersion: number;
|
|
23
|
+
generatedAt: string;
|
|
24
|
+
/** Keyed by function id exactly as the meta records it, `@vN` included. */
|
|
25
|
+
functions: Record<string, SurfaceFunction>;
|
|
26
|
+
/** Only the schemas some function actually references. */
|
|
27
|
+
schemas: Record<string, unknown>;
|
|
28
|
+
wirings: Partial<Record<WiringCategory, Record<string, unknown>>>;
|
|
29
|
+
/**
|
|
30
|
+
* `functionKey → published version numbers`, lifted from
|
|
31
|
+
* `versions.pikku.json`. Published versions are immutable, so a version the
|
|
32
|
+
* manifest still records is still being served even when the source has
|
|
33
|
+
* moved on — that is what stops a `@v2` bump reading as a removal.
|
|
34
|
+
*/
|
|
35
|
+
publishedVersions: Record<string, number[]>;
|
|
36
|
+
}
|
|
37
|
+
/** Build a surface from a generated `.pikku` directory. */
|
|
38
|
+
export declare function readSurface(pikkuDir: string, manifest?: VersionManifest | null): Surface;
|
|
39
|
+
export type FetchLike = (url: string) => Promise<{
|
|
40
|
+
ok: boolean;
|
|
41
|
+
status: number;
|
|
42
|
+
statusText: string;
|
|
43
|
+
text(): Promise<string>;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Resolve a baseline. A URL fetches a published snapshot; a path is read as a
|
|
47
|
+
* `.pikku` directory when it is one, and as a snapshot file otherwise — so
|
|
48
|
+
* `--against ../other-app/.pikku` and `--against ./prod-surface.json` both work
|
|
49
|
+
* without a second flag to say which is which.
|
|
50
|
+
*/
|
|
51
|
+
export declare function loadSurface(source: string, fetchImpl?: FetchLike): Promise<Surface>;
|