@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
|
@@ -40,11 +40,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
40
40
|
},
|
|
41
41
|
ignoreFiles: config.ignoreFiles ??
|
|
42
42
|
extendedConfig.ignoreFiles ?? [
|
|
43
|
-
'**/*.gen.ts',
|
|
44
43
|
'**/*.test.ts',
|
|
45
44
|
'**/*.spec.ts',
|
|
46
45
|
'**/node_modules/**',
|
|
47
|
-
'**/.pikku/**',
|
|
48
46
|
'**/dist/**',
|
|
49
47
|
],
|
|
50
48
|
schema: {
|
|
@@ -64,11 +62,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
64
62
|
? resolve(configDir, config.rootDir)
|
|
65
63
|
: configDir,
|
|
66
64
|
ignoreFiles: config.ignoreFiles ?? [
|
|
67
|
-
'**/*.gen.ts',
|
|
68
65
|
'**/*.test.ts',
|
|
69
66
|
'**/*.spec.ts',
|
|
70
67
|
'**/node_modules/**',
|
|
71
|
-
'**/.pikku/**',
|
|
72
68
|
'**/dist/**',
|
|
73
69
|
],
|
|
74
70
|
schema: {
|
|
@@ -85,6 +81,7 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
85
81
|
const rpcDir = join(result.outDir, 'rpc');
|
|
86
82
|
const schedulerDir = join(result.outDir, 'scheduler');
|
|
87
83
|
const queueDir = join(result.outDir, 'queue');
|
|
84
|
+
const workflowDir = join(result.outDir, 'workflow');
|
|
88
85
|
const mcpDir = join(result.outDir, 'mcp');
|
|
89
86
|
const cliDir = join(result.outDir, 'cli');
|
|
90
87
|
const middlewareDir = join(result.outDir, 'middleware');
|
|
@@ -144,6 +141,13 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
144
141
|
if (!result.rpcMapDeclarationFile) {
|
|
145
142
|
result.rpcMapDeclarationFile = join(rpcDir, 'pikku-rpc-wirings-map.gen.d.ts');
|
|
146
143
|
}
|
|
144
|
+
// RPC config defaults
|
|
145
|
+
if (!result.rpc) {
|
|
146
|
+
result.rpc = {};
|
|
147
|
+
}
|
|
148
|
+
if (!result.rpc.remoteRpcWorkersPath) {
|
|
149
|
+
result.rpc.remoteRpcWorkersPath = join(rpcDir, 'pikku-remote-rpc-workers.gen.ts');
|
|
150
|
+
}
|
|
147
151
|
// Scheduler
|
|
148
152
|
if (!result.schedulersWiringFile) {
|
|
149
153
|
result.schedulersWiringFile = join(schedulerDir, 'pikku-schedulers-wirings.gen.ts');
|
|
@@ -167,6 +171,22 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
167
171
|
if (!result.queueTypesFile) {
|
|
168
172
|
result.queueTypesFile = join(queueDir, 'pikku-queue-types.gen.ts');
|
|
169
173
|
}
|
|
174
|
+
// Workflows
|
|
175
|
+
if (!result.workflowsWiringFile) {
|
|
176
|
+
result.workflowsWiringFile = join(workflowDir, 'pikku-workflow-wirings.gen.ts');
|
|
177
|
+
}
|
|
178
|
+
if (!result.workflowsWiringMetaFile) {
|
|
179
|
+
result.workflowsWiringMetaFile = join(workflowDir, 'pikku-workflow-wirings-meta.gen.ts');
|
|
180
|
+
}
|
|
181
|
+
if (!result.workflowsWorkersFile) {
|
|
182
|
+
result.workflowsWorkersFile = join(workflowDir, 'pikku-workflow-workers.gen.ts');
|
|
183
|
+
}
|
|
184
|
+
if (!result.workflowMapDeclarationFile) {
|
|
185
|
+
result.workflowMapDeclarationFile = join(workflowDir, 'pikku-workflow-map.gen.d.ts');
|
|
186
|
+
}
|
|
187
|
+
if (!result.workflowTypesFile) {
|
|
188
|
+
result.workflowTypesFile = join(workflowDir, 'pikku-workflow-types.gen.ts');
|
|
189
|
+
}
|
|
170
190
|
// Services
|
|
171
191
|
if (!result.servicesFile) {
|
|
172
192
|
result.servicesFile = join(result.outDir, 'pikku-services.gen.ts');
|
|
@@ -7,9 +7,14 @@ export async function generateSchemas(logger, tsconfig, typesMap, functionMeta,
|
|
|
7
7
|
for (const { inputs, outputs } of Object.values(functionMeta)) {
|
|
8
8
|
const types = [...(inputs || []), ...(outputs || [])];
|
|
9
9
|
for (const type of types) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
try {
|
|
11
|
+
const uniqueName = typesMap.getUniqueName(type);
|
|
12
|
+
if (uniqueName) {
|
|
13
|
+
schemasSet.add(uniqueName);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// Skip types not in typesMap (e.g., inline types in generated workflow workers)
|
|
13
18
|
}
|
|
14
19
|
}
|
|
15
20
|
}
|
|
@@ -64,10 +69,26 @@ export async function saveSchemas(logger, schemaParentDir, schemas, typesMap, fu
|
|
|
64
69
|
await writeFileInDir(logger, `${schemaParentDir}/register.gen.ts`, 'export const empty = null;');
|
|
65
70
|
const desiredSchemas = new Set([
|
|
66
71
|
...Object.values(functionsMeta)
|
|
67
|
-
.map(({ inputs, outputs }) =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
.map(({ inputs, outputs }) => {
|
|
73
|
+
const types = [];
|
|
74
|
+
if (inputs?.[0]) {
|
|
75
|
+
try {
|
|
76
|
+
types.push(typesMap.getUniqueName(inputs[0]));
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Skip types not in typesMap (e.g., inline types in generated workflow workers)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (outputs?.[0]) {
|
|
83
|
+
try {
|
|
84
|
+
types.push(typesMap.getUniqueName(outputs[0]));
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Skip types not in typesMap (e.g., inline types in generated workflow workers)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return types;
|
|
91
|
+
})
|
|
71
92
|
.flat()
|
|
72
93
|
.filter((s) => !!s &&
|
|
73
94
|
!['boolean', 'string', 'number', 'null', 'undefined'].includes(s)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/functions/commands/all.ts","../src/functions/commands/bootstrap.ts","../src/functions/commands/watch.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/pikku-command-websocket-typed.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/channels/serialize-websocket-wrapper.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/fetch/index.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/pikku-function-types.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/http/openapi-spec-generator.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-json.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-groups-meta.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/middleware/log-command-info-and-time.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/check-required-types.ts","../src/utils/command-summary.ts","../src/utils/custom-types-generator.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/schema-generator.ts","../src/utils/serialize-import-map.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/pikku-websocket.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/channel/pikku-channels-map.gen.d.ts","../.pikku/channel/pikku-channels-meta.gen.ts","../.pikku/channel/pikku-channels.gen.ts","../.pikku/cli/pikku-cli-types.gen.ts","../.pikku/cli/pikku-cli-wirings-meta.gen.ts","../.pikku/cli/pikku-cli-wirings.gen.ts","../.pikku/function/pikku-function-types.gen.ts","../.pikku/function/pikku-functions-meta.gen.ts","../.pikku/function/pikku-functions-meta.min.gen.ts","../.pikku/function/pikku-functions.gen.ts","../.pikku/http/pikku-http-types.gen.ts","../.pikku/http/pikku-http-wirings-map.gen.d.ts","../.pikku/http/pikku-http-wirings-meta.gen.ts","../.pikku/http/pikku-http-wirings.gen.ts","../.pikku/mcp/pikku-mcp-types.gen.ts","../.pikku/mcp/pikku-mcp-wirings-meta.gen.ts","../.pikku/mcp/pikku-mcp-wirings.gen.ts","../.pikku/queue/pikku-queue-types.gen.ts","../.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts","../.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts","../.pikku/queue/pikku-queue-workers-wirings.gen.ts","../.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts","../.pikku/scheduler/pikku-scheduler-types.gen.ts","../.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts","../.pikku/scheduler/pikku-schedulers-wirings.gen.ts","../.pikku/schemas/register.gen.ts","../types/application-types.d.ts","../types/config.d.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/functions/commands/all.ts","../src/functions/commands/bootstrap.ts","../src/functions/commands/watch.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/pikku-command-websocket-typed.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/channels/serialize-websocket-wrapper.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/fetch/index.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/pikku-function-types.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/http/openapi-spec-generator.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-json.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-groups-meta.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/rpc/pikku-command-public-rpc.ts","../src/functions/wirings/rpc/pikku-command-remote-rpc.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-public-rpc.ts","../src/functions/wirings/rpc/serialize-remote-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/functions/wirings/workflow/pikku-command-workflow-map.ts","../src/functions/wirings/workflow/pikku-command-workflow-types.ts","../src/functions/wirings/workflow/pikku-command-workflow.ts","../src/functions/wirings/workflow/serialize-workflow-map.ts","../src/functions/wirings/workflow/serialize-workflow-meta.ts","../src/functions/wirings/workflow/serialize-workflow-types.ts","../src/functions/wirings/workflow/serialize-workflow-workers.ts","../src/middleware/log-command-info-and-time.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/check-required-types.ts","../src/utils/command-summary.ts","../src/utils/custom-types-generator.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/schema-generator.ts","../src/utils/serialize-import-map.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/pikku-websocket.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/channel/pikku-channels-map.gen.d.ts","../.pikku/channel/pikku-channels-meta.gen.ts","../.pikku/channel/pikku-channels.gen.ts","../.pikku/cli/pikku-cli-channel.ts","../.pikku/cli/pikku-cli-client.gen.ts","../.pikku/cli/pikku-cli-types.gen.ts","../.pikku/cli/pikku-cli-wirings-meta.gen.ts","../.pikku/cli/pikku-cli-wirings.gen.ts","../.pikku/cli/pikku-cli.gen.ts","../.pikku/function/pikku-function-types.gen.ts","../.pikku/function/pikku-functions-meta.gen.ts","../.pikku/function/pikku-functions-meta.min.gen.ts","../.pikku/function/pikku-functions.gen.ts","../.pikku/http/pikku-http-types.gen.ts","../.pikku/http/pikku-http-wirings-map.gen.d.ts","../.pikku/http/pikku-http-wirings-meta.gen.ts","../.pikku/http/pikku-http-wirings.gen.ts","../.pikku/mcp/pikku-mcp-types.gen.ts","../.pikku/mcp/pikku-mcp-wirings-meta.gen.ts","../.pikku/mcp/pikku-mcp-wirings.gen.ts","../.pikku/queue/pikku-queue-types.gen.ts","../.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts","../.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts","../.pikku/queue/pikku-queue-workers-wirings.gen.ts","../.pikku/rpc/pikku-remote-rpc-workers.gen.ts","../.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts","../.pikku/scheduler/pikku-scheduler-types.gen.ts","../.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts","../.pikku/scheduler/pikku-schedulers-wirings.gen.ts","../.pikku/schemas/register.gen.ts","../.pikku/workflow/pikku-workflow-map.gen.d.ts","../.pikku/workflow/pikku-workflow-types.gen.ts","../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts","../.pikku/workflow/pikku-workflow-wirings.gen.ts","../types/application-types.d.ts","../types/config.d.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"author": "yasser.fadl@gmail.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@openapi-contrib/json-schema-to-openapi-schema": "^4.2.0",
|
|
25
|
-
"@pikku/core": "^0.
|
|
26
|
-
"@pikku/inspector": "^0.
|
|
25
|
+
"@pikku/core": "^0.11.0",
|
|
26
|
+
"@pikku/inspector": "^0.11.0",
|
|
27
27
|
"@types/cookie": "^1.0.0",
|
|
28
28
|
"@types/json-schema": "^7.0.15",
|
|
29
29
|
"chalk": "^5.6.2",
|
package/src/cli.wiring.ts
CHANGED
|
@@ -1,107 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { pikkuSchemas } from './functions/wirings/functions/schemas.js'
|
|
2
|
+
import { pikkuFetch } from './functions/wirings/fetch/index.js'
|
|
3
|
+
import { pikkuWebSocketTyped } from './functions/wirings/channels/pikku-command-websocket-typed.js'
|
|
4
|
+
import { pikkuRPCClient } from './functions/wirings/rpc/pikku-command-rpc-client.js'
|
|
5
|
+
import { pikkuQueueService } from './functions/wirings/queue/pikku-command-queue-service.js'
|
|
6
|
+
import { pikkuOpenAPI } from './functions/wirings/http/pikku-command-openapi.js'
|
|
7
|
+
import { pikkuNext } from './functions/runtimes/nextjs/pikku-command-nextjs.js'
|
|
8
|
+
import { pikkuCLICommand, wireCLI } from '../.pikku/cli/pikku-cli-types.gen.js'
|
|
9
|
+
import { all } from './functions/commands/all.js'
|
|
10
|
+
import { bootstrap } from './functions/commands/bootstrap.js'
|
|
11
|
+
import { watch } from './functions/commands/watch.js'
|
|
12
|
+
import { clientCLIRenderer } from './services.js'
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
14
|
+
wireCLI({
|
|
15
|
+
program: 'pikku',
|
|
16
|
+
description:
|
|
17
|
+
'Pikku CLI - Code generation tool for type-safe backend development',
|
|
18
|
+
render: clientCLIRenderer,
|
|
19
|
+
options: {
|
|
20
|
+
config: {
|
|
21
|
+
description: 'Path to pikku.config.json file',
|
|
22
|
+
short: 'c',
|
|
23
|
+
},
|
|
24
|
+
logLevel: {
|
|
25
|
+
description: 'Set log level',
|
|
26
|
+
default: 'info' as const,
|
|
27
|
+
short: 'l',
|
|
28
|
+
},
|
|
29
|
+
userSessionType: {
|
|
30
|
+
description:
|
|
31
|
+
'Specify which UserSession type to use (when multiple exist)',
|
|
32
|
+
},
|
|
33
|
+
singletonServicesFactoryType: {
|
|
34
|
+
description: 'Specify which singleton services factory to use',
|
|
35
|
+
},
|
|
36
|
+
sessionServicesFactoryType: {
|
|
37
|
+
description: 'Specify which session services factory to use',
|
|
38
|
+
},
|
|
39
|
+
stateOutput: {
|
|
40
|
+
description: 'Save inspector state to JSON file for reuse',
|
|
41
|
+
},
|
|
42
|
+
stateInput: {
|
|
43
|
+
description: 'Load inspector state from JSON file (skips inspection)',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
commands: {
|
|
47
|
+
all: pikkuCLICommand({
|
|
48
|
+
func: all,
|
|
49
|
+
description: 'Generate all Pikku files (types, schemas, wirings, etc.)',
|
|
50
|
+
isDefault: true,
|
|
51
|
+
options: {
|
|
52
|
+
tags: {
|
|
53
|
+
description: 'Filter functions by tags (comma-separated)',
|
|
54
|
+
short: 't',
|
|
55
|
+
},
|
|
56
|
+
types: {
|
|
57
|
+
description: 'Filter functions by types (comma-separated)',
|
|
58
|
+
},
|
|
59
|
+
directories: {
|
|
60
|
+
description: 'Filter functions by directories (comma-separated)',
|
|
61
|
+
short: 'd',
|
|
62
|
+
},
|
|
63
|
+
httpMethods: {
|
|
64
|
+
description: 'Filter HTTP routes by methods (comma-separated)',
|
|
65
|
+
},
|
|
66
|
+
httpRoutes: {
|
|
67
|
+
description: 'Filter HTTP routes by route patterns (comma-separated)',
|
|
68
|
+
},
|
|
69
|
+
names: {
|
|
70
|
+
description: 'Filter functions by name patterns (supports wildcards)',
|
|
71
|
+
short: 'n',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
75
|
+
bootstrap: pikkuCLICommand({
|
|
76
|
+
func: bootstrap,
|
|
77
|
+
description: 'Generate only type files (setup phase only)',
|
|
78
|
+
}),
|
|
79
|
+
watch: pikkuCLICommand({
|
|
80
|
+
func: watch,
|
|
81
|
+
description: 'Watch for file changes and regenerate automatically',
|
|
82
|
+
}),
|
|
83
|
+
schemas: pikkuCLICommand({
|
|
84
|
+
func: pikkuSchemas,
|
|
85
|
+
description: 'Generate JSON schemas for function input/output types',
|
|
86
|
+
}),
|
|
87
|
+
fetch: pikkuCLICommand({
|
|
88
|
+
func: pikkuFetch,
|
|
89
|
+
description: 'Generate type-safe HTTP fetch client',
|
|
90
|
+
}),
|
|
91
|
+
websocket: pikkuCLICommand({
|
|
92
|
+
func: pikkuWebSocketTyped,
|
|
93
|
+
description: 'Generate type-safe WebSocket client',
|
|
94
|
+
}),
|
|
95
|
+
rpc: pikkuCLICommand({
|
|
96
|
+
func: pikkuRPCClient,
|
|
97
|
+
description: 'Generate RPC client wrappers',
|
|
98
|
+
}),
|
|
99
|
+
'queue-service': pikkuCLICommand({
|
|
100
|
+
func: pikkuQueueService,
|
|
101
|
+
description: 'Generate queue service wrapper',
|
|
102
|
+
}),
|
|
103
|
+
openapi: pikkuCLICommand({
|
|
104
|
+
func: pikkuOpenAPI,
|
|
105
|
+
description: 'Generate OpenAPI specification from HTTP routes',
|
|
106
|
+
}),
|
|
107
|
+
nextjs: pikkuCLICommand({
|
|
108
|
+
func: pikkuNext,
|
|
109
|
+
description: 'Generate Next.js backend and HTTP wrappers',
|
|
110
|
+
}),
|
|
111
|
+
},
|
|
112
|
+
})
|
|
@@ -28,6 +28,7 @@ export const all: any = pikkuVoidFunc({
|
|
|
28
28
|
await rpc.invoke('pikkuChannelTypes', null)
|
|
29
29
|
await rpc.invoke('pikkuSchedulerTypes', null)
|
|
30
30
|
await rpc.invoke('pikkuQueueTypes', null)
|
|
31
|
+
await rpc.invoke('pikkuWorkflowTypes', null)
|
|
31
32
|
await rpc.invoke('pikkuMCPTypes', null)
|
|
32
33
|
await rpc.invoke('pikkuCLITypes', null)
|
|
33
34
|
|
|
@@ -89,6 +90,30 @@ export const all: any = pikkuVoidFunc({
|
|
|
89
90
|
)
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
// Generate Workflows
|
|
94
|
+
const workflows = await rpc.invoke('pikkuWorkflow', null)
|
|
95
|
+
|
|
96
|
+
// Generate Remote RPC Workers (must be before queue discovery so wireQueueWorker calls are picked up)
|
|
97
|
+
const remoteRPC = await rpc.invoke('pikkuRemoteRPC', null)
|
|
98
|
+
|
|
99
|
+
// Reinspect to pick up generated workflow workers and remote RPC workers BEFORE generating maps
|
|
100
|
+
if (workflows || remoteRPC) {
|
|
101
|
+
await getInspectorState(true)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (workflows) {
|
|
105
|
+
await rpc.invoke('pikkuWorkflowMap', null)
|
|
106
|
+
allImports.push(
|
|
107
|
+
config.workflowsWiringMetaFile,
|
|
108
|
+
config.workflowsWiringFile
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (remoteRPC && config.rpc?.remoteRpcWorkersPath) {
|
|
113
|
+
// Only add to imports if we actually generated the file
|
|
114
|
+
allImports.push(config.rpc.remoteRpcWorkersPath)
|
|
115
|
+
}
|
|
116
|
+
|
|
92
117
|
// Generate Queues
|
|
93
118
|
const queues = await rpc.invoke('pikkuQueue', null)
|
|
94
119
|
if (queues) {
|
|
@@ -175,6 +200,9 @@ export const all: any = pikkuVoidFunc({
|
|
|
175
200
|
)
|
|
176
201
|
if (totalCommands > 0) summary.set('cliCommands', totalCommands)
|
|
177
202
|
}
|
|
203
|
+
if (state.workflows?.meta) {
|
|
204
|
+
summary.set('workflows', Object.keys(state.workflows.meta).length)
|
|
205
|
+
}
|
|
178
206
|
|
|
179
207
|
// Display summary (unless in silent mode)
|
|
180
208
|
if (!logger.isSilent()) {
|
|
@@ -16,6 +16,7 @@ export const bootstrap: any = pikkuVoidFunc({
|
|
|
16
16
|
await rpc.invoke('pikkuChannelTypes', null)
|
|
17
17
|
await rpc.invoke('pikkuSchedulerTypes', null)
|
|
18
18
|
await rpc.invoke('pikkuQueueTypes', null)
|
|
19
|
+
await rpc.invoke('pikkuWorkflowTypes', null)
|
|
19
20
|
await rpc.invoke('pikkuMCPTypes', null)
|
|
20
21
|
await rpc.invoke('pikkuCLITypes', null)
|
|
21
22
|
|
|
@@ -139,29 +139,10 @@ ${rendererImports}
|
|
|
139
139
|
* Executes CLI commands over a WebSocket connection
|
|
140
140
|
*/
|
|
141
141
|
export async function ${capitalizedName}CLIClient(
|
|
142
|
-
|
|
142
|
+
ws: WebSocket,
|
|
143
143
|
args?: string[]
|
|
144
144
|
): Promise<void> {
|
|
145
|
-
//
|
|
146
|
-
let WebSocketImpl: any
|
|
147
|
-
if (typeof WebSocket !== 'undefined') {
|
|
148
|
-
WebSocketImpl = WebSocket
|
|
149
|
-
} else {
|
|
150
|
-
// Node.js environment - dynamically import 'ws'
|
|
151
|
-
try {
|
|
152
|
-
const wsModule = await import('ws')
|
|
153
|
-
WebSocketImpl = wsModule.default
|
|
154
|
-
} catch (e) {
|
|
155
|
-
throw new Error(
|
|
156
|
-
'No WebSocket implementation found. In Node.js environments, you need to:\\n' +
|
|
157
|
-
'1. Install the "ws" package: npm install ws\\n' +
|
|
158
|
-
'Learn more: https://www.npmjs.com/package/ws'
|
|
159
|
-
)
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Create WebSocket connection
|
|
164
|
-
const ws = new WebSocketImpl(url) as WebSocket
|
|
145
|
+
// Create Pikku WebSocket wrapper
|
|
165
146
|
const pikkuWS = new CorePikkuWebsocket(ws)
|
|
166
147
|
|
|
167
148
|
// Register renderers for CLI commands
|
|
@@ -181,7 +162,19 @@ export default ${capitalizedName}CLIClient
|
|
|
181
162
|
// For direct execution (if this file is run directly)
|
|
182
163
|
if (import.meta.url === \`file://\${process.argv[1]}\`) {
|
|
183
164
|
const url = process.env.PIKKU_WS_URL || 'ws://localhost:4002${finalChannelRoute}'
|
|
184
|
-
|
|
165
|
+
|
|
166
|
+
// Create WebSocket instance
|
|
167
|
+
let WebSocketImpl: any
|
|
168
|
+
if (typeof WebSocket !== 'undefined') {
|
|
169
|
+
WebSocketImpl = WebSocket
|
|
170
|
+
} else {
|
|
171
|
+
// Node.js environment - dynamically import 'ws'
|
|
172
|
+
const wsModule = await import('ws')
|
|
173
|
+
WebSocketImpl = wsModule.default
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const ws = new WebSocketImpl(url) as WebSocket
|
|
177
|
+
${capitalizedName}CLIClient(ws, process.argv.slice(2)).catch(error => {
|
|
185
178
|
console.error('Fatal channel CLI error:', error)
|
|
186
179
|
// TODO: We get an error code even when it exists cleanly, investigate
|
|
187
180
|
// process.exit(1)
|
|
@@ -14,10 +14,19 @@ export const pikkuQueue: any = pikkuSessionlessFunc<void, boolean>({
|
|
|
14
14
|
} = config
|
|
15
15
|
const { queueWorkers } = visitState
|
|
16
16
|
|
|
17
|
+
// Add remote RPC worker to queue metadata if it exists
|
|
18
|
+
const queueMeta = { ...queueWorkers.meta }
|
|
19
|
+
if (config.rpc?.remoteRpcWorkersPath) {
|
|
20
|
+
queueMeta['pikku-remote-internal-rpc'] = {
|
|
21
|
+
pikkuFuncName: 'pikkuRemoteInternalRPC',
|
|
22
|
+
queueName: 'pikku-remote-internal-rpc',
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
17
26
|
await writeFileInDir(
|
|
18
27
|
logger,
|
|
19
28
|
queueWorkersWiringMetaFile,
|
|
20
|
-
serializeQueueMeta(
|
|
29
|
+
serializeQueueMeta(queueMeta)
|
|
21
30
|
)
|
|
22
31
|
await writeFileInDir(
|
|
23
32
|
logger,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { QueueWorkersMeta } from '@pikku/core/queue'
|
|
2
2
|
import { serializeImportMap } from '../../../utils/serialize-import-map.js'
|
|
3
3
|
import { TypesMap } from '@pikku/inspector'
|
|
4
4
|
import { FunctionsMeta } from '@pikku/core'
|
|
@@ -9,7 +9,7 @@ export const serializeQueueMap = (
|
|
|
9
9
|
packageMappings: Record<string, string>,
|
|
10
10
|
typesMap: TypesMap,
|
|
11
11
|
functionsMeta: FunctionsMeta,
|
|
12
|
-
queueWorkersMeta:
|
|
12
|
+
queueWorkersMeta: QueueWorkersMeta
|
|
13
13
|
) => {
|
|
14
14
|
const requiredTypes = new Set<string>()
|
|
15
15
|
const serializedCustomTypes = generateCustomTypes(typesMap, requiredTypes)
|
|
@@ -69,7 +69,7 @@ export type TypedPikkuQueue = {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function generateQueues(
|
|
72
|
-
queueWorkersMeta:
|
|
72
|
+
queueWorkersMeta: QueueWorkersMeta,
|
|
73
73
|
functionsMeta: FunctionsMeta,
|
|
74
74
|
typesMap: TypesMap,
|
|
75
75
|
requiredTypes: Set<string>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueueWorkersMeta } from '@pikku/core/queue'
|
|
2
2
|
|
|
3
|
-
export const serializeQueueMeta = (queueWorkersMeta:
|
|
3
|
+
export const serializeQueueMeta = (queueWorkersMeta: QueueWorkersMeta) => {
|
|
4
4
|
const serializedOutput: string[] = []
|
|
5
5
|
serializedOutput.push("import { pikkuState } from '@pikku/core'")
|
|
6
6
|
serializedOutput.push(
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js'
|
|
2
|
+
import { getFileImportRelativePath } from '../../../utils/file-import-path.js'
|
|
3
|
+
import { writeFileInDir } from '../../../utils/file-writer.js'
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js'
|
|
5
|
+
import { serializePublicRPC } from './serialize-public-rpc.js'
|
|
6
|
+
import { join } from 'path'
|
|
7
|
+
|
|
8
|
+
export const pikkuPublicRPC: any = pikkuSessionlessFunc<void, boolean>({
|
|
9
|
+
func: async ({ logger, config }) => {
|
|
10
|
+
if (config.rpc?.publicRpcPath) {
|
|
11
|
+
const publicRpcPath = join(config.rootDir, config.rpc.publicRpcPath)
|
|
12
|
+
const pathToPikkuTypes = getFileImportRelativePath(
|
|
13
|
+
publicRpcPath,
|
|
14
|
+
config.typesDeclarationFile,
|
|
15
|
+
config.packageMappings
|
|
16
|
+
)
|
|
17
|
+
await writeFileInDir(
|
|
18
|
+
logger,
|
|
19
|
+
publicRpcPath,
|
|
20
|
+
serializePublicRPC(pathToPikkuTypes)
|
|
21
|
+
)
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
return false
|
|
25
|
+
},
|
|
26
|
+
middleware: [
|
|
27
|
+
logCommandInfoAndTime({
|
|
28
|
+
commandStart: 'Generating Public RPC Endpoint',
|
|
29
|
+
commandEnd: 'Generated Public RPC Endpoint',
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
32
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '../../../../.pikku/pikku-types.gen.js'
|
|
2
|
+
import { getFileImportRelativePath } from '../../../utils/file-import-path.js'
|
|
3
|
+
import { writeFileInDir } from '../../../utils/file-writer.js'
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js'
|
|
5
|
+
import { serializeRemoteRPC } from './serialize-remote-rpc.js'
|
|
6
|
+
import { join } from 'path'
|
|
7
|
+
|
|
8
|
+
export const pikkuRemoteRPC: any = pikkuSessionlessFunc<void, boolean>({
|
|
9
|
+
func: async ({ logger, config }) => {
|
|
10
|
+
if (config.rpc?.remoteRpcWorkersPath) {
|
|
11
|
+
const remoteRpcPath = join(
|
|
12
|
+
config.rootDir,
|
|
13
|
+
config.rpc.remoteRpcWorkersPath
|
|
14
|
+
)
|
|
15
|
+
const pathToPikkuTypes = getFileImportRelativePath(
|
|
16
|
+
remoteRpcPath,
|
|
17
|
+
config.typesDeclarationFile,
|
|
18
|
+
config.packageMappings
|
|
19
|
+
)
|
|
20
|
+
await writeFileInDir(
|
|
21
|
+
logger,
|
|
22
|
+
remoteRpcPath,
|
|
23
|
+
serializeRemoteRPC(pathToPikkuTypes)
|
|
24
|
+
)
|
|
25
|
+
return true
|
|
26
|
+
}
|
|
27
|
+
return false
|
|
28
|
+
},
|
|
29
|
+
middleware: [
|
|
30
|
+
logCommandInfoAndTime({
|
|
31
|
+
commandStart: 'Generating Remote RPC Workers',
|
|
32
|
+
commandEnd: 'Generated Remote RPC Workers',
|
|
33
|
+
}),
|
|
34
|
+
],
|
|
35
|
+
})
|