@pikku/cli 0.8.3 → 0.9.1

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 (159) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/bin/pikku-all.ts +47 -33
  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 +38 -33
  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/src/inspector-glob.js +2 -2
  14. package/dist/src/pikku-cli-config.d.ts +17 -17
  15. package/dist/src/pikku-cli-config.js +31 -31
  16. package/dist/src/runtimes/nextjs/pikku-command-nextjs.js +3 -3
  17. package/dist/src/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +29 -29
  18. package/dist/src/runtimes/nextjs/serialize-nextjs-http-wrapper.js +28 -28
  19. package/dist/src/schema-generator.d.ts +2 -2
  20. package/dist/src/schema-generator.js +2 -2
  21. package/dist/src/serialize-pikku-types.js +67 -67
  22. package/dist/src/utils.d.ts +5 -1
  23. package/dist/src/utils.js +17 -6
  24. package/dist/src/wirings/channels/pikku-channels.js +9 -0
  25. package/dist/src/wirings/channels/pikku-command-channels.js +9 -0
  26. package/dist/src/{events → wirings}/channels/serialize-typed-channel-map.js +3 -3
  27. package/dist/src/{events → wirings}/channels/serialize-websocket-wrapper.js +19 -5
  28. package/dist/src/{events → wirings}/fetch/index.js +2 -2
  29. package/dist/src/{events → wirings}/http/openapi-spec-generator.d.ts +2 -2
  30. package/dist/src/wirings/http/pikku-command-http-map.js +8 -0
  31. package/dist/src/{events → wirings}/http/pikku-command-http-routes.js +3 -3
  32. package/dist/src/{events → wirings}/http/pikku-http-routes.js +3 -3
  33. package/dist/src/wirings/http/serialize-fetch-wrapper.js +67 -0
  34. package/dist/src/wirings/http/serialize-typed-http-map.d.ts +4 -0
  35. package/dist/src/{events → wirings}/http/serialize-typed-http-map.js +13 -13
  36. package/dist/src/{events → wirings}/mcp/pikku-command-mcp.js +3 -3
  37. package/dist/src/wirings/queue/pikku-command-queue-service.js +15 -0
  38. package/dist/src/{events → wirings}/queue/pikku-command-queue.js +3 -3
  39. package/dist/src/{events → wirings}/queue/pikku-queue.js +3 -3
  40. package/dist/src/wirings/rpc/pikku-command-rpc-client.js +15 -0
  41. package/dist/src/wirings/rpc/pikku-command-rpc.js +6 -0
  42. package/dist/src/wirings/rpc/pikku-rpc.js +6 -0
  43. package/dist/src/wirings/rpc/serialize-rpc-wrapper.js +68 -0
  44. package/dist/src/{events → wirings}/scheduler/pikku-command-scheduler.js +3 -3
  45. package/dist/tsconfig.tsbuildinfo +1 -1
  46. package/package.json +3 -3
  47. package/src/inspector-glob.ts +2 -2
  48. package/src/pikku-cli-config.ts +67 -52
  49. package/src/runtimes/nextjs/pikku-command-nextjs.ts +3 -3
  50. package/src/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +29 -29
  51. package/src/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +28 -28
  52. package/src/schema-generator.ts +3 -3
  53. package/src/serialize-pikku-types.ts +67 -67
  54. package/src/utils.ts +26 -6
  55. package/src/{events → wirings}/channels/pikku-channels.ts +5 -4
  56. package/src/{events → wirings}/channels/pikku-command-channels.ts +5 -4
  57. package/src/{events → wirings}/channels/serialize-typed-channel-map.ts +3 -3
  58. package/src/{events → wirings}/channels/serialize-websocket-wrapper.ts +19 -5
  59. package/src/{events → wirings}/fetch/index.ts +2 -2
  60. package/src/{events → wirings}/http/openapi-spec-generator.ts +3 -3
  61. package/src/{events → wirings}/http/pikku-command-http-map.ts +5 -5
  62. package/src/{events → wirings}/http/pikku-command-http-routes.ts +5 -5
  63. package/src/{events → wirings}/http/pikku-http-routes.ts +5 -5
  64. package/src/wirings/http/serialize-fetch-wrapper.ts +67 -0
  65. package/src/{events → wirings}/http/serialize-typed-http-map.ts +17 -17
  66. package/src/{events → wirings}/mcp/pikku-command-mcp.ts +5 -5
  67. package/src/{events → wirings}/queue/pikku-command-queue-service.ts +9 -6
  68. package/src/{events → wirings}/queue/pikku-command-queue.ts +8 -5
  69. package/src/{events → wirings}/queue/pikku-queue.ts +8 -5
  70. package/src/{events → wirings}/rpc/pikku-command-rpc-client.ts +9 -6
  71. package/src/{events → wirings}/rpc/pikku-command-rpc.ts +2 -2
  72. package/src/{events → wirings}/rpc/pikku-rpc.ts +2 -2
  73. package/src/wirings/rpc/serialize-rpc-wrapper.ts +68 -0
  74. package/src/{events → wirings}/scheduler/pikku-command-scheduler.ts +8 -4
  75. package/dist/src/events/channels/pikku-channels.js +0 -9
  76. package/dist/src/events/channels/pikku-command-channels.js +0 -9
  77. package/dist/src/events/http/pikku-command-http-map.js +0 -8
  78. package/dist/src/events/http/serialize-fetch-wrapper.js +0 -67
  79. package/dist/src/events/http/serialize-typed-http-map.d.ts +0 -4
  80. package/dist/src/events/queue/pikku-command-queue-service.js +0 -12
  81. package/dist/src/events/rpc/pikku-command-rpc-client.js +0 -12
  82. package/dist/src/events/rpc/pikku-command-rpc.js +0 -6
  83. package/dist/src/events/rpc/pikku-rpc.js +0 -6
  84. package/dist/src/events/rpc/serialize-rpc-wrapper.js +0 -29
  85. package/src/events/http/serialize-fetch-wrapper.ts +0 -67
  86. package/src/events/rpc/serialize-rpc-wrapper.ts +0 -29
  87. /package/dist/src/{events → wirings}/channels/pikku-channels.d.ts +0 -0
  88. /package/dist/src/{events → wirings}/channels/pikku-command-channels-map.d.ts +0 -0
  89. /package/dist/src/{events → wirings}/channels/pikku-command-channels-map.js +0 -0
  90. /package/dist/src/{events → wirings}/channels/pikku-command-channels.d.ts +0 -0
  91. /package/dist/src/{events → wirings}/channels/pikku-command-websocket-typed.d.ts +0 -0
  92. /package/dist/src/{events → wirings}/channels/pikku-command-websocket-typed.js +0 -0
  93. /package/dist/src/{events → wirings}/channels/serialize-typed-channel-map.d.ts +0 -0
  94. /package/dist/src/{events → wirings}/channels/serialize-websocket-wrapper.d.ts +0 -0
  95. /package/dist/src/{events → wirings}/fetch/index.d.ts +0 -0
  96. /package/dist/src/{events → wirings}/functions/pikku-command-function-types.d.ts +0 -0
  97. /package/dist/src/{events → wirings}/functions/pikku-command-function-types.js +0 -0
  98. /package/dist/src/{events → wirings}/functions/pikku-command-functions.d.ts +0 -0
  99. /package/dist/src/{events → wirings}/functions/pikku-command-functions.js +0 -0
  100. /package/dist/src/{events → wirings}/functions/pikku-command-services.d.ts +0 -0
  101. /package/dist/src/{events → wirings}/functions/pikku-command-services.js +0 -0
  102. /package/dist/src/{events → wirings}/functions/pikku-function-types.d.ts +0 -0
  103. /package/dist/src/{events → wirings}/functions/pikku-function-types.js +0 -0
  104. /package/dist/src/{events → wirings}/functions/pikku-functions.d.ts +0 -0
  105. /package/dist/src/{events → wirings}/functions/pikku-functions.js +0 -0
  106. /package/dist/src/{events → wirings}/http/openapi-spec-generator.js +0 -0
  107. /package/dist/src/{events → wirings}/http/pikku-command-http-map.d.ts +0 -0
  108. /package/dist/src/{events → wirings}/http/pikku-command-http-routes.d.ts +0 -0
  109. /package/dist/src/{events → wirings}/http/pikku-command-openapi.d.ts +0 -0
  110. /package/dist/src/{events → wirings}/http/pikku-command-openapi.js +0 -0
  111. /package/dist/src/{events → wirings}/http/pikku-http-routes.d.ts +0 -0
  112. /package/dist/src/{events → wirings}/http/serialize-fetch-wrapper.d.ts +0 -0
  113. /package/dist/src/{events → wirings}/mcp/pikku-command-mcp-json.d.ts +0 -0
  114. /package/dist/src/{events → wirings}/mcp/pikku-command-mcp-json.js +0 -0
  115. /package/dist/src/{events → wirings}/mcp/pikku-command-mcp.d.ts +0 -0
  116. /package/dist/src/{events → wirings}/mcp/serialize-mcp-json.d.ts +0 -0
  117. /package/dist/src/{events → wirings}/mcp/serialize-mcp-json.js +0 -0
  118. /package/dist/src/{events → wirings}/queue/pikku-command-queue-map.d.ts +0 -0
  119. /package/dist/src/{events → wirings}/queue/pikku-command-queue-map.js +0 -0
  120. /package/dist/src/{events → wirings}/queue/pikku-command-queue-service.d.ts +0 -0
  121. /package/dist/src/{events → wirings}/queue/pikku-command-queue.d.ts +0 -0
  122. /package/dist/src/{events → wirings}/queue/pikku-queue-map.d.ts +0 -0
  123. /package/dist/src/{events → wirings}/queue/pikku-queue-map.js +0 -0
  124. /package/dist/src/{events → wirings}/queue/pikku-queue.d.ts +0 -0
  125. /package/dist/src/{events → wirings}/queue/serialize-queue-map.d.ts +0 -0
  126. /package/dist/src/{events → wirings}/queue/serialize-queue-map.js +0 -0
  127. /package/dist/src/{events → wirings}/queue/serialize-queue-meta.d.ts +0 -0
  128. /package/dist/src/{events → wirings}/queue/serialize-queue-meta.js +0 -0
  129. /package/dist/src/{events → wirings}/queue/serialize-queue-wrapper.d.ts +0 -0
  130. /package/dist/src/{events → wirings}/queue/serialize-queue-wrapper.js +0 -0
  131. /package/dist/src/{events → wirings}/rpc/pikku-command-rpc-client.d.ts +0 -0
  132. /package/dist/src/{events → wirings}/rpc/pikku-command-rpc-map.d.ts +0 -0
  133. /package/dist/src/{events → wirings}/rpc/pikku-command-rpc-map.js +0 -0
  134. /package/dist/src/{events → wirings}/rpc/pikku-command-rpc.d.ts +0 -0
  135. /package/dist/src/{events → wirings}/rpc/pikku-rpc.d.ts +0 -0
  136. /package/dist/src/{events → wirings}/rpc/serialize-rpc-wrapper.d.ts +0 -0
  137. /package/dist/src/{events → wirings}/rpc/serialize-typed-rpc-map.d.ts +0 -0
  138. /package/dist/src/{events → wirings}/rpc/serialize-typed-rpc-map.js +0 -0
  139. /package/dist/src/{events → wirings}/scheduler/pikku-command-scheduler.d.ts +0 -0
  140. /package/dist/src/{events → wirings}/scheduler/serialize-scheduler-meta.d.ts +0 -0
  141. /package/dist/src/{events → wirings}/scheduler/serialize-scheduler-meta.js +0 -0
  142. /package/src/{events → wirings}/channels/pikku-command-channels-map.ts +0 -0
  143. /package/src/{events → wirings}/channels/pikku-command-websocket-typed.ts +0 -0
  144. /package/src/{events → wirings}/functions/pikku-command-function-types.ts +0 -0
  145. /package/src/{events → wirings}/functions/pikku-command-functions.ts +0 -0
  146. /package/src/{events → wirings}/functions/pikku-command-services.ts +0 -0
  147. /package/src/{events → wirings}/functions/pikku-function-types.ts +0 -0
  148. /package/src/{events → wirings}/functions/pikku-functions.ts +0 -0
  149. /package/src/{events → wirings}/http/pikku-command-openapi.ts +0 -0
  150. /package/src/{events → wirings}/mcp/pikku-command-mcp-json.ts +0 -0
  151. /package/src/{events → wirings}/mcp/serialize-mcp-json.ts +0 -0
  152. /package/src/{events → wirings}/queue/pikku-command-queue-map.ts +0 -0
  153. /package/src/{events → wirings}/queue/pikku-queue-map.ts +0 -0
  154. /package/src/{events → wirings}/queue/serialize-queue-map.ts +0 -0
  155. /package/src/{events → wirings}/queue/serialize-queue-meta.ts +0 -0
  156. /package/src/{events → wirings}/queue/serialize-queue-wrapper.ts +0 -0
  157. /package/src/{events → wirings}/rpc/pikku-command-rpc-map.ts +0 -0
  158. /package/src/{events → wirings}/rpc/serialize-typed-rpc-map.ts +0 -0
  159. /package/src/{events → wirings}/scheduler/serialize-scheduler-meta.ts +0 -0
@@ -12,7 +12,7 @@ export const serializeNextJsBackendWrapper = (
12
12
  * It ensures type safety for route handling methods when integrating with the @pikku/core framework.
13
13
  */
14
14
  import { PikkuNextJS } from '@pikku/next'
15
- import type { RoutesMap, RouteHandlerOf, RoutesWithMethod } from '${routesMapPath}'
15
+ import type { HTTPWiringsMap, HTTPWiringHandlerOf, HTTPWiringsWithMethod } from '${routesMapPath}'
16
16
 
17
17
  ${configImport}
18
18
  ${singleServicesFactoryImport}
@@ -40,7 +40,7 @@ export const pikku = (_options?: any) => {
40
40
  * Makes a dynamic action request for a specified route and method.
41
41
  * Dynamic requests may access headers and cookies and are therefore unsuitable for precompile stages.
42
42
  *
43
- * @template Route - The route key from the RoutesMap.
43
+ * @template Route - The route key from the HTTPWiringsMap.
44
44
  * @template Method - The method key from the specified route.
45
45
  * @param route - The route identifier.
46
46
  * @param method - The HTTP method to be used for the request.
@@ -48,13 +48,13 @@ export const pikku = (_options?: any) => {
48
48
  * @returns A promise that resolves to the output of the route handler.
49
49
  */
50
50
  const dynamicActionRequest = async <
51
- Route extends keyof RoutesMap,
52
- Method extends keyof RoutesMap[Route]
51
+ Route extends keyof HTTPWiringsMap,
52
+ Method extends keyof HTTPWiringsMap[Route]
53
53
  >(
54
54
  route: Route,
55
55
  method: Method,
56
- data: RouteHandlerOf<Route, Method>['input'] = null
57
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
56
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
57
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
58
58
  return _pikku!.actionRequest(route, method, data as any)
59
59
  }
60
60
 
@@ -62,7 +62,7 @@ export const pikku = (_options?: any) => {
62
62
  * Makes a static action request for a specified route and method.
63
63
  * Static requests do not depend on headers or cookies and are suitable for precompile stages.
64
64
  *
65
- * @template Route - The route key from the RoutesMap.
65
+ * @template Route - The route key from the HTTPWiringsMap.
66
66
  * @template Method - The method key from the specified route.
67
67
  * @param route - The route identifier.
68
68
  * @param method - The HTTP method to be used for the request.
@@ -70,13 +70,13 @@ export const pikku = (_options?: any) => {
70
70
  * @returns A promise that resolves to the output of the route handler.
71
71
  */
72
72
  const staticActionRequest = async <
73
- Route extends keyof RoutesMap,
74
- Method extends keyof RoutesMap[Route]
73
+ Route extends keyof HTTPWiringsMap,
74
+ Method extends keyof HTTPWiringsMap[Route]
75
75
  >(
76
76
  route: Route,
77
77
  method: Method,
78
- data: RouteHandlerOf<Route, Method>['input'] = null
79
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
78
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
79
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
80
80
  return _pikku!.staticActionRequest(route, method, data as any)
81
81
  }
82
82
 
@@ -88,10 +88,10 @@ export const pikku = (_options?: any) => {
88
88
  * @param data - The input data for the POST request, defaults to null.
89
89
  * @returns A promise that resolves to the output of the POST handler.
90
90
  */
91
- const dynamicPost = <Route extends RoutesWithMethod<'POST'>>(
91
+ const dynamicPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
92
92
  route: Route,
93
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
94
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
93
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
94
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
95
95
  return dynamicActionRequest(route, 'POST', data)
96
96
  }
97
97
 
@@ -103,10 +103,10 @@ export const pikku = (_options?: any) => {
103
103
  * @param data - The input data for the GET request, defaults to null.
104
104
  * @returns A promise that resolves to the output of the GET handler.
105
105
  */
106
- const dynamicGet = <Route extends RoutesWithMethod<'GET'>>(
106
+ const dynamicGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
107
107
  route: Route,
108
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
109
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
108
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
109
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
110
110
  return dynamicActionRequest(route, 'GET', data)
111
111
  }
112
112
 
@@ -118,10 +118,10 @@ export const pikku = (_options?: any) => {
118
118
  * @param data - The input data for the PATCH request, defaults to null.
119
119
  * @returns A promise that resolves to the output of the PATCH handler.
120
120
  */
121
- const dynamicPatch = <Route extends RoutesWithMethod<'PATCH'>>(
121
+ const dynamicPatch = <Route extends HTTPWiringsWithMethod<'PATCH'>>(
122
122
  route: Route,
123
- data: RouteHandlerOf<Route, 'PATCH'>['input'] = null
124
- ): Promise<RouteHandlerOf<Route, 'PATCH'>['output']> => {
123
+ data: HTTPWiringHandlerOf<Route, 'PATCH'>['input'] = null
124
+ ): Promise<HTTPWiringHandlerOf<Route, 'PATCH'>['output']> => {
125
125
  return dynamicActionRequest(route, 'PATCH', data)
126
126
  }
127
127
 
@@ -133,10 +133,10 @@ export const pikku = (_options?: any) => {
133
133
  * @param data - The input data for the DELETE request, defaults to null.
134
134
  * @returns A promise that resolves to the output of the DELETE handler.
135
135
  */
136
- const dynamicDel = <Route extends RoutesWithMethod<'DELETE'>>(
136
+ const dynamicDel = <Route extends HTTPWiringsWithMethod<'DELETE'>>(
137
137
  route: Route,
138
- data: RouteHandlerOf<Route, 'DELETE'>['input'] = null
139
- ): Promise<RouteHandlerOf<Route, 'DELETE'>['output']> => {
138
+ data: HTTPWiringHandlerOf<Route, 'DELETE'>['input'] = null
139
+ ): Promise<HTTPWiringHandlerOf<Route, 'DELETE'>['output']> => {
140
140
  return dynamicActionRequest(route, 'DELETE', data)
141
141
  }
142
142
 
@@ -150,10 +150,10 @@ export const pikku = (_options?: any) => {
150
150
  * @param data - The input data for the POST request, defaults to null.
151
151
  * @returns A promise that resolves to the output of the POST handler.
152
152
  */
153
- const staticPost = <Route extends RoutesWithMethod<'POST'>>(
153
+ const staticPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
154
154
  route: Route,
155
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
156
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
155
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
156
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
157
157
  return staticActionRequest(route, 'POST', data)
158
158
  }
159
159
 
@@ -165,10 +165,10 @@ export const pikku = (_options?: any) => {
165
165
  * @param data - The input data for the GET request, defaults to null.
166
166
  * @returns A promise that resolves to the output of the GET handler.
167
167
  */
168
- const staticGet = <Route extends RoutesWithMethod<'GET'>>(
168
+ const staticGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
169
169
  route: Route,
170
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
171
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
170
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
171
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
172
172
  return staticActionRequest(route, 'GET', data)
173
173
  }
174
174
 
@@ -9,7 +9,7 @@ export const serializeNextJsHTTPWrapper = (
9
9
  * It ensures type safety for route handling methods when integrating with the @pikku/core framework.
10
10
  */
11
11
  import { CorePikkuFetchOptions } from '@pikku/fetch'
12
- import type { RoutesMap, RouteHandlerOf, RoutesWithMethod } from '${routesMapPath}'
12
+ import type { HTTPWiringsMap, HTTPWiringHandlerOf, HTTPWiringsWithMethod } from '${routesMapPath}'
13
13
  import { PikkuFetch } from '${pikkuFetchImport}'
14
14
 
15
15
  let _pikku: PikkuFetch | undefined
@@ -25,13 +25,13 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
25
25
  }
26
26
 
27
27
  const dynamicActionRequest = async <
28
- Route extends keyof RoutesMap,
29
- Method extends keyof RoutesMap[Route]
28
+ Route extends keyof HTTPWiringsMap,
29
+ Method extends keyof HTTPWiringsMap[Route]
30
30
  >(
31
31
  route: Route,
32
32
  method: Method,
33
- data: RouteHandlerOf<Route, Method>['input'] = null
34
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
33
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
34
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
35
35
  return (_pikku! as any)[(method as string).toLowerCase()](route, data as any)
36
36
  }
37
37
 
@@ -39,7 +39,7 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
39
39
  * Makes a static action request for a specified route and method.
40
40
  * Static requests do not depend on headers or cookies and are suitable for precompile stages.
41
41
  *
42
- * @template Route - The route key from the RoutesMap.
42
+ * @template Route - The route key from the HTTPWiringsMap.
43
43
  * @template Method - The method key from the specified route.
44
44
  * @param route - The route identifier.
45
45
  * @param method - The HTTP method to be used for the request.
@@ -47,13 +47,13 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
47
47
  * @returns A promise that resolves to the output of the route handler.
48
48
  */
49
49
  const staticActionRequest = async <
50
- Route extends keyof RoutesMap,
51
- Method extends keyof RoutesMap[Route]
50
+ Route extends keyof HTTPWiringsMap,
51
+ Method extends keyof HTTPWiringsMap[Route]
52
52
  >(
53
53
  route: Route,
54
54
  method: Method,
55
- data: RouteHandlerOf<Route, Method>['input'] = null
56
- ): Promise<RouteHandlerOf<Route, Method>['output']> => {
55
+ data: HTTPWiringHandlerOf<Route, Method>['input'] = null
56
+ ): Promise<HTTPWiringHandlerOf<Route, Method>['output']> => {
57
57
  return (_pikku! as any)[(method as string).toLowerCase()](route, data as any)
58
58
  }
59
59
 
@@ -65,10 +65,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
65
65
  * @param data - The input data for the POST request, defaults to null.
66
66
  * @returns A promise that resolves to the output of the POST handler.
67
67
  */
68
- const dynamicPost = <Route extends RoutesWithMethod<'POST'>>(
68
+ const dynamicPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
69
69
  route: Route,
70
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
71
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
70
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
71
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
72
72
  return dynamicActionRequest(route, 'POST', data)
73
73
  }
74
74
 
@@ -80,10 +80,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
80
80
  * @param data - The input data for the GET request, defaults to null.
81
81
  * @returns A promise that resolves to the output of the GET handler.
82
82
  */
83
- const dynamicGet = <Route extends RoutesWithMethod<'GET'>>(
83
+ const dynamicGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
84
84
  route: Route,
85
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
86
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
85
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
86
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
87
87
  return dynamicActionRequest(route, 'GET', data)
88
88
  }
89
89
 
@@ -95,10 +95,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
95
95
  * @param data - The input data for the PATCH request, defaults to null.
96
96
  * @returns A promise that resolves to the output of the PATCH handler.
97
97
  */
98
- const dynamicPatch = <Route extends RoutesWithMethod<'PATCH'>>(
98
+ const dynamicPatch = <Route extends HTTPWiringsWithMethod<'PATCH'>>(
99
99
  route: Route,
100
- data: RouteHandlerOf<Route, 'PATCH'>['input'] = null
101
- ): Promise<RouteHandlerOf<Route, 'PATCH'>['output']> => {
100
+ data: HTTPWiringHandlerOf<Route, 'PATCH'>['input'] = null
101
+ ): Promise<HTTPWiringHandlerOf<Route, 'PATCH'>['output']> => {
102
102
  return dynamicActionRequest(route, 'PATCH', data)
103
103
  }
104
104
 
@@ -110,10 +110,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
110
110
  * @param data - The input data for the DELETE request, defaults to null.
111
111
  * @returns A promise that resolves to the output of the DELETE handler.
112
112
  */
113
- const dynamicDel = <Route extends RoutesWithMethod<'DELETE'>>(
113
+ const dynamicDel = <Route extends HTTPWiringsWithMethod<'DELETE'>>(
114
114
  route: Route,
115
- data: RouteHandlerOf<Route, 'DELETE'>['input'] = null
116
- ): Promise<RouteHandlerOf<Route, 'DELETE'>['output']> => {
115
+ data: HTTPWiringHandlerOf<Route, 'DELETE'>['input'] = null
116
+ ): Promise<HTTPWiringHandlerOf<Route, 'DELETE'>['output']> => {
117
117
  return dynamicActionRequest(route, 'DELETE', data)
118
118
  }
119
119
 
@@ -127,10 +127,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
127
127
  * @param data - The input data for the POST request, defaults to null.
128
128
  * @returns A promise that resolves to the output of the POST handler.
129
129
  */
130
- const staticPost = <Route extends RoutesWithMethod<'POST'>>(
130
+ const staticPost = <Route extends HTTPWiringsWithMethod<'POST'>>(
131
131
  route: Route,
132
- data: RouteHandlerOf<Route, 'POST'>['input'] = null
133
- ): Promise<RouteHandlerOf<Route, 'POST'>['output']> => {
132
+ data: HTTPWiringHandlerOf<Route, 'POST'>['input'] = null
133
+ ): Promise<HTTPWiringHandlerOf<Route, 'POST'>['output']> => {
134
134
  return staticActionRequest(route, 'POST', data)
135
135
  }
136
136
 
@@ -142,10 +142,10 @@ export const pikku = (options?: CorePikkuFetchOptions) => {
142
142
  * @param data - The input data for the GET request, defaults to null.
143
143
  * @returns A promise that resolves to the output of the GET handler.
144
144
  */
145
- const staticGet = <Route extends RoutesWithMethod<'GET'>>(
145
+ const staticGet = <Route extends HTTPWiringsWithMethod<'GET'>>(
146
146
  route: Route,
147
- data: RouteHandlerOf<Route, 'GET'>['input'] = null
148
- ): Promise<RouteHandlerOf<Route, 'GET'>['output']> => {
147
+ data: HTTPWiringHandlerOf<Route, 'GET'>['input'] = null
148
+ ): Promise<HTTPWiringHandlerOf<Route, 'GET'>['output']> => {
149
149
  return staticActionRequest(route, 'GET', data)
150
150
  }
151
151
 
@@ -2,7 +2,7 @@ import { createGenerator, RootlessError } from 'ts-json-schema-generator'
2
2
  import { CLILogger, writeFileInDir } from './utils.js'
3
3
  import { mkdir, writeFile } from 'fs/promises'
4
4
  import { FunctionsMeta, JSONValue } from '@pikku/core'
5
- import { HTTPRoutesMeta } from '@pikku/core/http'
5
+ import { HTTPWiringsMeta } from '@pikku/core/http'
6
6
  import { TypesMap } from '@pikku/inspector'
7
7
 
8
8
  export async function generateSchemas(
@@ -10,7 +10,7 @@ export async function generateSchemas(
10
10
  tsconfig: string,
11
11
  typesMap: TypesMap,
12
12
  functionMeta: FunctionsMeta,
13
- httpRoutesMeta: HTTPRoutesMeta
13
+ httpWiringsMeta: HTTPWiringsMeta
14
14
  ): Promise<Record<string, JSONValue>> {
15
15
  const schemasSet = new Set(typesMap.customTypes.keys())
16
16
  for (const { inputs, outputs } of Object.values(functionMeta)) {
@@ -22,7 +22,7 @@ export async function generateSchemas(
22
22
  }
23
23
  }
24
24
  }
25
- for (const { inputTypes } of httpRoutesMeta) {
25
+ for (const { inputTypes } of httpWiringsMeta) {
26
26
  if (inputTypes?.body) {
27
27
  schemasSet.add(inputTypes.body)
28
28
  }
@@ -13,13 +13,13 @@ export const serializePikkuTypes = (
13
13
  * This is used to provide the application types in the typescript project
14
14
  */
15
15
 
16
- import { CoreAPIPermission, PikkuMiddleware } from '@pikku/core'
17
- import { CoreAPIFunction, CoreAPIFunctionSessionless } from '@pikku/core/function'
18
- import { CoreHTTPFunctionRoute, AssertRouteParams, addHTTPRoute as addCoreHTTPRoute } from '@pikku/core/http'
19
- import { CoreScheduledTask, addScheduledTask as addCoreScheduledTask } from '@pikku/core/scheduler'
20
- import { CoreAPIChannel, PikkuChannel, addChannel as addCoreChannel } from '@pikku/core/channel'
21
- import { CoreQueueWorker, addQueueWorker as addCoreQueueWorker } from '@pikku/core/queue'
22
- import { CoreMCPResource, CoreMCPTool, CoreMCPPrompt, addMCPResource as addCoreMCPResource, addMCPTool as addCoreMCPTool, addMCPPrompt as addCoreMCPPrompt, MCPResourceResponse, MCPToolResponse, MCPPromptResponse, PikkuMCP } from '@pikku/core'
16
+ import { CorePikkuPermission, PikkuMiddleware } from '@pikku/core'
17
+ import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function'
18
+ import { CoreHTTPFunctionWiring, AssertHTTPWiringParams, wireHTTP as wireHTTPCore } from '@pikku/core/http'
19
+ import { CoreScheduledTask, wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler'
20
+ import { CoreChannel, PikkuChannel, wireChannel as wireChannelCore } from '@pikku/core/channel'
21
+ import { CoreQueueWorker, wireQueueWorker as wireQueueWorkerCore } from '@pikku/core/queue'
22
+ import { CoreMCPResource, CoreMCPTool, CoreMCPPrompt, wireMCPResource as wireMCPResourceCore, wireMCPTool as wireMCPToolCore, wireMCPPrompt as wireMCPPromptCore, MCPResourceResponse, MCPToolResponse, MCPPromptResponse, PikkuMCP } from '@pikku/core'
23
23
 
24
24
  ${userSessionTypeImport}
25
25
  ${singletonServicesTypeImport}
@@ -33,11 +33,11 @@ ${rpcMapTypeImport}
33
33
  * @template In - The input type that the permission check will receive
34
34
  * @template RequiredServices - The services required for this permission check
35
35
  */
36
- export type APIPermission<In = unknown, RequiredServices extends ${singletonServicesTypeName} = ${singletonServicesTypeName}> = CoreAPIPermission<In, RequiredServices, ${userSessionTypeName}>
36
+ export type PikkuPermission<In = unknown, RequiredServices extends ${singletonServicesTypeName} = ${singletonServicesTypeName}> = CorePikkuPermission<In, RequiredServices, ${userSessionTypeName}>
37
37
 
38
38
  /**
39
39
  * Type-safe middleware definition that can access your application's services and session.
40
- * Use this to define reusable middleware that can be applied to multiple routes.
40
+ * Use this to define reusable middleware that can be applied to multiple HTTP wirings.
41
41
  *
42
42
  * @template RequiredServices - The services required for this middleware
43
43
  */
@@ -53,7 +53,7 @@ export type APIMiddleware<RequiredServices extends ${singletonServicesTypeName}
53
53
  * @template MCPData - MCP data type (null = optional MCP)
54
54
  * @template RequiredServices - Services required by this function
55
55
  */
56
- type APIFunctionSessionless<
56
+ type PikkuFunctionSessionless<
57
57
  In = unknown,
58
58
  Out = never,
59
59
  ChannelData = null, // null means optional channel
@@ -67,7 +67,7 @@ type APIFunctionSessionless<
67
67
  ? { mcp?: PikkuMCP } // Optional MCP
68
68
  : { mcp: PikkuMCP } // Required MCP
69
69
  )
70
- > = CoreAPIFunctionSessionless<In, Out, ChannelData, RequiredServices, ${userSessionTypeName}>
70
+ > = CorePikkuFunctionSessionless<In, Out, ChannelData, RequiredServices, ${userSessionTypeName}>
71
71
 
72
72
  /**
73
73
  * A session-aware API function that requires user authentication.
@@ -79,7 +79,7 @@ type APIFunctionSessionless<
79
79
  * @template MCPData - MCP data type (null = optional MCP)
80
80
  * @template RequiredServices - Services required by this function
81
81
  */
82
- type APIFunction<
82
+ type PikkuFunction<
83
83
  In = unknown,
84
84
  Out = never,
85
85
  ChannelData = null, // null means optional channel
@@ -93,17 +93,17 @@ type APIFunction<
93
93
  ? { mcp?: PikkuMCP } // Optional MCP
94
94
  : { mcp: PikkuMCP } // Required MCP
95
95
  )
96
- > = CoreAPIFunction<In, Out, ChannelData, RequiredServices, ${userSessionTypeName}>
96
+ > = CorePikkuFunction<In, Out, ChannelData, RequiredServices, ${userSessionTypeName}>
97
97
 
98
98
  /**
99
- * Type definition for HTTP API routes with type-safe path parameters.
99
+ * Type definition for HTTP API wirings with type-safe path parameters.
100
100
  * Supports both authenticated and unauthenticated functions.
101
101
  *
102
- * @template In - Input type for the route
103
- * @template Out - Output type for the route
104
- * @template Route - String literal type for the route path (e.g., "/users/:id")
102
+ * @template In - Input type for the HTTP wiring
103
+ * @template Out - Output type for the HTTP wiring
104
+ * @template Route - String literal type for the HTTP path (e.g., "/users/:id")
105
105
  */
106
- type APIRoute<In, Out, Route extends string> = CoreHTTPFunctionRoute<In, Out, Route, APIFunction<In, Out>, APIFunctionSessionless<In, Out>, APIPermission<In>, APIMiddleware>
106
+ type HTTPWiring<In, Out, Route extends string> = CoreHTTPFunctionWiring<In, Out, Route, PikkuFunction<In, Out>, PikkuFunctionSessionless<In, Out>, PikkuPermission<In>, APIMiddleware>
107
107
 
108
108
  /**
109
109
  * Type definition for WebSocket channels with typed data exchange.
@@ -112,13 +112,13 @@ type APIRoute<In, Out, Route extends string> = CoreHTTPFunctionRoute<In, Out, Ro
112
112
  * @template ChannelData - Type of data exchanged through the channel
113
113
  * @template Channel - String literal type for the channel name
114
114
  */
115
- 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>
115
+ 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>
116
116
 
117
117
  /**
118
118
  * Type definition for scheduled tasks that run at specified intervals.
119
119
  * These are sessionless functions that execute based on cron expressions.
120
120
  */
121
- type ScheduledTask = CoreScheduledTask<APIFunctionSessionless<void, void>>
121
+ type SchedulerWiring = CoreScheduledTask<PikkuFunctionSessionless<void, void>>
122
122
 
123
123
  /**
124
124
  * Type definition for queue workers that process background jobs.
@@ -126,28 +126,28 @@ type ScheduledTask = CoreScheduledTask<APIFunctionSessionless<void, void>>
126
126
  * @template In - Input type for the queue job
127
127
  * @template Out - Output type for the queue job
128
128
  */
129
- type QueueWorker<In, Out> = CoreQueueWorker<APIFunctionSessionless<In, Out>>
129
+ type QueueWiring<In, Out> = CoreQueueWorker<PikkuFunctionSessionless<In, Out>>
130
130
 
131
131
  /**
132
132
  * Type definition for MCP resources that provide data to AI models.
133
133
  *
134
134
  * @template In - Input type for the resource request
135
135
  */
136
- type MCPResource<In> = CoreMCPResource<APIFunctionSessionless<In, MCPResourceResponse, null, true>>
136
+ type MCPResourceWiring<In> = CoreMCPResource<PikkuFunctionSessionless<In, MCPResourceResponse, null, true>>
137
137
 
138
138
  /**
139
139
  * Type definition for MCP tools that AI models can invoke.
140
140
  *
141
141
  * @template In - Input type for the tool invocation
142
142
  */
143
- type MCPTool<In> = CoreMCPTool<APIFunctionSessionless<In, MCPToolResponse, null, true>>
143
+ type MCPToolWiring<In> = CoreMCPTool<PikkuFunctionSessionless<In, MCPToolResponse, null, true>>
144
144
 
145
145
  /**
146
146
  * Type definition for MCP prompts that provide templates to AI models.
147
147
  *
148
148
  * @template In - Input type for the prompt parameters
149
149
  */
150
- type MCPPrompt<In> = CoreMCPPrompt<APIFunctionSessionless<In, MCPPromptResponse, null, true>>
150
+ type MCPPromptWiring<In> = CoreMCPPrompt<PikkuFunctionSessionless<In, MCPPromptResponse, null, true>>
151
151
 
152
152
  /**
153
153
  * Creates a Pikku function that can be either session-aware or sessionless.
@@ -172,14 +172,14 @@ type MCPPrompt<In> = CoreMCPPrompt<APIFunctionSessionless<In, MCPPromptResponse,
172
172
  */
173
173
  export const pikkuFunc = <In, Out = unknown>(
174
174
  func:
175
- | APIFunction<In, Out>
175
+ | PikkuFunction<In, Out>
176
176
  | {
177
- func: APIFunction<In, Out>
177
+ func: PikkuFunction<In, Out>
178
178
  auth?: true
179
179
  name?: string
180
180
  }
181
181
  | {
182
- func: APIFunctionSessionless<In, Out>
182
+ func: PikkuFunctionSessionless<In, Out>
183
183
  auth: false
184
184
  name?: string
185
185
  }
@@ -209,9 +209,9 @@ export const pikkuFunc = <In, Out = unknown>(
209
209
  */
210
210
  export const pikkuSessionlessFunc = <In, Out = unknown>(
211
211
  func:
212
- | APIFunctionSessionless<In, Out>
212
+ | PikkuFunctionSessionless<In, Out>
213
213
  | {
214
- func: APIFunctionSessionless<In, Out>
214
+ func: PikkuFunctionSessionless<In, Out>
215
215
  name?: string
216
216
  }
217
217
  ) => {
@@ -240,9 +240,9 @@ export const pikkuSessionlessFunc = <In, Out = unknown>(
240
240
  */
241
241
  export const pikkuChannelConnectionFunc = <Out = unknown, ChannelData = unknown>(
242
242
  func:
243
- | APIFunctionSessionless<void, Out, ChannelData>
243
+ | PikkuFunctionSessionless<void, Out, ChannelData>
244
244
  | {
245
- func: APIFunctionSessionless<void, Out, ChannelData>
245
+ func: PikkuFunctionSessionless<void, Out, ChannelData>
246
246
  name?: string
247
247
  }
248
248
  ) => {
@@ -269,9 +269,9 @@ export const pikkuChannelConnectionFunc = <Out = unknown, ChannelData = unknown>
269
269
  */
270
270
  export const pikkuChannelDisconnectionFunc = <ChannelData = unknown>(
271
271
  func:
272
- | APIFunctionSessionless<void, void, ChannelData>
272
+ | PikkuFunctionSessionless<void, void, ChannelData>
273
273
  | {
274
- func: APIFunction<void, void, ChannelData>
274
+ func: PikkuFunction<void, void, ChannelData>
275
275
  name?: string
276
276
  }
277
277
  ) => {
@@ -299,9 +299,9 @@ export const pikkuChannelDisconnectionFunc = <ChannelData = unknown>(
299
299
  */
300
300
  export const pikkuChannelFunc = <In = unknown, Out = unknown, ChannelData = unknown>(
301
301
  func:
302
- | APIFunctionSessionless<In, Out, ChannelData>
302
+ | PikkuFunctionSessionless<In, Out, ChannelData>
303
303
  | {
304
- func: APIFunctionSessionless<In, Out, ChannelData>
304
+ func: PikkuFunctionSessionless<In, Out, ChannelData>
305
305
  name?: string
306
306
  }
307
307
  ) => {
@@ -326,9 +326,9 @@ export const pikkuChannelFunc = <In = unknown, Out = unknown, ChannelData = unkn
326
326
  */
327
327
  export const pikkuVoidFunc = (
328
328
  func:
329
- | APIFunctionSessionless<void, void>
329
+ | PikkuFunctionSessionless<void, void>
330
330
  | {
331
- func: APIFunctionSessionless<void, void>
331
+ func: PikkuFunctionSessionless<void, void>
332
332
  name?: string
333
333
  }
334
334
  ) => {
@@ -342,24 +342,24 @@ export const pikkuVoidFunc = (
342
342
  * @template Channel - String literal type for the channel name
343
343
  * @param channel - Channel definition with connection, disconnection, and message handlers
344
344
  */
345
- export const addChannel = <ChannelData, Channel extends string>(
346
- channel: APIChannel<ChannelData, Channel> & AssertRouteParams<ChannelData, Channel>
345
+ export const wireChannel = <ChannelData, Channel extends string>(
346
+ channel: ChannelWiring<ChannelData, Channel> & AssertHTTPWiringParams<ChannelData, Channel>
347
347
  ) => {
348
- addCoreChannel(channel as any) // TODO
348
+ wireChannelCore(channel as any) // TODO
349
349
  }
350
350
 
351
351
  /**
352
- * Registers an HTTP route with the Pikku framework.
352
+ * Registers an HTTP wiring with the Pikku framework.
353
353
  *
354
- * @template In - Input type for the route
355
- * @template Out - Output type for the route
356
- * @template Route - String literal type for the route path (e.g., "/users/:id")
357
- * @param route - Route definition with handler, method, and optional middleware
354
+ * @template In - Input type for the HTTP wiring
355
+ * @template Out - Output type for the HTTP wiring
356
+ * @template Route - String literal type for the HTTP path (e.g., "/users/:id")
357
+ * @param httpWiring - HTTP wiring definition with handler, method, and optional middleware
358
358
  */
359
- export const addHTTPRoute = <In, Out, Route extends string>(
360
- route: APIRoute<In, Out, Route> & AssertRouteParams<In, Route>
359
+ export const wireHTTP = <In, Out, Route extends string>(
360
+ httpWiring: HTTPWiring<In, Out, Route> & AssertHTTPWiringParams<In, Route>
361
361
  ) => {
362
- addCoreHTTPRoute(route)
362
+ wireHTTPCore(httpWiring)
363
363
  }
364
364
 
365
365
  /**
@@ -368,8 +368,8 @@ export const addHTTPRoute = <In, Out, Route extends string>(
368
368
  *
369
369
  * @param task - Scheduled task definition with cron expression and handler
370
370
  */
371
- export const addScheduledTask = (task: ScheduledTask) => {
372
- addCoreScheduledTask(task as any) // TODO
371
+ export const wireScheduler = (task: SchedulerWiring) => {
372
+ wireSchedulerCore(task as any) // TODO
373
373
  }
374
374
 
375
375
  /**
@@ -378,8 +378,8 @@ export const addScheduledTask = (task: ScheduledTask) => {
378
378
  *
379
379
  * @param queueWorker - Queue worker definition with job handler
380
380
  */
381
- export const addQueueWorker = (queueWorker: QueueWorker<any, any>) => {
382
- addCoreQueueWorker(queueWorker as any) // TODO
381
+ export const wireQueueWorker = (queueWorker: QueueWiring<any, any>) => {
382
+ wireQueueWorkerCore(queueWorker as any) // TODO
383
383
  }
384
384
 
385
385
  /**
@@ -389,10 +389,10 @@ export const addQueueWorker = (queueWorker: QueueWorker<any, any>) => {
389
389
  * @template In - Input type for the resource request
390
390
  * @param mcpResource - MCP resource definition with data provider function
391
391
  */
392
- export const addMCPResource = <In>(
393
- mcpResource: MCPResource<In>
392
+ export const wireMCPResource = <In>(
393
+ mcpResource: MCPResourceWiring<In>
394
394
  ) => {
395
- addCoreMCPResource(mcpResource as any)
395
+ wireMCPResourceCore(mcpResource as any)
396
396
  }
397
397
 
398
398
  /**
@@ -402,10 +402,10 @@ export const addMCPResource = <In>(
402
402
  * @template In - Input type for the tool invocation
403
403
  * @param mcpTool - MCP tool definition with action function
404
404
  */
405
- export const addMCPTool = <In>(
406
- mcpTool: MCPTool<In>
405
+ export const wireMCPTool = <In>(
406
+ mcpTool: MCPToolWiring<In>
407
407
  ) => {
408
- addCoreMCPTool(mcpTool as any)
408
+ wireMCPToolCore(mcpTool as any)
409
409
  }
410
410
 
411
411
  /**
@@ -415,10 +415,10 @@ export const addMCPTool = <In>(
415
415
  * @template In - Input type for the prompt parameters
416
416
  * @param mcpPrompt - MCP prompt definition with template function
417
417
  */
418
- export const addMCPPrompt = <In>(
419
- mcpPrompt: MCPPrompt<In>
418
+ export const wireMCPPrompt = <In>(
419
+ mcpPrompt: MCPPromptWiring<In>
420
420
  ) => {
421
- addCoreMCPPrompt(mcpPrompt as any)
421
+ wireMCPPromptCore(mcpPrompt as any)
422
422
  }
423
423
 
424
424
  /**
@@ -446,9 +446,9 @@ export const addMCPPrompt = <In>(
446
446
  */
447
447
  export const pikkuMCPPromptFunc = <In>(
448
448
  func:
449
- | APIFunctionSessionless<In, MCPPromptResponse>
449
+ | PikkuFunctionSessionless<In, MCPPromptResponse>
450
450
  | {
451
- func: APIFunctionSessionless<In, MCPPromptResponse>
451
+ func: PikkuFunctionSessionless<In, MCPPromptResponse>
452
452
  name?: string
453
453
  }
454
454
  ) => {
@@ -478,9 +478,9 @@ export const pikkuMCPPromptFunc = <In>(
478
478
  */
479
479
  export const pikkuMCPToolFunc = <In>(
480
480
  func:
481
- | APIFunctionSessionless<In, MCPToolResponse, null, true>
481
+ | PikkuFunctionSessionless<In, MCPToolResponse, null, true>
482
482
  | {
483
- func: APIFunctionSessionless<In, MCPToolResponse, null, true>
483
+ func: PikkuFunctionSessionless<In, MCPToolResponse, null, true>
484
484
  name?: string
485
485
  }
486
486
  ) => {
@@ -511,9 +511,9 @@ export const pikkuMCPToolFunc = <In>(
511
511
  */
512
512
  export const pikkuMCPResourceFunc = <In>(
513
513
  func:
514
- | APIFunctionSessionless<In, MCPResourceResponse, null, true>
514
+ | PikkuFunctionSessionless<In, MCPResourceResponse, null, true>
515
515
  | {
516
- func: APIFunctionSessionless<In, MCPResourceResponse, null, true>
516
+ func: PikkuFunctionSessionless<In, MCPResourceResponse, null, true>
517
517
  name?: string
518
518
  }
519
519
  ) => {