@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,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
3
|
*/
|
|
4
4
|
import { addSchema } from '@pikku/core/schema'
|
|
5
5
|
|
|
6
|
+
import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' }
|
|
7
|
+
addSchema('PikkuSchemasOutput', PikkuSchemasOutput)
|
|
8
|
+
|
|
9
|
+
|
|
6
10
|
import * as PikkuChannelsOutput from './schemas/PikkuChannelsOutput.schema.json' with { type: 'json' }
|
|
7
11
|
addSchema('PikkuChannelsOutput', PikkuChannelsOutput)
|
|
8
12
|
|
|
@@ -15,10 +19,6 @@ import * as PikkuFunctionsOutput from './schemas/PikkuFunctionsOutput.schema.jso
|
|
|
15
19
|
addSchema('PikkuFunctionsOutput', PikkuFunctionsOutput)
|
|
16
20
|
|
|
17
21
|
|
|
18
|
-
import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' }
|
|
19
|
-
addSchema('PikkuSchemasOutput', PikkuSchemasOutput)
|
|
20
|
-
|
|
21
|
-
|
|
22
22
|
import * as PikkuHTTPOutput from './schemas/PikkuHTTPOutput.schema.json' with { type: 'json' }
|
|
23
23
|
addSchema('PikkuHTTPOutput', PikkuHTTPOutput)
|
|
24
24
|
|
|
@@ -39,6 +39,14 @@ import * as PikkuQueueOutput from './schemas/PikkuQueueOutput.schema.json' with
|
|
|
39
39
|
addSchema('PikkuQueueOutput', PikkuQueueOutput)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
+
import * as PikkuPublicRPCOutput from './schemas/PikkuPublicRPCOutput.schema.json' with { type: 'json' }
|
|
43
|
+
addSchema('PikkuPublicRPCOutput', PikkuPublicRPCOutput)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
import * as PikkuRemoteRPCOutput from './schemas/PikkuRemoteRPCOutput.schema.json' with { type: 'json' }
|
|
47
|
+
addSchema('PikkuRemoteRPCOutput', PikkuRemoteRPCOutput)
|
|
48
|
+
|
|
49
|
+
|
|
42
50
|
import * as PikkuRPCOutput from './schemas/PikkuRPCOutput.schema.json' with { type: 'json' }
|
|
43
51
|
addSchema('PikkuRPCOutput', PikkuRPCOutput)
|
|
44
52
|
|
|
@@ -47,5 +55,9 @@ import * as PikkuSchedulerOutput from './schemas/PikkuSchedulerOutput.schema.jso
|
|
|
47
55
|
addSchema('PikkuSchedulerOutput', PikkuSchedulerOutput)
|
|
48
56
|
|
|
49
57
|
|
|
58
|
+
import * as PikkuWorkflowOutput from './schemas/PikkuWorkflowOutput.schema.json' with { type: 'json' }
|
|
59
|
+
addSchema('PikkuWorkflowOutput', PikkuWorkflowOutput)
|
|
60
|
+
|
|
61
|
+
|
|
50
62
|
import * as PikkuCLIConfig from './schemas/PikkuCLIConfig.schema.json' with { type: 'json' }
|
|
51
63
|
addSchema('PikkuCLIConfig', PikkuCLIConfig)
|
|
@@ -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":"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,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* This provides the structure needed for TypeScript to be aware of workflows and their input/output types
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// Custom types are those that are defined directly within generics
|
|
11
|
+
// or are broken into simpler types
|
|
12
|
+
export type PikkuSchemasOutput = false | true
|
|
13
|
+
export type PikkuChannelsOutput = false | true
|
|
14
|
+
export type PikkuCLIOutput = false | true
|
|
15
|
+
export type PikkuFunctionsOutput = false | true
|
|
16
|
+
export type PikkuHTTPOutput = false | true
|
|
17
|
+
export type PikkuMCPOutput = false | true
|
|
18
|
+
export type PikkuMiddlewareOutput = false | true
|
|
19
|
+
export type PikkuPermissionsOutput = false | true
|
|
20
|
+
export type PikkuQueueOutput = false | true
|
|
21
|
+
export type PikkuPublicRPCOutput = false | true
|
|
22
|
+
export type PikkuRemoteRPCOutput = false | true
|
|
23
|
+
export type PikkuRPCOutput = false | true
|
|
24
|
+
export type PikkuSchedulerOutput = false | true
|
|
25
|
+
export type PikkuWorkflowOutput = false | true
|
|
26
|
+
|
|
27
|
+
interface WorkflowHandler<I, O> {
|
|
28
|
+
input: I;
|
|
29
|
+
output: O;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type WorkflowMap = {
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Type-safe workflow client API
|
|
38
|
+
*/
|
|
39
|
+
export type WorkflowClient<Name extends keyof WorkflowMap> = {
|
|
40
|
+
/**
|
|
41
|
+
* Start a new workflow run
|
|
42
|
+
*/
|
|
43
|
+
start: (input: WorkflowMap[Name]['input']) => Promise<{ runId: string }>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Get a workflow run by ID
|
|
47
|
+
*/
|
|
48
|
+
getRun: <output extends keyof WorkflowMap[Name]>(runId: string) => Promise<WorkflowMap[Name][output]>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Cancel a running workflow
|
|
52
|
+
*/
|
|
53
|
+
cancelRun: (runId: string) => Promise<boolean>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Map of all registered workflows with type-safe client APIs
|
|
58
|
+
*/
|
|
59
|
+
export type TypedWorkflowClients = {
|
|
60
|
+
[Name in keyof WorkflowMap]: WorkflowClient<Name>;
|
|
61
|
+
}
|
|
62
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
|
|
8
|
+
import { CoreWorkflow, wireWorkflow as wireWorkflowCore, PikkuWorkflowInteraction, WorkflowStepOptions } from '@pikku/core/workflow'
|
|
9
|
+
import { CorePikkuFunctionConfig, CorePikkuFunctionSessionless } from '@pikku/core'
|
|
10
|
+
import type { PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
|
|
11
|
+
import type { UserSession, SingletonServices } from '../../types/application-types.d.js'
|
|
12
|
+
import type { TypedPikkuRPC, RPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Type definition for workflows that orchestrate multi-step processes.
|
|
16
|
+
* Workflows support both inline and remote execution modes with step caching.
|
|
17
|
+
*/
|
|
18
|
+
type WorkflowWiring = CoreWorkflow<
|
|
19
|
+
CorePikkuFunctionConfig<PikkuFunctionWorkflow<any, any>, PikkuPermission<any>, PikkuMiddleware>
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Typed workflow interaction with RPC awareness
|
|
24
|
+
* Provides type-safe workflow.do() for RPC steps
|
|
25
|
+
*/
|
|
26
|
+
export interface TypedWorkflow extends PikkuWorkflowInteraction {
|
|
27
|
+
/**
|
|
28
|
+
* Execute a workflow step with RPC invocation (typed based on available RPCs)
|
|
29
|
+
* @template K - RPC name from the RPC map
|
|
30
|
+
*/
|
|
31
|
+
do<K extends keyof RPCMap>(
|
|
32
|
+
stepName: string,
|
|
33
|
+
rpcName: K,
|
|
34
|
+
data: RPCMap[K]['input'],
|
|
35
|
+
options?: WorkflowStepOptions
|
|
36
|
+
): Promise<RPCMap[K]['output']>
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Execute a workflow step with inline function
|
|
40
|
+
* @template T - Return type of the inline function
|
|
41
|
+
*/
|
|
42
|
+
do<T>(
|
|
43
|
+
stepName: string,
|
|
44
|
+
fn: () => T | Promise<T>,
|
|
45
|
+
options?: WorkflowStepOptions
|
|
46
|
+
): Promise<T>
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Workflow function type with typed workflow service
|
|
51
|
+
* Includes the workflow interaction object with typed RPC methods
|
|
52
|
+
*/
|
|
53
|
+
export type PikkuFunctionWorkflow<
|
|
54
|
+
In = unknown,
|
|
55
|
+
Out = never
|
|
56
|
+
> = CorePikkuFunctionSessionless<
|
|
57
|
+
In,
|
|
58
|
+
Out,
|
|
59
|
+
null,
|
|
60
|
+
SingletonServices & {
|
|
61
|
+
rpc: TypedPikkuRPC
|
|
62
|
+
workflow: TypedWorkflow
|
|
63
|
+
},
|
|
64
|
+
UserSession
|
|
65
|
+
>
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Creates a workflow function with typed input and output.
|
|
69
|
+
* Workflow functions have access to the workflow interaction object for step execution.
|
|
70
|
+
*
|
|
71
|
+
* @template In - Input type for the workflow
|
|
72
|
+
* @template Out - Output type for the workflow
|
|
73
|
+
* @param func - Function definition, either direct function or configuration object
|
|
74
|
+
* @returns The normalized configuration object
|
|
75
|
+
*/
|
|
76
|
+
export const pikkuWorkflowFunc = <In, Out = unknown>(
|
|
77
|
+
func:
|
|
78
|
+
| PikkuFunctionWorkflow<In, Out>
|
|
79
|
+
| CorePikkuFunctionConfig<PikkuFunctionWorkflow<In, Out>, PikkuPermission<In>, PikkuMiddleware>
|
|
80
|
+
) => {
|
|
81
|
+
return typeof func === 'function' ? { func } : func
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Registers a workflow with the Pikku framework.
|
|
86
|
+
* Workflows can run in 'inline' (synchronous) or 'remote' (queue-based) execution modes.
|
|
87
|
+
*
|
|
88
|
+
* @param workflow - Workflow definition with name, execution mode, and handler function
|
|
89
|
+
*/
|
|
90
|
+
export const wireWorkflow = (workflow: WorkflowWiring) => {
|
|
91
|
+
wireWorkflowCore(workflow as any)
|
|
92
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## 0.11.0
|
|
2
|
+
|
|
3
|
+
## 0.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1d064c5: feat: using pikku cli to drive the pikku cli
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- Add workflow code generation (types, maps, workers, metadata)
|
|
12
|
+
- Add public RPC and remote RPC code generation
|
|
13
|
+
|
|
1
14
|
# @pikku/cli
|
|
2
15
|
|
|
3
16
|
## 0.10.2
|
package/bin/pikku.ts
CHANGED
|
@@ -3,30 +3,30 @@ 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
|
-
|
|
6
|
+
import { existsSync } from 'fs'
|
|
7
|
+
import { fileURLToPath } from 'url'
|
|
8
|
+
import { dirname, join } from 'path'
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
11
|
+
const __dirname = dirname(__filename)
|
|
12
12
|
|
|
13
13
|
// Check if Pikku CLI is available
|
|
14
|
-
|
|
14
|
+
const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js')
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
if (existsSync(pikkuCliPath)) {
|
|
17
|
+
try {
|
|
18
|
+
// Use the generated Pikku CLI
|
|
19
|
+
const { PikkuCLI } = await import(pikkuCliPath)
|
|
20
|
+
await PikkuCLI(process.argv.slice(2))
|
|
21
|
+
process.exit(0)
|
|
22
|
+
} catch (error) {
|
|
23
|
+
// If import fails, fall back to Commander.js
|
|
24
|
+
console.warn(
|
|
25
|
+
'Failed to load Pikku CLI, using fallback mode:',
|
|
26
|
+
error.message
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
30
|
|
|
31
31
|
// Fallback to Commander.js for initial setup
|
|
32
32
|
// Import bootstrap if it exists
|
package/build.sh
CHANGED
|
@@ -16,7 +16,7 @@ rm -rf .pikku/cli
|
|
|
16
16
|
# This relies on the published version being backwards compatible enough to generate
|
|
17
17
|
# types that work with the current codebase.
|
|
18
18
|
echo "Generating Pikku types using published @pikku/cli..."
|
|
19
|
-
npx -y @pikku/cli@
|
|
19
|
+
npx -y @pikku/cli@latest
|
|
20
20
|
|
|
21
21
|
# Step 3: Build the TypeScript source to dist
|
|
22
22
|
# Now that we have the generated types (from the published version),
|
package/cli.schema.json
CHANGED
|
@@ -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}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* WebSocket channel backend for 'pikku' CLI commands
|
|
6
|
+
*/
|
|
7
|
+
import { wireChannel } from '../channel/pikku-channel-types.gen.js';
|
|
8
|
+
import { pikkuMiddleware } from '../function/pikku-function-types.gen.js';
|
|
9
|
+
import { all } from '../../src/functions/commands/all.js';
|
|
10
|
+
import { bootstrap } from '../../src/functions/commands/bootstrap.js';
|
|
11
|
+
import { watch } from '../../src/functions/commands/watch.js';
|
|
12
|
+
import { pikkuSchemas } from '../../src/functions/wirings/functions/schemas.js';
|
|
13
|
+
import { pikkuFetch } from '../../src/functions/wirings/fetch/index.js';
|
|
14
|
+
import { pikkuWebSocketTyped } from '../../src/functions/wirings/channels/pikku-command-websocket-typed.js';
|
|
15
|
+
import { pikkuRPCClient } from '../../src/functions/wirings/rpc/pikku-command-rpc-client.js';
|
|
16
|
+
import { pikkuQueueService } from '../../src/functions/wirings/queue/pikku-command-queue-service.js';
|
|
17
|
+
import { pikkuOpenAPI } from '../../src/functions/wirings/http/pikku-command-openapi.js';
|
|
18
|
+
import { pikkuNext } from '../../src/functions/runtimes/nextjs/pikku-command-nextjs.js';
|
|
19
|
+
// Middleware to close the channel after CLI command completes
|
|
20
|
+
const cliCloseOnComplete = pikkuMiddleware(async (services, { channel }, next) => {
|
|
21
|
+
const closeChannel = () => {
|
|
22
|
+
setTimeout(async () => {
|
|
23
|
+
try {
|
|
24
|
+
// This gives time for the response to be sent before closing
|
|
25
|
+
await channel?.close();
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
// Ignore errors on close
|
|
29
|
+
}
|
|
30
|
+
}, 200);
|
|
31
|
+
};
|
|
32
|
+
try {
|
|
33
|
+
const result = await next();
|
|
34
|
+
closeChannel();
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
closeChannel();
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
wireChannel({
|
|
43
|
+
name: 'pikku-cli',
|
|
44
|
+
route: '/cli/pikku',
|
|
45
|
+
auth: false,
|
|
46
|
+
onMessageWiring: {
|
|
47
|
+
command: {
|
|
48
|
+
'all': {
|
|
49
|
+
func: all,
|
|
50
|
+
middleware: [cliCloseOnComplete],
|
|
51
|
+
},
|
|
52
|
+
'bootstrap': {
|
|
53
|
+
func: bootstrap,
|
|
54
|
+
middleware: [cliCloseOnComplete],
|
|
55
|
+
},
|
|
56
|
+
'watch': {
|
|
57
|
+
func: watch,
|
|
58
|
+
middleware: [cliCloseOnComplete],
|
|
59
|
+
},
|
|
60
|
+
'schemas': {
|
|
61
|
+
func: pikkuSchemas,
|
|
62
|
+
middleware: [cliCloseOnComplete],
|
|
63
|
+
},
|
|
64
|
+
'fetch': {
|
|
65
|
+
func: pikkuFetch,
|
|
66
|
+
middleware: [cliCloseOnComplete],
|
|
67
|
+
},
|
|
68
|
+
'websocket': {
|
|
69
|
+
func: pikkuWebSocketTyped,
|
|
70
|
+
middleware: [cliCloseOnComplete],
|
|
71
|
+
},
|
|
72
|
+
'rpc': {
|
|
73
|
+
func: pikkuRPCClient,
|
|
74
|
+
middleware: [cliCloseOnComplete],
|
|
75
|
+
},
|
|
76
|
+
'queue-service': {
|
|
77
|
+
func: pikkuQueueService,
|
|
78
|
+
middleware: [cliCloseOnComplete],
|
|
79
|
+
},
|
|
80
|
+
'openapi': {
|
|
81
|
+
func: pikkuOpenAPI,
|
|
82
|
+
middleware: [cliCloseOnComplete],
|
|
83
|
+
},
|
|
84
|
+
'nextjs': {
|
|
85
|
+
func: pikkuNext,
|
|
86
|
+
middleware: [cliCloseOnComplete],
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
tags: ['cli', 'pikku']
|
|
91
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
|
+
*/
|
|
4
|
+
import '../pikku-bootstrap.gen.js';
|
|
5
|
+
/**
|
|
6
|
+
* Pikku CLI Client (via WebSocket Channel)
|
|
7
|
+
* Executes CLI commands over a WebSocket connection
|
|
8
|
+
*/
|
|
9
|
+
export declare function PikkuCLIClient(ws: WebSocket, args?: string[]): Promise<void>;
|
|
10
|
+
export default PikkuCLIClient;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
|
+
*/
|
|
4
|
+
import { executeCLIViaChannel } from '@pikku/core/cli/channel';
|
|
5
|
+
import { CorePikkuWebsocket } from '@pikku/websocket';
|
|
6
|
+
import '../pikku-bootstrap.gen.js';
|
|
7
|
+
import { clientCLIRenderer } from '../../src/services.js';
|
|
8
|
+
/**
|
|
9
|
+
* Pikku CLI Client (via WebSocket Channel)
|
|
10
|
+
* Executes CLI commands over a WebSocket connection
|
|
11
|
+
*/
|
|
12
|
+
export async function PikkuCLIClient(ws, args) {
|
|
13
|
+
// Create Pikku WebSocket wrapper
|
|
14
|
+
const pikkuWS = new CorePikkuWebsocket(ws);
|
|
15
|
+
// Register renderers for CLI commands
|
|
16
|
+
const renderers = {};
|
|
17
|
+
await executeCLIViaChannel({
|
|
18
|
+
programName: 'pikku',
|
|
19
|
+
pikkuWS,
|
|
20
|
+
args,
|
|
21
|
+
renderers,
|
|
22
|
+
defaultRenderer: clientCLIRenderer,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// Export as default for easy importing
|
|
26
|
+
export default PikkuCLIClient;
|
|
27
|
+
// For direct execution (if this file is run directly)
|
|
28
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
29
|
+
const url = process.env.PIKKU_WS_URL || 'ws://localhost:4002/cli/pikku';
|
|
30
|
+
// Create WebSocket instance
|
|
31
|
+
let WebSocketImpl;
|
|
32
|
+
if (typeof WebSocket !== 'undefined') {
|
|
33
|
+
WebSocketImpl = WebSocket;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Node.js environment - dynamically import 'ws'
|
|
37
|
+
const wsModule = await import('ws');
|
|
38
|
+
WebSocketImpl = wsModule.default;
|
|
39
|
+
}
|
|
40
|
+
const ws = new WebSocketImpl(url);
|
|
41
|
+
PikkuCLIClient(ws, process.argv.slice(2)).catch(error => {
|
|
42
|
+
console.error('Fatal channel CLI error:', error);
|
|
43
|
+
// TODO: We get an error code even when it exists cleanly, investigate
|
|
44
|
+
// process.exit(1)
|
|
45
|
+
});
|
|
46
|
+
}
|