@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.
Files changed (297) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/console-app/assets/{abnfDiagram-N423BO3Z-W1UI4BWy.js → abnfDiagram-N423BO3Z-CG60mMUd.js} +1 -1
  3. package/console-app/assets/architecture-TIHT7OUA-DSzfLiV3.js +1 -0
  4. package/console-app/assets/{architectureDiagram-T3A2C74G-Dgnhu9J8.js → architectureDiagram-T3A2C74G-Ch6qWsLf.js} +1 -1
  5. package/console-app/assets/{blockDiagram-VBNYF7ZC-Da-H9pFU.js → blockDiagram-VBNYF7ZC-yRgqjgqW.js} +1 -1
  6. package/console-app/assets/{c4Diagram-5PPSVZJV-CPQ006DM.js → c4Diagram-5PPSVZJV-NvawOgnU.js} +1 -1
  7. package/console-app/assets/channel-DYUdcfEK.js +1 -0
  8. package/console-app/assets/{chunk-2GRJ4B5K-B3QE8g_6.js → chunk-2GRJ4B5K-BJ9-Roz7.js} +1 -1
  9. package/console-app/assets/{chunk-4I5QYGJK-D04DssN0.js → chunk-4I5QYGJK-DZwmcj48.js} +1 -1
  10. package/console-app/assets/{chunk-5RXB4S5H-CXe_vAKZ.js → chunk-5RXB4S5H-BTBwIEIt.js} +1 -1
  11. package/console-app/assets/{chunk-6Q2QTUOP-DhpMC5UR.js → chunk-6Q2QTUOP-C55aqlA-.js} +1 -1
  12. package/console-app/assets/{chunk-7Z6QIM7H-CtoQQGfm.js → chunk-7Z6QIM7H-DRmYZ-SZ.js} +1 -1
  13. package/console-app/assets/{chunk-GF5L2VYU-BovriS0p.js → chunk-GF5L2VYU-InZeM4Hr.js} +1 -1
  14. package/console-app/assets/{chunk-I66GZJ75-Goasace2.js → chunk-I66GZJ75-BNvijc65.js} +1 -1
  15. package/console-app/assets/{chunk-JQJVKLGR-Dy3HStoh.js → chunk-JQJVKLGR-CIMXqmif.js} +1 -1
  16. package/console-app/assets/{chunk-KBJHAD2P-Cm5EwbeQ.js → chunk-KBJHAD2P-C9h3FBoE.js} +1 -1
  17. package/console-app/assets/{chunk-NSK5VX7P-DZ-VVQUA.js → chunk-NSK5VX7P-lz8xBTRo.js} +1 -1
  18. package/console-app/assets/{chunk-QR6OTTB3-W5GRG-wW.js → chunk-QR6OTTB3-CjOfjLMq.js} +1 -1
  19. package/console-app/assets/{chunk-RYQCIY6F-_xvZ8Hx8.js → chunk-RYQCIY6F-CV3667Qm.js} +1 -1
  20. package/console-app/assets/{chunk-UBXNYLIW-C0L1Tpxq.js → chunk-UBXNYLIW-CBN7usxw.js} +1 -1
  21. package/console-app/assets/{chunk-W5SLKNZC-DAyLbBQq.js → chunk-W5SLKNZC-5TkpffRm.js} +1 -1
  22. package/console-app/assets/{chunk-WRU74C26-BrL4inwu.js → chunk-WRU74C26-GBek0Nby.js} +1 -1
  23. package/console-app/assets/chunk-XXDRQBXY-B3U_w_pW.js +1 -0
  24. package/console-app/assets/classDiagram-JCYQIIEL-Mg8_8GSE.js +1 -0
  25. package/console-app/assets/classDiagram-v2-OCEON4UE-Mg8_8GSE.js +1 -0
  26. package/console-app/assets/{cose-bilkent-JH36ORCC-DxHzzMQL.js → cose-bilkent-JH36ORCC-BkGyb7Kn.js} +1 -1
  27. package/console-app/assets/{cynefin-VYW2F7L2-7ytt-CDO.js → cynefin-VYW2F7L2-qMmeyMja.js} +1 -1
  28. package/console-app/assets/{cynefinDiagram-MW4NZA55-Cq-zIV7s.js → cynefinDiagram-MW4NZA55-7MuIYiO4.js} +1 -1
  29. package/console-app/assets/{dagre-Dl-9JF5i.js → dagre-BbESpUs5.js} +1 -1
  30. package/console-app/assets/{dagre-VZM6K2ZE-DLlanPb9.js → dagre-VZM6K2ZE-I6YsMazW.js} +1 -1
  31. package/console-app/assets/{diagram-7IWD3JNH-NTCRs_uw.js → diagram-7IWD3JNH-CJPB2T6d.js} +1 -1
  32. package/console-app/assets/{diagram-B4RE2ZJO-Dwf7hoRU.js → diagram-B4RE2ZJO-CmFGMFPx.js} +1 -1
  33. package/console-app/assets/{diagram-LBJQPF4R-2h_a7jsr.js → diagram-LBJQPF4R-BMzRMe8g.js} +1 -1
  34. package/console-app/assets/{diagram-Q27KOJAE-DuOfl1WJ.js → diagram-Q27KOJAE-CeJb7xQ2.js} +1 -1
  35. package/console-app/assets/{diagram-UB23O5K3-Blp2hikL.js → diagram-UB23O5K3-BQkhJgYU.js} +1 -1
  36. package/console-app/assets/{ebnfDiagram-BXEA7PRR-BwdeYz2Z.js → ebnfDiagram-BXEA7PRR-C1F_8089.js} +1 -1
  37. package/console-app/assets/{erDiagram-JOGREHBK-DY_x1XSg.js → erDiagram-JOGREHBK-DRwpdW4v.js} +1 -1
  38. package/console-app/assets/eventmodeling-45OFAUF4-C5L7A6YY.js +1 -0
  39. package/console-app/assets/flowDiagram-UKHOOZJN-D6GmsM3x.js +1 -0
  40. package/console-app/assets/{ganttDiagram-PKOTCBZU-DxiIwMWB.js → ganttDiagram-PKOTCBZU-CfsGz3Lj.js} +1 -1
  41. package/console-app/assets/{gitGraph-TEB2WS4Q-C3DsIpZV.js → gitGraph-TEB2WS4Q-BBt9AGD3.js} +1 -1
  42. package/console-app/assets/{gitGraphDiagram-DS77QQ5N-C2pPy08m.js → gitGraphDiagram-DS77QQ5N-y5WPOR-G.js} +1 -1
  43. package/console-app/assets/{index-D6aBqNnO.js → index-BmvyL35Z.js} +150 -150
  44. package/console-app/assets/{info-DKCQHKI2-FJuVYZ8D.js → info-DKCQHKI2-mYDlDDyA.js} +1 -1
  45. package/console-app/assets/{infoDiagram-6WML65LV-Bih5T82B.js → infoDiagram-6WML65LV-uOP7AjEu.js} +1 -1
  46. package/console-app/assets/{ishikawaDiagram-WSZJBQD7-jOkuIgMl.js → ishikawaDiagram-WSZJBQD7-BUMKV94t.js} +1 -1
  47. package/console-app/assets/{journeyDiagram-NVQOT4AX-CZ9yVscx.js → journeyDiagram-NVQOT4AX-C8_km86P.js} +1 -1
  48. package/console-app/assets/{kanban-definition-27J2QSJJ-Dpmgfv5c.js → kanban-definition-27J2QSJJ-Ce5oUBPR.js} +1 -1
  49. package/console-app/assets/{line-DjmQl1gv.js → line-D-6c8Gxs.js} +1 -1
  50. package/console-app/assets/{linear-B8fAzric.js → linear-CyrGkJOO.js} +1 -1
  51. package/console-app/assets/{mermaid-parser.core-BxoecV24.js → mermaid-parser.core-CYuFKArA.js} +3 -3
  52. package/console-app/assets/{mermaid.core-D2Ux-Rs7.js → mermaid.core-CXQhu3yO.js} +4 -4
  53. package/console-app/assets/{mindmap-definition-FAOFIHXS-5xpWfvPY.js → mindmap-definition-FAOFIHXS-CTMHna5d.js} +1 -1
  54. package/console-app/assets/{packet-7NZHBO7P-Bq9JPqWg.js → packet-7NZHBO7P-Bu7Wxek6.js} +1 -1
  55. package/console-app/assets/{pegDiagram-VL7TDLO6-BKWLK1GI.js → pegDiagram-VL7TDLO6-CQOikBgW.js} +1 -1
  56. package/console-app/assets/{pie-RZYD4A2V-CsGG-f-c.js → pie-RZYD4A2V-Co7qIvyZ.js} +1 -1
  57. package/console-app/assets/{pieDiagram-7S7Q4E2Y-BRy6lUc2.js → pieDiagram-7S7Q4E2Y-Dh6jYgnj.js} +1 -1
  58. package/console-app/assets/{quadrantDiagram-CIZ2JOQS-OcYHZLLg.js → quadrantDiagram-CIZ2JOQS-Boongjy-.js} +1 -1
  59. package/console-app/assets/{radar-I7S5WNFK-8MO05jdC.js → radar-I7S5WNFK-CSJyAKYA.js} +1 -1
  60. package/console-app/assets/{railroad-3IZDKUUU-CLs1yR0q.js → railroad-3IZDKUUU-DklknXem.js} +1 -1
  61. package/console-app/assets/railroad-abnf-AHOZXSZD-D-2EAJOD.js +1 -0
  62. package/console-app/assets/railroad-ebnf-EBAXGLYW-C5XxxCx7.js +1 -0
  63. package/console-app/assets/railroad-peg-LSFZ7HO6-D8fXoMuX.js +1 -0
  64. package/console-app/assets/{railroadDiagram-AXF67PYL-DjpHDwhw.js → railroadDiagram-AXF67PYL-DEapZRM_.js} +1 -1
  65. package/console-app/assets/{requirementDiagram-LRYGKXZP-CyKaqOMR.js → requirementDiagram-LRYGKXZP-CqFLtnyL.js} +1 -1
  66. package/console-app/assets/{sankeyDiagram-W5VNT64P-0WoWlmdY.js → sankeyDiagram-W5VNT64P-CNu-G1MH.js} +1 -1
  67. package/console-app/assets/{sequenceDiagram-SI44F4Z6-kd31YoP4.js → sequenceDiagram-SI44F4Z6-CoEKUR3G.js} +1 -1
  68. package/console-app/assets/{src-CGPyCqg2.js → src-C1UIZ0TF.js} +1 -1
  69. package/console-app/assets/{stateDiagram-OKZ733FA-Cwy-Xwqp.js → stateDiagram-OKZ733FA-CJka40EH.js} +1 -1
  70. package/console-app/assets/stateDiagram-v2-UEYNNEHI-Bfuo66an.js +1 -0
  71. package/console-app/assets/{swimlanes-SLNWSIFB-Cq0Pq-Qq.js → swimlanes-SLNWSIFB-Dv3MGmvW.js} +1 -1
  72. package/console-app/assets/swimlanesDiagram-ULZ7WXOC-CyQmsXKP.js +8 -0
  73. package/console-app/assets/{timeline-definition-Z64GVDOM-CgFH2I_j.js → timeline-definition-Z64GVDOM-CO8etJHi.js} +1 -1
  74. package/console-app/assets/{treeView-QDETBFTQ-CmeHYUxi.js → treeView-QDETBFTQ-BjLcvY-V.js} +1 -1
  75. package/console-app/assets/{treemap-6X3UGDF4-B6JWxyQe.js → treemap-6X3UGDF4-xC9XqGfS.js} +1 -1
  76. package/console-app/assets/{vennDiagram-T6HMQDX7-DdGYpKcz.js → vennDiagram-T6HMQDX7-CJGsYvlQ.js} +1 -1
  77. package/console-app/assets/{wardley-OPB4EBWU-BVF8AOCQ.js → wardley-OPB4EBWU-DkMc876g.js} +1 -1
  78. package/console-app/assets/{wardleyDiagram-T6FBY63Y-BUFon1WP.js → wardleyDiagram-T6FBY63Y-CTe7zAVZ.js} +1 -1
  79. package/console-app/assets/{xychartDiagram-ELKLHX3M-Bu-WJdeF.js → xychartDiagram-ELKLHX3M-CABg-MLE.js} +1 -1
  80. package/console-app/index.html +1 -1
  81. package/dist/.pikku/addon/index.d.ts +1 -1
  82. package/dist/.pikku/addon/index.js +1 -1
  83. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
  84. package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
  85. package/dist/.pikku/agent/index.d.ts +1 -1
  86. package/dist/.pikku/agent/index.js +1 -1
  87. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  88. package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
  89. package/dist/.pikku/auth/index.d.ts +1 -1
  90. package/dist/.pikku/auth/index.js +1 -1
  91. package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +1 -1
  92. package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
  93. package/dist/.pikku/channel/index.d.ts +1 -1
  94. package/dist/.pikku/channel/index.js +1 -1
  95. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  96. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  97. package/dist/.pikku/cli/index.d.ts +1 -1
  98. package/dist/.pikku/cli/index.js +1 -1
  99. package/dist/.pikku/cli/pikku-cli-channel.js +11 -1
  100. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  101. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  102. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  103. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  104. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.json +11 -0
  105. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  106. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  107. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  108. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +24 -0
  109. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  110. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  111. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  112. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  113. package/dist/.pikku/error/index.d.ts +1 -1
  114. package/dist/.pikku/error/index.js +1 -1
  115. package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
  116. package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
  117. package/dist/.pikku/function/index.d.ts +1 -1
  118. package/dist/.pikku/function/index.js +1 -1
  119. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  120. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  121. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  122. package/dist/.pikku/function/pikku-functions-meta.gen.json +75 -87
  123. package/dist/.pikku/function/pikku-functions.gen.js +3 -1
  124. package/dist/.pikku/gateway/index.d.ts +1 -1
  125. package/dist/.pikku/gateway/index.js +1 -1
  126. package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
  127. package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
  128. package/dist/.pikku/http/index.d.ts +1 -1
  129. package/dist/.pikku/http/index.js +1 -1
  130. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  131. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  132. package/dist/.pikku/mcp/index.d.ts +1 -1
  133. package/dist/.pikku/mcp/index.js +1 -1
  134. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  135. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  136. package/dist/.pikku/middleware/index.d.ts +1 -1
  137. package/dist/.pikku/middleware/index.js +1 -1
  138. package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +1 -1
  139. package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
  140. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  141. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
  142. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  143. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  144. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  145. package/dist/.pikku/queue/index.d.ts +1 -1
  146. package/dist/.pikku/queue/index.js +1 -1
  147. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  148. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  149. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  150. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  151. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  152. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  153. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -3
  154. package/dist/.pikku/scenarios/index.d.ts +1 -1
  155. package/dist/.pikku/scenarios/index.js +1 -1
  156. package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
  157. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  158. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  159. package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
  160. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  161. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  162. package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
  163. package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
  164. package/dist/.pikku/scheduler/index.d.ts +1 -1
  165. package/dist/.pikku/scheduler/index.js +1 -1
  166. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  167. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  168. package/dist/.pikku/schemas/register.gen.js +7 -5
  169. package/dist/.pikku/schemas/schemas/FabricLinkInput.schema.json +1 -1
  170. package/dist/.pikku/schemas/schemas/KnowledgeReconcileInput.schema.json +1 -0
  171. package/dist/.pikku/schemas/schemas/KnowledgeReconcileOutput.schema.json +1 -0
  172. package/dist/.pikku/scopes/index.d.ts +1 -1
  173. package/dist/.pikku/scopes/index.js +1 -1
  174. package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
  175. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
  176. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
  177. package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
  178. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  179. package/dist/.pikku/secrets/index.d.ts +1 -1
  180. package/dist/.pikku/secrets/index.js +1 -1
  181. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  182. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  183. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  184. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  185. package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
  186. package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
  187. package/dist/.pikku/setup/index.d.ts +1 -1
  188. package/dist/.pikku/setup/index.js +1 -1
  189. package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
  190. package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
  191. package/dist/.pikku/trigger/index.d.ts +1 -1
  192. package/dist/.pikku/trigger/index.js +1 -1
  193. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  194. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  195. package/dist/.pikku/variables/index.d.ts +1 -1
  196. package/dist/.pikku/variables/index.js +1 -1
  197. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  198. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  199. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  200. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  201. package/dist/.pikku/workflow/index.d.ts +1 -1
  202. package/dist/.pikku/workflow/index.js +1 -1
  203. package/dist/.pikku/workflow/meta/allWorkflow.gen.json +8 -2
  204. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  205. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  206. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  207. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  208. package/dist/bin/pikku-bin.mjs +2 -2
  209. package/dist/src/cli.wiring.js +11 -1
  210. package/dist/src/deploy/build-pipeline.js +2 -0
  211. package/dist/src/deploy/bundler/bun-bundler.js +5 -2
  212. package/dist/src/deploy/bundler/bundler.interface.d.ts +9 -1
  213. package/dist/src/deploy/bundler/bundler.js +1 -0
  214. package/dist/src/deploy/bundler/node-bundler.js +12 -2
  215. package/dist/src/deploy/bundler/service-module-map.js +2 -2
  216. package/dist/src/fabric/fabric-commands.d.ts +18 -9
  217. package/dist/src/fabric/fabric-commands.js +11 -0
  218. package/dist/src/fabric/functions/deploy.function.d.ts +5 -5
  219. package/dist/src/fabric/functions/link.function.d.ts +12 -0
  220. package/dist/src/fabric/functions/link.function.js +95 -6
  221. package/dist/src/fabric/functions/llm-key.function.d.ts +4 -4
  222. package/dist/src/fabric/functions/smoke.function.d.ts +4 -4
  223. package/dist/src/fabric/lib/git.d.ts +27 -0
  224. package/dist/src/fabric/lib/git.js +70 -2
  225. package/dist/src/functions/commands/db-export.js +4 -9
  226. package/dist/src/functions/commands/enable.d.ts +1 -0
  227. package/dist/src/functions/commands/enable.js +3 -0
  228. package/dist/src/functions/commands/knowledge-reconcile.d.ts +45 -0
  229. package/dist/src/functions/commands/knowledge-reconcile.js +11 -0
  230. package/dist/src/functions/db/local-db.d.ts +12 -2
  231. package/dist/src/functions/db/local-db.js +71 -13
  232. package/dist/src/functions/knowledge/render.d.ts +12 -1
  233. package/dist/src/functions/knowledge/render.js +48 -0
  234. package/dist/src/functions/knowledge/schemas.d.ts +23 -0
  235. package/dist/src/functions/knowledge/schemas.js +3 -1
  236. package/dist/src/functions/wirings/agent/pikku-command-agent.js +11 -14
  237. package/dist/src/functions/wirings/channels/pikku-command-channels.js +10 -13
  238. package/dist/src/functions/wirings/cli/pikku-command-cli.js +10 -13
  239. package/dist/src/functions/wirings/console/pikku-command-nodes-meta.js +7 -15
  240. package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +2 -8
  241. package/dist/src/functions/wirings/functions/pikku-command-functions.js +21 -18
  242. package/dist/src/functions/wirings/gateway/pikku-command-gateway.js +11 -10
  243. package/dist/src/functions/wirings/http/pikku-command-http-routes.js +10 -13
  244. package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +11 -17
  245. package/dist/src/functions/wirings/personas/serialize-personas-types.js +2 -2
  246. package/dist/src/functions/wirings/queue/pikku-command-queue.js +11 -14
  247. package/dist/src/functions/wirings/remote-jobs/pikku-command-remote-jobs.d.ts +1 -0
  248. package/dist/src/functions/wirings/remote-jobs/pikku-command-remote-jobs.js +31 -0
  249. package/dist/src/functions/wirings/remote-jobs/serialize-remote-jobs.d.ts +16 -0
  250. package/dist/src/functions/wirings/remote-jobs/serialize-remote-jobs.js +78 -0
  251. package/dist/src/functions/wirings/roles/serialize-roles-types.js +2 -2
  252. package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +11 -12
  253. package/dist/src/functions/wirings/scopes/serialize-scopes-client.js +2 -2
  254. package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +5 -3
  255. package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +4 -10
  256. package/dist/src/functions/wirings/triggers/pikku-command-trigger.js +11 -11
  257. package/dist/src/functions/wirings/variables/serialize-variables-types.js +2 -8
  258. package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +7 -8
  259. package/dist/src/functions/workflows/all.workflow.js +8 -0
  260. package/dist/src/services.js +23 -0
  261. package/dist/src/utils/pikku-cli-config.js +4 -0
  262. package/dist/src/utils/remote-jobs-schemas-file.d.ts +6 -0
  263. package/dist/src/utils/remote-jobs-schemas-file.js +9 -0
  264. package/dist/src/utils/remove-legacy-scaffold-file.js +3 -0
  265. package/dist/src/utils/strip-verbose-meta.d.ts +9 -10
  266. package/dist/src/utils/strip-verbose-meta.js +15 -19
  267. package/dist/src/utils/ts-literal.d.ts +7 -0
  268. package/dist/src/utils/ts-literal.js +7 -0
  269. package/dist/src/utils/write-wiring-meta.d.ts +43 -0
  270. package/dist/src/utils/write-wiring-meta.js +45 -0
  271. package/dist/tsconfig.tsbuildinfo +1 -1
  272. package/package.json +10 -10
  273. package/surface.json +15 -15
  274. package/console-app/assets/architecture-TIHT7OUA-ChuyZvLt.js +0 -1
  275. package/console-app/assets/channel-Bk5Nkkn2.js +0 -1
  276. package/console-app/assets/chunk-XXDRQBXY-CCdCi2uV.js +0 -1
  277. package/console-app/assets/classDiagram-JCYQIIEL-Dgekxp3j.js +0 -1
  278. package/console-app/assets/classDiagram-v2-OCEON4UE-Dgekxp3j.js +0 -1
  279. package/console-app/assets/eventmodeling-45OFAUF4-2ImzjrgM.js +0 -1
  280. package/console-app/assets/flowDiagram-UKHOOZJN-DmrgHe66.js +0 -1
  281. package/console-app/assets/railroad-abnf-AHOZXSZD-CA9-7Fw1.js +0 -1
  282. package/console-app/assets/railroad-ebnf-EBAXGLYW-BhkwTTAW.js +0 -1
  283. package/console-app/assets/railroad-peg-LSFZ7HO6-BEaB8UlJ.js +0 -1
  284. package/console-app/assets/stateDiagram-v2-UEYNNEHI-DExEOOCw.js +0 -1
  285. package/console-app/assets/swimlanesDiagram-ULZ7WXOC-B0RUxlCH.js +0 -8
  286. package/dist/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +0 -1
  287. package/dist/src/fabric/lib/not-implemented.d.ts +0 -5
  288. package/dist/src/fabric/lib/not-implemented.js +0 -8
  289. package/dist/src/functions/wirings/channels/pikku-channels.d.ts +0 -1
  290. package/dist/src/functions/wirings/channels/pikku-channels.js +0 -38
  291. package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +0 -1
  292. package/dist/src/functions/wirings/http/pikku-http-routes.js +0 -30
  293. package/dist/src/functions/wirings/queue/pikku-queue.d.ts +0 -1
  294. package/dist/src/functions/wirings/queue/pikku-queue.js +0 -31
  295. package/dist/src/utils/pikku-files-and-methods.d.ts +0 -20
  296. package/dist/src/utils/pikku-files-and-methods.js +0 -25
  297. /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 `export {}` module. */
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 {
@@ -172,6 +172,7 @@ export class BaseBundler {
172
172
  sourcemap,
173
173
  emitMetafile,
174
174
  deadPatterns,
175
+ mangleIdentifiers: options.mangleIdentifiers !== false,
175
176
  });
176
177
  // Metafile is large (~1.6MB/unit) and never needed at runtime — only
177
178
  // persisted for debugging.
@@ -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: 'export {}',
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
- minify: true,
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 `export {}` keeps their (often
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: "skipped" | "failed" | "passed";
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: "skipped" | "failed" | "passed";
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: "skipped" | "failed" | "passed";
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: "queued" | "failed" | "timeout" | "succeeded" | "blocked";
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: "queued" | "failed" | "timeout" | "succeeded" | "blocked";
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: "queued" | "failed" | "timeout" | "succeeded" | "blocked";
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" | "env" | "shell";
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" | "env" | "shell";
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" | "env" | "shell";
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
- timeout: "timeout";
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: "queued" | "failed" | "timeout" | "succeeded" | "blocked";
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: "queued" | "failed" | "timeout" | "succeeded" | "blocked";
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: "queued" | "failed" | "timeout" | "succeeded" | "blocked";
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
- const remoteUrl = await getRemoteUrl();
27
- const safety = await assertDeploySafety();
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
- const isGithub = /github\.com/i.test(remoteUrl);
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" | "env" | "shell";
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" | "env" | "shell";
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" | "env" | "shell";
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: "skipped" | "failed" | "passed";
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: "skipped" | "failed" | "passed";
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: "skipped" | "failed" | "passed";
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 { exportSchema } from '../db/local-db.js';
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 artifact = await exportSchema(config.rootDir, config.db?.pgliteExtensions);
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('db export: no db/sqlite or db/postgres migrations — nothing to publish');
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>;