@pikku/cli 0.12.115 → 0.12.116

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 (296) hide show
  1. package/CHANGELOG.md +260 -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/tsconfig.tsbuildinfo +1 -1
  279. package/package.json +9 -7
  280. package/snippets-meta.json +131 -0
  281. package/snippets.json +131 -0
  282. package/surface.json +7393 -458
  283. package/console-app/assets/architecture-TIHT7OUA-DgRqRaqo.js +0 -1
  284. package/console-app/assets/channel-37lNznWk.js +0 -1
  285. package/console-app/assets/chunk-XXDRQBXY-B1prMCvW.js +0 -1
  286. package/console-app/assets/classDiagram-JCYQIIEL-BDCX9ZLm.js +0 -1
  287. package/console-app/assets/classDiagram-v2-OCEON4UE-BDCX9ZLm.js +0 -1
  288. package/console-app/assets/eventmodeling-45OFAUF4-BarrKD55.js +0 -1
  289. package/console-app/assets/flowDiagram-UKHOOZJN-B6RiRjcD.js +0 -1
  290. package/console-app/assets/railroad-abnf-AHOZXSZD-lmUjOixE.js +0 -1
  291. package/console-app/assets/railroad-ebnf-EBAXGLYW-ZjdA7OHp.js +0 -1
  292. package/console-app/assets/railroad-peg-LSFZ7HO6-VHSlvwI8.js +0 -1
  293. package/console-app/assets/stateDiagram-v2-UEYNNEHI-BSXWhCvf.js +0 -1
  294. package/console-app/assets/swimlanesDiagram-ULZ7WXOC-BUdsPDKC.js +0 -8
  295. package/dist/.pikku/schemas/schemas/FabricDeployPlanInput.schema.json +0 -1
  296. package/dist/.pikku/schemas/schemas/FabricDeployPlanOutput.schema.json +0 -1
@@ -0,0 +1,107 @@
1
+ import type { PikkuRPC } from '../sdk/pikku-rpc.gen.js';
2
+ import type { GetDeploymentStatusOutput } from '../sdk/rpc-map.gen.d.js';
3
+ type MissingConfigEntry = GetDeploymentStatusOutput['missingSecrets'][number];
4
+ export type BlockedReason = 'awaiting_approval' | 'needs_config' | 'needs_attention' | 'unknown';
5
+ export type StatusClass = 'in_flight' | 'succeeded' | 'failed' | 'blocked';
6
+ export declare function classifyStatus(status: string): StatusClass;
7
+ export declare function blockedReason(statusReason: string | null): BlockedReason;
8
+ export declare function isApprovable(reason: BlockedReason): boolean;
9
+ export declare function stateLabel(status: string, statusReason: string | null): string;
10
+ export declare function blockedSummary(reason: BlockedReason): string;
11
+ export interface DeploymentStatus {
12
+ status: string;
13
+ statusReason: string | null;
14
+ stageId: string;
15
+ hostname: string | null;
16
+ missingSecrets: MissingConfigEntry[];
17
+ missingVariables: MissingConfigEntry[];
18
+ }
19
+ export declare function readDeploymentStatus(rpc: PikkuRPC, deploymentId: string): Promise<DeploymentStatus>;
20
+ export declare function approveDeployment(rpc: PikkuRPC, deploymentId: string): Promise<boolean>;
21
+ export interface MigrationRisk {
22
+ name: string;
23
+ level: 'destructive' | 'safe';
24
+ reasons: string[];
25
+ }
26
+ export declare function destructiveMigrations(changes: DeploymentChanges | null | undefined): MigrationRisk[];
27
+ export interface DeploymentChanges {
28
+ unitsAdded: string[];
29
+ unitsRemoved: string[];
30
+ handlersAdded: string[];
31
+ handlersRemoved: string[];
32
+ workflowsAdded: string[];
33
+ workflowsRemoved: string[];
34
+ workflowsChanged: string[];
35
+ functionsAdded: string[];
36
+ functionsRemoved: string[];
37
+ secretsChanged: string[];
38
+ variablesChanged: string[];
39
+ pendingMigrations: string[];
40
+ migrationRisks: MigrationRisk[];
41
+ }
42
+ export declare function changesAreEmpty(changes: DeploymentChanges): boolean;
43
+ export interface DeploymentDescription {
44
+ branch: string;
45
+ stageId: string;
46
+ gitSha: string | null;
47
+ status: string;
48
+ statusReason: string | null;
49
+ url: string | null;
50
+ changes: DeploymentChanges | null;
51
+ }
52
+ export declare function describeDeployment(rpc: PikkuRPC, projectId: string, deploymentId: string): Promise<DeploymentDescription | null>;
53
+ export interface DeployedWorker {
54
+ name: string;
55
+ role: string;
56
+ status: string;
57
+ }
58
+ export declare function readWorkers(rpc: PikkuRPC, stageId: string): Promise<DeployedWorker[]>;
59
+ export type ProgressEvent = {
60
+ event: 'created';
61
+ deploymentId: string;
62
+ branch: string;
63
+ ref: string;
64
+ } | {
65
+ event: 'attached';
66
+ deploymentId: string;
67
+ status: string;
68
+ } | {
69
+ event: 'status';
70
+ deploymentId: string;
71
+ status: string;
72
+ statusReason: string | null;
73
+ elapsedMs: number;
74
+ } | {
75
+ event: 'blocked';
76
+ deploymentId: string;
77
+ reason: BlockedReason;
78
+ missingSecrets: string[];
79
+ missingVariables: string[];
80
+ } | {
81
+ event: 'approved';
82
+ deploymentId: string;
83
+ };
84
+ export type WaitOutcome = 'succeeded' | 'failed' | 'blocked' | 'timeout';
85
+ export interface WaitResult {
86
+ outcome: WaitOutcome;
87
+ status: string;
88
+ statusReason: string | null;
89
+ stageId: string;
90
+ hostname: string | null;
91
+ reason: BlockedReason | null;
92
+ missingSecrets: MissingConfigEntry[];
93
+ missingVariables: MissingConfigEntry[];
94
+ approved: boolean;
95
+ elapsedMs: number;
96
+ }
97
+ export interface WaitOptions {
98
+ rpc: PikkuRPC;
99
+ deploymentId: string;
100
+ timeoutMs: number;
101
+ approve: (status: DeploymentStatus) => Promise<boolean>;
102
+ onEvent: (event: ProgressEvent) => void;
103
+ sleep?: (ms: number) => Promise<void>;
104
+ now?: () => number;
105
+ }
106
+ export declare function waitForDeployment({ rpc, deploymentId, timeoutMs, approve, onEvent, sleep, now, }: WaitOptions): Promise<WaitResult>;
107
+ export {};
@@ -0,0 +1,264 @@
1
+ const IN_FLIGHT = new Set(['queued', 'planning', 'building', 'deploying']);
2
+ const SUCCEEDED = new Set(['active']);
3
+ const FAILED = new Set([
4
+ 'failed',
5
+ 'error',
6
+ 'timed_out',
7
+ 'cancelled',
8
+ 'rolled_back',
9
+ 'stopped',
10
+ 'archived',
11
+ ]);
12
+ export function classifyStatus(status) {
13
+ if (SUCCEEDED.has(status))
14
+ return 'succeeded';
15
+ if (FAILED.has(status))
16
+ return 'failed';
17
+ if (status === 'suspended')
18
+ return 'blocked';
19
+ if (IN_FLIGHT.has(status))
20
+ return 'in_flight';
21
+ return 'in_flight';
22
+ }
23
+ export function blockedReason(statusReason) {
24
+ if (statusReason === 'awaiting_approval' ||
25
+ statusReason === 'needs_config' ||
26
+ statusReason === 'needs_attention') {
27
+ return statusReason;
28
+ }
29
+ return 'unknown';
30
+ }
31
+ export function isApprovable(reason) {
32
+ return reason === 'awaiting_approval';
33
+ }
34
+ export function stateLabel(status, statusReason) {
35
+ if (status === 'suspended') {
36
+ if (statusReason === 'needs_attention')
37
+ return 'needs attention';
38
+ if (statusReason === 'needs_config')
39
+ return 'config required';
40
+ return 'planned';
41
+ }
42
+ if (status === 'active')
43
+ return 'live';
44
+ if (status === 'rolled_back')
45
+ return 'rolled back';
46
+ if (status === 'timed_out')
47
+ return 'timed out';
48
+ return status;
49
+ }
50
+ export function blockedSummary(reason) {
51
+ switch (reason) {
52
+ case 'needs_attention':
53
+ return 'Plan needs attention before it can deploy';
54
+ case 'needs_config':
55
+ return 'Required config missing — set values before approving';
56
+ case 'awaiting_approval':
57
+ return 'Plan ready — approve to deploy';
58
+ default:
59
+ return 'Deployment is suspended';
60
+ }
61
+ }
62
+ export async function readDeploymentStatus(rpc, deploymentId) {
63
+ const s = await rpc.invoke('getDeploymentStatus', { deploymentId });
64
+ return {
65
+ status: s.status,
66
+ statusReason: s.statusReason,
67
+ stageId: s.stageId,
68
+ hostname: s.hostname,
69
+ missingSecrets: s.missingSecrets,
70
+ missingVariables: s.missingVariables,
71
+ };
72
+ }
73
+ export async function approveDeployment(rpc, deploymentId) {
74
+ const { resumed } = await rpc.invoke('applyDeployment', { deploymentId });
75
+ return resumed;
76
+ }
77
+ function parseMigrationRisks(plan) {
78
+ const raw = plan
79
+ ?.migrationRisks;
80
+ if (!Array.isArray(raw))
81
+ return [];
82
+ const risks = [];
83
+ for (const entry of raw) {
84
+ if (!entry || typeof entry !== 'object')
85
+ continue;
86
+ const { name, level, reasons } = entry;
87
+ if (typeof name !== 'string')
88
+ continue;
89
+ if (level !== 'destructive' && level !== 'safe')
90
+ continue;
91
+ risks.push({
92
+ name,
93
+ level,
94
+ reasons: Array.isArray(reasons)
95
+ ? reasons.filter((r) => typeof r === 'string')
96
+ : [],
97
+ });
98
+ }
99
+ return risks;
100
+ }
101
+ export function destructiveMigrations(changes) {
102
+ return (changes?.migrationRisks ?? []).filter((r) => r.level === 'destructive');
103
+ }
104
+ export function changesAreEmpty(changes) {
105
+ return Object.values(changes).every((list) => list.length === 0);
106
+ }
107
+ const handlerNames = (entries) => (entries ?? []).map((h) => `${h.unit}/${h.id}`);
108
+ export async function describeDeployment(rpc, projectId, deploymentId) {
109
+ const { stages } = await rpc.invoke('getProjectDeployments', {
110
+ projectId,
111
+ includeDismissed: true,
112
+ });
113
+ for (const stage of stages) {
114
+ for (const deployment of stage.deployments) {
115
+ if (deployment.deploymentId !== deploymentId)
116
+ continue;
117
+ const diff = deployment.diff;
118
+ const executed = new Set((deployment.migrations ?? []).map((m) => m.migrationName));
119
+ const planned = deployment.plan?.pendingMigrations;
120
+ const pendingMigrations = Array.isArray(planned)
121
+ ? planned
122
+ .filter((m) => typeof m === 'string')
123
+ .filter((m) => !executed.has(m))
124
+ : [];
125
+ const pending = new Set(pendingMigrations);
126
+ const migrationRisks = parseMigrationRisks(deployment.plan).filter((r) => pending.has(r.name));
127
+ const changes = diff
128
+ ? {
129
+ unitsAdded: diff.units.added,
130
+ unitsRemoved: diff.units.removed,
131
+ handlersAdded: handlerNames(diff.handlers.added),
132
+ handlersRemoved: handlerNames(diff.handlers.removed),
133
+ workflowsAdded: diff.workflows.added,
134
+ workflowsRemoved: diff.workflows.removed,
135
+ workflowsChanged: diff.workflows.hashChanged,
136
+ functionsAdded: diff.contracts.addedFunctions,
137
+ functionsRemoved: diff.contracts.removedFunctions,
138
+ secretsChanged: [
139
+ ...diff.secrets.added,
140
+ ...diff.secrets.removed,
141
+ ...diff.secrets.modified,
142
+ ],
143
+ variablesChanged: [
144
+ ...diff.variables.added,
145
+ ...diff.variables.removed,
146
+ ...diff.variables.modified,
147
+ ],
148
+ pendingMigrations,
149
+ migrationRisks,
150
+ }
151
+ : pendingMigrations.length > 0
152
+ ? {
153
+ unitsAdded: [],
154
+ unitsRemoved: [],
155
+ handlersAdded: [],
156
+ handlersRemoved: [],
157
+ workflowsAdded: [],
158
+ workflowsRemoved: [],
159
+ workflowsChanged: [],
160
+ functionsAdded: [],
161
+ functionsRemoved: [],
162
+ secretsChanged: [],
163
+ variablesChanged: [],
164
+ pendingMigrations,
165
+ migrationRisks,
166
+ }
167
+ : null;
168
+ return {
169
+ branch: stage.branch,
170
+ stageId: stage.stageId,
171
+ gitSha: deployment.gitSha,
172
+ status: deployment.status,
173
+ statusReason: deployment.statusReason ?? null,
174
+ url: stage.url,
175
+ changes,
176
+ };
177
+ }
178
+ }
179
+ return null;
180
+ }
181
+ export async function readWorkers(rpc, stageId) {
182
+ const { workers } = await rpc.invoke('listDeploymentWorkers', { stageId });
183
+ return workers.map(({ name, role, status }) => ({ name, role, status }));
184
+ }
185
+ const RESUME_GRACE_MS = 30_000;
186
+ const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
187
+ export async function waitForDeployment({ rpc, deploymentId, timeoutMs, approve, onEvent, sleep = defaultSleep, now = Date.now, }) {
188
+ const startedAt = now();
189
+ const elapsed = () => now() - startedAt;
190
+ let delay = 2_000;
191
+ let lastStatus = null;
192
+ let approved = false;
193
+ let approvedAt = 0;
194
+ let lastBlockedReason = null;
195
+ const settle = (status, outcome, reason) => ({
196
+ outcome,
197
+ status: status.status,
198
+ statusReason: status.statusReason,
199
+ stageId: status.stageId,
200
+ hostname: status.hostname,
201
+ reason,
202
+ missingSecrets: status.missingSecrets,
203
+ missingVariables: status.missingVariables,
204
+ approved,
205
+ elapsedMs: elapsed(),
206
+ });
207
+ let latest = await readDeploymentStatus(rpc, deploymentId);
208
+ while (true) {
209
+ if (latest.status !== lastStatus) {
210
+ lastStatus = latest.status;
211
+ onEvent({
212
+ event: 'status',
213
+ deploymentId,
214
+ status: latest.status,
215
+ statusReason: latest.statusReason,
216
+ elapsedMs: elapsed(),
217
+ });
218
+ }
219
+ const klass = classifyStatus(latest.status);
220
+ if (klass === 'succeeded')
221
+ return settle(latest, 'succeeded', null);
222
+ if (klass === 'failed')
223
+ return settle(latest, 'failed', null);
224
+ if (klass === 'blocked') {
225
+ const reason = blockedReason(latest.statusReason);
226
+ if (reason !== lastBlockedReason) {
227
+ lastBlockedReason = reason;
228
+ onEvent({
229
+ event: 'blocked',
230
+ deploymentId,
231
+ reason,
232
+ missingSecrets: latest.missingSecrets.map((m) => m.name),
233
+ missingVariables: latest.missingVariables.map((m) => m.name),
234
+ });
235
+ }
236
+ if (!isApprovable(reason)) {
237
+ return settle(latest, 'blocked', reason);
238
+ }
239
+ if (approved) {
240
+ if (elapsed() - approvedAt >= RESUME_GRACE_MS) {
241
+ return settle(latest, 'blocked', reason);
242
+ }
243
+ }
244
+ else {
245
+ if (!(await approve(latest))) {
246
+ return settle(latest, 'blocked', reason);
247
+ }
248
+ await approveDeployment(rpc, deploymentId);
249
+ approved = true;
250
+ approvedAt = elapsed();
251
+ onEvent({ event: 'approved', deploymentId });
252
+ delay = 2_000;
253
+ latest = await readDeploymentStatus(rpc, deploymentId);
254
+ continue;
255
+ }
256
+ }
257
+ const remaining = timeoutMs - elapsed();
258
+ if (remaining <= 0)
259
+ return settle(latest, 'timeout', null);
260
+ await sleep(Math.min(delay, remaining));
261
+ delay = Math.min(delay * 1.5, 10_000);
262
+ latest = await readDeploymentStatus(rpc, deploymentId);
263
+ }
264
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.21
2
+ * This file was generated by @pikku/cli@0.12.113
3
3
  */
4
4
  import { CorePikkuFetch } from '@pikku/fetch';
5
5
  import type { HTTPWiringsMap, HTTPWiringHandlerOf, HTTPWiringsWithMethod } from './http-map.gen.d.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.21
2
+ * This file was generated by @pikku/cli@0.12.113
3
3
  */
4
4
  import { CorePikkuFetch } from '@pikku/fetch';
5
5
  export class PikkuFetch extends CorePikkuFetch {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.21
2
+ * This file was generated by @pikku/cli@0.12.113
3
3
  */
4
4
  import { PikkuFetch } from "./pikku-fetch.gen.js";
5
5
  import type { RPCInvoke, TypedAgentRun, TypedStartWorkflow, TypedRunWorkflow, TypedWorkflowStatus } from './rpc-map.gen.d.js';
@@ -101,5 +101,8 @@ export declare class PikkuRPC {
101
101
  */
102
102
  approve: (agentName: string, input: Record<string, unknown>) => Promise<any>;
103
103
  };
104
+ subscribeToSSE<T = unknown>(path: string, handler: (event: T) => void, onError?: (err: unknown) => void): {
105
+ close: () => void;
106
+ };
104
107
  }
105
108
  export declare const pikkuRPC: PikkuRPC;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.21
2
+ * This file was generated by @pikku/cli@0.12.113
3
3
  */
4
4
  import { PikkuFetch } from "./pikku-fetch.gen.js";
5
5
  /**
@@ -122,5 +122,8 @@ export class PikkuRPC {
122
122
  return await this.pikkuFetch.post(`/rpc/agent/${String(agentName)}/approve`, input);
123
123
  },
124
124
  };
125
+ subscribeToSSE(path, handler, onError) {
126
+ return this.pikkuFetch.subscribeToSSE(path, handler, onError);
127
+ }
125
128
  }
126
129
  export const pikkuRPC = new PikkuRPC();
@@ -210,6 +210,7 @@ export const deployApply = pikkuSessionlessFunc({
210
210
  inspectorState,
211
211
  serverlessIncompatible: config.deploy?.serverlessIncompatible,
212
212
  defaultTarget: config.deploy?.defaultTarget,
213
+ globalHTTPPrefix: config.globalHTTPPrefix,
213
214
  getEntryContext,
214
215
  outDir: config.outDir,
215
216
  debugArtifacts: data?.debugArtifacts ?? false,
@@ -57,6 +57,7 @@ export const deployPlan = pikkuSessionlessFunc({
57
57
  inspectorState,
58
58
  serverlessIncompatible: config.deploy?.serverlessIncompatible,
59
59
  defaultTarget: config.deploy?.defaultTarget,
60
+ globalHTTPPrefix: config.globalHTTPPrefix,
60
61
  getEntryContext,
61
62
  outDir: config.outDir,
62
63
  debugArtifacts: data?.debugArtifacts ?? false,
@@ -0,0 +1,22 @@
1
+ export declare const doc: import("#pikku/function").PikkuFunctionConfig<{
2
+ topics?: string[];
3
+ ai?: boolean;
4
+ addon?: boolean;
5
+ }, {
6
+ text: string;
7
+ }, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<{
8
+ topics?: string[];
9
+ ai?: boolean;
10
+ addon?: boolean;
11
+ }, {
12
+ text: string;
13
+ }, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<{
14
+ topics?: string[];
15
+ ai?: boolean;
16
+ addon?: boolean;
17
+ }, {
18
+ text: string;
19
+ }, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
20
+ export declare const renderDoc: (_services: unknown, { text }: {
21
+ text: string;
22
+ }) => void;
@@ -0,0 +1,25 @@
1
+ import { pikkuSessionlessFunc } from '#pikku/function';
2
+ import { readShippedSurfaceDoc } from '../surface/shipped-surface-doc.js';
3
+ import { renderSurfaceDoc } from '../surface/render-surface-doc.js';
4
+ export const doc = pikkuSessionlessFunc({
5
+ description: 'Print the public API surface of the pikku version installed here: the doors you import from, what each exports, and how each export is called.',
6
+ func: async (_services, { topics, ai, addon }) => {
7
+ const surface = readShippedSurfaceDoc();
8
+ if (!surface) {
9
+ throw new Error('This @pikku/cli has no surface doc. It ships with the published package and is written when the CLI is built, so a source checkout needs a build first.');
10
+ }
11
+ const targets = topics?.length ? topics : [undefined];
12
+ return {
13
+ text: targets
14
+ .map((target) => renderSurfaceDoc(surface, {
15
+ target,
16
+ ai,
17
+ entryPoint: addon ? 'addon' : 'app',
18
+ }))
19
+ .join('\n\n'),
20
+ };
21
+ },
22
+ });
23
+ export const renderDoc = (_services, { text }) => {
24
+ console.log(text);
25
+ };
@@ -10,17 +10,20 @@ export declare const pikkuSkillsInstall: import("#pikku/function").PikkuFunction
10
10
  only?: string;
11
11
  core?: boolean;
12
12
  fabric?: boolean;
13
+ client?: boolean;
13
14
  update?: boolean;
14
15
  }, void, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<{
15
16
  agent?: string;
16
17
  only?: string;
17
18
  core?: boolean;
18
19
  fabric?: boolean;
20
+ client?: boolean;
19
21
  update?: boolean;
20
22
  }, void, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<{
21
23
  agent?: string;
22
24
  only?: string;
23
25
  core?: boolean;
24
26
  fabric?: boolean;
27
+ client?: boolean;
25
28
  update?: boolean;
26
29
  }, void, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
@@ -67,7 +67,7 @@ async function readSkillInstallGroups(skillName) {
67
67
  return [];
68
68
  return parseInstallGroups(match[1]);
69
69
  }
70
- async function getWantedSkills(allEntries, { only, core = false, fabric = false, }) {
70
+ async function getWantedSkills(allEntries, { only, core = false, fabric = false, client = false, }) {
71
71
  const wanted = new Set();
72
72
  if (only) {
73
73
  for (const name of only
@@ -80,6 +80,7 @@ async function getWantedSkills(allEntries, { only, core = false, fabric = false,
80
80
  const requestedGroups = [
81
81
  ...(core ? ['core'] : []),
82
82
  ...(fabric ? ['fabric'] : []),
83
+ ...(client ? ['client'] : []),
83
84
  ];
84
85
  if (requestedGroups.length > 0) {
85
86
  for (const name of allEntries) {
@@ -117,7 +118,7 @@ export const pikkuSkillsList = pikkuSessionlessFunc({
117
118
  },
118
119
  });
119
120
  export const pikkuSkillsInstall = pikkuSessionlessFunc({
120
- func: async ({ logger }, { agent = 'claude', only, core = false, fabric = false, update = false }) => {
121
+ func: async ({ logger }, { agent = 'claude', only, core = false, fabric = false, client = false, update = false, }) => {
121
122
  const supportedAgents = Object.keys(AGENT_SKILL_DIRS);
122
123
  if (!supportedAgents.includes(agent)) {
123
124
  logger.error(`Agent "${agent}" is not yet supported. Supported: ${supportedAgents.join(', ')}. ` +
@@ -130,6 +131,7 @@ export const pikkuSkillsInstall = pikkuSessionlessFunc({
130
131
  only,
131
132
  core,
132
133
  fabric,
134
+ client,
133
135
  });
134
136
  const missing = wanted.filter((n) => !allEntries.includes(n));
135
137
  if (missing.length > 0) {
@@ -3,8 +3,9 @@
3
3
  *
4
4
  * The "server function" is a Pikku function; this shim is a typed *caller* over
5
5
  * the generated RPC map (`PikkuRPC`) for use in Start loaders, actions and
6
- * components. The API base URL comes from `import.meta.env.VITE_API_URL` and the
7
- * shim throws if it is unset — never hardcode a host.
6
+ * components. The base URL is derived from the page origin in the browser and
7
+ * from a runtime binding during SSR — never hardcoded, and never taken from a
8
+ * build-time variable alone, which is undefined in a deployed bundle.
8
9
  *
9
10
  * @param rpcWiringsPath - import path to the file exporting the `PikkuRPC` class
10
11
  */
@@ -3,8 +3,9 @@
3
3
  *
4
4
  * The "server function" is a Pikku function; this shim is a typed *caller* over
5
5
  * the generated RPC map (`PikkuRPC`) for use in Start loaders, actions and
6
- * components. The API base URL comes from `import.meta.env.VITE_API_URL` and the
7
- * shim throws if it is unset — never hardcode a host.
6
+ * components. The base URL is derived from the page origin in the browser and
7
+ * from a runtime binding during SSR — never hardcoded, and never taken from a
8
+ * build-time variable alone, which is undefined in a deployed bundle.
8
9
  *
9
10
  * @param rpcWiringsPath - import path to the file exporting the `PikkuRPC` class
10
11
  */
@@ -17,19 +18,41 @@ export const serializeTanStackStartShim = (rpcWiringsPath) => {
17
18
  *
18
19
  * loader: () => makeApi().invoke('listCards', {})
19
20
  *
20
- * The API base URL is read from \`import.meta.env.VITE_API_URL\`.
21
+ * In the browser the base URL is \`import.meta.env.VITE_API_URL\` when the build
22
+ * inlined one, otherwise the page's own origin + /api. During SSR it comes from
23
+ * \`PIKKU_API_URL\` / \`VITE_API_URL\` in the environment, since there is no page
24
+ * to derive it from.
21
25
  */
22
26
  import { PikkuRPC } from '${rpcWiringsPath}'
23
27
 
24
- export function makeApi(): PikkuRPC {
25
- const serverUrl = import.meta.env.VITE_API_URL
26
- if (!serverUrl) {
27
- throw new Error(
28
- 'VITE_API_URL is not set — point it at the Pikku API base URL'
29
- )
28
+ const LOCAL_HOSTNAME = /^(localhost|127\\.0\\.0\\.1)$/
29
+ const LOCAL_BASE = /\\/\\/(localhost|127\\.0\\.0\\.1)(:|\\/)/
30
+
31
+ export function apiBaseUrl(): string {
32
+ const configured = import.meta.env.VITE_API_URL
33
+
34
+ if (import.meta.env.SSR) {
35
+ const env = (globalThis as { process?: { env?: Record<string, string | undefined> } })
36
+ .process?.env
37
+ const serverUrl = env?.PIKKU_API_URL ?? env?.VITE_API_URL ?? configured
38
+ if (!serverUrl) {
39
+ throw new Error(
40
+ 'No API base URL during SSR — set VITE_API_URL for local dev, or bind PIKKU_API_URL on the deployed server'
41
+ )
42
+ }
43
+ return serverUrl
44
+ }
45
+
46
+ const remote = !LOCAL_HOSTNAME.test(window.location.hostname)
47
+ if (configured && !(remote && LOCAL_BASE.test(configured))) {
48
+ return configured
30
49
  }
50
+ return window.location.origin + '/api'
51
+ }
52
+
53
+ export function makeApi(): PikkuRPC {
31
54
  const rpc = new PikkuRPC()
32
- rpc.setServerUrl(serverUrl)
55
+ rpc.setServerUrl(apiBaseUrl())
33
56
  return rpc
34
57
  }
35
58
  `;
@@ -18,5 +18,12 @@ export type BuildSurfaceDocOptions = {
18
18
  version: string;
19
19
  app: SurfaceProject;
20
20
  addon: SurfaceProject;
21
+ /** Named regions an `@example snippet: <name>` resolves against. */
22
+ snippets?: Map<string, string>;
21
23
  };
22
- export declare const buildSurfaceDoc: ({ version, app, addon, }: BuildSurfaceDocOptions) => Promise<SurfaceDoc>;
24
+ /**
25
+ * An example names a snippet rather than restating it, and both entrypoints
26
+ * resolve against the same map — the regions come from one running application
27
+ * (`examples/online-shop`), not from whichever template happened to hold them.
28
+ */
29
+ export declare const buildSurfaceDoc: ({ version, app, addon, snippets, }: BuildSurfaceDocOptions) => Promise<SurfaceDoc>;