@pikku/cli 0.12.136 → 0.12.141
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/CHANGELOG.md +117 -0
- package/console-app/assets/{abnfDiagram-N423BO3Z-W1UI4BWy.js → abnfDiagram-N423BO3Z-CG60mMUd.js} +1 -1
- package/console-app/assets/architecture-TIHT7OUA-DSzfLiV3.js +1 -0
- package/console-app/assets/{architectureDiagram-T3A2C74G-Dgnhu9J8.js → architectureDiagram-T3A2C74G-Ch6qWsLf.js} +1 -1
- package/console-app/assets/{blockDiagram-VBNYF7ZC-Da-H9pFU.js → blockDiagram-VBNYF7ZC-yRgqjgqW.js} +1 -1
- package/console-app/assets/{c4Diagram-5PPSVZJV-CPQ006DM.js → c4Diagram-5PPSVZJV-NvawOgnU.js} +1 -1
- package/console-app/assets/channel-DYUdcfEK.js +1 -0
- package/console-app/assets/{chunk-2GRJ4B5K-B3QE8g_6.js → chunk-2GRJ4B5K-BJ9-Roz7.js} +1 -1
- package/console-app/assets/{chunk-4I5QYGJK-D04DssN0.js → chunk-4I5QYGJK-DZwmcj48.js} +1 -1
- package/console-app/assets/{chunk-5RXB4S5H-CXe_vAKZ.js → chunk-5RXB4S5H-BTBwIEIt.js} +1 -1
- package/console-app/assets/{chunk-6Q2QTUOP-DhpMC5UR.js → chunk-6Q2QTUOP-C55aqlA-.js} +1 -1
- package/console-app/assets/{chunk-7Z6QIM7H-CtoQQGfm.js → chunk-7Z6QIM7H-DRmYZ-SZ.js} +1 -1
- package/console-app/assets/{chunk-GF5L2VYU-BovriS0p.js → chunk-GF5L2VYU-InZeM4Hr.js} +1 -1
- package/console-app/assets/{chunk-I66GZJ75-Goasace2.js → chunk-I66GZJ75-BNvijc65.js} +1 -1
- package/console-app/assets/{chunk-JQJVKLGR-Dy3HStoh.js → chunk-JQJVKLGR-CIMXqmif.js} +1 -1
- package/console-app/assets/{chunk-KBJHAD2P-Cm5EwbeQ.js → chunk-KBJHAD2P-C9h3FBoE.js} +1 -1
- package/console-app/assets/{chunk-NSK5VX7P-DZ-VVQUA.js → chunk-NSK5VX7P-lz8xBTRo.js} +1 -1
- package/console-app/assets/{chunk-QR6OTTB3-W5GRG-wW.js → chunk-QR6OTTB3-CjOfjLMq.js} +1 -1
- package/console-app/assets/{chunk-RYQCIY6F-_xvZ8Hx8.js → chunk-RYQCIY6F-CV3667Qm.js} +1 -1
- package/console-app/assets/{chunk-UBXNYLIW-C0L1Tpxq.js → chunk-UBXNYLIW-CBN7usxw.js} +1 -1
- package/console-app/assets/{chunk-W5SLKNZC-DAyLbBQq.js → chunk-W5SLKNZC-5TkpffRm.js} +1 -1
- package/console-app/assets/{chunk-WRU74C26-BrL4inwu.js → chunk-WRU74C26-GBek0Nby.js} +1 -1
- package/console-app/assets/chunk-XXDRQBXY-B3U_w_pW.js +1 -0
- package/console-app/assets/classDiagram-JCYQIIEL-Mg8_8GSE.js +1 -0
- package/console-app/assets/classDiagram-v2-OCEON4UE-Mg8_8GSE.js +1 -0
- package/console-app/assets/{cose-bilkent-JH36ORCC-DxHzzMQL.js → cose-bilkent-JH36ORCC-BkGyb7Kn.js} +1 -1
- package/console-app/assets/{cynefin-VYW2F7L2-7ytt-CDO.js → cynefin-VYW2F7L2-qMmeyMja.js} +1 -1
- package/console-app/assets/{cynefinDiagram-MW4NZA55-Cq-zIV7s.js → cynefinDiagram-MW4NZA55-7MuIYiO4.js} +1 -1
- package/console-app/assets/{dagre-Dl-9JF5i.js → dagre-BbESpUs5.js} +1 -1
- package/console-app/assets/{dagre-VZM6K2ZE-DLlanPb9.js → dagre-VZM6K2ZE-I6YsMazW.js} +1 -1
- package/console-app/assets/{diagram-7IWD3JNH-NTCRs_uw.js → diagram-7IWD3JNH-CJPB2T6d.js} +1 -1
- package/console-app/assets/{diagram-B4RE2ZJO-Dwf7hoRU.js → diagram-B4RE2ZJO-CmFGMFPx.js} +1 -1
- package/console-app/assets/{diagram-LBJQPF4R-2h_a7jsr.js → diagram-LBJQPF4R-BMzRMe8g.js} +1 -1
- package/console-app/assets/{diagram-Q27KOJAE-DuOfl1WJ.js → diagram-Q27KOJAE-CeJb7xQ2.js} +1 -1
- package/console-app/assets/{diagram-UB23O5K3-Blp2hikL.js → diagram-UB23O5K3-BQkhJgYU.js} +1 -1
- package/console-app/assets/{ebnfDiagram-BXEA7PRR-BwdeYz2Z.js → ebnfDiagram-BXEA7PRR-C1F_8089.js} +1 -1
- package/console-app/assets/{erDiagram-JOGREHBK-DY_x1XSg.js → erDiagram-JOGREHBK-DRwpdW4v.js} +1 -1
- package/console-app/assets/eventmodeling-45OFAUF4-C5L7A6YY.js +1 -0
- package/console-app/assets/flowDiagram-UKHOOZJN-D6GmsM3x.js +1 -0
- package/console-app/assets/{ganttDiagram-PKOTCBZU-DxiIwMWB.js → ganttDiagram-PKOTCBZU-CfsGz3Lj.js} +1 -1
- package/console-app/assets/{gitGraph-TEB2WS4Q-C3DsIpZV.js → gitGraph-TEB2WS4Q-BBt9AGD3.js} +1 -1
- package/console-app/assets/{gitGraphDiagram-DS77QQ5N-C2pPy08m.js → gitGraphDiagram-DS77QQ5N-y5WPOR-G.js} +1 -1
- package/console-app/assets/{index-D6aBqNnO.js → index-BmvyL35Z.js} +150 -150
- package/console-app/assets/{info-DKCQHKI2-FJuVYZ8D.js → info-DKCQHKI2-mYDlDDyA.js} +1 -1
- package/console-app/assets/{infoDiagram-6WML65LV-Bih5T82B.js → infoDiagram-6WML65LV-uOP7AjEu.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-WSZJBQD7-jOkuIgMl.js → ishikawaDiagram-WSZJBQD7-BUMKV94t.js} +1 -1
- package/console-app/assets/{journeyDiagram-NVQOT4AX-CZ9yVscx.js → journeyDiagram-NVQOT4AX-C8_km86P.js} +1 -1
- package/console-app/assets/{kanban-definition-27J2QSJJ-Dpmgfv5c.js → kanban-definition-27J2QSJJ-Ce5oUBPR.js} +1 -1
- package/console-app/assets/{line-DjmQl1gv.js → line-D-6c8Gxs.js} +1 -1
- package/console-app/assets/{linear-B8fAzric.js → linear-CyrGkJOO.js} +1 -1
- package/console-app/assets/{mermaid-parser.core-BxoecV24.js → mermaid-parser.core-CYuFKArA.js} +3 -3
- package/console-app/assets/{mermaid.core-D2Ux-Rs7.js → mermaid.core-CXQhu3yO.js} +4 -4
- package/console-app/assets/{mindmap-definition-FAOFIHXS-5xpWfvPY.js → mindmap-definition-FAOFIHXS-CTMHna5d.js} +1 -1
- package/console-app/assets/{packet-7NZHBO7P-Bq9JPqWg.js → packet-7NZHBO7P-Bu7Wxek6.js} +1 -1
- package/console-app/assets/{pegDiagram-VL7TDLO6-BKWLK1GI.js → pegDiagram-VL7TDLO6-CQOikBgW.js} +1 -1
- package/console-app/assets/{pie-RZYD4A2V-CsGG-f-c.js → pie-RZYD4A2V-Co7qIvyZ.js} +1 -1
- package/console-app/assets/{pieDiagram-7S7Q4E2Y-BRy6lUc2.js → pieDiagram-7S7Q4E2Y-Dh6jYgnj.js} +1 -1
- package/console-app/assets/{quadrantDiagram-CIZ2JOQS-OcYHZLLg.js → quadrantDiagram-CIZ2JOQS-Boongjy-.js} +1 -1
- package/console-app/assets/{radar-I7S5WNFK-8MO05jdC.js → radar-I7S5WNFK-CSJyAKYA.js} +1 -1
- package/console-app/assets/{railroad-3IZDKUUU-CLs1yR0q.js → railroad-3IZDKUUU-DklknXem.js} +1 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-D-2EAJOD.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-C5XxxCx7.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-D8fXoMuX.js +1 -0
- package/console-app/assets/{railroadDiagram-AXF67PYL-DjpHDwhw.js → railroadDiagram-AXF67PYL-DEapZRM_.js} +1 -1
- package/console-app/assets/{requirementDiagram-LRYGKXZP-CyKaqOMR.js → requirementDiagram-LRYGKXZP-CqFLtnyL.js} +1 -1
- package/console-app/assets/{sankeyDiagram-W5VNT64P-0WoWlmdY.js → sankeyDiagram-W5VNT64P-CNu-G1MH.js} +1 -1
- package/console-app/assets/{sequenceDiagram-SI44F4Z6-kd31YoP4.js → sequenceDiagram-SI44F4Z6-CoEKUR3G.js} +1 -1
- package/console-app/assets/{src-CGPyCqg2.js → src-C1UIZ0TF.js} +1 -1
- package/console-app/assets/{stateDiagram-OKZ733FA-Cwy-Xwqp.js → stateDiagram-OKZ733FA-CJka40EH.js} +1 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-Bfuo66an.js +1 -0
- package/console-app/assets/{swimlanes-SLNWSIFB-Cq0Pq-Qq.js → swimlanes-SLNWSIFB-Dv3MGmvW.js} +1 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-CyQmsXKP.js +8 -0
- package/console-app/assets/{timeline-definition-Z64GVDOM-CgFH2I_j.js → timeline-definition-Z64GVDOM-CO8etJHi.js} +1 -1
- package/console-app/assets/{treeView-QDETBFTQ-CmeHYUxi.js → treeView-QDETBFTQ-BjLcvY-V.js} +1 -1
- package/console-app/assets/{treemap-6X3UGDF4-B6JWxyQe.js → treemap-6X3UGDF4-xC9XqGfS.js} +1 -1
- package/console-app/assets/{vennDiagram-T6HMQDX7-DdGYpKcz.js → vennDiagram-T6HMQDX7-CJGsYvlQ.js} +1 -1
- package/console-app/assets/{wardley-OPB4EBWU-BVF8AOCQ.js → wardley-OPB4EBWU-DkMc876g.js} +1 -1
- package/console-app/assets/{wardleyDiagram-T6FBY63Y-BUFon1WP.js → wardleyDiagram-T6FBY63Y-CTe7zAVZ.js} +1 -1
- package/console-app/assets/{xychartDiagram-ELKLHX3M-Bu-WJdeF.js → xychartDiagram-ELKLHX3M-CABg-MLE.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/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 +11 -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 +11 -0
- 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 +24 -0
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/error/index.d.ts +1 -1
- package/dist/.pikku/error/index.js +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/function/index.d.ts +1 -1
- package/dist/.pikku/function/index.js +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +75 -87
- package/dist/.pikku/function/pikku-functions.gen.js +3 -1
- package/dist/.pikku/gateway/index.d.ts +1 -1
- package/dist/.pikku/gateway/index.js +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
- package/dist/.pikku/http/index.d.ts +1 -1
- package/dist/.pikku/http/index.js +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/mcp/index.d.ts +1 -1
- package/dist/.pikku/mcp/index.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/middleware/index.d.ts +1 -1
- package/dist/.pikku/middleware/index.js +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +1 -1
- package/dist/.pikku/queue/index.d.ts +1 -1
- package/dist/.pikku/queue/index.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -3
- 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 +7 -5
- package/dist/.pikku/schemas/schemas/FabricLinkInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/KnowledgeReconcileInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/KnowledgeReconcileOutput.schema.json +1 -0
- package/dist/.pikku/scopes/index.d.ts +1 -1
- package/dist/.pikku/scopes/index.js +1 -1
- package/dist/.pikku/scopes/pikku-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/meta/allWorkflow.gen.json +8 -2
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/cli.wiring.js +11 -1
- package/dist/src/deploy/build-pipeline.js +2 -0
- package/dist/src/deploy/bundler/bun-bundler.js +5 -2
- package/dist/src/deploy/bundler/bundler.interface.d.ts +9 -1
- package/dist/src/deploy/bundler/bundler.js +1 -0
- package/dist/src/deploy/bundler/node-bundler.js +12 -2
- package/dist/src/deploy/bundler/service-module-map.js +2 -2
- package/dist/src/fabric/fabric-commands.d.ts +18 -9
- package/dist/src/fabric/fabric-commands.js +11 -0
- package/dist/src/fabric/functions/deploy.function.d.ts +5 -5
- package/dist/src/fabric/functions/link.function.d.ts +12 -0
- package/dist/src/fabric/functions/link.function.js +95 -6
- package/dist/src/fabric/functions/llm-key.function.d.ts +4 -4
- package/dist/src/fabric/functions/smoke.function.d.ts +4 -4
- package/dist/src/fabric/lib/git.d.ts +27 -0
- package/dist/src/fabric/lib/git.js +70 -2
- package/dist/src/functions/commands/db-export.js +4 -9
- package/dist/src/functions/commands/enable.d.ts +1 -0
- package/dist/src/functions/commands/enable.js +3 -0
- package/dist/src/functions/commands/knowledge-reconcile.d.ts +45 -0
- package/dist/src/functions/commands/knowledge-reconcile.js +11 -0
- package/dist/src/functions/db/local-db.d.ts +12 -2
- package/dist/src/functions/db/local-db.js +71 -13
- package/dist/src/functions/knowledge/render.d.ts +12 -1
- package/dist/src/functions/knowledge/render.js +48 -0
- package/dist/src/functions/knowledge/schemas.d.ts +23 -0
- package/dist/src/functions/knowledge/schemas.js +3 -1
- package/dist/src/functions/wirings/agent/pikku-command-agent.js +11 -14
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +10 -13
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +10 -13
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.js +7 -15
- package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +2 -8
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +21 -18
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.js +11 -10
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +10 -13
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +11 -17
- package/dist/src/functions/wirings/personas/serialize-personas-types.js +2 -2
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +11 -14
- package/dist/src/functions/wirings/remote-jobs/pikku-command-remote-jobs.d.ts +1 -0
- package/dist/src/functions/wirings/remote-jobs/pikku-command-remote-jobs.js +31 -0
- package/dist/src/functions/wirings/remote-jobs/serialize-remote-jobs.d.ts +16 -0
- package/dist/src/functions/wirings/remote-jobs/serialize-remote-jobs.js +78 -0
- package/dist/src/functions/wirings/roles/serialize-roles-types.js +2 -2
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +11 -12
- package/dist/src/functions/wirings/scopes/serialize-scopes-client.js +2 -2
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +5 -3
- package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +4 -10
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.js +11 -11
- package/dist/src/functions/wirings/variables/serialize-variables-types.js +2 -8
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +7 -8
- package/dist/src/functions/workflows/all.workflow.js +8 -0
- package/dist/src/services.js +23 -0
- package/dist/src/utils/pikku-cli-config.js +4 -0
- package/dist/src/utils/remote-jobs-schemas-file.d.ts +6 -0
- package/dist/src/utils/remote-jobs-schemas-file.js +9 -0
- package/dist/src/utils/remove-legacy-scaffold-file.js +3 -0
- package/dist/src/utils/strip-verbose-meta.d.ts +9 -10
- package/dist/src/utils/strip-verbose-meta.js +15 -19
- package/dist/src/utils/ts-literal.d.ts +7 -0
- package/dist/src/utils/ts-literal.js +7 -0
- package/dist/src/utils/write-wiring-meta.d.ts +43 -0
- package/dist/src/utils/write-wiring-meta.js +45 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/surface.json +15 -15
- package/console-app/assets/architecture-TIHT7OUA-ChuyZvLt.js +0 -1
- package/console-app/assets/channel-Bk5Nkkn2.js +0 -1
- package/console-app/assets/chunk-XXDRQBXY-CCdCi2uV.js +0 -1
- package/console-app/assets/classDiagram-JCYQIIEL-Dgekxp3j.js +0 -1
- package/console-app/assets/classDiagram-v2-OCEON4UE-Dgekxp3j.js +0 -1
- package/console-app/assets/eventmodeling-45OFAUF4-2ImzjrgM.js +0 -1
- package/console-app/assets/flowDiagram-UKHOOZJN-DmrgHe66.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-CA9-7Fw1.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-BhkwTTAW.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-BEaB8UlJ.js +0 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-DExEOOCw.js +0 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-B0RUxlCH.js +0 -8
- package/dist/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +0 -1
- package/dist/src/fabric/lib/not-implemented.d.ts +0 -5
- package/dist/src/fabric/lib/not-implemented.js +0 -8
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +0 -1
- package/dist/src/functions/wirings/channels/pikku-channels.js +0 -38
- package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +0 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.js +0 -30
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +0 -1
- package/dist/src/functions/wirings/queue/pikku-queue.js +0 -31
- package/dist/src/utils/pikku-files-and-methods.d.ts +0 -20
- package/dist/src/utils/pikku-files-and-methods.js +0 -25
- /package/dist/.pikku/schemas/schemas/{PikkuHTTPOutput.schema.json → PikkuRemoteJobsOutput.schema.json} +0 -0
|
@@ -28,8 +28,14 @@ export interface CompileInput {
|
|
|
28
28
|
bannerJs?: string;
|
|
29
29
|
sourcemap: boolean;
|
|
30
30
|
emitMetafile: boolean;
|
|
31
|
-
/** Regexes for modules to replace with an empty
|
|
31
|
+
/** Regexes for modules to replace with an empty module. */
|
|
32
32
|
deadPatterns: RegExp[];
|
|
33
|
+
/**
|
|
34
|
+
* Whether the compile may rename identifiers. False when the bundle is an
|
|
35
|
+
* INPUT to a second bundler rather than the shipped artifact — see
|
|
36
|
+
* `getMangleIdentifiers` on the provider adapter.
|
|
37
|
+
*/
|
|
38
|
+
mangleIdentifiers: boolean;
|
|
33
39
|
}
|
|
34
40
|
export interface CompileResult {
|
|
35
41
|
/** Real npm package names kept external — drive the unit's package.json. */
|
|
@@ -47,6 +53,8 @@ export interface BundleUnitsOptions {
|
|
|
47
53
|
sourcemap?: boolean;
|
|
48
54
|
emitMetafile?: boolean;
|
|
49
55
|
stubModules?: string[];
|
|
56
|
+
/** Defaults to true; see {@link CompileInput.mangleIdentifiers}. */
|
|
57
|
+
mangleIdentifiers?: boolean;
|
|
50
58
|
resolveOutputDir?: (unit: DeploymentUnit, baseOutputDir: string) => string;
|
|
51
59
|
}
|
|
52
60
|
export interface Bundler {
|
|
@@ -26,8 +26,11 @@ function createDeadModuleStubPlugin(patterns) {
|
|
|
26
26
|
path: args.path,
|
|
27
27
|
namespace: 'pikku-stub',
|
|
28
28
|
}));
|
|
29
|
+
// CJS, not `export {}`: the stubbed packages are imported in every shape
|
|
30
|
+
// (`import pg from 'pg'`, `import { PostgresDialect } from 'kysely'`), and
|
|
31
|
+
// an ESM stub fails the build on each one it cannot statically satisfy.
|
|
29
32
|
build.onLoad({ filter: /.*/, namespace: 'pikku-stub' }, () => ({
|
|
30
|
-
contents: '
|
|
33
|
+
contents: 'module.exports = {}',
|
|
31
34
|
loader: 'js',
|
|
32
35
|
}));
|
|
33
36
|
},
|
|
@@ -60,7 +63,14 @@ export class NodeBundler extends BaseBundler {
|
|
|
60
63
|
// runtime (CF Workers / container), tsc is never the bundler. keepNames
|
|
61
64
|
// preserves Function.name / constructor.name so name-based reflection
|
|
62
65
|
// still works.
|
|
63
|
-
|
|
66
|
+
//
|
|
67
|
+
// Whitespace and syntax always; identifiers only when this bundle is the
|
|
68
|
+
// shipped artifact. `minify: true` cannot express that — esbuild ORs it
|
|
69
|
+
// over the granular flags, so a `minifyIdentifiers: false` beside it is
|
|
70
|
+
// silently ignored.
|
|
71
|
+
minifyWhitespace: true,
|
|
72
|
+
minifySyntax: true,
|
|
73
|
+
minifyIdentifiers: input.mangleIdentifiers,
|
|
64
74
|
keepNames: true,
|
|
65
75
|
sourcemap: input.sourcemap,
|
|
66
76
|
logLevel: 'warning',
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Mapping of service name -> npm module patterns to stub when the service is
|
|
3
3
|
* NOT required by a deployment unit. These are external packages, not gen
|
|
4
4
|
* files: a unit that doesn't wire the service never executes the code path
|
|
5
|
-
* that imports them, so replacing them with
|
|
6
|
-
* large) trees out of the bundle.
|
|
5
|
+
* that imports them, so replacing them with an empty module keeps their
|
|
6
|
+
* (often large) trees out of the bundle.
|
|
7
7
|
*
|
|
8
8
|
* The AI SDKs (@pikku/ai-vercel + @ai-sdk/* + `ai`, ~3MB) are only constructed
|
|
9
9
|
* when a model-bearing service is wired. Every other unit stubs them. The
|
|
@@ -50,7 +50,7 @@ export declare const fabricCommands: {
|
|
|
50
50
|
notes: string[];
|
|
51
51
|
steps: {
|
|
52
52
|
name: string;
|
|
53
|
-
status: "
|
|
53
|
+
status: "failed" | "passed" | "skipped";
|
|
54
54
|
durationMs: number;
|
|
55
55
|
detail?: string | undefined;
|
|
56
56
|
command?: string | undefined;
|
|
@@ -71,7 +71,7 @@ export declare const fabricCommands: {
|
|
|
71
71
|
notes: string[];
|
|
72
72
|
steps: {
|
|
73
73
|
name: string;
|
|
74
|
-
status: "
|
|
74
|
+
status: "failed" | "passed" | "skipped";
|
|
75
75
|
durationMs: number;
|
|
76
76
|
detail?: string | undefined;
|
|
77
77
|
command?: string | undefined;
|
|
@@ -92,7 +92,7 @@ export declare const fabricCommands: {
|
|
|
92
92
|
notes: string[];
|
|
93
93
|
steps: {
|
|
94
94
|
name: string;
|
|
95
|
-
status: "
|
|
95
|
+
status: "failed" | "passed" | "skipped";
|
|
96
96
|
durationMs: number;
|
|
97
97
|
detail?: string | undefined;
|
|
98
98
|
command?: string | undefined;
|
|
@@ -161,6 +161,9 @@ export declare const fabricCommands: {
|
|
|
161
161
|
}, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").WiredServices>, undefined, undefined>, import("../../.pikku/middleware/pikku-middleware-types.gen.js").PikkuMiddleware, (services: import("../../types/application-types.js").SingletonServices, data: any, session?: import("../../types/application-types.js").UserSession | undefined) => void | Promise<void>, string>;
|
|
162
162
|
link: import("@pikku/core/cli").CoreCLICommandConfig<import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionConfig<{
|
|
163
163
|
apiUrl?: string | undefined;
|
|
164
|
+
github?: boolean | undefined;
|
|
165
|
+
gitea?: boolean | undefined;
|
|
166
|
+
repoName?: string | undefined;
|
|
164
167
|
}, {
|
|
165
168
|
projectId: string;
|
|
166
169
|
projectSlug: string;
|
|
@@ -168,6 +171,9 @@ export declare const fabricCommands: {
|
|
|
168
171
|
stageId: string;
|
|
169
172
|
}, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
|
|
170
173
|
apiUrl?: string | undefined;
|
|
174
|
+
github?: boolean | undefined;
|
|
175
|
+
gitea?: boolean | undefined;
|
|
176
|
+
repoName?: string | undefined;
|
|
171
177
|
}, {
|
|
172
178
|
projectId: string;
|
|
173
179
|
projectSlug: string;
|
|
@@ -175,6 +181,9 @@ export declare const fabricCommands: {
|
|
|
175
181
|
stageId: string;
|
|
176
182
|
}, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").WiredServices, unknown> | import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunction<{
|
|
177
183
|
apiUrl?: string | undefined;
|
|
184
|
+
github?: boolean | undefined;
|
|
185
|
+
gitea?: boolean | undefined;
|
|
186
|
+
repoName?: string | undefined;
|
|
178
187
|
}, {
|
|
179
188
|
projectId: string;
|
|
180
189
|
projectSlug: string;
|
|
@@ -291,7 +300,7 @@ export declare const fabricCommands: {
|
|
|
291
300
|
json?: boolean | undefined;
|
|
292
301
|
}, {
|
|
293
302
|
event: "result";
|
|
294
|
-
outcome: "
|
|
303
|
+
outcome: "failed" | "queued" | "succeeded" | "blocked" | "timeout";
|
|
295
304
|
projectId: string;
|
|
296
305
|
deploymentId: string;
|
|
297
306
|
branch?: string | undefined;
|
|
@@ -354,7 +363,7 @@ export declare const fabricCommands: {
|
|
|
354
363
|
json?: boolean | undefined;
|
|
355
364
|
}, {
|
|
356
365
|
event: "result";
|
|
357
|
-
outcome: "
|
|
366
|
+
outcome: "failed" | "queued" | "succeeded" | "blocked" | "timeout";
|
|
358
367
|
projectId: string;
|
|
359
368
|
deploymentId: string;
|
|
360
369
|
branch?: string | undefined;
|
|
@@ -417,7 +426,7 @@ export declare const fabricCommands: {
|
|
|
417
426
|
json?: boolean | undefined;
|
|
418
427
|
}, {
|
|
419
428
|
event: "result";
|
|
420
|
-
outcome: "
|
|
429
|
+
outcome: "failed" | "queued" | "succeeded" | "blocked" | "timeout";
|
|
421
430
|
projectId: string;
|
|
422
431
|
deploymentId: string;
|
|
423
432
|
branch?: string | undefined;
|
|
@@ -1069,7 +1078,7 @@ export declare const fabricCommands: {
|
|
|
1069
1078
|
}, {
|
|
1070
1079
|
proxyUrl: string;
|
|
1071
1080
|
apiKey: string;
|
|
1072
|
-
format: "text" | "json" | "
|
|
1081
|
+
format: "text" | "json" | "shell" | "env";
|
|
1073
1082
|
}, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
|
|
1074
1083
|
shell?: boolean | undefined;
|
|
1075
1084
|
env?: boolean | undefined;
|
|
@@ -1077,7 +1086,7 @@ export declare const fabricCommands: {
|
|
|
1077
1086
|
}, {
|
|
1078
1087
|
proxyUrl: string;
|
|
1079
1088
|
apiKey: string;
|
|
1080
|
-
format: "text" | "json" | "
|
|
1089
|
+
format: "text" | "json" | "shell" | "env";
|
|
1081
1090
|
}, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").WiredServices, unknown> | import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunction<{
|
|
1082
1091
|
shell?: boolean | undefined;
|
|
1083
1092
|
env?: boolean | undefined;
|
|
@@ -1085,7 +1094,7 @@ export declare const fabricCommands: {
|
|
|
1085
1094
|
}, {
|
|
1086
1095
|
proxyUrl: string;
|
|
1087
1096
|
apiKey: string;
|
|
1088
|
-
format: "text" | "json" | "
|
|
1097
|
+
format: "text" | "json" | "shell" | "env";
|
|
1089
1098
|
}, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").WiredServices>, undefined, undefined>, import("../../.pikku/middleware/pikku-middleware-types.gen.js").PikkuMiddleware, (services: import("../../types/application-types.js").SingletonServices, data: any, session?: import("../../types/application-types.js").UserSession | undefined) => void | Promise<void>, string>;
|
|
1090
1099
|
};
|
|
1091
1100
|
};
|
|
@@ -120,6 +120,17 @@ export const fabricCommands = defineCLICommands({
|
|
|
120
120
|
func: FabricLink,
|
|
121
121
|
description: 'Register the current git repo as a fabric project and queue an initial deploy',
|
|
122
122
|
options: {
|
|
123
|
+
github: {
|
|
124
|
+
description: 'Assert the repo is on github.com (fails if origin points elsewhere)',
|
|
125
|
+
default: false,
|
|
126
|
+
},
|
|
127
|
+
gitea: {
|
|
128
|
+
description: "Host the repo on fabric's git server — creates and pushes to it when there is no origin",
|
|
129
|
+
default: false,
|
|
130
|
+
},
|
|
131
|
+
repoName: {
|
|
132
|
+
description: 'Name for a repo created by --gitea (defaults to the directory name)',
|
|
133
|
+
},
|
|
123
134
|
apiUrl: {
|
|
124
135
|
description: 'Override the fabric-api URL stored in fabric.config.json',
|
|
125
136
|
},
|
|
@@ -24,11 +24,11 @@ export declare const FabricDeployValidatedInput: z.ZodObject<{
|
|
|
24
24
|
export declare const FabricDeployApplyOutput: z.ZodObject<{
|
|
25
25
|
event: z.ZodLiteral<"result">;
|
|
26
26
|
outcome: z.ZodEnum<{
|
|
27
|
-
queued: "queued";
|
|
28
27
|
failed: "failed";
|
|
29
|
-
|
|
28
|
+
queued: "queued";
|
|
30
29
|
succeeded: "succeeded";
|
|
31
30
|
blocked: "blocked";
|
|
31
|
+
timeout: "timeout";
|
|
32
32
|
}>;
|
|
33
33
|
projectId: z.ZodString;
|
|
34
34
|
deploymentId: z.ZodString;
|
|
@@ -111,7 +111,7 @@ export declare const FabricDeployApply: import("../../../.pikku/function/pikku-f
|
|
|
111
111
|
json?: boolean | undefined;
|
|
112
112
|
}, {
|
|
113
113
|
event: "result";
|
|
114
|
-
outcome: "
|
|
114
|
+
outcome: "failed" | "queued" | "succeeded" | "blocked" | "timeout";
|
|
115
115
|
projectId: string;
|
|
116
116
|
deploymentId: string;
|
|
117
117
|
branch?: string | undefined;
|
|
@@ -174,7 +174,7 @@ export declare const FabricDeployApply: import("../../../.pikku/function/pikku-f
|
|
|
174
174
|
json?: boolean | undefined;
|
|
175
175
|
}, {
|
|
176
176
|
event: "result";
|
|
177
|
-
outcome: "
|
|
177
|
+
outcome: "failed" | "queued" | "succeeded" | "blocked" | "timeout";
|
|
178
178
|
projectId: string;
|
|
179
179
|
deploymentId: string;
|
|
180
180
|
branch?: string | undefined;
|
|
@@ -237,7 +237,7 @@ export declare const FabricDeployApply: import("../../../.pikku/function/pikku-f
|
|
|
237
237
|
json?: boolean | undefined;
|
|
238
238
|
}, {
|
|
239
239
|
event: "result";
|
|
240
|
-
outcome: "
|
|
240
|
+
outcome: "failed" | "queued" | "succeeded" | "blocked" | "timeout";
|
|
241
241
|
projectId: string;
|
|
242
242
|
deploymentId: string;
|
|
243
243
|
branch?: string | undefined;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const FabricLinkInput: z.ZodObject<{
|
|
3
3
|
apiUrl: z.ZodOptional<z.ZodString>;
|
|
4
|
+
github: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
gitea: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
repoName: z.ZodOptional<z.ZodString>;
|
|
4
7
|
}, z.core.$strip>;
|
|
5
8
|
export declare const FabricLinkOutput: z.ZodObject<{
|
|
6
9
|
projectId: z.ZodString;
|
|
@@ -10,6 +13,9 @@ export declare const FabricLinkOutput: z.ZodObject<{
|
|
|
10
13
|
}, z.core.$strip>;
|
|
11
14
|
export declare const FabricLink: import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionConfig<{
|
|
12
15
|
apiUrl?: string | undefined;
|
|
16
|
+
github?: boolean | undefined;
|
|
17
|
+
gitea?: boolean | undefined;
|
|
18
|
+
repoName?: string | undefined;
|
|
13
19
|
}, {
|
|
14
20
|
projectId: string;
|
|
15
21
|
projectSlug: string;
|
|
@@ -17,6 +23,9 @@ export declare const FabricLink: import("../../../.pikku/function/pikku-function
|
|
|
17
23
|
stageId: string;
|
|
18
24
|
}, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
|
|
19
25
|
apiUrl?: string | undefined;
|
|
26
|
+
github?: boolean | undefined;
|
|
27
|
+
gitea?: boolean | undefined;
|
|
28
|
+
repoName?: string | undefined;
|
|
20
29
|
}, {
|
|
21
30
|
projectId: string;
|
|
22
31
|
projectSlug: string;
|
|
@@ -24,6 +33,9 @@ export declare const FabricLink: import("../../../.pikku/function/pikku-function
|
|
|
24
33
|
stageId: string;
|
|
25
34
|
}, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").WiredServices, unknown> | import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunction<{
|
|
26
35
|
apiUrl?: string | undefined;
|
|
36
|
+
github?: boolean | undefined;
|
|
37
|
+
gitea?: boolean | undefined;
|
|
38
|
+
repoName?: string | undefined;
|
|
27
39
|
}, {
|
|
28
40
|
projectId: string;
|
|
29
41
|
projectSlug: string;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { basename } from 'node:path';
|
|
2
3
|
import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
|
|
3
4
|
import { resolveApiContext, writeProjectConfig } from '../lib/config.js';
|
|
4
5
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
|
-
import { assertDeploySafety, getRemoteUrl } from '../lib/git.js';
|
|
6
|
+
import { addRemote, assertDeploySafety, currentBranch, getRemoteUrl, hasCommits, hasRemote, isWorkingTreeClean, pushWithCredential, removeRemote, } from '../lib/git.js';
|
|
7
|
+
import { promptConfirm } from '../lib/prompt.js';
|
|
6
8
|
export const FabricLinkInput = z.object({
|
|
7
9
|
apiUrl: z.string().optional(),
|
|
10
|
+
/** Assert the project lives on GitHub. */
|
|
11
|
+
github: z.boolean().optional(),
|
|
12
|
+
/** Assert — or, with no `origin`, request — a repo on Fabric's git server. */
|
|
13
|
+
gitea: z.boolean().optional(),
|
|
14
|
+
/** Name for a repo created here. Defaults to the directory name. */
|
|
15
|
+
repoName: z.string().optional(),
|
|
8
16
|
});
|
|
9
17
|
export const FabricLinkOutput = z.object({
|
|
10
18
|
projectId: z.string(),
|
|
@@ -14,22 +22,38 @@ export const FabricLinkOutput = z.object({
|
|
|
14
22
|
});
|
|
15
23
|
const GITHUB_POLL_INTERVAL_MS = 2000;
|
|
16
24
|
const GITHUB_POLL_TIMEOUT_MS = 5 * 60 * 1000;
|
|
25
|
+
/** github.com or not. Everything else Fabric supports is reached the Gitea way. */
|
|
26
|
+
const isGithubUrl = (url) => /github\.com/i.test(url);
|
|
17
27
|
export const FabricLink = pikkuSessionlessFunc({
|
|
18
28
|
description: 'Register the current git repo as a fabric project and queue an initial deploy.',
|
|
19
29
|
input: FabricLinkInput,
|
|
20
30
|
output: FabricLinkOutput,
|
|
21
|
-
func: async (_services, { apiUrl: apiUrlOverride }) => {
|
|
31
|
+
func: async (_services, { apiUrl: apiUrlOverride, github, gitea, repoName }) => {
|
|
22
32
|
const ctx = await resolveApiContext({ apiUrlOverride });
|
|
23
33
|
if (!ctx.token) {
|
|
24
34
|
throw new Error('Not logged in. Run `pikku fabric login` first.');
|
|
25
35
|
}
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
if (github && gitea) {
|
|
37
|
+
throw new Error('--github and --gitea name two different places to keep one repo. Pass one, or neither to use whatever `origin` already points at.');
|
|
38
|
+
}
|
|
28
39
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|
|
40
|
+
// Both of these are checked BEFORE anything is created. `assertDeploySafety`
|
|
41
|
+
// below covers them too, but it runs after the repo exists — and refusing to
|
|
42
|
+
// link because of a dirty tree, having already provisioned a repo the user
|
|
43
|
+
// now has to clean up, is a worse answer than refusing first.
|
|
44
|
+
if (!(await hasCommits())) {
|
|
45
|
+
throw new Error('Nothing to link: this repository has no commits yet. Commit your work first — fabric deploys a pushed commit, not a working directory.');
|
|
46
|
+
}
|
|
47
|
+
if (!(await isWorkingTreeClean())) {
|
|
48
|
+
throw new Error('Deployment blocked: uncommitted changes detected.\nCommit and push your changes before deploying.');
|
|
49
|
+
}
|
|
50
|
+
const remoteUrl = (await hasRemote())
|
|
51
|
+
? await adoptExistingRemote({ github, gitea })
|
|
52
|
+
: await createRemote({ rpc, github, gitea, repoName });
|
|
53
|
+
const safety = await assertDeploySafety();
|
|
29
54
|
// Only check GitHub App installation for github.com repos.
|
|
30
55
|
// Gitea (local dev) and other hosts use shared tokens — no App needed.
|
|
31
|
-
|
|
32
|
-
if (isGithub) {
|
|
56
|
+
if (isGithubUrl(remoteUrl)) {
|
|
33
57
|
const ghInstall = await rpc.invoke('checkGithubInstall', {});
|
|
34
58
|
if (!ghInstall.installed) {
|
|
35
59
|
if (!ghInstall.installUrl) {
|
|
@@ -80,3 +104,68 @@ export const FabricLink = pikkuSessionlessFunc({
|
|
|
80
104
|
};
|
|
81
105
|
},
|
|
82
106
|
});
|
|
107
|
+
/**
|
|
108
|
+
* The common case: `origin` exists, so that is the repo, whichever host it is on.
|
|
109
|
+
*
|
|
110
|
+
* The flags are read as ASSERTIONS here rather than as instructions. `--gitea`
|
|
111
|
+
* against a github.com origin could plausibly mean "move this to Fabric's git
|
|
112
|
+
* server", but re-pointing somebody's `origin` is not something a link command
|
|
113
|
+
* should decide on its own — so it is a question, answered by an error that says
|
|
114
|
+
* what to do instead.
|
|
115
|
+
*/
|
|
116
|
+
async function adoptExistingRemote({ github, gitea, }) {
|
|
117
|
+
const remoteUrl = await getRemoteUrl();
|
|
118
|
+
const onGithub = isGithubUrl(remoteUrl);
|
|
119
|
+
if (github && !onGithub) {
|
|
120
|
+
throw new Error(`--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.`);
|
|
121
|
+
}
|
|
122
|
+
if (gitea && onGithub) {
|
|
123
|
+
throw new Error(`--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.`);
|
|
124
|
+
}
|
|
125
|
+
return remoteUrl;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* No `origin` — the case `link` used to fail on with a bare "no such remote".
|
|
129
|
+
*
|
|
130
|
+
* Fabric creates the repo on its own git server and pushes to it, then the
|
|
131
|
+
* caller carries on down the ordinary import path. It does NOT create GitHub
|
|
132
|
+
* repos: doing that on the user's behalf needs a separate consent (a device-flow
|
|
133
|
+
* authorization against their GitHub account), and the Fabric GitHub App cannot
|
|
134
|
+
* stand in for it without asking every existing installation to re-approve an
|
|
135
|
+
* `administration: write` permission.
|
|
136
|
+
*
|
|
137
|
+
* Nothing here happens unasked. Without a flag the user is asked, and a session
|
|
138
|
+
* with nobody at the terminal is told which flag to pass instead of hanging on a
|
|
139
|
+
* prompt no one will answer.
|
|
140
|
+
*/
|
|
141
|
+
async function createRemote({ rpc, github, gitea, repoName, }) {
|
|
142
|
+
if (github) {
|
|
143
|
+
throw new Error('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.');
|
|
144
|
+
}
|
|
145
|
+
if (!gitea) {
|
|
146
|
+
if (!process.stdin.isTTY) {
|
|
147
|
+
throw new Error('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.');
|
|
148
|
+
}
|
|
149
|
+
const confirmed = await promptConfirm('This project has no git remote. Create one on fabric and push this branch to it?', true);
|
|
150
|
+
if (!confirmed) {
|
|
151
|
+
throw new Error('Nothing linked. Add a remote yourself (`git remote add origin <url>`) and run `pikku fabric link` again.');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const name = repoName ?? basename(process.cwd());
|
|
155
|
+
const branch = await currentBranch();
|
|
156
|
+
const repo = await rpc.invoke('provisionRepo', { name });
|
|
157
|
+
console.log(`[fabric] created ${repo.repoUrl}`);
|
|
158
|
+
await addRemote('origin', repo.cloneUrl);
|
|
159
|
+
try {
|
|
160
|
+
await pushWithCredential('origin', branch, repo);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
// Leave no half-linked repository behind. The remote is ours — added a line
|
|
164
|
+
// ago — so removing it is safe, and it is what stops a retry dying on
|
|
165
|
+
// "remote origin already exists" instead of on the real problem.
|
|
166
|
+
await removeRemote('origin');
|
|
167
|
+
throw new Error(`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.`);
|
|
168
|
+
}
|
|
169
|
+
console.log(`[fabric] pushed ${branch} to origin`);
|
|
170
|
+
return repo.repoUrl;
|
|
171
|
+
}
|
|
@@ -10,8 +10,8 @@ export declare const FabricLLMKeyOutput: z.ZodObject<{
|
|
|
10
10
|
format: z.ZodEnum<{
|
|
11
11
|
text: "text";
|
|
12
12
|
json: "json";
|
|
13
|
-
env: "env";
|
|
14
13
|
shell: "shell";
|
|
14
|
+
env: "env";
|
|
15
15
|
}>;
|
|
16
16
|
}, z.core.$strip>;
|
|
17
17
|
export declare const FabricLLMKey: import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionConfig<{
|
|
@@ -21,7 +21,7 @@ export declare const FabricLLMKey: import("../../../.pikku/function/pikku-functi
|
|
|
21
21
|
}, {
|
|
22
22
|
proxyUrl: string;
|
|
23
23
|
apiKey: string;
|
|
24
|
-
format: "text" | "json" | "
|
|
24
|
+
format: "text" | "json" | "shell" | "env";
|
|
25
25
|
}, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
|
|
26
26
|
shell?: boolean | undefined;
|
|
27
27
|
env?: boolean | undefined;
|
|
@@ -29,7 +29,7 @@ export declare const FabricLLMKey: import("../../../.pikku/function/pikku-functi
|
|
|
29
29
|
}, {
|
|
30
30
|
proxyUrl: string;
|
|
31
31
|
apiKey: string;
|
|
32
|
-
format: "text" | "json" | "
|
|
32
|
+
format: "text" | "json" | "shell" | "env";
|
|
33
33
|
}, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").WiredServices, unknown> | import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunction<{
|
|
34
34
|
shell?: boolean | undefined;
|
|
35
35
|
env?: boolean | undefined;
|
|
@@ -37,7 +37,7 @@ export declare const FabricLLMKey: import("../../../.pikku/function/pikku-functi
|
|
|
37
37
|
}, {
|
|
38
38
|
proxyUrl: string;
|
|
39
39
|
apiKey: string;
|
|
40
|
-
format: "text" | "json" | "
|
|
40
|
+
format: "text" | "json" | "shell" | "env";
|
|
41
41
|
}, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").WiredServices>, undefined, undefined>;
|
|
42
42
|
export declare const renderLLMKey: (_services: unknown, data: {
|
|
43
43
|
proxyUrl: string;
|
|
@@ -15,9 +15,9 @@ export declare const FabricSmokeOutput: z.ZodObject<{
|
|
|
15
15
|
steps: z.ZodArray<z.ZodObject<{
|
|
16
16
|
name: z.ZodString;
|
|
17
17
|
status: z.ZodEnum<{
|
|
18
|
-
skipped: "skipped";
|
|
19
18
|
failed: "failed";
|
|
20
19
|
passed: "passed";
|
|
20
|
+
skipped: "skipped";
|
|
21
21
|
}>;
|
|
22
22
|
durationMs: z.ZodNumber;
|
|
23
23
|
detail: z.ZodOptional<z.ZodString>;
|
|
@@ -40,7 +40,7 @@ export declare const FabricSmoke: import("../../../.pikku/function/pikku-functio
|
|
|
40
40
|
notes: string[];
|
|
41
41
|
steps: {
|
|
42
42
|
name: string;
|
|
43
|
-
status: "
|
|
43
|
+
status: "failed" | "passed" | "skipped";
|
|
44
44
|
durationMs: number;
|
|
45
45
|
detail?: string | undefined;
|
|
46
46
|
command?: string | undefined;
|
|
@@ -61,7 +61,7 @@ export declare const FabricSmoke: import("../../../.pikku/function/pikku-functio
|
|
|
61
61
|
notes: string[];
|
|
62
62
|
steps: {
|
|
63
63
|
name: string;
|
|
64
|
-
status: "
|
|
64
|
+
status: "failed" | "passed" | "skipped";
|
|
65
65
|
durationMs: number;
|
|
66
66
|
detail?: string | undefined;
|
|
67
67
|
command?: string | undefined;
|
|
@@ -82,7 +82,7 @@ export declare const FabricSmoke: import("../../../.pikku/function/pikku-functio
|
|
|
82
82
|
notes: string[];
|
|
83
83
|
steps: {
|
|
84
84
|
name: string;
|
|
85
|
-
status: "
|
|
85
|
+
status: "failed" | "passed" | "skipped";
|
|
86
86
|
durationMs: number;
|
|
87
87
|
detail?: string | undefined;
|
|
88
88
|
command?: string | undefined;
|
|
@@ -74,3 +74,30 @@ export declare function isTracked(relPath: string, cwd?: string): Promise<boolea
|
|
|
74
74
|
* the file" from "there is no repository", which are the same `false` there.
|
|
75
75
|
*/
|
|
76
76
|
export declare function isGitRepo(cwd?: string): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Does this repository have the given remote?
|
|
79
|
+
*
|
|
80
|
+
* Separate from `getRemoteUrl` throwing, because "no origin" is an ordinary
|
|
81
|
+
* state that `link` acts on rather than an error it reports: a developer who
|
|
82
|
+
* has not pushed anywhere yet is exactly who repo provisioning is for.
|
|
83
|
+
*/
|
|
84
|
+
export declare function hasRemote(remote?: string, cwd?: string): Promise<boolean>;
|
|
85
|
+
/** Does HEAD resolve? False in a repository with no commits yet. */
|
|
86
|
+
export declare function hasCommits(cwd?: string): Promise<boolean>;
|
|
87
|
+
export declare function addRemote(name: string, url: string, cwd?: string): Promise<void>;
|
|
88
|
+
export declare function removeRemote(name: string, cwd?: string): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Push `branch` to `remote` and set it as upstream, authenticating with a
|
|
91
|
+
* one-shot credential.
|
|
92
|
+
*
|
|
93
|
+
* The credential is passed through the ENVIRONMENT and read back by an inline
|
|
94
|
+
* credential helper, rather than embedded in the remote URL. Both a URL like
|
|
95
|
+
* `https://user:token@host/...` and `-c http.<url>.extraheader=...` put the
|
|
96
|
+
* secret in the process's argv, where any other user on the machine can read it
|
|
97
|
+
* out of `ps`. This way argv holds only the shape of the helper, and the token
|
|
98
|
+
* never reaches `.git/config` either — so it cannot outlive the push.
|
|
99
|
+
*/
|
|
100
|
+
export declare function pushWithCredential(remote: string, branch: string, credential: {
|
|
101
|
+
username: string;
|
|
102
|
+
password: string;
|
|
103
|
+
}, cwd?: string): Promise<void>;
|
|
@@ -41,11 +41,11 @@ function envWithoutInheritedRepo() {
|
|
|
41
41
|
}
|
|
42
42
|
return env;
|
|
43
43
|
}
|
|
44
|
-
function git(args, cwd = process.cwd()) {
|
|
44
|
+
function git(args, cwd = process.cwd(), extraEnv) {
|
|
45
45
|
return new Promise((resolve, reject) => {
|
|
46
46
|
const child = spawn('git', args, {
|
|
47
47
|
cwd,
|
|
48
|
-
env: envWithoutInheritedRepo(),
|
|
48
|
+
env: { ...envWithoutInheritedRepo(), ...extraEnv },
|
|
49
49
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
50
50
|
});
|
|
51
51
|
let stdout = '';
|
|
@@ -218,3 +218,71 @@ export async function isGitRepo(cwd = process.cwd()) {
|
|
|
218
218
|
return false;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* Does this repository have the given remote?
|
|
223
|
+
*
|
|
224
|
+
* Separate from `getRemoteUrl` throwing, because "no origin" is an ordinary
|
|
225
|
+
* state that `link` acts on rather than an error it reports: a developer who
|
|
226
|
+
* has not pushed anywhere yet is exactly who repo provisioning is for.
|
|
227
|
+
*/
|
|
228
|
+
export async function hasRemote(remote = 'origin', cwd) {
|
|
229
|
+
try {
|
|
230
|
+
await git(['remote', 'get-url', remote], cwd);
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/** Does HEAD resolve? False in a repository with no commits yet. */
|
|
238
|
+
export async function hasCommits(cwd) {
|
|
239
|
+
try {
|
|
240
|
+
await git(['rev-parse', '--verify', 'HEAD'], cwd);
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
catch {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
export async function addRemote(name, url, cwd) {
|
|
248
|
+
await git(['remote', 'add', name, url], cwd);
|
|
249
|
+
}
|
|
250
|
+
export async function removeRemote(name, cwd) {
|
|
251
|
+
try {
|
|
252
|
+
await git(['remote', 'remove', name], cwd);
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
/* best-effort: only used to undo a remote we just added */
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Push `branch` to `remote` and set it as upstream, authenticating with a
|
|
260
|
+
* one-shot credential.
|
|
261
|
+
*
|
|
262
|
+
* The credential is passed through the ENVIRONMENT and read back by an inline
|
|
263
|
+
* credential helper, rather than embedded in the remote URL. Both a URL like
|
|
264
|
+
* `https://user:token@host/...` and `-c http.<url>.extraheader=...` put the
|
|
265
|
+
* secret in the process's argv, where any other user on the machine can read it
|
|
266
|
+
* out of `ps`. This way argv holds only the shape of the helper, and the token
|
|
267
|
+
* never reaches `.git/config` either — so it cannot outlive the push.
|
|
268
|
+
*/
|
|
269
|
+
export async function pushWithCredential(remote, branch, credential, cwd) {
|
|
270
|
+
await git([
|
|
271
|
+
'-c',
|
|
272
|
+
'credential.helper=',
|
|
273
|
+
'-c',
|
|
274
|
+
'credential.helper=!f() { echo "username=$PIKKU_GIT_USERNAME"; echo "password=$PIKKU_GIT_PASSWORD"; }; f',
|
|
275
|
+
'push',
|
|
276
|
+
'-u',
|
|
277
|
+
remote,
|
|
278
|
+
`HEAD:refs/heads/${branch}`,
|
|
279
|
+
], cwd, {
|
|
280
|
+
PIKKU_GIT_USERNAME: credential.username,
|
|
281
|
+
PIKKU_GIT_PASSWORD: credential.password,
|
|
282
|
+
// Any configured interactive helper (osxkeychain, a GUI prompt) would be
|
|
283
|
+
// consulted first and could hang a CLI with no one at the terminal. The
|
|
284
|
+
// empty `credential.helper=` above resets the inherited list; this stops
|
|
285
|
+
// git falling back to a terminal prompt if ours somehow yields nothing.
|
|
286
|
+
GIT_TERMINAL_PROMPT: '0',
|
|
287
|
+
});
|
|
288
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
3
1
|
import { pikkuSessionlessFunc } from '#pikku/function';
|
|
4
|
-
import {
|
|
2
|
+
import { writeSchemaArtifact } from '../db/local-db.js';
|
|
5
3
|
/**
|
|
6
4
|
* Publish this package's schema so a project consuming it as an addon can
|
|
7
5
|
* create its tables.
|
|
@@ -16,15 +14,12 @@ import { exportSchema } from '../db/local-db.js';
|
|
|
16
14
|
export const dbExport = pikkuSessionlessFunc({
|
|
17
15
|
remote: true,
|
|
18
16
|
func: async ({ logger, config }) => {
|
|
19
|
-
const
|
|
20
|
-
const dialects = Object.keys(artifact);
|
|
17
|
+
const { file, dialects } = await writeSchemaArtifact(config.rootDir, config.outDir, config.db?.pgliteExtensions);
|
|
21
18
|
if (dialects.length === 0) {
|
|
22
|
-
logger.info(
|
|
19
|
+
logger.info(`db export: no db/sqlite or db/postgres migrations — wrote ${file} empty, ` +
|
|
20
|
+
'which is how a consumer tells "no tables" from "never published"');
|
|
23
21
|
return;
|
|
24
22
|
}
|
|
25
|
-
const file = join(config.outDir, 'db', 'pikku-db-meta.gen.json');
|
|
26
|
-
mkdirSync(dirname(file), { recursive: true });
|
|
27
|
-
writeFileSync(file, `${JSON.stringify(artifact, null, 2)}\n`, 'utf8');
|
|
28
23
|
logger.info(`db export: wrote ${file} for ${dialects.join(', ')}`);
|
|
29
24
|
logger.info(' Ship it with the package — a consumer resolves it through the package name.');
|
|
30
25
|
},
|
|
@@ -5,4 +5,5 @@ export declare const enableAgent: import("#pikku/function").PikkuFunctionConfig<
|
|
|
5
5
|
export declare const enableWorkflow: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<void, void, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
|
|
6
6
|
export declare const enableEvents: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<void, void, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
|
|
7
7
|
export declare const enableRemoteRpc: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<void, void, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
|
|
8
|
+
export declare const enableRemoteJobs: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<void, void, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
|
|
8
9
|
export declare const enableWebhook: import("#pikku/function").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<void, void, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
|