@pikku/cli 0.11.0 → 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.
Files changed (113) hide show
  1. package/.pikku/channel/pikku-channel-types.gen.ts +1 -1
  2. package/.pikku/channel/pikku-channels-map.gen.d.ts +2 -2
  3. package/.pikku/channel/pikku-channels-meta.gen.ts +1 -1
  4. package/.pikku/channel/pikku-channels.gen.ts +1 -1
  5. package/.pikku/cli/pikku-cli-channel.ts +92 -0
  6. package/.pikku/cli/pikku-cli-client.gen.ts +56 -0
  7. package/.pikku/cli/pikku-cli-types.gen.ts +1 -1
  8. package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +127 -4
  9. package/.pikku/cli/pikku-cli-wirings.gen.ts +3 -2
  10. package/.pikku/cli/pikku-cli.gen.ts +41 -0
  11. package/.pikku/function/pikku-function-types.gen.ts +1 -1
  12. package/.pikku/function/pikku-functions-meta.gen.ts +156 -156
  13. package/.pikku/function/pikku-functions-meta.min.gen.ts +36 -36
  14. package/.pikku/function/pikku-functions.gen.ts +1 -1
  15. package/.pikku/http/pikku-http-types.gen.ts +1 -1
  16. package/.pikku/http/pikku-http-wirings-map.gen.d.ts +2 -2
  17. package/.pikku/http/pikku-http-wirings-meta.gen.ts +1 -1
  18. package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
  19. package/.pikku/mcp/pikku-mcp-types.gen.ts +1 -1
  20. package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +1 -1
  21. package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
  22. package/.pikku/pikku-bootstrap.gen.ts +1 -1
  23. package/.pikku/pikku-services.gen.ts +3 -3
  24. package/.pikku/pikku-types.gen.ts +1 -1
  25. package/.pikku/pikku-websocket.gen.ts +1 -1
  26. package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
  27. package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +2 -2
  28. package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +1 -1
  29. package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
  30. package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +1 -1
  31. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +2 -2
  32. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +9 -9
  33. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +8 -8
  34. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
  35. package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +1 -1
  36. package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
  37. package/.pikku/schemas/register.gen.ts +5 -5
  38. package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  39. package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  40. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +2 -2
  41. package/.pikku/workflow/pikku-workflow-types.gen.ts +1 -1
  42. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
  43. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
  44. package/CHANGELOG.md +6 -1
  45. package/bin/pikku.ts +20 -20
  46. package/build.sh +1 -1
  47. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  48. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  49. package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
  50. package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
  51. package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
  52. package/dist/.pikku/cli/pikku-cli-channel.d.ts +1 -0
  53. package/dist/.pikku/cli/pikku-cli-channel.js +91 -0
  54. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +10 -0
  55. package/dist/.pikku/cli/pikku-cli-client.gen.js +46 -0
  56. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  57. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  58. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +127 -4
  59. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +2 -1
  60. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +2 -1
  61. package/dist/.pikku/cli/pikku-cli.gen.d.ts +10 -0
  62. package/dist/.pikku/cli/pikku-cli.gen.js +38 -0
  63. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  64. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  65. package/dist/.pikku/function/pikku-functions-meta.gen.js +156 -156
  66. package/dist/.pikku/function/pikku-functions-meta.min.gen.js +36 -36
  67. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  68. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  69. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  70. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  71. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  72. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  73. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  74. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  75. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +1 -1
  76. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
  77. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
  78. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  79. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  80. package/dist/.pikku/pikku-services.gen.d.ts +3 -3
  81. package/dist/.pikku/pikku-services.gen.js +1 -1
  82. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  83. package/dist/.pikku/pikku-types.gen.js +1 -1
  84. package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
  85. package/dist/.pikku/pikku-websocket.gen.js +1 -1
  86. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  87. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  88. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  89. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  90. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  91. package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +1 -1
  92. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +8 -8
  93. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  94. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  95. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +1 -1
  96. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
  97. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
  98. package/dist/.pikku/schemas/register.gen.js +3 -3
  99. package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  100. package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  101. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  102. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  103. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  104. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  105. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  106. package/dist/bin/pikku.js +18 -20
  107. package/dist/src/cli.wiring.js +109 -107
  108. package/dist/src/services/cli-logger-forwarder.service.d.ts +3 -0
  109. package/dist/src/services/cli-logger-forwarder.service.js +8 -1
  110. package/dist/tsconfig.tsbuildinfo +1 -1
  111. package/package.json +1 -1
  112. package/src/cli.wiring.ts +111 -106
  113. package/src/services/cli-logger-forwarder.service.ts +10 -1
@@ -1,5 +1,5 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.11.0
3
+ * This file was generated by @pikku/cli@0.11.1
4
4
  */
5
5
  /* The files with an wireMCPResource or wireMCPTool function call */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import './cli/pikku-cli-wirings-meta.gen.js';
5
5
  import './mcp/pikku-mcp-wirings-meta.gen.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import './cli/pikku-cli-wirings-meta.gen.js';
5
5
  import './mcp/pikku-mcp-wirings-meta.gen.js';
@@ -1,11 +1,11 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import type { SingletonServices } from '../types/application-types.d.js';
5
5
  import type { Services } from '../types/application-types.d.js';
6
6
  export declare const requiredSingletonServices: {
7
7
  readonly config: true;
8
- readonly getInspectorState: false;
8
+ readonly getInspectorState: true;
9
9
  readonly jwt: false;
10
10
  readonly logger: true;
11
11
  readonly queueService: false;
@@ -18,5 +18,5 @@ export declare const requiredSessionServices: {
18
18
  readonly workflow: false;
19
19
  readonly workflowStep: false;
20
20
  };
21
- export type RequiredSingletonServices = Pick<SingletonServices, 'config' | 'logger' | 'schema' | 'variables'> & Partial<Omit<SingletonServices, 'config' | 'logger' | 'schema' | 'variables'>>;
21
+ export type RequiredSingletonServices = Pick<SingletonServices, 'config' | 'getInspectorState' | 'logger' | 'schema' | 'variables'> & Partial<Omit<SingletonServices, 'config' | 'getInspectorState' | 'logger' | 'schema' | 'variables'>>;
22
22
  export type RequiredSessionServices = Partial<Services>;
@@ -1,7 +1,7 @@
1
1
  // Singleton services map: true if required, false if available but unused
2
2
  export const requiredSingletonServices = {
3
3
  'config': true,
4
- 'getInspectorState': false,
4
+ 'getInspectorState': true,
5
5
  'jwt': false,
6
6
  'logger': true,
7
7
  'queueService': false,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  /**
5
5
  * Main type export hub - re-exports all wiring-specific types
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  /**
5
5
  * Main type export hub - re-exports all wiring-specific types
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import { CorePikkuWebsocket, CorePikkuRouteHandler } from '@pikku/websocket';
5
5
  import { ChannelDefaultHandlerOf, ChannelWiringHandlerOf, ChannelsMap } from './channel/pikku-channels-map.gen.d.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import { CorePikkuWebsocket, CorePikkuRouteHandler } from '@pikku/websocket';
5
5
  class PikkuWebSocketRoute extends CorePikkuRouteHandler {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  /**
5
5
  * Queue-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  /**
5
5
  * Queue-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import { pikkuState } from '@pikku/core';
5
5
  pikkuState('queue', 'meta', {
@@ -1,4 +1,4 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.11.0
3
+ * This file was generated by @pikku/cli@0.11.1
4
4
  */
@@ -1,5 +1,5 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.11.0
3
+ * This file was generated by @pikku/cli@0.11.1
4
4
  */
5
5
  /* The files with an addQueueWorkers function call */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  /**
5
5
  * Auto-generated remote internal RPC queue worker and HTTP endpoint
@@ -1,41 +1,41 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import { pikkuState } from '@pikku/core';
5
5
  pikkuState('rpc', 'meta', {
6
+ "pikkuSchemas": "pikkuSchemas",
7
+ "pikkuFetch": "pikkuFetch",
8
+ "pikkuWebSocketTyped": "pikkuWebSocketTyped",
9
+ "pikkuRPCClient": "pikkuRPCClient",
10
+ "pikkuQueueService": "pikkuQueueService",
11
+ "pikkuOpenAPI": "pikkuOpenAPI",
12
+ "pikkuNext": "pikkuNext",
6
13
  "all": "all",
7
14
  "bootstrap": "bootstrap",
8
15
  "watch": "watch",
9
- "pikkuNext": "pikkuNext",
10
16
  "pikkuChannels": "pikkuChannels",
11
17
  "pikkuChannelTypes": "pikkuChannelTypes",
12
18
  "pikkuChannelsMap": "pikkuChannelsMap",
13
- "pikkuWebSocketTyped": "pikkuWebSocketTyped",
14
19
  "pikkuCLIEntry": "pikkuCLIEntry",
15
20
  "pikkuCLITypes": "pikkuCLITypes",
16
21
  "pikkuCLI": "pikkuCLI",
17
- "pikkuFetch": "pikkuFetch",
18
22
  "pikkuFunctionTypesSplit": "pikkuFunctionTypesSplit",
19
23
  "pikkuFunctionTypes": "pikkuFunctionTypes",
20
24
  "pikkuFunctions": "pikkuFunctions",
21
25
  "pikkuServices": "pikkuServices",
22
- "pikkuSchemas": "pikkuSchemas",
23
26
  "pikkuHTTPMap": "pikkuHTTPMap",
24
27
  "pikkuHTTP": "pikkuHTTP",
25
28
  "pikkuHTTPTypes": "pikkuHTTPTypes",
26
- "pikkuOpenAPI": "pikkuOpenAPI",
27
29
  "pikkuMCPJSON": "pikkuMCPJSON",
28
30
  "pikkuMCPTypes": "pikkuMCPTypes",
29
31
  "pikkuMCP": "pikkuMCP",
30
32
  "pikkuMiddleware": "pikkuMiddleware",
31
33
  "pikkuPermissions": "pikkuPermissions",
32
34
  "pikkuQueueMap": "pikkuQueueMap",
33
- "pikkuQueueService": "pikkuQueueService",
34
35
  "pikkuQueueTypes": "pikkuQueueTypes",
35
36
  "pikkuQueue": "pikkuQueue",
36
37
  "pikkuPublicRPC": "pikkuPublicRPC",
37
38
  "pikkuRemoteRPC": "pikkuRemoteRPC",
38
- "pikkuRPCClient": "pikkuRPCClient",
39
39
  "pikkuRPCInternalMap": "pikkuRPCInternalMap",
40
40
  "pikkuRPCExposedMap": "pikkuRPCExposedMap",
41
41
  "pikkuRPC": "pikkuRPC",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  /**
5
5
  * Scheduler-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  /**
5
5
  * Scheduler-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import { pikkuState } from '@pikku/core';
5
5
  pikkuState('scheduler', 'meta', {});
@@ -1,4 +1,4 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.11.0
3
+ * This file was generated by @pikku/cli@0.11.1
4
4
  */
@@ -1,5 +1,5 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.11.0
3
+ * This file was generated by @pikku/cli@0.11.1
4
4
  */
5
5
  /* The files with an addScheduledTasks function call */
@@ -1,15 +1,15 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import { addSchema } from '@pikku/core/schema';
5
+ import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' };
6
+ addSchema('PikkuSchemasOutput', PikkuSchemasOutput);
5
7
  import * as PikkuChannelsOutput from './schemas/PikkuChannelsOutput.schema.json' with { type: 'json' };
6
8
  addSchema('PikkuChannelsOutput', PikkuChannelsOutput);
7
9
  import * as PikkuCLIOutput from './schemas/PikkuCLIOutput.schema.json' with { type: 'json' };
8
10
  addSchema('PikkuCLIOutput', PikkuCLIOutput);
9
11
  import * as PikkuFunctionsOutput from './schemas/PikkuFunctionsOutput.schema.json' with { type: 'json' };
10
12
  addSchema('PikkuFunctionsOutput', PikkuFunctionsOutput);
11
- import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' };
12
- addSchema('PikkuSchemasOutput', PikkuSchemasOutput);
13
13
  import * as PikkuHTTPOutput from './schemas/PikkuHTTPOutput.schema.json' with { type: 'json' };
14
14
  addSchema('PikkuHTTPOutput', PikkuHTTPOutput);
15
15
  import * as PikkuMCPOutput from './schemas/PikkuMCPOutput.schema.json' with { type: 'json' };
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "description": "This provides the structure needed for typescript to be aware of RPCs and their return types", "definitions": {} }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "description": "This provides the structure needed for typescript to be aware of RPCs and their return types", "definitions": {} }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  /**
5
5
  * Workflow-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  /**
5
5
  * Workflow-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.11.0
2
+ * This file was generated by @pikku/cli@0.11.1
3
3
  */
4
4
  import { pikkuState } from '@pikku/core';
5
5
  pikkuState('workflows', 'meta', {});
@@ -1,4 +1,4 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.11.0
3
+ * This file was generated by @pikku/cli@0.11.1
4
4
  */
@@ -1,5 +1,5 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.11.0
3
+ * This file was generated by @pikku/cli@0.11.1
4
4
  */
5
5
  /* The files with an wireWorkflow function call */
package/dist/bin/pikku.js CHANGED
@@ -3,27 +3,25 @@ import { Command } from 'commander';
3
3
  import { createConfig, createSingletonServices } from '../src/services.js';
4
4
  import { PikkuRPCService } from '@pikku/core/rpc';
5
5
  import { LocalVariablesService } from '@pikku/core/services';
6
- // import { existsSync } from 'fs'
7
- // import { fileURLToPath } from 'url'
8
- // import { dirname, join } from 'path'
9
- // const __filename = fileURLToPath(import.meta.url)
10
- // const __dirname = dirname(__filename)
6
+ import { existsSync } from 'fs';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname, join } from 'path';
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
11
  // Check if Pikku CLI is available
12
- // const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js')
13
- // if (existsSync(pikkuCliPath)) {
14
- // try {
15
- // // Use the generated Pikku CLI
16
- // const { PikkuCLI } = await import('../.pikku/cli/pikku-cli.gen.js')
17
- // await PikkuCLI(process.argv.slice(2))
18
- // process.exit(0)
19
- // } catch (error) {
20
- // // If import fails, fall back to Commander.js
21
- // console.warn(
22
- // 'Failed to load Pikku CLI, using fallback mode:',
23
- // error.message
24
- // )
25
- // }
26
- // }
12
+ const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js');
13
+ if (existsSync(pikkuCliPath)) {
14
+ try {
15
+ // Use the generated Pikku CLI
16
+ const { PikkuCLI } = await import(pikkuCliPath);
17
+ await PikkuCLI(process.argv.slice(2));
18
+ process.exit(0);
19
+ }
20
+ catch (error) {
21
+ // If import fails, fall back to Commander.js
22
+ console.warn('Failed to load Pikku CLI, using fallback mode:', error.message);
23
+ }
24
+ }
27
25
  // Fallback to Commander.js for initial setup
28
26
  // Import bootstrap if it exists
29
27
  try {
@@ -1,107 +1,109 @@
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 { clientCLIRenderer } from './services.js'
12
- export {};
13
- // wireCLI({
14
- // program: 'pikku',
15
- // description:
16
- // 'Pikku CLI - Code generation tool for type-safe backend development',
17
- // render: clientCLIRenderer,
18
- // options: {
19
- // config: {
20
- // description: 'Path to pikku.config.json file',
21
- // short: 'c',
22
- // },
23
- // logLevel: {
24
- // description: 'Set log level',
25
- // default: 'info' as const,
26
- // short: 'l',
27
- // },
28
- // userSessionType: {
29
- // description:
30
- // 'Specify which UserSession type to use (when multiple exist)',
31
- // },
32
- // singletonServicesFactoryType: {
33
- // description: 'Specify which singleton services factory to use',
34
- // },
35
- // sessionServicesFactoryType: {
36
- // description: 'Specify which session services factory to use',
37
- // },
38
- // stateOutput: {
39
- // description: 'Save inspector state to JSON file for reuse',
40
- // },
41
- // stateInput: {
42
- // description: 'Load inspector state from JSON file (skips inspection)',
43
- // },
44
- // },
45
- // commands: {
46
- // all: pikkuCLICommand({
47
- // func: all,
48
- // description: 'Generate all Pikku files (types, schemas, wirings, etc.)',
49
- // isDefault: true,
50
- // options: {
51
- // tags: {
52
- // description: 'Filter functions by tags (comma-separated)',
53
- // short: 't',
54
- // },
55
- // types: {
56
- // description: 'Filter functions by types (comma-separated)',
57
- // },
58
- // directories: {
59
- // description: 'Filter functions by directories (comma-separated)',
60
- // short: 'd',
61
- // },
62
- // httpMethods: {
63
- // description: 'Filter HTTP routes by methods (comma-separated)',
64
- // },
65
- // httpRoutes: {
66
- // description: 'Filter HTTP routes by route patterns (comma-separated)',
67
- // },
68
- // names: {
69
- // description: 'Filter functions by name patterns (supports wildcards)',
70
- // short: 'n',
71
- // },
72
- // },
73
- // }),
74
- // bootstrap: pikkuCLICommand({
75
- // func: bootstrap,
76
- // description: 'Generate only type files (setup phase only)',
77
- // }),
78
- // schemas: pikkuCLICommand({
79
- // func: pikkuSchemas,
80
- // description: 'Generate JSON schemas for function input/output types',
81
- // }),
82
- // fetch: pikkuCLICommand({
83
- // func: pikkuFetch,
84
- // description: 'Generate type-safe HTTP fetch client',
85
- // }),
86
- // websocket: pikkuCLICommand({
87
- // func: pikkuWebSocketTyped,
88
- // description: 'Generate type-safe WebSocket client',
89
- // }),
90
- // rpc: pikkuCLICommand({
91
- // func: pikkuRPCClient,
92
- // description: 'Generate RPC client wrappers',
93
- // }),
94
- // 'queue-service': pikkuCLICommand({
95
- // func: pikkuQueueService,
96
- // description: 'Generate queue service wrapper',
97
- // }),
98
- // openapi: pikkuCLICommand({
99
- // func: pikkuOpenAPI,
100
- // description: 'Generate OpenAPI specification from HTTP routes',
101
- // }),
102
- // nextjs: pikkuCLICommand({
103
- // func: pikkuNext,
104
- // description: 'Generate Next.js backend and HTTP wrappers',
105
- // }),
106
- // },
107
- // })
1
+ import { pikkuSchemas } from './functions/wirings/functions/schemas.js';
2
+ import { pikkuFetch } from './functions/wirings/fetch/index.js';
3
+ import { pikkuWebSocketTyped } from './functions/wirings/channels/pikku-command-websocket-typed.js';
4
+ import { pikkuRPCClient } from './functions/wirings/rpc/pikku-command-rpc-client.js';
5
+ import { pikkuQueueService } from './functions/wirings/queue/pikku-command-queue-service.js';
6
+ import { pikkuOpenAPI } from './functions/wirings/http/pikku-command-openapi.js';
7
+ import { pikkuNext } from './functions/runtimes/nextjs/pikku-command-nextjs.js';
8
+ import { pikkuCLICommand, wireCLI } from '../.pikku/cli/pikku-cli-types.gen.js';
9
+ import { all } from './functions/commands/all.js';
10
+ import { bootstrap } from './functions/commands/bootstrap.js';
11
+ import { watch } from './functions/commands/watch.js';
12
+ import { clientCLIRenderer } from './services.js';
13
+ wireCLI({
14
+ program: 'pikku',
15
+ description: 'Pikku CLI - Code generation tool for type-safe backend development',
16
+ render: clientCLIRenderer,
17
+ options: {
18
+ config: {
19
+ description: 'Path to pikku.config.json file',
20
+ short: 'c',
21
+ },
22
+ logLevel: {
23
+ description: 'Set log level',
24
+ default: 'info',
25
+ short: 'l',
26
+ },
27
+ userSessionType: {
28
+ description: 'Specify which UserSession type to use (when multiple exist)',
29
+ },
30
+ singletonServicesFactoryType: {
31
+ description: 'Specify which singleton services factory to use',
32
+ },
33
+ sessionServicesFactoryType: {
34
+ description: 'Specify which session services factory to use',
35
+ },
36
+ stateOutput: {
37
+ description: 'Save inspector state to JSON file for reuse',
38
+ },
39
+ stateInput: {
40
+ description: 'Load inspector state from JSON file (skips inspection)',
41
+ },
42
+ },
43
+ commands: {
44
+ all: pikkuCLICommand({
45
+ func: all,
46
+ description: 'Generate all Pikku files (types, schemas, wirings, etc.)',
47
+ isDefault: true,
48
+ options: {
49
+ tags: {
50
+ description: 'Filter functions by tags (comma-separated)',
51
+ short: 't',
52
+ },
53
+ types: {
54
+ description: 'Filter functions by types (comma-separated)',
55
+ },
56
+ directories: {
57
+ description: 'Filter functions by directories (comma-separated)',
58
+ short: 'd',
59
+ },
60
+ httpMethods: {
61
+ description: 'Filter HTTP routes by methods (comma-separated)',
62
+ },
63
+ httpRoutes: {
64
+ description: 'Filter HTTP routes by route patterns (comma-separated)',
65
+ },
66
+ names: {
67
+ description: 'Filter functions by name patterns (supports wildcards)',
68
+ short: 'n',
69
+ },
70
+ },
71
+ }),
72
+ bootstrap: pikkuCLICommand({
73
+ func: bootstrap,
74
+ description: 'Generate only type files (setup phase only)',
75
+ }),
76
+ watch: pikkuCLICommand({
77
+ func: watch,
78
+ description: 'Watch for file changes and regenerate automatically',
79
+ }),
80
+ schemas: pikkuCLICommand({
81
+ func: pikkuSchemas,
82
+ description: 'Generate JSON schemas for function input/output types',
83
+ }),
84
+ fetch: pikkuCLICommand({
85
+ func: pikkuFetch,
86
+ description: 'Generate type-safe HTTP fetch client',
87
+ }),
88
+ websocket: pikkuCLICommand({
89
+ func: pikkuWebSocketTyped,
90
+ description: 'Generate type-safe WebSocket client',
91
+ }),
92
+ rpc: pikkuCLICommand({
93
+ func: pikkuRPCClient,
94
+ description: 'Generate RPC client wrappers',
95
+ }),
96
+ 'queue-service': pikkuCLICommand({
97
+ func: pikkuQueueService,
98
+ description: 'Generate queue service wrapper',
99
+ }),
100
+ openapi: pikkuCLICommand({
101
+ func: pikkuOpenAPI,
102
+ description: 'Generate OpenAPI specification from HTTP routes',
103
+ }),
104
+ nextjs: pikkuCLICommand({
105
+ func: pikkuNext,
106
+ description: 'Generate Next.js backend and HTTP wrappers',
107
+ }),
108
+ },
109
+ });
@@ -17,8 +17,11 @@ export declare class CLILoggerForwarder implements Logger {
17
17
  private logger;
18
18
  private channel;
19
19
  private level;
20
+ private silent;
20
21
  constructor(logger: Logger, channel: PikkuChannel<unknown, any>);
21
22
  setLevel(level: LogLevel): void;
23
+ setSilent(silent: boolean): void;
24
+ isSilent(): boolean;
22
25
  private log;
23
26
  info(messageOrObj: string | Record<string, any>, ..._meta: any[]): void;
24
27
  error(messageOrObj: string | Record<string, any> | Error, ..._meta: any[]): void;
@@ -7,6 +7,7 @@ export class CLILoggerForwarder {
7
7
  logger;
8
8
  channel;
9
9
  level = LogLevel.info;
10
+ silent = false;
10
11
  constructor(logger, channel) {
11
12
  this.logger = logger;
12
13
  this.channel = channel;
@@ -14,8 +15,14 @@ export class CLILoggerForwarder {
14
15
  setLevel(level) {
15
16
  this.level = level;
16
17
  }
18
+ setSilent(silent) {
19
+ this.silent = silent;
20
+ }
21
+ isSilent() {
22
+ return this.silent;
23
+ }
17
24
  log(level, logLevel, messageOrObj, type) {
18
- if (this.level > logLevel)
25
+ if (this.level > logLevel || this.silent)
19
26
  return;
20
27
  let message;
21
28
  if (messageOrObj instanceof Error) {