@pikku/cli 0.12.82 → 0.12.85
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-ChcXIEhS.js → index-CEv-kj3J.js} +154 -147
- package/console-app/assets/index-CSzCJzBb.css +1 -0
- package/console-app/index.html +2 -2
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +4 -2
- package/dist/.pikku/auth/auth.types.d.ts +4 -0
- package/dist/.pikku/auth/auth.types.js +5 -0
- 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/cli/pikku-cli-channel.d.ts +4 -4
- package/dist/.pikku/cli/pikku-cli-channel.js +21 -1
- 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-contracts-meta.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.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 +60 -3
- 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 +29 -25
- package/dist/.pikku/function/pikku-function-types.gen.js +3 -12
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +195 -32
- package/dist/.pikku/function/pikku-functions.gen.js +15 -3
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +2 -24
- package/dist/.pikku/http/pikku-http-types.gen.js +2 -24
- 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/pikku-bootstrap.gen.d.ts +1 -5
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -5
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +4 -1
- package/dist/.pikku/pikku-services.gen.js +3 -0
- package/dist/.pikku/pikku-types.gen.d.ts +2 -1
- package/dist/.pikku/pikku-types.gen.js +3 -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/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +10 -2
- 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/schemas/register.gen.js +13 -7
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuGraphWiringsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuImportN8nInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuScopesInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuWebhookOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/ScopesAuditInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/ScopesPruneInput.schema.json +1 -0
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +5 -0
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +4 -0
- package/dist/.pikku/scopes/pikku-scopes-meta.gen.json +1 -0
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +35 -0
- package/dist/.pikku/scopes/pikku-scopes.gen.js +27 -0
- 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-meta.gen.json +1 -0
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +11 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +11 -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-meta.gen.json +1 -0
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +11 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +13 -3
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +49 -7
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +11 -2
- 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.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/cli.wiring.js +47 -4
- package/dist/src/deploy/analyzer/analyzer.js +6 -0
- package/dist/src/fabric/fabric-commands.d.ts +53 -53
- package/dist/src/fabric/functions/add.function.d.ts +2 -2
- package/dist/src/fabric/functions/addon-verify.function.d.ts +2 -2
- package/dist/src/fabric/functions/db-schema.function.d.ts +2 -2
- package/dist/src/fabric/functions/deploy-list.function.d.ts +2 -2
- package/dist/src/fabric/functions/deploy-units.function.d.ts +2 -2
- package/dist/src/fabric/functions/deploy.function.d.ts +4 -4
- package/dist/src/fabric/functions/domains-add.function.d.ts +2 -2
- package/dist/src/fabric/functions/domains-list.function.d.ts +2 -2
- package/dist/src/fabric/functions/domains-remove.function.d.ts +2 -2
- package/dist/src/fabric/functions/errors.function.d.ts +2 -2
- package/dist/src/fabric/functions/init.function.d.ts +2 -2
- package/dist/src/fabric/functions/link.function.d.ts +2 -2
- package/dist/src/fabric/functions/llm-key.function.d.ts +6 -6
- package/dist/src/fabric/functions/login.function.d.ts +2 -2
- package/dist/src/fabric/functions/logs.function.d.ts +2 -2
- package/dist/src/fabric/functions/metrics.function.d.ts +2 -2
- package/dist/src/fabric/functions/publish.function.d.ts +2 -2
- package/dist/src/fabric/functions/rollback.function.d.ts +2 -2
- package/dist/src/fabric/functions/secrets-list.function.d.ts +2 -2
- package/dist/src/fabric/functions/secrets-set.function.d.ts +2 -2
- package/dist/src/fabric/functions/smoke.function.d.ts +2 -2
- package/dist/src/fabric/functions/status.function.d.ts +2 -2
- package/dist/src/fabric/functions/trace.function.d.ts +2 -2
- package/dist/src/fabric/functions/validate.function.d.ts +2 -2
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/audit.d.ts +1 -1
- package/dist/src/functions/commands/binary.d.ts +2 -2
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +3 -0
- package/dist/src/functions/commands/db-audit.d.ts +1 -1
- package/dist/src/functions/commands/db-generate.d.ts +1 -1
- package/dist/src/functions/commands/db-migrate.d.ts +1 -1
- package/dist/src/functions/commands/db-reset.d.ts +1 -1
- package/dist/src/functions/commands/db-seed.d.ts +1 -1
- package/dist/src/functions/commands/deploy-apply.d.ts +2 -2
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/deploy-plan.d.ts +2 -2
- package/dist/src/functions/commands/dev.d.ts +2 -2
- package/dist/src/functions/commands/dev.js +14 -3
- package/dist/src/functions/commands/emails-init.d.ts +1 -1
- package/dist/src/functions/commands/enable.d.ts +8 -7
- package/dist/src/functions/commands/enable.js +10 -5
- package/dist/src/functions/commands/import-n8n.d.ts +10 -0
- package/dist/src/functions/commands/import-n8n.js +130 -0
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/info.js +0 -13
- package/dist/src/functions/commands/login.d.ts +5 -5
- package/dist/src/functions/commands/meta.d.ts +25 -25
- package/dist/src/functions/commands/new-addon.d.ts +13 -2
- package/dist/src/functions/commands/new-addon.js +71 -39
- package/dist/src/functions/commands/new-function.d.ts +2 -2
- package/dist/src/functions/commands/new-middleware.d.ts +2 -2
- package/dist/src/functions/commands/new-permission.d.ts +2 -2
- package/dist/src/functions/commands/new-wiring.d.ts +2 -2
- package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-bootstrap.js +6 -0
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/scenario.d.ts +3 -3
- package/dist/src/functions/commands/scopes-audit.d.ts +1 -0
- package/dist/src/functions/commands/scopes-audit.js +37 -0
- package/dist/src/functions/commands/scopes-prune.d.ts +14 -0
- package/dist/src/functions/commands/scopes-prune.js +50 -0
- package/dist/src/functions/commands/scopes-shared.d.ts +39 -0
- package/dist/src/functions/commands/scopes-shared.js +83 -0
- package/dist/src/functions/commands/serve.d.ts +2 -2
- package/dist/src/functions/commands/serve.js +4 -2
- package/dist/src/functions/commands/skills.d.ts +4 -4
- package/dist/src/functions/commands/skills.js +18 -10
- package/dist/src/functions/commands/versions-check.d.ts +1 -1
- package/dist/src/functions/commands/versions-init.d.ts +2 -2
- package/dist/src/functions/commands/versions-update.d.ts +1 -1
- package/dist/src/functions/commands/watch.d.ts +2 -2
- package/dist/src/functions/commands/workspace-validate.d.ts +2 -2
- package/dist/src/functions/runtimes/fetch/index.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -1
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -1
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.js +3 -2
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/serialize-ai-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/serialize-ai-agent-types.js +4 -2
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +55 -16
- package/dist/src/functions/wirings/auth/pikku-command-auth.d.ts +2 -2
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-node-types.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
- package/dist/src/functions/wirings/console/serialize-console-functions.js +6 -0
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +22 -0
- package/dist/src/functions/wirings/emails/pikku-command-emails.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +2 -2
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types.d.ts +2 -2
- package/dist/src/functions/wirings/functions/pikku-command-function-types.js +2 -2
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +2 -2
- package/dist/src/functions/wirings/functions/pikku-command-services.js +9 -2
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +37 -28
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.js +6 -2
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
- package/dist/src/functions/wirings/graph/pikku-command-graph-wirings.d.ts +1 -0
- package/dist/src/functions/wirings/graph/pikku-command-graph-wirings.js +21 -0
- package/dist/src/functions/wirings/graph/serialize-graph-wirings.d.ts +5 -0
- package/dist/src/functions/wirings/graph/serialize-graph-wirings.js +14 -0
- package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/serialize-http-types.js +2 -30
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.d.ts +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -1
- package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +3 -2
- package/dist/src/functions/wirings/package/pikku-command-package-types.js +14 -1
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/package/serialize-package-types.d.ts +1 -0
- package/dist/src/functions/wirings/package/serialize-package-types.js +5 -0
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.js +1 -3
- package/dist/src/functions/wirings/permissions/serialize-permissions-imports.d.ts +6 -1
- package/dist/src/functions/wirings/permissions/serialize-permissions-imports.js +7 -64
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-react-query.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +7 -2
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.js +20 -0
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.d.ts +1 -0
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +8 -3
- package/dist/src/functions/wirings/scenarios/pikku-command-scenario-functions.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.d.ts +1 -1
- package/dist/src/functions/wirings/scopes/pikku-command-scopes.d.ts +7 -0
- package/dist/src/functions/wirings/scopes/pikku-command-scopes.js +34 -0
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.d.ts +15 -0
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +86 -0
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +13 -0
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +2 -2
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.d.ts +1 -1
- package/dist/src/functions/wirings/variables/pikku-command-variables.d.ts +1 -1
- package/dist/src/functions/wirings/variables/serialize-variables-types.js +15 -2
- package/dist/src/functions/wirings/webhook/pikku-command-webhook.d.ts +1 -0
- package/dist/src/functions/wirings/webhook/pikku-command-webhook.js +25 -0
- package/dist/src/functions/wirings/webhook/serialize-webhook.d.ts +14 -0
- package/dist/src/functions/wirings/webhook/serialize-webhook.js +34 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +2 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +29 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +11 -2
- package/dist/src/functions/workflows/all.workflow.js +23 -3
- package/dist/src/services.d.ts +1 -0
- package/dist/src/services.js +1 -0
- package/dist/src/utils/pikku-cli-config.js +20 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/skills/pikku-addon/SKILL.md +7 -3
- package/skills/pikku-ai-agent/SKILL.md +9 -6
- package/skills/pikku-ai-vercel/SKILL.md +6 -3
- package/skills/pikku-ai-voice/SKILL.md +6 -3
- package/skills/pikku-audit/SKILL.md +10 -3
- package/skills/pikku-aws/SKILL.md +9 -5
- package/skills/pikku-backblaze/SKILL.md +4 -3
- package/skills/pikku-better-auth/SKILL.md +10 -5
- package/skills/pikku-cli/SKILL.md +6 -3
- package/skills/pikku-concepts/SKILL.md +9 -4
- package/skills/pikku-concepts/references/concept-mapping.md +12 -10
- package/skills/pikku-config/SKILL.md +9 -5
- package/skills/pikku-cron/SKILL.md +6 -3
- package/skills/pikku-deploy-azure/SKILL.md +5 -3
- package/skills/pikku-deploy-cloudflare/SKILL.md +5 -3
- package/skills/pikku-deploy-express/SKILL.md +6 -3
- package/skills/pikku-deploy-fastify/SKILL.md +6 -3
- package/skills/pikku-deploy-lambda/SKILL.md +6 -3
- package/skills/pikku-deploy-nextjs/SKILL.md +5 -3
- package/skills/pikku-deploy-uws/SKILL.md +7 -4
- package/skills/pikku-deps/SKILL.md +13 -6
- package/skills/pikku-emails/SKILL.md +10 -5
- package/skills/pikku-feature/SKILL.md +1 -1
- package/skills/pikku-gateway-slack/SKILL.md +6 -3
- package/skills/pikku-http/SKILL.md +15 -21
- package/skills/pikku-http/references/http-options.md +0 -2
- package/skills/pikku-info/SKILL.md +9 -4
- package/skills/pikku-jose/SKILL.md +6 -3
- package/skills/pikku-kysely/SKILL.md +13 -5
- package/skills/pikku-machine-auth/SKILL.md +9 -3
- package/skills/pikku-mcp/SKILL.md +7 -3
- package/skills/pikku-middleware/SKILL.md +11 -6
- package/skills/pikku-mongodb/SKILL.md +8 -5
- package/skills/pikku-n8n-import/SKILL.md +109 -0
- package/skills/pikku-n8n-import/SPEC.md +84 -0
- package/skills/pikku-n8n-import/references/addon-mapping.md +121 -0
- package/skills/pikku-n8n-import/references/code-translation.md +121 -0
- package/skills/pikku-n8n-import/references/loops-and-control.md +87 -0
- package/skills/pikku-permissions/SKILL.md +26 -15
- package/skills/pikku-pino/SKILL.md +5 -3
- package/skills/pikku-product-second-opinion/README.md +43 -0
- package/skills/pikku-product-second-opinion/SKILL.md +158 -0
- package/skills/pikku-product-second-opinion/example/sample-report.md +90 -0
- package/skills/pikku-product-second-opinion/references/report-template.md +73 -0
- package/skills/pikku-queue/SKILL.md +7 -4
- package/skills/pikku-redis/SKILL.md +9 -6
- package/skills/pikku-rpc/SKILL.md +7 -4
- package/skills/pikku-rtl/SKILL.md +1 -1
- package/skills/pikku-scenario/SKILL.md +215 -0
- package/skills/pikku-schedule/SKILL.md +6 -3
- package/skills/pikku-schema-ajv/SKILL.md +5 -3
- package/skills/pikku-schema-cfworker/SKILL.md +6 -3
- package/skills/pikku-security/SKILL.md +8 -4
- package/skills/pikku-services/SKILL.md +42 -4
- package/skills/pikku-software-archaeology/README.md +70 -0
- package/skills/pikku-software-archaeology/SKILL.md +186 -0
- package/skills/pikku-software-archaeology/references/blueprint.schema.json +625 -0
- package/skills/pikku-software-archaeology/references/pikku-mapping.md +49 -0
- package/skills/pikku-software-archaeology/scripts/validate.mjs +173 -0
- package/skills/pikku-template-clone/SKILL.md +1 -1
- package/skills/pikku-trigger/SKILL.md +7 -3
- package/skills/pikku-versioning/SKILL.md +7 -3
- package/skills/pikku-websocket/SKILL.md +8 -4
- package/skills/pikku-workflow/SKILL.md +7 -3
- package/skills/pikku-ws/SKILL.md +5 -3
- package/console-app/assets/index-DwyRdRuZ.css +0 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.d.ts +0 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +0 -6
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.json +0 -26
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +0 -4
- package/dist/.pikku/http/pikku-http-wirings.gen.js +0 -5
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.d.ts +0 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +0 -6
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +0 -10
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +0 -4
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +0 -5
- package/dist/.pikku/schemas/schemas/RemoteRPCHandlerInput.schema.json +0 -1
- package/dist/src/scaffold/rpc-remote.gen.d.ts +0 -10
- package/dist/src/scaffold/rpc-remote.gen.js +0 -27
- package/skills/pikku-n8n-addon-map/SKILL.md +0 -178
- package/skills/pikku-n8n-code-translate/SKILL.md +0 -166
- package/skills/pikku-testing/SKILL.md +0 -328
- package/skills/pikku-testing/references/cucumber-bdd-testing.md +0 -176
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pikku-kysely
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
description: >-
|
|
4
|
+
Use when WRITING KYSELY QUERIES (select/join/aggregate/insert/update/delete) inside a Pikku
|
|
5
|
+
function body, or when setting up SQL database services with Kysely. Covers the query builder
|
|
6
|
+
API (joins, aggregates + groupBy/having, returning, sql template, expression builder, $if,
|
|
7
|
+
transactions, jsonArrayFrom relation helpers) AND @pikku/kysely service setup (channel stores,
|
|
8
|
+
workflow services, secret services, AI storage, deployment services). TRIGGER when: writing any
|
|
9
|
+
non-trivial kysely query (a join, an aggregate/count/sum, groupBy, subquery, transaction, or
|
|
10
|
+
conditional query), the injected `kysely` service is used in a function body, or code uses
|
|
11
|
+
PikkuKysely, KyselyChannelStore, KyselyWorkflowService, KyselySecretService, or the user asks
|
|
12
|
+
about SQL setup with Pikku. DO NOT TRIGGER when: user asks about MongoDB (use pikku-mongodb) or
|
|
13
|
+
Redis (use pikku-redis).
|
|
6
14
|
installGroups: [core]
|
|
7
15
|
---
|
|
8
16
|
|
|
@@ -156,8 +164,8 @@ const secrets = new PgKyselySecretService(db.kysely, {
|
|
|
156
164
|
})
|
|
157
165
|
await secrets.init()
|
|
158
166
|
|
|
159
|
-
await secrets.
|
|
160
|
-
const value = await secrets.
|
|
167
|
+
await secrets.setSecret('api-key', { key: 'sk-...' })
|
|
168
|
+
const value = await secrets.getSecret<{ key: string }>('api-key')
|
|
161
169
|
await secrets.rotateKEK() // Re-encrypt all secrets with new KEK
|
|
162
170
|
```
|
|
163
171
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pikku-machine-auth
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
description: >-
|
|
4
|
+
Use when authenticating a CLI/agent/service against a Pikku server, adding machine-to-machine
|
|
5
|
+
(M2M) auth, issuing scoped API keys for sandboxes/agents/workers, or wiring better-auth sessions
|
|
6
|
+
into Pikku middleware. Covers `pikku login` (device-authorization), the better-auth API Key
|
|
7
|
+
plugin, machine identities, and `betterAuthSession` with the api-key branch. TRIGGER when: user
|
|
8
|
+
asks about CLI login, `pikku login`, machine agents, service-to-service auth, API keys, client
|
|
9
|
+
credentials, sandbox/worker tokens, or resolving a better-auth session in a Pikku function. DO
|
|
10
|
+
NOT TRIGGER when: user asks about end-user HTTP session/cookie auth only (use pikku-http + the
|
|
11
|
+
app betterAuth config) or about WebSocket channel mechanics (use pikku-websocket).
|
|
6
12
|
---
|
|
7
13
|
|
|
8
14
|
# Pikku Machine Auth
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pikku-mcp
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
description: >-
|
|
4
|
+
Use when exposing Pikku functions as MCP tools, resources, or prompts for AI assistants. Covers
|
|
5
|
+
mcp: true flag, pikkuMCPResourceFunc, pikkuMCPPromptFunc, and MCP wire object. TRIGGER when:
|
|
6
|
+
code uses mcp: true or pikkuMCPResourceFunc/pikkuMCPPromptFunc, user asks about MCP, Model
|
|
7
|
+
Context Protocol, AI tool integration, or exposing functions to Claude/ChatGPT. DO NOT TRIGGER
|
|
8
|
+
when: user asks about AI agents (use pikku-ai-agent) or general function definitions (use
|
|
9
|
+
pikku-concepts).
|
|
6
10
|
installGroups: [core]
|
|
7
11
|
---
|
|
8
12
|
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pikku-middleware
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
description: >-
|
|
4
|
+
Use when adding any middleware to a Pikku app — global HTTP middleware, tag-scoped middleware
|
|
5
|
+
(including service-to-service bearer auth), per-route middleware, session-setting middleware, or
|
|
6
|
+
understanding middleware execution order and priority. TRIGGER when: user wants middleware on
|
|
7
|
+
some or all routes, machine-to-machine auth, tag-scoped cross-cutting concerns, global
|
|
8
|
+
interceptors, or middleware priority/order questions. DO NOT TRIGGER when: user asks about
|
|
9
|
+
permissions/authorization checks (use pikku-permissions), auth strategies like
|
|
10
|
+
authBearer/authCookie (use pikku-security), or deployment.
|
|
6
11
|
installGroups: [core]
|
|
7
12
|
---
|
|
8
13
|
|
|
@@ -13,7 +18,7 @@ installGroups: [core]
|
|
|
13
18
|
1. Discover before editing. Run `pikku info middleware --verbose` and `pikku info tags --json` to understand the existing middleware and tag landscape.
|
|
14
19
|
2. Identify the source files that own the behavior — wirings files, not generated output.
|
|
15
20
|
3. Register middleware at module load time — in a `wirings/*.ts` file, never inside a function body.
|
|
16
|
-
4. Validate: run `pikku all` after adding or changing middleware
|
|
21
|
+
4. Validate: run `pikku all --tsc` after adding or changing middleware — it regenerates and then confirms type safety in one pass.
|
|
17
22
|
|
|
18
23
|
## The `pikkuMiddleware` Factory
|
|
19
24
|
|
|
@@ -221,6 +226,6 @@ export const myFunc = pikkuSessionlessFunc({
|
|
|
221
226
|
## After Changes
|
|
222
227
|
|
|
223
228
|
```bash
|
|
224
|
-
pikku all
|
|
225
|
-
pikku tsc # type-check
|
|
229
|
+
pikku all # regenerate metadata so new tags are picked up
|
|
230
|
+
pikku all --tsc # regenerate, then type-check (fails on type errors)
|
|
226
231
|
```
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pikku-mongodb
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
description: >-
|
|
4
|
+
Use when setting up MongoDB database services in a Pikku app. Covers PikkuMongoDB connection,
|
|
5
|
+
channel stores, workflow services, secret services, AI storage, agent runs, and deployment
|
|
6
|
+
services. TRIGGER when: code uses PikkuMongoDB, MongoDBChannelStore, MongoDBWorkflowService,
|
|
7
|
+
MongoDBSecretService, or user asks about MongoDB setup with Pikku. DO NOT TRIGGER when: user
|
|
8
|
+
asks about SQL databases (use pikku-kysely) or Redis (use pikku-redis).
|
|
6
9
|
---
|
|
7
10
|
|
|
8
11
|
# Pikku MongoDB
|
|
@@ -70,8 +73,8 @@ const secrets = new MongoDBSecretService(mongo.db, {
|
|
|
70
73
|
})
|
|
71
74
|
await secrets.init()
|
|
72
75
|
|
|
73
|
-
await secrets.
|
|
74
|
-
const value = await secrets.
|
|
76
|
+
await secrets.setSecret('api-key', { key: 'sk-...' })
|
|
77
|
+
const value = await secrets.getSecret<{ key: string }>('api-key')
|
|
75
78
|
await secrets.rotateKEK()
|
|
76
79
|
```
|
|
77
80
|
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-n8n-import
|
|
3
|
+
description: 'Use to import an n8n workflow JSON export into a runnable Pikku workflow. Triggers when the user says "import this n8n workflow", "convert this n8n export to pikku", points at an n8n `.json` export or a directory of them, or picks up after `pikku import n8n` left throwing stub functions (`STUB — generated from n8n …`, `— implement me`) or a `<workflow>.integrations.json` manifest. Owns the whole flow: run the importer, triage what it could not map, fill each stub, report any missing `@pikku/addon-*` integrations, and verify the result compiles and runs with no surviving stubs. DO NOT TRIGGER for hand-written addon wiring unrelated to an n8n import (use pikku-addon), or for authoring workflows from scratch (use pikku-workflow).'
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# n8n → Pikku Import
|
|
9
|
+
|
|
10
|
+
Take an n8n export all the way to a compiling, stub-free Pikku workflow. The
|
|
11
|
+
`@pikku/n8n-import` package (invoked by `pikku import n8n`) is **frozen**: it does
|
|
12
|
+
the provable, mechanical conversion and leaves everything it cannot prove as a
|
|
13
|
+
typed stub that throws at runtime. This skill runs that package, then fills the
|
|
14
|
+
remainder with judgment, reports what needs a human decision, and verifies.
|
|
15
|
+
|
|
16
|
+
Never re-do what the importer already did, and never hand-edit generated files to
|
|
17
|
+
paper over a stub — fix the source cause (the stub function, the graph node, or a
|
|
18
|
+
missing dependency).
|
|
19
|
+
|
|
20
|
+
## Agent Operating Procedure
|
|
21
|
+
|
|
22
|
+
1. Discover before editing. Prefer `pikku-meta`/`pikku meta ... --json` when
|
|
23
|
+
available; inspect only the focused output you need.
|
|
24
|
+
2. Identify the source file that owns the behavior. Do not start from generated
|
|
25
|
+
output, `.pikku`, `node_modules`, or vendored packages.
|
|
26
|
+
3. Make the smallest source change that satisfies the task. Keep generated files
|
|
27
|
+
generated.
|
|
28
|
+
4. Validate with the narrowest relevant command first, then `pikku all` /
|
|
29
|
+
`pikku-verify` when functions, wirings, or schemas changed.
|
|
30
|
+
5. If validation fails, fix the source cause and rerun. Never edit generated
|
|
31
|
+
files to hide an error.
|
|
32
|
+
|
|
33
|
+
## Workflow
|
|
34
|
+
|
|
35
|
+
### 1 — Run the importer (do as much as possible, cheaply)
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pikku import n8n <export.json> [outDir]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
It writes `<slug>.graph.ts` (+ `.agent.ts` for AI workflows), `<slug>.addons.gen.ts`,
|
|
42
|
+
a `<slug>.integrations.json` manifest, and one stub function per node it could not
|
|
43
|
+
map. It **exits 1** on an un-importable input (a cross-workflow sub-workflow
|
|
44
|
+
reference, a dynamic workflow target, a mid-flow `respondToWebhook`) with a
|
|
45
|
+
`[reason] message` — relay that to the user; do not fake a partial scaffold.
|
|
46
|
+
|
|
47
|
+
For a directory of exports, run it per file.
|
|
48
|
+
|
|
49
|
+
### 2 — Triage what it left
|
|
50
|
+
|
|
51
|
+
Every unmapped node is a stub that throws `… — implement me`. Classify each by its
|
|
52
|
+
JSDoc marker and route to the matching reference:
|
|
53
|
+
|
|
54
|
+
| Stub marker / signal | Handle via |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `STUB — generated from n8n node "…" (type "n8n-nodes-base.<svc>…")` | `references/addon-mapping.md` |
|
|
57
|
+
| `STUB — generated from n8n Code node "…"` | `references/code-translation.md` |
|
|
58
|
+
| A `control` stub — Loop Over Items / **splitInBatches**, Switch expr-mode | `references/loops-and-control.md` |
|
|
59
|
+
| `STUB — … vector-store … #902` | rare now (RAG ships as `<store>:query`/`:ingest`); a residual one = an unmapped store → report it, don't guess |
|
|
60
|
+
| Importer `diagnostics` (already exited 1) | explain the reason; the workflow is un-importable as-is |
|
|
61
|
+
|
|
62
|
+
Read a reference file only when you actually hit that stub class.
|
|
63
|
+
|
|
64
|
+
### 3 — Fill each stub
|
|
65
|
+
|
|
66
|
+
Work the manifest + stub files per the routed reference. The mechanical classes
|
|
67
|
+
(addon, code) are near-deterministic; the loop/control class needs judgment
|
|
68
|
+
(map vs reduce, done-branch semantics) — reference `loops-and-control.md` tells you
|
|
69
|
+
when to decide vs ask.
|
|
70
|
+
|
|
71
|
+
### 4 — Report missing integrations (first-class output)
|
|
72
|
+
|
|
73
|
+
An addon stub can only be wired to an **installed** `@pikku/addon-*`. When the
|
|
74
|
+
package for an n8n service is not in `dependencies`, do not guess a lookalike —
|
|
75
|
+
collect it. Give the user one upfront list:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
Missing integrations — install these or the nodes stay stubs:
|
|
79
|
+
• slackTool "Post to channel" → npm i @pikku/addon-chat-slack
|
|
80
|
+
• hubspot "Create contact" → no @pikku/addon-hubspot exists yet
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 5 — Verify it works
|
|
84
|
+
|
|
85
|
+
1. `pikku all` (regenerate) → `yarn tsc` from the package root; fix the source
|
|
86
|
+
cause of any error and rerun.
|
|
87
|
+
2. Grep the emitted functions for any surviving `— implement me`
|
|
88
|
+
/ `throw new Error('Stub:`. **Any survivor means the import is not done** —
|
|
89
|
+
list them by node name.
|
|
90
|
+
3. Green tsc **and** zero surviving stubs = success.
|
|
91
|
+
|
|
92
|
+
## References
|
|
93
|
+
|
|
94
|
+
| Open when you need to… | Read |
|
|
95
|
+
|---|---|
|
|
96
|
+
| map an integration stub (gmailTool, slackTool, googleSheets, plain action nodes) to an installed addon `ref(...)` | `references/addon-mapping.md` |
|
|
97
|
+
| translate an n8n Code node body into a Pikku function body | `references/code-translation.md` |
|
|
98
|
+
| lower a Loop Over Items / splitInBatches loop, or a Switch that stayed a stub | `references/loops-and-control.md` |
|
|
99
|
+
|
|
100
|
+
## Final summary
|
|
101
|
+
|
|
102
|
+
Report, terse:
|
|
103
|
+
|
|
104
|
+
- Files written and workflow shape (`pure-graph` / `agent`).
|
|
105
|
+
- Stubs filled, by class.
|
|
106
|
+
- **Missing integrations** (the step-4 list) — the thing the user must act on.
|
|
107
|
+
- Anything left as a `// TODO:` and why (credentials to wire, a loop deferred, an
|
|
108
|
+
unmapped store).
|
|
109
|
+
- Verification: `tsc` status + surviving-stub count (must be 0).
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# n8n → Pikku Import Specification
|
|
2
|
+
|
|
3
|
+
## Intent
|
|
4
|
+
|
|
5
|
+
Take an n8n workflow JSON export all the way to a compiling, stub-free, runnable
|
|
6
|
+
Pikku workflow. The `@pikku/n8n-import` package is treated as **frozen**: it does
|
|
7
|
+
the provable mechanical conversion and leaves everything it cannot prove as a typed,
|
|
8
|
+
throwing stub. This skill owns the end-to-end flow around it — run it, fill the
|
|
9
|
+
remainder with judgment, report gaps that need a human decision, and verify.
|
|
10
|
+
|
|
11
|
+
## Scope
|
|
12
|
+
|
|
13
|
+
In scope:
|
|
14
|
+
- Running `pikku import n8n` and triaging its output.
|
|
15
|
+
- Filling integration stubs (→ addon refs), Code stubs (→ function bodies), and
|
|
16
|
+
loop/control stubs (→ `graph:map`/reduce/branch).
|
|
17
|
+
- Reporting missing `@pikku/addon-*` integrations as a first-class output.
|
|
18
|
+
- Verifying via `pikku all` + `tsc` + a zero-surviving-stub check.
|
|
19
|
+
|
|
20
|
+
Out of scope:
|
|
21
|
+
- Extending `@pikku/n8n-import` itself (it is frozen; do not add per-service tables
|
|
22
|
+
or new compiler rules to it).
|
|
23
|
+
- Authoring workflows from scratch (`pikku-workflow`) or hand-written addon wiring
|
|
24
|
+
unrelated to an import (`pikku-addon`).
|
|
25
|
+
- Inventing batching primitives or guessing ambiguous loop semantics — surface them.
|
|
26
|
+
|
|
27
|
+
## Users And Trigger Context
|
|
28
|
+
|
|
29
|
+
- Primary users: developers importing their own n8n workflows into a Pikku app,
|
|
30
|
+
usually inside an agentic session.
|
|
31
|
+
- Common requests: "import this n8n workflow", "convert this n8n export to pikku",
|
|
32
|
+
finishing `— implement me` stubs, wiring a `*.integrations.json` manifest.
|
|
33
|
+
- Should not trigger for: from-scratch workflow authoring, or addon wiring with no
|
|
34
|
+
n8n import involved.
|
|
35
|
+
|
|
36
|
+
## Runtime Contract
|
|
37
|
+
|
|
38
|
+
- Required first action: run `pikku import n8n <export.json> [outDir]` (per file for
|
|
39
|
+
a directory); relay any exit-1 diagnostic instead of scaffolding a partial.
|
|
40
|
+
- Required outputs: filled stubs, a missing-integrations list, verification status.
|
|
41
|
+
- Non-negotiable: never hand-edit generated files to hide a stub; map only to
|
|
42
|
+
installed addons; zero surviving `— implement me` stubs at success.
|
|
43
|
+
- Bundled files loaded at runtime: `references/addon-mapping.md`,
|
|
44
|
+
`references/code-translation.md`, `references/loops-and-control.md` — each only
|
|
45
|
+
when its stub class appears.
|
|
46
|
+
|
|
47
|
+
## Source And Evidence Model
|
|
48
|
+
|
|
49
|
+
Authoritative sources:
|
|
50
|
+
- `@pikku/n8n-import` codegen (stub markers, manifest shape, `import-n8n` command).
|
|
51
|
+
- `@pikku/addon-graph` function contracts (`graph:map`/`fanout`, `branch`).
|
|
52
|
+
- Installed `@pikku/addon-*` source (function names verified by grep, never guessed).
|
|
53
|
+
|
|
54
|
+
Useful improvement sources: real imported workflows, harness coverage deltas,
|
|
55
|
+
addon catalogue changes.
|
|
56
|
+
|
|
57
|
+
Data that must not be stored: credential secrets, customer data, private ids beyond
|
|
58
|
+
what a manifest already records for reproduction.
|
|
59
|
+
|
|
60
|
+
## Reference Architecture
|
|
61
|
+
|
|
62
|
+
- `SKILL.md`: the run → triage → fill → report → verify workflow + router.
|
|
63
|
+
- `references/`: per-stub-class depth (addon mapping, code translation, loops/control).
|
|
64
|
+
|
|
65
|
+
## Validation
|
|
66
|
+
|
|
67
|
+
- Lightweight: `yarn tsc` from the package root after each fill.
|
|
68
|
+
- Deeper: `pikku all` regeneration; grep emitted functions for surviving stub throws.
|
|
69
|
+
- Acceptance gates: green tsc **and** zero surviving `— implement me` stubs.
|
|
70
|
+
|
|
71
|
+
## Known Limitations
|
|
72
|
+
|
|
73
|
+
- `splitInBatches` with `batchSize > 1` and reduce-style accumulators have no direct
|
|
74
|
+
primitive — surfaced, not auto-converted.
|
|
75
|
+
- Missing addons block their nodes; the skill reports, it does not install.
|
|
76
|
+
- Cross-workflow sub-workflow references fail import at the package level.
|
|
77
|
+
|
|
78
|
+
## Maintenance Notes
|
|
79
|
+
|
|
80
|
+
- Update `SKILL.md` when the import command, stub taxonomy, or verify gates change.
|
|
81
|
+
- Update a reference when an addon convention, the `graph:map` contract, or a rubric
|
|
82
|
+
changes.
|
|
83
|
+
- This skill supersedes the former `pikku-n8n-addon-map` and `pikku-n8n-code-translate`
|
|
84
|
+
skills (folded into `references/addon-mapping.md` and `references/code-translation.md`).
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Integration stub → Pikku addon
|
|
2
|
+
|
|
3
|
+
Translate n8n integration nodes (`gmailTool`, `slackTool`, `googleSheetsTool`, plain
|
|
4
|
+
`gmail` / `slack` action nodes, etc.) that the importer left as throwing stubs into
|
|
5
|
+
real `ref('<addonRpc>')` references pointing at functions in **installed**
|
|
6
|
+
`@pikku/addon-*` packages.
|
|
7
|
+
|
|
8
|
+
This is **per-stub mechanical**. Do not invent business logic, chain calls, or
|
|
9
|
+
"improve" the workflow. Read one manifest entry, find the matching addon function,
|
|
10
|
+
rewrite the stub.
|
|
11
|
+
|
|
12
|
+
## Inputs
|
|
13
|
+
|
|
14
|
+
1. **Manifest** — `<workflow>.integrations.json` next to the `.graph.ts`. Each entry:
|
|
15
|
+
```jsonc
|
|
16
|
+
{
|
|
17
|
+
"rpcName": "agentGmailtool__sendAMessageInGmail",
|
|
18
|
+
"n8nType": "n8n-nodes-base.gmailTool",
|
|
19
|
+
"n8nName": "Send a message in Gmail",
|
|
20
|
+
"parameters": { "sendTo": "...", "message": "...", "subject": "..." },
|
|
21
|
+
"credentials": { "gmailOAuth2": { "id": "...", "name": "Personal Gmail" } },
|
|
22
|
+
"isAgentTool": true,
|
|
23
|
+
"agentName": "Inbox Assistant"
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
2. **Installed addons** — `@pikku/addon-*` in the project's `package.json`
|
|
27
|
+
`dependencies`. Map **only** against installed packages. If the addon for an n8n
|
|
28
|
+
type is not installed, surface it (see SKILL step 4) — never silently skip and
|
|
29
|
+
never pick a vaguely-named function from another addon.
|
|
30
|
+
|
|
31
|
+
## Per entry, in order
|
|
32
|
+
|
|
33
|
+
### Step 1 — identify the target addon
|
|
34
|
+
|
|
35
|
+
Map `n8nType` to a package by reading its source. Common shapes (**guesses, not
|
|
36
|
+
authoritative** — always verify against installed source):
|
|
37
|
+
|
|
38
|
+
| n8n type prefix | typical addon candidate |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `n8n-nodes-base.gmail` / `gmailTool` | `@pikku/addon-email-gmail` |
|
|
41
|
+
| `n8n-nodes-base.slack` / `slackTool` | `@pikku/addon-chat-slack` |
|
|
42
|
+
| `n8n-nodes-base.googleSheets` / `…Tool` | `@pikku/addon-sheets-google` |
|
|
43
|
+
| `n8n-nodes-base.notion` / `notionTool` | `@pikku/addon-docs-notion` |
|
|
44
|
+
| `n8n-nodes-base.telegram` / `telegramTool` | `@pikku/addon-chat-telegram` |
|
|
45
|
+
|
|
46
|
+
If no installed addon plausibly covers the n8n type, stop and report it — do not
|
|
47
|
+
pick a wrong addon.
|
|
48
|
+
|
|
49
|
+
### Step 2 — pick the function (resource + operation → fn name)
|
|
50
|
+
|
|
51
|
+
n8n nodes use a `(resource, operation)` pair. Rubric:
|
|
52
|
+
|
|
53
|
+
- `resource` defaults to the integration's primary noun if absent (gmail →
|
|
54
|
+
`message`, slack → `message`, sheets → `spreadsheet`). Read the addon's folder
|
|
55
|
+
structure (`messages/`, `drafts/`, `channels/`) to see what nouns exist.
|
|
56
|
+
- `operation` is usually a verb (`get`, `getAll`, `send`, `delete`, `addLabels`).
|
|
57
|
+
- The pikku function name is almost always `<resource><Verb>` in camelCase, matching
|
|
58
|
+
the file's `export const` (`messageList` for `messages/list.function.ts`).
|
|
59
|
+
|
|
60
|
+
Verify: `grep -h "^export const" <addonPkg>/src/functions/**/*.ts` and match by name.
|
|
61
|
+
Conventions in `@pikku/addon-email-gmail` (a **sanity reference**, not a fallback):
|
|
62
|
+
|
|
63
|
+
- `getAll → <resource>List`, `get → <resource>Get`, `send → <resource>Send`,
|
|
64
|
+
`delete → <resource>Delete`, `reply → <resource>Reply`
|
|
65
|
+
- `addLabels → <resource>AddLabel` (singular!), `removeLabels → <resource>RemoveLabel`
|
|
66
|
+
- `markAsRead / markAsUnread → <resource>MarkRead / <resource>MarkUnread`
|
|
67
|
+
- `create → <resource>Create`
|
|
68
|
+
|
|
69
|
+
If the function has a `node:` block, prefer matching its `category`/`displayName`
|
|
70
|
+
over guessing.
|
|
71
|
+
|
|
72
|
+
### Step 3 — rewrite the stub
|
|
73
|
+
|
|
74
|
+
Two outcomes, by `isAgentTool`:
|
|
75
|
+
|
|
76
|
+
**A) `isAgentTool: true`** — the stub is an agent tool referenced via `ref()`:
|
|
77
|
+
1. Delete the stub file.
|
|
78
|
+
2. In the agent file, replace `ref('agentGmailtool__sendAMessageInGmail')` in
|
|
79
|
+
`tools: [...]` with `ref('messageSend')` (the resolved addon function).
|
|
80
|
+
3. Ensure the addon is where pikku scans functions (usually automatic via
|
|
81
|
+
`node_modules/@pikku/addon-*`).
|
|
82
|
+
|
|
83
|
+
If you can't delete safely, leave a one-line re-export instead of a stub:
|
|
84
|
+
```ts
|
|
85
|
+
import { messageSend } from '@pikku/addon-email-gmail'
|
|
86
|
+
export const agentGmailtool__sendAMessageInGmail = messageSend
|
|
87
|
+
```
|
|
88
|
+
Default is delete + retarget; wrappers add maintenance burden.
|
|
89
|
+
|
|
90
|
+
**B) `isAgentTool: false`** — the stub is a graph node:
|
|
91
|
+
1. Open `<workflow>.graph.ts`.
|
|
92
|
+
2. In `nodes: { … }` find the entry whose value is the stub rpc name.
|
|
93
|
+
3. Replace it with the addon function name (`'messageSend'`).
|
|
94
|
+
4. If `config: { <id>: { input } }` produces an `{ items }` envelope, rewrite it to
|
|
95
|
+
the addon function's real input schema (read its `input: z.object({...})`).
|
|
96
|
+
5. Delete the stub file.
|
|
97
|
+
|
|
98
|
+
### Step 4 — port hard-coded parameters
|
|
99
|
+
|
|
100
|
+
- **Hardcoded values** (`"limit": 20`, `"labelIds": ["INBOX"]`) were user choices.
|
|
101
|
+
Preserve them in the graph node's `input` (case B). **Agent tools cannot carry
|
|
102
|
+
hardcoded params** (the LLM fills args at call time) — surface the trade-off; if
|
|
103
|
+
the user needs a value pinned, they keep a thin wrapper.
|
|
104
|
+
- **`$fromAI('Name', '', 'string')`** placeholders are LLM-filled — the addon's Zod
|
|
105
|
+
schema becomes the tool schema. Just drop the placeholder string; no other action.
|
|
106
|
+
|
|
107
|
+
### Step 5 — credentials
|
|
108
|
+
|
|
109
|
+
`credentials: { gmailOAuth2: { id, name } }` is the n8n credential ref. Pikku addons
|
|
110
|
+
expect a wired service (`services.gmail`). Do **not** auto-wire — leave a TODO:
|
|
111
|
+
|
|
112
|
+
> `// TODO: wire services.gmail using credential "Personal Gmail" (n8n id: gmail_cred_1) — see @pikku/addon-email-gmail/README.md`
|
|
113
|
+
|
|
114
|
+
## Never
|
|
115
|
+
|
|
116
|
+
- Invent functions that don't exist — grep first.
|
|
117
|
+
- Pick a wrong addon because the right one isn't installed — report `npm i @pikku/addon-<x>`.
|
|
118
|
+
- Bake per-mapping tables into `@pikku/n8n-import` — it is addon-agnostic; mapping lives here.
|
|
119
|
+
- Modify the manifest — it's an audit artifact.
|
|
120
|
+
- Chain calls — each entry maps to exactly one addon function.
|
|
121
|
+
- Silently drop a hardcoded param — surface it.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# n8n Code node → Pikku function
|
|
2
|
+
|
|
3
|
+
Replace a Code-node stub's `throw new Error(...)` body with a faithful TypeScript
|
|
4
|
+
reimplementation. The original JS is preserved verbatim in the JSDoc above the
|
|
5
|
+
function. Keep the signature and JSDoc intact; only widen the Zod input/output if
|
|
6
|
+
the code's data shape demands it.
|
|
7
|
+
|
|
8
|
+
**Narrow, mechanical translation** — behavioral parity, not better code. Do not
|
|
9
|
+
refactor, add error handling, or invent fields.
|
|
10
|
+
|
|
11
|
+
## Process
|
|
12
|
+
|
|
13
|
+
1. **Read the file.** Identify the input schema, output schema, the verbatim JS in
|
|
14
|
+
the JSDoc, and the `pikkuSessionlessFunc` shape.
|
|
15
|
+
2. **Determine the n8n mode** from the original JSON if available (importer leaves it
|
|
16
|
+
in `fixtures/`, or ask). Two modes:
|
|
17
|
+
- `runOnceForAllItems` (default) — code runs once with `items: Array<{ json, binary, pairedItem }>`, returns an array of envelopes.
|
|
18
|
+
- `runOnceForEachItem` — runs once per item, `$json` / `$input.item.json` in scope, returns a single envelope.
|
|
19
|
+
- If unknown, infer: bare `items.X` → all-items; bare `$json.X` / `$input.item.X` → each-item.
|
|
20
|
+
3. **Apply the rubric.**
|
|
21
|
+
4. **Edit only the function body.** Leave imports, schemas, JSDoc, name, description, refs untouched unless step 5 forces it.
|
|
22
|
+
5. **If the schemas are wrong** (code reads `$json.userId: string` but input is `items: z.array(z.unknown())`), tighten with the smallest change. Prefer `z.unknown()` over `z.any()`. Never widen output to `z.any()`.
|
|
23
|
+
6. **Add one comment** at the top of the body noting the mode: `// translated from n8n Code node, mode: runOnceForAllItems`. This is the *only* comment you may add.
|
|
24
|
+
7. **Typecheck** (`yarn tsc` from the package root); fix errors with the smallest change.
|
|
25
|
+
|
|
26
|
+
## Rubric
|
|
27
|
+
|
|
28
|
+
### Envelope unwrapping — all-items mode
|
|
29
|
+
|
|
30
|
+
| n8n | Pikku |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `items` | `(data.items ?? []) as any[]` (or typed if known) |
|
|
33
|
+
| `items[i].json.X` | `items[i].X` |
|
|
34
|
+
| `items[i].json` | `items[i]` |
|
|
35
|
+
| `items[i].binary` | **NOT supported** — leave a TODO and explain |
|
|
36
|
+
| `items.length` | `items.length` |
|
|
37
|
+
| `items.map(i => i.json.X)` | `items.map((i: any) => i.X)` |
|
|
38
|
+
|
|
39
|
+
### Envelope unwrapping — each-item mode
|
|
40
|
+
|
|
41
|
+
| n8n | Pikku |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `$json.X` / `$input.item.json.X` | `data.X` (input is the item itself) |
|
|
44
|
+
| `$input.item.json` | `data` |
|
|
45
|
+
| `$input.all()` | not available per-item — change to all-items mode |
|
|
46
|
+
|
|
47
|
+
### Return statement
|
|
48
|
+
|
|
49
|
+
| n8n | Pikku |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `return [{ json: X }]` | `return { items: [X] }` |
|
|
52
|
+
| `return items.map(i => ({ json: ... }))` | `return { items: items.map(...) }` |
|
|
53
|
+
| `return [{ json: X }, { json: Y }]` | `return { items: [X, Y] }` |
|
|
54
|
+
| `return { json: X }` (each-item) | `return X` |
|
|
55
|
+
| `return [...]` (already plain) | wrap in `{ items: [...] }` only if the output schema expects it |
|
|
56
|
+
|
|
57
|
+
### Built-ins — do NOT auto-translate
|
|
58
|
+
|
|
59
|
+
If the code references any of these, **stop**, leave the body a stub, and annotate
|
|
60
|
+
`// TODO:` + explain:
|
|
61
|
+
|
|
62
|
+
- `this.helpers.*` (binary buffers, HTTP requests, prepareBinaryData)
|
|
63
|
+
- `$node['Some Node'].json` (cross-node refs — resolve via Pikku `ref()` upstream, not in the body)
|
|
64
|
+
- `$workflow`, `$execution`, `$item()`, `$items('Other Node')`
|
|
65
|
+
- `getBinaryDataBuffer` / `getStaticData` — no equivalent, TODO
|
|
66
|
+
- `require()` / dynamic `import()` — flag and stop
|
|
67
|
+
|
|
68
|
+
Translate these only when reachable: `$now`/`$today` → `new Date()`; `$env.X` →
|
|
69
|
+
`services.variables.get('X')` (never `process.env` — Pikku house rule; `services` is
|
|
70
|
+
the first param).
|
|
71
|
+
|
|
72
|
+
### Async / types
|
|
73
|
+
|
|
74
|
+
- Original uses `await` → the body is already `async`; keep every `await`.
|
|
75
|
+
- `this.helpers.httpRequest(...)` → do NOT inline; the user should use a separate
|
|
76
|
+
`httpRequest` rpc node. Leave a `// TODO:` and explain.
|
|
77
|
+
- Cast `items` as `any[]` only if the schema is `z.array(z.unknown())`; use the
|
|
78
|
+
inferred type if tightened. Never `as any` on the return — fix the schema instead.
|
|
79
|
+
|
|
80
|
+
## Example
|
|
81
|
+
|
|
82
|
+
Before (stub):
|
|
83
|
+
```ts
|
|
84
|
+
/**
|
|
85
|
+
* STUB — generated from n8n Code node "Custom Code".
|
|
86
|
+
* const total = items.reduce((acc, i) => acc + i.json.amount, 0);
|
|
87
|
+
* return [{ json: { total } }];
|
|
88
|
+
*/
|
|
89
|
+
export const codeStubCustomCode = pikkuSessionlessFunc({
|
|
90
|
+
input: CodeStubCustomCodeInput,
|
|
91
|
+
output: CodeStubCustomCodeOutput,
|
|
92
|
+
func: async (_services, _data) => {
|
|
93
|
+
throw new Error('Stub: ported from n8n Code node "Custom Code" — implement me')
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
After:
|
|
99
|
+
```ts
|
|
100
|
+
export const codeStubCustomCode = pikkuSessionlessFunc({
|
|
101
|
+
description: 'Ported from n8n Code node "Custom Code"',
|
|
102
|
+
input: CodeStubCustomCodeInput,
|
|
103
|
+
output: CodeStubCustomCodeOutput,
|
|
104
|
+
func: async (_services, data) => {
|
|
105
|
+
// translated from n8n Code node, mode: runOnceForAllItems
|
|
106
|
+
const items = (data.items ?? []) as any[]
|
|
107
|
+
const total = items.reduce((acc, i) => acc + i.amount, 0)
|
|
108
|
+
return { items: [{ total }] }
|
|
109
|
+
},
|
|
110
|
+
})
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Report
|
|
114
|
+
|
|
115
|
+
Terse: the mode you inferred (one sentence), the literal rubric translations
|
|
116
|
+
applied, anything flagged TODO and why, any schema tightening (before → after).
|
|
117
|
+
|
|
118
|
+
Do not add tests, refactor, edit other files, "improve" the logic, or add
|
|
119
|
+
try/catch unless the original did. If the code is empty, comment-only, or so
|
|
120
|
+
dependent on n8n internals that no honest translation is possible, leave the stub
|
|
121
|
+
and tell the user which n8n features block it.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Loops & control stubs
|
|
2
|
+
|
|
3
|
+
The importer maps the mechanical control flow (IF/Filter/Switch it can normalize →
|
|
4
|
+
`graph:branch`) but leaves the **semantic** cases as `control` stubs — chiefly
|
|
5
|
+
**Loop Over Items / splitInBatches** and Switch in expression mode. These need
|
|
6
|
+
judgment, which is why they are not compiled. Read the loop body and the workflow
|
|
7
|
+
around it; decide, or ask.
|
|
8
|
+
|
|
9
|
+
## Loop Over Items / splitInBatches
|
|
10
|
+
|
|
11
|
+
n8n's loop node has two outputs: **loop** (output 1, fires per batch) and **done**
|
|
12
|
+
(output 0, fires once when iteration finishes). The loop body flows from the loop
|
|
13
|
+
output back into the node — a cycle. Pikku graphs are a DAG, so **the loop becomes a
|
|
14
|
+
`graph:map`** (`@pikku/addon-graph`) and the back-edge disappears:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
theLoop: "graph:map", // (graph:fanout) — one child invocation per item
|
|
18
|
+
// config:
|
|
19
|
+
theLoop: {
|
|
20
|
+
input: (ref) => ({
|
|
21
|
+
items: ref("<predecessor>"), // what fed the loop
|
|
22
|
+
child: "<childRpc-or-subGraph>", // the loop body
|
|
23
|
+
childInput: { /* $item-rebound body input */ },
|
|
24
|
+
stepPrefix: "theLoop",
|
|
25
|
+
}),
|
|
26
|
+
next: "<done-branch target>", // output 0
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Inside `childInput`, references rebind to the current element: the body's `$json` /
|
|
31
|
+
predecessor and any `$('<loop node>')` become `$item`.
|
|
32
|
+
|
|
33
|
+
### Decide the shape first
|
|
34
|
+
|
|
35
|
+
| Loop body does… | Emit |
|
|
36
|
+
|---|---|
|
|
37
|
+
| transform each item independently (enrich, format, call one thing) | `graph:map` — child = the body |
|
|
38
|
+
| accumulate across items (running total, build one object/array) | a **reduce**: a single generated function over the whole array, not a map — `graph:map` collects per-item results and *loses* the accumulator |
|
|
39
|
+
| pure side-effect per item, nothing downstream consumes results | `graph:map` with **no `next`** (done branch empty) — the safest, unambiguous case |
|
|
40
|
+
|
|
41
|
+
### Child arity
|
|
42
|
+
|
|
43
|
+
- **Single-node body** → `child: "<that node's rpc>"`, its input as `childInput`.
|
|
44
|
+
- **Multi-node body** → the child must be a per-item **sub-graph**. Lift the body
|
|
45
|
+
into its own `pikkuWorkflowGraph` (see `pikku-workflow`) and set `child` to that
|
|
46
|
+
workflow's registered name. If the body references nodes **outside** the loop
|
|
47
|
+
(not just the item), that value has to be threaded in as `childInput` — if you
|
|
48
|
+
can't do it cleanly, stop and ask rather than emit something subtly wrong.
|
|
49
|
+
|
|
50
|
+
### Done-branch semantics (ask if it matters)
|
|
51
|
+
|
|
52
|
+
n8n's done output is version-dependent: it may carry the *original* items or the
|
|
53
|
+
*accumulated* results. `graph:map`'s `next` receives the array of child results.
|
|
54
|
+
If a downstream node reads that array's shape and the distinction matters, add:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
// TODO(n8n): done branch receives collected loop results (not original items) — confirm this matches intent
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
and call it out in your summary. When the done branch is empty, there's nothing to
|
|
61
|
+
decide.
|
|
62
|
+
|
|
63
|
+
### batchSize > 1
|
|
64
|
+
|
|
65
|
+
`graph:map` is one-item-at-a-time. A real numeric `batchSize` (chunk into groups,
|
|
66
|
+
run the body per chunk) has no direct primitive — leave the stub, and tell the user
|
|
67
|
+
this loop batches N-at-a-time and needs a manual pass (or a `graph:chunk` +
|
|
68
|
+
`graph:map` composition if the body is chunk-shaped).
|
|
69
|
+
|
|
70
|
+
## Switch / control stubs the importer couldn't normalize
|
|
71
|
+
|
|
72
|
+
A Switch in **expression mode** (routing by an arbitrary JS expression rather than
|
|
73
|
+
comparable conditions) stays a `control` stub. Options, in order of preference:
|
|
74
|
+
|
|
75
|
+
1. If the expression is really a set of value comparisons, rewrite the node as a
|
|
76
|
+
`graph:branch` by hand (see `pikku-workflow` for the `branch` shape) and wire the
|
|
77
|
+
emitted `next` keys to the branch targets.
|
|
78
|
+
2. If it's genuinely computed routing, translate the stub into a small function that
|
|
79
|
+
returns the branch key, then feed it a `graph:branch`.
|
|
80
|
+
3. If neither is faithful, leave the stub and explain what the Switch does.
|
|
81
|
+
|
|
82
|
+
## Never
|
|
83
|
+
|
|
84
|
+
- Emit a `graph:map` for an accumulator loop — you'll silently drop the running state.
|
|
85
|
+
- Guess the done-branch semantics when a downstream node depends on the shape — mark
|
|
86
|
+
it and surface it.
|
|
87
|
+
- Invent a batching primitive — say what's unsupported instead.
|