@pikku/cli 0.12.152 → 0.12.153
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/{HelpPanel-CxjgE40i.js → HelpPanel-0XQ4CyKC.js} +1 -1
- package/console-app/assets/{abnfDiagram-VCTEODGH-UPW1PlxM.js → abnfDiagram-VCTEODGH-DZTF_2aX.js} +1 -1
- package/console-app/assets/architecture-7GRP2DOG-NotVOJ5Y.js +1 -0
- package/console-app/assets/{architectureDiagram-5GKGNRK7-B3XFrvZk.js → architectureDiagram-5GKGNRK7-Re4-6X-k.js} +1 -1
- package/console-app/assets/{blockDiagram-I7D4REHJ-Ca0v9UJQ.js → blockDiagram-I7D4REHJ-Dbj7SnRK.js} +1 -1
- package/console-app/assets/{c4Diagram-7LVT6UL2-CLewVsj_.js → c4Diagram-7LVT6UL2-DUr02Wxh.js} +1 -1
- package/console-app/assets/channel-DU63_zXh.js +1 -0
- package/console-app/assets/{chunk-4HAMMTFA-BwhbhOD9.js → chunk-4HAMMTFA-DjatzNf_.js} +1 -1
- package/console-app/assets/{chunk-75Z2AOVW-C7nAgNk0.js → chunk-75Z2AOVW-BGsmWEdU.js} +1 -1
- package/console-app/assets/{chunk-DU6HZSFF-D4yYAcHt.js → chunk-DU6HZSFF-CC7WiVgI.js} +1 -1
- package/console-app/assets/{chunk-F27PBJKO-UHllOPps.js → chunk-F27PBJKO-BATuW9Ej.js} +1 -1
- package/console-app/assets/{chunk-GMAD6QVW-C0l_vm7T.js → chunk-GMAD6QVW-CgHNo00B.js} +1 -1
- package/console-app/assets/{chunk-GVQU2GXP-h-H2Oird.js → chunk-GVQU2GXP-VT_xckd9.js} +1 -1
- package/console-app/assets/{chunk-IMKFNOWR-DJ_W9CSg.js → chunk-IMKFNOWR-BhSVbWtF.js} +1 -1
- package/console-app/assets/{chunk-L3NEJ4N5-Ce9oniwE.js → chunk-L3NEJ4N5-HUF6a3Xl.js} +1 -1
- package/console-app/assets/{chunk-OSK3NFVY-CdGE5qxS.js → chunk-OSK3NFVY-C_LPDGIB.js} +1 -1
- package/console-app/assets/{chunk-P2QGCYS3-DK1pHDdz.js → chunk-P2QGCYS3-lWDBgw4Q.js} +1 -1
- package/console-app/assets/{chunk-POPQ4Y6H-DjevEFNo.js → chunk-POPQ4Y6H--6JTzmZJ.js} +1 -1
- package/console-app/assets/{chunk-PWAF6VOD-BVF5N1No.js → chunk-PWAF6VOD-C1GqaJJs.js} +1 -1
- package/console-app/assets/{chunk-SHT3W25Y-BX8We-wN.js → chunk-SHT3W25Y-Dd_4Zpdj.js} +1 -1
- package/console-app/assets/{chunk-SVP7TREG-Cl0GgAPC.js → chunk-SVP7TREG-B8OY7dfD.js} +1 -1
- package/console-app/assets/{chunk-TICWLB2K-IWZAWDhu.js → chunk-TICWLB2K-B8S7Hmnu.js} +1 -1
- package/console-app/assets/chunk-XXDRQBXY-BLuHuEZN.js +1 -0
- package/console-app/assets/classDiagram-ZZMXUADV-BTYfUi7u.js +1 -0
- package/console-app/assets/classDiagram-v2-VYDZK3BY-BTYfUi7u.js +1 -0
- package/console-app/assets/{cose-bilkent-JH36ORCC-GsQ0JAnL.js → cose-bilkent-JH36ORCC-C6RM8oPO.js} +1 -1
- package/console-app/assets/{cynefin-OW5HDTMX-hZsAZp_5.js → cynefin-OW5HDTMX-COh9rFYY.js} +1 -1
- package/console-app/assets/{cynefinDiagram-5FMLGOSQ-CsyMovx1.js → cynefinDiagram-5FMLGOSQ-Dd9AR17w.js} +1 -1
- package/console-app/assets/{dagre-BP8XEFz-.js → dagre-BDMvDAer.js} +1 -1
- package/console-app/assets/{dagre-GXQ25YYZ-Jg5285rx.js → dagre-GXQ25YYZ-C_nBUPgr.js} +1 -1
- package/console-app/assets/{diagram-S7CK7UJ4-n9JiR8HK.js → diagram-S7CK7UJ4-BGOobQeC.js} +1 -1
- package/console-app/assets/{diagram-UQ7AKVKN-Cde-dgbI.js → diagram-UQ7AKVKN-CAF_vcj0.js} +1 -1
- package/console-app/assets/{diagram-VSXAHHWV-CPZUg4FP.js → diagram-VSXAHHWV-q-aY0Nsc.js} +1 -1
- package/console-app/assets/{diagram-VX7I27RA-B2rCDWvn.js → diagram-VX7I27RA-CnUibSOe.js} +1 -1
- package/console-app/assets/{diagram-Z3DM3KII-UwO0hte3.js → diagram-Z3DM3KII-DY0V5kOJ.js} +1 -1
- package/console-app/assets/{ebnfDiagram-PWID7BFC-BGJ_PBlS.js → ebnfDiagram-PWID7BFC-CXp4CmEF.js} +1 -1
- package/console-app/assets/{erDiagram-RLTQ6QDP-CKsTScr3.js → erDiagram-RLTQ6QDP-CKnfXmPl.js} +1 -1
- package/console-app/assets/eventmodeling-NTZA5JFV-CBfQhnG8.js +1 -0
- package/console-app/assets/flowDiagram-HODETNUW-BnY3G7p6.js +1 -0
- package/console-app/assets/{ganttDiagram-EL5Y4UJY-koeTkIEA.js → ganttDiagram-EL5Y4UJY-D6v_RJ7o.js} +1 -1
- package/console-app/assets/{gitGraph-4MIJSDKK-DyRPbcM4.js → gitGraph-4MIJSDKK-y3kWDddY.js} +1 -1
- package/console-app/assets/{gitGraphDiagram-WWUBYQGX-DSIejrYw.js → gitGraphDiagram-WWUBYQGX-CBaE24KN.js} +1 -1
- package/console-app/assets/{graphlib-BpQ_697T.js → graphlib-DAA_TPmU.js} +1 -1
- package/console-app/assets/{index-Du9_fRSw.js → index-HuTd6kcC.js} +147 -147
- package/console-app/assets/{info-A6RAGUB7-C63f9an_.js → info-A6RAGUB7-BvxfRJ9-.js} +1 -1
- package/console-app/assets/{infoDiagram-27XIBGKW-Dz5gMcUF.js → infoDiagram-27XIBGKW-BlFmgW96.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-5VMMS53U-m-nTAZTH.js → ishikawaDiagram-5VMMS53U-Dpwhnwwq.js} +1 -1
- package/console-app/assets/{journeyDiagram-3NMN7TZE-C7mjFY7i.js → journeyDiagram-3NMN7TZE-iOSeOQma.js} +1 -1
- package/console-app/assets/{kanban-definition-UXKFOSKX-Cm7PqOOP.js → kanban-definition-UXKFOSKX-DFGTB8S5.js} +1 -1
- package/console-app/assets/{line-RZNRGurC.js → line-B_5qZKoM.js} +1 -1
- package/console-app/assets/{linear-C2IGWMlF.js → linear-BmXUYu4J.js} +1 -1
- package/console-app/assets/{mermaid-parser.core-DN1yDqgB.js → mermaid-parser.core-DyPi3Lbr.js} +3 -3
- package/console-app/assets/{mermaid.core-DDRs3TbC.js → mermaid.core-S4y9jX8K.js} +4 -4
- package/console-app/assets/{mindmap-definition-YA3MSWOX-o6riOwlF.js → mindmap-definition-YA3MSWOX-Bl09mCaS.js} +1 -1
- package/console-app/assets/{packet-AYTQ26CC-B89F6gXG.js → packet-AYTQ26CC-B5zoasmU.js} +1 -1
- package/console-app/assets/{pegDiagram-XKGWAZYB-BQ1AAIaV.js → pegDiagram-XKGWAZYB-CAa0SOHf.js} +1 -1
- package/console-app/assets/{pie-WAS4IAKB-CzuwQlQz.js → pie-WAS4IAKB-C91xXCXY.js} +1 -1
- package/console-app/assets/{pieDiagram-E7YTZNPT-DlcGHWGT.js → pieDiagram-E7YTZNPT-CmUHVYwz.js} +1 -1
- package/console-app/assets/{quadrantDiagram-AXDQQJYC-DdITwqw-.js → quadrantDiagram-AXDQQJYC-XWsej4ss.js} +1 -1
- package/console-app/assets/{radar-RG4KPBEZ-DlJ29jAN.js → radar-RG4KPBEZ-B7ieCnSw.js} +1 -1
- package/console-app/assets/{railroad-74A4TZTK-BL49fdM8.js → railroad-74A4TZTK-KTKjMg4U.js} +1 -1
- package/console-app/assets/railroad-abnf-HS5TGJTU-e9AlsYmr.js +1 -0
- package/console-app/assets/railroad-ebnf-LZEXJU2U-BVX8UG1z.js +1 -0
- package/console-app/assets/railroad-peg-WCYAUIDC-BzWQFvD9.js +1 -0
- package/console-app/assets/{railroadDiagram-O6MQD6OU-BNgQGtF5.js → railroadDiagram-O6MQD6OU-oh1FjI2K.js} +1 -1
- package/console-app/assets/{requirementDiagram-BXWQKSXE-48lE_WeD.js → requirementDiagram-BXWQKSXE-D6z7hLfj.js} +1 -1
- package/console-app/assets/{sankeyDiagram-P5KCCOFB-WmTardCP.js → sankeyDiagram-P5KCCOFB-DFb92jfp.js} +1 -1
- package/console-app/assets/{sequenceDiagram-WJ2MYXX4-Bd5cHDMs.js → sequenceDiagram-WJ2MYXX4-BRKj-PG1.js} +1 -1
- package/console-app/assets/{src-BTXg_NtK.js → src-DYBVouJk.js} +1 -1
- package/console-app/assets/{stateDiagram-D77RDMKH-DBoCkqGv.js → stateDiagram-D77RDMKH-BfTLNw5t.js} +1 -1
- package/console-app/assets/stateDiagram-v2-MP3YSRHH-B8sMNnnF.js +1 -0
- package/console-app/assets/{swimlanes-42K2YHIH-lecUPBaK.js → swimlanes-42K2YHIH-DXkNYzX9.js} +1 -1
- package/console-app/assets/swimlanesDiagram-VR7AAH4N-CiZdLDyk.js +8 -0
- package/console-app/assets/{timeline-definition-24CTP7MA-CWq0OWm1.js → timeline-definition-24CTP7MA-B8m2V75P.js} +1 -1
- package/console-app/assets/{treeView-Q6P3EWNA-C7lEeqUz.js → treeView-Q6P3EWNA-BisqOzat.js} +1 -1
- package/console-app/assets/{treemap-WGGIJYW6-Bkx2DAoI.js → treemap-WGGIJYW6-DOxEXpb1.js} +1 -1
- package/console-app/assets/{vennDiagram-4TSXK5OY-Bw_kGRL3.js → vennDiagram-4TSXK5OY-ZeuU7o23.js} +1 -1
- package/console-app/assets/{wardley-WFR3VGLG-V0zki2L0.js → wardley-WFR3VGLG-sspeOMuz.js} +1 -1
- package/console-app/assets/{wardleyDiagram-VM6X3IG4-C5vrwEHM.js → wardleyDiagram-VM6X3IG4-CF2vzNJV.js} +1 -1
- package/console-app/assets/{xychartDiagram-S5SC5T6Z-B9uA0moC.js → xychartDiagram-S5SC5T6Z-BR9XBq3s.js} +1 -1
- package/console-app/index.html +1 -1
- package/dist/.pikku/addon/index.d.ts +1 -1
- package/dist/.pikku/addon/index.js +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
- package/dist/.pikku/agent/index.d.ts +1 -1
- package/dist/.pikku/agent/index.js +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/analytics/index.d.ts +1 -1
- package/dist/.pikku/analytics/index.js +1 -1
- package/dist/.pikku/analytics/pikku-analytics-types.gen.d.ts +1 -1
- package/dist/.pikku/analytics/pikku-analytics-types.gen.js +1 -1
- package/dist/.pikku/auth/index.d.ts +1 -1
- package/dist/.pikku/auth/index.js +1 -1
- package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +1 -1
- package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
- package/dist/.pikku/channel/index.d.ts +1 -1
- package/dist/.pikku/channel/index.js +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/index.d.ts +1 -1
- package/dist/.pikku/cli/index.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +16 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +56 -0
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/error/index.d.ts +1 -1
- package/dist/.pikku/error/index.js +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/function/index.d.ts +1 -1
- package/dist/.pikku/function/index.js +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +59 -2
- package/dist/.pikku/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/gateway/index.d.ts +1 -1
- package/dist/.pikku/gateway/index.js +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
- package/dist/.pikku/http/index.d.ts +1 -1
- package/dist/.pikku/http/index.js +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/mcp/index.d.ts +1 -1
- package/dist/.pikku/mcp/index.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/middleware/index.d.ts +1 -1
- package/dist/.pikku/middleware/index.js +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +1 -1
- package/dist/.pikku/queue/index.d.ts +1 -1
- package/dist/.pikku/queue/index.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
- package/dist/.pikku/scenarios/index.d.ts +1 -1
- package/dist/.pikku/scenarios/index.js +1 -1
- package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/scheduler/index.d.ts +1 -1
- package/dist/.pikku/scheduler/index.js +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +13 -1
- package/dist/.pikku/schemas/schemas/ExamplesAddInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/ExamplesAddOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/ExamplesListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/ExamplesListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/ExamplesShowInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/ExamplesShowOutput.schema.json +1 -0
- package/dist/.pikku/scopes/index.d.ts +1 -1
- package/dist/.pikku/scopes/index.js +1 -1
- package/dist/.pikku/scopes/pikku-flags.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/secrets/index.d.ts +1 -1
- package/dist/.pikku/secrets/index.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/setup/index.d.ts +1 -1
- package/dist/.pikku/setup/index.js +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
- package/dist/.pikku/trigger/index.d.ts +1 -1
- package/dist/.pikku/trigger/index.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/index.d.ts +1 -1
- package/dist/.pikku/variables/index.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/index.d.ts +1 -1
- package/dist/.pikku/workflow/index.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/cli.wiring.js +51 -0
- package/dist/src/examples.gen.d.ts +17 -0
- package/dist/src/examples.gen.js +7 -0
- package/dist/src/fabric/functions/validate.function.d.ts +34 -0
- package/dist/src/fabric/functions/validate.function.js +118 -0
- package/dist/src/fabric/lib/config.d.ts +1 -0
- package/dist/src/fabric/lib/config.js +1 -1
- package/dist/src/functions/commands/dev-address.d.ts +27 -0
- package/dist/src/functions/commands/dev-address.js +45 -0
- package/dist/src/functions/commands/dev.js +6 -0
- package/dist/src/functions/commands/environment.d.ts +8 -0
- package/dist/src/functions/commands/environment.js +15 -0
- package/dist/src/functions/commands/examples.d.ts +170 -0
- package/dist/src/functions/commands/examples.js +28 -0
- package/dist/src/functions/commands/scenario.js +356 -273
- package/dist/src/functions/db/local-db.d.ts +12 -0
- package/dist/src/functions/db/local-db.js +1 -1
- package/dist/src/functions/db/postgres/scenario-baseline.d.ts +3 -0
- package/dist/src/functions/db/postgres/scenario-baseline.js +112 -0
- package/dist/src/functions/db/scenario-baseline.d.ts +51 -0
- package/dist/src/functions/db/scenario-baseline.js +60 -0
- package/dist/src/functions/db/sqlite/scenario-baseline.d.ts +3 -0
- package/dist/src/functions/db/sqlite/scenario-baseline.js +77 -0
- package/dist/src/functions/examples/command-schemas.d.ts +69 -0
- package/dist/src/functions/examples/command-schemas.js +15 -0
- package/dist/src/functions/examples/corpus.d.ts +115 -0
- package/dist/src/functions/examples/corpus.js +307 -0
- package/dist/src/functions/examples/project.d.ts +64 -0
- package/dist/src/functions/examples/project.js +363 -0
- package/dist/src/functions/examples/render.d.ts +4 -0
- package/dist/src/functions/examples/render.js +101 -0
- package/dist/src/functions/examples/run.d.ts +9 -0
- package/dist/src/functions/examples/run.js +242 -0
- package/dist/src/functions/examples/schemas.d.ts +65 -0
- package/dist/src/functions/examples/schemas.js +76 -0
- package/dist/src/functions/surface/render-surface-doc.js +32 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
- package/snippets-meta.json +2 -0
- package/snippets.json +2 -0
- package/surface.json +1 -1
- package/console-app/assets/architecture-7GRP2DOG-BQN972Vc.js +0 -1
- package/console-app/assets/channel-B8xtOmL3.js +0 -1
- package/console-app/assets/chunk-XXDRQBXY-CGWcS5Ol.js +0 -1
- package/console-app/assets/classDiagram-ZZMXUADV-OGsmOlmO.js +0 -1
- package/console-app/assets/classDiagram-v2-VYDZK3BY-OGsmOlmO.js +0 -1
- package/console-app/assets/eventmodeling-NTZA5JFV-CnZOTLz3.js +0 -1
- package/console-app/assets/flowDiagram-HODETNUW-TYMCrte8.js +0 -1
- package/console-app/assets/railroad-abnf-HS5TGJTU-D9Ej_sin.js +0 -1
- package/console-app/assets/railroad-ebnf-LZEXJU2U-CjzlC3qv.js +0 -1
- package/console-app/assets/railroad-peg-WCYAUIDC-BPa6lIrj.js +0 -1
- package/console-app/assets/stateDiagram-v2-MP3YSRHH-BLbaZawL.js +0 -1
- package/console-app/assets/swimlanesDiagram-VR7AAH4N-CM_5HS_7.js +0 -8
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { EXAMPLES } from '../../examples.gen.js';
|
|
4
|
+
import { entityNames, extractExampleApi, extractTeaching, renameActorsInCode, renameEntityInCode, renameEntityInPath, requiredChain, reservedEntityCollision, resolveExamplePath, scenarioRpcNames, splitExampleFiles, stripTeaching, } from './corpus.js';
|
|
5
|
+
import { entityWriteCoverage, generatedTables, nearestTable, personaCast, registeredRpcs, resolveAppBase, } from './project.js';
|
|
6
|
+
const summary = (example) => ({
|
|
7
|
+
name: example.name,
|
|
8
|
+
title: example.title,
|
|
9
|
+
when: example.when,
|
|
10
|
+
lang: example.lang,
|
|
11
|
+
entity: example.entity,
|
|
12
|
+
deferUntil: example.deferUntil,
|
|
13
|
+
});
|
|
14
|
+
export function runExamplesList(group) {
|
|
15
|
+
const examples = group
|
|
16
|
+
? EXAMPLES.filter((e) => e.name.startsWith(group))
|
|
17
|
+
: [...EXAMPLES];
|
|
18
|
+
return { examples: examples.map(summary) };
|
|
19
|
+
}
|
|
20
|
+
/** The project's own source directory a backend recipe's files are rebased onto. */
|
|
21
|
+
function functionsDirOf(project) {
|
|
22
|
+
const first = project.srcDirectories[0];
|
|
23
|
+
if (!first)
|
|
24
|
+
return 'src';
|
|
25
|
+
const rel = first.startsWith(project.rootDir)
|
|
26
|
+
? first.slice(project.rootDir.length).replace(/^[/\\]/, '')
|
|
27
|
+
: first;
|
|
28
|
+
return rel.replace(/\\/g, '/').replace(/^\.\//, '') || 'src';
|
|
29
|
+
}
|
|
30
|
+
export function runExamplesShow(project, name, entity) {
|
|
31
|
+
const empty = {
|
|
32
|
+
name,
|
|
33
|
+
title: '',
|
|
34
|
+
when: '',
|
|
35
|
+
source: '',
|
|
36
|
+
steps: '',
|
|
37
|
+
code: '',
|
|
38
|
+
notes: [],
|
|
39
|
+
available: EXAMPLES.map((e) => e.name),
|
|
40
|
+
};
|
|
41
|
+
const found = EXAMPLES.find((e) => e.name === name);
|
|
42
|
+
if (!found)
|
|
43
|
+
return { found: false, ...empty };
|
|
44
|
+
const from = found.entity ? entityNames(found.entity) : null;
|
|
45
|
+
const to = entity ? entityNames(entity) : null;
|
|
46
|
+
const cast = personaCast(project.srcDirectories);
|
|
47
|
+
const applyRename = (body) => renameActorsInCode(from && to ? renameEntityInCode(body, from, to) : body, cast);
|
|
48
|
+
return {
|
|
49
|
+
found: true,
|
|
50
|
+
...empty,
|
|
51
|
+
title: found.title,
|
|
52
|
+
when: found.when,
|
|
53
|
+
source: found.source,
|
|
54
|
+
steps: found.steps ? applyRename(found.steps) : '',
|
|
55
|
+
code: applyRename(stripTeaching(found.content)),
|
|
56
|
+
notes: extractTeaching(found.content).map((note) => ({
|
|
57
|
+
anchor: note.anchor ? applyRename(note.anchor) : null,
|
|
58
|
+
lines: note.lines.map(applyRename),
|
|
59
|
+
})),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** `ProductsComment` → `products_comment`, the name its migration has to declare. */
|
|
63
|
+
function snakeTable(pascal) {
|
|
64
|
+
return pascal.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The tables a file needs but this project has not generated zod for.
|
|
68
|
+
*
|
|
69
|
+
* The entity gate covers the table the example was asked for. A recipe may also reach for
|
|
70
|
+
* a CHILD of it, and that table exists in no project until someone writes its migration.
|
|
71
|
+
* Written anyway, both its imports resolve to `any` and codegen dies naming the file.
|
|
72
|
+
*/
|
|
73
|
+
function missingTables(body, tables) {
|
|
74
|
+
if (!tables || tables.length === 0)
|
|
75
|
+
return [];
|
|
76
|
+
const imported = /import\s*\{([^}]+)\}\s*from\s*'#pikku\/db\/zod\.gen\.js'/.exec(body)?.[1];
|
|
77
|
+
if (!imported)
|
|
78
|
+
return [];
|
|
79
|
+
const wanted = new Set(imported
|
|
80
|
+
.split(',')
|
|
81
|
+
.map((name) => name
|
|
82
|
+
.trim()
|
|
83
|
+
.split(/\s+as\s+/)[0]
|
|
84
|
+
.replace(/(InsertZ|PatchZ|Z)$/, ''))
|
|
85
|
+
.filter(Boolean));
|
|
86
|
+
return [...wanted].filter((table) => !tables.includes(table));
|
|
87
|
+
}
|
|
88
|
+
const blank = (name, entity) => ({
|
|
89
|
+
ok: false,
|
|
90
|
+
name,
|
|
91
|
+
entity,
|
|
92
|
+
refusal: '',
|
|
93
|
+
written: [],
|
|
94
|
+
kept: [],
|
|
95
|
+
failed: [],
|
|
96
|
+
deferred: [],
|
|
97
|
+
manual: [],
|
|
98
|
+
api: [],
|
|
99
|
+
when: '',
|
|
100
|
+
steps: '',
|
|
101
|
+
notes: [],
|
|
102
|
+
});
|
|
103
|
+
const refuse = (name, entity, refusal) => ({
|
|
104
|
+
...blank(name, entity),
|
|
105
|
+
refusal,
|
|
106
|
+
});
|
|
107
|
+
export function runExamplesAdd(project, name, entity, app) {
|
|
108
|
+
const found = EXAMPLES.find((e) => e.name === name);
|
|
109
|
+
if (!found) {
|
|
110
|
+
return refuse(name, entity ?? '', `No example named "${name}". Run \`pikku examples\` to see what there is.`);
|
|
111
|
+
}
|
|
112
|
+
// A pacing precondition, declared by the recipe rather than configured here: an app
|
|
113
|
+
// whose schema promises tables nobody can create or edit yet does not need an AI
|
|
114
|
+
// surface on top of it. Fails open when there is no schema to measure against.
|
|
115
|
+
if (found.deferUntil === 'entity-write') {
|
|
116
|
+
const { required, uncovered } = entityWriteCoverage(project.rootDir, project.srcDirectories);
|
|
117
|
+
if (required.length > 0 && uncovered.length === required.length) {
|
|
118
|
+
return refuse(name, entity ?? '', `"${name}" declares \`deferUntil: entity-write\`, and none of the ${required.length} table(s) this app's own migrations declare (${required.join(', ')}) has a create or edit path yet. Build one vertical's list + create + edit against a real \`insertInto\`/\`updateTable\` first, then run this again.`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (found.entity && !entity) {
|
|
122
|
+
return refuse(name, '', `"${name}" is written for an example \`${found.entity}\`, and is useless until it is renamed. Run it again with the domain word you mean: \`pikku examples add --name ${name} --entity <name>\`. It then writes its files already named for that entity.`);
|
|
123
|
+
}
|
|
124
|
+
const collision = entity ? reservedEntityCollision(entity) : null;
|
|
125
|
+
if (collision) {
|
|
126
|
+
return refuse(name, entity ?? '', `"${entity}" is reserved — it collides with ${collision}, and the rename would write a table that clobbers it. Use the domain word you actually mean.`);
|
|
127
|
+
}
|
|
128
|
+
const target = resolveAppBase(project.rootDir, app);
|
|
129
|
+
if (!target) {
|
|
130
|
+
return refuse(name, entity ?? '', `There is no app called "${app}" under apps/. Drop --app to write into the primary one.`);
|
|
131
|
+
}
|
|
132
|
+
const from = found.entity ? entityNames(found.entity) : null;
|
|
133
|
+
const to = entity ? entityNames(entity) : null;
|
|
134
|
+
const cast = personaCast(project.srcDirectories);
|
|
135
|
+
const renameCode = (body) => renameActorsInCode(from && to ? renameEntityInCode(body, from, to) : body, cast);
|
|
136
|
+
const renamePath = (path) => from && to ? renameEntityInPath(path, from, to) : path;
|
|
137
|
+
const code = stripTeaching(found.content);
|
|
138
|
+
const tables = code.includes('zod.gen')
|
|
139
|
+
? generatedTables(project.outDir)
|
|
140
|
+
: null;
|
|
141
|
+
if (to && tables && tables.length > 0 && !tables.includes(to.pascal)) {
|
|
142
|
+
const near = nearestTable(to.pascal, tables);
|
|
143
|
+
const shown = tables
|
|
144
|
+
.slice(0, 25)
|
|
145
|
+
.map((t) => t[0].toLowerCase() + t.slice(1));
|
|
146
|
+
return refuse(name, entity ?? '', `"${name}" builds its schemas from the \`${to.pascal}\` table zod, and this project has no such table — every one of its imports would resolve to \`any\` and fail codegen.\n` +
|
|
147
|
+
(near
|
|
148
|
+
? `Did you mean \`--entity ${near[0].toLowerCase() + near.slice(1)}\`?`
|
|
149
|
+
: `Tables it does have: ${shown.join(', ')}${tables.length > shown.length ? `, +${tables.length - shown.length} more` : ''}.\nUse one of those, or write the migration for "${to.camel}" first and run \`pikku db migrate\`.`));
|
|
150
|
+
}
|
|
151
|
+
// A scenario is the one family that is a FORWARD reference: its steps name RPCs at the
|
|
152
|
+
// type level, so a step naming one nobody has written is a type error the instant the
|
|
153
|
+
// file lands — and while codegen is red nothing written afterwards registers.
|
|
154
|
+
const wantedRpcs = scenarioRpcNames(renameCode(code));
|
|
155
|
+
if (wantedRpcs.length > 0) {
|
|
156
|
+
const registered = registeredRpcs(project.outDir);
|
|
157
|
+
const missing = wantedRpcs.filter((rpc) => !registered.includes(rpc));
|
|
158
|
+
if (registered.length > 0 && missing.length > 0) {
|
|
159
|
+
const shown = registered.slice(0, 25);
|
|
160
|
+
return refuse(name, entity ?? '', `"${name}" writes steps that call ${missing.map((r) => `\`${r}\``).join(', ')}, and this project has no such rpc. A scenario names its rpcs at the TYPE level, so the file would fail codegen the moment it lands.\n` +
|
|
161
|
+
`Build the journey first, then come back for the scenario that proves it.\n` +
|
|
162
|
+
`Rpcs it has today: ${shown.join(', ')}${registered.length > shown.length ? `, +${registered.length - shown.length} more` : ''}.`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
const functionsDir = functionsDirOf(project);
|
|
166
|
+
const { install: requiredNames, manual } = requiredChain(found.name, EXAMPLES);
|
|
167
|
+
const requiredEntries = requiredNames
|
|
168
|
+
.map((n) => EXAMPLES.find((e) => e.name === n))
|
|
169
|
+
.filter((e) => e !== undefined);
|
|
170
|
+
// Renamed AFTER the split, never before: a marker line and a body line want opposite
|
|
171
|
+
// precedence for a one-word example, and renaming the whole blob first settles that the
|
|
172
|
+
// wrong way for every destination path.
|
|
173
|
+
const ownFiles = splitExampleFiles(code).map((f) => ({
|
|
174
|
+
...f,
|
|
175
|
+
path: renamePath(f.path),
|
|
176
|
+
body: renameCode(f.body),
|
|
177
|
+
}));
|
|
178
|
+
// A recipe with no `// ===== FILE:` marker has no ONE true destination — where a config
|
|
179
|
+
// block or an auth hook belongs depends on the app. Those are read, not written.
|
|
180
|
+
if (ownFiles.length === 0) {
|
|
181
|
+
return refuse(name, entity ?? '', `"${name}" names no destination file — where it goes depends on how this app is laid out, so writing it would be a guess. Read it with \`pikku examples show --name ${name}${entity ? ` --entity ${entity}` : ''}\` and put it where it belongs.`);
|
|
182
|
+
}
|
|
183
|
+
const result = blank(name, entity ?? '');
|
|
184
|
+
const install = (files) => {
|
|
185
|
+
for (const file of files) {
|
|
186
|
+
const absent = missingTables(file.body, tables);
|
|
187
|
+
if (absent.length > 0) {
|
|
188
|
+
result.deferred.push({
|
|
189
|
+
path: file.path,
|
|
190
|
+
tables: absent.map(snakeTable),
|
|
191
|
+
});
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const relative = resolveExamplePath(file.path, target.base, functionsDir);
|
|
195
|
+
const destination = join(project.rootDir, relative);
|
|
196
|
+
// Never clobber: a file the caller has since customised stays theirs, which is what
|
|
197
|
+
// makes it safe to run this twice.
|
|
198
|
+
if (existsSync(destination) && !file.overwrite) {
|
|
199
|
+
if (!result.kept.includes(relative) &&
|
|
200
|
+
!result.written.includes(relative)) {
|
|
201
|
+
result.kept.push(relative);
|
|
202
|
+
}
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
try {
|
|
206
|
+
mkdirSync(dirname(destination), { recursive: true });
|
|
207
|
+
writeFileSync(destination, file.body);
|
|
208
|
+
result.written.push(relative);
|
|
209
|
+
}
|
|
210
|
+
catch (err) {
|
|
211
|
+
result.failed.push(`${relative} (${err instanceof Error ? err.message : String(err)})`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const requiredFiles = requiredEntries.flatMap((e) => splitExampleFiles(stripTeaching(e.content)));
|
|
216
|
+
install(requiredFiles);
|
|
217
|
+
install(ownFiles);
|
|
218
|
+
const usable = new Set([...result.written, ...result.kept]);
|
|
219
|
+
result.api = [
|
|
220
|
+
...requiredEntries.flatMap((e) => splitExampleFiles(e.content)),
|
|
221
|
+
...splitExampleFiles(found.content).map((f) => ({
|
|
222
|
+
path: renamePath(f.path),
|
|
223
|
+
body: renameCode(f.body),
|
|
224
|
+
})),
|
|
225
|
+
]
|
|
226
|
+
.map((f) => ({
|
|
227
|
+
path: resolveExamplePath(f.path, target.base, functionsDir),
|
|
228
|
+
body: f.body,
|
|
229
|
+
}))
|
|
230
|
+
.filter((f) => usable.has(f.path) && !f.path.includes('.stories.'))
|
|
231
|
+
.map((f) => ({ path: f.path, ...extractExampleApi(f.body) }))
|
|
232
|
+
.filter((f) => f.exports.length > 0);
|
|
233
|
+
result.manual = manual;
|
|
234
|
+
result.when = found.when;
|
|
235
|
+
result.steps = found.steps ? renameCode(found.steps) : '';
|
|
236
|
+
result.notes = extractTeaching(found.content).map((note) => ({
|
|
237
|
+
anchor: note.anchor ? renameCode(note.anchor) : null,
|
|
238
|
+
lines: note.lines.map(renameCode),
|
|
239
|
+
}));
|
|
240
|
+
result.ok = result.failed.length === 0;
|
|
241
|
+
return result;
|
|
242
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ExamplesListInput: z.ZodObject<{
|
|
3
|
+
group: z.ZodOptional<z.ZodString>;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const ExamplesListOutput: z.ZodObject<{
|
|
6
|
+
examples: z.ZodArray<z.ZodObject<{
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
when: z.ZodString;
|
|
10
|
+
lang: z.ZodString;
|
|
11
|
+
entity: z.ZodString;
|
|
12
|
+
deferUntil: z.ZodString;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const ExamplesShowInput: z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
entity: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const ExamplesShowOutput: z.ZodObject<{
|
|
20
|
+
found: z.ZodBoolean;
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
title: z.ZodString;
|
|
23
|
+
when: z.ZodString;
|
|
24
|
+
source: z.ZodString;
|
|
25
|
+
steps: z.ZodString;
|
|
26
|
+
code: z.ZodString;
|
|
27
|
+
notes: z.ZodArray<z.ZodObject<{
|
|
28
|
+
anchor: z.ZodNullable<z.ZodString>;
|
|
29
|
+
lines: z.ZodArray<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
available: z.ZodArray<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export declare const ExamplesAddInput: z.ZodObject<{
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
entity: z.ZodOptional<z.ZodString>;
|
|
36
|
+
app: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const ExamplesAddOutput: z.ZodObject<{
|
|
39
|
+
ok: z.ZodBoolean;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
entity: z.ZodString;
|
|
42
|
+
refusal: z.ZodString;
|
|
43
|
+
written: z.ZodArray<z.ZodString>;
|
|
44
|
+
kept: z.ZodArray<z.ZodString>;
|
|
45
|
+
failed: z.ZodArray<z.ZodString>;
|
|
46
|
+
deferred: z.ZodArray<z.ZodObject<{
|
|
47
|
+
path: z.ZodString;
|
|
48
|
+
tables: z.ZodArray<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
manual: z.ZodArray<z.ZodString>;
|
|
51
|
+
api: z.ZodArray<z.ZodObject<{
|
|
52
|
+
path: z.ZodString;
|
|
53
|
+
exports: z.ZodArray<z.ZodString>;
|
|
54
|
+
declarations: z.ZodArray<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
when: z.ZodString;
|
|
57
|
+
steps: z.ZodString;
|
|
58
|
+
notes: z.ZodArray<z.ZodObject<{
|
|
59
|
+
anchor: z.ZodNullable<z.ZodString>;
|
|
60
|
+
lines: z.ZodArray<z.ZodString>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type ExamplesListResult = z.infer<typeof ExamplesListOutput>;
|
|
64
|
+
export type ExamplesShowResult = z.infer<typeof ExamplesShowOutput>;
|
|
65
|
+
export type ExamplesAddResult = z.infer<typeof ExamplesAddOutput>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The `pikku examples` schemas, declared here rather than beside the wired functions.
|
|
4
|
+
*
|
|
5
|
+
* The CLI bootstraps with the PUBLISHED inspector, which has to be able to IMPORT the
|
|
6
|
+
* schema a command declares. A command file imports `#pikku`, which points at build
|
|
7
|
+
* output that does not exist yet while the bootstrap is running — so a schema the
|
|
8
|
+
* inspector must read cannot live in one. Same reason the knowledge schemas sit in their
|
|
9
|
+
* own file.
|
|
10
|
+
*/
|
|
11
|
+
const ExampleSummary = z.object({
|
|
12
|
+
name: z.string(),
|
|
13
|
+
title: z.string(),
|
|
14
|
+
when: z.string(),
|
|
15
|
+
lang: z.string(),
|
|
16
|
+
entity: z.string(),
|
|
17
|
+
deferUntil: z.string(),
|
|
18
|
+
});
|
|
19
|
+
export const ExamplesListInput = z.object({
|
|
20
|
+
group: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Only the examples whose name starts with this, e.g. `scenario`'),
|
|
24
|
+
});
|
|
25
|
+
export const ExamplesListOutput = z.object({
|
|
26
|
+
examples: z.array(ExampleSummary),
|
|
27
|
+
});
|
|
28
|
+
export const ExamplesShowInput = z.object({
|
|
29
|
+
name: z.string(),
|
|
30
|
+
entity: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Rewrite the example's domain symbol into this one before printing"),
|
|
34
|
+
});
|
|
35
|
+
export const ExamplesShowOutput = z.object({
|
|
36
|
+
found: z.boolean(),
|
|
37
|
+
name: z.string(),
|
|
38
|
+
title: z.string(),
|
|
39
|
+
when: z.string(),
|
|
40
|
+
source: z.string(),
|
|
41
|
+
steps: z.string(),
|
|
42
|
+
code: z.string(),
|
|
43
|
+
notes: z.array(z.object({ anchor: z.string().nullable(), lines: z.array(z.string()) })),
|
|
44
|
+
available: z.array(z.string()),
|
|
45
|
+
});
|
|
46
|
+
export const ExamplesAddInput = z.object({
|
|
47
|
+
name: z.string(),
|
|
48
|
+
entity: z
|
|
49
|
+
.string()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("The domain symbol to rename the example's own onto"),
|
|
52
|
+
app: z
|
|
53
|
+
.string()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('Which frontend a screen belongs to, for a project with more than one'),
|
|
56
|
+
});
|
|
57
|
+
export const ExamplesAddOutput = z.object({
|
|
58
|
+
ok: z.boolean(),
|
|
59
|
+
name: z.string(),
|
|
60
|
+
entity: z.string(),
|
|
61
|
+
/** Why nothing was written. A refusal is the whole answer; every other field is empty. */
|
|
62
|
+
refusal: z.string(),
|
|
63
|
+
written: z.array(z.string()),
|
|
64
|
+
kept: z.array(z.string()),
|
|
65
|
+
failed: z.array(z.string()),
|
|
66
|
+
deferred: z.array(z.object({ path: z.string(), tables: z.array(z.string()) })),
|
|
67
|
+
manual: z.array(z.string()),
|
|
68
|
+
api: z.array(z.object({
|
|
69
|
+
path: z.string(),
|
|
70
|
+
exports: z.array(z.string()),
|
|
71
|
+
declarations: z.array(z.string()),
|
|
72
|
+
})),
|
|
73
|
+
when: z.string(),
|
|
74
|
+
steps: z.string(),
|
|
75
|
+
notes: z.array(z.object({ anchor: z.string().nullable(), lines: z.array(z.string()) })),
|
|
76
|
+
});
|
|
@@ -172,11 +172,41 @@ const renderSymbol = (symbol, leaf, home, ai) => {
|
|
|
172
172
|
}
|
|
173
173
|
return lines.join('\n').trimEnd();
|
|
174
174
|
};
|
|
175
|
+
/**
|
|
176
|
+
* Words in an identifier, however it was spelled: `PikkuScenarioWire` and
|
|
177
|
+
* `pikku-scenario-wire` both come back as pikku, scenario, wire.
|
|
178
|
+
*/
|
|
179
|
+
const words = (name) => name
|
|
180
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
181
|
+
.toLowerCase()
|
|
182
|
+
.split(/[^a-z0-9]+/)
|
|
183
|
+
.filter(Boolean);
|
|
184
|
+
/**
|
|
185
|
+
* A guessed name is almost never a substring of a real one — `PikkuScenarioWire`
|
|
186
|
+
* is contained in nothing, so whole-string matching offered no suggestion in the
|
|
187
|
+
* one case a suggestion is worth anything. Rank by shared words instead, which
|
|
188
|
+
* puts `PikkuBrowserWire` and `TypedScenario` in front of that guess.
|
|
189
|
+
*/
|
|
175
190
|
const near = (target, candidates) => {
|
|
176
191
|
const needle = target.toLowerCase();
|
|
192
|
+
const wanted = new Set(words(target));
|
|
177
193
|
return candidates
|
|
178
|
-
.
|
|
179
|
-
|
|
194
|
+
.map((candidate) => {
|
|
195
|
+
const own = words(candidate);
|
|
196
|
+
const shared = own.filter((word) => wanted.has(word)).length;
|
|
197
|
+
const contains = candidate.toLowerCase().includes(needle);
|
|
198
|
+
return {
|
|
199
|
+
candidate,
|
|
200
|
+
score: shared + (contains ? wanted.size : 0),
|
|
201
|
+
extra: own.length - shared,
|
|
202
|
+
};
|
|
203
|
+
})
|
|
204
|
+
.filter((entry) => entry.score > 0)
|
|
205
|
+
.sort((a, b) => b.score - a.score ||
|
|
206
|
+
a.extra - b.extra ||
|
|
207
|
+
a.candidate.localeCompare(b.candidate))
|
|
208
|
+
.slice(0, 5)
|
|
209
|
+
.map((entry) => entry.candidate);
|
|
180
210
|
};
|
|
181
211
|
export const renderSurfaceDoc = (doc, { target, ai = false, entryPoint = 'app' } = {}) => {
|
|
182
212
|
const leaves = appEntryPoint(doc, entryPoint).leaves;
|