@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '#pikku';
|
|
2
|
+
import { loadDeclaredScopes, openScopeService, reportStaleScopes, } from './scopes-shared.js';
|
|
3
|
+
export const scopesAudit = pikkuSessionlessFunc({
|
|
4
|
+
remote: true,
|
|
5
|
+
func: async ({ logger, config }) => {
|
|
6
|
+
const declared = await loadDeclaredScopes(config.scopesMetaJsonFile, logger);
|
|
7
|
+
if (!declared) {
|
|
8
|
+
throw new Error('scope metadata not found');
|
|
9
|
+
}
|
|
10
|
+
const opened = await openScopeService({ config, logger }, declared, 'pikku scopes audit');
|
|
11
|
+
if (!opened) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
const stale = await opened.service.findStaleScopes();
|
|
16
|
+
logger.info(`Scope audit: ${declared.length} scope(s) declared in code`);
|
|
17
|
+
if (stale.length === 0) {
|
|
18
|
+
logger.info(' every scope in the database is still declared');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
logger.info('');
|
|
22
|
+
logger.info(`${stale.length} scope(s) no longer declared in code:`);
|
|
23
|
+
reportStaleScopes(stale, logger);
|
|
24
|
+
const granted = stale.filter((s) => s.roles.length > 0);
|
|
25
|
+
logger.info('');
|
|
26
|
+
if (granted.length > 0) {
|
|
27
|
+
logger.warn(`${granted.length} undeclared scope(s) are still granted by a role. ` +
|
|
28
|
+
`They authorize nothing — no function can require a scope that is not declared — ` +
|
|
29
|
+
`but the grants persist until removed.`);
|
|
30
|
+
}
|
|
31
|
+
logger.info('Run `pikku scopes prune --yes` to remove them.');
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
await opened.destroy();
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes scopes that are no longer declared in code, cascading them out of
|
|
3
|
+
* every role that holds them.
|
|
4
|
+
*
|
|
5
|
+
* This revokes access, so it never runs implicitly — not at boot, not as part
|
|
6
|
+
* of `pikku all`. Without `--yes` it only reports the blast radius.
|
|
7
|
+
*/
|
|
8
|
+
export declare const scopesPrune: import("#pikku").PikkuFunctionConfig<{
|
|
9
|
+
yes?: boolean;
|
|
10
|
+
}, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
|
|
11
|
+
yes?: boolean;
|
|
12
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<{
|
|
13
|
+
yes?: boolean;
|
|
14
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '#pikku';
|
|
2
|
+
import { loadDeclaredScopes, openScopeService, reportStaleScopes, } from './scopes-shared.js';
|
|
3
|
+
/**
|
|
4
|
+
* Removes scopes that are no longer declared in code, cascading them out of
|
|
5
|
+
* every role that holds them.
|
|
6
|
+
*
|
|
7
|
+
* This revokes access, so it never runs implicitly — not at boot, not as part
|
|
8
|
+
* of `pikku all`. Without `--yes` it only reports the blast radius.
|
|
9
|
+
*/
|
|
10
|
+
export const scopesPrune = pikkuSessionlessFunc({
|
|
11
|
+
remote: true,
|
|
12
|
+
func: async ({ logger, config }, { yes }) => {
|
|
13
|
+
const declared = await loadDeclaredScopes(config.scopesMetaJsonFile, logger);
|
|
14
|
+
if (!declared) {
|
|
15
|
+
throw new Error('scope metadata not found');
|
|
16
|
+
}
|
|
17
|
+
const opened = await openScopeService({ config, logger }, declared, 'pikku scopes prune');
|
|
18
|
+
if (!opened) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const stale = await opened.service.findStaleScopes();
|
|
23
|
+
if (stale.length === 0) {
|
|
24
|
+
logger.info('scopes prune: nothing to prune');
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
logger.info(`${stale.length} scope(s) no longer declared in code:`);
|
|
28
|
+
reportStaleScopes(stale, logger);
|
|
29
|
+
const granted = stale.filter((s) => s.roles.length > 0);
|
|
30
|
+
const affectedRoles = new Set(stale.flatMap(({ roles }) => roles));
|
|
31
|
+
if (!yes) {
|
|
32
|
+
logger.info('');
|
|
33
|
+
if (granted.length > 0) {
|
|
34
|
+
logger.warn(`Pruning would revoke ${granted.length} scope(s) from the roles above.`);
|
|
35
|
+
}
|
|
36
|
+
logger.info('Re-run with --yes to remove them.');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const pruned = await opened.service.pruneScopes();
|
|
40
|
+
logger.info('');
|
|
41
|
+
logger.info(`scopes prune: removed ${pruned.length} scope(s)`);
|
|
42
|
+
if (granted.length > 0) {
|
|
43
|
+
logger.warn(`Revoked from ${affectedRoles.size} role(s). Users holding those roles lose these scopes on their next request.`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
await opened.destroy();
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { FlatScope } from '@pikku/core/scope';
|
|
2
|
+
import { KyselyScopeService } from '@pikku/kysely';
|
|
3
|
+
type Logger = {
|
|
4
|
+
info: (msg: string) => void;
|
|
5
|
+
warn: (msg: string) => void;
|
|
6
|
+
error: (msg: string) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const loadDeclaredScopes: (scopesMetaJsonFile: string, logger: Logger) => Promise<FlatScope[] | null>;
|
|
9
|
+
export type OpenedScopeService = {
|
|
10
|
+
service: KyselyScopeService;
|
|
11
|
+
destroy: () => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Opens a ScopeService against the project's configured database and brings the
|
|
15
|
+
* `declared` marks up to date with the code.
|
|
16
|
+
*
|
|
17
|
+
* The sync is deliberate: the marks are otherwise only as fresh as the last app
|
|
18
|
+
* boot, so an audit run straight after a code change would report stale
|
|
19
|
+
* answers. It is safe to do here because syncing is purely additive — it
|
|
20
|
+
* upserts and marks, and never deletes a scope or revokes a grant.
|
|
21
|
+
*/
|
|
22
|
+
export declare const openScopeService: ({ config, logger, }: {
|
|
23
|
+
config: {
|
|
24
|
+
rootDir: string;
|
|
25
|
+
outDir: string;
|
|
26
|
+
runtimeDir?: string;
|
|
27
|
+
srcDirectories: string[];
|
|
28
|
+
};
|
|
29
|
+
logger: Logger;
|
|
30
|
+
}, declared: FlatScope[], command: string) => Promise<OpenedScopeService | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Renders undeclared scopes and the roles that would lose them — the blast
|
|
33
|
+
* radius, shown before anything is deleted.
|
|
34
|
+
*/
|
|
35
|
+
export declare const reportStaleScopes: (stale: Array<{
|
|
36
|
+
scope: string;
|
|
37
|
+
roles: string[];
|
|
38
|
+
}>, logger: Logger) => void;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { flattenScopeDefinitions } from '@pikku/core/scope';
|
|
3
|
+
import { KyselyScopeService } from '@pikku/kysely';
|
|
4
|
+
import { createKysely, resolveDb } from '../db/local-db.js';
|
|
5
|
+
import { loadUserConfigForDb } from './db-shared.js';
|
|
6
|
+
/**
|
|
7
|
+
* Reads the generated scope metadata and flattens it to the declared scope set.
|
|
8
|
+
*
|
|
9
|
+
* Returns `null` — never an empty array — when the file cannot be read, so a
|
|
10
|
+
* caller can tell "nothing is declared" apart from "we failed to find out".
|
|
11
|
+
* `prune` deletes everything not in this set, so conflating the two would wipe
|
|
12
|
+
* every scope in the database.
|
|
13
|
+
*/
|
|
14
|
+
const isScopeDefinitionsMeta = (value) => typeof value === 'object' &&
|
|
15
|
+
value !== null &&
|
|
16
|
+
!Array.isArray(value) &&
|
|
17
|
+
Object.values(value).every((def) => typeof def === 'object' &&
|
|
18
|
+
def !== null &&
|
|
19
|
+
!Array.isArray(def) &&
|
|
20
|
+
typeof def.name === 'string');
|
|
21
|
+
export const loadDeclaredScopes = async (scopesMetaJsonFile, logger) => {
|
|
22
|
+
let parsed;
|
|
23
|
+
try {
|
|
24
|
+
parsed = JSON.parse(await readFile(scopesMetaJsonFile, 'utf8'));
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
logger.error(`pikku scopes: no scope metadata at ${scopesMetaJsonFile}.\n` +
|
|
28
|
+
` Run \`pikku all\` to generate it.`);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
if (!isScopeDefinitionsMeta(parsed)) {
|
|
32
|
+
logger.error(`pikku scopes: the scope metadata at ${scopesMetaJsonFile} is malformed.\n` +
|
|
33
|
+
` Run \`pikku all\` to regenerate it.`);
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return flattenScopeDefinitions(Object.values(parsed));
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Opens a ScopeService against the project's configured database and brings the
|
|
40
|
+
* `declared` marks up to date with the code.
|
|
41
|
+
*
|
|
42
|
+
* The sync is deliberate: the marks are otherwise only as fresh as the last app
|
|
43
|
+
* boot, so an audit run straight after a code change would report stale
|
|
44
|
+
* answers. It is safe to do here because syncing is purely additive — it
|
|
45
|
+
* upserts and marks, and never deletes a scope or revokes a grant.
|
|
46
|
+
*/
|
|
47
|
+
export const openScopeService = async ({ config, logger, }, declared, command) => {
|
|
48
|
+
const userConfig = await loadUserConfigForDb({
|
|
49
|
+
config,
|
|
50
|
+
logger,
|
|
51
|
+
});
|
|
52
|
+
if (!userConfig) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
|
|
56
|
+
if (!resolved) {
|
|
57
|
+
logger.error(`${command}: no database configured — set sqliteDb or postgresUrl in your createConfig.`);
|
|
58
|
+
throw new Error('no database configured');
|
|
59
|
+
}
|
|
60
|
+
const db = await createKysely(resolved);
|
|
61
|
+
try {
|
|
62
|
+
const service = new KyselyScopeService(db);
|
|
63
|
+
await service.init();
|
|
64
|
+
await service.syncScopes(declared);
|
|
65
|
+
return { service, destroy: () => db.destroy() };
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
await db.destroy();
|
|
69
|
+
throw e;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Renders undeclared scopes and the roles that would lose them — the blast
|
|
74
|
+
* radius, shown before anything is deleted.
|
|
75
|
+
*/
|
|
76
|
+
export const reportStaleScopes = (stale, logger) => {
|
|
77
|
+
for (const { scope, roles } of stale) {
|
|
78
|
+
const held = roles.length > 0
|
|
79
|
+
? `held by ${roles.length} role(s): ${roles.join(', ')}`
|
|
80
|
+
: 'held by no role';
|
|
81
|
+
logger.info(` ${scope.padEnd(40)} ${held}`);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
@@ -4,7 +4,7 @@ export declare const serve: import("#pikku").PikkuFunctionConfig<{
|
|
|
4
4
|
}, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
|
|
5
5
|
port?: string;
|
|
6
6
|
console?: boolean;
|
|
7
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
7
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<{
|
|
8
8
|
port?: string;
|
|
9
9
|
console?: boolean;
|
|
10
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
10
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join, resolve } from 'path';
|
|
2
2
|
import { pikkuSessionlessFunc } from '#pikku';
|
|
3
|
-
import { ConsoleLogger, LocalEmailService, InMemoryQueueService, InMemoryWorkflowService, InMemoryTriggerService, InMemoryAIRunStateService, } from '@pikku/core/services';
|
|
3
|
+
import { ConsoleLogger, LocalEmailService, InMemoryQueueService, InMemoryWorkflowService, InMemoryTriggerService, InMemoryAIRunStateService, QueueWebhookService, } from '@pikku/core/services';
|
|
4
4
|
import { KyselyAIStorageService, KyselyAIRunStateService, KyselyAgentRunService, } from '@pikku/kysely';
|
|
5
5
|
import { stopSingletonServices } from '@pikku/core';
|
|
6
6
|
import { pikkuState } from '@pikku/core/internal';
|
|
@@ -81,13 +81,15 @@ export const serve = pikkuSessionlessFunc({
|
|
|
81
81
|
})
|
|
82
82
|
: undefined;
|
|
83
83
|
const eventHub = await devServerRunner.createEventHub();
|
|
84
|
+
const serveQueueService = new InMemoryQueueService();
|
|
84
85
|
const inMemoryServices = {
|
|
85
86
|
logger: devLogger,
|
|
86
87
|
...(aiAgentRunner ? { aiAgentRunner } : {}),
|
|
87
88
|
emailService: new LocalEmailService(),
|
|
88
89
|
metaService: new LocalMetaService(pikkuDir),
|
|
89
90
|
schedulerService,
|
|
90
|
-
queueService:
|
|
91
|
+
queueService: serveQueueService,
|
|
92
|
+
webhookService: new QueueWebhookService(serveQueueService),
|
|
91
93
|
workflowService,
|
|
92
94
|
workflowRunService: workflowService,
|
|
93
95
|
triggerService: new InMemoryTriggerService(),
|
|
@@ -2,9 +2,9 @@ export declare const pikkuSkillsList: import("#pikku").PikkuFunctionConfig<{
|
|
|
2
2
|
target?: string;
|
|
3
3
|
}, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
|
|
4
4
|
target?: string;
|
|
5
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
5
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<{
|
|
6
6
|
target?: string;
|
|
7
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
7
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
8
8
|
export declare const pikkuSkillsInstall: import("#pikku").PikkuFunctionConfig<{
|
|
9
9
|
agent?: string;
|
|
10
10
|
only?: string;
|
|
@@ -17,10 +17,10 @@ export declare const pikkuSkillsInstall: import("#pikku").PikkuFunctionConfig<{
|
|
|
17
17
|
core?: boolean;
|
|
18
18
|
fabric?: boolean;
|
|
19
19
|
update?: boolean;
|
|
20
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
20
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<{
|
|
21
21
|
agent?: string;
|
|
22
22
|
only?: string;
|
|
23
23
|
core?: boolean;
|
|
24
24
|
fabric?: boolean;
|
|
25
25
|
update?: boolean;
|
|
26
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
26
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readdir, readFile, mkdir, writeFile } from 'fs/promises';
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
|
-
import { join, dirname } from 'path';
|
|
3
|
+
import { join, dirname, sep } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { pikkuSessionlessFunc } from '#pikku';
|
|
6
6
|
/**
|
|
@@ -46,6 +46,17 @@ async function copyDir(src, dest) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Where each supported agent reads project-local skills from, relative to the
|
|
51
|
+
* project root. `pi` mirrors pi.dev's own resolution: it scans
|
|
52
|
+
* `<cwd>/<CONFIG_DIR_NAME>/skills` for project skills, where CONFIG_DIR_NAME
|
|
53
|
+
* defaults to `.pi`.
|
|
54
|
+
*/
|
|
55
|
+
const AGENT_SKILL_DIRS = {
|
|
56
|
+
claude: join('.claude', 'skills'),
|
|
57
|
+
opencode: join('.opencode', 'skills'),
|
|
58
|
+
pi: join('.pi', 'skills'),
|
|
59
|
+
};
|
|
49
60
|
function parseInstallGroups(frontmatter) {
|
|
50
61
|
const inline = frontmatter.match(/^\s*installGroups\s*:\s*\[([^\]]*)\]/m);
|
|
51
62
|
if (inline) {
|
|
@@ -113,10 +124,8 @@ export const pikkuSkillsList = pikkuSessionlessFunc({
|
|
|
113
124
|
.map((e) => e.name)
|
|
114
125
|
.sort();
|
|
115
126
|
const installed = new Set();
|
|
116
|
-
for (const
|
|
117
|
-
join(process.cwd(),
|
|
118
|
-
join(process.cwd(), '.opencode', 'skills'),
|
|
119
|
-
]) {
|
|
127
|
+
for (const relative of Object.values(AGENT_SKILL_DIRS)) {
|
|
128
|
+
const dir = join(process.cwd(), relative);
|
|
120
129
|
if (existsSync(dir)) {
|
|
121
130
|
for (const e of await readdir(dir, { withFileTypes: true })) {
|
|
122
131
|
if (e.isDirectory() || e.isSymbolicLink())
|
|
@@ -133,11 +142,12 @@ export const pikkuSkillsList = pikkuSessionlessFunc({
|
|
|
133
142
|
console.log('Run `pikku skills install` to copy them into .claude/skills/');
|
|
134
143
|
console.log('Run `pikku skills install --core --fabric` to install the Fabric sandbox skill set.');
|
|
135
144
|
console.log('Run `pikku skills install --agent opencode` to copy them into .opencode/skills/');
|
|
145
|
+
console.log('Run `pikku skills install --agent pi` to copy them into .pi/skills/');
|
|
136
146
|
},
|
|
137
147
|
});
|
|
138
148
|
export const pikkuSkillsInstall = pikkuSessionlessFunc({
|
|
139
149
|
func: async ({ logger }, { agent = 'claude', only, core = false, fabric = false, update = false }) => {
|
|
140
|
-
const supportedAgents =
|
|
150
|
+
const supportedAgents = Object.keys(AGENT_SKILL_DIRS);
|
|
141
151
|
if (!supportedAgents.includes(agent)) {
|
|
142
152
|
logger.error(`Agent "${agent}" is not yet supported. Supported: ${supportedAgents.join(', ')}. ` +
|
|
143
153
|
`(codex/gemini will emit AGENTS.md/GEMINI.md from the same source — coming soon.)`);
|
|
@@ -160,9 +170,7 @@ export const pikkuSkillsInstall = pikkuSessionlessFunc({
|
|
|
160
170
|
process.exitCode = 1;
|
|
161
171
|
return;
|
|
162
172
|
}
|
|
163
|
-
const installRoot = agent
|
|
164
|
-
? join(process.cwd(), '.opencode', 'skills')
|
|
165
|
-
: join(process.cwd(), '.claude', 'skills');
|
|
173
|
+
const installRoot = join(process.cwd(), AGENT_SKILL_DIRS[agent]);
|
|
166
174
|
await mkdir(installRoot, { recursive: true });
|
|
167
175
|
let installed = 0;
|
|
168
176
|
let skipped = 0;
|
|
@@ -176,7 +184,7 @@ export const pikkuSkillsInstall = pikkuSessionlessFunc({
|
|
|
176
184
|
await copyDir(src, dest);
|
|
177
185
|
installed++;
|
|
178
186
|
}
|
|
179
|
-
const destLabel = agent
|
|
187
|
+
const destLabel = `${AGENT_SKILL_DIRS[agent].split(sep).join('/')}/`;
|
|
180
188
|
logger.info(`Installed ${installed} skill(s) into ${destLabel}${skipped > 0
|
|
181
189
|
? ` (skipped ${skipped} already present — pass --update to overwrite)`
|
|
182
190
|
: ''}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuVersionsCheck: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").
|
|
1
|
+
export declare const pikkuVersionsCheck: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -2,6 +2,6 @@ export declare const pikkuVersionsInit: import("#pikku").PikkuFunctionConfig<{
|
|
|
2
2
|
force?: boolean;
|
|
3
3
|
}, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
|
|
4
4
|
force?: boolean;
|
|
5
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
5
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<{
|
|
6
6
|
force?: boolean;
|
|
7
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
7
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuVersionsUpdate: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").
|
|
1
|
+
export declare const pikkuVersionsUpdate: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -2,6 +2,6 @@ export declare const watch: import("#pikku").PikkuFunctionConfig<{
|
|
|
2
2
|
hmr?: boolean;
|
|
3
3
|
}, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
|
|
4
4
|
hmr?: boolean;
|
|
5
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
5
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<{
|
|
6
6
|
hmr?: boolean;
|
|
7
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
7
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -19,7 +19,7 @@ export declare const workspaceValidate: import("#pikku").PikkuFunctionConfig<Rec
|
|
|
19
19
|
path: string;
|
|
20
20
|
fixHint: string;
|
|
21
21
|
}[];
|
|
22
|
-
}, "rpc" | "session", import("#pikku").
|
|
22
|
+
}, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<Record<string, never>, {
|
|
23
23
|
ok: boolean;
|
|
24
24
|
root: string;
|
|
25
25
|
findings: {
|
|
@@ -29,5 +29,5 @@ export declare const workspaceValidate: import("#pikku").PikkuFunctionConfig<Rec
|
|
|
29
29
|
path: string;
|
|
30
30
|
fixHint: string;
|
|
31
31
|
}[];
|
|
32
|
-
}, "rpc" | "session", import("#pikku").
|
|
32
|
+
}, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
33
33
|
export { renderWorkspaceValidate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuFetch: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").
|
|
1
|
+
export declare const pikkuFetch: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuNext: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").
|
|
1
|
+
export declare const pikkuNext: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuTanStackStart: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").
|
|
1
|
+
export declare const pikkuTanStackStart: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuWebSocketTyped: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").
|
|
1
|
+
export declare const pikkuWebSocketTyped: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuAIAgentTypes: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").
|
|
1
|
+
export declare const pikkuAIAgentTypes: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -5,10 +5,11 @@ import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-
|
|
|
5
5
|
import { serializeAIAgentTypes } from './serialize-ai-agent-types.js';
|
|
6
6
|
export const pikkuAIAgentTypes = pikkuSessionlessFunc({
|
|
7
7
|
func: async ({ logger, config }) => {
|
|
8
|
-
const { agentTypesFile, functionTypesFile, agentMapDeclarationFile, packageMappings, } = config;
|
|
8
|
+
const { agentTypesFile, functionTypesFile, agentMapDeclarationFile, scopesFile, packageMappings, } = config;
|
|
9
9
|
const functionTypesImportPath = getFileImportRelativePath(agentTypesFile, functionTypesFile, packageMappings);
|
|
10
10
|
const agentMapImportPath = getFileImportRelativePath(agentTypesFile, agentMapDeclarationFile, packageMappings);
|
|
11
|
-
const
|
|
11
|
+
const scopesImportPath = getFileImportRelativePath(agentTypesFile, scopesFile, packageMappings);
|
|
12
|
+
const content = serializeAIAgentTypes(functionTypesImportPath, agentMapImportPath, scopesImportPath);
|
|
12
13
|
await writeFileInDir(logger, agentTypesFile, content);
|
|
13
14
|
},
|
|
14
15
|
middleware: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuAIAgent: import("#pikku").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean | undefined, "rpc" | "session", import("#pikku").
|
|
1
|
+
export declare const pikkuAIAgent: import("#pikku").PikkuFunctionConfig<void, boolean | undefined, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean | undefined, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, boolean | undefined, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pikkuPublicAgent: import("#pikku").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku").
|
|
1
|
+
export declare const pikkuPublicAgent: import("#pikku").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const serializeAIAgentTypes: (functionTypesImportPath: string, agentMapImportPath: string) => string;
|
|
1
|
+
export declare const serializeAIAgentTypes: (functionTypesImportPath: string, agentMapImportPath: string, scopesImportPath: string) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const serializeAIAgentTypes = (functionTypesImportPath, agentMapImportPath) => {
|
|
1
|
+
export const serializeAIAgentTypes = (functionTypesImportPath, agentMapImportPath, scopesImportPath) => {
|
|
2
2
|
return `import {
|
|
3
3
|
CoreAIAgent,
|
|
4
4
|
PikkuAIMiddlewareHooks,
|
|
@@ -13,16 +13,18 @@ import type { PikkuPermission, PikkuMiddleware, Services, PikkuFunctionConfig }
|
|
|
13
13
|
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
14
14
|
import type { AIAgentMemoryConfig, AIAgentInput } from '@pikku/core/ai-agent'
|
|
15
15
|
import type { AgentMap } from '${agentMapImportPath}'
|
|
16
|
+
import type { ScopeId } from '${scopesImportPath}'
|
|
16
17
|
|
|
17
18
|
type AIAgentConfig<
|
|
18
19
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
19
20
|
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
20
|
-
> = Omit<CoreAIAgent<PikkuPermission, PikkuMiddleware>, 'tools' | 'agents' | 'memory' | 'input' | 'output'> & {
|
|
21
|
+
> = Omit<CoreAIAgent<PikkuPermission, PikkuMiddleware, ScopeId>, 'tools' | 'agents' | 'workflows' | 'memory' | 'input' | 'output'> & {
|
|
21
22
|
input?: InputSchema
|
|
22
23
|
output?: OutputSchema
|
|
23
24
|
memory?: Omit<AIAgentMemoryConfig, 'workingMemory'> & { workingMemory?: StandardSchemaV1 }
|
|
24
25
|
tools?: object[]
|
|
25
26
|
agents?: AIAgentConfig<StandardSchemaV1 | undefined, StandardSchemaV1 | undefined>[]
|
|
27
|
+
workflows?: object[]
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
export const pikkuAIAgent = <
|
|
@@ -1,12 +1,45 @@
|
|
|
1
1
|
export const serializePublicAgent = (pathToPikkuTypes, requireAuth = true, globalHTTPPrefix = '') => {
|
|
2
2
|
const authFlag = requireAuth ? 'true' : 'false';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// Emitted inline at each call site rather than as a shared named alias: the
|
|
4
|
+
// schema extractor only reads type literals in the generic position, and
|
|
5
|
+
// synthesises the schema name from the function name. Behind a named alias it
|
|
6
|
+
// records an `inputSchemaName` with no schema behind it, and every agent call
|
|
7
|
+
// then fails at runtime with MissingSchemaError.
|
|
8
|
+
const callerInput = `{
|
|
9
|
+
agentName: string
|
|
10
|
+
message: string
|
|
11
|
+
threadId: string
|
|
12
|
+
resourceId: string
|
|
13
|
+
attachments?: {
|
|
14
|
+
type: 'image' | 'file'
|
|
15
|
+
data?: string
|
|
16
|
+
url?: string
|
|
17
|
+
mediaType?: string
|
|
18
|
+
filename?: string
|
|
19
|
+
}[]
|
|
20
|
+
model?: string
|
|
21
|
+
temperature?: number
|
|
22
|
+
context?: string
|
|
23
|
+
}`;
|
|
24
|
+
return `import { canAccessThread, threadOwnerConstraint } from '@pikku/core/ai-agent'
|
|
25
|
+
import { pikkuSessionlessFunc, pikkuPermission, defineHTTPRoutes, wireHTTPRoutes } from '${pathToPikkuTypes}'
|
|
5
26
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Thread reads are keyed by a caller-supplied \`threadId\`, so ownership cannot
|
|
29
|
+
* come from the request — it is derived from the session and checked against
|
|
30
|
+
* the stored thread's resourceId.
|
|
31
|
+
*/
|
|
32
|
+
export const isThreadOwner = pikkuPermission<{ threadId: string }>(
|
|
33
|
+
async ({ agentRunService }, { threadId }, { session }) => {
|
|
34
|
+
const thread = await agentRunService.getThread(threadId)
|
|
35
|
+
// A missing thread is denied rather than 404'd so it is indistinguishable
|
|
36
|
+
// from one owned by someone else — no existence oracle.
|
|
37
|
+
if (!thread) return false
|
|
38
|
+
return canAccessThread(thread.resourceId, session)
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
export const agentCaller = pikkuSessionlessFunc<${callerInput}, unknown>({
|
|
10
43
|
tags: ['pikku'],
|
|
11
44
|
auth: ${authFlag},
|
|
12
45
|
func: async (_services, data, { rpc }) => {
|
|
@@ -14,14 +47,15 @@ export const agentCaller = pikkuSessionlessFunc<
|
|
|
14
47
|
message: data.message,
|
|
15
48
|
threadId: data.threadId,
|
|
16
49
|
resourceId: data.resourceId,
|
|
50
|
+
...(data.attachments ? { attachments: data.attachments } : {}),
|
|
51
|
+
...(data.model ? { model: data.model } : {}),
|
|
52
|
+
...(data.temperature !== undefined ? { temperature: data.temperature } : {}),
|
|
53
|
+
...(data.context ? { context: data.context } : {}),
|
|
17
54
|
})
|
|
18
55
|
},
|
|
19
56
|
})
|
|
20
57
|
|
|
21
|
-
export const agentStreamCaller = pikkuSessionlessFunc
|
|
22
|
-
{ agentName: string; message: string; threadId: string; resourceId: string; context?: string },
|
|
23
|
-
void
|
|
24
|
-
>({
|
|
58
|
+
export const agentStreamCaller = pikkuSessionlessFunc<${callerInput}, void>({
|
|
25
59
|
tags: ['pikku'],
|
|
26
60
|
auth: ${authFlag},
|
|
27
61
|
func: async (_services, data, { rpc }) => {
|
|
@@ -29,6 +63,9 @@ export const agentStreamCaller = pikkuSessionlessFunc<
|
|
|
29
63
|
message: data.message,
|
|
30
64
|
threadId: data.threadId,
|
|
31
65
|
resourceId: data.resourceId,
|
|
66
|
+
...(data.attachments ? { attachments: data.attachments } : {}),
|
|
67
|
+
...(data.model ? { model: data.model } : {}),
|
|
68
|
+
...(data.temperature !== undefined ? { temperature: data.temperature } : {}),
|
|
32
69
|
...(data.context ? { context: data.context } : {}),
|
|
33
70
|
})
|
|
34
71
|
},
|
|
@@ -66,14 +103,16 @@ export const getAgentThreads = pikkuSessionlessFunc<
|
|
|
66
103
|
tags: ['pikku', 'pikku:agent'],
|
|
67
104
|
title: 'Get Agent Threads',
|
|
68
105
|
description:
|
|
69
|
-
'Returns
|
|
106
|
+
'Returns the caller\\'s AI agent threads from storage. Accepts optional filters: agentName, resourceId, limit, and offset for pagination.',
|
|
70
107
|
expose: true,
|
|
71
108
|
auth: ${authFlag},
|
|
72
|
-
func: async ({ agentRunService }, input) => {
|
|
73
|
-
|
|
109
|
+
func: async ({ agentRunService }, input, { session }) => {
|
|
110
|
+
// \`owners\` is an authorization constraint derived from the session, never
|
|
111
|
+
// from input — \`resourceId\` remains a caller-supplied filter within it.
|
|
74
112
|
return await agentRunService.listThreads({
|
|
75
113
|
agentName: input?.agentName,
|
|
76
114
|
resourceId: input?.resourceId,
|
|
115
|
+
owners: threadOwnerConstraint(session),
|
|
77
116
|
limit: input?.limit,
|
|
78
117
|
offset: input?.offset,
|
|
79
118
|
})
|
|
@@ -90,8 +129,8 @@ export const getAgentThreadMessages = pikkuSessionlessFunc<
|
|
|
90
129
|
'Returns all messages for a given AI agent thread, ordered by creation time.',
|
|
91
130
|
expose: true,
|
|
92
131
|
auth: ${authFlag},
|
|
132
|
+
permissions: { owner: isThreadOwner },
|
|
93
133
|
func: async ({ agentRunService }, input) => {
|
|
94
|
-
if (!agentRunService) throw new MissingServiceError('agentRunService is not available')
|
|
95
134
|
return await agentRunService.getThreadMessages(input.threadId)
|
|
96
135
|
},
|
|
97
136
|
})
|
|
@@ -106,8 +145,8 @@ export const getAgentThreadRuns = pikkuSessionlessFunc<
|
|
|
106
145
|
'Returns the run history for a given AI agent thread, ordered by creation time.',
|
|
107
146
|
expose: true,
|
|
108
147
|
auth: ${authFlag},
|
|
148
|
+
permissions: { owner: isThreadOwner },
|
|
109
149
|
func: async ({ agentRunService }, input) => {
|
|
110
|
-
if (!agentRunService) throw new MissingServiceError('agentRunService is not available')
|
|
111
150
|
return await agentRunService.getThreadRuns(input.threadId)
|
|
112
151
|
},
|
|
113
152
|
})
|
|
@@ -122,8 +161,8 @@ export const deleteAgentThread = pikkuSessionlessFunc<
|
|
|
122
161
|
'Deletes an AI agent thread and all of its persisted state.',
|
|
123
162
|
expose: true,
|
|
124
163
|
auth: ${authFlag},
|
|
164
|
+
permissions: { owner: isThreadOwner },
|
|
125
165
|
func: async ({ agentRunService }, input) => {
|
|
126
|
-
if (!agentRunService) throw new MissingServiceError('agentRunService is not available')
|
|
127
166
|
const deleted = await agentRunService.deleteThread(input.threadId)
|
|
128
167
|
return { deleted }
|
|
129
168
|
},
|
|
@@ -2,6 +2,6 @@ export declare const pikkuAuth: import("#pikku").PikkuFunctionConfig<{
|
|
|
2
2
|
bootstrap?: boolean;
|
|
3
3
|
}, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
|
|
4
4
|
bootstrap?: boolean;
|
|
5
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
5
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices> | import("#pikku").PikkuFunction<{
|
|
6
6
|
bootstrap?: boolean;
|
|
7
|
-
}, void, "rpc" | "session", import("#pikku").
|
|
7
|
+
}, void, "rpc" | "session", import("#pikku").WiredServices>, undefined, undefined>;
|