@pikku/cli 0.12.127 → 0.12.133

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 (289) hide show
  1. package/CHANGELOG.md +322 -0
  2. package/console-app/assets/{abnfDiagram-N423BO3Z-BY2LM8wi.js → abnfDiagram-N423BO3Z-BQPUva28.js} +1 -1
  3. package/console-app/assets/architecture-TIHT7OUA-G_ldr-C2.js +1 -0
  4. package/console-app/assets/{architectureDiagram-T3A2C74G-CeqjY3Kw.js → architectureDiagram-T3A2C74G-Cjzy66o9.js} +1 -1
  5. package/console-app/assets/{blockDiagram-VBNYF7ZC-BW5174xj.js → blockDiagram-VBNYF7ZC-DVasSXpX.js} +1 -1
  6. package/console-app/assets/{c4Diagram-5PPSVZJV-B7zXAFL0.js → c4Diagram-5PPSVZJV-FB0YMoOr.js} +1 -1
  7. package/console-app/assets/channel-CuDpOUYn.js +1 -0
  8. package/console-app/assets/{chunk-2GRJ4B5K-BfRYzQ4t.js → chunk-2GRJ4B5K-BLGsmyy4.js} +1 -1
  9. package/console-app/assets/{chunk-4I5QYGJK-DBA7-Nu4.js → chunk-4I5QYGJK-DCgTj78f.js} +1 -1
  10. package/console-app/assets/{chunk-5RXB4S5H-D03lNzwi.js → chunk-5RXB4S5H-CX9hS68x.js} +1 -1
  11. package/console-app/assets/{chunk-6Q2QTUOP-DloGRHJZ.js → chunk-6Q2QTUOP-xrgFRP4Y.js} +1 -1
  12. package/console-app/assets/{chunk-7Z6QIM7H-DH3uHtl2.js → chunk-7Z6QIM7H-CbBMe7ej.js} +1 -1
  13. package/console-app/assets/{chunk-GF5L2VYU-Cu252lza.js → chunk-GF5L2VYU-BXraqZ7w.js} +1 -1
  14. package/console-app/assets/{chunk-I66GZJ75-DH54FcuO.js → chunk-I66GZJ75-CbpQtX8e.js} +1 -1
  15. package/console-app/assets/{chunk-JQJVKLGR-CeFuTL-V.js → chunk-JQJVKLGR-Cp9FHSH6.js} +1 -1
  16. package/console-app/assets/{chunk-KBJHAD2P-B-prFo0-.js → chunk-KBJHAD2P-Brvmen34.js} +1 -1
  17. package/console-app/assets/{chunk-NSK5VX7P-C10iA4GS.js → chunk-NSK5VX7P-Bo-dbDZD.js} +1 -1
  18. package/console-app/assets/{chunk-QR6OTTB3-Cd8apAsA.js → chunk-QR6OTTB3-B5Al5KEo.js} +1 -1
  19. package/console-app/assets/{chunk-RYQCIY6F-rfPUp2Fj.js → chunk-RYQCIY6F-WOZyn5It.js} +1 -1
  20. package/console-app/assets/{chunk-UBXNYLIW-D25wqJBc.js → chunk-UBXNYLIW-D9OoHV5X.js} +1 -1
  21. package/console-app/assets/{chunk-W5SLKNZC-CJvxkxuK.js → chunk-W5SLKNZC-BNTcVpi3.js} +1 -1
  22. package/console-app/assets/{chunk-WRU74C26-B9Wju92P.js → chunk-WRU74C26-DXijYjrx.js} +1 -1
  23. package/console-app/assets/chunk-XXDRQBXY-DRMEt0Gf.js +1 -0
  24. package/console-app/assets/classDiagram-JCYQIIEL-Bjgk6QkN.js +1 -0
  25. package/console-app/assets/classDiagram-v2-OCEON4UE-Bjgk6QkN.js +1 -0
  26. package/console-app/assets/{cose-bilkent-JH36ORCC-CwA1VCP5.js → cose-bilkent-JH36ORCC-CPN5VkQC.js} +1 -1
  27. package/console-app/assets/{cynefin-VYW2F7L2-C_qsD7eR.js → cynefin-VYW2F7L2-CuBPO3Z0.js} +1 -1
  28. package/console-app/assets/{cynefinDiagram-MW4NZA55-CkSLreFW.js → cynefinDiagram-MW4NZA55-BYc2PGXv.js} +1 -1
  29. package/console-app/assets/{dagre-WqgBlKb7.js → dagre-7HV9Jfb_.js} +1 -1
  30. package/console-app/assets/{dagre-VZM6K2ZE-0ssqLoHs.js → dagre-VZM6K2ZE-BpPyuM7i.js} +1 -1
  31. package/console-app/assets/{diagram-7IWD3JNH-DmRL3lmL.js → diagram-7IWD3JNH-DTH9ID9z.js} +1 -1
  32. package/console-app/assets/{diagram-B4RE2ZJO-Bsr9wG4I.js → diagram-B4RE2ZJO-DwZb9gPm.js} +1 -1
  33. package/console-app/assets/{diagram-LBJQPF4R-DdMw1FSY.js → diagram-LBJQPF4R-DfvBayzk.js} +1 -1
  34. package/console-app/assets/{diagram-Q27KOJAE-TPx5TB2B.js → diagram-Q27KOJAE-hksFpSxs.js} +1 -1
  35. package/console-app/assets/{diagram-UB23O5K3-e_1zSlZR.js → diagram-UB23O5K3-5hEVCouO.js} +1 -1
  36. package/console-app/assets/{ebnfDiagram-BXEA7PRR-BACajh2b.js → ebnfDiagram-BXEA7PRR-D0v6RJvf.js} +1 -1
  37. package/console-app/assets/{erDiagram-JOGREHBK-CojomKqL.js → erDiagram-JOGREHBK-DGps-M4l.js} +1 -1
  38. package/console-app/assets/eventmodeling-45OFAUF4-DWRslJcU.js +1 -0
  39. package/console-app/assets/flowDiagram-UKHOOZJN-CE3qN_pH.js +1 -0
  40. package/console-app/assets/{ganttDiagram-PKOTCBZU-yoOX4Xj2.js → ganttDiagram-PKOTCBZU-Dok7ME1t.js} +1 -1
  41. package/console-app/assets/{gitGraph-TEB2WS4Q-BcUY5hIc.js → gitGraph-TEB2WS4Q-8492lYYh.js} +1 -1
  42. package/console-app/assets/{gitGraphDiagram-DS77QQ5N-BtuIPjuB.js → gitGraphDiagram-DS77QQ5N-sPOnBy5f.js} +1 -1
  43. package/console-app/assets/{index-CzWW052c.js → index-DqNqujdF.js} +184 -184
  44. package/console-app/assets/{info-DKCQHKI2-B-iR9PUz.js → info-DKCQHKI2-U4uEmX4H.js} +1 -1
  45. package/console-app/assets/{infoDiagram-6WML65LV-CuXKIFH2.js → infoDiagram-6WML65LV-CNV12_Nx.js} +1 -1
  46. package/console-app/assets/{ishikawaDiagram-WSZJBQD7-CSueMFD6.js → ishikawaDiagram-WSZJBQD7-CcnTBGLj.js} +1 -1
  47. package/console-app/assets/{journeyDiagram-NVQOT4AX-kvnKStZp.js → journeyDiagram-NVQOT4AX-MX-UQBJ7.js} +1 -1
  48. package/console-app/assets/{kanban-definition-27J2QSJJ-CGGDEz30.js → kanban-definition-27J2QSJJ-BXh1Eu4D.js} +1 -1
  49. package/console-app/assets/{line-mtMM5-xO.js → line-2B2dlQbw.js} +1 -1
  50. package/console-app/assets/{linear-CLSje0O_.js → linear-DAVRH-Dp.js} +1 -1
  51. package/console-app/assets/{mermaid-parser.core-Cx6yvn3j.js → mermaid-parser.core-DxPo1qbR.js} +3 -3
  52. package/console-app/assets/{mermaid.core-BebGyklS.js → mermaid.core-DpvXaF3y.js} +4 -4
  53. package/console-app/assets/{mindmap-definition-FAOFIHXS-C2_WUUJ9.js → mindmap-definition-FAOFIHXS-wIEKn4qe.js} +1 -1
  54. package/console-app/assets/{packet-7NZHBO7P-Dh5yNCA8.js → packet-7NZHBO7P-CXySycDQ.js} +1 -1
  55. package/console-app/assets/{pegDiagram-VL7TDLO6-XgUxesi8.js → pegDiagram-VL7TDLO6-CDGkzO6q.js} +1 -1
  56. package/console-app/assets/{pie-RZYD4A2V-D2x2RAXI.js → pie-RZYD4A2V-9woSahH7.js} +1 -1
  57. package/console-app/assets/{pieDiagram-7S7Q4E2Y-Bbor0KbG.js → pieDiagram-7S7Q4E2Y-DLoZWnVF.js} +1 -1
  58. package/console-app/assets/{quadrantDiagram-CIZ2JOQS-DZmnMHpM.js → quadrantDiagram-CIZ2JOQS-NBGRoga7.js} +1 -1
  59. package/console-app/assets/{radar-I7S5WNFK-CPeriDtN.js → radar-I7S5WNFK-BYhW66ZA.js} +1 -1
  60. package/console-app/assets/{railroad-3IZDKUUU-2iKAyaie.js → railroad-3IZDKUUU-BqHXlwF5.js} +1 -1
  61. package/console-app/assets/railroad-abnf-AHOZXSZD-BfGOy69e.js +1 -0
  62. package/console-app/assets/railroad-ebnf-EBAXGLYW-BbGv9WfS.js +1 -0
  63. package/console-app/assets/railroad-peg-LSFZ7HO6-CCiPI8BL.js +1 -0
  64. package/console-app/assets/{railroadDiagram-AXF67PYL-DVEqCXoo.js → railroadDiagram-AXF67PYL-FYQaHJ6A.js} +1 -1
  65. package/console-app/assets/{requirementDiagram-LRYGKXZP-CSgSNL8p.js → requirementDiagram-LRYGKXZP-ihhW1kgC.js} +1 -1
  66. package/console-app/assets/{sankeyDiagram-W5VNT64P-CFk11odN.js → sankeyDiagram-W5VNT64P-Dw2EbW8v.js} +1 -1
  67. package/console-app/assets/{sequenceDiagram-SI44F4Z6-Cb5u6FsJ.js → sequenceDiagram-SI44F4Z6-C6i_U4QX.js} +1 -1
  68. package/console-app/assets/{src-LceHEY_Q.js → src-DF-84qwJ.js} +1 -1
  69. package/console-app/assets/{stateDiagram-OKZ733FA-DM1jWlkU.js → stateDiagram-OKZ733FA-xH4wcMO4.js} +1 -1
  70. package/console-app/assets/stateDiagram-v2-UEYNNEHI-BJln5PLd.js +1 -0
  71. package/console-app/assets/{swimlanes-SLNWSIFB-DD6MchlE.js → swimlanes-SLNWSIFB-CkFlU1Qc.js} +1 -1
  72. package/console-app/assets/swimlanesDiagram-ULZ7WXOC-CSLhmtbh.js +8 -0
  73. package/console-app/assets/{timeline-definition-Z64GVDOM-zu5cNnVv.js → timeline-definition-Z64GVDOM-BQE9-7mm.js} +1 -1
  74. package/console-app/assets/{treeView-QDETBFTQ-D_4IbvCG.js → treeView-QDETBFTQ-C4hse2Wn.js} +1 -1
  75. package/console-app/assets/{treemap-6X3UGDF4-DNc6bjUc.js → treemap-6X3UGDF4-Bi7ORgq6.js} +1 -1
  76. package/console-app/assets/{vennDiagram-T6HMQDX7-DfqoG28f.js → vennDiagram-T6HMQDX7-DbUdNREA.js} +1 -1
  77. package/console-app/assets/{wardley-OPB4EBWU-BqpI2Lx-.js → wardley-OPB4EBWU-BHqXIxRe.js} +1 -1
  78. package/console-app/assets/{wardleyDiagram-T6FBY63Y-CLIZSvNi.js → wardleyDiagram-T6FBY63Y-1VOvM_bb.js} +1 -1
  79. package/console-app/assets/{xychartDiagram-ELKLHX3M-Cni-XXa6.js → xychartDiagram-ELKLHX3M-C3DVfSR9.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 +36 -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 +21 -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 +122 -1
  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 +137 -6
  123. package/dist/.pikku/function/pikku-functions.gen.js +1 -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 +7 -0
  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 +27 -1
  169. package/dist/.pikku/schemas/schemas/FabricSecretsDeleteInput.schema.json +1 -0
  170. package/dist/.pikku/schemas/schemas/FabricSecretsDeleteOutput.schema.json +1 -0
  171. package/dist/.pikku/schemas/schemas/KnowledgePlanDeferInput.schema.json +1 -0
  172. package/dist/.pikku/schemas/schemas/KnowledgePlanDeferOutput.schema.json +1 -0
  173. package/dist/.pikku/schemas/schemas/KnowledgePlanProgressInput.schema.json +1 -0
  174. package/dist/.pikku/schemas/schemas/KnowledgePlanProgressOutput.schema.json +1 -0
  175. package/dist/.pikku/schemas/schemas/KnowledgePlanSchemaInput.schema.json +1 -0
  176. package/dist/.pikku/schemas/schemas/KnowledgePlanSchemaOutput.schema.json +1 -0
  177. package/dist/.pikku/schemas/schemas/KnowledgePlanSetInput.schema.json +1 -0
  178. package/dist/.pikku/schemas/schemas/KnowledgePlanSetOutput.schema.json +1 -0
  179. package/dist/.pikku/schemas/schemas/KnowledgePlanShowInput.schema.json +1 -0
  180. package/dist/.pikku/schemas/schemas/KnowledgePlanShowOutput.schema.json +1 -0
  181. package/dist/.pikku/schemas/schemas/PikkuDistInput.schema.json +1 -0
  182. package/dist/.pikku/schemas/schemas/PikkuNewAddonInput.schema.json +1 -1
  183. package/dist/.pikku/scopes/index.d.ts +1 -1
  184. package/dist/.pikku/scopes/index.js +1 -1
  185. package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
  186. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
  187. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
  188. package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
  189. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  190. package/dist/.pikku/secrets/index.d.ts +1 -1
  191. package/dist/.pikku/secrets/index.js +1 -1
  192. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  193. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  194. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  195. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  196. package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
  197. package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
  198. package/dist/.pikku/setup/index.d.ts +1 -1
  199. package/dist/.pikku/setup/index.js +1 -1
  200. package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
  201. package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
  202. package/dist/.pikku/trigger/index.d.ts +1 -1
  203. package/dist/.pikku/trigger/index.js +1 -1
  204. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  205. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  206. package/dist/.pikku/variables/index.d.ts +1 -1
  207. package/dist/.pikku/variables/index.js +1 -1
  208. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  209. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  210. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  211. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  212. package/dist/.pikku/workflow/index.d.ts +1 -1
  213. package/dist/.pikku/workflow/index.js +1 -1
  214. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  215. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  216. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  217. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  218. package/dist/bin/pikku-bin.mjs +2 -2
  219. package/dist/src/cli.wiring.js +63 -1
  220. package/dist/src/deploy/analyzer/analyzer.js +42 -6
  221. package/dist/src/deploy/build-pipeline.js +92 -4
  222. package/dist/src/deploy/codegen/per-unit-codegen.d.ts +10 -0
  223. package/dist/src/deploy/codegen/per-unit-codegen.js +12 -1
  224. package/dist/src/deploy/server-entry.js +14 -1
  225. package/dist/src/fabric/fabric-commands.d.ts +25 -0
  226. package/dist/src/fabric/fabric-commands.js +13 -0
  227. package/dist/src/fabric/functions/secrets-delete.function.d.ts +36 -0
  228. package/dist/src/fabric/functions/secrets-delete.function.js +51 -0
  229. package/dist/src/functions/commands/dev.js +2 -1
  230. package/dist/src/functions/commands/dist.d.ts +28 -0
  231. package/dist/src/functions/commands/dist.js +58 -0
  232. package/dist/src/functions/commands/knowledge-plan.d.ts +112 -0
  233. package/dist/src/functions/commands/knowledge-plan.js +35 -0
  234. package/dist/src/functions/commands/new-addon.d.ts +30 -0
  235. package/dist/src/functions/commands/new-addon.js +81 -3
  236. package/dist/src/functions/commands/persona-sync.d.ts +5 -4
  237. package/dist/src/functions/commands/persona-sync.js +6 -5
  238. package/dist/src/functions/commands/persona.js +6 -2
  239. package/dist/src/functions/db/local-db.d.ts +1 -1
  240. package/dist/src/functions/db/local-db.js +5 -5
  241. package/dist/src/functions/db/postgres/postgres-introspector.js +1 -1
  242. package/dist/src/functions/db/sqlite/dev-seed.d.ts +1 -1
  243. package/dist/src/functions/db/sqlite/sqlite-introspector.d.ts +1 -1
  244. package/dist/src/functions/db/sqlite/sqlite-introspector.js +1 -1
  245. package/dist/src/functions/db/sqlite/sqlite-kysely.d.ts +1 -1
  246. package/dist/src/functions/knowledge/render.d.ts +6 -1
  247. package/dist/src/functions/knowledge/render.js +74 -0
  248. package/dist/src/functions/knowledge/schemas.d.ts +45 -0
  249. package/dist/src/functions/knowledge/schemas.js +11 -1
  250. package/dist/src/functions/surface/surface-editorial.js +12 -12
  251. package/dist/src/functions/validate/auth-plugin-checks.js +3 -2
  252. package/dist/src/functions/validate/persona-checks.js +2 -1
  253. package/dist/src/functions/validate/shared-checks.js +1 -1
  254. package/dist/src/functions/wirings/realtime/serialize-events-scaffold.d.ts +1 -1
  255. package/dist/src/functions/wirings/realtime/serialize-events-scaffold.js +2 -2
  256. package/dist/src/utils/persona-credentials.d.ts +0 -2
  257. package/dist/src/utils/persona-credentials.js +1 -8
  258. package/dist/tsconfig.tsbuildinfo +1 -1
  259. package/package.json +11 -10
  260. package/snippets.json +1 -1
  261. package/surface.json +1245 -4866
  262. package/console-app/assets/architecture-TIHT7OUA-CWwmvxZF.js +0 -1
  263. package/console-app/assets/channel-pOkwZ_Ot.js +0 -1
  264. package/console-app/assets/chunk-XXDRQBXY-BU_UP6f5.js +0 -1
  265. package/console-app/assets/classDiagram-JCYQIIEL-CLBKUuxj.js +0 -1
  266. package/console-app/assets/classDiagram-v2-OCEON4UE-CLBKUuxj.js +0 -1
  267. package/console-app/assets/eventmodeling-45OFAUF4-DkN2KCrT.js +0 -1
  268. package/console-app/assets/flowDiagram-UKHOOZJN-DL0M9lBc.js +0 -1
  269. package/console-app/assets/railroad-abnf-AHOZXSZD-D26xz4MM.js +0 -1
  270. package/console-app/assets/railroad-ebnf-EBAXGLYW-CCAiMPWc.js +0 -1
  271. package/console-app/assets/railroad-peg-LSFZ7HO6-BA1zcisq.js +0 -1
  272. package/console-app/assets/stateDiagram-v2-UEYNNEHI-COVnPYic.js +0 -1
  273. package/console-app/assets/swimlanesDiagram-ULZ7WXOC-B5q8iRCQ.js +0 -8
  274. package/dist/src/functions/db/db-migrator.d.ts +0 -63
  275. package/dist/src/functions/db/db-migrator.js +0 -136
  276. package/dist/src/functions/db/migration-identifiers.d.ts +0 -58
  277. package/dist/src/functions/db/migration-identifiers.js +0 -262
  278. package/dist/src/functions/db/postgres/postgres-migrator.d.ts +0 -15
  279. package/dist/src/functions/db/postgres/postgres-migrator.js +0 -40
  280. package/dist/src/functions/db/schema-sql.d.ts +0 -43
  281. package/dist/src/functions/db/schema-sql.js +0 -135
  282. package/dist/src/functions/db/sqlite/sqlite-migrator.d.ts +0 -11
  283. package/dist/src/functions/db/sqlite/sqlite-migrator.js +0 -41
  284. package/dist/src/functions/db/sqlite/sqlite-runtime-bun.d.ts +0 -2
  285. package/dist/src/functions/db/sqlite/sqlite-runtime-bun.js +0 -62
  286. package/dist/src/functions/db/sqlite/sqlite-runtime-node.d.ts +0 -2
  287. package/dist/src/functions/db/sqlite/sqlite-runtime-node.js +0 -78
  288. package/dist/src/functions/db/sqlite/sqlite-runtime.d.ts +0 -20
  289. package/dist/src/functions/db/sqlite/sqlite-runtime.js +0 -13
@@ -12,6 +12,7 @@ import { pikkuCLICommand, wireCLI } from '../.pikku/cli/pikku-cli-types.gen.js';
12
12
  import { fabricCommands } from './fabric/fabric-commands.js';
13
13
  import { all } from './functions/commands/all.js';
14
14
  import { bootstrap } from './functions/commands/bootstrap.js';
15
+ import { pikkuDist } from './functions/commands/dist.js';
15
16
  import { watch } from './functions/commands/watch.js';
16
17
  import { login, logout, whoami } from './functions/commands/login.js';
17
18
  import { dev } from './functions/commands/dev.js';
@@ -34,6 +35,7 @@ import { renderSemver } from './functions/commands/semver-render.js';
34
35
  import { validate, renderValidate } from './functions/commands/validate.js';
35
36
  import { knowledgeValidate, renderKnowledgeValidate, } from './functions/commands/knowledge-validate.js';
36
37
  import { knowledgeIndex, renderKnowledgeIndex, } from './functions/commands/knowledge-index.js';
38
+ import { knowledgePlanDefer, knowledgePlanProgress, knowledgePlanSchema, knowledgePlanSet, knowledgePlanShow, renderKnowledgePlanDefer, renderKnowledgePlanProgress, renderKnowledgePlanSchema, renderKnowledgePlanSet, renderKnowledgePlanShow, } from './functions/commands/knowledge-plan.js';
37
39
  import { scenarioRun, scenarioList } from './functions/commands/scenario.js';
38
40
  import { personaList, personaRun, personaSecret, } from './functions/commands/persona.js';
39
41
  import { personaSync } from './functions/commands/persona-sync.js';
@@ -231,6 +233,16 @@ wireCLI({
231
233
  func: bootstrap,
232
234
  description: 'Generate only type files (setup phase only)',
233
235
  }),
236
+ dist: pikkuCLICommand({
237
+ func: pikkuDist,
238
+ description: "Copy the generated files tsc cannot emit — the .gen.json meta, and hand-authored .d.ts — into the build output. Run it after tsc, as a package's build script",
239
+ options: {
240
+ distDir: {
241
+ description: "Where to copy to. Defaults to the tsconfig's compilerOptions.outDir",
242
+ type: 'string',
243
+ },
244
+ },
245
+ }),
234
246
  audit: pikkuCLICommand({
235
247
  func: pikkuAudit,
236
248
  description: 'Audit dependencies for security advisories (always) and available updates (--outdated); writes .pikku/audit.json',
@@ -513,6 +525,52 @@ wireCLI({
513
525
  },
514
526
  },
515
527
  }),
528
+ plan: {
529
+ description: "Read and write a milestone's technical plan — the shape of the work, checked before it is built rather than after",
530
+ subcommands: {
531
+ schema: pikkuCLICommand({
532
+ func: knowledgePlanSchema,
533
+ render: renderKnowledgePlanSchema,
534
+ description: 'Print the plan schema, so a plan is written against what is enforced rather than guessed at',
535
+ }),
536
+ show: pikkuCLICommand({
537
+ func: knowledgePlanShow,
538
+ render: renderKnowledgePlanShow,
539
+ description: "Print a milestone's plan",
540
+ parameters: '<milestone>',
541
+ options: {
542
+ forBuild: {
543
+ description: 'Render it as the ordered list of work a build follows, rather than as stored',
544
+ default: false,
545
+ },
546
+ },
547
+ }),
548
+ progress: pikkuCLICommand({
549
+ func: knowledgePlanProgress,
550
+ render: renderKnowledgePlanProgress,
551
+ description: 'Say what the milestone still owes its plan, read from the generated meta rather than from what was claimed',
552
+ parameters: '<milestone>',
553
+ }),
554
+ set: pikkuCLICommand({
555
+ func: knowledgePlanSet,
556
+ render: renderKnowledgePlanSet,
557
+ description: 'Validate a plan against its milestone note and write it, or write nothing and say what is wrong',
558
+ parameters: '<milestone> <file>',
559
+ }),
560
+ defer: pikkuCLICommand({
561
+ func: knowledgePlanDefer,
562
+ render: renderKnowledgePlanDefer,
563
+ description: 'Move one first-pass item to the next pass, with the reason on the record',
564
+ parameters: '<milestone> <item>',
565
+ options: {
566
+ reason: {
567
+ description: 'Why this item cannot land in the first pass',
568
+ short: 'r',
569
+ },
570
+ },
571
+ }),
572
+ },
573
+ },
516
574
  },
517
575
  },
518
576
  validate: pikkuCLICommand({
@@ -635,7 +693,7 @@ wireCLI({
635
693
  }),
636
694
  sync: pikkuCLICommand({
637
695
  func: personaSync,
638
- description: "Report which personas an environment will provision, with which roles, and why any of them were skipped. The provisioning itself happens in the deployment — call provisionPersonas from '@pikku/better-auth' in your server lifecycle — because the CLI has no connection to a deployed environment's database.",
696
+ description: "Report which personas an environment will provision, with which roles, and why any of them were skipped. The provisioning itself happens in the deployment — pass the generated personas to pikkuFabric from '@pikku/better-auth' — because the CLI has no connection to a deployed environment's database.",
639
697
  parameters: '<environment>',
640
698
  }),
641
699
  list: pikkuCLICommand({
@@ -829,6 +887,10 @@ wireCLI({
829
887
  description: 'Convert snake_case property names to camelCase in generated Zod schemas',
830
888
  default: false,
831
889
  },
890
+ build: {
891
+ description: 'Install and build the generated addon (an unbuilt addon exports a dist/ that does not exist yet, so every ref() into it is dead at runtime)',
892
+ default: true,
893
+ },
832
894
  },
833
895
  }),
834
896
  },
@@ -127,15 +127,17 @@ export function analyzeDeployment(state, options) {
127
127
  if (handlers.length === 0) {
128
128
  continue;
129
129
  }
130
+ const invokedAgents = collectInvokedAgents(state, funcId);
130
131
  units.push({
131
132
  name: toSafeKebab(funcId),
132
133
  role: 'function',
133
134
  target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId, defaultTarget),
134
135
  functionIds: [funcId],
135
- services: collectServicesForFunction(funcMeta),
136
+ services: withAgentServices(collectServicesForFunction(funcMeta), invokedAgents),
136
137
  dependsOn: [],
137
138
  handlers,
138
139
  tags: funcMeta.tags ?? [],
140
+ ...(invokedAgents.length > 0 && { invokedAgents }),
139
141
  });
140
142
  }
141
143
  // ── Step 2: Agent gateways ─────────────────────────────────────────
@@ -147,10 +149,7 @@ export function analyzeDeployment(state, options) {
147
149
  const toolUnitNames = toolIds.map((id) => toSafeKebab(id));
148
150
  const subAgentUnitNames = subAgentNames.map((sa) => `agent-${toSafeKebab(sa)}`);
149
151
  // Agent needs AI services
150
- const agentServices = [
151
- { capability: 'ai-model', sourceServiceName: 'agentRunner' },
152
- { capability: 'ai-storage', sourceServiceName: 'agentStorage' },
153
- ];
152
+ const agentServices = agentServiceRequirements();
154
153
  // Concrete routes for this agent via catch-all
155
154
  const agentRoutes = [
156
155
  {
@@ -282,15 +281,17 @@ export function analyzeDeployment(state, options) {
282
281
  const funcId = fromKebab(dep);
283
282
  const funcMeta = functionsMeta[funcId];
284
283
  if (funcMeta) {
284
+ const invokedAgents = collectInvokedAgents(state, funcId);
285
285
  units.push({
286
286
  name: dep,
287
287
  role: 'function',
288
288
  target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId, defaultTarget),
289
289
  functionIds: [funcId],
290
- services: collectServicesForFunction(funcMeta),
290
+ services: withAgentServices(collectServicesForFunction(funcMeta), invokedAgents),
291
291
  dependsOn: [],
292
292
  handlers: [{ type: 'fetch', routes: [] }],
293
293
  tags: funcMeta.tags ?? [],
294
+ ...(invokedAgents.length > 0 && { invokedAgents }),
294
295
  });
295
296
  existingUnitNames.add(dep);
296
297
  }
@@ -597,6 +598,41 @@ function mapServiceToRequirement(serviceName) {
597
598
  return null;
598
599
  return { capability, sourceServiceName: serviceName };
599
600
  }
601
+ function agentServiceRequirements() {
602
+ return [
603
+ { capability: 'ai-model', sourceServiceName: 'agentRunner' },
604
+ { capability: 'ai-storage', sourceServiceName: 'agentStorage' },
605
+ ];
606
+ }
607
+ /**
608
+ * Agents named by a `runAgent`/`rpc.agent.run` call inside a function body.
609
+ *
610
+ * The inspector attributes those calls to the source FILE, so every function
611
+ * declared alongside the caller inherits them. That is deliberate: the unit
612
+ * bundles the file either way, and registering an agent the caller never
613
+ * reaches is cheaper than the run-time "AI agent not found" a missed one
614
+ * causes.
615
+ */
616
+ function collectInvokedAgents(state, funcId) {
617
+ const path = state.functions?.files?.get(funcId)?.path;
618
+ if (!path)
619
+ return [];
620
+ const invoked = state.agents?.invokedAgentsByFile?.get(path);
621
+ if (!invoked)
622
+ return [];
623
+ return [...invoked].filter((name) => Boolean(state.agents?.agentsMeta[name]));
624
+ }
625
+ function withAgentServices(services, invokedAgents) {
626
+ if (invokedAgents.length === 0)
627
+ return services;
628
+ const merged = [...services];
629
+ for (const requirement of agentServiceRequirements()) {
630
+ if (!merged.some((s) => s.capability === requirement.capability)) {
631
+ merged.push(requirement);
632
+ }
633
+ }
634
+ return merged;
635
+ }
600
636
  function collectServicesForFunction(funcMeta) {
601
637
  if (!funcMeta?.services?.services)
602
638
  return [];
@@ -4,9 +4,9 @@
4
4
  * Runs: analyze → per-unit codegen → entry generation → bundle → configs
5
5
  * Outputs everything to .deploy/<provider>/ without deploying.
6
6
  */
7
- import { join } from 'node:path';
8
- import { existsSync } from 'node:fs';
9
- import { mkdir, writeFile, copyFile } from 'node:fs/promises';
7
+ import { join, relative } from 'node:path';
8
+ import { existsSync, readFileSync } from 'node:fs';
9
+ import { cp, mkdir, writeFile, copyFile } from 'node:fs/promises';
10
10
  import { PikkuError } from '@pikku/core/errors';
11
11
  import { analyzeDeployment } from './analyzer/index.js';
12
12
  import { withoutScenarios } from '../functions/wirings/scenarios/scenario-partition.js';
@@ -61,6 +61,88 @@ function findLockfile(projectDir) {
61
61
  }
62
62
  return null;
63
63
  }
64
+ /**
65
+ * The database a standalone bundle has to open for itself.
66
+ *
67
+ * Every other provider deploys onto a host that supplies `kysely` — `pikku dev`
68
+ * builds one, a Cloudflare deploy binds one — so `createSingletonServices` is
69
+ * written expecting it. A standalone artifact has no host, and shipped one that
70
+ * never got a connection at all: the app booted straight into whatever its
71
+ * services factory does when the database is missing, which for the generated
72
+ * templates is a throw.
73
+ *
74
+ * Engine comes from the migrations directory rather than the user config,
75
+ * because that is the same signal `loadUserConfigForDb` falls back to and it
76
+ * needs no module loading here. `db/sqlite` and `db/postgres` are the two
77
+ * conventions the migrator already writes to, so a project declares its engine
78
+ * by having written migrations for it.
79
+ *
80
+ * Both at once is refused rather than resolved. Picking one would be picking
81
+ * which database the deployed app talks to on the strength of directory order,
82
+ * and the failure — an app running happily against the wrong, fully valid
83
+ * schema — is invisible until someone reads the data.
84
+ *
85
+ * The migrations are copied in beside the bundle under the same `db/<engine>/`
86
+ * path they have in the project, which is also where Fabric's build container
87
+ * stages them. Two producers writing the artifact cannot disagree about where
88
+ * the SQL lives, and `bundle.js db migrate` finds it either way.
89
+ */
90
+ /**
91
+ * The project's declared version, or nothing.
92
+ *
93
+ * Absent is a real answer — a project need not version itself — and is better
94
+ * reported as unknown than as a number this made up.
95
+ */
96
+ function resolveProjectVersion(projectDir) {
97
+ try {
98
+ const pkg = JSON.parse(readFileSync(join(projectDir, 'package.json'), 'utf-8'));
99
+ return typeof pkg.version === 'string' ? pkg.version : undefined;
100
+ }
101
+ catch {
102
+ return undefined;
103
+ }
104
+ }
105
+ async function resolveStandaloneDb(projectDir, pikkuDir, unitDir) {
106
+ const hasSqlite = existsSync(join(projectDir, 'db', 'sqlite'));
107
+ const hasPostgres = existsSync(join(projectDir, 'db', 'postgres'));
108
+ if (hasSqlite && hasPostgres) {
109
+ throw new Error('This project has both db/sqlite and db/postgres migrations, so a standalone build cannot tell which database the app is meant to open. Keep the one this app deploys against.');
110
+ }
111
+ const engine = hasSqlite ? 'sqlite' : hasPostgres ? 'postgres' : undefined;
112
+ if (!engine)
113
+ return undefined;
114
+ await cp(join(projectDir, 'db', engine), join(unitDir, 'db', engine), {
115
+ recursive: true,
116
+ });
117
+ // Absent for an app that annotates no columns, which is a database with
118
+ // nothing to coerce rather than a reason to hand the app no database.
119
+ const coercionFile = join(pikkuDir, 'db', 'coercion.gen.ts');
120
+ if (!existsSync(coercionFile))
121
+ return { engine };
122
+ let rel = relative(unitDir, coercionFile).replace(/\\/g, '/');
123
+ if (!rel.startsWith('.'))
124
+ rel = `./${rel}`;
125
+ return { engine, coercionImportPath: rel.replace(/\.ts$/, '.js') };
126
+ }
127
+ /**
128
+ * The app's server lifecycle, for entries that can call it.
129
+ *
130
+ * The hooks are resolved to an import rather than read at build time because
131
+ * they are the app's own code and have to run in the app's own process, with
132
+ * the services that process built.
133
+ */
134
+ function resolveLifecycle(unitDir, state) {
135
+ const factory = state.filesAndMethods.serverLifecycleFactory;
136
+ if (!factory)
137
+ return undefined;
138
+ let rel = relative(unitDir, factory.file).replace(/\\/g, '/');
139
+ if (!rel.startsWith('.'))
140
+ rel = `./${rel}`;
141
+ return {
142
+ importPath: rel.replace(/\.tsx?$/, '.js'),
143
+ variable: factory.variable,
144
+ };
145
+ }
64
146
  export async function runBuildPipeline(options) {
65
147
  const { projectDir, projectId, provider, inspectorState, getEntryContext, debugArtifacts, logger, bundler, } = options;
66
148
  const deployDir = options.deployDir ?? join(projectDir, '.deploy');
@@ -115,6 +197,9 @@ export async function runBuildPipeline(options) {
115
197
  const ctx = {
116
198
  ...getEntryContext(unitDir, pikkuDir, singleUnit, inspectorState),
117
199
  frontend: frontendMount,
200
+ version: resolveProjectVersion(projectDir),
201
+ db: await resolveStandaloneDb(projectDir, pikkuDir, unitDir),
202
+ lifecycle: resolveLifecycle(unitDir, inspectorState),
118
203
  };
119
204
  const source = provider.generateEntrySource(ctx);
120
205
  const entryPath = join(unitDir, 'entry.ts');
@@ -228,7 +313,10 @@ export async function runBuildPipeline(options) {
228
313
  const unitDir = unit.target === 'server' ? containerDir : join(unitsDir, unit.name);
229
314
  const entryPath = join(unitDir, 'entry.ts');
230
315
  await mkdir(unitDir, { recursive: true });
231
- const ctx = getEntryContext(unitDir, pikkuDir, unit, inspectorState);
316
+ const ctx = {
317
+ ...getEntryContext(unitDir, pikkuDir, unit, inspectorState),
318
+ lifecycle: resolveLifecycle(unitDir, inspectorState),
319
+ };
232
320
  const source = unit.target === 'server'
233
321
  ? (provider.generateServerEntrySource?.(ctx) ??
234
322
  generateServerEntrySource(ctx))
@@ -42,6 +42,16 @@ export interface PerUnitCodegenResult {
42
42
  error: string;
43
43
  }>;
44
44
  }
45
+ /**
46
+ * Collect the full set of filter names for a deployment unit.
47
+ *
48
+ * The --names filter matches against different identifier types depending
49
+ * on the metadata being filtered (function names, agent names, channel
50
+ * names, etc.). For a unit to get its complete metadata, we need to
51
+ * include both the function IDs and any wiring-level names (e.g. agent
52
+ * names, channel names) that reference those functions.
53
+ */
54
+ export declare function collectFilterNames(unit: DeploymentUnit, manifest: DeploymentManifest, inspectorState: InspectorState, workflowQueues: boolean): string[];
45
55
  /**
46
56
  * Runs filtered codegen for each deployment unit.
47
57
  *
@@ -34,7 +34,7 @@ function resolvePikkuBin() {
34
34
  * include both the function IDs and any wiring-level names (e.g. agent
35
35
  * names, channel names) that reference those functions.
36
36
  */
37
- function collectFilterNames(unit, manifest, inspectorState, workflowQueues) {
37
+ export function collectFilterNames(unit, manifest, inspectorState, workflowQueues) {
38
38
  const names = new Set(unit.functionIds);
39
39
  // Include catch-all scaffold routes based on unit contents
40
40
  const functionsMeta = inspectorState.functions.meta;
@@ -103,6 +103,17 @@ function collectFilterNames(unit, manifest, inspectorState, workflowQueues) {
103
103
  if (handler.type === 'scheduled')
104
104
  names.add(handler.taskName);
105
105
  }
106
+ // `runAgent(...)` / `rpc.agent.run(...)` look the agent up in the
107
+ // in-process registry, so a function that calls one needs the agent's
108
+ // wiring — and its tools — bundled into its OWN unit, not just into
109
+ // the agent gateway unit.
110
+ for (const agentName of unit.invokedAgents ?? []) {
111
+ names.add(agentName);
112
+ const agentDef = manifest.agents.find((a) => a.name === agentName);
113
+ for (const id of agentDef?.toolFunctionIds ?? [])
114
+ names.add(id);
115
+ names.add('/rpc/:rpcName');
116
+ }
106
117
  // Function units with workflow-state capability (workflow-starter,
107
118
  // workflow-runner, workflow-status-checker) call rpc.startWorkflow
108
119
  // and look workflows up by name in the registry. The registry is
@@ -18,6 +18,11 @@ export function generateServerEntrySource(ctx) {
18
18
  ctx.configImport,
19
19
  ctx.servicesImport,
20
20
  ctx.mcpImport,
21
+ ...(ctx.lifecycle
22
+ ? [
23
+ `import { ${ctx.lifecycle.variable} as __pikkuLifecycle } from '${ctx.lifecycle.importPath}'`,
24
+ ]
25
+ : []),
21
26
  `import '${ctx.bootstrapPath}'`,
22
27
  ``,
23
28
  `const PORT = Number(process.env.PORT ?? 8080)`,
@@ -33,9 +38,17 @@ export function generateServerEntrySource(ctx) {
33
38
  ` singletonServices.logger,`,
34
39
  ` { ${ctx.mcpServerOption}}`,
35
40
  ` )`,
36
- ` server.enableExitOnSignals()`,
41
+ ` server.enableExitOnSignals(${ctx.lifecycle
42
+ ? `{ beforeStop: () => __pikkuLifecycle?.beforeStop?.(singletonServices), afterStop: () => __pikkuLifecycle?.afterStop?.(singletonServices) }`
43
+ : ''})`,
37
44
  ` await server.init()`,
45
+ ...(ctx.lifecycle
46
+ ? [` await __pikkuLifecycle?.beforeStart?.(singletonServices)`]
47
+ : []),
38
48
  ` await server.start()`,
49
+ ...(ctx.lifecycle
50
+ ? [` await __pikkuLifecycle?.afterStart?.(singletonServices)`]
51
+ : []),
39
52
  `}`,
40
53
  ``,
41
54
  `main().catch((err) => {`,
@@ -611,6 +611,31 @@ export declare const fabricCommands: {
611
611
  updatedAt: string;
612
612
  }[];
613
613
  }, "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>;
614
+ delete: import("@pikku/core/cli").CoreCLICommandConfig<import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionConfig<{
615
+ name: string;
616
+ branch?: string | undefined;
617
+ force?: boolean | undefined;
618
+ }, {
619
+ name: string;
620
+ runId: string | null;
621
+ deploymentId: string | null;
622
+ }, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
623
+ name: string;
624
+ branch?: string | undefined;
625
+ force?: boolean | undefined;
626
+ }, {
627
+ name: string;
628
+ runId: string | null;
629
+ deploymentId: string | null;
630
+ }, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").WiredServices, unknown> | import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunction<{
631
+ name: string;
632
+ branch?: string | undefined;
633
+ force?: boolean | undefined;
634
+ }, {
635
+ name: string;
636
+ runId: string | null;
637
+ deploymentId: string | null;
638
+ }, "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>;
614
639
  rotate: import("@pikku/core/cli").CoreCLICommandConfig<import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionConfig<{
615
640
  branch?: string | undefined;
616
641
  force?: boolean | undefined;
@@ -32,6 +32,7 @@ import { FabricDbSchema, renderDbSchema, } from './functions/db-schema.function.
32
32
  import { FabricRollback } from './functions/rollback.function.js';
33
33
  import { FabricSecretsSet } from './functions/secrets-set.function.js';
34
34
  import { FabricSecretsList } from './functions/secrets-list.function.js';
35
+ import { FabricSecretsDelete } from './functions/secrets-delete.function.js';
35
36
  import { FabricSecretsRotate } from './functions/secrets-rotate.function.js';
36
37
  import { FabricVariablesSet } from './functions/variables-set.function.js';
37
38
  import { FabricVariablesGet } from './functions/variables-get.function.js';
@@ -254,6 +255,18 @@ export const fabricCommands = defineCLICommands({
254
255
  json: { description: 'Machine-readable output', default: false },
255
256
  },
256
257
  }),
258
+ delete: pikkuCLICommand({
259
+ parameters: '<name>',
260
+ func: FabricSecretsDelete,
261
+ description: 'Delete a single stage-scoped secret',
262
+ options: {
263
+ branch: { description: 'Target branch', short: 'b' },
264
+ force: {
265
+ description: 'Delete without confirmation',
266
+ default: false,
267
+ },
268
+ },
269
+ }),
257
270
  rotate: pikkuCLICommand({
258
271
  func: FabricSecretsRotate,
259
272
  description: "Retire a stage's sealing key (secrets must be set again)",
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ export declare const FabricSecretsDeleteInput: z.ZodObject<{
3
+ name: z.ZodString;
4
+ branch: z.ZodOptional<z.ZodString>;
5
+ force: z.ZodOptional<z.ZodBoolean>;
6
+ }, z.core.$strip>;
7
+ export declare const FabricSecretsDeleteOutput: z.ZodObject<{
8
+ name: z.ZodString;
9
+ runId: z.ZodNullable<z.ZodString>;
10
+ deploymentId: z.ZodNullable<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ export declare const FabricSecretsDelete: import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionConfig<{
13
+ name: string;
14
+ branch?: string | undefined;
15
+ force?: boolean | undefined;
16
+ }, {
17
+ name: string;
18
+ runId: string | null;
19
+ deploymentId: string | null;
20
+ }, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
21
+ name: string;
22
+ branch?: string | undefined;
23
+ force?: boolean | undefined;
24
+ }, {
25
+ name: string;
26
+ runId: string | null;
27
+ deploymentId: string | null;
28
+ }, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").WiredServices, unknown> | import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunction<{
29
+ name: string;
30
+ branch?: string | undefined;
31
+ force?: boolean | undefined;
32
+ }, {
33
+ name: string;
34
+ runId: string | null;
35
+ deploymentId: string | null;
36
+ }, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").WiredServices>, undefined, undefined>;
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
3
+ import { resolveApiContext } from '../lib/config.js';
4
+ import { getFabricRPC } from '../lib/http.js';
5
+ import { promptConfirm } from '../lib/prompt.js';
6
+ import { resolveStage } from '../lib/stage.js';
7
+ export const FabricSecretsDeleteInput = z.object({
8
+ name: z.string(),
9
+ branch: z.string().optional(),
10
+ force: z.boolean().optional(),
11
+ });
12
+ export const FabricSecretsDeleteOutput = z.object({
13
+ name: z.string(),
14
+ runId: z.string().nullable(),
15
+ deploymentId: z.string().nullable(),
16
+ });
17
+ export const FabricSecretsDelete = pikkuSessionlessFunc({
18
+ description: 'Remove a single stage-scoped secret. Unlike `secrets rotate`, the rest of the stage keeps its sealing key and its other secrets.',
19
+ input: FabricSecretsDeleteInput,
20
+ output: FabricSecretsDeleteOutput,
21
+ func: async (_services, { name, branch: requested, force }) => {
22
+ const ctx = await resolveApiContext();
23
+ if (!ctx.token)
24
+ throw new Error('Not logged in. Run `pikku fabric login` first.');
25
+ if (!ctx.projectId)
26
+ throw new Error('No fabric project linked. Run `pikku fabric link` first.');
27
+ // Resolved before the prompt so the confirmation names the stage that
28
+ // would actually lose the secret, not an argument that may be absent.
29
+ const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
30
+ const { stageId, branch } = await resolveStage(rpc, ctx.projectId, requested);
31
+ if (!force) {
32
+ if (!process.stdin.isTTY) {
33
+ throw new Error(`Refusing to delete ${name} from ${branch} without confirmation — re-run with --force to delete non-interactively.`);
34
+ }
35
+ // Fabric cannot read the sealed value back, so this is not recoverable
36
+ // by re-reading it — the plaintext has to be supplied again.
37
+ if (!(await promptConfirm(`Delete ${name} from ${branch}? It cannot be recovered — the value must be set again.`))) {
38
+ throw new Error('Delete aborted.');
39
+ }
40
+ }
41
+ const result = await rpc.invoke('deleteStageSecret', { stageId, name });
42
+ console.log(`[fabric] deleted ${result.name} from ${branch}`);
43
+ if (result.runId) {
44
+ console.log(`[fabric] republishing the stage as run ${result.runId} — units serve the old value until it lands`);
45
+ }
46
+ else {
47
+ console.log('[fabric] deploy the stage to stop its units serving the old value');
48
+ }
49
+ return result;
50
+ },
51
+ });
@@ -4,7 +4,7 @@ import { pikkuSessionlessFunc } from '#pikku/function';
4
4
  import chokidar from 'chokidar';
5
5
  import { pikkuDevReloader, reloadGeneratedMeta, reconcileAddonRegistry, } from '@pikku/core/dev';
6
6
  import { InMemoryQueueService, QueueWebhookService } from '@pikku/core/services';
7
- import { ConsoleLogger, LocalEmailService, spy, InMemoryAgentRunStateService, } from '@pikku/core/services';
7
+ import { ConsoleLogger, LocalEmailService, LocalCredentialService, spy, InMemoryAgentRunStateService, } from '@pikku/core/services';
8
8
  import { InMemoryTriggerService } from '@pikku/core/services';
9
9
  import { InMemoryWorkflowService } from '@pikku/core/services';
10
10
  import { KyselyAgentStorageService, KyselyAgentRunStateService, KyselyAgentRunService, } from '@pikku/kysely';
@@ -230,6 +230,7 @@ export const dev = pikkuSessionlessFunc({
230
230
  workflowService,
231
231
  workflowRunService: workflowService,
232
232
  triggerService: new InMemoryTriggerService(),
233
+ credentialService: new LocalCredentialService(),
233
234
  agentStorage,
234
235
  agentRunState,
235
236
  agentRunService,
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Carry into the build output the files `tsc` compiles around but never emits.
3
+ *
4
+ * `tsc` turns the generated `.ts` under the pikku out dir into JavaScript, so
5
+ * that half arrives on its own. Two kinds of file do not:
6
+ *
7
+ * - the `*.gen.json` meta pikku writes beside them. `resolveJsonModule` lets
8
+ * TypeScript *read* a json, it never copies one to `outDir`, and the meta is
9
+ * read off disk at runtime — `MetaService` opens it by path — so a package
10
+ * that ships only tsc's output answers every meta lookup with nothing.
11
+ * - a hand-authored `.d.ts` such as `types/application-types.d.ts`. A
12
+ * declaration file is an input, and `declaration: true` does not re-emit it.
13
+ *
14
+ * Packages used to do this with `cp -r .pikku types dist/`, which also dumped
15
+ * every `.ts` source into the published output and needed a POSIX shell.
16
+ */
17
+ export type DistCopy = {
18
+ from: string;
19
+ to: string;
20
+ };
21
+ export declare const planDistCopies: (rootDir: string, distDir: string, files: string[]) => DistCopy[];
22
+ export declare const pikkuDist: import("#pikku/function").PikkuFunctionConfig<{
23
+ distDir?: string;
24
+ }, void, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<{
25
+ distDir?: string;
26
+ }, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<{
27
+ distDir?: string;
28
+ }, void, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
@@ -0,0 +1,58 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { cp, mkdir, readdir } from 'node:fs/promises';
3
+ import { dirname, join, relative, resolve } from 'node:path';
4
+ import ts from 'typescript';
5
+ import { pikkuSessionlessFunc } from '#pikku/function';
6
+ /**
7
+ * `tsc` compiles a `.ts` and emits it. Everything else it either reads without
8
+ * emitting — a `.d.ts` is an input, `declaration: true` does not re-emit one —
9
+ * or ignores entirely, like the generated json.
10
+ */
11
+ const tscEmitsIt = (file) => file.endsWith('.ts') && !file.endsWith('.d.ts');
12
+ const walk = async (dir) => {
13
+ if (!existsSync(dir)) {
14
+ return [];
15
+ }
16
+ const entries = await readdir(dir, { withFileTypes: true });
17
+ const files = await Promise.all(entries.map(async (entry) => {
18
+ const path = join(dir, entry.name);
19
+ return entry.isDirectory() ? walk(path) : [path];
20
+ }));
21
+ return files.flat();
22
+ };
23
+ export const planDistCopies = (rootDir, distDir, files) => {
24
+ return files
25
+ .filter((file) => !tscEmitsIt(file))
26
+ .map((from) => ({
27
+ from,
28
+ to: join(distDir, relative(rootDir, from)),
29
+ }));
30
+ };
31
+ const readTsOutDir = (tsconfig) => {
32
+ const parsed = ts.getParsedCommandLineOfConfigFile(tsconfig, {}, {
33
+ ...ts.sys,
34
+ onUnRecoverableConfigFileDiagnostic: () => { },
35
+ });
36
+ return parsed?.options.outDir;
37
+ };
38
+ export const pikkuDist = pikkuSessionlessFunc({
39
+ func: async ({ logger, config }, data) => {
40
+ const { rootDir, outDir, srcDirectories, tsconfig } = config;
41
+ const distDir = data.distDir
42
+ ? resolve(rootDir, data.distDir)
43
+ : readTsOutDir(resolve(rootDir, tsconfig));
44
+ if (!distDir) {
45
+ logger.error(`${tsconfig} sets no compilerOptions.outDir, so there is nowhere to copy to. Set one, or pass --dist-dir.`);
46
+ process.exit(1);
47
+ }
48
+ const copies = planDistCopies(rootDir, distDir, [
49
+ ...(await walk(outDir)),
50
+ ...(await Promise.all(srcDirectories.map((dir) => walk(resolve(rootDir, dir))))).flat(),
51
+ ]);
52
+ for (const { from, to } of copies) {
53
+ await mkdir(dirname(to), { recursive: true });
54
+ await cp(from, to);
55
+ }
56
+ logger.info(`Copied ${copies.length} generated file(s) into ${relative(rootDir, distDir) || distDir}`);
57
+ },
58
+ });