@pikku/addon-meta-conversions 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) 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 +82 -0
  5. package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  6. package/.pikku/console/pikku-addon-meta.gen.json +33 -0
  7. package/.pikku/console/pikku-node-types.gen.ts +8 -0
  8. package/.pikku/function/pikku-function-types.gen.ts +754 -0
  9. package/.pikku/function/pikku-functions-meta-verbose.gen.json +31 -0
  10. package/.pikku/function/pikku-functions-meta.gen.json +21 -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 +147 -0
  14. package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  15. package/.pikku/pikku-bootstrap.gen.ts +8 -0
  16. package/.pikku/pikku-meta-service.gen.ts +10 -0
  17. package/.pikku/pikku-services.gen.ts +45 -0
  18. package/.pikku/pikku-types.gen.ts +21 -0
  19. package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  20. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +134 -0
  21. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +135 -0
  22. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
  23. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  24. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  25. package/.pikku/schemas/register.gen.ts +15 -0
  26. package/.pikku/schemas/schemas/EventSendInput.schema.json +1 -0
  27. package/.pikku/schemas/schemas/EventSendOutput.schema.json +1 -0
  28. package/.pikku/schemas/schemas/SecretSchema_metaConversions.schema.json +1 -0
  29. package/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
  30. package/.pikku/secrets/pikku-secrets-meta.gen.json +10 -0
  31. package/.pikku/secrets/pikku-secrets.gen.ts +23 -0
  32. package/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
  33. package/.pikku/variables/pikku-variable-types.gen.ts +5 -0
  34. package/.pikku/variables/pikku-variables-meta.gen.json +1 -0
  35. package/.pikku/variables/pikku-variables.gen.ts +21 -0
  36. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +38 -0
  37. package/.pikku/workflow/pikku-workflow-types.gen.ts +167 -0
  38. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
  39. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
  40. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +4 -4
  41. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
  42. package/dist/.pikku/addon/pikku-addon-types.gen.js +7 -3
  43. package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
  44. package/dist/.pikku/addon/pikku-addon-types.gen.ts +11 -6
  45. package/dist/.pikku/addon/pikku-package.gen.js +2 -1
  46. package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
  47. package/dist/.pikku/addon/pikku-package.gen.ts +3 -1
  48. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
  49. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -6
  50. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
  51. package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
  52. package/dist/.pikku/agent/pikku-agent-types.gen.ts +13 -7
  53. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
  54. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
  55. package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
  56. package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
  57. package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  58. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  59. package/dist/.pikku/console/pikku-node-types.gen.ts +1 -1
  60. package/dist/.pikku/function/pikku-function-types.gen.d.ts +71 -87
  61. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
  62. package/dist/.pikku/function/pikku-function-types.gen.js +80 -60
  63. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
  64. package/dist/.pikku/function/pikku-function-types.gen.ts +170 -102
  65. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +3 -0
  66. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  67. package/dist/.pikku/function/pikku-functions-meta.gen.json +1 -0
  68. package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
  69. package/dist/.pikku/function/pikku-functions.gen.js +2 -2
  70. package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
  71. package/dist/.pikku/function/pikku-functions.gen.ts +2 -2
  72. package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
  73. package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
  74. package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
  75. package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
  76. package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
  77. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
  78. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
  79. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
  80. package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
  81. package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  82. package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -2
  83. package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -1
  84. package/dist/.pikku/pikku-bootstrap.gen.js +2 -10
  85. package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -1
  86. package/dist/.pikku/pikku-bootstrap.gen.ts +2 -9
  87. package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
  88. package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
  89. package/dist/.pikku/pikku-meta-service.gen.js +10 -0
  90. package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
  91. package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
  92. package/dist/.pikku/pikku-services.gen.d.ts +10 -2
  93. package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
  94. package/dist/.pikku/pikku-services.gen.js +9 -0
  95. package/dist/.pikku/pikku-services.gen.js.map +1 -1
  96. package/dist/.pikku/pikku-services.gen.ts +12 -2
  97. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  98. package/dist/.pikku/pikku-types.gen.js +1 -1
  99. package/dist/.pikku/pikku-types.gen.ts +1 -1
  100. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
  101. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
  102. package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
  103. package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
  104. package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  105. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +27 -8
  106. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +27 -8
  107. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
  108. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
  109. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
  110. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
  111. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
  112. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  113. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
  114. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
  115. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
  116. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
  117. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  118. package/dist/.pikku/schemas/register.gen.js +1 -1
  119. package/dist/.pikku/schemas/register.gen.ts +1 -1
  120. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  121. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  122. package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
  123. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  124. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  125. package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
  126. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  127. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  128. package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
  129. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  130. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  131. package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
  132. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  133. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  134. package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
  135. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
  136. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +36 -27
  137. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
  138. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +5 -18
  139. package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
  140. package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +66 -57
  141. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  142. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
  143. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  144. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  145. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
  146. package/dist/src/services.d.ts.map +1 -1
  147. package/dist/src/services.js +1 -1
  148. package/dist/src/services.js.map +1 -1
  149. package/package.json +7 -6
  150. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +0 -2
  151. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +0 -1
  152. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +0 -7
  153. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +0 -1
  154. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
  155. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
  156. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +0 -5
  157. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +0 -1
  158. package/dist/.pikku/agent/pikku-agent-wirings.gen.js +0 -5
  159. package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +0 -1
  160. package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
@@ -1,14 +1,20 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.6
2
+ * This file was generated by @pikku/cli@0.12.55
3
3
  */
4
4
  /**
5
5
  * Core function, middleware, and permission types for all wirings
6
6
  */
7
7
 
8
- import { CorePikkuFunctionConfig, CorePikkuAuth, CorePikkuAuthConfig, CorePikkuPermission, CorePikkuMiddleware, CorePermissionGroup, addMiddleware as addMiddlewareCore, addPermission as addPermissionCore, PikkuWire, PickRequired } from '@pikku/core'
8
+ import type { CorePikkuMiddleware, CorePermissionGroup, ListInput, ListOutput, PikkuWire, PickRequired } from '@pikku/core'
9
+ import type { CorePikkuFunctionConfig, CorePikkuAuth, CorePikkuAuthConfig, CorePikkuPermission } from '@pikku/core/function'
10
+ import { pikkuAuth as pikkuAuthCore } from '@pikku/core/function'
11
+ import {
12
+ addTagMiddleware as addTagMiddlewareCore,
13
+ addGlobalMiddleware as addGlobalMiddlewareCore,
14
+ addTagPermission as addTagPermissionCore,
15
+ addGlobalPermission as addGlobalPermissionCore,
16
+ } from '@pikku/core/middleware'
9
17
  import { pikkuState as __pikkuState, CreateWireServices } from '@pikku/core/internal'
10
- import { pikkuAuth as pikkuAuthCore } from '@pikku/core'
11
- import { PikkuError } from '@pikku/core/errors'
12
18
  import type { NodeType } from '@pikku/core/node'
13
19
  import type { StandardSchemaV1 } from '@standard-schema/spec'
14
20
  import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function'
@@ -323,34 +329,36 @@ export type PikkuFunctionConfig<
323
329
  * Use this when you want to define input/output schemas using Zod.
324
330
  * Types are automatically inferred from the schemas.
325
331
  */
332
+ type SchemaInferred<S, Fallback = unknown> = S extends StandardSchemaV1
333
+ ? InferSchemaOutput<S>
334
+ : Fallback
335
+
336
+ /**
337
+ * Schema-overload variant for pikkuFunc. Derived from CorePikkuFunctionConfig
338
+ * so adding a field on the core type automatically propagates here.
339
+ */
326
340
  export type PikkuFunctionConfigWithSchema<
327
341
  InputSchema extends StandardSchemaV1 | undefined = undefined,
328
342
  OutputSchema extends StandardSchemaV1 | undefined = undefined,
329
343
  RequiredWires extends keyof PikkuWire = never
330
- > = {
331
- name?: string
332
- tags?: string[]
333
- expose?: boolean
334
- mcp?: boolean
335
- internal?: boolean
336
- approvalRequired?: boolean
337
- approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
338
- func: PikkuFunction<
339
- InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
340
- OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
341
- RequiredWires
342
- > | PikkuFunctionSessionless<
343
- InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
344
- OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
345
- RequiredWires
346
- >
347
- auth?: boolean
348
- permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
349
- middleware?: PikkuMiddleware[]
344
+ > = Omit<
345
+ CorePikkuFunctionConfig<
346
+ | PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
347
+ | PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
348
+ >,
349
+ 'func' | 'input' | 'output' | 'permissions' | 'approvalDescription'
350
+ > & {
351
+ func:
352
+ | PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
353
+ | PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
350
354
  input?: InputSchema
351
355
  output?: OutputSchema
352
- node?: NodeConfig
353
- errors?: Array<typeof PikkuError>
356
+ permissions?: InputSchema extends StandardSchemaV1
357
+ ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
358
+ : undefined
359
+ approvalDescription?: InputSchema extends StandardSchemaV1
360
+ ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>>
361
+ : never
354
362
  }
355
363
 
356
364
  /**
@@ -406,35 +414,62 @@ export function pikkuFunc(func: any) {
406
414
  return typeof func === 'function' ? { func } : func
407
415
  }
408
416
 
417
+ export type PikkuListFunction<
418
+ F extends Record<string, unknown> = {},
419
+ Row = unknown,
420
+ S extends string = never
421
+ > =
422
+ | PikkuFunction<ListInput<F, S>, ListOutput<Row>, 'session' | 'rpc'>
423
+ | PikkuFunctionSessionless<
424
+ ListInput<F, S>,
425
+ ListOutput<Row>,
426
+ 'session' | 'rpc'
427
+ >
428
+
429
+ export const pikkuListFunc = <
430
+ F extends Record<string, unknown> = {},
431
+ Row = unknown,
432
+ S extends string = never
433
+ >(
434
+ config: PikkuFunctionConfig<
435
+ ListInput<F, S>,
436
+ ListOutput<Row>,
437
+ 'session' | 'rpc'
438
+ >
439
+ ): PikkuFunctionConfig<ListInput<F, S>, ListOutput<Row>, 'session' | 'rpc'> => {
440
+ return pikkuFunc(config)
441
+ }
442
+
409
443
  /**
410
444
  * Configuration object for sessionless Pikku functions with Zod schema validation.
411
445
  */
446
+ /**
447
+ * Schema-overload variant for pikkuSessionlessFunc. Derived from
448
+ * CorePikkuFunctionConfig to stay in sync with the generic-typed config.
449
+ */
412
450
  export type PikkuFunctionSessionlessConfigWithSchema<
413
451
  InputSchema extends StandardSchemaV1 | undefined = undefined,
414
452
  OutputSchema extends StandardSchemaV1 | undefined = undefined,
415
453
  RequiredWires extends keyof PikkuWire = never
416
- > = {
417
- name?: string
418
- description?: string
419
- tags?: string[]
420
- expose?: boolean
421
- mcp?: boolean
422
- internal?: boolean
423
- remote?: boolean
424
- approvalRequired?: boolean
425
- approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
454
+ > = Omit<
455
+ CorePikkuFunctionConfig<
456
+ PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
457
+ >,
458
+ 'func' | 'input' | 'output' | 'permissions' | 'approvalDescription'
459
+ > & {
426
460
  func: PikkuFunctionSessionless<
427
- InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
428
- OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
461
+ SchemaInferred<InputSchema>,
462
+ SchemaInferred<OutputSchema>,
429
463
  RequiredWires
430
464
  >
431
- auth?: boolean
432
- permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
433
- middleware?: PikkuMiddleware[]
434
465
  input?: InputSchema
435
466
  output?: OutputSchema
436
- node?: NodeConfig
437
- errors?: Array<typeof PikkuError>
467
+ permissions?: InputSchema extends StandardSchemaV1
468
+ ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
469
+ : undefined
470
+ approvalDescription?: InputSchema extends StandardSchemaV1
471
+ ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>>
472
+ : never
438
473
  }
439
474
 
440
475
  /**
@@ -512,27 +547,23 @@ export const pikkuVoidFunc = (
512
547
  }
513
548
 
514
549
  /**
515
- * Creates a wrapper function for addon package functions that are exposed via RPC.
516
- * This allows you to wire addon functions to any wiring type (HTTP, queue, etc.)
517
- * without type compatibility issues.
550
+ * References a registered function by name for use in any wiring.
551
+ * Works for both local and addon functions — resolves via RPC at runtime.
518
552
  *
519
- * @template Name - The RPC method name (must be a key in FlattenedRPCMap)
520
- * @param rpcName - The name of the RPC method to invoke
521
- * @returns A Pikku function that proxies calls to the addon RPC method
553
+ * @template Name - The function name (must be a key in FlattenedRPCMap)
554
+ * @param rpcName - The name of the function to reference
555
+ * @returns A Pikku function config that proxies calls via RPC
522
556
  *
523
557
  * @example
524
558
  * ```typescript
525
- * // Wire an addon function via HTTP
526
- * wireHTTP({
527
- * auth: false,
528
- * method: 'get',
529
- * route: '/addon/hello',
530
- * func: addon('ext:hello'),
531
- * tags: ['addon'],
532
- * })
559
+ * // Use in agent tools
560
+ * tools: [ref('todos:listTodos'), ref('myLocalFunc')]
561
+ *
562
+ * // Use in HTTP wiring
563
+ * wireHTTP({ route: '/greet', method: 'post', func: ref('greet') })
533
564
  * ```
534
565
  */
535
- export const addon = <Name extends keyof FlattenedRPCMap>(
566
+ export const ref = <Name extends keyof FlattenedRPCMap>(
536
567
  rpcName: Name
537
568
  ): PikkuFunctionConfig<
538
569
  FlattenedRPCMap[Name]['input'],
@@ -591,12 +622,27 @@ export const pikkuConfig = (
591
622
  * ```
592
623
  */
593
624
  export const pikkuServices = (
594
- func: (config: Config, existingServices: Partial<SingletonServices>) => Promise<RequiredSingletonServices>
625
+ func: (config: Config, existingServices: Partial<SingletonServices>) => Promise<Partial<Omit<RequiredSingletonServices, 'auth'>>>
595
626
  ) => {
596
627
  return async (config: Config, existingServices: Partial<SingletonServices> = {}) => {
597
- const services = await func(config, existingServices)
598
- __pikkuState(null, 'package', 'singletonServices', services as any)
599
- return services
628
+ const createdServices = await func(config, existingServices)
629
+ const services = { ...existingServices, ...createdServices }
630
+ const authFactory = __pikkuState(null, 'package', 'authFactory')
631
+ if (authFactory) {
632
+ let authInstance: Promise<unknown> | undefined
633
+ ;(services as any).auth = () => {
634
+ authInstance ??= Promise.resolve()
635
+ .then(() => authFactory(services as any))
636
+ .catch((error) => {
637
+ authInstance = undefined
638
+ throw error
639
+ })
640
+ return authInstance
641
+ }
642
+ }
643
+ const resolved = services as RequiredSingletonServices
644
+ __pikkuState(null, 'package', 'singletonServices', resolved as any)
645
+ return resolved
600
646
  }
601
647
  }
602
648
 
@@ -629,58 +675,80 @@ export const pikkuWireServices = (
629
675
  }
630
676
 
631
677
  /**
632
- * Adds global middleware for a specific tag.
633
- *
634
- * This function allows you to register middleware that will be applied to
635
- * any wiring (HTTP, Channel, Queue, Scheduler, MCP) that includes the matching tag.
636
- *
637
- * @param tag - The tag that the middleware should apply to.
638
- * @param middleware - The middleware array to apply for the specified tag.
639
- *
640
- * @throws Error if middleware for the tag already exists.
678
+ * Tag-scoped middleware. Applies to any wiring that carries the matching tag.
641
679
  *
642
680
  * @example
643
- * ```typescript
644
- * // Add admin middleware for admin endpoints
645
- * addMiddleware('admin', [adminMiddleware])
646
- *
647
- * // Add authentication middleware for auth endpoints
648
- * addMiddleware('auth', [authMiddleware])
649
- *
650
- * // Add logging middleware for all API endpoints
651
- * addMiddleware('api', [loggingMiddleware])
652
- * ```
681
+ * addTagMiddleware('admin', [adminMiddleware])
653
682
  */
654
- export const addMiddleware = (tag: string, middleware: PikkuMiddleware[]) => {
655
- addMiddlewareCore(tag, middleware as any, '@pikku/addon-meta-conversions')
683
+ export const addTagMiddleware = (tag: string, middleware: PikkuMiddleware[]) => {
684
+ addTagMiddlewareCore(tag, middleware as any, '@pikku/addon-meta-conversions')
656
685
  }
657
686
 
658
687
  /**
659
- * Adds global permissions for a specific tag.
688
+ * Wire-agnostic global middleware. Runs at the top of every wiring's
689
+ * middleware chain — before wire-, tag-, and function-level entries.
660
690
  *
661
- * This function allows you to register permissions that will be applied to
662
- * any wiring (HTTP, Channel, Queue, Scheduler, MCP) that includes the matching tag.
691
+ * Resolution order: global -> wire -> tag -> function.
663
692
  *
664
- * @param tag - The tag that the permissions should apply to.
665
- * @param permissions - The permissions array or object to apply for the specified tag.
666
- *
667
- * @throws Error if permissions for the tag already exist.
693
+ * @example
694
+ * addGlobalMiddleware([telemetryMiddleware])
695
+ */
696
+ export const addGlobalMiddleware = (middleware: PikkuMiddleware[]) => {
697
+ addGlobalMiddlewareCore(middleware as any, '@pikku/addon-meta-conversions')
698
+ }
699
+
700
+ /**
701
+ * Tag-scoped permissions. Applies to any wiring that carries the matching tag.
668
702
  *
669
703
  * @example
670
- * ```typescript
671
- * // Add admin permissions for admin endpoints
672
- * addPermission('admin', [adminPermission])
704
+ * addTagPermission('admin', [adminPermission])
705
+ */
706
+ export const addTagPermission = <In = unknown>(tag: string, permissions: CorePermissionGroup<PikkuPermission<In>> | PikkuPermission<In>[]) => {
707
+ addTagPermissionCore(tag, permissions as any, '@pikku/addon-meta-conversions')
708
+ }
709
+
710
+ /**
711
+ * Wire-agnostic global permissions. Runs at the top of every wiring's
712
+ * permission resolution — before wire-, tag-, and function-level entries.
673
713
  *
674
- * // Add authentication permissions for auth endpoints
675
- * addPermission('auth', [authPermission])
714
+ * Resolution order: global -> wire -> tag -> function.
676
715
  *
677
- * // Add read permissions for all API endpoints (as object)
678
- * addPermission('api', { read: readPermission })
679
- * ```
716
+ * @example
717
+ * addGlobalPermission([signedInUser])
680
718
  */
681
- export const addPermission = <In = unknown>(tag: string, permissions: CorePermissionGroup<PikkuPermission<In>> | PikkuPermission<In>[]) => {
682
- addPermissionCore(tag, permissions as any, '@pikku/addon-meta-conversions')
719
+ export const addGlobalPermission = <In = unknown>(permissions: CorePermissionGroup<PikkuPermission<In>> | PikkuPermission<In>[]) => {
720
+ addGlobalPermissionCore(permissions as any, '@pikku/addon-meta-conversions')
683
721
  }
684
722
 
685
- export { wireAddon } from '@pikku/core'
686
- export type { WireAddonConfig } from '@pikku/core'
723
+ export { wireAddon } from '@pikku/core/rpc'
724
+ export type { WireAddonConfig } from '@pikku/core/rpc'
725
+
726
+
727
+ /**
728
+ * Addon contract references. Generated from each wired addon's published
729
+ * contract metadata — no addon source is imported. Functions are proxied via
730
+ * ref() (RPC) exactly like ref('namespace:fn').
731
+ */
732
+ const __addonHttp = {} as const
733
+ const __addonChannel = {} as const
734
+ const __addonCli = {} as const
735
+
736
+ export const refHTTP = <Name extends keyof typeof __addonHttp>(
737
+ name: Name,
738
+ options?: { basePath?: string }
739
+ ): (typeof __addonHttp)[Name] => {
740
+ const contract = __addonHttp[name] as any
741
+ return (
742
+ options?.basePath !== undefined
743
+ ? { ...contract, basePath: options.basePath }
744
+ : contract
745
+ ) as (typeof __addonHttp)[Name]
746
+ }
747
+
748
+ export const refChannel = <Name extends keyof typeof __addonChannel>(
749
+ name: Name
750
+ ): (typeof __addonChannel)[Name] => __addonChannel[name]
751
+
752
+ export const refCLI = <Name extends keyof typeof __addonCli>(
753
+ name: Name
754
+ ): (typeof __addonCli)[Name] => __addonCli[name]
@@ -19,8 +19,11 @@
19
19
  "outputs": [
20
20
  "EventSendOutput"
21
21
  ],
22
+ "implementationHash": "289d4066fc71925f",
22
23
  "description": "Send server-side conversion events to Meta via the Conversions API",
23
24
  "isDirectFunction": false,
25
+ "sourceFile": "/home/runner/work/addons/addons/packages/analytics/meta-conversions/src/functions/events/send.function.ts",
26
+ "exportedName": "eventSend",
24
27
  "contractHash": "5864ea42d4379da5",
25
28
  "inputHash": "0030f99c",
26
29
  "outputHash": "39d1f240"
@@ -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.55
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/internal';
5
5
  import metaData from './pikku-functions-meta.gen.json' with { type: 'json' };
@@ -13,6 +13,7 @@
13
13
  "outputs": [
14
14
  "EventSendOutput"
15
15
  ],
16
+ "implementationHash": "289d4066fc71925f",
16
17
  "contractHash": "5864ea42d4379da5",
17
18
  "inputHash": "0030f99c",
18
19
  "outputHash": "39d1f240"
@@ -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.55
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/internal'
5
5
  import type { FunctionsMeta } from '@pikku/core'
@@ -1,8 +1,8 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.6
2
+ * This file was generated by @pikku/cli@0.12.55
3
3
  */
4
4
  /* Import and register functions used by RPCs */
5
- import { addFunction } from '@pikku/core';
5
+ import { addFunction } from '@pikku/core/function';
6
6
  import { eventSend } from '../../src/functions/events/send.function.js';
7
7
  addFunction('eventSend', eventSend, '@pikku/addon-meta-conversions');
8
8
  //# sourceMappingURL=pikku-functions.gen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-functions.gen.js","sourceRoot":"","sources":["../../../.pikku/function/pikku-functions.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAEvE,WAAW,CAAC,WAAW,EAAE,SAAS,EAAE,+BAA+B,CAAC,CAAA"}
1
+ {"version":3,"file":"pikku-functions.gen.js","sourceRoot":"","sources":["../../../.pikku/function/pikku-functions.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAEvE,WAAW,CAAC,WAAW,EAAE,SAAS,EAAE,+BAA+B,CAAC,CAAA"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.6
2
+ * This file was generated by @pikku/cli@0.12.55
3
3
  */
4
4
  /* Import and register functions used by RPCs */
5
- import { addFunction } from '@pikku/core'
5
+ import { addFunction } from '@pikku/core/function'
6
6
  import { eventSend } from '../../src/functions/events/send.function.js'
7
7
 
8
8
  addFunction('eventSend', eventSend, '@pikku/addon-meta-conversions')
@@ -0,0 +1,120 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ /**
5
+ * HTTP-specific type definitions for tree-shaking optimization
6
+ */
7
+ import { AssertHTTPWiringParams } from '@pikku/core/http';
8
+ import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js';
9
+ import type { CoreHTTPFunctionWiring, HTTPMethod, HTTPRouteBaseConfig } from '@pikku/core/http';
10
+ /**
11
+ * Type definition for HTTP API wirings with type-safe path parameters.
12
+ * Supports both authenticated and unauthenticated functions.
13
+ *
14
+ * @template In - Input type for the HTTP wiring
15
+ * @template Out - Output type for the HTTP wiring
16
+ * @template Route - String literal type for the HTTP path (e.g., "/users/:id")
17
+ */
18
+ type HTTPWiring<In, Out, Route extends string> = CoreHTTPFunctionWiring<In, Out, Route, PikkuFunction<In, Out, 'rpc' | 'session'>, PikkuFunctionSessionless<In, Out, 'rpc' | 'session'>, PikkuPermission<In>, PikkuMiddleware>;
19
+ /**
20
+ * Registers an HTTP wiring with the Pikku framework.
21
+ *
22
+ * @template In - Input type for the HTTP wiring
23
+ * @template Out - Output type for the HTTP wiring
24
+ * @template Route - String literal type for the HTTP path (e.g., "/users/:id")
25
+ * @param httpWiring - HTTP wiring definition with handler, method, and optional middleware
26
+ */
27
+ export declare const wireHTTP: <In, Out, Route extends string>(httpWiring: HTTPWiring<In, Out, Route> & AssertHTTPWiringParams<In, Route>) => void;
28
+ /**
29
+ * Registers HTTP middleware either globally or for a specific route pattern.
30
+ *
31
+ * When a string route pattern is provided along with middleware, the middleware
32
+ * is applied only to that route. Otherwise, if an array is provided, it is treated
33
+ * as global middleware (applied to all routes).
34
+ *
35
+ * @param routeOrMiddleware - Either a global middleware array or a route pattern string
36
+ * @param middleware - The middleware array to apply when a route pattern is specified
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * // Add global HTTP middleware
41
+ * addHTTPMiddleware([authMiddleware, loggingMiddleware])
42
+ *
43
+ * // Add route-specific middleware
44
+ * addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
45
+ * ```
46
+ */
47
+ export declare const addHTTPMiddleware: (routeOrMiddleware: PikkuMiddleware[] | string, middleware?: PikkuMiddleware[]) => void;
48
+ /**
49
+ * Registers HTTP permissions either globally or for a specific route pattern.
50
+ *
51
+ * When a string route pattern is provided along with permissions, the permissions
52
+ * are applied only to that route. Permissions can be passed as an array or as a
53
+ * permission group object.
54
+ *
55
+ * @param pattern - Route pattern string (e.g., '*' for all routes, '/api/*' for specific routes)
56
+ * @param permissions - The permissions to apply for the specified route pattern
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * // Add global HTTP permissions
61
+ * addHTTPPermission('*', { global: globalPermission })
62
+ *
63
+ * // Add route-specific permissions
64
+ * addHTTPPermission('/api/admin/*', { admin: adminPermission })
65
+ * ```
66
+ */
67
+ export declare const addHTTPPermission: <In = unknown>(pattern: string, permissions: Record<string, PikkuPermission<In>> | PikkuPermission<In>[]) => void;
68
+ /**
69
+ * Route configuration for wireHTTPRoutes with proper typing
70
+ */
71
+ type HTTPRouteConfig = HTTPRouteBaseConfig & {
72
+ method: HTTPMethod;
73
+ route: string;
74
+ func: PikkuFunctionConfig<any, any, any, any, any, any>;
75
+ auth?: boolean;
76
+ permissions?: Record<string, PikkuPermission | PikkuPermission[]>;
77
+ middleware?: PikkuMiddleware[];
78
+ sse?: boolean;
79
+ };
80
+ /**
81
+ * Typed route map for wireHTTPRoutes
82
+ */
83
+ type TypedHTTPRouteMap = {
84
+ [key: string]: HTTPRouteConfig | TypedHTTPRouteMap | TypedHTTPRouteContract;
85
+ };
86
+ /**
87
+ * Typed route contract for defineHTTPRoutes
88
+ */
89
+ type TypedHTTPRouteContract<T extends TypedHTTPRouteMap = TypedHTTPRouteMap> = TypedHTTPRoutesGroupConfig & {
90
+ routes: T;
91
+ };
92
+ /**
93
+ * Group config with typed middleware/permissions
94
+ */
95
+ type TypedHTTPRoutesGroupConfig = {
96
+ basePath?: string;
97
+ tags?: string[];
98
+ auth?: boolean;
99
+ middleware?: PikkuMiddleware[];
100
+ permissions?: Record<string, PikkuPermission | PikkuPermission[]>;
101
+ };
102
+ /**
103
+ * Full config for wireHTTPRoutes
104
+ */
105
+ type TypedWireHTTPRoutesConfig = TypedHTTPRoutesGroupConfig & {
106
+ routes: TypedHTTPRouteMap | HTTPRouteConfig[];
107
+ };
108
+ /**
109
+ * Type-safe helper for defining route contracts that can be composed.
110
+ */
111
+ export declare function defineHTTPRoutes<T extends TypedHTTPRouteMap>(routes: T): TypedHTTPRouteContract<T>;
112
+ export declare function defineHTTPRoutes<T extends TypedHTTPRouteMap>(config: TypedHTTPRoutesGroupConfig & {
113
+ routes: T;
114
+ }): TypedHTTPRouteContract<T>;
115
+ /**
116
+ * Wires multiple HTTP routes from a nested map or array configuration.
117
+ */
118
+ export declare const wireHTTPRoutes: (config: TypedWireHTTPRoutesConfig) => void;
119
+ export {};
120
+ //# sourceMappingURL=pikku-http-types.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-http-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/http/pikku-http-types.gen.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ /**
5
+ * HTTP-specific type definitions for tree-shaking optimization
6
+ */
7
+ import { wireHTTP as wireHTTPCore, addHTTPMiddleware as addHTTPMiddlewareCore, addHTTPPermission as addHTTPPermissionCore, wireHTTPRoutes as wireHTTPRoutesCore, defineHTTPRoutes as defineHTTPRoutesCore } from '@pikku/core/http';
8
+ /**
9
+ * Registers an HTTP wiring with the Pikku framework.
10
+ *
11
+ * @template In - Input type for the HTTP wiring
12
+ * @template Out - Output type for the HTTP wiring
13
+ * @template Route - String literal type for the HTTP path (e.g., "/users/:id")
14
+ * @param httpWiring - HTTP wiring definition with handler, method, and optional middleware
15
+ */
16
+ export const wireHTTP = (httpWiring) => {
17
+ wireHTTPCore(httpWiring);
18
+ };
19
+ /**
20
+ * Registers HTTP middleware either globally or for a specific route pattern.
21
+ *
22
+ * When a string route pattern is provided along with middleware, the middleware
23
+ * is applied only to that route. Otherwise, if an array is provided, it is treated
24
+ * as global middleware (applied to all routes).
25
+ *
26
+ * @param routeOrMiddleware - Either a global middleware array or a route pattern string
27
+ * @param middleware - The middleware array to apply when a route pattern is specified
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * // Add global HTTP middleware
32
+ * addHTTPMiddleware([authMiddleware, loggingMiddleware])
33
+ *
34
+ * // Add route-specific middleware
35
+ * addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
36
+ * ```
37
+ */
38
+ export const addHTTPMiddleware = (routeOrMiddleware, middleware) => {
39
+ addHTTPMiddlewareCore(routeOrMiddleware, middleware);
40
+ };
41
+ /**
42
+ * Registers HTTP permissions either globally or for a specific route pattern.
43
+ *
44
+ * When a string route pattern is provided along with permissions, the permissions
45
+ * are applied only to that route. Permissions can be passed as an array or as a
46
+ * permission group object.
47
+ *
48
+ * @param pattern - Route pattern string (e.g., '*' for all routes, '/api/*' for specific routes)
49
+ * @param permissions - The permissions to apply for the specified route pattern
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * // Add global HTTP permissions
54
+ * addHTTPPermission('*', { global: globalPermission })
55
+ *
56
+ * // Add route-specific permissions
57
+ * addHTTPPermission('/api/admin/*', { admin: adminPermission })
58
+ * ```
59
+ */
60
+ export const addHTTPPermission = (pattern, permissions) => {
61
+ addHTTPPermissionCore(pattern, permissions);
62
+ };
63
+ export function defineHTTPRoutes(configOrRoutes) {
64
+ return defineHTTPRoutesCore(configOrRoutes);
65
+ }
66
+ /**
67
+ * Wires multiple HTTP routes from a nested map or array configuration.
68
+ */
69
+ export const wireHTTPRoutes = (config) => {
70
+ wireHTTPRoutesCore(config);
71
+ };
72
+ //# sourceMappingURL=pikku-http-types.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-http-types.gen.js","sourceRoot":"","sources":["../../../.pikku/http/pikku-http-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAA0B,QAAQ,IAAI,YAAY,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,cAAc,IAAI,kBAAkB,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAc3P;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,UAA0E,EAC1E,EAAE;IACF,YAAY,CAAC,UAAiB,CAAC,CAAA;AACjC,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,iBAA6C,EAC7C,UAA8B,EAC9B,EAAE;IACF,qBAAqB,CAAC,iBAAwB,EAAE,UAAiB,CAAC,CAAA;AACpE,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,OAAe,EACf,WAAwE,EACxE,EAAE;IACF,qBAAqB,CAAC,OAAO,EAAE,WAAkB,CAAC,CAAA;AACpD,CAAC,CAAA;AAoDD,MAAM,UAAU,gBAAgB,CAA8B,cAAgE;IAC5H,OAAO,oBAAoB,CAAC,cAAqB,CAAyC,CAAA;AAC5F,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAiC,EAAQ,EAAE;IACxE,kBAAkB,CAAC,MAAa,CAAC,CAAA;AACnC,CAAC,CAAA"}