@pikku/addon-graph 0.12.0 → 0.12.4

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 (231) hide show
  1. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +2 -2
  2. package/dist/.pikku/addon/pikku-addon-types.gen.js +2 -2
  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/channel/pikku-channel-types.gen.d.ts +1 -1
  7. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  8. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  9. package/dist/.pikku/function/pikku-function-types.gen.d.ts +57 -70
  10. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
  11. package/dist/.pikku/function/pikku-function-types.gen.js +67 -43
  12. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
  13. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  14. package/dist/.pikku/function/pikku-functions-meta.gen.json +476 -449
  15. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  16. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  17. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  18. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  19. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  20. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  21. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  22. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  23. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  24. package/dist/.pikku/pikku-services.gen.d.ts +8 -3
  25. package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
  26. package/dist/.pikku/pikku-services.gen.js +6 -1
  27. package/dist/.pikku/pikku-services.gen.js.map +1 -1
  28. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  29. package/dist/.pikku/pikku-types.gen.js +1 -1
  30. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  31. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  32. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +11 -3
  33. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +12 -4
  34. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  35. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +26 -26
  36. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  37. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  38. package/dist/.pikku/schemas/register.gen.js +3 -1
  39. package/dist/.pikku/schemas/register.gen.js.map +1 -1
  40. package/dist/.pikku/schemas/schemas/AggregateInput.schema.json +1 -1
  41. package/dist/.pikku/schemas/schemas/AggregateOutput.schema.json +1 -1
  42. package/dist/.pikku/schemas/schemas/ChunkInput.schema.json +1 -1
  43. package/dist/.pikku/schemas/schemas/ChunkOutput.schema.json +1 -1
  44. package/dist/.pikku/schemas/schemas/CoalesceInput.schema.json +1 -1
  45. package/dist/.pikku/schemas/schemas/CoalesceOutput.schema.json +1 -1
  46. package/dist/.pikku/schemas/schemas/CryptoInput.schema.json +1 -1
  47. package/dist/.pikku/schemas/schemas/CryptoOutput.schema.json +1 -1
  48. package/dist/.pikku/schemas/schemas/DateTimeInput.schema.json +1 -1
  49. package/dist/.pikku/schemas/schemas/DateTimeOutput.schema.json +1 -1
  50. package/dist/.pikku/schemas/schemas/EditFieldsInput.schema.json +1 -1
  51. package/dist/.pikku/schemas/schemas/EditFieldsOutput.schema.json +1 -1
  52. package/dist/.pikku/schemas/schemas/FindInput.schema.json +1 -1
  53. package/dist/.pikku/schemas/schemas/FindOutput.schema.json +1 -1
  54. package/dist/.pikku/schemas/schemas/GroupByInput.schema.json +1 -1
  55. package/dist/.pikku/schemas/schemas/GroupByOutput.schema.json +1 -1
  56. package/dist/.pikku/schemas/schemas/JwtDecodeInput.schema.json +1 -1
  57. package/dist/.pikku/schemas/schemas/JwtDecodeOutput.schema.json +1 -1
  58. package/dist/.pikku/schemas/schemas/JwtSignInput.schema.json +1 -1
  59. package/dist/.pikku/schemas/schemas/JwtSignOutput.schema.json +1 -1
  60. package/dist/.pikku/schemas/schemas/LimitInput.schema.json +1 -1
  61. package/dist/.pikku/schemas/schemas/LimitOutput.schema.json +1 -1
  62. package/dist/.pikku/schemas/schemas/MathInput.schema.json +1 -1
  63. package/dist/.pikku/schemas/schemas/MathOutput.schema.json +1 -1
  64. package/dist/.pikku/schemas/schemas/MergeInput.schema.json +1 -1
  65. package/dist/.pikku/schemas/schemas/MergeOutput.schema.json +1 -1
  66. package/dist/.pikku/schemas/schemas/OmitInput.schema.json +1 -1
  67. package/dist/.pikku/schemas/schemas/OmitOutput.schema.json +1 -1
  68. package/dist/.pikku/schemas/schemas/PickInput.schema.json +1 -1
  69. package/dist/.pikku/schemas/schemas/PickOutput.schema.json +1 -1
  70. package/dist/.pikku/schemas/schemas/RemoveDuplicatesInput.schema.json +1 -1
  71. package/dist/.pikku/schemas/schemas/RemoveDuplicatesOutput.schema.json +1 -1
  72. package/dist/.pikku/schemas/schemas/RenameKeysInput.schema.json +1 -1
  73. package/dist/.pikku/schemas/schemas/RenameKeysOutput.schema.json +1 -1
  74. package/dist/.pikku/schemas/schemas/ReverseInput.schema.json +1 -1
  75. package/dist/.pikku/schemas/schemas/ReverseOutput.schema.json +1 -1
  76. package/dist/.pikku/schemas/schemas/SleepInput.schema.json +1 -1
  77. package/dist/.pikku/schemas/schemas/SleepOutput.schema.json +1 -0
  78. package/dist/.pikku/schemas/schemas/SortInput.schema.json +1 -1
  79. package/dist/.pikku/schemas/schemas/SortOutput.schema.json +1 -1
  80. package/dist/.pikku/schemas/schemas/SplitOutInput.schema.json +1 -1
  81. package/dist/.pikku/schemas/schemas/SplitOutOutput.schema.json +1 -1
  82. package/dist/.pikku/schemas/schemas/StringTransformInput.schema.json +1 -1
  83. package/dist/.pikku/schemas/schemas/StringTransformOutput.schema.json +1 -1
  84. package/dist/.pikku/schemas/schemas/SummarizeInput.schema.json +1 -1
  85. package/dist/.pikku/schemas/schemas/SummarizeOutput.schema.json +1 -1
  86. package/dist/.pikku/schemas/schemas/TypeConvertInput.schema.json +1 -1
  87. package/dist/.pikku/schemas/schemas/TypeConvertOutput.schema.json +1 -1
  88. package/dist/.pikku/schemas/schemas/UniqueInput.schema.json +1 -1
  89. package/dist/.pikku/schemas/schemas/UniqueOutput.schema.json +1 -1
  90. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  91. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  92. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  93. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  94. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  95. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  96. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  97. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  98. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  99. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  100. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +1 -1
  101. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  102. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  103. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  104. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  105. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  106. package/dist/src/functions/data/sleep.function.d.ts +1 -0
  107. package/dist/src/functions/data/sleep.function.d.ts.map +1 -1
  108. package/dist/src/functions/data/sleep.function.js +2 -1
  109. package/dist/src/functions/data/sleep.function.js.map +1 -1
  110. package/package.json +15 -17
  111. package/.pikku/addon/pikku-addon-types.gen.ts +0 -105
  112. package/.pikku/addon/pikku-package.gen.ts +0 -11
  113. package/.pikku/agent/pikku-agent-map.gen.d.ts +0 -4
  114. package/.pikku/agent/pikku-agent-types.gen.ts +0 -82
  115. package/.pikku/channel/pikku-channel-types.gen.ts +0 -177
  116. package/.pikku/cli/pikku-cli-types.gen.ts +0 -105
  117. package/.pikku/console/pikku-addon-meta.gen.json +0 -281
  118. package/.pikku/console/pikku-node-types.gen.ts +0 -8
  119. package/.pikku/function/pikku-function-types.gen.ts +0 -684
  120. package/.pikku/function/pikku-functions-meta-verbose.gen.json +0 -660
  121. package/.pikku/function/pikku-functions-meta.gen.json +0 -450
  122. package/.pikku/function/pikku-functions-meta.gen.ts +0 -7
  123. package/.pikku/function/pikku-functions.gen.ts +0 -56
  124. package/.pikku/http/pikku-http-types.gen.ts +0 -147
  125. package/.pikku/mcp/pikku-mcp-types.gen.ts +0 -183
  126. package/.pikku/pikku-bootstrap.gen.ts +0 -8
  127. package/.pikku/pikku-meta-service.gen.ts +0 -10
  128. package/.pikku/pikku-services.gen.ts +0 -39
  129. package/.pikku/pikku-types.gen.ts +0 -21
  130. package/.pikku/queue/pikku-queue-types.gen.ts +0 -27
  131. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +0 -488
  132. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +0 -513
  133. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +0 -27
  134. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +0 -6
  135. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +0 -25
  136. package/.pikku/schemas/register.gen.ts +0 -199
  137. package/.pikku/schemas/schemas/AggregateInput.schema.json +0 -1
  138. package/.pikku/schemas/schemas/AggregateOutput.schema.json +0 -1
  139. package/.pikku/schemas/schemas/ChunkInput.schema.json +0 -1
  140. package/.pikku/schemas/schemas/ChunkOutput.schema.json +0 -1
  141. package/.pikku/schemas/schemas/CoalesceInput.schema.json +0 -1
  142. package/.pikku/schemas/schemas/CoalesceOutput.schema.json +0 -1
  143. package/.pikku/schemas/schemas/CryptoInput.schema.json +0 -1
  144. package/.pikku/schemas/schemas/CryptoOutput.schema.json +0 -1
  145. package/.pikku/schemas/schemas/DateTimeInput.schema.json +0 -1
  146. package/.pikku/schemas/schemas/DateTimeOutput.schema.json +0 -1
  147. package/.pikku/schemas/schemas/EditFieldsInput.schema.json +0 -1
  148. package/.pikku/schemas/schemas/EditFieldsOutput.schema.json +0 -1
  149. package/.pikku/schemas/schemas/FindInput.schema.json +0 -1
  150. package/.pikku/schemas/schemas/FindOutput.schema.json +0 -1
  151. package/.pikku/schemas/schemas/GroupByInput.schema.json +0 -1
  152. package/.pikku/schemas/schemas/GroupByOutput.schema.json +0 -1
  153. package/.pikku/schemas/schemas/JwtDecodeInput.schema.json +0 -1
  154. package/.pikku/schemas/schemas/JwtDecodeOutput.schema.json +0 -1
  155. package/.pikku/schemas/schemas/JwtSignInput.schema.json +0 -1
  156. package/.pikku/schemas/schemas/JwtSignOutput.schema.json +0 -1
  157. package/.pikku/schemas/schemas/LimitInput.schema.json +0 -1
  158. package/.pikku/schemas/schemas/LimitOutput.schema.json +0 -1
  159. package/.pikku/schemas/schemas/MathInput.schema.json +0 -1
  160. package/.pikku/schemas/schemas/MathOutput.schema.json +0 -1
  161. package/.pikku/schemas/schemas/MergeInput.schema.json +0 -1
  162. package/.pikku/schemas/schemas/MergeOutput.schema.json +0 -1
  163. package/.pikku/schemas/schemas/OmitInput.schema.json +0 -1
  164. package/.pikku/schemas/schemas/OmitOutput.schema.json +0 -1
  165. package/.pikku/schemas/schemas/PickInput.schema.json +0 -1
  166. package/.pikku/schemas/schemas/PickOutput.schema.json +0 -1
  167. package/.pikku/schemas/schemas/RemoveDuplicatesInput.schema.json +0 -1
  168. package/.pikku/schemas/schemas/RemoveDuplicatesOutput.schema.json +0 -1
  169. package/.pikku/schemas/schemas/RenameKeysInput.schema.json +0 -1
  170. package/.pikku/schemas/schemas/RenameKeysOutput.schema.json +0 -1
  171. package/.pikku/schemas/schemas/ReverseInput.schema.json +0 -1
  172. package/.pikku/schemas/schemas/ReverseOutput.schema.json +0 -1
  173. package/.pikku/schemas/schemas/SleepInput.schema.json +0 -1
  174. package/.pikku/schemas/schemas/SortInput.schema.json +0 -1
  175. package/.pikku/schemas/schemas/SortOutput.schema.json +0 -1
  176. package/.pikku/schemas/schemas/SplitOutInput.schema.json +0 -1
  177. package/.pikku/schemas/schemas/SplitOutOutput.schema.json +0 -1
  178. package/.pikku/schemas/schemas/StringTransformInput.schema.json +0 -1
  179. package/.pikku/schemas/schemas/StringTransformOutput.schema.json +0 -1
  180. package/.pikku/schemas/schemas/SummarizeInput.schema.json +0 -1
  181. package/.pikku/schemas/schemas/SummarizeOutput.schema.json +0 -1
  182. package/.pikku/schemas/schemas/TypeConvertInput.schema.json +0 -1
  183. package/.pikku/schemas/schemas/TypeConvertOutput.schema.json +0 -1
  184. package/.pikku/schemas/schemas/UniqueInput.schema.json +0 -1
  185. package/.pikku/schemas/schemas/UniqueOutput.schema.json +0 -1
  186. package/.pikku/secrets/pikku-secret-types.gen.ts +0 -5
  187. package/.pikku/secrets/pikku-secrets-meta.gen.json +0 -1
  188. package/.pikku/secrets/pikku-secrets.gen.ts +0 -21
  189. package/.pikku/trigger/pikku-trigger-types.gen.ts +0 -160
  190. package/.pikku/variables/pikku-variable-types.gen.ts +0 -5
  191. package/.pikku/variables/pikku-variables-meta.gen.json +0 -1
  192. package/.pikku/variables/pikku-variables.gen.ts +0 -21
  193. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +0 -38
  194. package/.pikku/workflow/pikku-workflow-types.gen.ts +0 -167
  195. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +0 -9
  196. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +0 -3
  197. package/dist/.pikku/addon/pikku-addon-types.gen.ts +0 -105
  198. package/dist/.pikku/addon/pikku-package.gen.ts +0 -11
  199. package/dist/.pikku/agent/pikku-agent-types.gen.ts +0 -82
  200. package/dist/.pikku/channel/pikku-channel-types.gen.ts +0 -177
  201. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +0 -78
  202. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts.map +0 -1
  203. package/dist/.pikku/cli/pikku-cli-types.gen.js +0 -61
  204. package/dist/.pikku/cli/pikku-cli-types.gen.js.map +0 -1
  205. package/dist/.pikku/cli/pikku-cli-types.gen.ts +0 -105
  206. package/dist/.pikku/console/pikku-addon-meta.gen.json +0 -281
  207. package/dist/.pikku/console/pikku-node-types.gen.ts +0 -8
  208. package/dist/.pikku/function/pikku-function-types.gen.ts +0 -684
  209. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +0 -660
  210. package/dist/.pikku/function/pikku-functions-meta.gen.ts +0 -7
  211. package/dist/.pikku/function/pikku-functions.gen.ts +0 -56
  212. package/dist/.pikku/http/pikku-http-types.gen.ts +0 -147
  213. package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +0 -183
  214. package/dist/.pikku/pikku-bootstrap.gen.ts +0 -8
  215. package/dist/.pikku/pikku-meta-service.gen.ts +0 -10
  216. package/dist/.pikku/pikku-services.gen.ts +0 -39
  217. package/dist/.pikku/pikku-types.gen.ts +0 -21
  218. package/dist/.pikku/queue/pikku-queue-types.gen.ts +0 -27
  219. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +0 -6
  220. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +0 -25
  221. package/dist/.pikku/schemas/register.gen.ts +0 -199
  222. package/dist/.pikku/secrets/pikku-secret-types.gen.ts +0 -5
  223. package/dist/.pikku/secrets/pikku-secrets-meta.gen.json +0 -1
  224. package/dist/.pikku/secrets/pikku-secrets.gen.ts +0 -21
  225. package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +0 -160
  226. package/dist/.pikku/variables/pikku-variable-types.gen.ts +0 -5
  227. package/dist/.pikku/variables/pikku-variables-meta.gen.json +0 -1
  228. package/dist/.pikku/variables/pikku-variables.gen.ts +0 -21
  229. package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +0 -167
  230. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +0 -9
  231. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +0 -3
@@ -1,21 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
4
- import { TypedVariablesService as CoreTypedVariablesService, type VariableMeta } from '@pikku/core/services'
5
- import type { VariablesService } from '@pikku/core/services'
6
-
7
- export interface VariablesMap {
8
-
9
- }
10
-
11
- export type VariableId = keyof VariablesMap
12
-
13
- const VARIABLES_META: Record<string, VariableMeta> = {
14
-
15
- }
16
-
17
- export class TypedVariablesService extends CoreTypedVariablesService<VariablesMap> {
18
- constructor(variables: VariablesService) {
19
- super(variables, VARIABLES_META)
20
- }
21
- }
@@ -1,38 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
4
- /**
5
- * Workflow type map with input/output types for each workflow
6
- */
7
-
8
-
9
-
10
-
11
-
12
- interface WorkflowHandler<I, O> {
13
- input: I;
14
- output: O;
15
- }
16
-
17
- interface GraphNodeHandler<I> {
18
- input: I;
19
- }
20
-
21
- export type WorkflowMap = {
22
- };
23
-
24
- export type GraphsMap = {
25
- };
26
-
27
- export type FlattenedWorkflowMap = WorkflowMap
28
-
29
-
30
- export type WorkflowClient<Name extends keyof FlattenedWorkflowMap> = {
31
- start: (input: FlattenedWorkflowMap[Name]['input']) => Promise<{ runId: string }>;
32
- getRun: <output extends keyof FlattenedWorkflowMap[Name]>(runId: string) => Promise<FlattenedWorkflowMap[Name][output]>;
33
- cancelRun: (runId: string) => Promise<boolean>;
34
- }
35
-
36
- export type TypedWorkflowClients = {
37
- [Name in keyof FlattenedWorkflowMap]: WorkflowClient<Name>;
38
- }
@@ -1,167 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
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, WorkflowStepOptions } 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
-
18
- export { template }
19
-
20
- export interface TypedWorkflow extends PikkuWorkflowWire {
21
- do<K extends keyof FlattenedRPCMap>(
22
- stepName: string,
23
- rpcName: K,
24
- data: FlattenedRPCMap[K]['input'],
25
- options?: WorkflowStepOptions
26
- ): Promise<FlattenedRPCMap[K]['output']>
27
-
28
- do<K extends keyof FlattenedWorkflowMap>(
29
- stepName: string,
30
- workflowName: K,
31
- data: FlattenedWorkflowMap[K]['input'],
32
- options?: WorkflowStepOptions
33
- ): Promise<FlattenedWorkflowMap[K]['output']>
34
-
35
- do<T>(
36
- stepName: string,
37
- fn: () => T | Promise<T>,
38
- options?: WorkflowStepOptions
39
- ): Promise<T>
40
- }
41
-
42
- import type { StandardSchemaV1 } from '@standard-schema/spec'
43
- import type { InferSchemaOutput, PikkuPermission, PikkuMiddleware, NodeConfig, PikkuApprovalDescription } from '../function/pikku-function-types.gen.js'
44
- import { PikkuError } from '@pikku/core/errors'
45
- import type { CorePermissionGroup } from '@pikku/core'
46
-
47
- export type PikkuFunctionWorkflow<
48
- In = unknown,
49
- Out = never
50
- > = PikkuFunctionSessionless<In, Out, 'workflow'>
51
-
52
- export type PikkuWorkflowConfigWithSchema<
53
- InputSchema extends StandardSchemaV1 | undefined = undefined,
54
- OutputSchema extends StandardSchemaV1 | undefined = undefined
55
- > = {
56
- title?: string
57
- description?: string
58
- tags?: string[]
59
- expose?: boolean
60
- internal?: boolean
61
- override?: string
62
- version?: number
63
- remote?: boolean
64
- mcp?: boolean
65
- readonly?: boolean
66
- approvalRequired?: boolean
67
- approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
68
- func: PikkuFunctionWorkflow<
69
- InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
70
- OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
71
- >
72
- auth?: boolean
73
- permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
74
- middleware?: PikkuMiddleware[]
75
- input?: InputSchema
76
- output?: OutputSchema
77
- node?: NodeConfig
78
- errors?: Array<typeof PikkuError>
79
- inline?: boolean
80
- }
81
-
82
- export function pikkuWorkflowFunc<
83
- InputSchema extends StandardSchemaV1 | undefined = undefined,
84
- OutputSchema extends StandardSchemaV1 | undefined = undefined
85
- >(
86
- config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
87
- ): 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>
88
- export function pikkuWorkflowFunc<In, Out = unknown>(
89
- func:
90
- | PikkuFunctionWorkflow<In, Out>
91
- | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
92
- ): PikkuFunctionConfig<In, Out, 'workflow'>
93
- export function pikkuWorkflowFunc(func: any) {
94
- return typeof func === 'function' ? { func } : func
95
- }
96
-
97
- export function pikkuWorkflowComplexFunc<
98
- InputSchema extends StandardSchemaV1 | undefined = undefined,
99
- OutputSchema extends StandardSchemaV1 | undefined = undefined
100
- >(
101
- config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
102
- ): 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>
103
- export function pikkuWorkflowComplexFunc<In, Out = unknown>(
104
- func:
105
- | PikkuFunctionWorkflow<In, Out>
106
- | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
107
- ): PikkuFunctionConfig<In, Out, 'workflow'>
108
- export function pikkuWorkflowComplexFunc(func: any) {
109
- return typeof func === 'function' ? { func } : func
110
- }
111
-
112
- type TypedRef<T> = { $ref: string; path?: string } & { __phantomType?: T }
113
-
114
- type TemplateString = {
115
- $template: {
116
- parts: string[]
117
- expressions: Array<{ $ref: string; path?: string }>
118
- }
119
- } & { __brand: 'TemplateString' }
120
-
121
- type InputWithRefs<T> = {
122
- [K in keyof T]?: T[K] | TypedRef<T[K]> | TypedRef<unknown> | TemplateString
123
- }
124
-
125
- type NodeInputType<FuncMap extends Record<string, string>, K extends keyof FuncMap> =
126
- FuncMap[K] extends keyof FlattenedRPCMap
127
- ? InputWithRefs<FlattenedRPCMap[FuncMap[K]]['input']>
128
- : Record<string, unknown>
129
-
130
- type NodeOutputKeys<FuncMap extends Record<string, string>, N extends string> =
131
- N extends keyof FuncMap
132
- ? FuncMap[N] extends keyof FlattenedRPCMap
133
- ? keyof FlattenedRPCMap[FuncMap[N]]['output'] & string
134
- : string
135
- : string
136
-
137
- type RefFunction<FuncMap extends Record<string, string>> = {
138
- <N extends Extract<keyof FuncMap, string>>(
139
- nodeId: N,
140
- path: NodeOutputKeys<FuncMap, N>
141
- ): TypedRef<unknown>
142
- (nodeId: 'trigger' | '$item', path?: string): TypedRef<unknown>
143
- }
144
-
145
- type TemplateFunction = (templateStr: string, refs: TypedRef<unknown>[]) => TemplateString
146
-
147
- type GraphNodeConfigMap<FuncMap extends Record<string, string>> = {
148
- [K in Extract<keyof FuncMap, string>]?: {
149
- next?: NextConfig<Extract<keyof FuncMap, string>>
150
- input?:
151
- | NodeInputType<FuncMap, K>
152
- | (() => NodeInputType<FuncMap, K>)
153
- | ((ref: RefFunction<FuncMap>, template: TemplateFunction) => NodeInputType<FuncMap, K>)
154
- onError?: Extract<keyof FuncMap, string> | Extract<keyof FuncMap, string>[]
155
- }
156
- }
157
-
158
- type NextConfig<NodeIds extends string> = NodeIds | NodeIds[] | { if: string; then: NodeIds; else?: NodeIds }
159
-
160
- export function pikkuWorkflowGraph<
161
- const FuncMap extends Record<string, keyof FlattenedRPCMap & string>
162
- >(
163
- config: PikkuWorkflowGraphConfig<FuncMap, GraphNodeConfigMap<FuncMap>>
164
- ): PikkuWorkflowGraphResult {
165
- return corePikkuWorkflowGraph(config as any)
166
- }
167
-
@@ -1,9 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
4
- import { pikkuState } from '@pikku/core/internal'
5
- import type { SerializedWorkflowGraphs } from '@pikku/inspector/workflow-graph'
6
-
7
- const workflowsMeta: SerializedWorkflowGraphs = {}
8
-
9
- pikkuState('@pikku/addon-graph', 'workflows', 'meta', workflowsMeta)
@@ -1,3 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
@@ -1,105 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
4
- /**
5
- * Addon package types for pikkuAddonConfig and pikkuAddonServices
6
- */
7
-
8
- import type { CreateConfig, PikkuWire } from '@pikku/core'
9
- import type { SingletonServices } from '../../types/application-types.d.js'
10
- import type { Config } from '../../types/application-types.d.js'
11
- import type { RequiredSingletonServices } from '../pikku-services.gen.js'
12
- import { TypedSecretService } from '../secrets/pikku-secrets.gen.js'
13
- import { TypedVariablesService } from '../variables/pikku-variables.gen.js'
14
-
15
-
16
-
17
-
18
-
19
- /**
20
- * Base services provided to addon package service factories.
21
- * These are always available from the parent application.
22
- */
23
- export type AddonBaseServices = {
24
- logger: SingletonServices['logger']
25
- variables: TypedVariablesService
26
- secrets: TypedSecretService
27
- }
28
-
29
- /**
30
- * Creates a Pikku config factory for addon packages.
31
- * Unlike pikkuConfig, this receives AddonBaseServices (logger, variables, secrets)
32
- * from the parent application, so addon packages can read variables/secrets during config creation.
33
- */
34
- export const pikkuAddonConfig = <ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & AddonBaseServices>(
35
- func: (services: ExistingServices) => Promise<Config>
36
- ): CreateConfig<Config> => {
37
- return (async (_variables: any, existingServices?: Partial<SingletonServices>): Promise<Config> => {
38
- const { secrets, variables, ...rest } = (existingServices ?? {}) as unknown as SingletonServices
39
- return func({ ...rest, secrets: new TypedSecretService(secrets), variables: new TypedVariablesService(variables) } as ExistingServices)
40
- }) as unknown as CreateConfig<Config>
41
- }
42
-
43
- /**
44
- * Creates a Pikku singleton services factory for addon packages.
45
- * Unlike pikkuServices, this expects the parent application to provide
46
- * logger, variables, and secrets - no fallbacks needed.
47
- *
48
- * @param func - Addon services factory function that receives config and base services
49
- * @returns The singleton services factory function
50
- *
51
- * @example
52
- * ```typescript
53
- * export const createSingletonServices = pikkuAddonServices(async (
54
- * config,
55
- * { secrets }
56
- * ) => {
57
- * const creds = await secrets.getSecretJSON<GithubCredentials>('GITHUB_CREDENTIALS')
58
- * const github = new GithubService(creds)
59
- * return { github }
60
- * })
61
- * ```
62
- */
63
- export const pikkuAddonServices = <T extends Record<string, any>, ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & AddonBaseServices>(
64
- func: (config: Config, services: ExistingServices) => Promise<T>
65
- ) => {
66
- return async (config: Config, existingServices?: Partial<SingletonServices>): Promise<RequiredSingletonServices> => {
67
- const { logger, variables, secrets, schema } = (existingServices ?? {}) as unknown as SingletonServices
68
- const typedVariables = new TypedVariablesService(variables)
69
- const typedSecrets = new TypedSecretService(secrets)
70
- const result = await func(config, { ...existingServices, logger, variables: typedVariables, secrets: typedSecrets } as ExistingServices)
71
- return {
72
- config,
73
- logger,
74
- schema,
75
- variables: typedVariables,
76
- secrets: typedSecrets,
77
- ...result,
78
- } as unknown as RequiredSingletonServices
79
- }
80
- }
81
-
82
- /**
83
- * Creates a Pikku wire services factory for addon packages.
84
- * Wire services are created per-request and have access to the HTTP request context.
85
- *
86
- * @param func - Wire services factory function that receives singleton services and the wire context
87
- * @returns The wire services factory function
88
- *
89
- * @example
90
- * ```typescript
91
- * export const createWireServices = pikkuAddonWireServices(async (services, wire) => {
92
- * const authHeader = wire.http?.request?.header('authorization')
93
- * return { myService: new MyService(authHeader) }
94
- * })
95
- * ```
96
- */
97
- export const pikkuAddonWireServices = <ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & AddonBaseServices>(
98
- func: (services: ExistingServices, wire: PikkuWire) => Promise<Record<string, any>>
99
- ) => {
100
- return ((services: any, wire: PikkuWire) => {
101
- const typedVariables = new TypedVariablesService(services.variables)
102
- const typedSecrets = new TypedSecretService(services.secrets)
103
- return func({ ...services, variables: typedVariables, secrets: typedSecrets } as ExistingServices, wire)
104
- }) as any
105
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
4
- import { pikkuState } from '@pikku/core/internal'
5
- import { createSingletonServices as createSingletonServices } from '../../src/services.js'
6
-
7
- pikkuState('@pikku/addon-graph', 'package', 'factories', {
8
- createSingletonServices,
9
- })
10
-
11
- pikkuState('@pikku/addon-graph', 'package', 'requiredParentServices', ["jwt"])
@@ -1,82 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
4
- import {
5
- CoreAIAgent,
6
- PikkuAIMiddlewareHooks,
7
- } from '@pikku/core/ai-agent'
8
- import {
9
- agent as coreAgent,
10
- agentStream as coreAgentStream,
11
- agentResume as coreAgentResume,
12
- agentApprove as coreAgentApprove,
13
- } from '@pikku/core/ai-agent'
14
- import type { PikkuPermission, PikkuMiddleware, Services, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
15
- import type { StandardSchemaV1 } from '@standard-schema/spec'
16
- import type { AIAgentMemoryConfig, AIAgentInput } from '@pikku/core/ai-agent'
17
- import type { AgentMap } from './pikku-agent-map.gen.d.js'
18
-
19
- type AIAgentConfig<
20
- InputSchema extends StandardSchemaV1 | undefined = undefined,
21
- OutputSchema extends StandardSchemaV1 | undefined = undefined
22
- > = Omit<CoreAIAgent<PikkuPermission, PikkuMiddleware>, 'tools' | 'agents' | 'memory' | 'input' | 'output'> & {
23
- input?: InputSchema
24
- output?: OutputSchema
25
- memory?: Omit<AIAgentMemoryConfig, 'workingMemory'> & { workingMemory?: StandardSchemaV1 }
26
- tools?: object[]
27
- agents?: AIAgentConfig<StandardSchemaV1 | undefined, StandardSchemaV1 | undefined>[]
28
- }
29
-
30
- export const pikkuAIAgent = <
31
- InputSchema extends StandardSchemaV1 | undefined = undefined,
32
- OutputSchema extends StandardSchemaV1 | undefined = undefined
33
- >(
34
- agent: AIAgentConfig<InputSchema, OutputSchema>
35
- ) => {
36
- return agent
37
- }
38
-
39
- export const pikkuAIMiddleware = <
40
- State extends Record<string, unknown> = Record<string, unknown>,
41
- RequiredServices extends Services = Services,
42
- >(
43
- hooks: PikkuAIMiddlewareHooks<State, RequiredServices>
44
- ): PikkuAIMiddlewareHooks<State, RequiredServices> => hooks
45
-
46
- export const agent = <Name extends keyof AgentMap>(
47
- agentName: Name
48
- ) => {
49
- return coreAgent<AgentMap>(agentName as string & keyof AgentMap) as PikkuFunctionConfig<
50
- AIAgentInput,
51
- { runId: string; result: AgentMap[Name]['output']; usage: { inputTokens: number; outputTokens: number } },
52
- 'session' | 'rpc'
53
- >
54
- }
55
-
56
- export const agentStream = <Name extends keyof AgentMap>(
57
- agentName?: Name
58
- ) => {
59
- return coreAgentStream<AgentMap>(agentName as string & keyof AgentMap) as PikkuFunctionConfig<
60
- { agentName?: string; message: string; threadId: string; resourceId: string },
61
- void,
62
- 'session' | 'rpc'
63
- >
64
- }
65
-
66
- export const agentResume = () => {
67
- return coreAgentResume() as PikkuFunctionConfig<
68
- { runId: string; toolCallId: string; approved: boolean },
69
- void,
70
- 'session' | 'rpc'
71
- >
72
- }
73
-
74
- export const agentApprove = <Name extends keyof AgentMap>(
75
- agentName: Name
76
- ) => {
77
- return coreAgentApprove<AgentMap>(agentName as string & keyof AgentMap) as PikkuFunctionConfig<
78
- { runId: string; approvals: { toolCallId: string; approved: boolean }[] },
79
- unknown,
80
- 'session' | 'rpc'
81
- >
82
- }
@@ -1,177 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.19
3
- */
4
- /**
5
- * Channel-specific type definitions for tree-shaking optimization
6
- */
7
-
8
- import { CoreChannel, CorePikkuChannelMiddleware, CorePikkuChannelMiddlewareFactory, wireChannel as wireChannelCore, defineChannelRoutes as defineChannelRoutesCore, addChannelMiddleware as addChannelMiddlewareCore } from '@pikku/core/channel'
9
- import { AssertHTTPWiringParams } from '@pikku/core/http'
10
- import type { PikkuFunctionConfig, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware, Services } from '../function/pikku-function-types.gen.js'
11
- import type { CorePermissionGroup } from '@pikku/core'
12
- import type { StandardSchemaV1 } from '@standard-schema/spec'
13
-
14
- /**
15
- * Helper type to infer the output type from a Standard Schema
16
- */
17
- type InferSchemaOutput<T> = T extends StandardSchemaV1<any, infer Output> ? Output : never
18
-
19
- /**
20
- * Type definition for WebSocket channels with typed data exchange.
21
- * Supports connection, disconnection, and message handling.
22
- * Accepts both session-based (PikkuFunction) and sessionless (PikkuFunctionSessionless) functions.
23
- *
24
- * @template ChannelData - Type of data exchanged through the channel
25
- * @template Channel - String literal type for the channel name
26
- */
27
- type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<
28
- ChannelData,
29
- Channel,
30
- PikkuFunctionConfig<void, any, 'channel' | 'session' | 'rpc'>,
31
- PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>,
32
- PikkuFunctionConfig<any, any, 'channel' | 'session' | 'rpc'>,
33
- PikkuPermission,
34
- PikkuMiddleware
35
- >
36
-
37
- /**
38
- * Creates a function that handles WebSocket channel connections.
39
- * Called when a client connects to a channel.
40
- *
41
- * @template Out - Output type for connection response
42
- * @param func - Function definition, either direct function or configuration object
43
- * @returns The normalized configuration object
44
- */
45
- export const pikkuChannelConnectionFunc = <Out = unknown>(
46
- func:
47
- | PikkuFunctionSessionless<void, Out, 'channel' | 'session' | 'rpc'>
48
- | PikkuFunctionConfig<void, Out, 'channel' | 'session' | 'rpc'>
49
- ) => {
50
- return typeof func === 'function' ? { func } : func
51
- }
52
-
53
- /**
54
- * Creates a function that handles WebSocket channel disconnections.
55
- * Called when a client disconnects from a channel.
56
- *
57
- * @param func - Function definition, either direct function or configuration object
58
- * @returns The normalized configuration object
59
- */
60
- export const pikkuChannelDisconnectionFunc = (
61
- func:
62
- | PikkuFunctionSessionless<void, void, 'channel'>
63
- | PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>
64
- ) => {
65
- return typeof func === 'function' ? { func } : func
66
- }
67
-
68
- /**
69
- * Configuration object for channel functions with Zod schema validation.
70
- */
71
- type PikkuChannelFuncConfigWithSchema<
72
- InputSchema extends StandardSchemaV1,
73
- OutputSchema extends StandardSchemaV1 | undefined = undefined
74
- > = {
75
- name?: string
76
- tags?: string[]
77
- expose?: boolean
78
- remote?: boolean
79
- func: PikkuFunctionSessionless<
80
- InferSchemaOutput<InputSchema>,
81
- OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
82
- 'channel' | 'session' | 'rpc'
83
- >
84
- auth?: boolean
85
- permissions?: CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
86
- middleware?: PikkuMiddleware[]
87
- input: InputSchema
88
- output?: OutputSchema
89
- }
90
-
91
- /**
92
- * Creates a function that handles WebSocket channel messages.
93
- * Called when a message is received on a channel.
94
- *
95
- * Supports two patterns:
96
- * 1. Generic types: `pikkuChannelFunc<Input, Output>({ func: ... })`
97
- * 2. Zod schemas: `pikkuChannelFunc({ input: z.object(...), func: ... })`
98
- *
99
- * @template In - Input type for channel messages (inferred from schema if provided)
100
- * @template Out - Output type for channel responses (inferred from schema if provided)
101
- * @param func - Function definition, either direct function or configuration object
102
- * @returns The normalized configuration object
103
- *
104
- * @example
105
- * ```typescript
106
- * // Pattern 1: Using generic types
107
- * const handleMessage = pikkuChannelFunc<{text: string}, {received: boolean}>({
108
- * func: async (_services, { text }) => ({ received: true })
109
- * })
110
- *
111
- * // Pattern 2: Using Zod schemas
112
- * const messageInput = z.object({ text: z.string() })
113
- * const messageOutput = z.object({ received: z.boolean() })
114
- *
115
- * const handleMessage = pikkuChannelFunc({
116
- * input: messageInput,
117
- * output: messageOutput,
118
- * func: async (_services, { text }) => ({ received: true })
119
- * })
120
- * ```
121
- */
122
- export function pikkuChannelFunc<
123
- InputSchema extends StandardSchemaV1,
124
- OutputSchema extends StandardSchemaV1 | undefined = undefined
125
- >(
126
- config: PikkuChannelFuncConfigWithSchema<InputSchema, OutputSchema>
127
- ): PikkuFunctionConfig<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'channel' | 'session' | 'rpc'>
128
- export function pikkuChannelFunc<In, Out = unknown>(
129
- func:
130
- | PikkuFunctionSessionless<In, Out, 'channel' | 'session' | 'rpc'>
131
- | PikkuFunctionConfig<In, Out, 'channel' | 'session' | 'rpc'>
132
- ): PikkuFunctionConfig<In, Out, 'channel' | 'session' | 'rpc'>
133
- export function pikkuChannelFunc(func: any) {
134
- return typeof func === 'function' ? { func } : func
135
- }
136
-
137
- /**
138
- * Registers a WebSocket channel with the Pikku framework.
139
- *
140
- * @template ChannelData - Type of data associated with the channel
141
- * @template Channel - String literal type for the channel name
142
- * @param channel - Channel definition with connection, disconnection, and message handlers
143
- */
144
- export const wireChannel = <ChannelData, Channel extends string>(
145
- channel: ChannelWiring<ChannelData, Channel> & AssertHTTPWiringParams<ChannelData, Channel>
146
- ) => {
147
- wireChannelCore(channel as any)
148
- }
149
-
150
- /**
151
- * Type-safe helper for defining channel message routes that can be composed.
152
- * Returns the routes record as-is for use with wireChannel's onMessageWiring.
153
- *
154
- * @template T - Record of channel route handlers
155
- * @param routes - The channel routes record
156
- * @returns The same routes record (identity function for type safety)
157
- */
158
- export function defineChannelRoutes<T extends Record<string, any>>(routes: T): T {
159
- return defineChannelRoutesCore(routes)
160
- }
161
-
162
- export type PikkuChannelMiddleware<RequiredServices extends Services = Services, Event = unknown> = CorePikkuChannelMiddleware<RequiredServices, Event>
163
-
164
- export const pikkuChannelMiddleware = <RequiredServices extends Services = Services, Event = unknown>(
165
- middleware: PikkuChannelMiddleware<RequiredServices, Event>
166
- ): PikkuChannelMiddleware<RequiredServices, Event> => {
167
- return middleware
168
- }
169
-
170
- export const pikkuChannelMiddlewareFactory = <In = any>(
171
- factory: CorePikkuChannelMiddlewareFactory<In>
172
- ): CorePikkuChannelMiddlewareFactory<In> => {
173
- return factory
174
- }
175
-
176
- export const addChannelMiddleware = (tag: string, middleware: PikkuChannelMiddleware[]) =>
177
- addChannelMiddlewareCore(tag, middleware, '@pikku/addon-graph')