@pikku/cli 0.11.0 → 0.11.2

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 (262) hide show
  1. package/.pikku/channel/pikku-channel-types.gen.ts +11 -12
  2. package/.pikku/channel/pikku-channels-map.gen.d.ts +9 -9
  3. package/.pikku/channel/pikku-channels-meta.gen.ts +1 -1
  4. package/.pikku/channel/pikku-channels.gen.ts +1 -1
  5. package/.pikku/cli/pikku-cli-channel.ts +92 -0
  6. package/.pikku/cli/pikku-cli-client.gen.ts +54 -0
  7. package/.pikku/cli/pikku-cli-types.gen.ts +3 -3
  8. package/.pikku/cli/pikku-cli-wirings-meta.gen.json +146 -0
  9. package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +4 -34
  10. package/.pikku/cli/pikku-cli-wirings.gen.ts +2 -1
  11. package/.pikku/cli/pikku-cli.gen.ts +41 -0
  12. package/.pikku/function/pikku-function-types.gen.ts +49 -63
  13. package/.pikku/function/pikku-functions-meta.gen.json +988 -0
  14. package/.pikku/function/pikku-functions-meta.gen.ts +4 -970
  15. package/.pikku/function/pikku-functions-meta.min.gen.json +212 -0
  16. package/.pikku/function/pikku-functions-meta.min.gen.ts +4 -209
  17. package/.pikku/http/pikku-http-types.gen.ts +2 -2
  18. package/.pikku/http/pikku-http-wirings-map.gen.d.ts +9 -9
  19. package/.pikku/http/pikku-http-wirings-meta.gen.ts +1 -1
  20. package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
  21. package/.pikku/mcp/pikku-mcp-types.gen.ts +13 -13
  22. package/.pikku/mcp/pikku-mcp-wirings-meta.gen.json +5 -0
  23. package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +6 -4
  24. package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
  25. package/.pikku/pikku-bootstrap.gen.ts +1 -4
  26. package/.pikku/pikku-services.gen.ts +6 -8
  27. package/.pikku/pikku-types.gen.ts +1 -1
  28. package/.pikku/pikku-websocket.gen.ts +1 -1
  29. package/.pikku/queue/pikku-queue-types.gen.ts +2 -2
  30. package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +9 -9
  31. package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +1 -0
  32. package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +5 -7
  33. package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
  34. package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +2 -2
  35. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +9 -9
  36. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +41 -40
  37. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +2 -2
  38. package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.json +1 -0
  39. package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +5 -2
  40. package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
  41. package/.pikku/schemas/register.gen.ts +27 -27
  42. package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  43. package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  44. package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  45. package/.pikku/services/config.gen.json +99 -0
  46. package/.pikku/services/getInspectorState.gen.json +10 -0
  47. package/.pikku/services/jwt.gen.json +13 -0
  48. package/.pikku/services/logger.gen.json +25 -0
  49. package/.pikku/services/queueService.gen.json +14 -0
  50. package/.pikku/services/schedulerService.gen.json +17 -0
  51. package/.pikku/services/schema.gen.json +14 -0
  52. package/.pikku/services/variables.gen.json +13 -0
  53. package/.pikku/services/workflowService.gen.json +31 -0
  54. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -9
  55. package/.pikku/workflow/pikku-workflow-types.gen.ts +36 -31
  56. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.json +1 -0
  57. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -2
  58. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +6 -2
  59. package/CHANGELOG.md +27 -1
  60. package/bin/pikku.ts +6 -32
  61. package/build.sh +53 -31
  62. package/cli.schema.json +1 -1
  63. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +6 -7
  64. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  65. package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
  66. package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
  67. package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
  68. package/dist/.pikku/cli/pikku-cli-channel.js +91 -0
  69. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +10 -0
  70. package/dist/.pikku/cli/pikku-cli-client.gen.js +44 -0
  71. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +3 -3
  72. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  73. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +3 -34
  74. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +146 -0
  75. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +2 -1
  76. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +2 -1
  77. package/dist/.pikku/cli/pikku-cli.gen.d.ts +10 -0
  78. package/dist/.pikku/cli/pikku-cli.gen.js +38 -0
  79. package/dist/.pikku/function/pikku-function-types.gen.d.ts +29 -79
  80. package/dist/.pikku/function/pikku-function-types.gen.js +19 -15
  81. package/dist/.pikku/function/pikku-functions-meta.gen.js +3 -969
  82. package/dist/.pikku/function/pikku-functions-meta.gen.json +988 -0
  83. package/dist/.pikku/function/pikku-functions-meta.min.gen.js +3 -208
  84. package/dist/.pikku/function/pikku-functions-meta.min.gen.json +212 -0
  85. package/dist/.pikku/http/pikku-http-types.gen.d.ts +2 -2
  86. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  87. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  88. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  89. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  90. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +13 -13
  91. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  92. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +5 -4
  93. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.json +5 -0
  94. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
  95. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
  96. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -4
  97. package/dist/.pikku/pikku-bootstrap.gen.js +1 -4
  98. package/dist/.pikku/pikku-services.gen.d.ts +5 -8
  99. package/dist/.pikku/pikku-services.gen.js +3 -6
  100. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  101. package/dist/.pikku/pikku-types.gen.js +1 -1
  102. package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
  103. package/dist/.pikku/pikku-websocket.gen.js +1 -1
  104. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +2 -2
  105. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  106. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +3 -7
  107. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +1 -0
  108. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  109. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  110. package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.d.ts +6 -9
  111. package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +2 -2
  112. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +2 -2
  113. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  114. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +3 -2
  115. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.json +1 -0
  116. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
  117. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
  118. package/dist/.pikku/schemas/register.gen.js +17 -17
  119. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  120. package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  121. package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  122. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +29 -25
  123. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +22 -8
  124. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +3 -2
  125. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.json +1 -0
  126. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +6 -2
  127. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +6 -3
  128. package/dist/bin/pikku.js +5 -28
  129. package/dist/src/cli.wiring.js +108 -106
  130. package/dist/src/functions/commands/all.js +82 -42
  131. package/dist/src/functions/commands/bootstrap.js +22 -10
  132. package/dist/src/functions/commands/watch.js +6 -3
  133. package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +12 -7
  134. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.d.ts +1 -1
  135. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +42 -4
  136. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts +1 -1
  137. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +40 -2
  138. package/dist/src/functions/wirings/channels/pikku-channels.js +9 -2
  139. package/dist/src/functions/wirings/channels/serialize-channel-types.js +10 -11
  140. package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
  141. package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +1 -1
  142. package/dist/src/functions/wirings/cli/pikku-command-cli.js +9 -3
  143. package/dist/src/functions/wirings/cli/serialize-channel-cli.js +1 -1
  144. package/dist/src/functions/wirings/cli/serialize-cli-types.js +2 -2
  145. package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.d.ts +1 -1
  146. package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +4 -4
  147. package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +4 -4
  148. package/dist/src/functions/wirings/functions/pikku-command-functions.js +15 -5
  149. package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
  150. package/dist/src/functions/wirings/functions/pikku-command-services.js +23 -23
  151. package/dist/src/functions/wirings/functions/schemas.js +1 -1
  152. package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
  153. package/dist/src/functions/wirings/functions/serialize-function-types.js +50 -64
  154. package/dist/src/functions/wirings/http/openapi-spec-generator.js +4 -4
  155. package/dist/src/functions/wirings/http/pikku-http-routes.js +9 -2
  156. package/dist/src/functions/wirings/http/serialize-http-types.js +1 -1
  157. package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +18 -4
  158. package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +12 -12
  159. package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +26 -2
  160. package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.d.ts +5 -2
  161. package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.js +5 -13
  162. package/dist/src/functions/wirings/queue/pikku-command-queue.js +9 -3
  163. package/dist/src/functions/wirings/queue/pikku-queue.js +9 -3
  164. package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +2 -1
  165. package/dist/src/functions/wirings/queue/serialize-queue-meta.js +10 -1
  166. package/dist/src/functions/wirings/queue/serialize-queue-types.js +1 -1
  167. package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +9 -2
  168. package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +11 -4
  169. package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +1 -1
  170. package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +3 -3
  171. package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +6 -3
  172. package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.d.ts +2 -1
  173. package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.js +11 -1
  174. package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +1 -1
  175. package/dist/src/functions/wirings/services/pikku-command-service-metadata.d.ts +1 -0
  176. package/dist/src/functions/wirings/services/pikku-command-service-metadata.js +22 -0
  177. package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +3 -1
  178. package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +12 -8
  179. package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +2 -1
  180. package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +11 -1
  181. package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +1 -1
  182. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +36 -31
  183. package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.d.ts +8 -0
  184. package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.js +30 -0
  185. package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +2 -2
  186. package/dist/src/middleware/log-command-info-and-time.d.ts +2 -2
  187. package/dist/src/middleware/log-command-info-and-time.js +1 -4
  188. package/dist/src/services/cli-logger-forwarder.service.d.ts +3 -0
  189. package/dist/src/services/cli-logger-forwarder.service.js +9 -2
  190. package/dist/src/services.d.ts +2 -7
  191. package/dist/src/services.js +14 -12
  192. package/dist/src/utils/check-required-types.d.ts +2 -2
  193. package/dist/src/utils/check-required-types.js +2 -3
  194. package/dist/src/utils/pikku-cli-config.js +35 -2
  195. package/dist/src/utils/pikku-files-and-methods.d.ts +2 -2
  196. package/dist/src/utils/pikku-files-and-methods.js +4 -4
  197. package/dist/src/utils/schema-generator.d.ts +1 -1
  198. package/dist/src/utils/schema-generator.js +1 -1
  199. package/dist/tsconfig.tsbuildinfo +1 -1
  200. package/package.json +7 -8
  201. package/src/cli.wiring.ts +110 -105
  202. package/src/functions/commands/all.ts +94 -45
  203. package/src/functions/commands/bootstrap.ts +25 -10
  204. package/src/functions/commands/watch.ts +6 -3
  205. package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +26 -5
  206. package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +43 -4
  207. package/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +40 -1
  208. package/src/functions/wirings/channels/pikku-channels.ts +27 -3
  209. package/src/functions/wirings/channels/serialize-channel-types.ts +10 -11
  210. package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
  211. package/src/functions/wirings/cli/pikku-command-cli-types.ts +1 -1
  212. package/src/functions/wirings/cli/pikku-command-cli.ts +26 -3
  213. package/src/functions/wirings/cli/serialize-channel-cli.ts +1 -1
  214. package/src/functions/wirings/cli/serialize-cli-types.ts +2 -2
  215. package/src/functions/wirings/cli/serialize-local-cli-bootstrap.ts +5 -5
  216. package/src/functions/wirings/functions/pikku-command-function-types-split.ts +6 -6
  217. package/src/functions/wirings/functions/pikku-command-functions.ts +39 -4
  218. package/src/functions/wirings/functions/pikku-command-services.ts +25 -25
  219. package/src/functions/wirings/functions/schemas.ts +2 -2
  220. package/src/functions/wirings/functions/serialize-function-types.ts +51 -65
  221. package/src/functions/wirings/http/openapi-spec-generator.ts +14 -5
  222. package/src/functions/wirings/http/pikku-http-routes.ts +28 -2
  223. package/src/functions/wirings/http/serialize-http-types.ts +1 -1
  224. package/src/functions/wirings/mcp/pikku-command-mcp.ts +30 -4
  225. package/src/functions/wirings/mcp/serialize-mcp-types.ts +12 -12
  226. package/src/functions/wirings/middleware/pikku-command-middleware.ts +35 -2
  227. package/src/functions/wirings/middleware/serialize-middleware-groups-meta.ts +4 -19
  228. package/src/functions/wirings/permissions/pikku-command-permissions.ts +2 -2
  229. package/src/functions/wirings/queue/pikku-command-queue.ts +27 -2
  230. package/src/functions/wirings/queue/pikku-queue.ts +27 -2
  231. package/src/functions/wirings/queue/serialize-queue-meta.ts +15 -1
  232. package/src/functions/wirings/queue/serialize-queue-types.ts +1 -1
  233. package/src/functions/wirings/rpc/pikku-command-rpc.ts +25 -2
  234. package/src/functions/wirings/rpc/serialize-public-rpc.ts +11 -4
  235. package/src/functions/wirings/rpc/serialize-remote-rpc.ts +1 -1
  236. package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +3 -3
  237. package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +30 -4
  238. package/src/functions/wirings/scheduler/serialize-scheduler-meta.ts +20 -1
  239. package/src/functions/wirings/scheduler/serialize-scheduler-types.ts +1 -1
  240. package/src/functions/wirings/services/pikku-command-service-metadata.ts +25 -0
  241. package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +8 -1
  242. package/src/functions/wirings/workflow/pikku-command-workflow.ts +36 -8
  243. package/src/functions/wirings/workflow/serialize-workflow-meta.ts +18 -1
  244. package/src/functions/wirings/workflow/serialize-workflow-types.ts +39 -31
  245. package/src/functions/wirings/workflow/serialize-workflow-wirings.ts +47 -0
  246. package/src/functions/wirings/workflow/serialize-workflow-workers.ts +2 -2
  247. package/src/middleware/log-command-info-and-time.ts +3 -6
  248. package/src/services/cli-logger-forwarder.service.ts +11 -2
  249. package/src/services.ts +15 -15
  250. package/src/utils/check-required-types.ts +4 -7
  251. package/src/utils/pikku-cli-config.ts +69 -2
  252. package/src/utils/pikku-files-and-methods.ts +10 -13
  253. package/src/utils/schema-generator.ts +2 -2
  254. package/types/application-types.d.ts +1 -1
  255. package/types/config.d.ts +12 -1
  256. package/.pikku/function/pikku-functions.gen.ts +0 -84
  257. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +0 -47
  258. package/dist/.pikku/function/pikku-functions.gen.js +0 -83
  259. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +0 -1
  260. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +0 -47
  261. package/dist/.pikku/schemas/schemas/PikkuRemoteInternalRPCInput.schema.json +0 -1
  262. /package/dist/.pikku/{function/pikku-functions.gen.d.ts → cli/pikku-cli-channel.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /**
5
5
 
@@ -7,9 +7,8 @@
7
7
  */
8
8
 
9
9
  import { CoreChannel, wireChannel as wireChannelCore } from '@pikku/core/channel'
10
- import { CorePikkuFunctionConfig } from '@pikku/core'
11
10
  import { AssertHTTPWiringParams } from '@pikku/core/http'
12
- import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
11
+ import type { PikkuFunctionConfig, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
13
12
 
14
13
  /**
15
14
  * Type definition for WebSocket channels with typed data exchange.
@@ -22,9 +21,9 @@ import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMid
22
21
  type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<
23
22
  ChannelData,
24
23
  Channel,
25
- CorePikkuFunctionConfig<PikkuFunctionSessionless<void, any, ChannelData>, PikkuPermission<void>, PikkuMiddleware>,
26
- CorePikkuFunctionConfig<PikkuFunctionSessionless<void, void, ChannelData>, PikkuPermission<void>, PikkuMiddleware>,
27
- CorePikkuFunctionConfig<PikkuFunctionSessionless<any, any, ChannelData> | PikkuFunction<any, any, ChannelData>, PikkuPermission<any>, PikkuMiddleware>,
24
+ PikkuFunctionConfig<void, any, 'channel' | 'session' | 'rpc'>,
25
+ PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>,
26
+ PikkuFunctionConfig<any, any, 'channel' | 'session' | 'rpc'>,
28
27
  PikkuPermission,
29
28
  PikkuMiddleware
30
29
  >
@@ -39,8 +38,8 @@ type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<
39
38
  */
40
39
  export const pikkuChannelConnectionFunc = <Out = unknown>(
41
40
  func:
42
- | PikkuFunctionSessionless<void, Out, unknown>
43
- | CorePikkuFunctionConfig<PikkuFunctionSessionless<void, Out, unknown>, PikkuPermission<void>, PikkuMiddleware>
41
+ | PikkuFunctionSessionless<void, Out, 'channel' | 'session' | 'rpc'>
42
+ | PikkuFunctionConfig<void, Out, 'channel' | 'session' | 'rpc'>
44
43
  ) => {
45
44
  return typeof func === 'function' ? { func } : func
46
45
  }
@@ -54,8 +53,8 @@ export const pikkuChannelConnectionFunc = <Out = unknown>(
54
53
  */
55
54
  export const pikkuChannelDisconnectionFunc = (
56
55
  func:
57
- | PikkuFunctionSessionless<void, void, unknown>
58
- | CorePikkuFunctionConfig<PikkuFunctionSessionless<void, void, unknown>, PikkuPermission<void>, PikkuMiddleware>
56
+ | PikkuFunctionSessionless<void, void, 'channel'>
57
+ | PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>
59
58
  ) => {
60
59
  return typeof func === 'function' ? { func } : func
61
60
  }
@@ -72,8 +71,8 @@ export const pikkuChannelDisconnectionFunc = (
72
71
  */
73
72
  export const pikkuChannelFunc = <In, Out = unknown>(
74
73
  func:
75
- | PikkuFunctionSessionless<In, Out, unknown>
76
- | CorePikkuFunctionConfig<PikkuFunctionSessionless<In, Out, unknown>, PikkuPermission<In>, PikkuMiddleware>
74
+ | PikkuFunctionSessionless<In, Out, 'channel' | 'session' | 'rpc'>
75
+ | PikkuFunctionConfig<In, Out, 'channel' | 'session' | 'rpc'>
77
76
  ) => {
78
77
  return typeof func === 'function' ? { func } : func
79
78
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /**
5
5
  * This provides the structure needed for TypeScript to be aware of channels
@@ -9,20 +9,20 @@
9
9
 
10
10
  // Custom types are those that are defined directly within generics
11
11
  // or are broken into simpler types
12
- export type PikkuChannelsOutput = false | true
13
- export type PikkuCLIOutput = false | true
14
- export type PikkuFunctionsOutput = false | true
15
12
  export type PikkuSchemasOutput = false | true
16
- export type PikkuHTTPOutput = false | true
17
- export type PikkuMCPOutput = false | true
13
+ export type PikkuFunctionsOutput = false | true
18
14
  export type PikkuMiddlewareOutput = false | true
19
15
  export type PikkuPermissionsOutput = false | true
20
- export type PikkuQueueOutput = false | true
21
- export type PikkuPublicRPCOutput = false | true
22
- export type PikkuRemoteRPCOutput = false | true
23
16
  export type PikkuRPCOutput = false | true
17
+ export type PikkuPublicRPCOutput = false | true
18
+ export type PikkuHTTPOutput = false | true
24
19
  export type PikkuSchedulerOutput = false | true
25
20
  export type PikkuWorkflowOutput = false | true
21
+ export type PikkuRemoteRPCOutput = false | true
22
+ export type PikkuQueueOutput = false | true
23
+ export type PikkuChannelsOutput = false | true
24
+ export type PikkuMCPOutput = false | true
25
+ export type PikkuCLIOutput = false | true
26
26
 
27
27
  interface ChannelHandler<I, O> {
28
28
  input: I;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  import { pikkuState } from '@pikku/core'
5
5
  pikkuState('channel', 'meta', {})
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /* The files with an addChannel function call */
@@ -0,0 +1,92 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.11.2
3
+ */
4
+ /**
5
+ * WebSocket channel backend for 'pikku' CLI commands
6
+ */
7
+ import { wireChannel } from '../channel/pikku-channel-types.gen.js'
8
+ import { pikkuMiddleware } from '../function/pikku-function-types.gen.js'
9
+ import { all } from '../../src/functions/commands/all.js'
10
+ import { bootstrap } from '../../src/functions/commands/bootstrap.js'
11
+ import { watch } from '../../src/functions/commands/watch.js'
12
+ import { pikkuSchemas } from '../../src/functions/wirings/functions/schemas.js'
13
+ import { pikkuFetch } from '../../src/functions/wirings/fetch/index.js'
14
+ import { pikkuWebSocketTyped } from '../../src/functions/wirings/channels/pikku-command-websocket-typed.js'
15
+ import { pikkuRPCClient } from '../../src/functions/wirings/rpc/pikku-command-rpc-client.js'
16
+ import { pikkuQueueService } from '../../src/functions/wirings/queue/pikku-command-queue-service.js'
17
+ import { pikkuOpenAPI } from '../../src/functions/wirings/http/pikku-command-openapi.js'
18
+ import { pikkuNext } from '../../src/functions/runtimes/nextjs/pikku-command-nextjs.js'
19
+
20
+ // Middleware to close the channel after CLI command completes
21
+ const cliCloseOnComplete = pikkuMiddleware(async (_services, { channel }, next) => {
22
+ const closeChannel = () => {
23
+ setTimeout(async () => {
24
+ try {
25
+ // This gives time for the response to be sent before closing
26
+ await channel?.close()
27
+ } catch (err) {
28
+ // Ignore errors on close
29
+ }
30
+ }, 200)
31
+ }
32
+
33
+ try {
34
+ const result = await next()
35
+ closeChannel()
36
+ return result
37
+ } catch (error) {
38
+ closeChannel()
39
+ throw error
40
+ }
41
+ })
42
+
43
+ wireChannel({
44
+ name: 'pikku-cli',
45
+ route: '/cli/pikku',
46
+ auth: false,
47
+ onMessageWiring: {
48
+ command: {
49
+ 'all': {
50
+ func: all,
51
+ middleware: [cliCloseOnComplete],
52
+ },
53
+ 'bootstrap': {
54
+ func: bootstrap,
55
+ middleware: [cliCloseOnComplete],
56
+ },
57
+ 'watch': {
58
+ func: watch,
59
+ middleware: [cliCloseOnComplete],
60
+ },
61
+ 'schemas': {
62
+ func: pikkuSchemas,
63
+ middleware: [cliCloseOnComplete],
64
+ },
65
+ 'fetch': {
66
+ func: pikkuFetch,
67
+ middleware: [cliCloseOnComplete],
68
+ },
69
+ 'websocket': {
70
+ func: pikkuWebSocketTyped,
71
+ middleware: [cliCloseOnComplete],
72
+ },
73
+ 'rpc': {
74
+ func: pikkuRPCClient,
75
+ middleware: [cliCloseOnComplete],
76
+ },
77
+ 'queue-service': {
78
+ func: pikkuQueueService,
79
+ middleware: [cliCloseOnComplete],
80
+ },
81
+ 'openapi': {
82
+ func: pikkuOpenAPI,
83
+ middleware: [cliCloseOnComplete],
84
+ },
85
+ 'nextjs': {
86
+ func: pikkuNext,
87
+ middleware: [cliCloseOnComplete],
88
+ }
89
+ }
90
+ },
91
+ tags: ['cli', 'pikku']
92
+ })
@@ -0,0 +1,54 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.11.2
3
+ */
4
+
5
+ import { executeCLIViaChannel } from '@pikku/core/cli/channel'
6
+ import { CorePikkuWebsocket } from '@pikku/websocket'
7
+ import '../pikku-bootstrap.gen.js'
8
+
9
+ /**
10
+ * Pikku CLI Client (via WebSocket Channel)
11
+ * Executes CLI commands over a WebSocket connection
12
+ */
13
+ export async function PikkuCLIClient(
14
+ ws: WebSocket,
15
+ args?: string[]
16
+ ): Promise<void> {
17
+ // Create Pikku WebSocket wrapper
18
+ const pikkuWS = new CorePikkuWebsocket(ws)
19
+
20
+ // Register renderers for CLI commands
21
+ const renderers = {}
22
+
23
+ await executeCLIViaChannel({
24
+ programName: 'pikku',
25
+ pikkuWS,
26
+ args,
27
+ renderers,
28
+ })
29
+ }
30
+
31
+ // Export as default for easy importing
32
+ export default PikkuCLIClient
33
+
34
+ // For direct execution (if this file is run directly)
35
+ if (import.meta.url === `file://${process.argv[1]}`) {
36
+ const url = process.env.PIKKU_WS_URL || 'ws://localhost:4002/cli/pikku'
37
+
38
+ // Create WebSocket instance
39
+ let WebSocketImpl: any
40
+ if (typeof WebSocket !== 'undefined') {
41
+ WebSocketImpl = WebSocket
42
+ } else {
43
+ // Node.js environment - dynamically import 'ws'
44
+ const wsModule = await import('ws')
45
+ WebSocketImpl = wsModule.default
46
+ }
47
+
48
+ const ws = new WebSocketImpl(url) as WebSocket
49
+ PikkuCLIClient(ws, process.argv.slice(2)).catch(error => {
50
+ console.error('Fatal channel CLI error:', error)
51
+ // TODO: We get an error code even when it exists cleanly, investigate
52
+ // process.exit(1)
53
+ })
54
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /**
5
5
 
@@ -49,7 +49,7 @@ export const pikkuCLIRender = <Data, RequiredServices extends SingletonServices
49
49
  * CLI command configuration with project-specific types.
50
50
  * Uses CoreCLICommandConfig from @pikku/core with local middleware and render types.
51
51
  */
52
- type CLICommandConfig<Func extends PikkuFunctionConfig<In, Out>, In = any, Out = any, Params extends string = string> = CoreCLICommandConfig<Func, PikkuMiddleware, PikkuCLIRender<any>, Params>
52
+ type CLICommandConfig<Func extends PikkuFunctionConfig<In, Out, 'cli' | 'rpc' | 'session'>, In = any, Out = any, Params extends string = string> = CoreCLICommandConfig<Func, PikkuMiddleware, PikkuCLIRender<any>, Params>
53
53
 
54
54
  /**
55
55
  * Type definition for CLI applications with commands and global options.
@@ -83,7 +83,7 @@ export const wireCLI = <Commands extends Record<string, CoreCLICommandConfig<any
83
83
  * @returns CLI command configuration with inferred types
84
84
  */
85
85
  export const pikkuCLICommand = <
86
- FuncConfig extends PikkuFunctionConfig<any, any>,
86
+ FuncConfig extends PikkuFunctionConfig<any, any, 'cli' | 'rpc' | 'session'>,
87
87
  Params extends string
88
88
  >(
89
89
  config: CLICommandConfig<FuncConfig, any, any, Params>
@@ -0,0 +1,146 @@
1
+ {
2
+ "programs": {
3
+ "pikku": {
4
+ "program": "pikku",
5
+ "commands": {
6
+ "all": {
7
+ "pikkuFuncName": "all",
8
+ "positionals": [],
9
+ "options": {
10
+ "tags": {
11
+ "description": "Filter functions by tags (comma-separated)",
12
+ "short": "t"
13
+ },
14
+ "types": {
15
+ "description": "Filter functions by types (comma-separated)"
16
+ },
17
+ "directories": {
18
+ "description": "Filter functions by directories (comma-separated)",
19
+ "short": "d"
20
+ },
21
+ "httpMethods": {
22
+ "description": "Filter HTTP routes by methods (comma-separated)"
23
+ },
24
+ "httpRoutes": {
25
+ "description": "Filter HTTP routes by route patterns (comma-separated)"
26
+ },
27
+ "names": {
28
+ "description": "Filter functions by name patterns (supports wildcards)",
29
+ "short": "n"
30
+ }
31
+ },
32
+ "description": "Generate all Pikku files (types, schemas, wirings, etc.)",
33
+ "isDefault": true
34
+ },
35
+ "bootstrap": {
36
+ "pikkuFuncName": "bootstrap",
37
+ "positionals": [],
38
+ "options": {},
39
+ "description": "Generate only type files (setup phase only)"
40
+ },
41
+ "watch": {
42
+ "pikkuFuncName": "watch",
43
+ "positionals": [],
44
+ "options": {},
45
+ "description": "Watch for file changes and regenerate automatically"
46
+ },
47
+ "schemas": {
48
+ "pikkuFuncName": "pikkuSchemas",
49
+ "positionals": [],
50
+ "options": {},
51
+ "description": "Generate JSON schemas for function input/output types"
52
+ },
53
+ "fetch": {
54
+ "pikkuFuncName": "pikkuFetch",
55
+ "positionals": [],
56
+ "options": {},
57
+ "description": "Generate type-safe HTTP fetch client"
58
+ },
59
+ "websocket": {
60
+ "pikkuFuncName": "pikkuWebSocketTyped",
61
+ "positionals": [],
62
+ "options": {},
63
+ "description": "Generate type-safe WebSocket client"
64
+ },
65
+ "rpc": {
66
+ "pikkuFuncName": "pikkuRPCClient",
67
+ "positionals": [],
68
+ "options": {},
69
+ "description": "Generate RPC client wrappers"
70
+ },
71
+ "queue-service": {
72
+ "pikkuFuncName": "pikkuQueueService",
73
+ "positionals": [],
74
+ "options": {},
75
+ "description": "Generate queue service wrapper"
76
+ },
77
+ "openapi": {
78
+ "pikkuFuncName": "pikkuOpenAPI",
79
+ "positionals": [],
80
+ "options": {},
81
+ "description": "Generate OpenAPI specification from HTTP routes"
82
+ },
83
+ "nextjs": {
84
+ "pikkuFuncName": "pikkuNext",
85
+ "positionals": [],
86
+ "options": {},
87
+ "description": "Generate Next.js backend and HTTP wrappers"
88
+ }
89
+ },
90
+ "options": {
91
+ "config": {
92
+ "description": "Path to pikku.config.json file",
93
+ "short": "c"
94
+ },
95
+ "logLevel": {
96
+ "description": "Set log level",
97
+ "short": "l",
98
+ "choices": [
99
+ "trace",
100
+ "debug",
101
+ "info",
102
+ "warn",
103
+ "error",
104
+ "critical"
105
+ ]
106
+ },
107
+ "userSessionType": {
108
+ "description": "Specify which UserSession type to use (when multiple exist)"
109
+ },
110
+ "singletonServicesFactoryType": {
111
+ "description": "Specify which singleton services factory to use"
112
+ },
113
+ "wireServicesFactoryType": {
114
+ "description": "Specify which wire services factory to use"
115
+ },
116
+ "stateOutput": {
117
+ "description": "Save inspector state to JSON file for reuse"
118
+ },
119
+ "stateInput": {
120
+ "description": "Load inspector state from JSON file (skips inspection)"
121
+ }
122
+ }
123
+ }
124
+ },
125
+ "renderers": {
126
+ "defaultCLIRenderer": {
127
+ "name": "defaultCLIRenderer",
128
+ "exportedName": "defaultCLIRenderer",
129
+ "services": {
130
+ "optimized": true,
131
+ "services": [
132
+ "logger",
133
+ "getInspectorState",
134
+ "schema",
135
+ "jwt",
136
+ "config",
137
+ "variables",
138
+ "workflowService",
139
+ "queueService",
140
+ "schedulerService"
141
+ ]
142
+ },
143
+ "filePath": "src/services.ts"
144
+ }
145
+ }
146
+ }
@@ -1,37 +1,7 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  import { pikkuState } from '@pikku/core'
5
- pikkuState('cli', 'meta', {
6
- "programs": {},
7
- "renderers": {
8
- "defaultCLIRenderer": {
9
- "name": "defaultCLIRenderer",
10
- "exportedName": "defaultCLIRenderer",
11
- "services": {
12
- "optimized": true,
13
- "services": [
14
- "logger",
15
- "getInspectorState",
16
- "schema",
17
- "jwt",
18
- "config",
19
- "variables",
20
- "workflowService",
21
- "queueService",
22
- "schedulerService"
23
- ]
24
- },
25
- "filePath": "src/services.ts"
26
- },
27
- "clientCLIRenderer": {
28
- "name": "clientCLIRenderer",
29
- "exportedName": "clientCLIRenderer",
30
- "services": {
31
- "optimized": true,
32
- "services": []
33
- },
34
- "filePath": "src/services.ts"
35
- }
36
- }
37
- })
5
+ import { CLIMeta } from '@pikku/core/cli'
6
+ import metaData from './pikku-cli-wirings-meta.gen.json' with { type: 'json' }
7
+ pikkuState('cli', 'meta', metaData as CLIMeta)
@@ -1,5 +1,6 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /* The files with an wireCLI function call */
5
+ import '../../src/cli.wiring.js'
5
6
  import '../../src/services.js'
@@ -0,0 +1,41 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.11.2
3
+ */
4
+
5
+ import { executeCLI, CLIError } from '@pikku/core/cli'
6
+ import { createConfig as createConfig } from '../../src/services.js'
7
+ import { createSingletonServices as createSingletonServices } from '../../src/services.js'
8
+ import { createWireServices as createWireServices } from '../../src/services.js'
9
+ import '../pikku-bootstrap.gen.js'
10
+
11
+ /**
12
+ * Pikku CLI function
13
+ * Handles command line arguments and executes the appropriate function
14
+ */
15
+ export async function PikkuCLI(args: string[]): Promise<void> {
16
+ try {
17
+ await executeCLI({
18
+ programName: 'pikku',
19
+ args: args || process.argv.slice(2),
20
+ createConfig,
21
+ createSingletonServices,
22
+ createWireServices,
23
+ })
24
+ } catch (error) {
25
+ if (error instanceof CLIError) {
26
+ process.exit(error.exitCode)
27
+ }
28
+ throw error
29
+ }
30
+ }
31
+
32
+ // Export as default for easy importing
33
+ export default PikkuCLI
34
+
35
+ // For direct execution (if this file is run directly)
36
+ if (import.meta.url === `file://${process.argv[1]}`) {
37
+ PikkuCLI(process.argv.slice(2)).catch(error => {
38
+ console.error('Fatal error:', error.message)
39
+ process.exit(1)
40
+ })
41
+ }