@pikku/cli 0.12.115 → 0.12.117

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 +270 -0
  2. package/console-app/assets/{abnfDiagram-N423BO3Z-Bltf5dmS.js → abnfDiagram-N423BO3Z-WNIAg_Oa.js} +1 -1
  3. package/console-app/assets/architecture-TIHT7OUA-CIT-Nug2.js +1 -0
  4. package/console-app/assets/{architectureDiagram-T3A2C74G-BTtx6R7-.js → architectureDiagram-T3A2C74G-DM698mgf.js} +1 -1
  5. package/console-app/assets/{blockDiagram-VBNYF7ZC-DgeTIOaM.js → blockDiagram-VBNYF7ZC-DPfy9K5S.js} +1 -1
  6. package/console-app/assets/{c4Diagram-5PPSVZJV-CaswnNob.js → c4Diagram-5PPSVZJV-DhLbbBbX.js} +1 -1
  7. package/console-app/assets/channel-DQC6cL1c.js +1 -0
  8. package/console-app/assets/{chunk-2GRJ4B5K-OnpnkpQT.js → chunk-2GRJ4B5K-C1RQ1gvs.js} +1 -1
  9. package/console-app/assets/{chunk-4I5QYGJK-CWmfNXFr.js → chunk-4I5QYGJK-BkzSdNc_.js} +1 -1
  10. package/console-app/assets/{chunk-5RXB4S5H-M8QmKeuk.js → chunk-5RXB4S5H-DZpBpdcU.js} +1 -1
  11. package/console-app/assets/{chunk-6Q2QTUOP-C_h5lS68.js → chunk-6Q2QTUOP-mZObxdld.js} +1 -1
  12. package/console-app/assets/{chunk-7Z6QIM7H-DSnVb09k.js → chunk-7Z6QIM7H-C0HbxZEa.js} +1 -1
  13. package/console-app/assets/{chunk-GF5L2VYU-BkX038sq.js → chunk-GF5L2VYU-DXPVwWqW.js} +1 -1
  14. package/console-app/assets/{chunk-I66GZJ75-b3yMIljX.js → chunk-I66GZJ75-pVpq9ckD.js} +1 -1
  15. package/console-app/assets/{chunk-JQJVKLGR-Bihcz4nv.js → chunk-JQJVKLGR-DJQ8K4wK.js} +1 -1
  16. package/console-app/assets/{chunk-KBJHAD2P-CS7eflbk.js → chunk-KBJHAD2P-B8XuxRCO.js} +1 -1
  17. package/console-app/assets/{chunk-NSK5VX7P-CfigFGDQ.js → chunk-NSK5VX7P-cYzQU4bD.js} +1 -1
  18. package/console-app/assets/{chunk-QR6OTTB3-BBy8NfTW.js → chunk-QR6OTTB3-CNoTFsqn.js} +1 -1
  19. package/console-app/assets/{chunk-RYQCIY6F-BCfZVQef.js → chunk-RYQCIY6F-DoKRUO_N.js} +1 -1
  20. package/console-app/assets/{chunk-UBXNYLIW-DkMKDHW4.js → chunk-UBXNYLIW-BqcIoUpU.js} +1 -1
  21. package/console-app/assets/{chunk-W5SLKNZC-BSLytTSJ.js → chunk-W5SLKNZC-p0Qalbjj.js} +1 -1
  22. package/console-app/assets/{chunk-WRU74C26-Dic7ZP8H.js → chunk-WRU74C26-DUMn96Dr.js} +1 -1
  23. package/console-app/assets/chunk-XXDRQBXY-Dgz5VbWO.js +1 -0
  24. package/console-app/assets/classDiagram-JCYQIIEL-1ASFocNV.js +1 -0
  25. package/console-app/assets/classDiagram-v2-OCEON4UE-1ASFocNV.js +1 -0
  26. package/console-app/assets/{cose-bilkent-JH36ORCC-CEpWcE3M.js → cose-bilkent-JH36ORCC-BCh3BlPI.js} +1 -1
  27. package/console-app/assets/{cynefin-VYW2F7L2-irPiPhgz.js → cynefin-VYW2F7L2-ZfghUZsD.js} +1 -1
  28. package/console-app/assets/{cynefinDiagram-MW4NZA55-CIkqQ912.js → cynefinDiagram-MW4NZA55-DcV3QXCe.js} +1 -1
  29. package/console-app/assets/{dagre-FZyyw3H3.js → dagre-BPFWXLBN.js} +1 -1
  30. package/console-app/assets/{dagre-VZM6K2ZE-Dxnnu7Rh.js → dagre-VZM6K2ZE-DETshBO-.js} +1 -1
  31. package/console-app/assets/{diagram-7IWD3JNH-DaT47sVs.js → diagram-7IWD3JNH-CsLX3P2o.js} +1 -1
  32. package/console-app/assets/{diagram-B4RE2ZJO-Dmht03tx.js → diagram-B4RE2ZJO-o2zcxm5S.js} +1 -1
  33. package/console-app/assets/{diagram-LBJQPF4R-B--jwILh.js → diagram-LBJQPF4R-BD2zKU21.js} +1 -1
  34. package/console-app/assets/{diagram-Q27KOJAE-D9H0euUr.js → diagram-Q27KOJAE-DHaacyna.js} +1 -1
  35. package/console-app/assets/{diagram-UB23O5K3-DloUQ8tO.js → diagram-UB23O5K3-pSLCMUyV.js} +1 -1
  36. package/console-app/assets/{ebnfDiagram-BXEA7PRR-gaOXzNBU.js → ebnfDiagram-BXEA7PRR-BDzawX3O.js} +1 -1
  37. package/console-app/assets/{erDiagram-JOGREHBK-3X9eTLsh.js → erDiagram-JOGREHBK-CyYnPmbN.js} +1 -1
  38. package/console-app/assets/eventmodeling-45OFAUF4-BYJ0A5k-.js +1 -0
  39. package/console-app/assets/flowDiagram-UKHOOZJN-CVn87uiP.js +1 -0
  40. package/console-app/assets/{ganttDiagram-PKOTCBZU-khAFwSBy.js → ganttDiagram-PKOTCBZU-3fhCBbPA.js} +1 -1
  41. package/console-app/assets/{gitGraph-TEB2WS4Q-Bb7uENmk.js → gitGraph-TEB2WS4Q-CdLRkVux.js} +1 -1
  42. package/console-app/assets/{gitGraphDiagram-DS77QQ5N-OkSBM0h0.js → gitGraphDiagram-DS77QQ5N-CC1epdKw.js} +1 -1
  43. package/console-app/assets/{index-Bn1BoT3w.js → index-BRmokG9t.js} +184 -184
  44. package/console-app/assets/{index-suVNAhyL.css → index-GruDnAhJ.css} +1 -1
  45. package/console-app/assets/{info-DKCQHKI2-BH5dbX2B.js → info-DKCQHKI2-BJs8WkzC.js} +1 -1
  46. package/console-app/assets/{infoDiagram-6WML65LV-IbUl8J2C.js → infoDiagram-6WML65LV-uoOwoIeI.js} +1 -1
  47. package/console-app/assets/{ishikawaDiagram-WSZJBQD7-CX0gA3de.js → ishikawaDiagram-WSZJBQD7-vCUJhwTi.js} +1 -1
  48. package/console-app/assets/{journeyDiagram-NVQOT4AX--k2etXu8.js → journeyDiagram-NVQOT4AX-D2QcIlLG.js} +1 -1
  49. package/console-app/assets/{kanban-definition-27J2QSJJ-D1FvtPpN.js → kanban-definition-27J2QSJJ-JwwKowmR.js} +1 -1
  50. package/console-app/assets/{line-JLMY_DDK.js → line-h2oRreYF.js} +1 -1
  51. package/console-app/assets/{linear-CSvLB3cd.js → linear-Dz002X_a.js} +1 -1
  52. package/console-app/assets/{mermaid-parser.core-CwwjcAjz.js → mermaid-parser.core-DTgmT0AA.js} +3 -3
  53. package/console-app/assets/{mermaid.core-hmS_M4K5.js → mermaid.core-1jSEDr-j.js} +4 -4
  54. package/console-app/assets/{mindmap-definition-FAOFIHXS-rTDa_CTp.js → mindmap-definition-FAOFIHXS-C3Txxhj4.js} +1 -1
  55. package/console-app/assets/{packet-7NZHBO7P-DBUJcYfI.js → packet-7NZHBO7P-BGG7zIK2.js} +1 -1
  56. package/console-app/assets/{pegDiagram-VL7TDLO6-D42PxXnS.js → pegDiagram-VL7TDLO6--g1r_rov.js} +1 -1
  57. package/console-app/assets/{pie-RZYD4A2V-dM0uFAE4.js → pie-RZYD4A2V-C5OepMH7.js} +1 -1
  58. package/console-app/assets/{pieDiagram-7S7Q4E2Y-wCln1ucl.js → pieDiagram-7S7Q4E2Y-DGD_LzGm.js} +1 -1
  59. package/console-app/assets/{quadrantDiagram-CIZ2JOQS-DrRwS1g5.js → quadrantDiagram-CIZ2JOQS-CyBQQlD2.js} +1 -1
  60. package/console-app/assets/{radar-I7S5WNFK-BW0V-EGR.js → radar-I7S5WNFK-CaBOAO95.js} +1 -1
  61. package/console-app/assets/{railroad-3IZDKUUU-FiTHaDbb.js → railroad-3IZDKUUU-2aTWN4Pw.js} +1 -1
  62. package/console-app/assets/railroad-abnf-AHOZXSZD-TU7k5gB_.js +1 -0
  63. package/console-app/assets/railroad-ebnf-EBAXGLYW-DbArPBkM.js +1 -0
  64. package/console-app/assets/railroad-peg-LSFZ7HO6-TzB93z4K.js +1 -0
  65. package/console-app/assets/{railroadDiagram-AXF67PYL-9ef7j5U7.js → railroadDiagram-AXF67PYL-3Nr0rlTp.js} +1 -1
  66. package/console-app/assets/{requirementDiagram-LRYGKXZP-Cu90DbEZ.js → requirementDiagram-LRYGKXZP-BN7sEwSa.js} +1 -1
  67. package/console-app/assets/{sankeyDiagram-W5VNT64P-Bhxmyxaw.js → sankeyDiagram-W5VNT64P-CXZR46wO.js} +1 -1
  68. package/console-app/assets/{sequenceDiagram-SI44F4Z6-CBsbRTz8.js → sequenceDiagram-SI44F4Z6-DNtmdJ4U.js} +1 -1
  69. package/console-app/assets/{src-BR8qR3lM.js → src-x1E3pJJ-.js} +1 -1
  70. package/console-app/assets/{stateDiagram-OKZ733FA-Dr0frETZ.js → stateDiagram-OKZ733FA-B_GyYdl_.js} +1 -1
  71. package/console-app/assets/stateDiagram-v2-UEYNNEHI-D7V_HITc.js +1 -0
  72. package/console-app/assets/{swimlanes-SLNWSIFB-CXMjvd_a.js → swimlanes-SLNWSIFB-D4N7VdF7.js} +1 -1
  73. package/console-app/assets/swimlanesDiagram-ULZ7WXOC-C4XcIHKT.js +8 -0
  74. package/console-app/assets/{timeline-definition-Z64GVDOM-DpmEZPV0.js → timeline-definition-Z64GVDOM-DU5rsOWQ.js} +1 -1
  75. package/console-app/assets/{treeView-QDETBFTQ-CjmuinMk.js → treeView-QDETBFTQ-DaKM_9sB.js} +1 -1
  76. package/console-app/assets/{treemap-6X3UGDF4-BP_fU6Cn.js → treemap-6X3UGDF4-BabsKtZY.js} +1 -1
  77. package/console-app/assets/{vennDiagram-T6HMQDX7-DgZS7iuW.js → vennDiagram-T6HMQDX7-Dniftpq0.js} +1 -1
  78. package/console-app/assets/{wardley-OPB4EBWU-CgMPoouN.js → wardley-OPB4EBWU-BWffQNys.js} +1 -1
  79. package/console-app/assets/{wardleyDiagram-T6FBY63Y-6y-xxP1R.js → wardleyDiagram-T6FBY63Y-CQ74fVdn.js} +1 -1
  80. package/console-app/assets/{xychartDiagram-ELKLHX3M-DOeIQjYI.js → xychartDiagram-ELKLHX3M-D-XxbGIL.js} +1 -1
  81. package/console-app/index.html +2 -2
  82. package/dist/.pikku/addon/index.d.ts +1 -1
  83. package/dist/.pikku/addon/index.js +1 -1
  84. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
  85. package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
  86. package/dist/.pikku/agent/index.d.ts +1 -1
  87. package/dist/.pikku/agent/index.js +1 -1
  88. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +42 -1
  89. package/dist/.pikku/agent/pikku-agent-types.gen.js +41 -0
  90. package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
  91. package/dist/.pikku/auth/index.d.ts +1 -1
  92. package/dist/.pikku/auth/index.js +1 -1
  93. package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +2 -19
  94. package/dist/.pikku/auth/pikku-auth-types.gen.js +2 -19
  95. package/dist/.pikku/channel/index.d.ts +1 -1
  96. package/dist/.pikku/channel/index.js +1 -1
  97. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +10 -18
  98. package/dist/.pikku/channel/pikku-channel-types.gen.js +9 -1
  99. package/dist/.pikku/cli/index.d.ts +1 -1
  100. package/dist/.pikku/cli/index.js +1 -1
  101. package/dist/.pikku/cli/pikku-cli-channel.js +6 -6
  102. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  103. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  104. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  105. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  106. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.json +24 -23
  107. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +8 -7
  108. package/dist/.pikku/cli/pikku-cli-types.gen.js +8 -7
  109. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  110. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +51 -23
  111. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  112. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  113. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  114. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  115. package/dist/.pikku/error/index.d.ts +1 -1
  116. package/dist/.pikku/error/index.js +1 -1
  117. package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
  118. package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
  119. package/dist/.pikku/function/index.d.ts +1 -1
  120. package/dist/.pikku/function/index.js +1 -1
  121. package/dist/.pikku/function/pikku-function-types.gen.d.ts +36 -37
  122. package/dist/.pikku/function/pikku-function-types.gen.js +21 -9
  123. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  124. package/dist/.pikku/function/pikku-functions-meta.gen.json +34 -34
  125. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  126. package/dist/.pikku/gateway/index.d.ts +1 -1
  127. package/dist/.pikku/gateway/index.js +1 -1
  128. package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
  129. package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
  130. package/dist/.pikku/http/index.d.ts +1 -1
  131. package/dist/.pikku/http/index.js +1 -1
  132. package/dist/.pikku/http/pikku-http-types.gen.d.ts +7 -1
  133. package/dist/.pikku/http/pikku-http-types.gen.js +5 -1
  134. package/dist/.pikku/mcp/index.d.ts +1 -1
  135. package/dist/.pikku/mcp/index.js +1 -1
  136. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +11 -1
  137. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +5 -1
  138. package/dist/.pikku/middleware/index.d.ts +1 -1
  139. package/dist/.pikku/middleware/index.js +1 -1
  140. package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +33 -24
  141. package/dist/.pikku/middleware/pikku-middleware-types.gen.js +29 -24
  142. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  143. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
  144. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  145. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  146. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  147. package/dist/.pikku/queue/index.d.ts +1 -1
  148. package/dist/.pikku/queue/index.js +1 -1
  149. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +3 -1
  150. package/dist/.pikku/queue/pikku-queue-types.gen.js +3 -1
  151. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  152. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  153. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  154. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  155. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +1 -1
  156. package/dist/.pikku/scenarios/index.d.ts +1 -1
  157. package/dist/.pikku/scenarios/index.js +1 -1
  158. package/dist/.pikku/scenarios/pikku-personas.gen.d.ts +4 -0
  159. package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
  160. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  161. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  162. package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +13 -1
  163. package/dist/.pikku/scenarios/pikku-scenario-types.gen.js +4 -0
  164. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  165. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  166. package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
  167. package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
  168. package/dist/.pikku/scheduler/index.d.ts +1 -1
  169. package/dist/.pikku/scheduler/index.js +1 -1
  170. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +3 -1
  171. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +3 -1
  172. package/dist/.pikku/schemas/register.gen.js +5 -5
  173. package/dist/.pikku/schemas/schemas/DocInput.schema.json +1 -0
  174. package/dist/.pikku/schemas/schemas/DocOutput.schema.json +1 -0
  175. package/dist/.pikku/schemas/schemas/FabricDeployApplyInput.schema.json +1 -1
  176. package/dist/.pikku/schemas/schemas/FabricDeployApplyOutput.schema.json +1 -1
  177. package/dist/.pikku/schemas/schemas/FabricSecretsRotateOutput.schema.json +1 -1
  178. package/dist/.pikku/schemas/schemas/PikkuSkillsInstallInput.schema.json +1 -1
  179. package/dist/.pikku/scopes/index.d.ts +1 -1
  180. package/dist/.pikku/scopes/index.js +1 -1
  181. package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
  182. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
  183. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
  184. package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
  185. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  186. package/dist/.pikku/secrets/index.d.ts +1 -1
  187. package/dist/.pikku/secrets/index.js +1 -1
  188. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  189. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  190. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +9 -1
  191. package/dist/.pikku/secrets/pikku-secrets.gen.js +5 -1
  192. package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
  193. package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
  194. package/dist/.pikku/setup/index.d.ts +1 -1
  195. package/dist/.pikku/setup/index.js +1 -1
  196. package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +7 -19
  197. package/dist/.pikku/setup/pikku-setup-types.gen.js +11 -19
  198. package/dist/.pikku/trigger/index.d.ts +1 -1
  199. package/dist/.pikku/trigger/index.js +1 -1
  200. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +5 -1
  201. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +5 -1
  202. package/dist/.pikku/variables/index.d.ts +1 -1
  203. package/dist/.pikku/variables/index.js +1 -1
  204. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  205. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  206. package/dist/.pikku/variables/pikku-variables.gen.d.ts +9 -1
  207. package/dist/.pikku/variables/pikku-variables.gen.js +5 -1
  208. package/dist/.pikku/workflow/index.d.ts +1 -1
  209. package/dist/.pikku/workflow/index.js +1 -1
  210. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +29 -1
  211. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +8 -1
  212. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  213. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  214. package/dist/bin/pikku-bin.mjs +2 -2
  215. package/dist/src/cli.wiring.js +21 -0
  216. package/dist/src/deploy/analyzer/analyzer.d.ts +1 -0
  217. package/dist/src/deploy/analyzer/analyzer.js +8 -6
  218. package/dist/src/deploy/build-pipeline.d.ts +1 -0
  219. package/dist/src/deploy/build-pipeline.js +1 -0
  220. package/dist/src/fabric/fabric-commands.d.ts +170 -54
  221. package/dist/src/fabric/fabric-commands.js +25 -20
  222. package/dist/src/fabric/functions/deploy.function.d.ts +246 -67
  223. package/dist/src/fabric/functions/deploy.function.js +316 -69
  224. package/dist/src/fabric/functions/init.function.js +1 -0
  225. package/dist/src/fabric/functions/link.function.js +4 -1
  226. package/dist/src/fabric/functions/secrets-rotate.function.d.ts +4 -4
  227. package/dist/src/fabric/functions/secrets-rotate.function.js +2 -2
  228. package/dist/src/fabric/functions/validate.function.js +123 -0
  229. package/dist/src/fabric/lib/deployment.d.ts +107 -0
  230. package/dist/src/fabric/lib/deployment.js +264 -0
  231. package/dist/src/fabric/sdk/pikku-fetch.gen.d.ts +1 -1
  232. package/dist/src/fabric/sdk/pikku-fetch.gen.js +1 -1
  233. package/dist/src/fabric/sdk/pikku-rpc.gen.d.ts +4 -1
  234. package/dist/src/fabric/sdk/pikku-rpc.gen.js +4 -1
  235. package/dist/src/functions/commands/deploy-apply.js +1 -0
  236. package/dist/src/functions/commands/deploy-plan.js +1 -0
  237. package/dist/src/functions/commands/doc.d.ts +22 -0
  238. package/dist/src/functions/commands/doc.js +25 -0
  239. package/dist/src/functions/commands/skills.d.ts +3 -0
  240. package/dist/src/functions/commands/skills.js +4 -2
  241. package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.d.ts +3 -2
  242. package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.js +33 -10
  243. package/dist/src/functions/surface/build-surface-doc.d.ts +8 -1
  244. package/dist/src/functions/surface/build-surface-doc.js +21 -8
  245. package/dist/src/functions/surface/collect-snippets.d.ts +13 -0
  246. package/dist/src/functions/surface/collect-snippets.js +83 -0
  247. package/dist/src/functions/surface/collect-surface.d.ts +27 -1
  248. package/dist/src/functions/surface/collect-surface.js +323 -13
  249. package/dist/src/functions/surface/generate-surface-doc.js +40 -5
  250. package/dist/src/functions/surface/render-surface-doc.d.ts +12 -0
  251. package/dist/src/functions/surface/render-surface-doc.js +209 -0
  252. package/dist/src/functions/surface/surface-doc.types.d.ts +15 -2
  253. package/dist/src/functions/surface/surface-editorial.d.ts +6 -0
  254. package/dist/src/functions/surface/surface-editorial.js +22 -1
  255. package/dist/src/functions/wirings/agent/serialize-agent-types.js +41 -0
  256. package/dist/src/functions/wirings/agent/serialize-public-agent.js +1 -1
  257. package/dist/src/functions/wirings/auth/serialize-auth-guards.js +1 -18
  258. package/dist/src/functions/wirings/auth/serialize-auth-types.js +7 -0
  259. package/dist/src/functions/wirings/channels/serialize-channel-types.js +9 -17
  260. package/dist/src/functions/wirings/cli/serialize-cli-types.js +7 -6
  261. package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
  262. package/dist/src/functions/wirings/functions/serialize-addon-refs.js +12 -0
  263. package/dist/src/functions/wirings/functions/serialize-function-types.js +23 -36
  264. package/dist/src/functions/wirings/http/serialize-http-types.js +6 -0
  265. package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +10 -0
  266. package/dist/src/functions/wirings/middleware/serialize-middleware-types.js +32 -23
  267. package/dist/src/functions/wirings/queue/serialize-queue-types.js +2 -0
  268. package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +2 -0
  269. package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +8 -0
  270. package/dist/src/functions/wirings/setup/serialize-setup-types.d.ts +1 -1
  271. package/dist/src/functions/wirings/setup/serialize-setup-types.js +19 -19
  272. package/dist/src/functions/wirings/triggers/serialize-trigger-types.js +4 -0
  273. package/dist/src/functions/wirings/variables/serialize-variables-types.js +8 -0
  274. package/dist/src/functions/wirings/workflow/serialize-personas.js +4 -0
  275. package/dist/src/functions/wirings/workflow/serialize-scenario-types.js +12 -0
  276. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +28 -0
  277. package/dist/src/services.js +8 -1
  278. package/dist/src/utils/assert-single-core-version.js +63 -11
  279. package/dist/tsconfig.tsbuildinfo +1 -1
  280. package/package.json +9 -7
  281. package/snippets-meta.json +131 -0
  282. package/snippets.json +131 -0
  283. package/surface.json +7393 -458
  284. package/console-app/assets/architecture-TIHT7OUA-DgRqRaqo.js +0 -1
  285. package/console-app/assets/channel-37lNznWk.js +0 -1
  286. package/console-app/assets/chunk-XXDRQBXY-B1prMCvW.js +0 -1
  287. package/console-app/assets/classDiagram-JCYQIIEL-BDCX9ZLm.js +0 -1
  288. package/console-app/assets/classDiagram-v2-OCEON4UE-BDCX9ZLm.js +0 -1
  289. package/console-app/assets/eventmodeling-45OFAUF4-BarrKD55.js +0 -1
  290. package/console-app/assets/flowDiagram-UKHOOZJN-B6RiRjcD.js +0 -1
  291. package/console-app/assets/railroad-abnf-AHOZXSZD-lmUjOixE.js +0 -1
  292. package/console-app/assets/railroad-ebnf-EBAXGLYW-ZjdA7OHp.js +0 -1
  293. package/console-app/assets/railroad-peg-LSFZ7HO6-VHSlvwI8.js +0 -1
  294. package/console-app/assets/stateDiagram-v2-UEYNNEHI-BSXWhCvf.js +0 -1
  295. package/console-app/assets/swimlanesDiagram-ULZ7WXOC-BUdsPDKC.js +0 -8
  296. package/dist/.pikku/schemas/schemas/FabricDeployPlanInput.schema.json +0 -1
  297. package/dist/.pikku/schemas/schemas/FabricDeployPlanOutput.schema.json +0 -1
@@ -49,8 +49,21 @@ ${rpcMapTypeImport}
49
49
  ${requiredServicesTypeImport}
50
50
  ${workflowImport}
51
51
 
52
+ /**
53
+ * The services that live for the process — the ones built once in \`createConfig\`/
54
+ * \`createSingletonServices\` and shared by every request.
55
+ */
52
56
  ${singletonServicesTypeName !== 'SingletonServices' ? `export type SingletonServices = ${singletonServicesTypeName}` : `export type { ${singletonServicesTypeName} as SingletonServices }`}
57
+ /**
58
+ * Everything a function is handed as its first argument: the singleton services
59
+ * plus whatever is built per request. This is the type to widen when you add a
60
+ * service.
61
+ */
53
62
  ${wireServicesTypeName !== 'Services' ? `export type Services = ${wireServicesTypeName}` : `export type { ${wireServicesTypeName} as Services }`}
63
+ /**
64
+ * The signed-in user as this project defines it. Reached on the wire as
65
+ * \`session\`, and replaced with \`setSession\`.
66
+ */
54
67
  ${userSessionTypeName !== 'Session' ? `export type Session = ${userSessionTypeName}` : `export type { ${userSessionTypeName} as Session }`}
55
68
 
56
69
  /**
@@ -257,21 +270,7 @@ type PikkuFunctionConfigWithSchema<
257
270
  * @param config - Function definition with \`input\`/\`output\` Zod schemas and \`func\`.
258
271
  * @returns The normalized configuration object
259
272
  *
260
- * @example
261
- * \`\`\`typescript
262
- * const createUserInput = z.object({ name: z.string(), email: z.string() })
263
- * const createUserOutput = z.object({ id: z.number() })
264
- *
265
- * const createUser = pikkuFunc({
266
- * input: createUserInput,
267
- * output: createUserOutput,
268
- * func: async ({db}, input) => {
269
- * // input is typed as { name: string, email: string }
270
- * const user = await db.users.create(input)
271
- * return { id: user.id } // must match output schema
272
- * }
273
- * })
274
- * \`\`\`
273
+ * @example snippet: sessionFunction
275
274
  */
276
275
  export function pikkuFunc<
277
276
  InputSchema extends StandardSchemaV1 | undefined = undefined,
@@ -288,6 +287,13 @@ export function pikkuFunc(func: any) {
288
287
  return typeof func === 'function' ? { func } : func
289
288
  }
290
289
 
290
+ /**
291
+ * A \`pikkuFunc\` whose input and output are already the shared list shape —
292
+ * filters, sort, paging in; rows and a total out — so a listing endpoint pages
293
+ * the same way everywhere.
294
+ *
295
+ * @example snippet: listFunction
296
+ */
291
297
  export const pikkuListFunc = <
292
298
  F extends Record<string, unknown> = {},
293
299
  Row = unknown,
@@ -348,19 +354,7 @@ type PikkuFunctionSessionlessConfigWithSchema<
348
354
  * @param config - Function definition with \`input\`/\`output\` Zod schemas and \`func\`.
349
355
  * @returns The normalized configuration object
350
356
  *
351
- * @example
352
- * \`\`\`typescript
353
- * const greetInput = z.object({ name: z.string() })
354
- * const greetOutput = z.object({ message: z.string() })
355
- *
356
- * const greet = pikkuSessionlessFunc({
357
- * input: greetInput,
358
- * output: greetOutput,
359
- * func: async (_services, { name }) => {
360
- * return { message: \`Hello, \${name}!\` }
361
- * }
362
- * })
363
- * \`\`\`
357
+ * @example snippet: readFunction
364
358
  */
365
359
  export function pikkuSessionlessFunc<
366
360
  InputSchema extends StandardSchemaV1 | undefined = undefined,
@@ -385,14 +379,7 @@ export function pikkuSessionlessFunc(func: any) {
385
379
  * @param func - Function definition, either direct function or configuration object
386
380
  * @returns The normalized configuration object
387
381
  *
388
- * @example
389
- * \`\`\`typescript
390
- * const cleanupTempFiles = pikkuVoidFunc(async ({fileSystem, logger}) => {
391
- * logger.info('Starting cleanup of temporary files')
392
- * await fileSystem.deleteDirectory('/tmp/uploads')
393
- * logger.info('Cleanup completed')
394
- * })
395
- * \`\`\`
382
+ * @example snippet: cleanupFunction
396
383
  */
397
384
  export const pikkuVoidFunc = (
398
385
  func:
@@ -33,6 +33,8 @@ type HTTPWiring<In, Out, Route extends string> = CoreHTTPFunctionWiring<In, Out,
33
33
  * @template Out - Output type for the HTTP wiring
34
34
  * @template Route - String literal type for the HTTP path (e.g., "/users/:id")
35
35
  * @param httpWiring - HTTP wiring definition with handler, method, and optional middleware
36
+ *
37
+ * @example snippet: httpSingleRoute
36
38
  */
37
39
  export const wireHTTP = <In, Out, Route extends string>(
38
40
  httpWiring: HTTPWiring<In, Out, Route> & AssertHTTPWiringParams<In, Route>
@@ -87,6 +89,8 @@ type TypedWireHTTPRoutesConfig = TypedHTTPRoutesGroupConfig & {
87
89
  `}
88
90
  /**
89
91
  * Type-safe helper for defining route contracts that can be composed.
92
+ *
93
+ * @example snippet: wireHttp
90
94
  */
91
95
  export function defineHTTPRoutes<T extends TypedHTTPRouteMap>(routes: T): TypedHTTPRouteContract<T>
92
96
  export function defineHTTPRoutes<T extends TypedHTTPRouteMap>(config: TypedHTTPRoutesGroupConfig & { routes: T }): TypedHTTPRouteContract<T>
@@ -99,6 +103,8 @@ ${addon
99
103
  : `
100
104
  /**
101
105
  * Wires multiple HTTP routes from a nested map or array configuration.
106
+ *
107
+ * @example snippet: httpRoutesWiring
102
108
  */
103
109
  export const wireHTTPRoutes = (config: TypedWireHTTPRoutesConfig): void => {
104
110
  wireHTTPRoutesCore(config as any)
@@ -43,6 +43,8 @@ ${addon
43
43
  * @template In - Input type for the resource request
44
44
  * @template URI - URI template string for compile-time parameter validation
45
45
  * @param mcpResource - MCP resource definition with data provider function
46
+ *
47
+ * @example snippet: mcpResource
46
48
  */
47
49
  export const wireMCPResource = <In, URI extends string>(
48
50
  mcpResource: MCPResourceWiring<In, URI> & AssertMCPResourceURIParams<In, URI>
@@ -56,6 +58,8 @@ export const wireMCPResource = <In, URI extends string>(
56
58
  *
57
59
  * @template In - Input type for the prompt parameters
58
60
  * @param mcpPrompt - MCP prompt definition with template function
61
+ *
62
+ * @example snippet: mcpPrompt
59
63
  */
60
64
  export const wireMCPPrompt = <In>(
61
65
  mcpPrompt: MCPPromptWiring<In>
@@ -83,6 +87,8 @@ type MCPPromptFuncConfigWithSchema<InputSchema extends StandardSchemaV1> = {
83
87
  * @template In - Input type for the prompt parameters (inferred from schema if provided)
84
88
  * @param func - Function definition, either direct function or configuration object
85
89
  * @returns The unwrapped function for internal use
90
+ *
91
+ * @example snippet: mcpPrompt
86
92
  */
87
93
  export function pikkuMCPPromptFunc<InputSchema extends StandardSchemaV1>(
88
94
  config: MCPPromptFuncConfigWithSchema<InputSchema>
@@ -125,6 +131,8 @@ type MCPToolFuncConfigWithSchema<InputSchema extends StandardSchemaV1> = {
125
131
  * @template In - Input type for the tool invocation (inferred from schema if provided)
126
132
  * @param func - Function definition, either direct function or configuration object
127
133
  * @returns The unwrapped function for internal use
134
+ *
135
+ * @example snippet: mcpSingleTool
128
136
  */
129
137
  export function pikkuMCPToolFunc<InputSchema extends StandardSchemaV1>(
130
138
  config: MCPToolFuncConfigWithSchema<InputSchema>
@@ -167,6 +175,8 @@ type MCPResourceFuncConfigWithSchema<InputSchema extends StandardSchemaV1> = {
167
175
  * @template In - Input type for the resource request (inferred from schema if provided)
168
176
  * @param func - Function definition, either direct function or configuration object
169
177
  * @returns The unwrapped function for internal use
178
+ *
179
+ * @example snippet: mcpResource
170
180
  */
171
181
  export function pikkuMCPResourceFunc<InputSchema extends StandardSchemaV1>(
172
182
  config: MCPResourceFuncConfigWithSchema<InputSchema>
@@ -24,7 +24,7 @@ import type { PikkuAgentMiddlewareHooks } from '@pikku/core/agent'
24
24
  import type { Services, SingletonServices } from '${functionTypesImportPath}'
25
25
  ${requiredServicesTypeImport}
26
26
 
27
- export { cors } from '@pikku/core/middleware'
27
+ export { cors, authAPIKey, authBearer, authCookie } from '@pikku/core/middleware'
28
28
  export type { MiddlewarePriority }
29
29
 
30
30
  /**
@@ -90,18 +90,7 @@ export const pikkuMiddleware = <RequiredServices extends SingletonServices = Wir
90
90
  * Factory function for creating middleware factories
91
91
  * Use this when your middleware needs configuration/input parameters
92
92
  *
93
- * @example
94
- * \`\`\`typescript
95
- * export const logMiddleware = pikkuMiddlewareFactory<LogOptions>(({
96
- * message,
97
- * level = 'info'
98
- * }) => {
99
- * return pikkuMiddleware(async ({ logger }, next) => {
100
- * logger[level](message)
101
- * await next()
102
- * })
103
- * })
104
- * \`\`\`
93
+ * @example snippet: middlewareFactory
105
94
  */
106
95
  export const pikkuMiddlewareFactory = <In = any>(
107
96
  factory: (input: In) => PikkuMiddleware
@@ -125,8 +114,7 @@ export const addGlobalMiddleware = (middleware: PikkuMiddleware[]) => {
125
114
  /**
126
115
  * Tag-scoped middleware. Applies to any wiring that carries the matching tag.
127
116
  *
128
- * @example
129
- * addTagMiddleware('admin', [adminMiddleware])
117
+ * @example snippet: tagMiddleware
130
118
  */
131
119
  export const addTagMiddleware = (tag: string, middleware: PikkuMiddleware[]) => {
132
120
  addTagMiddlewareCore(tag, middleware as any, ${packageNameValue})
@@ -141,14 +129,7 @@ export const addTagMiddleware = (tag: string, middleware: PikkuMiddleware[]) =>
141
129
  * @param routeOrMiddleware - Either a global middleware array or a route pattern string
142
130
  * @param middleware - The middleware array to apply when a route pattern is specified
143
131
  *
144
- * @example
145
- * \`\`\`typescript
146
- * // Add global HTTP middleware
147
- * addHTTPMiddleware([authMiddleware, loggingMiddleware])
148
- *
149
- * // Add route-specific middleware
150
- * addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
151
- * \`\`\`
132
+ * @example snippet: httpMiddleware
152
133
  */
153
134
  export const addHTTPMiddleware = (
154
135
  routeOrMiddleware: PikkuMiddleware[] | string,
@@ -157,23 +138,51 @@ export const addHTTPMiddleware = (
157
138
  addHTTPMiddlewareCore(routeOrMiddleware as any, middleware as any)
158
139
  }
159
140
 
141
+ /**
142
+ * The shape of channel middleware — it runs around the connection and its
143
+ * messages rather than around a single request.
144
+ */
160
145
  export type PikkuChannelMiddleware<RequiredServices extends Services = Services, Event = unknown> = CorePikkuChannelMiddleware<RequiredServices, Event>
161
146
 
147
+ /**
148
+ * Declares middleware for a channel — it runs around the connection and its
149
+ * messages rather than around a single request.
150
+ *
151
+ * @example snippet: channelMiddleware
152
+ */
162
153
  export const pikkuChannelMiddleware = <RequiredServices extends Services = Services, Event = unknown>(
163
154
  middleware: PikkuChannelMiddleware<RequiredServices, Event>
164
155
  ): PikkuChannelMiddleware<RequiredServices, Event> => {
165
156
  return middleware
166
157
  }
167
158
 
159
+ /**
160
+ * Declares channel middleware that takes options, so one definition can be
161
+ * wired several times with different configuration.
162
+ *
163
+ * @example snippet: channelMiddlewareFactory
164
+ */
168
165
  export const pikkuChannelMiddlewareFactory = <In = any>(
169
166
  factory: CorePikkuChannelMiddlewareFactory<In>
170
167
  ): CorePikkuChannelMiddlewareFactory<In> => {
171
168
  return factory
172
169
  }
173
170
 
171
+ /**
172
+ * Attaches channel middleware to every channel carrying the given tag, so the
173
+ * channels themselves stay free of the wiring.
174
+ *
175
+ * @example snippet: addChannelMiddleware
176
+ */
174
177
  export const addChannelMiddleware = (tag: string, middleware: PikkuChannelMiddleware[]) =>
175
178
  addChannelMiddlewareCore(tag, middleware, ${packageNameValue})
176
179
 
180
+ /**
181
+ * Declares middleware for an agent run — hooks around the model call, its tool
182
+ * calls and the run's state.
183
+ *
184
+ * @example snippet: agentMiddleware
185
+ */
177
186
  export const pikkuAgentMiddleware = <
178
187
  State extends Record<string, unknown> = Record<string, unknown>,
179
188
  RequiredServices extends SingletonServices = WiredSingletonServices,
@@ -25,6 +25,8 @@ type QueueWiring<In, Out> = CoreQueueWorker<PikkuFunctionConfig<In, Out, 'sessio
25
25
  * Workers process background jobs from queues.
26
26
  *
27
27
  * @param queueWorker - Queue worker definition with job handler
28
+ *
29
+ * @example snippet: wireQueue
28
30
  */
29
31
  export const wireQueueWorker = (queueWorker: QueueWiring<any, any>) => {
30
32
  wireQueueWorkerCore(queueWorker as any)
@@ -25,6 +25,8 @@ type SchedulerWiring = CoreScheduledTask<PikkuFunctionConfig<void, void, 'sessio
25
25
  * Tasks run based on cron expressions and are sessionless.
26
26
  *
27
27
  * @param task - Scheduled task definition with cron expression and handler
28
+ *
29
+ * @example snippet: wireScheduler
28
30
  */
29
31
  export const wireScheduler = (task: SchedulerWiring) => {
30
32
  wireSchedulerCore(task as any)
@@ -61,6 +61,10 @@ import './pikku-secrets-meta.gen.json' with { type: 'json' }`);
61
61
  }
62
62
  return `${imports.join('\n')}
63
63
 
64
+ /**
65
+ * Every secret this project declares with \`defineSecret\`, keyed by name. It is
66
+ * what gives \`secrets.getSecret('NAME')\` a real type.
67
+ */
64
68
  export type CredentialsMap = {
65
69
  ${mapEntries.join('\n')}
66
70
  }
@@ -69,6 +73,10 @@ const CREDENTIALS_META: Record<string, CredentialMeta> = {
69
73
  ${metaEntries.join(',\n')}
70
74
  }
71
75
 
76
+ /**
77
+ * The \`secrets\` service as this project sees it: \`getSecret('NAME')\` resolves
78
+ * the value's type from \`CredentialsMap\` instead of returning \`unknown\`.
79
+ */
72
80
  export class TypedSecretService extends CoreTypedSecretService<CredentialsMap> {
73
81
  constructor(secrets: SecretService) {
74
82
  super(secrets, CREDENTIALS_META)
@@ -4,4 +4,4 @@
4
4
  * the function types keeps `#pikku/function` to what a feature imports every
5
5
  * day and `#pikku/setup` to what bootstrap imports and never touches again.
6
6
  */
7
- export declare const serializeSetupTypes: (functionTypesImportPath: string, configTypeImport: string, configTypeName: string | undefined, requiredServicesTypeImport: string) => string;
7
+ export declare const serializeSetupTypes: (functionTypesImportPath: string, configTypeImport: string, configTypeName: string | undefined, requiredServicesTypeImport: string, allowShadowedServices?: string[]) => string;
@@ -4,7 +4,7 @@
4
4
  * the function types keeps `#pikku/function` to what a feature imports every
5
5
  * day and `#pikku/setup` to what bootstrap imports and never touches again.
6
6
  */
7
- export const serializeSetupTypes = (functionTypesImportPath, configTypeImport, configTypeName, requiredServicesTypeImport) => {
7
+ export const serializeSetupTypes = (functionTypesImportPath, configTypeImport, configTypeName, requiredServicesTypeImport, allowShadowedServices = []) => {
8
8
  return `/**
9
9
  * Config and service factory definitions, declared once per application
10
10
  */
@@ -14,6 +14,10 @@ import { CreateWireServices } from '@pikku/core/types'
14
14
  import type { SingletonServices } from '${functionTypesImportPath}'
15
15
  ${configTypeImport}
16
16
  ${requiredServicesTypeImport}
17
+ /**
18
+ * This project's own config — whatever \`createConfig\` returns. Every singleton
19
+ * service is built from it.
20
+ */
17
21
  ${!configTypeName ? 'export type Config = any' : configTypeName === 'Config' ? 'export type { Config }' : `export type { ${configTypeName} as Config }`}
18
22
 
19
23
  /**
@@ -23,15 +27,7 @@ ${!configTypeName ? 'export type Config = any' : configTypeName === 'Config' ? '
23
27
  * @param func - Config factory function that returns your application's config
24
28
  * @returns The config factory function
25
29
  *
26
- * @example
27
- * \`\`\`typescript
28
- * export const createConfig = pikkuConfig(async () => {
29
- * return {
30
- * apiUrl: process.env.API_URL || 'http://localhost:3000',
31
- * dbUrl: process.env.DATABASE_URL
32
- * }
33
- * })
34
- * \`\`\`
30
+ * @example snippet: pikkuConfig
35
31
  */
36
32
  export const pikkuConfig = (
37
33
  func: (variables?: any, ...args: any[]) => Promise<Config>
@@ -61,6 +57,18 @@ export const pikkuServices = (
61
57
  return async (config: Config, existingServices: Partial<SingletonServices> = {}) => {
62
58
  const createdServices = await func(config, existingServices)
63
59
  const services = { ...existingServices, ...createdServices }
60
+ const allowedToShadow = new Set<string>(${JSON.stringify(allowShadowedServices)})
61
+ const shadowed = Object.keys(createdServices).filter(
62
+ (name) =>
63
+ !allowedToShadow.has(name) &&
64
+ (existingServices as any)[name] !== undefined &&
65
+ (existingServices as any)[name] !== (createdServices as any)[name]
66
+ )
67
+ if (shadowed.length > 0) {
68
+ ;(services as any).logger?.warn?.(
69
+ \`createSingletonServices returned its own \${shadowed.join(', ')}, discarding what the host passed in. A host only passes a service it has already configured — a \\\`secrets\\\` holding this deployment's values, a \\\`kysely\\\` bound to its database — so the replacement starts empty and fails later somewhere unrelated. Write \\\`existingServices.<name> ?? new Own...\\\` to take the host's when there is one and still work standalone, or list the name under \\\`allowShadowedServices\\\` in pikku.config.json if replacing it is deliberate.\`
70
+ )
71
+ }
64
72
  const authFactory = __pikkuState(null, 'package', 'authFactory')
65
73
  if (authFactory) {
66
74
  let authInstance: Promise<unknown> | undefined
@@ -87,15 +95,7 @@ export const pikkuServices = (
87
95
  * @param func - Wire services factory function
88
96
  * @returns The wire services factory function
89
97
  *
90
- * @example
91
- * \`\`\`typescript
92
- * export const createWireServices = pikkuWireServices(async (services, wire) => {
93
- * const session = await wire.session?.get()
94
- * return {
95
- * userCache: new UserCache(session?.userId)
96
- * }
97
- * })
98
- * \`\`\`
98
+ * @example snippet: shopWireServices
99
99
  */
100
100
  export const pikkuWireServices = (
101
101
  func: (
@@ -147,6 +147,8 @@ ${addon
147
147
  * Runs everywhere — inspector extracts at build time.
148
148
  *
149
149
  * @param trigger - Trigger definition with name and function config
150
+ *
151
+ * @example snippet: wireTrigger
150
152
  */
151
153
  export const wireTrigger = (
152
154
  trigger: TriggerWiring
@@ -160,6 +162,8 @@ export const wireTrigger = (
160
162
  * Only imported in the trigger worker process.
161
163
  *
162
164
  * @param source - Trigger source with name, func, and input
165
+ *
166
+ * @example snippet: wireTriggerSource
163
167
  */
164
168
  export const wireTriggerSource = <TInput = unknown, TOutput = unknown>(
165
169
  source: TriggerSource<TInput, TOutput>
@@ -52,6 +52,10 @@ import './pikku-variables-meta.gen.json' with { type: 'json' }`);
52
52
  }
53
53
  return `${imports.join('\n')}
54
54
 
55
+ /**
56
+ * Every variable this project declares with \`defineVariable\`, keyed by name. It
57
+ * is what gives \`variables.get('NAME')\` a real type.
58
+ */
55
59
  export interface VariablesMap {
56
60
  ${mapEntries.join('\n')}
57
61
  }
@@ -60,6 +64,10 @@ const TYPED_VARIABLES_META: Record<string, VariableMeta> = {
60
64
  ${metaEntries.join(',\n')}
61
65
  }
62
66
 
67
+ /**
68
+ * The \`variables\` service as this project sees it: \`get('NAME')\` resolves the
69
+ * value's type from \`VariablesMap\` instead of returning \`unknown\`.
70
+ */
63
71
  export class TypedVariablesService extends CoreTypedVariablesService<VariablesMap> {
64
72
  constructor(variables: VariablesService) {
65
73
  super(variables, TYPED_VARIABLES_META)
@@ -28,6 +28,10 @@ export type PersonaName = keyof typeof personaConfigs
28
28
  export const personaList: ResolvedPersona[] = Object.values(personaConfigs)
29
29
 
30
30
  export type AgentName = keyof AgentMap & string
31
+ /**
32
+ * The personas this project declares, keyed by name — the \`actors\` a scenario
33
+ * step runs as.
34
+ */
31
35
  export type TypedPersonas = Record<
32
36
  PersonaName,
33
37
  ScenarioPersona<AgentName, FlattenedRPCMap>
@@ -159,6 +159,8 @@ export type PikkuScenarioHook<
159
159
  * Declares a scenario hook. Returns the function verbatim — a hook is never
160
160
  * registered, so this exists purely to give an inline hook a call site to be
161
161
  * contextually typed from, the way every other pikku primitive is.
162
+ *
163
+ * @example snippet: scenarioHook
162
164
  */
163
165
  export function pikkuScenarioHook<In = unknown, Ctx = unknown>(
164
166
  hook: PikkuFunctionScenario<In, void, Ctx>
@@ -171,6 +173,8 @@ export function pikkuScenarioHook<In = unknown, Ctx = unknown>(
171
173
  * Steps run as actors over the REAL transport — \`scenario.do(step, rpc,
172
174
  * data, { actor: actors.yasser })\` — so flows double as e2e tests and
173
175
  * staged/production health checks (no state reset; scope what you create).
176
+ *
177
+ * @example snippet: scenarioBasics
174
178
  */
175
179
  export function pikkuScenario<
176
180
  InputSchema extends StandardSchemaV1 | undefined = undefined,
@@ -252,6 +256,8 @@ type PikkuFeatureConfig<Scenarios extends readonly unknown[]> = {
252
256
  * ],
253
257
  * })
254
258
  * \`\`\`
259
+ *
260
+ * @example snippet: scenarioFeature
255
261
  */
256
262
  export function pikkuFeature<const Scenarios extends readonly unknown[]>(
257
263
  config: PikkuFeatureConfig<Scenarios>
@@ -376,6 +382,8 @@ type PikkuScenarioStepConfig<In, Out, HasActor extends boolean = false> =
376
382
  *
377
383
  * Steps are deliberately NOT registered as RPCs: a browser-driving step must
378
384
  * never be network-callable.
385
+ *
386
+ * @example snippet: scenarioStepDefinition
379
387
  */
380
388
  export function pikkuScenarioStep<
381
389
  InputSchema extends StandardSchemaV1 | undefined = undefined,
@@ -466,6 +474,8 @@ type PikkuSubjectScenarioStepConfig<In, Out> =
466
474
  *
467
475
  * Local-test-only, and never in a virtual user's catalogue: a virtual user that
468
476
  * could expire its own trial is manufacturing the outcome it exists to discover.
477
+ *
478
+ * @example snippet: platformStep
469
479
  */
470
480
  export function pikkuPlatformScenarioStep<
471
481
  InputSchema extends StandardSchemaV1 | undefined = undefined,
@@ -494,6 +504,8 @@ export function pikkuPlatformScenarioStep(config: any) {
494
504
  *
495
505
  * Local-test-only, and never in a virtual user's catalogue: one that could
496
506
  * invoke this would forge its own payment success.
507
+ *
508
+ * @example snippet: addonStep
497
509
  */
498
510
  export function pikkuAddonScenarioStep<
499
511
  InputSchema extends StandardSchemaV1 | undefined = undefined,
@@ -17,6 +17,10 @@ import type { FlattenedRPCMap } from '${rpcMapImportPath}'
17
17
  import type { FlattenedWorkflowMap } from '${workflowMapImportPath}'
18
18
  import type { AgentMap as FlattenedAgentMap } from '${agentMapImportPath}'
19
19
 
20
+ /**
21
+ * The wire a workflow step is handed: \`step\` to run one durably, plus sleeping,
22
+ * waiting for a signal and asking for approval.
23
+ */
20
24
  export interface TypedWorkflow extends PikkuWorkflowWire {
21
25
  do<K extends keyof FlattenedRPCMap>(
22
26
  stepName: string,
@@ -47,6 +51,9 @@ import type { ScopeId } from '${scopesImportPath}'
47
51
  import { PikkuError } from '@pikku/core/errors'
48
52
  import type { CorePermissionGroup } from '@pikku/core/function'
49
53
 
54
+ /**
55
+ * The shape of a workflow's body — services, input, and the workflow wire.
56
+ */
50
57
  export type PikkuFunctionWorkflow<
51
58
  In = unknown,
52
59
  Out = never
@@ -70,6 +77,13 @@ ${sharedWorkflowConfigFields}
70
77
  permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
71
78
  }
72
79
 
80
+ /**
81
+ * Declares a workflow: the DSL form, where each step is awaited in order and
82
+ * the runner persists progress between them so a restart resumes rather than
83
+ * replays. The default choice for a workflow.
84
+ *
85
+ * @example snippet: workflowSteps
86
+ */
73
87
  export function pikkuWorkflowFunc<
74
88
  InputSchema extends StandardSchemaV1 | undefined = undefined,
75
89
  OutputSchema extends StandardSchemaV1 | undefined = undefined
@@ -85,6 +99,13 @@ export function pikkuWorkflowFunc(func: any) {
85
99
  return typeof func === 'function' ? { func } : func
86
100
  }
87
101
 
102
+ /**
103
+ * Declares a workflow whose control flow the DSL cannot express - a loop whose
104
+ * bound is only known at runtime, or branching that rejoins. An escape hatch:
105
+ * reach for \`pikkuWorkflowFunc\` unless the shape genuinely needs this.
106
+ *
107
+ * @example snippet: workflowComplexFunc
108
+ */
88
109
  export function pikkuWorkflowComplexFunc<
89
110
  InputSchema extends StandardSchemaV1 | undefined = undefined,
90
111
  OutputSchema extends StandardSchemaV1 | undefined = undefined
@@ -167,6 +188,13 @@ type GraphNodeConfigMap<FuncMap extends Record<string, string>> = {
167
188
 
168
189
  type NextConfig<NodeIds extends string> = NodeIds | NodeIds[] | { if: string; then: NodeIds; else?: NodeIds }
169
190
 
191
+ /**
192
+ * Declares a workflow as an explicit node graph, for a genuine cyclic
193
+ * dependency or a Node-only import the DSL cannot carry. The last resort of the
194
+ * three.
195
+ *
196
+ * @example snippet: workflowGraph
197
+ */
170
198
  export function pikkuWorkflowGraph<
171
199
  const FuncMap extends Record<
172
200
  string,
@@ -69,12 +69,14 @@ export const defaultCLIRenderer = pikkuCLIRender((_services, data) => {
69
69
  /**
70
70
  * Commands that must work in a directory that is not a Pikku project.
71
71
  * `skills install` writes agent skills into a repo that has no pikku.config.json
72
- * yet — that is the whole point of it — so it cannot require one to start.
72
+ * yet — that is the whole point of it — so it cannot require one to start, and
73
+ * `doc` answers from the surface shipped inside the CLI rather than the project.
73
74
  */
74
75
  const CONFIG_FREE_COMMANDS = new Set([
75
76
  'skills',
76
77
  'skills.list',
77
78
  'skills.install',
79
+ 'doc',
78
80
  ]);
79
81
  export const createConfig = async (_variablesService, data, commandPath = []) => {
80
82
  // Determine log level based on CLI flags with precedence:
@@ -166,6 +168,10 @@ export const createSingletonServices = async (config) => {
166
168
  let unfilteredStateIsSetupOnly = false;
167
169
  let inspectedTsGeneration;
168
170
  let inspectorInvalidated = false;
171
+ const releaseProgram = (state) => {
172
+ if (state)
173
+ state.program = undefined;
174
+ };
169
175
  /**
170
176
  * `unfiltered` is for commands that RUN the project rather than generate from
171
177
  * it. The CLI filters narrow what gets written out, which is meaningless to a
@@ -304,6 +310,7 @@ export const createSingletonServices = async (config) => {
304
310
  logger.debug(`Inspector took ${Date.now() - inspectStart}ms`);
305
311
  inspectedTsGeneration = tsGenerationAtInspect;
306
312
  inspectorInvalidated = false;
313
+ releaseProgram(unfilteredState);
307
314
  if ('diagnostics' in unfilteredState &&
308
315
  unfilteredState.diagnostics.length > 0) {
309
316
  processDiagnostics(unfilteredState.diagnostics, config.lint);