@pikku/cli 0.9.16-next.0 → 0.10.0

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 (266) hide show
  1. package/.pikku/channel/pikku-channel-types.gen.ts +28 -29
  2. package/.pikku/channel/pikku-channels-map.gen.d.ts +44 -0
  3. package/.pikku/channel/pikku-channels-meta.gen.ts +5 -0
  4. package/.pikku/channel/pikku-channels.gen.ts +4 -0
  5. package/.pikku/cli/pikku-cli-channel.gen.ts +34 -0
  6. package/.pikku/cli/pikku-cli-client.gen.ts +43 -0
  7. package/.pikku/cli/pikku-cli-types.gen.ts +14 -15
  8. package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +142 -2
  9. package/.pikku/cli/pikku-cli-wirings.gen.ts +4 -2
  10. package/.pikku/cli/pikku-cli.gen.ts +41 -0
  11. package/.pikku/function/pikku-function-types.gen.ts +167 -19
  12. package/.pikku/function/pikku-functions-meta.gen.ts +220 -192
  13. package/.pikku/function/pikku-functions-meta.min.gen.ts +61 -56
  14. package/.pikku/function/pikku-functions.gen.ts +3 -1
  15. package/.pikku/http/pikku-http-types.gen.ts +28 -3
  16. package/.pikku/http/pikku-http-wirings-map.gen.d.ts +43 -0
  17. package/.pikku/http/pikku-http-wirings-meta.gen.ts +13 -0
  18. package/.pikku/http/pikku-http-wirings.gen.ts +4 -0
  19. package/.pikku/mcp/pikku-mcp-types.gen.ts +15 -13
  20. package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +7 -0
  21. package/.pikku/mcp/pikku-mcp-wirings.gen.ts +4 -0
  22. package/.pikku/mcp/pikku-mcp.gen.json +5 -0
  23. package/.pikku/pikku-bootstrap.gen.ts +11 -1
  24. package/.pikku/pikku-services.gen.ts +1 -5
  25. package/.pikku/pikku-types.gen.ts +1 -2
  26. package/.pikku/pikku-websocket.gen.ts +76 -0
  27. package/.pikku/queue/pikku-queue-types.gen.ts +1 -2
  28. package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +57 -0
  29. package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +5 -0
  30. package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +4 -0
  31. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +5 -4
  32. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +19 -17
  33. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +15 -14
  34. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -2
  35. package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +5 -0
  36. package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +4 -0
  37. package/.pikku/schemas/register.gen.ts +15 -11
  38. package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  39. package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  40. package/.pikku/schemas/schemas/PikkuPermissionsOutput.schema.json +1 -0
  41. package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  42. package/CHANGELOG.md +6 -0
  43. package/bin/pikku.ts +63 -11
  44. package/build.sh +1 -1
  45. package/cli.schema.json +1 -1
  46. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +11 -20
  47. package/dist/.pikku/channel/pikku-channel-types.gen.js +9 -11
  48. package/dist/.pikku/channel/pikku-channels-meta.gen.d.ts +1 -0
  49. package/dist/.pikku/channel/pikku-channels-meta.gen.js +5 -0
  50. package/dist/.pikku/channel/pikku-channels.gen.d.ts +4 -0
  51. package/dist/.pikku/channel/pikku-channels.gen.js +5 -0
  52. package/dist/.pikku/cli/pikku-cli-channel.gen.d.ts +1 -0
  53. package/dist/.pikku/cli/pikku-cli-channel.gen.js +33 -0
  54. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +10 -0
  55. package/dist/.pikku/cli/pikku-cli-client.gen.js +34 -0
  56. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +9 -12
  57. package/dist/.pikku/cli/pikku-cli-types.gen.js +5 -4
  58. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +142 -2
  59. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +3 -2
  60. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +4 -3
  61. package/dist/.pikku/cli/pikku-cli.gen.d.ts +10 -0
  62. package/dist/.pikku/cli/pikku-cli.gen.js +38 -0
  63. package/dist/.pikku/function/pikku-function-types.gen.d.ts +141 -20
  64. package/dist/.pikku/function/pikku-function-types.gen.js +108 -12
  65. package/dist/.pikku/function/pikku-functions-meta.gen.js +220 -192
  66. package/dist/.pikku/function/pikku-functions-meta.min.gen.js +61 -56
  67. package/dist/.pikku/function/pikku-functions.gen.js +3 -1
  68. package/dist/.pikku/http/pikku-http-types.gen.d.ts +21 -2
  69. package/dist/.pikku/http/pikku-http-types.gen.js +24 -3
  70. package/dist/.pikku/http/pikku-http-wirings-meta.gen.d.ts +1 -0
  71. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +13 -0
  72. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +4 -0
  73. package/dist/.pikku/http/pikku-http-wirings.gen.js +5 -0
  74. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +11 -8
  75. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +6 -6
  76. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.d.ts +1 -0
  77. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +7 -0
  78. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +4 -0
  79. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +5 -0
  80. package/dist/.pikku/pikku-bootstrap.gen.d.ts +11 -1
  81. package/dist/.pikku/pikku-bootstrap.gen.js +11 -1
  82. package/dist/.pikku/pikku-services.gen.d.ts +1 -4
  83. package/dist/.pikku/pikku-services.gen.js +0 -6
  84. package/dist/.pikku/pikku-types.gen.d.ts +1 -2
  85. package/dist/.pikku/pikku-types.gen.js +1 -2
  86. package/dist/.pikku/pikku-websocket.gen.d.ts +31 -0
  87. package/dist/.pikku/pikku-websocket.gen.js +49 -0
  88. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -2
  89. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -2
  90. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.d.ts +1 -0
  91. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +5 -0
  92. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +4 -0
  93. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +5 -0
  94. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +15 -14
  95. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -2
  96. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -2
  97. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.d.ts +1 -0
  98. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +5 -0
  99. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +4 -0
  100. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +5 -0
  101. package/dist/.pikku/schemas/register.gen.js +9 -7
  102. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  103. package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  104. package/dist/.pikku/schemas/schemas/PikkuPermissionsOutput.schema.json +1 -0
  105. package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  106. package/dist/bin/pikku.d.ts +1 -1
  107. package/dist/bin/pikku.js +37 -6
  108. package/dist/src/cli.wiring.js +99 -75
  109. package/dist/src/functions/commands/all.js +10 -0
  110. package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +10 -8
  111. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.d.ts +1 -1
  112. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +2 -2
  113. package/dist/src/functions/wirings/channels/pikku-channels.js +0 -5
  114. package/dist/src/functions/wirings/channels/pikku-command-channel-types.js +0 -2
  115. package/dist/src/functions/wirings/channels/pikku-command-channels-map.js +0 -5
  116. package/dist/src/functions/wirings/channels/pikku-command-channels.js +0 -5
  117. package/dist/src/functions/wirings/channels/pikku-command-websocket-typed.js +6 -3
  118. package/dist/src/functions/wirings/channels/serialize-channel-types.js +27 -28
  119. package/dist/src/functions/wirings/channels/serialize-typed-channel-map.js +4 -1
  120. package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +31 -8
  121. package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +0 -2
  122. package/dist/src/functions/wirings/cli/pikku-command-cli.js +0 -2
  123. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.d.ts +6 -2
  124. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +88 -11
  125. package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +1 -1
  126. package/dist/src/functions/wirings/cli/serialize-channel-cli.js +1 -18
  127. package/dist/src/functions/wirings/cli/serialize-cli-types.js +13 -14
  128. package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +19 -14
  129. package/dist/src/functions/wirings/fetch/index.js +6 -3
  130. package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +6 -5
  131. package/dist/src/functions/wirings/functions/pikku-command-function-types.js +0 -2
  132. package/dist/src/functions/wirings/functions/pikku-command-functions.js +0 -2
  133. package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
  134. package/dist/src/functions/wirings/functions/pikku-command-services.js +11 -21
  135. package/dist/src/functions/wirings/functions/pikku-function-types.js +0 -2
  136. package/dist/src/functions/wirings/functions/schemas.js +0 -2
  137. package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
  138. package/dist/src/functions/wirings/functions/serialize-function-types.js +167 -19
  139. package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.js +0 -1
  140. package/dist/src/functions/wirings/http/openapi-spec-generator.d.ts +2 -1
  141. package/dist/src/functions/wirings/http/pikku-command-http-map.js +0 -5
  142. package/dist/src/functions/wirings/http/pikku-command-http-routes.js +0 -5
  143. package/dist/src/functions/wirings/http/pikku-command-http-types.js +0 -2
  144. package/dist/src/functions/wirings/http/pikku-command-openapi.js +7 -4
  145. package/dist/src/functions/wirings/http/pikku-http-routes.js +0 -5
  146. package/dist/src/functions/wirings/http/serialize-http-types.js +27 -2
  147. package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.js +0 -5
  148. package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.js +0 -2
  149. package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +0 -5
  150. package/dist/src/functions/wirings/mcp/serialize-mcp-json.d.ts +1 -1
  151. package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +14 -12
  152. package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +0 -2
  153. package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.js +1 -7
  154. package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -0
  155. package/dist/src/functions/wirings/permissions/pikku-command-permissions.js +28 -0
  156. package/dist/src/functions/wirings/permissions/serialize-permissions-imports.d.ts +2 -0
  157. package/dist/src/functions/wirings/permissions/serialize-permissions-imports.js +43 -0
  158. package/dist/src/functions/wirings/queue/pikku-command-queue-map.js +0 -5
  159. package/dist/src/functions/wirings/queue/pikku-command-queue-service.js +6 -3
  160. package/dist/src/functions/wirings/queue/pikku-command-queue-types.js +0 -2
  161. package/dist/src/functions/wirings/queue/pikku-command-queue.js +0 -5
  162. package/dist/src/functions/wirings/queue/pikku-queue-map.js +0 -5
  163. package/dist/src/functions/wirings/queue/pikku-queue.js +1 -5
  164. package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +1 -1
  165. package/dist/src/functions/wirings/queue/serialize-queue-types.js +0 -1
  166. package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.js +5 -3
  167. package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.js +0 -4
  168. package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +0 -2
  169. package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.js +0 -2
  170. package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +0 -5
  171. package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +0 -1
  172. package/dist/src/middleware/log-command-info-and-time.d.ts +2 -8
  173. package/dist/src/middleware/log-command-info-and-time.js +2 -14
  174. package/dist/src/services/cli-logger-forwarder.service.d.ts +6 -2
  175. package/dist/src/services/cli-logger-forwarder.service.js +9 -0
  176. package/dist/src/services/cli-logger.service.d.ts +4 -0
  177. package/dist/src/services/cli-logger.service.js +11 -0
  178. package/dist/src/services.d.ts +5 -0
  179. package/dist/src/services.js +111 -13
  180. package/dist/src/utils/custom-types-generator.js +8 -2
  181. package/dist/src/utils/file-writer.d.ts +4 -1
  182. package/dist/src/utils/file-writer.js +13 -3
  183. package/dist/src/utils/get-cli-version.d.ts +5 -0
  184. package/dist/src/utils/get-cli-version.js +27 -0
  185. package/dist/src/utils/pikku-cli-config.d.ts +1 -2
  186. package/dist/src/utils/pikku-cli-config.js +9 -28
  187. package/dist/src/utils/schema-generator.js +3 -2
  188. package/dist/src/utils/serialize-import-map.js +0 -3
  189. package/dist/tsconfig.tsbuildinfo +1 -1
  190. package/package.json +10 -8
  191. package/pikku.config.json +4 -2
  192. package/src/cli.wiring.ts +101 -74
  193. package/src/functions/commands/all.ts +12 -0
  194. package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +12 -12
  195. package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +2 -2
  196. package/src/functions/wirings/channels/pikku-channels.ts +0 -5
  197. package/src/functions/wirings/channels/pikku-command-channel-types.ts +0 -2
  198. package/src/functions/wirings/channels/pikku-command-channels-map.ts +0 -5
  199. package/src/functions/wirings/channels/pikku-command-channels.ts +0 -5
  200. package/src/functions/wirings/channels/pikku-command-websocket-typed.ts +7 -3
  201. package/src/functions/wirings/channels/serialize-channel-types.ts +27 -28
  202. package/src/functions/wirings/channels/serialize-typed-channel-map.ts +4 -1
  203. package/src/functions/wirings/cli/pikku-command-cli-entry.ts +52 -9
  204. package/src/functions/wirings/cli/pikku-command-cli-types.ts +0 -2
  205. package/src/functions/wirings/cli/pikku-command-cli.ts +0 -2
  206. package/src/functions/wirings/cli/serialize-channel-cli-client.ts +111 -12
  207. package/src/functions/wirings/cli/serialize-channel-cli.ts +2 -23
  208. package/src/functions/wirings/cli/serialize-cli-types.ts +13 -14
  209. package/src/functions/wirings/cli/serialize-local-cli-bootstrap.ts +19 -14
  210. package/src/functions/wirings/fetch/index.ts +7 -3
  211. package/src/functions/wirings/functions/pikku-command-function-types-split.ts +14 -5
  212. package/src/functions/wirings/functions/pikku-command-function-types.ts +0 -2
  213. package/src/functions/wirings/functions/pikku-command-functions.ts +0 -2
  214. package/src/functions/wirings/functions/pikku-command-services.ts +13 -24
  215. package/src/functions/wirings/functions/pikku-function-types.ts +0 -2
  216. package/src/functions/wirings/functions/schemas.ts +0 -2
  217. package/src/functions/wirings/functions/serialize-function-types.ts +169 -19
  218. package/src/functions/wirings/functions/serialize-pikku-types-hub.ts +0 -1
  219. package/src/functions/wirings/http/openapi-spec-generator.ts +2 -1
  220. package/src/functions/wirings/http/pikku-command-http-map.ts +0 -5
  221. package/src/functions/wirings/http/pikku-command-http-routes.ts +0 -5
  222. package/src/functions/wirings/http/pikku-command-http-types.ts +0 -2
  223. package/src/functions/wirings/http/pikku-command-openapi.ts +9 -4
  224. package/src/functions/wirings/http/pikku-http-routes.ts +0 -5
  225. package/src/functions/wirings/http/serialize-http-types.ts +27 -2
  226. package/src/functions/wirings/mcp/pikku-command-mcp-json.ts +0 -5
  227. package/src/functions/wirings/mcp/pikku-command-mcp-types.ts +0 -2
  228. package/src/functions/wirings/mcp/pikku-command-mcp.ts +0 -5
  229. package/src/functions/wirings/mcp/serialize-mcp-json.ts +1 -1
  230. package/src/functions/wirings/mcp/serialize-mcp-types.ts +14 -12
  231. package/src/functions/wirings/middleware/pikku-command-middleware.ts +0 -2
  232. package/src/functions/wirings/middleware/serialize-middleware-groups-meta.ts +1 -7
  233. package/src/functions/wirings/permissions/pikku-command-permissions.ts +49 -0
  234. package/src/functions/wirings/permissions/serialize-permissions-imports.test.ts +274 -0
  235. package/src/functions/wirings/permissions/serialize-permissions-imports.ts +78 -0
  236. package/src/functions/wirings/queue/pikku-command-queue-map.ts +0 -5
  237. package/src/functions/wirings/queue/pikku-command-queue-service.ts +7 -3
  238. package/src/functions/wirings/queue/pikku-command-queue-types.ts +0 -2
  239. package/src/functions/wirings/queue/pikku-command-queue.ts +0 -5
  240. package/src/functions/wirings/queue/pikku-queue-map.ts +0 -5
  241. package/src/functions/wirings/queue/pikku-queue.ts +3 -6
  242. package/src/functions/wirings/queue/serialize-queue-meta.ts +1 -1
  243. package/src/functions/wirings/queue/serialize-queue-types.ts +0 -1
  244. package/src/functions/wirings/rpc/pikku-command-rpc-client.ts +6 -3
  245. package/src/functions/wirings/rpc/pikku-command-rpc-map.ts +0 -4
  246. package/src/functions/wirings/rpc/pikku-command-rpc.ts +0 -2
  247. package/src/functions/wirings/scheduler/pikku-command-scheduler-types.ts +0 -2
  248. package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +0 -5
  249. package/src/functions/wirings/scheduler/serialize-scheduler-types.ts +0 -1
  250. package/src/middleware/log-command-info-and-time.ts +2 -28
  251. package/src/services/cli-logger-forwarder.service.ts +15 -2
  252. package/src/services/cli-logger.service.ts +15 -0
  253. package/src/services.ts +148 -19
  254. package/src/utils/custom-types-generator.ts +8 -2
  255. package/src/utils/file-writer.ts +19 -3
  256. package/src/utils/get-cli-version.ts +28 -0
  257. package/src/utils/pikku-cli-config.ts +6 -35
  258. package/src/utils/schema-generator.ts +7 -3
  259. package/src/utils/serialize-import-map.ts +0 -4
  260. package/types/application-types.d.ts +4 -1
  261. package/types/config.d.ts +15 -3
  262. package/dist/.pikku/rpc/pikku-bootstrap-rpc.gen.d.ts +0 -6
  263. package/dist/.pikku/rpc/pikku-bootstrap-rpc.gen.js +0 -6
  264. package/dist/src/serialize-pikku-types.d.ts +0 -4
  265. package/dist/src/serialize-pikku-types.js +0 -605
  266. package/src/serialize-pikku-types.ts +0 -613
@@ -1,40 +1,41 @@
1
1
  /**
2
- * This file was generated by the @pikku/cli
2
+ * This file was generated by @pikku/cli@0.10.0
3
3
  */
4
4
  import { pikkuState } from '@pikku/core';
5
5
  pikkuState('rpc', 'meta', {
6
+ "pikkuSchemas": "pikkuSchemas",
7
+ "pikkuFetch": "pikkuFetch",
8
+ "pikkuWebSocketTyped": "pikkuWebSocketTyped",
9
+ "pikkuRPCClient": "pikkuRPCClient",
10
+ "pikkuQueueService": "pikkuQueueService",
11
+ "pikkuOpenAPI": "pikkuOpenAPI",
12
+ "pikkuNext": "pikkuNext",
6
13
  "all": "all",
7
14
  "watch": "watch",
8
- "pikkuNext": "pikkuNext",
9
15
  "pikkuChannels": "pikkuChannels",
10
16
  "pikkuChannelTypes": "pikkuChannelTypes",
11
17
  "pikkuChannelsMap": "pikkuChannelsMap",
12
- "pikkuWebSocketTyped": "pikkuWebSocketTyped",
13
18
  "pikkuCLIEntry": "pikkuCLIEntry",
14
19
  "pikkuCLITypes": "pikkuCLITypes",
15
20
  "pikkuCLI": "pikkuCLI",
16
- "pikkuFetch": "pikkuFetch",
17
21
  "pikkuFunctionTypesSplit": "pikkuFunctionTypesSplit",
18
22
  "pikkuFunctionTypes": "pikkuFunctionTypes",
19
23
  "pikkuFunctions": "pikkuFunctions",
20
24
  "pikkuServices": "pikkuServices",
21
- "pikkuSchemas": "pikkuSchemas",
22
- "pikkuMCPJSON": "pikkuMCPJSON",
23
- "pikkuMCPTypes": "pikkuMCPTypes",
24
- "pikkuMCP": "pikkuMCP",
25
25
  "pikkuHTTPMap": "pikkuHTTPMap",
26
26
  "pikkuHTTP": "pikkuHTTP",
27
27
  "pikkuHTTPTypes": "pikkuHTTPTypes",
28
- "pikkuOpenAPI": "pikkuOpenAPI",
28
+ "pikkuMCPJSON": "pikkuMCPJSON",
29
+ "pikkuMCPTypes": "pikkuMCPTypes",
30
+ "pikkuMCP": "pikkuMCP",
29
31
  "pikkuMiddleware": "pikkuMiddleware",
30
- "pikkuRPCClient": "pikkuRPCClient",
31
- "pikkuRPCInternalMap": "pikkuRPCInternalMap",
32
- "pikkuRPCExposedMap": "pikkuRPCExposedMap",
33
- "pikkuRPC": "pikkuRPC",
32
+ "pikkuPermissions": "pikkuPermissions",
34
33
  "pikkuQueueMap": "pikkuQueueMap",
35
- "pikkuQueueService": "pikkuQueueService",
36
34
  "pikkuQueueTypes": "pikkuQueueTypes",
37
35
  "pikkuQueue": "pikkuQueue",
36
+ "pikkuRPCInternalMap": "pikkuRPCInternalMap",
37
+ "pikkuRPCExposedMap": "pikkuRPCExposedMap",
38
+ "pikkuRPC": "pikkuRPC",
38
39
  "pikkuSchedulerTypes": "pikkuSchedulerTypes",
39
40
  "pikkuScheduler": "pikkuScheduler"
40
41
  });
@@ -1,8 +1,7 @@
1
1
  /**
2
- * This file was generated by the @pikku/cli
2
+ * This file was generated by @pikku/cli@0.10.0
3
3
  */
4
4
  /**
5
- * This file was generated by the @pikku/cli
6
5
  * Scheduler-specific type definitions for tree-shaking optimization
7
6
  */
8
7
  import { CoreScheduledTask } from '@pikku/core/scheduler';
@@ -1,8 +1,7 @@
1
1
  /**
2
- * This file was generated by the @pikku/cli
2
+ * This file was generated by @pikku/cli@0.10.0
3
3
  */
4
4
  /**
5
- * This file was generated by the @pikku/cli
6
5
  * Scheduler-specific type definitions for tree-shaking optimization
7
6
  */
8
7
  import { wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.10.0
3
+ */
4
+ import { pikkuState } from '@pikku/core';
5
+ pikkuState('scheduler', 'meta', {});
@@ -0,0 +1,4 @@
1
+ export {};
2
+ /**
3
+ * This file was generated by @pikku/cli@0.10.0
4
+ */
@@ -0,0 +1,5 @@
1
+ export {};
2
+ /**
3
+ * This file was generated by @pikku/cli@0.10.0
4
+ */
5
+ /* The files with an addScheduledTasks function call */
@@ -1,26 +1,28 @@
1
1
  /**
2
- * This file was generated by the @pikku/cli
2
+ * This file was generated by @pikku/cli@0.10.0
3
3
  */
4
4
  import { addSchema } from '@pikku/core/schema';
5
+ import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' };
6
+ addSchema('PikkuSchemasOutput', PikkuSchemasOutput);
5
7
  import * as PikkuChannelsOutput from './schemas/PikkuChannelsOutput.schema.json' with { type: 'json' };
6
8
  addSchema('PikkuChannelsOutput', PikkuChannelsOutput);
7
9
  import * as PikkuCLIOutput from './schemas/PikkuCLIOutput.schema.json' with { type: 'json' };
8
10
  addSchema('PikkuCLIOutput', PikkuCLIOutput);
9
11
  import * as PikkuFunctionsOutput from './schemas/PikkuFunctionsOutput.schema.json' with { type: 'json' };
10
12
  addSchema('PikkuFunctionsOutput', PikkuFunctionsOutput);
11
- import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' };
12
- addSchema('PikkuSchemasOutput', PikkuSchemasOutput);
13
- import * as PikkuMCPOutput from './schemas/PikkuMCPOutput.schema.json' with { type: 'json' };
14
- addSchema('PikkuMCPOutput', PikkuMCPOutput);
15
13
  import * as PikkuHTTPOutput from './schemas/PikkuHTTPOutput.schema.json' with { type: 'json' };
16
14
  addSchema('PikkuHTTPOutput', PikkuHTTPOutput);
15
+ import * as PikkuMCPOutput from './schemas/PikkuMCPOutput.schema.json' with { type: 'json' };
16
+ addSchema('PikkuMCPOutput', PikkuMCPOutput);
17
17
  import * as PikkuMiddlewareOutput from './schemas/PikkuMiddlewareOutput.schema.json' with { type: 'json' };
18
18
  addSchema('PikkuMiddlewareOutput', PikkuMiddlewareOutput);
19
+ import * as PikkuPermissionsOutput from './schemas/PikkuPermissionsOutput.schema.json' with { type: 'json' };
20
+ addSchema('PikkuPermissionsOutput', PikkuPermissionsOutput);
21
+ import * as PikkuQueueOutput from './schemas/PikkuQueueOutput.schema.json' with { type: 'json' };
22
+ addSchema('PikkuQueueOutput', PikkuQueueOutput);
19
23
  import * as PikkuRPCOutput from './schemas/PikkuRPCOutput.schema.json' with { type: 'json' };
20
24
  addSchema('PikkuRPCOutput', PikkuRPCOutput);
21
25
  import * as PikkuSchedulerOutput from './schemas/PikkuSchedulerOutput.schema.json' with { type: 'json' };
22
26
  addSchema('PikkuSchedulerOutput', PikkuSchedulerOutput);
23
- import * as PikkuQueueOutput from './schemas/PikkuQueueOutput.schema.json' with { type: 'json' };
24
- addSchema('PikkuQueueOutput', PikkuQueueOutput);
25
27
  import * as PikkuCLIConfig from './schemas/PikkuCLIConfig.schema.json' with { type: 'json' };
26
28
  addSchema('PikkuCLIConfig', PikkuCLIConfig);
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "outDir": { "type": "string" }, "schemaDirectory": { "type": "string" }, "typesDeclarationFile": { "type": "string" }, "functionsFile": { "type": "string" }, "functionsMetaFile": { "type": "string" }, "functionsMetaMinFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "channelsWiringFile": { "type": "string" }, "channelsWiringMetaFile": { "type": "string" }, "channelsMapDeclarationFile": { "type": "string" }, "channelsTypesFile": { "type": "string" }, "rpcInternalWiringMetaFile": { "type": "string" }, "rpcInternalMapDeclarationFile": { "type": "string" }, "rpcMapDeclarationFile": { "type": "string" }, "schedulersWiringFile": { "type": "string" }, "schedulersWiringMetaFile": { "type": "string" }, "schedulersTypesFile": { "type": "string" }, "queueWorkersWiringFile": { "type": "string" }, "queueWorkersWiringMetaFile": { "type": "string" }, "queueMapDeclarationFile": { "type": "string" }, "queueTypesFile": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "bootstrapFiles": { "type": "object", "properties": { "http": { "type": "string" }, "scheduler": { "type": "string" }, "channel": { "type": "string" }, "rpc": { "type": "string" }, "queue": { "type": "string" }, "mcp": { "type": "string" }, "cli": { "type": "string" } }, "required": ["http", "scheduler", "channel", "rpc", "queue", "mcp", "cli"], "additionalProperties": false }, "$schema": { "type": "string" }, "extends": { "type": "string" }, "rootDir": { "type": "string" }, "srcDirectories": { "type": "array", "items": { "type": "string" } }, "packageMappings": { "type": "object", "additionalProperties": { "type": "string" } }, "supportsImportAttributes": { "type": "boolean" }, "configFile": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "configDir": { "type": "string" }, "tsconfig": { "type": "string" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" }, "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "openAPI": { "type": "object", "properties": { "outputFile": { "type": "string" }, "additionalInfo": { "$ref": "#/definitions/OpenAPISpecInfo" } }, "required": ["outputFile", "additionalInfo"], "additionalProperties": false }, "cli": { "type": "object", "properties": { "entrypoints": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "cli" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }, { "type": "array", "items": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "cli" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }] } }] } } }, "additionalProperties": false }, "middlewareServices": { "type": "array", "items": { "type": "string" } }, "schemasFromTypes": { "type": "array", "items": { "type": "string" } }, "filters": { "$ref": "#/definitions/InspectorFilters" } }, "required": ["bootstrapFile", "bootstrapFiles", "channelsMapDeclarationFile", "channelsTypesFile", "channelsWiringFile", "channelsWiringMetaFile", "cliBootstrapFile", "cliTypesFile", "cliWiringMetaFile", "cliWiringsFile", "configDir", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaMinFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringsFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "middlewareFile", "middlewareGroupsMetaFile", "outDir", "packageMappings", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "rootDir", "rpcInternalMapDeclarationFile", "rpcInternalWiringMetaFile", "rpcMapDeclarationFile", "schedulersTypesFile", "schedulersWiringFile", "schedulersWiringMetaFile", "schemaDirectory", "servicesFile", "srcDirectories", "supportsImportAttributes", "tsconfig", "typesDeclarationFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "InspectorFilters": { "type": "object", "properties": { "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "directories": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "outDir": { "type": "string" }, "schemaDirectory": { "type": "string" }, "typesDeclarationFile": { "type": "string" }, "functionsFile": { "type": "string" }, "functionsMetaFile": { "type": "string" }, "functionsMetaMinFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "channelsWiringFile": { "type": "string" }, "channelsWiringMetaFile": { "type": "string" }, "channelsMapDeclarationFile": { "type": "string" }, "channelsTypesFile": { "type": "string" }, "rpcInternalWiringMetaFile": { "type": "string" }, "rpcInternalMapDeclarationFile": { "type": "string" }, "rpcMapDeclarationFile": { "type": "string" }, "schedulersWiringFile": { "type": "string" }, "schedulersWiringMetaFile": { "type": "string" }, "schedulersTypesFile": { "type": "string" }, "queueWorkersWiringFile": { "type": "string" }, "queueWorkersWiringMetaFile": { "type": "string" }, "queueMapDeclarationFile": { "type": "string" }, "queueTypesFile": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaFile": { "type": "string" }, "permissionsFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "$schema": { "type": "string" }, "extends": { "type": "string" }, "rootDir": { "type": "string" }, "srcDirectories": { "type": "array", "items": { "type": "string" } }, "packageMappings": { "type": "object", "additionalProperties": { "type": "string" } }, "supportsImportAttributes": { "type": "boolean" }, "configFile": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "userSessionType": { "type": "string" }, "singletonServicesFactoryType": { "type": "string" }, "sessionServicesFactoryType": { "type": "string" }, "configDir": { "type": "string" }, "tsconfig": { "type": "string" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" }, "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "openAPI": { "type": "object", "properties": { "outputFile": { "type": "string" }, "additionalInfo": { "$ref": "#/definitions/OpenAPISpecInfo" } }, "required": ["outputFile", "additionalInfo"], "additionalProperties": false }, "cli": { "type": "object", "properties": { "entrypoints": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "cli" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }, { "type": "array", "items": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "cli" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }] } }] } } }, "additionalProperties": false }, "forceRequiredServices": { "type": "array", "items": { "type": "string" } }, "schemasFromTypes": { "type": "array", "items": { "type": "string" } }, "stateOutput": { "type": "string" }, "stateInput": { "type": "string" }, "filters": { "$ref": "#/definitions/InspectorFilters" } }, "required": ["bootstrapFile", "channelsMapDeclarationFile", "channelsTypesFile", "channelsWiringFile", "channelsWiringMetaFile", "cliBootstrapFile", "cliTypesFile", "cliWiringMetaFile", "cliWiringsFile", "configDir", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaMinFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringsFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "middlewareFile", "middlewareGroupsMetaFile", "outDir", "packageMappings", "permissionsFile", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "rootDir", "rpcInternalMapDeclarationFile", "rpcInternalWiringMetaFile", "rpcMapDeclarationFile", "schedulersTypesFile", "schedulersWiringFile", "schedulersWiringMetaFile", "schemaDirectory", "servicesFile", "srcDirectories", "supportsImportAttributes", "tsconfig", "typesDeclarationFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "InspectorFilters": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "directories": { "type": "array", "items": { "type": "string" } }, "httpRoutes": { "type": "array", "items": { "type": "string" } }, "httpMethods": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "description": "This provides the structure needed for typescript to be aware of RPCs and their return types", "definitions": {} }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
@@ -0,0 +1 @@
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "description": "This provides the structure needed for typescript to be aware of RPCs and their return types", "definitions": {} }
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import '../.pikku/pikku-bootstrap.gen.js';
2
+ export {};
package/dist/bin/pikku.js CHANGED
@@ -1,9 +1,35 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
3
  import { createConfig, createSingletonServices } from '../src/services.js';
4
- import { PikkuRPCService } from '@pikku/core';
5
- import '../.pikku/pikku-bootstrap.gen.js';
4
+ import { PikkuRPCService } from '@pikku/core/rpc';
6
5
  import { LocalVariablesService } from '@pikku/core/services';
6
+ import { existsSync } from 'fs';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname, join } from 'path';
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+ // Check if Pikku CLI is available
12
+ const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js');
13
+ if (existsSync(pikkuCliPath)) {
14
+ try {
15
+ // Use the generated Pikku CLI
16
+ const { PikkuCLI } = await import('../.pikku/cli/pikku-cli.gen.js');
17
+ await PikkuCLI(process.argv.slice(2));
18
+ process.exit(0);
19
+ }
20
+ catch (error) {
21
+ // If import fails, fall back to Commander.js
22
+ console.warn('Failed to load Pikku CLI, using fallback mode:', error.message);
23
+ }
24
+ }
25
+ // Fallback to Commander.js for initial setup
26
+ // Import bootstrap if it exists
27
+ try {
28
+ await import('../.pikku/pikku-bootstrap.gen.js');
29
+ }
30
+ catch {
31
+ // Bootstrap doesn't exist yet, continue anyway
32
+ }
7
33
  const action = async (command, cliConfig) => {
8
34
  const config = await createConfig(new LocalVariablesService(), cliConfig);
9
35
  const services = await createSingletonServices(config);
@@ -23,11 +49,16 @@ const all = (program, name, description) => {
23
49
  .option('--pikku-config-type', 'The type of your pikku config object')
24
50
  .option('--singleton-services-factory-type', 'The type of your singleton services factory')
25
51
  .option('--session-services-factory-type', 'The type of your session services factory')
26
- .option('-c | --config <string>', 'The path to pikku cli config file')
27
- .option('-t | --tags <tags...>', 'Which tags to filter by')
52
+ .option('-c, --config <string>', 'The path to pikku cli config file')
53
+ .option('-t, --tags <tags...>', 'Which tags to filter by')
28
54
  .option('--types <types...>', 'Which types to filter by (http, channel, queue, scheduler, rpc, mcp)')
29
- .option('--directories <directories...>', 'Which directories to filter by')
30
- .option('-s | --silent', 'Silent mode - only show errors')
55
+ .option('-d, --directories <directories...>', 'Which directories to filter by')
56
+ .option('-n, --names <names...>', 'Filter functions by name patterns (supports wildcards)')
57
+ .option('--httpMethods <methods...>', 'Filter HTTP routes by methods (comma-separated)')
58
+ .option('--httpRoutes <routes...>', 'Filter HTTP routes by route patterns (comma-separated)')
59
+ .option('-s, --silent', 'Silent mode - only show errors')
60
+ .option('--state-output <path>', 'Save inspector state to JSON file for reuse')
61
+ .option('--state-input <path>', 'Load inspector state from JSON file (skips inspection)')
31
62
  .action((c) => action(name, c));
32
63
  };
33
64
  const program = new Command('pikku');
@@ -1,75 +1,99 @@
1
- // import { pikkuSchemas } from './functions/wirings/functions/schemas.js'
2
- // import { pikkuFetch } from './functions/wirings/fetch/index.js'
3
- // import { pikkuWebSocketTyped } from './functions/wirings/channels/pikku-command-websocket-typed.js'
4
- // import { pikkuRPCClient } from './functions/wirings/rpc/pikku-command-rpc-client.js'
5
- // import { pikkuQueueService } from './functions/wirings/queue/pikku-command-queue-service.js'
6
- // import { pikkuOpenAPI } from './functions/wirings/http/pikku-command-openapi.js'
7
- // import { pikkuNext } from './functions/runtimes/nextjs/pikku-command-nextjs.js'
8
- // import { pikkuCLICommand, wireCLI } from '../.pikku/cli/pikku-cli-types.gen.js'
9
- // import { all } from './functions/commands/all.js'
10
- // import { defaultCLIRenderer } from './services.js'
11
- export {};
12
- // wireCLI({
13
- // program: 'pikku',
14
- // description:
15
- // 'Pikku CLI - Code generation tool for type-safe backend development',
16
- // render: defaultCLIRenderer,
17
- // options: {
18
- // config: {
19
- // description: 'Path to pikku.config.json file',
20
- // short: 'c',
21
- // },
22
- // logLevel: {
23
- // description: 'Set log level',
24
- // default: 'info',
25
- // short: 'l',
26
- // },
27
- // },
28
- // commands: {
29
- // all: pikkuCLICommand({
30
- // func: all,
31
- // description: 'Generate all Pikku files (types, schemas, wirings, etc.)',
32
- // options: {
33
- // tags: {
34
- // description: 'Filter functions by tags (comma-separated)',
35
- // short: 't',
36
- // },
37
- // types: {
38
- // description: 'Filter functions by types (comma-separated)',
39
- // },
40
- // directories: {
41
- // description: 'Filter functions by directories (comma-separated)',
42
- // short: 'd',
43
- // },
44
- // },
45
- // }),
46
- // schemas: pikkuCLICommand({
47
- // func: pikkuSchemas,
48
- // description: 'Generate JSON schemas for function input/output types',
49
- // }),
50
- // fetch: pikkuCLICommand({
51
- // func: pikkuFetch,
52
- // description: 'Generate type-safe HTTP fetch client',
53
- // }),
54
- // websocket: pikkuCLICommand({
55
- // func: pikkuWebSocketTyped,
56
- // description: 'Generate type-safe WebSocket client',
57
- // }),
58
- // rpc: pikkuCLICommand({
59
- // func: pikkuRPCClient,
60
- // description: 'Generate RPC client wrappers',
61
- // }),
62
- // 'queue-service': pikkuCLICommand({
63
- // func: pikkuQueueService,
64
- // description: 'Generate queue service wrapper',
65
- // }),
66
- // openapi: pikkuCLICommand({
67
- // func: pikkuOpenAPI,
68
- // description: 'Generate OpenAPI specification from HTTP routes',
69
- // }),
70
- // nextjs: pikkuCLICommand({
71
- // func: pikkuNext,
72
- // description: 'Generate Next.js backend and HTTP wrappers',
73
- // }),
74
- // },
75
- // })
1
+ import { pikkuSchemas } from './functions/wirings/functions/schemas.js';
2
+ import { pikkuFetch } from './functions/wirings/fetch/index.js';
3
+ import { pikkuWebSocketTyped } from './functions/wirings/channels/pikku-command-websocket-typed.js';
4
+ import { pikkuRPCClient } from './functions/wirings/rpc/pikku-command-rpc-client.js';
5
+ import { pikkuQueueService } from './functions/wirings/queue/pikku-command-queue-service.js';
6
+ import { pikkuOpenAPI } from './functions/wirings/http/pikku-command-openapi.js';
7
+ import { pikkuNext } from './functions/runtimes/nextjs/pikku-command-nextjs.js';
8
+ import { pikkuCLICommand, wireCLI } from '../.pikku/cli/pikku-cli-types.gen.js';
9
+ import { all } from './functions/commands/all.js';
10
+ import { clientCLIRenderer } from './services.js';
11
+ wireCLI({
12
+ program: 'pikku',
13
+ description: 'Pikku CLI - Code generation tool for type-safe backend development',
14
+ render: clientCLIRenderer,
15
+ options: {
16
+ config: {
17
+ description: 'Path to pikku.config.json file',
18
+ short: 'c',
19
+ },
20
+ logLevel: {
21
+ description: 'Set log level',
22
+ default: 'info',
23
+ short: 'l',
24
+ },
25
+ userSessionType: {
26
+ description: 'Specify which UserSession type to use (when multiple exist)',
27
+ },
28
+ singletonServicesFactoryType: {
29
+ description: 'Specify which singleton services factory to use',
30
+ },
31
+ sessionServicesFactoryType: {
32
+ description: 'Specify which session services factory to use',
33
+ },
34
+ stateOutput: {
35
+ description: 'Save inspector state to JSON file for reuse',
36
+ },
37
+ stateInput: {
38
+ description: 'Load inspector state from JSON file (skips inspection)',
39
+ },
40
+ },
41
+ commands: {
42
+ all: pikkuCLICommand({
43
+ func: all,
44
+ description: 'Generate all Pikku files (types, schemas, wirings, etc.)',
45
+ isDefault: true,
46
+ options: {
47
+ tags: {
48
+ description: 'Filter functions by tags (comma-separated)',
49
+ short: 't',
50
+ },
51
+ types: {
52
+ description: 'Filter functions by types (comma-separated)',
53
+ },
54
+ directories: {
55
+ description: 'Filter functions by directories (comma-separated)',
56
+ short: 'd',
57
+ },
58
+ httpMethods: {
59
+ description: 'Filter HTTP routes by methods (comma-separated)',
60
+ },
61
+ httpRoutes: {
62
+ description: 'Filter HTTP routes by route patterns (comma-separated)',
63
+ },
64
+ names: {
65
+ description: 'Filter functions by name patterns (supports wildcards)',
66
+ short: 'n',
67
+ },
68
+ },
69
+ }),
70
+ schemas: pikkuCLICommand({
71
+ func: pikkuSchemas,
72
+ description: 'Generate JSON schemas for function input/output types',
73
+ }),
74
+ fetch: pikkuCLICommand({
75
+ func: pikkuFetch,
76
+ description: 'Generate type-safe HTTP fetch client',
77
+ }),
78
+ websocket: pikkuCLICommand({
79
+ func: pikkuWebSocketTyped,
80
+ description: 'Generate type-safe WebSocket client',
81
+ }),
82
+ rpc: pikkuCLICommand({
83
+ func: pikkuRPCClient,
84
+ description: 'Generate RPC client wrappers',
85
+ }),
86
+ 'queue-service': pikkuCLICommand({
87
+ func: pikkuQueueService,
88
+ description: 'Generate queue service wrapper',
89
+ }),
90
+ openapi: pikkuCLICommand({
91
+ func: pikkuOpenAPI,
92
+ description: 'Generate OpenAPI specification from HTTP routes',
93
+ }),
94
+ nextjs: pikkuCLICommand({
95
+ func: pikkuNext,
96
+ description: 'Generate Next.js backend and HTTP wrappers',
97
+ }),
98
+ },
99
+ });
@@ -30,6 +30,12 @@ export const all = pikkuVoidFunc({
30
30
  if (middleware) {
31
31
  allImports.push(config.middlewareFile);
32
32
  }
33
+ // Generate and register permissions
34
+ const permissions = await rpc.invoke('pikkuPermissions', null);
35
+ // Permissions must be imported before functions meta to ensure registration happens first
36
+ if (permissions) {
37
+ allImports.push(config.permissionsFile);
38
+ }
33
39
  // Always import functions meta (needed for all function metadata)
34
40
  allImports.push(config.functionsMetaFile);
35
41
  // Only import functionsFile if it was generated (has internal/external RPCs)
@@ -100,5 +106,9 @@ export const all = pikkuVoidFunc({
100
106
  .map((to) => `import '${getFileImportRelativePath(config.bootstrapFile, to, config.packageMappings)}'`)
101
107
  .sort((to) => (to.includes('meta') ? -1 : 1)) // Ensure meta files are at the top
102
108
  .join('\n'));
109
+ // Check for critical errors and exit if any were logged
110
+ if (logger.hasCriticalErrors()) {
111
+ process.exit(1);
112
+ }
103
113
  },
104
114
  });
@@ -7,11 +7,16 @@ import { serializeNextJsBackendWrapper as serializeNextBackendWrapper } from './
7
7
  import { serializeNextJsHTTPWrapper as serializeNextHTTPWrapper } from './serialize-nextjs-http-wrapper.js';
8
8
  export const pikkuNext = pikkuSessionlessFunc({
9
9
  func: async ({ logger, config, getInspectorState }) => {
10
- const { nextBackendFile, nextHTTPFile, httpMapDeclarationFile, packageMappings, fetchFile, bootstrapFiles, } = config;
11
- const visitState = await getInspectorState();
10
+ const { nextBackendFile, nextHTTPFile, httpMapDeclarationFile, packageMappings, fetchFile, } = config;
11
+ // If both files are undefined, clean up any existing files and return
12
12
  if (!nextBackendFile && !nextHTTPFile) {
13
- throw new Error('nextBackendFile or nextHTTPFile is required in pikku config for nextJS');
13
+ logger.info({
14
+ message: 'Skipping generating nextjs wrapper since nextjs outfile is not defined.',
15
+ type: 'skip',
16
+ });
17
+ return;
14
18
  }
19
+ const visitState = await getInspectorState();
15
20
  if (nextHTTPFile && !fetchFile) {
16
21
  throw new Error('fetchFile is required in pikku config in order for nextJS http wrapper to work');
17
22
  }
@@ -31,9 +36,9 @@ export const pikkuNext = pikkuSessionlessFunc({
31
36
  const pikkuConfigImport = `import { ${pikkuConfigFactory.variable} as createConfig } from '${getFileImportRelativePath(nextBackendFile, pikkuConfigFactory.file, packageMappings)}'`;
32
37
  const singletonServicesImport = `import { ${singletonServicesFactory.variable} as createSingletonServices } from '${getFileImportRelativePath(nextBackendFile, singletonServicesFactory.file, packageMappings)}'`;
33
38
  const sessionServicesImport = `import { ${sessionServicesFactory.variable} as createSessionServices } from '${getFileImportRelativePath(nextBackendFile, sessionServicesFactory.file, packageMappings)}'`;
34
- const httpBootstrapPath = getFileImportRelativePath(nextBackendFile, bootstrapFiles.http, packageMappings);
39
+ const bootstrapPath = getFileImportRelativePath(nextBackendFile, config.bootstrapFile, packageMappings);
35
40
  const routesMapDeclarationPath = getFileImportRelativePath(nextBackendFile, httpMapDeclarationFile, packageMappings);
36
- const content = serializeNextBackendWrapper(httpBootstrapPath, routesMapDeclarationPath, pikkuConfigImport, singletonServicesImport, sessionServicesImport);
41
+ const content = serializeNextBackendWrapper(bootstrapPath, routesMapDeclarationPath, pikkuConfigImport, singletonServicesImport, sessionServicesImport);
37
42
  await writeFileInDir(logger, nextBackendFile, content);
38
43
  }
39
44
  if (nextHTTPFile && fetchFile) {
@@ -47,9 +52,6 @@ export const pikkuNext = pikkuSessionlessFunc({
47
52
  logCommandInfoAndTime({
48
53
  commandStart: 'Generating nextjs wrapper',
49
54
  commandEnd: 'Generated nextjs wrapper',
50
- skipCondition: ({ config }) => config.nextBackendFile === undefined &&
51
- config.nextHTTPFile === undefined,
52
- skipMessage: 'nextjs outfile is not defined',
53
55
  }),
54
56
  ],
55
57
  });
@@ -1 +1 @@
1
- export declare const serializeNextJsBackendWrapper: (httpBootstrapPath: string, routesMapPath: string, configImport: string, singleServicesFactoryImport: string, sessionServicesImport: string) => string;
1
+ export declare const serializeNextJsBackendWrapper: (bootstrapPath: string, routesMapPath: string, configImport: string, singleServicesFactoryImport: string, sessionServicesImport: string) => string;
@@ -1,4 +1,4 @@
1
- export const serializeNextJsBackendWrapper = (httpBootstrapPath, routesMapPath, configImport, singleServicesFactoryImport, sessionServicesImport) => {
1
+ export const serializeNextJsBackendWrapper = (bootstrapPath, routesMapPath, configImport, singleServicesFactoryImport, sessionServicesImport) => {
2
2
  return `'server-only'
3
3
 
4
4
  /**
@@ -12,7 +12,7 @@ ${configImport}
12
12
  ${singleServicesFactoryImport}
13
13
  ${sessionServicesImport}
14
14
 
15
- import '${httpBootstrapPath}'
15
+ import '${bootstrapPath}'
16
16
 
17
17
  let _pikku: PikkuNextJS | undefined
18
18
 
@@ -14,11 +14,6 @@ export const pikkuChannels = pikkuVoidFunc({
14
14
  logCommandInfoAndTime({
15
15
  commandStart: 'Finding Channels',
16
16
  commandEnd: 'Found channels',
17
- skipCondition: async ({ getInspectorState }) => {
18
- const visitState = await getInspectorState();
19
- return visitState.channels.files.size === 0;
20
- },
21
- skipMessage: 'none found',
22
17
  }),
23
18
  ],
24
19
  });
@@ -14,8 +14,6 @@ export const pikkuChannelTypes = pikkuSessionlessFunc({
14
14
  logCommandInfoAndTime({
15
15
  commandStart: 'Creating channel types',
16
16
  commandEnd: 'Created channel types',
17
- skipCondition: false,
18
- skipMessage: '',
19
17
  }),
20
18
  ],
21
19
  });
@@ -13,11 +13,6 @@ export const pikkuChannelsMap = pikkuSessionlessFunc({
13
13
  logCommandInfoAndTime({
14
14
  commandStart: 'Creating channels map',
15
15
  commandEnd: 'Created channels map',
16
- skipCondition: async ({ getInspectorState }) => {
17
- const state = await getInspectorState();
18
- return state.channels.files.size === 0;
19
- },
20
- skipMessage: 'none found',
21
16
  }),
22
17
  ],
23
18
  });
@@ -15,11 +15,6 @@ export const pikkuChannels = pikkuSessionlessFunc({
15
15
  logCommandInfoAndTime({
16
16
  commandStart: 'Finding Channels',
17
17
  commandEnd: 'Found channels',
18
- skipCondition: async ({ getInspectorState }) => {
19
- const visitState = await getInspectorState();
20
- return visitState.channels.files.size === 0;
21
- },
22
- skipMessage: 'none found',
23
18
  }),
24
19
  ],
25
20
  });
@@ -6,8 +6,13 @@ import { serializeWebsocketWrapper } from './serialize-websocket-wrapper.js';
6
6
  export const pikkuWebSocketTyped = pikkuSessionlessFunc({
7
7
  func: async ({ logger, config }) => {
8
8
  const { websocketFile, channelsMapDeclarationFile, packageMappings } = config;
9
+ // If websocketFile is not set, clean up any existing file and return
9
10
  if (!websocketFile) {
10
- throw new Error("fetchFile is isn't set in the pikku config");
11
+ logger.info({
12
+ message: "Skipping generating websocket wrapper since websocketFile isn't set in the pikku config.",
13
+ type: 'skip',
14
+ });
15
+ return;
11
16
  }
12
17
  const channelsMapDeclarationPath = getFileImportRelativePath(websocketFile, channelsMapDeclarationFile, packageMappings);
13
18
  const content = [serializeWebsocketWrapper(channelsMapDeclarationPath)];
@@ -17,8 +22,6 @@ export const pikkuWebSocketTyped = pikkuSessionlessFunc({
17
22
  logCommandInfoAndTime({
18
23
  commandStart: 'Generating websocket wrapper',
19
24
  commandEnd: 'Generated websocket wrapper',
20
- skipCondition: ({ config }) => config.websocketFile === undefined,
21
- skipMessage: "websocketFile isn't set in the pikku config",
22
25
  }),
23
26
  ],
24
27
  });