@pikku/cli 0.12.7 → 0.12.9

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 (94) hide show
  1. package/cli.schema.json +1 -1
  2. package/console-app/assets/{index-sUj3oFEL.js → index-DgyIKxt6.js} +109 -109
  3. package/console-app/index.html +1 -2
  4. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  5. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +1 -1
  6. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +1 -1
  7. package/dist/.pikku/agent/pikku-agent-wirings.gen.js +1 -1
  8. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  9. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  10. package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
  11. package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
  12. package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
  13. package/dist/.pikku/cli/pikku-cli-channel.d.ts +19 -0
  14. package/dist/.pikku/cli/pikku-cli-channel.js +16 -1
  15. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  16. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  17. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  18. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  19. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  20. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +2 -1
  21. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  22. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  23. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  24. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  25. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  26. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  27. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  28. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  29. package/dist/.pikku/function/pikku-functions-meta.gen.json +86 -65
  30. package/dist/.pikku/function/pikku-functions.gen.js +3 -1
  31. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  32. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  33. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  34. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  35. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  36. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  37. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  38. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +1 -1
  39. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
  40. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
  41. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  42. package/dist/.pikku/pikku-services.gen.d.ts +2 -1
  43. package/dist/.pikku/pikku-services.gen.js +1 -0
  44. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  45. package/dist/.pikku/pikku-types.gen.js +1 -1
  46. package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
  47. package/dist/.pikku/pikku-websocket.gen.js +1 -1
  48. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  49. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  50. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  51. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  52. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  53. package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +1 -1
  54. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  55. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +1 -0
  56. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  57. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  58. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +1 -1
  59. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
  60. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
  61. package/dist/.pikku/schemas/register.gen.js +3 -3
  62. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  63. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  64. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  65. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  66. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  67. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  68. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  69. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  70. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  71. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  72. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  73. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +2 -1
  74. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  75. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  76. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  77. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  78. package/dist/src/functions/commands/all.js +1 -0
  79. package/dist/src/functions/commands/new-addon.js +29 -12
  80. package/dist/src/functions/wirings/cli/serialize-channel-cli.js +16 -0
  81. package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -0
  82. package/dist/src/functions/wirings/credentials/pikku-command-credentials.js +34 -0
  83. package/dist/src/functions/wirings/credentials/serialize-credentials-types.d.ts +9 -0
  84. package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +61 -0
  85. package/dist/src/functions/wirings/functions/pikku-command-addon-types.js +4 -2
  86. package/dist/src/functions/wirings/functions/serialize-addon-types.d.ts +1 -1
  87. package/dist/src/functions/wirings/functions/serialize-addon-types.js +3 -2
  88. package/dist/src/functions/wirings/middleware/serialize-middleware-imports.js +22 -0
  89. package/dist/src/functions/wirings/permissions/serialize-permissions-imports.js +22 -0
  90. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +1 -0
  91. package/dist/src/services.js +4 -0
  92. package/dist/src/utils/pikku-cli-config.js +8 -0
  93. package/dist/tsconfig.tsbuildinfo +1 -1
  94. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.12.7
3
+ * This file was generated by @pikku/cli@0.12.9
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.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  /**
5
5
  * Auto-generated remote internal RPC queue worker and HTTP endpoint
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/internal';
5
5
  import metaData from './pikku-rpc-wirings-meta.internal.gen.json' with { type: 'json' };
@@ -40,6 +40,7 @@
40
40
  "pikkuConsoleFunctions": "pikkuConsoleFunctions",
41
41
  "pikkuNodeTypes": "pikkuNodeTypes",
42
42
  "pikkuNodesMeta": "pikkuNodesMeta",
43
+ "pikkuCredentials": "pikkuCredentials",
43
44
  "pikkuAddonTypes": "pikkuAddonTypes",
44
45
  "pikkuFunctionTypesSplit": "pikkuFunctionTypesSplit",
45
46
  "pikkuFunctionTypes": "pikkuFunctionTypes",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
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.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
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.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/internal';
5
5
  import metaData from './pikku-schedulers-wirings-meta.gen.json' with { type: 'json' };
@@ -1,4 +1,4 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.12.7
3
+ * This file was generated by @pikku/cli@0.12.9
4
4
  */
@@ -1,5 +1,5 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.12.7
3
+ * This file was generated by @pikku/cli@0.12.9
4
4
  */
5
5
  /* The files with an addScheduledTasks function call */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { addSchema } from '@pikku/core/schema';
5
5
  import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' };
@@ -48,6 +48,8 @@ import * as PikkuPackageOutput from './schemas/PikkuPackageOutput.schema.json' w
48
48
  addSchema('PikkuPackageOutput', PikkuPackageOutput);
49
49
  import * as PikkuPermissionsOutput from './schemas/PikkuPermissionsOutput.schema.json' with { type: 'json' };
50
50
  addSchema('PikkuPermissionsOutput', PikkuPermissionsOutput);
51
+ import * as PikkuQueueOutput from './schemas/PikkuQueueOutput.schema.json' with { type: 'json' };
52
+ addSchema('PikkuQueueOutput', PikkuQueueOutput);
51
53
  import * as PikkuPublicRPCOutput from './schemas/PikkuPublicRPCOutput.schema.json' with { type: 'json' };
52
54
  addSchema('PikkuPublicRPCOutput', PikkuPublicRPCOutput);
53
55
  import * as PikkuRemoteRPCOutput from './schemas/PikkuRemoteRPCOutput.schema.json' with { type: 'json' };
@@ -56,8 +58,6 @@ import * as PikkuRPCOutput from './schemas/PikkuRPCOutput.schema.json' with { ty
56
58
  addSchema('PikkuRPCOutput', PikkuRPCOutput);
57
59
  import * as PikkuSchedulerOutput from './schemas/PikkuSchedulerOutput.schema.json' with { type: 'json' };
58
60
  addSchema('PikkuSchedulerOutput', PikkuSchedulerOutput);
59
- import * as PikkuQueueOutput from './schemas/PikkuQueueOutput.schema.json' with { type: 'json' };
60
- addSchema('PikkuQueueOutput', PikkuQueueOutput);
61
61
  import * as PikkuTriggerOutput from './schemas/PikkuTriggerOutput.schema.json' with { type: 'json' };
62
62
  addSchema('PikkuTriggerOutput', PikkuTriggerOutput);
63
63
  import * as PikkuWorkflowOutput from './schemas/PikkuWorkflowOutput.schema.json' with { type: 'json' };
@@ -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" }, "functionsMetaJsonFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpWiringMetaJsonFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "gatewaysWiringFile": { "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" }, "remoteRpcWorkersFile": { "type": "string" }, "publicRpcFile": { "type": "string" }, "publicAgentFile": { "type": "string" }, "consoleFunctionsFile": { "type": "string" }, "workflowWorkersFile": { "type": "string" }, "triggersTypesFile": { "type": "string" }, "triggersWiringFile": { "type": "string" }, "triggersWiringMetaFile": { "type": "string" }, "triggersWiringMetaJsonFile": { "type": "string" }, "triggerSourcesMetaFile": { "type": "string" }, "triggerSourcesMetaJsonFile": { "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" }, "workflowsWorkersFile": { "type": "string" }, "workflowMapDeclarationFile": { "type": "string" }, "workflowTypesFile": { "type": "string" }, "workflowMetaDir": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpWiringsMetaJsonFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "agentWiringsFile": { "type": "string" }, "agentWiringMetaFile": { "type": "string" }, "agentWiringMetaJsonFile": { "type": "string" }, "agentTypesFile": { "type": "string" }, "agentMapDeclarationFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliWiringMetaJsonFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaJsonFile": { "type": "string" }, "permissionsFile": { "type": "string" }, "permissionsGroupsMetaJsonFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "packageFile": { "type": "string" }, "addonTypesFile": { "type": "string" }, "nodeTypesFile": { "type": "string" }, "secretTypesFile": { "type": "string" }, "secretsFile": { "type": "string" }, "secretsMetaJsonFile": { "type": "string" }, "variableTypesFile": { "type": "string" }, "variablesFile": { "type": "string" }, "variablesMetaJsonFile": { "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" } }, "addon": { "anyOf": [{ "type": "boolean" }, { "type": "object", "properties": { "categories": { "type": "array", "items": { "type": "string" } }, "icon": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "openapi": { "type": "object", "properties": { "version": { "type": "string" }, "hash": { "type": "string" } }, "required": ["version", "hash"], "additionalProperties": false } }, "additionalProperties": false }] }, "addonName": { "type": "string" }, "models": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "model": { "type": "string" }, "temperature": { "type": "number" }, "maxSteps": { "type": "number" } }, "required": ["model"], "additionalProperties": false }] } }, "agentDefaults": { "type": "object", "properties": { "temperature": { "type": "number" }, "maxSteps": { "type": "number" } }, "additionalProperties": false }, "agentOverrides": { "type": "object", "additionalProperties": { "type": "object", "properties": { "model": { "type": "string" }, "temperature": { "type": "number" }, "maxSteps": { "type": "number" } }, "additionalProperties": false } }, "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" }, "clientFiles": { "type": "object", "properties": { "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" } }, "additionalProperties": false }, "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": { "type": "object", "properties": { "orchestratorQueue": { "type": "string" }, "workerQueue": { "type": "string" } }, "additionalProperties": false }, "scaffold": { "type": "object", "properties": { "addonDir": { "type": "string" }, "functionDir": { "type": "string" }, "wiringDir": { "type": "string" }, "middlewareDir": { "type": "string" }, "permissionDir": { "type": "string" }, "pikkuDir": { "type": "string" }, "rpc": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "console": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "agent": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "workflow": { "$ref": "#/definitions/PikkuScaffoldFeature" } }, "additionalProperties": false }, "forceRequiredServices": { "type": "array", "items": { "type": "string" } }, "schemasFromTypes": { "type": "array", "items": { "type": "string" } }, "stateOutput": { "type": "string" }, "stateInput": { "type": "string" }, "verboseMeta": { "type": "boolean" }, "lint": { "type": "object", "properties": { "servicesNotDestructured": { "type": "string", "enum": ["off", "warn", "error"] }, "wiresNotDestructured": { "type": "string", "enum": ["off", "warn", "error"] } }, "additionalProperties": false }, "addonMetaJsonFile": { "type": "string" }, "globalHTTPPrefix": { "type": "string" }, "filters": { "$ref": "#/definitions/InspectorFilters" } }, "required": ["addonTypesFile", "agentMapDeclarationFile", "agentTypesFile", "agentWiringMetaFile", "agentWiringMetaJsonFile", "agentWiringsFile", "bootstrapFile", "channelsMapDeclarationFile", "channelsTypesFile", "channelsWiringFile", "channelsWiringMetaFile", "channelsWiringMetaJsonFile", "cliBootstrapFile", "cliTypesFile", "cliWiringMetaFile", "cliWiringMetaJsonFile", "cliWiringsFile", "configDir", "consoleFunctionsFile", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaJsonFile", "gatewaysWiringFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringMetaJsonFile", "httpWiringsFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "mcpWiringsMetaJsonFile", "middlewareFile", "middlewareGroupsMetaJsonFile", "nodeTypesFile", "outDir", "packageFile", "packageMappings", "permissionsFile", "permissionsGroupsMetaJsonFile", "publicAgentFile", "publicRpcFile", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "queueWorkersWiringMetaJsonFile", "remoteRpcWorkersFile", "rootDir", "rpcInternalMapDeclarationFile", "rpcInternalWiringMetaFile", "rpcInternalWiringMetaJsonFile", "rpcMapDeclarationFile", "schedulersTypesFile", "schedulersWiringFile", "schedulersWiringMetaFile", "schedulersWiringMetaJsonFile", "schemaDirectory", "secretTypesFile", "secretsFile", "secretsMetaJsonFile", "servicesFile", "srcDirectories", "triggerSourcesMetaFile", "triggerSourcesMetaJsonFile", "triggersTypesFile", "triggersWiringFile", "triggersWiringMetaFile", "triggersWiringMetaJsonFile", "tsconfig", "typesDeclarationFile", "variableTypesFile", "variablesFile", "variablesMetaJsonFile", "workflowMapDeclarationFile", "workflowMetaDir", "workflowTypesFile", "workflowWorkersFile", "workflowsWiringFile", "workflowsWiringMetaFile", "workflowsWorkersFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "PikkuScaffoldFeature": { "type": ["string", "boolean"], "enum": ["auth", "no-auth", false] }, "InspectorFilters": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "directories": { "type": "array", "items": { "type": "string" } }, "httpRoutes": { "type": "array", "items": { "type": "string" } }, "httpMethods": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "outDir": { "type": "string" }, "schemaDirectory": { "type": "string" }, "typesDeclarationFile": { "type": "string" }, "functionsFile": { "type": "string" }, "functionsMetaFile": { "type": "string" }, "functionsMetaJsonFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpWiringMetaJsonFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "gatewaysWiringFile": { "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" }, "remoteRpcWorkersFile": { "type": "string" }, "publicRpcFile": { "type": "string" }, "publicAgentFile": { "type": "string" }, "consoleFunctionsFile": { "type": "string" }, "workflowWorkersFile": { "type": "string" }, "triggersTypesFile": { "type": "string" }, "triggersWiringFile": { "type": "string" }, "triggersWiringMetaFile": { "type": "string" }, "triggersWiringMetaJsonFile": { "type": "string" }, "triggerSourcesMetaFile": { "type": "string" }, "triggerSourcesMetaJsonFile": { "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" }, "workflowsWorkersFile": { "type": "string" }, "workflowMapDeclarationFile": { "type": "string" }, "workflowTypesFile": { "type": "string" }, "workflowMetaDir": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpWiringsMetaJsonFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "agentWiringsFile": { "type": "string" }, "agentWiringMetaFile": { "type": "string" }, "agentWiringMetaJsonFile": { "type": "string" }, "agentTypesFile": { "type": "string" }, "agentMapDeclarationFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliWiringMetaJsonFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaJsonFile": { "type": "string" }, "permissionsFile": { "type": "string" }, "permissionsGroupsMetaJsonFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "packageFile": { "type": "string" }, "addonTypesFile": { "type": "string" }, "nodeTypesFile": { "type": "string" }, "secretTypesFile": { "type": "string" }, "secretsFile": { "type": "string" }, "secretsMetaJsonFile": { "type": "string" }, "credentialsFile": { "type": "string" }, "credentialsMetaJsonFile": { "type": "string" }, "variableTypesFile": { "type": "string" }, "variablesFile": { "type": "string" }, "variablesMetaJsonFile": { "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" } }, "addon": { "anyOf": [{ "type": "boolean" }, { "type": "object", "properties": { "categories": { "type": "array", "items": { "type": "string" } }, "icon": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "openapi": { "type": "object", "properties": { "version": { "type": "string" }, "hash": { "type": "string" } }, "required": ["version", "hash"], "additionalProperties": false } }, "additionalProperties": false }] }, "addonName": { "type": "string" }, "models": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "model": { "type": "string" }, "temperature": { "type": "number" }, "maxSteps": { "type": "number" } }, "required": ["model"], "additionalProperties": false }] } }, "agentDefaults": { "type": "object", "properties": { "temperature": { "type": "number" }, "maxSteps": { "type": "number" } }, "additionalProperties": false }, "agentOverrides": { "type": "object", "additionalProperties": { "type": "object", "properties": { "model": { "type": "string" }, "temperature": { "type": "number" }, "maxSteps": { "type": "number" } }, "additionalProperties": false } }, "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" }, "clientFiles": { "type": "object", "properties": { "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" } }, "additionalProperties": false }, "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": { "type": "object", "properties": { "orchestratorQueue": { "type": "string" }, "workerQueue": { "type": "string" } }, "additionalProperties": false }, "scaffold": { "type": "object", "properties": { "addonDir": { "type": "string" }, "functionDir": { "type": "string" }, "wiringDir": { "type": "string" }, "middlewareDir": { "type": "string" }, "permissionDir": { "type": "string" }, "pikkuDir": { "type": "string" }, "rpc": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "console": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "agent": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "workflow": { "$ref": "#/definitions/PikkuScaffoldFeature" } }, "additionalProperties": false }, "forceRequiredServices": { "type": "array", "items": { "type": "string" } }, "schemasFromTypes": { "type": "array", "items": { "type": "string" } }, "stateOutput": { "type": "string" }, "stateInput": { "type": "string" }, "verboseMeta": { "type": "boolean" }, "lint": { "type": "object", "properties": { "servicesNotDestructured": { "type": "string", "enum": ["off", "warn", "error"] }, "wiresNotDestructured": { "type": "string", "enum": ["off", "warn", "error"] } }, "additionalProperties": false }, "addonMetaJsonFile": { "type": "string" }, "globalHTTPPrefix": { "type": "string" }, "filters": { "$ref": "#/definitions/InspectorFilters" } }, "required": ["addonTypesFile", "agentMapDeclarationFile", "agentTypesFile", "agentWiringMetaFile", "agentWiringMetaJsonFile", "agentWiringsFile", "bootstrapFile", "channelsMapDeclarationFile", "channelsTypesFile", "channelsWiringFile", "channelsWiringMetaFile", "channelsWiringMetaJsonFile", "cliBootstrapFile", "cliTypesFile", "cliWiringMetaFile", "cliWiringMetaJsonFile", "cliWiringsFile", "configDir", "consoleFunctionsFile", "credentialsFile", "credentialsMetaJsonFile", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaJsonFile", "gatewaysWiringFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringMetaJsonFile", "httpWiringsFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "mcpWiringsMetaJsonFile", "middlewareFile", "middlewareGroupsMetaJsonFile", "nodeTypesFile", "outDir", "packageFile", "packageMappings", "permissionsFile", "permissionsGroupsMetaJsonFile", "publicAgentFile", "publicRpcFile", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "queueWorkersWiringMetaJsonFile", "remoteRpcWorkersFile", "rootDir", "rpcInternalMapDeclarationFile", "rpcInternalWiringMetaFile", "rpcInternalWiringMetaJsonFile", "rpcMapDeclarationFile", "schedulersTypesFile", "schedulersWiringFile", "schedulersWiringMetaFile", "schedulersWiringMetaJsonFile", "schemaDirectory", "secretTypesFile", "secretsFile", "secretsMetaJsonFile", "servicesFile", "srcDirectories", "triggerSourcesMetaFile", "triggerSourcesMetaJsonFile", "triggersTypesFile", "triggersWiringFile", "triggersWiringMetaFile", "triggersWiringMetaJsonFile", "tsconfig", "typesDeclarationFile", "variableTypesFile", "variablesFile", "variablesMetaJsonFile", "workflowMapDeclarationFile", "workflowMetaDir", "workflowTypesFile", "workflowWorkersFile", "workflowsWiringFile", "workflowsWiringMetaFile", "workflowsWorkersFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "PikkuScaffoldFeature": { "type": ["string", "boolean"], "enum": ["auth", "no-auth", 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,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  export { wireSecret } from '@pikku/core/secret';
5
5
  export type { CoreSecret, SecretDefinitionMeta, SecretDefinitionsMeta } from '@pikku/core/secret';
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  export { wireSecret } from '@pikku/core/secret';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
5
5
  import type { SecretService } from '@pikku/core/services';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
5
5
  const CREDENTIALS_META = {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  /**
5
5
  * Trigger-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  /**
5
5
  * Trigger-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  export { wireVariable } from '@pikku/core/variable';
5
5
  export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable';
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  export { wireVariable } from '@pikku/core/variable';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { TypedVariablesService as CoreTypedVariablesService } from '@pikku/core/services';
5
5
  import type { VariablesService } from '@pikku/core/services';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { TypedVariablesService as CoreTypedVariablesService } from '@pikku/core/services';
5
5
  const VARIABLES_META = {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { WorkflowCancelledException } from '@pikku/core/workflow';
5
5
  import { template } from '@pikku/core/workflow';
@@ -41,6 +41,7 @@ export type PikkuWorkflowConfigWithSchema<InputSchema extends StandardSchemaV1 |
41
41
  output?: OutputSchema;
42
42
  node?: NodeConfig;
43
43
  errors?: Array<typeof PikkuError>;
44
+ inline?: boolean;
44
45
  };
45
46
  export declare function pikkuWorkflowFunc<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined>(config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>;
46
47
  export declare function pikkuWorkflowFunc<In, Out = unknown>(func: PikkuFunctionWorkflow<In, Out> | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>): PikkuFunctionConfig<In, Out, 'workflow'>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { WorkflowCancelledException } from '@pikku/core/workflow';
5
5
  import { workflow as coreWorkflow, workflowStart as coreWorkflowStart, workflowStatus as coreWorkflowStatus, graphStart as coreGraphStart, } from '@pikku/core/workflow';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.7
2
+ * This file was generated by @pikku/cli@0.12.9
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/internal';
5
5
  const workflowsMeta = {};
@@ -1,4 +1,4 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.12.7
3
+ * This file was generated by @pikku/cli@0.12.9
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export {};
2
2
  /**
3
- * This file was generated by @pikku/cli@0.12.7
3
+ * This file was generated by @pikku/cli@0.12.9
4
4
  */
@@ -88,6 +88,7 @@ export const all = pikkuVoidFunc({
88
88
  await rpc.invoke('pikkuNodeTypes', null);
89
89
  await rpc.invoke('pikkuSecretDefinitionTypes', null);
90
90
  await rpc.invoke('pikkuSecrets', null);
91
+ await rpc.invoke('pikkuCredentials', null);
91
92
  await rpc.invoke('pikkuVariableDefinitionTypes', null);
92
93
  await rpc.invoke('pikkuVariables', null);
93
94
  await rpc.invoke('pikkuAddonTypes', null);
@@ -351,18 +351,35 @@ export interface Services extends CoreServices<SingletonServices> {}
351
351
  `;
352
352
  // Conditional: secret file
353
353
  if (flags.oauth) {
354
- files[`src/${name}.secret.ts`] =
355
- `import { wireOAuth2Credential } from '@pikku/core/oauth2'
356
-
357
- wireOAuth2Credential({
358
- name: '${camelName}OAuth',
359
- displayName: '${displayName} OAuth2',
360
- description: '${displayName} OAuth2 credentials',
361
- secretId: '${screamingName}_APP_CREDENTIALS',
362
- tokenSecretId: '${screamingName}_TOKENS',
363
- authorizationUrl: 'https://example.com/oauth2/authorize',
364
- tokenUrl: 'https://example.com/oauth2/token',
365
- scopes: ['read', 'write'],
354
+ files[`src/${name}.credential.ts`] = `import { z } from 'zod'
355
+ import { wireCredential } from '@pikku/core/credential'
356
+ import { wireSecret } from '@pikku/core/secret'
357
+
358
+ export const ${camelName}TokenSchema = z.object({
359
+ accessToken: z.string(),
360
+ refreshToken: z.string().optional(),
361
+ })
362
+
363
+ wireCredential({
364
+ name: '${camelName}',
365
+ displayName: '${displayName}',
366
+ description: '${description}',
367
+ type: 'wire',
368
+ schema: ${camelName}TokenSchema,
369
+ oauth2: {
370
+ appCredentialSecretId: '${screamingName}_OAUTH_APP',
371
+ tokenSecretId: '${screamingName}_OAUTH_TOKENS',
372
+ authorizationUrl: 'https://example.com/oauth2/authorize',
373
+ tokenUrl: 'https://example.com/oauth2/token',
374
+ scopes: ['read', 'write'],
375
+ },
376
+ })
377
+
378
+ wireSecret({
379
+ name: '${camelName}OAuthApp',
380
+ displayName: '${displayName} OAuth App',
381
+ description: 'OAuth2 app credentials for ${displayName}',
382
+ secretId: '${screamingName}_OAUTH_APP',
366
383
  })
367
384
  `;
368
385
  }
@@ -50,6 +50,7 @@ export function serializeChannelCLI(programName, programMeta, channelFile, funct
50
50
  import { wireChannel } from '${channelTypesPath}'
51
51
  import { pikkuMiddleware${hasAddonFuncs ? ', addon' : ''}, pikkuSessionlessFunc } from '${functionTypesPath}'
52
52
  import { generateCommandHelp } from '@pikku/core/cli'
53
+ import { handleRawCLI } from '@pikku/core/cli/channel'
53
54
  import { pikkuState } from '@pikku/core/internal'
54
55
  ${imports}
55
56
 
@@ -86,6 +87,17 @@ export const cliHelp = pikkuSessionlessFunc<{ args?: string[] }, { help: string
86
87
  },
87
88
  })
88
89
 
90
+ export const cliRaw = pikkuSessionlessFunc<{ args: string[] }, { help?: string; result?: unknown; error?: string }>({
91
+ auth: false,
92
+ func: async (services, data: { args: string[] }) => {
93
+ return handleRawCLI({
94
+ programName: '${programName}',
95
+ args: data.args,
96
+ singletonServices: services as any,
97
+ })
98
+ },
99
+ })
100
+
89
101
  wireChannel({
90
102
  name: '${finalChannelName}',
91
103
  route: '${finalChannelRoute}',
@@ -96,6 +108,10 @@ wireChannel({
96
108
  func: cliHelp,
97
109
  middleware: [cliCloseOnComplete],
98
110
  },
111
+ '__raw': {
112
+ func: cliRaw,
113
+ middleware: [cliCloseOnComplete],
114
+ },
99
115
  ${Object.entries(commandMap)
100
116
  .map(([commandKey, { pikkuFuncId, isAddon }]) => {
101
117
  const funcRef = isAddon
@@ -0,0 +1 @@
1
+ export declare const pikkuCredentials: import("#pikku").PikkuFunctionConfig<void, void, "session" | "rpc", import("#pikku").PikkuFunctionSessionless<void, void, "session" | "rpc", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "session" | "rpc", import("#pikku").Services>, undefined, undefined>;
@@ -0,0 +1,34 @@
1
+ import { pikkuSessionlessFunc } from '#pikku';
2
+ import { writeFileInDir } from '../../../utils/file-writer.js';
3
+ import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
4
+ import { serializeCredentialsTypes } from './serialize-credentials-types.js';
5
+ import { validateAndBuildCredentialDefinitionsMeta } from '@pikku/core/credential';
6
+ export const pikkuCredentials = pikkuSessionlessFunc({
7
+ func: async ({ logger, config, getInspectorState }) => {
8
+ const { credentialsFile, credentialsMetaJsonFile, packageMappings } = config;
9
+ if (!credentialsFile) {
10
+ return;
11
+ }
12
+ const state = await getInspectorState();
13
+ if (state.credentials.definitions.length === 0) {
14
+ return;
15
+ }
16
+ const content = serializeCredentialsTypes({
17
+ definitions: state.credentials.definitions,
18
+ schemaLookup: state.schemaLookup,
19
+ credentialsFile,
20
+ packageMappings,
21
+ });
22
+ await writeFileInDir(logger, credentialsFile, content);
23
+ if (credentialsMetaJsonFile) {
24
+ const meta = validateAndBuildCredentialDefinitionsMeta(state.credentials.definitions, state.schemaLookup);
25
+ await writeFileInDir(logger, credentialsMetaJsonFile, JSON.stringify(meta, null, 2));
26
+ }
27
+ },
28
+ middleware: [
29
+ logCommandInfoAndTime({
30
+ commandStart: 'Creating PikkuCredentials types',
31
+ commandEnd: 'Created PikkuCredentials types',
32
+ }),
33
+ ],
34
+ });
@@ -0,0 +1,9 @@
1
+ import type { CredentialDefinitions } from '@pikku/core/credential';
2
+ import type { SchemaRef } from '@pikku/inspector';
3
+ export interface SerializeCredentialsOptions {
4
+ definitions: CredentialDefinitions;
5
+ schemaLookup: Map<string, SchemaRef>;
6
+ credentialsFile: string;
7
+ packageMappings: Record<string, string>;
8
+ }
9
+ export declare const serializeCredentialsTypes: ({ definitions, schemaLookup, credentialsFile, packageMappings, }: SerializeCredentialsOptions) => string;
@@ -0,0 +1,61 @@
1
+ import { validateAndBuildCredentialDefinitionsMeta } from '@pikku/core/credential';
2
+ import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
3
+ export const serializeCredentialsTypes = ({ definitions, schemaLookup, credentialsFile, packageMappings, }) => {
4
+ const credentials = validateAndBuildCredentialDefinitionsMeta(definitions, schemaLookup);
5
+ const credentialEntries = Object.entries(credentials);
6
+ const schemaImports = new Map();
7
+ let needsZod = false;
8
+ const mapEntries = [];
9
+ const metaEntries = [];
10
+ for (const [name, meta] of credentialEntries) {
11
+ if (meta.schema && typeof meta.schema === 'string') {
12
+ const schemaRef = schemaLookup.get(meta.schema);
13
+ if (schemaRef) {
14
+ needsZod = true;
15
+ if (!schemaImports.has(schemaRef.sourceFile)) {
16
+ schemaImports.set(schemaRef.sourceFile, new Set());
17
+ }
18
+ schemaImports.get(schemaRef.sourceFile).add(schemaRef.variableName);
19
+ mapEntries.push(` '${name}': z.infer<typeof ${schemaRef.variableName}>`);
20
+ }
21
+ }
22
+ const metaParts = [
23
+ `name: '${name}'`,
24
+ `displayName: '${meta.displayName}'`,
25
+ `type: '${meta.type}'`,
26
+ ];
27
+ if (meta.oauth2) {
28
+ metaParts.push(`oauth2: true`);
29
+ }
30
+ metaEntries.push(` '${name}': { ${metaParts.join(', ')} }`);
31
+ }
32
+ const imports = [];
33
+ imports.push(`import { TypedCredentialService as CoreTypedCredentialService, type CredentialMetaInfo } from '@pikku/core/services'`);
34
+ imports.push(`import type { CredentialService } from '@pikku/core/services'`);
35
+ if (needsZod) {
36
+ imports.push(`import type { z } from 'zod'`);
37
+ }
38
+ for (const [sourceFile, variableNames] of schemaImports) {
39
+ const importPath = getFileImportRelativePath(credentialsFile, sourceFile, packageMappings);
40
+ const vars = Array.from(variableNames).join(', ');
41
+ imports.push(`import { ${vars} } from '${importPath}'`);
42
+ }
43
+ return `${imports.join('\n')}
44
+
45
+ export interface CredentialsMap {
46
+ ${mapEntries.join('\n')}
47
+ }
48
+
49
+ export type CredentialName = keyof CredentialsMap
50
+
51
+ const CREDENTIALS_META: Record<string, CredentialMetaInfo> = {
52
+ ${metaEntries.join(',\n')}
53
+ }
54
+
55
+ export class TypedCredentialService extends CoreTypedCredentialService<CredentialsMap> {
56
+ constructor(credentials: CredentialService) {
57
+ super(credentials, CREDENTIALS_META)
58
+ }
59
+ }
60
+ `;
61
+ };
@@ -10,7 +10,7 @@ export const pikkuAddonTypes = pikkuSessionlessFunc({
10
10
  return;
11
11
  }
12
12
  const visitState = await getInspectorState();
13
- const { addonTypesFile, packageMappings, servicesFile, secretsFile, variablesFile, } = config;
13
+ const { addonTypesFile, packageMappings, servicesFile, secretsFile, credentialsFile, variablesFile, } = config;
14
14
  checkRequiredTypes(visitState.filesAndMethodsErrors, {
15
15
  singletonServicesType: true,
16
16
  });
@@ -21,7 +21,9 @@ export const pikkuAddonTypes = pikkuSessionlessFunc({
21
21
  const configTypeImport = pikkuConfigType
22
22
  ? `import type { ${pikkuConfigType.type} } from '${getFileImportRelativePath(addonTypesFile, pikkuConfigType.typePath, packageMappings)}'`
23
23
  : '// Config type not found, will use fallback';
24
- const content = serializeAddonTypes(`import type { ${singletonServicesType.type} } from '${getFileImportRelativePath(addonTypesFile, singletonServicesType.typePath, packageMappings)}'`, singletonServicesType.type, configTypeImport, `import type { RequiredSingletonServices } from '${getFileImportRelativePath(addonTypesFile, servicesFile, packageMappings)}'`, `import { TypedSecretService } from '${getFileImportRelativePath(addonTypesFile, secretsFile, packageMappings)}'`, `import { TypedVariablesService } from '${getFileImportRelativePath(addonTypesFile, variablesFile, packageMappings)}'`);
24
+ const content = serializeAddonTypes(`import type { ${singletonServicesType.type} } from '${getFileImportRelativePath(addonTypesFile, singletonServicesType.typePath, packageMappings)}'`, singletonServicesType.type, configTypeImport, `import type { RequiredSingletonServices } from '${getFileImportRelativePath(addonTypesFile, servicesFile, packageMappings)}'`, `import { TypedSecretService } from '${getFileImportRelativePath(addonTypesFile, secretsFile, packageMappings)}'`, `import { TypedVariablesService } from '${getFileImportRelativePath(addonTypesFile, variablesFile, packageMappings)}'`, visitState.credentials.definitions.length > 0
25
+ ? `import { TypedCredentialService } from '${getFileImportRelativePath(addonTypesFile, credentialsFile, packageMappings)}'`
26
+ : null);
25
27
  await writeFileInDir(logger, addonTypesFile, content);
26
28
  },
27
29
  middleware: [
@@ -1 +1 @@
1
- export declare const serializeAddonTypes: (singletonServicesTypeImport: string, singletonServicesTypeName: string, configTypeImport: string, requiredServicesTypeImport: string, typedSecretServiceImport: string, typedVariablesServiceImport: string) => string;
1
+ export declare const serializeAddonTypes: (singletonServicesTypeImport: string, singletonServicesTypeName: string, configTypeImport: string, requiredServicesTypeImport: string, typedSecretServiceImport: string, typedVariablesServiceImport: string, typedCredentialServiceImport?: string | null) => string;
@@ -1,4 +1,4 @@
1
- export const serializeAddonTypes = (singletonServicesTypeImport, singletonServicesTypeName, configTypeImport, requiredServicesTypeImport, typedSecretServiceImport, typedVariablesServiceImport) => {
1
+ export const serializeAddonTypes = (singletonServicesTypeImport, singletonServicesTypeName, configTypeImport, requiredServicesTypeImport, typedSecretServiceImport, typedVariablesServiceImport, typedCredentialServiceImport = null) => {
2
2
  return `/**
3
3
  * Addon package types for pikkuAddonConfig and pikkuAddonServices
4
4
  */
@@ -9,6 +9,7 @@ ${configTypeImport}
9
9
  ${requiredServicesTypeImport}
10
10
  ${typedSecretServiceImport}
11
11
  ${typedVariablesServiceImport}
12
+ ${typedCredentialServiceImport ? typedCredentialServiceImport : ''}
12
13
 
13
14
  ${singletonServicesTypeName !== 'SingletonServices' ? `type SingletonServices = ${singletonServicesTypeName}` : ''}
14
15
  ${configTypeImport.includes('Config type not found') ? 'type Config = any' : ''}
@@ -20,7 +21,7 @@ ${configTypeImport.includes('Config type not found') ? 'type Config = any' : ''}
20
21
  export type AddonBaseServices = {
21
22
  logger: SingletonServices['logger']
22
23
  variables: TypedVariablesService
23
- secrets: TypedSecretService
24
+ secrets: TypedSecretService${typedCredentialServiceImport ? `\n credentials: TypedCredentialService` : ''}
24
25
  }
25
26
 
26
27
  /**
@@ -20,11 +20,33 @@ export const serializeMiddlewareImports = (outputPath, middlewareState, httpStat
20
20
  const channelMiddlewareFactories = fullState
21
21
  ? collectFactories(fullState.channelMiddleware.tagMiddleware, outputPath, packageMappings)
22
22
  : new Map();
23
+ // Collect direct (non-factory) side-effect imports
24
+ const directImports = new Set();
25
+ const collectDirectImports = (groupMap) => {
26
+ for (const [, groupMeta] of groupMap.entries()) {
27
+ if (!groupMeta.isFactory) {
28
+ const filePath = getFileImportRelativePath(outputPath, groupMeta.sourceFile, packageMappings);
29
+ directImports.add(filePath);
30
+ }
31
+ }
32
+ };
33
+ collectDirectImports(httpState.routeMiddleware);
34
+ collectDirectImports(middlewareState.tagMiddleware);
35
+ if (fullState) {
36
+ collectDirectImports(fullState.channelMiddleware.tagMiddleware);
37
+ }
23
38
  const allFactories = new Map([
24
39
  ...httpFactories,
25
40
  ...tagFactories,
26
41
  ...channelMiddlewareFactories,
27
42
  ]);
43
+ // Add direct side-effect imports (non-factory addHTTPMiddleware / addMiddleware calls)
44
+ if (directImports.size > 0) {
45
+ serializedImports.push('/* Side-effect imports for direct middleware registration calls */');
46
+ for (const filePath of directImports) {
47
+ serializedImports.push(`import '${filePath}'`);
48
+ }
49
+ }
28
50
  if (allFactories.size > 0) {
29
51
  serializedImports.push('/* Call middleware group factories to register at module evaluation */');
30
52
  for (const [exportName, { filePath }] of allFactories) {