@pikku/cli 0.11.0 → 0.11.2
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 +11 -12
- package/.pikku/channel/pikku-channels-map.gen.d.ts +9 -9
- 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 +54 -0
- package/.pikku/cli/pikku-cli-types.gen.ts +3 -3
- package/.pikku/cli/pikku-cli-wirings-meta.gen.json +146 -0
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +4 -34
- package/.pikku/cli/pikku-cli-wirings.gen.ts +2 -1
- package/.pikku/cli/pikku-cli.gen.ts +41 -0
- package/.pikku/function/pikku-function-types.gen.ts +49 -63
- package/.pikku/function/pikku-functions-meta.gen.json +988 -0
- package/.pikku/function/pikku-functions-meta.gen.ts +4 -970
- package/.pikku/function/pikku-functions-meta.min.gen.json +212 -0
- package/.pikku/function/pikku-functions-meta.min.gen.ts +4 -209
- package/.pikku/http/pikku-http-types.gen.ts +2 -2
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +9 -9
- 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 +13 -13
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.json +5 -0
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +6 -4
- package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
- package/.pikku/pikku-bootstrap.gen.ts +1 -4
- package/.pikku/pikku-services.gen.ts +6 -8
- package/.pikku/pikku-types.gen.ts +1 -1
- package/.pikku/pikku-websocket.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +2 -2
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +9 -9
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +1 -0
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +5 -7
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +2 -2
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +9 -9
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +41 -40
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +2 -2
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.json +1 -0
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +5 -2
- package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
- package/.pikku/schemas/register.gen.ts +27 -27
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/.pikku/services/config.gen.json +99 -0
- package/.pikku/services/getInspectorState.gen.json +10 -0
- package/.pikku/services/jwt.gen.json +13 -0
- package/.pikku/services/logger.gen.json +25 -0
- package/.pikku/services/queueService.gen.json +14 -0
- package/.pikku/services/schedulerService.gen.json +17 -0
- package/.pikku/services/schema.gen.json +14 -0
- package/.pikku/services/variables.gen.json +13 -0
- package/.pikku/services/workflowService.gen.json +31 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -9
- package/.pikku/workflow/pikku-workflow-types.gen.ts +36 -31
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.json +1 -0
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -2
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +6 -2
- package/CHANGELOG.md +27 -1
- package/bin/pikku.ts +6 -32
- package/build.sh +53 -31
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +6 -7
- 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.js +91 -0
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +10 -0
- package/dist/.pikku/cli/pikku-cli-client.gen.js +44 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +3 -3
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +3 -34
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +146 -0
- 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 +29 -79
- package/dist/.pikku/function/pikku-function-types.gen.js +19 -15
- package/dist/.pikku/function/pikku-functions-meta.gen.js +3 -969
- package/dist/.pikku/function/pikku-functions-meta.gen.json +988 -0
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +3 -208
- package/dist/.pikku/function/pikku-functions-meta.min.gen.json +212 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +2 -2
- 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 +13 -13
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +5 -4
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.json +5 -0
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -4
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -4
- package/dist/.pikku/pikku-services.gen.d.ts +5 -8
- package/dist/.pikku/pikku-services.gen.js +3 -6
- 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 +2 -2
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +3 -7
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +1 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.d.ts +6 -9
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +2 -2
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +2 -2
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +3 -2
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.json +1 -0
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +17 -17
- 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/PikkuSchemasOutput.schema.json +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +29 -25
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +22 -8
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +3 -2
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.json +1 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +6 -2
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +6 -3
- package/dist/bin/pikku.js +5 -28
- package/dist/src/cli.wiring.js +108 -106
- package/dist/src/functions/commands/all.js +82 -42
- package/dist/src/functions/commands/bootstrap.js +22 -10
- package/dist/src/functions/commands/watch.js +6 -3
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +12 -7
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +42 -4
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +40 -2
- package/dist/src/functions/wirings/channels/pikku-channels.js +9 -2
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +10 -11
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +9 -3
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +1 -1
- package/dist/src/functions/wirings/cli/serialize-cli-types.js +2 -2
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.js +4 -4
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +4 -4
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +15 -5
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +23 -23
- package/dist/src/functions/wirings/functions/schemas.js +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +50 -64
- package/dist/src/functions/wirings/http/openapi-spec-generator.js +4 -4
- package/dist/src/functions/wirings/http/pikku-http-routes.js +9 -2
- package/dist/src/functions/wirings/http/serialize-http-types.js +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +18 -4
- package/dist/src/functions/wirings/mcp/serialize-mcp-types.js +12 -12
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +26 -2
- package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.d.ts +5 -2
- package/dist/src/functions/wirings/middleware/serialize-middleware-groups-meta.js +5 -13
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +9 -3
- package/dist/src/functions/wirings/queue/pikku-queue.js +9 -3
- package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +2 -1
- package/dist/src/functions/wirings/queue/serialize-queue-meta.js +10 -1
- package/dist/src/functions/wirings/queue/serialize-queue-types.js +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +9 -2
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +11 -4
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +3 -3
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +6 -3
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.d.ts +2 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.js +11 -1
- package/dist/src/functions/wirings/scheduler/serialize-scheduler-types.js +1 -1
- package/dist/src/functions/wirings/services/pikku-command-service-metadata.d.ts +1 -0
- package/dist/src/functions/wirings/services/pikku-command-service-metadata.js +22 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +3 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +12 -8
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +2 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +11 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +36 -31
- package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.d.ts +8 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-wirings.js +30 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +2 -2
- package/dist/src/middleware/log-command-info-and-time.d.ts +2 -2
- package/dist/src/middleware/log-command-info-and-time.js +1 -4
- package/dist/src/services/cli-logger-forwarder.service.d.ts +3 -0
- package/dist/src/services/cli-logger-forwarder.service.js +9 -2
- package/dist/src/services.d.ts +2 -7
- package/dist/src/services.js +14 -12
- package/dist/src/utils/check-required-types.d.ts +2 -2
- package/dist/src/utils/check-required-types.js +2 -3
- package/dist/src/utils/pikku-cli-config.js +35 -2
- package/dist/src/utils/pikku-files-and-methods.d.ts +2 -2
- package/dist/src/utils/pikku-files-and-methods.js +4 -4
- package/dist/src/utils/schema-generator.d.ts +1 -1
- package/dist/src/utils/schema-generator.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -8
- package/src/cli.wiring.ts +110 -105
- package/src/functions/commands/all.ts +94 -45
- package/src/functions/commands/bootstrap.ts +25 -10
- package/src/functions/commands/watch.ts +6 -3
- package/src/functions/runtimes/nextjs/pikku-command-nextjs.ts +26 -5
- package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +43 -4
- package/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts +40 -1
- package/src/functions/wirings/channels/pikku-channels.ts +27 -3
- package/src/functions/wirings/channels/serialize-channel-types.ts +10 -11
- package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
- package/src/functions/wirings/cli/pikku-command-cli-types.ts +1 -1
- package/src/functions/wirings/cli/pikku-command-cli.ts +26 -3
- package/src/functions/wirings/cli/serialize-channel-cli.ts +1 -1
- package/src/functions/wirings/cli/serialize-cli-types.ts +2 -2
- package/src/functions/wirings/cli/serialize-local-cli-bootstrap.ts +5 -5
- package/src/functions/wirings/functions/pikku-command-function-types-split.ts +6 -6
- package/src/functions/wirings/functions/pikku-command-functions.ts +39 -4
- package/src/functions/wirings/functions/pikku-command-services.ts +25 -25
- package/src/functions/wirings/functions/schemas.ts +2 -2
- package/src/functions/wirings/functions/serialize-function-types.ts +51 -65
- package/src/functions/wirings/http/openapi-spec-generator.ts +14 -5
- package/src/functions/wirings/http/pikku-http-routes.ts +28 -2
- package/src/functions/wirings/http/serialize-http-types.ts +1 -1
- package/src/functions/wirings/mcp/pikku-command-mcp.ts +30 -4
- package/src/functions/wirings/mcp/serialize-mcp-types.ts +12 -12
- package/src/functions/wirings/middleware/pikku-command-middleware.ts +35 -2
- package/src/functions/wirings/middleware/serialize-middleware-groups-meta.ts +4 -19
- package/src/functions/wirings/permissions/pikku-command-permissions.ts +2 -2
- package/src/functions/wirings/queue/pikku-command-queue.ts +27 -2
- package/src/functions/wirings/queue/pikku-queue.ts +27 -2
- package/src/functions/wirings/queue/serialize-queue-meta.ts +15 -1
- package/src/functions/wirings/queue/serialize-queue-types.ts +1 -1
- package/src/functions/wirings/rpc/pikku-command-rpc.ts +25 -2
- package/src/functions/wirings/rpc/serialize-public-rpc.ts +11 -4
- package/src/functions/wirings/rpc/serialize-remote-rpc.ts +1 -1
- package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +3 -3
- package/src/functions/wirings/scheduler/pikku-command-scheduler.ts +30 -4
- package/src/functions/wirings/scheduler/serialize-scheduler-meta.ts +20 -1
- package/src/functions/wirings/scheduler/serialize-scheduler-types.ts +1 -1
- package/src/functions/wirings/services/pikku-command-service-metadata.ts +25 -0
- package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +8 -1
- package/src/functions/wirings/workflow/pikku-command-workflow.ts +36 -8
- package/src/functions/wirings/workflow/serialize-workflow-meta.ts +18 -1
- package/src/functions/wirings/workflow/serialize-workflow-types.ts +39 -31
- package/src/functions/wirings/workflow/serialize-workflow-wirings.ts +47 -0
- package/src/functions/wirings/workflow/serialize-workflow-workers.ts +2 -2
- package/src/middleware/log-command-info-and-time.ts +3 -6
- package/src/services/cli-logger-forwarder.service.ts +11 -2
- package/src/services.ts +15 -15
- package/src/utils/check-required-types.ts +4 -7
- package/src/utils/pikku-cli-config.ts +69 -2
- package/src/utils/pikku-files-and-methods.ts +10 -13
- package/src/utils/schema-generator.ts +2 -2
- package/types/application-types.d.ts +1 -1
- package/types/config.d.ts +12 -1
- package/.pikku/function/pikku-functions.gen.ts +0 -84
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +0 -47
- package/dist/.pikku/function/pikku-functions.gen.js +0 -83
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +0 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +0 -47
- package/dist/.pikku/schemas/schemas/PikkuRemoteInternalRPCInput.schema.json +0 -1
- /package/dist/.pikku/{function/pikku-functions.gen.d.ts → cli/pikku-cli-channel.d.ts} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "schedulerService",
|
|
3
|
+
"summary": "Abstract scheduler service for persistent scheduled task management",
|
|
4
|
+
"description": "Implementations use queue backends (pg-boss, BullMQ) for distributed scheduling",
|
|
5
|
+
"package": "@pikku/core",
|
|
6
|
+
"path": "home/runner/work/pikku/pikku/packages/core/dist/types/core.types.d.ts",
|
|
7
|
+
"version": "0.11.1",
|
|
8
|
+
"interface": "class SchedulerService {\n init(): Promise<void>;\n scheduleRPC(delay: number | string, rpcName: string, data?: any, session?: CoreUserSession): Promise<string>;\n unschedule(taskId: string): Promise<boolean>;\n getTask(taskId: string): Promise<ScheduledTaskInfo | null>;\n getAllTasks(): Promise<ScheduledTaskSummary[]>;\n close(): Promise<void>;\n}",
|
|
9
|
+
"expandedProperties": {
|
|
10
|
+
"init": "() => Promise<void>",
|
|
11
|
+
"scheduleRPC": "(delay: number | string, rpcName: string, data?: any, session?: CoreUserSession) => Promise<string>",
|
|
12
|
+
"unschedule": "(taskId: string) => Promise<boolean>",
|
|
13
|
+
"getTask": "(taskId: string) => Promise<ScheduledTaskInfo | null>",
|
|
14
|
+
"getAllTasks": "() => Promise<ScheduledTaskSummary[]>",
|
|
15
|
+
"close": "() => Promise<void>"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "schema",
|
|
3
|
+
"summary": "Interface for a schema service that handles schema compilation, validation, and management.",
|
|
4
|
+
"description": "",
|
|
5
|
+
"package": "@pikku/core",
|
|
6
|
+
"path": "home/runner/work/pikku/pikku/packages/core/dist/types/core.types.d.ts",
|
|
7
|
+
"version": "0.11.1",
|
|
8
|
+
"interface": "export interface SchemaService {\n /**\n * Compiles a schema with the provided name and value, making it available for use.\n * @param {string} name - The unique name for the schema.\n * @param {any} value - The schema definition or configuration to be compiled.\n * @returns {Promise<void> | void} A promise if asynchronous, or void if synchronous.\n */\n compileSchema: (name: string, value: any) => Promise<void> | void;\n /**\n * Validates data against a specified schema.\n * @param {string} schema - The name of the schema to validate against.\n * @param {any} data - The data to validate against the schema.\n * @returns {Promise<void> | void} A promise if asynchronous, or void if synchronous.\n */\n validateSchema: (schema: string, data: any) => Promise<void> | void;\n /**\n * Retrieves a set of all registered schema names.\n * @returns {Set<string>} A set containing the names of all available schemas.\n */\n getSchemaNames: () => Set<string>;\n}",
|
|
9
|
+
"expandedProperties": {
|
|
10
|
+
"compileSchema": "(name: string, value: any) => Promise<void> | void",
|
|
11
|
+
"validateSchema": "(schema: string, data: any) => Promise<void> | void",
|
|
12
|
+
"getSchemaNames": "() => Set<string>"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "variables",
|
|
3
|
+
"summary": "",
|
|
4
|
+
"description": "",
|
|
5
|
+
"package": "@pikku/core",
|
|
6
|
+
"path": "home/runner/work/pikku/pikku/packages/core/dist/types/core.types.d.ts",
|
|
7
|
+
"version": "0.11.1",
|
|
8
|
+
"interface": "export interface VariablesService {\n get: (name: string) => Promise<string | undefined> | string | undefined;\n getAll: () => Promise<Record<string, string | undefined>> | Record<string, string | undefined>;\n}",
|
|
9
|
+
"expandedProperties": {
|
|
10
|
+
"get": "(name: string) => Promise<string | undefined> | string | undefined",
|
|
11
|
+
"getAll": "() => Promise<Record<string, string | undefined>> | Record<string, string | undefined>"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflowService",
|
|
3
|
+
"summary": "Interface for workflow orchestration",
|
|
4
|
+
"description": "Handles workflow execution, replay, orchestration logic, and run-level state",
|
|
5
|
+
"package": "@pikku/core",
|
|
6
|
+
"path": "home/runner/work/pikku/pikku/packages/core/dist/types/core.types.d.ts",
|
|
7
|
+
"version": "0.11.1",
|
|
8
|
+
"interface": "export interface WorkflowService {\n createRun(workflowName: string, input: any): Promise<string>;\n getRun(id: string): Promise<WorkflowRun | null>;\n getRunHistory(runId: string): Promise<Array<StepState & {\n stepName: string;\n }>>;\n updateRunStatus(id: string, status: WorkflowStatus, output?: any, error?: SerializedError): Promise<void>;\n withRunLock<T>(id: string, fn: () => Promise<T>): Promise<T>;\n close(): Promise<void>;\n resumeWorkflow(runId: string): Promise<void>;\n setServices(singletonServices: CoreSingletonServices, createWireServices: CreateWireServices, config: CoreConfig): void;\n startWorkflow<I>(name: string, input: I, rpcService: any): Promise<{\n runId: string;\n }>;\n runWorkflowJob(runId: string, rpcService: any): Promise<void>;\n orchestrateWorkflow(runId: string, rpcService: any): Promise<void>;\n executeWorkflowSleep(runId: string, stepId: string): Promise<void>;\n insertStepState(runId: string, stepName: string, rpcName: string, data: any, stepOptions?: {\n retries?: number;\n retryDelay?: string | number;\n }): Promise<StepState>;\n getStepState(runId: string, stepName: string): Promise<StepState>;\n setStepRunning(stepId: string): Promise<void>;\n setStepScheduled(stepId: string): Promise<void>;\n setStepResult(stepId: string, result: any): Promise<void>;\n setStepError(stepId: string, error: Error): Promise<void>;\n createRetryAttempt(stepId: string, status: 'pending' | 'running'): Promise<StepState>;\n executeWorkflowStep(runId: string, stepName: string, rpcName: string | null, data: any, rpcService: any): Promise<void>;\n}",
|
|
9
|
+
"expandedProperties": {
|
|
10
|
+
"createRun": "(workflowName: string, input: any) => Promise<string>",
|
|
11
|
+
"getRun": "(id: string) => Promise<WorkflowRun | null>",
|
|
12
|
+
"getRunHistory": "(runId: string) => Promise<Array<StepState & { stepName: string; }>>",
|
|
13
|
+
"updateRunStatus": "(id: string, status: WorkflowStatus, output?: any, error?: SerializedError) => Promise<void>",
|
|
14
|
+
"withRunLock": "<T>(id: string, fn: () => Promise<T>) => Promise<T>",
|
|
15
|
+
"close": "() => Promise<void>",
|
|
16
|
+
"resumeWorkflow": "(runId: string) => Promise<void>",
|
|
17
|
+
"setServices": "(singletonServices: CoreSingletonServices, createWireServices: CreateWireServices, config: CoreConfig) => void",
|
|
18
|
+
"startWorkflow": "<I>(name: string, input: I, rpcService: any) => Promise<{ runId: string; }>",
|
|
19
|
+
"runWorkflowJob": "(runId: string, rpcService: any) => Promise<void>",
|
|
20
|
+
"orchestrateWorkflow": "(runId: string, rpcService: any) => Promise<void>",
|
|
21
|
+
"executeWorkflowSleep": "(runId: string, stepId: string) => Promise<void>",
|
|
22
|
+
"insertStepState": "(runId: string, stepName: string, rpcName: string, data: any, stepOptions?: { retries?: number; retryDelay?: string | number; }) => Promise<StepState>",
|
|
23
|
+
"getStepState": "(runId: string, stepName: string) => Promise<StepState>",
|
|
24
|
+
"setStepRunning": "(stepId: string) => Promise<void>",
|
|
25
|
+
"setStepScheduled": "(stepId: string) => Promise<void>",
|
|
26
|
+
"setStepResult": "(stepId: string, result: any) => Promise<void>",
|
|
27
|
+
"setStepError": "(stepId: string, error: Error) => Promise<void>",
|
|
28
|
+
"createRetryAttempt": "(stepId: string, status: \"pending\" | \"running\") => Promise<StepState>",
|
|
29
|
+
"executeWorkflowStep": "(runId: string, stepName: string, rpcName: string | null, data: any, rpcService: any) => Promise<void>"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.2
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* This provides the structure needed for TypeScript to be aware of workflows and their input/output types
|
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
// Custom types are those that are defined directly within generics
|
|
11
11
|
// or are broken into simpler types
|
|
12
|
-
export type PikkuChannelsOutput = false | true
|
|
13
|
-
export type PikkuCLIOutput = false | true
|
|
14
|
-
export type PikkuFunctionsOutput = false | true
|
|
15
12
|
export type PikkuSchemasOutput = false | true
|
|
16
|
-
export type
|
|
17
|
-
export type PikkuMCPOutput = false | true
|
|
13
|
+
export type PikkuFunctionsOutput = false | true
|
|
18
14
|
export type PikkuMiddlewareOutput = false | true
|
|
19
15
|
export type PikkuPermissionsOutput = false | true
|
|
20
|
-
export type PikkuQueueOutput = false | true
|
|
21
|
-
export type PikkuPublicRPCOutput = false | true
|
|
22
|
-
export type PikkuRemoteRPCOutput = false | true
|
|
23
16
|
export type PikkuRPCOutput = false | true
|
|
17
|
+
export type PikkuPublicRPCOutput = false | true
|
|
18
|
+
export type PikkuHTTPOutput = false | true
|
|
24
19
|
export type PikkuSchedulerOutput = false | true
|
|
25
20
|
export type PikkuWorkflowOutput = false | true
|
|
21
|
+
export type PikkuRemoteRPCOutput = false | true
|
|
22
|
+
export type PikkuQueueOutput = false | true
|
|
23
|
+
export type PikkuChannelsOutput = false | true
|
|
24
|
+
export type PikkuMCPOutput = false | true
|
|
25
|
+
export type PikkuCLIOutput = false | true
|
|
26
26
|
|
|
27
27
|
interface WorkflowHandler<I, O> {
|
|
28
28
|
input: I;
|
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.2
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Workflow-specific type definitions for tree-shaking optimization
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import type {
|
|
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'
|
|
8
|
+
import { PikkuWorkflowWire, WorkflowStepOptions } from '@pikku/core/workflow'
|
|
9
|
+
import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
|
|
10
|
+
import type { RPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
|
-
*
|
|
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
|
|
13
|
+
* Typed workflow wire with RPC awareness
|
|
24
14
|
* Provides type-safe workflow.do() for RPC steps
|
|
25
15
|
*/
|
|
26
|
-
export interface TypedWorkflow extends
|
|
16
|
+
export interface TypedWorkflow extends PikkuWorkflowWire {
|
|
27
17
|
/**
|
|
28
18
|
* Execute a workflow step with RPC invocation (typed based on available RPCs)
|
|
29
19
|
* @template K - RPC name from the RPC map
|
|
@@ -48,25 +38,23 @@ export interface TypedWorkflow extends PikkuWorkflowInteraction {
|
|
|
48
38
|
|
|
49
39
|
/**
|
|
50
40
|
* Workflow function type with typed workflow service
|
|
51
|
-
* Includes the workflow
|
|
41
|
+
* Includes the workflow wire object with typed RPC methods
|
|
52
42
|
*/
|
|
53
43
|
export type PikkuFunctionWorkflow<
|
|
54
44
|
In = unknown,
|
|
55
45
|
Out = never
|
|
56
|
-
> =
|
|
46
|
+
> = PikkuFunctionSessionless<
|
|
57
47
|
In,
|
|
58
48
|
Out,
|
|
59
|
-
|
|
60
|
-
SingletonServices & {
|
|
61
|
-
rpc: TypedPikkuRPC
|
|
62
|
-
workflow: TypedWorkflow
|
|
63
|
-
},
|
|
64
|
-
UserSession
|
|
49
|
+
'workflow'
|
|
65
50
|
>
|
|
66
51
|
|
|
67
52
|
/**
|
|
68
53
|
* Creates a workflow function with typed input and output.
|
|
69
|
-
* Workflow functions have access to the workflow
|
|
54
|
+
* Workflow functions have access to the workflow wire object for step execution.
|
|
55
|
+
*
|
|
56
|
+
* This is the permissive mode - workflows that don't conform to simple DSL will fall back
|
|
57
|
+
* to basic extraction with a warning.
|
|
70
58
|
*
|
|
71
59
|
* @template In - Input type for the workflow
|
|
72
60
|
* @template Out - Output type for the workflow
|
|
@@ -76,17 +64,34 @@ export type PikkuFunctionWorkflow<
|
|
|
76
64
|
export const pikkuWorkflowFunc = <In, Out = unknown>(
|
|
77
65
|
func:
|
|
78
66
|
| PikkuFunctionWorkflow<In, Out>
|
|
79
|
-
|
|
|
67
|
+
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
80
68
|
) => {
|
|
81
69
|
return typeof func === 'function' ? { func } : func
|
|
82
70
|
}
|
|
83
71
|
|
|
84
72
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
73
|
+
* Creates a simple workflow function with typed input and output.
|
|
74
|
+
* Simple workflows must conform to the restricted DSL for static analysis.
|
|
75
|
+
*
|
|
76
|
+
* This is the strict mode - workflows that don't conform to simple DSL will cause
|
|
77
|
+
* a critical error during inspection.
|
|
87
78
|
*
|
|
88
|
-
*
|
|
79
|
+
* Constraints:
|
|
80
|
+
* - Must use only workflow.do() with RPC form (no inline functions)
|
|
81
|
+
* - Only if/else, for..of, and Promise.all(array.map()) control flow allowed
|
|
82
|
+
* - Step names must be unique (except across mutually exclusive branches)
|
|
83
|
+
* - All workflow calls must be awaited
|
|
84
|
+
*
|
|
85
|
+
* @template In - Input type for the workflow
|
|
86
|
+
* @template Out - Output type for the workflow
|
|
87
|
+
* @param func - Function definition, either direct function or configuration object
|
|
88
|
+
* @returns The normalized configuration object
|
|
89
89
|
*/
|
|
90
|
-
export const
|
|
91
|
-
|
|
90
|
+
export const pikkuSimpleWorkflowFunc = <In, Out = unknown>(
|
|
91
|
+
func:
|
|
92
|
+
| PikkuFunctionWorkflow<In, Out>
|
|
93
|
+
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
94
|
+
) => {
|
|
95
|
+
return typeof func === 'function' ? { func } : func
|
|
92
96
|
}
|
|
97
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.2
|
|
3
3
|
*/
|
|
4
4
|
import { pikkuState } from '@pikku/core'
|
|
5
|
-
|
|
5
|
+
import { WorkflowsMeta } from '@pikku/core/workflow'
|
|
6
|
+
import metaData from './pikku-workflow-wirings-meta.gen.json' with { type: 'json' }
|
|
7
|
+
|
|
8
|
+
pikkuState('workflows', 'meta', metaData as WorkflowsMeta)
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.2
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Auto-generated workflow registrations
|
|
6
|
+
* Do not edit manually - regenerate with 'npx pikku'
|
|
7
|
+
*/
|
|
8
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,37 @@
|
|
|
1
1
|
## 0.11.0
|
|
2
2
|
|
|
3
|
+
## 0.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4b811db: chore: updating all dependencies
|
|
8
|
+
- ce902b1: feat: serialize json files seperate to pikku meta state calls
|
|
9
|
+
- e12a00c: feat: adding initialSession to PikkuWire which is correctly typed (undefined / not depending on function type)
|
|
10
|
+
- ce902b1: feat: adding rpcName to rpc url so its nicer in network tabs
|
|
11
|
+
- 4579434: breaking: changing the signature of functions
|
|
12
|
+
- 28aeb7f: breaking: extract docs in the wiring meta
|
|
13
|
+
- ce902b1: feat: adding in pikkuSimpleWorkflowFunc
|
|
14
|
+
- 06e1a31: breaking: change session services to wire services
|
|
15
|
+
- Updated dependencies [4b811db]
|
|
16
|
+
- Updated dependencies [e12a00c]
|
|
17
|
+
- Updated dependencies [4579434]
|
|
18
|
+
- Updated dependencies [28aeb7f]
|
|
19
|
+
- Updated dependencies [ce902b1]
|
|
20
|
+
- Updated dependencies [06e1a31]
|
|
21
|
+
- @pikku/inspector@0.11.1
|
|
22
|
+
- @pikku/core@0.11.1
|
|
23
|
+
|
|
24
|
+
## 0.11.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 1d064c5: feat: using pikku cli to drive the pikku cli
|
|
29
|
+
|
|
3
30
|
### Minor Changes
|
|
4
31
|
|
|
5
32
|
- Add workflow code generation (types, maps, workers, metadata)
|
|
6
33
|
- Add public RPC and remote RPC code generation
|
|
7
34
|
|
|
8
|
-
|
|
9
35
|
# @pikku/cli
|
|
10
36
|
|
|
11
37
|
## 0.10.2
|
package/bin/pikku.ts
CHANGED
|
@@ -1,34 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander'
|
|
3
3
|
import { createConfig, createSingletonServices } from '../src/services.js'
|
|
4
|
-
import { PikkuRPCService } from '@pikku/core/rpc'
|
|
5
4
|
import { LocalVariablesService } from '@pikku/core/services'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// import { dirname, join } from 'path'
|
|
5
|
+
import { all as allCommand } from '../src/functions/commands/all.js'
|
|
6
|
+
import { watch as watchCommand } from '../src/functions/commands/watch.js'
|
|
9
7
|
|
|
10
|
-
// const __filename = fileURLToPath(import.meta.url)
|
|
11
|
-
// const __dirname = dirname(__filename)
|
|
12
|
-
|
|
13
|
-
// Check if Pikku CLI is available
|
|
14
|
-
// const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js')
|
|
15
|
-
|
|
16
|
-
// if (existsSync(pikkuCliPath)) {
|
|
17
|
-
// try {
|
|
18
|
-
// // Use the generated Pikku CLI
|
|
19
|
-
// const { PikkuCLI } = await import('../.pikku/cli/pikku-cli.gen.js')
|
|
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
|
-
|
|
31
|
-
// Fallback to Commander.js for initial setup
|
|
32
8
|
// Import bootstrap if it exists
|
|
33
9
|
try {
|
|
34
10
|
await import('../.pikku/pikku-bootstrap.gen.js')
|
|
@@ -36,16 +12,14 @@ try {
|
|
|
36
12
|
// Bootstrap doesn't exist yet, continue anyway
|
|
37
13
|
}
|
|
38
14
|
|
|
39
|
-
const action = async (command, cliConfig) => {
|
|
15
|
+
const action = async (command: string, cliConfig: any) => {
|
|
40
16
|
const config = await createConfig(new LocalVariablesService(), cliConfig)
|
|
41
17
|
const services = await createSingletonServices(config)
|
|
42
|
-
const rpcWrapper = new PikkuRPCService()
|
|
43
|
-
const { rpc } = await rpcWrapper.injectRPCService(services, {}, false)
|
|
44
18
|
|
|
45
19
|
if (command === 'watch') {
|
|
46
|
-
await
|
|
20
|
+
await watchCommand.func(services)
|
|
47
21
|
} else {
|
|
48
|
-
await
|
|
22
|
+
await allCommand.func(services)
|
|
49
23
|
}
|
|
50
24
|
}
|
|
51
25
|
|
|
@@ -60,7 +34,7 @@ const all = (program, name, description) => {
|
|
|
60
34
|
)
|
|
61
35
|
.option(
|
|
62
36
|
'--session-services-factory-type',
|
|
63
|
-
'The type of your
|
|
37
|
+
'The type of your wire services factory'
|
|
64
38
|
)
|
|
65
39
|
.option('-c, --config <string>', 'The path to pikku cli config file')
|
|
66
40
|
.option('-t, --tags <tags...>', 'Which tags to filter by')
|
package/build.sh
CHANGED
|
@@ -1,52 +1,74 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
# Exit on error
|
|
4
3
|
set -e
|
|
5
4
|
|
|
6
5
|
echo "Starting Pikku CLI build process..."
|
|
7
6
|
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
# Clean .pikku directory
|
|
8
|
+
rm -rf .pikku
|
|
9
|
+
|
|
10
|
+
# Create minimal bootstrap stub files
|
|
11
|
+
echo "Creating minimal bootstrap stub files..."
|
|
12
|
+
mkdir -p .pikku/function .pikku/cli
|
|
13
|
+
|
|
14
|
+
cat > .pikku/pikku-types.gen.ts << 'EOF'
|
|
15
|
+
/**
|
|
16
|
+
* Bootstrap stub - minimal types for initial build
|
|
17
|
+
*/
|
|
18
|
+
export * from './function/pikku-function-types.gen.js'
|
|
19
|
+
export * from './cli/pikku-cli-types.gen.js'
|
|
20
|
+
EOF
|
|
21
|
+
|
|
22
|
+
cat > .pikku/function/pikku-function-types.gen.ts << 'EOF'
|
|
23
|
+
/**
|
|
24
|
+
* Bootstrap stub - minimal function types
|
|
25
|
+
*/
|
|
26
|
+
export const pikkuFunc = <In, Out = unknown>(func: any) => {
|
|
27
|
+
return typeof func === 'function' ? { func } : func
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const pikkuSessionlessFunc = <In, Out = unknown>(func: any) => {
|
|
31
|
+
return typeof func === 'function' ? { func } : func
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const pikkuVoidFunc = (func: any) => {
|
|
35
|
+
return typeof func === 'function' ? { func } : func
|
|
36
|
+
}
|
|
37
|
+
EOF
|
|
38
|
+
|
|
39
|
+
cat > .pikku/cli/pikku-cli-types.gen.ts << 'EOF'
|
|
40
|
+
/**
|
|
41
|
+
* Bootstrap stub - minimal CLI types
|
|
42
|
+
*/
|
|
43
|
+
export { wireCLI } from '@pikku/core/cli'
|
|
44
|
+
|
|
45
|
+
export const pikkuCLICommand = (config: any) => {
|
|
46
|
+
return config
|
|
47
|
+
}
|
|
48
|
+
EOF
|
|
49
|
+
|
|
50
|
+
cat > .pikku/pikku-bootstrap.gen.ts << 'EOF'
|
|
51
|
+
/**
|
|
52
|
+
* Bootstrap stub - empty bootstrap file
|
|
53
|
+
*/
|
|
54
|
+
EOF
|
|
55
|
+
|
|
56
|
+
# Build TypeScript with stubs
|
|
24
57
|
echo "Building TypeScript to dist..."
|
|
25
58
|
yarn tsc -b
|
|
26
59
|
|
|
27
|
-
#
|
|
28
|
-
# The types we generated in step 2 were from the old published version.
|
|
29
|
-
# We need to regenerate them with the newly built local version to ensure
|
|
30
|
-
# the generated files reflect the actual current state of the CLI.
|
|
60
|
+
# Regenerate types with newly built CLI
|
|
31
61
|
echo "Removing .pikku directory (generated from published version)..."
|
|
32
62
|
rm -rf .pikku
|
|
33
63
|
|
|
34
|
-
# Step 5: Regenerate types using the newly built local CLI
|
|
35
|
-
# Use the freshly built local version (from dist) to regenerate Pikku types.
|
|
36
|
-
# This ensures the generated files are in sync with the current codebase.
|
|
37
64
|
echo "Regenerating Pikku types using local CLI..."
|
|
38
65
|
yarn pikku
|
|
39
66
|
|
|
40
|
-
#
|
|
41
|
-
# Compile again now that we have the correct generated types from the local version.
|
|
42
|
-
# This ensures the final dist reflects the true current state of both the source
|
|
43
|
-
# and the generated type files.
|
|
67
|
+
# Rebuild with generated types
|
|
44
68
|
echo "Rebuilding TypeScript with local types..."
|
|
45
69
|
yarn tsc -b
|
|
46
70
|
|
|
47
|
-
#
|
|
48
|
-
# The schema is generated as part of the Pikku type generation process
|
|
49
|
-
# and needs to be copied to the root of the package for distribution
|
|
71
|
+
# Copy schema file
|
|
50
72
|
echo "Copying schema file..."
|
|
51
73
|
cp .pikku/schemas/schemas/PikkuCLIConfig.schema.json cli.schema.json
|
|
52
74
|
|
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"},"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"},"
|
|
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"},"functionsMetaJsonFile":{"type":"string"},"functionsMetaMinFile":{"type":"string"},"functionsMetaMinJsonFile":{"type":"string"},"functionTypesFile":{"type":"string"},"httpWiringsFile":{"type":"string"},"httpWiringMetaFile":{"type":"string"},"httpWiringMetaJsonFile":{"type":"string"},"httpMapDeclarationFile":{"type":"string"},"httpTypesFile":{"type":"string"},"channelsWiringFile":{"type":"string"},"channelsWiringMetaFile":{"type":"string"},"channelsWiringMetaJsonFile":{"type":"string"},"channelsMapDeclarationFile":{"type":"string"},"channelsTypesFile":{"type":"string"},"rpcInternalWiringMetaFile":{"type":"string"},"rpcInternalWiringMetaJsonFile":{"type":"string"},"rpcInternalMapDeclarationFile":{"type":"string"},"rpcMapDeclarationFile":{"type":"string"},"schedulersWiringFile":{"type":"string"},"schedulersWiringMetaFile":{"type":"string"},"schedulersWiringMetaJsonFile":{"type":"string"},"schedulersTypesFile":{"type":"string"},"queueWorkersWiringFile":{"type":"string"},"queueWorkersWiringMetaFile":{"type":"string"},"queueWorkersWiringMetaJsonFile":{"type":"string"},"queueMapDeclarationFile":{"type":"string"},"queueTypesFile":{"type":"string"},"workflowsWiringFile":{"type":"string"},"workflowsWiringMetaFile":{"type":"string"},"workflowsWiringMetaJsonFile":{"type":"string"},"workflowsWorkersFile":{"type":"string"},"workflowMapDeclarationFile":{"type":"string"},"workflowTypesFile":{"type":"string"},"mcpWiringsFile":{"type":"string"},"mcpWiringsMetaFile":{"type":"string"},"mcpWiringsMetaJsonFile":{"type":"string"},"mcpTypesFile":{"type":"string"},"cliWiringsFile":{"type":"string"},"cliWiringMetaFile":{"type":"string"},"cliWiringMetaJsonFile":{"type":"string"},"cliBootstrapFile":{"type":"string"},"cliTypesFile":{"type":"string"},"servicesFile":{"type":"string"},"middlewareFile":{"type":"string"},"middlewareGroupsMetaFile":{"type":"string"},"middlewareGroupsMetaJsonFile":{"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"},"wireServicesFactoryType":{"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","channelsWiringMetaJsonFile","cliBootstrapFile","cliTypesFile","cliWiringMetaFile","cliWiringMetaJsonFile","cliWiringsFile","configDir","filters","functionTypesFile","functionsFile","functionsMetaFile","functionsMetaJsonFile","functionsMetaMinFile","functionsMetaMinJsonFile","httpMapDeclarationFile","httpTypesFile","httpWiringMetaFile","httpWiringMetaJsonFile","httpWiringsFile","mcpTypesFile","mcpWiringsFile","mcpWiringsMetaFile","mcpWiringsMetaJsonFile","middlewareFile","middlewareGroupsMetaFile","middlewareGroupsMetaJsonFile","outDir","packageMappings","permissionsFile","queueMapDeclarationFile","queueTypesFile","queueWorkersWiringFile","queueWorkersWiringMetaFile","queueWorkersWiringMetaJsonFile","rootDir","rpcInternalMapDeclarationFile","rpcInternalWiringMetaFile","rpcInternalWiringMetaJsonFile","rpcMapDeclarationFile","schedulersTypesFile","schedulersWiringFile","schedulersWiringMetaFile","schedulersWiringMetaJsonFile","schemaDirectory","servicesFile","srcDirectories","tsconfig","typesDeclarationFile","workflowMapDeclarationFile","workflowTypesFile","workflowsWiringFile","workflowsWiringMetaFile","workflowsWiringMetaJsonFile","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,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.11.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.2
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
|
|
6
6
|
* Channel-specific type definitions for tree-shaking optimization
|
|
7
7
|
*/
|
|
8
8
|
import { CoreChannel } from '@pikku/core/channel';
|
|
9
|
-
import { CorePikkuFunctionConfig } from '@pikku/core';
|
|
10
9
|
import { AssertHTTPWiringParams } from '@pikku/core/http';
|
|
11
|
-
import type {
|
|
10
|
+
import type { PikkuFunctionConfig, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js';
|
|
12
11
|
/**
|
|
13
12
|
* Type definition for WebSocket channels with typed data exchange.
|
|
14
13
|
* Supports connection, disconnection, and message handling.
|
|
@@ -17,7 +16,7 @@ import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMid
|
|
|
17
16
|
* @template ChannelData - Type of data exchanged through the channel
|
|
18
17
|
* @template Channel - String literal type for the channel name
|
|
19
18
|
*/
|
|
20
|
-
type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelData, Channel,
|
|
19
|
+
type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelData, Channel, PikkuFunctionConfig<void, any, 'channel' | 'session' | 'rpc'>, PikkuFunctionConfig<void, void, 'channel' | 'session' | 'rpc'>, PikkuFunctionConfig<any, any, 'channel' | 'session' | 'rpc'>, PikkuPermission, PikkuMiddleware>;
|
|
21
20
|
/**
|
|
22
21
|
* Creates a function that handles WebSocket channel connections.
|
|
23
22
|
* Called when a client connects to a channel.
|
|
@@ -26,7 +25,7 @@ type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<ChannelDat
|
|
|
26
25
|
* @param func - Function definition, either direct function or configuration object
|
|
27
26
|
* @returns The normalized configuration object
|
|
28
27
|
*/
|
|
29
|
-
export declare const pikkuChannelConnectionFunc: <Out = unknown>(func: PikkuFunctionSessionless<void, Out,
|
|
28
|
+
export declare const pikkuChannelConnectionFunc: <Out = unknown>(func: PikkuFunctionSessionless<void, Out, "channel" | "session" | "rpc"> | PikkuFunctionConfig<void, Out, "channel" | "session" | "rpc">) => PikkuFunctionConfig<void, Out, "rpc" | "channel" | "session">;
|
|
30
29
|
/**
|
|
31
30
|
* Creates a function that handles WebSocket channel disconnections.
|
|
32
31
|
* Called when a client disconnects from a channel.
|
|
@@ -34,7 +33,7 @@ export declare const pikkuChannelConnectionFunc: <Out = unknown>(func: PikkuFunc
|
|
|
34
33
|
* @param func - Function definition, either direct function or configuration object
|
|
35
34
|
* @returns The normalized configuration object
|
|
36
35
|
*/
|
|
37
|
-
export declare const pikkuChannelDisconnectionFunc: (func: PikkuFunctionSessionless<void, void,
|
|
36
|
+
export declare const pikkuChannelDisconnectionFunc: (func: PikkuFunctionSessionless<void, void, "channel"> | PikkuFunctionConfig<void, void, "channel" | "session" | "rpc">) => PikkuFunctionConfig<void, void, "rpc" | "channel" | "session">;
|
|
38
37
|
/**
|
|
39
38
|
* Creates a function that handles WebSocket channel messages.
|
|
40
39
|
* Called when a message is received on a channel.
|
|
@@ -45,7 +44,7 @@ export declare const pikkuChannelDisconnectionFunc: (func: PikkuFunctionSessionl
|
|
|
45
44
|
* @param func - Function definition, either direct function or configuration object
|
|
46
45
|
* @returns The normalized configuration object
|
|
47
46
|
*/
|
|
48
|
-
export declare const pikkuChannelFunc: <In, Out = unknown>(func: PikkuFunctionSessionless<In, Out,
|
|
47
|
+
export declare const pikkuChannelFunc: <In, Out = unknown>(func: PikkuFunctionSessionless<In, Out, "channel" | "session" | "rpc"> | PikkuFunctionConfig<In, Out, "channel" | "session" | "rpc">) => PikkuFunctionConfig<In, Out, "rpc" | "channel" | "session">;
|
|
49
48
|
/**
|
|
50
49
|
* Registers a WebSocket channel with the Pikku framework.
|
|
51
50
|
*
|