@pikku/addon-graph 0.0.2 → 0.12.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.
- package/.pikku/addon/pikku-addon-types.gen.ts +30 -3
- package/.pikku/addon/pikku-package.gen.ts +3 -1
- package/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
- package/.pikku/agent/pikku-agent-types.gen.ts +13 -7
- package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/.pikku/cli/pikku-cli-types.gen.ts +105 -0
- package/.pikku/console/pikku-addon-meta.gen.json +281 -0
- package/.pikku/console/pikku-node-types.gen.ts +2 -2
- package/.pikku/function/pikku-function-types.gen.ts +70 -34
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +274 -196
- package/.pikku/function/pikku-functions-meta.gen.json +160 -144
- package/.pikku/function/pikku-functions-meta.gen.ts +1 -1
- package/.pikku/function/pikku-functions.gen.ts +4 -2
- package/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/.pikku/pikku-bootstrap.gen.ts +2 -9
- package/.pikku/pikku-meta-service.gen.ts +10 -0
- package/.pikku/pikku-services.gen.ts +10 -3
- package/.pikku/pikku-types.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +212 -194
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +221 -202
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/.pikku/schemas/register.gen.ts +69 -65
- package/.pikku/schemas/schemas/SleepInput.schema.json +1 -0
- package/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
- package/.pikku/secrets/pikku-secrets.gen.ts +1 -1
- package/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
- package/.pikku/variables/pikku-variable-types.gen.ts +1 -1
- package/.pikku/variables/pikku-variables.gen.ts +1 -1
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
- package/.pikku/workflow/pikku-workflow-types.gen.ts +66 -57
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +18 -2
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +25 -2
- package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +30 -3
- package/dist/.pikku/addon/pikku-package.gen.js +2 -1
- package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-package.gen.ts +3 -1
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +13 -7
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +78 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts.map +1 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.js +61 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.js.map +1 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.ts +105 -0
- package/dist/.pikku/console/pikku-addon-meta.gen.json +281 -0
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +2 -2
- package/dist/.pikku/console/pikku-node-types.gen.d.ts.map +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.ts +2 -2
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +56 -30
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +31 -19
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.ts +70 -34
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +274 -196
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +160 -144
- package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
- package/dist/.pikku/function/pikku-functions.gen.js +4 -2
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-functions.gen.ts +4 -2
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
- package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -2
- package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +2 -10
- package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.ts +2 -9
- package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
- package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.js +10 -0
- package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
- package/dist/.pikku/pikku-services.gen.d.ts +8 -3
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +7 -1
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-services.gen.ts +10 -3
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-types.gen.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +212 -194
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +221 -202
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +27 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/dist/.pikku/schemas/register.gen.js +35 -33
- package/dist/.pikku/schemas/register.gen.js.map +1 -1
- package/dist/.pikku/schemas/register.gen.ts +69 -65
- package/dist/.pikku/schemas/schemas/SleepInput.schema.json +1 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +36 -27
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +5 -18
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +66 -57
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/src/functions/data/jwt.function.d.ts.map +1 -1
- package/dist/src/functions/data/jwt.function.js +3 -2
- package/dist/src/functions/data/jwt.function.js.map +1 -1
- package/dist/src/functions/data/sleep.function.d.ts +16 -0
- package/dist/src/functions/data/sleep.function.d.ts.map +1 -0
- package/dist/src/functions/data/sleep.function.js +18 -0
- package/dist/src/functions/data/sleep.function.js.map +1 -0
- package/package.json +3 -2
- package/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
- package/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
- package/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +0 -2
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { pikkuAuth as pikkuAuthCore } from '@pikku/core/function';
|
|
8
|
+
import { addMiddleware as addMiddlewareCore, addPermission as addPermissionCore } from '@pikku/core/middleware';
|
|
8
9
|
import { pikkuState as __pikkuState } from '@pikku/core/internal';
|
|
9
|
-
import { pikkuAuth as pikkuAuthCore } from '@pikku/core';
|
|
10
10
|
/**
|
|
11
11
|
* Factory function for creating permissions with tree-shaking support.
|
|
12
12
|
* Supports both direct function and configuration object syntax.
|
|
@@ -124,6 +124,22 @@ export const pikkuMiddlewareFactory = (factory) => {
|
|
|
124
124
|
export const pikkuPermissionFactory = (factory) => {
|
|
125
125
|
return factory;
|
|
126
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Factory function for creating approval description functions with tree-shaking support.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* export const deleteTodoApproval = pikkuApprovalDescription(
|
|
133
|
+
* async ({ todoStore }, { id }) => {
|
|
134
|
+
* const todo = await todoStore.get(id)
|
|
135
|
+
* return \`Delete todo: "${todo.title}"\`
|
|
136
|
+
* }
|
|
137
|
+
* )
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export const pikkuApprovalDescription = (fn) => {
|
|
141
|
+
return fn;
|
|
142
|
+
};
|
|
127
143
|
export function pikkuFunc(func) {
|
|
128
144
|
return typeof func === 'function' ? { func } : func;
|
|
129
145
|
}
|
|
@@ -150,27 +166,23 @@ export const pikkuVoidFunc = (func) => {
|
|
|
150
166
|
return typeof func === 'function' ? { func } : func;
|
|
151
167
|
};
|
|
152
168
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* without type compatibility issues.
|
|
169
|
+
* References a registered function by name for use in any wiring.
|
|
170
|
+
* Works for both local and addon functions — resolves via RPC at runtime.
|
|
156
171
|
*
|
|
157
|
-
* @template Name - The
|
|
158
|
-
* @param rpcName - The name of the
|
|
159
|
-
* @returns A Pikku function that proxies calls
|
|
172
|
+
* @template Name - The function name (must be a key in FlattenedRPCMap)
|
|
173
|
+
* @param rpcName - The name of the function to reference
|
|
174
|
+
* @returns A Pikku function config that proxies calls via RPC
|
|
160
175
|
*
|
|
161
176
|
* @example
|
|
162
177
|
* ```typescript
|
|
163
|
-
* //
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* func: addon('ext:hello'),
|
|
169
|
-
* tags: ['addon'],
|
|
170
|
-
* })
|
|
178
|
+
* // Use in agent tools
|
|
179
|
+
* tools: [ref('todos:listTodos'), ref('myLocalFunc')]
|
|
180
|
+
*
|
|
181
|
+
* // Use in HTTP wiring
|
|
182
|
+
* wireHTTP({ route: '/greet', method: 'post', func: ref('greet') })
|
|
171
183
|
* ```
|
|
172
184
|
*/
|
|
173
|
-
export const
|
|
185
|
+
export const ref = (rpcName) => {
|
|
174
186
|
return {
|
|
175
187
|
func: async (_services, data, { rpc }) => {
|
|
176
188
|
return rpc.invoke(rpcName, data);
|
|
@@ -294,5 +306,5 @@ export const addMiddleware = (tag, middleware) => {
|
|
|
294
306
|
export const addPermission = (tag, permissions) => {
|
|
295
307
|
addPermissionCore(tag, permissions, '@pikku/addon-graph');
|
|
296
308
|
};
|
|
297
|
-
export { wireAddon } from '@pikku/core';
|
|
309
|
+
export { wireAddon } from '@pikku/core/rpc';
|
|
298
310
|
//# sourceMappingURL=pikku-function-types.gen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-function-types.gen.js","sourceRoot":"","sources":["../../../.pikku/function/pikku-function-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;
|
|
1
|
+
{"version":3,"file":"pikku-function-types.gen.js","sourceRoot":"","sources":["../../../.pikku/function/pikku-function-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAIH,OAAO,EAAE,SAAS,IAA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AAC,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAGkC,EACd,EAAE;IACtB,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,CAAA;IAC5D,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,GAAG,SAAS,EAAE,kBAAkB,EAAE,IAAW,EAAE,CAAC,CAAA;IAC7F,OAAO,IAAqC,CAAA;AAC9C,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,UAA6B,EAAE,EAAE;IAC1E,iBAAiB,CAAC,GAAG,EAAE,UAAiB,EAAE,oBAAoB,CAAC,CAAA;AACjE,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAe,GAAW,EAAE,WAA6E,EAAE,EAAE;IACxI,iBAAiB,CAAC,GAAG,EAAE,WAAkB,EAAE,oBAAoB,CAAC,CAAA;AAClE,CAAC,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.19
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import type { CorePikkuMiddleware, CorePermissionGroup, 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 { addMiddleware as addMiddlewareCore, addPermission as addPermissionCore } from '@pikku/core/middleware'
|
|
9
12
|
import { pikkuState as __pikkuState, CreateWireServices } from '@pikku/core/internal'
|
|
10
|
-
import {
|
|
13
|
+
import { PikkuError } from '@pikku/core/errors'
|
|
11
14
|
import type { NodeType } from '@pikku/core/node'
|
|
12
15
|
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
13
16
|
import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function'
|
|
@@ -30,7 +33,7 @@ export type Session = UserSession
|
|
|
30
33
|
*/
|
|
31
34
|
export type NodeConfig = {
|
|
32
35
|
displayName: string
|
|
33
|
-
category:
|
|
36
|
+
category: string
|
|
34
37
|
type: NodeType
|
|
35
38
|
errorOutput?: boolean
|
|
36
39
|
}
|
|
@@ -222,6 +225,37 @@ export const pikkuPermissionFactory = <In = any>(
|
|
|
222
225
|
return factory
|
|
223
226
|
}
|
|
224
227
|
|
|
228
|
+
/**
|
|
229
|
+
* A function that generates a human-readable description of a pending approval action.
|
|
230
|
+
* Used by AI agents to show meaningful approval prompts instead of raw tool arguments.
|
|
231
|
+
*
|
|
232
|
+
* @template In - The input type (same as the function it describes)
|
|
233
|
+
* @template RequiredServices - The services required for this description function
|
|
234
|
+
*/
|
|
235
|
+
export type PikkuApprovalDescription<In = unknown, RequiredServices extends Services = Services> = (
|
|
236
|
+
services: RequiredServices,
|
|
237
|
+
data: In
|
|
238
|
+
) => Promise<string>
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Factory function for creating approval description functions with tree-shaking support.
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* export const deleteTodoApproval = pikkuApprovalDescription(
|
|
246
|
+
* async ({ todoStore }, { id }) => {
|
|
247
|
+
* const todo = await todoStore.get(id)
|
|
248
|
+
* return \`Delete todo: "${todo.title}"\`
|
|
249
|
+
* }
|
|
250
|
+
* )
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
export const pikkuApprovalDescription = <In = unknown, RequiredServices extends Services = Services>(
|
|
254
|
+
fn: PikkuApprovalDescription<In, RequiredServices>
|
|
255
|
+
): PikkuApprovalDescription<In, RequiredServices> => {
|
|
256
|
+
return fn
|
|
257
|
+
}
|
|
258
|
+
|
|
225
259
|
/**
|
|
226
260
|
* A sessionless API function that doesn't require user authentication.
|
|
227
261
|
* Use this for public endpoints, health checks, or operations that don't need user context.
|
|
@@ -292,7 +326,7 @@ export type PikkuFunctionConfig<
|
|
|
292
326
|
* Types are automatically inferred from the schemas.
|
|
293
327
|
*/
|
|
294
328
|
export type PikkuFunctionConfigWithSchema<
|
|
295
|
-
InputSchema extends StandardSchemaV1,
|
|
329
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
296
330
|
OutputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
297
331
|
RequiredWires extends keyof PikkuWire = never
|
|
298
332
|
> = {
|
|
@@ -301,21 +335,24 @@ export type PikkuFunctionConfigWithSchema<
|
|
|
301
335
|
expose?: boolean
|
|
302
336
|
mcp?: boolean
|
|
303
337
|
internal?: boolean
|
|
338
|
+
approvalRequired?: boolean
|
|
339
|
+
approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
|
|
304
340
|
func: PikkuFunction<
|
|
305
|
-
InferSchemaOutput<InputSchema
|
|
341
|
+
InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
|
|
306
342
|
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
|
|
307
343
|
RequiredWires
|
|
308
344
|
> | PikkuFunctionSessionless<
|
|
309
|
-
InferSchemaOutput<InputSchema
|
|
345
|
+
InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
|
|
310
346
|
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
|
|
311
347
|
RequiredWires
|
|
312
348
|
>
|
|
313
349
|
auth?: boolean
|
|
314
|
-
permissions?: CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
|
|
350
|
+
permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
|
|
315
351
|
middleware?: PikkuMiddleware[]
|
|
316
|
-
input
|
|
352
|
+
input?: InputSchema
|
|
317
353
|
output?: OutputSchema
|
|
318
354
|
node?: NodeConfig
|
|
355
|
+
errors?: Array<typeof PikkuError>
|
|
319
356
|
}
|
|
320
357
|
|
|
321
358
|
/**
|
|
@@ -357,11 +394,11 @@ export type PikkuFunctionConfigWithSchema<
|
|
|
357
394
|
* ```
|
|
358
395
|
*/
|
|
359
396
|
export function pikkuFunc<
|
|
360
|
-
InputSchema extends StandardSchemaV1,
|
|
397
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
361
398
|
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
362
399
|
>(
|
|
363
400
|
config: PikkuFunctionConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>
|
|
364
|
-
): PikkuFunctionConfig<InferSchemaOutput<InputSchema
|
|
401
|
+
): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'session' | 'rpc'>
|
|
365
402
|
export function pikkuFunc<In, Out = unknown>(
|
|
366
403
|
func:
|
|
367
404
|
| PikkuFunction<In, Out, 'session' | 'rpc'>
|
|
@@ -375,7 +412,7 @@ export function pikkuFunc(func: any) {
|
|
|
375
412
|
* Configuration object for sessionless Pikku functions with Zod schema validation.
|
|
376
413
|
*/
|
|
377
414
|
export type PikkuFunctionSessionlessConfigWithSchema<
|
|
378
|
-
InputSchema extends StandardSchemaV1,
|
|
415
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
379
416
|
OutputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
380
417
|
RequiredWires extends keyof PikkuWire = never
|
|
381
418
|
> = {
|
|
@@ -386,17 +423,20 @@ export type PikkuFunctionSessionlessConfigWithSchema<
|
|
|
386
423
|
mcp?: boolean
|
|
387
424
|
internal?: boolean
|
|
388
425
|
remote?: boolean
|
|
426
|
+
approvalRequired?: boolean
|
|
427
|
+
approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
|
|
389
428
|
func: PikkuFunctionSessionless<
|
|
390
|
-
InferSchemaOutput<InputSchema
|
|
429
|
+
InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
|
|
391
430
|
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
|
|
392
431
|
RequiredWires
|
|
393
432
|
>
|
|
394
433
|
auth?: boolean
|
|
395
|
-
permissions?: CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
|
|
434
|
+
permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
|
|
396
435
|
middleware?: PikkuMiddleware[]
|
|
397
|
-
input
|
|
436
|
+
input?: InputSchema
|
|
398
437
|
output?: OutputSchema
|
|
399
438
|
node?: NodeConfig
|
|
439
|
+
errors?: Array<typeof PikkuError>
|
|
400
440
|
}
|
|
401
441
|
|
|
402
442
|
/**
|
|
@@ -435,11 +475,11 @@ export type PikkuFunctionSessionlessConfigWithSchema<
|
|
|
435
475
|
* ```
|
|
436
476
|
*/
|
|
437
477
|
export function pikkuSessionlessFunc<
|
|
438
|
-
InputSchema extends StandardSchemaV1,
|
|
478
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
439
479
|
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
440
480
|
>(
|
|
441
481
|
config: PikkuFunctionSessionlessConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>
|
|
442
|
-
): PikkuFunctionConfig<InferSchemaOutput<InputSchema
|
|
482
|
+
): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'session' | 'rpc'>
|
|
443
483
|
export function pikkuSessionlessFunc<In, Out = unknown>(
|
|
444
484
|
func:
|
|
445
485
|
| PikkuFunctionSessionless<In, Out, 'session' | 'rpc'>
|
|
@@ -474,27 +514,23 @@ export const pikkuVoidFunc = (
|
|
|
474
514
|
}
|
|
475
515
|
|
|
476
516
|
/**
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
* without type compatibility issues.
|
|
517
|
+
* References a registered function by name for use in any wiring.
|
|
518
|
+
* Works for both local and addon functions — resolves via RPC at runtime.
|
|
480
519
|
*
|
|
481
|
-
* @template Name - The
|
|
482
|
-
* @param rpcName - The name of the
|
|
483
|
-
* @returns A Pikku function that proxies calls
|
|
520
|
+
* @template Name - The function name (must be a key in FlattenedRPCMap)
|
|
521
|
+
* @param rpcName - The name of the function to reference
|
|
522
|
+
* @returns A Pikku function config that proxies calls via RPC
|
|
484
523
|
*
|
|
485
524
|
* @example
|
|
486
525
|
* ```typescript
|
|
487
|
-
* //
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
* func: addon('ext:hello'),
|
|
493
|
-
* tags: ['addon'],
|
|
494
|
-
* })
|
|
526
|
+
* // Use in agent tools
|
|
527
|
+
* tools: [ref('todos:listTodos'), ref('myLocalFunc')]
|
|
528
|
+
*
|
|
529
|
+
* // Use in HTTP wiring
|
|
530
|
+
* wireHTTP({ route: '/greet', method: 'post', func: ref('greet') })
|
|
495
531
|
* ```
|
|
496
532
|
*/
|
|
497
|
-
export const
|
|
533
|
+
export const ref = <Name extends keyof FlattenedRPCMap>(
|
|
498
534
|
rpcName: Name
|
|
499
535
|
): PikkuFunctionConfig<
|
|
500
536
|
FlattenedRPCMap[Name]['input'],
|
|
@@ -644,5 +680,5 @@ export const addPermission = <In = unknown>(tag: string, permissions: CorePermis
|
|
|
644
680
|
addPermissionCore(tag, permissions as any, '@pikku/addon-graph')
|
|
645
681
|
}
|
|
646
682
|
|
|
647
|
-
export { wireAddon } from '@pikku/core'
|
|
648
|
-
export type { WireAddonConfig } from '@pikku/core'
|
|
683
|
+
export { wireAddon } from '@pikku/core/rpc'
|
|
684
|
+
export type { WireAddonConfig } from '@pikku/core/rpc'
|