@pikku/cli 0.12.153 → 0.12.155
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-0XQ4CyKC.js → HelpPanel-Ndvkqpn8.js} +1 -1
- package/console-app/assets/{abnfDiagram-VCTEODGH-DZTF_2aX.js → abnfDiagram-VCTEODGH-DvUR4gej.js} +1 -1
- package/console-app/assets/architecture-7GRP2DOG-DJkDVzM_.js +1 -0
- package/console-app/assets/{architectureDiagram-5GKGNRK7-Re4-6X-k.js → architectureDiagram-5GKGNRK7-HLwJ3llk.js} +1 -1
- package/console-app/assets/{blockDiagram-I7D4REHJ-Dbj7SnRK.js → blockDiagram-I7D4REHJ-LMSdIVfc.js} +1 -1
- package/console-app/assets/{c4Diagram-7LVT6UL2-DUr02Wxh.js → c4Diagram-7LVT6UL2-CcWW9nYv.js} +1 -1
- package/console-app/assets/channel-C6yZyX_m.js +1 -0
- package/console-app/assets/{chunk-4HAMMTFA-DjatzNf_.js → chunk-4HAMMTFA-Dxcu8ptc.js} +1 -1
- package/console-app/assets/{chunk-75Z2AOVW-BGsmWEdU.js → chunk-75Z2AOVW-BBINCcJe.js} +1 -1
- package/console-app/assets/{chunk-DU6HZSFF-CC7WiVgI.js → chunk-DU6HZSFF-BgJhrYpo.js} +1 -1
- package/console-app/assets/{chunk-F27PBJKO-BATuW9Ej.js → chunk-F27PBJKO-CctviqIo.js} +1 -1
- package/console-app/assets/{chunk-GMAD6QVW-CgHNo00B.js → chunk-GMAD6QVW-BJ-InAqp.js} +1 -1
- package/console-app/assets/{chunk-GVQU2GXP-VT_xckd9.js → chunk-GVQU2GXP-DaeerGJS.js} +1 -1
- package/console-app/assets/{chunk-IMKFNOWR-BhSVbWtF.js → chunk-IMKFNOWR-eOSAFAc9.js} +1 -1
- package/console-app/assets/{chunk-L3NEJ4N5-HUF6a3Xl.js → chunk-L3NEJ4N5-DRfMBpkp.js} +1 -1
- package/console-app/assets/{chunk-OSK3NFVY-C_LPDGIB.js → chunk-OSK3NFVY-DMZ2WBA1.js} +1 -1
- package/console-app/assets/{chunk-P2QGCYS3-lWDBgw4Q.js → chunk-P2QGCYS3-d0BFQiY1.js} +1 -1
- package/console-app/assets/{chunk-POPQ4Y6H--6JTzmZJ.js → chunk-POPQ4Y6H-D4zICDtR.js} +1 -1
- package/console-app/assets/{chunk-PWAF6VOD-C1GqaJJs.js → chunk-PWAF6VOD-_v9wUl6m.js} +1 -1
- package/console-app/assets/{chunk-SHT3W25Y-Dd_4Zpdj.js → chunk-SHT3W25Y-DZ3Wa0Mc.js} +1 -1
- package/console-app/assets/{chunk-SVP7TREG-B8OY7dfD.js → chunk-SVP7TREG-2yCR3ywB.js} +1 -1
- package/console-app/assets/{chunk-TICWLB2K-B8S7Hmnu.js → chunk-TICWLB2K-CtulM0X6.js} +1 -1
- package/console-app/assets/chunk-XXDRQBXY-CLsn_tEh.js +1 -0
- package/console-app/assets/classDiagram-ZZMXUADV-D7FKceOo.js +1 -0
- package/console-app/assets/classDiagram-v2-VYDZK3BY-D7FKceOo.js +1 -0
- package/console-app/assets/{cose-bilkent-JH36ORCC-C6RM8oPO.js → cose-bilkent-JH36ORCC-DNc5wiJ_.js} +1 -1
- package/console-app/assets/{cynefin-OW5HDTMX-COh9rFYY.js → cynefin-OW5HDTMX-CQPn9kED.js} +1 -1
- package/console-app/assets/{cynefinDiagram-5FMLGOSQ-Dd9AR17w.js → cynefinDiagram-5FMLGOSQ-CkW1ZG13.js} +1 -1
- package/console-app/assets/{dagre-BDMvDAer.js → dagre-BcTdbH8b.js} +1 -1
- package/console-app/assets/{dagre-GXQ25YYZ-C_nBUPgr.js → dagre-GXQ25YYZ-Cgvwy7_U.js} +1 -1
- package/console-app/assets/{diagram-S7CK7UJ4-BGOobQeC.js → diagram-S7CK7UJ4-JB3GlMwZ.js} +1 -1
- package/console-app/assets/{diagram-UQ7AKVKN-CAF_vcj0.js → diagram-UQ7AKVKN-CaIeYJXa.js} +1 -1
- package/console-app/assets/{diagram-VSXAHHWV-q-aY0Nsc.js → diagram-VSXAHHWV-Cku8J3KG.js} +1 -1
- package/console-app/assets/{diagram-VX7I27RA-CnUibSOe.js → diagram-VX7I27RA-Dp3jeYrS.js} +1 -1
- package/console-app/assets/{diagram-Z3DM3KII-DY0V5kOJ.js → diagram-Z3DM3KII-B56Ys0Pf.js} +1 -1
- package/console-app/assets/{ebnfDiagram-PWID7BFC-CXp4CmEF.js → ebnfDiagram-PWID7BFC-CfxeEpk1.js} +1 -1
- package/console-app/assets/{erDiagram-RLTQ6QDP-CKnfXmPl.js → erDiagram-RLTQ6QDP-Dp9sOoSf.js} +1 -1
- package/console-app/assets/eventmodeling-NTZA5JFV-CccBkMWb.js +1 -0
- package/console-app/assets/flowDiagram-HODETNUW-Cp_XHTFC.js +1 -0
- package/console-app/assets/{ganttDiagram-EL5Y4UJY-D6v_RJ7o.js → ganttDiagram-EL5Y4UJY-BsD1LYkb.js} +1 -1
- package/console-app/assets/{gitGraph-4MIJSDKK-y3kWDddY.js → gitGraph-4MIJSDKK-CSHhAZoD.js} +1 -1
- package/console-app/assets/{gitGraphDiagram-WWUBYQGX-CBaE24KN.js → gitGraphDiagram-WWUBYQGX-CZ_0OI7F.js} +1 -1
- package/console-app/assets/{graphlib-DAA_TPmU.js → graphlib-Bpf494dL.js} +1 -1
- package/console-app/assets/{index-HuTd6kcC.js → index-DXtR4J7Y.js} +68 -68
- package/console-app/assets/{info-A6RAGUB7-BvxfRJ9-.js → info-A6RAGUB7-Cym2YsaS.js} +1 -1
- package/console-app/assets/{infoDiagram-27XIBGKW-BlFmgW96.js → infoDiagram-27XIBGKW-n9atnl-K.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-5VMMS53U-Dpwhnwwq.js → ishikawaDiagram-5VMMS53U-BeLDkr8-.js} +1 -1
- package/console-app/assets/{journeyDiagram-3NMN7TZE-iOSeOQma.js → journeyDiagram-3NMN7TZE-B__R_eOL.js} +1 -1
- package/console-app/assets/{kanban-definition-UXKFOSKX-DFGTB8S5.js → kanban-definition-UXKFOSKX-Cwsl1hYB.js} +1 -1
- package/console-app/assets/{line-B_5qZKoM.js → line-UWFHtT2i.js} +1 -1
- package/console-app/assets/{linear-BmXUYu4J.js → linear-BHDHoGpb.js} +1 -1
- package/console-app/assets/{mermaid-parser.core-DyPi3Lbr.js → mermaid-parser.core-CyGW9xht.js} +3 -3
- package/console-app/assets/{mermaid.core-S4y9jX8K.js → mermaid.core-zeBKxakC.js} +4 -4
- package/console-app/assets/{mindmap-definition-YA3MSWOX-Bl09mCaS.js → mindmap-definition-YA3MSWOX-bZ2kbbMM.js} +1 -1
- package/console-app/assets/{packet-AYTQ26CC-B5zoasmU.js → packet-AYTQ26CC-DtH3ZjsO.js} +1 -1
- package/console-app/assets/{pegDiagram-XKGWAZYB-CAa0SOHf.js → pegDiagram-XKGWAZYB-Cy-M_2Zc.js} +1 -1
- package/console-app/assets/{pie-WAS4IAKB-C91xXCXY.js → pie-WAS4IAKB-DEZDAaJW.js} +1 -1
- package/console-app/assets/{pieDiagram-E7YTZNPT-CmUHVYwz.js → pieDiagram-E7YTZNPT-Ce3Yl--P.js} +1 -1
- package/console-app/assets/{quadrantDiagram-AXDQQJYC-XWsej4ss.js → quadrantDiagram-AXDQQJYC-BTK8v4H5.js} +1 -1
- package/console-app/assets/{radar-RG4KPBEZ-B7ieCnSw.js → radar-RG4KPBEZ-CTPhaLOE.js} +1 -1
- package/console-app/assets/{railroad-74A4TZTK-KTKjMg4U.js → railroad-74A4TZTK-DMa9G1LV.js} +1 -1
- package/console-app/assets/railroad-abnf-HS5TGJTU-K0DgRobv.js +1 -0
- package/console-app/assets/railroad-ebnf-LZEXJU2U-CHEGHd9y.js +1 -0
- package/console-app/assets/railroad-peg-WCYAUIDC-EYHvZbXp.js +1 -0
- package/console-app/assets/{railroadDiagram-O6MQD6OU-oh1FjI2K.js → railroadDiagram-O6MQD6OU-CYbkYMqD.js} +1 -1
- package/console-app/assets/{requirementDiagram-BXWQKSXE-D6z7hLfj.js → requirementDiagram-BXWQKSXE-DjWjfWOk.js} +1 -1
- package/console-app/assets/{sankeyDiagram-P5KCCOFB-DFb92jfp.js → sankeyDiagram-P5KCCOFB-6sAcPgDK.js} +1 -1
- package/console-app/assets/{sequenceDiagram-WJ2MYXX4-BRKj-PG1.js → sequenceDiagram-WJ2MYXX4-DzyU1CIr.js} +1 -1
- package/console-app/assets/{src-DYBVouJk.js → src-0ppm3vZe.js} +1 -1
- package/console-app/assets/{stateDiagram-D77RDMKH-BfTLNw5t.js → stateDiagram-D77RDMKH-S5osVh5p.js} +1 -1
- package/console-app/assets/stateDiagram-v2-MP3YSRHH-BZUe_KiH.js +1 -0
- package/console-app/assets/{swimlanes-42K2YHIH-DXkNYzX9.js → swimlanes-42K2YHIH-Dd7HjelH.js} +1 -1
- package/console-app/assets/swimlanesDiagram-VR7AAH4N-D6xRypPY.js +8 -0
- package/console-app/assets/{timeline-definition-24CTP7MA-B8m2V75P.js → timeline-definition-24CTP7MA-eZ3AIIpc.js} +1 -1
- package/console-app/assets/{treeView-Q6P3EWNA-BisqOzat.js → treeView-Q6P3EWNA-DF5sOT6y.js} +1 -1
- package/console-app/assets/{treemap-WGGIJYW6-DOxEXpb1.js → treemap-WGGIJYW6-Bob0iUUb.js} +1 -1
- package/console-app/assets/{vennDiagram-4TSXK5OY-ZeuU7o23.js → vennDiagram-4TSXK5OY-CeowTqyG.js} +1 -1
- package/console-app/assets/{wardley-WFR3VGLG-sspeOMuz.js → wardley-WFR3VGLG-DrnQFkZZ.js} +1 -1
- package/console-app/assets/{wardleyDiagram-VM6X3IG4-CF2vzNJV.js → wardleyDiagram-VM6X3IG4-Dsfkp6D5.js} +1 -1
- package/console-app/assets/{xychartDiagram-S5SC5T6Z-BR9XBq3s.js → xychartDiagram-S5SC5T6Z-YC_qsmJw.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 +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +15 -5
- 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 +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 +1 -1
- 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 +15 -6
- 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 +33 -33
- 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/scenarios/index.d.ts +1 -1
- package/dist/.pikku/scenarios/index.js +1 -1
- package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/scheduler/index.d.ts +1 -1
- package/dist/.pikku/scheduler/index.js +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +1 -1
- package/dist/.pikku/scopes/index.d.ts +1 -1
- package/dist/.pikku/scopes/index.js +1 -1
- package/dist/.pikku/scopes/pikku-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/bin/pikku.js +32 -2
- package/dist/src/deploy/build-pipeline.d.ts +43 -0
- package/dist/src/deploy/build-pipeline.js +79 -30
- package/dist/src/fabric/fabric-commands.js +3 -1
- package/dist/src/fabric/functions/add.function.js +4 -3
- package/dist/src/fabric/functions/changes-file.function.js +2 -1
- package/dist/src/fabric/functions/changes-shot.function.js +3 -2
- package/dist/src/fabric/functions/db-schema.function.js +3 -2
- package/dist/src/fabric/functions/deploy-list.function.js +3 -2
- package/dist/src/fabric/functions/deploy-units.function.js +3 -2
- package/dist/src/fabric/functions/deploy.function.js +4 -4
- package/dist/src/fabric/functions/domains-add.function.js +4 -3
- package/dist/src/fabric/functions/domains-list.function.js +3 -2
- package/dist/src/fabric/functions/domains-remove.function.js +5 -4
- package/dist/src/fabric/functions/errors.function.js +3 -2
- package/dist/src/fabric/functions/findings-flush.function.js +2 -1
- package/dist/src/fabric/functions/init.function.js +3 -2
- package/dist/src/fabric/functions/link.function.js +10 -10
- package/dist/src/fabric/functions/login.function.js +4 -3
- package/dist/src/fabric/functions/logs.function.js +2 -2
- package/dist/src/fabric/functions/metrics.function.js +3 -2
- package/dist/src/fabric/functions/projects-list.function.js +2 -1
- package/dist/src/fabric/functions/publish.function.js +7 -6
- package/dist/src/fabric/functions/report.function.js +4 -3
- package/dist/src/fabric/functions/rollback.function.js +3 -2
- package/dist/src/fabric/functions/secrets-delete.function.js +5 -4
- package/dist/src/fabric/functions/secrets-list.function.js +3 -2
- package/dist/src/fabric/functions/secrets-rotate.function.js +4 -3
- package/dist/src/fabric/functions/secrets-set.function.js +11 -4
- package/dist/src/fabric/functions/smoke.function.js +4 -3
- package/dist/src/fabric/functions/status.function.js +3 -2
- package/dist/src/fabric/functions/trace.function.js +3 -2
- package/dist/src/fabric/functions/variables-get.function.js +3 -2
- package/dist/src/fabric/functions/variables-set.function.js +3 -2
- package/dist/src/fabric/lib/changes.js +3 -2
- package/dist/src/fabric/lib/config.js +2 -1
- package/dist/src/fabric/lib/deployment.js +2 -1
- package/dist/src/fabric/lib/git.d.ts +10 -1
- package/dist/src/fabric/lib/git.js +10 -1
- package/dist/src/fabric/lib/prompt.d.ts +14 -5
- package/dist/src/fabric/lib/prompt.js +78 -15
- package/dist/src/fabric/lib/report-environment.d.ts +5 -4
- package/dist/src/fabric/lib/report-environment.js +18 -4
- package/dist/src/fabric/lib/sealed-box.js +3 -2
- package/dist/src/fabric/lib/stage.js +3 -2
- package/dist/src/functions/commands/deploy-apply.js +1 -0
- package/dist/src/functions/commands/deploy-plan.js +1 -0
- package/dist/src/functions/commands/watch.js +5 -2
- package/dist/src/functions/db/sqlite/scenario-baseline.js +5 -0
- package/dist/src/functions/wirings/agent/serialize-public-agent.js +2 -0
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +18 -4
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +16 -5
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.js +26 -5
- package/dist/src/functions/wirings/functions/serialize-addon-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-addon-types.js +46 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +3 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +13 -1
- package/dist/src/functions/wirings/middleware/serialize-middleware-imports.d.ts +13 -0
- package/dist/src/functions/wirings/middleware/serialize-middleware-imports.js +48 -8
- package/dist/src/utils/pikku-cli-config-error.d.ts +8 -3
- package/dist/src/utils/pikku-cli-config-error.js +8 -3
- package/dist/src/utils/pikku-cli-config.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/surface.json +4 -16
- package/console-app/assets/architecture-7GRP2DOG-NotVOJ5Y.js +0 -1
- package/console-app/assets/channel-DU63_zXh.js +0 -1
- package/console-app/assets/chunk-XXDRQBXY-BLuHuEZN.js +0 -1
- package/console-app/assets/classDiagram-ZZMXUADV-BTYfUi7u.js +0 -1
- package/console-app/assets/classDiagram-v2-VYDZK3BY-BTYfUi7u.js +0 -1
- package/console-app/assets/eventmodeling-NTZA5JFV-CBfQhnG8.js +0 -1
- package/console-app/assets/flowDiagram-HODETNUW-BnY3G7p6.js +0 -1
- package/console-app/assets/railroad-abnf-HS5TGJTU-e9AlsYmr.js +0 -1
- package/console-app/assets/railroad-ebnf-LZEXJU2U-BVX8UG1z.js +0 -1
- package/console-app/assets/railroad-peg-WCYAUIDC-BzWQFvD9.js +0 -1
- package/console-app/assets/stateDiagram-v2-MP3YSRHH-B8sMNnnF.js +0 -1
- package/console-app/assets/swimlanesDiagram-VR7AAH4N-CiZdLDyk.js +0 -8
|
@@ -13,6 +13,7 @@ import { withoutScenarios } from '../functions/wirings/scenarios/scenario-partit
|
|
|
13
13
|
import { generatePerUnitCodegen } from './codegen/per-unit-codegen.js';
|
|
14
14
|
import { materializeFrontend } from './frontend-assets.js';
|
|
15
15
|
import { assertFrontendBuilt } from '../utils/frontend.js';
|
|
16
|
+
import { loadUserConfigForDb, } from '../functions/commands/db-shared.js';
|
|
16
17
|
import { generateServerEntrySource, SERVER_DOCKERFILE, SERVER_DOCKERIGNORE, } from './server-entry.js';
|
|
17
18
|
/**
|
|
18
19
|
* A unit that failed codegen or bundling is an expected build outcome (the
|
|
@@ -61,6 +62,44 @@ function findLockfile(projectDir) {
|
|
|
61
62
|
}
|
|
62
63
|
return null;
|
|
63
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* The project's declared version, or nothing.
|
|
67
|
+
*
|
|
68
|
+
* Absent is a real answer — a project need not version itself — and is better
|
|
69
|
+
* reported as unknown than as a number this made up.
|
|
70
|
+
*/
|
|
71
|
+
function resolveProjectVersion(projectDir) {
|
|
72
|
+
try {
|
|
73
|
+
const pkg = JSON.parse(readFileSync(join(projectDir, 'package.json'), 'utf-8'));
|
|
74
|
+
return typeof pkg.version === 'string' ? pkg.version : undefined;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The project's own database declaration, or nothing it could read.
|
|
82
|
+
*
|
|
83
|
+
* A config that throws, or names no `createConfig` at all, is reported as no
|
|
84
|
+
* declaration rather than as a build failure: it is only ever one of two
|
|
85
|
+
* signals here, and the directory conventions still answer for a project whose
|
|
86
|
+
* config needs an environment this build does not have.
|
|
87
|
+
*/
|
|
88
|
+
async function loadConfiguredDb(projectDir, srcDirectories, logger) {
|
|
89
|
+
try {
|
|
90
|
+
return await loadUserConfigForDb({
|
|
91
|
+
config: { rootDir: projectDir, srcDirectories },
|
|
92
|
+
logger: {
|
|
93
|
+
error: (msg) => logger.debug(msg),
|
|
94
|
+
warn: (msg) => logger.debug(msg),
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
logger.debug(`Could not read createConfig to resolve the deploy database: ${error?.message ?? error}`);
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
64
103
|
/**
|
|
65
104
|
* The database a standalone bundle has to open for itself.
|
|
66
105
|
*
|
|
@@ -71,49 +110,59 @@ function findLockfile(projectDir) {
|
|
|
71
110
|
* services factory does when the database is missing, which for the generated
|
|
72
111
|
* templates is a throw.
|
|
73
112
|
*
|
|
74
|
-
* Engine
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
113
|
+
* Engine is resolved the way every other pikku host resolves it: `createConfig`
|
|
114
|
+
* first, through the same `loadUserConfigForDb` the db commands use, and the
|
|
115
|
+
* `db/sqlite` / `db/postgres` conventions only as the fallback. Reading the
|
|
116
|
+
* directory alone left an app that declares its database in config and keeps no
|
|
117
|
+
* migrations getting a connection under `pikku dev` and none in its artifact —
|
|
118
|
+
* the same crash, reached a different way. A config that cannot be loaded falls
|
|
119
|
+
* back to the directories rather than failing the build, because a project with
|
|
120
|
+
* no database at all must still bundle.
|
|
121
|
+
*
|
|
122
|
+
* Both at once is refused rather than resolved, whether the two arrive as two
|
|
123
|
+
* migration directories or as `sqliteDb` beside `postgresUrl`. Picking one would
|
|
124
|
+
* be picking which database the deployed app talks to on the strength of
|
|
125
|
+
* directory order, and the failure — an app running happily against the wrong,
|
|
126
|
+
* fully valid schema — is invisible until someone reads the data.
|
|
79
127
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* schema — is invisible until someone reads the data.
|
|
128
|
+
* Only the engine travels. A configured SQLite path is a developer's local file
|
|
129
|
+
* and has no meaning on the target host, which names its own through
|
|
130
|
+
* `PIKKU_DATA_DIR`.
|
|
84
131
|
*
|
|
85
132
|
* The migrations are copied in beside the bundle under the same `db/<engine>/`
|
|
86
133
|
* path they have in the project, which is also where Fabric's build container
|
|
87
134
|
* stages them. Two producers writing the artifact cannot disagree about where
|
|
88
135
|
* the SQL lives, and `bundle.js db migrate` finds it either way.
|
|
89
136
|
*/
|
|
90
|
-
|
|
91
|
-
* The project's declared version, or nothing.
|
|
92
|
-
*
|
|
93
|
-
* Absent is a real answer — a project need not version itself — and is better
|
|
94
|
-
* reported as unknown than as a number this made up.
|
|
95
|
-
*/
|
|
96
|
-
function resolveProjectVersion(projectDir) {
|
|
97
|
-
try {
|
|
98
|
-
const pkg = JSON.parse(readFileSync(join(projectDir, 'package.json'), 'utf-8'));
|
|
99
|
-
return typeof pkg.version === 'string' ? pkg.version : undefined;
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
async function resolveStandaloneDb(projectDir, pikkuDir, unitDir) {
|
|
137
|
+
export async function resolveStandaloneDb(projectDir, pikkuDir, unitDir, srcDirectories, logger) {
|
|
106
138
|
const hasSqlite = existsSync(join(projectDir, 'db', 'sqlite'));
|
|
107
139
|
const hasPostgres = existsSync(join(projectDir, 'db', 'postgres'));
|
|
108
140
|
if (hasSqlite && hasPostgres) {
|
|
109
141
|
throw new Error('This project has both db/sqlite and db/postgres migrations, so a standalone build cannot tell which database the app is meant to open. Keep the one this app deploys against.');
|
|
110
142
|
}
|
|
111
|
-
const
|
|
143
|
+
const userConfig = await loadConfiguredDb(projectDir, srcDirectories, logger);
|
|
144
|
+
if (userConfig?.postgresUrl && userConfig?.sqliteDb) {
|
|
145
|
+
throw new Error('createConfig sets both postgresUrl and sqliteDb, so a standalone build cannot tell which database the app is meant to open. Configure exactly one database dialect.');
|
|
146
|
+
}
|
|
147
|
+
const engine = userConfig?.postgresUrl
|
|
148
|
+
? 'postgres'
|
|
149
|
+
: userConfig?.sqliteDb
|
|
150
|
+
? 'sqlite'
|
|
151
|
+
: hasSqlite
|
|
152
|
+
? 'sqlite'
|
|
153
|
+
: hasPostgres
|
|
154
|
+
? 'postgres'
|
|
155
|
+
: undefined;
|
|
112
156
|
if (!engine)
|
|
113
157
|
return undefined;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
158
|
+
// Absent for a database whose schema is created outside the migrator, which
|
|
159
|
+
// is a database to connect to rather than a reason to hand the app none.
|
|
160
|
+
const migrationsDir = join(projectDir, 'db', engine);
|
|
161
|
+
if (existsSync(migrationsDir)) {
|
|
162
|
+
await cp(migrationsDir, join(unitDir, 'db', engine), {
|
|
163
|
+
recursive: true,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
117
166
|
// Absent for an app that annotates no columns, which is a database with
|
|
118
167
|
// nothing to coerce rather than a reason to hand the app no database.
|
|
119
168
|
const coercionFile = join(pikkuDir, 'db', 'coercion.gen.ts');
|
|
@@ -199,7 +248,7 @@ export async function runBuildPipeline(options) {
|
|
|
199
248
|
...getEntryContext(unitDir, pikkuDir, singleUnit, inspectorState),
|
|
200
249
|
frontend: frontendMount,
|
|
201
250
|
version: resolveProjectVersion(projectDir),
|
|
202
|
-
db: await resolveStandaloneDb(projectDir, pikkuDir, unitDir),
|
|
251
|
+
db: await resolveStandaloneDb(projectDir, pikkuDir, unitDir, options.srcDirectories ?? ['src'], logger),
|
|
203
252
|
lifecycle: resolveLifecycle(unitDir, inspectorState),
|
|
204
253
|
};
|
|
205
254
|
const source = provider.generateEntrySource(ctx);
|
|
@@ -259,7 +259,9 @@ export const fabricCommands = defineCLICommands({
|
|
|
259
259
|
description: 'Set a stage-scoped secret',
|
|
260
260
|
options: {
|
|
261
261
|
branch: { description: 'Target branch', short: 'b' },
|
|
262
|
-
value: {
|
|
262
|
+
value: {
|
|
263
|
+
description: 'Secret value (prompted if omitted, or read from stdin when piped)',
|
|
264
|
+
},
|
|
263
265
|
force: {
|
|
264
266
|
description: 'Overwrite without confirmation',
|
|
265
267
|
default: false,
|
|
@@ -6,6 +6,7 @@ import { tmpdir } from 'node:os';
|
|
|
6
6
|
import { execFileSync } from 'node:child_process';
|
|
7
7
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
8
8
|
import { resolveApiContext } from '../lib/config.js';
|
|
9
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
9
10
|
export const FabricAddInput = z.object({
|
|
10
11
|
id: z.string(),
|
|
11
12
|
dir: z.string().optional(),
|
|
@@ -97,12 +98,12 @@ export const FabricAdd = pikkuSessionlessFunc({
|
|
|
97
98
|
// 1. resolve a presigned download URL (public read)
|
|
98
99
|
const metaRes = await fetch(`${ctx.apiUrl}/registry/packages/${encodeURIComponent(id)}/download`);
|
|
99
100
|
if (!metaRes.ok)
|
|
100
|
-
throw new
|
|
101
|
+
throw new FabricPreconditionError(`download lookup failed → ${metaRes.status}: ${await metaRes.text()}`);
|
|
101
102
|
const { url } = (await metaRes.json());
|
|
102
103
|
// 2. fetch the artifact
|
|
103
104
|
const dl = await fetch(url);
|
|
104
105
|
if (!dl.ok)
|
|
105
|
-
throw new
|
|
106
|
+
throw new FabricPreconditionError(`artifact fetch failed → ${dl.status}`);
|
|
106
107
|
const artifact = Buffer.from(await dl.arrayBuffer());
|
|
107
108
|
const root = resolveProjectRoot();
|
|
108
109
|
const addonDir = dir ?? (await readAddonDirFromConfig(root)) ?? 'addons';
|
|
@@ -120,7 +121,7 @@ export const FabricAdd = pikkuSessionlessFunc({
|
|
|
120
121
|
await rm(tmp, { force: true });
|
|
121
122
|
const pkg = JSON.parse(await readFile(join(staging, 'package.json'), 'utf8'));
|
|
122
123
|
if (!pkg.name)
|
|
123
|
-
throw new
|
|
124
|
+
throw new FabricPreconditionError('artifact package.json is missing a "name" field');
|
|
124
125
|
const version = pkg.version ?? '0.0.0';
|
|
125
126
|
// shadcn copy: folder is the last segment of the (scoped) package name
|
|
126
127
|
const folder = pkg.name.split('/').pop();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
4
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
4
5
|
import { changesContext, requireProjectId } from '../lib/changes.js';
|
|
5
6
|
import { resolveStageId } from '../lib/stage.js';
|
|
6
7
|
import { dim, safe } from '../lib/output.js';
|
|
@@ -34,7 +35,7 @@ export const FabricChangesFile = pikkuSessionlessFunc({
|
|
|
34
35
|
output: FabricChangesFileOutput,
|
|
35
36
|
func: async (_services, input) => {
|
|
36
37
|
if (input.body && input.bodyFile)
|
|
37
|
-
throw new
|
|
38
|
+
throw new FabricPreconditionError('Pass --body or --body-file, not both.');
|
|
38
39
|
const { rpc, projectId } = await changesContext(input.apiUrl, input.projectId);
|
|
39
40
|
const stageId = input.stageId ??
|
|
40
41
|
(await resolveStageId(rpc, requireProjectId(projectId), input.branch));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
4
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
4
5
|
import { changesContext, imageContentType, } from '../lib/changes.js';
|
|
5
6
|
import { dim, safe } from '../lib/output.js';
|
|
6
7
|
export const FabricChangesShotInput = z.object({
|
|
@@ -28,13 +29,13 @@ export const FabricChangesShot = pikkuSessionlessFunc({
|
|
|
28
29
|
output: FabricChangesShotOutput,
|
|
29
30
|
func: async (_services, input) => {
|
|
30
31
|
if (!input.image && !input.imageBase64)
|
|
31
|
-
throw new
|
|
32
|
+
throw new FabricPreconditionError('Pass --image <path> or --image-base64 <data>.');
|
|
32
33
|
let contentType = input.contentType;
|
|
33
34
|
let imageBase64 = input.imageBase64;
|
|
34
35
|
if (input.image) {
|
|
35
36
|
const inferred = imageContentType(input.image);
|
|
36
37
|
if (!inferred && !contentType)
|
|
37
|
-
throw new
|
|
38
|
+
throw new FabricPreconditionError(`Cannot tell the image type from “${input.image}” — pass --content-type.`);
|
|
38
39
|
contentType ??= inferred;
|
|
39
40
|
imageBase64 = (await readFile(input.image)).toString('base64');
|
|
40
41
|
}
|
|
@@ -4,6 +4,7 @@ import { resolveApiContext } from '../lib/config.js';
|
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
5
|
import { resolveStageId } from '../lib/stage.js';
|
|
6
6
|
import { table, dim } from '../lib/output.js';
|
|
7
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
7
8
|
export const FabricDbSchemaInput = z.object({
|
|
8
9
|
branch: z.string().default('main'),
|
|
9
10
|
});
|
|
@@ -18,9 +19,9 @@ export const FabricDbSchema = pikkuSessionlessFunc({
|
|
|
18
19
|
func: async (_services, { branch }) => {
|
|
19
20
|
const ctx = await resolveApiContext();
|
|
20
21
|
if (!ctx.token)
|
|
21
|
-
throw new
|
|
22
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
22
23
|
if (!ctx.projectId)
|
|
23
|
-
throw new
|
|
24
|
+
throw new FabricPreconditionError('No fabric project linked. Run `pikku fabric link` first.');
|
|
24
25
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
25
26
|
const stageId = await resolveStageId(rpc, ctx.projectId, branch);
|
|
26
27
|
const { schema } = await rpc.invoke('getStageDatabaseSchema', { stageId });
|
|
@@ -4,6 +4,7 @@ import { resolveApiContext } from '../lib/config.js';
|
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
5
|
import { resolveStageId } from '../lib/stage.js';
|
|
6
6
|
import { table, statusColor, dim } from '../lib/output.js';
|
|
7
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
7
8
|
export const FabricDeployListInput = z.object({
|
|
8
9
|
branch: z.string().default('main'),
|
|
9
10
|
});
|
|
@@ -18,9 +19,9 @@ export const FabricDeployList = pikkuSessionlessFunc({
|
|
|
18
19
|
func: async (_services, { branch }) => {
|
|
19
20
|
const ctx = await resolveApiContext();
|
|
20
21
|
if (!ctx.token)
|
|
21
|
-
throw new
|
|
22
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
22
23
|
if (!ctx.projectId)
|
|
23
|
-
throw new
|
|
24
|
+
throw new FabricPreconditionError('No fabric project linked. Run `pikku fabric link` first.');
|
|
24
25
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
25
26
|
const stageId = await resolveStageId(rpc, ctx.projectId, branch);
|
|
26
27
|
const { deployments } = await rpc.invoke('listDeployments', { stageId });
|
|
@@ -4,6 +4,7 @@ import { resolveApiContext } from '../lib/config.js';
|
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
5
|
import { resolveStageId } from '../lib/stage.js';
|
|
6
6
|
import { table, statusColor, dim } from '../lib/output.js';
|
|
7
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
7
8
|
export const FabricDeployUnitsInput = z.object({
|
|
8
9
|
branch: z.string().default('main'),
|
|
9
10
|
});
|
|
@@ -18,9 +19,9 @@ export const FabricDeployUnits = pikkuSessionlessFunc({
|
|
|
18
19
|
func: async (_services, { branch }) => {
|
|
19
20
|
const ctx = await resolveApiContext();
|
|
20
21
|
if (!ctx.token)
|
|
21
|
-
throw new
|
|
22
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
22
23
|
if (!ctx.projectId)
|
|
23
|
-
throw new
|
|
24
|
+
throw new FabricPreconditionError('No fabric project linked. Run `pikku fabric link` first.');
|
|
24
25
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
25
26
|
const stageId = await resolveStageId(rpc, ctx.projectId, branch);
|
|
26
27
|
const { workers } = await rpc.invoke('listDeploymentWorkers', { stageId });
|
|
@@ -92,10 +92,10 @@ export const FabricDeployApplyOutput = z.object({
|
|
|
92
92
|
async function prepDeploy({ branch, production, ref }) {
|
|
93
93
|
const ctx = await resolveApiContext();
|
|
94
94
|
if (!ctx.token) {
|
|
95
|
-
throw new
|
|
95
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
96
96
|
}
|
|
97
97
|
if (!ctx.projectId) {
|
|
98
|
-
throw new
|
|
98
|
+
throw new FabricPreconditionError('No fabric project linked. Run `pikku fabric link` first.');
|
|
99
99
|
}
|
|
100
100
|
// With no target named, deploy the branch that is checked out — the common
|
|
101
101
|
// case, and the one worth not making people type twice. It is only safe to
|
|
@@ -120,10 +120,10 @@ async function prepDeploy({ branch, production, ref }) {
|
|
|
120
120
|
async function prepAttach() {
|
|
121
121
|
const ctx = await resolveApiContext();
|
|
122
122
|
if (!ctx.token) {
|
|
123
|
-
throw new
|
|
123
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
124
124
|
}
|
|
125
125
|
if (!ctx.projectId) {
|
|
126
|
-
throw new
|
|
126
|
+
throw new FabricPreconditionError('No fabric project linked. Run `pikku fabric link` first.');
|
|
127
127
|
}
|
|
128
128
|
return { ctx, projectId: ctx.projectId };
|
|
129
129
|
}
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
3
3
|
import { findProjectConfig, resolveApiContext } from '../lib/config.js';
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
5
6
|
export const FabricDomainsAddInput = z.object({
|
|
6
7
|
hostname: z.string(),
|
|
7
8
|
target: z.enum(['api', 'app']).optional(),
|
|
@@ -18,17 +19,17 @@ export const FabricDomainsAdd = pikkuSessionlessFunc({
|
|
|
18
19
|
func: async (_services, { hostname, target = 'api', apiUrl: apiUrlOverride }) => {
|
|
19
20
|
const ctx = await resolveApiContext({ apiUrlOverride });
|
|
20
21
|
if (!ctx.token)
|
|
21
|
-
throw new
|
|
22
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
22
23
|
const local = await findProjectConfig();
|
|
23
24
|
if (!local)
|
|
24
|
-
throw new
|
|
25
|
+
throw new FabricPreconditionError('No fabric.config.json found. Run `pikku fabric link` first.');
|
|
25
26
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
26
27
|
const stagesResult = await rpc.invoke('listStages', {
|
|
27
28
|
projectId: local.config.projectId,
|
|
28
29
|
});
|
|
29
30
|
const production = stagesResult.stages.find((s) => s.type === 'production');
|
|
30
31
|
if (!production)
|
|
31
|
-
throw new
|
|
32
|
+
throw new FabricPreconditionError('No production stage exists yet — deploy the project first.');
|
|
32
33
|
const result = await rpc.invoke('addStageCustomHostname', {
|
|
33
34
|
stageId: production.stageId,
|
|
34
35
|
hostname,
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
3
3
|
import { findProjectConfig, resolveApiContext } from '../lib/config.js';
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
5
6
|
export const FabricDomainsListInput = z.object({
|
|
6
7
|
apiUrl: z.string().optional(),
|
|
7
8
|
});
|
|
@@ -15,10 +16,10 @@ export const FabricDomainsList = pikkuSessionlessFunc({
|
|
|
15
16
|
func: async (_services, { apiUrl: apiUrlOverride }) => {
|
|
16
17
|
const ctx = await resolveApiContext({ apiUrlOverride });
|
|
17
18
|
if (!ctx.token)
|
|
18
|
-
throw new
|
|
19
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
19
20
|
const local = await findProjectConfig();
|
|
20
21
|
if (!local)
|
|
21
|
-
throw new
|
|
22
|
+
throw new FabricPreconditionError('No fabric.config.json found. Run `pikku fabric link` first.');
|
|
22
23
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
23
24
|
const stagesResult = await rpc.invoke('listStages', {
|
|
24
25
|
projectId: local.config.projectId,
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
3
3
|
import { findProjectConfig, resolveApiContext } from '../lib/config.js';
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
5
6
|
export const FabricDomainsRemoveInput = z.object({
|
|
6
7
|
hostname: z.string(),
|
|
7
8
|
apiUrl: z.string().optional(),
|
|
@@ -16,23 +17,23 @@ export const FabricDomainsRemove = pikkuSessionlessFunc({
|
|
|
16
17
|
func: async (_services, { hostname, apiUrl: apiUrlOverride }) => {
|
|
17
18
|
const ctx = await resolveApiContext({ apiUrlOverride });
|
|
18
19
|
if (!ctx.token)
|
|
19
|
-
throw new
|
|
20
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
20
21
|
const local = await findProjectConfig();
|
|
21
22
|
if (!local)
|
|
22
|
-
throw new
|
|
23
|
+
throw new FabricPreconditionError('No fabric.config.json found. Run `pikku fabric link` first.');
|
|
23
24
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
24
25
|
const stagesResult = await rpc.invoke('listStages', {
|
|
25
26
|
projectId: local.config.projectId,
|
|
26
27
|
});
|
|
27
28
|
const production = stagesResult.stages.find((s) => s.type === 'production');
|
|
28
29
|
if (!production)
|
|
29
|
-
throw new
|
|
30
|
+
throw new FabricPreconditionError('No production stage found.');
|
|
30
31
|
const hostnamesResult = await rpc.invoke('listStageCustomHostnames', {
|
|
31
32
|
stageId: production.stageId,
|
|
32
33
|
});
|
|
33
34
|
const match = hostnamesResult.hostnames.find((h) => h.hostname === hostname.toLowerCase());
|
|
34
35
|
if (!match)
|
|
35
|
-
throw new
|
|
36
|
+
throw new FabricPreconditionError(`Hostname "${hostname}" is not attached to this project.`);
|
|
36
37
|
await rpc.invoke('removeStageCustomHostname', {
|
|
37
38
|
customHostnameId: match.customHostnameId,
|
|
38
39
|
});
|
|
@@ -3,6 +3,7 @@ import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
|
3
3
|
import { resolveApiContext } from '../lib/config.js';
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
5
|
import { table, removed, dim } from '../lib/output.js';
|
|
6
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
6
7
|
export const FabricErrorsInput = z.object({
|
|
7
8
|
branch: z.string().default('main'),
|
|
8
9
|
function: z.string().optional(),
|
|
@@ -23,9 +24,9 @@ export const FabricErrors = pikkuSessionlessFunc({
|
|
|
23
24
|
func: async (_services, { branch, function: functionName }) => {
|
|
24
25
|
const ctx = await resolveApiContext();
|
|
25
26
|
if (!ctx.token)
|
|
26
|
-
throw new
|
|
27
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
27
28
|
if (!ctx.projectId)
|
|
28
|
-
throw new
|
|
29
|
+
throw new FabricPreconditionError('No fabric project linked. Run `pikku fabric link` first.');
|
|
29
30
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
30
31
|
const { logs } = await rpc.invoke('getFabricLogsByStageKind', {
|
|
31
32
|
projectId: ctx.projectId,
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
3
3
|
import { resolveApiContext } from '../lib/config.js';
|
|
4
4
|
import { flushSpool } from '../lib/finding-spool.js';
|
|
5
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
5
6
|
export const FabricFindingsFlushInput = z.object({
|
|
6
7
|
apiUrl: z.string().optional(),
|
|
7
8
|
});
|
|
@@ -22,7 +23,7 @@ export const FabricFindingsFlush = pikkuSessionlessFunc({
|
|
|
22
23
|
func: async (_services, { apiUrl: apiUrlOverride }) => {
|
|
23
24
|
const ctx = await resolveApiContext({ apiUrlOverride });
|
|
24
25
|
if (!ctx.token)
|
|
25
|
-
throw new
|
|
26
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
26
27
|
const result = await flushSpool({
|
|
27
28
|
apiUrl: ctx.apiUrl,
|
|
28
29
|
token: ctx.token,
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
3
3
|
import { findProjectConfig, isLinkedProjectId, resolveApiContext, writeProjectConfig, } from '../lib/config.js';
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
5
6
|
export const FabricInitInput = z.object({
|
|
6
7
|
repo: z.string(),
|
|
7
8
|
name: z.string().optional(),
|
|
@@ -28,10 +29,10 @@ export const FabricInit = pikkuSessionlessFunc({
|
|
|
28
29
|
func: async (_services, { repo, name, branch, force, apiUrl: apiUrlOverride }) => {
|
|
29
30
|
const ctx = await resolveApiContext({ apiUrlOverride });
|
|
30
31
|
if (!ctx.token)
|
|
31
|
-
throw new
|
|
32
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
32
33
|
const existing = await findProjectConfig();
|
|
33
34
|
if (existing && isLinkedProjectId(existing.config.projectId) && !force) {
|
|
34
|
-
throw new
|
|
35
|
+
throw new FabricPreconditionError(`Already linked: ${existing.config.projectId} at ${existing.path}. Pass --force to replace.`);
|
|
35
36
|
}
|
|
36
37
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
37
38
|
const result = await rpc.invoke('importProject', {
|
|
@@ -32,10 +32,10 @@ export const FabricLink = pikkuSessionlessFunc({
|
|
|
32
32
|
func: async (_services, { apiUrl: apiUrlOverride, github, gitea, repoName }) => {
|
|
33
33
|
const ctx = await resolveApiContext({ apiUrlOverride });
|
|
34
34
|
if (!ctx.token) {
|
|
35
|
-
throw new
|
|
35
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
36
36
|
}
|
|
37
37
|
if (github && gitea) {
|
|
38
|
-
throw new
|
|
38
|
+
throw new FabricPreconditionError('--github and --gitea name two different places to keep one repo. Pass one, or neither to use whatever `origin` already points at.');
|
|
39
39
|
}
|
|
40
40
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
41
41
|
// Both of these are checked BEFORE anything is created. `assertDeploySafety`
|
|
@@ -58,7 +58,7 @@ export const FabricLink = pikkuSessionlessFunc({
|
|
|
58
58
|
const ghInstall = await rpc.invoke('checkGithubInstall', {});
|
|
59
59
|
if (!ghInstall.installed) {
|
|
60
60
|
if (!ghInstall.installUrl) {
|
|
61
|
-
throw new
|
|
61
|
+
throw new FabricPreconditionError('GitHub App is not configured on this fabric deployment.');
|
|
62
62
|
}
|
|
63
63
|
console.log('');
|
|
64
64
|
console.log(' GitHub App not installed. Connect GitHub to continue:');
|
|
@@ -78,7 +78,7 @@ export const FabricLink = pikkuSessionlessFunc({
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
if (!installed) {
|
|
81
|
-
throw new
|
|
81
|
+
throw new FabricPreconditionError('Timed out waiting for GitHub App installation. Run `pikku fabric link` again after installing.');
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -118,10 +118,10 @@ async function adoptExistingRemote({ github, gitea, }) {
|
|
|
118
118
|
const remoteUrl = await getRemoteUrl();
|
|
119
119
|
const onGithub = isGithubUrl(remoteUrl);
|
|
120
120
|
if (github && !onGithub) {
|
|
121
|
-
throw new
|
|
121
|
+
throw new FabricPreconditionError(`--github was passed, but origin is ${remoteUrl}, which is not on github.com.\nDrop the flag to link that remote, or repoint origin at the GitHub repo you meant.`);
|
|
122
122
|
}
|
|
123
123
|
if (gitea && onGithub) {
|
|
124
|
-
throw new
|
|
124
|
+
throw new FabricPreconditionError(`--gitea was passed, but origin is already ${remoteUrl}.\nDrop the flag to link the GitHub repo. To host it on fabric instead, remove the remote first (\`git remote remove origin\`) and run link again.`);
|
|
125
125
|
}
|
|
126
126
|
return remoteUrl;
|
|
127
127
|
}
|
|
@@ -141,15 +141,15 @@ async function adoptExistingRemote({ github, gitea, }) {
|
|
|
141
141
|
*/
|
|
142
142
|
async function createRemote({ rpc, github, gitea, repoName, }) {
|
|
143
143
|
if (github) {
|
|
144
|
-
throw new
|
|
144
|
+
throw new FabricPreconditionError('There is no `origin` to link, and fabric cannot create a GitHub repository for you.\nCreate it on github.com, `git remote add origin <url>`, and run `pikku fabric link` again — or pass --gitea to host it on fabric instead.');
|
|
145
145
|
}
|
|
146
146
|
if (!gitea) {
|
|
147
147
|
if (!process.stdin.isTTY) {
|
|
148
|
-
throw new
|
|
148
|
+
throw new FabricPreconditionError('There is no `origin` to link.\nPass --gitea to create a repository on fabric and push to it, or add a remote yourself and run link again.');
|
|
149
149
|
}
|
|
150
150
|
const confirmed = await promptConfirm('This project has no git remote. Create one on fabric and push this branch to it?', true);
|
|
151
151
|
if (!confirmed) {
|
|
152
|
-
throw new
|
|
152
|
+
throw new FabricPreconditionError('Nothing linked. Add a remote yourself (`git remote add origin <url>`) and run `pikku fabric link` again.');
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
const name = repoName ?? basename(process.cwd());
|
|
@@ -165,7 +165,7 @@ async function createRemote({ rpc, github, gitea, repoName, }) {
|
|
|
165
165
|
// ago — so removing it is safe, and it is what stops a retry dying on
|
|
166
166
|
// "remote origin already exists" instead of on the real problem.
|
|
167
167
|
await removeRemote('origin');
|
|
168
|
-
throw new
|
|
168
|
+
throw new FabricPreconditionError(`Created ${repo.repoUrl} but could not push to it: ${error instanceof Error ? error.message : String(error)}\nThe repository exists and is empty; push to it yourself, or run link again to get a fresh one.`);
|
|
169
169
|
}
|
|
170
170
|
console.log(`[fabric] pushed ${branch} to origin`);
|
|
171
171
|
return repo.repoUrl;
|
|
@@ -4,6 +4,7 @@ import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
|
4
4
|
import { readAuthFile, writeAuthFile, resolveApiContext, } from '../lib/config.js';
|
|
5
5
|
import { getFabricRPC } from '../lib/http.js';
|
|
6
6
|
import { deriveConsoleUrl } from '../lib/console-url.js';
|
|
7
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
7
8
|
export const FabricLoginInput = z.object({
|
|
8
9
|
apiKey: z.string().optional(),
|
|
9
10
|
token: z.string().optional(),
|
|
@@ -89,12 +90,12 @@ export const FabricLogin = pikkuSessionlessFunc({
|
|
|
89
90
|
await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS));
|
|
90
91
|
const result = await rpc.invoke('pollCliAuth', { code });
|
|
91
92
|
if (result.status === 'expired') {
|
|
92
|
-
throw new
|
|
93
|
+
throw new FabricPreconditionError('Code expired before confirmation. Run `pikku fabric login` again.');
|
|
93
94
|
}
|
|
94
95
|
// Distinct from expired: the user pressed Cancel, so stop immediately
|
|
95
96
|
// rather than sitting here until the TTL runs out.
|
|
96
97
|
if (result.status === 'rejected') {
|
|
97
|
-
throw new
|
|
98
|
+
throw new FabricPreconditionError('Sign-in was cancelled in the browser. Run `pikku fabric login` again to retry.');
|
|
98
99
|
}
|
|
99
100
|
if (result.status === 'confirmed' && result.token) {
|
|
100
101
|
const auth = await readAuthFile();
|
|
@@ -104,6 +105,6 @@ export const FabricLogin = pikkuSessionlessFunc({
|
|
|
104
105
|
return { ok: true, apiUrl };
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
|
-
throw new
|
|
108
|
+
throw new FabricPreconditionError('Login timed out.');
|
|
108
109
|
},
|
|
109
110
|
});
|
|
@@ -31,9 +31,9 @@ export const FabricLogs = pikkuSessionlessFunc({
|
|
|
31
31
|
func: async (_services, { branch, level, json, follow }) => {
|
|
32
32
|
const ctx = await resolveApiContext();
|
|
33
33
|
if (!ctx.token)
|
|
34
|
-
throw new
|
|
34
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
35
35
|
if (!ctx.projectId)
|
|
36
|
-
throw new
|
|
36
|
+
throw new FabricPreconditionError('No fabric project linked. Run `pikku fabric link` first.');
|
|
37
37
|
if (!branch)
|
|
38
38
|
throw new FabricPreconditionError('Specify --branch <branch-name>.');
|
|
39
39
|
const seen = new Set();
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
3
3
|
import { resolveApiContext } from '../lib/config.js';
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
5
6
|
export const FabricMetricsInput = z.object({
|
|
6
7
|
branch: z.string(),
|
|
7
8
|
hours: z.number().optional(),
|
|
@@ -20,9 +21,9 @@ export const FabricMetrics = pikkuSessionlessFunc({
|
|
|
20
21
|
func: async (_services, { branch, hours, function: functionName, json }) => {
|
|
21
22
|
const ctx = await resolveApiContext();
|
|
22
23
|
if (!ctx.token)
|
|
23
|
-
throw new
|
|
24
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
24
25
|
if (!ctx.projectId)
|
|
25
|
-
throw new
|
|
26
|
+
throw new FabricPreconditionError('No fabric project linked. Run `pikku fabric link` first.');
|
|
26
27
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
27
28
|
const res = await rpc.invoke('getProjectMetricsByStageKind', {
|
|
28
29
|
projectId: ctx.projectId,
|
|
@@ -3,6 +3,7 @@ import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
|
3
3
|
import { findProjectConfig, resolveApiContext } from '../lib/config.js';
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
5
|
import { dim } from '../lib/output.js';
|
|
6
|
+
import { FabricPreconditionError } from '../lib/errors.js';
|
|
6
7
|
export const FabricProjectsListInput = z.object({
|
|
7
8
|
apiUrl: z.string().optional(),
|
|
8
9
|
});
|
|
@@ -31,7 +32,7 @@ export const FabricProjectsList = pikkuSessionlessFunc({
|
|
|
31
32
|
func: async (_services, { apiUrl: apiUrlOverride }) => {
|
|
32
33
|
const ctx = await resolveApiContext({ apiUrlOverride });
|
|
33
34
|
if (!ctx.token)
|
|
34
|
-
throw new
|
|
35
|
+
throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
|
|
35
36
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
36
37
|
const { projects } = await rpc.invoke('fabricCliProjects', {});
|
|
37
38
|
const local = await findProjectConfig();
|