@pikku/cli 0.11.1 → 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 +73 -17
- package/.pikku/channel/pikku-channels-map.gen.d.ts +11 -11
- package/.pikku/channel/pikku-channels-meta.gen.json +1 -0
- 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 +2 -2
- package/.pikku/cli/pikku-cli-client.gen.ts +1 -3
- package/.pikku/cli/pikku-cli-types.gen.ts +3 -3
- package/.pikku/cli/pikku-cli-wirings-meta.gen.json +147 -0
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +4 -157
- package/.pikku/cli/pikku-cli-wirings.gen.ts +3 -3
- package/.pikku/cli/pikku-cli.gen.ts +3 -3
- package/.pikku/forge/pikku-forge-types.gen.ts +83 -0
- package/.pikku/function/pikku-function-types.gen.ts +223 -91
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +1030 -0
- package/.pikku/function/pikku-functions-meta.gen.json +656 -0
- package/.pikku/function/pikku-functions-meta.gen.ts +4 -970
- package/.pikku/http/pikku-http-types.gen.ts +20 -4
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +11 -11
- 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 +72 -20
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.json +5 -0
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +6 -4
- package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
- package/.pikku/pikku-bootstrap.gen.ts +7 -12
- package/.pikku/pikku-services.gen.ts +6 -7
- package/.pikku/pikku-types.gen.ts +4 -1
- package/.pikku/pikku-websocket.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +2 -2
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +11 -11
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +1 -0
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +5 -7
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +5 -2
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +19 -14
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +46 -39
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +2 -2
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.json +1 -0
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +5 -2
- package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
- package/.pikku/schemas/register.gen.ts +31 -23
- 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 +104 -0
- package/.pikku/services/getInspectorState.gen.json +10 -0
- package/.pikku/services/jwt.gen.json +13 -0
- package/.pikku/services/logger.gen.json +25 -0
- package/.pikku/services/queueService.gen.json +14 -0
- package/.pikku/services/schedulerService.gen.json +17 -0
- package/.pikku/services/schema.gen.json +14 -0
- package/.pikku/services/secrets.gen.json +13 -0
- package/.pikku/services/variables.gen.json +13 -0
- package/.pikku/services/workflowService.gen.json +31 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +2 -36
- package/.pikku/workflow/pikku-workflow-types.gen.ts +305 -48
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +6 -2
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -2
- package/CHANGELOG.md +44 -1
- package/bin/pikku.ts +6 -32
- package/build.sh +53 -31
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +51 -10
- 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-meta.gen.json +1 -0
- 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 +2 -2
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -3
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +3 -3
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +3 -157
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +147 -0
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +2 -2
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +2 -2
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +3 -3
- 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 +141 -99
- package/dist/.pikku/function/pikku-function-types.gen.js +52 -62
- package/dist/.pikku/function/pikku-functions-meta.gen.js +3 -969
- package/dist/.pikku/function/pikku-functions-meta.gen.json +656 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +19 -4
- 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 +57 -17
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +7 -31
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +5 -4
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.json +5 -0
- 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 -12
- package/dist/.pikku/pikku-bootstrap.gen.js +7 -12
- package/dist/.pikku/pikku-services.gen.d.ts +5 -7
- package/dist/.pikku/pikku-services.gen.js +3 -5
- 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 +2 -2
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +3 -7
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +1 -0
- 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 +9 -9
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +5 -2
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +2 -2
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +3 -2
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.json +1 -0
- 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 +19 -15
- 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 +213 -39
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +106 -16
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +3 -2
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -2
- package/dist/bin/pikku.js +5 -26
- package/dist/src/cli.wiring.js +4 -4
- package/dist/src/functions/commands/all.js +172 -94
- package/dist/src/functions/commands/bootstrap.js +21 -16
- package/dist/src/functions/commands/watch.js +6 -3
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +12 -8
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +74 -22
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +72 -20
- package/dist/src/functions/wirings/channels/pikku-channels.js +9 -2
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +18 -2
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +72 -16
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.js +1 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +17 -3
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +1 -1
- package/dist/src/functions/wirings/cli/serialize-cli-types.js +2 -2
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +4 -4
- 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 +4 -4
- package/dist/src/functions/wirings/functions/pikku-command-function-types.js +7 -2
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +35 -10
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +24 -24
- 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 +224 -91
- 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 +5 -5
- 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 +9 -2
- package/dist/src/functions/wirings/http/serialize-http-types.js +19 -3
- package/dist/src/functions/wirings/http/serialize-typed-http-map.js +33 -8
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +29 -6
- package/dist/src/functions/wirings/mcp/serialize-mcp-json.js +3 -2
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +71 -19
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +29 -2
- package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.d.ts +5 -2
- package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.js +5 -13
- 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 +17 -3
- package/dist/src/functions/wirings/queue/pikku-queue.js +9 -11
- package/dist/src/functions/wirings/queue/serialize-queue-map.js +20 -3
- package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +2 -1
- package/dist/src/functions/wirings/queue/serialize-queue-meta.js +10 -1
- package/dist/src/functions/wirings/queue/serialize-queue-types.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 +9 -2
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +11 -4
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +4 -1
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +3 -3
- 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 +15 -3
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.d.ts +2 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.js +11 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +1 -1
- package/dist/src/functions/wirings/services/pikku-command-service-metadata.d.ts +1 -0
- package/dist/src/functions/wirings/services/pikku-command-service-metadata.js +22 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +58 -16
- 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 -2
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +43 -8
- 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 +4 -2
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +308 -49
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +16 -29
- package/dist/src/middleware/log-command-info-and-time.d.ts +2 -2
- package/dist/src/middleware/log-command-info-and-time.js +1 -4
- package/dist/src/services/cli-logger-forwarder.service.js +1 -1
- package/dist/src/services.d.ts +2 -7
- package/dist/src/services.js +18 -13
- package/dist/src/utils/check-required-types.d.ts +2 -2
- package/dist/src/utils/check-required-types.js +2 -3
- 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 +65 -4
- package/dist/src/utils/pikku-files-and-methods.d.ts +2 -2
- package/dist/src/utils/pikku-files-and-methods.js +4 -4
- 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 +11 -9
- package/src/cli.wiring.ts +4 -4
- package/src/functions/commands/all.ts +203 -107
- package/src/functions/commands/bootstrap.ts +23 -16
- package/src/functions/commands/watch.ts +6 -3
- package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +26 -6
- package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +75 -22
- package/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +72 -19
- package/src/functions/wirings/channels/pikku-channels.ts +27 -3
- package/src/functions/wirings/channels/pikku-command-channels.ts +46 -3
- package/src/functions/wirings/channels/serialize-channel-types.ts +72 -16
- package/src/functions/wirings/channels/serialize-typed-channel-map.ts +3 -2
- package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
- package/src/functions/wirings/cli/pikku-command-cli-types.ts +1 -1
- package/src/functions/wirings/cli/pikku-command-cli.ts +45 -3
- package/src/functions/wirings/cli/serialize-channel-cli.ts +1 -1
- package/src/functions/wirings/cli/serialize-cli-types.ts +2 -2
- package/src/functions/wirings/cli/serialize-local-cli-bootstrap.ts +5 -5
- 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 +9 -8
- package/src/functions/wirings/functions/pikku-command-function-types.ts +17 -10
- package/src/functions/wirings/functions/pikku-command-functions.ts +59 -14
- package/src/functions/wirings/functions/pikku-command-services.ts +26 -26
- 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 +227 -93
- package/src/functions/wirings/functions/serialize-pikku-types-hub.ts +27 -26
- package/src/functions/wirings/http/openapi-spec-generator.ts +15 -6
- 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 +28 -2
- package/src/functions/wirings/http/serialize-http-types.ts +19 -3
- package/src/functions/wirings/http/serialize-typed-http-map.ts +32 -8
- package/src/functions/wirings/mcp/pikku-command-mcp.ts +58 -10
- package/src/functions/wirings/mcp/serialize-mcp-json.ts +8 -6
- package/src/functions/wirings/mcp/serialize-mcp-types.ts +71 -19
- package/src/functions/wirings/middleware/pikku-command-middleware.ts +39 -2
- package/src/functions/wirings/middleware/serialize-middleware-groups-meta.ts +4 -19
- 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/permissions/pikku-command-permissions.ts +2 -2
- package/src/functions/wirings/queue/pikku-command-queue.ts +47 -2
- package/src/functions/wirings/queue/pikku-queue.ts +26 -10
- package/src/functions/wirings/queue/serialize-queue-map.ts +18 -3
- package/src/functions/wirings/queue/serialize-queue-meta.ts +15 -1
- package/src/functions/wirings/queue/serialize-queue-types.ts +1 -1
- package/src/functions/wirings/rpc/pikku-command-rpc-map.ts +7 -4
- package/src/functions/wirings/rpc/pikku-command-rpc.ts +25 -2
- package/src/functions/wirings/rpc/serialize-public-rpc.ts +11 -4
- package/src/functions/wirings/rpc/serialize-remote-rpc.ts +4 -1
- package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +3 -3
- package/src/functions/wirings/rpc/serialize-typed-rpc-map.ts +74 -8
- package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +51 -4
- package/src/functions/wirings/scheduler/serialize-scheduler-meta.ts +20 -1
- package/src/functions/wirings/scheduler/serialize-scheduler-types.ts +1 -1
- package/src/functions/wirings/services/pikku-command-service-metadata.ts +25 -0
- package/src/functions/wirings/workflow/pikku-command-workflow.ts +114 -19
- package/src/functions/wirings/workflow/serialize-workflow-map.ts +38 -40
- package/src/functions/wirings/workflow/serialize-workflow-meta.ts +68 -11
- package/src/functions/wirings/workflow/serialize-workflow-registration.ts +83 -0
- package/src/functions/wirings/workflow/serialize-workflow-types.ts +311 -49
- package/src/functions/wirings/workflow/serialize-workflow-workers.ts +16 -29
- package/src/middleware/log-command-info-and-time.ts +3 -6
- package/src/services/cli-logger-forwarder.service.ts +1 -1
- package/src/services.ts +23 -16
- package/src/utils/check-required-types.ts +4 -7
- 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 +105 -5
- package/src/utils/pikku-files-and-methods.ts +10 -13
- package/src/utils/schema-generator.ts +185 -22
- package/src/utils/strip-verbose-meta.ts +254 -0
- package/types/application-types.d.ts +1 -1
- package/types/config.d.ts +47 -2
- package/.pikku/function/pikku-functions-meta.min.gen.ts +0 -211
- package/.pikku/function/pikku-functions.gen.ts +0 -84
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +0 -47
- package/dist/.pikku/function/pikku-functions-meta.min.gen.d.ts +0 -1
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +0 -211
- package/dist/.pikku/function/pikku-functions.gen.d.ts +0 -1
- package/dist/.pikku/function/pikku-functions.gen.js +0 -83
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +0 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +0 -47
- package/dist/.pikku/schemas/schemas/PikkuRemoteInternalRPCInput.schema.json +0 -1
- 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 -11
- package/src/functions/wirings/workflow/pikku-command-workflow-map.ts +0 -24
- package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +0 -22
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generate queue workers
|
|
2
|
+
* Generate queue workers for workflow orchestration
|
|
3
3
|
*/
|
|
4
4
|
export const serializeWorkflowWorkers = (pathToPikkuTypes) => {
|
|
5
5
|
return `/**
|
|
6
|
-
*
|
|
7
|
-
* Do not edit manually - regenerate with 'npx pikku'
|
|
6
|
+
* Workflow queue workers for orchestration
|
|
8
7
|
*/
|
|
9
8
|
import { pikkuSessionlessFunc, wireQueueWorker } from '${pathToPikkuTypes}'
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
* Worker input types for generated queue workers
|
|
13
|
-
*/
|
|
14
10
|
export type WorkflowStepInput = {
|
|
15
11
|
runId: string
|
|
16
12
|
stepName: string
|
|
@@ -18,43 +14,34 @@ export type WorkflowStepInput = {
|
|
|
18
14
|
data: any
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
export const pikkuWorkflowWorker = pikkuSessionlessFunc<
|
|
22
|
-
|
|
23
|
-
void
|
|
24
|
-
>({
|
|
25
|
-
func: async ({ workflowService, rpc }, { runId, stepName, rpcName, data }) => {
|
|
17
|
+
export const pikkuWorkflowWorker = pikkuSessionlessFunc<WorkflowStepInput, void>({
|
|
18
|
+
func: async ({ workflowService }, { runId, stepName, rpcName, data }, { rpc }) => {
|
|
26
19
|
await workflowService!.executeWorkflowStep(runId, stepName, rpcName, data, rpc)
|
|
27
20
|
}
|
|
28
21
|
})
|
|
29
22
|
|
|
30
|
-
export const pikkuWorkflowOrchestrator = pikkuSessionlessFunc<
|
|
31
|
-
{ runId
|
|
32
|
-
void
|
|
33
|
-
>({
|
|
34
|
-
func: async ({ workflowService, rpc }, { runId }) => {
|
|
23
|
+
export const pikkuWorkflowOrchestrator = pikkuSessionlessFunc<{ runId: string }, void>({
|
|
24
|
+
func: async ({ workflowService }, { runId }, { rpc }) => {
|
|
35
25
|
await workflowService!.orchestrateWorkflow(runId, rpc)
|
|
36
26
|
}
|
|
37
27
|
})
|
|
38
28
|
|
|
39
|
-
export const pikkuWorkflowSleeper = pikkuSessionlessFunc<
|
|
40
|
-
{ runId: string, stepId: string },
|
|
41
|
-
void
|
|
42
|
-
>({
|
|
29
|
+
export const pikkuWorkflowSleeper = pikkuSessionlessFunc<{ runId: string, stepId: string }, void>({
|
|
43
30
|
func: async ({ workflowService }, { runId, stepId }) => {
|
|
44
|
-
await workflowService!.
|
|
31
|
+
await workflowService!.executeWorkflowSleepCompleted(runId, stepId)
|
|
45
32
|
},
|
|
46
|
-
name: 'pikkuWorkflowStepSleeper',
|
|
47
33
|
internal: true,
|
|
48
34
|
})
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
export const pikkuRemoteInternalRPC = pikkuSessionlessFunc<{ rpcName: string, data?: any }, any>({
|
|
37
|
+
func: async (_services, { rpcName, data }, { rpc }) => {
|
|
38
|
+
return await (rpc.invoke as any)(rpcName, data)
|
|
39
|
+
},
|
|
40
|
+
internal: true,
|
|
53
41
|
})
|
|
54
42
|
|
|
55
|
-
wireQueueWorker({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
})
|
|
43
|
+
wireQueueWorker({ queueName: 'pikku-workflow-step-worker', func: pikkuWorkflowWorker })
|
|
44
|
+
wireQueueWorker({ queueName: 'pikku-workflow-orchestrator', func: pikkuWorkflowOrchestrator })
|
|
45
|
+
wireQueueWorker({ queueName: 'pikku-remote-internal-rpc', func: pikkuRemoteInternalRPC })
|
|
59
46
|
`;
|
|
60
47
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Services } from '../../types/application-types.js';
|
|
2
|
-
import type {
|
|
3
|
-
type PikkuMiddleware = (services: Services,
|
|
2
|
+
import type { PikkuWire } from '@pikku/core';
|
|
3
|
+
type PikkuMiddleware = (services: Services, wire: PikkuWire, next: () => Promise<void>) => Promise<void>;
|
|
4
4
|
export interface LogCommandInfoOptions {
|
|
5
5
|
commandStart: string;
|
|
6
6
|
commandEnd: string;
|
|
@@ -3,13 +3,10 @@
|
|
|
3
3
|
* Uses debug level so it only shows with --verbose flag
|
|
4
4
|
*/
|
|
5
5
|
export const logCommandInfoAndTime = ({ commandStart, commandEnd, }) => {
|
|
6
|
-
return async ({ logger },
|
|
7
|
-
// Log start (debug level - only shows with --verbose)
|
|
6
|
+
return async ({ logger }, _wire, next) => {
|
|
8
7
|
const start = Date.now();
|
|
9
8
|
logger.debug(`• ${commandStart}...`);
|
|
10
|
-
// Execute the function
|
|
11
9
|
await next();
|
|
12
|
-
// Log completion (debug level - only shows with --verbose)
|
|
13
10
|
logger.debug({
|
|
14
11
|
type: 'success',
|
|
15
12
|
message: `✓ ${commandEnd} in ${Date.now() - start}ms.`,
|
|
@@ -26,7 +26,7 @@ export class CLILoggerForwarder {
|
|
|
26
26
|
return;
|
|
27
27
|
let message;
|
|
28
28
|
if (messageOrObj instanceof Error) {
|
|
29
|
-
this.logger.error(messageOrObj);
|
|
29
|
+
this.logger.error(messageOrObj.toString());
|
|
30
30
|
message = messageOrObj.message;
|
|
31
31
|
}
|
|
32
32
|
else if (typeof messageOrObj === 'object') {
|
package/dist/src/services.d.ts
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import type { Config, Services, SingletonServices, UserSession } from '../types/application-types.js';
|
|
2
|
-
import { CreateConfig,
|
|
2
|
+
import { CreateConfig, CreateWireServices, CreateSingletonServices } from '@pikku/core';
|
|
3
3
|
import { PikkuCLIConfig } from '../types/config.js';
|
|
4
4
|
import { ForwardedLogMessage } from './services/cli-logger-forwarder.service.js';
|
|
5
5
|
/**
|
|
6
6
|
* Default CLI renderer that logs output using the logger
|
|
7
7
|
*/
|
|
8
8
|
export declare const defaultCLIRenderer: import("@pikku/core").CorePikkuCLIRender<ForwardedLogMessage, SingletonServices, import("@pikku/core").CoreUserSession>;
|
|
9
|
-
/**
|
|
10
|
-
* Client-safe CLI renderer that outputs to console (no service dependencies)
|
|
11
|
-
* This renderer can be used in CLI-over-channel clients
|
|
12
|
-
*/
|
|
13
|
-
export declare const clientCLIRenderer: import("@pikku/core").CorePikkuCLIRender<ForwardedLogMessage, import("@pikku/core").CoreServices, import("@pikku/core").CoreUserSession>;
|
|
14
9
|
export declare const createConfig: CreateConfig<Config, [PikkuCLIConfig]>;
|
|
15
10
|
/**
|
|
16
11
|
* Singleton services factory for the Pikku CLI
|
|
17
12
|
* This function creates the singleton services used by the CLI and is created once on start.
|
|
18
13
|
*/
|
|
19
14
|
export declare const createSingletonServices: CreateSingletonServices<Config, SingletonServices>;
|
|
20
|
-
export declare const
|
|
15
|
+
export declare const createWireServices: CreateWireServices<SingletonServices, Services, UserSession>;
|
package/dist/src/services.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pikkuCLIRender } from '@pikku/core/cli';
|
|
2
|
-
import { LocalVariablesService, LogLevel } from '@pikku/core/services';
|
|
2
|
+
import { LocalVariablesService, LocalSecretService, LogLevel, } from '@pikku/core/services';
|
|
3
3
|
import { CLILogger } from './services/cli-logger.service.js';
|
|
4
4
|
import { getPikkuCLIConfig } from './utils/pikku-cli-config.js';
|
|
5
5
|
import { inspect, serializeInspectorState, deserializeInspectorState, filterInspectorState, getInitialInspectorState, } from '@pikku/inspector';
|
|
@@ -70,15 +70,17 @@ export const defaultCLIRenderer = pikkuCLIRender(({ logger }, data) => {
|
|
|
70
70
|
logger[data.level]({ message: data.message, type: data.type });
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
export const clientCLIRenderer = pikkuCLIRender(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
73
|
+
// /**
|
|
74
|
+
// * Client-safe CLI renderer that outputs to console (no service dependencies)
|
|
75
|
+
// * This renderer can be used in CLI-over-channel clients
|
|
76
|
+
// */
|
|
77
|
+
// export const clientCLIRenderer = pikkuCLIRender<ForwardedLogMessage>(
|
|
78
|
+
// ({ logger }, data) => {
|
|
79
|
+
// if (data) {
|
|
80
|
+
// logger[data.level]?.({ message: data.message, type: data.type } as any)
|
|
81
|
+
// }
|
|
82
|
+
// }
|
|
83
|
+
// )
|
|
82
84
|
export const createConfig = async (_variablesService, data) => {
|
|
83
85
|
// Determine log level based on CLI flags with precedence:
|
|
84
86
|
// --silent > --loglevel > --verbose > --info > default (warn)
|
|
@@ -155,7 +157,7 @@ export const createSingletonServices = async (config) => {
|
|
|
155
157
|
type: 'CoreUserSession',
|
|
156
158
|
typePath: corePackagePath,
|
|
157
159
|
},
|
|
158
|
-
|
|
160
|
+
wireServicesType: {
|
|
159
161
|
file: corePackagePath,
|
|
160
162
|
variable: 'CoreServices',
|
|
161
163
|
type: 'CoreServices',
|
|
@@ -181,14 +183,16 @@ export const createSingletonServices = async (config) => {
|
|
|
181
183
|
// Run inspector WITHOUT filters to get full state
|
|
182
184
|
const wiringFiles = (await Promise.all(srcDirectories.map((dir) => glob(`${path.join(rootDir, dir)}/**/*.ts`, {
|
|
183
185
|
ignore: config.ignoreFiles || [],
|
|
186
|
+
absolute: true,
|
|
184
187
|
})))).flat();
|
|
185
188
|
unfilteredState = inspect(logger, wiringFiles, {
|
|
186
189
|
setupOnly,
|
|
190
|
+
rootDir,
|
|
187
191
|
types: {
|
|
188
192
|
configFileType: config.configFile,
|
|
189
193
|
userSessionType: config.userSessionType,
|
|
190
194
|
singletonServicesFactoryType: config.singletonServicesFactoryType,
|
|
191
|
-
|
|
195
|
+
wireServicesFactoryType: config.wireServicesFactoryType,
|
|
192
196
|
},
|
|
193
197
|
});
|
|
194
198
|
// Save unfiltered inspector state to file if stateOutput is provided
|
|
@@ -213,10 +217,11 @@ export const createSingletonServices = async (config) => {
|
|
|
213
217
|
config,
|
|
214
218
|
logger,
|
|
215
219
|
variables,
|
|
220
|
+
secrets: new LocalSecretService(variables),
|
|
216
221
|
getInspectorState,
|
|
217
222
|
};
|
|
218
223
|
};
|
|
219
|
-
export const
|
|
224
|
+
export const createWireServices = async ({ logger }, { cli, channel }) => {
|
|
220
225
|
const vChannel = cli ? cli.channel : channel;
|
|
221
226
|
if (!vChannel) {
|
|
222
227
|
throw new Error('No channel provided for CLI services');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FilesAndMethodsErrors } from '@pikku/inspector';
|
|
2
2
|
export type RequiredTypes = Partial<{
|
|
3
3
|
config: boolean;
|
|
4
|
-
|
|
4
|
+
wireServiceType: boolean;
|
|
5
5
|
singletonServicesType: boolean;
|
|
6
6
|
userSessionType: boolean;
|
|
7
7
|
singletonServicesFactory: boolean;
|
|
8
|
-
|
|
8
|
+
wireServicesFactory: boolean;
|
|
9
9
|
}>;
|
|
10
10
|
export declare const checkRequiredTypes: (errors: FilesAndMethodsErrors, requires?: RequiredTypes) => void;
|
|
@@ -13,7 +13,7 @@ export const checkRequiredTypes = (errors, requires = {}) => {
|
|
|
13
13
|
}
|
|
14
14
|
if (requires.config && message.includes('CoreConfig'))
|
|
15
15
|
return true;
|
|
16
|
-
if (requires.
|
|
16
|
+
if (requires.wireServiceType && message.includes('CoreServices'))
|
|
17
17
|
return true;
|
|
18
18
|
if (requires.singletonServicesType &&
|
|
19
19
|
message.includes('CoreSingletonServices'))
|
|
@@ -23,8 +23,7 @@ export const checkRequiredTypes = (errors, requires = {}) => {
|
|
|
23
23
|
if (requires.singletonServicesFactory &&
|
|
24
24
|
message.includes('CreateSingletonServices'))
|
|
25
25
|
return true;
|
|
26
|
-
if (requires.
|
|
27
|
-
message.includes('CreateSessionServices'))
|
|
26
|
+
if (requires.wireServicesFactory && message.includes('CreateWireServices'))
|
|
28
27
|
return true;
|
|
29
28
|
return false;
|
|
30
29
|
});
|
|
@@ -52,6 +52,8 @@ export class CommandSummary {
|
|
|
52
52
|
mcpEndpoints: 'MCP endpoint',
|
|
53
53
|
cliCommands: 'CLI command',
|
|
54
54
|
workflows: 'Workflow',
|
|
55
|
+
forgeNodes: 'Forge node',
|
|
56
|
+
workflowGraphs: 'Workflow graph',
|
|
55
57
|
};
|
|
56
58
|
for (const [key, label] of Object.entries(statLabels)) {
|
|
57
59
|
const value = this.stats[key];
|
|
@@ -1,40 +1,38 @@
|
|
|
1
|
+
// Sanitize a type name to be a valid TypeScript identifier
|
|
2
|
+
function sanitizeTypeName(name) {
|
|
3
|
+
// Replace hyphens with underscores
|
|
4
|
+
return name.replace(/-/g, '_');
|
|
5
|
+
}
|
|
1
6
|
export function generateCustomTypes(typesMap, requiredTypes) {
|
|
2
7
|
return `
|
|
3
|
-
// Custom types are those that are defined directly within generics
|
|
4
|
-
// or are broken into simpler types
|
|
5
8
|
${Array.from(typesMap.customTypes.entries())
|
|
6
|
-
.
|
|
9
|
+
.filter(([_name, { type }]) => {
|
|
10
|
+
const hasUndefinedGeneric = /\b(Name|In|Out|Key)\b/.test(type) && /\[.*\]/.test(type);
|
|
11
|
+
return !hasUndefinedGeneric;
|
|
12
|
+
})
|
|
13
|
+
.map(([originalName, { type, references }]) => {
|
|
14
|
+
const name = sanitizeTypeName(originalName);
|
|
7
15
|
references.forEach((refName) => {
|
|
8
|
-
// Skip __object types (including those with suffixes like __object_abc123)
|
|
9
|
-
// These are placeholder types created by the inspector for invalid/broken functions
|
|
10
|
-
// (e.g., functions with type errors or missing return statements). Attempting to
|
|
11
|
-
// import these would fail since the source files don't actually export __object.
|
|
12
16
|
if (refName !== '__object' && !refName.startsWith('__object_')) {
|
|
13
17
|
requiredTypes.add(refName);
|
|
14
18
|
}
|
|
15
19
|
});
|
|
16
|
-
// Extract type names from the type string that might not be in references
|
|
17
20
|
const typeString = type;
|
|
18
|
-
// Use regex to extract potential type names (PascalCase identifiers)
|
|
19
21
|
const typeNameRegex = /\b[A-Z][a-zA-Z0-9]*\b/g;
|
|
20
22
|
const potentialTypes = typeString.match(typeNameRegex) || [];
|
|
21
23
|
potentialTypes.forEach((typeName) => {
|
|
22
|
-
// Skip string literals and common keywords
|
|
23
24
|
if (typeString.includes(`"${typeName}"`) ||
|
|
24
25
|
['Pick', 'Omit', 'Partial', 'Required', 'Record', 'Readonly'].includes(typeName)) {
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
// Try to find this type in the typesMap and add it if found
|
|
28
28
|
try {
|
|
29
29
|
const typeMeta = typesMap.getTypeMeta(typeName);
|
|
30
30
|
if (typeMeta.path) {
|
|
31
|
-
// Add originalName to preserve canonical import name
|
|
32
31
|
requiredTypes.add(typeMeta.originalName);
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
|
-
catch
|
|
36
|
-
// Type not found in map (ambient/builtin type)
|
|
37
|
-
// Do NOT add to requiredTypes to avoid crashes in serializeImportMap
|
|
34
|
+
catch {
|
|
35
|
+
// Type not found in map (ambient/builtin type)
|
|
38
36
|
}
|
|
39
37
|
});
|
|
40
38
|
return `export type ${name} = ${type}`;
|
|
@@ -7,7 +7,7 @@ export const generateBootstrapFile = async (logger, config, bootstrapFile, speci
|
|
|
7
7
|
if (hasMiddleware) {
|
|
8
8
|
commonImports.push(config.middlewareFile);
|
|
9
9
|
}
|
|
10
|
-
commonImports.push(config.
|
|
10
|
+
commonImports.push(config.functionsMetaFile, config.functionsFile);
|
|
11
11
|
// Add schema if it exists
|
|
12
12
|
if (schemas) {
|
|
13
13
|
commonImports.push(`${config.schemaDirectory}/register.gen.ts`);
|
|
@@ -38,6 +38,10 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
38
38
|
...extendedConfig.packageMappings,
|
|
39
39
|
...config.packageMappings,
|
|
40
40
|
},
|
|
41
|
+
externalPackages: {
|
|
42
|
+
...extendedConfig.externalPackages,
|
|
43
|
+
...config.externalPackages,
|
|
44
|
+
},
|
|
41
45
|
ignoreFiles: config.ignoreFiles ??
|
|
42
46
|
extendedConfig.ignoreFiles ?? [
|
|
43
47
|
'**/*.test.ts',
|
|
@@ -47,7 +51,7 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
47
51
|
],
|
|
48
52
|
schema: {
|
|
49
53
|
additionalProperties: false,
|
|
50
|
-
supportsImportAttributes:
|
|
54
|
+
supportsImportAttributes: true,
|
|
51
55
|
...extendedConfig.schema,
|
|
52
56
|
...config.schema,
|
|
53
57
|
},
|
|
@@ -58,6 +62,7 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
58
62
|
...config,
|
|
59
63
|
configDir,
|
|
60
64
|
packageMappings: config.packageMappings || {},
|
|
65
|
+
externalPackages: config.externalPackages || {},
|
|
61
66
|
rootDir: config.rootDir
|
|
62
67
|
? resolve(configDir, config.rootDir)
|
|
63
68
|
: configDir,
|
|
@@ -69,7 +74,7 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
69
74
|
],
|
|
70
75
|
schema: {
|
|
71
76
|
additionalProperties: false,
|
|
72
|
-
supportsImportAttributes:
|
|
77
|
+
supportsImportAttributes: true,
|
|
73
78
|
...config.schema,
|
|
74
79
|
},
|
|
75
80
|
};
|
|
@@ -96,8 +101,8 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
96
101
|
if (!result.functionsMetaFile) {
|
|
97
102
|
result.functionsMetaFile = join(functionDir, 'pikku-functions-meta.gen.ts');
|
|
98
103
|
}
|
|
99
|
-
if (!result.
|
|
100
|
-
result.
|
|
104
|
+
if (!result.functionsMetaJsonFile) {
|
|
105
|
+
result.functionsMetaJsonFile = join(functionDir, 'pikku-functions-meta.gen.json');
|
|
101
106
|
}
|
|
102
107
|
if (!result.functionTypesFile) {
|
|
103
108
|
result.functionTypesFile = join(functionDir, 'pikku-function-types.gen.ts');
|
|
@@ -112,6 +117,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
112
117
|
if (!result.httpWiringMetaFile) {
|
|
113
118
|
result.httpWiringMetaFile = join(httpDir, 'pikku-http-wirings-meta.gen.ts');
|
|
114
119
|
}
|
|
120
|
+
if (!result.httpWiringMetaJsonFile) {
|
|
121
|
+
result.httpWiringMetaJsonFile = join(httpDir, 'pikku-http-wirings-meta.gen.json');
|
|
122
|
+
}
|
|
115
123
|
if (!result.httpMapDeclarationFile) {
|
|
116
124
|
result.httpMapDeclarationFile = join(httpDir, 'pikku-http-wirings-map.gen.d.ts');
|
|
117
125
|
}
|
|
@@ -125,6 +133,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
125
133
|
if (!result.channelsWiringMetaFile) {
|
|
126
134
|
result.channelsWiringMetaFile = join(channelDir, 'pikku-channels-meta.gen.ts');
|
|
127
135
|
}
|
|
136
|
+
if (!result.channelsWiringMetaJsonFile) {
|
|
137
|
+
result.channelsWiringMetaJsonFile = join(channelDir, 'pikku-channels-meta.gen.json');
|
|
138
|
+
}
|
|
128
139
|
if (!result.channelsMapDeclarationFile) {
|
|
129
140
|
result.channelsMapDeclarationFile = join(channelDir, 'pikku-channels-map.gen.d.ts');
|
|
130
141
|
}
|
|
@@ -135,6 +146,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
135
146
|
if (!result.rpcInternalWiringMetaFile) {
|
|
136
147
|
result.rpcInternalWiringMetaFile = join(rpcDir, 'pikku-rpc-wirings-meta.internal.gen.ts');
|
|
137
148
|
}
|
|
149
|
+
if (!result.rpcInternalWiringMetaJsonFile) {
|
|
150
|
+
result.rpcInternalWiringMetaJsonFile = join(rpcDir, 'pikku-rpc-wirings-meta.internal.gen.json');
|
|
151
|
+
}
|
|
138
152
|
if (!result.rpcInternalMapDeclarationFile) {
|
|
139
153
|
result.rpcInternalMapDeclarationFile = join(rpcDir, 'pikku-rpc-wirings-map.internal.gen.d.ts');
|
|
140
154
|
}
|
|
@@ -155,6 +169,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
155
169
|
if (!result.schedulersWiringMetaFile) {
|
|
156
170
|
result.schedulersWiringMetaFile = join(schedulerDir, 'pikku-schedulers-wirings-meta.gen.ts');
|
|
157
171
|
}
|
|
172
|
+
if (!result.schedulersWiringMetaJsonFile) {
|
|
173
|
+
result.schedulersWiringMetaJsonFile = join(schedulerDir, 'pikku-schedulers-wirings-meta.gen.json');
|
|
174
|
+
}
|
|
158
175
|
if (!result.schedulersTypesFile) {
|
|
159
176
|
result.schedulersTypesFile = join(schedulerDir, 'pikku-scheduler-types.gen.ts');
|
|
160
177
|
}
|
|
@@ -165,6 +182,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
165
182
|
if (!result.queueWorkersWiringMetaFile) {
|
|
166
183
|
result.queueWorkersWiringMetaFile = join(queueDir, 'pikku-queue-workers-wirings-meta.gen.ts');
|
|
167
184
|
}
|
|
185
|
+
if (!result.queueWorkersWiringMetaJsonFile) {
|
|
186
|
+
result.queueWorkersWiringMetaJsonFile = join(queueDir, 'pikku-queue-workers-wirings-meta.gen.json');
|
|
187
|
+
}
|
|
168
188
|
if (!result.queueMapDeclarationFile) {
|
|
169
189
|
result.queueMapDeclarationFile = join(queueDir, 'pikku-queue-workers-wirings-map.gen.d.ts');
|
|
170
190
|
}
|
|
@@ -187,6 +207,10 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
187
207
|
if (!result.workflowTypesFile) {
|
|
188
208
|
result.workflowTypesFile = join(workflowDir, 'pikku-workflow-types.gen.ts');
|
|
189
209
|
}
|
|
210
|
+
// Workflow meta directory (individual JSON files for each workflow)
|
|
211
|
+
if (!result.workflowMetaDir) {
|
|
212
|
+
result.workflowMetaDir = join(workflowDir, 'meta');
|
|
213
|
+
}
|
|
190
214
|
// Services
|
|
191
215
|
if (!result.servicesFile) {
|
|
192
216
|
result.servicesFile = join(result.outDir, 'pikku-services.gen.ts');
|
|
@@ -198,6 +222,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
198
222
|
if (!result.middlewareGroupsMetaFile) {
|
|
199
223
|
result.middlewareGroupsMetaFile = join(middlewareDir, 'pikku-middleware-groups-meta.gen.ts');
|
|
200
224
|
}
|
|
225
|
+
if (!result.middlewareGroupsMetaJsonFile) {
|
|
226
|
+
result.middlewareGroupsMetaJsonFile = join(middlewareDir, 'pikku-middleware-groups-meta.gen.json');
|
|
227
|
+
}
|
|
201
228
|
// Permissions
|
|
202
229
|
const permissionsDir = join(result.outDir, 'permissions');
|
|
203
230
|
if (!result.permissionsFile) {
|
|
@@ -207,10 +234,17 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
207
234
|
if (!result.bootstrapFile) {
|
|
208
235
|
result.bootstrapFile = join(result.outDir, 'pikku-bootstrap.gen.ts');
|
|
209
236
|
}
|
|
237
|
+
// Package service factories (for external packages)
|
|
238
|
+
if (!result.packageFile) {
|
|
239
|
+
result.packageFile = join(result.outDir, 'pikku-package.gen.ts');
|
|
240
|
+
}
|
|
210
241
|
// MCP
|
|
211
242
|
if (!result.mcpWiringsMetaFile) {
|
|
212
243
|
result.mcpWiringsMetaFile = join(mcpDir, 'pikku-mcp-wirings-meta.gen.ts');
|
|
213
244
|
}
|
|
245
|
+
if (!result.mcpWiringsMetaJsonFile) {
|
|
246
|
+
result.mcpWiringsMetaJsonFile = join(mcpDir, 'pikku-mcp-wirings-meta.gen.json');
|
|
247
|
+
}
|
|
214
248
|
if (!result.mcpWiringsFile) {
|
|
215
249
|
result.mcpWiringsFile = join(mcpDir, 'pikku-mcp-wirings.gen.ts');
|
|
216
250
|
}
|
|
@@ -227,12 +261,23 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
227
261
|
if (!result.cliWiringMetaFile) {
|
|
228
262
|
result.cliWiringMetaFile = join(cliDir, 'pikku-cli-wirings-meta.gen.ts');
|
|
229
263
|
}
|
|
264
|
+
if (!result.cliWiringMetaJsonFile) {
|
|
265
|
+
result.cliWiringMetaJsonFile = join(cliDir, 'pikku-cli-wirings-meta.gen.json');
|
|
266
|
+
}
|
|
230
267
|
if (!result.cliBootstrapFile) {
|
|
231
268
|
result.cliBootstrapFile = join(cliDir, 'pikku-cli-bootstrap.gen.ts');
|
|
232
269
|
}
|
|
233
270
|
if (!result.cliTypesFile) {
|
|
234
271
|
result.cliTypesFile = join(cliDir, 'pikku-cli-types.gen.ts');
|
|
235
272
|
}
|
|
273
|
+
// Forge
|
|
274
|
+
const forgeDir = join(result.outDir, 'forge');
|
|
275
|
+
if (!result.forgeNodesMetaJsonFile) {
|
|
276
|
+
result.forgeNodesMetaJsonFile = join(forgeDir, 'pikku-forge-nodes-meta.gen.json');
|
|
277
|
+
}
|
|
278
|
+
if (!result.forgeTypesFile) {
|
|
279
|
+
result.forgeTypesFile = join(forgeDir, 'pikku-forge-types.gen.ts');
|
|
280
|
+
}
|
|
236
281
|
if (requiredFields.length > 0) {
|
|
237
282
|
validateCLIConfig(result, requiredFields);
|
|
238
283
|
}
|
|
@@ -252,6 +297,22 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
252
297
|
if (!isAbsolute(result.tsconfig)) {
|
|
253
298
|
result.tsconfig = join(result.rootDir, result.tsconfig);
|
|
254
299
|
}
|
|
300
|
+
if (result.externalPackage) {
|
|
301
|
+
const packageJsonPath = join(result.rootDir, 'package.json');
|
|
302
|
+
try {
|
|
303
|
+
const packageJsonContent = await readFile(packageJsonPath, 'utf-8');
|
|
304
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
305
|
+
if (!packageJson.name ||
|
|
306
|
+
typeof packageJson.name !== 'string' ||
|
|
307
|
+
packageJson.name.trim() === '') {
|
|
308
|
+
throw new Error(`package.json at ${packageJsonPath} is missing a valid "name" field`);
|
|
309
|
+
}
|
|
310
|
+
result.externalPackageName = packageJson.name;
|
|
311
|
+
}
|
|
312
|
+
catch (e) {
|
|
313
|
+
throw new Error(`externalPackage is true but could not read or parse package.json at ${packageJsonPath}: ${e.message}`);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
255
316
|
return result;
|
|
256
317
|
}
|
|
257
318
|
catch (e) {
|
|
@@ -8,11 +8,11 @@ interface Meta {
|
|
|
8
8
|
}
|
|
9
9
|
export type FilesAndMethods = {
|
|
10
10
|
userSessionType: Meta;
|
|
11
|
-
|
|
11
|
+
wireServicesType: Meta;
|
|
12
12
|
singletonServicesType: Meta;
|
|
13
13
|
pikkuConfigFactory: Meta;
|
|
14
14
|
singletonServicesFactory: Meta;
|
|
15
|
-
|
|
15
|
+
wireServicesFactory: Meta;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* @deprecated Use state.filesAndMethods from InspectorState instead
|
|
@@ -45,16 +45,16 @@ const getMetaTypes = (type, map, desiredType) => {
|
|
|
45
45
|
* @deprecated Use state.filesAndMethods from InspectorState instead
|
|
46
46
|
*/
|
|
47
47
|
export const getPikkuFilesAndMethods = async (state, options = {}) => {
|
|
48
|
-
const { singletonServicesTypeImportMap,
|
|
49
|
-
const { configFileType, userSessionType, singletonServicesFactoryType,
|
|
48
|
+
const { singletonServicesTypeImportMap, wireServicesTypeImportMap, userSessionTypeImportMap, wireServicesFactories, singletonServicesFactories, configFactories, } = state;
|
|
49
|
+
const { configFileType, userSessionType, singletonServicesFactoryType, wireServicesFactoryType, } = options;
|
|
50
50
|
let errors = new Map();
|
|
51
51
|
const result = {
|
|
52
52
|
userSessionType: getMetaTypes('CoreUserSession', userSessionTypeImportMap, userSessionType),
|
|
53
53
|
singletonServicesType: getMetaTypes('CoreSingletonServices', singletonServicesTypeImportMap),
|
|
54
|
-
|
|
54
|
+
wireServicesType: getMetaTypes('CoreServices', wireServicesTypeImportMap),
|
|
55
55
|
pikkuConfigFactory: getMetaTypes('CoreConfig', configFactories, configFileType),
|
|
56
56
|
singletonServicesFactory: getMetaTypes('CreateSingletonServices', singletonServicesFactories, singletonServicesFactoryType),
|
|
57
|
-
|
|
57
|
+
wireServicesFactory: getMetaTypes('CreateWireServices', wireServicesFactories, wireServicesFactoryType),
|
|
58
58
|
};
|
|
59
59
|
if (errors.size > 0) {
|
|
60
60
|
const result = ['Found errors:'];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FunctionsMeta, JSONValue } from '@pikku/core';
|
|
2
2
|
import { HTTPWiringsMeta } from '@pikku/core/http';
|
|
3
|
-
import { TypesMap } from '@pikku/inspector';
|
|
3
|
+
import { TypesMap, ZodSchemaRef } from '@pikku/inspector';
|
|
4
4
|
import { CLILogger } from '../services/cli-logger.service.js';
|
|
5
|
-
export declare function generateSchemas(logger: CLILogger, tsconfig: string, typesMap: TypesMap, functionMeta: FunctionsMeta, httpWiringsMeta: HTTPWiringsMeta, additionalTypes?: string[], additionalProperties?: boolean): Promise<Record<string, JSONValue>>;
|
|
6
|
-
export declare function
|
|
5
|
+
export declare function generateSchemas(logger: CLILogger, tsconfig: string, typesMap: TypesMap, functionMeta: FunctionsMeta, httpWiringsMeta: HTTPWiringsMeta, additionalTypes?: string[], additionalProperties?: boolean, zodLookup?: Map<string, ZodSchemaRef>): Promise<Record<string, JSONValue>>;
|
|
6
|
+
export declare function generateZodSchemas(logger: CLILogger, zodLookup: Map<string, ZodSchemaRef>, typesMap: TypesMap): Promise<Record<string, JSONValue>>;
|
|
7
|
+
export declare function saveSchemas(logger: CLILogger, schemaParentDir: string, schemas: Record<string, JSONValue>, typesMap: TypesMap, functionsMeta: FunctionsMeta, supportsImportAttributes: boolean, additionalTypes?: string[], zodLookup?: Map<string, ZodSchemaRef>, packageName?: string | null): Promise<void>;
|