@pikku/cli 0.10.2 → 0.11.1
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 +1 -1
- package/.pikku/channel/pikku-channels-map.gen.d.ts +5 -2
- package/.pikku/channel/pikku-channels-meta.gen.ts +1 -1
- package/.pikku/channel/pikku-channels.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-channel.ts +92 -0
- package/.pikku/cli/pikku-cli-client.gen.ts +56 -0
- package/.pikku/cli/pikku-cli-types.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +131 -5
- package/.pikku/cli/pikku-cli-wirings.gen.ts +3 -2
- package/.pikku/cli/pikku-cli.gen.ts +41 -0
- package/.pikku/function/pikku-function-types.gen.ts +1 -1
- package/.pikku/function/pikku-functions-meta.gen.ts +240 -131
- package/.pikku/function/pikku-functions-meta.min.gen.ts +59 -34
- package/.pikku/function/pikku-functions.gen.ts +9 -1
- package/.pikku/http/pikku-http-types.gen.ts +1 -1
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +5 -2
- package/.pikku/http/pikku-http-wirings-meta.gen.ts +1 -1
- package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-types.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
- package/.pikku/pikku-bootstrap.gen.ts +4 -1
- package/.pikku/pikku-services.gen.ts +8 -3
- package/.pikku/pikku-types.gen.ts +1 -1
- package/.pikku/pikku-websocket.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +5 -2
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +7 -2
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +13 -3
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +25 -10
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +14 -9
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
- package/.pikku/schemas/register.gen.ts +17 -5
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +62 -0
- package/.pikku/workflow/pikku-workflow-types.gen.ts +92 -0
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -0
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +4 -0
- package/CHANGELOG.md +13 -0
- package/bin/pikku.ts +20 -20
- package/build.sh +1 -1
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +1 -0
- package/dist/.pikku/cli/pikku-cli-channel.js +91 -0
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +10 -0
- package/dist/.pikku/cli/pikku-cli-client.gen.js +46 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +131 -5
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +2 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +2 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +10 -0
- package/dist/.pikku/cli/pikku-cli.gen.js +38 -0
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +240 -131
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +59 -34
- package/dist/.pikku/function/pikku-functions.gen.js +9 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +4 -1
- package/dist/.pikku/pikku-services.gen.d.ts +10 -4
- package/dist/.pikku/pikku-services.gen.js +8 -2
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
- package/dist/.pikku/pikku-websocket.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +7 -2
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.d.ts +17 -0
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +22 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +14 -9
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +9 -3
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuRemoteInternalRPCInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +58 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +28 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts +1 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +5 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +4 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +5 -0
- package/dist/bin/pikku.js +18 -20
- package/dist/src/cli.wiring.js +109 -107
- package/dist/src/functions/commands/all.js +20 -0
- package/dist/src/functions/commands/bootstrap.js +1 -0
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +15 -22
- package/dist/src/functions/wirings/queue/pikku-queue.js +9 -1
- package/dist/src/functions/wirings/queue/serialize-queue-map.d.ts +2 -2
- package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +2 -2
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -0
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +23 -0
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -0
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.js +23 -0
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.d.ts +4 -0
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +30 -0
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.d.ts +4 -0
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +30 -0
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +2 -2
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +27 -3
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.js +12 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +11 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +55 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.js +79 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +2 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +10 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +95 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +60 -0
- package/dist/src/services/cli-logger-forwarder.service.d.ts +3 -0
- package/dist/src/services/cli-logger-forwarder.service.js +9 -2
- package/dist/src/services/cli-logger.service.js +1 -1
- package/dist/src/utils/command-summary.d.ts +1 -0
- package/dist/src/utils/command-summary.js +9 -8
- package/dist/src/utils/pikku-cli-config.js +24 -4
- package/dist/src/utils/schema-generator.js +28 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/cli.wiring.ts +111 -106
- package/src/functions/commands/all.ts +28 -0
- package/src/functions/commands/bootstrap.ts +1 -0
- package/src/functions/wirings/cli/serialize-channel-cli-client.ts +15 -22
- package/src/functions/wirings/queue/pikku-queue.ts +10 -1
- package/src/functions/wirings/queue/serialize-queue-map.ts +3 -3
- package/src/functions/wirings/queue/serialize-queue-meta.ts +2 -2
- package/src/functions/wirings/rpc/pikku-command-public-rpc.ts +32 -0
- package/src/functions/wirings/rpc/pikku-command-remote-rpc.ts +35 -0
- package/src/functions/wirings/rpc/serialize-public-rpc.ts +30 -0
- package/src/functions/wirings/rpc/serialize-remote-rpc.ts +30 -0
- package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +2 -2
- package/src/functions/wirings/rpc/serialize-typed-rpc-map.ts +26 -3
- package/src/functions/wirings/workflow/pikku-command-workflow-map.ts +24 -0
- package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +22 -0
- package/src/functions/wirings/workflow/pikku-command-workflow.ts +123 -0
- package/src/functions/wirings/workflow/serialize-workflow-map.ts +123 -0
- package/src/functions/wirings/workflow/serialize-workflow-meta.ts +16 -0
- package/src/functions/wirings/workflow/serialize-workflow-types.ts +95 -0
- package/src/functions/wirings/workflow/serialize-workflow-workers.ts +60 -0
- package/src/services/cli-logger-forwarder.service.ts +11 -2
- package/src/services/cli-logger.service.ts +1 -1
- package/src/utils/command-summary.ts +10 -8
- package/src/utils/pikku-cli-config.ts +44 -4
- package/src/utils/schema-generator.ts +25 -7
- package/types/config.d.ts +45 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "outDir": { "type": "string" }, "schemaDirectory": { "type": "string" }, "typesDeclarationFile": { "type": "string" }, "functionsFile": { "type": "string" }, "functionsMetaFile": { "type": "string" }, "functionsMetaMinFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "channelsWiringFile": { "type": "string" }, "channelsWiringMetaFile": { "type": "string" }, "channelsMapDeclarationFile": { "type": "string" }, "channelsTypesFile": { "type": "string" }, "rpcInternalWiringMetaFile": { "type": "string" }, "rpcInternalMapDeclarationFile": { "type": "string" }, "rpcMapDeclarationFile": { "type": "string" }, "schedulersWiringFile": { "type": "string" }, "schedulersWiringMetaFile": { "type": "string" }, "schedulersTypesFile": { "type": "string" }, "queueWorkersWiringFile": { "type": "string" }, "queueWorkersWiringMetaFile": { "type": "string" }, "queueMapDeclarationFile": { "type": "string" }, "queueTypesFile": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaFile": { "type": "string" }, "permissionsFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "$schema": { "type": "string" }, "extends": { "type": "string" }, "rootDir": { "type": "string" }, "srcDirectories": { "type": "array", "items": { "type": "string" } }, "ignoreFiles": { "type": "array", "items": { "type": "string" } }, "packageMappings": { "type": "object", "additionalProperties": { "type": "string" } }, "configFile": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "userSessionType": { "type": "string" }, "singletonServicesFactoryType": { "type": "string" }, "sessionServicesFactoryType": { "type": "string" }, "configDir": { "type": "string" }, "tsconfig": { "type": "string" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" }, "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "openAPI": { "type": "object", "properties": { "outputFile": { "type": "string" }, "additionalInfo": { "$ref": "#/definitions/OpenAPISpecInfo" } }, "required": ["outputFile", "additionalInfo"], "additionalProperties": false }, "schema": { "type": "object", "properties": { "additionalProperties": { "type": "boolean" }, "supportsImportAttributes": { "type": "boolean" } }, "additionalProperties": false }, "cli": { "type": "object", "properties": { "entrypoints": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }, { "type": "array", "items": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }] } }] } } }, "additionalProperties": false }, "forceRequiredServices": { "type": "array", "items": { "type": "string" } }, "schemasFromTypes": { "type": "array", "items": { "type": "string" } }, "stateOutput": { "type": "string" }, "stateInput": { "type": "string" }, "filters": { "$ref": "#/definitions/InspectorFilters" } }, "required": ["bootstrapFile", "channelsMapDeclarationFile", "channelsTypesFile", "channelsWiringFile", "channelsWiringMetaFile", "cliBootstrapFile", "cliTypesFile", "cliWiringMetaFile", "cliWiringsFile", "configDir", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaMinFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringsFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "middlewareFile", "middlewareGroupsMetaFile", "outDir", "packageMappings", "permissionsFile", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "rootDir", "rpcInternalMapDeclarationFile", "rpcInternalWiringMetaFile", "rpcMapDeclarationFile", "schedulersTypesFile", "schedulersWiringFile", "schedulersWiringMetaFile", "schemaDirectory", "servicesFile", "srcDirectories", "tsconfig", "typesDeclarationFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "InspectorFilters": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "directories": { "type": "array", "items": { "type": "string" } }, "httpRoutes": { "type": "array", "items": { "type": "string" } }, "httpMethods": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } }
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "outDir": { "type": "string" }, "schemaDirectory": { "type": "string" }, "typesDeclarationFile": { "type": "string" }, "functionsFile": { "type": "string" }, "functionsMetaFile": { "type": "string" }, "functionsMetaMinFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "channelsWiringFile": { "type": "string" }, "channelsWiringMetaFile": { "type": "string" }, "channelsMapDeclarationFile": { "type": "string" }, "channelsTypesFile": { "type": "string" }, "rpcInternalWiringMetaFile": { "type": "string" }, "rpcInternalMapDeclarationFile": { "type": "string" }, "rpcMapDeclarationFile": { "type": "string" }, "schedulersWiringFile": { "type": "string" }, "schedulersWiringMetaFile": { "type": "string" }, "schedulersTypesFile": { "type": "string" }, "queueWorkersWiringFile": { "type": "string" }, "queueWorkersWiringMetaFile": { "type": "string" }, "queueMapDeclarationFile": { "type": "string" }, "queueTypesFile": { "type": "string" }, "workflowsWiringFile": { "type": "string" }, "workflowsWiringMetaFile": { "type": "string" }, "workflowsWorkersFile": { "type": "string" }, "workflowMapDeclarationFile": { "type": "string" }, "workflowTypesFile": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaFile": { "type": "string" }, "permissionsFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "$schema": { "type": "string" }, "extends": { "type": "string" }, "rootDir": { "type": "string" }, "srcDirectories": { "type": "array", "items": { "type": "string" } }, "ignoreFiles": { "type": "array", "items": { "type": "string" } }, "packageMappings": { "type": "object", "additionalProperties": { "type": "string" } }, "configFile": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "userSessionType": { "type": "string" }, "singletonServicesFactoryType": { "type": "string" }, "sessionServicesFactoryType": { "type": "string" }, "configDir": { "type": "string" }, "tsconfig": { "type": "string" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" }, "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "openAPI": { "type": "object", "properties": { "outputFile": { "type": "string" }, "additionalInfo": { "$ref": "#/definitions/OpenAPISpecInfo" } }, "required": ["outputFile", "additionalInfo"], "additionalProperties": false }, "schema": { "type": "object", "properties": { "additionalProperties": { "type": "boolean" }, "supportsImportAttributes": { "type": "boolean" } }, "additionalProperties": false }, "cli": { "type": "object", "properties": { "entrypoints": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }, { "type": "array", "items": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }] } }] } } }, "additionalProperties": false }, "workflows": { "anyOf": [{ "type": "object", "properties": { "singleQueue": { "type": "boolean", "const": true }, "path": { "type": "string" }, "orchestratorQueue": { "type": "string" }, "workerQueue": { "type": "string" } }, "required": ["singleQueue", "path"], "additionalProperties": false }, { "type": "object", "properties": { "singleQueue": { "type": "boolean", "const": false }, "dir": { "type": "string" }, "orchestratorQueuePrefix": { "type": "string" }, "workerQueuePrefix": { "type": "string" } }, "required": ["singleQueue", "dir"], "additionalProperties": false }] }, "rpc": { "type": "object", "properties": { "remoteRpcWorkersPath": { "type": "string" }, "publicRpcPath": { "type": "string" } }, "additionalProperties": false }, "forceRequiredServices": { "type": "array", "items": { "type": "string" } }, "schemasFromTypes": { "type": "array", "items": { "type": "string" } }, "stateOutput": { "type": "string" }, "stateInput": { "type": "string" }, "filters": { "$ref": "#/definitions/InspectorFilters" } }, "required": ["bootstrapFile", "channelsMapDeclarationFile", "channelsTypesFile", "channelsWiringFile", "channelsWiringMetaFile", "cliBootstrapFile", "cliTypesFile", "cliWiringMetaFile", "cliWiringsFile", "configDir", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaMinFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringsFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "middlewareFile", "middlewareGroupsMetaFile", "outDir", "packageMappings", "permissionsFile", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "rootDir", "rpcInternalMapDeclarationFile", "rpcInternalWiringMetaFile", "rpcMapDeclarationFile", "schedulersTypesFile", "schedulersWiringFile", "schedulersWiringMetaFile", "schemaDirectory", "servicesFile", "srcDirectories", "tsconfig", "typesDeclarationFile", "workflowMapDeclarationFile", "workflowTypesFile", "workflowsWiringFile", "workflowsWiringMetaFile", "workflowsWorkersFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "InspectorFilters": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "directories": { "type": "array", "items": { "type": "string" } }, "httpRoutes": { "type": "array", "items": { "type": "string" } }, "httpMethods": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "rpcName": { "type": "string" }, "data": {} }, "required": ["rpcName"], "additionalProperties": false, "definitions": {} }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "description": "This provides the structure needed for typescript to be aware of RPCs and their return types", "definitions": {} }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Workflow-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { CoreWorkflow, PikkuWorkflowInteraction, WorkflowStepOptions } from '@pikku/core/workflow';
|
|
8
|
+
import { CorePikkuFunctionConfig, CorePikkuFunctionSessionless } from '@pikku/core';
|
|
9
|
+
import type { PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js';
|
|
10
|
+
import type { UserSession, SingletonServices } from '../../types/application-types.d.js';
|
|
11
|
+
import type { TypedPikkuRPC, RPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js';
|
|
12
|
+
/**
|
|
13
|
+
* Type definition for workflows that orchestrate multi-step processes.
|
|
14
|
+
* Workflows support both inline and remote execution modes with step caching.
|
|
15
|
+
*/
|
|
16
|
+
type WorkflowWiring = CoreWorkflow<CorePikkuFunctionConfig<PikkuFunctionWorkflow<any, any>, PikkuPermission<any>, PikkuMiddleware>>;
|
|
17
|
+
/**
|
|
18
|
+
* Typed workflow interaction with RPC awareness
|
|
19
|
+
* Provides type-safe workflow.do() for RPC steps
|
|
20
|
+
*/
|
|
21
|
+
export interface TypedWorkflow extends PikkuWorkflowInteraction {
|
|
22
|
+
/**
|
|
23
|
+
* Execute a workflow step with RPC invocation (typed based on available RPCs)
|
|
24
|
+
* @template K - RPC name from the RPC map
|
|
25
|
+
*/
|
|
26
|
+
do<K extends keyof RPCMap>(stepName: string, rpcName: K, data: RPCMap[K]['input'], options?: WorkflowStepOptions): Promise<RPCMap[K]['output']>;
|
|
27
|
+
/**
|
|
28
|
+
* Execute a workflow step with inline function
|
|
29
|
+
* @template T - Return type of the inline function
|
|
30
|
+
*/
|
|
31
|
+
do<T>(stepName: string, fn: () => T | Promise<T>, options?: WorkflowStepOptions): Promise<T>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Workflow function type with typed workflow service
|
|
35
|
+
* Includes the workflow interaction object with typed RPC methods
|
|
36
|
+
*/
|
|
37
|
+
export type PikkuFunctionWorkflow<In = unknown, Out = never> = CorePikkuFunctionSessionless<In, Out, null, SingletonServices & {
|
|
38
|
+
rpc: TypedPikkuRPC;
|
|
39
|
+
workflow: TypedWorkflow;
|
|
40
|
+
}, UserSession>;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a workflow function with typed input and output.
|
|
43
|
+
* Workflow functions have access to the workflow interaction object for step execution.
|
|
44
|
+
*
|
|
45
|
+
* @template In - Input type for the workflow
|
|
46
|
+
* @template Out - Output type for the workflow
|
|
47
|
+
* @param func - Function definition, either direct function or configuration object
|
|
48
|
+
* @returns The normalized configuration object
|
|
49
|
+
*/
|
|
50
|
+
export declare const pikkuWorkflowFunc: <In, Out = unknown>(func: PikkuFunctionWorkflow<In, Out> | CorePikkuFunctionConfig<PikkuFunctionWorkflow<In, Out>, PikkuPermission<In>, PikkuMiddleware>) => CorePikkuFunctionConfig<PikkuFunctionWorkflow<In, Out>, PikkuPermission<In>, PikkuMiddleware>;
|
|
51
|
+
/**
|
|
52
|
+
* Registers a workflow with the Pikku framework.
|
|
53
|
+
* Workflows can run in 'inline' (synchronous) or 'remote' (queue-based) execution modes.
|
|
54
|
+
*
|
|
55
|
+
* @param workflow - Workflow definition with name, execution mode, and handler function
|
|
56
|
+
*/
|
|
57
|
+
export declare const wireWorkflow: (workflow: WorkflowWiring) => void;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Workflow-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { wireWorkflow as wireWorkflowCore } from '@pikku/core/workflow';
|
|
8
|
+
/**
|
|
9
|
+
* Creates a workflow function with typed input and output.
|
|
10
|
+
* Workflow functions have access to the workflow interaction object for step execution.
|
|
11
|
+
*
|
|
12
|
+
* @template In - Input type for the workflow
|
|
13
|
+
* @template Out - Output type for the workflow
|
|
14
|
+
* @param func - Function definition, either direct function or configuration object
|
|
15
|
+
* @returns The normalized configuration object
|
|
16
|
+
*/
|
|
17
|
+
export const pikkuWorkflowFunc = (func) => {
|
|
18
|
+
return typeof func === 'function' ? { func } : func;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Registers a workflow with the Pikku framework.
|
|
22
|
+
* Workflows can run in 'inline' (synchronous) or 'remote' (queue-based) execution modes.
|
|
23
|
+
*
|
|
24
|
+
* @param workflow - Workflow definition with name, execution mode, and handler function
|
|
25
|
+
*/
|
|
26
|
+
export const wireWorkflow = (workflow) => {
|
|
27
|
+
wireWorkflowCore(workflow);
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/bin/pikku.js
CHANGED
|
@@ -3,27 +3,25 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { createConfig, createSingletonServices } from '../src/services.js';
|
|
4
4
|
import { PikkuRPCService } from '@pikku/core/rpc';
|
|
5
5
|
import { LocalVariablesService } from '@pikku/core/services';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { existsSync } from 'fs';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import { dirname, join } from 'path';
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
11
|
// Check if Pikku CLI is available
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// }
|
|
26
|
-
// }
|
|
12
|
+
const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js');
|
|
13
|
+
if (existsSync(pikkuCliPath)) {
|
|
14
|
+
try {
|
|
15
|
+
// Use the generated Pikku CLI
|
|
16
|
+
const { PikkuCLI } = await import(pikkuCliPath);
|
|
17
|
+
await PikkuCLI(process.argv.slice(2));
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
// If import fails, fall back to Commander.js
|
|
22
|
+
console.warn('Failed to load Pikku CLI, using fallback mode:', error.message);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
27
25
|
// Fallback to Commander.js for initial setup
|
|
28
26
|
// Import bootstrap if it exists
|
|
29
27
|
try {
|
package/dist/src/cli.wiring.js
CHANGED
|
@@ -1,107 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
import { pikkuSchemas } from './functions/wirings/functions/schemas.js';
|
|
2
|
+
import { pikkuFetch } from './functions/wirings/fetch/index.js';
|
|
3
|
+
import { pikkuWebSocketTyped } from './functions/wirings/channels/pikku-command-websocket-typed.js';
|
|
4
|
+
import { pikkuRPCClient } from './functions/wirings/rpc/pikku-command-rpc-client.js';
|
|
5
|
+
import { pikkuQueueService } from './functions/wirings/queue/pikku-command-queue-service.js';
|
|
6
|
+
import { pikkuOpenAPI } from './functions/wirings/http/pikku-command-openapi.js';
|
|
7
|
+
import { pikkuNext } from './functions/runtimes/nextjs/pikku-command-nextjs.js';
|
|
8
|
+
import { pikkuCLICommand, wireCLI } from '../.pikku/cli/pikku-cli-types.gen.js';
|
|
9
|
+
import { all } from './functions/commands/all.js';
|
|
10
|
+
import { bootstrap } from './functions/commands/bootstrap.js';
|
|
11
|
+
import { watch } from './functions/commands/watch.js';
|
|
12
|
+
import { clientCLIRenderer } from './services.js';
|
|
13
|
+
wireCLI({
|
|
14
|
+
program: 'pikku',
|
|
15
|
+
description: 'Pikku CLI - Code generation tool for type-safe backend development',
|
|
16
|
+
render: clientCLIRenderer,
|
|
17
|
+
options: {
|
|
18
|
+
config: {
|
|
19
|
+
description: 'Path to pikku.config.json file',
|
|
20
|
+
short: 'c',
|
|
21
|
+
},
|
|
22
|
+
logLevel: {
|
|
23
|
+
description: 'Set log level',
|
|
24
|
+
default: 'info',
|
|
25
|
+
short: 'l',
|
|
26
|
+
},
|
|
27
|
+
userSessionType: {
|
|
28
|
+
description: 'Specify which UserSession type to use (when multiple exist)',
|
|
29
|
+
},
|
|
30
|
+
singletonServicesFactoryType: {
|
|
31
|
+
description: 'Specify which singleton services factory to use',
|
|
32
|
+
},
|
|
33
|
+
sessionServicesFactoryType: {
|
|
34
|
+
description: 'Specify which session services factory to use',
|
|
35
|
+
},
|
|
36
|
+
stateOutput: {
|
|
37
|
+
description: 'Save inspector state to JSON file for reuse',
|
|
38
|
+
},
|
|
39
|
+
stateInput: {
|
|
40
|
+
description: 'Load inspector state from JSON file (skips inspection)',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
commands: {
|
|
44
|
+
all: pikkuCLICommand({
|
|
45
|
+
func: all,
|
|
46
|
+
description: 'Generate all Pikku files (types, schemas, wirings, etc.)',
|
|
47
|
+
isDefault: true,
|
|
48
|
+
options: {
|
|
49
|
+
tags: {
|
|
50
|
+
description: 'Filter functions by tags (comma-separated)',
|
|
51
|
+
short: 't',
|
|
52
|
+
},
|
|
53
|
+
types: {
|
|
54
|
+
description: 'Filter functions by types (comma-separated)',
|
|
55
|
+
},
|
|
56
|
+
directories: {
|
|
57
|
+
description: 'Filter functions by directories (comma-separated)',
|
|
58
|
+
short: 'd',
|
|
59
|
+
},
|
|
60
|
+
httpMethods: {
|
|
61
|
+
description: 'Filter HTTP routes by methods (comma-separated)',
|
|
62
|
+
},
|
|
63
|
+
httpRoutes: {
|
|
64
|
+
description: 'Filter HTTP routes by route patterns (comma-separated)',
|
|
65
|
+
},
|
|
66
|
+
names: {
|
|
67
|
+
description: 'Filter functions by name patterns (supports wildcards)',
|
|
68
|
+
short: 'n',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
bootstrap: pikkuCLICommand({
|
|
73
|
+
func: bootstrap,
|
|
74
|
+
description: 'Generate only type files (setup phase only)',
|
|
75
|
+
}),
|
|
76
|
+
watch: pikkuCLICommand({
|
|
77
|
+
func: watch,
|
|
78
|
+
description: 'Watch for file changes and regenerate automatically',
|
|
79
|
+
}),
|
|
80
|
+
schemas: pikkuCLICommand({
|
|
81
|
+
func: pikkuSchemas,
|
|
82
|
+
description: 'Generate JSON schemas for function input/output types',
|
|
83
|
+
}),
|
|
84
|
+
fetch: pikkuCLICommand({
|
|
85
|
+
func: pikkuFetch,
|
|
86
|
+
description: 'Generate type-safe HTTP fetch client',
|
|
87
|
+
}),
|
|
88
|
+
websocket: pikkuCLICommand({
|
|
89
|
+
func: pikkuWebSocketTyped,
|
|
90
|
+
description: 'Generate type-safe WebSocket client',
|
|
91
|
+
}),
|
|
92
|
+
rpc: pikkuCLICommand({
|
|
93
|
+
func: pikkuRPCClient,
|
|
94
|
+
description: 'Generate RPC client wrappers',
|
|
95
|
+
}),
|
|
96
|
+
'queue-service': pikkuCLICommand({
|
|
97
|
+
func: pikkuQueueService,
|
|
98
|
+
description: 'Generate queue service wrapper',
|
|
99
|
+
}),
|
|
100
|
+
openapi: pikkuCLICommand({
|
|
101
|
+
func: pikkuOpenAPI,
|
|
102
|
+
description: 'Generate OpenAPI specification from HTTP routes',
|
|
103
|
+
}),
|
|
104
|
+
nextjs: pikkuCLICommand({
|
|
105
|
+
func: pikkuNext,
|
|
106
|
+
description: 'Generate Next.js backend and HTTP wrappers',
|
|
107
|
+
}),
|
|
108
|
+
},
|
|
109
|
+
});
|
|
@@ -23,6 +23,7 @@ export const all = pikkuVoidFunc({
|
|
|
23
23
|
await rpc.invoke('pikkuChannelTypes', null);
|
|
24
24
|
await rpc.invoke('pikkuSchedulerTypes', null);
|
|
25
25
|
await rpc.invoke('pikkuQueueTypes', null);
|
|
26
|
+
await rpc.invoke('pikkuWorkflowTypes', null);
|
|
26
27
|
await rpc.invoke('pikkuMCPTypes', null);
|
|
27
28
|
await rpc.invoke('pikkuCLITypes', null);
|
|
28
29
|
const hasFunctionRegistrations = await rpc.invoke('pikkuFunctions', null);
|
|
@@ -69,6 +70,22 @@ export const all = pikkuVoidFunc({
|
|
|
69
70
|
if (scheduler) {
|
|
70
71
|
allImports.push(config.schedulersWiringMetaFile, config.schedulersWiringFile);
|
|
71
72
|
}
|
|
73
|
+
// Generate Workflows
|
|
74
|
+
const workflows = await rpc.invoke('pikkuWorkflow', null);
|
|
75
|
+
// Generate Remote RPC Workers (must be before queue discovery so wireQueueWorker calls are picked up)
|
|
76
|
+
const remoteRPC = await rpc.invoke('pikkuRemoteRPC', null);
|
|
77
|
+
// Reinspect to pick up generated workflow workers and remote RPC workers BEFORE generating maps
|
|
78
|
+
if (workflows || remoteRPC) {
|
|
79
|
+
await getInspectorState(true);
|
|
80
|
+
}
|
|
81
|
+
if (workflows) {
|
|
82
|
+
await rpc.invoke('pikkuWorkflowMap', null);
|
|
83
|
+
allImports.push(config.workflowsWiringMetaFile, config.workflowsWiringFile);
|
|
84
|
+
}
|
|
85
|
+
if (remoteRPC && config.rpc?.remoteRpcWorkersPath) {
|
|
86
|
+
// Only add to imports if we actually generated the file
|
|
87
|
+
allImports.push(config.rpc.remoteRpcWorkersPath);
|
|
88
|
+
}
|
|
72
89
|
// Generate Queues
|
|
73
90
|
const queues = await rpc.invoke('pikkuQueue', null);
|
|
74
91
|
if (queues) {
|
|
@@ -131,6 +148,9 @@ export const all = pikkuVoidFunc({
|
|
|
131
148
|
if (totalCommands > 0)
|
|
132
149
|
summary.set('cliCommands', totalCommands);
|
|
133
150
|
}
|
|
151
|
+
if (state.workflows?.meta) {
|
|
152
|
+
summary.set('workflows', Object.keys(state.workflows.meta).length);
|
|
153
|
+
}
|
|
134
154
|
// Display summary (unless in silent mode)
|
|
135
155
|
if (!logger.isSilent()) {
|
|
136
156
|
console.log(summary.format());
|
|
@@ -13,6 +13,7 @@ export const bootstrap = pikkuVoidFunc({
|
|
|
13
13
|
await rpc.invoke('pikkuChannelTypes', null);
|
|
14
14
|
await rpc.invoke('pikkuSchedulerTypes', null);
|
|
15
15
|
await rpc.invoke('pikkuQueueTypes', null);
|
|
16
|
+
await rpc.invoke('pikkuWorkflowTypes', null);
|
|
16
17
|
await rpc.invoke('pikkuMCPTypes', null);
|
|
17
18
|
await rpc.invoke('pikkuCLITypes', null);
|
|
18
19
|
// Check for critical errors and exit if any were logged
|
|
@@ -99,29 +99,10 @@ ${rendererImports}
|
|
|
99
99
|
* Executes CLI commands over a WebSocket connection
|
|
100
100
|
*/
|
|
101
101
|
export async function ${capitalizedName}CLIClient(
|
|
102
|
-
|
|
102
|
+
ws: WebSocket,
|
|
103
103
|
args?: string[]
|
|
104
104
|
): Promise<void> {
|
|
105
|
-
//
|
|
106
|
-
let WebSocketImpl: any
|
|
107
|
-
if (typeof WebSocket !== 'undefined') {
|
|
108
|
-
WebSocketImpl = WebSocket
|
|
109
|
-
} else {
|
|
110
|
-
// Node.js environment - dynamically import 'ws'
|
|
111
|
-
try {
|
|
112
|
-
const wsModule = await import('ws')
|
|
113
|
-
WebSocketImpl = wsModule.default
|
|
114
|
-
} catch (e) {
|
|
115
|
-
throw new Error(
|
|
116
|
-
'No WebSocket implementation found. In Node.js environments, you need to:\\n' +
|
|
117
|
-
'1. Install the "ws" package: npm install ws\\n' +
|
|
118
|
-
'Learn more: https://www.npmjs.com/package/ws'
|
|
119
|
-
)
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Create WebSocket connection
|
|
124
|
-
const ws = new WebSocketImpl(url) as WebSocket
|
|
105
|
+
// Create Pikku WebSocket wrapper
|
|
125
106
|
const pikkuWS = new CorePikkuWebsocket(ws)
|
|
126
107
|
|
|
127
108
|
// Register renderers for CLI commands
|
|
@@ -141,7 +122,19 @@ export default ${capitalizedName}CLIClient
|
|
|
141
122
|
// For direct execution (if this file is run directly)
|
|
142
123
|
if (import.meta.url === \`file://\${process.argv[1]}\`) {
|
|
143
124
|
const url = process.env.PIKKU_WS_URL || 'ws://localhost:4002${finalChannelRoute}'
|
|
144
|
-
|
|
125
|
+
|
|
126
|
+
// Create WebSocket instance
|
|
127
|
+
let WebSocketImpl: any
|
|
128
|
+
if (typeof WebSocket !== 'undefined') {
|
|
129
|
+
WebSocketImpl = WebSocket
|
|
130
|
+
} else {
|
|
131
|
+
// Node.js environment - dynamically import 'ws'
|
|
132
|
+
const wsModule = await import('ws')
|
|
133
|
+
WebSocketImpl = wsModule.default
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const ws = new WebSocketImpl(url) as WebSocket
|
|
137
|
+
${capitalizedName}CLIClient(ws, process.argv.slice(2)).catch(error => {
|
|
145
138
|
console.error('Fatal channel CLI error:', error)
|
|
146
139
|
// TODO: We get an error code even when it exists cleanly, investigate
|
|
147
140
|
// process.exit(1)
|
|
@@ -8,7 +8,15 @@ export const pikkuQueue = pikkuSessionlessFunc({
|
|
|
8
8
|
const visitState = await getInspectorState();
|
|
9
9
|
const { queueWorkersWiringFile, queueWorkersWiringMetaFile, packageMappings, } = config;
|
|
10
10
|
const { queueWorkers } = visitState;
|
|
11
|
-
|
|
11
|
+
// Add remote RPC worker to queue metadata if it exists
|
|
12
|
+
const queueMeta = { ...queueWorkers.meta };
|
|
13
|
+
if (config.rpc?.remoteRpcWorkersPath) {
|
|
14
|
+
queueMeta['pikku-remote-internal-rpc'] = {
|
|
15
|
+
pikkuFuncName: 'pikkuRemoteInternalRPC',
|
|
16
|
+
queueName: 'pikku-remote-internal-rpc',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
await writeFileInDir(logger, queueWorkersWiringMetaFile, serializeQueueMeta(queueMeta));
|
|
12
20
|
await writeFileInDir(logger, queueWorkersWiringFile, serializeFileImports('addQueueWorkers', queueWorkersWiringFile, queueWorkers.files, packageMappings));
|
|
13
21
|
return true;
|
|
14
22
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { QueueWorkersMeta } from '@pikku/core/queue';
|
|
2
2
|
import { TypesMap } from '@pikku/inspector';
|
|
3
3
|
import { FunctionsMeta } from '@pikku/core';
|
|
4
|
-
export declare const serializeQueueMap: (relativeToPath: string, packageMappings: Record<string, string>, typesMap: TypesMap, functionsMeta: FunctionsMeta, queueWorkersMeta:
|
|
4
|
+
export declare const serializeQueueMap: (relativeToPath: string, packageMappings: Record<string, string>, typesMap: TypesMap, functionsMeta: FunctionsMeta, queueWorkersMeta: QueueWorkersMeta) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const serializeQueueMeta: (queueWorkersMeta:
|
|
1
|
+
import { QueueWorkersMeta } from '@pikku/core/queue';
|
|
2
|
+
export declare const serializeQueueMeta: (queueWorkersMeta: QueueWorkersMeta) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuPublicRPC: any;
|