@pikku/cli 0.12.155 → 0.12.159

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 (273) hide show
  1. package/console-app/assets/{HelpPanel-Ndvkqpn8.js → HelpPanel-C06T226y.js} +1 -1
  2. package/console-app/assets/{abnfDiagram-VCTEODGH-DvUR4gej.js → abnfDiagram-VCTEODGH-BVwdT3Es.js} +1 -1
  3. package/console-app/assets/architecture-7GRP2DOG-3y7bWtag.js +1 -0
  4. package/console-app/assets/{architectureDiagram-5GKGNRK7-HLwJ3llk.js → architectureDiagram-5GKGNRK7-XfzqZ3mW.js} +1 -1
  5. package/console-app/assets/{blockDiagram-I7D4REHJ-LMSdIVfc.js → blockDiagram-I7D4REHJ-B5omSqDK.js} +1 -1
  6. package/console-app/assets/{c4Diagram-7LVT6UL2-CcWW9nYv.js → c4Diagram-7LVT6UL2-DkPe7xCg.js} +1 -1
  7. package/console-app/assets/channel-CTiluQVw.js +1 -0
  8. package/console-app/assets/{chunk-4HAMMTFA-Dxcu8ptc.js → chunk-4HAMMTFA-QfSXT_X7.js} +1 -1
  9. package/console-app/assets/{chunk-75Z2AOVW-BBINCcJe.js → chunk-75Z2AOVW-h7UnPWNo.js} +1 -1
  10. package/console-app/assets/{chunk-DU6HZSFF-BgJhrYpo.js → chunk-DU6HZSFF-VaMy-LOI.js} +1 -1
  11. package/console-app/assets/{chunk-F27PBJKO-CctviqIo.js → chunk-F27PBJKO-toywqOqS.js} +1 -1
  12. package/console-app/assets/{chunk-GMAD6QVW-BJ-InAqp.js → chunk-GMAD6QVW-Cpa-YKLB.js} +1 -1
  13. package/console-app/assets/{chunk-GVQU2GXP-DaeerGJS.js → chunk-GVQU2GXP-BWSHPLNL.js} +1 -1
  14. package/console-app/assets/{chunk-IMKFNOWR-eOSAFAc9.js → chunk-IMKFNOWR-yhQzfQuj.js} +1 -1
  15. package/console-app/assets/{chunk-L3NEJ4N5-DRfMBpkp.js → chunk-L3NEJ4N5-C8pAfDlo.js} +1 -1
  16. package/console-app/assets/{chunk-OSK3NFVY-DMZ2WBA1.js → chunk-OSK3NFVY-749yk2fa.js} +1 -1
  17. package/console-app/assets/{chunk-P2QGCYS3-d0BFQiY1.js → chunk-P2QGCYS3-C1Y9GyYT.js} +1 -1
  18. package/console-app/assets/{chunk-POPQ4Y6H-D4zICDtR.js → chunk-POPQ4Y6H-DzI9aRsX.js} +1 -1
  19. package/console-app/assets/{chunk-PWAF6VOD-_v9wUl6m.js → chunk-PWAF6VOD-D3fAPSwz.js} +1 -1
  20. package/console-app/assets/{chunk-SHT3W25Y-DZ3Wa0Mc.js → chunk-SHT3W25Y-D9w7LzM9.js} +1 -1
  21. package/console-app/assets/{chunk-SVP7TREG-2yCR3ywB.js → chunk-SVP7TREG-D55MjOJw.js} +1 -1
  22. package/console-app/assets/{chunk-TICWLB2K-CtulM0X6.js → chunk-TICWLB2K-DV8q7H-z.js} +1 -1
  23. package/console-app/assets/chunk-XXDRQBXY-DBtYQykd.js +1 -0
  24. package/console-app/assets/classDiagram-ZZMXUADV-BnWa-i9n.js +1 -0
  25. package/console-app/assets/classDiagram-v2-VYDZK3BY-BnWa-i9n.js +1 -0
  26. package/console-app/assets/{cose-bilkent-JH36ORCC-DNc5wiJ_.js → cose-bilkent-JH36ORCC-CLedPW9a.js} +1 -1
  27. package/console-app/assets/{cynefin-OW5HDTMX-CQPn9kED.js → cynefin-OW5HDTMX-CS5NKw2p.js} +1 -1
  28. package/console-app/assets/{cynefinDiagram-5FMLGOSQ-CkW1ZG13.js → cynefinDiagram-5FMLGOSQ-DGTHW90E.js} +1 -1
  29. package/console-app/assets/{dagre-BcTdbH8b.js → dagre-BNQdos_2.js} +1 -1
  30. package/console-app/assets/{dagre-GXQ25YYZ-Cgvwy7_U.js → dagre-GXQ25YYZ-DHZ8wtwQ.js} +1 -1
  31. package/console-app/assets/{diagram-S7CK7UJ4-JB3GlMwZ.js → diagram-S7CK7UJ4-C41Begsy.js} +1 -1
  32. package/console-app/assets/{diagram-UQ7AKVKN-CaIeYJXa.js → diagram-UQ7AKVKN-CU8D-sRT.js} +1 -1
  33. package/console-app/assets/{diagram-VSXAHHWV-Cku8J3KG.js → diagram-VSXAHHWV-DTTiXYnQ.js} +1 -1
  34. package/console-app/assets/{diagram-VX7I27RA-Dp3jeYrS.js → diagram-VX7I27RA-BBy91pxm.js} +1 -1
  35. package/console-app/assets/{diagram-Z3DM3KII-B56Ys0Pf.js → diagram-Z3DM3KII-D50xTYe5.js} +1 -1
  36. package/console-app/assets/{ebnfDiagram-PWID7BFC-CfxeEpk1.js → ebnfDiagram-PWID7BFC-BHjnFZgE.js} +1 -1
  37. package/console-app/assets/{erDiagram-RLTQ6QDP-Dp9sOoSf.js → erDiagram-RLTQ6QDP-B4-yVo9b.js} +1 -1
  38. package/console-app/assets/eventmodeling-NTZA5JFV-C_IpFSCw.js +1 -0
  39. package/console-app/assets/flowDiagram-HODETNUW-Q90rgVpx.js +1 -0
  40. package/console-app/assets/{ganttDiagram-EL5Y4UJY-BsD1LYkb.js → ganttDiagram-EL5Y4UJY-D1T-2BlO.js} +1 -1
  41. package/console-app/assets/{gitGraph-4MIJSDKK-CSHhAZoD.js → gitGraph-4MIJSDKK-ClqKTUfQ.js} +1 -1
  42. package/console-app/assets/{gitGraphDiagram-WWUBYQGX-CZ_0OI7F.js → gitGraphDiagram-WWUBYQGX-ruq2MAhM.js} +1 -1
  43. package/console-app/assets/{graphlib-Bpf494dL.js → graphlib-D-vLYPdw.js} +1 -1
  44. package/console-app/assets/{index-DXtR4J7Y.js → index-BIEZPuyK.js} +131 -128
  45. package/console-app/assets/{info-A6RAGUB7-Cym2YsaS.js → info-A6RAGUB7-BGI-8HNB.js} +1 -1
  46. package/console-app/assets/{infoDiagram-27XIBGKW-n9atnl-K.js → infoDiagram-27XIBGKW-BGURgKHv.js} +1 -1
  47. package/console-app/assets/{ishikawaDiagram-5VMMS53U-BeLDkr8-.js → ishikawaDiagram-5VMMS53U-DzgAaPTR.js} +1 -1
  48. package/console-app/assets/{journeyDiagram-3NMN7TZE-B__R_eOL.js → journeyDiagram-3NMN7TZE-BsyWad8z.js} +1 -1
  49. package/console-app/assets/{kanban-definition-UXKFOSKX-Cwsl1hYB.js → kanban-definition-UXKFOSKX-g1nO2rWF.js} +1 -1
  50. package/console-app/assets/{line-UWFHtT2i.js → line-CeFoQ5y-.js} +1 -1
  51. package/console-app/assets/{linear-BHDHoGpb.js → linear-C4Pk-YMX.js} +1 -1
  52. package/console-app/assets/{mermaid-parser.core-CyGW9xht.js → mermaid-parser.core-U7wquvx8.js} +3 -3
  53. package/console-app/assets/{mermaid.core-zeBKxakC.js → mermaid.core-8TRpFRm9.js} +4 -4
  54. package/console-app/assets/{mindmap-definition-YA3MSWOX-bZ2kbbMM.js → mindmap-definition-YA3MSWOX-C7lzwqBX.js} +1 -1
  55. package/console-app/assets/{packet-AYTQ26CC-DtH3ZjsO.js → packet-AYTQ26CC-DiQV_rU3.js} +1 -1
  56. package/console-app/assets/{pegDiagram-XKGWAZYB-Cy-M_2Zc.js → pegDiagram-XKGWAZYB-63ajP7-W.js} +1 -1
  57. package/console-app/assets/{pie-WAS4IAKB-DEZDAaJW.js → pie-WAS4IAKB-B5q_o6dr.js} +1 -1
  58. package/console-app/assets/{pieDiagram-E7YTZNPT-Ce3Yl--P.js → pieDiagram-E7YTZNPT-BTbvj-by.js} +1 -1
  59. package/console-app/assets/{quadrantDiagram-AXDQQJYC-BTK8v4H5.js → quadrantDiagram-AXDQQJYC-CulqsAYd.js} +1 -1
  60. package/console-app/assets/{radar-RG4KPBEZ-CTPhaLOE.js → radar-RG4KPBEZ-CW_KoURS.js} +1 -1
  61. package/console-app/assets/{railroad-74A4TZTK-DMa9G1LV.js → railroad-74A4TZTK-CUmF6uBQ.js} +1 -1
  62. package/console-app/assets/railroad-abnf-HS5TGJTU-CcPw9q8a.js +1 -0
  63. package/console-app/assets/railroad-ebnf-LZEXJU2U-Ci_fZics.js +1 -0
  64. package/console-app/assets/railroad-peg-WCYAUIDC-DTsDykSf.js +1 -0
  65. package/console-app/assets/{railroadDiagram-O6MQD6OU-CYbkYMqD.js → railroadDiagram-O6MQD6OU-WlkBu_N3.js} +1 -1
  66. package/console-app/assets/{requirementDiagram-BXWQKSXE-DjWjfWOk.js → requirementDiagram-BXWQKSXE-CJK_CbPR.js} +1 -1
  67. package/console-app/assets/{sankeyDiagram-P5KCCOFB-6sAcPgDK.js → sankeyDiagram-P5KCCOFB-C466WOH8.js} +1 -1
  68. package/console-app/assets/{sequenceDiagram-WJ2MYXX4-DzyU1CIr.js → sequenceDiagram-WJ2MYXX4-CV0dCcj0.js} +1 -1
  69. package/console-app/assets/{src-0ppm3vZe.js → src-P4Nw8sY0.js} +1 -1
  70. package/console-app/assets/{stateDiagram-D77RDMKH-S5osVh5p.js → stateDiagram-D77RDMKH-HaLGm8V9.js} +1 -1
  71. package/console-app/assets/stateDiagram-v2-MP3YSRHH--GM14Hz5.js +1 -0
  72. package/console-app/assets/{swimlanes-42K2YHIH-Dd7HjelH.js → swimlanes-42K2YHIH-Bi-O5vWa.js} +1 -1
  73. package/console-app/assets/swimlanesDiagram-VR7AAH4N-_6rRi6Wt.js +8 -0
  74. package/console-app/assets/{timeline-definition-24CTP7MA-eZ3AIIpc.js → timeline-definition-24CTP7MA-B4h-gx-i.js} +1 -1
  75. package/console-app/assets/{treeView-Q6P3EWNA-DF5sOT6y.js → treeView-Q6P3EWNA-CXJ_pHQw.js} +1 -1
  76. package/console-app/assets/{treemap-WGGIJYW6-Bob0iUUb.js → treemap-WGGIJYW6-M84p2a_3.js} +1 -1
  77. package/console-app/assets/{vennDiagram-4TSXK5OY-CeowTqyG.js → vennDiagram-4TSXK5OY-BesF4k_r.js} +1 -1
  78. package/console-app/assets/{wardley-WFR3VGLG-DrnQFkZZ.js → wardley-WFR3VGLG-n9ulickP.js} +1 -1
  79. package/console-app/assets/{wardleyDiagram-VM6X3IG4-Dsfkp6D5.js → wardleyDiagram-VM6X3IG4-BG0nnWDf.js} +1 -1
  80. package/console-app/assets/{xychartDiagram-S5SC5T6Z-YC_qsmJw.js → xychartDiagram-S5SC5T6Z-BtOW7fpF.js} +1 -1
  81. package/console-app/index.html +1 -1
  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 +1 -1
  89. package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
  90. package/dist/.pikku/analytics/index.d.ts +1 -1
  91. package/dist/.pikku/analytics/index.js +1 -1
  92. package/dist/.pikku/analytics/pikku-analytics-types.gen.d.ts +1 -1
  93. package/dist/.pikku/analytics/pikku-analytics-types.gen.js +1 -1
  94. package/dist/.pikku/auth/index.d.ts +1 -1
  95. package/dist/.pikku/auth/index.js +1 -1
  96. package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +1 -1
  97. package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
  98. package/dist/.pikku/channel/index.d.ts +1 -1
  99. package/dist/.pikku/channel/index.js +1 -1
  100. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  101. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  102. package/dist/.pikku/cli/index.d.ts +1 -1
  103. package/dist/.pikku/cli/index.js +1 -1
  104. package/dist/.pikku/cli/pikku-cli-channel.js +1 -1
  105. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  106. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  107. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  108. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  109. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.json +11 -1
  110. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  111. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  112. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  113. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +30 -3
  114. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  115. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  116. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  117. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  118. package/dist/.pikku/error/index.d.ts +1 -1
  119. package/dist/.pikku/error/index.js +1 -1
  120. package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
  121. package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
  122. package/dist/.pikku/function/index.d.ts +1 -1
  123. package/dist/.pikku/function/index.js +1 -1
  124. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  125. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  126. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  127. package/dist/.pikku/function/pikku-functions-meta.gen.json +23 -23
  128. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  129. package/dist/.pikku/gateway/index.d.ts +1 -1
  130. package/dist/.pikku/gateway/index.js +1 -1
  131. package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
  132. package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
  133. package/dist/.pikku/http/index.d.ts +1 -1
  134. package/dist/.pikku/http/index.js +1 -1
  135. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  136. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  137. package/dist/.pikku/mcp/index.d.ts +1 -1
  138. package/dist/.pikku/mcp/index.js +1 -1
  139. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  140. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  141. package/dist/.pikku/middleware/index.d.ts +1 -1
  142. package/dist/.pikku/middleware/index.js +1 -1
  143. package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +1 -1
  144. package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
  145. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  146. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
  147. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  148. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  149. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  150. package/dist/.pikku/queue/index.d.ts +1 -1
  151. package/dist/.pikku/queue/index.js +1 -1
  152. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  153. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  154. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  155. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  156. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  157. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  158. package/dist/.pikku/scenarios/index.d.ts +1 -1
  159. package/dist/.pikku/scenarios/index.js +1 -1
  160. package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
  161. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  162. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  163. package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
  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 +1 -1
  171. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  172. package/dist/.pikku/schemas/register.gen.js +1 -1
  173. package/dist/.pikku/schemas/schemas/FabricChangesAskInput.schema.json +1 -1
  174. package/dist/.pikku/schemas/schemas/FabricInitInput.schema.json +1 -1
  175. package/dist/.pikku/schemas/schemas/FabricLinkInput.schema.json +1 -1
  176. package/dist/.pikku/schemas/schemas/KnowledgeReconcileInput.schema.json +1 -1
  177. package/dist/.pikku/schemas/schemas/KnowledgeReconcileOutput.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-flags.gen.d.ts +1 -1
  182. package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
  183. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
  184. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
  185. package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
  186. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  187. package/dist/.pikku/secrets/index.d.ts +1 -1
  188. package/dist/.pikku/secrets/index.js +1 -1
  189. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  190. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  191. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  192. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  193. package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
  194. package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
  195. package/dist/.pikku/setup/index.d.ts +1 -1
  196. package/dist/.pikku/setup/index.js +1 -1
  197. package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
  198. package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
  199. package/dist/.pikku/trigger/index.d.ts +1 -1
  200. package/dist/.pikku/trigger/index.js +1 -1
  201. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  202. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  203. package/dist/.pikku/variables/index.d.ts +1 -1
  204. package/dist/.pikku/variables/index.js +1 -1
  205. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  206. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  207. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  208. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  209. package/dist/.pikku/workflow/index.d.ts +1 -1
  210. package/dist/.pikku/workflow/index.js +1 -1
  211. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  212. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  213. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  214. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  215. package/dist/bin/pikku-bin.mjs +3 -3
  216. package/dist/src/cli.wiring.js +19 -1
  217. package/dist/src/deploy/analyzer/analyzer.js +93 -4
  218. package/dist/src/deploy/codegen/per-unit-codegen.js +24 -0
  219. package/dist/src/fabric/fabric-commands.d.ts +9 -0
  220. package/dist/src/fabric/fabric-commands.js +11 -1
  221. package/dist/src/fabric/functions/changes-ask.function.d.ts +4 -0
  222. package/dist/src/fabric/functions/changes-ask.function.js +7 -1
  223. package/dist/src/fabric/functions/init.function.d.ts +4 -0
  224. package/dist/src/fabric/functions/init.function.js +5 -1
  225. package/dist/src/fabric/functions/link.function.d.ts +4 -0
  226. package/dist/src/fabric/functions/link.function.js +9 -1
  227. package/dist/src/fabric/lib/organization.d.ts +8 -0
  228. package/dist/src/fabric/lib/organization.js +26 -0
  229. package/dist/src/functions/commands/audit.js +4 -2
  230. package/dist/src/functions/commands/deploy-apply.js +128 -13
  231. package/dist/src/functions/commands/dev-mcp-manifests.d.ts +27 -0
  232. package/dist/src/functions/commands/dev-mcp-manifests.js +52 -0
  233. package/dist/src/functions/commands/dev.js +10 -30
  234. package/dist/src/functions/commands/knowledge-reconcile.d.ts +15 -3
  235. package/dist/src/functions/commands/knowledge-reconcile.js +1 -1
  236. package/dist/src/functions/commands/scenario.js +1 -1
  237. package/dist/src/functions/commands/skill-agents.d.ts +43 -0
  238. package/dist/src/functions/commands/skill-agents.js +135 -0
  239. package/dist/src/functions/commands/skills.d.ts +9 -0
  240. package/dist/src/functions/commands/skills.js +29 -2
  241. package/dist/src/functions/db/postgres/postgres-introspector.d.ts +6 -0
  242. package/dist/src/functions/db/postgres/postgres-introspector.js +7 -1
  243. package/dist/src/functions/knowledge/render.d.ts +1 -1
  244. package/dist/src/functions/knowledge/render.js +25 -2
  245. package/dist/src/functions/knowledge/schemas.d.ts +5 -1
  246. package/dist/src/functions/wirings/credentials/pikku-command-credentials.js +26 -2
  247. package/dist/src/functions/wirings/credentials/serialize-credentials-types.d.ts +6 -2
  248. package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +9 -3
  249. package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.js +32 -5
  250. package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +4 -1
  251. package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +9 -4
  252. package/dist/src/functions/workflows/all.workflow.js +8 -0
  253. package/dist/src/server/bun-server-runner.js +1 -0
  254. package/dist/src/server/dev-server-runner.interface.d.ts +13 -0
  255. package/dist/src/server/node-server-runner.js +1 -0
  256. package/dist/src/services.js +1 -0
  257. package/dist/src/utils/mcp-surface.d.ts +8 -0
  258. package/dist/src/utils/mcp-surface.js +9 -0
  259. package/dist/tsconfig.tsbuildinfo +1 -1
  260. package/package.json +13 -13
  261. package/surface.json +25 -17
  262. package/console-app/assets/architecture-7GRP2DOG-DJkDVzM_.js +0 -1
  263. package/console-app/assets/channel-C6yZyX_m.js +0 -1
  264. package/console-app/assets/chunk-XXDRQBXY-CLsn_tEh.js +0 -1
  265. package/console-app/assets/classDiagram-ZZMXUADV-D7FKceOo.js +0 -1
  266. package/console-app/assets/classDiagram-v2-VYDZK3BY-D7FKceOo.js +0 -1
  267. package/console-app/assets/eventmodeling-NTZA5JFV-CccBkMWb.js +0 -1
  268. package/console-app/assets/flowDiagram-HODETNUW-Cp_XHTFC.js +0 -1
  269. package/console-app/assets/railroad-abnf-HS5TGJTU-K0DgRobv.js +0 -1
  270. package/console-app/assets/railroad-ebnf-LZEXJU2U-CHEGHd9y.js +0 -1
  271. package/console-app/assets/railroad-peg-WCYAUIDC-EYHvZbXp.js +0 -1
  272. package/console-app/assets/stateDiagram-v2-MP3YSRHH-BZUe_KiH.js +0 -1
  273. package/console-app/assets/swimlanesDiagram-VR7AAH4N-D6xRypPY.js +0 -8
@@ -134,6 +134,7 @@ export declare const fabricCommands: {
134
134
  branch?: string | undefined;
135
135
  force?: boolean | undefined;
136
136
  apiUrl?: string | undefined;
137
+ organization?: string | undefined;
137
138
  }, {
138
139
  projectId: string;
139
140
  projectSlug: string;
@@ -144,6 +145,7 @@ export declare const fabricCommands: {
144
145
  branch?: string | undefined;
145
146
  force?: boolean | undefined;
146
147
  apiUrl?: string | undefined;
148
+ organization?: string | undefined;
147
149
  }, {
148
150
  projectId: string;
149
151
  projectSlug: string;
@@ -154,6 +156,7 @@ export declare const fabricCommands: {
154
156
  branch?: string | undefined;
155
157
  force?: boolean | undefined;
156
158
  apiUrl?: string | undefined;
159
+ organization?: string | undefined;
157
160
  }, {
158
161
  projectId: string;
159
162
  projectSlug: string;
@@ -164,6 +167,7 @@ export declare const fabricCommands: {
164
167
  github?: boolean | undefined;
165
168
  gitea?: boolean | undefined;
166
169
  repoName?: string | undefined;
170
+ organization?: string | undefined;
167
171
  }, {
168
172
  projectId: string;
169
173
  projectSlug: string;
@@ -174,6 +178,7 @@ export declare const fabricCommands: {
174
178
  github?: boolean | undefined;
175
179
  gitea?: boolean | undefined;
176
180
  repoName?: string | undefined;
181
+ organization?: string | undefined;
177
182
  }, {
178
183
  projectId: string;
179
184
  projectSlug: string;
@@ -184,6 +189,7 @@ export declare const fabricCommands: {
184
189
  github?: boolean | undefined;
185
190
  gitea?: boolean | undefined;
186
191
  repoName?: string | undefined;
192
+ organization?: string | undefined;
187
193
  }, {
188
194
  projectId: string;
189
195
  projectSlug: string;
@@ -1205,6 +1211,7 @@ export declare const fabricCommands: {
1205
1211
  apiUrl?: string | undefined;
1206
1212
  changeId: string;
1207
1213
  question: string;
1214
+ option?: string[] | undefined;
1208
1215
  authorName?: string | undefined;
1209
1216
  }, {
1210
1217
  message: any;
@@ -1212,6 +1219,7 @@ export declare const fabricCommands: {
1212
1219
  apiUrl?: string | undefined;
1213
1220
  changeId: string;
1214
1221
  question: string;
1222
+ option?: string[] | undefined;
1215
1223
  authorName?: string | undefined;
1216
1224
  }, {
1217
1225
  message: any;
@@ -1219,6 +1227,7 @@ export declare const fabricCommands: {
1219
1227
  apiUrl?: string | undefined;
1220
1228
  changeId: string;
1221
1229
  question: string;
1230
+ option?: string[] | undefined;
1222
1231
  authorName?: string | undefined;
1223
1232
  }, {
1224
1233
  message: any;
@@ -116,6 +116,9 @@ export const fabricCommands = defineCLICommands({
116
116
  description: 'Override the project display name (defaults to repo name)',
117
117
  },
118
118
  branch: { description: 'Default branch (defaults to main)' },
119
+ organization: {
120
+ description: 'Organization to import into — slug, name or id (defaults to the one your session is in)',
121
+ },
119
122
  force: {
120
123
  description: 'Replace existing fabric.config.json',
121
124
  default: false,
@@ -138,6 +141,9 @@ export const fabricCommands = defineCLICommands({
138
141
  repoName: {
139
142
  description: 'Name for a repo created by --gitea (defaults to the directory name)',
140
143
  },
144
+ organization: {
145
+ description: 'Organization to import into — slug, name or id (defaults to the one your session is in)',
146
+ },
141
147
  apiUrl: {
142
148
  description: 'Override the fabric-api URL stored in fabric.config.json',
143
149
  },
@@ -591,9 +597,13 @@ export const fabricCommands = defineCLICommands({
591
597
  options: {
592
598
  changeId: { description: 'The item the question is about' },
593
599
  question: {
594
- description: 'One decision, in the filer’s vocabulary, with the options named',
600
+ description: 'One decision, in the filer’s vocabulary. Name the choices with --option, not as “(a) … (b) …” inside this text',
595
601
  short: 'q',
596
602
  },
603
+ option: {
604
+ description: 'A choice the filer can click, repeatable — e.g. --option "Reprice them" --option "Leave them". Without these they have to type an answer',
605
+ type: 'string[]',
606
+ },
597
607
  authorName: { description: 'Who is asking, e.g. claude-code' },
598
608
  apiUrl: { description: 'Override the fabric-api URL for this call' },
599
609
  },
@@ -4,6 +4,7 @@ export declare const FabricChangesAskInput: z.ZodObject<{
4
4
  apiUrl: z.ZodOptional<z.ZodString>;
5
5
  changeId: z.ZodString;
6
6
  question: z.ZodString;
7
+ option: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
8
  authorName: z.ZodOptional<z.ZodString>;
8
9
  }, z.core.$strip>;
9
10
  export declare const FabricChangesAskOutput: z.ZodObject<{
@@ -13,6 +14,7 @@ export declare const FabricChangesAsk: import("../../../.pikku/function/pikku-fu
13
14
  apiUrl?: string | undefined;
14
15
  changeId: string;
15
16
  question: string;
17
+ option?: string[] | undefined;
16
18
  authorName?: string | undefined;
17
19
  }, {
18
20
  message: any;
@@ -20,6 +22,7 @@ export declare const FabricChangesAsk: import("../../../.pikku/function/pikku-fu
20
22
  apiUrl?: string | undefined;
21
23
  changeId: string;
22
24
  question: string;
25
+ option?: string[] | undefined;
23
26
  authorName?: string | undefined;
24
27
  }, {
25
28
  message: any;
@@ -27,6 +30,7 @@ export declare const FabricChangesAsk: import("../../../.pikku/function/pikku-fu
27
30
  apiUrl?: string | undefined;
28
31
  changeId: string;
29
32
  question: string;
33
+ option?: string[] | undefined;
30
34
  authorName?: string | undefined;
31
35
  }, {
32
36
  message: any;
@@ -1,11 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
3
3
  import { changesContext } from '../lib/changes.js';
4
- import { dim, safeBlock } from '../lib/output.js';
4
+ import { dim, safe, safeBlock } from '../lib/output.js';
5
5
  export const FabricChangesAskInput = z.object({
6
6
  apiUrl: z.string().optional(),
7
7
  changeId: z.string(),
8
8
  question: z.string().trim().min(1, 'Ask something — the question is empty.'),
9
+ option: z.array(z.string().trim().min(1)).max(6).optional(),
9
10
  authorName: z.string().optional(),
10
11
  });
11
12
  export const FabricChangesAskOutput = z.object({
@@ -21,10 +22,15 @@ export const FabricChangesAsk = pikkuSessionlessFunc({
21
22
  changeId: input.changeId,
22
23
  question: input.question,
23
24
  authorName: input.authorName ?? 'pikku-cli',
25
+ ...(input.option?.length ? { option: input.option } : {}),
24
26
  });
25
27
  },
26
28
  });
27
29
  export const renderChangesAsk = (_s, { message }) => {
30
+ const options = (message.attachments ?? []).filter((attachment) => attachment.kind === 'option');
28
31
  console.log('Asked — the item now shows as needing an answer in the panel.');
29
32
  console.log(dim(` ${safeBlock(message.body)}`));
33
+ if (options.length) {
34
+ console.log(dim(` they can click: ${options.map(({ label }) => safe(label)).join(' · ')}`));
35
+ }
30
36
  };
@@ -5,6 +5,7 @@ export declare const FabricInitInput: z.ZodObject<{
5
5
  branch: z.ZodOptional<z.ZodString>;
6
6
  force: z.ZodOptional<z.ZodBoolean>;
7
7
  apiUrl: z.ZodOptional<z.ZodString>;
8
+ organization: z.ZodOptional<z.ZodString>;
8
9
  }, z.core.$strip>;
9
10
  export declare const FabricInitOutput: z.ZodObject<{
10
11
  projectId: z.ZodString;
@@ -24,6 +25,7 @@ export declare const FabricInit: import("../../../.pikku/function/pikku-function
24
25
  branch?: string | undefined;
25
26
  force?: boolean | undefined;
26
27
  apiUrl?: string | undefined;
28
+ organization?: string | undefined;
27
29
  }, {
28
30
  projectId: string;
29
31
  projectSlug: string;
@@ -34,6 +36,7 @@ export declare const FabricInit: import("../../../.pikku/function/pikku-function
34
36
  branch?: string | undefined;
35
37
  force?: boolean | undefined;
36
38
  apiUrl?: string | undefined;
39
+ organization?: string | undefined;
37
40
  }, {
38
41
  projectId: string;
39
42
  projectSlug: string;
@@ -44,6 +47,7 @@ export declare const FabricInit: import("../../../.pikku/function/pikku-function
44
47
  branch?: string | undefined;
45
48
  force?: boolean | undefined;
46
49
  apiUrl?: string | undefined;
50
+ organization?: string | undefined;
47
51
  }, {
48
52
  projectId: string;
49
53
  projectSlug: string;
@@ -3,12 +3,14 @@ import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
3
3
  import { findProjectConfig, isLinkedProjectId, resolveApiContext, writeProjectConfig, } from '../lib/config.js';
4
4
  import { getFabricRPC } from '../lib/http.js';
5
5
  import { FabricPreconditionError } from '../lib/errors.js';
6
+ import { resolveOrganizationId } from '../lib/organization.js';
6
7
  export const FabricInitInput = z.object({
7
8
  repo: z.string(),
8
9
  name: z.string().optional(),
9
10
  branch: z.string().optional(),
10
11
  force: z.boolean().optional(),
11
12
  apiUrl: z.string().optional(),
13
+ organization: z.string().optional(),
12
14
  });
13
15
  export const FabricInitOutput = z.object({
14
16
  projectId: z.string(),
@@ -26,7 +28,7 @@ export const FabricInit = pikkuSessionlessFunc({
26
28
  description: 'Adopt an existing repo as a fabric project (writes fabric.config.json).',
27
29
  input: FabricInitInput,
28
30
  output: FabricInitOutput,
29
- func: async (_services, { repo, name, branch, force, apiUrl: apiUrlOverride }) => {
31
+ func: async (_services, { repo, name, branch, force, apiUrl: apiUrlOverride, organization }) => {
30
32
  const ctx = await resolveApiContext({ apiUrlOverride });
31
33
  if (!ctx.token)
32
34
  throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
@@ -35,11 +37,13 @@ export const FabricInit = pikkuSessionlessFunc({
35
37
  throw new FabricPreconditionError(`Already linked: ${existing.config.projectId} at ${existing.path}. Pass --force to replace.`);
36
38
  }
37
39
  const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
40
+ const organizationId = await resolveOrganizationId(rpc, organization);
38
41
  const result = await rpc.invoke('importProject', {
39
42
  repoUrl: repo,
40
43
  name,
41
44
  defaultBranch: branch,
42
45
  productionBranch: 'main',
46
+ ...(organizationId ? { organizationId } : {}),
43
47
  });
44
48
  const path = await writeProjectConfig(process.cwd(), {
45
49
  projectId: result.projectId,
@@ -4,6 +4,7 @@ export declare const FabricLinkInput: z.ZodObject<{
4
4
  github: z.ZodOptional<z.ZodBoolean>;
5
5
  gitea: z.ZodOptional<z.ZodBoolean>;
6
6
  repoName: z.ZodOptional<z.ZodString>;
7
+ organization: z.ZodOptional<z.ZodString>;
7
8
  }, z.core.$strip>;
8
9
  export declare const FabricLinkOutput: z.ZodObject<{
9
10
  projectId: z.ZodString;
@@ -16,6 +17,7 @@ export declare const FabricLink: import("../../../.pikku/function/pikku-function
16
17
  github?: boolean | undefined;
17
18
  gitea?: boolean | undefined;
18
19
  repoName?: string | undefined;
20
+ organization?: string | undefined;
19
21
  }, {
20
22
  projectId: string;
21
23
  projectSlug: string;
@@ -26,6 +28,7 @@ export declare const FabricLink: import("../../../.pikku/function/pikku-function
26
28
  github?: boolean | undefined;
27
29
  gitea?: boolean | undefined;
28
30
  repoName?: string | undefined;
31
+ organization?: string | undefined;
29
32
  }, {
30
33
  projectId: string;
31
34
  projectSlug: string;
@@ -36,6 +39,7 @@ export declare const FabricLink: import("../../../.pikku/function/pikku-function
36
39
  github?: boolean | undefined;
37
40
  gitea?: boolean | undefined;
38
41
  repoName?: string | undefined;
42
+ organization?: string | undefined;
39
43
  }, {
40
44
  projectId: string;
41
45
  projectSlug: string;
@@ -5,6 +5,7 @@ import { resolveApiContext, writeProjectConfig } from '../lib/config.js';
5
5
  import { getFabricRPC } from '../lib/http.js';
6
6
  import { addRemote, assertDeploySafety, currentBranch, getRemoteUrl, hasCommits, hasRemote, isWorkingTreeClean, pushWithCredential, removeRemote, } from '../lib/git.js';
7
7
  import { FabricPreconditionError } from '../lib/errors.js';
8
+ import { resolveOrganizationId } from '../lib/organization.js';
8
9
  import { promptConfirm } from '../lib/prompt.js';
9
10
  export const FabricLinkInput = z.object({
10
11
  apiUrl: z.string().optional(),
@@ -14,6 +15,8 @@ export const FabricLinkInput = z.object({
14
15
  gitea: z.boolean().optional(),
15
16
  /** Name for a repo created here. Defaults to the directory name. */
16
17
  repoName: z.string().optional(),
18
+ /** Slug, name or id of the organization to import into. Defaults to the session's. */
19
+ organization: z.string().optional(),
17
20
  });
18
21
  export const FabricLinkOutput = z.object({
19
22
  projectId: z.string(),
@@ -29,7 +32,7 @@ export const FabricLink = pikkuSessionlessFunc({
29
32
  description: 'Register the current git repo as a fabric project and queue an initial deploy.',
30
33
  input: FabricLinkInput,
31
34
  output: FabricLinkOutput,
32
- func: async (_services, { apiUrl: apiUrlOverride, github, gitea, repoName }) => {
35
+ func: async (_services, { apiUrl: apiUrlOverride, github, gitea, repoName, organization }) => {
33
36
  const ctx = await resolveApiContext({ apiUrlOverride });
34
37
  if (!ctx.token) {
35
38
  throw new FabricPreconditionError('Not logged in. Run `pikku fabric login` first.');
@@ -48,6 +51,10 @@ export const FabricLink = pikkuSessionlessFunc({
48
51
  if (!(await isWorkingTreeClean())) {
49
52
  throw new FabricPreconditionError('Deployment blocked: uncommitted changes detected.\nCommit and push your changes before deploying.');
50
53
  }
54
+ // Resolved here for the same reason, since `--gitea` reaches `createRemote`
55
+ // below: a misspelt organization must not cost the user a repository they
56
+ // then have to go and delete.
57
+ const organizationId = await resolveOrganizationId(rpc, organization);
51
58
  const remoteUrl = (await hasRemote())
52
59
  ? await adoptExistingRemote({ github, gitea })
53
60
  : await createRemote({ rpc, github, gitea, repoName });
@@ -85,6 +92,7 @@ export const FabricLink = pikkuSessionlessFunc({
85
92
  const project = await rpc.invoke('importProject', {
86
93
  repoUrl: remoteUrl,
87
94
  productionBranch: 'main',
95
+ ...(organizationId ? { organizationId } : {}),
88
96
  });
89
97
  await writeProjectConfig(process.cwd(), {
90
98
  projectId: project.projectId,
@@ -0,0 +1,8 @@
1
+ import type { getFabricRPC } from './http.js';
2
+ /**
3
+ * Turn `--organization` into an id. Fabric derives the owning org from the
4
+ * session when the flag is absent, which silently imports into whichever org
5
+ * the token happens to be scoped to — the flag is how a repo belonging to a
6
+ * different org gets linked without re-logging-in.
7
+ */
8
+ export declare function resolveOrganizationId(rpc: ReturnType<typeof getFabricRPC>, organization: string | undefined): Promise<string | undefined>;
@@ -0,0 +1,26 @@
1
+ import { FabricPreconditionError } from './errors.js';
2
+ const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
3
+ /**
4
+ * Turn `--organization` into an id. Fabric derives the owning org from the
5
+ * session when the flag is absent, which silently imports into whichever org
6
+ * the token happens to be scoped to — the flag is how a repo belonging to a
7
+ * different org gets linked without re-logging-in.
8
+ */
9
+ export async function resolveOrganizationId(rpc, organization) {
10
+ if (!organization)
11
+ return undefined;
12
+ if (UUID.test(organization))
13
+ return organization;
14
+ const { organizations } = await rpc.invoke('listMyOrganizations', {});
15
+ const wanted = organization.toLowerCase();
16
+ const matches = organizations.filter((org) => org.slug.toLowerCase() === wanted || org.name.toLowerCase() === wanted);
17
+ if (matches.length === 0) {
18
+ const known = organizations.map((org) => org.slug).join(', ');
19
+ throw new FabricPreconditionError(`No organization named "${organization}".\nYou belong to: ${known || '(none)'}`);
20
+ }
21
+ if (matches.length > 1) {
22
+ const ids = matches.map((org) => org.organizationId).join(', ');
23
+ throw new FabricPreconditionError(`"${organization}" matches more than one organization. Pass the id instead: ${ids}`);
24
+ }
25
+ return matches[0].organizationId;
26
+ }
@@ -118,6 +118,8 @@ export function semverLevel(current, latest) {
118
118
  return 'unknown';
119
119
  }
120
120
  // bun outdated has no --json; it prints a table: | Package | Current | Update | Latest |
121
+ // Under `--filter` it appends a fifth Workspace column, so both widths are read.
122
+ // Latest sits at index 3 either way.
121
123
  export function parseBunOutdated(raw) {
122
124
  const updates = [];
123
125
  const seen = new Set();
@@ -128,7 +130,7 @@ export function parseBunOutdated(raw) {
128
130
  .split('|')
129
131
  .map((c) => c.trim())
130
132
  .filter((c) => c.length > 0);
131
- if (cells.length !== 4)
133
+ if (cells.length !== 4 && cells.length !== 5)
132
134
  continue;
133
135
  const [cell, current, , latest] = cells;
134
136
  if (cell === 'Package' || /^-+$/.test(cell))
@@ -183,7 +185,7 @@ export const pikkuAudit = pikkuSessionlessFunc({
183
185
  try {
184
186
  const issues = parseBunAudit(runBun(['audit', '--json'], root));
185
187
  const updates = includeOutdated
186
- ? parseBunOutdated(runBun(['outdated'], root))
188
+ ? parseBunOutdated(runBun(['outdated', '--filter', '*'], root))
187
189
  : [];
188
190
  const latestByPkg = new Map(updates.map((u) => [u.package, u.latest]));
189
191
  for (const i of issues)
@@ -5,17 +5,18 @@ import { readFile } from 'node:fs/promises';
5
5
  import { existsSync, readFileSync } from 'node:fs';
6
6
  import { pikkuSessionlessFunc } from '#pikku/function';
7
7
  import { runBuildPipeline, describeBuildFailure, PikkuDeployBuildFailedError, } from '../../deploy/build-pipeline.js';
8
+ // A bundler reads anything not starting with `./` or `../` as a bare package
9
+ // specifier, and a path into a dot-directory (`.pikku/...`) starts with a dot
10
+ // without being relative — so testing for `.` alone silently emits an import
11
+ // no bundler can resolve.
8
12
  function toRelativeImport(fromDir, toFile) {
9
13
  let rel = relative(fromDir, toFile).replace(/\\/g, '/');
10
- if (!rel.startsWith('.'))
14
+ if (!rel.startsWith('./') && !rel.startsWith('../'))
11
15
  rel = `./${rel}`;
12
16
  return rel.replace(/\.ts$/, '.js');
13
17
  }
14
18
  export function getEntryContext(unitDir, pikkuDir, unit, inspectorState) {
15
- const bootstrapRelative = relative(unitDir, join(pikkuDir, 'pikku-bootstrap.gen.js'));
16
- const bootstrapPath = bootstrapRelative.startsWith('./') || bootstrapRelative.startsWith('../')
17
- ? bootstrapRelative
18
- : `./${bootstrapRelative}`;
19
+ const bootstrapPath = toRelativeImport(unitDir, join(pikkuDir, 'pikku-bootstrap.gen.js'));
19
20
  const { pikkuConfigFactory, singletonServicesFactory, singletonServicesType, } = inspectorState.filesAndMethods;
20
21
  if (!pikkuConfigFactory || !singletonServicesFactory) {
21
22
  throw new Error('Cannot generate deploy entries: createConfig and createSingletonServices must be defined in your project');
@@ -28,14 +29,22 @@ export function getEntryContext(unitDir, pikkuDir, unit, inspectorState) {
28
29
  const servicesType = singletonServicesType
29
30
  ? `Partial<${singletonServicesType.type}>`
30
31
  : 'Record<string, unknown>';
31
- // MCP: when the unit's .pikku has a non-empty mcp.gen.json, import it and pass
32
- // it to the generated server so PikkuNodeHTTPServer mounts /mcp. Without this
33
- // the deployed bundle never serves MCP even though the dev server does.
32
+ // MCP: when the unit's surface manifest is non-empty, import it and pass it
33
+ // to the generated server so it mounts the surface. Without this the deployed
34
+ // bundle never serves MCP even though the dev server does.
35
+ //
36
+ // An `mcp` unit serves exactly the one surface it was emitted for — its name
37
+ // carries that surface's slug, which is also the manifest's filename. Any
38
+ // other unit (a monolith, say) serves the default surface, as before.
34
39
  let mcpImport = '';
35
40
  let mcpServerOption = '';
36
- const mcpJsonAbs = join(pikkuDir, 'mcp', 'mcp.gen.json');
41
+ const mcpSlug = unit.role === 'mcp' && unit.name !== 'mcp-server'
42
+ ? unit.name.replace(/^mcp-/, '')
43
+ : undefined;
44
+ const mcpJsonAbs = join(pikkuDir, 'mcp', mcpSlug ? `mcp.${mcpSlug}.gen.json` : 'mcp.gen.json');
37
45
  if (existsSync(mcpJsonAbs)) {
38
46
  let hasMcp = false;
47
+ let mcpPath = '/mcp';
39
48
  try {
40
49
  const parsed = JSON.parse(readFileSync(mcpJsonAbs, 'utf-8'));
41
50
  hasMcp =
@@ -43,15 +52,18 @@ export function getEntryContext(unitDir, pikkuDir, unit, inspectorState) {
43
52
  (parsed.resources?.length ?? 0) +
44
53
  (parsed.prompts?.length ?? 0) >
45
54
  0;
55
+ mcpPath = parsed.mcpPath ?? mcpPath;
46
56
  }
47
57
  catch (err) {
48
58
  console.warn(`[pikku] could not parse ${mcpJsonAbs} — skipping MCP mount: ${err instanceof Error ? err.message : String(err)}`);
49
59
  }
50
60
  if (hasMcp) {
51
- const rel = relative(unitDir, mcpJsonAbs).replace(/\\/g, '/');
52
- const relImport = rel.startsWith('.') ? rel : `./${rel}`;
61
+ const relImport = toRelativeImport(unitDir, mcpJsonAbs);
53
62
  mcpImport = `import mcpJson from '${relImport}' with { type: 'json' }`;
54
- mcpServerOption = 'mcpJson, ';
63
+ mcpServerOption =
64
+ mcpPath === '/mcp'
65
+ ? 'mcpJson, '
66
+ : `mcpJson, mcpPath: ${JSON.stringify(mcpPath)}, `;
55
67
  }
56
68
  }
57
69
  return {
@@ -103,7 +115,105 @@ async function resolveProjectId(projectDir) {
103
115
  * configured provider may also be a URL, and a runtime whose `require.resolve`
104
116
  * hands a bare specifier straight back for its own built-ins has resolved
105
117
  * nothing. Both of those import as written.
118
+ *
119
+ * `require.resolve` applies the `require` condition, so an ESM-only provider —
120
+ * one whose exports map offers `types` and `import` and nothing else, which is
121
+ * a perfectly ordinary way to publish — does not resolve there even though it
122
+ * is installed and importable. Falling through to the bare import does not
123
+ * rescue it, because that resolves from the CLI rather than the project, so
124
+ * `resolveEsmOnlyEntry` reads the package's own entry instead. It has to walk
125
+ * the resolution paths by hand: the exports map that blocked the package also
126
+ * blocks `<name>/package.json`.
127
+ *
128
+ * Which is why it runs on any resolution failure rather than on one code. Node
129
+ * reports this as ERR_PACKAGE_PATH_NOT_EXPORTED and bun as a plain
130
+ * MODULE_NOT_FOUND, indistinguishable from a package that is genuinely absent.
131
+ * Telling them apart is what the filesystem is for: a package that is not there
132
+ * yields no entry and the bare import still runs, unchanged.
133
+ */
134
+ /**
135
+ * The conditions that are true for the `import()` this resolution ends in.
136
+ * `default` matches unconditionally and is handled by the resolver rather than
137
+ * listed here, because node treats it as the fallthrough rather than as a name.
138
+ */
139
+ const ACTIVE_EXPORT_CONDITIONS = new Set(['node', 'import']);
140
+ /**
141
+ * Picks an export target the way node does: a conditions object is walked in
142
+ * DECLARATION order and the first key that is active wins, nesting included.
143
+ *
144
+ * The order is the package author's, not ours. `{ "import": { "node": "./n.js",
145
+ * "default": "./browser.js" } }` resolves to `./n.js`, because `node` is listed
146
+ * first and is true here — preferring a fixed list of condition names instead
147
+ * would hand back the browser build and load a different provider than the one
148
+ * node would have.
149
+ *
150
+ * An array is a list of fallbacks, and `null` is a deliberate block, so both
151
+ * carry on to the next candidate rather than ending the walk.
106
152
  */
153
+ const resolveExportTarget = (target) => {
154
+ if (typeof target === 'string')
155
+ return target;
156
+ if (target === null || target === undefined)
157
+ return undefined;
158
+ if (Array.isArray(target)) {
159
+ for (const candidate of target) {
160
+ const resolved = resolveExportTarget(candidate);
161
+ if (resolved !== undefined)
162
+ return resolved;
163
+ }
164
+ return undefined;
165
+ }
166
+ if (typeof target !== 'object')
167
+ return undefined;
168
+ for (const [condition, value] of Object.entries(target)) {
169
+ if (condition !== 'default' && !ACTIVE_EXPORT_CONDITIONS.has(condition)) {
170
+ continue;
171
+ }
172
+ const resolved = resolveExportTarget(value);
173
+ if (resolved !== undefined)
174
+ return resolved;
175
+ }
176
+ return undefined;
177
+ };
178
+ /**
179
+ * The entry an exports map offers to `import`, or, for a package with no
180
+ * exports map at all, its legacy main. A map that deliberately omits a root
181
+ * entry offers nothing: falling back to `main` there would reach past the
182
+ * encapsulation the package asked for, so this reports no entry and the caller
183
+ * treats the provider as missing.
184
+ */
185
+ const esmEntryFromManifest = (manifest) => {
186
+ const exportsField = manifest.exports;
187
+ if (exportsField === undefined || exportsField === null) {
188
+ const legacy = manifest.module ?? manifest.main;
189
+ return typeof legacy === 'string' ? legacy : undefined;
190
+ }
191
+ const isSubpathMap = typeof exportsField === 'object' &&
192
+ !Array.isArray(exportsField) &&
193
+ Object.keys(exportsField).some((key) => key.startsWith('.'));
194
+ const root = isSubpathMap ? exportsField['.'] : exportsField;
195
+ return resolveExportTarget(root);
196
+ };
197
+ const resolveEsmOnlyEntry = (require, packageName) => {
198
+ const searchPaths = require.resolve.paths(packageName) ?? [];
199
+ for (const searchPath of searchPaths) {
200
+ const packageJsonPath = join(searchPath, packageName, 'package.json');
201
+ if (!existsSync(packageJsonPath))
202
+ continue;
203
+ let manifest;
204
+ try {
205
+ manifest = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
206
+ }
207
+ catch {
208
+ return undefined;
209
+ }
210
+ const entry = esmEntryFromManifest(manifest);
211
+ if (!entry)
212
+ return undefined;
213
+ return join(searchPath, packageName, entry);
214
+ }
215
+ return undefined;
216
+ };
107
217
  const importProviderPackage = async (packageName, projectDir) => {
108
218
  const require = createRequire(join(projectDir ?? process.cwd(), 'package.json'));
109
219
  try {
@@ -115,9 +225,14 @@ const importProviderPackage = async (packageName, projectDir) => {
115
225
  catch (e) {
116
226
  const err = e;
117
227
  if (err?.code !== 'ERR_MODULE_NOT_FOUND' &&
118
- err?.code !== 'MODULE_NOT_FOUND') {
228
+ err?.code !== 'MODULE_NOT_FOUND' &&
229
+ err?.code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
119
230
  throw e;
120
231
  }
232
+ const entry = resolveEsmOnlyEntry(require, packageName);
233
+ if (entry && existsSync(entry)) {
234
+ return await import(pathToFileURL(entry).href);
235
+ }
121
236
  }
122
237
  return await import(packageName);
123
238
  };
@@ -0,0 +1,27 @@
1
+ export type McpManifest = {
2
+ mcpPath?: string;
3
+ tools?: unknown[];
4
+ resources?: unknown[];
5
+ prompts?: unknown[];
6
+ };
7
+ export type McpSurfaceMount = {
8
+ mcpJson: McpManifest;
9
+ mcpPath: string;
10
+ };
11
+ /**
12
+ * Every MCP endpoint the generated tree describes: the default one, plus one
13
+ * per surface for a project that serves several connectors.
14
+ *
15
+ * Dev mounts all of them so a connector can be pointed at `pikku dev` and tried
16
+ * before it is deployed. Without the surfaces, a project that moved its tools
17
+ * onto their own endpoints would serve nothing locally at all — the default
18
+ * manifest it does read is empty precisely because they moved.
19
+ *
20
+ * A surface manifest without an `mcpPath` is skipped rather than guessed at: the
21
+ * path is what the deployed unit is routed on, and a mount at a different path
22
+ * would make dev disagree with production.
23
+ */
24
+ export declare const readMcpManifests: (pikkuDir: string, onWarning: (message: string) => void) => {
25
+ mcpJson?: McpManifest;
26
+ mcpSurfaces: McpSurfaceMount[];
27
+ };
@@ -0,0 +1,52 @@
1
+ import { existsSync, readFileSync, readdirSync } from 'node:fs';
2
+ import { join } from 'path';
3
+ /**
4
+ * A manifest with nothing in it reads as "no MCP here": the transports mount
5
+ * only when there is something to serve, so an empty one would announce an
6
+ * endpoint that answers every call with a missing tool.
7
+ *
8
+ * Absent or unparseable is not an error either — an app with no MCP wirings
9
+ * has no manifest, and that is the common case.
10
+ */
11
+ const readMcpManifest = (file, onWarning) => {
12
+ if (!existsSync(file))
13
+ return undefined;
14
+ try {
15
+ const parsed = JSON.parse(readFileSync(file, 'utf-8'));
16
+ const count = (parsed.tools?.length ?? 0) +
17
+ (parsed.resources?.length ?? 0) +
18
+ (parsed.prompts?.length ?? 0);
19
+ return count > 0 ? parsed : undefined;
20
+ }
21
+ catch (err) {
22
+ onWarning(`[pikku] could not parse ${file} — MCP will not be served: ${err instanceof Error ? err.message : String(err)}`);
23
+ return undefined;
24
+ }
25
+ };
26
+ /**
27
+ * Every MCP endpoint the generated tree describes: the default one, plus one
28
+ * per surface for a project that serves several connectors.
29
+ *
30
+ * Dev mounts all of them so a connector can be pointed at `pikku dev` and tried
31
+ * before it is deployed. Without the surfaces, a project that moved its tools
32
+ * onto their own endpoints would serve nothing locally at all — the default
33
+ * manifest it does read is empty precisely because they moved.
34
+ *
35
+ * A surface manifest without an `mcpPath` is skipped rather than guessed at: the
36
+ * path is what the deployed unit is routed on, and a mount at a different path
37
+ * would make dev disagree with production.
38
+ */
39
+ export const readMcpManifests = (pikkuDir, onWarning) => {
40
+ const mcpDir = join(pikkuDir, 'mcp');
41
+ const mcpJson = readMcpManifest(join(mcpDir, 'mcp.gen.json'), onWarning);
42
+ const mcpSurfaces = (existsSync(mcpDir) ? readdirSync(mcpDir) : [])
43
+ .filter((name) => /^mcp\..+\.gen\.json$/.test(name))
44
+ .sort()
45
+ .flatMap((name) => {
46
+ const parsed = readMcpManifest(join(mcpDir, name), onWarning);
47
+ if (!parsed?.mcpPath)
48
+ return [];
49
+ return [{ mcpJson: parsed, mcpPath: parsed.mcpPath }];
50
+ });
51
+ return { mcpJson, mcpSurfaces };
52
+ };