@pikku/cli 0.12.144 → 0.12.151
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 +1 -0
- package/console-app/assets/{abnfDiagram-N423BO3Z-BIPJyOId.js → abnfDiagram-VCTEODGH-UPW1PlxM.js} +1 -1
- package/console-app/assets/architecture-7GRP2DOG-BQN972Vc.js +1 -0
- package/console-app/assets/architectureDiagram-5GKGNRK7-B3XFrvZk.js +36 -0
- package/console-app/assets/blockDiagram-I7D4REHJ-Ca0v9UJQ.js +129 -0
- package/console-app/assets/c4Diagram-7LVT6UL2-CLewVsj_.js +38 -0
- package/console-app/assets/channel-B8xtOmL3.js +1 -0
- package/console-app/assets/chunk-4HAMMTFA-BwhbhOD9.js +62 -0
- package/console-app/assets/{chunk-NSK5VX7P-VK0slsok.js → chunk-75Z2AOVW-C7nAgNk0.js} +1 -1
- package/console-app/assets/chunk-DU6HZSFF-D4yYAcHt.js +127 -0
- package/console-app/assets/{chunk-2GRJ4B5K-pBREt5-Y.js → chunk-F27PBJKO-UHllOPps.js} +1 -1
- package/console-app/assets/{chunk-KEIR6QF5-BICK3FdT.js → chunk-FOHPRMQF-CoA4358r.js} +9 -9
- package/console-app/assets/chunk-GMAD6QVW-C0l_vm7T.js +72 -0
- package/console-app/assets/chunk-GVQU2GXP-h-H2Oird.js +1 -0
- package/console-app/assets/{chunk-5RXB4S5H-wo8Xtqiv.js → chunk-IMKFNOWR-DJ_W9CSg.js} +2 -2
- package/console-app/assets/chunk-L3NEJ4N5-Ce9oniwE.js +1 -0
- package/console-app/assets/chunk-OSK3NFVY-CdGE5qxS.js +10 -0
- package/console-app/assets/chunk-P2QGCYS3-DK1pHDdz.js +1 -0
- package/console-app/assets/{chunk-KBJHAD2P-PiPaopal.js → chunk-POPQ4Y6H-DjevEFNo.js} +1 -1
- package/console-app/assets/{chunk-4I5QYGJK-SmJ1Rqsn.js → chunk-PWAF6VOD-BVF5N1No.js} +1 -1
- package/console-app/assets/chunk-SHT3W25Y-BX8We-wN.js +168 -0
- package/console-app/assets/{chunk-6Q2QTUOP-B6uqaxr0.js → chunk-SVP7TREG-Cl0GgAPC.js} +1 -1
- package/console-app/assets/{chunk-GF5L2VYU-Cw7tsTe6.js → chunk-TICWLB2K-IWZAWDhu.js} +2 -2
- package/console-app/assets/chunk-XXDRQBXY-CGWcS5Ol.js +1 -0
- package/console-app/assets/classDiagram-ZZMXUADV-OGsmOlmO.js +1 -0
- package/console-app/assets/classDiagram-v2-VYDZK3BY-OGsmOlmO.js +1 -0
- package/console-app/assets/cose-bilkent-JH36ORCC-GsQ0JAnL.js +1 -0
- package/console-app/assets/cynefin-OW5HDTMX-hZsAZp_5.js +1 -0
- package/console-app/assets/{cynefinDiagram-MW4NZA55-BzFWEf8Y.js → cynefinDiagram-5FMLGOSQ-CsyMovx1.js} +1 -1
- package/console-app/assets/cytoscape.esm-B-1iW2ft.js +321 -0
- package/console-app/assets/dagre-BP8XEFz-.js +1 -0
- package/console-app/assets/dagre-GXQ25YYZ-Jg5285rx.js +4 -0
- package/console-app/assets/{diagram-7IWD3JNH-C58VaHJt.js → diagram-S7CK7UJ4-n9JiR8HK.js} +4 -4
- package/console-app/assets/{diagram-UB23O5K3-CmRNd5vm.js → diagram-UQ7AKVKN-Cde-dgbI.js} +1 -1
- package/console-app/assets/{diagram-B4RE2ZJO-B3w3TcXn.js → diagram-VSXAHHWV-CPZUg4FP.js} +1 -1
- package/console-app/assets/{diagram-Q27KOJAE-7oaP3D-d.js → diagram-VX7I27RA-B2rCDWvn.js} +1 -1
- package/console-app/assets/{diagram-LBJQPF4R-L1ZkDsab.js → diagram-Z3DM3KII-UwO0hte3.js} +1 -1
- package/console-app/assets/{ebnfDiagram-BXEA7PRR-D0rxzLaa.js → ebnfDiagram-PWID7BFC-BGJ_PBlS.js} +1 -1
- package/console-app/assets/erDiagram-RLTQ6QDP-CKsTScr3.js +99 -0
- package/console-app/assets/eventmodeling-NTZA5JFV-CnZOTLz3.js +1 -0
- package/console-app/assets/flowDiagram-HODETNUW-TYMCrte8.js +1 -0
- package/console-app/assets/ganttDiagram-EL5Y4UJY-koeTkIEA.js +292 -0
- package/console-app/assets/gitGraph-4MIJSDKK-DyRPbcM4.js +1 -0
- package/console-app/assets/{gitGraphDiagram-DS77QQ5N-JaW7OYCY.js → gitGraphDiagram-WWUBYQGX-DSIejrYw.js} +1 -1
- package/console-app/assets/graphlib-BpQ_697T.js +1 -0
- package/console-app/assets/index-BbJGr-r1.css +1 -0
- package/console-app/assets/index-Du9_fRSw.js +262 -0
- package/console-app/assets/info-A6RAGUB7-C63f9an_.js +1 -0
- package/console-app/assets/{infoDiagram-6WML65LV-DIbMcTbW.js → infoDiagram-27XIBGKW-Dz5gMcUF.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-WSZJBQD7-mozqgfxi.js → ishikawaDiagram-5VMMS53U-m-nTAZTH.js} +1 -1
- package/console-app/assets/{journeyDiagram-NVQOT4AX-CKDrjPz5.js → journeyDiagram-3NMN7TZE-C7mjFY7i.js} +2 -2
- package/console-app/assets/{kanban-definition-27J2QSJJ-B9shPbST.js → kanban-definition-UXKFOSKX-Cm7PqOOP.js} +2 -2
- package/console-app/assets/{katex-CXMH3UgJ.js → katex-ZlcWpGUi.js} +2 -2
- package/console-app/assets/{line-DLrnl2PN.js → line-RZNRGurC.js} +1 -1
- package/console-app/assets/linear-C2IGWMlF.js +1 -0
- package/console-app/assets/{mermaid-parser.core-ElI_yw4f.js → mermaid-parser.core-DN1yDqgB.js} +3 -3
- package/console-app/assets/mermaid.core-DDRs3TbC.js +44 -0
- package/console-app/assets/{mindmap-definition-FAOFIHXS-BTvmLZE7.js → mindmap-definition-YA3MSWOX-o6riOwlF.js} +1 -1
- package/console-app/assets/packet-AYTQ26CC-B89F6gXG.js +1 -0
- package/console-app/assets/{pegDiagram-VL7TDLO6-1hBiUSmO.js → pegDiagram-XKGWAZYB-BQ1AAIaV.js} +1 -1
- package/console-app/assets/pie-WAS4IAKB-CzuwQlQz.js +1 -0
- package/console-app/assets/{pieDiagram-7S7Q4E2Y-vvgYfdFq.js → pieDiagram-E7YTZNPT-DlcGHWGT.js} +1 -1
- package/console-app/assets/{quadrantDiagram-CIZ2JOQS-B_emxK6O.js → quadrantDiagram-AXDQQJYC-DdITwqw-.js} +1 -1
- package/console-app/assets/radar-RG4KPBEZ-DlJ29jAN.js +1 -0
- package/console-app/assets/railroad-74A4TZTK-BL49fdM8.js +1 -0
- package/console-app/assets/railroad-abnf-HS5TGJTU-D9Ej_sin.js +1 -0
- package/console-app/assets/railroad-ebnf-LZEXJU2U-CjzlC3qv.js +1 -0
- package/console-app/assets/railroad-peg-WCYAUIDC-BPa6lIrj.js +1 -0
- package/console-app/assets/{railroadDiagram-AXF67PYL-IXXj_KlB.js → railroadDiagram-O6MQD6OU-BNgQGtF5.js} +1 -1
- package/console-app/assets/{requirementDiagram-LRYGKXZP-B15ZEbec.js → requirementDiagram-BXWQKSXE-48lE_WeD.js} +2 -2
- package/console-app/assets/{sankeyDiagram-W5VNT64P-w-sj_WN8.js → sankeyDiagram-P5KCCOFB-WmTardCP.js} +1 -1
- package/console-app/assets/{sequenceDiagram-SI44F4Z6-BP1UgEbX.js → sequenceDiagram-WJ2MYXX4-Bd5cHDMs.js} +1 -1
- package/console-app/assets/src-BTXg_NtK.js +1 -0
- package/console-app/assets/{stateDiagram-OKZ733FA-DE4L-y3n.js → stateDiagram-D77RDMKH-DBoCkqGv.js} +1 -1
- package/console-app/assets/stateDiagram-v2-MP3YSRHH-BLbaZawL.js +1 -0
- package/console-app/assets/swimlanes-42K2YHIH-lecUPBaK.js +1 -0
- package/console-app/assets/swimlanesDiagram-VR7AAH4N-CM_5HS_7.js +8 -0
- package/console-app/assets/{timeline-definition-Z64GVDOM-Cc8M2qee.js → timeline-definition-24CTP7MA-CWq0OWm1.js} +1 -1
- package/console-app/assets/treeView-Q6P3EWNA-C7lEeqUz.js +1 -0
- package/console-app/assets/treemap-WGGIJYW6-Bkx2DAoI.js +1 -0
- package/console-app/assets/{vennDiagram-T6HMQDX7-dpGyGzMg.js → vennDiagram-4TSXK5OY-Bw_kGRL3.js} +1 -1
- package/console-app/assets/wardley-WFR3VGLG-V0zki2L0.js +1 -0
- package/console-app/assets/{wardleyDiagram-T6FBY63Y-CBvRf8GJ.js → wardleyDiagram-VM6X3IG4-C5vrwEHM.js} +1 -1
- package/console-app/assets/{xychartDiagram-ELKLHX3M-UlPqx-ve.js → xychartDiagram-S5SC5T6Z-B9uA0moC.js} +3 -3
- package/console-app/index.html +2 -3
- 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 +6 -6
- package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/analytics/index.d.ts +7 -0
- package/dist/.pikku/analytics/index.js +7 -0
- package/dist/.pikku/analytics/pikku-analytics-types.gen.d.ts +5 -0
- package/dist/.pikku/analytics/pikku-analytics-types.gen.js +4 -0
- package/dist/.pikku/auth/auth.types.d.ts +1 -1
- package/dist/.pikku/auth/auth.types.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 +3 -3
- 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.d.ts +7 -7
- package/dist/.pikku/cli/pikku-cli-channel.js +31 -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-contracts-meta.gen.json +170 -0
- 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 +170 -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 +8 -7
- 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 +235 -27
- package/dist/.pikku/function/pikku-functions.gen.js +9 -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 +5 -1
- package/dist/.pikku/pikku-services.gen.js +4 -0
- 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 +10 -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.d.ts +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 +31 -1
- package/dist/.pikku/schemas/schemas/FabricChangesAskInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesAskOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesClaimInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesClaimOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesDoneInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesDoneOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesShotInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesShotOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesShowInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricChangesShowOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricFindingsListOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricProjectsListOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricPublishOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricRollbackOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricSecretsDeleteOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/FabricSecretsRotateOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuAnalyticsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuFeatureFlagsScaffoldOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuFlagsInput.schema.json +1 -0
- package/dist/.pikku/scopes/index.d.ts +2 -1
- package/dist/.pikku/scopes/index.js +2 -1
- package/dist/.pikku/scopes/pikku-flags-meta.gen.json +1 -0
- package/dist/.pikku/scopes/pikku-flags.gen.d.ts +41 -0
- package/dist/.pikku/scopes/pikku-flags.gen.js +34 -0
- package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +2 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +2 -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 +2 -2
- 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/meta/allWorkflow.gen.json +42 -6
- 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/deploy/analyzer/analyzer.d.ts +8 -1
- package/dist/src/deploy/analyzer/analyzer.js +212 -52
- package/dist/src/deploy/analyzer/grouping.d.ts +57 -0
- package/dist/src/deploy/analyzer/grouping.js +148 -0
- package/dist/src/deploy/analyzer/index.d.ts +1 -0
- package/dist/src/deploy/analyzer/naming.d.ts +1 -0
- package/dist/src/deploy/analyzer/naming.js +9 -0
- package/dist/src/deploy/build-pipeline.d.ts +2 -0
- package/dist/src/deploy/build-pipeline.js +24 -0
- package/dist/src/fabric/fabric-commands.d.ts +323 -138
- package/dist/src/fabric/fabric-commands.js +135 -0
- package/dist/src/fabric/functions/add.function.d.ts +3 -3
- package/dist/src/fabric/functions/addon-verify.function.d.ts +9 -9
- package/dist/src/fabric/functions/changes-ask.function.d.ts +34 -0
- package/dist/src/fabric/functions/changes-ask.function.js +30 -0
- package/dist/src/fabric/functions/changes-claim.function.d.ts +50 -0
- package/dist/src/fabric/functions/changes-claim.function.js +43 -0
- package/dist/src/fabric/functions/changes-done.function.d.ts +55 -0
- package/dist/src/fabric/functions/changes-done.function.js +59 -0
- package/dist/src/fabric/functions/changes-list.function.d.ts +60 -0
- package/dist/src/fabric/functions/changes-list.function.js +82 -0
- package/dist/src/fabric/functions/changes-shot.function.d.ts +66 -0
- package/dist/src/fabric/functions/changes-shot.function.js +56 -0
- package/dist/src/fabric/functions/changes-show.function.d.ts +41 -0
- package/dist/src/fabric/functions/changes-show.function.js +80 -0
- package/dist/src/fabric/functions/db-schema.function.d.ts +3 -3
- package/dist/src/fabric/functions/deploy-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/deploy-units.function.d.ts +3 -3
- package/dist/src/fabric/functions/deploy.function.d.ts +12 -12
- package/dist/src/fabric/functions/deploy.function.js +6 -5
- package/dist/src/fabric/functions/domains-add.function.d.ts +7 -7
- package/dist/src/fabric/functions/domains-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/domains-remove.function.d.ts +3 -3
- package/dist/src/fabric/functions/errors.function.d.ts +3 -3
- package/dist/src/fabric/functions/findings-clear.function.d.ts +3 -3
- package/dist/src/fabric/functions/findings-flush.function.d.ts +3 -3
- package/dist/src/fabric/functions/findings-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/init.function.d.ts +3 -3
- package/dist/src/fabric/functions/link.function.d.ts +3 -3
- package/dist/src/fabric/functions/link.function.js +3 -2
- package/dist/src/fabric/functions/llm-key.function.d.ts +9 -9
- package/dist/src/fabric/functions/login.function.d.ts +3 -3
- package/dist/src/fabric/functions/logs.function.d.ts +3 -3
- package/dist/src/fabric/functions/logs.function.js +2 -1
- package/dist/src/fabric/functions/metrics.function.d.ts +3 -3
- package/dist/src/fabric/functions/projects-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/publish.function.d.ts +3 -3
- package/dist/src/fabric/functions/report.function.d.ts +15 -15
- package/dist/src/fabric/functions/rollback.function.d.ts +9 -9
- package/dist/src/fabric/functions/secrets-delete.function.d.ts +3 -3
- package/dist/src/fabric/functions/secrets-list.function.d.ts +3 -3
- package/dist/src/fabric/functions/secrets-rotate.function.d.ts +3 -3
- package/dist/src/fabric/functions/secrets-set.function.d.ts +3 -3
- package/dist/src/fabric/functions/smoke.function.d.ts +3 -3
- package/dist/src/fabric/functions/status.function.d.ts +3 -3
- package/dist/src/fabric/functions/trace.function.d.ts +3 -3
- package/dist/src/fabric/functions/validate.function.d.ts +7 -7
- package/dist/src/fabric/functions/variables-get.function.d.ts +3 -3
- package/dist/src/fabric/functions/variables-set.function.d.ts +6 -6
- package/dist/src/fabric/lib/changes.d.ts +38 -0
- package/dist/src/fabric/lib/changes.js +70 -0
- package/dist/src/fabric/lib/errors.d.ts +21 -0
- package/dist/src/fabric/lib/errors.js +21 -0
- package/dist/src/fabric/lib/finding.d.ts +3 -3
- package/dist/src/fabric/lib/git.d.ts +3 -2
- package/dist/src/fabric/lib/git.js +10 -8
- package/dist/src/fabric/lib/output.d.ts +20 -0
- package/dist/src/fabric/lib/output.js +32 -7
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/audit.d.ts +1 -1
- package/dist/src/functions/commands/binary.d.ts +3 -3
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +3 -0
- package/dist/src/functions/commands/db-audit.d.ts +1 -1
- package/dist/src/functions/commands/db-baseline.d.ts +1 -1
- package/dist/src/functions/commands/db-check.d.ts +1 -1
- package/dist/src/functions/commands/db-codegen.d.ts +1 -1
- package/dist/src/functions/commands/db-export.d.ts +1 -1
- package/dist/src/functions/commands/db-generate.d.ts +1 -1
- package/dist/src/functions/commands/db-migrate.d.ts +1 -1
- package/dist/src/functions/commands/db-reset.d.ts +3 -3
- package/dist/src/functions/commands/deploy-apply.d.ts +3 -3
- package/dist/src/functions/commands/deploy-apply.js +36 -3
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/deploy-plan.d.ts +3 -3
- package/dist/src/functions/commands/deploy-plan.js +2 -0
- package/dist/src/functions/commands/dev-agent-runner.d.ts +9 -7
- package/dist/src/functions/commands/dev-agent-runner.js +56 -12
- package/dist/src/functions/commands/dev.d.ts +3 -3
- package/dist/src/functions/commands/dev.js +60 -6
- package/dist/src/functions/commands/dist.d.ts +3 -3
- package/dist/src/functions/commands/dist.js +2 -9
- package/dist/src/functions/commands/doc.d.ts +3 -3
- package/dist/src/functions/commands/emails-init.d.ts +1 -1
- package/dist/src/functions/commands/enable.d.ts +9 -9
- package/dist/src/functions/commands/import-n8n.d.ts +3 -3
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/init-or-warn.d.ts +19 -0
- package/dist/src/functions/commands/init-or-warn.js +25 -0
- package/dist/src/functions/commands/knowledge-index.d.ts +6 -6
- package/dist/src/functions/commands/knowledge-plan.d.ts +15 -15
- package/dist/src/functions/commands/knowledge-reconcile.d.ts +6 -6
- package/dist/src/functions/commands/knowledge-validate.d.ts +6 -6
- package/dist/src/functions/commands/login.d.ts +7 -7
- package/dist/src/functions/commands/meta.d.ts +34 -34
- package/dist/src/functions/commands/new-addon.d.ts +3 -3
- package/dist/src/functions/commands/new-function.d.ts +3 -3
- package/dist/src/functions/commands/new-middleware.d.ts +3 -3
- package/dist/src/functions/commands/new-permission.d.ts +3 -3
- package/dist/src/functions/commands/new-wiring.d.ts +3 -3
- package/dist/src/functions/commands/persona-sync.d.ts +3 -3
- package/dist/src/functions/commands/persona.d.ts +7 -7
- package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/roles-audit.d.ts +1 -1
- package/dist/src/functions/commands/roles-prune.d.ts +3 -3
- package/dist/src/functions/commands/scenario.d.ts +7 -7
- package/dist/src/functions/commands/scopes-audit.d.ts +1 -1
- package/dist/src/functions/commands/scopes-prune.d.ts +3 -3
- package/dist/src/functions/commands/semver.d.ts +1 -1
- package/dist/src/functions/commands/serve.d.ts +3 -3
- package/dist/src/functions/commands/serve.js +40 -3
- package/dist/src/functions/commands/skills.d.ts +6 -6
- package/dist/src/functions/commands/update.d.ts +1 -1
- package/dist/src/functions/commands/validate.d.ts +6 -6
- package/dist/src/functions/commands/versions-check.d.ts +1 -1
- package/dist/src/functions/commands/versions-init.d.ts +3 -3
- package/dist/src/functions/commands/versions-update.d.ts +1 -1
- package/dist/src/functions/commands/watch.d.ts +3 -3
- package/dist/src/functions/db/zod-codegen.d.ts +19 -19
- package/dist/src/functions/knowledge/schemas.d.ts +5 -5
- package/dist/src/functions/runtimes/fetch/index.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -1
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -1
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +1 -1
- package/dist/src/functions/surface/build-surface-doc.js +1 -1
- package/dist/src/functions/surface/surface-doc.types.d.ts +1 -1
- package/dist/src/functions/surface/surface-editorial.js +5 -0
- package/dist/src/functions/validate/pikku-barrel-checks.js +2 -22
- package/dist/src/functions/validate/validate.d.ts +2 -2
- package/dist/src/functions/validate/websocket-deps-checks.d.ts +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-agent.d.ts +1 -1
- package/dist/src/functions/wirings/agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/agent-scorer/pikku-command-agent-scorer.d.ts +1 -1
- package/dist/src/functions/wirings/analytics/pikku-command-analytics.d.ts +11 -0
- package/dist/src/functions/wirings/analytics/pikku-command-analytics.js +66 -0
- package/dist/src/functions/wirings/analytics/serialize-analytics.d.ts +30 -0
- package/dist/src/functions/wirings/analytics/serialize-analytics.js +141 -0
- package/dist/src/functions/wirings/auth/pikku-command-auth.d.ts +3 -3
- package/dist/src/functions/wirings/auth/pikku-command-auth.js +2 -6
- package/dist/src/functions/wirings/auth/serialize-auth-gen.d.ts +1 -1
- package/dist/src/functions/wirings/auth/serialize-auth-gen.js +15 -36
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/emails/pikku-command-emails.d.ts +1 -1
- package/dist/src/functions/wirings/errors/pikku-command-error-types.d.ts +1 -1
- package/dist/src/functions/wirings/flags/pikku-command-feature-flags-scaffold.d.ts +1 -0
- package/dist/src/functions/wirings/flags/pikku-command-feature-flags-scaffold.js +36 -0
- package/dist/src/functions/wirings/flags/pikku-command-flags.d.ts +7 -0
- package/dist/src/functions/wirings/flags/pikku-command-flags.js +36 -0
- package/dist/src/functions/wirings/flags/serialize-feature-flags-scaffold.d.ts +13 -0
- package/dist/src/functions/wirings/flags/serialize-feature-flags-scaffold.js +73 -0
- package/dist/src/functions/wirings/flags/serialize-flags-types.d.ts +14 -0
- package/dist/src/functions/wirings/flags/serialize-flags-types.js +68 -0
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +3 -3
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-leaf-indexes.d.ts +2 -2
- package/dist/src/functions/wirings/functions/pikku-command-leaf-indexes.js +2 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +9 -2
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +9 -4
- package/dist/src/functions/wirings/gateway/pikku-command-gateway-types.d.ts +3 -3
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
- package/dist/src/functions/wirings/graph/pikku-command-graph-wirings.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.d.ts +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -1
- package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +4 -3
- package/dist/src/functions/wirings/package/pikku-command-package-types.js +14 -1
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/package/serialize-package-types.d.ts +1 -0
- package/dist/src/functions/wirings/package/serialize-package-types.js +15 -0
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- package/dist/src/functions/wirings/personas/pikku-command-personas.d.ts +3 -3
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -1
- package/dist/src/functions/wirings/remote-jobs/pikku-command-remote-jobs.d.ts +1 -1
- package/dist/src/functions/wirings/roles/pikku-command-roles.d.ts +3 -3
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-react-query.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +3 -3
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.d.ts +1 -1
- package/dist/src/functions/wirings/scopes/pikku-command-scopes.d.ts +3 -3
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +3 -3
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.d.ts +1 -1
- package/dist/src/functions/wirings/variables/pikku-command-variables.d.ts +1 -1
- package/dist/src/functions/wirings/virtual-user/pikku-command-virtual-user-functions.d.ts +1 -1
- package/dist/src/functions/wirings/webhook/pikku-command-webhook.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +1 -1
- package/dist/src/functions/workflows/all.workflow.js +34 -9
- package/dist/src/services.js +7 -0
- package/dist/src/utils/analytics-schemas-file.d.ts +6 -0
- package/dist/src/utils/analytics-schemas-file.js +9 -0
- package/dist/src/utils/file-import-path.js +4 -1
- package/dist/src/utils/pikku-cli-config.d.ts +2 -2
- package/dist/src/utils/pikku-cli-config.js +28 -0
- package/dist/src/utils/remove-legacy-scaffold-file.js +4 -0
- package/dist/src/utils/resolve-from-project.d.ts +5 -0
- package/dist/src/utils/resolve-from-project.js +8 -2
- package/dist/src/utils/tsc-check.d.ts +11 -15
- package/dist/src/utils/tsc-check.js +97 -86
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -25
- package/snippets.json +1 -1
- package/surface.json +743 -27
- package/CHANGELOG.md +0 -9599
- package/console-app/assets/HelpPanel-nYO2hRY5.js +0 -1
- package/console-app/assets/architecture-TIHT7OUA-B-c05-x5.js +0 -1
- package/console-app/assets/architectureDiagram-T3A2C74G-BAH1O4B7.js +0 -36
- package/console-app/assets/blockDiagram-VBNYF7ZC-T3kmcPgj.js +0 -132
- package/console-app/assets/c4Diagram-5PPSVZJV-DRva89Br.js +0 -10
- package/console-app/assets/channel-DJ3jfSNX.js +0 -1
- package/console-app/assets/chunk-7BUUIJ7U-Bb538aSH.js +0 -1
- package/console-app/assets/chunk-7Z6QIM7H-uxzNGOHh.js +0 -10
- package/console-app/assets/chunk-I66GZJ75-DksrbEtn.js +0 -127
- package/console-app/assets/chunk-JQJVKLGR-BnRvPhDK.js +0 -156
- package/console-app/assets/chunk-QR6OTTB3-CgQotuzQ.js +0 -62
- package/console-app/assets/chunk-RYQCIY6F-Cei0abOq.js +0 -1
- package/console-app/assets/chunk-UBXNYLIW-B55XJk4O.js +0 -1
- package/console-app/assets/chunk-W5SLKNZC-gFa01tuI.js +0 -1
- package/console-app/assets/chunk-WRU74C26-C3ESZQ-F.js +0 -70
- package/console-app/assets/chunk-XXDRQBXY-D0tL6SVk.js +0 -1
- package/console-app/assets/classDiagram-JCYQIIEL-BqEwCDi8.js +0 -1
- package/console-app/assets/classDiagram-v2-OCEON4UE-BqEwCDi8.js +0 -1
- package/console-app/assets/cose-bilkent-JH36ORCC-CUxqwjs-.js +0 -1
- package/console-app/assets/cynefin-VYW2F7L2-Dh1yOBBs.js +0 -1
- package/console-app/assets/cytoscape.esm-B-NFISlW.js +0 -321
- package/console-app/assets/dagre-DKjebq_c.js +0 -1
- package/console-app/assets/dagre-VZM6K2ZE-BllFBMe9.js +0 -4
- package/console-app/assets/erDiagram-JOGREHBK-Bg0FPLS0.js +0 -85
- package/console-app/assets/eventmodeling-45OFAUF4-CVovwmpS.js +0 -1
- package/console-app/assets/flowDiagram-UKHOOZJN-DwRgEyXD.js +0 -1
- package/console-app/assets/ganttDiagram-PKOTCBZU-BBxxHrPG.js +0 -292
- package/console-app/assets/gitGraph-TEB2WS4Q-Cn1MjFvM.js +0 -1
- package/console-app/assets/graphlib-IlWVLY3o.js +0 -1
- package/console-app/assets/index-C8MC-uMB.css +0 -1
- package/console-app/assets/index-Deds7K2I.js +0 -290
- package/console-app/assets/info-DKCQHKI2-C2R7hV-y.js +0 -1
- package/console-app/assets/isUndefined-T4snU1Mx.js +0 -1
- package/console-app/assets/linear-BQOZezXu.js +0 -1
- package/console-app/assets/map-BmPfXn7V.js +0 -1
- package/console-app/assets/mermaid.core-B02bSmuz.js +0 -42
- package/console-app/assets/packet-7NZHBO7P-CkYMF0Cd.js +0 -1
- package/console-app/assets/pie-RZYD4A2V-BFMvieVM.js +0 -1
- package/console-app/assets/radar-I7S5WNFK-C_2tp7_w.js +0 -1
- package/console-app/assets/railroad-3IZDKUUU-DwlFJLv5.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-Cyu_rpdZ.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-BLiwK-H7.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-BUDTDYmP.js +0 -1
- package/console-app/assets/src-BI35UZf8.js +0 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-BsP8TwKV.js +0 -1
- package/console-app/assets/swimlanes-SLNWSIFB-DvAJxCGQ.js +0 -2
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-BAXO3Id2.js +0 -8
- package/console-app/assets/treeView-QDETBFTQ-DnlS0s0_.js +0 -1
- package/console-app/assets/treemap-6X3UGDF4-CiUoxlJe.js +0 -1
- package/console-app/assets/wardley-OPB4EBWU-DrTySJtR.js +0 -1
- package/dist/.pikku/console/index.d.ts +0 -1
- package/dist/.pikku/console/index.js +0 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +0 -6
- package/dist/.pikku/console/pikku-node-types.gen.js +0 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +0 -7
- package/dist/.pikku/pikku-meta-service.gen.js +0 -9
- package/dist/.pikku/pikku-types.gen.d.ts +0 -17
- package/dist/.pikku/pikku-types.gen.js +0 -28
- package/dist/.pikku/workflow/pikku-personas.gen.d.ts +0 -15
- package/dist/.pikku/workflow/pikku-personas.gen.js +0 -17
- package/dist/src/functions/surface/collect-surface.d.ts +0 -58
- package/dist/src/functions/surface/collect-surface.js +0 -613
- /package/console-app/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
* Gateways (MCP, agents, channels) dispatch to function units via RPC.
|
|
7
7
|
* Workflow orchestrators dispatch to step units via queue or RPC (inline).
|
|
8
8
|
*/
|
|
9
|
-
import { resolveDeployTarget, } from '@pikku/inspector';
|
|
9
|
+
import { incompatibleServicesFor, resolveDeployTarget, } from '@pikku/inspector';
|
|
10
10
|
import { relative } from 'node:path';
|
|
11
11
|
import { isScenarioFunction, withoutScenarios, withoutScenarioWorkflows, } from '../../functions/wirings/scenarios/scenario-partition.js';
|
|
12
|
+
import { toSafeKebab } from './naming.js';
|
|
13
|
+
import { createUnitResolver } from './grouping.js';
|
|
12
14
|
export function analyzeDeployment(state, options) {
|
|
13
15
|
const serverlessIncompatible = new Set(options.serverlessIncompatible ?? []);
|
|
14
16
|
const defaultTarget = options.defaultTarget ?? 'serverless';
|
|
@@ -30,6 +32,110 @@ export function analyzeDeployment(state, options) {
|
|
|
30
32
|
const functionsMeta = withoutScenarios(state.functions.meta);
|
|
31
33
|
const graphMeta = withoutScenarioWorkflows(state.workflows.graphMeta);
|
|
32
34
|
const httpMeta = state.http.meta;
|
|
35
|
+
const tagIndex = buildFunctionTagIndex(state, functionsMeta);
|
|
36
|
+
const tagsFor = (funcId) => tagIndex.get(funcId) ?? [];
|
|
37
|
+
const resolver = createUnitResolver(options.grouping, {
|
|
38
|
+
routesForFunction: (funcId) => collectHttpRoutes(httpMeta, funcId).flatMap((r) => [
|
|
39
|
+
r.route,
|
|
40
|
+
prefixed(r.route),
|
|
41
|
+
]),
|
|
42
|
+
tagsForFunction: tagsFor,
|
|
43
|
+
servicesForFunction: (funcId) => functionsMeta[funcId]?.services?.services ?? [],
|
|
44
|
+
targetForFunction: (funcId) => {
|
|
45
|
+
const funcMeta = functionsMeta[funcId];
|
|
46
|
+
return funcMeta
|
|
47
|
+
? resolveDeployTarget(funcMeta, serverlessIncompatible, funcId, defaultTarget)
|
|
48
|
+
: defaultTarget;
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const addFunctionUnit = (unit) => {
|
|
52
|
+
// Set here rather than at each call site: a unit is created from six
|
|
53
|
+
// places (functions, channels, agents, MCP, workflow orchestrators, steps)
|
|
54
|
+
// and a unit missing its key reads as one the strategy never named.
|
|
55
|
+
if (!unit.servicesKey) {
|
|
56
|
+
const key = resolver.serviceKeyForUnit(unit.name);
|
|
57
|
+
if (key)
|
|
58
|
+
unit.servicesKey = key;
|
|
59
|
+
}
|
|
60
|
+
const existing = units.find((u) => u.name === unit.name);
|
|
61
|
+
if (!existing) {
|
|
62
|
+
units.push(unit);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (existing.target !== unit.target) {
|
|
66
|
+
const rule = resolver.ruleForUnit(unit.name);
|
|
67
|
+
throw new Error(`deploy.grouping: unit "${unit.name}" would hold both serverless and server functions ` +
|
|
68
|
+
`(${existing.functionIds.join(', ')} vs ${unit.functionIds.join(', ')}). ` +
|
|
69
|
+
(rule
|
|
70
|
+
? `Give the server-target functions their own rule, or drop them from "${unit.name}".`
|
|
71
|
+
: `A grouping rule cannot change a function's target.`));
|
|
72
|
+
}
|
|
73
|
+
for (const id of unit.functionIds) {
|
|
74
|
+
if (!existing.functionIds.includes(id)) {
|
|
75
|
+
existing.functionIds.push(id);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
for (const service of unit.services) {
|
|
79
|
+
if (!existing.services.some((s) => s.capability === service.capability &&
|
|
80
|
+
s.sourceServiceName === service.sourceServiceName)) {
|
|
81
|
+
existing.services.push(service);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
for (const dep of unit.dependsOn) {
|
|
85
|
+
if (dep !== existing.name && !existing.dependsOn.includes(dep)) {
|
|
86
|
+
existing.dependsOn.push(dep);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
for (const tag of unit.tags) {
|
|
90
|
+
if (!existing.tags.includes(tag)) {
|
|
91
|
+
existing.tags.push(tag);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (unit.targetForcedBy?.length) {
|
|
95
|
+
const forcedBy = existing.targetForcedBy ?? [];
|
|
96
|
+
for (const svc of unit.targetForcedBy) {
|
|
97
|
+
if (!forcedBy.includes(svc)) {
|
|
98
|
+
forcedBy.push(svc);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
existing.targetForcedBy = forcedBy;
|
|
102
|
+
}
|
|
103
|
+
for (const handler of unit.handlers) {
|
|
104
|
+
if (handler.type === 'fetch') {
|
|
105
|
+
const fetchHandler = existing.handlers.find((h) => h.type === 'fetch');
|
|
106
|
+
if (fetchHandler) {
|
|
107
|
+
fetchHandler.routes.push(...handler.routes);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
existing.handlers.push(handler);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
existing.handlers.push(handler);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (unit.invokedAgents?.length) {
|
|
118
|
+
const merged = new Set([
|
|
119
|
+
...(existing.invokedAgents ?? []),
|
|
120
|
+
...unit.invokedAgents,
|
|
121
|
+
]);
|
|
122
|
+
existing.invokedAgents = [...merged];
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const unitFunctionIds = new Map();
|
|
126
|
+
const unitFor = (funcId) => {
|
|
127
|
+
const name = resolver.forFunction(funcId);
|
|
128
|
+
const existing = unitFunctionIds.get(name);
|
|
129
|
+
if (existing) {
|
|
130
|
+
if (!existing.includes(funcId)) {
|
|
131
|
+
existing.push(funcId);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
unitFunctionIds.set(name, [funcId]);
|
|
136
|
+
}
|
|
137
|
+
return name;
|
|
138
|
+
};
|
|
33
139
|
// ── Step 1: Create function units ──────────────────────────────────
|
|
34
140
|
// Each function gets one unit. Collect all its triggers.
|
|
35
141
|
for (const [funcId, funcMeta] of entries(functionsMeta)) {
|
|
@@ -70,7 +176,7 @@ export function analyzeDeployment(state, options) {
|
|
|
70
176
|
handlers.push({ type: 'queue', queueName: queueMeta.name ?? queueName });
|
|
71
177
|
queues.push({
|
|
72
178
|
name: queueMeta.name ?? queueName,
|
|
73
|
-
consumerUnit:
|
|
179
|
+
consumerUnit: unitFor(funcId),
|
|
74
180
|
consumerFunctionId: funcId,
|
|
75
181
|
});
|
|
76
182
|
}
|
|
@@ -86,7 +192,7 @@ export function analyzeDeployment(state, options) {
|
|
|
86
192
|
scheduledTasks.push({
|
|
87
193
|
name: schedMeta.name,
|
|
88
194
|
schedule: schedMeta.schedule,
|
|
89
|
-
unitName:
|
|
195
|
+
unitName: unitFor(funcId),
|
|
90
196
|
functionId: funcId,
|
|
91
197
|
});
|
|
92
198
|
}
|
|
@@ -128,16 +234,21 @@ export function analyzeDeployment(state, options) {
|
|
|
128
234
|
continue;
|
|
129
235
|
}
|
|
130
236
|
const invokedAgents = collectInvokedAgents(state, funcId);
|
|
131
|
-
|
|
132
|
-
|
|
237
|
+
const unitName = unitFor(funcId);
|
|
238
|
+
const groupedBy = resolver.ruleForUnit(unitName);
|
|
239
|
+
const forcedBy = incompatibleServicesFor(funcMeta, serverlessIncompatible);
|
|
240
|
+
addFunctionUnit({
|
|
241
|
+
name: unitName,
|
|
133
242
|
role: 'function',
|
|
134
243
|
target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId, defaultTarget),
|
|
135
244
|
functionIds: [funcId],
|
|
136
245
|
services: withAgentServices(collectServicesForFunction(funcMeta), invokedAgents),
|
|
137
246
|
dependsOn: [],
|
|
138
247
|
handlers,
|
|
139
|
-
tags:
|
|
248
|
+
tags: tagsFor(funcId),
|
|
140
249
|
...(invokedAgents.length > 0 && { invokedAgents }),
|
|
250
|
+
...(groupedBy && { groupedBy }),
|
|
251
|
+
...(forcedBy.length > 0 && { targetForcedBy: forcedBy }),
|
|
141
252
|
});
|
|
142
253
|
}
|
|
143
254
|
// ── Step 1b: Addon units ───────────────────────────────────────────
|
|
@@ -147,11 +258,13 @@ export function analyzeDeployment(state, options) {
|
|
|
147
258
|
if (exposed.length === 0) {
|
|
148
259
|
continue;
|
|
149
260
|
}
|
|
150
|
-
const unitName =
|
|
261
|
+
const unitName = resolver.forAddon(namespace);
|
|
262
|
+
const addonGroupedBy = resolver.ruleForUnit(unitName);
|
|
151
263
|
const addonIncompatible = new Set(state.addonServerlessIncompatible?.get(namespace) ?? []);
|
|
152
264
|
const routes = [];
|
|
153
265
|
const functionIds = [];
|
|
154
266
|
const services = [];
|
|
267
|
+
const addonForcedBy = [];
|
|
155
268
|
let target = defaultTarget;
|
|
156
269
|
for (const [funcName, funcMeta] of exposed) {
|
|
157
270
|
const rpcName = `${namespace}:${funcName}`;
|
|
@@ -172,11 +285,16 @@ export function analyzeDeployment(state, options) {
|
|
|
172
285
|
services.push(service);
|
|
173
286
|
}
|
|
174
287
|
}
|
|
288
|
+
for (const svc of incompatibleServicesFor(funcMeta, addonIncompatible)) {
|
|
289
|
+
if (!addonForcedBy.includes(svc)) {
|
|
290
|
+
addonForcedBy.push(svc);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
175
293
|
if (resolveDeployTarget(funcMeta, addonIncompatible, rpcName, defaultTarget) === 'server') {
|
|
176
294
|
target = 'server';
|
|
177
295
|
}
|
|
178
296
|
}
|
|
179
|
-
|
|
297
|
+
addFunctionUnit({
|
|
180
298
|
name: unitName,
|
|
181
299
|
role: 'function',
|
|
182
300
|
target,
|
|
@@ -185,6 +303,8 @@ export function analyzeDeployment(state, options) {
|
|
|
185
303
|
dependsOn: [],
|
|
186
304
|
handlers: [{ type: 'fetch', routes }],
|
|
187
305
|
tags: [],
|
|
306
|
+
...(addonGroupedBy && { groupedBy: addonGroupedBy }),
|
|
307
|
+
...(addonForcedBy.length > 0 && { targetForcedBy: addonForcedBy }),
|
|
188
308
|
});
|
|
189
309
|
}
|
|
190
310
|
// ── Step 2: Agent gateways ─────────────────────────────────────────
|
|
@@ -193,7 +313,7 @@ export function analyzeDeployment(state, options) {
|
|
|
193
313
|
const subAgentNames = agentMeta.agents ?? [];
|
|
194
314
|
const unitName = `agent-${toSafeKebab(agentName)}`;
|
|
195
315
|
// Agent gateway depends on its tool function units
|
|
196
|
-
const toolUnitNames = toolIds.map((id) =>
|
|
316
|
+
const toolUnitNames = toolIds.map((id) => unitFor(id));
|
|
197
317
|
const subAgentUnitNames = subAgentNames.map((sa) => `agent-${toSafeKebab(sa)}`);
|
|
198
318
|
// Agent needs AI services
|
|
199
319
|
const agentServices = agentServiceRequirements();
|
|
@@ -271,7 +391,7 @@ export function analyzeDeployment(state, options) {
|
|
|
271
391
|
const allMcpIds = [...mcpToolIds, ...mcpResourceIds, ...mcpPromptIds];
|
|
272
392
|
if (allMcpIds.length > 0) {
|
|
273
393
|
const unitName = 'mcp-server';
|
|
274
|
-
const mcpFuncUnitNames = allMcpIds.map((id) =>
|
|
394
|
+
const mcpFuncUnitNames = allMcpIds.map((id) => unitFor(id));
|
|
275
395
|
units.push({
|
|
276
396
|
name: unitName,
|
|
277
397
|
role: 'mcp',
|
|
@@ -280,7 +400,7 @@ export function analyzeDeployment(state, options) {
|
|
|
280
400
|
services: [],
|
|
281
401
|
dependsOn: mcpFuncUnitNames,
|
|
282
402
|
handlers: [{ type: 'fetch', routes: [] }],
|
|
283
|
-
tags: collectTags(allMcpIds,
|
|
403
|
+
tags: collectTags(allMcpIds, tagsFor),
|
|
284
404
|
});
|
|
285
405
|
mcpEndpoints.push({
|
|
286
406
|
unitName,
|
|
@@ -295,7 +415,7 @@ export function analyzeDeployment(state, options) {
|
|
|
295
415
|
if (funcIds.length === 0)
|
|
296
416
|
continue;
|
|
297
417
|
const unitName = `channel-${toSafeKebab(channelName)}`;
|
|
298
|
-
const funcUnitNames = funcIds.map((id) =>
|
|
418
|
+
const funcUnitNames = funcIds.map((id) => unitFor(id));
|
|
299
419
|
units.push({
|
|
300
420
|
name: unitName,
|
|
301
421
|
role: 'channel',
|
|
@@ -314,34 +434,35 @@ export function analyzeDeployment(state, options) {
|
|
|
314
434
|
});
|
|
315
435
|
}
|
|
316
436
|
// ── Step 5: Workflows ──────────────────────────────────────────────
|
|
317
|
-
buildWorkflows(graphMeta, functionsMeta, { ...state.rpc?.exposedMeta, ...state.rpc?.internalMeta }, httpMeta, units, workflows, queues, workflowQueues);
|
|
437
|
+
buildWorkflows(graphMeta, functionsMeta, { ...state.rpc?.exposedMeta, ...state.rpc?.internalMeta }, httpMeta, units, workflows, queues, workflowQueues, unitFor);
|
|
318
438
|
// ── Step 6: Ensure function units exist for gateway dependencies ───
|
|
319
439
|
// Gateways depend on function units. If a function is only used via
|
|
320
440
|
// a gateway (not directly wired to HTTP/queue/cron), it still needs
|
|
321
441
|
// a unit with a fetch handler for RPC access.
|
|
322
|
-
const existingUnitNames = new Set(units.map((u) => u.name));
|
|
323
442
|
const unitsSnapshot = Array.from(units);
|
|
324
443
|
for (const unit of unitsSnapshot) {
|
|
325
444
|
for (const dep of unit.dependsOn) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
445
|
+
for (const funcId of unitFunctionIds.get(dep) ?? []) {
|
|
446
|
+
const existing = units.find((u) => u.name === dep);
|
|
447
|
+
if (existing?.functionIds.includes(funcId)) {
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
329
450
|
const funcMeta = functionsMeta[funcId];
|
|
330
|
-
if (funcMeta) {
|
|
331
|
-
|
|
332
|
-
units.push({
|
|
333
|
-
name: dep,
|
|
334
|
-
role: 'function',
|
|
335
|
-
target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId, defaultTarget),
|
|
336
|
-
functionIds: [funcId],
|
|
337
|
-
services: withAgentServices(collectServicesForFunction(funcMeta), invokedAgents),
|
|
338
|
-
dependsOn: [],
|
|
339
|
-
handlers: [{ type: 'fetch', routes: [] }],
|
|
340
|
-
tags: funcMeta.tags ?? [],
|
|
341
|
-
...(invokedAgents.length > 0 && { invokedAgents }),
|
|
342
|
-
});
|
|
343
|
-
existingUnitNames.add(dep);
|
|
451
|
+
if (!funcMeta) {
|
|
452
|
+
continue;
|
|
344
453
|
}
|
|
454
|
+
const invokedAgents = collectInvokedAgents(state, funcId);
|
|
455
|
+
addFunctionUnit({
|
|
456
|
+
name: dep,
|
|
457
|
+
role: 'function',
|
|
458
|
+
target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId, defaultTarget),
|
|
459
|
+
functionIds: [funcId],
|
|
460
|
+
services: withAgentServices(collectServicesForFunction(funcMeta), invokedAgents),
|
|
461
|
+
dependsOn: [],
|
|
462
|
+
handlers: [{ type: 'fetch', routes: [] }],
|
|
463
|
+
tags: tagsFor(funcId),
|
|
464
|
+
...(invokedAgents.length > 0 && { invokedAgents }),
|
|
465
|
+
});
|
|
345
466
|
}
|
|
346
467
|
}
|
|
347
468
|
}
|
|
@@ -557,7 +678,7 @@ export function analyzeDeployment(state, options) {
|
|
|
557
678
|
// ---------------------------------------------------------------------------
|
|
558
679
|
// Workflow builder
|
|
559
680
|
// ---------------------------------------------------------------------------
|
|
560
|
-
function buildWorkflows(graphMeta, functionsMeta, rpcMeta, _httpMeta, units, workflows, queues, workflowQueues) {
|
|
681
|
+
function buildWorkflows(graphMeta, functionsMeta, rpcMeta, _httpMeta, units, workflows, queues, workflowQueues, unitFor) {
|
|
561
682
|
for (const [_wfName, graph] of entries(graphMeta)) {
|
|
562
683
|
const steps = [];
|
|
563
684
|
const stepUnitNames = [];
|
|
@@ -566,7 +687,7 @@ function buildWorkflows(graphMeta, functionsMeta, rpcMeta, _httpMeta, units, wor
|
|
|
566
687
|
continue;
|
|
567
688
|
if (!('rpcName' in node))
|
|
568
689
|
continue;
|
|
569
|
-
const stepUnitName =
|
|
690
|
+
const stepUnitName = unitFor(node.rpcName);
|
|
570
691
|
// Step dispatch is decided per-function: a step runs inline unless its
|
|
571
692
|
// function is marked `workflowQueued: true` (then it dispatches via queue).
|
|
572
693
|
const stepFuncId = rpcMeta[node.rpcName] ?? node.rpcName;
|
|
@@ -654,7 +775,7 @@ function buildWorkflows(graphMeta, functionsMeta, rpcMeta, _httpMeta, units, wor
|
|
|
654
775
|
const stepQueueName = `wf-step-${toSafeKebab(step.functionId)}`;
|
|
655
776
|
queues.push({
|
|
656
777
|
name: stepQueueName,
|
|
657
|
-
consumerUnit:
|
|
778
|
+
consumerUnit: unitFor(step.functionId),
|
|
658
779
|
consumerFunctionId: `pikkuWorkflowWorker:${step.functionId}`,
|
|
659
780
|
});
|
|
660
781
|
}
|
|
@@ -797,32 +918,71 @@ function collectChannelFunctionIds(channelMeta) {
|
|
|
797
918
|
// ---------------------------------------------------------------------------
|
|
798
919
|
// Naming helpers
|
|
799
920
|
// ---------------------------------------------------------------------------
|
|
800
|
-
export
|
|
801
|
-
return str
|
|
802
|
-
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
803
|
-
.replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')
|
|
804
|
-
.replace(/[:/\\]/g, '-')
|
|
805
|
-
.replace(/--+/g, '-')
|
|
806
|
-
.replace(/^-|-$/g, '')
|
|
807
|
-
.toLowerCase();
|
|
808
|
-
}
|
|
809
|
-
function fromKebab(str) {
|
|
810
|
-
return str.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
811
|
-
}
|
|
921
|
+
export { toSafeKebab } from './naming.js';
|
|
812
922
|
// ---------------------------------------------------------------------------
|
|
813
923
|
// Tag helpers
|
|
814
924
|
// ---------------------------------------------------------------------------
|
|
815
|
-
function collectTags(funcIds,
|
|
925
|
+
function collectTags(funcIds, tagsFor) {
|
|
816
926
|
const tags = new Set();
|
|
817
927
|
for (const id of funcIds) {
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
for (const tag of meta.tags)
|
|
821
|
-
tags.add(tag);
|
|
822
|
-
}
|
|
928
|
+
for (const tag of tagsFor(id))
|
|
929
|
+
tags.add(tag);
|
|
823
930
|
}
|
|
824
931
|
return [...tags];
|
|
825
932
|
}
|
|
933
|
+
/**
|
|
934
|
+
* Every tag that applies to a function, from the function itself and from every
|
|
935
|
+
* wiring that reaches it.
|
|
936
|
+
*
|
|
937
|
+
* Tags are almost always written on the wiring — `wireHTTP({ tags: ['todos'] })`
|
|
938
|
+
* — not on the `pikkuFunc`, so reading `FunctionMeta.tags` alone sees nothing in
|
|
939
|
+
* a typical project. `deploy.grouping` matches on the tags a user actually
|
|
940
|
+
* wrote, which means the union.
|
|
941
|
+
*/
|
|
942
|
+
function buildFunctionTagIndex(state, functionsMeta) {
|
|
943
|
+
const index = new Map();
|
|
944
|
+
const add = (funcId, tags) => {
|
|
945
|
+
if (!funcId || !tags?.length)
|
|
946
|
+
return;
|
|
947
|
+
let set = index.get(funcId);
|
|
948
|
+
if (!set) {
|
|
949
|
+
set = new Set();
|
|
950
|
+
index.set(funcId, set);
|
|
951
|
+
}
|
|
952
|
+
for (const tag of tags)
|
|
953
|
+
set.add(tag);
|
|
954
|
+
};
|
|
955
|
+
for (const [funcId, meta] of entries(functionsMeta)) {
|
|
956
|
+
add(funcId, meta.tags);
|
|
957
|
+
}
|
|
958
|
+
for (const method of HTTP_METHODS) {
|
|
959
|
+
const methodRoutes = state.http?.meta?.[method];
|
|
960
|
+
if (!methodRoutes)
|
|
961
|
+
continue;
|
|
962
|
+
for (const routeMeta of values(methodRoutes)) {
|
|
963
|
+
add(routeMeta.pikkuFuncId, routeMeta.tags);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
for (const meta of values(state.queueWorkers?.meta ?? {})) {
|
|
967
|
+
add(meta.pikkuFuncId, meta.tags);
|
|
968
|
+
}
|
|
969
|
+
for (const meta of values(state.scheduledTasks?.meta ?? {})) {
|
|
970
|
+
add(meta.pikkuFuncId, meta.tags);
|
|
971
|
+
}
|
|
972
|
+
for (const meta of [
|
|
973
|
+
...values(state.mcpEndpoints?.toolsMeta ?? {}),
|
|
974
|
+
...values(state.mcpEndpoints?.resourcesMeta ?? {}),
|
|
975
|
+
...values(state.mcpEndpoints?.promptsMeta ?? {}),
|
|
976
|
+
]) {
|
|
977
|
+
add(meta.pikkuFuncId, meta.tags);
|
|
978
|
+
}
|
|
979
|
+
for (const channelMeta of values(state.channels?.meta ?? {})) {
|
|
980
|
+
for (const funcId of collectChannelFunctionIds(channelMeta)) {
|
|
981
|
+
add(funcId, channelMeta.tags);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return new Map([...index].map(([funcId, tags]) => [funcId, [...tags]]));
|
|
985
|
+
}
|
|
826
986
|
// ---------------------------------------------------------------------------
|
|
827
987
|
// Typed iteration helpers
|
|
828
988
|
// ---------------------------------------------------------------------------
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { GroupingRule } from '@pikku/deploy';
|
|
2
|
+
export type GroupingStrategy = 'function' | 'single' | 'services';
|
|
3
|
+
export type { GroupingRule } from '@pikku/deploy';
|
|
4
|
+
export interface GroupingConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Defaults to `'services'`: one unit per distinct service combination. The
|
|
7
|
+
* alternatives are `'function'` (one unit per function — the smallest bundles
|
|
8
|
+
* and the most of them) and `'single'` (everything in one).
|
|
9
|
+
*/
|
|
10
|
+
strategy?: GroupingStrategy;
|
|
11
|
+
rules?: GroupingRule[];
|
|
12
|
+
}
|
|
13
|
+
export interface UnitResolverInput {
|
|
14
|
+
routesForFunction: (funcId: string) => string[];
|
|
15
|
+
tagsForFunction: (funcId: string) => string[];
|
|
16
|
+
/**
|
|
17
|
+
* The singleton services the function's own body destructures. Only used by
|
|
18
|
+
* `strategy: 'services'`, which keys a unit on this set.
|
|
19
|
+
*/
|
|
20
|
+
servicesForFunction: (funcId: string) => string[];
|
|
21
|
+
/**
|
|
22
|
+
* Where the function runs. Part of the `strategy: 'services'` key, because a
|
|
23
|
+
* target is not always implied by the services: a function carrying no
|
|
24
|
+
* serverless-incompatible service can still name `deploy: 'server'` itself,
|
|
25
|
+
* and merging it with a serverless function that happens to build the same
|
|
26
|
+
* services is the one grouping a target refusal exists to stop.
|
|
27
|
+
*/
|
|
28
|
+
targetForFunction: (funcId: string) => 'serverless' | 'server';
|
|
29
|
+
}
|
|
30
|
+
export interface UnitResolver {
|
|
31
|
+
forFunction: (funcId: string) => string;
|
|
32
|
+
forAddon: (namespace: string) => string;
|
|
33
|
+
isGrouped: boolean;
|
|
34
|
+
ruleForUnit: (unitName: string) => GroupingRule | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The service set that named a unit under `strategy: 'services'`, or
|
|
37
|
+
* undefined for a unit that came from a rule or from one-per-function. The
|
|
38
|
+
* manifest's own `services` list cannot stand in for it: that list is keyed
|
|
39
|
+
* by capability, so `workflowService` and `workflowRunService` both arrive as
|
|
40
|
+
* `workflow-state` and two genuinely different units read as identical.
|
|
41
|
+
*/
|
|
42
|
+
serviceKeyForUnit: (unitName: string) => string[] | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The distinguishing services in a set: what is left once the services every
|
|
46
|
+
* unit gets regardless are removed. This is the grouping key.
|
|
47
|
+
*/
|
|
48
|
+
export declare const serviceKey: (services: string[]) => string[];
|
|
49
|
+
/**
|
|
50
|
+
* The unit name for one service set. Names the services themselves so a plan
|
|
51
|
+
* reads as what each unit builds; a set too long to spell out keeps the first
|
|
52
|
+
* few names and a digest of the whole set, which stays stable for that exact
|
|
53
|
+
* set and distinct from every other.
|
|
54
|
+
*/
|
|
55
|
+
export declare const serviceUnitName: (services: string[], target?: 'serverless' | 'server') => string;
|
|
56
|
+
export declare const validateGrouping: (config: GroupingConfig) => void;
|
|
57
|
+
export declare const createUnitResolver: (config: GroupingConfig | undefined, input: UnitResolverInput) => UnitResolver;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { toSafeKebab } from './naming.js';
|
|
3
|
+
const SINGLE_UNIT_NAME = 'app';
|
|
4
|
+
/**
|
|
5
|
+
* One unit per distinct service combination. `'function'` gives a deployment
|
|
6
|
+
* as many units as it has functions, which is a cold start and a deploy step
|
|
7
|
+
* each for bundles that mostly build the same services.
|
|
8
|
+
*/
|
|
9
|
+
const DEFAULT_STRATEGY = 'services';
|
|
10
|
+
/**
|
|
11
|
+
* Services every unit is given regardless of what it holds, so they say nothing
|
|
12
|
+
* about which functions belong together. `config`, `logger`, `variables`,
|
|
13
|
+
* `schema` and `secrets` are written into every generated services map as
|
|
14
|
+
* `defaultServices`; `rpc`, `mcp`, `channel` and `userSession` are the
|
|
15
|
+
* per-request services the inspector already excludes from tree-shaking.
|
|
16
|
+
*
|
|
17
|
+
* Only the base set is subtracted. A service that happens to be app-wide today
|
|
18
|
+
* — `auth` under a declared auth definition, say — is left in the key on
|
|
19
|
+
* purpose: it is constant, so it cannot split a partition, and dropping it
|
|
20
|
+
* would make the unit name lie about what the unit builds.
|
|
21
|
+
*/
|
|
22
|
+
const BASE_SERVICES = new Set([
|
|
23
|
+
'config',
|
|
24
|
+
'logger',
|
|
25
|
+
'variables',
|
|
26
|
+
'schema',
|
|
27
|
+
'secrets',
|
|
28
|
+
'rpc',
|
|
29
|
+
'mcp',
|
|
30
|
+
'channel',
|
|
31
|
+
'userSession',
|
|
32
|
+
]);
|
|
33
|
+
const SERVICE_UNIT_PREFIX = 'svc';
|
|
34
|
+
/** Kept short enough to survive a provider's own name length limits. */
|
|
35
|
+
const SERVICE_UNIT_NAME_LIMIT = 58;
|
|
36
|
+
/**
|
|
37
|
+
* The distinguishing services in a set: what is left once the services every
|
|
38
|
+
* unit gets regardless are removed. This is the grouping key.
|
|
39
|
+
*/
|
|
40
|
+
export const serviceKey = (services) => [...new Set(services)].filter((service) => !BASE_SERVICES.has(service)).sort();
|
|
41
|
+
/**
|
|
42
|
+
* The unit name for one service set. Names the services themselves so a plan
|
|
43
|
+
* reads as what each unit builds; a set too long to spell out keeps the first
|
|
44
|
+
* few names and a digest of the whole set, which stays stable for that exact
|
|
45
|
+
* set and distinct from every other.
|
|
46
|
+
*/
|
|
47
|
+
export const serviceUnitName = (services, target = 'serverless') => {
|
|
48
|
+
const suffix = target === 'server' ? '-server' : '';
|
|
49
|
+
const key = serviceKey(services);
|
|
50
|
+
if (key.length === 0) {
|
|
51
|
+
return `${SERVICE_UNIT_PREFIX}-base${suffix}`;
|
|
52
|
+
}
|
|
53
|
+
const full = `${SERVICE_UNIT_PREFIX}-${key.map(toSafeKebab).join('-')}${suffix}`;
|
|
54
|
+
if (full.length <= SERVICE_UNIT_NAME_LIMIT) {
|
|
55
|
+
return full;
|
|
56
|
+
}
|
|
57
|
+
const digest = createHash('sha256')
|
|
58
|
+
.update(key.join(','))
|
|
59
|
+
.digest('hex')
|
|
60
|
+
.slice(0, 6);
|
|
61
|
+
const room = SERVICE_UNIT_NAME_LIMIT - digest.length - suffix.length - 1;
|
|
62
|
+
return `${full.slice(0, room).replace(/-+$/, '')}-${digest}${suffix}`;
|
|
63
|
+
};
|
|
64
|
+
const routeMatcher = (pattern) => {
|
|
65
|
+
const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&');
|
|
66
|
+
return new RegExp(`^${escaped.replace(/\*/g, '.*')}$`);
|
|
67
|
+
};
|
|
68
|
+
export const validateGrouping = (config) => {
|
|
69
|
+
const rules = config.rules ?? [];
|
|
70
|
+
const seen = new Set();
|
|
71
|
+
for (const rule of rules) {
|
|
72
|
+
if (!rule.unit) {
|
|
73
|
+
throw new Error(`deploy.grouping: every rule needs a "unit" name (offending rule: ${JSON.stringify(rule)})`);
|
|
74
|
+
}
|
|
75
|
+
if (seen.has(rule.unit)) {
|
|
76
|
+
throw new Error(`deploy.grouping: two rules both name the unit "${rule.unit}". Merge them into one rule.`);
|
|
77
|
+
}
|
|
78
|
+
seen.add(rule.unit);
|
|
79
|
+
if (!rule.tags?.length && !rule.addon && !rule.routes?.length) {
|
|
80
|
+
throw new Error(`deploy.grouping: rule "${rule.unit}" matches nothing. Give it at least one of "tags", "addon" or "routes".`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
export const createUnitResolver = (config, input) => {
|
|
85
|
+
const strategy = config?.strategy ?? DEFAULT_STRATEGY;
|
|
86
|
+
const rules = config?.rules ?? [];
|
|
87
|
+
if (config) {
|
|
88
|
+
validateGrouping(config);
|
|
89
|
+
}
|
|
90
|
+
const compiled = rules.map((rule) => ({
|
|
91
|
+
rule,
|
|
92
|
+
unit: toSafeKebab(rule.unit),
|
|
93
|
+
tags: rule.tags,
|
|
94
|
+
addon: rule.addon,
|
|
95
|
+
routes: rule.routes?.map(routeMatcher),
|
|
96
|
+
}));
|
|
97
|
+
const byUnitName = new Map(compiled.map((c) => [c.unit, c.rule]));
|
|
98
|
+
const serviceKeys = new Map();
|
|
99
|
+
const matches = (c, tags, routes, addon) => {
|
|
100
|
+
if (c.tags && !c.tags.some((tag) => tags.includes(tag))) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
if (c.addon && c.addon !== addon) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (c.routes && !c.routes.some((re) => routes.some((r) => re.test(r)))) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
};
|
|
111
|
+
const fallback = (funcId) => {
|
|
112
|
+
if (strategy === 'single') {
|
|
113
|
+
return SINGLE_UNIT_NAME;
|
|
114
|
+
}
|
|
115
|
+
if (strategy === 'services') {
|
|
116
|
+
const services = input.servicesForFunction(funcId);
|
|
117
|
+
const name = serviceUnitName(services, input.targetForFunction(funcId));
|
|
118
|
+
serviceKeys.set(name, serviceKey(services));
|
|
119
|
+
return name;
|
|
120
|
+
}
|
|
121
|
+
return toSafeKebab(funcId);
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
isGrouped: strategy !== 'function' || compiled.length > 0,
|
|
125
|
+
ruleForUnit: (unitName) => byUnitName.get(unitName),
|
|
126
|
+
serviceKeyForUnit: (unitName) => serviceKeys.get(unitName),
|
|
127
|
+
forFunction: (funcId) => {
|
|
128
|
+
if (compiled.length > 0) {
|
|
129
|
+
const tags = input.tagsForFunction(funcId);
|
|
130
|
+
const routes = input.routesForFunction(funcId);
|
|
131
|
+
for (const c of compiled) {
|
|
132
|
+
if (matches(c, tags, routes, undefined)) {
|
|
133
|
+
return c.unit;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return fallback(funcId);
|
|
138
|
+
},
|
|
139
|
+
forAddon: (namespace) => {
|
|
140
|
+
for (const c of compiled) {
|
|
141
|
+
if (c.addon === namespace && !c.tags && !c.routes) {
|
|
142
|
+
return c.unit;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return `addon-${toSafeKebab(namespace)}`;
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toSafeKebab(str: string): string;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { InspectorState } from '@pikku/inspector';
|
|
8
8
|
import { PikkuError } from '@pikku/core/errors';
|
|
9
|
+
import type { GroupingConfig } from './analyzer/index.js';
|
|
9
10
|
import type { DeploymentManifest } from '@pikku/deploy';
|
|
10
11
|
import type { Bundler } from './bundler/bundler.interface.js';
|
|
11
12
|
import type { BundleResult } from './bundler/types.js';
|
|
@@ -50,6 +51,7 @@ export declare function runBuildPipeline(options: {
|
|
|
50
51
|
inspectorState: InspectorState;
|
|
51
52
|
serverlessIncompatible?: string[];
|
|
52
53
|
defaultTarget?: 'serverless' | 'server';
|
|
54
|
+
grouping?: GroupingConfig;
|
|
53
55
|
globalHTTPPrefix?: string;
|
|
54
56
|
getEntryContext: (unitDir: string, pikkuDir: string, unit: DeploymentManifest['units'][0], state: InspectorState) => unknown;
|
|
55
57
|
/**
|