@pikku/cli 0.11.2 → 0.11.3

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 (301) hide show
  1. package/.pikku/channel/pikku-channel-types.gen.ts +63 -6
  2. package/.pikku/channel/pikku-channels-map.gen.d.ts +4 -4
  3. package/.pikku/channel/pikku-channels-meta.gen.ts +4 -2
  4. package/.pikku/channel/pikku-channels.gen.ts +1 -1
  5. package/.pikku/cli/pikku-cli-channel.ts +1 -1
  6. package/.pikku/cli/pikku-cli-client.gen.ts +1 -1
  7. package/.pikku/cli/pikku-cli-types.gen.ts +1 -1
  8. package/.pikku/cli/pikku-cli-wirings-meta.gen.json +2 -1
  9. package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +2 -2
  10. package/.pikku/cli/pikku-cli-wirings.gen.ts +1 -1
  11. package/.pikku/cli/pikku-cli.gen.ts +1 -1
  12. package/.pikku/forge/pikku-forge-types.gen.ts +83 -0
  13. package/.pikku/function/pikku-function-types.gen.ts +181 -35
  14. package/.pikku/function/pikku-functions-meta-verbose.gen.json +1030 -0
  15. package/.pikku/function/pikku-functions-meta.gen.json +88 -420
  16. package/.pikku/function/pikku-functions-meta.gen.ts +2 -2
  17. package/.pikku/http/pikku-http-types.gen.ts +19 -3
  18. package/.pikku/http/pikku-http-wirings-map.gen.d.ts +4 -4
  19. package/.pikku/http/pikku-http-wirings-meta.gen.json +9 -0
  20. package/.pikku/http/pikku-http-wirings-meta.gen.ts +4 -10
  21. package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
  22. package/.pikku/mcp/pikku-mcp-types.gen.ts +69 -17
  23. package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +4 -4
  24. package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
  25. package/.pikku/pikku-bootstrap.gen.ts +7 -9
  26. package/.pikku/pikku-services.gen.ts +3 -2
  27. package/.pikku/pikku-types.gen.ts +4 -1
  28. package/.pikku/pikku-websocket.gen.ts +1 -1
  29. package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
  30. package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +4 -4
  31. package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +2 -2
  32. package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
  33. package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +4 -1
  34. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +12 -7
  35. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +15 -9
  36. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
  37. package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +2 -2
  38. package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
  39. package/.pikku/schemas/register.gen.ts +9 -1
  40. package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  41. package/.pikku/schemas/schemas/PikkuCLIOutput.schema.json +1 -1
  42. package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  43. package/.pikku/schemas/schemas/PikkuForgeNodesOutput.schema.json +1 -0
  44. package/.pikku/schemas/schemas/PikkuFunctionsOutput.schema.json +1 -1
  45. package/.pikku/schemas/schemas/PikkuHTTPOutput.schema.json +1 -1
  46. package/.pikku/schemas/schemas/PikkuMCPOutput.schema.json +1 -1
  47. package/.pikku/schemas/schemas/PikkuMiddlewareOutput.schema.json +1 -1
  48. package/.pikku/schemas/schemas/PikkuPackageOutput.schema.json +1 -0
  49. package/.pikku/schemas/schemas/PikkuPermissionsOutput.schema.json +1 -1
  50. package/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -1
  51. package/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +1 -1
  52. package/.pikku/schemas/schemas/PikkuRPCOutput.schema.json +1 -1
  53. package/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -1
  54. package/.pikku/schemas/schemas/PikkuSchedulerOutput.schema.json +1 -1
  55. package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  56. package/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -1
  57. package/.pikku/services/config.gen.json +11 -6
  58. package/.pikku/services/getInspectorState.gen.json +2 -2
  59. package/.pikku/services/jwt.gen.json +2 -2
  60. package/.pikku/services/logger.gen.json +2 -2
  61. package/.pikku/services/queueService.gen.json +2 -2
  62. package/.pikku/services/schedulerService.gen.json +2 -2
  63. package/.pikku/services/schema.gen.json +2 -2
  64. package/.pikku/services/secrets.gen.json +13 -0
  65. package/.pikku/services/variables.gen.json +2 -2
  66. package/.pikku/services/workflowService.gen.json +6 -6
  67. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +2 -36
  68. package/.pikku/workflow/pikku-workflow-types.gen.ts +297 -45
  69. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -4
  70. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -6
  71. package/CHANGELOG.md +23 -1
  72. package/cli.schema.json +1 -1
  73. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +47 -5
  74. package/dist/.pikku/channel/pikku-channel-types.gen.js +3 -13
  75. package/dist/.pikku/channel/pikku-channels-meta.gen.js +3 -2
  76. package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
  77. package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
  78. package/dist/.pikku/cli/pikku-cli-channel.js +1 -1
  79. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  80. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  81. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  82. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  83. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +2 -2
  84. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +2 -1
  85. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  86. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  87. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  88. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  89. package/dist/.pikku/forge/pikku-forge-types.gen.d.ts +72 -0
  90. package/dist/.pikku/forge/pikku-forge-types.gen.js +55 -0
  91. package/dist/.pikku/function/pikku-function-types.gen.d.ts +123 -31
  92. package/dist/.pikku/function/pikku-function-types.gen.js +37 -51
  93. package/dist/.pikku/function/pikku-functions-meta.gen.js +2 -2
  94. package/dist/.pikku/function/pikku-functions-meta.gen.json +88 -420
  95. package/dist/.pikku/http/pikku-http-types.gen.d.ts +18 -3
  96. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  97. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +3 -10
  98. package/dist/.pikku/http/pikku-http-wirings-meta.gen.json +9 -0
  99. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  100. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  101. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +54 -14
  102. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +7 -31
  103. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +4 -4
  104. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
  105. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
  106. package/dist/.pikku/pikku-bootstrap.gen.d.ts +7 -9
  107. package/dist/.pikku/pikku-bootstrap.gen.js +7 -9
  108. package/dist/.pikku/pikku-services.gen.d.ts +3 -2
  109. package/dist/.pikku/pikku-services.gen.js +1 -0
  110. package/dist/.pikku/pikku-types.gen.d.ts +2 -1
  111. package/dist/.pikku/pikku-types.gen.js +3 -1
  112. package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
  113. package/dist/.pikku/pikku-websocket.gen.js +1 -1
  114. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  115. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  116. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +2 -2
  117. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  118. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  119. package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.d.ts +4 -1
  120. package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +4 -1
  121. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  122. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  123. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +2 -2
  124. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
  125. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
  126. package/dist/.pikku/schemas/register.gen.js +5 -1
  127. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  128. package/dist/.pikku/schemas/schemas/PikkuCLIOutput.schema.json +1 -1
  129. package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  130. package/dist/.pikku/schemas/schemas/PikkuForgeNodesOutput.schema.json +1 -0
  131. package/dist/.pikku/schemas/schemas/PikkuFunctionsOutput.schema.json +1 -1
  132. package/dist/.pikku/schemas/schemas/PikkuHTTPOutput.schema.json +1 -1
  133. package/dist/.pikku/schemas/schemas/PikkuMCPOutput.schema.json +1 -1
  134. package/dist/.pikku/schemas/schemas/PikkuMiddlewareOutput.schema.json +1 -1
  135. package/dist/.pikku/schemas/schemas/PikkuPackageOutput.schema.json +1 -0
  136. package/dist/.pikku/schemas/schemas/PikkuPermissionsOutput.schema.json +1 -1
  137. package/dist/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -1
  138. package/dist/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +1 -1
  139. package/dist/.pikku/schemas/schemas/PikkuRPCOutput.schema.json +1 -1
  140. package/dist/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -1
  141. package/dist/.pikku/schemas/schemas/PikkuSchedulerOutput.schema.json +1 -1
  142. package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  143. package/dist/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -1
  144. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +207 -37
  145. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +104 -28
  146. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +3 -3
  147. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +2 -6
  148. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +2 -6
  149. package/dist/src/functions/commands/all.js +117 -79
  150. package/dist/src/functions/commands/bootstrap.js +2 -9
  151. package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +0 -1
  152. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +49 -35
  153. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +49 -35
  154. package/dist/src/functions/wirings/channels/pikku-channels.js +1 -1
  155. package/dist/src/functions/wirings/channels/pikku-command-channels.js +18 -2
  156. package/dist/src/functions/wirings/channels/serialize-channel-types.js +62 -5
  157. package/dist/src/functions/wirings/channels/serialize-typed-channel-map.js +1 -2
  158. package/dist/src/functions/wirings/cli/pikku-command-cli.js +10 -2
  159. package/dist/src/functions/wirings/forge/pikku-command-forge-nodes.d.ts +1 -0
  160. package/dist/src/functions/wirings/forge/pikku-command-forge-nodes.js +90 -0
  161. package/dist/src/functions/wirings/forge/pikku-command-forge-types.d.ts +1 -0
  162. package/dist/src/functions/wirings/forge/pikku-command-forge-types.js +26 -0
  163. package/dist/src/functions/wirings/forge/serialize-forge-types.d.ts +4 -0
  164. package/dist/src/functions/wirings/forge/serialize-forge-types.js +90 -0
  165. package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
  166. package/dist/src/functions/wirings/functions/pikku-command-function-types.js +7 -2
  167. package/dist/src/functions/wirings/functions/pikku-command-functions.js +33 -18
  168. package/dist/src/functions/wirings/functions/pikku-command-services.js +1 -1
  169. package/dist/src/functions/wirings/functions/pikku-function-types.js +2 -2
  170. package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
  171. package/dist/src/functions/wirings/functions/schemas.js +5 -4
  172. package/dist/src/functions/wirings/functions/serialize-function-imports.d.ts +3 -1
  173. package/dist/src/functions/wirings/functions/serialize-function-imports.js +7 -3
  174. package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
  175. package/dist/src/functions/wirings/functions/serialize-function-types.js +181 -34
  176. package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.d.ts +1 -1
  177. package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.js +19 -21
  178. package/dist/src/functions/wirings/http/openapi-spec-generator.js +1 -1
  179. package/dist/src/functions/wirings/http/pikku-command-http-routes.js +18 -2
  180. package/dist/src/functions/wirings/http/pikku-command-openapi.js +2 -2
  181. package/dist/src/functions/wirings/http/pikku-http-routes.js +1 -1
  182. package/dist/src/functions/wirings/http/serialize-http-types.js +18 -2
  183. package/dist/src/functions/wirings/http/serialize-typed-http-map.js +33 -8
  184. package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +15 -6
  185. package/dist/src/functions/wirings/mcp/serialize-mcp-json.js +3 -2
  186. package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +68 -16
  187. package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +5 -2
  188. package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -0
  189. package/dist/src/functions/wirings/package/pikku-command-package.js +58 -0
  190. package/dist/src/functions/wirings/package/serialize-package.d.ts +5 -0
  191. package/dist/src/functions/wirings/package/serialize-package.js +32 -0
  192. package/dist/src/functions/wirings/queue/pikku-command-queue.js +10 -2
  193. package/dist/src/functions/wirings/queue/pikku-queue.js +1 -9
  194. package/dist/src/functions/wirings/queue/serialize-queue-map.js +20 -3
  195. package/dist/src/functions/wirings/queue/serialize-queue-meta.js +1 -1
  196. package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.js +4 -4
  197. package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +1 -1
  198. package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +3 -0
  199. package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +1 -1
  200. package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.d.ts +1 -1
  201. package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +54 -8
  202. package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +10 -1
  203. package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.js +1 -1
  204. package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +56 -18
  205. package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +3 -0
  206. package/dist/src/functions/wirings/workflow/serialize-workflow-map.js +30 -32
  207. package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +1 -3
  208. package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +43 -18
  209. package/dist/src/functions/wirings/workflow/serialize-workflow-registration.d.ts +7 -0
  210. package/dist/src/functions/wirings/workflow/serialize-workflow-registration.js +53 -0
  211. package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +3 -1
  212. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +299 -45
  213. package/dist/src/functions/wirings/workflow/serialize-workflow-workers.d.ts +1 -1
  214. package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +14 -27
  215. package/dist/src/services.js +4 -1
  216. package/dist/src/utils/command-summary.d.ts +2 -0
  217. package/dist/src/utils/command-summary.js +2 -0
  218. package/dist/src/utils/custom-types-generator.js +13 -15
  219. package/dist/src/utils/generate-bootstrap-file.js +1 -1
  220. package/dist/src/utils/pikku-cli-config.js +37 -9
  221. package/dist/src/utils/schema-generator.d.ts +4 -3
  222. package/dist/src/utils/schema-generator.js +135 -15
  223. package/dist/src/utils/strip-verbose-meta.d.ts +43 -0
  224. package/dist/src/utils/strip-verbose-meta.js +210 -0
  225. package/dist/tsconfig.tsbuildinfo +1 -1
  226. package/package.json +7 -4
  227. package/src/functions/commands/all.ts +144 -97
  228. package/src/functions/commands/bootstrap.ts +2 -10
  229. package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +0 -1
  230. package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +49 -35
  231. package/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +49 -35
  232. package/src/functions/wirings/channels/pikku-channels.ts +1 -1
  233. package/src/functions/wirings/channels/pikku-command-channels.ts +46 -3
  234. package/src/functions/wirings/channels/serialize-channel-types.ts +62 -5
  235. package/src/functions/wirings/channels/serialize-typed-channel-map.ts +3 -2
  236. package/src/functions/wirings/cli/pikku-command-cli.ts +21 -2
  237. package/src/functions/wirings/forge/pikku-command-forge-nodes.ts +135 -0
  238. package/src/functions/wirings/forge/pikku-command-forge-types.ts +38 -0
  239. package/src/functions/wirings/forge/serialize-forge-types.ts +94 -0
  240. package/src/functions/wirings/functions/pikku-command-function-types-split.ts +3 -2
  241. package/src/functions/wirings/functions/pikku-command-function-types.ts +17 -10
  242. package/src/functions/wirings/functions/pikku-command-functions.ts +47 -37
  243. package/src/functions/wirings/functions/pikku-command-services.ts +1 -1
  244. package/src/functions/wirings/functions/pikku-function-types.ts +3 -1
  245. package/src/functions/wirings/functions/schemas.ts +14 -4
  246. package/src/functions/wirings/functions/serialize-function-imports.ts +12 -3
  247. package/src/functions/wirings/functions/serialize-function-types.ts +182 -34
  248. package/src/functions/wirings/functions/serialize-pikku-types-hub.ts +27 -26
  249. package/src/functions/wirings/http/openapi-spec-generator.ts +1 -1
  250. package/src/functions/wirings/http/pikku-command-http-routes.ts +46 -2
  251. package/src/functions/wirings/http/pikku-command-openapi.ts +3 -2
  252. package/src/functions/wirings/http/pikku-http-routes.ts +1 -1
  253. package/src/functions/wirings/http/serialize-http-types.ts +18 -2
  254. package/src/functions/wirings/http/serialize-typed-http-map.ts +32 -8
  255. package/src/functions/wirings/mcp/pikku-command-mcp.ts +32 -10
  256. package/src/functions/wirings/mcp/serialize-mcp-json.ts +8 -6
  257. package/src/functions/wirings/mcp/serialize-mcp-types.ts +68 -16
  258. package/src/functions/wirings/middleware/pikku-command-middleware.ts +6 -2
  259. package/src/functions/wirings/package/pikku-command-package.ts +81 -0
  260. package/src/functions/wirings/package/serialize-package.ts +69 -0
  261. package/src/functions/wirings/queue/pikku-command-queue.ts +22 -2
  262. package/src/functions/wirings/queue/pikku-queue.ts +1 -10
  263. package/src/functions/wirings/queue/serialize-queue-map.ts +18 -3
  264. package/src/functions/wirings/queue/serialize-queue-meta.ts +1 -1
  265. package/src/functions/wirings/rpc/pikku-command-rpc-map.ts +7 -4
  266. package/src/functions/wirings/rpc/pikku-command-rpc.ts +1 -1
  267. package/src/functions/wirings/rpc/serialize-remote-rpc.ts +3 -0
  268. package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +1 -1
  269. package/src/functions/wirings/rpc/serialize-typed-rpc-map.ts +74 -8
  270. package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +22 -1
  271. package/src/functions/wirings/scheduler/serialize-scheduler-meta.ts +1 -1
  272. package/src/functions/wirings/workflow/pikku-command-workflow.ts +104 -37
  273. package/src/functions/wirings/workflow/serialize-workflow-map.ts +38 -40
  274. package/src/functions/wirings/workflow/serialize-workflow-meta.ts +66 -26
  275. package/src/functions/wirings/workflow/serialize-workflow-registration.ts +83 -0
  276. package/src/functions/wirings/workflow/serialize-workflow-types.ts +299 -45
  277. package/src/functions/wirings/workflow/serialize-workflow-workers.ts +14 -27
  278. package/src/services.ts +8 -1
  279. package/src/utils/command-summary.ts +4 -0
  280. package/src/utils/custom-types-generator.ts +15 -15
  281. package/src/utils/generate-bootstrap-file.ts +1 -1
  282. package/src/utils/pikku-cli-config.ts +51 -18
  283. package/src/utils/schema-generator.ts +185 -22
  284. package/src/utils/strip-verbose-meta.ts +254 -0
  285. package/types/config.d.ts +37 -3
  286. package/.pikku/function/pikku-functions-meta.min.gen.json +0 -212
  287. package/.pikku/function/pikku-functions-meta.min.gen.ts +0 -6
  288. package/dist/.pikku/function/pikku-functions-meta.min.gen.d.ts +0 -1
  289. package/dist/.pikku/function/pikku-functions-meta.min.gen.js +0 -6
  290. package/dist/.pikku/function/pikku-functions-meta.min.gen.json +0 -212
  291. package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.d.ts +0 -1
  292. package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.js +0 -12
  293. package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.d.ts +0 -1
  294. package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +0 -13
  295. package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.d.ts +0 -8
  296. package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.js +0 -30
  297. package/src/functions/wirings/workflow/pikku-command-workflow-map.ts +0 -24
  298. package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +0 -29
  299. package/src/functions/wirings/workflow/serialize-workflow-wirings.ts +0 -47
  300. /package/.pikku/{workflow/pikku-workflow-wirings-meta.gen.json → channel/pikku-channels-meta.gen.json} +0 -0
  301. /package/dist/.pikku/{workflow/pikku-workflow-wirings-meta.gen.json → channel/pikku-channels-meta.gen.json} +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  import { executeCLIViaChannel } from '@pikku/core/cli/channel';
5
5
  import { CorePikkuWebsocket } from '@pikku/websocket';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  /**
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  /**
5
5
 
@@ -1,6 +1,6 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  import { pikkuState } from '@pikku/core';
5
5
  import metaData from './pikku-cli-wirings-meta.gen.json' with { type: 'json' };
6
- pikkuState('cli', 'meta', metaData);
6
+ pikkuState(null, 'cli', 'meta', metaData);
@@ -135,12 +135,13 @@
135
135
  "jwt",
136
136
  "config",
137
137
  "variables",
138
+ "secrets",
138
139
  "workflowService",
139
140
  "queueService",
140
141
  "schedulerService"
141
142
  ]
142
143
  },
143
- "filePath": "src/services.ts"
144
+ "filePath": "/home/runner/work/pikku/pikku/packages/cli/src/services.ts"
144
145
  }
145
146
  }
146
147
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  import '../../src/cli.wiring.js';
5
5
  import '../../src/services.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  /* The files with an wireCLI function call */
5
5
  import '../../src/cli.wiring.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  import '../pikku-bootstrap.gen.js';
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  import { executeCLI, CLIError } from '@pikku/core/cli';
5
5
  import { createConfig as createConfig } from '../../src/services.js';
@@ -0,0 +1,72 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.11.3
3
+ */
4
+ /**
5
+ * Forge-specific type definitions for typed wireForgeNode and wireForgeCredential
6
+ */
7
+ import type { CoreForgeNode, CoreForgeCredential } from '@pikku/core/forge-node';
8
+ import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.js';
9
+ /**
10
+ * Valid category values for forge nodes.
11
+ * No categories configured - wireForgeNode cannot be used until forge.node.categories is defined in pikku.config.json.
12
+ */
13
+ export type ForgeCategory = never;
14
+ /**
15
+ * Valid RPC names that can be used with forge nodes.
16
+ * These are derived from the FlattenedRPCMap which includes both local and external package RPCs.
17
+ */
18
+ export type ForgeRPCName = keyof FlattenedRPCMap;
19
+ /**
20
+ * Typed forge node configuration.
21
+ * Validates that category and rpc are valid values.
22
+ */
23
+ export type TypedForgeNode = Omit<CoreForgeNode, 'category' | 'rpc'> & {
24
+ /** Grouping category (validated against forge.node.categories in config) */
25
+ category: ForgeCategory;
26
+ /** RPC name to call when node executes (must be a valid RPC name) */
27
+ rpc: ForgeRPCName;
28
+ };
29
+ /**
30
+ * Registers a Forge node with validated category and RPC.
31
+ *
32
+ * @param config - Forge node configuration with typed category and rpc
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * wireForgeNode({
37
+ * name: 'send-email',
38
+ * displayName: 'Send Email',
39
+ * category: 'Communication', // Must be in forge.node.categories
40
+ * type: 'action',
41
+ * rpc: 'sendEmail', // Must be a valid RPC name
42
+ * description: 'Sends an email to a recipient'
43
+ * })
44
+ * ```
45
+ */
46
+ export declare const wireForgeNode: (config: TypedForgeNode) => void;
47
+ /**
48
+ * Registers a Forge credential definition.
49
+ * Credentials define secrets/API keys required by the package.
50
+ *
51
+ * @template T - Zod schema type for the credential structure
52
+ * @param config - Forge credential configuration
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * import { z } from 'zod'
57
+ *
58
+ * const apiCredentials = z.object({
59
+ * apiKey: z.string().describe('API key for authentication'),
60
+ * apiSecret: z.string().describe('API secret')
61
+ * })
62
+ *
63
+ * wireForgeCredential({
64
+ * name: 'example-api',
65
+ * displayName: 'Example API Credentials',
66
+ * description: 'Credentials for the example external API',
67
+ * secretId: 'EXAMPLE_API_CREDENTIALS',
68
+ * schema: apiCredentials
69
+ * })
70
+ * ```
71
+ */
72
+ export declare const wireForgeCredential: <T>(config: CoreForgeCredential<T>) => void;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.11.3
3
+ */
4
+ /**
5
+ * Forge-specific type definitions for typed wireForgeNode and wireForgeCredential
6
+ */
7
+ import { wireForgeNode as wireForgeNodeCore, wireForgeCredential as wireForgeCredentialCore } from '@pikku/core/forge-node';
8
+ /**
9
+ * Registers a Forge node with validated category and RPC.
10
+ *
11
+ * @param config - Forge node configuration with typed category and rpc
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * wireForgeNode({
16
+ * name: 'send-email',
17
+ * displayName: 'Send Email',
18
+ * category: 'Communication', // Must be in forge.node.categories
19
+ * type: 'action',
20
+ * rpc: 'sendEmail', // Must be a valid RPC name
21
+ * description: 'Sends an email to a recipient'
22
+ * })
23
+ * ```
24
+ */
25
+ export const wireForgeNode = (config) => {
26
+ wireForgeNodeCore(config);
27
+ };
28
+ /**
29
+ * Registers a Forge credential definition.
30
+ * Credentials define secrets/API keys required by the package.
31
+ *
32
+ * @template T - Zod schema type for the credential structure
33
+ * @param config - Forge credential configuration
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * import { z } from 'zod'
38
+ *
39
+ * const apiCredentials = z.object({
40
+ * apiKey: z.string().describe('API key for authentication'),
41
+ * apiSecret: z.string().describe('API secret')
42
+ * })
43
+ *
44
+ * wireForgeCredential({
45
+ * name: 'example-api',
46
+ * displayName: 'Example API Credentials',
47
+ * description: 'Credentials for the example external API',
48
+ * secretId: 'EXAMPLE_API_CREDENTIALS',
49
+ * schema: apiCredentials
50
+ * })
51
+ * ```
52
+ */
53
+ export const wireForgeCredential = (config) => {
54
+ wireForgeCredentialCore(config);
55
+ };
@@ -1,16 +1,16 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  /**
5
5
  * Core function, middleware, and permission types for all wirings
6
6
  */
7
- import { CorePikkuFunctionConfig, CorePikkuPermission, CorePikkuMiddleware, CorePermissionGroup, PikkuWire, PickRequired } from '@pikku/core';
7
+ import { CorePikkuFunctionConfig, CorePikkuPermission, CorePikkuMiddleware, CorePermissionGroup, PikkuWire, PickRequired, ZodLike, CreateWireServices } from '@pikku/core';
8
8
  import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function';
9
9
  import type { UserSession } from '../../types/application-types.d.js';
10
10
  import type { SingletonServices } from '../../types/application-types.d.js';
11
11
  import type { Services } from '../../types/application-types.d.js';
12
12
  import type { Config } from '../../types/application-types.d.js';
13
- import type { TypedPikkuRPC } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js';
13
+ import type { TypedPikkuRPC, FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js';
14
14
  import type { RequiredSingletonServices, RequiredWireServices } from '../pikku-services.gen.js';
15
15
  type Session = UserSession;
16
16
  /**
@@ -154,6 +154,10 @@ export type PikkuFunctionSessionless<In = unknown, Out = never, RequiredWires ex
154
154
  * @template RequiredServices - Services required by this function
155
155
  */
156
156
  export type PikkuFunction<In = unknown, Out = never, RequiredWires extends keyof PikkuWire = 'session', RequiredServices extends Services = Services> = CorePikkuFunction<In, Out, RequiredServices, PickRequired<PikkuWire<In, Out, true, Session, TypedPikkuRPC, null, any>, RequiredWires>>;
157
+ /**
158
+ * Helper type to infer the output type from a Zod schema
159
+ */
160
+ export type InferZodOutput<T> = T extends ZodLike<infer U> ? U : never;
157
161
  /**
158
162
  * Configuration object for Pikku functions with optional middleware, permissions, tags, and documentation.
159
163
  * This type wraps CorePikkuFunctionConfig with the user's custom types.
@@ -162,51 +166,117 @@ export type PikkuFunction<In = unknown, Out = never, RequiredWires extends keyof
162
166
  * @template Out - The output type
163
167
  * @template PikkuFunc - The function type (can be narrowed to PikkuFunction or PikkuFunctionSessionless)
164
168
  */
165
- export type PikkuFunctionConfig<In = unknown, Out = unknown, RequiredWires extends keyof PikkuWire = never, PikkuFunc extends PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires> = PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires>> = CorePikkuFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware>;
169
+ export type PikkuFunctionConfig<In = unknown, Out = unknown, RequiredWires extends keyof PikkuWire = never, PikkuFunc extends PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires> = PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires>, InputSchema extends ZodLike | undefined = undefined, OutputSchema extends ZodLike | undefined = undefined> = CorePikkuFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema>;
170
+ /**
171
+ * Configuration object for Pikku functions with Zod schema validation.
172
+ * Use this when you want to define input/output schemas using Zod.
173
+ * Types are automatically inferred from the schemas.
174
+ */
175
+ export type PikkuFunctionConfigWithSchema<InputSchema extends ZodLike, OutputSchema extends ZodLike | undefined = undefined, RequiredWires extends keyof PikkuWire = never> = {
176
+ name?: string;
177
+ tags?: string[];
178
+ expose?: boolean;
179
+ internal?: boolean;
180
+ func: PikkuFunction<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, RequiredWires> | PikkuFunctionSessionless<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, RequiredWires>;
181
+ auth?: boolean;
182
+ permissions?: CorePermissionGroup<PikkuPermission<InferZodOutput<InputSchema>>>;
183
+ middleware?: PikkuMiddleware[];
184
+ input: InputSchema;
185
+ output?: OutputSchema;
186
+ };
166
187
  /**
167
188
  * Creates a Pikku function that can be either session-aware or sessionless.
168
189
  * This is the main function wrapper for creating API endpoints.
169
190
  *
170
- * @template In - Input type for the function
171
- * @template Out - Output type for the function
191
+ * Supports two patterns:
192
+ * 1. Generic types: `pikkuFunc<Input, Output>({ func: ... })`
193
+ * 2. Zod schemas: `pikkuFunc({ input: z.object(...), output: z.object(...), func: ... })`
194
+ *
195
+ * @template In - Input type for the function (inferred from schema if provided)
196
+ * @template Out - Output type for the function (inferred from schema if provided)
172
197
  * @param func - Function definition, either direct function or configuration object
173
198
  * @returns The normalized configuration object
174
199
  *
175
200
  * @example
176
- * \`\`\`typescript
177
- * const createUser = pikkuFunc<{name: string, email: string}, {id: number, message: string}>({
178
- * func: async ({db, logger}, input, wire) => {
179
- * const session = await wire.session.get()
180
- * logger.info('Creating user', input.name)
201
+ * ```typescript
202
+ * // Pattern 1: Using generic types
203
+ * const createUser = pikkuFunc<{name: string, email: string}, {id: number}>({
204
+ * func: async ({db}, input) => {
181
205
  * const user = await db.users.create(input)
182
- * return {id: user.id, message: \`User \${input.name} created successfully\`}
183
- * },
184
- * auth: true
206
+ * return { id: user.id }
207
+ * }
185
208
  * })
186
- * \`\`\`
209
+ *
210
+ * // Pattern 2: Using Zod schemas (types inferred automatically)
211
+ * const createUserInput = z.object({ name: z.string(), email: z.string() })
212
+ * const createUserOutput = z.object({ id: z.number() })
213
+ *
214
+ * const createUser = pikkuFunc({
215
+ * input: createUserInput,
216
+ * output: createUserOutput,
217
+ * func: async ({db}, input) => {
218
+ * // input is typed as { name: string, email: string }
219
+ * const user = await db.users.create(input)
220
+ * return { id: user.id } // must match output schema
221
+ * }
222
+ * })
223
+ * ```
187
224
  */
188
- export declare const pikkuFunc: <In, Out = unknown>(func: PikkuFunction<In, Out, "session" | "rpc"> | PikkuFunctionConfig<In, Out, "session" | "rpc">) => PikkuFunctionConfig<In, Out, "rpc" | "session", PikkuFunction<In, Out, "rpc" | "session", Services> | PikkuFunctionSessionless<In, Out, "rpc" | "session", Services>>;
225
+ export declare function pikkuFunc<InputSchema extends ZodLike, OutputSchema extends ZodLike | undefined = undefined>(config: PikkuFunctionConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>): PikkuFunctionConfig<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, 'session' | 'rpc'>;
226
+ export declare function pikkuFunc<In, Out = unknown>(func: PikkuFunction<In, Out, 'session' | 'rpc'> | PikkuFunctionConfig<In, Out, 'session' | 'rpc'>): PikkuFunctionConfig<In, Out, 'session' | 'rpc'>;
227
+ /**
228
+ * Configuration object for sessionless Pikku functions with Zod schema validation.
229
+ */
230
+ export type PikkuFunctionSessionlessConfigWithSchema<InputSchema extends ZodLike, OutputSchema extends ZodLike | undefined = undefined, RequiredWires extends keyof PikkuWire = never> = {
231
+ name?: string;
232
+ description?: string;
233
+ tags?: string[];
234
+ expose?: boolean;
235
+ internal?: boolean;
236
+ func: PikkuFunctionSessionless<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, RequiredWires>;
237
+ auth?: boolean;
238
+ permissions?: CorePermissionGroup<PikkuPermission<InferZodOutput<InputSchema>>>;
239
+ middleware?: PikkuMiddleware[];
240
+ input: InputSchema;
241
+ output?: OutputSchema;
242
+ };
189
243
  /**
190
244
  * Creates a sessionless Pikku function that doesn't require user authentication.
191
245
  * Use this for public endpoints, webhooks, or background tasks.
192
246
  *
193
- * @template In - Input type for the function
194
- * @template Out - Output type for the function
247
+ * Supports two patterns:
248
+ * 1. Generic types: `pikkuSessionlessFunc<Input, Output>({ func: ... })`
249
+ * 2. Zod schemas: `pikkuSessionlessFunc({ input: z.object(...), func: ... })`
250
+ *
251
+ * @template In - Input type for the function (inferred from schema if provided)
252
+ * @template Out - Output type for the function (inferred from schema if provided)
195
253
  * @param func - Function definition, either direct function or configuration object
196
254
  * @returns The normalized configuration object
197
255
  *
198
256
  * @example
199
- * \`\`\`typescript
200
- * const healthCheck = pikkuSessionlessFunc<void, {status: string, timestamp: string}>({
201
- * func: async ({logger}, input) => {
202
- * logger.info('Health check requested')
203
- * return {status: 'healthy', timestamp: new Date().toISOString()}
204
- * },
205
- * name: 'healthCheck'
257
+ * ```typescript
258
+ * // Pattern 1: Using generic types
259
+ * const healthCheck = pikkuSessionlessFunc<void, {status: string}>({
260
+ * func: async ({logger}) => {
261
+ * return { status: 'healthy' }
262
+ * }
263
+ * })
264
+ *
265
+ * // Pattern 2: Using Zod schemas
266
+ * const greetInput = z.object({ name: z.string() })
267
+ * const greetOutput = z.object({ message: z.string() })
268
+ *
269
+ * const greet = pikkuSessionlessFunc({
270
+ * input: greetInput,
271
+ * output: greetOutput,
272
+ * func: async (_services, { name }) => {
273
+ * return { message: `Hello, ${name}!` }
274
+ * }
206
275
  * })
207
- * \`\`\`
276
+ * ```
208
277
  */
209
- export declare const pikkuSessionlessFunc: <In, Out = unknown>(func: PikkuFunctionSessionless<In, Out, "session" | "rpc"> | PikkuFunctionConfig<In, Out, "session" | "rpc">) => PikkuFunctionConfig<In, Out, "rpc" | "session", PikkuFunctionSessionless<In, Out, "rpc" | "session", Services> | PikkuFunction<In, Out, "rpc" | "session", Services>>;
278
+ export declare function pikkuSessionlessFunc<InputSchema extends ZodLike, OutputSchema extends ZodLike | undefined = undefined>(config: PikkuFunctionSessionlessConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>): PikkuFunctionConfig<InferZodOutput<InputSchema>, OutputSchema extends ZodLike ? InferZodOutput<OutputSchema> : unknown, 'session' | 'rpc'>;
279
+ export declare function pikkuSessionlessFunc<In, Out = unknown>(func: PikkuFunctionSessionless<In, Out, 'session' | 'rpc'> | PikkuFunctionConfig<In, Out, 'session' | 'rpc'>): PikkuFunctionConfig<In, Out, 'session' | 'rpc'>;
210
280
  /**
211
281
  * Creates a function that takes no input and returns no output.
212
282
  * Useful for health checks, triggers, or cleanup operations.
@@ -215,15 +285,37 @@ export declare const pikkuSessionlessFunc: <In, Out = unknown>(func: PikkuFuncti
215
285
  * @returns The normalized configuration object
216
286
  *
217
287
  * @example
218
- * \`\`\`typescript
288
+ * ```typescript
219
289
  * const cleanupTempFiles = pikkuVoidFunc(async ({fileSystem, logger}) => {
220
290
  * logger.info('Starting cleanup of temporary files')
221
291
  * await fileSystem.deleteDirectory('/tmp/uploads')
222
292
  * logger.info('Cleanup completed')
223
293
  * })
224
- * \`\`\`
294
+ * ```
295
+ */
296
+ export declare const pikkuVoidFunc: (func: PikkuFunctionSessionless<void, void, "session" | "rpc"> | PikkuFunctionConfig<void, void, "session" | "rpc">) => PikkuFunctionConfig<void, void, "rpc" | "session", PikkuFunctionSessionless<void, void, "rpc" | "session", Services> | PikkuFunction<void, void, "rpc" | "session", Services>, undefined, undefined>;
297
+ /**
298
+ * Creates a wrapper function for external package functions that are exposed via RPC.
299
+ * This allows you to wire external functions to any wiring type (HTTP, queue, etc.)
300
+ * without type compatibility issues.
301
+ *
302
+ * @template Name - The RPC method name (must be a key in FlattenedRPCMap)
303
+ * @param rpcName - The name of the RPC method to invoke
304
+ * @returns A Pikku function that proxies calls to the external RPC method
305
+ *
306
+ * @example
307
+ * ```typescript
308
+ * // Wire an external function via HTTP
309
+ * wireHTTP({
310
+ * auth: false,
311
+ * method: 'get',
312
+ * route: '/external/hello',
313
+ * func: external('ext:hello'),
314
+ * tags: ['external'],
315
+ * })
316
+ * ```
225
317
  */
226
- export declare const pikkuVoidFunc: (func: PikkuFunctionSessionless<void, void, "session" | "rpc"> | PikkuFunctionConfig<void, void, "session" | "rpc">) => PikkuFunctionConfig<void, void, "rpc" | "session", PikkuFunctionSessionless<void, void, "rpc" | "session", Services> | PikkuFunction<void, void, "rpc" | "session", Services>>;
318
+ export declare const external: <Name extends keyof FlattenedRPCMap>(rpcName: Name) => PikkuFunctionConfig<FlattenedRPCMap[Name]["input"], FlattenedRPCMap[Name]["output"], "session" | "rpc">;
227
319
  /**
228
320
  * Creates a Pikku config factory.
229
321
  * Use this to define your application's configuration factory.
@@ -278,7 +370,7 @@ export declare const pikkuServices: (func: (config: Config, existingServices?: P
278
370
  * })
279
371
  * ```
280
372
  */
281
- export declare const pikkuWireServices: (func: (services: SingletonServices, wire: any) => Promise<RequiredWireServices>) => (services: SingletonServices, wire: any) => Promise<RequiredWireServices>;
373
+ export declare const pikkuWireServices: (func: (services: SingletonServices, wire: any) => Promise<RequiredWireServices>) => CreateWireServices;
282
374
  /**
283
375
  * Adds global middleware for a specific tag.
284
376
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  /**
5
5
  * Core function, middleware, and permission types for all wirings
@@ -99,54 +99,12 @@ export const pikkuMiddlewareFactory = (factory) => {
99
99
  export const pikkuPermissionFactory = (factory) => {
100
100
  return factory;
101
101
  };
102
- /**
103
- * Creates a Pikku function that can be either session-aware or sessionless.
104
- * This is the main function wrapper for creating API endpoints.
105
- *
106
- * @template In - Input type for the function
107
- * @template Out - Output type for the function
108
- * @param func - Function definition, either direct function or configuration object
109
- * @returns The normalized configuration object
110
- *
111
- * @example
112
- * \`\`\`typescript
113
- * const createUser = pikkuFunc<{name: string, email: string}, {id: number, message: string}>({
114
- * func: async ({db, logger}, input, wire) => {
115
- * const session = await wire.session.get()
116
- * logger.info('Creating user', input.name)
117
- * const user = await db.users.create(input)
118
- * return {id: user.id, message: \`User \${input.name} created successfully\`}
119
- * },
120
- * auth: true
121
- * })
122
- * \`\`\`
123
- */
124
- export const pikkuFunc = (func) => {
102
+ export function pikkuFunc(func) {
125
103
  return typeof func === 'function' ? { func } : func;
126
- };
127
- /**
128
- * Creates a sessionless Pikku function that doesn't require user authentication.
129
- * Use this for public endpoints, webhooks, or background tasks.
130
- *
131
- * @template In - Input type for the function
132
- * @template Out - Output type for the function
133
- * @param func - Function definition, either direct function or configuration object
134
- * @returns The normalized configuration object
135
- *
136
- * @example
137
- * \`\`\`typescript
138
- * const healthCheck = pikkuSessionlessFunc<void, {status: string, timestamp: string}>({
139
- * func: async ({logger}, input) => {
140
- * logger.info('Health check requested')
141
- * return {status: 'healthy', timestamp: new Date().toISOString()}
142
- * },
143
- * name: 'healthCheck'
144
- * })
145
- * \`\`\`
146
- */
147
- export const pikkuSessionlessFunc = (func) => {
104
+ }
105
+ export function pikkuSessionlessFunc(func) {
148
106
  return typeof func === 'function' ? { func } : func;
149
- };
107
+ }
150
108
  /**
151
109
  * Creates a function that takes no input and returns no output.
152
110
  * Useful for health checks, triggers, or cleanup operations.
@@ -155,17 +113,45 @@ export const pikkuSessionlessFunc = (func) => {
155
113
  * @returns The normalized configuration object
156
114
  *
157
115
  * @example
158
- * \`\`\`typescript
116
+ * ```typescript
159
117
  * const cleanupTempFiles = pikkuVoidFunc(async ({fileSystem, logger}) => {
160
118
  * logger.info('Starting cleanup of temporary files')
161
119
  * await fileSystem.deleteDirectory('/tmp/uploads')
162
120
  * logger.info('Cleanup completed')
163
121
  * })
164
- * \`\`\`
122
+ * ```
165
123
  */
166
124
  export const pikkuVoidFunc = (func) => {
167
125
  return typeof func === 'function' ? { func } : func;
168
126
  };
127
+ /**
128
+ * Creates a wrapper function for external package functions that are exposed via RPC.
129
+ * This allows you to wire external functions to any wiring type (HTTP, queue, etc.)
130
+ * without type compatibility issues.
131
+ *
132
+ * @template Name - The RPC method name (must be a key in FlattenedRPCMap)
133
+ * @param rpcName - The name of the RPC method to invoke
134
+ * @returns A Pikku function that proxies calls to the external RPC method
135
+ *
136
+ * @example
137
+ * ```typescript
138
+ * // Wire an external function via HTTP
139
+ * wireHTTP({
140
+ * auth: false,
141
+ * method: 'get',
142
+ * route: '/external/hello',
143
+ * func: external('ext:hello'),
144
+ * tags: ['external'],
145
+ * })
146
+ * ```
147
+ */
148
+ export const external = (rpcName) => {
149
+ return {
150
+ func: (async (_services, data, { rpc }) => {
151
+ return rpc.invoke(rpcName, data);
152
+ })
153
+ };
154
+ };
169
155
  /**
170
156
  * Creates a Pikku config factory.
171
157
  * Use this to define your application's configuration factory.
@@ -245,7 +231,7 @@ export const pikkuWireServices = (func) => func;
245
231
  * ```
246
232
  */
247
233
  export const addMiddleware = (tag, middleware) => {
248
- addMiddlewareCore(tag, middleware);
234
+ addMiddlewareCore(tag, middleware, null);
249
235
  };
250
236
  /**
251
237
  * Adds global permissions for a specific tag.
@@ -271,5 +257,5 @@ export const addMiddleware = (tag, middleware) => {
271
257
  * ```
272
258
  */
273
259
  export const addPermission = (tag, permissions) => {
274
- addPermissionCore(tag, permissions);
260
+ addPermissionCore(tag, permissions, null);
275
261
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.2
2
+ * This file was generated by @pikku/cli@0.11.3
3
3
  */
4
4
  import { pikkuState } from '@pikku/core';
5
5
  import metaData from './pikku-functions-meta.gen.json' with { type: 'json' };
6
- pikkuState('function', 'meta', metaData);
6
+ pikkuState(null, 'function', 'meta', metaData);