@pikku/cli 0.11.2 → 0.11.3
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/channel/pikku-channel-types.gen.ts +63 -6
- package/.pikku/channel/pikku-channels-map.gen.d.ts +4 -4
- package/.pikku/channel/pikku-channels-meta.gen.ts +4 -2
- package/.pikku/channel/pikku-channels.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-channel.ts +1 -1
- package/.pikku/cli/pikku-cli-client.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-types.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.json +2 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +2 -2
- package/.pikku/cli/pikku-cli-wirings.gen.ts +1 -1
- package/.pikku/cli/pikku-cli.gen.ts +1 -1
- package/.pikku/forge/pikku-forge-types.gen.ts +83 -0
- package/.pikku/function/pikku-function-types.gen.ts +181 -35
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +1030 -0
- package/.pikku/function/pikku-functions-meta.gen.json +88 -420
- package/.pikku/function/pikku-functions-meta.gen.ts +2 -2
- package/.pikku/http/pikku-http-types.gen.ts +19 -3
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +4 -4
- package/.pikku/http/pikku-http-wirings-meta.gen.json +9 -0
- package/.pikku/http/pikku-http-wirings-meta.gen.ts +4 -10
- package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-types.gen.ts +69 -17
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +4 -4
- package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
- package/.pikku/pikku-bootstrap.gen.ts +7 -9
- package/.pikku/pikku-services.gen.ts +3 -2
- package/.pikku/pikku-types.gen.ts +4 -1
- package/.pikku/pikku-websocket.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +4 -4
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +2 -2
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +4 -1
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +12 -7
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +15 -9
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +2 -2
- package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
- package/.pikku/schemas/register.gen.ts +9 -1
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuCLIOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuForgeNodesOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuFunctionsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuHTTPOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuMCPOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuMiddlewareOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuPackageOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuPermissionsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuRPCOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuSchedulerOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -1
- package/.pikku/services/config.gen.json +11 -6
- package/.pikku/services/getInspectorState.gen.json +2 -2
- package/.pikku/services/jwt.gen.json +2 -2
- package/.pikku/services/logger.gen.json +2 -2
- package/.pikku/services/queueService.gen.json +2 -2
- package/.pikku/services/schedulerService.gen.json +2 -2
- package/.pikku/services/schema.gen.json +2 -2
- package/.pikku/services/secrets.gen.json +13 -0
- package/.pikku/services/variables.gen.json +2 -2
- package/.pikku/services/workflowService.gen.json +6 -6
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +2 -36
- package/.pikku/workflow/pikku-workflow-types.gen.ts +297 -45
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -4
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -6
- package/CHANGELOG.md +23 -1
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +47 -5
- package/dist/.pikku/channel/pikku-channel-types.gen.js +3 -13
- package/dist/.pikku/channel/pikku-channels-meta.gen.js +3 -2
- 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.js +1 -1
- 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 +2 -2
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +2 -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/forge/pikku-forge-types.gen.d.ts +72 -0
- package/dist/.pikku/forge/pikku-forge-types.gen.js +55 -0
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +123 -31
- package/dist/.pikku/function/pikku-function-types.gen.js +37 -51
- package/dist/.pikku/function/pikku-functions-meta.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions-meta.gen.json +88 -420
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +18 -3
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +3 -10
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.json +9 -0
- 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 +54 -14
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +7 -31
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +4 -4
- 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.d.ts +7 -9
- package/dist/.pikku/pikku-bootstrap.gen.js +7 -9
- package/dist/.pikku/pikku-services.gen.d.ts +3 -2
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/pikku-types.gen.d.ts +2 -1
- package/dist/.pikku/pikku-types.gen.js +3 -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 +2 -2
- 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.d.ts +4 -1
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +4 -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 +2 -2
- 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 +5 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuForgeNodesOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuFunctionsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuHTTPOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuMCPOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuMiddlewareOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuPackageOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuPermissionsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuRPCOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuSchedulerOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +207 -37
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +104 -28
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +3 -3
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +2 -6
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +2 -6
- package/dist/src/functions/commands/all.js +117 -79
- package/dist/src/functions/commands/bootstrap.js +2 -9
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +0 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +49 -35
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +49 -35
- package/dist/src/functions/wirings/channels/pikku-channels.js +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +18 -2
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +62 -5
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.js +1 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +10 -2
- package/dist/src/functions/wirings/forge/pikku-command-forge-nodes.d.ts +1 -0
- package/dist/src/functions/wirings/forge/pikku-command-forge-nodes.js +90 -0
- package/dist/src/functions/wirings/forge/pikku-command-forge-types.d.ts +1 -0
- package/dist/src/functions/wirings/forge/pikku-command-forge-types.js +26 -0
- package/dist/src/functions/wirings/forge/serialize-forge-types.d.ts +4 -0
- package/dist/src/functions/wirings/forge/serialize-forge-types.js +90 -0
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types.js +7 -2
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +33 -18
- package/dist/src/functions/wirings/functions/pikku-command-services.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-function-types.js +2 -2
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/schemas.js +5 -4
- package/dist/src/functions/wirings/functions/serialize-function-imports.d.ts +3 -1
- package/dist/src/functions/wirings/functions/serialize-function-imports.js +7 -3
- package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +181 -34
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.js +19 -21
- package/dist/src/functions/wirings/http/openapi-spec-generator.js +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +18 -2
- package/dist/src/functions/wirings/http/pikku-command-openapi.js +2 -2
- package/dist/src/functions/wirings/http/pikku-http-routes.js +1 -1
- package/dist/src/functions/wirings/http/serialize-http-types.js +18 -2
- package/dist/src/functions/wirings/http/serialize-typed-http-map.js +33 -8
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +15 -6
- package/dist/src/functions/wirings/mcp/serialize-mcp-json.js +3 -2
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +68 -16
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +5 -2
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -0
- package/dist/src/functions/wirings/package/pikku-command-package.js +58 -0
- package/dist/src/functions/wirings/package/serialize-package.d.ts +5 -0
- package/dist/src/functions/wirings/package/serialize-package.js +32 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +10 -2
- package/dist/src/functions/wirings/queue/pikku-queue.js +1 -9
- package/dist/src/functions/wirings/queue/serialize-queue-map.js +20 -3
- package/dist/src/functions/wirings/queue/serialize-queue-meta.js +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.js +4 -4
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +3 -0
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +54 -8
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +10 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.js +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +56 -18
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +3 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.js +30 -32
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +1 -3
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +43 -18
- package/dist/src/functions/wirings/workflow/serialize-workflow-registration.d.ts +7 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-registration.js +53 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +3 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +299 -45
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +14 -27
- package/dist/src/services.js +4 -1
- package/dist/src/utils/command-summary.d.ts +2 -0
- package/dist/src/utils/command-summary.js +2 -0
- package/dist/src/utils/custom-types-generator.js +13 -15
- package/dist/src/utils/generate-bootstrap-file.js +1 -1
- package/dist/src/utils/pikku-cli-config.js +37 -9
- package/dist/src/utils/schema-generator.d.ts +4 -3
- package/dist/src/utils/schema-generator.js +135 -15
- package/dist/src/utils/strip-verbose-meta.d.ts +43 -0
- package/dist/src/utils/strip-verbose-meta.js +210 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -4
- package/src/functions/commands/all.ts +144 -97
- package/src/functions/commands/bootstrap.ts +2 -10
- package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +0 -1
- package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +49 -35
- package/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +49 -35
- package/src/functions/wirings/channels/pikku-channels.ts +1 -1
- package/src/functions/wirings/channels/pikku-command-channels.ts +46 -3
- package/src/functions/wirings/channels/serialize-channel-types.ts +62 -5
- package/src/functions/wirings/channels/serialize-typed-channel-map.ts +3 -2
- package/src/functions/wirings/cli/pikku-command-cli.ts +21 -2
- package/src/functions/wirings/forge/pikku-command-forge-nodes.ts +135 -0
- package/src/functions/wirings/forge/pikku-command-forge-types.ts +38 -0
- package/src/functions/wirings/forge/serialize-forge-types.ts +94 -0
- package/src/functions/wirings/functions/pikku-command-function-types-split.ts +3 -2
- package/src/functions/wirings/functions/pikku-command-function-types.ts +17 -10
- package/src/functions/wirings/functions/pikku-command-functions.ts +47 -37
- package/src/functions/wirings/functions/pikku-command-services.ts +1 -1
- package/src/functions/wirings/functions/pikku-function-types.ts +3 -1
- package/src/functions/wirings/functions/schemas.ts +14 -4
- package/src/functions/wirings/functions/serialize-function-imports.ts +12 -3
- package/src/functions/wirings/functions/serialize-function-types.ts +182 -34
- package/src/functions/wirings/functions/serialize-pikku-types-hub.ts +27 -26
- package/src/functions/wirings/http/openapi-spec-generator.ts +1 -1
- package/src/functions/wirings/http/pikku-command-http-routes.ts +46 -2
- package/src/functions/wirings/http/pikku-command-openapi.ts +3 -2
- package/src/functions/wirings/http/pikku-http-routes.ts +1 -1
- package/src/functions/wirings/http/serialize-http-types.ts +18 -2
- package/src/functions/wirings/http/serialize-typed-http-map.ts +32 -8
- package/src/functions/wirings/mcp/pikku-command-mcp.ts +32 -10
- package/src/functions/wirings/mcp/serialize-mcp-json.ts +8 -6
- package/src/functions/wirings/mcp/serialize-mcp-types.ts +68 -16
- package/src/functions/wirings/middleware/pikku-command-middleware.ts +6 -2
- package/src/functions/wirings/package/pikku-command-package.ts +81 -0
- package/src/functions/wirings/package/serialize-package.ts +69 -0
- package/src/functions/wirings/queue/pikku-command-queue.ts +22 -2
- package/src/functions/wirings/queue/pikku-queue.ts +1 -10
- package/src/functions/wirings/queue/serialize-queue-map.ts +18 -3
- package/src/functions/wirings/queue/serialize-queue-meta.ts +1 -1
- package/src/functions/wirings/rpc/pikku-command-rpc-map.ts +7 -4
- package/src/functions/wirings/rpc/pikku-command-rpc.ts +1 -1
- package/src/functions/wirings/rpc/serialize-remote-rpc.ts +3 -0
- package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +1 -1
- package/src/functions/wirings/rpc/serialize-typed-rpc-map.ts +74 -8
- package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +22 -1
- package/src/functions/wirings/scheduler/serialize-scheduler-meta.ts +1 -1
- package/src/functions/wirings/workflow/pikku-command-workflow.ts +104 -37
- package/src/functions/wirings/workflow/serialize-workflow-map.ts +38 -40
- package/src/functions/wirings/workflow/serialize-workflow-meta.ts +66 -26
- package/src/functions/wirings/workflow/serialize-workflow-registration.ts +83 -0
- package/src/functions/wirings/workflow/serialize-workflow-types.ts +299 -45
- package/src/functions/wirings/workflow/serialize-workflow-workers.ts +14 -27
- package/src/services.ts +8 -1
- package/src/utils/command-summary.ts +4 -0
- package/src/utils/custom-types-generator.ts +15 -15
- package/src/utils/generate-bootstrap-file.ts +1 -1
- package/src/utils/pikku-cli-config.ts +51 -18
- package/src/utils/schema-generator.ts +185 -22
- package/src/utils/strip-verbose-meta.ts +254 -0
- package/types/config.d.ts +37 -3
- package/.pikku/function/pikku-functions-meta.min.gen.json +0 -212
- package/.pikku/function/pikku-functions-meta.min.gen.ts +0 -6
- package/dist/.pikku/function/pikku-functions-meta.min.gen.d.ts +0 -1
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +0 -6
- package/dist/.pikku/function/pikku-functions-meta.min.gen.json +0 -212
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.d.ts +0 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.js +0 -12
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.d.ts +0 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +0 -13
- package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.d.ts +0 -8
- package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.js +0 -30
- package/src/functions/wirings/workflow/pikku-command-workflow-map.ts +0 -24
- package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +0 -29
- package/src/functions/wirings/workflow/serialize-workflow-wirings.ts +0 -47
- /package/.pikku/{workflow/pikku-workflow-wirings-meta.gen.json → channel/pikku-channels-meta.gen.json} +0 -0
- /package/dist/.pikku/{workflow/pikku-workflow-wirings-meta.gen.json → channel/pikku-channels-meta.gen.json} +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates type definitions for Forge wirings with typed category and RPC validation
|
|
3
|
+
*/
|
|
4
|
+
export const serializeForgeTypes = (
|
|
5
|
+
rpcMapImportPath: string,
|
|
6
|
+
categories: string[] | undefined
|
|
7
|
+
) => {
|
|
8
|
+
// Generate category union type - 'never' if no categories configured
|
|
9
|
+
const categoryType = categories?.length
|
|
10
|
+
? categories.map((c) => `'${c}'`).join(' | ')
|
|
11
|
+
: 'never'
|
|
12
|
+
|
|
13
|
+
return `/**
|
|
14
|
+
* Forge-specific type definitions for typed wireForgeNode and wireForgeCredential
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { wireForgeNode as wireForgeNodeCore, wireForgeCredential as wireForgeCredentialCore } from '@pikku/core/forge-node'
|
|
18
|
+
import type { CoreForgeNode, CoreForgeCredential } from '@pikku/core/forge-node'
|
|
19
|
+
import type { FlattenedRPCMap } from '${rpcMapImportPath}'
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Valid category values for forge nodes.
|
|
23
|
+
* ${categories?.length ? `Configured categories: ${categories.join(', ')}` : 'No categories configured - wireForgeNode cannot be used until forge.node.categories is defined in pikku.config.json.'}
|
|
24
|
+
*/
|
|
25
|
+
export type ForgeCategory = ${categoryType}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Valid RPC names that can be used with forge nodes.
|
|
29
|
+
* These are derived from the FlattenedRPCMap which includes both local and external package RPCs.
|
|
30
|
+
*/
|
|
31
|
+
export type ForgeRPCName = keyof FlattenedRPCMap
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Typed forge node configuration.
|
|
35
|
+
* Validates that category and rpc are valid values.
|
|
36
|
+
*/
|
|
37
|
+
export type TypedForgeNode = Omit<CoreForgeNode, 'category' | 'rpc'> & {
|
|
38
|
+
/** Grouping category (validated against forge.node.categories in config) */
|
|
39
|
+
category: ForgeCategory
|
|
40
|
+
/** RPC name to call when node executes (must be a valid RPC name) */
|
|
41
|
+
rpc: ForgeRPCName
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Registers a Forge node with validated category and RPC.
|
|
46
|
+
*
|
|
47
|
+
* @param config - Forge node configuration with typed category and rpc
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* \`\`\`typescript
|
|
51
|
+
* wireForgeNode({
|
|
52
|
+
* name: 'send-email',
|
|
53
|
+
* displayName: 'Send Email',
|
|
54
|
+
* category: 'Communication', // Must be in forge.node.categories
|
|
55
|
+
* type: 'action',
|
|
56
|
+
* rpc: 'sendEmail', // Must be a valid RPC name
|
|
57
|
+
* description: 'Sends an email to a recipient'
|
|
58
|
+
* })
|
|
59
|
+
* \`\`\`
|
|
60
|
+
*/
|
|
61
|
+
export const wireForgeNode = (config: TypedForgeNode): void => {
|
|
62
|
+
wireForgeNodeCore(config as CoreForgeNode)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Registers a Forge credential definition.
|
|
67
|
+
* Credentials define secrets/API keys required by the package.
|
|
68
|
+
*
|
|
69
|
+
* @template T - Zod schema type for the credential structure
|
|
70
|
+
* @param config - Forge credential configuration
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* \`\`\`typescript
|
|
74
|
+
* import { z } from 'zod'
|
|
75
|
+
*
|
|
76
|
+
* const apiCredentials = z.object({
|
|
77
|
+
* apiKey: z.string().describe('API key for authentication'),
|
|
78
|
+
* apiSecret: z.string().describe('API secret')
|
|
79
|
+
* })
|
|
80
|
+
*
|
|
81
|
+
* wireForgeCredential({
|
|
82
|
+
* name: 'example-api',
|
|
83
|
+
* displayName: 'Example API Credentials',
|
|
84
|
+
* description: 'Credentials for the example external API',
|
|
85
|
+
* secretId: 'EXAMPLE_API_CREDENTIALS',
|
|
86
|
+
* schema: apiCredentials
|
|
87
|
+
* })
|
|
88
|
+
* \`\`\`
|
|
89
|
+
*/
|
|
90
|
+
export const wireForgeCredential = <T>(config: CoreForgeCredential<T>): void => {
|
|
91
|
+
wireForgeCredentialCore(config)
|
|
92
|
+
}
|
|
93
|
+
`
|
|
94
|
+
}
|
|
@@ -44,9 +44,10 @@ export const pikkuFunctionTypesSplit: any = pikkuSessionlessFunc<void, void>({
|
|
|
44
44
|
singletonServicesType.type,
|
|
45
45
|
`import type { ${wireServicesType.type} } from '${getFileImportRelativePath(functionTypesFile, wireServicesType.typePath, packageMappings)}'`,
|
|
46
46
|
wireServicesType.type,
|
|
47
|
-
`import type { TypedPikkuRPC } from '${getFileImportRelativePath(functionTypesFile, rpcInternalMapDeclarationFile, packageMappings)}'`,
|
|
47
|
+
`import type { TypedPikkuRPC, FlattenedRPCMap } from '${getFileImportRelativePath(functionTypesFile, rpcInternalMapDeclarationFile, packageMappings)}'`,
|
|
48
48
|
`import type { RequiredSingletonServices, RequiredWireServices } from '${getFileImportRelativePath(functionTypesFile, servicesFile, packageMappings)}'`,
|
|
49
|
-
configTypeImport
|
|
49
|
+
configTypeImport,
|
|
50
|
+
config.externalPackageName
|
|
50
51
|
)
|
|
51
52
|
|
|
52
53
|
await writeFileInDir(logger, functionTypesFile, content)
|
|
@@ -16,20 +16,27 @@ export const pikkuFunctionTypes: any = pikkuSessionlessFunc<void, void>({
|
|
|
16
16
|
queueTypesFile,
|
|
17
17
|
mcpTypesFile,
|
|
18
18
|
cliTypesFile,
|
|
19
|
+
forgeTypesFile,
|
|
19
20
|
} = config
|
|
20
21
|
|
|
22
|
+
const getImportPath = (file: string) =>
|
|
23
|
+
config.externalPackage
|
|
24
|
+
? null
|
|
25
|
+
: getFileImportRelativePath(typesFile, file, packageMappings)
|
|
26
|
+
|
|
27
|
+
// Forge types are included for external packages (they need wireForgeNode/wireForgeCredential)
|
|
28
|
+
const getForgeImportPath = (file: string) =>
|
|
29
|
+
getFileImportRelativePath(typesFile, file, packageMappings)
|
|
30
|
+
|
|
21
31
|
const content = serializePikkuTypesHub(
|
|
22
32
|
getFileImportRelativePath(typesFile, functionTypesFile, packageMappings),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
)
|
|
30
|
-
getFileImportRelativePath(typesFile, queueTypesFile, packageMappings),
|
|
31
|
-
getFileImportRelativePath(typesFile, mcpTypesFile, packageMappings),
|
|
32
|
-
getFileImportRelativePath(typesFile, cliTypesFile, packageMappings)
|
|
33
|
+
getImportPath(httpTypesFile),
|
|
34
|
+
getImportPath(channelsTypesFile),
|
|
35
|
+
getImportPath(schedulersTypesFile),
|
|
36
|
+
getImportPath(queueTypesFile),
|
|
37
|
+
getImportPath(mcpTypesFile),
|
|
38
|
+
getImportPath(cliTypesFile),
|
|
39
|
+
getForgeImportPath(forgeTypesFile)
|
|
33
40
|
)
|
|
34
41
|
|
|
35
42
|
await writeFileInDir(logger, typesFile, content)
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js'
|
|
2
2
|
import { writeFileInDir } from '../../../utils/file-writer.js'
|
|
3
3
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js'
|
|
4
|
-
import {
|
|
5
|
-
generateRuntimeMeta,
|
|
6
|
-
serializeFunctionImports,
|
|
7
|
-
} from './serialize-function-imports.js'
|
|
4
|
+
import { serializeFunctionImports } from './serialize-function-imports.js'
|
|
8
5
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js'
|
|
6
|
+
import {
|
|
7
|
+
stripVerboseFields,
|
|
8
|
+
hasVerboseFields,
|
|
9
|
+
} from '../../../utils/strip-verbose-meta.js'
|
|
9
10
|
|
|
10
11
|
export const pikkuFunctions: any = pikkuSessionlessFunc<
|
|
11
12
|
void,
|
|
@@ -16,74 +17,83 @@ export const pikkuFunctions: any = pikkuSessionlessFunc<
|
|
|
16
17
|
const {
|
|
17
18
|
functionsMetaFile,
|
|
18
19
|
functionsMetaJsonFile,
|
|
19
|
-
functionsMetaMinFile,
|
|
20
|
-
functionsMetaMinJsonFile,
|
|
21
20
|
functionsFile,
|
|
22
21
|
packageMappings,
|
|
23
22
|
schema,
|
|
24
23
|
} = config
|
|
25
24
|
|
|
25
|
+
// Write minimal JSON (runtime-only fields)
|
|
26
|
+
const minimalMeta = stripVerboseFields(functions.meta)
|
|
26
27
|
await writeFileInDir(
|
|
27
28
|
logger,
|
|
28
29
|
functionsMetaJsonFile,
|
|
29
|
-
JSON.stringify(
|
|
30
|
+
JSON.stringify(minimalMeta, null, 2)
|
|
30
31
|
)
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
// Write verbose JSON only if it has additional fields
|
|
34
|
+
if (hasVerboseFields(functions.meta)) {
|
|
35
|
+
const verbosePath = functionsMetaJsonFile.replace(
|
|
36
|
+
/\.gen\.json$/,
|
|
37
|
+
'-verbose.gen.json'
|
|
38
|
+
)
|
|
39
|
+
await writeFileInDir(
|
|
40
|
+
logger,
|
|
41
|
+
verbosePath,
|
|
42
|
+
JSON.stringify(functions.meta, null, 2)
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const jsonImportPath = getFileImportRelativePath(
|
|
33
47
|
functionsMetaFile,
|
|
34
48
|
functionsMetaJsonFile,
|
|
35
49
|
packageMappings
|
|
36
50
|
)
|
|
37
51
|
|
|
38
52
|
const supportsImportAttributes = schema?.supportsImportAttributes ?? false
|
|
39
|
-
const
|
|
40
|
-
? `import metaData from '${
|
|
41
|
-
: `import metaData from '${
|
|
53
|
+
const importStatement = supportsImportAttributes
|
|
54
|
+
? `import metaData from '${jsonImportPath}' with { type: 'json' }`
|
|
55
|
+
: `import metaData from '${jsonImportPath}'`
|
|
42
56
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
`import { pikkuState, FunctionsMeta } from '@pikku/core'\n${fullImportStatement}\npikkuState('function', 'meta', metaData as FunctionsMeta)`
|
|
47
|
-
)
|
|
57
|
+
const packageName = config.externalPackageName
|
|
58
|
+
? `'${config.externalPackageName}'`
|
|
59
|
+
: 'null'
|
|
48
60
|
|
|
49
|
-
const runtimeMeta = generateRuntimeMeta(functions.meta)
|
|
50
61
|
await writeFileInDir(
|
|
51
62
|
logger,
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
functionsMetaFile,
|
|
64
|
+
`import { pikkuState, FunctionsMeta } from '@pikku/core'\n${importStatement}\npikkuState(${packageName}, 'function', 'meta', metaData as FunctionsMeta)`
|
|
54
65
|
)
|
|
55
66
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
// For external packages, register ALL functions (they'll be invoked by consumers)
|
|
68
|
+
// For main packages, only register functions that are invoked via internal RPCs
|
|
69
|
+
const isExternalPackage = !!config.externalPackageName
|
|
70
|
+
const hasRPCs = rpc.exposedFiles.size > 0 || rpc.internalFiles.size > 0
|
|
71
|
+
const hasFunctions = functions.files.size > 0
|
|
61
72
|
|
|
62
|
-
const
|
|
63
|
-
?
|
|
64
|
-
:
|
|
73
|
+
const shouldGenerateFunctionsFile = isExternalPackage
|
|
74
|
+
? hasFunctions
|
|
75
|
+
: hasRPCs
|
|
65
76
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
if (shouldGenerateFunctionsFile) {
|
|
78
|
+
// For external packages, use all function files; for main packages, use internal RPC files
|
|
79
|
+
const filesToRegister = isExternalPackage
|
|
80
|
+
? functions.files
|
|
81
|
+
: rpc.internalFiles
|
|
71
82
|
|
|
72
|
-
const hasRPCs = rpc.exposedFiles.size > 0 || rpc.internalFiles.size > 0
|
|
73
|
-
if (hasRPCs) {
|
|
74
83
|
await writeFileInDir(
|
|
75
84
|
logger,
|
|
76
85
|
functionsFile,
|
|
77
86
|
serializeFunctionImports(
|
|
78
87
|
functionsFile,
|
|
79
|
-
|
|
88
|
+
filesToRegister,
|
|
80
89
|
functions.meta,
|
|
81
|
-
packageMappings
|
|
90
|
+
packageMappings,
|
|
91
|
+
config.externalPackageName
|
|
82
92
|
)
|
|
83
93
|
)
|
|
84
94
|
}
|
|
85
95
|
|
|
86
|
-
return
|
|
96
|
+
return shouldGenerateFunctionsFile
|
|
87
97
|
},
|
|
88
98
|
middleware: [
|
|
89
99
|
logCommandInfoAndTime({
|
|
@@ -41,7 +41,7 @@ export const serializeServicesMap = (
|
|
|
41
41
|
})
|
|
42
42
|
|
|
43
43
|
// Services that are always required internally by the framework
|
|
44
|
-
const defaultServices = ['config', 'logger', 'variables', 'schema']
|
|
44
|
+
const defaultServices = ['config', 'logger', 'variables', 'schema', 'secrets']
|
|
45
45
|
defaultServices.forEach((service) => usedServices.add(service))
|
|
46
46
|
|
|
47
47
|
// Create singleton services map: all singleton services with true/false based on usage
|
|
@@ -16,6 +16,7 @@ export const pikkuFunctionTypes: any = pikkuSessionlessFunc<void, void>({
|
|
|
16
16
|
queueTypesFile,
|
|
17
17
|
mcpTypesFile,
|
|
18
18
|
cliTypesFile,
|
|
19
|
+
forgeTypesFile,
|
|
19
20
|
} = config
|
|
20
21
|
|
|
21
22
|
const content = serializePikkuTypesHub(
|
|
@@ -29,7 +30,8 @@ export const pikkuFunctionTypes: any = pikkuSessionlessFunc<void, void>({
|
|
|
29
30
|
),
|
|
30
31
|
getFileImportRelativePath(typesFile, queueTypesFile, packageMappings),
|
|
31
32
|
getFileImportRelativePath(typesFile, mcpTypesFile, packageMappings),
|
|
32
|
-
getFileImportRelativePath(typesFile, cliTypesFile, packageMappings)
|
|
33
|
+
getFileImportRelativePath(typesFile, cliTypesFile, packageMappings),
|
|
34
|
+
getFileImportRelativePath(typesFile, forgeTypesFile, packageMappings)
|
|
33
35
|
)
|
|
34
36
|
|
|
35
37
|
await writeFileInDir(logger, typesFile, content)
|
|
@@ -2,11 +2,12 @@ import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js'
|
|
|
2
2
|
import {
|
|
3
3
|
saveSchemas,
|
|
4
4
|
generateSchemas,
|
|
5
|
+
generateZodSchemas,
|
|
5
6
|
} from '../../../utils/schema-generator.js'
|
|
6
7
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js'
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
* Generate JSON schemas from TypeScript types
|
|
10
|
+
* Generate JSON schemas from TypeScript types and Zod schemas
|
|
10
11
|
*/
|
|
11
12
|
export const pikkuSchemas: any = pikkuSessionlessFunc<
|
|
12
13
|
void,
|
|
@@ -22,17 +23,26 @@ export const pikkuSchemas: any = pikkuSessionlessFunc<
|
|
|
22
23
|
visitState.functions.meta,
|
|
23
24
|
visitState.http.meta,
|
|
24
25
|
config.schemasFromTypes,
|
|
25
|
-
config.schema?.additionalProperties
|
|
26
|
+
config.schema?.additionalProperties,
|
|
27
|
+
visitState.zodLookup
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
const zodSchemas = await generateZodSchemas(
|
|
31
|
+
logger,
|
|
32
|
+
visitState.zodLookup,
|
|
33
|
+
visitState.functions.typesMap
|
|
26
34
|
)
|
|
27
35
|
|
|
28
36
|
await saveSchemas(
|
|
29
37
|
logger,
|
|
30
38
|
config.schemaDirectory,
|
|
31
|
-
schemas,
|
|
39
|
+
{ ...schemas, ...zodSchemas},
|
|
32
40
|
visitState.functions.typesMap,
|
|
33
41
|
visitState.functions.meta,
|
|
34
42
|
config.schema?.supportsImportAttributes || true,
|
|
35
|
-
config.schemasFromTypes
|
|
43
|
+
config.schemasFromTypes,
|
|
44
|
+
visitState.zodLookup,
|
|
45
|
+
config.externalPackageName || null
|
|
36
46
|
)
|
|
37
47
|
|
|
38
48
|
return true
|
|
@@ -5,7 +5,9 @@ export const serializeFunctionImports = (
|
|
|
5
5
|
outputPath: string,
|
|
6
6
|
functionsMap: Map<string, { path: string; exportedName: string }>,
|
|
7
7
|
functionsMeta: FunctionsMeta,
|
|
8
|
-
packageMappings: Record<string, string> = {}
|
|
8
|
+
packageMappings: Record<string, string> = {},
|
|
9
|
+
/** Package name for external packages (e.g., '@pikku/templates-function-external') */
|
|
10
|
+
externalPackageName?: string
|
|
9
11
|
) => {
|
|
10
12
|
const serializedImports: string[] = [
|
|
11
13
|
`/* Import and register functions used by RPCs */`,
|
|
@@ -19,6 +21,9 @@ export const serializeFunctionImports = (
|
|
|
19
21
|
a[0].localeCompare(b[0])
|
|
20
22
|
)
|
|
21
23
|
|
|
24
|
+
// Third argument to addFunction is the package name (null for main package)
|
|
25
|
+
const packageArg = externalPackageName ? `, '${externalPackageName}'` : ''
|
|
26
|
+
|
|
22
27
|
for (const [name, { path, exportedName }] of sortedEntries) {
|
|
23
28
|
const filePath = getFileImportRelativePath(
|
|
24
29
|
outputPath,
|
|
@@ -30,14 +35,18 @@ export const serializeFunctionImports = (
|
|
|
30
35
|
// For directly exported functions, we can just import and register them
|
|
31
36
|
if (name === exportedName) {
|
|
32
37
|
serializedImports.push(`import { ${exportedName} } from '${filePath}'`)
|
|
33
|
-
serializedRegistrations.push(
|
|
38
|
+
serializedRegistrations.push(
|
|
39
|
+
`addFunction('${name}', ${exportedName}${packageArg})`
|
|
40
|
+
)
|
|
34
41
|
}
|
|
35
42
|
// For renamed functions, we need to import and alias them
|
|
36
43
|
else {
|
|
37
44
|
serializedImports.push(
|
|
38
45
|
`import { ${exportedName} as ${name} } from '${filePath}'`
|
|
39
46
|
)
|
|
40
|
-
serializedRegistrations.push(
|
|
47
|
+
serializedRegistrations.push(
|
|
48
|
+
`addFunction('${name}', ${name}${packageArg})`
|
|
49
|
+
)
|
|
41
50
|
}
|
|
42
51
|
}
|
|
43
52
|
|