@pikku/cli 0.12.1 → 0.12.3
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/cli.schema.json +1 -1
- package/console-app/assets/index-Ci24-VT-.js +657 -0
- package/console-app/assets/{index-0Ui5UudO.css → index-DvrDbftC.css} +1 -1
- package/console-app/index.html +2 -2
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +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 +13 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +37 -2
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- 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 +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +64 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +30 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +17 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +155 -76
- package/dist/.pikku/function/pikku-functions.gen.js +3 -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.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +3 -1
- package/dist/.pikku/pikku-services.gen.js +2 -0
- 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 +1 -1
- 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.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +10 -5
- 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 -7
- package/dist/.pikku/schemas/schemas/ConsoleCommandInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuGatewayOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuNewAddonInput.schema.json +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/src/cli.wiring.js +55 -0
- package/dist/src/functions/commands/all.js +40 -13
- package/dist/src/functions/commands/console.d.ts +3 -0
- package/dist/src/functions/commands/console.js +4 -2
- package/dist/src/functions/commands/enable.d.ts +4 -0
- package/dist/src/functions/commands/enable.js +39 -0
- package/dist/src/functions/commands/new-addon.d.ts +3 -0
- package/dist/src/functions/commands/new-addon.js +8 -6
- package/dist/src/functions/runtimes/fetch/index.js +2 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +4 -1
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.js +2 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.js +3 -5
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +19 -0
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.js +1 -1
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/serialize-typed-channel-map.js +7 -6
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +9 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +35 -12
- package/dist/src/functions/wirings/console/pikku-command-console-functions.js +4 -6
- package/dist/src/functions/wirings/console/pikku-command-node-types.js +2 -2
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.js +20 -11
- package/dist/src/functions/wirings/console/serialize-console-functions.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/serialize-addon-types.js +23 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +38 -0
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -0
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.js +22 -0
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.js +2 -1
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +3 -5
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.js +3 -5
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.js +2 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +3 -10
- package/dist/src/services.js +13 -1
- package/dist/src/utils/file-import-path.js +5 -2
- package/dist/src/utils/openapi/codegen.d.ts +1 -0
- package/dist/src/utils/openapi/codegen.js +214 -46
- package/dist/src/utils/openapi/parse-openapi.d.ts +25 -0
- package/dist/src/utils/openapi/parse-openapi.js +119 -9
- package/dist/src/utils/openapi/zod-codegen.d.ts +1 -53
- package/dist/src/utils/openapi/zod-codegen.js +1 -251
- package/dist/src/utils/pikku-cli-config.js +45 -18
- package/dist/src/utils/strip-verbose-meta.d.ts +2 -0
- package/dist/src/utils/strip-verbose-meta.js +34 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
- package/console-app/assets/index-DiYPTQU_.js +0 -676
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.3
|
|
3
3
|
*/
|
|
4
4
|
import { addSchema } from '@pikku/core/schema';
|
|
5
5
|
import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' };
|
|
@@ -28,10 +28,14 @@ import * as PikkuConsoleFunctionsOutput from './schemas/PikkuConsoleFunctionsOut
|
|
|
28
28
|
addSchema('PikkuConsoleFunctionsOutput', PikkuConsoleFunctionsOutput);
|
|
29
29
|
import * as PikkuNodesMetaOutput from './schemas/PikkuNodesMetaOutput.schema.json' with { type: 'json' };
|
|
30
30
|
addSchema('PikkuNodesMetaOutput', PikkuNodesMetaOutput);
|
|
31
|
+
import * as PikkuAIAgentOutput from './schemas/PikkuAIAgentOutput.schema.json' with { type: 'json' };
|
|
32
|
+
addSchema('PikkuAIAgentOutput', PikkuAIAgentOutput);
|
|
33
|
+
import * as PikkuPublicAgentOutput from './schemas/PikkuPublicAgentOutput.schema.json' with { type: 'json' };
|
|
34
|
+
addSchema('PikkuPublicAgentOutput', PikkuPublicAgentOutput);
|
|
31
35
|
import * as PikkuFunctionsOutput from './schemas/PikkuFunctionsOutput.schema.json' with { type: 'json' };
|
|
32
36
|
addSchema('PikkuFunctionsOutput', PikkuFunctionsOutput);
|
|
33
|
-
import * as
|
|
34
|
-
addSchema('
|
|
37
|
+
import * as PikkuGatewayOutput from './schemas/PikkuGatewayOutput.schema.json' with { type: 'json' };
|
|
38
|
+
addSchema('PikkuGatewayOutput', PikkuGatewayOutput);
|
|
35
39
|
import * as PikkuMCPOutput from './schemas/PikkuMCPOutput.schema.json' with { type: 'json' };
|
|
36
40
|
addSchema('PikkuMCPOutput', PikkuMCPOutput);
|
|
37
41
|
import * as PikkuMiddlewareOutput from './schemas/PikkuMiddlewareOutput.schema.json' with { type: 'json' };
|
|
@@ -54,9 +58,7 @@ import * as PikkuTriggerOutput from './schemas/PikkuTriggerOutput.schema.json' w
|
|
|
54
58
|
addSchema('PikkuTriggerOutput', PikkuTriggerOutput);
|
|
55
59
|
import * as PikkuWorkflowOutput from './schemas/PikkuWorkflowOutput.schema.json' with { type: 'json' };
|
|
56
60
|
addSchema('PikkuWorkflowOutput', PikkuWorkflowOutput);
|
|
57
|
-
import * as
|
|
58
|
-
addSchema('
|
|
59
|
-
import * as PikkuPublicAgentOutput from './schemas/PikkuPublicAgentOutput.schema.json' with { type: 'json' };
|
|
60
|
-
addSchema('PikkuPublicAgentOutput', PikkuPublicAgentOutput);
|
|
61
|
+
import * as PikkuHTTPOutput from './schemas/PikkuHTTPOutput.schema.json' with { type: 'json' };
|
|
62
|
+
addSchema('PikkuHTTPOutput', PikkuHTTPOutput);
|
|
61
63
|
import * as PikkuCLIConfig from './schemas/PikkuCLIConfig.schema.json' with { type: 'json' };
|
|
62
64
|
addSchema('PikkuCLIConfig', PikkuCLIConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "port": { "type": "string" } }, "additionalProperties": false, "definitions": {} }
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "port": { "type": "string" }, "open": { "type": "string" } }, "additionalProperties": false, "definitions": {} }
|
|
@@ -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" }, "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" }, "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": { "type": "boolean" }, "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" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" }, "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "openAPI": { "type": "object", "properties": { "outputFile": { "type": "string" }, "additionalInfo": { "$ref": "#/definitions/OpenAPISpecInfo" } }, "required": ["outputFile", "additionalInfo"], "additionalProperties": false }, "schema": { "type": "object", "properties": { "additionalProperties": { "type": "boolean" }, "supportsImportAttributes": { "type": "boolean" } }, "additionalProperties": false }, "cli": { "type": "object", "properties": { "entrypoints": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }, { "type": "array", "items": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }] } }] } } }, "additionalProperties": false }, "workflows": { "anyOf": [{ "type": "object", "properties": { "singleQueue": { "type": "boolean", "const": true }, "path": { "type": "string" }, "orchestratorQueue": { "type": "string" }, "workerQueue": { "type": "string" } }, "required": ["singleQueue", "path"], "additionalProperties": false }, { "type": "object", "properties": { "singleQueue": { "type": "boolean", "const": false }, "dir": { "type": "string" }, "orchestratorQueuePrefix": { "type": "string" }, "workerQueuePrefix": { "type": "string" } }, "required": ["singleQueue", "dir"], "additionalProperties": false }] }, "rpc": { "type": "object", "properties": { "remoteRpcWorkersPath": { "type": "string" }, "publicRpcPath": { "type": "string" }, "publicRpcRequireAuth": { "type": "boolean" } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "publicAgentPath": { "type": "string" }, "publicAgentRequireAuth": { "type": "boolean" } }, "additionalProperties": false }, "console": { "type": "object", "properties": { "functionsPath": { "type": "string" } }, "additionalProperties": false }, "scaffold": { "type": "object", "properties": { "addonDir": { "type": "string" }, "functionDir": { "type": "string" }, "wiringDir": { "type": "string" }, "middlewareDir": { "type": "string" }, "permissionDir": { "type": "string" } }, "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 }, "node": { "type": "object", "properties": { "categories": { "type": "array", "items": { "type": "string" } }, "icon": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" } }, "additionalProperties": false }, "nodesMetaJsonFile": { "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", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaJsonFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringMetaJsonFile", "httpWiringsFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "mcpWiringsMetaJsonFile", "middlewareFile", "middlewareGroupsMetaJsonFile", "nodeTypesFile", "outDir", "packageFile", "packageMappings", "permissionsFile", "permissionsGroupsMetaJsonFile", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "queueWorkersWiringMetaJsonFile", "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", "workflowsWiringFile", "workflowsWiringMetaFile", "workflowsWorkersFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "InspectorFilters": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "directories": { "type": "array", "items": { "type": "string" } }, "httpRoutes": { "type": "array", "items": { "type": "string" } }, "httpMethods": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } }
|
|
1
|
+
{ "$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" } }, "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" }, "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 } } }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "category": { "type": "string" }, "dir": { "type": "string" }, "secret": { "type": "boolean" }, "variable": { "type": "boolean" }, "oauth": { "type": "boolean" }, "test": { "type": "boolean" }, "openapi": { "type": "string" } }, "required": ["name"], "additionalProperties": false, "definitions": {} }
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "category": { "type": "string" }, "dir": { "type": "string" }, "secret": { "type": "boolean" }, "variable": { "type": "boolean" }, "oauth": { "type": "boolean" }, "test": { "type": "boolean" }, "openapi": { "type": "string" }, "mcp": { "type": "boolean" } }, "required": ["name"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.3
|
|
3
3
|
*/
|
|
4
4
|
export { wireVariable } from '@pikku/core/variable';
|
|
5
5
|
export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.3
|
|
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';
|
package/dist/src/cli.wiring.js
CHANGED
|
@@ -19,6 +19,7 @@ import { pikkuNewMiddleware } from './functions/commands/new-middleware.js';
|
|
|
19
19
|
import { pikkuNewPermission } from './functions/commands/new-permission.js';
|
|
20
20
|
import { pikkuNewAddon } from './functions/commands/new-addon.js';
|
|
21
21
|
import { pikkuInfoFunctions, pikkuInfoTags, pikkuInfoMiddleware, pikkuInfoPermissions, } from './functions/commands/info.js';
|
|
22
|
+
import { enableRpc, enableConsole, enableAgent, enableWorkflow, } from './functions/commands/enable.js';
|
|
22
23
|
// import { clientCLIRenderer } from './services.js'
|
|
23
24
|
wireCLI({
|
|
24
25
|
program: 'pikku',
|
|
@@ -96,6 +97,11 @@ wireCLI({
|
|
|
96
97
|
default: '51442',
|
|
97
98
|
short: 'p',
|
|
98
99
|
},
|
|
100
|
+
open: {
|
|
101
|
+
description: 'Open the console in the browser',
|
|
102
|
+
default: 'false',
|
|
103
|
+
short: 'o',
|
|
104
|
+
},
|
|
99
105
|
},
|
|
100
106
|
}),
|
|
101
107
|
schemas: pikkuCLICommand({
|
|
@@ -126,6 +132,51 @@ wireCLI({
|
|
|
126
132
|
func: pikkuNext,
|
|
127
133
|
description: 'Generate Next.js backend and HTTP wrappers',
|
|
128
134
|
}),
|
|
135
|
+
enable: {
|
|
136
|
+
description: 'Enable Pikku features',
|
|
137
|
+
subcommands: {
|
|
138
|
+
rpc: pikkuCLICommand({
|
|
139
|
+
func: enableRpc,
|
|
140
|
+
description: 'Enable public RPC endpoint',
|
|
141
|
+
options: {
|
|
142
|
+
'no-auth': {
|
|
143
|
+
description: 'Disable auth requirement',
|
|
144
|
+
default: false,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
}),
|
|
148
|
+
console: pikkuCLICommand({
|
|
149
|
+
func: enableConsole,
|
|
150
|
+
description: 'Enable console functions',
|
|
151
|
+
options: {
|
|
152
|
+
'no-auth': {
|
|
153
|
+
description: 'Disable auth requirement',
|
|
154
|
+
default: false,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
}),
|
|
158
|
+
agent: pikkuCLICommand({
|
|
159
|
+
func: enableAgent,
|
|
160
|
+
description: 'Enable public agent endpoints',
|
|
161
|
+
options: {
|
|
162
|
+
'no-auth': {
|
|
163
|
+
description: 'Disable auth requirement',
|
|
164
|
+
default: false,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
}),
|
|
168
|
+
workflow: pikkuCLICommand({
|
|
169
|
+
func: enableWorkflow,
|
|
170
|
+
description: 'Enable workflow workers',
|
|
171
|
+
options: {
|
|
172
|
+
'no-auth': {
|
|
173
|
+
description: 'Disable auth requirement',
|
|
174
|
+
default: false,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
}),
|
|
178
|
+
},
|
|
179
|
+
},
|
|
129
180
|
new: {
|
|
130
181
|
description: 'Scaffold new functions and wirings',
|
|
131
182
|
subcommands: {
|
|
@@ -215,6 +266,10 @@ wireCLI({
|
|
|
215
266
|
openapi: {
|
|
216
267
|
description: 'Path to OpenAPI YAML/JSON spec to generate functions from',
|
|
217
268
|
},
|
|
269
|
+
mcp: {
|
|
270
|
+
description: 'Add mcp: true to generated functions (expose as MCP tools)',
|
|
271
|
+
default: false,
|
|
272
|
+
},
|
|
218
273
|
},
|
|
219
274
|
}),
|
|
220
275
|
},
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { existsSync } from 'fs';
|
|
2
2
|
import { pikkuVoidFunc } from '#pikku';
|
|
3
|
+
const scaffoldFiles = (config) => {
|
|
4
|
+
const files = [];
|
|
5
|
+
if (config.scaffold?.rpc && config.publicRpcFile)
|
|
6
|
+
files.push({ file: config.publicRpcFile, generator: 'pikkuPublicRPC' });
|
|
7
|
+
if (config.scaffold?.console && config.consoleFunctionsFile)
|
|
8
|
+
files.push({
|
|
9
|
+
file: config.consoleFunctionsFile,
|
|
10
|
+
generator: 'pikkuConsoleFunctions',
|
|
11
|
+
});
|
|
12
|
+
if (config.scaffold?.agent && config.publicAgentFile)
|
|
13
|
+
files.push({
|
|
14
|
+
file: config.publicAgentFile,
|
|
15
|
+
generator: 'pikkuPublicAgent',
|
|
16
|
+
});
|
|
17
|
+
return files;
|
|
18
|
+
};
|
|
3
19
|
export const all = pikkuVoidFunc({
|
|
4
20
|
remote: true,
|
|
5
21
|
func: async ({ logger, config, getInspectorState }, _data, { rpc }) => {
|
|
@@ -8,9 +24,15 @@ export const all = pikkuVoidFunc({
|
|
|
8
24
|
if (!existsSync(config.typesDeclarationFile)) {
|
|
9
25
|
typesDeclarationFileExists = false;
|
|
10
26
|
}
|
|
27
|
+
const missingScaffolds = scaffoldFiles(config).filter((s) => !existsSync(s.file));
|
|
28
|
+
if (missingScaffolds.length > 0) {
|
|
29
|
+
for (const { generator } of missingScaffolds) {
|
|
30
|
+
await rpc.invoke(generator, null);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
11
33
|
await rpc.invoke('pikkuFunctionTypes', null);
|
|
12
|
-
if (!typesDeclarationFileExists) {
|
|
13
|
-
logger.debug(`• Type file first created, inspecting again...`);
|
|
34
|
+
if (!typesDeclarationFileExists || missingScaffolds.length > 0) {
|
|
35
|
+
logger.debug(`• Type file or scaffolds first created, inspecting again...`);
|
|
14
36
|
await getInspectorState(true);
|
|
15
37
|
}
|
|
16
38
|
await rpc.invoke('pikkuFunctionTypesSplit', null);
|
|
@@ -41,7 +63,7 @@ export const all = pikkuVoidFunc({
|
|
|
41
63
|
const agents = await rpc.invoke('pikkuAIAgent', null);
|
|
42
64
|
if (agents) {
|
|
43
65
|
allImports.push(config.agentWiringMetaFile, config.agentWiringsFile);
|
|
44
|
-
if (config.agent
|
|
66
|
+
if (config.scaffold?.agent) {
|
|
45
67
|
await rpc.invoke('pikkuPublicAgent', null);
|
|
46
68
|
}
|
|
47
69
|
}
|
|
@@ -66,6 +88,15 @@ export const all = pikkuVoidFunc({
|
|
|
66
88
|
}
|
|
67
89
|
await rpc.invoke('pikkuRPCInternalMap', null);
|
|
68
90
|
await rpc.invoke('pikkuRPCExposedMap', null);
|
|
91
|
+
const workflows = await rpc.invoke('pikkuWorkflow', null);
|
|
92
|
+
let remoteRPC = false;
|
|
93
|
+
if (!config.addon) {
|
|
94
|
+
remoteRPC = await rpc.invoke('pikkuRemoteRPC', null);
|
|
95
|
+
}
|
|
96
|
+
if (workflows || remoteRPC) {
|
|
97
|
+
await getInspectorState(true);
|
|
98
|
+
await rpc.invoke('pikkuSchemas', null);
|
|
99
|
+
}
|
|
69
100
|
if (!config.addon) {
|
|
70
101
|
const http = await rpc.invoke('pikkuHTTP', null);
|
|
71
102
|
if (http) {
|
|
@@ -82,15 +113,6 @@ export const all = pikkuVoidFunc({
|
|
|
82
113
|
allImports.push(config.triggersWiringMetaFile, config.triggerSourcesMetaFile, config.triggersWiringFile);
|
|
83
114
|
}
|
|
84
115
|
}
|
|
85
|
-
const workflows = await rpc.invoke('pikkuWorkflow', null);
|
|
86
|
-
let remoteRPC = false;
|
|
87
|
-
if (!config.addon) {
|
|
88
|
-
remoteRPC = await rpc.invoke('pikkuRemoteRPC', null);
|
|
89
|
-
}
|
|
90
|
-
if (workflows || remoteRPC) {
|
|
91
|
-
await getInspectorState(true);
|
|
92
|
-
await rpc.invoke('pikkuSchemas', null);
|
|
93
|
-
}
|
|
94
116
|
const hasFunctionRegistrations = await rpc.invoke('pikkuFunctions', null);
|
|
95
117
|
allImports.push(config.functionsMetaFile);
|
|
96
118
|
if (hasFunctionRegistrations) {
|
|
@@ -112,6 +134,10 @@ export const all = pikkuVoidFunc({
|
|
|
112
134
|
await rpc.invoke('pikkuWebSocketTyped', null);
|
|
113
135
|
allImports.push(config.channelsWiringMetaFile, config.channelsWiringFile);
|
|
114
136
|
}
|
|
137
|
+
const gateways = await rpc.invoke('pikkuGateway', null);
|
|
138
|
+
if (gateways) {
|
|
139
|
+
allImports.push(config.gatewaysWiringFile);
|
|
140
|
+
}
|
|
115
141
|
const mcp = await rpc.invoke('pikkuMCP', null);
|
|
116
142
|
if (mcp) {
|
|
117
143
|
await rpc.invoke('pikkuMCPJSON', null);
|
|
@@ -124,7 +150,8 @@ export const all = pikkuVoidFunc({
|
|
|
124
150
|
}
|
|
125
151
|
}
|
|
126
152
|
await rpc.invoke('pikkuNodesMeta', null);
|
|
127
|
-
if (config.nextBackendFile ||
|
|
153
|
+
if (config.clientFiles?.nextBackendFile ||
|
|
154
|
+
config.clientFiles?.nextHTTPFile) {
|
|
128
155
|
await rpc.invoke('pikkuNext', null);
|
|
129
156
|
}
|
|
130
157
|
if (config.openAPI) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export declare const consoleCommand: import("#pikku").PikkuFunctionConfig<{
|
|
2
2
|
port?: string;
|
|
3
|
+
open?: string;
|
|
3
4
|
}, void, "session" | "rpc", import("#pikku").PikkuFunctionSessionless<{
|
|
4
5
|
port?: string;
|
|
6
|
+
open?: string;
|
|
5
7
|
}, void, "session" | "rpc", import("#pikku").Services> | import("#pikku").PikkuFunction<{
|
|
6
8
|
port?: string;
|
|
9
|
+
open?: string;
|
|
7
10
|
}, void, "session" | "rpc", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -21,7 +21,7 @@ const MIME_TYPES = {
|
|
|
21
21
|
};
|
|
22
22
|
export const consoleCommand = pikkuSessionlessFunc({
|
|
23
23
|
remote: true,
|
|
24
|
-
func: async ({ logger, config }, { port }, { rpc }) => {
|
|
24
|
+
func: async ({ logger, config }, { port, open: openBrowser }, { rpc }) => {
|
|
25
25
|
const consoleDir = join(fileURLToPath(import.meta.url), '..', '..', '..', '..', '..', 'console-app');
|
|
26
26
|
const resolvedPort = parseInt(port || '51442', 10);
|
|
27
27
|
try {
|
|
@@ -57,7 +57,9 @@ export const consoleCommand = pikkuSessionlessFunc({
|
|
|
57
57
|
});
|
|
58
58
|
server.listen(resolvedPort, () => {
|
|
59
59
|
logger.info(`Pikku Console running at http://localhost:${resolvedPort}`);
|
|
60
|
-
|
|
60
|
+
if (openBrowser === 'true') {
|
|
61
|
+
open(`http://localhost:${resolvedPort}`);
|
|
62
|
+
}
|
|
61
63
|
});
|
|
62
64
|
const configWatcher = chokidar.watch(config.srcDirectories, {
|
|
63
65
|
ignoreInitial: true,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const enableRpc: 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>;
|
|
2
|
+
export declare const enableConsole: 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>;
|
|
3
|
+
export declare const enableAgent: 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>;
|
|
4
|
+
export declare const enableWorkflow: 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,39 @@
|
|
|
1
|
+
import { readFile, writeFile } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { pikkuVoidFunc } from '#pikku';
|
|
4
|
+
const FEATURE_DEFAULTS = {
|
|
5
|
+
rpc: 'auth',
|
|
6
|
+
agent: 'auth',
|
|
7
|
+
console: 'no-auth',
|
|
8
|
+
workflow: 'auth',
|
|
9
|
+
};
|
|
10
|
+
async function enableFeature(feature, logger, config, data) {
|
|
11
|
+
const noAuth = data?.['no-auth'] ?? false;
|
|
12
|
+
const configPath = join(config.configDir, 'pikku.config.json');
|
|
13
|
+
const raw = await readFile(configPath, 'utf-8');
|
|
14
|
+
const json = JSON.parse(raw);
|
|
15
|
+
if (!json.scaffold) {
|
|
16
|
+
json.scaffold = {};
|
|
17
|
+
}
|
|
18
|
+
if (!json.scaffold.pikkuDir) {
|
|
19
|
+
json.scaffold.pikkuDir = 'pikku';
|
|
20
|
+
}
|
|
21
|
+
const value = noAuth
|
|
22
|
+
? 'no-auth'
|
|
23
|
+
: FEATURE_DEFAULTS[feature];
|
|
24
|
+
json.scaffold[feature] = value;
|
|
25
|
+
await writeFile(configPath, JSON.stringify(json, null, 2) + '\n', 'utf-8');
|
|
26
|
+
logger.info(`Enabled scaffold.${feature} = '${value}' in ${configPath}`);
|
|
27
|
+
}
|
|
28
|
+
export const enableRpc = pikkuVoidFunc({
|
|
29
|
+
func: async ({ logger, config }, data) => enableFeature('rpc', logger, config, data),
|
|
30
|
+
});
|
|
31
|
+
export const enableConsole = pikkuVoidFunc({
|
|
32
|
+
func: async ({ logger, config }, data) => enableFeature('console', logger, config, data),
|
|
33
|
+
});
|
|
34
|
+
export const enableAgent = pikkuVoidFunc({
|
|
35
|
+
func: async ({ logger, config }, data) => enableFeature('agent', logger, config, data),
|
|
36
|
+
});
|
|
37
|
+
export const enableWorkflow = pikkuVoidFunc({
|
|
38
|
+
func: async ({ logger, config }, data) => enableFeature('workflow', logger, config, data),
|
|
39
|
+
});
|
|
@@ -9,6 +9,7 @@ export declare const pikkuNewAddon: import("#pikku").PikkuFunctionConfig<{
|
|
|
9
9
|
oauth?: boolean;
|
|
10
10
|
test?: boolean;
|
|
11
11
|
openapi?: string;
|
|
12
|
+
mcp?: boolean;
|
|
12
13
|
}, void, "session" | "rpc", import("#pikku").PikkuFunctionSessionless<{
|
|
13
14
|
name: string;
|
|
14
15
|
displayName?: string;
|
|
@@ -20,6 +21,7 @@ export declare const pikkuNewAddon: import("#pikku").PikkuFunctionConfig<{
|
|
|
20
21
|
oauth?: boolean;
|
|
21
22
|
test?: boolean;
|
|
22
23
|
openapi?: string;
|
|
24
|
+
mcp?: boolean;
|
|
23
25
|
}, void, "session" | "rpc", import("#pikku").Services> | import("#pikku").PikkuFunction<{
|
|
24
26
|
name: string;
|
|
25
27
|
displayName?: string;
|
|
@@ -31,4 +33,5 @@ export declare const pikkuNewAddon: import("#pikku").PikkuFunctionConfig<{
|
|
|
31
33
|
oauth?: boolean;
|
|
32
34
|
test?: boolean;
|
|
33
35
|
openapi?: string;
|
|
36
|
+
mcp?: boolean;
|
|
34
37
|
}, void, "session" | "rpc", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -117,9 +117,9 @@ import { pikkuAddonServices } from '#pikku'
|
|
|
117
117
|
|
|
118
118
|
export const createSingletonServices = pikkuAddonServices(async (
|
|
119
119
|
config,
|
|
120
|
-
{ secrets }
|
|
120
|
+
{ secrets, variables }
|
|
121
121
|
) => {
|
|
122
|
-
const ${camelName} = new ${pascalName}Service(secrets)
|
|
122
|
+
const ${camelName} = new ${pascalName}Service(secrets, variables)
|
|
123
123
|
|
|
124
124
|
return { ${camelName} }
|
|
125
125
|
})
|
|
@@ -133,10 +133,10 @@ import { pikkuAddonServices } from '#pikku'
|
|
|
133
133
|
|
|
134
134
|
export const createSingletonServices = pikkuAddonServices(async (
|
|
135
135
|
config,
|
|
136
|
-
{ secrets }
|
|
136
|
+
{ secrets, variables }
|
|
137
137
|
) => {
|
|
138
138
|
const creds = await secrets.getSecretJSON<${pascalName}Secrets>('${screamingName}_CREDENTIALS')
|
|
139
|
-
const ${camelName} = new ${pascalName}Service(creds)
|
|
139
|
+
const ${camelName} = new ${pascalName}Service(creds, variables)
|
|
140
140
|
|
|
141
141
|
return { ${camelName} }
|
|
142
142
|
})
|
|
@@ -149,8 +149,9 @@ import { pikkuAddonServices } from '#pikku'
|
|
|
149
149
|
|
|
150
150
|
export const createSingletonServices = pikkuAddonServices(async (
|
|
151
151
|
config,
|
|
152
|
+
{ variables }
|
|
152
153
|
) => {
|
|
153
|
-
const ${camelName} = new ${pascalName}Service()
|
|
154
|
+
const ${camelName} = new ${pascalName}Service(variables)
|
|
154
155
|
|
|
155
156
|
return { ${camelName} }
|
|
156
157
|
})
|
|
@@ -581,7 +582,7 @@ async function writeFiles(baseDir, files) {
|
|
|
581
582
|
return written;
|
|
582
583
|
}
|
|
583
584
|
export const pikkuNewAddon = pikkuSessionlessFunc({
|
|
584
|
-
func: async ({ logger, config }, { name, displayName, description, category = 'General', dir, secret = false, variable = false, oauth = false, test = true, openapi, }) => {
|
|
585
|
+
func: async ({ logger, config }, { name, displayName, description, category = 'General', dir, secret = false, variable = false, oauth = false, test = true, openapi, mcp = false, }) => {
|
|
585
586
|
if (!/^[a-z][a-z0-9_-]*$/.test(name)) {
|
|
586
587
|
logger.error(`Invalid addon name "${name}": must start with a lowercase letter and contain only lowercase alphanumerics, hyphens, and underscores`);
|
|
587
588
|
process.exit(1);
|
|
@@ -617,6 +618,7 @@ export const pikkuNewAddon = pikkuSessionlessFunc({
|
|
|
617
618
|
const openapiFiles = generateAddonFromOpenAPI(spec, vars, {
|
|
618
619
|
oauth,
|
|
619
620
|
secret: secret || oauth,
|
|
621
|
+
mcp,
|
|
620
622
|
});
|
|
621
623
|
Object.assign(addonFiles, openapiFiles);
|
|
622
624
|
}
|
|
@@ -5,7 +5,8 @@ import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
|
5
5
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
6
6
|
export const pikkuFetch = pikkuSessionlessFunc({
|
|
7
7
|
func: async ({ logger, config }) => {
|
|
8
|
-
const
|
|
8
|
+
const fetchFile = config.clientFiles?.fetchFile;
|
|
9
|
+
const { httpMapDeclarationFile, packageMappings } = config;
|
|
9
10
|
// If fetchFile is not set, clean up any existing file and return
|
|
10
11
|
if (!fetchFile) {
|
|
11
12
|
logger.debug({
|
|
@@ -7,7 +7,10 @@ import { serializeNextJsBackendWrapper as serializeNextBackendWrapper } from './
|
|
|
7
7
|
import { serializeNextJsHTTPWrapper as serializeNextHTTPWrapper } from './serialize-nextjs-http-wrapper.js';
|
|
8
8
|
export const pikkuNext = pikkuSessionlessFunc({
|
|
9
9
|
func: async ({ logger, config, getInspectorState }) => {
|
|
10
|
-
const
|
|
10
|
+
const nextBackendFile = config.clientFiles?.nextBackendFile;
|
|
11
|
+
const nextHTTPFile = config.clientFiles?.nextHTTPFile;
|
|
12
|
+
const fetchFile = config.clientFiles?.fetchFile;
|
|
13
|
+
const { httpMapDeclarationFile, rpcMapDeclarationFile, packageMappings } = config;
|
|
11
14
|
// If both files are undefined, clean up any existing files and return
|
|
12
15
|
if (!nextBackendFile && !nextHTTPFile) {
|
|
13
16
|
logger.debug({
|