@pikku/cli 0.9.14 → 0.9.16-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pikku/channel/pikku-channel-types.gen.ts +92 -0
- package/.pikku/cli/pikku-cli-types.gen.ts +71 -0
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +5 -0
- package/.pikku/cli/pikku-cli-wirings.gen.ts +4 -0
- package/.pikku/function/pikku-function-types.gen.ts +292 -0
- package/.pikku/function/pikku-functions-meta.gen.ts +817 -0
- package/.pikku/function/pikku-functions-meta.min.gen.ts +176 -0
- package/.pikku/function/pikku-functions.gen.ts +74 -0
- package/.pikku/http/pikku-http-types.gen.ts +61 -0
- package/.pikku/mcp/pikku-mcp-types.gen.ts +138 -0
- package/.pikku/pikku-bootstrap.gen.ts +9 -0
- package/.pikku/pikku-services.gen.ts +24 -0
- package/.pikku/pikku-types.gen.ts +28 -0
- package/.pikku/queue/pikku-queue-types.gen.ts +28 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +46 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +80 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +40 -0
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +26 -0
- package/.pikku/schemas/register.gen.ts +47 -0
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuCLIOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuFunctionsOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuHTTPOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuMCPOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuMiddlewareOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuRPCOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuSchedulerOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -0
- package/CHANGELOG.md +15 -0
- package/bin/pikku.ts +45 -14
- package/build.sh +53 -0
- package/cli.schema.json +1 -382
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +65 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js +54 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +55 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.js +30 -0
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +5 -0
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +4 -0
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +5 -0
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +259 -0
- package/dist/.pikku/function/pikku-function-types.gen.js +175 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.d.ts +1 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.js +817 -0
- package/dist/.pikku/function/pikku-functions-meta.min.gen.d.ts +1 -0
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +176 -0
- package/dist/.pikku/function/pikku-functions.gen.d.ts +1 -0
- package/dist/.pikku/function/pikku-functions.gen.js +73 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +49 -0
- package/dist/.pikku/http/pikku-http-types.gen.js +41 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +88 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +71 -0
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +9 -0
- package/dist/.pikku/pikku-bootstrap.gen.js +9 -0
- package/dist/.pikku/pikku-services.gen.d.ts +16 -0
- package/dist/.pikku/pikku-services.gen.js +11 -0
- package/dist/.pikku/pikku-types.gen.d.ts +14 -0
- package/dist/.pikku/pikku-types.gen.js +21 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
- package/dist/.pikku/rpc/pikku-bootstrap-rpc.gen.d.ts +6 -0
- package/dist/.pikku/rpc/pikku-bootstrap-rpc.gen.js +6 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +40 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
- package/dist/.pikku/schemas/register.gen.d.ts +1 -0
- package/dist/.pikku/schemas/register.gen.js +26 -0
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCLIOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuFunctionsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuHTTPOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMCPOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMiddlewareOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuRPCOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSchedulerOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -0
- package/dist/bin/pikku.d.ts +1 -1
- package/dist/bin/pikku.js +32 -14
- package/dist/src/cli.wiring.d.ts +1 -0
- package/dist/src/cli.wiring.js +75 -0
- package/dist/src/functions/commands/all.d.ts +1 -0
- package/dist/src/functions/commands/all.js +104 -0
- package/dist/src/functions/commands/watch.d.ts +1 -0
- package/dist/src/functions/commands/watch.js +47 -0
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -0
- package/dist/src/{runtimes → functions/runtimes}/nextjs/pikku-command-nextjs.js +28 -9
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -0
- package/dist/src/functions/wirings/channels/pikku-channels.js +24 -0
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -0
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.js +21 -0
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -0
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.js +23 -0
- package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -0
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +25 -0
- package/dist/src/functions/wirings/channels/pikku-command-websocket-typed.d.ts +1 -0
- package/dist/src/functions/wirings/channels/pikku-command-websocket-typed.js +24 -0
- package/dist/src/functions/wirings/channels/serialize-channel-types.d.ts +4 -0
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +95 -0
- package/dist/src/{wirings → functions/wirings}/channels/serialize-typed-channel-map.js +2 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.d.ts +1 -0
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +100 -0
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +1 -0
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +33 -0
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -0
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +24 -0
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.d.ts +7 -0
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +54 -0
- package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +9 -0
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +84 -0
- package/dist/src/functions/wirings/cli/serialize-cli-types.d.ts +4 -0
- package/dist/src/functions/wirings/cli/serialize-cli-types.js +74 -0
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.d.ts +14 -0
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +46 -0
- package/dist/src/functions/wirings/fetch/index.d.ts +1 -0
- package/dist/src/functions/wirings/fetch/index.js +24 -0
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +1 -0
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +32 -0
- package/dist/src/functions/wirings/functions/pikku-command-function-types.d.ts +1 -0
- package/dist/src/functions/wirings/functions/pikku-command-function-types.js +20 -0
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -0
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +28 -0
- package/dist/src/{wirings → functions/wirings}/functions/pikku-command-services.d.ts +1 -2
- package/dist/src/{wirings → functions/wirings}/functions/pikku-command-services.js +27 -10
- package/dist/src/functions/wirings/functions/pikku-function-types.d.ts +1 -0
- package/dist/src/functions/wirings/functions/pikku-function-types.js +20 -0
- package/dist/src/functions/wirings/functions/schemas.d.ts +4 -0
- package/dist/src/functions/wirings/functions/schemas.js +22 -0
- package/dist/src/{wirings → functions/wirings}/functions/serialize-function-imports.js +4 -21
- package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +4 -0
- package/dist/src/functions/wirings/functions/serialize-function-types.js +295 -0
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.d.ts +4 -0
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.js +31 -0
- package/dist/src/{wirings → functions/wirings}/http/openapi-spec-generator.d.ts +2 -1
- package/dist/src/{wirings → functions/wirings}/http/openapi-spec-generator.js +2 -2
- package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -0
- package/dist/src/functions/wirings/http/pikku-command-http-map.js +23 -0
- package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -0
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +25 -0
- package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -0
- package/dist/src/functions/wirings/http/pikku-command-http-types.js +21 -0
- package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -0
- package/dist/src/functions/wirings/http/pikku-command-openapi.js +34 -0
- package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +1 -0
- package/dist/src/functions/wirings/http/pikku-http-routes.js +25 -0
- package/dist/src/functions/wirings/http/serialize-http-types.d.ts +4 -0
- package/dist/src/functions/wirings/http/serialize-http-types.js +64 -0
- package/dist/src/{wirings → functions/wirings}/http/serialize-typed-http-map.js +2 -2
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +1 -0
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.js +28 -0
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.d.ts +1 -0
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.js +21 -0
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.d.ts +1 -0
- package/dist/src/{wirings → functions/wirings}/mcp/pikku-command-mcp.js +22 -5
- package/dist/src/{wirings → functions/wirings}/mcp/serialize-mcp-json.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.d.ts +4 -0
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +141 -0
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -0
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +38 -0
- package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.d.ts +8 -0
- package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.js +50 -0
- package/dist/src/functions/wirings/middleware/serialize-middleware-imports.d.ts +2 -0
- package/dist/src/functions/wirings/middleware/serialize-middleware-imports.js +43 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +1 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.js +23 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.js +24 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.d.ts +1 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.js +21 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -0
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +26 -0
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -0
- package/dist/src/functions/wirings/queue/pikku-queue-map.js +23 -0
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +1 -0
- package/dist/src/functions/wirings/queue/pikku-queue.js +25 -0
- package/dist/src/{wirings → functions/wirings}/queue/serialize-queue-map.js +2 -2
- package/dist/src/functions/wirings/queue/serialize-queue-types.d.ts +4 -0
- package/dist/src/functions/wirings/queue/serialize-queue-types.js +31 -0
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -0
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.js +25 -0
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +2 -0
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.js +36 -0
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +1 -0
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +22 -0
- package/dist/src/{wirings → functions/wirings}/rpc/serialize-typed-rpc-map.js +2 -2
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.d.ts +1 -0
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.js +21 -0
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.d.ts +1 -0
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +26 -0
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.d.ts +4 -0
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +29 -0
- package/dist/src/middleware/log-command-info-and-time.d.ts +19 -0
- package/dist/src/middleware/log-command-info-and-time.js +27 -0
- package/dist/src/serialize-pikku-types.js +2 -2
- package/dist/src/services/cli-logger-forwarder.service.d.ts +26 -0
- package/dist/src/services/cli-logger-forwarder.service.js +55 -0
- package/dist/src/services/cli-logger.service.d.ts +19 -0
- package/dist/src/services/cli-logger.service.js +66 -0
- package/dist/src/services.d.ts +15 -0
- package/dist/src/services.js +64 -0
- package/dist/src/utils/check-required-types.d.ts +10 -0
- package/dist/src/utils/check-required-types.js +31 -0
- package/dist/src/utils/custom-types-generator.d.ts +2 -0
- package/dist/src/utils/custom-types-generator.js +37 -0
- package/dist/src/utils/file-import-path.d.ts +1 -0
- package/dist/src/utils/file-import-path.js +43 -0
- package/dist/src/utils/file-imports-serializer.d.ts +1 -0
- package/dist/src/utils/file-imports-serializer.js +13 -0
- package/dist/src/utils/file-writer.d.ts +6 -0
- package/dist/src/utils/file-writer.js +40 -0
- package/dist/src/utils/generate-bootstrap-file.d.ts +3 -0
- package/dist/src/utils/generate-bootstrap-file.js +21 -0
- package/dist/src/utils/pikku-cli-config.d.ts +5 -0
- package/dist/src/utils/pikku-cli-config.js +243 -0
- package/dist/src/utils/pikku-files-and-methods.d.ts +21 -0
- package/dist/src/utils/pikku-files-and-methods.js +70 -0
- package/dist/src/{schema-generator.d.ts → utils/schema-generator.d.ts} +1 -1
- package/dist/src/{schema-generator.js → utils/schema-generator.js} +1 -1
- package/dist/src/{serialize-import-map.js → utils/serialize-import-map.js} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/pikku.config.json +24 -0
- package/src/cli.wiring.ts +75 -0
- package/src/functions/commands/all.ts +141 -0
- package/src/functions/commands/watch.ts +58 -0
- package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +111 -0
- package/src/functions/wirings/channels/pikku-channels.ts +40 -0
- package/src/functions/wirings/channels/pikku-command-channel-types.ts +27 -0
- package/src/functions/wirings/channels/pikku-command-channels-map.ts +31 -0
- package/src/functions/wirings/channels/pikku-command-channels.ts +45 -0
- package/src/functions/wirings/channels/pikku-command-websocket-typed.ts +33 -0
- package/src/functions/wirings/channels/serialize-channel-types.ts +95 -0
- package/src/{wirings → functions/wirings}/channels/serialize-typed-channel-map.ts +2 -2
- package/src/functions/wirings/cli/pikku-command-cli-entry.ts +173 -0
- package/src/functions/wirings/cli/pikku-command-cli-types.ts +50 -0
- package/src/functions/wirings/cli/pikku-command-cli.ts +41 -0
- package/src/functions/wirings/cli/serialize-channel-cli-client.ts +72 -0
- package/src/functions/wirings/cli/serialize-channel-cli.ts +123 -0
- package/src/functions/wirings/cli/serialize-cli-types.ts +80 -0
- package/src/functions/wirings/cli/serialize-local-cli-bootstrap.ts +75 -0
- package/src/functions/wirings/fetch/index.ts +32 -0
- package/src/functions/wirings/functions/pikku-command-function-types-split.ts +51 -0
- package/src/functions/wirings/functions/pikku-command-function-types.ts +45 -0
- package/src/functions/wirings/functions/pikku-command-functions.ts +61 -0
- package/src/{wirings → functions/wirings}/functions/pikku-command-services.ts +41 -44
- package/src/functions/wirings/functions/pikku-function-types.ts +45 -0
- package/src/functions/wirings/functions/schemas.ts +47 -0
- package/src/{wirings → functions/wirings}/functions/serialize-function-imports.ts +4 -30
- package/src/functions/wirings/functions/serialize-function-types.ts +303 -0
- package/src/functions/wirings/functions/serialize-pikku-types-hub.ts +39 -0
- package/src/{wirings → functions/wirings}/http/openapi-spec-generator.ts +3 -1
- package/src/functions/wirings/http/pikku-command-http-map.ts +32 -0
- package/src/functions/wirings/http/pikku-command-http-routes.ts +41 -0
- package/src/functions/wirings/http/pikku-command-http-types.ts +27 -0
- package/src/functions/wirings/http/pikku-command-openapi.ts +57 -0
- package/src/functions/wirings/http/pikku-http-routes.ts +40 -0
- package/src/functions/wirings/http/serialize-http-types.ts +64 -0
- package/src/{wirings → functions/wirings}/http/serialize-typed-http-map.ts +2 -2
- package/src/functions/wirings/mcp/pikku-command-mcp-json.ts +38 -0
- package/src/functions/wirings/mcp/pikku-command-mcp-types.ts +27 -0
- package/src/{wirings → functions/wirings}/mcp/pikku-command-mcp.ts +55 -46
- package/src/{wirings → functions/wirings}/mcp/serialize-mcp-json.ts +1 -1
- package/src/functions/wirings/mcp/serialize-mcp-types.ts +141 -0
- package/src/functions/wirings/middleware/pikku-command-middleware.ts +65 -0
- package/src/functions/wirings/middleware/serialize-middleware-groups-meta.ts +61 -0
- package/src/functions/wirings/middleware/serialize-middleware-imports.ts +78 -0
- package/src/functions/wirings/queue/pikku-command-queue-map.ts +31 -0
- package/src/functions/wirings/queue/pikku-command-queue-service.ts +33 -0
- package/src/functions/wirings/queue/pikku-command-queue-types.ts +27 -0
- package/src/functions/wirings/queue/pikku-command-queue.ts +46 -0
- package/src/functions/wirings/queue/pikku-queue-map.ts +31 -0
- package/src/functions/wirings/queue/pikku-queue.ts +44 -0
- package/src/{wirings → functions/wirings}/queue/serialize-queue-map.ts +2 -2
- package/src/functions/wirings/queue/serialize-queue-types.ts +31 -0
- package/src/functions/wirings/rpc/pikku-command-rpc-client.ts +32 -0
- package/src/functions/wirings/rpc/pikku-command-rpc-map.ts +52 -0
- package/src/functions/wirings/rpc/pikku-command-rpc.ts +28 -0
- package/src/{wirings → functions/wirings}/rpc/serialize-typed-rpc-map.ts +2 -2
- package/src/functions/wirings/scheduler/pikku-command-scheduler-types.ts +27 -0
- package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +46 -0
- package/src/functions/wirings/scheduler/serialize-scheduler-types.ts +29 -0
- package/src/middleware/log-command-info-and-time.ts +61 -0
- package/src/serialize-pikku-types.ts +2 -2
- package/src/services/cli-logger-forwarder.service.ts +77 -0
- package/src/services/cli-logger.service.ts +78 -0
- package/src/services.ts +111 -0
- package/src/utils/check-required-types.ts +53 -0
- package/src/utils/custom-types-generator.ts +49 -0
- package/src/{utils.test.ts → utils/file-import-path.test.ts} +1 -1
- package/src/utils/file-import-path.ts +53 -0
- package/src/utils/file-imports-serializer.ts +25 -0
- package/src/utils/file-writer.ts +56 -0
- package/src/utils/generate-bootstrap-file.ts +43 -0
- package/src/utils/pikku-cli-config.ts +356 -0
- package/src/utils/pikku-files-and-methods.ts +148 -0
- package/src/{schema-generator.ts → utils/schema-generator.ts} +3 -1
- package/src/{serialize-import-map.ts → utils/serialize-import-map.ts} +1 -1
- package/tsconfig.json +2 -2
- package/types/application-types.d.ts +20 -0
- package/types/config.d.ts +192 -0
- package/bin/pikku-all.ts +0 -349
- package/bin/pikku-fetch.ts +0 -27
- package/bin/pikku-nextjs.ts +0 -44
- package/bin/pikku-openapi.ts +0 -31
- package/bin/pikku-queue-service.ts +0 -28
- package/bin/pikku-rpc.ts +0 -28
- package/bin/pikku-schemas.ts +0 -31
- package/bin/pikku-websocket.ts +0 -28
- package/dist/bin/pikku-all.d.ts +0 -4
- package/dist/bin/pikku-all.js +0 -194
- package/dist/bin/pikku-fetch.d.ts +0 -4
- package/dist/bin/pikku-fetch.js +0 -19
- package/dist/bin/pikku-nextjs.d.ts +0 -4
- package/dist/bin/pikku-nextjs.js +0 -24
- package/dist/bin/pikku-openapi.d.ts +0 -2
- package/dist/bin/pikku-openapi.js +0 -19
- package/dist/bin/pikku-queue-service.d.ts +0 -4
- package/dist/bin/pikku-queue-service.js +0 -19
- package/dist/bin/pikku-rpc.d.ts +0 -4
- package/dist/bin/pikku-rpc.js +0 -19
- package/dist/bin/pikku-schemas.d.ts +0 -2
- package/dist/bin/pikku-schemas.js +0 -21
- package/dist/bin/pikku-websocket.d.ts +0 -4
- package/dist/bin/pikku-websocket.js +0 -19
- package/dist/src/inspector-glob.d.ts +0 -2
- package/dist/src/inspector-glob.js +0 -12
- package/dist/src/pikku-cli-config.d.ts +0 -56
- package/dist/src/pikku-cli-config.js +0 -203
- package/dist/src/pikku-command-schemas.d.ts +0 -2
- package/dist/src/pikku-command-schemas.js +0 -8
- package/dist/src/runtimes/nextjs/pikku-command-nextjs.d.ts +0 -2
- package/dist/src/schemas.d.ts +0 -2
- package/dist/src/schemas.js +0 -8
- package/dist/src/types.d.ts +0 -5
- package/dist/src/utils.d.ts +0 -60
- package/dist/src/utils.js +0 -248
- package/dist/src/wirings/channels/pikku-channels.d.ts +0 -2
- package/dist/src/wirings/channels/pikku-channels.js +0 -9
- package/dist/src/wirings/channels/pikku-command-channels-map.d.ts +0 -2
- package/dist/src/wirings/channels/pikku-command-channels-map.js +0 -8
- package/dist/src/wirings/channels/pikku-command-channels.d.ts +0 -2
- package/dist/src/wirings/channels/pikku-command-channels.js +0 -9
- package/dist/src/wirings/channels/pikku-command-websocket-typed.d.ts +0 -2
- package/dist/src/wirings/channels/pikku-command-websocket-typed.js +0 -15
- package/dist/src/wirings/fetch/index.d.ts +0 -2
- package/dist/src/wirings/fetch/index.js +0 -12
- package/dist/src/wirings/functions/pikku-command-function-types.d.ts +0 -2
- package/dist/src/wirings/functions/pikku-command-function-types.js +0 -13
- package/dist/src/wirings/functions/pikku-command-functions.d.ts +0 -2
- package/dist/src/wirings/functions/pikku-command-functions.js +0 -14
- package/dist/src/wirings/functions/pikku-function-types.d.ts +0 -2
- package/dist/src/wirings/functions/pikku-function-types.js +0 -13
- package/dist/src/wirings/http/pikku-command-http-map.d.ts +0 -2
- package/dist/src/wirings/http/pikku-command-http-map.js +0 -8
- package/dist/src/wirings/http/pikku-command-http-routes.d.ts +0 -2
- package/dist/src/wirings/http/pikku-command-http-routes.js +0 -9
- package/dist/src/wirings/http/pikku-command-openapi.d.ts +0 -2
- package/dist/src/wirings/http/pikku-command-openapi.js +0 -20
- package/dist/src/wirings/http/pikku-http-routes.d.ts +0 -2
- package/dist/src/wirings/http/pikku-http-routes.js +0 -9
- package/dist/src/wirings/mcp/pikku-command-mcp-json.d.ts +0 -2
- package/dist/src/wirings/mcp/pikku-command-mcp-json.js +0 -13
- package/dist/src/wirings/mcp/pikku-command-mcp.d.ts +0 -2
- package/dist/src/wirings/queue/pikku-command-queue-map.d.ts +0 -2
- package/dist/src/wirings/queue/pikku-command-queue-map.js +0 -8
- package/dist/src/wirings/queue/pikku-command-queue-service.d.ts +0 -2
- package/dist/src/wirings/queue/pikku-command-queue-service.js +0 -15
- package/dist/src/wirings/queue/pikku-command-queue.d.ts +0 -2
- package/dist/src/wirings/queue/pikku-command-queue.js +0 -10
- package/dist/src/wirings/queue/pikku-queue-map.d.ts +0 -2
- package/dist/src/wirings/queue/pikku-queue-map.js +0 -8
- package/dist/src/wirings/queue/pikku-queue.d.ts +0 -2
- package/dist/src/wirings/queue/pikku-queue.js +0 -10
- package/dist/src/wirings/rpc/pikku-command-rpc-client.d.ts +0 -2
- package/dist/src/wirings/rpc/pikku-command-rpc-client.js +0 -15
- package/dist/src/wirings/rpc/pikku-command-rpc-map.d.ts +0 -3
- package/dist/src/wirings/rpc/pikku-command-rpc-map.js +0 -14
- package/dist/src/wirings/rpc/pikku-command-rpc.d.ts +0 -2
- package/dist/src/wirings/rpc/pikku-command-rpc.js +0 -8
- package/dist/src/wirings/scheduler/pikku-command-scheduler.d.ts +0 -2
- package/dist/src/wirings/scheduler/pikku-command-scheduler.js +0 -10
- package/src/inspector-glob.ts +0 -30
- package/src/pikku-cli-config.ts +0 -387
- package/src/pikku-command-schemas.ts +0 -35
- package/src/runtimes/nextjs/pikku-command-nextjs.ts +0 -110
- package/src/schemas.ts +0 -35
- package/src/types.ts +0 -16
- package/src/utils.ts +0 -420
- package/src/wirings/channels/pikku-channels.ts +0 -41
- package/src/wirings/channels/pikku-command-channels-map.ts +0 -26
- package/src/wirings/channels/pikku-command-channels.ts +0 -39
- package/src/wirings/channels/pikku-command-websocket-typed.ts +0 -36
- package/src/wirings/fetch/index.ts +0 -33
- package/src/wirings/functions/pikku-command-function-types.ts +0 -53
- package/src/wirings/functions/pikku-command-functions.ts +0 -48
- package/src/wirings/functions/pikku-function-types.ts +0 -52
- package/src/wirings/http/pikku-command-http-map.ts +0 -27
- package/src/wirings/http/pikku-command-http-routes.ts +0 -40
- package/src/wirings/http/pikku-command-openapi.ts +0 -55
- package/src/wirings/http/pikku-http-routes.ts +0 -40
- package/src/wirings/mcp/pikku-command-mcp-json.ts +0 -33
- package/src/wirings/queue/pikku-command-queue-map.ts +0 -26
- package/src/wirings/queue/pikku-command-queue-service.ts +0 -36
- package/src/wirings/queue/pikku-command-queue.ts +0 -45
- package/src/wirings/queue/pikku-queue-map.ts +0 -26
- package/src/wirings/queue/pikku-queue.ts +0 -43
- package/src/wirings/rpc/pikku-command-rpc-client.ts +0 -35
- package/src/wirings/rpc/pikku-command-rpc-map.ts +0 -49
- package/src/wirings/rpc/pikku-command-rpc.ts +0 -24
- package/src/wirings/scheduler/pikku-command-scheduler.ts +0 -43
- /package/dist/{src/types.js → .pikku/cli/pikku-cli-wirings-meta.gen.d.ts} +0 -0
- /package/dist/src/{runtimes → functions/runtimes}/nextjs/serialize-nextjs-backend-wrapper.d.ts +0 -0
- /package/dist/src/{runtimes → functions/runtimes}/nextjs/serialize-nextjs-backend-wrapper.js +0 -0
- /package/dist/src/{runtimes → functions/runtimes}/nextjs/serialize-nextjs-http-wrapper.d.ts +0 -0
- /package/dist/src/{runtimes → functions/runtimes}/nextjs/serialize-nextjs-http-wrapper.js +0 -0
- /package/dist/src/{wirings → functions/wirings}/channels/serialize-typed-channel-map.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/channels/serialize-websocket-wrapper.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/channels/serialize-websocket-wrapper.js +0 -0
- /package/dist/src/{wirings → functions/wirings}/functions/serialize-function-imports.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/http/serialize-fetch-wrapper.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/http/serialize-fetch-wrapper.js +0 -0
- /package/dist/src/{wirings → functions/wirings}/http/serialize-typed-http-map.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/mcp/serialize-mcp-json.js +0 -0
- /package/dist/src/{wirings → functions/wirings}/queue/serialize-queue-map.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/queue/serialize-queue-meta.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/queue/serialize-queue-meta.js +0 -0
- /package/dist/src/{wirings → functions/wirings}/queue/serialize-queue-wrapper.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/queue/serialize-queue-wrapper.js +0 -0
- /package/dist/src/{wirings → functions/wirings}/rpc/serialize-rpc-wrapper.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/rpc/serialize-rpc-wrapper.js +0 -0
- /package/dist/src/{wirings → functions/wirings}/rpc/serialize-typed-rpc-map.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/scheduler/serialize-scheduler-meta.d.ts +0 -0
- /package/dist/src/{wirings → functions/wirings}/scheduler/serialize-scheduler-meta.js +0 -0
- /package/dist/src/{serialize-import-map.d.ts → utils/serialize-import-map.d.ts} +0 -0
- /package/src/{runtimes → functions/runtimes}/nextjs/serialize-nextjs-backend-wrapper.ts +0 -0
- /package/src/{runtimes → functions/runtimes}/nextjs/serialize-nextjs-http-wrapper.ts +0 -0
- /package/src/{wirings → functions/wirings}/channels/serialize-websocket-wrapper.ts +0 -0
- /package/src/{wirings → functions/wirings}/http/serialize-fetch-wrapper.ts +0 -0
- /package/src/{wirings → functions/wirings}/queue/serialize-queue-meta.ts +0 -0
- /package/src/{wirings → functions/wirings}/queue/serialize-queue-wrapper.ts +0 -0
- /package/src/{wirings → functions/wirings}/rpc/serialize-rpc-wrapper.ts +0 -0
- /package/src/{wirings → functions/wirings}/scheduler/serialize-scheduler-meta.ts +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
4
|
+
import { serializeQueueMap } from './serialize-queue-map.js';
|
|
5
|
+
export const pikkuQueueMap = pikkuSessionlessFunc({
|
|
6
|
+
func: async ({ logger, config, getInspectorState }) => {
|
|
7
|
+
const { queueWorkers, functions } = await getInspectorState();
|
|
8
|
+
const { queueMapDeclarationFile, packageMappings } = config;
|
|
9
|
+
const content = serializeQueueMap(queueMapDeclarationFile, packageMappings, functions.typesMap, functions.meta, queueWorkers.meta);
|
|
10
|
+
await writeFileInDir(logger, queueMapDeclarationFile, content);
|
|
11
|
+
},
|
|
12
|
+
middleware: [
|
|
13
|
+
logCommandInfoAndTime({
|
|
14
|
+
commandStart: 'Creating Queue map',
|
|
15
|
+
commandEnd: 'Created Queue map',
|
|
16
|
+
skipCondition: async ({ getInspectorState }) => {
|
|
17
|
+
const { queueWorkers } = await getInspectorState();
|
|
18
|
+
return queueWorkers.files.size === 0;
|
|
19
|
+
},
|
|
20
|
+
skipMessage: 'none found',
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuQueueService: any;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
3
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { serializeQueueWrapper } from './serialize-queue-wrapper.js';
|
|
6
|
+
export const pikkuQueueService = pikkuSessionlessFunc({
|
|
7
|
+
func: async ({ logger, config }) => {
|
|
8
|
+
const { queueWiringsFile, queueMapDeclarationFile, packageMappings } = config;
|
|
9
|
+
if (!queueWiringsFile) {
|
|
10
|
+
throw new Error("queueWiringsFile is isn't set in the pikku config");
|
|
11
|
+
}
|
|
12
|
+
const queueMapDeclarationPath = getFileImportRelativePath(queueWiringsFile, queueMapDeclarationFile, packageMappings);
|
|
13
|
+
const content = [serializeQueueWrapper(queueMapDeclarationPath)];
|
|
14
|
+
await writeFileInDir(logger, queueWiringsFile, content.join('\n'));
|
|
15
|
+
},
|
|
16
|
+
middleware: [
|
|
17
|
+
logCommandInfoAndTime({
|
|
18
|
+
commandStart: 'Generating queue service wrapper',
|
|
19
|
+
commandEnd: 'Generated queue service wrapper',
|
|
20
|
+
skipCondition: ({ config }) => config.queueWiringsFile === undefined,
|
|
21
|
+
skipMessage: "queueWiringsFile isn't set in the pikku config",
|
|
22
|
+
}),
|
|
23
|
+
],
|
|
24
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuQueueTypes: any;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
|
+
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { serializeQueueTypes } from './serialize-queue-types.js';
|
|
6
|
+
export const pikkuQueueTypes = pikkuSessionlessFunc({
|
|
7
|
+
func: async ({ logger, config }) => {
|
|
8
|
+
const { queueTypesFile, functionTypesFile, packageMappings } = config;
|
|
9
|
+
const functionTypesImportPath = getFileImportRelativePath(queueTypesFile, functionTypesFile, packageMappings);
|
|
10
|
+
const content = serializeQueueTypes(functionTypesImportPath);
|
|
11
|
+
await writeFileInDir(logger, queueTypesFile, content);
|
|
12
|
+
},
|
|
13
|
+
middleware: [
|
|
14
|
+
logCommandInfoAndTime({
|
|
15
|
+
commandStart: 'Creating queue types',
|
|
16
|
+
commandEnd: 'Created queue types',
|
|
17
|
+
skipCondition: false,
|
|
18
|
+
skipMessage: '',
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuQueue: any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { serializeFileImports } from '../../../utils/file-imports-serializer.js';
|
|
3
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { serializeQueueMeta } from './serialize-queue-meta.js';
|
|
6
|
+
export const pikkuQueue = pikkuSessionlessFunc({
|
|
7
|
+
func: async ({ logger, config, getInspectorState }) => {
|
|
8
|
+
const visitState = await getInspectorState();
|
|
9
|
+
const { queueWorkersWiringFile, queueWorkersWiringMetaFile, packageMappings, } = config;
|
|
10
|
+
const { queueWorkers } = visitState;
|
|
11
|
+
await writeFileInDir(logger, queueWorkersWiringMetaFile, serializeQueueMeta(queueWorkers.meta));
|
|
12
|
+
await writeFileInDir(logger, queueWorkersWiringFile, serializeFileImports('addQueueWorkers', queueWorkersWiringFile, queueWorkers.files, packageMappings));
|
|
13
|
+
return true;
|
|
14
|
+
},
|
|
15
|
+
middleware: [
|
|
16
|
+
logCommandInfoAndTime({
|
|
17
|
+
commandStart: 'Finding Queues',
|
|
18
|
+
commandEnd: 'Found Queues',
|
|
19
|
+
skipCondition: async ({ getInspectorState }) => {
|
|
20
|
+
const visitState = await getInspectorState();
|
|
21
|
+
return visitState.queueWorkers.files.size === 0;
|
|
22
|
+
},
|
|
23
|
+
skipMessage: 'none found',
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuQueueMap: any;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
4
|
+
import { serializeQueueMap } from './serialize-queue-map.js';
|
|
5
|
+
export const pikkuQueueMap = pikkuSessionlessFunc({
|
|
6
|
+
func: async ({ logger, config, getInspectorState }) => {
|
|
7
|
+
const { queueWorkers, functions } = await getInspectorState();
|
|
8
|
+
const { queueMapDeclarationFile, packageMappings } = config;
|
|
9
|
+
const content = serializeQueueMap(queueMapDeclarationFile, packageMappings, functions.typesMap, functions.meta, queueWorkers.meta);
|
|
10
|
+
await writeFileInDir(logger, queueMapDeclarationFile, content);
|
|
11
|
+
},
|
|
12
|
+
middleware: [
|
|
13
|
+
logCommandInfoAndTime({
|
|
14
|
+
commandStart: 'Creating Queue map',
|
|
15
|
+
commandEnd: 'Created Queue map',
|
|
16
|
+
skipCondition: async ({ getInspectorState }) => {
|
|
17
|
+
const { queueWorkers } = await getInspectorState();
|
|
18
|
+
return queueWorkers.files.size === 0;
|
|
19
|
+
},
|
|
20
|
+
skipMessage: 'none found',
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuQueue: any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { serializeFileImports } from '../../../utils/file-imports-serializer.js';
|
|
3
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { serializeQueueMeta } from './serialize-queue-meta.js';
|
|
6
|
+
export const pikkuQueue = pikkuSessionlessFunc({
|
|
7
|
+
func: async ({ logger, config, getInspectorState }) => {
|
|
8
|
+
const visitState = await getInspectorState();
|
|
9
|
+
const { queueWorkersWiringFile, queueWorkersWiringMetaFile, packageMappings, } = config;
|
|
10
|
+
const { queueWorkers } = visitState;
|
|
11
|
+
await writeFileInDir(logger, queueWorkersWiringMetaFile, serializeQueueMeta(queueWorkers.meta));
|
|
12
|
+
await writeFileInDir(logger, queueWorkersWiringFile, serializeFileImports('addQueueWorkers', queueWorkersWiringFile, queueWorkers.files, packageMappings));
|
|
13
|
+
},
|
|
14
|
+
middleware: [
|
|
15
|
+
logCommandInfoAndTime({
|
|
16
|
+
commandStart: 'Finding queues',
|
|
17
|
+
commandEnd: 'Found queue',
|
|
18
|
+
skipCondition: async ({ getInspectorState }) => {
|
|
19
|
+
const { queueWorkers } = await getInspectorState();
|
|
20
|
+
return queueWorkers.files.size === 0;
|
|
21
|
+
},
|
|
22
|
+
skipMessage: 'none found',
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { serializeImportMap } from '
|
|
2
|
-
import { generateCustomTypes } from '
|
|
1
|
+
import { serializeImportMap } from '../../../utils/serialize-import-map.js';
|
|
2
|
+
import { generateCustomTypes } from '../../../utils/custom-types-generator.js';
|
|
3
3
|
export const serializeQueueMap = (relativeToPath, packageMappings, typesMap, functionsMeta, queueWorkersMeta) => {
|
|
4
4
|
const requiredTypes = new Set();
|
|
5
5
|
const serializedCustomTypes = generateCustomTypes(typesMap, requiredTypes);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates type definitions for queue wirings
|
|
3
|
+
*/
|
|
4
|
+
export const serializeQueueTypes = (functionTypesImportPath) => {
|
|
5
|
+
return `/**
|
|
6
|
+
* This file was generated by the @pikku/cli
|
|
7
|
+
* Queue-specific type definitions for tree-shaking optimization
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { CoreQueueWorker, wireQueueWorker as wireQueueWorkerCore } from '@pikku/core/queue'
|
|
11
|
+
import type { PikkuFunctionConfig } from '${functionTypesImportPath}'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Type definition for queue workers that process background jobs.
|
|
15
|
+
*
|
|
16
|
+
* @template In - Input type for the queue job
|
|
17
|
+
* @template Out - Output type for the queue job
|
|
18
|
+
*/
|
|
19
|
+
type QueueWiring<In, Out> = CoreQueueWorker<PikkuFunctionConfig<In, Out>>
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Registers a queue worker with the Pikku framework.
|
|
23
|
+
* Workers process background jobs from queues.
|
|
24
|
+
*
|
|
25
|
+
* @param queueWorker - Queue worker definition with job handler
|
|
26
|
+
*/
|
|
27
|
+
export const wireQueueWorker = (queueWorker: QueueWiring<any, any>) => {
|
|
28
|
+
wireQueueWorkerCore(queueWorker as any) // TODO
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuRPCClient: any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
3
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { serializeRPCWrapper } from './serialize-rpc-wrapper.js';
|
|
6
|
+
export const pikkuRPCClient = pikkuSessionlessFunc({
|
|
7
|
+
func: async ({ logger, config }) => {
|
|
8
|
+
const { rpcWiringsFile, rpcMapDeclarationFile, packageMappings } = config;
|
|
9
|
+
if (!rpcWiringsFile) {
|
|
10
|
+
return;
|
|
11
|
+
// TODO: throw new Error("rpcWiringsFile isn't set in the pikku config")
|
|
12
|
+
}
|
|
13
|
+
const rpcMapDeclarationPath = getFileImportRelativePath(rpcWiringsFile, rpcMapDeclarationFile, packageMappings);
|
|
14
|
+
const content = [serializeRPCWrapper(rpcMapDeclarationPath)];
|
|
15
|
+
await writeFileInDir(logger, rpcWiringsFile, content.join('\n'));
|
|
16
|
+
},
|
|
17
|
+
middleware: [
|
|
18
|
+
logCommandInfoAndTime({
|
|
19
|
+
commandStart: 'Generating RPC wrappers',
|
|
20
|
+
commandEnd: 'Generated RPC wrappers',
|
|
21
|
+
skipCondition: ({ config }) => config.rpcWiringsFile === undefined,
|
|
22
|
+
skipMessage: "rpcWiringsFile isn't set in the pikku config",
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
4
|
+
import { serializeTypedRPCMap } from './serialize-typed-rpc-map.js';
|
|
5
|
+
export const pikkuRPCInternalMap = pikkuSessionlessFunc({
|
|
6
|
+
func: async ({ logger, config, getInspectorState }) => {
|
|
7
|
+
const { functions, rpc } = await getInspectorState();
|
|
8
|
+
const { rpcInternalMapDeclarationFile, packageMappings } = config;
|
|
9
|
+
const content = serializeTypedRPCMap(rpcInternalMapDeclarationFile, packageMappings, functions.typesMap, functions.meta, rpc.internalMeta);
|
|
10
|
+
await writeFileInDir(logger, rpcInternalMapDeclarationFile, content);
|
|
11
|
+
},
|
|
12
|
+
middleware: [
|
|
13
|
+
logCommandInfoAndTime({
|
|
14
|
+
commandStart: 'Creating RPC internal map',
|
|
15
|
+
commandEnd: 'Created RPC internal map',
|
|
16
|
+
skipCondition: false,
|
|
17
|
+
skipMessage: '',
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
export const pikkuRPCExposedMap = pikkuSessionlessFunc({
|
|
22
|
+
func: async ({ logger, config, getInspectorState }) => {
|
|
23
|
+
const { functions, rpc } = await getInspectorState();
|
|
24
|
+
const { rpcMapDeclarationFile, packageMappings } = config;
|
|
25
|
+
const content = serializeTypedRPCMap(rpcMapDeclarationFile, packageMappings, functions.typesMap, functions.meta, rpc.exposedMeta);
|
|
26
|
+
await writeFileInDir(logger, rpcMapDeclarationFile, content);
|
|
27
|
+
},
|
|
28
|
+
middleware: [
|
|
29
|
+
logCommandInfoAndTime({
|
|
30
|
+
commandStart: 'Creating RPC external map',
|
|
31
|
+
commandEnd: 'Created RPC external map',
|
|
32
|
+
skipCondition: false,
|
|
33
|
+
skipMessage: '',
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuRPC: any;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
4
|
+
export const pikkuRPC = pikkuSessionlessFunc({
|
|
5
|
+
func: async ({ logger, config, getInspectorState }) => {
|
|
6
|
+
const { rpc } = await getInspectorState();
|
|
7
|
+
const { rpcInternalWiringMetaFile } = config;
|
|
8
|
+
if (rpc.internalFiles.size > 0) {
|
|
9
|
+
await writeFileInDir(logger, rpcInternalWiringMetaFile, `import { pikkuState } from '@pikku/core'\npikkuState('rpc', 'meta', ${JSON.stringify(rpc.internalMeta, null, 2)})`);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
},
|
|
14
|
+
middleware: [
|
|
15
|
+
logCommandInfoAndTime({
|
|
16
|
+
commandStart: 'Finding RPCs tasks',
|
|
17
|
+
commandEnd: 'Found RPCs',
|
|
18
|
+
skipCondition: false,
|
|
19
|
+
skipMessage: '',
|
|
20
|
+
}),
|
|
21
|
+
],
|
|
22
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { serializeImportMap } from '
|
|
2
|
-
import { generateCustomTypes } from '
|
|
1
|
+
import { serializeImportMap } from '../../../utils/serialize-import-map.js';
|
|
2
|
+
import { generateCustomTypes } from '../../../utils/custom-types-generator.js';
|
|
3
3
|
export const serializeTypedRPCMap = (relativeToPath, packageMappings, typesMap, functionsMeta, rpcMeta) => {
|
|
4
4
|
const requiredTypes = new Set();
|
|
5
5
|
const serializedCustomTypes = generateCustomTypes(typesMap, requiredTypes);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuSchedulerTypes: any;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
|
+
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { serializeSchedulerTypes } from './serialize-scheduler-types.js';
|
|
6
|
+
export const pikkuSchedulerTypes = pikkuSessionlessFunc({
|
|
7
|
+
func: async ({ logger, config }) => {
|
|
8
|
+
const { schedulersTypesFile, functionTypesFile, packageMappings } = config;
|
|
9
|
+
const functionTypesImportPath = getFileImportRelativePath(schedulersTypesFile, functionTypesFile, packageMappings);
|
|
10
|
+
const content = serializeSchedulerTypes(functionTypesImportPath);
|
|
11
|
+
await writeFileInDir(logger, schedulersTypesFile, content);
|
|
12
|
+
},
|
|
13
|
+
middleware: [
|
|
14
|
+
logCommandInfoAndTime({
|
|
15
|
+
commandStart: 'Creating cheduler types',
|
|
16
|
+
commandEnd: 'Created scheduler types',
|
|
17
|
+
skipCondition: false,
|
|
18
|
+
skipMessage: '',
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuScheduler: any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
import { serializeFileImports } from '../../../utils/file-imports-serializer.js';
|
|
3
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { serializeSchedulerMeta } from './serialize-scheduler-meta.js';
|
|
6
|
+
export const pikkuScheduler = pikkuSessionlessFunc({
|
|
7
|
+
func: async ({ logger, config, getInspectorState }) => {
|
|
8
|
+
const visitState = await getInspectorState();
|
|
9
|
+
const { schedulersWiringFile, schedulersWiringMetaFile, packageMappings } = config;
|
|
10
|
+
const { scheduledTasks } = visitState;
|
|
11
|
+
await writeFileInDir(logger, schedulersWiringMetaFile, serializeSchedulerMeta(scheduledTasks.meta));
|
|
12
|
+
await writeFileInDir(logger, schedulersWiringFile, serializeFileImports('addScheduledTasks', schedulersWiringFile, scheduledTasks.files, packageMappings));
|
|
13
|
+
return true;
|
|
14
|
+
},
|
|
15
|
+
middleware: [
|
|
16
|
+
logCommandInfoAndTime({
|
|
17
|
+
commandStart: 'Finding Scheduled tasks',
|
|
18
|
+
commandEnd: 'Found Scheduled tasks',
|
|
19
|
+
skipCondition: async ({ getInspectorState }) => {
|
|
20
|
+
const visitState = await getInspectorState();
|
|
21
|
+
return visitState.scheduledTasks.files.size === 0;
|
|
22
|
+
},
|
|
23
|
+
skipMessage: 'none found',
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates type definitions for scheduler wirings
|
|
3
|
+
*/
|
|
4
|
+
export const serializeSchedulerTypes = (functionTypesImportPath) => {
|
|
5
|
+
return `/**
|
|
6
|
+
* This file was generated by the @pikku/cli
|
|
7
|
+
* Scheduler-specific type definitions for tree-shaking optimization
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { CoreScheduledTask, wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler'
|
|
11
|
+
import type { PikkuFunctionConfig, PikkuMiddleware } from '${functionTypesImportPath}'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Type definition for scheduled tasks that run at specified intervals.
|
|
15
|
+
* These are sessionless functions that execute based on cron expressions.
|
|
16
|
+
*/
|
|
17
|
+
type SchedulerWiring = CoreScheduledTask<PikkuFunctionConfig<void, void>, PikkuMiddleware>
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Registers a scheduled task with the Pikku framework.
|
|
21
|
+
* Tasks run based on cron expressions and are sessionless.
|
|
22
|
+
*
|
|
23
|
+
* @param task - Scheduled task definition with cron expression and handler
|
|
24
|
+
*/
|
|
25
|
+
export const wireScheduler = (task: SchedulerWiring) => {
|
|
26
|
+
wireSchedulerCore(task as any) // TODO
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SingletonServices, Services } from '../../types/application-types.js';
|
|
2
|
+
import type { PikkuInteraction } from '@pikku/core';
|
|
3
|
+
type PikkuMiddleware = (services: Services, interaction: PikkuInteraction, next: () => Promise<void>) => Promise<void>;
|
|
4
|
+
export interface LogCommandInfoOptions {
|
|
5
|
+
commandStart: string;
|
|
6
|
+
commandEnd: string;
|
|
7
|
+
skipCondition?: boolean | ((services: SingletonServices) => boolean | Promise<boolean>);
|
|
8
|
+
skipMessage?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Middleware to log command execution timing and status
|
|
12
|
+
* Replaces the logCommandInfoAndTime wrapper function
|
|
13
|
+
*
|
|
14
|
+
* The skipCondition can be:
|
|
15
|
+
* - A boolean valuewe
|
|
16
|
+
* - A function that receives services and returns a boolean (can access getInspectorState)
|
|
17
|
+
*/
|
|
18
|
+
export declare const logCommandInfoAndTime: ({ commandStart, commandEnd, skipCondition, skipMessage, }: LogCommandInfoOptions) => PikkuMiddleware;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Middleware to log command execution timing and status
|
|
3
|
+
* Replaces the logCommandInfoAndTime wrapper function
|
|
4
|
+
*
|
|
5
|
+
* The skipCondition can be:
|
|
6
|
+
* - A boolean valuewe
|
|
7
|
+
* - A function that receives services and returns a boolean (can access getInspectorState)
|
|
8
|
+
*/
|
|
9
|
+
export const logCommandInfoAndTime = ({ commandStart, commandEnd, skipCondition = false, skipMessage = 'none found', }) => {
|
|
10
|
+
return async ({ logger, ...services }, _interaction, next) => {
|
|
11
|
+
// Evaluate skip condition (can be boolean or function)
|
|
12
|
+
const shouldSkip = typeof skipCondition === 'function'
|
|
13
|
+
? await skipCondition({ logger, ...services })
|
|
14
|
+
: skipCondition;
|
|
15
|
+
if (shouldSkip === true) {
|
|
16
|
+
logger.info(`• Skipping ${commandStart.charAt(0).toLocaleLowerCase()}${commandStart.slice(1)} since ${skipMessage}.`);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// Log start
|
|
20
|
+
const start = Date.now();
|
|
21
|
+
logger.info(`• ${commandStart}...`);
|
|
22
|
+
// Execute the function
|
|
23
|
+
await next();
|
|
24
|
+
// Log completion
|
|
25
|
+
logger.info(`✓ ${commandEnd} in ${Date.now() - start}ms.`);
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -155,7 +155,7 @@ type SchedulerWiring = CoreScheduledTask<PikkuFunctionSessionless<void, void>, P
|
|
|
155
155
|
* @template In - Input type for the queue job
|
|
156
156
|
* @template Out - Output type for the queue job
|
|
157
157
|
*/
|
|
158
|
-
type QueueWiring<In, Out> = CoreQueueWorker<
|
|
158
|
+
type QueueWiring<In, Out> = CoreQueueWorker<any>
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
161
|
* Type definition for MCP resources that provide data to AI models.
|
|
@@ -441,7 +441,7 @@ export { addPermission }
|
|
|
441
441
|
export const wireHTTP = <In, Out, Route extends string>(
|
|
442
442
|
httpWiring: HTTPWiring<In, Out, Route> & AssertHTTPWiringParams<In, Route>
|
|
443
443
|
) => {
|
|
444
|
-
wireHTTPCore(httpWiring)
|
|
444
|
+
wireHTTPCore(httpWiring as any) // TODO
|
|
445
445
|
}
|
|
446
446
|
|
|
447
447
|
/**
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Logger, LogLevel, PikkuChannel } from '@pikku/core';
|
|
2
|
+
/**
|
|
3
|
+
* Log message structure sent through the channel
|
|
4
|
+
*/
|
|
5
|
+
export interface ForwardedLogMessage {
|
|
6
|
+
message: string;
|
|
7
|
+
level: 'trace' | 'debug' | 'info' | 'warn' | 'error';
|
|
8
|
+
type?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A logger implementation that forwards log messages to a CLI channel
|
|
12
|
+
* instead of logging to console directly.
|
|
13
|
+
*/
|
|
14
|
+
export declare class CLILoggerForwarder implements Logger {
|
|
15
|
+
private logger;
|
|
16
|
+
private channel;
|
|
17
|
+
private level;
|
|
18
|
+
constructor(logger: Logger, channel: PikkuChannel<unknown, ForwardedLogMessage>);
|
|
19
|
+
setLevel(level: LogLevel): void;
|
|
20
|
+
private log;
|
|
21
|
+
info(messageOrObj: string | Record<string, any>, ..._meta: any[]): void;
|
|
22
|
+
error(messageOrObj: string | Record<string, any> | Error, ..._meta: any[]): void;
|
|
23
|
+
warn(messageOrObj: string | Record<string, any>, ..._meta: any[]): void;
|
|
24
|
+
debug(message: string, ..._meta: any[]): void;
|
|
25
|
+
trace(message: string, ..._meta: any[]): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { LogLevel } from '@pikku/core';
|
|
2
|
+
/**
|
|
3
|
+
* A logger implementation that forwards log messages to a CLI channel
|
|
4
|
+
* instead of logging to console directly.
|
|
5
|
+
*/
|
|
6
|
+
export class CLILoggerForwarder {
|
|
7
|
+
logger;
|
|
8
|
+
channel;
|
|
9
|
+
level = LogLevel.info;
|
|
10
|
+
constructor(logger, channel) {
|
|
11
|
+
this.logger = logger;
|
|
12
|
+
this.channel = channel;
|
|
13
|
+
}
|
|
14
|
+
setLevel(level) {
|
|
15
|
+
this.level = level;
|
|
16
|
+
}
|
|
17
|
+
log(level, logLevel, messageOrObj, type) {
|
|
18
|
+
if (this.level > logLevel)
|
|
19
|
+
return;
|
|
20
|
+
let message;
|
|
21
|
+
if (messageOrObj instanceof Error) {
|
|
22
|
+
this.logger.error(messageOrObj);
|
|
23
|
+
message = messageOrObj.message;
|
|
24
|
+
}
|
|
25
|
+
else if (typeof messageOrObj === 'object') {
|
|
26
|
+
if ('message' in messageOrObj &&
|
|
27
|
+
typeof messageOrObj.message === 'string') {
|
|
28
|
+
message = messageOrObj.message;
|
|
29
|
+
type = type || messageOrObj.type;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
message = JSON.stringify(messageOrObj);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
message = messageOrObj;
|
|
37
|
+
}
|
|
38
|
+
this.channel.send({ message, level, type });
|
|
39
|
+
}
|
|
40
|
+
info(messageOrObj, ..._meta) {
|
|
41
|
+
this.log('info', LogLevel.info, messageOrObj);
|
|
42
|
+
}
|
|
43
|
+
error(messageOrObj, ..._meta) {
|
|
44
|
+
this.log('error', LogLevel.error, messageOrObj);
|
|
45
|
+
}
|
|
46
|
+
warn(messageOrObj, ..._meta) {
|
|
47
|
+
this.log('warn', LogLevel.warn, messageOrObj);
|
|
48
|
+
}
|
|
49
|
+
debug(message, ..._meta) {
|
|
50
|
+
this.log('debug', LogLevel.debug, message);
|
|
51
|
+
}
|
|
52
|
+
trace(message, ..._meta) {
|
|
53
|
+
this.log('trace', LogLevel.trace, message);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Logger, LogLevel } from '@pikku/core';
|
|
2
|
+
export declare class CLILogger implements Logger {
|
|
3
|
+
private silent;
|
|
4
|
+
private level;
|
|
5
|
+
constructor({ logLogo, silent, }: {
|
|
6
|
+
logLogo: boolean;
|
|
7
|
+
silent?: boolean;
|
|
8
|
+
});
|
|
9
|
+
setLevel(level: LogLevel): void;
|
|
10
|
+
info(message: string | {
|
|
11
|
+
message: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
}): void;
|
|
14
|
+
error(message: string): void;
|
|
15
|
+
warn(message: string): void;
|
|
16
|
+
debug(message: string): void;
|
|
17
|
+
private logPikkuLogo;
|
|
18
|
+
private primary;
|
|
19
|
+
}
|