@pikku/addon-meta-conversions 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/.pikku/addon/pikku-addon-types.gen.ts +105 -0
  2. package/.pikku/addon/pikku-package.gen.ts +11 -0
  3. package/.pikku/agent/pikku-agent-map.gen.d.ts +4 -0
  4. package/.pikku/agent/pikku-agent-types.gen.ts +84 -0
  5. package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  6. package/.pikku/console/pikku-addon-meta.gen.json +36 -0
  7. package/.pikku/console/pikku-node-types.gen.ts +8 -0
  8. package/.pikku/function/pikku-function-types.gen.ts +797 -0
  9. package/.pikku/function/pikku-functions-meta-verbose.gen.json +33 -0
  10. package/.pikku/function/pikku-functions-meta.gen.json +27 -0
  11. package/.pikku/function/pikku-functions-meta.gen.ts +7 -0
  12. package/.pikku/function/pikku-functions.gen.ts +8 -0
  13. package/.pikku/http/pikku-http-types.gen.ts +119 -0
  14. package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  15. package/.pikku/pikku-bootstrap-scenarios.gen.ts +9 -0
  16. package/.pikku/pikku-bootstrap.gen.ts +8 -0
  17. package/.pikku/pikku-meta-service.gen.ts +10 -0
  18. package/.pikku/pikku-services.gen.ts +50 -0
  19. package/.pikku/pikku-types.gen.ts +24 -0
  20. package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  21. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +135 -0
  22. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +136 -0
  23. package/.pikku/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +135 -0
  24. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
  25. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  26. package/.pikku/scenarios/features.gen.json +1 -0
  27. package/.pikku/scenarios/pikku-scenario-functions-meta.gen.json +1 -0
  28. package/.pikku/scenarios/pikku-scenario-functions-meta.gen.ts +12 -0
  29. package/.pikku/scenarios/pikku-scenario-functions.gen.ts +4 -0
  30. package/.pikku/scenarios/pikku-scenario-wirings-meta.gen.ts +15 -0
  31. package/.pikku/scenarios/pikku-scenario-wirings.gen.ts +4 -0
  32. package/.pikku/scenarios/schemas/register.gen.ts +4 -0
  33. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  34. package/.pikku/schemas/register.gen.ts +15 -0
  35. package/.pikku/schemas/schemas/EventSendInput.schema.json +1 -0
  36. package/.pikku/schemas/schemas/EventSendOutput.schema.json +1 -0
  37. package/.pikku/schemas/schemas/SecretSchema_metaConversions.schema.json +1 -0
  38. package/.pikku/scopes/pikku-personas-meta.gen.json +1 -0
  39. package/.pikku/scopes/pikku-personas.gen.ts +52 -0
  40. package/.pikku/scopes/pikku-roles-meta.gen.json +1 -0
  41. package/.pikku/scopes/pikku-roles.gen.ts +41 -0
  42. package/.pikku/scopes/pikku-scope-types.gen.ts +7 -0
  43. package/.pikku/scopes/pikku-scopes-meta.gen.json +1 -0
  44. package/.pikku/scopes/pikku-scopes.gen.ts +58 -0
  45. package/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
  46. package/.pikku/secrets/pikku-secrets-meta.gen.json +10 -0
  47. package/.pikku/secrets/pikku-secrets.gen.ts +36 -0
  48. package/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
  49. package/.pikku/variables/pikku-variable-types.gen.ts +5 -0
  50. package/.pikku/variables/pikku-variables-meta.gen.json +1 -0
  51. package/.pikku/variables/pikku-variables.gen.ts +34 -0
  52. package/.pikku/workflow/personas.gen.json +1 -0
  53. package/.pikku/workflow/pikku-personas.gen.ts +38 -0
  54. package/.pikku/workflow/pikku-scenario-step-map.gen.d.ts +18 -0
  55. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +38 -0
  56. package/.pikku/workflow/pikku-workflow-types.gen.ts +591 -0
  57. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
  58. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
  59. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +4 -4
  60. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
  61. package/dist/.pikku/addon/pikku-addon-types.gen.js +7 -3
  62. package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
  63. package/dist/.pikku/addon/pikku-addon-types.gen.ts +11 -6
  64. package/dist/.pikku/addon/pikku-package.gen.js +2 -1
  65. package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
  66. package/dist/.pikku/addon/pikku-package.gen.ts +3 -1
  67. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
  68. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +8 -6
  69. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
  70. package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
  71. package/dist/.pikku/agent/pikku-agent-types.gen.ts +15 -7
  72. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
  73. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
  74. package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
  75. package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
  76. package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  77. package/dist/.pikku/console/pikku-addon-meta.gen.json +4 -1
  78. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  79. package/dist/.pikku/console/pikku-node-types.gen.ts +1 -1
  80. package/dist/.pikku/function/pikku-function-types.gen.d.ts +133 -133
  81. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
  82. package/dist/.pikku/function/pikku-function-types.gen.js +98 -61
  83. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
  84. package/dist/.pikku/function/pikku-function-types.gen.ts +268 -157
  85. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +5 -0
  86. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  87. package/dist/.pikku/function/pikku-functions-meta.gen.json +8 -1
  88. package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
  89. package/dist/.pikku/function/pikku-functions.gen.js +2 -2
  90. package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
  91. package/dist/.pikku/function/pikku-functions.gen.ts +2 -2
  92. package/dist/.pikku/http/pikku-http-types.gen.d.ts +98 -0
  93. package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
  94. package/dist/.pikku/http/pikku-http-types.gen.js +50 -0
  95. package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
  96. package/dist/.pikku/http/pikku-http-types.gen.ts +119 -0
  97. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
  98. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
  99. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
  100. package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
  101. package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  102. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +10 -0
  103. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts.map +1 -0
  104. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +10 -0
  105. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js.map +1 -0
  106. package/dist/.pikku/pikku-bootstrap-scenarios.gen.ts +9 -0
  107. package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -2
  108. package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -1
  109. package/dist/.pikku/pikku-bootstrap.gen.js +2 -10
  110. package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -1
  111. package/dist/.pikku/pikku-bootstrap.gen.ts +2 -9
  112. package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
  113. package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
  114. package/dist/.pikku/pikku-meta-service.gen.js +10 -0
  115. package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
  116. package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
  117. package/dist/.pikku/pikku-services.gen.d.ts +15 -2
  118. package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
  119. package/dist/.pikku/pikku-services.gen.js +14 -0
  120. package/dist/.pikku/pikku-services.gen.js.map +1 -1
  121. package/dist/.pikku/pikku-services.gen.ts +17 -2
  122. package/dist/.pikku/pikku-types.gen.d.ts +2 -1
  123. package/dist/.pikku/pikku-types.gen.d.ts.map +1 -1
  124. package/dist/.pikku/pikku-types.gen.js +3 -1
  125. package/dist/.pikku/pikku-types.gen.js.map +1 -1
  126. package/dist/.pikku/pikku-types.gen.ts +4 -1
  127. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
  128. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
  129. package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
  130. package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
  131. package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  132. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +28 -8
  133. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +28 -8
  134. package/dist/.pikku/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +135 -0
  135. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
  136. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
  137. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
  138. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
  139. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
  140. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  141. package/dist/.pikku/scenarios/features.gen.json +1 -0
  142. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.d.ts +2 -0
  143. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.d.ts.map +1 -0
  144. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +11 -0
  145. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js.map +1 -0
  146. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.json +1 -0
  147. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.ts +12 -0
  148. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +5 -0
  149. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts.map +1 -0
  150. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.js +2 -0
  151. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.js.map +1 -0
  152. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.ts +4 -0
  153. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.d.ts +2 -0
  154. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.d.ts.map +1 -0
  155. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +11 -0
  156. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js.map +1 -0
  157. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.ts +15 -0
  158. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +5 -0
  159. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts.map +1 -0
  160. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.js +2 -0
  161. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.js.map +1 -0
  162. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.ts +4 -0
  163. package/dist/.pikku/scenarios/schemas/register.gen.d.ts +5 -0
  164. package/dist/.pikku/scenarios/schemas/register.gen.d.ts.map +1 -0
  165. package/dist/.pikku/scenarios/schemas/register.gen.js +5 -0
  166. package/dist/.pikku/scenarios/schemas/register.gen.js.map +1 -0
  167. package/dist/.pikku/scenarios/schemas/register.gen.ts +4 -0
  168. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
  169. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
  170. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
  171. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
  172. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  173. package/dist/.pikku/schemas/register.gen.js +1 -1
  174. package/dist/.pikku/schemas/register.gen.ts +1 -1
  175. package/dist/.pikku/scopes/pikku-personas-meta.gen.json +1 -0
  176. package/dist/.pikku/scopes/pikku-personas.gen.d.ts +37 -0
  177. package/dist/.pikku/scopes/pikku-personas.gen.d.ts.map +1 -0
  178. package/dist/.pikku/scopes/pikku-personas.gen.js +18 -0
  179. package/dist/.pikku/scopes/pikku-personas.gen.js.map +1 -0
  180. package/dist/.pikku/scopes/pikku-personas.gen.ts +52 -0
  181. package/dist/.pikku/scopes/pikku-roles-meta.gen.json +1 -0
  182. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +31 -0
  183. package/dist/.pikku/scopes/pikku-roles.gen.d.ts.map +1 -0
  184. package/dist/.pikku/scopes/pikku-roles.gen.js +19 -0
  185. package/dist/.pikku/scopes/pikku-roles.gen.js.map +1 -0
  186. package/dist/.pikku/scopes/pikku-roles.gen.ts +41 -0
  187. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +8 -0
  188. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts.map +1 -0
  189. package/dist/.pikku/scopes/pikku-scope-types.gen.js +6 -0
  190. package/dist/.pikku/scopes/pikku-scope-types.gen.js.map +1 -0
  191. package/dist/.pikku/scopes/pikku-scope-types.gen.ts +7 -0
  192. package/dist/.pikku/scopes/pikku-scopes-meta.gen.json +1 -0
  193. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +36 -0
  194. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts.map +1 -0
  195. package/dist/.pikku/scopes/pikku-scopes.gen.js +28 -0
  196. package/dist/.pikku/scopes/pikku-scopes.gen.js.map +1 -0
  197. package/dist/.pikku/scopes/pikku-scopes.gen.ts +58 -0
  198. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +2 -2
  199. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts.map +1 -1
  200. package/dist/.pikku/secrets/pikku-secret-types.gen.js +2 -2
  201. package/dist/.pikku/secrets/pikku-secret-types.gen.js.map +1 -1
  202. package/dist/.pikku/secrets/pikku-secret-types.gen.ts +2 -2
  203. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +11 -1
  204. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts.map +1 -1
  205. package/dist/.pikku/secrets/pikku-secrets.gen.js +12 -2
  206. package/dist/.pikku/secrets/pikku-secrets.gen.js.map +1 -1
  207. package/dist/.pikku/secrets/pikku-secrets.gen.ts +15 -2
  208. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  209. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  210. package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
  211. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +2 -2
  212. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts.map +1 -1
  213. package/dist/.pikku/variables/pikku-variable-types.gen.js +2 -2
  214. package/dist/.pikku/variables/pikku-variable-types.gen.js.map +1 -1
  215. package/dist/.pikku/variables/pikku-variable-types.gen.ts +2 -2
  216. package/dist/.pikku/variables/pikku-variables.gen.d.ts +11 -1
  217. package/dist/.pikku/variables/pikku-variables.gen.d.ts.map +1 -1
  218. package/dist/.pikku/variables/pikku-variables.gen.js +13 -3
  219. package/dist/.pikku/variables/pikku-variables.gen.js.map +1 -1
  220. package/dist/.pikku/variables/pikku-variables.gen.ts +16 -3
  221. package/dist/.pikku/workflow/personas.gen.json +1 -0
  222. package/dist/.pikku/workflow/pikku-personas.gen.d.ts +16 -0
  223. package/dist/.pikku/workflow/pikku-personas.gen.d.ts.map +1 -0
  224. package/dist/.pikku/workflow/pikku-personas.gen.js +18 -0
  225. package/dist/.pikku/workflow/pikku-personas.gen.js.map +1 -0
  226. package/dist/.pikku/workflow/pikku-personas.gen.ts +38 -0
  227. package/dist/.pikku/workflow/pikku-scenario-step-map.gen.d.ts +18 -0
  228. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
  229. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +289 -31
  230. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
  231. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +66 -18
  232. package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
  233. package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +494 -61
  234. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  235. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js.map +1 -1
  236. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +3 -3
  237. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  238. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  239. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
  240. package/dist/src/functions/events/send.function.d.ts +2 -2
  241. package/dist/src/functions/events/send.function.d.ts.map +1 -1
  242. package/dist/src/meta-conversions.secret.js +2 -2
  243. package/dist/src/meta-conversions.secret.js.map +1 -1
  244. package/dist/src/services.d.ts.map +1 -1
  245. package/dist/src/services.js +1 -1
  246. package/dist/src/services.js.map +1 -1
  247. package/package.json +7 -6
  248. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +0 -2
  249. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +0 -1
  250. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +0 -7
  251. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +0 -1
  252. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
  253. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
  254. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +0 -5
  255. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +0 -1
  256. package/dist/.pikku/agent/pikku-agent-wirings.gen.js +0 -5
  257. package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +0 -1
  258. package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
@@ -0,0 +1,591 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.96
3
+ */
4
+ import { WorkflowCancelledException } from '@pikku/core/workflow'
5
+ import { template } from '@pikku/core/workflow'
6
+ import {
7
+ pikkuWorkflowGraph as corePikkuWorkflowGraph,
8
+ type PikkuWorkflowGraphConfig,
9
+ type PikkuWorkflowGraphResult,
10
+ } from '@pikku/core/workflow'
11
+ import type { PikkuWorkflowWire, PikkuScenarioWire, WorkflowStepOptions, ScenarioStepOptions } from '@pikku/core/workflow'
12
+
13
+ export { WorkflowCancelledException }
14
+ import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
15
+ import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
16
+ import type { FlattenedWorkflowMap } from './pikku-workflow-map.gen.d.js'
17
+ import type { AgentMap as FlattenedAgentMap } from '../agent/pikku-agent-map.gen.d.js'
18
+ import type { FlattenedScenarioStepMap } from './pikku-scenario-step-map.gen.d.js'
19
+ import type { TypedPersonas } from './pikku-personas.gen.js'
20
+
21
+ export type { TypedPersonas }
22
+
23
+ export { template }
24
+
25
+ export interface TypedWorkflow extends PikkuWorkflowWire {
26
+ do<K extends keyof FlattenedRPCMap>(
27
+ stepName: string,
28
+ rpcName: K,
29
+ data: FlattenedRPCMap[K]['input'],
30
+ options?: WorkflowStepOptions
31
+ ): Promise<FlattenedRPCMap[K]['output']>
32
+
33
+ do<K extends keyof FlattenedWorkflowMap>(
34
+ stepName: string,
35
+ workflowName: K,
36
+ data: FlattenedWorkflowMap[K]['input'],
37
+ options?: WorkflowStepOptions
38
+ ): Promise<FlattenedWorkflowMap[K]['output']>
39
+
40
+ do<T>(
41
+ stepName: string,
42
+ fn: () => T | Promise<T>,
43
+ options?: WorkflowStepOptions
44
+ ): Promise<T>
45
+ }
46
+
47
+ /**
48
+ * The typed half of a scenario wire: `step` and its `given`/`when`/`then`
49
+ * sugar, narrowed to the names declared by `pikkuScenarioStep` in this project.
50
+ * The phase only changes the prose the reporter renders.
51
+ */
52
+ export interface TypedScenarioSteps {
53
+ step<K extends keyof FlattenedScenarioStepMap>(
54
+ stepName: string,
55
+ stepFunc: K,
56
+ data?: FlattenedScenarioStepMap[K]['input'],
57
+ options?: ScenarioStepOptions
58
+ ): Promise<FlattenedScenarioStepMap[K]['output']>
59
+
60
+ given<K extends keyof FlattenedScenarioStepMap>(
61
+ stepName: string,
62
+ stepFunc: K,
63
+ data?: FlattenedScenarioStepMap[K]['input'],
64
+ options?: ScenarioStepOptions
65
+ ): Promise<FlattenedScenarioStepMap[K]['output']>
66
+
67
+ when<K extends keyof FlattenedScenarioStepMap>(
68
+ stepName: string,
69
+ stepFunc: K,
70
+ data?: FlattenedScenarioStepMap[K]['input'],
71
+ options?: ScenarioStepOptions
72
+ ): Promise<FlattenedScenarioStepMap[K]['output']>
73
+
74
+ then<K extends keyof FlattenedScenarioStepMap>(
75
+ stepName: string,
76
+ stepFunc: K,
77
+ data?: FlattenedScenarioStepMap[K]['input'],
78
+ options?: ScenarioStepOptions
79
+ ): Promise<FlattenedScenarioStepMap[K]['output']>
80
+ }
81
+
82
+ export type TypedScenario = TypedWorkflow &
83
+ Omit<PikkuScenarioWire, keyof PikkuWorkflowWire | keyof TypedScenarioSteps> &
84
+ TypedScenarioSteps
85
+
86
+ import type { StandardSchemaV1 } from '@standard-schema/spec'
87
+ import type { InferSchemaOutput, PikkuPermission, PikkuMiddleware, NodeConfig, PikkuApprovalDescription } from '../function/pikku-function-types.gen.js'
88
+ import type { ScopeId } from '../scopes/pikku-scopes.gen.js'
89
+ import { PikkuError } from '@pikku/core/errors'
90
+ import type { CorePermissionGroup } from '@pikku/core'
91
+
92
+ export type PikkuFunctionWorkflow<
93
+ In = unknown,
94
+ Out = never
95
+ > = PikkuFunctionSessionless<In, Out, 'workflow'>
96
+
97
+ export type PikkuFunctionScenario<
98
+ In = unknown,
99
+ Out = never
100
+ > = PikkuFunctionSessionless<In, Out, 'scenario' | 'actors'>
101
+
102
+ export type PikkuWorkflowConfigWithSchema<
103
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
104
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
105
+ > = {
106
+ title?: string
107
+ description?: string
108
+ tags?: string[]
109
+ expose?: boolean
110
+ internal?: boolean
111
+ override?: string
112
+ version?: number
113
+ remote?: boolean
114
+ mcp?: boolean
115
+ readonly?: boolean
116
+ approvalRequired?: boolean
117
+ approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
118
+ func: PikkuFunctionWorkflow<
119
+ InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
120
+ OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
121
+ >
122
+ auth?: boolean
123
+ /**
124
+ * Scopes the session must hold to run this workflow. All of them are required
125
+ * (AND), and they are checked before `permissions`.
126
+ */
127
+ scopes?: ScopeId[]
128
+ permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
129
+ middleware?: PikkuMiddleware[]
130
+ input?: InputSchema
131
+ output?: OutputSchema
132
+ node?: NodeConfig
133
+ errors?: Array<typeof PikkuError>
134
+ inline?: boolean
135
+ }
136
+
137
+ export function pikkuWorkflowFunc<
138
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
139
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
140
+ >(
141
+ config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
142
+ ): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
143
+ export function pikkuWorkflowFunc<In, Out = unknown>(
144
+ func:
145
+ | PikkuFunctionWorkflow<In, Out>
146
+ | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
147
+ ): PikkuFunctionConfig<In, Out, 'workflow'>
148
+ export function pikkuWorkflowFunc(func: any) {
149
+ return typeof func === 'function' ? { func } : func
150
+ }
151
+
152
+ export function pikkuWorkflowComplexFunc<
153
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
154
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
155
+ >(
156
+ config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
157
+ ): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
158
+ export function pikkuWorkflowComplexFunc<In, Out = unknown>(
159
+ func:
160
+ | PikkuFunctionWorkflow<In, Out>
161
+ | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
162
+ ): PikkuFunctionConfig<In, Out, 'workflow'>
163
+ export function pikkuWorkflowComplexFunc(func: any) {
164
+ return typeof func === 'function' ? { func } : func
165
+ }
166
+
167
+ export type PikkuScenarioConfigWithSchema<
168
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
169
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
170
+ > = Omit<PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>, 'func' | 'auth' | 'scopes' | 'permissions'> & {
171
+ func: PikkuFunctionScenario<
172
+ InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
173
+ OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
174
+ >
175
+ /**
176
+ * Runs before the scenario body. Same signature as `func`, but its return
177
+ * value is discarded — a hook is setup, not a step, so it is never recorded
178
+ * on the ladder. Throwing skips the body and fails the run; `after` still
179
+ * runs.
180
+ */
181
+ before?: PikkuScenarioHook<InputSchema>
182
+ /**
183
+ * Always runs after the scenario body, in a `finally`, whether it passed or
184
+ * failed. Throwing fails a run that would otherwise have passed; on an
185
+ * already-failed run it attaches as the `cause` and never replaces the
186
+ * original error.
187
+ */
188
+ after?: PikkuScenarioHook<InputSchema>
189
+ /**
190
+ * Why this scenario is held out of a default run, stated where the scenario
191
+ * is. The scenario still appears in the plan and is reported as skipped
192
+ * rather than quietly omitted; naming it directly with `--flows` runs it
193
+ * anyway.
194
+ */
195
+ skip?: string
196
+ }
197
+
198
+ /**
199
+ * A scenario lifecycle hook: the scenario's own `(services, data, wire)`
200
+ * signature with its result discarded.
201
+ */
202
+ export type PikkuScenarioHook<
203
+ InputSchema extends StandardSchemaV1 | undefined = undefined
204
+ > = PikkuFunctionScenario<
205
+ InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
206
+ void
207
+ >
208
+
209
+ /**
210
+ * Declares a scenario hook. Returns the function verbatim — a hook is never
211
+ * registered, so this exists purely to give an inline hook a call site to be
212
+ * contextually typed from, the way every other pikku primitive is.
213
+ */
214
+ export function pikkuScenarioHook<In = unknown>(
215
+ hook: PikkuFunctionScenario<In, void>
216
+ ): PikkuFunctionScenario<In, void> {
217
+ return hook
218
+ }
219
+
220
+ /**
221
+ * A scenario: a complex workflow that drives the app the way users do.
222
+ * Steps run as actors over the REAL transport — `scenario.do(step, rpc,
223
+ * data, { actor: actors.yasser })` — so flows double as e2e tests and
224
+ * staged/production health checks (no state reset; scope what you create).
225
+ */
226
+ export function pikkuScenario<
227
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
228
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
229
+ >(
230
+ config: PikkuScenarioConfigWithSchema<InputSchema, OutputSchema>
231
+ ): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'scenario' | 'actors', PikkuFunctionScenario<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
232
+ export function pikkuScenario<In, Out = unknown>(
233
+ func:
234
+ | PikkuFunctionScenario<In, Out>
235
+ | PikkuFunctionConfig<In, Out, 'scenario' | 'actors', PikkuFunctionScenario<In, Out>>
236
+ ): PikkuFunctionConfig<In, Out, 'scenario' | 'actors'>
237
+ export function pikkuScenario(func: any) {
238
+ return typeof func === 'function' ? { func } : func
239
+ }
240
+
241
+ /**
242
+ * A scenario as a feature references it. Any `pikkuScenario` export is
243
+ * assignable; `In` is recovered from it so the paired form's `data` is
244
+ * checked against that scenario's own input.
245
+ */
246
+ export type PikkuScenarioRef<In = any, Out = any> = PikkuFunctionConfig<
247
+ In,
248
+ Out,
249
+ 'scenario' | 'actors',
250
+ PikkuFunctionScenario<In, Out>,
251
+ any,
252
+ any
253
+ >
254
+
255
+ /**
256
+ * One entry in a feature's `scenarios` list, validated against itself: a bare
257
+ * scenario, or a scenario paired with the input to run it with. The paired form
258
+ * is gherkin's `Examples:` written as an ordinary loop.
259
+ */
260
+ export type PikkuFeatureEntry<Entry> = Entry extends {
261
+ scenario: PikkuScenarioRef<infer In>
262
+ }
263
+ ? { scenario: PikkuScenarioRef<In>; data: In }
264
+ : Entry extends PikkuScenarioRef
265
+ ? Entry
266
+ : never
267
+
268
+ export type PikkuFeatureConfig<Scenarios extends readonly unknown[]> = {
269
+ /** Human-readable name. The export identifier is the id. */
270
+ name: string
271
+ description?: string
272
+ tags?: string[]
273
+ scenarios: { [K in keyof Scenarios]: PikkuFeatureEntry<Scenarios[K]> }
274
+ /**
275
+ * Runs ONCE before the whole group — not before each scenario. Per-scenario
276
+ * setup is the scenario's own `before`; gherkin's `Background:` is
277
+ * deliberately not expressible here.
278
+ */
279
+ before?: PikkuScenarioHook
280
+ after?: PikkuScenarioHook
281
+ }
282
+
283
+ /**
284
+ * A feature: an ordered group of scenarios, mirroring gherkin's Feature ↔
285
+ * Scenario structure. Scenarios are referenced by imported identifier, so a
286
+ * renamed or deleted scenario is a compile error rather than a silent skip.
287
+ *
288
+ * A scenario does not have to belong to a feature — a void-input scenario
289
+ * still runs standalone.
290
+ *
291
+ * ```ts
292
+ * export const credentialFeature = pikkuFeature({
293
+ * name: 'Credential API',
294
+ * tags: ['credential'],
295
+ * before: startsMockOAuthServer,
296
+ * after: stopsMockOAuthServer,
297
+ * scenarios: [
298
+ * credentialLazyLoadScenario,
299
+ * ...['stripe', 'google'].map((name) => ({
300
+ * scenario: credentialRoundTripScenario,
301
+ * data: { name },
302
+ * })),
303
+ * ],
304
+ * })
305
+ * ```
306
+ */
307
+ export function pikkuFeature<const Scenarios extends readonly unknown[]>(
308
+ config: PikkuFeatureConfig<Scenarios>
309
+ ): PikkuFeatureConfig<Scenarios> {
310
+ return config
311
+ }
312
+
313
+ /**
314
+ * One surface's implementation of a step.
315
+ *
316
+ * Each binding is typed independently, so a browser binding gets a non-optional
317
+ * `wire.browser` and a cli binding a non-optional `wire.cli` without either
318
+ * leaking into the other.
319
+ */
320
+ export type PikkuFunctionScenarioStep<
321
+ In = unknown,
322
+ Out = never,
323
+ Surface extends 'browser' | 'cli' | 'default' = 'default'
324
+ > = PikkuFunctionSessionless<
325
+ In,
326
+ Out,
327
+ Surface extends 'default' ? 'scenarioStep' : 'scenarioStep' | Surface
328
+ >
329
+
330
+ export type PikkuScenarioStepConfigWithSchema<
331
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
332
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
333
+ > = {
334
+ /** Registered name — this is the string `scenario.step()` references. */
335
+ name: string
336
+ /**
337
+ * What this step does, for the console and for whoever reads the source. It
338
+ * is also the fallback prose when no `template` is declared, in which case a
339
+ * reporter renders "Given the shopper buys an apple". Defaults to the call
340
+ * site's step name.
341
+ */
342
+ description?: string
343
+ /**
344
+ * The prose a reporter renders for this step, with `{placeholders}` filled
345
+ * from the input the step was called with — `'sees {packageName}'` reports as
346
+ * "Then the admin sees @pikku/addon-todos". Every input field should appear,
347
+ * so the report names the values under test rather than repeating one
348
+ * sentence per call site.
349
+ */
350
+ template?: string
351
+ title?: string
352
+ tags?: string[]
353
+ input?: InputSchema
354
+ output?: OutputSchema
355
+ errors?: Array<typeof PikkuError>
356
+ /**
357
+ * Drive this step through a real browser, as a human would. The runner
358
+ * provisions a window for the step's actor first — which makes an actor
359
+ * mandatory — and `wire.browser` is non-optional inside it.
360
+ *
361
+ * Compose shared utilities here rather than writing raw clicks: the step says
362
+ * what the actor is doing, the utilities say how.
363
+ */
364
+ browser?: PikkuFunctionScenarioStep<
365
+ InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
366
+ OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
367
+ 'browser'
368
+ >
369
+ /** Drive this step remotely, over the websocket. */
370
+ cli?: PikkuFunctionScenarioStep<
371
+ InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
372
+ OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
373
+ 'cli'
374
+ >
375
+ /**
376
+ * The server-side path — the fast suite, and the floor every other surface
377
+ * falls back to.
378
+ *
379
+ * On a `then`, this is not an alternative to the other bindings but a second
380
+ * **witness**: the run executes every binding it has and fails if they
381
+ * disagree, because "the row says paid" and "the page says paid" are different
382
+ * claims and the gap between them is the bug nobody catches.
383
+ */
384
+ default?: PikkuFunctionScenarioStep<
385
+ InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
386
+ OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
387
+ 'default'
388
+ >
389
+ }
390
+
391
+ export type PikkuScenarioStepConfig<In, Out> =
392
+ Omit<PikkuScenarioStepConfigWithSchema<undefined, undefined>, 'browser' | 'cli' | 'default' | 'input' | 'output'> & {
393
+ browser?: PikkuFunctionScenarioStep<In, Out, 'browser'>
394
+ cli?: PikkuFunctionScenarioStep<In, Out, 'cli'>
395
+ default?: PikkuFunctionScenarioStep<In, Out, 'default'>
396
+ }
397
+
398
+ /**
399
+ * A named, reusable scenario step, declaring one implementation per surface an
400
+ * actor can drive it through.
401
+ *
402
+ * The step's identity is what the actor is trying to do; which surface carries
403
+ * it out is a binding. That is what lets one ladder run through a real browser,
404
+ * over the websocket, or entirely server-side — and what makes "how much of this
405
+ * flow can a human actually reach" a number rather than a guess.
406
+ *
407
+ * Steps are deliberately NOT registered as RPCs: a browser-driving step must
408
+ * never be network-callable.
409
+ */
410
+ export function pikkuScenarioStep<
411
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
412
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
413
+ >(
414
+ config: PikkuScenarioStepConfigWithSchema<InputSchema, OutputSchema>
415
+ ): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'scenarioStep' | 'browser' | 'cli', PikkuFunctionScenarioStep<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'browser' | 'cli' | 'default'>, InputSchema, OutputSchema>
416
+ export function pikkuScenarioStep<In, Out = unknown>(
417
+ config: PikkuScenarioStepConfig<In, Out>
418
+ ): PikkuFunctionConfig<In, Out, 'scenarioStep' | 'browser' | 'cli'>
419
+ export function pikkuScenarioStep(config: any) {
420
+ const surfaces = (['browser', 'cli', 'default'] as const).filter(
421
+ (surface) => typeof config[surface] === 'function'
422
+ )
423
+ if (surfaces.length === 0) {
424
+ throw new Error(
425
+ `[scenario] step '${config.name}' declares no surface bindings. Add at least a \`default\` (server-side) implementation.`
426
+ )
427
+ }
428
+ return {
429
+ ...config,
430
+ surfaces,
431
+ // The runner sets the surface on the wire and calls this once per binding it
432
+ // resolved — every witness of a `then`, exactly one for an action step.
433
+ func: (services: any, data: any, wire: any) => {
434
+ const surface = wire?.scenarioStep?.surface ?? 'default'
435
+ const binding = config[surface] ?? config.default
436
+ return binding(services, data, wire)
437
+ },
438
+ }
439
+ }
440
+
441
+ /**
442
+ * What a step declares when nobody drives it: one implementation, and no
443
+ * surfaces to choose between.
444
+ *
445
+ * `func` rather than `default` is the point. `default` means *the fallback when
446
+ * no other surface applies*, which implies others could exist; `func` says
447
+ * structurally that there is one way this happens. That also keeps the phase
448
+ * rule coherent — an assertion runs every witness it has and fails if they
449
+ * disagree, and this has exactly one by construction.
450
+ */
451
+ export type PikkuSubjectScenarioStepConfigWithSchema<
452
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
453
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
454
+ > = Omit<
455
+ PikkuScenarioStepConfigWithSchema<InputSchema, OutputSchema>,
456
+ 'browser' | 'cli' | 'default'
457
+ > & {
458
+ func: PikkuFunctionScenarioStep<
459
+ InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
460
+ OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
461
+ 'default'
462
+ >
463
+ }
464
+
465
+ export type PikkuSubjectScenarioStepConfig<In, Out> =
466
+ Omit<PikkuScenarioStepConfig<In, Out>, 'browser' | 'cli' | 'default'> & {
467
+ func: PikkuFunctionScenarioStep<In, Out, 'default'>
468
+ }
469
+
470
+ /**
471
+ * A step in which the app acts on itself — "Given the platform has expired the
472
+ * trial".
473
+ *
474
+ * The grammatical subject of that sentence is not a user of your app; it **is**
475
+ * your app, which is why it is its own declaration rather than a persona with an
476
+ * asterisk. A persona is a person.
477
+ *
478
+ * Local-test-only, and never in a virtual user's catalogue: a virtual user that
479
+ * could expire its own trial is manufacturing the outcome it exists to discover.
480
+ */
481
+ export function pikkuPlatformScenarioStep<
482
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
483
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
484
+ >(
485
+ config: PikkuSubjectScenarioStepConfigWithSchema<InputSchema, OutputSchema>
486
+ ): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'scenarioStep', PikkuFunctionScenarioStep<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'default'>, InputSchema, OutputSchema>
487
+ export function pikkuPlatformScenarioStep<In, Out = unknown>(
488
+ config: PikkuSubjectScenarioStepConfig<In, Out>
489
+ ): PikkuFunctionConfig<In, Out, 'scenarioStep'>
490
+ export function pikkuPlatformScenarioStep(config: any) {
491
+ return { ...config, surfaces: ['default'] }
492
+ }
493
+
494
+ /**
495
+ * A step in which a third-party system acts — "Given Stripe's webhook arrives",
496
+ * "When Mailgun bounces it".
497
+ *
498
+ * `addon` names the addon that wraps that service, the same name its
499
+ * `wireAddon` declares. These steps *are* the mock its consumers currently
500
+ * hand-write: shipped by the addon author, maintained with the addon, and the
501
+ * same artifact that appears in the prose.
502
+ *
503
+ * Note that arranging and asserting are different — "Stripe's webhook arrives"
504
+ * stubs, "Then Stripe was charged" asserts, and only the first is a stub.
505
+ *
506
+ * Local-test-only, and never in a virtual user's catalogue: one that could
507
+ * invoke this would forge its own payment success.
508
+ */
509
+ export function pikkuAddonScenarioStep<
510
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
511
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
512
+ >(
513
+ config: PikkuSubjectScenarioStepConfigWithSchema<InputSchema, OutputSchema> & { addon: string }
514
+ ): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'scenarioStep', PikkuFunctionScenarioStep<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'default'>, InputSchema, OutputSchema>
515
+ export function pikkuAddonScenarioStep<In, Out = unknown>(
516
+ config: PikkuSubjectScenarioStepConfig<In, Out> & { addon: string }
517
+ ): PikkuFunctionConfig<In, Out, 'scenarioStep'>
518
+ export function pikkuAddonScenarioStep(config: any) {
519
+ return { ...config, surfaces: ['default'] }
520
+ }
521
+
522
+ type TypedRef<T> = { $ref: string; path?: string } & { __phantomType?: T }
523
+
524
+ type TemplateString = {
525
+ $template: {
526
+ parts: string[]
527
+ expressions: Array<{ $ref: string; path?: string }>
528
+ }
529
+ } & { __brand: 'TemplateString' }
530
+
531
+ type InputWithRefs<T> = {
532
+ [K in keyof T]?: T[K] | TypedRef<T[K]> | TypedRef<unknown> | TemplateString
533
+ }
534
+
535
+ type NodeInputType<FuncMap extends Record<string, string>, K extends keyof FuncMap> =
536
+ FuncMap[K] extends keyof FlattenedRPCMap
537
+ ? InputWithRefs<FlattenedRPCMap[FuncMap[K]]['input']>
538
+ : FuncMap[K] extends keyof FlattenedWorkflowMap
539
+ ? InputWithRefs<FlattenedWorkflowMap[FuncMap[K]]['input']>
540
+ : Record<string, unknown>
541
+
542
+ type NodeOutputKeys<FuncMap extends Record<string, string>, N extends string> =
543
+ N extends keyof FuncMap
544
+ ? FuncMap[N] extends keyof FlattenedRPCMap
545
+ ? keyof FlattenedRPCMap[FuncMap[N]]['output'] & string
546
+ : FuncMap[N] extends keyof FlattenedWorkflowMap
547
+ ? keyof FlattenedWorkflowMap[FuncMap[N]]['output'] & string
548
+ : FuncMap[N] extends keyof FlattenedAgentMap
549
+ ? keyof FlattenedAgentMap[FuncMap[N]]['output'] & string
550
+ : string
551
+ : string
552
+
553
+ type RefFunction<FuncMap extends Record<string, string>> = {
554
+ <N extends Extract<keyof FuncMap, string>>(
555
+ nodeId: N,
556
+ path: NodeOutputKeys<FuncMap, N>
557
+ ): TypedRef<unknown>
558
+ <N extends Extract<keyof FuncMap, string>>(nodeId: N): TypedRef<unknown>
559
+ (nodeId: 'trigger' | '$item', path?: string): TypedRef<unknown>
560
+ }
561
+
562
+ type TemplateFunction = (templateStr: string, refs: TypedRef<unknown>[]) => TemplateString
563
+
564
+ type GraphNodeConfigMap<FuncMap extends Record<string, string>> = {
565
+ [K in Extract<keyof FuncMap, string>]?: {
566
+ next?: NextConfig<Extract<keyof FuncMap, string>>
567
+ input?:
568
+ | NodeInputType<FuncMap, K>
569
+ | (() => NodeInputType<FuncMap, K>)
570
+ | ((ref: RefFunction<FuncMap>, template: TemplateFunction) => NodeInputType<FuncMap, K>)
571
+ onError?: Extract<keyof FuncMap, string> | Extract<keyof FuncMap, string>[]
572
+ /** Free-text node documentation. Non-semantic — excluded from graphHash. */
573
+ notes?: string
574
+ }
575
+ }
576
+
577
+ type NextConfig<NodeIds extends string> = NodeIds | NodeIds[] | { if: string; then: NodeIds; else?: NodeIds }
578
+
579
+ export function pikkuWorkflowGraph<
580
+ const FuncMap extends Record<
581
+ string,
582
+ | (keyof FlattenedRPCMap & string)
583
+ | (keyof FlattenedWorkflowMap & string)
584
+ | (keyof FlattenedAgentMap & string)
585
+ >
586
+ >(
587
+ config: PikkuWorkflowGraphConfig<FuncMap, GraphNodeConfigMap<FuncMap>>
588
+ ): PikkuWorkflowGraphResult {
589
+ return corePikkuWorkflowGraph(config as any)
590
+ }
591
+
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.96
3
+ */
4
+ import { pikkuState } from '@pikku/core/internal'
5
+ import type { WorkflowsRuntimeMeta } from '@pikku/core/workflow/types'
6
+
7
+ const workflowsMeta: WorkflowsRuntimeMeta = {}
8
+
9
+ pikkuState('@pikku/addon-meta-conversions', 'workflows', 'meta', workflowsMeta)
@@ -0,0 +1,3 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.96
3
+ */
@@ -1,10 +1,10 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.6
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  /**
5
5
  * Addon package types for pikkuAddonConfig and pikkuAddonServices
6
6
  */
7
- import type { CreateConfig } from '@pikku/core';
7
+ import type { CreateConfig, PikkuWire } from '@pikku/core';
8
8
  import type { SingletonServices } from '../../types/application-types.d.js';
9
9
  import type { Config } from '../../types/application-types.d.js';
10
10
  import type { RequiredSingletonServices } from '../pikku-services.gen.js';
@@ -39,7 +39,7 @@ export declare const pikkuAddonConfig: <ExistingServices extends Omit<Partial<Si
39
39
  * config,
40
40
  * { secrets }
41
41
  * ) => {
42
- * const creds = await secrets.getSecretJSON<GithubCredentials>('GITHUB_CREDENTIALS')
42
+ * const creds = await secrets.getSecret<GithubCredentials>('GITHUB_CREDENTIALS')
43
43
  * const github = new GithubService(creds)
44
44
  * return { github }
45
45
  * })
@@ -61,5 +61,5 @@ export declare const pikkuAddonServices: <T extends Record<string, any>, Existin
61
61
  * })
62
62
  * ```
63
63
  */
64
- export declare const pikkuAddonWireServices: (func: (services: SingletonServices, wire: any) => Promise<Record<string, any>>) => any;
64
+ export declare const pikkuAddonWireServices: <ExistingServices extends Omit<Partial<SingletonServices>, "variables" | "secrets"> & AddonBaseServices>(func: (services: ExistingServices, wire: PikkuWire) => Promise<Record<string, any>>) => any;
65
65
  //# sourceMappingURL=pikku-addon-types.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-addon-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/addon/pikku-addon-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAA;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAK3E;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IACnC,SAAS,EAAE,qBAAqB,CAAA;IAChC,OAAO,EAAE,kBAAkB,CAAA;CAC5B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EACrI,MAAM,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,CAAC,KACpD,YAAY,CAAC,MAAM,CAKrB,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EACtK,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,MAElD,QAAQ,MAAM,EAAE,mBAAmB,OAAO,CAAC,iBAAiB,CAAC,KAAG,OAAO,CAAC,yBAAyB,CAchH,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GACjC,MAAM,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAE/D,GAChB,CAAA"}
1
+ {"version":3,"file":"pikku-addon-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/addon/pikku-addon-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAA;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAM3E;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IACnC,SAAS,EAAE,qBAAqB,CAAA;IAChC,OAAO,EAAE,kBAAkB,CAAA;CAC5B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EACrI,MAAM,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,CAAC,KACpD,YAAY,CAAC,MAAM,CAKrB,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EACtK,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,MAElD,QAAQ,MAAM,EAAE,mBAAmB,OAAO,CAAC,iBAAiB,CAAC,KAAG,OAAO,CAAC,yBAAyB,CAchH,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GAAI,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EAC3I,MAAM,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAM7E,GACP,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.6
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  /**
5
5
  * Addon package types for pikkuAddonConfig and pikkuAddonServices
@@ -31,7 +31,7 @@ export const pikkuAddonConfig = (func) => {
31
31
  * config,
32
32
  * { secrets }
33
33
  * ) => {
34
- * const creds = await secrets.getSecretJSON<GithubCredentials>('GITHUB_CREDENTIALS')
34
+ * const creds = await secrets.getSecret<GithubCredentials>('GITHUB_CREDENTIALS')
35
35
  * const github = new GithubService(creds)
36
36
  * return { github }
37
37
  * })
@@ -69,6 +69,10 @@ export const pikkuAddonServices = (func) => {
69
69
  * ```
70
70
  */
71
71
  export const pikkuAddonWireServices = (func) => {
72
- return func;
72
+ return ((services, wire) => {
73
+ const typedVariables = new TypedVariablesService(services.variables);
74
+ const typedSecrets = new TypedSecretService(services.secrets);
75
+ return func({ ...services, variables: typedVariables, secrets: typedSecrets }, wire);
76
+ });
73
77
  };
74
78
  //# sourceMappingURL=pikku-addon-types.gen.js.map