@pikku/cli 0.8.3 → 0.9.0

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 (172) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/bin/pikku-all.ts +41 -32
  3. package/bin/pikku-fetch.ts +1 -1
  4. package/bin/pikku-openapi.ts +2 -2
  5. package/bin/pikku-queue-service.ts +2 -2
  6. package/bin/pikku-websocket.ts +1 -1
  7. package/cli.schema.json +30 -30
  8. package/dist/bin/pikku-all.js +32 -32
  9. package/dist/bin/pikku-fetch.js +1 -1
  10. package/dist/bin/pikku-openapi.js +2 -2
  11. package/dist/bin/pikku-queue-service.js +2 -2
  12. package/dist/bin/pikku-websocket.js +1 -1
  13. package/dist/bin/pikku.js +0 -0
  14. package/dist/src/events/channels/pikku-channels.js +3 -3
  15. package/dist/src/events/channels/pikku-command-channels.js +3 -3
  16. package/dist/src/events/channels/serialize-typed-channel-map.js +2 -2
  17. package/dist/src/events/channels/serialize-websocket-wrapper.js +15 -1
  18. package/dist/src/events/fetch/index.js +2 -2
  19. package/dist/src/events/http/openapi-spec-generator.d.ts +2 -2
  20. package/dist/src/events/http/pikku-command-http-map.js +4 -4
  21. package/dist/src/events/http/pikku-command-http-routes.js +3 -3
  22. package/dist/src/events/http/pikku-command-nextjs.d.ts +2 -0
  23. package/dist/src/events/http/pikku-command-nextjs.js +36 -0
  24. package/dist/src/events/http/pikku-http-routes.js +3 -3
  25. package/dist/src/events/http/serialize-typed-http-map.d.ts +2 -2
  26. package/dist/src/events/http/serialize-typed-http-map.js +11 -11
  27. package/dist/src/events/mcp/pikku-command-mcp.js +3 -3
  28. package/dist/src/events/queue/pikku-command-queue-service.js +6 -6
  29. package/dist/src/events/queue/pikku-command-queue.js +3 -3
  30. package/dist/src/events/queue/pikku-queue.js +3 -3
  31. package/dist/src/events/rpc/index.d.ts +2 -0
  32. package/dist/src/events/rpc/index.js +12 -0
  33. package/dist/src/events/rpc/pikku-command-rpc-client.js +6 -6
  34. package/dist/src/events/rpc/pikku-command-rpc.js +2 -2
  35. package/dist/src/events/rpc/pikku-rpc.js +2 -2
  36. package/dist/src/events/rpc/serialize-rpc-wrapper.js +40 -1
  37. package/dist/src/events/scheduler/pikku-command-scheduler.js +3 -3
  38. package/dist/src/inspector-glob.js +2 -2
  39. package/dist/src/pikku-cli-config.d.ts +17 -17
  40. package/dist/src/pikku-cli-config.js +31 -31
  41. package/dist/src/runtimes/nextjs/pikku-command-nextjs.js +3 -3
  42. package/dist/src/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +29 -29
  43. package/dist/src/runtimes/nextjs/serialize-nextjs-http-wrapper.js +28 -28
  44. package/dist/src/schema-generator.d.ts +2 -2
  45. package/dist/src/schema-generator.js +2 -2
  46. package/dist/src/serialize-pikku-types.js +67 -67
  47. package/dist/src/wirings/channels/pikku-channels.d.ts +2 -0
  48. package/dist/src/wirings/channels/pikku-channels.js +9 -0
  49. package/dist/src/wirings/channels/pikku-command-channels-map.d.ts +2 -0
  50. package/dist/src/wirings/channels/pikku-command-channels-map.js +8 -0
  51. package/dist/src/wirings/channels/pikku-command-channels.d.ts +2 -0
  52. package/dist/src/wirings/channels/pikku-command-channels.js +9 -0
  53. package/dist/src/wirings/channels/pikku-command-websocket-typed.d.ts +2 -0
  54. package/dist/src/wirings/channels/pikku-command-websocket-typed.js +15 -0
  55. package/dist/src/wirings/channels/serialize-typed-channel-map.d.ts +4 -0
  56. package/dist/src/wirings/channels/serialize-typed-channel-map.js +111 -0
  57. package/dist/src/wirings/channels/serialize-websocket-wrapper.d.ts +1 -0
  58. package/dist/src/wirings/channels/serialize-websocket-wrapper.js +75 -0
  59. package/dist/src/wirings/fetch/index.d.ts +2 -0
  60. package/dist/src/wirings/fetch/index.js +12 -0
  61. package/dist/src/wirings/functions/pikku-command-function-types.d.ts +2 -0
  62. package/dist/src/wirings/functions/pikku-command-function-types.js +13 -0
  63. package/dist/src/wirings/functions/pikku-command-functions.d.ts +6 -0
  64. package/dist/src/wirings/functions/pikku-command-functions.js +35 -0
  65. package/dist/src/wirings/functions/pikku-command-services.d.ts +3 -0
  66. package/dist/src/wirings/functions/pikku-command-services.js +73 -0
  67. package/dist/src/wirings/functions/pikku-function-types.d.ts +2 -0
  68. package/dist/src/wirings/functions/pikku-function-types.js +13 -0
  69. package/dist/src/wirings/functions/pikku-functions.d.ts +6 -0
  70. package/dist/src/wirings/functions/pikku-functions.js +35 -0
  71. package/dist/src/wirings/http/openapi-spec-generator.d.ts +79 -0
  72. package/dist/src/wirings/http/openapi-spec-generator.js +145 -0
  73. package/dist/src/wirings/http/pikku-command-http-map.d.ts +2 -0
  74. package/dist/src/wirings/http/pikku-command-http-map.js +8 -0
  75. package/dist/src/wirings/http/pikku-command-http-routes.d.ts +2 -0
  76. package/dist/src/wirings/http/pikku-command-http-routes.js +9 -0
  77. package/dist/src/wirings/http/pikku-command-openapi.d.ts +2 -0
  78. package/dist/src/wirings/http/pikku-command-openapi.js +20 -0
  79. package/dist/src/wirings/http/pikku-http-routes.d.ts +2 -0
  80. package/dist/src/wirings/http/pikku-http-routes.js +9 -0
  81. package/dist/src/wirings/http/serialize-fetch-wrapper.d.ts +1 -0
  82. package/dist/src/wirings/http/serialize-fetch-wrapper.js +67 -0
  83. package/dist/src/wirings/http/serialize-typed-http-map.d.ts +4 -0
  84. package/dist/src/wirings/http/serialize-typed-http-map.js +100 -0
  85. package/dist/src/wirings/mcp/pikku-command-mcp-json.d.ts +2 -0
  86. package/dist/src/wirings/mcp/pikku-command-mcp-json.js +13 -0
  87. package/dist/src/wirings/mcp/pikku-command-mcp.d.ts +2 -0
  88. package/dist/src/wirings/mcp/pikku-command-mcp.js +54 -0
  89. package/dist/src/wirings/mcp/serialize-mcp-json.d.ts +5 -0
  90. package/dist/src/wirings/mcp/serialize-mcp-json.js +101 -0
  91. package/dist/src/wirings/queue/pikku-command-queue-map.d.ts +2 -0
  92. package/dist/src/wirings/queue/pikku-command-queue-map.js +8 -0
  93. package/dist/src/wirings/queue/pikku-command-queue-service.d.ts +2 -0
  94. package/dist/src/wirings/queue/pikku-command-queue-service.js +15 -0
  95. package/dist/src/wirings/queue/pikku-command-queue.d.ts +2 -0
  96. package/dist/src/wirings/queue/pikku-command-queue.js +10 -0
  97. package/dist/src/wirings/queue/pikku-queue-map.d.ts +2 -0
  98. package/dist/src/wirings/queue/pikku-queue-map.js +8 -0
  99. package/dist/src/wirings/queue/pikku-queue.d.ts +2 -0
  100. package/dist/src/wirings/queue/pikku-queue.js +10 -0
  101. package/dist/src/wirings/queue/serialize-queue-map.d.ts +4 -0
  102. package/dist/src/wirings/queue/serialize-queue-map.js +77 -0
  103. package/dist/src/wirings/queue/serialize-queue-meta.d.ts +2 -0
  104. package/dist/src/wirings/queue/serialize-queue-meta.js +6 -0
  105. package/dist/src/wirings/queue/serialize-queue-wrapper.d.ts +1 -0
  106. package/dist/src/wirings/queue/serialize-queue-wrapper.js +35 -0
  107. package/dist/src/wirings/rpc/pikku-command-rpc-client.d.ts +2 -0
  108. package/dist/src/wirings/rpc/pikku-command-rpc-client.js +15 -0
  109. package/dist/src/wirings/rpc/pikku-command-rpc-map.d.ts +2 -0
  110. package/dist/src/wirings/rpc/pikku-command-rpc-map.js +8 -0
  111. package/dist/src/wirings/rpc/pikku-command-rpc.d.ts +2 -0
  112. package/dist/src/wirings/rpc/pikku-command-rpc.js +6 -0
  113. package/dist/src/wirings/rpc/pikku-rpc.d.ts +2 -0
  114. package/dist/src/wirings/rpc/pikku-rpc.js +6 -0
  115. package/dist/src/wirings/rpc/serialize-rpc-wrapper.d.ts +1 -0
  116. package/dist/src/wirings/rpc/serialize-rpc-wrapper.js +68 -0
  117. package/dist/src/wirings/rpc/serialize-typed-rpc-map.d.ts +4 -0
  118. package/dist/src/wirings/rpc/serialize-typed-rpc-map.js +66 -0
  119. package/dist/src/wirings/scheduler/pikku-command-scheduler.d.ts +2 -0
  120. package/dist/src/wirings/scheduler/pikku-command-scheduler.js +10 -0
  121. package/dist/src/wirings/scheduler/serialize-scheduler-meta.d.ts +2 -0
  122. package/dist/src/wirings/scheduler/serialize-scheduler-meta.js +10 -0
  123. package/dist/tsconfig.tsbuildinfo +1 -1
  124. package/lcov.info +582 -0
  125. package/package.json +3 -3
  126. package/src/inspector-glob.ts +2 -2
  127. package/src/pikku-cli-config.ts +67 -52
  128. package/src/runtimes/nextjs/pikku-command-nextjs.ts +3 -3
  129. package/src/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +29 -29
  130. package/src/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +28 -28
  131. package/src/schema-generator.ts +3 -3
  132. package/src/serialize-pikku-types.ts +67 -67
  133. package/src/{events → wirings}/channels/pikku-channels.ts +5 -4
  134. package/src/{events → wirings}/channels/pikku-command-channels.ts +5 -4
  135. package/src/{events → wirings}/channels/serialize-typed-channel-map.ts +3 -3
  136. package/src/{events → wirings}/channels/serialize-websocket-wrapper.ts +19 -5
  137. package/src/{events → wirings}/fetch/index.ts +2 -2
  138. package/src/{events → wirings}/http/openapi-spec-generator.ts +3 -3
  139. package/src/{events → wirings}/http/pikku-command-http-map.ts +5 -5
  140. package/src/{events → wirings}/http/pikku-command-http-routes.ts +5 -5
  141. package/src/{events → wirings}/http/pikku-http-routes.ts +5 -5
  142. package/src/wirings/http/serialize-fetch-wrapper.ts +67 -0
  143. package/src/{events → wirings}/http/serialize-typed-http-map.ts +17 -17
  144. package/src/{events → wirings}/mcp/pikku-command-mcp.ts +5 -5
  145. package/src/{events → wirings}/queue/pikku-command-queue-service.ts +9 -6
  146. package/src/{events → wirings}/queue/pikku-command-queue.ts +8 -5
  147. package/src/{events → wirings}/queue/pikku-queue.ts +8 -5
  148. package/src/{events → wirings}/rpc/pikku-command-rpc-client.ts +9 -6
  149. package/src/{events → wirings}/rpc/pikku-command-rpc.ts +2 -2
  150. package/src/{events → wirings}/rpc/pikku-rpc.ts +2 -2
  151. package/src/wirings/rpc/serialize-rpc-wrapper.ts +68 -0
  152. package/src/{events → wirings}/scheduler/pikku-command-scheduler.ts +8 -4
  153. package/src/events/http/serialize-fetch-wrapper.ts +0 -67
  154. package/src/events/rpc/serialize-rpc-wrapper.ts +0 -29
  155. /package/src/{events → wirings}/channels/pikku-command-channels-map.ts +0 -0
  156. /package/src/{events → wirings}/channels/pikku-command-websocket-typed.ts +0 -0
  157. /package/src/{events → wirings}/functions/pikku-command-function-types.ts +0 -0
  158. /package/src/{events → wirings}/functions/pikku-command-functions.ts +0 -0
  159. /package/src/{events → wirings}/functions/pikku-command-services.ts +0 -0
  160. /package/src/{events → wirings}/functions/pikku-function-types.ts +0 -0
  161. /package/src/{events → wirings}/functions/pikku-functions.ts +0 -0
  162. /package/src/{events → wirings}/http/pikku-command-openapi.ts +0 -0
  163. /package/src/{events → wirings}/mcp/pikku-command-mcp-json.ts +0 -0
  164. /package/src/{events → wirings}/mcp/serialize-mcp-json.ts +0 -0
  165. /package/src/{events → wirings}/queue/pikku-command-queue-map.ts +0 -0
  166. /package/src/{events → wirings}/queue/pikku-queue-map.ts +0 -0
  167. /package/src/{events → wirings}/queue/serialize-queue-map.ts +0 -0
  168. /package/src/{events → wirings}/queue/serialize-queue-meta.ts +0 -0
  169. /package/src/{events → wirings}/queue/serialize-queue-wrapper.ts +0 -0
  170. /package/src/{events → wirings}/rpc/pikku-command-rpc-map.ts +0 -0
  171. /package/src/{events → wirings}/rpc/serialize-typed-rpc-map.ts +0 -0
  172. /package/src/{events → wirings}/scheduler/serialize-scheduler-meta.ts +0 -0
@@ -6,7 +6,7 @@ export const serializeNextJsBackendWrapper = (httpBootstrapPath, routesMapPath,
6
6
  * It ensures type safety for route handling methods when integrating with the @pikku/core framework.
7
7
  */
8
8
  import { PikkuNextJS } from '@pikku/next'
9
- import type { RoutesMap, RouteHandlerOf, RoutesWithMethod } from '${routesMapPath}'
9
+ import type { HTTPWiringsMap, HTTPWiringHandlerOf, HTTPWiringsWithMethod } from '${routesMapPath}'
10
10
 
11
11
  ${configImport}
12
12
  ${singleServicesFactoryImport}
@@ -34,7 +34,7 @@ export const pikku = (_options?: any) => {
34
34
  * Makes a dynamic action request for a specified route and method.
35
35
  * Dynamic requests may access headers and cookies and are therefore unsuitable for precompile stages.
36
36
  *
37
- * @template Route - The route key from the RoutesMap.
37
+ * @template Route - The route key from the HTTPWiringsMap.
38
38
  * @template Method - The method key from the specified route.
39
39
  * @param route - The route identifier.
40
40
  * @param method - The HTTP method to be used for the request.
@@ -42,13 +42,13 @@ export const pikku = (_options?: any) => {
42
42
  * @returns A promise that resolves to the output of the route handler.
43
43
  */
44
44
  const dynamicActionRequest = async <
45
- Route extends keyof RoutesMap,
46
- Method extends keyof RoutesMap[Route]
45
+ Route extends keyof HTTPWiringsMap,
46
+ Method extends keyof HTTPWiringsMap[Route]
47
47
  >(
48
48
  route: Route,
49
49
  method: Method,
50
- data: RouteHandlerOf<Route, Method>['input'] = null
51
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
50
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
51
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
52
52
  return _pikku!.actionRequest(route, method, data as any)
53
53
  }
54
54
 
@@ -56,7 +56,7 @@ export const pikku = (_options?: any) => {
56
56
  * Makes a static action request for a specified route and method.
57
57
  * Static requests do not depend on headers or cookies and are suitable for precompile stages.
58
58
  *
59
- * @template Route - The route key from the RoutesMap.
59
+ * @template Route - The route key from the HTTPWiringsMap.
60
60
  * @template Method - The method key from the specified route.
61
61
  * @param route - The route identifier.
62
62
  * @param method - The HTTP method to be used for the request.
@@ -64,13 +64,13 @@ export const pikku = (_options?: any) => {
64
64
  * @returns A promise that resolves to the output of the route handler.
65
65
  */
66
66
  const staticActionRequest = async <
67
- Route extends keyof RoutesMap,
68
- Method extends keyof RoutesMap[Route]
67
+ Route extends keyof HTTPWiringsMap,
68
+ Method extends keyof HTTPWiringsMap[Route]
69
69
  >(
70
70
  route: Route,
71
71
  method: Method,
72
- data: RouteHandlerOf<Route, Method>['input'] = null
73
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
72
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
73
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
74
74
  return _pikku!.staticActionRequest(route, method, data as any)
75
75
  }
76
76
 
@@ -82,10 +82,10 @@ export const pikku = (_options?: any) => {
82
82
  * @param data - The input data for the POST request, defaults to null.
83
83
  * @returns A promise that resolves to the output of the POST handler.
84
84
  */
85
- const dynamicPost = <Route extends RoutesWithMethod<'POST'>>(
85
+ const dynamicPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
86
86
  route: Route,
87
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
88
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
87
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
88
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
89
89
  return dynamicActionRequest(route, 'POST', data)
90
90
  }
91
91
 
@@ -97,10 +97,10 @@ export const pikku = (_options?: any) => {
97
97
  * @param data - The input data for the GET request, defaults to null.
98
98
  * @returns A promise that resolves to the output of the GET handler.
99
99
  */
100
- const dynamicGet = <Route extends RoutesWithMethod<'GET'>>(
100
+ const dynamicGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
101
101
  route: Route,
102
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
103
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
102
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
103
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
104
104
  return dynamicActionRequest(route, 'GET', data)
105
105
  }
106
106
 
@@ -112,10 +112,10 @@ export const pikku = (_options?: any) => {
112
112
  * @param data - The input data for the PATCH request, defaults to null.
113
113
  * @returns A promise that resolves to the output of the PATCH handler.
114
114
  */
115
- const dynamicPatch = <Route extends RoutesWithMethod<'PATCH'>>(
115
+ const dynamicPatch = <Route extends HTTPWiringsWithMethod<'PATCH'>>(
116
116
  route: Route,
117
- data: RouteHandlerOf<Route, 'PATCH'>['input'] = null
118
- ): Promise<RouteHandlerOf<Route, 'PATCH'>['output']> => {
117
+ data: HTTPWiringHandlerOf<Route, 'PATCH'>['input'] = null
118
+ ): Promise<HTTPWiringHandlerOf<Route, 'PATCH'>['output']> => {
119
119
  return dynamicActionRequest(route, 'PATCH', data)
120
120
  }
121
121
 
@@ -127,10 +127,10 @@ export const pikku = (_options?: any) => {
127
127
  * @param data - The input data for the DELETE request, defaults to null.
128
128
  * @returns A promise that resolves to the output of the DELETE handler.
129
129
  */
130
- const dynamicDel = <Route extends RoutesWithMethod<'DELETE'>>(
130
+ const dynamicDel = <Route extends HTTPWiringsWithMethod<'DELETE'>>(
131
131
  route: Route,
132
- data: RouteHandlerOf<Route, 'DELETE'>['input'] = null
133
- ): Promise<RouteHandlerOf<Route, 'DELETE'>['output']> => {
132
+ data: HTTPWiringHandlerOf<Route, 'DELETE'>['input'] = null
133
+ ): Promise<HTTPWiringHandlerOf<Route, 'DELETE'>['output']> => {
134
134
  return dynamicActionRequest(route, 'DELETE', data)
135
135
  }
136
136
 
@@ -144,10 +144,10 @@ export const pikku = (_options?: any) => {
144
144
  * @param data - The input data for the POST request, defaults to null.
145
145
  * @returns A promise that resolves to the output of the POST handler.
146
146
  */
147
- const staticPost = <Route extends RoutesWithMethod<'POST'>>(
147
+ const staticPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
148
148
  route: Route,
149
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
150
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
149
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
150
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
151
151
  return staticActionRequest(route, 'POST', data)
152
152
  }
153
153
 
@@ -159,10 +159,10 @@ export const pikku = (_options?: any) => {
159
159
  * @param data - The input data for the GET request, defaults to null.
160
160
  * @returns A promise that resolves to the output of the GET handler.
161
161
  */
162
- const staticGet = <Route extends RoutesWithMethod<'GET'>>(
162
+ const staticGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
163
163
  route: Route,
164
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
165
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
164
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
165
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
166
166
  return staticActionRequest(route, 'GET', data)
167
167
  }
168
168
 
@@ -6,7 +6,7 @@ export const serializeNextJsHTTPWrapper = (routesMapPath, pikkuFetchImport) => {
6
6
  * It ensures type safety for route handling methods when integrating with the @pikku/core framework.
7
7
  */
8
8
  import { CorePikkuFetchOptions } from '@pikku/fetch'
9
- import type { RoutesMap, RouteHandlerOf, RoutesWithMethod } from '${routesMapPath}'
9
+ import type { HTTPWiringsMap, HTTPWiringHandlerOf, HTTPWiringsWithMethod } from '${routesMapPath}'
10
10
  import { PikkuFetch } from '${pikkuFetchImport}'
11
11
 
12
12
  let _pikku: PikkuFetch | undefined
@@ -22,13 +22,13 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
22
22
  }
23
23
 
24
24
  const dynamicActionRequest = async <
25
- Route extends keyof RoutesMap,
26
- Method extends keyof RoutesMap[Route]
25
+ Route extends keyof HTTPWiringsMap,
26
+ Method extends keyof HTTPWiringsMap[Route]
27
27
  >(
28
28
  route: Route,
29
29
  method: Method,
30
- data: RouteHandlerOf<Route, Method>['input'] = null
31
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
30
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
31
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
32
32
  return (_pikku! as any)[(method as string).toLowerCase()](route, data as any)
33
33
  }
34
34
 
@@ -36,7 +36,7 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
36
36
  * Makes a static action request for a specified route and method.
37
37
  * Static requests do not depend on headers or cookies and are suitable for precompile stages.
38
38
  *
39
- * @template Route - The route key from the RoutesMap.
39
+ * @template Route - The route key from the HTTPWiringsMap.
40
40
  * @template Method - The method key from the specified route.
41
41
  * @param route - The route identifier.
42
42
  * @param method - The HTTP method to be used for the request.
@@ -44,13 +44,13 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
44
44
  * @returns A promise that resolves to the output of the route handler.
45
45
  */
46
46
  const staticActionRequest = async <
47
- Route extends keyof RoutesMap,
48
- Method extends keyof RoutesMap[Route]
47
+ Route extends keyof HTTPWiringsMap,
48
+ Method extends keyof HTTPWiringsMap[Route]
49
49
  >(
50
50
  route: Route,
51
51
  method: Method,
52
- data: RouteHandlerOf<Route, Method>['input'] = null
53
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
52
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
53
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
54
54
  return (_pikku! as any)[(method as string).toLowerCase()](route, data as any)
55
55
  }
56
56
 
@@ -62,10 +62,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
62
62
  * @param data - The input data for the POST request, defaults to null.
63
63
  * @returns A promise that resolves to the output of the POST handler.
64
64
  */
65
- const dynamicPost = <Route extends RoutesWithMethod<'POST'>>(
65
+ const dynamicPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
66
66
  route: Route,
67
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
68
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
67
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
68
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
69
69
  return dynamicActionRequest(route, 'POST', data)
70
70
  }
71
71
 
@@ -77,10 +77,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
77
77
  * @param data - The input data for the GET request, defaults to null.
78
78
  * @returns A promise that resolves to the output of the GET handler.
79
79
  */
80
- const dynamicGet = <Route extends RoutesWithMethod<'GET'>>(
80
+ const dynamicGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
81
81
  route: Route,
82
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
83
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
82
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
83
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
84
84
  return dynamicActionRequest(route, 'GET', data)
85
85
  }
86
86
 
@@ -92,10 +92,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
92
92
  * @param data - The input data for the PATCH request, defaults to null.
93
93
  * @returns A promise that resolves to the output of the PATCH handler.
94
94
  */
95
- const dynamicPatch = <Route extends RoutesWithMethod<'PATCH'>>(
95
+ const dynamicPatch = <Route extends HTTPWiringsWithMethod<'PATCH'>>(
96
96
  route: Route,
97
- data: RouteHandlerOf<Route, 'PATCH'>['input'] = null
98
- ): Promise<RouteHandlerOf<Route, 'PATCH'>['output']> => {
97
+ data: HTTPWiringHandlerOf<Route, 'PATCH'>['input'] = null
98
+ ): Promise<HTTPWiringHandlerOf<Route, 'PATCH'>['output']> => {
99
99
  return dynamicActionRequest(route, 'PATCH', data)
100
100
  }
101
101
 
@@ -107,10 +107,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
107
107
  * @param data - The input data for the DELETE request, defaults to null.
108
108
  * @returns A promise that resolves to the output of the DELETE handler.
109
109
  */
110
- const dynamicDel = <Route extends RoutesWithMethod<'DELETE'>>(
110
+ const dynamicDel = <Route extends HTTPWiringsWithMethod<'DELETE'>>(
111
111
  route: Route,
112
- data: RouteHandlerOf<Route, 'DELETE'>['input'] = null
113
- ): Promise<RouteHandlerOf<Route, 'DELETE'>['output']> => {
112
+ data: HTTPWiringHandlerOf<Route, 'DELETE'>['input'] = null
113
+ ): Promise<HTTPWiringHandlerOf<Route, 'DELETE'>['output']> => {
114
114
  return dynamicActionRequest(route, 'DELETE', data)
115
115
  }
116
116
 
@@ -124,10 +124,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
124
124
  * @param data - The input data for the POST request, defaults to null.
125
125
  * @returns A promise that resolves to the output of the POST handler.
126
126
  */
127
- const staticPost = <Route extends RoutesWithMethod<'POST'>>(
127
+ const staticPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
128
128
  route: Route,
129
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
130
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
129
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
130
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
131
131
  return staticActionRequest(route, 'POST', data)
132
132
  }
133
133
 
@@ -139,10 +139,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
139
139
  * @param data - The input data for the GET request, defaults to null.
140
140
  * @returns A promise that resolves to the output of the GET handler.
141
141
  */
142
- const staticGet = <Route extends RoutesWithMethod<'GET'>>(
142
+ const staticGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
143
143
  route: Route,
144
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
145
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
144
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
145
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
146
146
  return staticActionRequest(route, 'GET', data)
147
147
  }
148
148
 
@@ -1,6 +1,6 @@
1
1
  import { CLILogger } from './utils.js';
2
2
  import { FunctionsMeta, JSONValue } from '@pikku/core';
3
- import { HTTPRoutesMeta } from '@pikku/core/http';
3
+ import { HTTPWiringsMeta } from '@pikku/core/http';
4
4
  import { TypesMap } from '@pikku/inspector';
5
- export declare function generateSchemas(logger: CLILogger, tsconfig: string, typesMap: TypesMap, functionMeta: FunctionsMeta, httpRoutesMeta: HTTPRoutesMeta): Promise<Record<string, JSONValue>>;
5
+ export declare function generateSchemas(logger: CLILogger, tsconfig: string, typesMap: TypesMap, functionMeta: FunctionsMeta, httpWiringsMeta: HTTPWiringsMeta): Promise<Record<string, JSONValue>>;
6
6
  export declare function saveSchemas(logger: CLILogger, schemaParentDir: string, schemas: Record<string, JSONValue>, typesMap: TypesMap, functionsMeta: FunctionsMeta, supportsImportAttributes: boolean): Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import { createGenerator, RootlessError } from 'ts-json-schema-generator';
2
2
  import { writeFileInDir } from './utils.js';
3
3
  import { mkdir, writeFile } from 'fs/promises';
4
- export async function generateSchemas(logger, tsconfig, typesMap, functionMeta, httpRoutesMeta) {
4
+ export async function generateSchemas(logger, tsconfig, typesMap, functionMeta, httpWiringsMeta) {
5
5
  const schemasSet = new Set(typesMap.customTypes.keys());
6
6
  for (const { inputs, outputs } of Object.values(functionMeta)) {
7
7
  const types = [...(inputs || []), ...(outputs || [])];
@@ -12,7 +12,7 @@ export async function generateSchemas(logger, tsconfig, typesMap, functionMeta,
12
12
  }
13
13
  }
14
14
  }
15
- for (const { inputTypes } of httpRoutesMeta) {
15
+ for (const { inputTypes } of httpWiringsMeta) {
16
16
  if (inputTypes?.body) {
17
17
  schemasSet.add(inputTypes.body);
18
18
  }
@@ -6,13 +6,13 @@ export const serializePikkuTypes = (userSessionTypeImport, userSessionTypeName,
6
6
  * This is used to provide the application types in the typescript project
7
7
  */
8
8
 
9
- import { CoreAPIPermission, PikkuMiddleware } from '@pikku/core'
10
- import { CoreAPIFunction, CoreAPIFunctionSessionless } from '@pikku/core/function'
11
- import { CoreHTTPFunctionRoute, AssertRouteParams, addHTTPRoute as addCoreHTTPRoute } from '@pikku/core/http'
12
- import { CoreScheduledTask, addScheduledTask as addCoreScheduledTask } from '@pikku/core/scheduler'
13
- import { CoreAPIChannel, PikkuChannel, addChannel as addCoreChannel } from '@pikku/core/channel'
14
- import { CoreQueueWorker, addQueueWorker as addCoreQueueWorker } from '@pikku/core/queue'
15
- import { CoreMCPResource, CoreMCPTool, CoreMCPPrompt, addMCPResource as addCoreMCPResource, addMCPTool as addCoreMCPTool, addMCPPrompt as addCoreMCPPrompt, MCPResourceResponse, MCPToolResponse, MCPPromptResponse, PikkuMCP } from '@pikku/core'
9
+ import { CorePikkuPermission, PikkuMiddleware } from '@pikku/core'
10
+ import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function'
11
+ import { CoreHTTPFunctionWiring, AssertHTTPWiringParams, wireHTTP as wireHTTPCore } from '@pikku/core/http'
12
+ import { CoreScheduledTask, wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler'
13
+ import { CoreChannel, PikkuChannel, wireChannel as wireChannelCore } from '@pikku/core/channel'
14
+ import { CoreQueueWorker, wireQueueWorker as wireQueueWorkerCore } from '@pikku/core/queue'
15
+ import { CoreMCPResource, CoreMCPTool, CoreMCPPrompt, wireMCPResource as wireMCPResourceCore, wireMCPTool as wireMCPToolCore, wireMCPPrompt as wireMCPPromptCore, MCPResourceResponse, MCPToolResponse, MCPPromptResponse, PikkuMCP } from '@pikku/core'
16
16
 
17
17
  ${userSessionTypeImport}
18
18
  ${singletonServicesTypeImport}
@@ -26,11 +26,11 @@ ${rpcMapTypeImport}
26
26
  * @template In - The input type that the permission check will receive
27
27
  * @template RequiredServices - The services required for this permission check
28
28
  */
29
- export type APIPermission<In = unknown, RequiredServices extends ${singletonServicesTypeName} = ${singletonServicesTypeName}> = CoreAPIPermission<In, RequiredServices, ${userSessionTypeName}>
29
+ export type PikkuPermission<In = unknown, RequiredServices extends ${singletonServicesTypeName} = ${singletonServicesTypeName}> = CorePikkuPermission<In, RequiredServices, ${userSessionTypeName}>
30
30
 
31
31
  /**
32
32
  * Type-safe middleware definition that can access your application's services and session.
33
- * Use this to define reusable middleware that can be applied to multiple routes.
33
+ * Use this to define reusable middleware that can be applied to multiple HTTP wirings.
34
34
  *
35
35
  * @template RequiredServices - The services required for this middleware
36
36
  */
@@ -46,7 +46,7 @@ export type APIMiddleware<RequiredServices extends ${singletonServicesTypeName}
46
46
  * @template MCPData - MCP data type (null = optional MCP)
47
47
  * @template RequiredServices - Services required by this function
48
48
  */
49
- type APIFunctionSessionless<
49
+ type PikkuFunctionSessionless<
50
50
  In = unknown,
51
51
  Out = never,
52
52
  ChannelData = null, // null means optional channel
@@ -60,7 +60,7 @@ type APIFunctionSessionless<
60
60
  ? { mcp?: PikkuMCP } // Optional MCP
61
61
  : { mcp: PikkuMCP } // Required MCP
62
62
  )
63
- > = CoreAPIFunctionSessionless<In, Out, ChannelData, RequiredServices, ${userSessionTypeName}>
63
+ > = CorePikkuFunctionSessionless<In, Out, ChannelData, RequiredServices, ${userSessionTypeName}>
64
64
 
65
65
  /**
66
66
  * A session-aware API function that requires user authentication.
@@ -72,7 +72,7 @@ type APIFunctionSessionless<
72
72
  * @template MCPData - MCP data type (null = optional MCP)
73
73
  * @template RequiredServices - Services required by this function
74
74
  */
75
- type APIFunction<
75
+ type PikkuFunction<
76
76
  In = unknown,
77
77
  Out = never,
78
78
  ChannelData = null, // null means optional channel
@@ -86,17 +86,17 @@ type APIFunction<
86
86
  ? { mcp?: PikkuMCP } // Optional MCP
87
87
  : { mcp: PikkuMCP } // Required MCP
88
88
  )
89
- > = CoreAPIFunction<In, Out, ChannelData, RequiredServices, ${userSessionTypeName}>
89
+ > = CorePikkuFunction<In, Out, ChannelData, RequiredServices, ${userSessionTypeName}>
90
90
 
91
91
  /**
92
- * Type definition for HTTP API routes with type-safe path parameters.
92
+ * Type definition for HTTP API wirings with type-safe path parameters.
93
93
  * Supports both authenticated and unauthenticated functions.
94
94
  *
95
- * @template In - Input type for the route
96
- * @template Out - Output type for the route
97
- * @template Route - String literal type for the route path (e.g., "/users/:id")
95
+ * @template In - Input type for the HTTP wiring
96
+ * @template Out - Output type for the HTTP wiring
97
+ * @template Route - String literal type for the HTTP path (e.g., "/users/:id")
98
98
  */
99
- type APIRoute<In, Out, Route extends string> = CoreHTTPFunctionRoute<In, Out, Route, APIFunction<In, Out>, APIFunctionSessionless<In, Out>, APIPermission<In>, APIMiddleware>
99
+ type HTTPWiring<In, Out, Route extends string> = CoreHTTPFunctionWiring<In, Out, Route, PikkuFunction<In, Out>, PikkuFunctionSessionless<In, Out>, PikkuPermission<In>, APIMiddleware>
100
100
 
101
101
  /**
102
102
  * Type definition for WebSocket channels with typed data exchange.
@@ -105,13 +105,13 @@ type APIRoute<In, Out, Route extends string> = CoreHTTPFunctionRoute<In, Out, Ro
105
105
  * @template ChannelData - Type of data exchanged through the channel
106
106
  * @template Channel - String literal type for the channel name
107
107
  */
108
- type APIChannel<ChannelData, Channel extends string> = CoreAPIChannel<ChannelData, Channel, APIFunction<void, unknown> | APIFunction<void, unknown, ChannelData>, APIFunction<void, void> | APIFunction<void, void, ChannelData>, APIFunction<any, any> | APIFunction<any, any, ChannelData>, APIPermission>
108
+ type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelData, Channel, PikkuFunction<void, unknown> | PikkuFunction<void, unknown, ChannelData>, PikkuFunction<void, void> | PikkuFunction<void, void, ChannelData>, PikkuFunction<any, any> | PikkuFunction<any, any, ChannelData>, PikkuPermission>
109
109
 
110
110
  /**
111
111
  * Type definition for scheduled tasks that run at specified intervals.
112
112
  * These are sessionless functions that execute based on cron expressions.
113
113
  */
114
- type ScheduledTask = CoreScheduledTask<APIFunctionSessionless<void, void>>
114
+ type SchedulerWiring = CoreScheduledTask<PikkuFunctionSessionless<void, void>>
115
115
 
116
116
  /**
117
117
  * Type definition for queue workers that process background jobs.
@@ -119,28 +119,28 @@ type ScheduledTask = CoreScheduledTask<APIFunctionSessionless<void, void>>
119
119
  * @template In - Input type for the queue job
120
120
  * @template Out - Output type for the queue job
121
121
  */
122
- type QueueWorker<In, Out> = CoreQueueWorker<APIFunctionSessionless<In, Out>>
122
+ type QueueWiring<In, Out> = CoreQueueWorker<PikkuFunctionSessionless<In, Out>>
123
123
 
124
124
  /**
125
125
  * Type definition for MCP resources that provide data to AI models.
126
126
  *
127
127
  * @template In - Input type for the resource request
128
128
  */
129
- type MCPResource<In> = CoreMCPResource<APIFunctionSessionless<In, MCPResourceResponse, null, true>>
129
+ type MCPResourceWiring<In> = CoreMCPResource<PikkuFunctionSessionless<In, MCPResourceResponse, null, true>>
130
130
 
131
131
  /**
132
132
  * Type definition for MCP tools that AI models can invoke.
133
133
  *
134
134
  * @template In - Input type for the tool invocation
135
135
  */
136
- type MCPTool<In> = CoreMCPTool<APIFunctionSessionless<In, MCPToolResponse, null, true>>
136
+ type MCPToolWiring<In> = CoreMCPTool<PikkuFunctionSessionless<In, MCPToolResponse, null, true>>
137
137
 
138
138
  /**
139
139
  * Type definition for MCP prompts that provide templates to AI models.
140
140
  *
141
141
  * @template In - Input type for the prompt parameters
142
142
  */
143
- type MCPPrompt<In> = CoreMCPPrompt<APIFunctionSessionless<In, MCPPromptResponse, null, true>>
143
+ type MCPPromptWiring<In> = CoreMCPPrompt<PikkuFunctionSessionless<In, MCPPromptResponse, null, true>>
144
144
 
145
145
  /**
146
146
  * Creates a Pikku function that can be either session-aware or sessionless.
@@ -165,14 +165,14 @@ type MCPPrompt<In> = CoreMCPPrompt<APIFunctionSessionless<In, MCPPromptResponse,
165
165
  */
166
166
  export const pikkuFunc = <In, Out = unknown>(
167
167
  func:
168
- | APIFunction<In, Out>
168
+ | PikkuFunction<In, Out>
169
169
  | {
170
- func: APIFunction<In, Out>
170
+ func: PikkuFunction<In, Out>
171
171
  auth?: true
172
172
  name?: string
173
173
  }
174
174
  | {
175
- func: APIFunctionSessionless<In, Out>
175
+ func: PikkuFunctionSessionless<In, Out>
176
176
  auth: false
177
177
  name?: string
178
178
  }
@@ -202,9 +202,9 @@ export const pikkuFunc = <In, Out = unknown>(
202
202
  */
203
203
  export const pikkuSessionlessFunc = <In, Out = unknown>(
204
204
  func:
205
- | APIFunctionSessionless<In, Out>
205
+ | PikkuFunctionSessionless<In, Out>
206
206
  | {
207
- func: APIFunctionSessionless<In, Out>
207
+ func: PikkuFunctionSessionless<In, Out>
208
208
  name?: string
209
209
  }
210
210
  ) => {
@@ -233,9 +233,9 @@ export const pikkuSessionlessFunc = <In, Out = unknown>(
233
233
  */
234
234
  export const pikkuChannelConnectionFunc = <Out = unknown, ChannelData = unknown>(
235
235
  func:
236
- | APIFunctionSessionless<void, Out, ChannelData>
236
+ | PikkuFunctionSessionless<void, Out, ChannelData>
237
237
  | {
238
- func: APIFunctionSessionless<void, Out, ChannelData>
238
+ func: PikkuFunctionSessionless<void, Out, ChannelData>
239
239
  name?: string
240
240
  }
241
241
  ) => {
@@ -262,9 +262,9 @@ export const pikkuChannelConnectionFunc = <Out = unknown, ChannelData = unknown>
262
262
  */
263
263
  export const pikkuChannelDisconnectionFunc = <ChannelData = unknown>(
264
264
  func:
265
- | APIFunctionSessionless<void, void, ChannelData>
265
+ | PikkuFunctionSessionless<void, void, ChannelData>
266
266
  | {
267
- func: APIFunction<void, void, ChannelData>
267
+ func: PikkuFunction<void, void, ChannelData>
268
268
  name?: string
269
269
  }
270
270
  ) => {
@@ -292,9 +292,9 @@ export const pikkuChannelDisconnectionFunc = <ChannelData = unknown>(
292
292
  */
293
293
  export const pikkuChannelFunc = <In = unknown, Out = unknown, ChannelData = unknown>(
294
294
  func:
295
- | APIFunctionSessionless<In, Out, ChannelData>
295
+ | PikkuFunctionSessionless<In, Out, ChannelData>
296
296
  | {
297
- func: APIFunctionSessionless<In, Out, ChannelData>
297
+ func: PikkuFunctionSessionless<In, Out, ChannelData>
298
298
  name?: string
299
299
  }
300
300
  ) => {
@@ -319,9 +319,9 @@ export const pikkuChannelFunc = <In = unknown, Out = unknown, ChannelData = unkn
319
319
  */
320
320
  export const pikkuVoidFunc = (
321
321
  func:
322
- | APIFunctionSessionless<void, void>
322
+ | PikkuFunctionSessionless<void, void>
323
323
  | {
324
- func: APIFunctionSessionless<void, void>
324
+ func: PikkuFunctionSessionless<void, void>
325
325
  name?: string
326
326
  }
327
327
  ) => {
@@ -335,24 +335,24 @@ export const pikkuVoidFunc = (
335
335
  * @template Channel - String literal type for the channel name
336
336
  * @param channel - Channel definition with connection, disconnection, and message handlers
337
337
  */
338
- export const addChannel = <ChannelData, Channel extends string>(
339
- channel: APIChannel<ChannelData, Channel> & AssertRouteParams<ChannelData, Channel>
338
+ export const wireChannel = <ChannelData, Channel extends string>(
339
+ channel: ChannelWiring<ChannelData, Channel> & AssertHTTPWiringParams<ChannelData, Channel>
340
340
  ) => {
341
- addCoreChannel(channel as any) // TODO
341
+ wireChannelCore(channel as any) // TODO
342
342
  }
343
343
 
344
344
  /**
345
- * Registers an HTTP route with the Pikku framework.
345
+ * Registers an HTTP wiring with the Pikku framework.
346
346
  *
347
- * @template In - Input type for the route
348
- * @template Out - Output type for the route
349
- * @template Route - String literal type for the route path (e.g., "/users/:id")
350
- * @param route - Route definition with handler, method, and optional middleware
347
+ * @template In - Input type for the HTTP wiring
348
+ * @template Out - Output type for the HTTP wiring
349
+ * @template Route - String literal type for the HTTP path (e.g., "/users/:id")
350
+ * @param httpWiring - HTTP wiring definition with handler, method, and optional middleware
351
351
  */
352
- export const addHTTPRoute = <In, Out, Route extends string>(
353
- route: APIRoute<In, Out, Route> & AssertRouteParams<In, Route>
352
+ export const wireHTTP = <In, Out, Route extends string>(
353
+ httpWiring: HTTPWiring<In, Out, Route> & AssertHTTPWiringParams<In, Route>
354
354
  ) => {
355
- addCoreHTTPRoute(route)
355
+ wireHTTPCore(httpWiring)
356
356
  }
357
357
 
358
358
  /**
@@ -361,8 +361,8 @@ export const addHTTPRoute = <In, Out, Route extends string>(
361
361
  *
362
362
  * @param task - Scheduled task definition with cron expression and handler
363
363
  */
364
- export const addScheduledTask = (task: ScheduledTask) => {
365
- addCoreScheduledTask(task as any) // TODO
364
+ export const wireScheduler = (task: SchedulerWiring) => {
365
+ wireSchedulerCore(task as any) // TODO
366
366
  }
367
367
 
368
368
  /**
@@ -371,8 +371,8 @@ export const addScheduledTask = (task: ScheduledTask) => {
371
371
  *
372
372
  * @param queueWorker - Queue worker definition with job handler
373
373
  */
374
- export const addQueueWorker = (queueWorker: QueueWorker<any, any>) => {
375
- addCoreQueueWorker(queueWorker as any) // TODO
374
+ export const wireQueueWorker = (queueWorker: QueueWiring<any, any>) => {
375
+ wireQueueWorkerCore(queueWorker as any) // TODO
376
376
  }
377
377
 
378
378
  /**
@@ -382,10 +382,10 @@ export const addQueueWorker = (queueWorker: QueueWorker<any, any>) => {
382
382
  * @template In - Input type for the resource request
383
383
  * @param mcpResource - MCP resource definition with data provider function
384
384
  */
385
- export const addMCPResource = <In>(
386
- mcpResource: MCPResource<In>
385
+ export const wireMCPResource = <In>(
386
+ mcpResource: MCPResourceWiring<In>
387
387
  ) => {
388
- addCoreMCPResource(mcpResource as any)
388
+ wireMCPResourceCore(mcpResource as any)
389
389
  }
390
390
 
391
391
  /**
@@ -395,10 +395,10 @@ export const addMCPResource = <In>(
395
395
  * @template In - Input type for the tool invocation
396
396
  * @param mcpTool - MCP tool definition with action function
397
397
  */
398
- export const addMCPTool = <In>(
399
- mcpTool: MCPTool<In>
398
+ export const wireMCPTool = <In>(
399
+ mcpTool: MCPToolWiring<In>
400
400
  ) => {
401
- addCoreMCPTool(mcpTool as any)
401
+ wireMCPToolCore(mcpTool as any)
402
402
  }
403
403
 
404
404
  /**
@@ -408,10 +408,10 @@ export const addMCPTool = <In>(
408
408
  * @template In - Input type for the prompt parameters
409
409
  * @param mcpPrompt - MCP prompt definition with template function
410
410
  */
411
- export const addMCPPrompt = <In>(
412
- mcpPrompt: MCPPrompt<In>
411
+ export const wireMCPPrompt = <In>(
412
+ mcpPrompt: MCPPromptWiring<In>
413
413
  ) => {
414
- addCoreMCPPrompt(mcpPrompt as any)
414
+ wireMCPPromptCore(mcpPrompt as any)
415
415
  }
416
416
 
417
417
  /**
@@ -439,9 +439,9 @@ export const addMCPPrompt = <In>(
439
439
  */
440
440
  export const pikkuMCPPromptFunc = <In>(
441
441
  func:
442
- | APIFunctionSessionless<In, MCPPromptResponse>
442
+ | PikkuFunctionSessionless<In, MCPPromptResponse>
443
443
  | {
444
- func: APIFunctionSessionless<In, MCPPromptResponse>
444
+ func: PikkuFunctionSessionless<In, MCPPromptResponse>
445
445
  name?: string
446
446
  }
447
447
  ) => {
@@ -471,9 +471,9 @@ export const pikkuMCPPromptFunc = <In>(
471
471
  */
472
472
  export const pikkuMCPToolFunc = <In>(
473
473
  func:
474
- | APIFunctionSessionless<In, MCPToolResponse, null, true>
474
+ | PikkuFunctionSessionless<In, MCPToolResponse, null, true>
475
475
  | {
476
- func: APIFunctionSessionless<In, MCPToolResponse, null, true>
476
+ func: PikkuFunctionSessionless<In, MCPToolResponse, null, true>
477
477
  name?: string
478
478
  }
479
479
  ) => {
@@ -504,9 +504,9 @@ export const pikkuMCPToolFunc = <In>(
504
504
  */
505
505
  export const pikkuMCPResourceFunc = <In>(
506
506
  func:
507
- | APIFunctionSessionless<In, MCPResourceResponse, null, true>
507
+ | PikkuFunctionSessionless<In, MCPResourceResponse, null, true>
508
508
  | {
509
- func: APIFunctionSessionless<In, MCPResourceResponse, null, true>
509
+ func: PikkuFunctionSessionless<In, MCPResourceResponse, null, true>
510
510
  name?: string
511
511
  }
512
512
  ) => {
@@ -0,0 +1,2 @@
1
+ import { PikkuCommand } from '../../types.js';
2
+ export declare const pikkuChannels: PikkuCommand;