@pikku/addon-console 0.12.21 → 0.12.23

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 (293) hide show
  1. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
  2. package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
  3. package/dist/.pikku/addon/pikku-package.gen.js +1 -1
  4. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +1 -1
  5. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  6. package/dist/.pikku/auth/auth.types.d.ts +1 -1
  7. package/dist/.pikku/auth/auth.types.js +1 -1
  8. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  9. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  10. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  11. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  12. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  13. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  14. package/dist/.pikku/function/pikku-functions-meta.gen.json +639 -217
  15. package/dist/.pikku/function/pikku-functions.gen.js +7 -1
  16. package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
  17. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  18. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  19. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  20. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  21. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  22. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  23. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  24. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  25. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  26. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  27. package/dist/.pikku/pikku-types.gen.js +1 -1
  28. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  29. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  30. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +8 -4
  31. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +8 -4
  32. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  33. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
  34. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  35. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  36. package/dist/.pikku/schemas/register.gen.js +5 -1
  37. package/dist/.pikku/schemas/register.gen.js.map +1 -1
  38. package/dist/.pikku/schemas/schemas/AddonPackageInfo.schema.json +1 -1
  39. package/dist/.pikku/schemas/schemas/AgentCredentialCheckInput.schema.json +1 -1
  40. package/dist/.pikku/schemas/schemas/AllMeta.schema.json +1 -1
  41. package/dist/.pikku/schemas/schemas/GetAddonMetaOutput.schema.json +1 -1
  42. package/dist/.pikku/schemas/schemas/GetWorkflowMetaByIdOutput.schema.json +1 -1
  43. package/dist/.pikku/schemas/schemas/SecurityAuditReport.schema.json +1 -0
  44. package/dist/.pikku/schemas/schemas/UpdateDependencyInput.schema.json +1 -0
  45. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  46. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  47. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  48. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  49. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  50. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  51. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  52. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  53. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  54. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  55. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +1 -1
  56. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +9 -1
  57. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
  58. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +4 -1
  59. package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
  60. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  61. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  62. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  63. package/dist/src/functions/agent-credential-check.function.d.ts +2 -5
  64. package/dist/src/functions/agent-credential-check.function.d.ts.map +1 -1
  65. package/dist/src/functions/agent-credential-check.function.js +7 -4
  66. package/dist/src/functions/agent-credential-check.function.js.map +1 -1
  67. package/dist/src/functions/credential-delete.function.d.ts +2 -2
  68. package/dist/src/functions/credential-delete.function.js +2 -2
  69. package/dist/src/functions/credential-delete.function.js.map +1 -1
  70. package/dist/src/functions/credential-get.function.d.ts +2 -2
  71. package/dist/src/functions/credential-get.function.js +2 -2
  72. package/dist/src/functions/credential-get.function.js.map +1 -1
  73. package/dist/src/functions/credential-list-users.function.d.ts +2 -2
  74. package/dist/src/functions/credential-list-users.function.js +2 -2
  75. package/dist/src/functions/credential-list-users.function.js.map +1 -1
  76. package/dist/src/functions/credential-set.function.d.ts +2 -2
  77. package/dist/src/functions/credential-set.function.js +2 -2
  78. package/dist/src/functions/credential-set.function.js.map +1 -1
  79. package/dist/src/functions/credential-status.function.d.ts +2 -2
  80. package/dist/src/functions/credential-status.function.js +2 -2
  81. package/dist/src/functions/credential-status.function.js.map +1 -1
  82. package/dist/src/functions/credential-users.function.d.ts +2 -2
  83. package/dist/src/functions/credential-users.function.js +2 -2
  84. package/dist/src/functions/credential-users.function.js.map +1 -1
  85. package/dist/src/functions/delete-agent-thread.function.d.ts +2 -2
  86. package/dist/src/functions/delete-agent-thread.function.d.ts.map +1 -1
  87. package/dist/src/functions/delete-agent-thread.function.js +2 -3
  88. package/dist/src/functions/delete-agent-thread.function.js.map +1 -1
  89. package/dist/src/functions/delete-workflow-run.function.d.ts +2 -2
  90. package/dist/src/functions/delete-workflow-run.function.d.ts.map +1 -1
  91. package/dist/src/functions/delete-workflow-run.function.js +2 -3
  92. package/dist/src/functions/delete-workflow-run.function.js.map +1 -1
  93. package/dist/src/functions/get-addon-icon.function.d.ts +2 -2
  94. package/dist/src/functions/get-addon-icon.function.d.ts.map +1 -1
  95. package/dist/src/functions/get-addon-icon.function.js +2 -3
  96. package/dist/src/functions/get-addon-icon.function.js.map +1 -1
  97. package/dist/src/functions/get-addon-meta.function.d.ts +1 -1
  98. package/dist/src/functions/get-addon-meta.function.d.ts.map +1 -1
  99. package/dist/src/functions/get-addon-meta.function.js +2 -3
  100. package/dist/src/functions/get-addon-meta.function.js.map +1 -1
  101. package/dist/src/functions/get-addon-package.function.d.ts +2 -2
  102. package/dist/src/functions/get-addon-package.function.d.ts.map +1 -1
  103. package/dist/src/functions/get-addon-package.function.js +2 -3
  104. package/dist/src/functions/get-addon-package.function.js.map +1 -1
  105. package/dist/src/functions/get-agent-thread-messages.function.d.ts +2 -2
  106. package/dist/src/functions/get-agent-thread-messages.function.d.ts.map +1 -1
  107. package/dist/src/functions/get-agent-thread-messages.function.js +2 -3
  108. package/dist/src/functions/get-agent-thread-messages.function.js.map +1 -1
  109. package/dist/src/functions/get-agent-thread-runs.function.d.ts +2 -2
  110. package/dist/src/functions/get-agent-thread-runs.function.d.ts.map +1 -1
  111. package/dist/src/functions/get-agent-thread-runs.function.js +2 -3
  112. package/dist/src/functions/get-agent-thread-runs.function.js.map +1 -1
  113. package/dist/src/functions/get-agent-threads.function.d.ts +2 -2
  114. package/dist/src/functions/get-agent-threads.function.d.ts.map +1 -1
  115. package/dist/src/functions/get-agent-threads.function.js +2 -3
  116. package/dist/src/functions/get-agent-threads.function.js.map +1 -1
  117. package/dist/src/functions/get-ai-workflows.function.d.ts +2 -2
  118. package/dist/src/functions/get-ai-workflows.function.d.ts.map +1 -1
  119. package/dist/src/functions/get-ai-workflows.function.js +2 -3
  120. package/dist/src/functions/get-ai-workflows.function.js.map +1 -1
  121. package/dist/src/functions/get-all-meta.function.d.ts +1 -1
  122. package/dist/src/functions/get-all-meta.function.d.ts.map +1 -1
  123. package/dist/src/functions/get-all-meta.function.js +2 -3
  124. package/dist/src/functions/get-all-meta.function.js.map +1 -1
  125. package/dist/src/functions/get-auth-providers.function.d.ts +1 -1
  126. package/dist/src/functions/get-auth-providers.function.d.ts.map +1 -1
  127. package/dist/src/functions/get-auth-providers.function.js +2 -3
  128. package/dist/src/functions/get-auth-providers.function.js.map +1 -1
  129. package/dist/src/functions/get-channel-snippets.function.d.ts +2 -2
  130. package/dist/src/functions/get-channel-snippets.function.d.ts.map +1 -1
  131. package/dist/src/functions/get-channel-snippets.function.js +2 -3
  132. package/dist/src/functions/get-channel-snippets.function.js.map +1 -1
  133. package/dist/src/functions/get-db-schema.function.d.ts +1 -1
  134. package/dist/src/functions/get-db-schema.function.d.ts.map +1 -1
  135. package/dist/src/functions/get-db-schema.function.js +2 -3
  136. package/dist/src/functions/get-db-schema.function.js.map +1 -1
  137. package/dist/src/functions/get-function-coverage.function.d.ts +1 -1
  138. package/dist/src/functions/get-function-coverage.function.d.ts.map +1 -1
  139. package/dist/src/functions/get-function-coverage.function.js +2 -3
  140. package/dist/src/functions/get-function-coverage.function.js.map +1 -1
  141. package/dist/src/functions/get-functions-meta.function.d.ts +1 -1
  142. package/dist/src/functions/get-functions-meta.function.d.ts.map +1 -1
  143. package/dist/src/functions/get-functions-meta.function.js +2 -3
  144. package/dist/src/functions/get-functions-meta.function.js.map +1 -1
  145. package/dist/src/functions/get-installed-addons.function.d.ts +1 -1
  146. package/dist/src/functions/get-installed-addons.function.d.ts.map +1 -1
  147. package/dist/src/functions/get-installed-addons.function.js +2 -3
  148. package/dist/src/functions/get-installed-addons.function.js.map +1 -1
  149. package/dist/src/functions/get-installed-package.function.d.ts +2 -2
  150. package/dist/src/functions/get-installed-package.function.d.ts.map +1 -1
  151. package/dist/src/functions/get-installed-package.function.js +2 -3
  152. package/dist/src/functions/get-installed-package.function.js.map +1 -1
  153. package/dist/src/functions/get-openapi-detail.function.d.ts +2 -2
  154. package/dist/src/functions/get-openapi-detail.function.d.ts.map +1 -1
  155. package/dist/src/functions/get-openapi-detail.function.js +2 -3
  156. package/dist/src/functions/get-openapi-detail.function.js.map +1 -1
  157. package/dist/src/functions/get-openapis.function.d.ts +2 -2
  158. package/dist/src/functions/get-openapis.function.d.ts.map +1 -1
  159. package/dist/src/functions/get-openapis.function.js +2 -3
  160. package/dist/src/functions/get-openapis.function.js.map +1 -1
  161. package/dist/src/functions/get-schema.function.d.ts +2 -2
  162. package/dist/src/functions/get-schema.function.d.ts.map +1 -1
  163. package/dist/src/functions/get-schema.function.js +2 -3
  164. package/dist/src/functions/get-schema.function.js.map +1 -1
  165. package/dist/src/functions/get-security-audit.function.d.ts +3 -0
  166. package/dist/src/functions/get-security-audit.function.d.ts.map +1 -0
  167. package/dist/src/functions/get-security-audit.function.js +9 -0
  168. package/dist/src/functions/get-security-audit.function.js.map +1 -0
  169. package/dist/src/functions/get-security-audit.function.test.d.ts +2 -0
  170. package/dist/src/functions/get-security-audit.function.test.d.ts.map +1 -0
  171. package/dist/src/functions/get-security-audit.function.test.js +53 -0
  172. package/dist/src/functions/get-security-audit.function.test.js.map +1 -0
  173. package/dist/src/functions/get-state-diff.function.d.ts +2 -2
  174. package/dist/src/functions/get-state-diff.function.js +2 -2
  175. package/dist/src/functions/get-state-diff.function.js.map +1 -1
  176. package/dist/src/functions/get-workflow-meta-by-id.function.d.ts +8 -2
  177. package/dist/src/functions/get-workflow-meta-by-id.function.d.ts.map +1 -1
  178. package/dist/src/functions/get-workflow-meta-by-id.function.js +2 -3
  179. package/dist/src/functions/get-workflow-meta-by-id.function.js.map +1 -1
  180. package/dist/src/functions/get-workflow-run-history.function.d.ts +2 -2
  181. package/dist/src/functions/get-workflow-run-history.function.d.ts.map +1 -1
  182. package/dist/src/functions/get-workflow-run-history.function.js +3 -4
  183. package/dist/src/functions/get-workflow-run-history.function.js.map +1 -1
  184. package/dist/src/functions/get-workflow-run-names.function.d.ts +1 -1
  185. package/dist/src/functions/get-workflow-run-names.function.d.ts.map +1 -1
  186. package/dist/src/functions/get-workflow-run-names.function.js +3 -4
  187. package/dist/src/functions/get-workflow-run-names.function.js.map +1 -1
  188. package/dist/src/functions/get-workflow-run-steps.function.d.ts +2 -2
  189. package/dist/src/functions/get-workflow-run-steps.function.d.ts.map +1 -1
  190. package/dist/src/functions/get-workflow-run-steps.function.js +2 -3
  191. package/dist/src/functions/get-workflow-run-steps.function.js.map +1 -1
  192. package/dist/src/functions/get-workflow-run.function.d.ts +2 -2
  193. package/dist/src/functions/get-workflow-run.function.d.ts.map +1 -1
  194. package/dist/src/functions/get-workflow-run.function.js +2 -3
  195. package/dist/src/functions/get-workflow-run.function.js.map +1 -1
  196. package/dist/src/functions/get-workflow-runs.function.d.ts +2 -2
  197. package/dist/src/functions/get-workflow-runs.function.d.ts.map +1 -1
  198. package/dist/src/functions/get-workflow-runs.function.js +2 -3
  199. package/dist/src/functions/get-workflow-runs.function.js.map +1 -1
  200. package/dist/src/functions/get-workflow-version.function.d.ts +2 -2
  201. package/dist/src/functions/get-workflow-version.function.d.ts.map +1 -1
  202. package/dist/src/functions/get-workflow-version.function.js +2 -3
  203. package/dist/src/functions/get-workflow-version.function.js.map +1 -1
  204. package/dist/src/functions/install-addon.function.d.ts.map +1 -1
  205. package/dist/src/functions/install-addon.function.js +2 -1
  206. package/dist/src/functions/install-addon.function.js.map +1 -1
  207. package/dist/src/functions/install-openapi-addon.function.d.ts.map +1 -1
  208. package/dist/src/functions/install-openapi-addon.function.js +2 -1
  209. package/dist/src/functions/install-openapi-addon.function.js.map +1 -1
  210. package/dist/src/functions/oauth-connect.function.d.ts +2 -2
  211. package/dist/src/functions/oauth-connect.function.js +2 -2
  212. package/dist/src/functions/oauth-connect.function.js.map +1 -1
  213. package/dist/src/functions/oauth-disconnect.function.d.ts +2 -2
  214. package/dist/src/functions/oauth-disconnect.function.js +2 -2
  215. package/dist/src/functions/oauth-disconnect.function.js.map +1 -1
  216. package/dist/src/functions/oauth-exchange-tokens.function.d.ts +2 -2
  217. package/dist/src/functions/oauth-exchange-tokens.function.js +2 -2
  218. package/dist/src/functions/oauth-exchange-tokens.function.js.map +1 -1
  219. package/dist/src/functions/oauth-refresh-token.function.d.ts +2 -2
  220. package/dist/src/functions/oauth-refresh-token.function.js +2 -2
  221. package/dist/src/functions/oauth-refresh-token.function.js.map +1 -1
  222. package/dist/src/functions/oauth-status.function.d.ts +2 -2
  223. package/dist/src/functions/oauth-status.function.js +2 -2
  224. package/dist/src/functions/oauth-status.function.js.map +1 -1
  225. package/dist/src/functions/oauth-test-token.function.d.ts +2 -2
  226. package/dist/src/functions/oauth-test-token.function.js +2 -2
  227. package/dist/src/functions/oauth-test-token.function.js.map +1 -1
  228. package/dist/src/functions/ping.function.d.ts +2 -2
  229. package/dist/src/functions/ping.function.d.ts.map +1 -1
  230. package/dist/src/functions/ping.function.js +2 -3
  231. package/dist/src/functions/ping.function.js.map +1 -1
  232. package/dist/src/functions/read-agent-source.function.d.ts +2 -2
  233. package/dist/src/functions/read-agent-source.function.d.ts.map +1 -1
  234. package/dist/src/functions/read-agent-source.function.js +2 -3
  235. package/dist/src/functions/read-agent-source.function.js.map +1 -1
  236. package/dist/src/functions/read-function-body.function.d.ts +2 -2
  237. package/dist/src/functions/read-function-body.function.d.ts.map +1 -1
  238. package/dist/src/functions/read-function-body.function.js +2 -3
  239. package/dist/src/functions/read-function-body.function.js.map +1 -1
  240. package/dist/src/functions/read-function-source.function.d.ts +2 -2
  241. package/dist/src/functions/read-function-source.function.d.ts.map +1 -1
  242. package/dist/src/functions/read-function-source.function.js +2 -3
  243. package/dist/src/functions/read-function-source.function.js.map +1 -1
  244. package/dist/src/functions/render-email-preview.function.d.ts +1 -1
  245. package/dist/src/functions/render-email-preview.function.d.ts.map +1 -1
  246. package/dist/src/functions/render-email-preview.function.js +2 -3
  247. package/dist/src/functions/render-email-preview.function.js.map +1 -1
  248. package/dist/src/functions/run-function-tests.function.d.ts +1 -1
  249. package/dist/src/functions/run-function-tests.function.d.ts.map +1 -1
  250. package/dist/src/functions/run-function-tests.function.js +2 -3
  251. package/dist/src/functions/run-function-tests.function.js.map +1 -1
  252. package/dist/src/functions/run-security-audit.function.d.ts +3 -0
  253. package/dist/src/functions/run-security-audit.function.d.ts.map +1 -0
  254. package/dist/src/functions/run-security-audit.function.js +18 -0
  255. package/dist/src/functions/run-security-audit.function.js.map +1 -0
  256. package/dist/src/functions/update-agent-config.function.d.ts +2 -2
  257. package/dist/src/functions/update-agent-config.function.d.ts.map +1 -1
  258. package/dist/src/functions/update-agent-config.function.js +2 -3
  259. package/dist/src/functions/update-agent-config.function.js.map +1 -1
  260. package/dist/src/functions/update-dependency.function.d.ts +12 -0
  261. package/dist/src/functions/update-dependency.function.d.ts.map +1 -0
  262. package/dist/src/functions/update-dependency.function.js +62 -0
  263. package/dist/src/functions/update-dependency.function.js.map +1 -0
  264. package/dist/src/functions/update-email-template.function.d.ts +2 -2
  265. package/dist/src/functions/update-email-template.function.d.ts.map +1 -1
  266. package/dist/src/functions/update-email-template.function.js +2 -3
  267. package/dist/src/functions/update-email-template.function.js.map +1 -1
  268. package/dist/src/functions/update-function-body.function.d.ts +2 -2
  269. package/dist/src/functions/update-function-body.function.d.ts.map +1 -1
  270. package/dist/src/functions/update-function-body.function.js +2 -3
  271. package/dist/src/functions/update-function-body.function.js.map +1 -1
  272. package/dist/src/functions/update-function-config.function.d.ts +2 -2
  273. package/dist/src/functions/update-function-config.function.d.ts.map +1 -1
  274. package/dist/src/functions/update-function-config.function.js +2 -3
  275. package/dist/src/functions/update-function-config.function.js.map +1 -1
  276. package/dist/src/lib/audit-exec.d.ts +10 -0
  277. package/dist/src/lib/audit-exec.d.ts.map +1 -0
  278. package/dist/src/lib/audit-exec.js +75 -0
  279. package/dist/src/lib/audit-exec.js.map +1 -0
  280. package/dist/src/lib/find-project-root.d.ts +9 -0
  281. package/dist/src/lib/find-project-root.d.ts.map +1 -0
  282. package/dist/src/lib/find-project-root.js +21 -0
  283. package/dist/src/lib/find-project-root.js.map +1 -0
  284. package/dist/src/services/wiring.service.d.ts +6 -0
  285. package/dist/src/services/wiring.service.d.ts.map +1 -1
  286. package/dist/src/services/wiring.service.js +3 -1
  287. package/dist/src/services/wiring.service.js.map +1 -1
  288. package/dist/src/services/wiring.service.test.js +1 -0
  289. package/dist/src/services/wiring.service.test.js.map +1 -1
  290. package/dist/src/services.d.ts.map +1 -1
  291. package/dist/src/services.js +2 -2
  292. package/dist/src/services.js.map +1 -1
  293. package/package.json +4 -4
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "functions": { "type": "array", "items": { "$ref": "#/definitions/FunctionMeta" } }, "httpMeta": { "type": "array", "items": { "$ref": "#/definitions/HttpRouteMeta" } }, "cliMeta": { "type": "array", "items": { "$ref": "#/definitions/CliProgramMeta" } }, "cliRenderers": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliRendererMeta" } }, "channelsMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ChannelMeta" } }, "queueMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/QueueWorkerMeta" } }, "schedulerMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/SchedulerTaskMeta" } }, "rpcMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/RpcMeta" } }, "mcpMeta": { "type": "array", "items": { "$ref": "#/definitions/McpItemMeta" } }, "gatewayMeta": { "type": "array", "items": { "$ref": "#/definitions/GatewayItemMeta" } }, "workflows": { "$ref": "#/definitions/WorkflowsMeta" }, "triggerMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/TriggerMeta" } }, "triggerSourceMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/TriggerSourceMeta" } }, "middlewareGroupsMeta": { "$ref": "#/definitions/MiddlewareGroupsMeta" }, "permissionsGroupsMeta": { "$ref": "#/definitions/PermissionsGroupsMeta" }, "agentsMeta": { "$ref": "#/definitions/AgentsMeta" }, "emailsMeta": { "$ref": "#/definitions/EmailsMeta" }, "secretsMeta": { "type": "object", "additionalProperties": {} }, "credentialsMeta": { "type": "object", "additionalProperties": {} }, "variablesMeta": { "type": "object", "additionalProperties": {} }, "functionUsedBy": { "type": "object", "additionalProperties": { "$ref": "#/definitions/FunctionUsedBy" } }, "counts": { "$ref": "#/definitions/MetaCounts" } }, "required": ["agentsMeta", "channelsMeta", "cliMeta", "cliRenderers", "counts", "credentialsMeta", "emailsMeta", "functionUsedBy", "functions", "gatewayMeta", "httpMeta", "mcpMeta", "middlewareGroupsMeta", "permissionsGroupsMeta", "queueMeta", "rpcMeta", "schedulerMeta", "secretsMeta", "triggerMeta", "triggerSourceMeta", "variablesMeta", "workflows"], "additionalProperties": false, "definitions": { "FunctionMeta": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "functionType": { "type": "string", "enum": ["user", "inline", "helper"] }, "funcWrapper": { "type": "string" }, "services": { "$ref": "#/definitions/FunctionServicesMeta" }, "wires": { "$ref": "#/definitions/FunctionWiresMeta" }, "inputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "outputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "isDirectFunction": { "type": "boolean" }, "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "inputSchemaName": { "type": ["string", "null"] }, "outputSchemaName": { "type": ["string", "null"] }, "expose": { "type": "boolean" }, "remote": { "type": "boolean" }, "mcp": { "type": "boolean" }, "readonly": { "type": "boolean" }, "deploy": { "type": "string", "enum": ["serverless", "server", "auto"] }, "sessionless": { "type": "boolean" }, "workflowQueued": { "type": "boolean", "description": "When true, workflow steps calling this function are dispatched via the queue. No queue service configured is a hard error." }, "workflowRetries": { "type": "number", "description": "Retry count when this function is used as a workflow step." }, "workflowTimeout": { "type": "string", "description": "Timeout when this function is used as a workflow step (e.g. '30s', '5m')." }, "version": { "type": "number" }, "approvalRequired": { "type": "boolean" }, "approvalDescription": { "type": "string" }, "implementationHash": { "type": "string" }, "contractHash": { "type": "string" }, "inputHash": { "type": "string" }, "outputHash": { "type": "string" } }, "required": ["inputSchemaName", "outputSchemaName", "pikkuFuncId"] }, "FunctionServicesMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "FunctionWiresMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "wires": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "wires"], "additionalProperties": false }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for permissions at any level\n- type: 'http' = HTTP route permission group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based permission group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual permission" }, "HttpRouteMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "route": { "type": "string" }, "method": { "type": "string" }, "params": { "type": "array", "items": { "type": "string" } }, "query": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "errors": { "type": "array", "items": { "type": "string" } }, "auth": { "type": "boolean" }, "sse": { "type": "boolean" }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "inputSchemaName": { "type": "string" }, "outputSchemaName": { "type": "string" } }, "required": ["pikkuFuncId", "route", "method"], "additionalProperties": false }, "CliProgramMeta": { "type": "object", "properties": { "wireId": { "type": "string" }, "program": { "type": "string" }, "description": { "type": "string" }, "commands": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliCommandMeta" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliOptionMeta" } }, "defaultRenderName": { "type": "string" } }, "required": ["wireId", "program", "commands", "options"], "additionalProperties": false }, "CliCommandMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "parameters": { "type": "string" }, "positionals": { "type": "array", "items": { "$ref": "#/definitions/CliPositionalMeta" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliOptionMeta" } }, "renderName": { "type": "string" }, "subcommands": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliCommandMeta" } }, "isDefault": { "type": "boolean" } }, "required": ["pikkuFuncId", "positionals", "options"], "additionalProperties": false }, "CliPositionalMeta": { "type": "object", "properties": { "name": { "type": "string" }, "required": { "type": "boolean" }, "variadic": { "type": "boolean" } }, "required": ["name", "required"], "additionalProperties": false }, "CliOptionMeta": { "type": "object", "properties": { "description": { "type": "string" }, "short": { "type": "string" }, "default": {}, "choices": { "type": "array", "items": {} }, "array": { "type": "boolean" }, "required": { "type": "boolean" } }, "required": ["description"], "additionalProperties": false }, "CliRendererMeta": { "type": "object", "properties": { "name": { "type": "string" }, "exportedName": { "type": "string" }, "filePath": { "type": "string" }, "services": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false } }, "required": ["name", "filePath", "services"], "additionalProperties": false }, "ChannelMeta": { "type": "object", "properties": { "name": { "type": "string" }, "route": { "type": "string" }, "params": { "type": "array", "items": { "type": "string" } }, "query": { "type": "array", "items": { "type": "string" } }, "input": { "type": ["string", "null"] }, "connect": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "disconnect": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "message": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "messageWirings": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ChannelMessageMeta" } } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "route", "input", "connect", "disconnect", "message", "messageWirings"], "additionalProperties": false }, "ChannelMessageMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId"], "additionalProperties": false }, "QueueWorkerMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "queueName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "config": { "type": "object", "additionalProperties": {} } }, "required": ["pikkuFuncId", "queueName"], "additionalProperties": false }, "SchedulerTaskMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "name": { "type": "string" }, "schedule": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId", "name", "schedule"], "additionalProperties": false }, "RpcMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" } }, "required": ["pikkuFuncId"], "additionalProperties": false }, "McpItemMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "method": { "type": "string", "enum": ["resource", "tool", "prompt"] }, "name": { "type": "string" }, "wireId": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "errors": { "type": "array", "items": { "type": "string" } }, "uri": { "type": "string" }, "arguments": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "boolean" } }, "required": ["name"], "additionalProperties": false } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "inputSchemaName": { "type": "string" }, "outputSchemaName": { "type": "string" } }, "required": ["pikkuFuncId", "method"], "additionalProperties": false }, "GatewayItemMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string", "enum": ["webhook", "websocket", "listener"] }, "route": { "type": "string" }, "platform": { "type": "string" }, "packageName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "errors": { "type": "array", "items": { "type": "string" } }, "auth": { "type": "boolean" }, "gateway": { "type": "boolean", "const": true }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId", "name", "type", "gateway"], "additionalProperties": false }, "WorkflowsMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" } }, "context": { "$ref": "#/definitions/WorkflowContext" }, "dsl": { "type": "boolean" }, "expose": { "type": "boolean" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "pikkuFuncId", "steps"] }, "description": "Workflows metadata for inspector/CLI (DSL step-based format)" }, "WorkflowStepMeta": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/BranchStepMeta" }, { "$ref": "#/definitions/ParallelGroupStepMeta" }, { "$ref": "#/definitions/FanoutStepMeta" }, { "$ref": "#/definitions/ReturnStepMeta" }, { "$ref": "#/definitions/InlineStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/CancelStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/SwitchStepMeta" }, { "$ref": "#/definitions/FilterStepMeta" }, { "$ref": "#/definitions/ArrayPredicateStepMeta" }, { "$ref": "#/definitions/SetStepMeta" }], "description": "Workflow step metadata (extracted by inspector)" }, "RpcStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "rpc", "description": "RPC form - generates queue worker" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "rpcName": { "type": "string", "description": "RPC to invoke" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName", "rpcName"], "additionalProperties": false, "description": "RPC step metadata (base form)" }, "InputSource": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "item" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "template" }, "parts": { "type": "array", "items": { "type": "string" } }, "expressions": { "type": "array", "items": { "$ref": "#/definitions/InputSource" } } }, "required": ["from", "parts", "expressions"], "additionalProperties": false }], "description": "Input source for step arguments in DSL workflows" }, "WorkflowStepOptions": { "type": "object", "properties": { "description": { "type": "string", "description": "Display name for logs/UI (optional, doesn't affect execution)" }, "retries": { "type": "number", "description": "Number of retry attempts for failed steps (only applies to local execution)" }, "retryDelay": { "type": ["string", "number"], "description": "Delay between retry attempts (e.g., '1s', '2s', '2min')" } }, "additionalProperties": false, "description": "Workflow step options" }, "BranchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "branch" }, "branches": { "type": "array", "items": { "$ref": "#/definitions/BranchCase" }, "description": "Branches in order: first is \"if\", rest are \"else if\"" }, "elseSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Else branch steps (when no conditions match)" } }, "required": ["type", "branches"], "additionalProperties": false, "description": "Branch step metadata (if/else-if/else control flow)" }, "BranchCase": { "type": "object", "properties": { "condition": { "$ref": "#/definitions/Condition", "description": "Condition for this branch" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute when condition is true" } }, "required": ["condition", "steps"], "additionalProperties": false, "description": "A single branch in an if/else-if chain" }, "Condition": { "anyOf": [{ "$ref": "#/definitions/SimpleCondition" }, { "type": "object", "properties": { "type": { "type": "string", "const": "and" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "or" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }], "description": "Nested condition structure supporting AND/OR operations" }, "SimpleCondition": { "type": "object", "properties": { "type": { "type": "string", "const": "simple" }, "expression": { "type": "string" } }, "required": ["type", "expression"], "additionalProperties": false, "description": "Simple condition expression (leaf node)" }, "ParallelGroupStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "parallel" }, "children": { "type": "array", "items": { "$ref": "#/definitions/RpcStepMeta" }, "description": "Child steps to execute in parallel" } }, "required": ["type", "children"], "additionalProperties": false, "description": "Parallel group step metadata (Promise.all with multiple steps)" }, "FanoutStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "fanout" }, "stepName": { "type": "string", "description": "Step name for this fanout" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "mode": { "type": "string", "enum": ["parallel", "sequential"], "description": "Execution mode" }, "child": { "$ref": "#/definitions/RpcStepMeta", "description": "Child step to execute per iteration" }, "timeBetween": { "type": "string", "description": "Time between iterations (sequential mode only)" } }, "required": ["type", "stepName", "sourceVar", "itemVar", "mode", "child"], "additionalProperties": false, "description": "Fanout step metadata (parallel or sequential iteration)" }, "ReturnStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "return" }, "outputs": { "type": "object", "additionalProperties": { "$ref": "#/definitions/OutputBinding" }, "description": "Output bindings" } }, "required": ["type", "outputs"], "additionalProperties": false, "description": "Return step metadata (workflow output)" }, "OutputBinding": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "stateVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "expression" }, "expression": { "type": "string" } }, "required": ["from", "expression"], "additionalProperties": false }], "description": "Output binding for return statements in DSL workflows" }, "InlineStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "inline", "description": "Inline form - local execution" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "description": { "type": "string", "description": "Display name" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName"], "additionalProperties": false, "description": "Inline step metadata (legacy support)" }, "SleepStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "sleep", "description": "Sleep step" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.sleep)" }, "duration": { "type": ["string", "number"], "description": "Sleep duration" } }, "required": ["type", "stepName", "duration"], "additionalProperties": false, "description": "Sleep step metadata" }, "CancelStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "cancel", "description": "Cancel step" }, "reason": { "type": "string", "description": "Optional cancellation reason" } }, "required": ["type"], "additionalProperties": false, "description": "Cancel step metadata" }, "SuspendStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "suspend" }, "reason": { "type": "string", "description": "Reason string passed to workflow.suspend() — becomes the durable step key" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Suspend step metadata (workflow.suspend())" }, "SwitchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "switch" }, "expression": { "type": "string", "description": "Expression being switched on" }, "cases": { "type": "array", "items": { "$ref": "#/definitions/SwitchCaseMeta" }, "description": "Case branches" }, "defaultSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Default case steps (optional)" } }, "required": ["type", "expression", "cases"], "additionalProperties": false, "description": "Switch step metadata (switch/case control flow)" }, "SwitchCaseMeta": { "type": "object", "properties": { "value": { "type": ["string", "number", "boolean", "null"], "description": "Case value (literal) or expression" }, "expression": { "type": "string", "description": "Case expression (for complex cases)" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute for this case" } }, "required": ["steps"], "additionalProperties": false, "description": "Switch case metadata" }, "FilterStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "filter" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Filter condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Filter step metadata (array.filter)" }, "ArrayPredicateStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "arrayPredicate" }, "mode": { "type": "string", "enum": ["some", "every"], "description": "Predicate mode" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Predicate condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "mode", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Array predicate step metadata (array.some, array.every)" }, "SetStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "set", "description": "Set step" }, "variable": { "type": "string", "description": "Variable name to set (must be in context)" }, "value": { "description": "Value to assign (literal or expression)" } }, "required": ["type", "variable", "value"], "additionalProperties": false, "description": "Set step metadata (context variable assignment)" }, "WorkflowContext": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ContextVariable" }, "description": "Workflow context - state variables with defaults and types" }, "ContextVariable": { "type": "object", "properties": { "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"], "description": "Variable type" }, "default": { "description": "Default value" }, "description": { "type": "string", "description": "Description for UI/docs" } }, "required": ["type"], "additionalProperties": false, "description": "Context variable definition (serialized from Zod schema or type inference)" }, "TriggerMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "name": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId", "name"], "additionalProperties": false }, "TriggerSourceMeta": { "type": "object", "properties": { "name": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" } }, "required": ["name", "pikkuFuncId"], "additionalProperties": false }, "MiddlewareGroupsMeta": { "type": "object", "properties": { "definitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/MiddlewareDefinitionMeta" } }, "instances": { "type": "object", "additionalProperties": { "$ref": "#/definitions/MiddlewareInstanceMeta" } }, "httpGroups": { "type": "object", "additionalProperties": { "$ref": "#/definitions/GroupMeta" } }, "tagGroups": { "type": "object", "additionalProperties": { "$ref": "#/definitions/GroupMeta" } } }, "required": ["definitions", "instances", "httpGroups", "tagGroups"], "additionalProperties": false }, "MiddlewareDefinitionMeta": { "type": "object", "properties": { "services": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "sourceFile": { "type": "string" }, "position": { "type": "number" }, "exportedName": { "type": ["string", "null"] }, "factory": { "type": "boolean" }, "name": { "type": "string" }, "description": { "type": "string" }, "package": { "type": "string" } }, "required": ["services", "sourceFile", "position", "exportedName"], "additionalProperties": false }, "MiddlewareInstanceMeta": { "type": "object", "properties": { "definitionId": { "type": "string" }, "sourceFile": { "type": "string" }, "position": { "type": "number" }, "isFactoryCall": { "type": "boolean" } }, "required": ["definitionId", "sourceFile", "position", "isFactoryCall"], "additionalProperties": false }, "GroupMeta": { "type": "object", "properties": { "exportName": { "type": ["string", "null"] }, "sourceFile": { "type": "string" }, "position": { "type": "number" }, "services": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "count": { "type": "number" }, "instanceIds": { "type": "array", "items": { "type": "string" } }, "isFactory": { "type": "boolean" } }, "required": ["exportName", "sourceFile", "position", "services", "count", "instanceIds", "isFactory"], "additionalProperties": false }, "PermissionsGroupsMeta": { "type": "object", "properties": { "definitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/PermissionDefinitionMeta" } }, "httpGroups": { "type": "object", "additionalProperties": { "$ref": "#/definitions/GroupMeta" } }, "tagGroups": { "type": "object", "additionalProperties": { "$ref": "#/definitions/GroupMeta" } } }, "required": ["definitions", "httpGroups", "tagGroups"], "additionalProperties": false }, "PermissionDefinitionMeta": { "type": "object", "properties": { "services": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "sourceFile": { "type": "string" }, "position": { "type": "number" }, "exportedName": { "type": ["string", "null"] }, "factory": { "type": "boolean" }, "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["services", "sourceFile", "position", "exportedName"], "additionalProperties": false }, "AgentsMeta": { "$ref": "#/definitions/AIAgentMeta" }, "AIAgentMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "tools": { "type": "array", "items": { "type": "string" } }, "agents": { "type": "array", "items": { "type": "string" } }, "inputSchema": { "type": ["string", "null"] }, "outputSchema": { "type": ["string", "null"] }, "workingMemorySchema": { "type": ["string", "null"] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "channelMiddleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "aiMiddleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "role": { "type": "string" }, "personality": { "type": "string" }, "goal": { "type": "string" }, "model": { "type": "string" }, "temperature": { "type": "number" }, "agentMode": { "type": "string", "enum": ["delegate", "supervise"] }, "memory": { "$ref": "#/definitions/AIAgentMemoryConfig" }, "maxSteps": { "type": "number" }, "toolChoice": { "type": "string", "enum": ["auto", "required", "none"] }, "tags": { "type": "array", "items": { "type": "string" } }, "prepareStep": { "$comment": "(ctx: {\n stepNumber: number;\n messages: AIMessage[];\n tools: AIAgentToolDef[];\n toolChoice: 'auto' | 'required' | 'none';\n model: string;\n stop: () => void;\n }) => void | Promise<void>", "type": "object", "properties": { "namedArgs": { "type": "object", "properties": { "ctx": { "type": "object", "properties": { "stepNumber": { "type": "number" }, "messages": { "type": "array", "items": { "$ref": "#/definitions/AIMessage" } }, "tools": { "type": "array", "items": { "$ref": "#/definitions/AIAgentToolDef" } }, "toolChoice": { "type": "string", "enum": ["auto", "required", "none"] }, "model": { "type": "string" }, "stop": { "$comment": "() => void" } }, "required": ["stepNumber", "messages", "tools", "toolChoice", "model", "stop"], "additionalProperties": false } }, "required": ["ctx"], "additionalProperties": false } } } }, "required": ["description", "goal", "inputSchema", "model", "name", "outputSchema", "workingMemorySchema"] } }, "AIAgentMemoryConfig": { "type": "object", "properties": { "storage": { "type": "string" }, "vector": { "type": "string" }, "embedder": { "type": "string" }, "lastMessages": { "type": "number" }, "workingMemory": {} }, "additionalProperties": false }, "AIMessage": { "type": "object", "properties": { "id": { "type": "string" }, "role": { "type": "string", "enum": ["system", "user", "assistant", "tool"] }, "content": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "$ref": "#/definitions/AIContentPart" } }] }, "toolCalls": { "type": "array", "items": { "$ref": "#/definitions/AIToolCall" } }, "toolResults": { "type": "array", "items": { "$ref": "#/definitions/AIToolResult" } }, "reasoningContent": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": ["id", "role", "createdAt"], "additionalProperties": false }, "AIContentPart": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": ["type", "text"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "url": { "type": "string" }, "mediaType": { "type": "string" } }, "required": ["type"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "file" }, "data": { "type": "string" }, "url": { "type": "string" }, "mediaType": { "type": "string" }, "filename": { "type": "string" } }, "required": ["type", "mediaType"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "data" }, "name": { "type": "string" }, "data": {} }, "required": ["type", "name", "data"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "generative-ui" }, "spec": {} }, "required": ["type", "spec"], "additionalProperties": false }] }, "AIToolCall": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "args": { "type": "object", "additionalProperties": {} } }, "required": ["id", "name", "args"], "additionalProperties": false }, "AIToolResult": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "result": { "type": "string" } }, "required": ["id", "name", "result"], "additionalProperties": false }, "AIAgentToolDef": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "inputSchema": { "type": "object", "additionalProperties": {} }, "execute": { "$comment": "(input: unknown) => Promise<unknown>", "type": "object", "properties": { "namedArgs": { "type": "object", "properties": { "input": {} }, "required": ["input"], "additionalProperties": false } } }, "needsApproval": { "type": "boolean" }, "approvalDescriptionFn": { "$comment": "(input: unknown) => Promise<string>", "type": "object", "properties": { "namedArgs": { "type": "object", "properties": { "input": {} }, "required": ["input"], "additionalProperties": false } } } }, "required": ["name", "description", "inputSchema", "execute"], "additionalProperties": false }, "EmailsMeta": { "type": "object", "properties": { "src": { "type": "string" }, "themeHash": { "type": "string" }, "templates": { "type": "object", "additionalProperties": { "$ref": "#/definitions/EmailTemplateMeta" } } }, "required": ["src", "themeHash", "templates"], "additionalProperties": false }, "EmailTemplateMeta": { "type": "object", "properties": { "variables": { "type": "array", "items": { "type": "string" } }, "hasHtml": { "type": "boolean" }, "hasSubject": { "type": "boolean" }, "hasText": { "type": "boolean" }, "locales": { "type": "object", "additionalProperties": { "$ref": "#/definitions/EmailTemplateLocaleMeta" } } }, "required": ["variables", "hasHtml", "hasSubject", "hasText", "locales"], "additionalProperties": false }, "EmailTemplateLocaleMeta": { "type": "object", "properties": { "contentHash": { "type": "string" }, "htmlHash": { "type": "string" }, "subjectHash": { "type": "string" }, "textHash": { "type": "string" } }, "required": ["contentHash", "htmlHash", "subjectHash", "textHash"], "additionalProperties": false }, "FunctionUsedBy": { "type": "object", "properties": { "transports": { "type": "array", "items": { "$ref": "#/definitions/WiringRef" } }, "jobs": { "type": "array", "items": { "$ref": "#/definitions/WiringRef" } }, "workflows": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": ["id", "name"], "additionalProperties": false } } }, "required": ["transports", "jobs", "workflows"], "additionalProperties": false }, "WiringRef": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" } }, "required": ["type", "id", "name"], "additionalProperties": false }, "MetaCounts": { "type": "object", "properties": { "functions": { "type": "number" }, "workflows": { "type": "number" }, "httpRoutes": { "type": "number" }, "channels": { "type": "number" }, "mcpTools": { "type": "number" }, "gateways": { "type": "number" }, "schedulers": { "type": "number" }, "queues": { "type": "number" }, "cliCommands": { "type": "number" }, "rpcMethods": { "type": "number" }, "triggers": { "type": "number" }, "triggerSources": { "type": "number" }, "agents": { "type": "number" }, "emails": { "type": "number" }, "secrets": { "type": "number" }, "variables": { "type": "number" } }, "required": ["functions", "workflows", "httpRoutes", "channels", "mcpTools", "gateways", "schedulers", "queues", "cliCommands", "rpcMethods", "triggers", "triggerSources", "agents", "emails", "secrets", "variables"], "additionalProperties": false } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "functions": { "type": "array", "items": { "$ref": "#/definitions/FunctionMeta" } }, "httpMeta": { "type": "array", "items": { "$ref": "#/definitions/HttpRouteMeta" } }, "cliMeta": { "type": "array", "items": { "$ref": "#/definitions/CliProgramMeta" } }, "cliRenderers": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliRendererMeta" } }, "channelsMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ChannelMeta" } }, "queueMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/QueueWorkerMeta" } }, "schedulerMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/SchedulerTaskMeta" } }, "rpcMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/RpcMeta" } }, "mcpMeta": { "type": "array", "items": { "$ref": "#/definitions/McpItemMeta" } }, "gatewayMeta": { "type": "array", "items": { "$ref": "#/definitions/GatewayItemMeta" } }, "workflows": { "$ref": "#/definitions/WorkflowsMeta" }, "userFlowActors": { "type": "object", "additionalProperties": { "type": "object", "properties": { "email": { "type": "string" }, "name": { "type": "string" }, "jobTitle": { "type": "string" }, "personality": { "type": "string" } }, "required": ["email"], "additionalProperties": false } }, "triggerMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/TriggerMeta" } }, "triggerSourceMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/TriggerSourceMeta" } }, "middlewareGroupsMeta": { "$ref": "#/definitions/MiddlewareGroupsMeta" }, "permissionsGroupsMeta": { "$ref": "#/definitions/PermissionsGroupsMeta" }, "agentsMeta": { "$ref": "#/definitions/AgentsMeta" }, "emailsMeta": { "$ref": "#/definitions/EmailsMeta" }, "secretsMeta": { "type": "object", "additionalProperties": {} }, "credentialsMeta": { "type": "object", "additionalProperties": {} }, "variablesMeta": { "type": "object", "additionalProperties": {} }, "functionUsedBy": { "type": "object", "additionalProperties": { "$ref": "#/definitions/FunctionUsedBy" } }, "counts": { "$ref": "#/definitions/MetaCounts" } }, "required": ["agentsMeta", "channelsMeta", "cliMeta", "cliRenderers", "counts", "credentialsMeta", "emailsMeta", "functionUsedBy", "functions", "gatewayMeta", "httpMeta", "mcpMeta", "middlewareGroupsMeta", "permissionsGroupsMeta", "queueMeta", "rpcMeta", "schedulerMeta", "secretsMeta", "triggerMeta", "triggerSourceMeta", "userFlowActors", "variablesMeta", "workflows"], "additionalProperties": false, "definitions": { "FunctionMeta": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "functionType": { "type": "string", "enum": ["user", "inline", "helper"] }, "funcWrapper": { "type": "string" }, "services": { "$ref": "#/definitions/FunctionServicesMeta" }, "wires": { "$ref": "#/definitions/FunctionWiresMeta" }, "inputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "outputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "isDirectFunction": { "type": "boolean" }, "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "inputSchemaName": { "type": ["string", "null"] }, "outputSchemaName": { "type": ["string", "null"] }, "expose": { "type": "boolean" }, "remote": { "type": "boolean" }, "mcp": { "type": "boolean" }, "readonly": { "type": "boolean" }, "deploy": { "type": "string", "enum": ["serverless", "server", "auto"] }, "sessionless": { "type": "boolean" }, "workflowQueued": { "type": "boolean", "description": "When true, workflow steps calling this function are dispatched via the queue. No queue service configured is a hard error." }, "workflowRetries": { "type": "number", "description": "Retry count when this function is used as a workflow step." }, "workflowTimeout": { "type": "string", "description": "Timeout when this function is used as a workflow step (e.g. '30s', '5m')." }, "version": { "type": "number" }, "approvalRequired": { "type": "boolean" }, "approvalDescription": { "type": "string" }, "implementationHash": { "type": "string" }, "contractHash": { "type": "string" }, "inputHash": { "type": "string" }, "outputHash": { "type": "string" } }, "required": ["inputSchemaName", "outputSchemaName", "pikkuFuncId"] }, "FunctionServicesMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "FunctionWiresMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "wires": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "wires"], "additionalProperties": false }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for permissions at any level\n- type: 'http' = HTTP route permission group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based permission group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual permission" }, "HttpRouteMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "route": { "type": "string" }, "method": { "type": "string" }, "params": { "type": "array", "items": { "type": "string" } }, "query": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "errors": { "type": "array", "items": { "type": "string" } }, "auth": { "type": "boolean" }, "sse": { "type": "boolean" }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "inputSchemaName": { "type": "string" }, "outputSchemaName": { "type": "string" } }, "required": ["pikkuFuncId", "route", "method"], "additionalProperties": false }, "CliProgramMeta": { "type": "object", "properties": { "wireId": { "type": "string" }, "program": { "type": "string" }, "description": { "type": "string" }, "commands": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliCommandMeta" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliOptionMeta" } }, "defaultRenderName": { "type": "string" } }, "required": ["wireId", "program", "commands", "options"], "additionalProperties": false }, "CliCommandMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "parameters": { "type": "string" }, "positionals": { "type": "array", "items": { "$ref": "#/definitions/CliPositionalMeta" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliOptionMeta" } }, "renderName": { "type": "string" }, "subcommands": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CliCommandMeta" } }, "isDefault": { "type": "boolean" } }, "required": ["pikkuFuncId", "positionals", "options"], "additionalProperties": false }, "CliPositionalMeta": { "type": "object", "properties": { "name": { "type": "string" }, "required": { "type": "boolean" }, "variadic": { "type": "boolean" } }, "required": ["name", "required"], "additionalProperties": false }, "CliOptionMeta": { "type": "object", "properties": { "description": { "type": "string" }, "short": { "type": "string" }, "default": {}, "choices": { "type": "array", "items": {} }, "array": { "type": "boolean" }, "required": { "type": "boolean" } }, "required": ["description"], "additionalProperties": false }, "CliRendererMeta": { "type": "object", "properties": { "name": { "type": "string" }, "exportedName": { "type": "string" }, "filePath": { "type": "string" }, "services": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false } }, "required": ["name", "filePath", "services"], "additionalProperties": false }, "ChannelMeta": { "type": "object", "properties": { "name": { "type": "string" }, "route": { "type": "string" }, "params": { "type": "array", "items": { "type": "string" } }, "query": { "type": "array", "items": { "type": "string" } }, "input": { "type": ["string", "null"] }, "connect": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "disconnect": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "message": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "messageWirings": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ChannelMessageMeta" } } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "route", "input", "connect", "disconnect", "message", "messageWirings"], "additionalProperties": false }, "ChannelMessageMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId"], "additionalProperties": false }, "QueueWorkerMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "queueName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "config": { "type": "object", "additionalProperties": {} } }, "required": ["pikkuFuncId", "queueName"], "additionalProperties": false }, "SchedulerTaskMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "name": { "type": "string" }, "schedule": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId", "name", "schedule"], "additionalProperties": false }, "RpcMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" } }, "required": ["pikkuFuncId"], "additionalProperties": false }, "McpItemMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "method": { "type": "string", "enum": ["resource", "tool", "prompt"] }, "name": { "type": "string" }, "wireId": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "errors": { "type": "array", "items": { "type": "string" } }, "uri": { "type": "string" }, "arguments": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "boolean" } }, "required": ["name"], "additionalProperties": false } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "inputSchemaName": { "type": "string" }, "outputSchemaName": { "type": "string" } }, "required": ["pikkuFuncId", "method"], "additionalProperties": false }, "GatewayItemMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string", "enum": ["webhook", "websocket", "listener"] }, "route": { "type": "string" }, "platform": { "type": "string" }, "packageName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "errors": { "type": "array", "items": { "type": "string" } }, "auth": { "type": "boolean" }, "gateway": { "type": "boolean", "const": true }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId", "name", "type", "gateway"], "additionalProperties": false }, "WorkflowsMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" } }, "context": { "$ref": "#/definitions/WorkflowContext" }, "dsl": { "type": "boolean" }, "expose": { "type": "boolean" }, "userFlow": { "type": "boolean", "description": "True for pikkuUserFlow workflows (complex + actor steps)." }, "actors": { "type": "array", "items": { "type": "string" }, "description": "Actor names a user flow declares (personas it runs steps as)." }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "pikkuFuncId", "steps"] }, "description": "Workflows metadata for inspector/CLI (DSL step-based format)" }, "WorkflowStepMeta": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/BranchStepMeta" }, { "$ref": "#/definitions/ParallelGroupStepMeta" }, { "$ref": "#/definitions/FanoutStepMeta" }, { "$ref": "#/definitions/ReturnStepMeta" }, { "$ref": "#/definitions/InlineStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/CancelStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/SwitchStepMeta" }, { "$ref": "#/definitions/FilterStepMeta" }, { "$ref": "#/definitions/ArrayPredicateStepMeta" }, { "$ref": "#/definitions/SetStepMeta" }], "description": "Workflow step metadata (extracted by inspector)" }, "RpcStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "rpc", "description": "RPC form - generates queue worker" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "rpcName": { "type": "string", "description": "RPC to invoke" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" }, "actor": { "type": "string", "description": "User-flow actor name this step runs as ({ actor: actors.x })" }, "expectEventually": { "type": "boolean", "description": "True for workflow.expectEventually polling steps" } }, "required": ["type", "stepName", "rpcName"], "additionalProperties": false, "description": "RPC step metadata (base form)" }, "InputSource": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "item" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "template" }, "parts": { "type": "array", "items": { "type": "string" } }, "expressions": { "type": "array", "items": { "$ref": "#/definitions/InputSource" } } }, "required": ["from", "parts", "expressions"], "additionalProperties": false }], "description": "Input source for step arguments in DSL workflows" }, "WorkflowStepOptions": { "type": "object", "properties": { "description": { "type": "string", "description": "Display name for logs/UI (optional, doesn't affect execution)" }, "retries": { "type": "number", "description": "Number of retry attempts for failed steps (only applies to local execution)" }, "retryDelay": { "type": ["string", "number"], "description": "Delay between retry attempts (e.g., '1s', '2s', '2min')" }, "actor": { "$ref": "#/definitions/UserFlowActor", "description": "Run this step as an actor (user flows). The RPC is sent through the actor's authenticated client over the REAL transport — never dispatched internally — so auth middleware and permissions are exercised end-to-end. The step is recorded durably like any RPC step." } }, "additionalProperties": false, "description": "Workflow step options" }, "UserFlowActor": { "type": "object", "properties": { "name": { "type": "string", "description": "Stable actor name (the key in pikku.config.json's actor registry)." }, "email": { "type": "string", "description": "The actor's user email — flows use it for invites/lookups." } }, "required": ["name", "email"], "additionalProperties": false, "description": "A user-flow actor: a synthetic user (a normal user row flagged `actor`) that workflow steps can run as. Passed to `workflow.do(step, rpc, data, { actor })` — the step then goes through the actor's authenticated client over the REAL transport (auth middleware, permissions, serialization all exercised), never through internal dispatch. Login is lazy: the first `invoke` signs the actor in and the session is cached for the actor's lifetime." }, "BranchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "branch" }, "branches": { "type": "array", "items": { "$ref": "#/definitions/BranchCase" }, "description": "Branches in order: first is \"if\", rest are \"else if\"" }, "elseSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Else branch steps (when no conditions match)" } }, "required": ["type", "branches"], "additionalProperties": false, "description": "Branch step metadata (if/else-if/else control flow)" }, "BranchCase": { "type": "object", "properties": { "condition": { "$ref": "#/definitions/Condition", "description": "Condition for this branch" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute when condition is true" } }, "required": ["condition", "steps"], "additionalProperties": false, "description": "A single branch in an if/else-if chain" }, "Condition": { "anyOf": [{ "$ref": "#/definitions/SimpleCondition" }, { "type": "object", "properties": { "type": { "type": "string", "const": "and" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "or" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }], "description": "Nested condition structure supporting AND/OR operations" }, "SimpleCondition": { "type": "object", "properties": { "type": { "type": "string", "const": "simple" }, "expression": { "type": "string" } }, "required": ["type", "expression"], "additionalProperties": false, "description": "Simple condition expression (leaf node)" }, "ParallelGroupStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "parallel" }, "children": { "type": "array", "items": { "$ref": "#/definitions/RpcStepMeta" }, "description": "Child steps to execute in parallel" } }, "required": ["type", "children"], "additionalProperties": false, "description": "Parallel group step metadata (Promise.all with multiple steps)" }, "FanoutStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "fanout" }, "stepName": { "type": "string", "description": "Step name for this fanout" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "mode": { "type": "string", "enum": ["parallel", "sequential"], "description": "Execution mode" }, "child": { "$ref": "#/definitions/RpcStepMeta", "description": "Child step to execute per iteration" }, "timeBetween": { "type": "string", "description": "Time between iterations (sequential mode only)" } }, "required": ["type", "stepName", "sourceVar", "itemVar", "mode", "child"], "additionalProperties": false, "description": "Fanout step metadata (parallel or sequential iteration)" }, "ReturnStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "return" }, "outputs": { "type": "object", "additionalProperties": { "$ref": "#/definitions/OutputBinding" }, "description": "Output bindings" } }, "required": ["type", "outputs"], "additionalProperties": false, "description": "Return step metadata (workflow output)" }, "OutputBinding": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "stateVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "expression" }, "expression": { "type": "string" } }, "required": ["from", "expression"], "additionalProperties": false }], "description": "Output binding for return statements in DSL workflows" }, "InlineStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "inline", "description": "Inline form - local execution" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "description": { "type": "string", "description": "Display name" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName"], "additionalProperties": false, "description": "Inline step metadata (legacy support)" }, "SleepStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "sleep", "description": "Sleep step" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.sleep)" }, "duration": { "type": ["string", "number"], "description": "Sleep duration" } }, "required": ["type", "stepName", "duration"], "additionalProperties": false, "description": "Sleep step metadata" }, "CancelStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "cancel", "description": "Cancel step" }, "reason": { "type": "string", "description": "Optional cancellation reason" } }, "required": ["type"], "additionalProperties": false, "description": "Cancel step metadata" }, "SuspendStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "suspend" }, "reason": { "type": "string", "description": "Reason string passed to workflow.suspend() — becomes the durable step key" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Suspend step metadata (workflow.suspend())" }, "SwitchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "switch" }, "expression": { "type": "string", "description": "Expression being switched on" }, "cases": { "type": "array", "items": { "$ref": "#/definitions/SwitchCaseMeta" }, "description": "Case branches" }, "defaultSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Default case steps (optional)" } }, "required": ["type", "expression", "cases"], "additionalProperties": false, "description": "Switch step metadata (switch/case control flow)" }, "SwitchCaseMeta": { "type": "object", "properties": { "value": { "type": ["string", "number", "boolean", "null"], "description": "Case value (literal) or expression" }, "expression": { "type": "string", "description": "Case expression (for complex cases)" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute for this case" } }, "required": ["steps"], "additionalProperties": false, "description": "Switch case metadata" }, "FilterStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "filter" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Filter condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Filter step metadata (array.filter)" }, "ArrayPredicateStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "arrayPredicate" }, "mode": { "type": "string", "enum": ["some", "every"], "description": "Predicate mode" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Predicate condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "mode", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Array predicate step metadata (array.some, array.every)" }, "SetStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "set", "description": "Set step" }, "variable": { "type": "string", "description": "Variable name to set (must be in context)" }, "value": { "description": "Value to assign (literal or expression)" } }, "required": ["type", "variable", "value"], "additionalProperties": false, "description": "Set step metadata (context variable assignment)" }, "WorkflowContext": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ContextVariable" }, "description": "Workflow context - state variables with defaults and types" }, "ContextVariable": { "type": "object", "properties": { "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"], "description": "Variable type" }, "default": { "description": "Default value" }, "description": { "type": "string", "description": "Description for UI/docs" } }, "required": ["type"], "additionalProperties": false, "description": "Context variable definition (serialized from Zod schema or type inference)" }, "TriggerMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "name": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId", "name"], "additionalProperties": false }, "TriggerSourceMeta": { "type": "object", "properties": { "name": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" } }, "required": ["name", "pikkuFuncId"], "additionalProperties": false }, "MiddlewareGroupsMeta": { "type": "object", "properties": { "definitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/MiddlewareDefinitionMeta" } }, "instances": { "type": "object", "additionalProperties": { "$ref": "#/definitions/MiddlewareInstanceMeta" } }, "httpGroups": { "type": "object", "additionalProperties": { "$ref": "#/definitions/GroupMeta" } }, "tagGroups": { "type": "object", "additionalProperties": { "$ref": "#/definitions/GroupMeta" } } }, "required": ["definitions", "instances", "httpGroups", "tagGroups"], "additionalProperties": false }, "MiddlewareDefinitionMeta": { "type": "object", "properties": { "services": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "sourceFile": { "type": "string" }, "position": { "type": "number" }, "exportedName": { "type": ["string", "null"] }, "factory": { "type": "boolean" }, "name": { "type": "string" }, "description": { "type": "string" }, "package": { "type": "string" } }, "required": ["services", "sourceFile", "position", "exportedName"], "additionalProperties": false }, "MiddlewareInstanceMeta": { "type": "object", "properties": { "definitionId": { "type": "string" }, "sourceFile": { "type": "string" }, "position": { "type": "number" }, "isFactoryCall": { "type": "boolean" } }, "required": ["definitionId", "sourceFile", "position", "isFactoryCall"], "additionalProperties": false }, "GroupMeta": { "type": "object", "properties": { "exportName": { "type": ["string", "null"] }, "sourceFile": { "type": "string" }, "position": { "type": "number" }, "services": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "count": { "type": "number" }, "instanceIds": { "type": "array", "items": { "type": "string" } }, "isFactory": { "type": "boolean" } }, "required": ["exportName", "sourceFile", "position", "services", "count", "instanceIds", "isFactory"], "additionalProperties": false }, "PermissionsGroupsMeta": { "type": "object", "properties": { "definitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/PermissionDefinitionMeta" } }, "httpGroups": { "type": "object", "additionalProperties": { "$ref": "#/definitions/GroupMeta" } }, "tagGroups": { "type": "object", "additionalProperties": { "$ref": "#/definitions/GroupMeta" } } }, "required": ["definitions", "httpGroups", "tagGroups"], "additionalProperties": false }, "PermissionDefinitionMeta": { "type": "object", "properties": { "services": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "sourceFile": { "type": "string" }, "position": { "type": "number" }, "exportedName": { "type": ["string", "null"] }, "factory": { "type": "boolean" }, "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["services", "sourceFile", "position", "exportedName"], "additionalProperties": false }, "AgentsMeta": { "$ref": "#/definitions/AIAgentMeta" }, "AIAgentMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "tools": { "type": "array", "items": { "type": "string" } }, "agents": { "type": "array", "items": { "type": "string" } }, "inputSchema": { "type": ["string", "null"] }, "outputSchema": { "type": ["string", "null"] }, "workingMemorySchema": { "type": ["string", "null"] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "channelMiddleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "aiMiddleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "role": { "type": "string" }, "personality": { "type": "string" }, "goal": { "type": "string" }, "model": { "type": "string" }, "temperature": { "type": "number" }, "agentMode": { "type": "string", "enum": ["delegate", "supervise"] }, "memory": { "$ref": "#/definitions/AIAgentMemoryConfig" }, "maxSteps": { "type": "number" }, "toolChoice": { "type": "string", "enum": ["auto", "required", "none"] }, "tags": { "type": "array", "items": { "type": "string" } }, "prepareStep": { "$comment": "(ctx: {\n stepNumber: number;\n messages: AIMessage[];\n tools: AIAgentToolDef[];\n toolChoice: 'auto' | 'required' | 'none';\n model: string;\n stop: () => void;\n }) => void | Promise<void>", "type": "object", "properties": { "namedArgs": { "type": "object", "properties": { "ctx": { "type": "object", "properties": { "stepNumber": { "type": "number" }, "messages": { "type": "array", "items": { "$ref": "#/definitions/AIMessage" } }, "tools": { "type": "array", "items": { "$ref": "#/definitions/AIAgentToolDef" } }, "toolChoice": { "type": "string", "enum": ["auto", "required", "none"] }, "model": { "type": "string" }, "stop": { "$comment": "() => void" } }, "required": ["stepNumber", "messages", "tools", "toolChoice", "model", "stop"], "additionalProperties": false } }, "required": ["ctx"], "additionalProperties": false } } } }, "required": ["description", "goal", "inputSchema", "model", "name", "outputSchema", "workingMemorySchema"] } }, "AIAgentMemoryConfig": { "type": "object", "properties": { "storage": { "type": "string" }, "vector": { "type": "string" }, "embedder": { "type": "string" }, "lastMessages": { "type": "number" }, "workingMemory": {} }, "additionalProperties": false }, "AIMessage": { "type": "object", "properties": { "id": { "type": "string" }, "role": { "type": "string", "enum": ["system", "user", "assistant", "tool"] }, "content": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "$ref": "#/definitions/AIContentPart" } }] }, "toolCalls": { "type": "array", "items": { "$ref": "#/definitions/AIToolCall" } }, "toolResults": { "type": "array", "items": { "$ref": "#/definitions/AIToolResult" } }, "reasoningContent": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": ["id", "role", "createdAt"], "additionalProperties": false }, "AIContentPart": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": ["type", "text"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "url": { "type": "string" }, "mediaType": { "type": "string" } }, "required": ["type"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "file" }, "data": { "type": "string" }, "url": { "type": "string" }, "mediaType": { "type": "string" }, "filename": { "type": "string" } }, "required": ["type", "mediaType"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "data" }, "name": { "type": "string" }, "data": {} }, "required": ["type", "name", "data"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "generative-ui" }, "spec": {} }, "required": ["type", "spec"], "additionalProperties": false }] }, "AIToolCall": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "args": { "type": "object", "additionalProperties": {} } }, "required": ["id", "name", "args"], "additionalProperties": false }, "AIToolResult": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "result": { "type": "string" } }, "required": ["id", "name", "result"], "additionalProperties": false }, "AIAgentToolDef": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "inputSchema": { "type": "object", "additionalProperties": {} }, "execute": { "$comment": "(input: unknown) => Promise<unknown>", "type": "object", "properties": { "namedArgs": { "type": "object", "properties": { "input": {} }, "required": ["input"], "additionalProperties": false } } }, "needsApproval": { "type": "boolean" }, "approvalDescriptionFn": { "$comment": "(input: unknown) => Promise<string>", "type": "object", "properties": { "namedArgs": { "type": "object", "properties": { "input": {} }, "required": ["input"], "additionalProperties": false } } } }, "required": ["name", "description", "inputSchema", "execute"], "additionalProperties": false }, "EmailsMeta": { "type": "object", "properties": { "src": { "type": "string" }, "themeHash": { "type": "string" }, "templates": { "type": "object", "additionalProperties": { "$ref": "#/definitions/EmailTemplateMeta" } } }, "required": ["src", "themeHash", "templates"], "additionalProperties": false }, "EmailTemplateMeta": { "type": "object", "properties": { "variables": { "type": "array", "items": { "type": "string" } }, "hasHtml": { "type": "boolean" }, "hasSubject": { "type": "boolean" }, "hasText": { "type": "boolean" }, "locales": { "type": "object", "additionalProperties": { "$ref": "#/definitions/EmailTemplateLocaleMeta" } } }, "required": ["variables", "hasHtml", "hasSubject", "hasText", "locales"], "additionalProperties": false }, "EmailTemplateLocaleMeta": { "type": "object", "properties": { "contentHash": { "type": "string" }, "htmlHash": { "type": "string" }, "subjectHash": { "type": "string" }, "textHash": { "type": "string" } }, "required": ["contentHash", "htmlHash", "subjectHash", "textHash"], "additionalProperties": false }, "FunctionUsedBy": { "type": "object", "properties": { "transports": { "type": "array", "items": { "$ref": "#/definitions/WiringRef" } }, "jobs": { "type": "array", "items": { "$ref": "#/definitions/WiringRef" } }, "workflows": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": ["id", "name"], "additionalProperties": false } } }, "required": ["transports", "jobs", "workflows"], "additionalProperties": false }, "WiringRef": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" } }, "required": ["type", "id", "name"], "additionalProperties": false }, "MetaCounts": { "type": "object", "properties": { "functions": { "type": "number" }, "workflows": { "type": "number" }, "httpRoutes": { "type": "number" }, "channels": { "type": "number" }, "mcpTools": { "type": "number" }, "gateways": { "type": "number" }, "schedulers": { "type": "number" }, "queues": { "type": "number" }, "cliCommands": { "type": "number" }, "rpcMethods": { "type": "number" }, "triggers": { "type": "number" }, "triggerSources": { "type": "number" }, "agents": { "type": "number" }, "emails": { "type": "number" }, "secrets": { "type": "number" }, "variables": { "type": "number" } }, "required": ["functions", "workflows", "httpRoutes", "channels", "mcpTools", "gateways", "schedulers", "queues", "cliCommands", "rpcMethods", "triggers", "triggerSources", "agents", "emails", "secrets", "variables"], "additionalProperties": false } } }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", "items": { "$ref": "#/definitions/AddonPackageInfo" }, "definitions": { "AddonPackageInfo": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "displayName": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "author": { "type": "string" }, "repository": { "type": "string" }, "license": { "type": "string" }, "readme": { "type": "string" }, "icon": { "type": "string" }, "publishedAt": { "type": "string" }, "updatedAt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "categories": { "type": "array", "items": { "type": "string" } }, "functions": { "$ref": "#/definitions/FunctionsMeta" }, "agents": { "type": "object", "additionalProperties": {} }, "secrets": { "type": "object", "additionalProperties": {} }, "variables": { "type": "object", "additionalProperties": {} }, "httpRoutes": { "$ref": "#/definitions/HTTPWiringsMeta" }, "channels": { "$ref": "#/definitions/ChannelsMeta" }, "cli": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLIProgramMeta" } }, "mcp": { "anyOf": [{ "$ref": "#/definitions/McpMeta" }, { "type": "null" }] }, "schemas": { "type": "object", "additionalProperties": {} } }, "required": ["id", "name", "displayName", "version", "description", "author", "publishedAt", "updatedAt", "tags", "categories", "functions", "agents", "secrets", "variables", "httpRoutes", "channels", "cli", "mcp", "schemas"], "additionalProperties": false }, "FunctionsMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/FunctionMeta" } }, "FunctionMeta": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "functionType": { "type": "string", "enum": ["user", "inline", "helper"] }, "funcWrapper": { "type": "string" }, "services": { "$ref": "#/definitions/FunctionServicesMeta" }, "wires": { "$ref": "#/definitions/FunctionWiresMeta" }, "inputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "outputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "isDirectFunction": { "type": "boolean" }, "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "inputSchemaName": { "type": ["string", "null"] }, "outputSchemaName": { "type": ["string", "null"] }, "expose": { "type": "boolean" }, "remote": { "type": "boolean" }, "mcp": { "type": "boolean" }, "readonly": { "type": "boolean" }, "deploy": { "type": "string", "enum": ["serverless", "server", "auto"] }, "sessionless": { "type": "boolean" }, "workflowQueued": { "type": "boolean", "description": "When true, workflow steps calling this function are dispatched via the queue. No queue service configured is a hard error." }, "workflowRetries": { "type": "number", "description": "Retry count when this function is used as a workflow step." }, "workflowTimeout": { "type": "string", "description": "Timeout when this function is used as a workflow step (e.g. '30s', '5m')." }, "version": { "type": "number" }, "approvalRequired": { "type": "boolean" }, "approvalDescription": { "type": "string" }, "implementationHash": { "type": "string" }, "contractHash": { "type": "string" }, "inputHash": { "type": "string" }, "outputHash": { "type": "string" } }, "required": ["inputSchemaName", "outputSchemaName", "pikkuFuncId"] }, "FunctionServicesMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "FunctionWiresMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "wires": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "wires"], "additionalProperties": false }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for permissions at any level\n- type: 'http' = HTTP route permission group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based permission group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual permission" }, "HTTPWiringsMeta": { "type": "object", "properties": { "post": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "get": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "delete": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "patch": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "head": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "put": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } } }, "required": ["post", "get", "delete", "patch", "head", "put", "options"], "additionalProperties": false }, "HTTPWiringMeta": { "type": "object", "additionalProperties": false, "properties": { "route": { "type": "string" }, "method": { "$ref": "#/definitions/HTTPMethod" }, "params": { "type": "array", "items": { "type": "string" } }, "query": { "type": "array", "items": { "type": "string" } }, "inputTypes": { "$ref": "#/definitions/HTTPFunctionMetaInputTypes" }, "headersSchemaName": { "type": "string" }, "sse": { "type": "boolean", "const": true }, "groupBasePath": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["method", "pikkuFuncId", "route"], "description": "Represents metadata for a set of HTTP wirings, including HTTP wiring details, methods, input/output types, and documentation." }, "HTTPMethod": { "type": "string", "enum": ["post", "get", "delete", "patch", "head", "put", "options"], "description": "Represents the HTTP methods supported for API HTTP wirings." }, "HTTPFunctionMetaInputTypes": { "type": "object", "properties": { "params": { "type": "string" }, "query": { "type": "string" }, "body": { "type": "string" } }, "additionalProperties": false, "description": "Represents the input types for HTTP wiring metadata, including parameters, query, and body types." }, "ChannelsMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ChannelMeta" } }, "ChannelMeta": { "type": "object", "properties": { "name": { "type": "string" }, "route": { "type": "string" }, "params": { "type": "array", "items": { "type": "string" } }, "query": { "type": "array", "items": { "type": "string" } }, "input": { "type": ["string", "null"] }, "inputTypes": { "$ref": "#/definitions/HTTPFunctionMetaInputTypes" }, "connect": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "disconnect": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "message": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "messageWirings": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ChannelMessageMeta" } } }, "binary": { "type": ["boolean", "null"] }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "channelMiddleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } } }, "required": ["name", "route", "input", "connect", "disconnect", "message", "messageWirings"], "additionalProperties": false }, "ChannelMessageMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId"], "additionalProperties": false }, "CLIProgramMeta": { "type": "object", "properties": { "program": { "type": "string" }, "commands": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLICommandMeta" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLIOption" } }, "defaultRenderName": { "type": "string" } }, "required": ["program", "commands", "options"], "additionalProperties": false, "description": "CLI metadata collection (per program)" }, "CLICommandMeta": { "type": "object", "properties": { "parameters": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "positionals": { "type": "array", "items": { "$ref": "#/definitions/CLIPositional" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLIOption" } }, "renderName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "subcommands": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLICommandMeta" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "isDefault": { "type": "boolean" } }, "required": ["pikkuFuncId", "positionals", "options"], "additionalProperties": false, "description": "CLI command metadata for runtime" }, "CLIPositional": { "type": "object", "properties": { "name": { "type": "string" }, "required": { "type": "boolean" }, "variadic": { "type": "boolean" } }, "required": ["name", "required"], "additionalProperties": false, "description": "Positional argument definition" }, "CLIOption": { "type": "object", "properties": { "description": { "type": "string" }, "short": { "type": "string" }, "default": {}, "choices": { "type": "array", "items": {} }, "array": { "type": "boolean" }, "required": { "type": "boolean" } }, "required": ["description"], "additionalProperties": false, "description": "CLI option definition" }, "McpMeta": { "type": "object", "properties": { "toolsMeta": { "$ref": "#/definitions/MCPToolMeta" }, "resourcesMeta": { "$ref": "#/definitions/MCPResourceMeta" }, "promptsMeta": { "$ref": "#/definitions/MCPPromptMeta" } }, "required": ["toolsMeta", "resourcesMeta", "promptsMeta"], "additionalProperties": false }, "MCPToolMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "pikkuFuncId": { "type": "string" }, "inputSchema": { "type": ["string", "null"] }, "outputSchema": { "type": ["string", "null"] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "name": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "streaming": { "type": "boolean" } }, "required": ["inputSchema", "name", "outputSchema", "pikkuFuncId"] }, "description": "Represents metadata for MCP tools, including name, description, and documentation." }, "MCPResourceMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "pikkuFuncId": { "type": "string" }, "inputSchema": { "type": ["string", "null"] }, "outputSchema": { "type": ["string", "null"] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "uri": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "mimeType": { "type": "string" }, "size": { "type": "number" }, "streaming": { "type": "boolean" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": ["description", "inputSchema", "outputSchema", "pikkuFuncId", "title", "uri"] }, "description": "Represents metadata for MCP resources, including name, description, and documentation." }, "MCPPromptMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "pikkuFuncId": { "type": "string" }, "inputSchema": { "type": ["string", "null"] }, "outputSchema": { "type": ["string", "null"] }, "arguments": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "boolean" } }, "required": ["name", "description", "required"], "additionalProperties": false } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "name": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": ["arguments", "description", "inputSchema", "name", "outputSchema", "pikkuFuncId"] }, "description": "Represents metadata for MCP prompts, including name, description, and arguments." } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", "items": { "$ref": "#/definitions/AddonPackageInfo" }, "definitions": { "AddonPackageInfo": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "displayName": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "author": { "type": "string" }, "repository": { "type": "string" }, "license": { "type": "string" }, "readme": { "type": "string" }, "icon": { "type": "string" }, "publishedAt": { "type": "string" }, "updatedAt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "categories": { "type": "array", "items": { "type": "string" } }, "functions": { "$ref": "#/definitions/FunctionsMeta" }, "agents": { "type": "object", "additionalProperties": {} }, "secrets": { "type": "object", "additionalProperties": {} }, "variables": { "type": "object", "additionalProperties": {} }, "httpRoutes": { "$ref": "#/definitions/HTTPWiringsMeta" }, "channels": { "$ref": "#/definitions/ChannelsMeta" }, "cli": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLIProgramMeta" } }, "mcp": { "anyOf": [{ "$ref": "#/definitions/McpMeta" }, { "type": "null" }] }, "schemas": { "type": "object", "additionalProperties": {} } }, "required": ["id", "name", "displayName", "version", "description", "author", "publishedAt", "updatedAt", "tags", "categories", "functions", "agents", "secrets", "variables", "httpRoutes", "channels", "cli", "mcp", "schemas"], "additionalProperties": false }, "FunctionsMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/FunctionMeta" } }, "FunctionMeta": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "functionType": { "type": "string", "enum": ["user", "inline", "helper"] }, "funcWrapper": { "type": "string" }, "services": { "$ref": "#/definitions/FunctionServicesMeta" }, "wires": { "$ref": "#/definitions/FunctionWiresMeta" }, "inputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "outputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "isDirectFunction": { "type": "boolean" }, "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "inputSchemaName": { "type": ["string", "null"] }, "outputSchemaName": { "type": ["string", "null"] }, "expose": { "type": "boolean" }, "remote": { "type": "boolean" }, "mcp": { "type": "boolean" }, "readonly": { "type": "boolean" }, "deploy": { "type": "string", "enum": ["serverless", "server", "auto"] }, "sessionless": { "type": "boolean" }, "workflowQueued": { "type": "boolean", "description": "When true, workflow steps calling this function are dispatched via the queue. No queue service configured is a hard error." }, "workflowRetries": { "type": "number", "description": "Retry count when this function is used as a workflow step." }, "workflowTimeout": { "type": "string", "description": "Timeout when this function is used as a workflow step (e.g. '30s', '5m')." }, "version": { "type": "number" }, "approvalRequired": { "type": "boolean" }, "approvalDescription": { "type": "string" }, "implementationHash": { "type": "string" }, "contractHash": { "type": "string" }, "inputHash": { "type": "string" }, "outputHash": { "type": "string" } }, "required": ["inputSchemaName", "outputSchemaName", "pikkuFuncId"] }, "FunctionServicesMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "FunctionWiresMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "wires": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "wires"], "additionalProperties": false }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for permissions at any level\n- type: 'http' = HTTP route permission group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based permission group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual permission" }, "HTTPWiringsMeta": { "type": "object", "properties": { "post": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "get": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "delete": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "patch": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "head": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "put": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/HTTPWiringMeta" } } }, "required": ["post", "get", "delete", "patch", "head", "put", "options"], "additionalProperties": false }, "HTTPWiringMeta": { "type": "object", "additionalProperties": false, "properties": { "route": { "type": "string" }, "method": { "$ref": "#/definitions/HTTPMethod" }, "refTarget": { "type": "string" }, "params": { "type": "array", "items": { "type": "string" } }, "query": { "type": "array", "items": { "type": "string" } }, "inputTypes": { "$ref": "#/definitions/HTTPFunctionMetaInputTypes" }, "headersSchemaName": { "type": "string" }, "sse": { "type": "boolean", "const": true }, "groupBasePath": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["method", "pikkuFuncId", "route"], "description": "Represents metadata for a set of HTTP wirings, including HTTP wiring details, methods, input/output types, and documentation." }, "HTTPMethod": { "type": "string", "enum": ["post", "get", "delete", "patch", "head", "put", "options"], "description": "Represents the HTTP methods supported for API HTTP wirings." }, "HTTPFunctionMetaInputTypes": { "type": "object", "properties": { "params": { "type": "string" }, "query": { "type": "string" }, "body": { "type": "string" } }, "additionalProperties": false, "description": "Represents the input types for HTTP wiring metadata, including parameters, query, and body types." }, "ChannelsMeta": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ChannelMeta" } }, "ChannelMeta": { "type": "object", "properties": { "name": { "type": "string" }, "route": { "type": "string" }, "params": { "type": "array", "items": { "type": "string" } }, "query": { "type": "array", "items": { "type": "string" } }, "input": { "type": ["string", "null"] }, "inputTypes": { "$ref": "#/definitions/HTTPFunctionMetaInputTypes" }, "connect": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "disconnect": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "message": { "anyOf": [{ "$ref": "#/definitions/ChannelMessageMeta" }, { "type": "null" }] }, "messageWirings": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ChannelMessageMeta" } } }, "binary": { "type": ["boolean", "null"] }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "channelMiddleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } } }, "required": ["name", "route", "input", "connect", "disconnect", "message", "messageWirings"], "additionalProperties": false }, "ChannelMessageMeta": { "type": "object", "properties": { "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["pikkuFuncId"], "additionalProperties": false }, "CLIProgramMeta": { "type": "object", "properties": { "program": { "type": "string" }, "commands": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLICommandMeta" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLIOption" } }, "defaultRenderName": { "type": "string" } }, "required": ["program", "commands", "options"], "additionalProperties": false, "description": "CLI metadata collection (per program)" }, "CLICommandMeta": { "type": "object", "properties": { "parameters": { "type": "string" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "positionals": { "type": "array", "items": { "$ref": "#/definitions/CLIPositional" } }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLIOption" } }, "renderName": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "subcommands": { "type": "object", "additionalProperties": { "$ref": "#/definitions/CLICommandMeta" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "isDefault": { "type": "boolean" } }, "required": ["pikkuFuncId", "positionals", "options"], "additionalProperties": false, "description": "CLI command metadata for runtime" }, "CLIPositional": { "type": "object", "properties": { "name": { "type": "string" }, "required": { "type": "boolean" }, "variadic": { "type": "boolean" } }, "required": ["name", "required"], "additionalProperties": false, "description": "Positional argument definition" }, "CLIOption": { "type": "object", "properties": { "description": { "type": "string" }, "short": { "type": "string" }, "default": {}, "choices": { "type": "array", "items": {} }, "array": { "type": "boolean" }, "required": { "type": "boolean" } }, "required": ["description"], "additionalProperties": false, "description": "CLI option definition" }, "McpMeta": { "type": "object", "properties": { "toolsMeta": { "$ref": "#/definitions/MCPToolMeta" }, "resourcesMeta": { "$ref": "#/definitions/MCPResourceMeta" }, "promptsMeta": { "$ref": "#/definitions/MCPPromptMeta" } }, "required": ["toolsMeta", "resourcesMeta", "promptsMeta"], "additionalProperties": false }, "MCPToolMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "pikkuFuncId": { "type": "string" }, "inputSchema": { "type": ["string", "null"] }, "outputSchema": { "type": ["string", "null"] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "name": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "streaming": { "type": "boolean" } }, "required": ["inputSchema", "name", "outputSchema", "pikkuFuncId"] }, "description": "Represents metadata for MCP tools, including name, description, and documentation." }, "MCPResourceMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "pikkuFuncId": { "type": "string" }, "inputSchema": { "type": ["string", "null"] }, "outputSchema": { "type": ["string", "null"] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "uri": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "mimeType": { "type": "string" }, "size": { "type": "number" }, "streaming": { "type": "boolean" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": ["description", "inputSchema", "outputSchema", "pikkuFuncId", "title", "uri"] }, "description": "Represents metadata for MCP resources, including name, description, and documentation." }, "MCPPromptMeta": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": false, "properties": { "pikkuFuncId": { "type": "string" }, "inputSchema": { "type": ["string", "null"] }, "outputSchema": { "type": ["string", "null"] }, "arguments": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "boolean" } }, "required": ["name", "description", "required"], "additionalProperties": false } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "name": { "type": "string" }, "description": { "type": "string" }, "summary": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": ["arguments", "description", "inputSchema", "name", "outputSchema", "pikkuFuncId"] }, "description": "Represents metadata for MCP prompts, including name, description, and arguments." } } }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" } }, "context": { "$ref": "#/definitions/WorkflowContext" }, "dsl": { "type": "boolean" }, "expose": { "type": "boolean" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "pikkuFuncId", "steps"], "definitions": { "WorkflowStepMeta": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/BranchStepMeta" }, { "$ref": "#/definitions/ParallelGroupStepMeta" }, { "$ref": "#/definitions/FanoutStepMeta" }, { "$ref": "#/definitions/ReturnStepMeta" }, { "$ref": "#/definitions/InlineStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/CancelStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/SwitchStepMeta" }, { "$ref": "#/definitions/FilterStepMeta" }, { "$ref": "#/definitions/ArrayPredicateStepMeta" }, { "$ref": "#/definitions/SetStepMeta" }], "description": "Workflow step metadata (extracted by inspector)" }, "RpcStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "rpc", "description": "RPC form - generates queue worker" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "rpcName": { "type": "string", "description": "RPC to invoke" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName", "rpcName"], "additionalProperties": false, "description": "RPC step metadata (base form)" }, "InputSource": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "item" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "template" }, "parts": { "type": "array", "items": { "type": "string" } }, "expressions": { "type": "array", "items": { "$ref": "#/definitions/InputSource" } } }, "required": ["from", "parts", "expressions"], "additionalProperties": false }], "description": "Input source for step arguments in DSL workflows" }, "WorkflowStepOptions": { "type": "object", "properties": { "description": { "type": "string", "description": "Display name for logs/UI (optional, doesn't affect execution)" }, "retries": { "type": "number", "description": "Number of retry attempts for failed steps (only applies to local execution)" }, "retryDelay": { "type": ["string", "number"], "description": "Delay between retry attempts (e.g., '1s', '2s', '2min')" } }, "additionalProperties": false, "description": "Workflow step options" }, "BranchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "branch" }, "branches": { "type": "array", "items": { "$ref": "#/definitions/BranchCase" }, "description": "Branches in order: first is \"if\", rest are \"else if\"" }, "elseSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Else branch steps (when no conditions match)" } }, "required": ["type", "branches"], "additionalProperties": false, "description": "Branch step metadata (if/else-if/else control flow)" }, "BranchCase": { "type": "object", "properties": { "condition": { "$ref": "#/definitions/Condition", "description": "Condition for this branch" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute when condition is true" } }, "required": ["condition", "steps"], "additionalProperties": false, "description": "A single branch in an if/else-if chain" }, "Condition": { "anyOf": [{ "$ref": "#/definitions/SimpleCondition" }, { "type": "object", "properties": { "type": { "type": "string", "const": "and" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "or" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }], "description": "Nested condition structure supporting AND/OR operations" }, "SimpleCondition": { "type": "object", "properties": { "type": { "type": "string", "const": "simple" }, "expression": { "type": "string" } }, "required": ["type", "expression"], "additionalProperties": false, "description": "Simple condition expression (leaf node)" }, "ParallelGroupStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "parallel" }, "children": { "type": "array", "items": { "$ref": "#/definitions/RpcStepMeta" }, "description": "Child steps to execute in parallel" } }, "required": ["type", "children"], "additionalProperties": false, "description": "Parallel group step metadata (Promise.all with multiple steps)" }, "FanoutStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "fanout" }, "stepName": { "type": "string", "description": "Step name for this fanout" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "mode": { "type": "string", "enum": ["parallel", "sequential"], "description": "Execution mode" }, "child": { "$ref": "#/definitions/RpcStepMeta", "description": "Child step to execute per iteration" }, "timeBetween": { "type": "string", "description": "Time between iterations (sequential mode only)" } }, "required": ["type", "stepName", "sourceVar", "itemVar", "mode", "child"], "additionalProperties": false, "description": "Fanout step metadata (parallel or sequential iteration)" }, "ReturnStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "return" }, "outputs": { "type": "object", "additionalProperties": { "$ref": "#/definitions/OutputBinding" }, "description": "Output bindings" } }, "required": ["type", "outputs"], "additionalProperties": false, "description": "Return step metadata (workflow output)" }, "OutputBinding": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "stateVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "expression" }, "expression": { "type": "string" } }, "required": ["from", "expression"], "additionalProperties": false }], "description": "Output binding for return statements in DSL workflows" }, "InlineStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "inline", "description": "Inline form - local execution" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "description": { "type": "string", "description": "Display name" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName"], "additionalProperties": false, "description": "Inline step metadata (legacy support)" }, "SleepStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "sleep", "description": "Sleep step" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.sleep)" }, "duration": { "type": ["string", "number"], "description": "Sleep duration" } }, "required": ["type", "stepName", "duration"], "additionalProperties": false, "description": "Sleep step metadata" }, "CancelStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "cancel", "description": "Cancel step" }, "reason": { "type": "string", "description": "Optional cancellation reason" } }, "required": ["type"], "additionalProperties": false, "description": "Cancel step metadata" }, "SuspendStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "suspend" }, "reason": { "type": "string", "description": "Reason string passed to workflow.suspend() — becomes the durable step key" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Suspend step metadata (workflow.suspend())" }, "SwitchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "switch" }, "expression": { "type": "string", "description": "Expression being switched on" }, "cases": { "type": "array", "items": { "$ref": "#/definitions/SwitchCaseMeta" }, "description": "Case branches" }, "defaultSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Default case steps (optional)" } }, "required": ["type", "expression", "cases"], "additionalProperties": false, "description": "Switch step metadata (switch/case control flow)" }, "SwitchCaseMeta": { "type": "object", "properties": { "value": { "type": ["string", "number", "boolean", "null"], "description": "Case value (literal) or expression" }, "expression": { "type": "string", "description": "Case expression (for complex cases)" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute for this case" } }, "required": ["steps"], "additionalProperties": false, "description": "Switch case metadata" }, "FilterStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "filter" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Filter condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Filter step metadata (array.filter)" }, "ArrayPredicateStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "arrayPredicate" }, "mode": { "type": "string", "enum": ["some", "every"], "description": "Predicate mode" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Predicate condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "mode", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Array predicate step metadata (array.some, array.every)" }, "SetStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "set", "description": "Set step" }, "variable": { "type": "string", "description": "Variable name to set (must be in context)" }, "value": { "description": "Value to assign (literal or expression)" } }, "required": ["type", "variable", "value"], "additionalProperties": false, "description": "Set step metadata (context variable assignment)" }, "WorkflowContext": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ContextVariable" }, "description": "Workflow context - state variables with defaults and types" }, "ContextVariable": { "type": "object", "properties": { "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"], "description": "Variable type" }, "default": { "description": "Default value" }, "description": { "type": "string", "description": "Description for UI/docs" } }, "required": ["type"], "additionalProperties": false, "description": "Context variable definition (serialized from Zod schema or type inference)" }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for permissions at any level\n- type: 'http' = HTTP route permission group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based permission group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual permission" } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" } }, "context": { "$ref": "#/definitions/WorkflowContext" }, "dsl": { "type": "boolean" }, "expose": { "type": "boolean" }, "userFlow": { "type": "boolean" }, "actors": { "type": "array", "items": { "type": "string" } }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "pikkuFuncId", "steps"], "definitions": { "WorkflowStepMeta": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/BranchStepMeta" }, { "$ref": "#/definitions/ParallelGroupStepMeta" }, { "$ref": "#/definitions/FanoutStepMeta" }, { "$ref": "#/definitions/ReturnStepMeta" }, { "$ref": "#/definitions/InlineStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/CancelStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/SwitchStepMeta" }, { "$ref": "#/definitions/FilterStepMeta" }, { "$ref": "#/definitions/ArrayPredicateStepMeta" }, { "$ref": "#/definitions/SetStepMeta" }], "description": "Workflow step metadata (extracted by inspector)" }, "RpcStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "rpc", "description": "RPC form - generates queue worker" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "rpcName": { "type": "string", "description": "RPC to invoke" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" }, "actor": { "type": "string", "description": "User-flow actor name this step runs as ({ actor: actors.x })" }, "expectEventually": { "type": "boolean", "description": "True for workflow.expectEventually polling steps" } }, "required": ["type", "stepName", "rpcName"], "additionalProperties": false, "description": "RPC step metadata (base form)" }, "InputSource": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "item" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "template" }, "parts": { "type": "array", "items": { "type": "string" } }, "expressions": { "type": "array", "items": { "$ref": "#/definitions/InputSource" } } }, "required": ["from", "parts", "expressions"], "additionalProperties": false }], "description": "Input source for step arguments in DSL workflows" }, "WorkflowStepOptions": { "type": "object", "properties": { "description": { "type": "string", "description": "Display name for logs/UI (optional, doesn't affect execution)" }, "retries": { "type": "number", "description": "Number of retry attempts for failed steps (only applies to local execution)" }, "retryDelay": { "type": ["string", "number"], "description": "Delay between retry attempts (e.g., '1s', '2s', '2min')" }, "actor": { "$ref": "#/definitions/UserFlowActor", "description": "Run this step as an actor (user flows). The RPC is sent through the actor's authenticated client over the REAL transport — never dispatched internally — so auth middleware and permissions are exercised end-to-end. The step is recorded durably like any RPC step." } }, "additionalProperties": false, "description": "Workflow step options" }, "UserFlowActor": { "type": "object", "properties": { "name": { "type": "string", "description": "Stable actor name (the key in pikku.config.json's actor registry)." }, "email": { "type": "string", "description": "The actor's user email — flows use it for invites/lookups." } }, "required": ["name", "email"], "additionalProperties": false, "description": "A user-flow actor: a synthetic user (a normal user row flagged `actor`) that workflow steps can run as. Passed to `workflow.do(step, rpc, data, { actor })` — the step then goes through the actor's authenticated client over the REAL transport (auth middleware, permissions, serialization all exercised), never through internal dispatch. Login is lazy: the first `invoke` signs the actor in and the session is cached for the actor's lifetime." }, "BranchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "branch" }, "branches": { "type": "array", "items": { "$ref": "#/definitions/BranchCase" }, "description": "Branches in order: first is \"if\", rest are \"else if\"" }, "elseSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Else branch steps (when no conditions match)" } }, "required": ["type", "branches"], "additionalProperties": false, "description": "Branch step metadata (if/else-if/else control flow)" }, "BranchCase": { "type": "object", "properties": { "condition": { "$ref": "#/definitions/Condition", "description": "Condition for this branch" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute when condition is true" } }, "required": ["condition", "steps"], "additionalProperties": false, "description": "A single branch in an if/else-if chain" }, "Condition": { "anyOf": [{ "$ref": "#/definitions/SimpleCondition" }, { "type": "object", "properties": { "type": { "type": "string", "const": "and" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "or" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }], "description": "Nested condition structure supporting AND/OR operations" }, "SimpleCondition": { "type": "object", "properties": { "type": { "type": "string", "const": "simple" }, "expression": { "type": "string" } }, "required": ["type", "expression"], "additionalProperties": false, "description": "Simple condition expression (leaf node)" }, "ParallelGroupStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "parallel" }, "children": { "type": "array", "items": { "$ref": "#/definitions/RpcStepMeta" }, "description": "Child steps to execute in parallel" } }, "required": ["type", "children"], "additionalProperties": false, "description": "Parallel group step metadata (Promise.all with multiple steps)" }, "FanoutStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "fanout" }, "stepName": { "type": "string", "description": "Step name for this fanout" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "mode": { "type": "string", "enum": ["parallel", "sequential"], "description": "Execution mode" }, "child": { "$ref": "#/definitions/RpcStepMeta", "description": "Child step to execute per iteration" }, "timeBetween": { "type": "string", "description": "Time between iterations (sequential mode only)" } }, "required": ["type", "stepName", "sourceVar", "itemVar", "mode", "child"], "additionalProperties": false, "description": "Fanout step metadata (parallel or sequential iteration)" }, "ReturnStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "return" }, "outputs": { "type": "object", "additionalProperties": { "$ref": "#/definitions/OutputBinding" }, "description": "Output bindings" } }, "required": ["type", "outputs"], "additionalProperties": false, "description": "Return step metadata (workflow output)" }, "OutputBinding": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "stateVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "expression" }, "expression": { "type": "string" } }, "required": ["from", "expression"], "additionalProperties": false }], "description": "Output binding for return statements in DSL workflows" }, "InlineStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "inline", "description": "Inline form - local execution" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "description": { "type": "string", "description": "Display name" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName"], "additionalProperties": false, "description": "Inline step metadata (legacy support)" }, "SleepStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "sleep", "description": "Sleep step" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.sleep)" }, "duration": { "type": ["string", "number"], "description": "Sleep duration" } }, "required": ["type", "stepName", "duration"], "additionalProperties": false, "description": "Sleep step metadata" }, "CancelStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "cancel", "description": "Cancel step" }, "reason": { "type": "string", "description": "Optional cancellation reason" } }, "required": ["type"], "additionalProperties": false, "description": "Cancel step metadata" }, "SuspendStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "suspend" }, "reason": { "type": "string", "description": "Reason string passed to workflow.suspend() — becomes the durable step key" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Suspend step metadata (workflow.suspend())" }, "SwitchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "switch" }, "expression": { "type": "string", "description": "Expression being switched on" }, "cases": { "type": "array", "items": { "$ref": "#/definitions/SwitchCaseMeta" }, "description": "Case branches" }, "defaultSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Default case steps (optional)" } }, "required": ["type", "expression", "cases"], "additionalProperties": false, "description": "Switch step metadata (switch/case control flow)" }, "SwitchCaseMeta": { "type": "object", "properties": { "value": { "type": ["string", "number", "boolean", "null"], "description": "Case value (literal) or expression" }, "expression": { "type": "string", "description": "Case expression (for complex cases)" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute for this case" } }, "required": ["steps"], "additionalProperties": false, "description": "Switch case metadata" }, "FilterStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "filter" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Filter condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Filter step metadata (array.filter)" }, "ArrayPredicateStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "arrayPredicate" }, "mode": { "type": "string", "enum": ["some", "every"], "description": "Predicate mode" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Predicate condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "mode", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Array predicate step metadata (array.some, array.every)" }, "SetStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "set", "description": "Set step" }, "variable": { "type": "string", "description": "Variable name to set (must be in context)" }, "value": { "description": "Value to assign (literal or expression)" } }, "required": ["type", "variable", "value"], "additionalProperties": false, "description": "Set step metadata (context variable assignment)" }, "WorkflowContext": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ContextVariable" }, "description": "Workflow context - state variables with defaults and types" }, "ContextVariable": { "type": "object", "properties": { "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"], "description": "Variable type" }, "default": { "description": "Default value" }, "description": { "type": "string", "description": "Description for UI/docs" } }, "required": ["type"], "additionalProperties": false, "description": "Context variable definition (serialized from Zod schema or type inference)" }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for permissions at any level\n- type: 'http' = HTTP route permission group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based permission group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual permission" } } }