@pikku/core 0.12.3 → 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 (218) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/services/in-memory-workflow-service.d.ts +15 -2
  3. package/dist/services/in-memory-workflow-service.js +49 -0
  4. package/lcov.info +18891 -0
  5. package/package.json +1 -1
  6. package/src/crypto-utils.test.ts +0 -214
  7. package/src/crypto-utils.ts +0 -213
  8. package/src/errors/error-handler.ts +0 -62
  9. package/src/errors/error.test.ts +0 -195
  10. package/src/errors/errors.ts +0 -374
  11. package/src/errors/index.ts +0 -2
  12. package/src/factory-functions.test.ts +0 -109
  13. package/src/function/function-runner.test.ts +0 -536
  14. package/src/function/function-runner.ts +0 -365
  15. package/src/function/functions.types.ts +0 -304
  16. package/src/function/index.ts +0 -5
  17. package/src/handle-error.test.ts +0 -424
  18. package/src/handle-error.ts +0 -69
  19. package/src/index.ts +0 -118
  20. package/src/internal.ts +0 -6
  21. package/src/middleware/auth-apikey.test.ts +0 -363
  22. package/src/middleware/auth-apikey.ts +0 -47
  23. package/src/middleware/auth-bearer.test.ts +0 -450
  24. package/src/middleware/auth-bearer.ts +0 -72
  25. package/src/middleware/auth-cookie.test.ts +0 -528
  26. package/src/middleware/auth-cookie.ts +0 -80
  27. package/src/middleware/cors.test.ts +0 -424
  28. package/src/middleware/cors.ts +0 -104
  29. package/src/middleware/index.ts +0 -5
  30. package/src/middleware/remote-auth.test.ts +0 -488
  31. package/src/middleware/remote-auth.ts +0 -68
  32. package/src/middleware/timeout.ts +0 -15
  33. package/src/middleware-runner.test.ts +0 -418
  34. package/src/middleware-runner.ts +0 -234
  35. package/src/permissions.test.ts +0 -434
  36. package/src/permissions.ts +0 -319
  37. package/src/pikku-request.ts +0 -23
  38. package/src/pikku-response.ts +0 -5
  39. package/src/pikku-state.test.ts +0 -224
  40. package/src/pikku-state.ts +0 -216
  41. package/src/run-tests-script.test.ts +0 -49
  42. package/src/schema.test.ts +0 -249
  43. package/src/schema.ts +0 -151
  44. package/src/services/ai-agent-runner-service.ts +0 -41
  45. package/src/services/ai-run-state-service.ts +0 -20
  46. package/src/services/ai-storage-service.ts +0 -39
  47. package/src/services/content-service.ts +0 -76
  48. package/src/services/deployment-service.ts +0 -22
  49. package/src/services/gateway-service.ts +0 -20
  50. package/src/services/gopass-secrets.ts +0 -98
  51. package/src/services/in-memory-ai-run-state-service.ts +0 -73
  52. package/src/services/in-memory-trigger-service.ts +0 -64
  53. package/src/services/in-memory-workflow-service.test.ts +0 -351
  54. package/src/services/in-memory-workflow-service.ts +0 -438
  55. package/src/services/index.ts +0 -56
  56. package/src/services/jwt-service.ts +0 -30
  57. package/src/services/local-content.ts +0 -120
  58. package/src/services/local-gateway-service.ts +0 -62
  59. package/src/services/local-secrets.test.ts +0 -80
  60. package/src/services/local-secrets.ts +0 -94
  61. package/src/services/local-variables.test.ts +0 -61
  62. package/src/services/local-variables.ts +0 -39
  63. package/src/services/logger-console.test.ts +0 -118
  64. package/src/services/logger-console.ts +0 -98
  65. package/src/services/logger.ts +0 -57
  66. package/src/services/scheduler-service.ts +0 -86
  67. package/src/services/schema-service.ts +0 -33
  68. package/src/services/scoped-secret-service.test.ts +0 -74
  69. package/src/services/scoped-secret-service.ts +0 -41
  70. package/src/services/secret-service.ts +0 -38
  71. package/src/services/trigger-service.ts +0 -17
  72. package/src/services/typed-secret-service.test.ts +0 -93
  73. package/src/services/typed-secret-service.ts +0 -70
  74. package/src/services/typed-variables-service.test.ts +0 -73
  75. package/src/services/typed-variables-service.ts +0 -81
  76. package/src/services/user-session-service.test.ts +0 -113
  77. package/src/services/user-session-service.ts +0 -86
  78. package/src/services/variables-service.ts +0 -11
  79. package/src/services/workflow-service.ts +0 -95
  80. package/src/testing/index.ts +0 -2
  81. package/src/testing/service-tests.ts +0 -873
  82. package/src/time-utils.test.ts +0 -56
  83. package/src/time-utils.ts +0 -107
  84. package/src/types/core.types.ts +0 -478
  85. package/src/types/state.types.ts +0 -188
  86. package/src/utils/hash.test.ts +0 -68
  87. package/src/utils/hash.ts +0 -26
  88. package/src/utils.test.ts +0 -350
  89. package/src/utils.ts +0 -129
  90. package/src/version.test.ts +0 -80
  91. package/src/version.ts +0 -25
  92. package/src/wirings/ai-agent/agent-dynamic-workflow.ts +0 -469
  93. package/src/wirings/ai-agent/ai-agent-helpers.test.ts +0 -152
  94. package/src/wirings/ai-agent/ai-agent-helpers.ts +0 -76
  95. package/src/wirings/ai-agent/ai-agent-memory.ts +0 -310
  96. package/src/wirings/ai-agent/ai-agent-model-config.test.ts +0 -115
  97. package/src/wirings/ai-agent/ai-agent-model-config.ts +0 -43
  98. package/src/wirings/ai-agent/ai-agent-prepare.ts +0 -636
  99. package/src/wirings/ai-agent/ai-agent-registry.test.ts +0 -37
  100. package/src/wirings/ai-agent/ai-agent-registry.ts +0 -82
  101. package/src/wirings/ai-agent/ai-agent-runner.test.ts +0 -319
  102. package/src/wirings/ai-agent/ai-agent-runner.ts +0 -773
  103. package/src/wirings/ai-agent/ai-agent-stream.test.ts +0 -859
  104. package/src/wirings/ai-agent/ai-agent-stream.ts +0 -1153
  105. package/src/wirings/ai-agent/ai-agent.types.ts +0 -382
  106. package/src/wirings/ai-agent/index.ts +0 -37
  107. package/src/wirings/channel/channel-common.ts +0 -90
  108. package/src/wirings/channel/channel-handler.ts +0 -250
  109. package/src/wirings/channel/channel-middleware-runner.ts +0 -120
  110. package/src/wirings/channel/channel-runner.ts +0 -166
  111. package/src/wirings/channel/channel-store.ts +0 -29
  112. package/src/wirings/channel/channel.types.ts +0 -172
  113. package/src/wirings/channel/define-channel-routes.ts +0 -25
  114. package/src/wirings/channel/eventhub-service.ts +0 -34
  115. package/src/wirings/channel/eventhub-store.ts +0 -13
  116. package/src/wirings/channel/index.ts +0 -24
  117. package/src/wirings/channel/local/index.ts +0 -3
  118. package/src/wirings/channel/local/local-channel-handler.ts +0 -81
  119. package/src/wirings/channel/local/local-channel-runner.test.ts +0 -215
  120. package/src/wirings/channel/local/local-channel-runner.ts +0 -210
  121. package/src/wirings/channel/local/local-eventhub-service.test.ts +0 -95
  122. package/src/wirings/channel/local/local-eventhub-service.ts +0 -101
  123. package/src/wirings/channel/log-channels.ts +0 -20
  124. package/src/wirings/channel/pikku-abstract-channel-handler.test.ts +0 -54
  125. package/src/wirings/channel/pikku-abstract-channel-handler.ts +0 -45
  126. package/src/wirings/channel/serverless/index.ts +0 -5
  127. package/src/wirings/channel/serverless/serverless-channel-runner.ts +0 -289
  128. package/src/wirings/cli/channel/cli-channel-runner.ts +0 -136
  129. package/src/wirings/cli/channel/index.ts +0 -1
  130. package/src/wirings/cli/cli-runner.test.ts +0 -403
  131. package/src/wirings/cli/cli-runner.ts +0 -529
  132. package/src/wirings/cli/cli.types.ts +0 -358
  133. package/src/wirings/cli/command-parser.test.ts +0 -445
  134. package/src/wirings/cli/command-parser.ts +0 -504
  135. package/src/wirings/cli/define-cli-commands.ts +0 -24
  136. package/src/wirings/cli/index.ts +0 -19
  137. package/src/wirings/gateway/gateway-runner.test.ts +0 -474
  138. package/src/wirings/gateway/gateway-runner.ts +0 -411
  139. package/src/wirings/gateway/gateway.types.ts +0 -149
  140. package/src/wirings/gateway/index.ts +0 -13
  141. package/src/wirings/http/http-routes.test.ts +0 -322
  142. package/src/wirings/http/http-routes.ts +0 -197
  143. package/src/wirings/http/http-runner.test.ts +0 -144
  144. package/src/wirings/http/http-runner.ts +0 -588
  145. package/src/wirings/http/http.types.ts +0 -369
  146. package/src/wirings/http/index.ts +0 -28
  147. package/src/wirings/http/log-http-routes.ts +0 -22
  148. package/src/wirings/http/pikku-fetch-http-request.test.ts +0 -237
  149. package/src/wirings/http/pikku-fetch-http-request.ts +0 -170
  150. package/src/wirings/http/pikku-fetch-http-response.test.ts +0 -82
  151. package/src/wirings/http/pikku-fetch-http-response.ts +0 -147
  152. package/src/wirings/http/routers/http-router.ts +0 -13
  153. package/src/wirings/http/routers/path-to-regex.test.ts +0 -319
  154. package/src/wirings/http/routers/path-to-regex.ts +0 -126
  155. package/src/wirings/http/web-request.test.ts +0 -236
  156. package/src/wirings/http/web-request.ts +0 -104
  157. package/src/wirings/mcp/index.ts +0 -27
  158. package/src/wirings/mcp/mcp-endpoint-registry.test.ts +0 -389
  159. package/src/wirings/mcp/mcp-endpoint-registry.ts +0 -159
  160. package/src/wirings/mcp/mcp-runner.ts +0 -323
  161. package/src/wirings/mcp/mcp.types.ts +0 -216
  162. package/src/wirings/node/index.ts +0 -2
  163. package/src/wirings/node/node.types.ts +0 -23
  164. package/src/wirings/oauth2/index.ts +0 -3
  165. package/src/wirings/oauth2/oauth2-client.test.ts +0 -929
  166. package/src/wirings/oauth2/oauth2-client.ts +0 -335
  167. package/src/wirings/oauth2/oauth2.types.ts +0 -69
  168. package/src/wirings/oauth2/wire-oauth2-credential.ts +0 -23
  169. package/src/wirings/queue/index.ts +0 -31
  170. package/src/wirings/queue/queue-runner.test.ts +0 -710
  171. package/src/wirings/queue/queue-runner.ts +0 -192
  172. package/src/wirings/queue/queue.types.ts +0 -189
  173. package/src/wirings/queue/register-queue-helper.ts +0 -60
  174. package/src/wirings/queue/validate-worker-config.test.ts +0 -108
  175. package/src/wirings/queue/validate-worker-config.ts +0 -116
  176. package/src/wirings/rpc/index.ts +0 -4
  177. package/src/wirings/rpc/rpc-runner.ts +0 -460
  178. package/src/wirings/rpc/rpc-types.ts +0 -56
  179. package/src/wirings/rpc/wire-addon.ts +0 -21
  180. package/src/wirings/scheduler/index.ts +0 -11
  181. package/src/wirings/scheduler/log-schedulers.ts +0 -20
  182. package/src/wirings/scheduler/scheduler-runner.test.ts +0 -660
  183. package/src/wirings/scheduler/scheduler-runner.ts +0 -133
  184. package/src/wirings/scheduler/scheduler.types.ts +0 -53
  185. package/src/wirings/secret/index.ts +0 -9
  186. package/src/wirings/secret/secret.types.ts +0 -32
  187. package/src/wirings/secret/validate-secret-definitions.test.ts +0 -140
  188. package/src/wirings/secret/validate-secret-definitions.ts +0 -82
  189. package/src/wirings/trigger/index.ts +0 -10
  190. package/src/wirings/trigger/pikku-trigger-service.ts +0 -112
  191. package/src/wirings/trigger/trigger-runner.test.ts +0 -79
  192. package/src/wirings/trigger/trigger-runner.ts +0 -135
  193. package/src/wirings/trigger/trigger.types.ts +0 -178
  194. package/src/wirings/variable/index.ts +0 -8
  195. package/src/wirings/variable/validate-variable-definitions.test.ts +0 -91
  196. package/src/wirings/variable/validate-variable-definitions.ts +0 -69
  197. package/src/wirings/variable/variable.types.ts +0 -22
  198. package/src/wirings/workflow/dsl/index.ts +0 -31
  199. package/src/wirings/workflow/dsl/workflow-dsl.types.ts +0 -320
  200. package/src/wirings/workflow/dsl/workflow-runner.ts +0 -28
  201. package/src/wirings/workflow/graph/graph-node.ts +0 -222
  202. package/src/wirings/workflow/graph/graph-runner.test.ts +0 -487
  203. package/src/wirings/workflow/graph/graph-runner.ts +0 -816
  204. package/src/wirings/workflow/graph/graph-validation.test.ts +0 -170
  205. package/src/wirings/workflow/graph/graph-validation.ts +0 -237
  206. package/src/wirings/workflow/graph/index.ts +0 -19
  207. package/src/wirings/workflow/graph/template.test.ts +0 -49
  208. package/src/wirings/workflow/graph/template.ts +0 -42
  209. package/src/wirings/workflow/graph/wire-workflow-graph.ts +0 -29
  210. package/src/wirings/workflow/graph/workflow-graph.types.ts +0 -104
  211. package/src/wirings/workflow/index.ts +0 -82
  212. package/src/wirings/workflow/pikku-workflow-service.test.ts +0 -200
  213. package/src/wirings/workflow/pikku-workflow-service.ts +0 -1176
  214. package/src/wirings/workflow/workflow-helpers.test.ts +0 -129
  215. package/src/wirings/workflow/workflow-helpers.ts +0 -79
  216. package/src/wirings/workflow/workflow.types.ts +0 -274
  217. package/tsconfig.json +0 -14
  218. package/tsconfig.tsbuildinfo +0 -1
@@ -1,358 +0,0 @@
1
- import type {
2
- CorePikkuMiddleware,
3
- CoreSingletonServices,
4
- CoreUserSession,
5
- CoreServices,
6
- MiddlewareMetadata,
7
- PermissionMetadata,
8
- } from '../../types/core.types.js'
9
- import type {
10
- CorePikkuFunctionConfig,
11
- CorePikkuPermission,
12
- CorePikkuFunction,
13
- CorePikkuFunctionSessionless,
14
- } from '../../function/functions.types.js'
15
- import type { PikkuChannel } from '../channel/channel.types.js'
16
-
17
- /**
18
- * CLI option definition
19
- */
20
- export interface CLIOption<T = any> {
21
- description: string
22
- short?: string
23
- default?: T
24
- choices?: T[]
25
- array?: boolean
26
- required?: boolean
27
- }
28
-
29
- /**
30
- * CLI options collection
31
- */
32
- export type CLIOptions<T> = {
33
- [K in keyof T]: CLIOption<T[K]>
34
- }
35
-
36
- /**
37
- * Positional argument definition
38
- */
39
- export interface CLIPositional {
40
- name: string
41
- required: boolean
42
- variadic?: boolean
43
- }
44
-
45
- /**
46
- * CLI wire context
47
- */
48
- export type PikkuCLI = {
49
- program: string
50
- command: string[]
51
- data: Record<string, any> // All positionals and options merged
52
- channel: PikkuChannel<unknown, unknown>
53
- }
54
-
55
- /**
56
- * Runtime CLI program state
57
- */
58
- export interface CLIProgramState {
59
- defaultRenderer?: CorePikkuCLIRender<any>
60
- middleware: CorePikkuMiddleware[]
61
- renderers: Record<string, CorePikkuCLIRender<any>>
62
- commandOptions?: Record<string, Record<string, CLIOption>>
63
- commandMiddleware?: Record<string, CorePikkuMiddleware[]>
64
- tags?: string[]
65
- }
66
-
67
- /**
68
- * CLI command metadata for runtime
69
- */
70
- export interface CLICommandMeta {
71
- parameters?: string
72
- pikkuFuncId: string
73
- packageName?: string
74
- positionals: CLIPositional[]
75
- options: Record<string, CLIOption>
76
- renderName?: string
77
- summary?: string
78
- description?: string
79
- errors?: string[]
80
- tags?: string[]
81
- subcommands?: Record<string, CLICommandMeta>
82
- middleware?: MiddlewareMetadata[] // Pre-resolved middleware chain (tag + explicit)
83
- permissions?: PermissionMetadata[] // Pre-resolved permission chain (tag + explicit)
84
- isDefault?: boolean
85
- }
86
-
87
- /**
88
- * CLI metadata collection (per program)
89
- */
90
- export type CLIProgramMeta = {
91
- program: string
92
- commands: Record<string, CLICommandMeta>
93
- options: Record<string, CLIOption>
94
- defaultRenderName?: string
95
- }
96
-
97
- /**
98
- * Renderer metadata for CLI commands
99
- */
100
- export interface RendererMeta {
101
- name: string
102
- exportedName?: string
103
- services: {
104
- optimized: boolean
105
- services: string[]
106
- }
107
- filePath: string
108
- }
109
-
110
- export type RenderersMeta = Record<string, RendererMeta>
111
-
112
- /**
113
- * All CLI programs metadata
114
- */
115
- export interface CLIMeta {
116
- programs: Record<string, CLIProgramMeta>
117
- renderers: RenderersMeta
118
- }
119
-
120
- /**
121
- * CLI-specific renderer that outputs to console
122
- */
123
- export type CorePikkuCLIRender<
124
- Data,
125
- Services extends CoreSingletonServices = CoreServices,
126
- Session extends CoreUserSession = CoreUserSession,
127
- > = CorePikkuRender<Data, void, Services, Session>
128
-
129
- /**
130
- * Extract input parameters from a Pikku function config type
131
- */
132
- export type ExtractFunctionInput<Func> =
133
- Func extends CorePikkuFunctionConfig<infer FuncType, any, any>
134
- ? FuncType extends
135
- | CorePikkuFunction<infer Input, any, any, any, any>
136
- | CorePikkuFunctionSessionless<infer Input, any, any, any, any>
137
- ? Input
138
- : never
139
- : never
140
-
141
- /**
142
- * Strip < > [ ] characters from a string
143
- */
144
- type StripBrackets<S extends string> = S extends `<${infer Inner}>`
145
- ? Inner
146
- : S extends `[${infer Inner}]`
147
- ? Inner
148
- : S
149
-
150
- /**
151
- * Split string by spaces
152
- */
153
- type SplitBySpace<S extends string> = S extends `${infer First} ${infer Rest}`
154
- ? [First, ...SplitBySpace<Rest>]
155
- : S extends ''
156
- ? []
157
- : [S]
158
-
159
- /**
160
- * Recursively build a tuple by stripping brackets from each element
161
- */
162
- type BuildParamsTuple<Parts extends readonly string[]> =
163
- Parts extends readonly [
164
- infer First extends string,
165
- ...infer Rest extends string[],
166
- ]
167
- ? [StripBrackets<First>, ...BuildParamsTuple<Rest>]
168
- : []
169
-
170
- /**
171
- * Extract parameter names from CLI parameter string into a tuple
172
- * Example: "<env> [region]" => ["env", "region"]
173
- */
174
- type ExtractParameterNames<S extends string> = BuildParamsTuple<SplitBySpace<S>>
175
-
176
- /**
177
- * Check if all elements of a tuple are valid keys of Input
178
- */
179
- type AllParamsValid<
180
- Params extends readonly any[],
181
- Input,
182
- > = Params extends readonly [infer First, ...infer Rest]
183
- ? First extends keyof Input
184
- ? AllParamsValid<Rest, Input>
185
- : false
186
- : true
187
-
188
- /**
189
- * Validate that all parameter names are valid keys of the function input
190
- */
191
- export type ValidateParameters<Params extends string, Input> =
192
- AllParamsValid<ExtractParameterNames<Params>, Input> extends true
193
- ? Params
194
- : never
195
-
196
- /**
197
- * Extract output type from a Pikku function config type
198
- */
199
- export type ExtractFunctionOutput<Func> =
200
- Func extends CorePikkuFunctionConfig<infer FuncType, any, any>
201
- ? FuncType extends
202
- | CorePikkuFunction<any, infer Output, any, any, any>
203
- | CorePikkuFunctionSessionless<any, infer Output, any, any, any>
204
- ? Output
205
- : never
206
- : never
207
-
208
- /**
209
- * CLI command configuration that infers options from function input type.
210
- * This is a helper type for creating type-safe CLI commands.
211
- */
212
- export type CoreCLICommandConfig<
213
- FuncConfig,
214
- PikkuMiddleware extends CorePikkuMiddleware<any, any> = CorePikkuMiddleware<
215
- any,
216
- any
217
- >,
218
- PikkuCLIRender extends CorePikkuCLIRender<any, any, any> = CorePikkuCLIRender<
219
- any,
220
- any
221
- >,
222
- Params extends string = string,
223
- > = {
224
- parameters?: ValidateParameters<Params, ExtractFunctionInput<FuncConfig>>
225
- func?: FuncConfig
226
- title?: string
227
- description?: string
228
- render?: PikkuCLIRender
229
- options?: {
230
- [K in keyof ExtractFunctionInput<FuncConfig>]?: {
231
- description?: string
232
- short?: string
233
- default?: ExtractFunctionInput<FuncConfig>[K]
234
- }
235
- }
236
- middleware?: PikkuMiddleware[]
237
- subcommands?: Record<
238
- string,
239
- CoreCLICommandConfig<any, PikkuMiddleware, PikkuCLIRender, any>
240
- >
241
- auth?: boolean
242
- permissions?: any[]
243
- isDefault?: boolean
244
- }
245
-
246
- /**
247
- * CLI command definition
248
- */
249
- export interface CoreCLICommand<
250
- In,
251
- Out,
252
- PikkuFunctionConfig extends CorePikkuFunctionConfig<
253
- | CorePikkuFunction<In, Out, any, any, any>
254
- | CorePikkuFunctionSessionless<In, Out, any, any, any>
255
- >,
256
- PikkuPermission extends CorePikkuPermission<any, any, any>,
257
- PikkuMiddleware extends CorePikkuMiddleware,
258
- Options = any,
259
- Subcommands extends Record<
260
- string,
261
- CoreCLICommandConfig<any, any, any>
262
- > = Record<string, CoreCLICommandConfig<any, any, any>>,
263
- > {
264
- parameters?: string
265
- func: PikkuFunctionConfig
266
- render?: CorePikkuCLIRender<Out>
267
- description?: string
268
- options?: CLIOptions<Options>
269
- middleware?: PikkuMiddleware[]
270
- permissions?: Record<string, PikkuPermission | PikkuPermission[]>
271
- auth?: boolean
272
- summary?: string
273
- errors?: string[]
274
- tags?: string[]
275
- subcommands?: Subcommands
276
- isDefault?: boolean
277
- }
278
-
279
- /**
280
- * Shorthand command definition (just a function)
281
- */
282
- export type CLICommandShorthand<
283
- In,
284
- Out,
285
- PikkuFunctionConfig extends CorePikkuFunctionConfig<
286
- | CorePikkuFunction<In, Out, any, any, any>
287
- | CorePikkuFunctionSessionless<In, Out, any, any, any>
288
- >,
289
- > = PikkuFunctionConfig
290
-
291
- /**
292
- * Command definition (either full or shorthand)
293
- */
294
- export type CLICommandDefinition<
295
- In,
296
- Out,
297
- PikkuFunctionConfig extends CorePikkuFunctionConfig<
298
- | CorePikkuFunction<In, Out, any, any, any>
299
- | CorePikkuFunctionSessionless<In, Out, any, any, any>
300
- >,
301
- PikkuPermission extends CorePikkuPermission<any, any, any>,
302
- PikkuMiddleware extends CorePikkuMiddleware,
303
- Options = any,
304
- Subcommands extends Record<
305
- string,
306
- CoreCLICommandConfig<any, any, any>
307
- > = Record<string, CoreCLICommandConfig<any, any, any>>,
308
- > =
309
- | CoreCLICommand<
310
- In,
311
- Out,
312
- PikkuFunctionConfig,
313
- PikkuPermission,
314
- PikkuMiddleware,
315
- Options,
316
- Subcommands
317
- >
318
- | CLICommandShorthand<In, Out, PikkuFunctionConfig>
319
-
320
- /**
321
- * CLI wiring configuration
322
- */
323
- export interface CoreCLI<
324
- Commands extends Record<string, CoreCLICommandConfig<any, any, any>>,
325
- Options,
326
- PikkuMiddleware,
327
- PikkuCLIRender,
328
- > {
329
- program: string
330
- description?: string
331
- commands: Commands
332
- options?: CLIOptions<Options>
333
- middleware?: PikkuMiddleware[]
334
- render?: PikkuCLIRender
335
- summary?: string
336
- errors?: string[]
337
- tags?: string[]
338
- }
339
-
340
- /**
341
- * Generic renderer type that can transform data into any output format.
342
- * Can be used across different wirings for flexible output handling.
343
- *
344
- * @template Data - The input data type to be rendered
345
- * @template Output - The output type after rendering
346
- * @template Services - The services available to the renderer
347
- * @template Session - The user session type
348
- */
349
- export type CorePikkuRender<
350
- Data,
351
- Output,
352
- Services extends CoreSingletonServices = CoreServices,
353
- Session extends CoreUserSession = CoreUserSession,
354
- > = (
355
- services: Services,
356
- data: Data,
357
- session?: Session
358
- ) => Output | Promise<Output>