@pikku/cli 0.12.2 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.schema.json +1 -1
- package/console-app/assets/index-AX4YS8AA.js +657 -0
- package/console-app/assets/{index-0Ui5UudO.css → index-DvrDbftC.css} +1 -1
- package/console-app/index.html +2 -2
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +13 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +17 -2
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +12 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +30 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +17 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +88 -88
- package/dist/.pikku/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +3 -1
- package/dist/.pikku/pikku-services.gen.js +2 -0
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
- package/dist/.pikku/pikku-websocket.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +3 -3
- package/dist/.pikku/schemas/schemas/ConsoleCommandInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuNewAddonInput.schema.json +1 -1
- 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-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +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/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-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +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/src/cli.wiring.js +9 -0
- package/dist/src/functions/commands/all.js +33 -11
- package/dist/src/functions/commands/console.d.ts +3 -0
- package/dist/src/functions/commands/console.js +8 -2
- package/dist/src/functions/commands/new-addon.d.ts +3 -0
- package/dist/src/functions/commands/new-addon.js +8 -6
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +19 -0
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.js +1 -1
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.js +7 -6
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +9 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +35 -12
- package/dist/src/functions/wirings/console/pikku-command-node-types.js +2 -2
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.js +20 -11
- package/dist/src/functions/wirings/console/serialize-console-functions.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/serialize-addon-types.js +23 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +38 -0
- package/dist/src/services.js +1 -1
- package/dist/src/utils/file-import-path.js +5 -2
- package/dist/src/utils/openapi/codegen.d.ts +1 -0
- package/dist/src/utils/openapi/codegen.js +214 -46
- package/dist/src/utils/openapi/parse-openapi.d.ts +25 -0
- package/dist/src/utils/openapi/parse-openapi.js +119 -9
- package/dist/src/utils/openapi/zod-codegen.d.ts +1 -53
- package/dist/src/utils/openapi/zod-codegen.js +1 -251
- package/dist/src/utils/pikku-cli-config.js +2 -2
- package/dist/src/utils/strip-verbose-meta.d.ts +2 -0
- package/dist/src/utils/strip-verbose-meta.js +34 -0
- package/package.json +4 -3
- package/console-app/assets/index-DRJQtv3c.js +0 -676
package/console-app/index.html
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
}
|
|
26
26
|
} catch (e) {}
|
|
27
27
|
</script>
|
|
28
|
-
<script type="module" crossorigin src="/assets/index-
|
|
29
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
28
|
+
<script type="module" crossorigin src="/assets/index-AX4YS8AA.js"></script>
|
|
29
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DvrDbftC.css">
|
|
30
30
|
</head>
|
|
31
31
|
<body>
|
|
32
32
|
<div id="root"></div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.4
|
|
3
3
|
*/
|
|
4
4
|
import { CoreAIAgent, PikkuAIMiddlewareHooks } from '@pikku/core/ai-agent';
|
|
5
5
|
import type { PikkuPermission, PikkuMiddleware, Services, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js';
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export declare const cliHelp: import("../function/pikku-function-types.gen.js").PikkuFunctionConfig<{
|
|
2
|
+
args?: string[];
|
|
3
|
+
}, {
|
|
4
|
+
help: string;
|
|
5
|
+
}, "session" | "rpc", import("../function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
|
|
6
|
+
args?: string[];
|
|
7
|
+
}, {
|
|
8
|
+
help: string;
|
|
9
|
+
}, "session" | "rpc", import("../function/pikku-function-types.gen.js").Services> | import("../function/pikku-function-types.gen.js").PikkuFunction<{
|
|
10
|
+
args?: string[];
|
|
11
|
+
}, {
|
|
12
|
+
help: string;
|
|
13
|
+
}, "session" | "rpc", import("../function/pikku-function-types.gen.js").Services>, undefined, undefined>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.4
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* WebSocket channel backend for 'pikku' CLI commands
|
|
6
6
|
*/
|
|
7
7
|
import { wireChannel } from '../channel/pikku-channel-types.gen.js';
|
|
8
|
-
import { pikkuMiddleware } from '../function/pikku-function-types.gen.js';
|
|
8
|
+
import { pikkuMiddleware, pikkuSessionlessFunc } from '../function/pikku-function-types.gen.js';
|
|
9
|
+
import { generateCommandHelp } from '@pikku/core/cli';
|
|
10
|
+
import { pikkuState } from '@pikku/core/internal';
|
|
9
11
|
import { all } from '../../src/functions/commands/all.js';
|
|
10
12
|
import { bootstrap } from '../../src/functions/commands/bootstrap.js';
|
|
11
13
|
import { watch } from '../../src/functions/commands/watch.js';
|
|
@@ -56,12 +58,25 @@ const cliCloseOnComplete = pikkuMiddleware(async (_services, { channel }, next)
|
|
|
56
58
|
throw error;
|
|
57
59
|
}
|
|
58
60
|
});
|
|
61
|
+
export const cliHelp = pikkuSessionlessFunc({
|
|
62
|
+
auth: false,
|
|
63
|
+
func: async (_services, data) => {
|
|
64
|
+
const cliMeta = pikkuState(null, 'cli', 'meta');
|
|
65
|
+
const commandPath = data?.args?.length ? data.args : [];
|
|
66
|
+
const helpText = generateCommandHelp('pikku', cliMeta, commandPath);
|
|
67
|
+
return { help: helpText };
|
|
68
|
+
},
|
|
69
|
+
});
|
|
59
70
|
wireChannel({
|
|
60
71
|
name: 'pikku-cli',
|
|
61
72
|
route: '/cli/pikku',
|
|
62
73
|
auth: false,
|
|
63
74
|
onMessageWiring: {
|
|
64
75
|
command: {
|
|
76
|
+
'__help': {
|
|
77
|
+
func: cliHelp,
|
|
78
|
+
middleware: [cliCloseOnComplete],
|
|
79
|
+
},
|
|
65
80
|
'all': {
|
|
66
81
|
func: all,
|
|
67
82
|
middleware: [cliCloseOnComplete],
|
|
@@ -52,6 +52,11 @@
|
|
|
52
52
|
"description": "Port for the console server",
|
|
53
53
|
"default": "51442",
|
|
54
54
|
"short": "p"
|
|
55
|
+
},
|
|
56
|
+
"open": {
|
|
57
|
+
"description": "Open the console in the browser",
|
|
58
|
+
"default": "false",
|
|
59
|
+
"short": "o"
|
|
55
60
|
}
|
|
56
61
|
},
|
|
57
62
|
"description": "Start the Pikku Console UI with live file watching"
|
|
@@ -269,6 +274,10 @@
|
|
|
269
274
|
},
|
|
270
275
|
"openapi": {
|
|
271
276
|
"description": "Path to OpenAPI YAML/JSON spec to generate functions from"
|
|
277
|
+
},
|
|
278
|
+
"mcp": {
|
|
279
|
+
"description": "Add mcp: true to generated functions (expose as MCP tools)",
|
|
280
|
+
"default": false
|
|
272
281
|
}
|
|
273
282
|
},
|
|
274
283
|
"description": "Scaffold a new addon package",
|
|
@@ -440,7 +449,9 @@
|
|
|
440
449
|
"aiStorage",
|
|
441
450
|
"content",
|
|
442
451
|
"aiAgentRunner",
|
|
443
|
-
"aiRunState"
|
|
452
|
+
"aiRunState",
|
|
453
|
+
"agentRunService",
|
|
454
|
+
"workflowRunService"
|
|
444
455
|
]
|
|
445
456
|
},
|
|
446
457
|
"filePath": "/home/runner/work/pikku/pikku/packages/cli/src/services.ts"
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.4
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
6
6
|
*/
|
|
7
7
|
import { CorePikkuFunctionConfig, CorePikkuAuth, CorePikkuAuthConfig, CorePikkuPermission, CorePikkuMiddleware, CorePermissionGroup, PikkuWire, PickRequired } from '@pikku/core';
|
|
8
8
|
import { CreateWireServices } from '@pikku/core/internal';
|
|
9
|
+
import { PikkuError } from '@pikku/core/errors';
|
|
9
10
|
import type { NodeType } from '@pikku/core/node';
|
|
10
11
|
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
11
12
|
import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function';
|
|
@@ -184,6 +185,28 @@ export declare const pikkuMiddlewareFactory: <In = any>(factory: (input: In) =>
|
|
|
184
185
|
* ```
|
|
185
186
|
*/
|
|
186
187
|
export declare const pikkuPermissionFactory: <In = any>(factory: (input: In) => PikkuPermission<any>) => ((input: In) => PikkuPermission<any>);
|
|
188
|
+
/**
|
|
189
|
+
* A function that generates a human-readable description of a pending approval action.
|
|
190
|
+
* Used by AI agents to show meaningful approval prompts instead of raw tool arguments.
|
|
191
|
+
*
|
|
192
|
+
* @template In - The input type (same as the function it describes)
|
|
193
|
+
* @template RequiredServices - The services required for this description function
|
|
194
|
+
*/
|
|
195
|
+
export type PikkuApprovalDescription<In = unknown, RequiredServices extends Services = Services> = (services: RequiredServices, data: In) => Promise<string>;
|
|
196
|
+
/**
|
|
197
|
+
* Factory function for creating approval description functions with tree-shaking support.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```typescript
|
|
201
|
+
* export const deleteTodoApproval = pikkuApprovalDescription(
|
|
202
|
+
* async ({ todoStore }, { id }) => {
|
|
203
|
+
* const todo = await todoStore.get(id)
|
|
204
|
+
* return \`Delete todo: "${todo.title}"\`
|
|
205
|
+
* }
|
|
206
|
+
* )
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
export declare const pikkuApprovalDescription: <In = unknown, RequiredServices extends Services = Services>(fn: PikkuApprovalDescription<In, RequiredServices>) => PikkuApprovalDescription<In, RequiredServices>;
|
|
187
210
|
/**
|
|
188
211
|
* A sessionless API function that doesn't require user authentication.
|
|
189
212
|
* Use this for public endpoints, health checks, or operations that don't need user context.
|
|
@@ -226,6 +249,8 @@ export type PikkuFunctionConfigWithSchema<InputSchema extends StandardSchemaV1,
|
|
|
226
249
|
expose?: boolean;
|
|
227
250
|
mcp?: boolean;
|
|
228
251
|
internal?: boolean;
|
|
252
|
+
approvalRequired?: boolean;
|
|
253
|
+
approvalDescription?: PikkuApprovalDescription<InferSchemaOutput<InputSchema>>;
|
|
229
254
|
func: PikkuFunction<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, RequiredWires> | PikkuFunctionSessionless<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, RequiredWires>;
|
|
230
255
|
auth?: boolean;
|
|
231
256
|
permissions?: CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>;
|
|
@@ -233,6 +258,7 @@ export type PikkuFunctionConfigWithSchema<InputSchema extends StandardSchemaV1,
|
|
|
233
258
|
input: InputSchema;
|
|
234
259
|
output?: OutputSchema;
|
|
235
260
|
node?: NodeConfig;
|
|
261
|
+
errors?: Array<typeof PikkuError>;
|
|
236
262
|
};
|
|
237
263
|
/**
|
|
238
264
|
* Creates a Pikku function that can be either session-aware or sessionless.
|
|
@@ -285,6 +311,8 @@ export type PikkuFunctionSessionlessConfigWithSchema<InputSchema extends Standar
|
|
|
285
311
|
mcp?: boolean;
|
|
286
312
|
internal?: boolean;
|
|
287
313
|
remote?: boolean;
|
|
314
|
+
approvalRequired?: boolean;
|
|
315
|
+
approvalDescription?: PikkuApprovalDescription<InferSchemaOutput<InputSchema>>;
|
|
288
316
|
func: PikkuFunctionSessionless<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, RequiredWires>;
|
|
289
317
|
auth?: boolean;
|
|
290
318
|
permissions?: CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>;
|
|
@@ -292,6 +320,7 @@ export type PikkuFunctionSessionlessConfigWithSchema<InputSchema extends Standar
|
|
|
292
320
|
input: InputSchema;
|
|
293
321
|
output?: OutputSchema;
|
|
294
322
|
node?: NodeConfig;
|
|
323
|
+
errors?: Array<typeof PikkuError>;
|
|
295
324
|
};
|
|
296
325
|
/**
|
|
297
326
|
* Creates a sessionless Pikku function that doesn't require user authentication.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.4
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
@@ -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
|
}
|