@pikku/cli 0.11.1 → 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 (257) hide show
  1. package/.pikku/channel/pikku-channel-types.gen.ts +11 -12
  2. package/.pikku/channel/pikku-channels-map.gen.d.ts +8 -8
  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 +2 -2
  6. package/.pikku/cli/pikku-cli-client.gen.ts +1 -3
  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 -157
  10. package/.pikku/cli/pikku-cli-wirings.gen.ts +3 -3
  11. package/.pikku/cli/pikku-cli.gen.ts +3 -3
  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 +8 -8
  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 +4 -6
  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 +8 -8
  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 +8 -8
  36. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +34 -33
  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 +25 -25
  42. package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  43. package/.pikku/services/config.gen.json +99 -0
  44. package/.pikku/services/getInspectorState.gen.json +10 -0
  45. package/.pikku/services/jwt.gen.json +13 -0
  46. package/.pikku/services/logger.gen.json +25 -0
  47. package/.pikku/services/queueService.gen.json +14 -0
  48. package/.pikku/services/schedulerService.gen.json +17 -0
  49. package/.pikku/services/schema.gen.json +14 -0
  50. package/.pikku/services/variables.gen.json +13 -0
  51. package/.pikku/services/workflowService.gen.json +31 -0
  52. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +8 -8
  53. package/.pikku/workflow/pikku-workflow-types.gen.ts +36 -31
  54. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.json +1 -0
  55. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -2
  56. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +6 -2
  57. package/CHANGELOG.md +21 -0
  58. package/bin/pikku.ts +6 -32
  59. package/build.sh +53 -31
  60. package/cli.schema.json +1 -1
  61. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +6 -7
  62. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  63. package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
  64. package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
  65. package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
  66. package/dist/.pikku/cli/pikku-cli-channel.js +2 -2
  67. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  68. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -3
  69. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +3 -3
  70. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  71. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +3 -157
  72. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +146 -0
  73. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +2 -2
  74. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +2 -2
  75. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  76. package/dist/.pikku/cli/pikku-cli.gen.js +3 -3
  77. package/dist/.pikku/function/pikku-function-types.gen.d.ts +29 -79
  78. package/dist/.pikku/function/pikku-function-types.gen.js +19 -15
  79. package/dist/.pikku/function/pikku-functions-meta.gen.js +3 -969
  80. package/dist/.pikku/function/pikku-functions-meta.gen.json +988 -0
  81. package/dist/.pikku/function/pikku-functions-meta.min.gen.js +3 -208
  82. package/dist/.pikku/function/pikku-functions-meta.min.gen.json +212 -0
  83. package/dist/.pikku/http/pikku-http-types.gen.d.ts +2 -2
  84. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  85. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  86. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  87. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  88. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +13 -13
  89. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  90. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +5 -4
  91. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.json +5 -0
  92. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
  93. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
  94. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -4
  95. package/dist/.pikku/pikku-bootstrap.gen.js +1 -4
  96. package/dist/.pikku/pikku-services.gen.d.ts +3 -6
  97. package/dist/.pikku/pikku-services.gen.js +2 -5
  98. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  99. package/dist/.pikku/pikku-types.gen.js +1 -1
  100. package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
  101. package/dist/.pikku/pikku-websocket.gen.js +1 -1
  102. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +2 -2
  103. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  104. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +3 -7
  105. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +1 -0
  106. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  107. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  108. package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.d.ts +6 -9
  109. package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +2 -2
  110. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +2 -2
  111. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  112. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +3 -2
  113. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.json +1 -0
  114. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
  115. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
  116. package/dist/.pikku/schemas/register.gen.js +15 -15
  117. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  118. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +29 -25
  119. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +22 -8
  120. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +3 -2
  121. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.json +1 -0
  122. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +6 -2
  123. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +6 -3
  124. package/dist/bin/pikku.js +5 -26
  125. package/dist/src/cli.wiring.js +4 -4
  126. package/dist/src/functions/commands/all.js +82 -42
  127. package/dist/src/functions/commands/bootstrap.js +22 -10
  128. package/dist/src/functions/commands/watch.js +6 -3
  129. package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +12 -7
  130. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.d.ts +1 -1
  131. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +42 -4
  132. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts +1 -1
  133. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +40 -2
  134. package/dist/src/functions/wirings/channels/pikku-channels.js +9 -2
  135. package/dist/src/functions/wirings/channels/serialize-channel-types.js +10 -11
  136. package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
  137. package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +1 -1
  138. package/dist/src/functions/wirings/cli/pikku-command-cli.js +9 -3
  139. package/dist/src/functions/wirings/cli/serialize-channel-cli.js +1 -1
  140. package/dist/src/functions/wirings/cli/serialize-cli-types.js +2 -2
  141. package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.d.ts +1 -1
  142. package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +4 -4
  143. package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +4 -4
  144. package/dist/src/functions/wirings/functions/pikku-command-functions.js +15 -5
  145. package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
  146. package/dist/src/functions/wirings/functions/pikku-command-services.js +23 -23
  147. package/dist/src/functions/wirings/functions/schemas.js +1 -1
  148. package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
  149. package/dist/src/functions/wirings/functions/serialize-function-types.js +50 -64
  150. package/dist/src/functions/wirings/http/openapi-spec-generator.js +4 -4
  151. package/dist/src/functions/wirings/http/pikku-http-routes.js +9 -2
  152. package/dist/src/functions/wirings/http/serialize-http-types.js +1 -1
  153. package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +18 -4
  154. package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +12 -12
  155. package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +26 -2
  156. package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.d.ts +5 -2
  157. package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.js +5 -13
  158. package/dist/src/functions/wirings/queue/pikku-command-queue.js +9 -3
  159. package/dist/src/functions/wirings/queue/pikku-queue.js +9 -3
  160. package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +2 -1
  161. package/dist/src/functions/wirings/queue/serialize-queue-meta.js +10 -1
  162. package/dist/src/functions/wirings/queue/serialize-queue-types.js +1 -1
  163. package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +9 -2
  164. package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +11 -4
  165. package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +1 -1
  166. package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +3 -3
  167. package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +6 -3
  168. package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.d.ts +2 -1
  169. package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.js +11 -1
  170. package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +1 -1
  171. package/dist/src/functions/wirings/services/pikku-command-service-metadata.d.ts +1 -0
  172. package/dist/src/functions/wirings/services/pikku-command-service-metadata.js +22 -0
  173. package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +3 -1
  174. package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +12 -8
  175. package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +2 -1
  176. package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +11 -1
  177. package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +1 -1
  178. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +36 -31
  179. package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.d.ts +8 -0
  180. package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.js +30 -0
  181. package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +2 -2
  182. package/dist/src/middleware/log-command-info-and-time.d.ts +2 -2
  183. package/dist/src/middleware/log-command-info-and-time.js +1 -4
  184. package/dist/src/services/cli-logger-forwarder.service.js +1 -1
  185. package/dist/src/services.d.ts +2 -7
  186. package/dist/src/services.js +14 -12
  187. package/dist/src/utils/check-required-types.d.ts +2 -2
  188. package/dist/src/utils/check-required-types.js +2 -3
  189. package/dist/src/utils/pikku-cli-config.js +35 -2
  190. package/dist/src/utils/pikku-files-and-methods.d.ts +2 -2
  191. package/dist/src/utils/pikku-files-and-methods.js +4 -4
  192. package/dist/src/utils/schema-generator.d.ts +1 -1
  193. package/dist/src/utils/schema-generator.js +1 -1
  194. package/dist/tsconfig.tsbuildinfo +1 -1
  195. package/package.json +7 -8
  196. package/src/cli.wiring.ts +4 -4
  197. package/src/functions/commands/all.ts +94 -45
  198. package/src/functions/commands/bootstrap.ts +25 -10
  199. package/src/functions/commands/watch.ts +6 -3
  200. package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +26 -5
  201. package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +43 -4
  202. package/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +40 -1
  203. package/src/functions/wirings/channels/pikku-channels.ts +27 -3
  204. package/src/functions/wirings/channels/serialize-channel-types.ts +10 -11
  205. package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
  206. package/src/functions/wirings/cli/pikku-command-cli-types.ts +1 -1
  207. package/src/functions/wirings/cli/pikku-command-cli.ts +26 -3
  208. package/src/functions/wirings/cli/serialize-channel-cli.ts +1 -1
  209. package/src/functions/wirings/cli/serialize-cli-types.ts +2 -2
  210. package/src/functions/wirings/cli/serialize-local-cli-bootstrap.ts +5 -5
  211. package/src/functions/wirings/functions/pikku-command-function-types-split.ts +6 -6
  212. package/src/functions/wirings/functions/pikku-command-functions.ts +39 -4
  213. package/src/functions/wirings/functions/pikku-command-services.ts +25 -25
  214. package/src/functions/wirings/functions/schemas.ts +2 -2
  215. package/src/functions/wirings/functions/serialize-function-types.ts +51 -65
  216. package/src/functions/wirings/http/openapi-spec-generator.ts +14 -5
  217. package/src/functions/wirings/http/pikku-http-routes.ts +28 -2
  218. package/src/functions/wirings/http/serialize-http-types.ts +1 -1
  219. package/src/functions/wirings/mcp/pikku-command-mcp.ts +30 -4
  220. package/src/functions/wirings/mcp/serialize-mcp-types.ts +12 -12
  221. package/src/functions/wirings/middleware/pikku-command-middleware.ts +35 -2
  222. package/src/functions/wirings/middleware/serialize-middleware-groups-meta.ts +4 -19
  223. package/src/functions/wirings/permissions/pikku-command-permissions.ts +2 -2
  224. package/src/functions/wirings/queue/pikku-command-queue.ts +27 -2
  225. package/src/functions/wirings/queue/pikku-queue.ts +27 -2
  226. package/src/functions/wirings/queue/serialize-queue-meta.ts +15 -1
  227. package/src/functions/wirings/queue/serialize-queue-types.ts +1 -1
  228. package/src/functions/wirings/rpc/pikku-command-rpc.ts +25 -2
  229. package/src/functions/wirings/rpc/serialize-public-rpc.ts +11 -4
  230. package/src/functions/wirings/rpc/serialize-remote-rpc.ts +1 -1
  231. package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +3 -3
  232. package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +30 -4
  233. package/src/functions/wirings/scheduler/serialize-scheduler-meta.ts +20 -1
  234. package/src/functions/wirings/scheduler/serialize-scheduler-types.ts +1 -1
  235. package/src/functions/wirings/services/pikku-command-service-metadata.ts +25 -0
  236. package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +8 -1
  237. package/src/functions/wirings/workflow/pikku-command-workflow.ts +36 -8
  238. package/src/functions/wirings/workflow/serialize-workflow-meta.ts +18 -1
  239. package/src/functions/wirings/workflow/serialize-workflow-types.ts +39 -31
  240. package/src/functions/wirings/workflow/serialize-workflow-wirings.ts +47 -0
  241. package/src/functions/wirings/workflow/serialize-workflow-workers.ts +2 -2
  242. package/src/middleware/log-command-info-and-time.ts +3 -6
  243. package/src/services/cli-logger-forwarder.service.ts +1 -1
  244. package/src/services.ts +15 -15
  245. package/src/utils/check-required-types.ts +4 -7
  246. package/src/utils/pikku-cli-config.ts +69 -2
  247. package/src/utils/pikku-files-and-methods.ts +10 -13
  248. package/src/utils/schema-generator.ts +2 -2
  249. package/types/application-types.d.ts +1 -1
  250. package/types/config.d.ts +12 -1
  251. package/.pikku/function/pikku-functions.gen.ts +0 -84
  252. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +0 -47
  253. package/dist/.pikku/function/pikku-functions.gen.d.ts +0 -1
  254. package/dist/.pikku/function/pikku-functions.gen.js +0 -83
  255. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +0 -1
  256. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +0 -47
  257. package/dist/.pikku/schemas/schemas/PikkuRemoteInternalRPCInput.schema.json +0 -1
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "workflowService",
3
+ "summary": "Interface for workflow orchestration",
4
+ "description": "Handles workflow execution, replay, orchestration logic, and run-level state",
5
+ "package": "@pikku/core",
6
+ "path": "home/runner/work/pikku/pikku/packages/core/dist/types/core.types.d.ts",
7
+ "version": "0.11.1",
8
+ "interface": "export interface WorkflowService {\n createRun(workflowName: string, input: any): Promise<string>;\n getRun(id: string): Promise<WorkflowRun | null>;\n getRunHistory(runId: string): Promise<Array<StepState & {\n stepName: string;\n }>>;\n updateRunStatus(id: string, status: WorkflowStatus, output?: any, error?: SerializedError): Promise<void>;\n withRunLock<T>(id: string, fn: () => Promise<T>): Promise<T>;\n close(): Promise<void>;\n resumeWorkflow(runId: string): Promise<void>;\n setServices(singletonServices: CoreSingletonServices, createWireServices: CreateWireServices, config: CoreConfig): void;\n startWorkflow<I>(name: string, input: I, rpcService: any): Promise<{\n runId: string;\n }>;\n runWorkflowJob(runId: string, rpcService: any): Promise<void>;\n orchestrateWorkflow(runId: string, rpcService: any): Promise<void>;\n executeWorkflowSleep(runId: string, stepId: string): Promise<void>;\n insertStepState(runId: string, stepName: string, rpcName: string, data: any, stepOptions?: {\n retries?: number;\n retryDelay?: string | number;\n }): Promise<StepState>;\n getStepState(runId: string, stepName: string): Promise<StepState>;\n setStepRunning(stepId: string): Promise<void>;\n setStepScheduled(stepId: string): Promise<void>;\n setStepResult(stepId: string, result: any): Promise<void>;\n setStepError(stepId: string, error: Error): Promise<void>;\n createRetryAttempt(stepId: string, status: 'pending' | 'running'): Promise<StepState>;\n executeWorkflowStep(runId: string, stepName: string, rpcName: string | null, data: any, rpcService: any): Promise<void>;\n}",
9
+ "expandedProperties": {
10
+ "createRun": "(workflowName: string, input: any) => Promise<string>",
11
+ "getRun": "(id: string) => Promise<WorkflowRun | null>",
12
+ "getRunHistory": "(runId: string) => Promise<Array<StepState & { stepName: string; }>>",
13
+ "updateRunStatus": "(id: string, status: WorkflowStatus, output?: any, error?: SerializedError) => Promise<void>",
14
+ "withRunLock": "<T>(id: string, fn: () => Promise<T>) => Promise<T>",
15
+ "close": "() => Promise<void>",
16
+ "resumeWorkflow": "(runId: string) => Promise<void>",
17
+ "setServices": "(singletonServices: CoreSingletonServices, createWireServices: CreateWireServices, config: CoreConfig) => void",
18
+ "startWorkflow": "<I>(name: string, input: I, rpcService: any) => Promise<{ runId: string; }>",
19
+ "runWorkflowJob": "(runId: string, rpcService: any) => Promise<void>",
20
+ "orchestrateWorkflow": "(runId: string, rpcService: any) => Promise<void>",
21
+ "executeWorkflowSleep": "(runId: string, stepId: string) => Promise<void>",
22
+ "insertStepState": "(runId: string, stepName: string, rpcName: string, data: any, stepOptions?: { retries?: number; retryDelay?: string | number; }) => Promise<StepState>",
23
+ "getStepState": "(runId: string, stepName: string) => Promise<StepState>",
24
+ "setStepRunning": "(stepId: string) => Promise<void>",
25
+ "setStepScheduled": "(stepId: string) => Promise<void>",
26
+ "setStepResult": "(stepId: string, result: any) => Promise<void>",
27
+ "setStepError": "(stepId: string, error: Error) => Promise<void>",
28
+ "createRetryAttempt": "(stepId: string, status: \"pending\" | \"running\") => Promise<StepState>",
29
+ "executeWorkflowStep": "(runId: string, stepName: string, rpcName: string | null, data: any, rpcService: any) => Promise<void>"
30
+ }
31
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
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 workflows and their input/output types
@@ -10,19 +10,19 @@
10
10
  // Custom types are those that are defined directly within generics
11
11
  // or are broken into simpler types
12
12
  export type PikkuSchemasOutput = false | true
13
- export type PikkuChannelsOutput = false | true
14
- export type PikkuCLIOutput = false | true
15
13
  export type PikkuFunctionsOutput = false | true
16
- export type PikkuHTTPOutput = false | true
17
- export type PikkuMCPOutput = 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 WorkflowHandler<I, O> {
28
28
  input: I;
@@ -1,29 +1,19 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /**
5
5
  * Workflow-specific type definitions for tree-shaking optimization
6
6
  */
7
7
 
8
- import { CoreWorkflow, wireWorkflow as wireWorkflowCore, PikkuWorkflowInteraction, WorkflowStepOptions } from '@pikku/core/workflow'
9
- import { CorePikkuFunctionConfig, CorePikkuFunctionSessionless } from '@pikku/core'
10
- import type { PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
11
- import type { UserSession, SingletonServices } from '../../types/application-types.d.js'
12
- import type { TypedPikkuRPC, RPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
8
+ import { PikkuWorkflowWire, WorkflowStepOptions } from '@pikku/core/workflow'
9
+ import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
10
+ import type { RPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
13
11
 
14
12
  /**
15
- * Type definition for workflows that orchestrate multi-step processes.
16
- * Workflows support both inline and remote execution modes with step caching.
17
- */
18
- type WorkflowWiring = CoreWorkflow<
19
- CorePikkuFunctionConfig<PikkuFunctionWorkflow<any, any>, PikkuPermission<any>, PikkuMiddleware>
20
- >
21
-
22
- /**
23
- * Typed workflow interaction with RPC awareness
13
+ * Typed workflow wire with RPC awareness
24
14
  * Provides type-safe workflow.do() for RPC steps
25
15
  */
26
- export interface TypedWorkflow extends PikkuWorkflowInteraction {
16
+ export interface TypedWorkflow extends PikkuWorkflowWire {
27
17
  /**
28
18
  * Execute a workflow step with RPC invocation (typed based on available RPCs)
29
19
  * @template K - RPC name from the RPC map
@@ -48,25 +38,23 @@ export interface TypedWorkflow extends PikkuWorkflowInteraction {
48
38
 
49
39
  /**
50
40
  * Workflow function type with typed workflow service
51
- * Includes the workflow interaction object with typed RPC methods
41
+ * Includes the workflow wire object with typed RPC methods
52
42
  */
53
43
  export type PikkuFunctionWorkflow<
54
44
  In = unknown,
55
45
  Out = never
56
- > = CorePikkuFunctionSessionless<
46
+ > = PikkuFunctionSessionless<
57
47
  In,
58
48
  Out,
59
- null,
60
- SingletonServices & {
61
- rpc: TypedPikkuRPC
62
- workflow: TypedWorkflow
63
- },
64
- UserSession
49
+ 'workflow'
65
50
  >
66
51
 
67
52
  /**
68
53
  * Creates a workflow function with typed input and output.
69
- * Workflow functions have access to the workflow interaction object for step execution.
54
+ * Workflow functions have access to the workflow wire object for step execution.
55
+ *
56
+ * This is the permissive mode - workflows that don't conform to simple DSL will fall back
57
+ * to basic extraction with a warning.
70
58
  *
71
59
  * @template In - Input type for the workflow
72
60
  * @template Out - Output type for the workflow
@@ -76,17 +64,34 @@ export type PikkuFunctionWorkflow<
76
64
  export const pikkuWorkflowFunc = <In, Out = unknown>(
77
65
  func:
78
66
  | PikkuFunctionWorkflow<In, Out>
79
- | CorePikkuFunctionConfig<PikkuFunctionWorkflow<In, Out>, PikkuPermission<In>, PikkuMiddleware>
67
+ | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
80
68
  ) => {
81
69
  return typeof func === 'function' ? { func } : func
82
70
  }
83
71
 
84
72
  /**
85
- * Registers a workflow with the Pikku framework.
86
- * Workflows can run in 'inline' (synchronous) or 'remote' (queue-based) execution modes.
73
+ * Creates a simple workflow function with typed input and output.
74
+ * Simple workflows must conform to the restricted DSL for static analysis.
75
+ *
76
+ * This is the strict mode - workflows that don't conform to simple DSL will cause
77
+ * a critical error during inspection.
87
78
  *
88
- * @param workflow - Workflow definition with name, execution mode, and handler function
79
+ * Constraints:
80
+ * - Must use only workflow.do() with RPC form (no inline functions)
81
+ * - Only if/else, for..of, and Promise.all(array.map()) control flow allowed
82
+ * - Step names must be unique (except across mutually exclusive branches)
83
+ * - All workflow calls must be awaited
84
+ *
85
+ * @template In - Input type for the workflow
86
+ * @template Out - Output type for the workflow
87
+ * @param func - Function definition, either direct function or configuration object
88
+ * @returns The normalized configuration object
89
89
  */
90
- export const wireWorkflow = (workflow: WorkflowWiring) => {
91
- wireWorkflowCore(workflow as any)
90
+ export const pikkuSimpleWorkflowFunc = <In, Out = unknown>(
91
+ func:
92
+ | PikkuFunctionWorkflow<In, Out>
93
+ | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
94
+ ) => {
95
+ return typeof func === 'function' ? { func } : func
92
96
  }
97
+
@@ -1,5 +1,8 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  import { pikkuState } from '@pikku/core'
5
- pikkuState('workflows', 'meta', {})
5
+ import { WorkflowsMeta } from '@pikku/core/workflow'
6
+ import metaData from './pikku-workflow-wirings-meta.gen.json' with { type: 'json' }
7
+
8
+ pikkuState('workflows', 'meta', metaData as WorkflowsMeta)
@@ -1,4 +1,8 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
- /* The files with an wireWorkflow function call */
4
+ /**
5
+ * Auto-generated workflow registrations
6
+ * Do not edit manually - regenerate with 'npx pikku'
7
+ */
8
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  ## 0.11.0
2
2
 
3
+ ## 0.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 4b811db: chore: updating all dependencies
8
+ - ce902b1: feat: serialize json files seperate to pikku meta state calls
9
+ - e12a00c: feat: adding initialSession to PikkuWire which is correctly typed (undefined / not depending on function type)
10
+ - ce902b1: feat: adding rpcName to rpc url so its nicer in network tabs
11
+ - 4579434: breaking: changing the signature of functions
12
+ - 28aeb7f: breaking: extract docs in the wiring meta
13
+ - ce902b1: feat: adding in pikkuSimpleWorkflowFunc
14
+ - 06e1a31: breaking: change session services to wire services
15
+ - Updated dependencies [4b811db]
16
+ - Updated dependencies [e12a00c]
17
+ - Updated dependencies [4579434]
18
+ - Updated dependencies [28aeb7f]
19
+ - Updated dependencies [ce902b1]
20
+ - Updated dependencies [06e1a31]
21
+ - @pikku/inspector@0.11.1
22
+ - @pikku/core@0.11.1
23
+
3
24
  ## 0.11.1
4
25
 
5
26
  ### Patch Changes
package/bin/pikku.ts CHANGED
@@ -1,34 +1,10 @@
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/rpc'
5
4
  import { LocalVariablesService } from '@pikku/core/services'
6
- import { existsSync } from 'fs'
7
- import { fileURLToPath } from 'url'
8
- import { dirname, join } from 'path'
5
+ import { all as allCommand } from '../src/functions/commands/all.js'
6
+ import { watch as watchCommand } from '../src/functions/commands/watch.js'
9
7
 
10
- const __filename = fileURLToPath(import.meta.url)
11
- const __dirname = dirname(__filename)
12
-
13
- // Check if Pikku CLI is available
14
- const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js')
15
-
16
- if (existsSync(pikkuCliPath)) {
17
- try {
18
- // Use the generated Pikku CLI
19
- const { PikkuCLI } = await import(pikkuCliPath)
20
- await PikkuCLI(process.argv.slice(2))
21
- process.exit(0)
22
- } catch (error) {
23
- // If import fails, fall back to Commander.js
24
- console.warn(
25
- 'Failed to load Pikku CLI, using fallback mode:',
26
- error.message
27
- )
28
- }
29
- }
30
-
31
- // Fallback to Commander.js for initial setup
32
8
  // Import bootstrap if it exists
33
9
  try {
34
10
  await import('../.pikku/pikku-bootstrap.gen.js')
@@ -36,16 +12,14 @@ try {
36
12
  // Bootstrap doesn't exist yet, continue anyway
37
13
  }
38
14
 
39
- const action = async (command, cliConfig) => {
15
+ const action = async (command: string, cliConfig: any) => {
40
16
  const config = await createConfig(new LocalVariablesService(), cliConfig)
41
17
  const services = await createSingletonServices(config)
42
- const rpcWrapper = new PikkuRPCService()
43
- const { rpc } = await rpcWrapper.injectRPCService(services, {}, false)
44
18
 
45
19
  if (command === 'watch') {
46
- await rpc.invoke('watch', null)
20
+ await watchCommand.func(services)
47
21
  } else {
48
- await rpc.invoke('all', null)
22
+ await allCommand.func(services)
49
23
  }
50
24
  }
51
25
 
@@ -60,7 +34,7 @@ const all = (program, name, description) => {
60
34
  )
61
35
  .option(
62
36
  '--session-services-factory-type',
63
- 'The type of your session services factory'
37
+ 'The type of your wire services factory'
64
38
  )
65
39
  .option('-c, --config <string>', 'The path to pikku cli config file')
66
40
  .option('-t, --tags <tags...>', 'Which tags to filter by')
package/build.sh CHANGED
@@ -1,52 +1,74 @@
1
1
  #!/bin/bash
2
2
 
3
- # Exit on error
4
3
  set -e
5
4
 
6
5
  echo "Starting Pikku CLI build process..."
7
6
 
8
- # Step 1: Clean the dist directory
9
- # Remove any previously built files to ensure a fresh build
10
- # echo "Cleaning dist directory..."
11
- rm -rf .pikku/cli
12
-
13
- # Step 2: Generate types using the published version of @pikku/cli
14
- # We use the latest published version from npm to generate Pikku types because
15
- # the CLI package needs its own generated types to build itself (bootstrap problem).
16
- # This relies on the published version being backwards compatible enough to generate
17
- # types that work with the current codebase.
18
- echo "Generating Pikku types using published @pikku/cli..."
19
- npx -y @pikku/cli@latest
20
-
21
- # Step 3: Build the TypeScript source to dist
22
- # Now that we have the generated types (from the published version),
23
- # we can compile the TypeScript source code
7
+ # Clean .pikku directory
8
+ rm -rf .pikku
9
+
10
+ # Create minimal bootstrap stub files
11
+ echo "Creating minimal bootstrap stub files..."
12
+ mkdir -p .pikku/function .pikku/cli
13
+
14
+ cat > .pikku/pikku-types.gen.ts << 'EOF'
15
+ /**
16
+ * Bootstrap stub - minimal types for initial build
17
+ */
18
+ export * from './function/pikku-function-types.gen.js'
19
+ export * from './cli/pikku-cli-types.gen.js'
20
+ EOF
21
+
22
+ cat > .pikku/function/pikku-function-types.gen.ts << 'EOF'
23
+ /**
24
+ * Bootstrap stub - minimal function types
25
+ */
26
+ export const pikkuFunc = <In, Out = unknown>(func: any) => {
27
+ return typeof func === 'function' ? { func } : func
28
+ }
29
+
30
+ export const pikkuSessionlessFunc = <In, Out = unknown>(func: any) => {
31
+ return typeof func === 'function' ? { func } : func
32
+ }
33
+
34
+ export const pikkuVoidFunc = (func: any) => {
35
+ return typeof func === 'function' ? { func } : func
36
+ }
37
+ EOF
38
+
39
+ cat > .pikku/cli/pikku-cli-types.gen.ts << 'EOF'
40
+ /**
41
+ * Bootstrap stub - minimal CLI types
42
+ */
43
+ export { wireCLI } from '@pikku/core/cli'
44
+
45
+ export const pikkuCLICommand = (config: any) => {
46
+ return config
47
+ }
48
+ EOF
49
+
50
+ cat > .pikku/pikku-bootstrap.gen.ts << 'EOF'
51
+ /**
52
+ * Bootstrap stub - empty bootstrap file
53
+ */
54
+ EOF
55
+
56
+ # Build TypeScript with stubs
24
57
  echo "Building TypeScript to dist..."
25
58
  yarn tsc -b
26
59
 
27
- # Step 4: Remove the generated .pikku directory
28
- # The types we generated in step 2 were from the old published version.
29
- # We need to regenerate them with the newly built local version to ensure
30
- # the generated files reflect the actual current state of the CLI.
60
+ # Regenerate types with newly built CLI
31
61
  echo "Removing .pikku directory (generated from published version)..."
32
62
  rm -rf .pikku
33
63
 
34
- # Step 5: Regenerate types using the newly built local CLI
35
- # Use the freshly built local version (from dist) to regenerate Pikku types.
36
- # This ensures the generated files are in sync with the current codebase.
37
64
  echo "Regenerating Pikku types using local CLI..."
38
65
  yarn pikku
39
66
 
40
- # Step 6: Rebuild to reflect the actual state
41
- # Compile again now that we have the correct generated types from the local version.
42
- # This ensures the final dist reflects the true current state of both the source
43
- # and the generated type files.
67
+ # Rebuild with generated types
44
68
  echo "Rebuilding TypeScript with local types..."
45
69
  yarn tsc -b
46
70
 
47
- # Step 7: Copy the generated schema to cli.schema.json
48
- # The schema is generated as part of the Pikku type generation process
49
- # and needs to be copied to the root of the package for distribution
71
+ # Copy schema file
50
72
  echo "Copying schema file..."
51
73
  cp .pikku/schemas/schemas/PikkuCLIConfig.schema.json cli.schema.json
52
74
 
package/cli.schema.json CHANGED
@@ -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"},"workflowsWiringFile":{"type":"string"},"workflowsWiringMetaFile":{"type":"string"},"workflowsWorkersFile":{"type":"string"},"workflowMapDeclarationFile":{"type":"string"},"workflowTypesFile":{"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"}},"ignoreFiles":{"type":"array","items":{"type":"string"}},"packageMappings":{"type":"object","additionalProperties":{"type":"string"}},"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},"schema":{"type":"object","properties":{"additionalProperties":{"type":"boolean"},"supportsImportAttributes":{"type":"boolean"}},"additionalProperties":false},"cli":{"type":"object","properties":{"entrypoints":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"local"},"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":"local"},"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},"workflows":{"anyOf":[{"type":"object","properties":{"singleQueue":{"type":"boolean","const":true},"path":{"type":"string"},"orchestratorQueue":{"type":"string"},"workerQueue":{"type":"string"}},"required":["singleQueue","path"],"additionalProperties":false},{"type":"object","properties":{"singleQueue":{"type":"boolean","const":false},"dir":{"type":"string"},"orchestratorQueuePrefix":{"type":"string"},"workerQueuePrefix":{"type":"string"}},"required":["singleQueue","dir"],"additionalProperties":false}]},"rpc":{"type":"object","properties":{"remoteRpcWorkersPath":{"type":"string"},"publicRpcPath":{"type":"string"}},"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","tsconfig","typesDeclarationFile","workflowMapDeclarationFile","workflowTypesFile","workflowsWiringFile","workflowsWiringMetaFile","workflowsWorkersFile"],"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
+ {"$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"},"functionsMetaJsonFile":{"type":"string"},"functionsMetaMinFile":{"type":"string"},"functionsMetaMinJsonFile":{"type":"string"},"functionTypesFile":{"type":"string"},"httpWiringsFile":{"type":"string"},"httpWiringMetaFile":{"type":"string"},"httpWiringMetaJsonFile":{"type":"string"},"httpMapDeclarationFile":{"type":"string"},"httpTypesFile":{"type":"string"},"channelsWiringFile":{"type":"string"},"channelsWiringMetaFile":{"type":"string"},"channelsWiringMetaJsonFile":{"type":"string"},"channelsMapDeclarationFile":{"type":"string"},"channelsTypesFile":{"type":"string"},"rpcInternalWiringMetaFile":{"type":"string"},"rpcInternalWiringMetaJsonFile":{"type":"string"},"rpcInternalMapDeclarationFile":{"type":"string"},"rpcMapDeclarationFile":{"type":"string"},"schedulersWiringFile":{"type":"string"},"schedulersWiringMetaFile":{"type":"string"},"schedulersWiringMetaJsonFile":{"type":"string"},"schedulersTypesFile":{"type":"string"},"queueWorkersWiringFile":{"type":"string"},"queueWorkersWiringMetaFile":{"type":"string"},"queueWorkersWiringMetaJsonFile":{"type":"string"},"queueMapDeclarationFile":{"type":"string"},"queueTypesFile":{"type":"string"},"workflowsWiringFile":{"type":"string"},"workflowsWiringMetaFile":{"type":"string"},"workflowsWiringMetaJsonFile":{"type":"string"},"workflowsWorkersFile":{"type":"string"},"workflowMapDeclarationFile":{"type":"string"},"workflowTypesFile":{"type":"string"},"mcpWiringsFile":{"type":"string"},"mcpWiringsMetaFile":{"type":"string"},"mcpWiringsMetaJsonFile":{"type":"string"},"mcpTypesFile":{"type":"string"},"cliWiringsFile":{"type":"string"},"cliWiringMetaFile":{"type":"string"},"cliWiringMetaJsonFile":{"type":"string"},"cliBootstrapFile":{"type":"string"},"cliTypesFile":{"type":"string"},"servicesFile":{"type":"string"},"middlewareFile":{"type":"string"},"middlewareGroupsMetaFile":{"type":"string"},"middlewareGroupsMetaJsonFile":{"type":"string"},"permissionsFile":{"type":"string"},"bootstrapFile":{"type":"string"},"$schema":{"type":"string"},"extends":{"type":"string"},"rootDir":{"type":"string"},"srcDirectories":{"type":"array","items":{"type":"string"}},"ignoreFiles":{"type":"array","items":{"type":"string"}},"packageMappings":{"type":"object","additionalProperties":{"type":"string"}},"configFile":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"types":{"type":"array","items":{"type":"string"}},"userSessionType":{"type":"string"},"singletonServicesFactoryType":{"type":"string"},"wireServicesFactoryType":{"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},"schema":{"type":"object","properties":{"additionalProperties":{"type":"boolean"},"supportsImportAttributes":{"type":"boolean"}},"additionalProperties":false},"cli":{"type":"object","properties":{"entrypoints":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"local"},"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":"local"},"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},"workflows":{"anyOf":[{"type":"object","properties":{"singleQueue":{"type":"boolean","const":true},"path":{"type":"string"},"orchestratorQueue":{"type":"string"},"workerQueue":{"type":"string"}},"required":["singleQueue","path"],"additionalProperties":false},{"type":"object","properties":{"singleQueue":{"type":"boolean","const":false},"dir":{"type":"string"},"orchestratorQueuePrefix":{"type":"string"},"workerQueuePrefix":{"type":"string"}},"required":["singleQueue","dir"],"additionalProperties":false}]},"rpc":{"type":"object","properties":{"remoteRpcWorkersPath":{"type":"string"},"publicRpcPath":{"type":"string"}},"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","channelsWiringMetaJsonFile","cliBootstrapFile","cliTypesFile","cliWiringMetaFile","cliWiringMetaJsonFile","cliWiringsFile","configDir","filters","functionTypesFile","functionsFile","functionsMetaFile","functionsMetaJsonFile","functionsMetaMinFile","functionsMetaMinJsonFile","httpMapDeclarationFile","httpTypesFile","httpWiringMetaFile","httpWiringMetaJsonFile","httpWiringsFile","mcpTypesFile","mcpWiringsFile","mcpWiringsMetaFile","mcpWiringsMetaJsonFile","middlewareFile","middlewareGroupsMetaFile","middlewareGroupsMetaJsonFile","outDir","packageMappings","permissionsFile","queueMapDeclarationFile","queueTypesFile","queueWorkersWiringFile","queueWorkersWiringMetaFile","queueWorkersWiringMetaJsonFile","rootDir","rpcInternalMapDeclarationFile","rpcInternalWiringMetaFile","rpcInternalWiringMetaJsonFile","rpcMapDeclarationFile","schedulersTypesFile","schedulersWiringFile","schedulersWiringMetaFile","schedulersWiringMetaJsonFile","schemaDirectory","servicesFile","srcDirectories","tsconfig","typesDeclarationFile","workflowMapDeclarationFile","workflowTypesFile","workflowsWiringFile","workflowsWiringMetaFile","workflowsWiringMetaJsonFile","workflowsWorkersFile"],"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,14 +1,13 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /**
5
5
 
6
6
  * Channel-specific type definitions for tree-shaking optimization
7
7
  */
8
8
  import { CoreChannel } from '@pikku/core/channel';
9
- import { CorePikkuFunctionConfig } from '@pikku/core';
10
9
  import { AssertHTTPWiringParams } from '@pikku/core/http';
11
- import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js';
10
+ import type { PikkuFunctionConfig, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js';
12
11
  /**
13
12
  * Type definition for WebSocket channels with typed data exchange.
14
13
  * Supports connection, disconnection, and message handling.
@@ -17,7 +16,7 @@ import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMid
17
16
  * @template ChannelData - Type of data exchanged through the channel
18
17
  * @template Channel - String literal type for the channel name
19
18
  */
20
- type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelData, Channel, CorePikkuFunctionConfig<PikkuFunctionSessionless<void, any, ChannelData>, PikkuPermission<void>, PikkuMiddleware>, CorePikkuFunctionConfig<PikkuFunctionSessionless<void, void, ChannelData>, PikkuPermission<void>, PikkuMiddleware>, CorePikkuFunctionConfig<PikkuFunctionSessionless<any, any, ChannelData> | PikkuFunction<any, any, ChannelData>, PikkuPermission<any>, PikkuMiddleware>, PikkuPermission, PikkuMiddleware>;
19
+ type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelData, Channel, PikkuFunctionConfig<void, any, 'channel' | 'session' | 'rpc'>, PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>, PikkuFunctionConfig<any, any, 'channel' | 'session' | 'rpc'>, PikkuPermission, PikkuMiddleware>;
21
20
  /**
22
21
  * Creates a function that handles WebSocket channel connections.
23
22
  * Called when a client connects to a channel.
@@ -26,7 +25,7 @@ type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelDat
26
25
  * @param func - Function definition, either direct function or configuration object
27
26
  * @returns The normalized configuration object
28
27
  */
29
- export declare const pikkuChannelConnectionFunc: <Out = unknown>(func: PikkuFunctionSessionless<void, Out, unknown> | CorePikkuFunctionConfig<PikkuFunctionSessionless<void, Out, unknown>, PikkuPermission<void>, PikkuMiddleware>) => CorePikkuFunctionConfig<PikkuFunctionSessionless<void, Out, unknown>, PikkuPermission<void>, PikkuMiddleware>;
28
+ export declare const pikkuChannelConnectionFunc: <Out = unknown>(func: PikkuFunctionSessionless<void, Out, "channel" | "session" | "rpc"> | PikkuFunctionConfig<void, Out, "channel" | "session" | "rpc">) => PikkuFunctionConfig<void, Out, "rpc" | "channel" | "session">;
30
29
  /**
31
30
  * Creates a function that handles WebSocket channel disconnections.
32
31
  * Called when a client disconnects from a channel.
@@ -34,7 +33,7 @@ export declare const pikkuChannelConnectionFunc: <Out = unknown>(func: PikkuFunc
34
33
  * @param func - Function definition, either direct function or configuration object
35
34
  * @returns The normalized configuration object
36
35
  */
37
- export declare const pikkuChannelDisconnectionFunc: (func: PikkuFunctionSessionless<void, void, unknown> | CorePikkuFunctionConfig<PikkuFunctionSessionless<void, void, unknown>, PikkuPermission<void>, PikkuMiddleware>) => CorePikkuFunctionConfig<PikkuFunctionSessionless<void, void, unknown>, PikkuPermission<void>, PikkuMiddleware>;
36
+ export declare const pikkuChannelDisconnectionFunc: (func: PikkuFunctionSessionless<void, void, "channel"> | PikkuFunctionConfig<void, void, "channel" | "session" | "rpc">) => PikkuFunctionConfig<void, void, "rpc" | "channel" | "session">;
38
37
  /**
39
38
  * Creates a function that handles WebSocket channel messages.
40
39
  * Called when a message is received on a channel.
@@ -45,7 +44,7 @@ export declare const pikkuChannelDisconnectionFunc: (func: PikkuFunctionSessionl
45
44
  * @param func - Function definition, either direct function or configuration object
46
45
  * @returns The normalized configuration object
47
46
  */
48
- export declare const pikkuChannelFunc: <In, Out = unknown>(func: PikkuFunctionSessionless<In, Out, unknown> | CorePikkuFunctionConfig<PikkuFunctionSessionless<In, Out, unknown>, PikkuPermission<In>, PikkuMiddleware>) => CorePikkuFunctionConfig<PikkuFunctionSessionless<In, Out, unknown>, PikkuPermission<In>, PikkuMiddleware>;
47
+ export declare const pikkuChannelFunc: <In, Out = unknown>(func: PikkuFunctionSessionless<In, Out, "channel" | "session" | "rpc"> | PikkuFunctionConfig<In, Out, "channel" | "session" | "rpc">) => PikkuFunctionConfig<In, Out, "rpc" | "channel" | "session">;
49
48
  /**
50
49
  * Registers a WebSocket channel with the Pikku framework.
51
50
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /**
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
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
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.11.1
3
+ * This file was generated by @pikku/cli@0.11.2
4
4
  */
@@ -1,5 +1,5 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.11.1
3
+ * This file was generated by @pikku/cli@0.11.2
4
4
  */
5
5
  /* The files with an addChannel function call */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /**
5
5
  * WebSocket channel backend for 'pikku' CLI commands
@@ -17,7 +17,7 @@ import { pikkuQueueService } from '../../src/functions/wirings/queue/pikku-comma
17
17
  import { pikkuOpenAPI } from '../../src/functions/wirings/http/pikku-command-openapi.js';
18
18
  import { pikkuNext } from '../../src/functions/runtimes/nextjs/pikku-command-nextjs.js';
19
19
  // Middleware to close the channel after CLI command completes
20
- const cliCloseOnComplete = pikkuMiddleware(async (services, { channel }, next) => {
20
+ const cliCloseOnComplete = pikkuMiddleware(async (_services, { channel }, next) => {
21
21
  const closeChannel = () => {
22
22
  setTimeout(async () => {
23
23
  try {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  import '../pikku-bootstrap.gen.js';
5
5
  /**
@@ -1,10 +1,9 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  import { executeCLIViaChannel } from '@pikku/core/cli/channel';
5
5
  import { CorePikkuWebsocket } from '@pikku/websocket';
6
6
  import '../pikku-bootstrap.gen.js';
7
- import { clientCLIRenderer } from '../../src/services.js';
8
7
  /**
9
8
  * Pikku CLI Client (via WebSocket Channel)
10
9
  * Executes CLI commands over a WebSocket connection
@@ -19,7 +18,6 @@ export async function PikkuCLIClient(ws, args) {
19
18
  pikkuWS,
20
19
  args,
21
20
  renderers,
22
- defaultRenderer: clientCLIRenderer,
23
21
  });
24
22
  }
25
23
  // Export as default for easy importing
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /**
5
5
 
@@ -39,7 +39,7 @@ export declare const pikkuCLIRender: <Data, RequiredServices extends SingletonSe
39
39
  * CLI command configuration with project-specific types.
40
40
  * Uses CoreCLICommandConfig from @pikku/core with local middleware and render types.
41
41
  */
42
- type CLICommandConfig<Func extends PikkuFunctionConfig<In, Out>, In = any, Out = any, Params extends string = string> = CoreCLICommandConfig<Func, PikkuMiddleware, PikkuCLIRender<any>, Params>;
42
+ type CLICommandConfig<Func extends PikkuFunctionConfig<In, Out, 'cli' | 'rpc' | 'session'>, In = any, Out = any, Params extends string = string> = CoreCLICommandConfig<Func, PikkuMiddleware, PikkuCLIRender<any>, Params>;
43
43
  /**
44
44
  * Type definition for CLI applications with commands and global options.
45
45
  *
@@ -65,5 +65,5 @@ export declare const wireCLI: <Commands extends Record<string, CoreCLICommandCon
65
65
  * @param config - CLI command configuration
66
66
  * @returns CLI command configuration with inferred types
67
67
  */
68
- export declare const pikkuCLICommand: <FuncConfig extends PikkuFunctionConfig<any, any>, Params extends string>(config: CLICommandConfig<FuncConfig, any, any, Params>) => CoreCLICommandConfig<FuncConfig, PikkuMiddleware, PikkuCLIRender<any>, string>;
68
+ export declare const pikkuCLICommand: <FuncConfig extends PikkuFunctionConfig<any, any, "cli" | "rpc" | "session">, Params extends string>(config: CLICommandConfig<FuncConfig, any, any, Params>) => CoreCLICommandConfig<FuncConfig, PikkuMiddleware, PikkuCLIRender<any>, string>;
69
69
  export {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.1
2
+ * This file was generated by @pikku/cli@0.11.2
3
3
  */
4
4
  /**
5
5