@pikku/cli 0.12.21 → 0.12.23
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-C52h1B_L.css +1 -0
- package/console-app/assets/index-CAk106ji.js +232 -0
- package/console-app/index.html +3 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +3 -3
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +6 -6
- package/dist/.pikku/cli/pikku-cli-channel.js +280 -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 +782 -7
- 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 +41 -73
- package/dist/.pikku/function/pikku-function-types.gen.js +30 -40
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +1305 -378
- package/dist/.pikku/function/pikku-functions.gen.js +13 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.json +1 -62
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -2
- package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -2
- 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 +3 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +3 -1
- 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 +2 -1
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.d.ts +1 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +6 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +250 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +4 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +5 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +66 -20
- 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 +153 -29
- package/dist/.pikku/schemas/schemas/BinaryInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbMigrateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbResetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbSeedInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIEntryOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuEventsScaffoldOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaClientsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaContextInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresChannelInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresHttpInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresQueueInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresSchedulerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTriggerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTypeInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsInstallInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsCoverageInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsInitInput.schema.json +1 -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.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +235 -627
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +23 -0
- package/dist/bin/pikku.js +28 -1
- package/dist/src/cli.wiring.js +274 -8
- package/dist/src/deploy/analyzer/analyzer.d.ts +16 -1
- package/dist/src/deploy/analyzer/analyzer.js +83 -43
- package/dist/src/deploy/build-pipeline.js +83 -17
- package/dist/src/deploy/bundler/bundler.d.ts +1 -0
- package/dist/src/deploy/bundler/bundler.js +13 -5
- package/dist/src/deploy/codegen/per-unit-codegen.d.ts +8 -0
- package/dist/src/deploy/codegen/per-unit-codegen.js +46 -5
- package/dist/src/deploy/provider-adapter.d.ts +34 -0
- package/dist/src/deploy/server-entry.d.ts +16 -0
- package/dist/src/deploy/server-entry.js +81 -0
- package/dist/src/fabric/fabric-commands.d.ts +522 -0
- package/dist/src/fabric/fabric-commands.js +299 -0
- package/dist/src/fabric/functions/db-schema.function.d.ts +35 -0
- package/dist/src/fabric/functions/db-schema.function.js +37 -0
- package/dist/src/fabric/functions/deploy-list.function.d.ts +41 -0
- package/dist/src/fabric/functions/deploy-list.function.js +43 -0
- package/dist/src/fabric/functions/deploy-units.function.d.ts +35 -0
- package/dist/src/fabric/functions/deploy-units.function.js +41 -0
- package/dist/src/fabric/functions/deploy.function.d.ts +105 -0
- package/dist/src/fabric/functions/deploy.function.js +122 -0
- package/dist/src/fabric/functions/domains-add.function.d.ts +35 -0
- package/dist/src/fabric/functions/domains-add.function.js +46 -0
- package/dist/src/fabric/functions/domains-list.function.d.ts +20 -0
- package/dist/src/fabric/functions/domains-list.function.js +50 -0
- package/dist/src/fabric/functions/domains-remove.function.d.ts +24 -0
- package/dist/src/fabric/functions/domains-remove.function.js +44 -0
- package/dist/src/fabric/functions/errors.function.d.ts +44 -0
- package/dist/src/fabric/functions/errors.function.js +50 -0
- package/dist/src/fabric/functions/init.function.d.ts +51 -0
- package/dist/src/fabric/functions/init.function.js +54 -0
- package/dist/src/fabric/functions/link.function.d.ts +28 -0
- package/dist/src/fabric/functions/link.function.js +77 -0
- package/dist/src/fabric/functions/llm-key.function.d.ts +46 -0
- package/dist/src/fabric/functions/llm-key.function.js +76 -0
- package/dist/src/fabric/functions/login.function.d.ts +42 -0
- package/dist/src/fabric/functions/login.function.js +68 -0
- package/dist/src/fabric/functions/logs.function.d.ts +40 -0
- package/dist/src/fabric/functions/logs.function.js +84 -0
- package/dist/src/fabric/functions/metrics.function.d.ts +32 -0
- package/dist/src/fabric/functions/metrics.function.js +49 -0
- package/dist/src/fabric/functions/rollback.function.d.ts +76 -0
- package/dist/src/fabric/functions/rollback.function.js +69 -0
- package/dist/src/fabric/functions/secrets-list.function.d.ts +24 -0
- package/dist/src/fabric/functions/secrets-list.function.js +37 -0
- package/dist/src/fabric/functions/secrets-set.function.d.ts +32 -0
- package/dist/src/fabric/functions/secrets-set.function.js +36 -0
- package/dist/src/fabric/functions/status.function.d.ts +34 -0
- package/dist/src/fabric/functions/status.function.js +43 -0
- package/dist/src/fabric/functions/trace.function.d.ts +28 -0
- package/dist/src/fabric/functions/trace.function.js +45 -0
- package/dist/src/fabric/functions/validate.function.d.ts +50 -0
- package/dist/src/fabric/functions/validate.function.js +363 -0
- package/dist/src/fabric/lib/config.d.ts +64 -0
- package/dist/src/fabric/lib/config.js +62 -0
- package/dist/src/fabric/lib/console-url.d.ts +5 -0
- package/dist/src/fabric/lib/console-url.js +13 -0
- package/dist/src/fabric/lib/git.d.ts +53 -0
- package/dist/src/fabric/lib/git.js +151 -0
- package/dist/src/fabric/lib/http.d.ts +4 -0
- package/dist/src/fabric/lib/http.js +12 -0
- package/dist/src/fabric/lib/not-implemented.d.ts +5 -0
- package/dist/src/fabric/lib/not-implemented.js +8 -0
- package/dist/src/fabric/lib/output.d.ts +23 -0
- package/dist/src/fabric/lib/output.js +39 -0
- package/dist/src/fabric/lib/prompt.d.ts +12 -0
- package/dist/src/fabric/lib/prompt.js +32 -0
- package/dist/src/fabric/lib/stage.d.ts +7 -0
- package/dist/src/fabric/lib/stage.js +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.d.ts +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.js +30 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.d.ts +105 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.js +126 -0
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/binary.d.ts +7 -0
- package/dist/src/functions/commands/binary.js +40 -0
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +7 -4
- package/dist/src/functions/commands/console.d.ts +3 -3
- package/dist/src/functions/commands/db-migrate.d.ts +1 -0
- package/dist/src/functions/commands/db-migrate.js +35 -0
- package/dist/src/functions/commands/db-reset.d.ts +1 -0
- package/dist/src/functions/commands/db-reset.js +36 -0
- package/dist/src/functions/commands/db-seed.d.ts +1 -0
- package/dist/src/functions/commands/db-seed.js +27 -0
- package/dist/src/functions/commands/db-shared.d.ts +32 -0
- package/dist/src/functions/commands/db-shared.js +26 -0
- package/dist/src/functions/commands/deploy-apply.d.ts +3 -3
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/deploy-plan.d.ts +3 -3
- package/dist/src/functions/commands/dev.d.ts +3 -3
- package/dist/src/functions/commands/dev.js +142 -86
- package/dist/src/functions/commands/enable.d.ts +5 -4
- package/dist/src/functions/commands/enable.js +4 -0
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/load-user-project.d.ts +11 -0
- package/dist/src/functions/commands/load-user-project.js +40 -0
- package/dist/src/functions/commands/meta.d.ts +82 -0
- package/dist/src/functions/commands/meta.js +454 -0
- package/dist/src/functions/commands/new-addon.d.ts +3 -3
- package/dist/src/functions/commands/new-function.d.ts +3 -3
- package/dist/src/functions/commands/new-middleware.d.ts +3 -3
- package/dist/src/functions/commands/new-permission.d.ts +3 -3
- package/dist/src/functions/commands/new-wiring.d.ts +3 -3
- package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-bootstrap.js +15 -1
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-summary.js +3 -0
- package/dist/src/functions/commands/skills.d.ts +26 -0
- package/dist/src/functions/commands/skills.js +184 -0
- package/dist/src/functions/commands/tests-coverage.d.ts +7 -0
- package/dist/src/functions/commands/tests-coverage.js +231 -0
- package/dist/src/functions/commands/tests-init.d.ts +7 -0
- package/dist/src/functions/commands/tests-init.js +225 -0
- package/dist/src/functions/commands/versions-check.d.ts +1 -1
- package/dist/src/functions/commands/versions-init.d.ts +3 -3
- package/dist/src/functions/commands/versions-update.d.ts +1 -1
- package/dist/src/functions/commands/watch.d.ts +3 -3
- package/dist/src/functions/commands/watch.js +1 -1
- package/dist/src/functions/db/local-db.d.ts +48 -0
- package/dist/src/functions/db/local-db.js +106 -0
- package/dist/src/functions/db/seed.d.ts +11 -0
- package/dist/src/functions/db/seed.js +22 -0
- package/dist/src/functions/db/sql-migrator.d.ts +26 -0
- package/dist/src/functions/db/sql-migrator.js +104 -0
- package/dist/src/functions/db/sqlite-codegen.d.ts +45 -0
- package/dist/src/functions/db/sqlite-codegen.js +294 -0
- package/dist/src/functions/db/zod-codegen.d.ts +10 -0
- package/dist/src/functions/db/zod-codegen.js +109 -0
- 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/nextjs/pikku-command-nextjs.js +21 -2
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.d.ts +1 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.js +163 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +5 -2
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -0
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.js +32 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.d.ts +11 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.js +36 -0
- 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.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.js +1 -10
- package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +76 -1
- 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-entry.js +5 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +5 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +8 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +27 -9
- package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +5 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +13 -3
- 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 +5 -0
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +5 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.js +7 -2
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +1 -1
- 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 +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +78 -83
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
- 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/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 +2 -2
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- 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 -0
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +26 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.js +35 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.d.ts +23 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.js +98 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.d.ts +22 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.js +337 -0
- 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-client.js +3 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +2 -2
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +2 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +13 -7
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +1 -0
- package/dist/src/functions/wirings/rpc/serialize-react-query-hooks.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +7 -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/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.js +1 -1
- 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/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +5 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +18 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.d.ts +3 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.js +40 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +14 -2
- package/dist/src/functions/workflows/all.workflow.js +41 -8
- package/dist/src/scaffold/rpc-remote.gen.d.ts +3 -3
- package/dist/src/scaffold/rpc-remote.gen.js +7 -2
- package/dist/src/services/cli-logger.service.d.ts +0 -1
- package/dist/src/services/cli-logger.service.js +12 -22
- package/dist/src/services.js +24 -66
- package/dist/src/utils/generate-bootstrap-file.js +3 -0
- package/dist/src/utils/parse-cli-filters.d.ts +18 -0
- package/dist/src/utils/parse-cli-filters.js +99 -0
- package/dist/src/utils/pikku-cli-config.js +29 -9
- package/dist/src/utils/serialize-schemas.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -4
- package/skills/pikku-addon/SKILL.md +330 -0
- package/skills/pikku-ai-agent/SKILL.md +227 -0
- package/skills/pikku-ai-vercel/SKILL.md +78 -0
- package/skills/pikku-ai-voice/SKILL.md +85 -0
- package/skills/pikku-auth-js/SKILL.md +106 -0
- package/skills/pikku-aws/SKILL.md +107 -0
- package/skills/pikku-backblaze/SKILL.md +70 -0
- package/skills/pikku-cli/SKILL.md +281 -0
- package/skills/pikku-concepts/SKILL.md +281 -0
- package/skills/pikku-concepts/references/concept-mapping.md +528 -0
- package/skills/pikku-config/SKILL.md +208 -0
- package/skills/pikku-cron/SKILL.md +211 -0
- package/skills/pikku-deploy-azure/SKILL.md +69 -0
- package/skills/pikku-deploy-cloudflare/SKILL.md +80 -0
- package/skills/pikku-deploy-express/SKILL.md +83 -0
- package/skills/pikku-deploy-fastify/SKILL.md +70 -0
- package/skills/pikku-deploy-lambda/SKILL.md +107 -0
- package/skills/pikku-deploy-nextjs/SKILL.md +76 -0
- package/skills/pikku-deploy-uws/SKILL.md +85 -0
- package/skills/pikku-fabric/SKILL.md +245 -0
- package/skills/pikku-feature/SKILL.md +258 -0
- package/skills/pikku-gateway-slack/SKILL.md +112 -0
- package/skills/pikku-http/SKILL.md +317 -0
- package/skills/pikku-i18n/SKILL.md +217 -0
- package/skills/pikku-info/SKILL.md +95 -0
- package/skills/pikku-jose/SKILL.md +102 -0
- package/skills/pikku-kysely/SKILL.md +145 -0
- package/skills/pikku-mcp/SKILL.md +237 -0
- package/skills/pikku-mongodb/SKILL.md +102 -0
- package/skills/pikku-n8n-addon-map/SKILL.md +178 -0
- package/skills/pikku-n8n-code-translate/SKILL.md +166 -0
- package/skills/pikku-pino/SKILL.md +77 -0
- package/skills/pikku-queue/SKILL.md +237 -0
- package/skills/pikku-react/SKILL.md +183 -0
- package/skills/pikku-react-query/SKILL.md +205 -0
- package/skills/pikku-realtime/SKILL.md +285 -0
- package/skills/pikku-redis/SKILL.md +87 -0
- package/skills/pikku-rpc/SKILL.md +168 -0
- package/skills/pikku-rtl/SKILL.md +219 -0
- package/skills/pikku-schedule/SKILL.md +54 -0
- package/skills/pikku-schema-ajv/SKILL.md +60 -0
- package/skills/pikku-schema-cfworker/SKILL.md +60 -0
- package/skills/pikku-security/SKILL.md +243 -0
- package/skills/pikku-services/SKILL.md +247 -0
- package/skills/pikku-template-clone/SKILL.md +39 -0
- package/skills/pikku-testing/SKILL.md +428 -0
- package/skills/pikku-trigger/SKILL.md +177 -0
- package/skills/pikku-versioning/SKILL.md +169 -0
- package/skills/pikku-websocket/SKILL.md +239 -0
- package/skills/pikku-workflow/SKILL.md +283 -0
- package/skills/pikku-workflows-client/SKILL.md +150 -0
- package/skills/pikku-ws/SKILL.md +45 -0
- package/console-app/assets/index-BpY2pSuA.css +0 -10
- package/console-app/assets/index-DXLy-_D4.js +0 -717
- package/dist/.pikku/schemas/schemas/GraphStarterInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/GraphStarterOutput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowRunStatus.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowRunnerInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStarterInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStarterOutput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStatusCheckerInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStatusStreamFullInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStatusStreamInput.schema.json +0 -1
- package/dist/src/scaffold/workflow-routes.gen.d.ts +0 -84
- package/dist/src/scaffold/workflow-routes.gen.js +0 -229
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-addon
|
|
3
|
+
description: 'Use when creating or consuming reusable function packages (addons) in Pikku. Covers wireAddon, addon(), pikkuAddonServices, pikkuAddonWireServices, addon package structure, and cross-project function sharing.
|
|
4
|
+
TRIGGER when: code uses wireAddon/addon()/pikkuAddonServices, user asks about addons, reusable function packages, cross-project sharing, or addon package structure.
|
|
5
|
+
DO NOT TRIGGER when: user asks about internal function composition (use pikku-rpc) or general function definitions (use pikku-concepts).'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Pikku Addons
|
|
9
|
+
|
|
10
|
+
## Agent Operating Procedure
|
|
11
|
+
|
|
12
|
+
Use this skill as an execution checklist, not reference material.
|
|
13
|
+
|
|
14
|
+
1. Discover before editing. Prefer OpenCode tools such as `pikku-meta` when available; otherwise run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
|
|
15
|
+
2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
|
|
16
|
+
3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
|
|
17
|
+
4. Validate with the narrowest relevant command first, then run `pikku-verify` or `pikku all` when functions, wirings, schemas, or generated clients may have changed.
|
|
18
|
+
5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
|
|
19
|
+
|
|
20
|
+
Addons are reusable Pikku function packages that can be shared across projects. They bundle functions, services, secrets, and variables into a self-contained NPM package.
|
|
21
|
+
|
|
22
|
+
## Before You Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pikku info functions --verbose # See existing functions and addons
|
|
26
|
+
pikku info tags --verbose # Understand project organization
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
See `pikku-concepts` for the core mental model.
|
|
30
|
+
|
|
31
|
+
## API Reference
|
|
32
|
+
|
|
33
|
+
### `wireAddon(config)`
|
|
34
|
+
|
|
35
|
+
Register an addon in the consuming project:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { wireAddon } from '#pikku'
|
|
39
|
+
|
|
40
|
+
wireAddon({
|
|
41
|
+
name: string, // Namespace for addon functions (e.g. 'todos')
|
|
42
|
+
package: string, // NPM package name (e.g. '@pikku/addon-todos')
|
|
43
|
+
rpcEndpoint?: string, // Optional remote RPC endpoint for distributed execution
|
|
44
|
+
auth?: boolean, // Whether addon functions require authentication
|
|
45
|
+
tags?: string[], // Tags applied to all addon functions
|
|
46
|
+
secretOverrides?: Record<string, string>, // Remap secret names
|
|
47
|
+
variableOverrides?: Record<string, string>, // Remap variable names
|
|
48
|
+
})
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### `addon(name)`
|
|
52
|
+
|
|
53
|
+
Type-safe reference to an addon function — use when wiring to HTTP, agents, etc.:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { addon } from '#pikku'
|
|
57
|
+
|
|
58
|
+
addon('todos:addTodo') // Returns a typed function config
|
|
59
|
+
addon('emails:sendEmail') // Namespace:functionName format
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### `pikkuAddonServices(factory)`
|
|
63
|
+
|
|
64
|
+
Define singleton services for an addon package (created once at startup):
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { pikkuAddonServices } from '#pikku'
|
|
68
|
+
|
|
69
|
+
export const createSingletonServices = pikkuAddonServices(
|
|
70
|
+
async (config, parentServices?) => {
|
|
71
|
+
// parentServices: logger, variables, secrets from the consuming app
|
|
72
|
+
return {
|
|
73
|
+
myStore: new MyStore(),
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### `pikkuAddonWireServices(factory)`
|
|
80
|
+
|
|
81
|
+
Define per-request services for an addon package (created fresh per HTTP request, queue job, etc.):
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { pikkuAddonWireServices } from '#pikku'
|
|
85
|
+
|
|
86
|
+
export const createWireServices = pikkuAddonWireServices(
|
|
87
|
+
async (singletonServices, wire) => {
|
|
88
|
+
// wire: transport context (http, channel, session, etc.)
|
|
89
|
+
const authHeader = wire.http?.request?.header('authorization')
|
|
90
|
+
return {
|
|
91
|
+
myService: new MyService(authHeader),
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Creating an Addon
|
|
98
|
+
|
|
99
|
+
### Scaffold
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx pikku new addon
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Package Structure
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
my-addon/
|
|
109
|
+
├── package.json # Exports .pikku/* and dist/
|
|
110
|
+
├── pikku.config.json # addon: true + metadata
|
|
111
|
+
├── tsconfig.json # #pikku path mapping
|
|
112
|
+
├── src/
|
|
113
|
+
│ ├── services.ts # createSingletonServices (required)
|
|
114
|
+
│ └── functions/
|
|
115
|
+
│ └── *.function.ts # Function definitions
|
|
116
|
+
├── types/
|
|
117
|
+
│ └── application-types.d.ts # SingletonServices interface
|
|
118
|
+
└── .pikku/ # Generated (gitignored)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### pikku.config.json
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"tsconfig": "./tsconfig.json",
|
|
126
|
+
"srcDirectories": ["src", "types"],
|
|
127
|
+
"outDir": "./.pikku",
|
|
128
|
+
"addon": true,
|
|
129
|
+
"node": {
|
|
130
|
+
"displayName": "My Addon",
|
|
131
|
+
"description": "What this addon does",
|
|
132
|
+
"categories": ["General"]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### package.json (key fields)
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"name": "@my-org/addon-todos",
|
|
142
|
+
"imports": {
|
|
143
|
+
"#pikku": "./.pikku/pikku-types.gen.ts",
|
|
144
|
+
"#pikku/*": "./.pikku/*"
|
|
145
|
+
},
|
|
146
|
+
"exports": {
|
|
147
|
+
".": { "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js" },
|
|
148
|
+
"./.pikku/*": "./.pikku/*",
|
|
149
|
+
"./.pikku/pikku-metadata.gen.json": "./.pikku/pikku-metadata.gen.json",
|
|
150
|
+
"./.pikku/rpc/pikku-rpc-wirings-map.internal.gen.js": {
|
|
151
|
+
"types": "./.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"files": ["dist", ".pikku"],
|
|
155
|
+
"peerDependencies": {
|
|
156
|
+
"@pikku/core": "*"
|
|
157
|
+
},
|
|
158
|
+
"scripts": {
|
|
159
|
+
"pikku": "pikku all",
|
|
160
|
+
"build": "tsc && cp -r .pikku dist/"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Services
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
// src/services.ts
|
|
169
|
+
import { pikkuAddonServices, pikkuAddonWireServices } from '#pikku'
|
|
170
|
+
import { TodoStore } from './todo-store.service.js'
|
|
171
|
+
|
|
172
|
+
export const createSingletonServices = pikkuAddonServices(async () => {
|
|
173
|
+
const todoStore = new TodoStore()
|
|
174
|
+
return { todoStore }
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
// Optional — only needed if addon functions require per-request services
|
|
178
|
+
export const createWireServices = pikkuAddonWireServices(
|
|
179
|
+
async (singletonServices, wire) => {
|
|
180
|
+
return {}
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Functions
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
// src/functions/addTodo.function.ts
|
|
189
|
+
import { z } from 'zod'
|
|
190
|
+
import { pikkuSessionlessFunc } from '#pikku'
|
|
191
|
+
|
|
192
|
+
const AddTodoInput = z.object({ title: z.string() })
|
|
193
|
+
const AddTodoOutput = z.object({ id: z.string(), title: z.string() })
|
|
194
|
+
|
|
195
|
+
export const addTodo = pikkuSessionlessFunc({
|
|
196
|
+
description: 'Adds a new todo',
|
|
197
|
+
input: AddTodoInput,
|
|
198
|
+
output: AddTodoOutput,
|
|
199
|
+
func: async ({ todoStore }, { title }) => {
|
|
200
|
+
return todoStore.add(title)
|
|
201
|
+
},
|
|
202
|
+
})
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Build
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
npx pikku all # Generate types
|
|
209
|
+
yarn tsc # Compile TypeScript
|
|
210
|
+
cp -r .pikku dist/ # Include generated files in dist
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Consuming an Addon
|
|
214
|
+
|
|
215
|
+
### Install & Register
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
yarn add @my-org/addon-todos
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
// wirings/todos.wirings.ts
|
|
223
|
+
import { wireAddon } from '#pikku'
|
|
224
|
+
|
|
225
|
+
wireAddon({ name: 'todos', package: '@my-org/addon-todos' })
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
After registration, run `npx pikku all` to generate types for the addon's functions.
|
|
229
|
+
|
|
230
|
+
### Call via RPC
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
export const myFunc = pikkuFunc({
|
|
234
|
+
func: async (_services, data, { rpc }) => {
|
|
235
|
+
const todo = await rpc.invoke('todos:addTodo', { title: 'Buy milk' })
|
|
236
|
+
return todo
|
|
237
|
+
},
|
|
238
|
+
})
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Wire to HTTP
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
import { wireHTTP, addon } from '#pikku'
|
|
245
|
+
|
|
246
|
+
wireHTTP({
|
|
247
|
+
method: 'get',
|
|
248
|
+
route: '/todos',
|
|
249
|
+
func: addon('todos:listTodos'),
|
|
250
|
+
auth: false,
|
|
251
|
+
})
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Use in AI Agents
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
import { pikkuAIAgent } from '#pikku'
|
|
258
|
+
import { addon } from '#pikku'
|
|
259
|
+
|
|
260
|
+
export const todoAgent = pikkuAIAgent({
|
|
261
|
+
name: 'todo-agent',
|
|
262
|
+
description: 'Manages a todo list',
|
|
263
|
+
instructions: 'You help users manage their todos.',
|
|
264
|
+
model: 'openai/gpt-4o',
|
|
265
|
+
tools: [
|
|
266
|
+
addon('todos:listTodos'),
|
|
267
|
+
addon('todos:addTodo'),
|
|
268
|
+
addon('todos:deleteTodo'),
|
|
269
|
+
],
|
|
270
|
+
maxSteps: 5,
|
|
271
|
+
})
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Complete Example
|
|
275
|
+
|
|
276
|
+
```typescript
|
|
277
|
+
// --- ADDON PACKAGE: @my-org/addon-todos ---
|
|
278
|
+
|
|
279
|
+
// src/services.ts
|
|
280
|
+
import { pikkuAddonServices } from '#pikku'
|
|
281
|
+
|
|
282
|
+
export const createSingletonServices = pikkuAddonServices(async () => {
|
|
283
|
+
return { todoStore: new TodoStore() }
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
// src/functions/listTodos.function.ts
|
|
287
|
+
export const listTodos = pikkuSessionlessFunc({
|
|
288
|
+
description: 'List all todos',
|
|
289
|
+
func: async ({ todoStore }) => {
|
|
290
|
+
return { todos: todoStore.list() }
|
|
291
|
+
},
|
|
292
|
+
})
|
|
293
|
+
|
|
294
|
+
// src/functions/addTodo.function.ts
|
|
295
|
+
export const addTodo = pikkuSessionlessFunc({
|
|
296
|
+
description: 'Add a new todo',
|
|
297
|
+
approvalRequired: true,
|
|
298
|
+
approvalDescription: async (_services, { title }) => {
|
|
299
|
+
return `Add a todo called "${title}"`
|
|
300
|
+
},
|
|
301
|
+
input: z.object({ title: z.string() }),
|
|
302
|
+
output: z.object({ id: z.string(), title: z.string() }),
|
|
303
|
+
func: async ({ todoStore }, { title }) => {
|
|
304
|
+
return todoStore.add(title)
|
|
305
|
+
},
|
|
306
|
+
})
|
|
307
|
+
|
|
308
|
+
// --- CONSUMING PROJECT ---
|
|
309
|
+
|
|
310
|
+
// wirings/addons.wirings.ts
|
|
311
|
+
import { wireAddon } from '#pikku'
|
|
312
|
+
wireAddon({ name: 'todos', package: '@my-org/addon-todos' })
|
|
313
|
+
|
|
314
|
+
// wirings/api.http.ts
|
|
315
|
+
import { wireHTTPRoutes, defineHTTPRoutes, addon } from '#pikku'
|
|
316
|
+
|
|
317
|
+
const todoRoutes = defineHTTPRoutes({
|
|
318
|
+
tags: ['todos'],
|
|
319
|
+
auth: false,
|
|
320
|
+
routes: {
|
|
321
|
+
list: { method: 'get', route: '/todos', func: addon('todos:listTodos') },
|
|
322
|
+
add: { method: 'post', route: '/todos', func: addon('todos:addTodo') },
|
|
323
|
+
},
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
wireHTTPRoutes({
|
|
327
|
+
basePath: '/api',
|
|
328
|
+
routes: { todos: todoRoutes },
|
|
329
|
+
})
|
|
330
|
+
```
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-ai-agent
|
|
3
|
+
description: 'Use when building AI agents, chatbots, or LLM-powered assistants with Pikku. Covers pikkuAIAgent, tool registration, memory, streaming, and agent invocation.
|
|
4
|
+
TRIGGER when: code uses pikkuAIAgent/runAIAgent/streamAIAgent, user asks about AI agents, chatbots, LLM assistants, tool-calling agents, or agent memory/streaming.
|
|
5
|
+
DO NOT TRIGGER when: user asks about MCP tool exposure (use pikku-mcp) or general function definitions (use pikku-concepts).'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Pikku AI Agent Wiring
|
|
9
|
+
|
|
10
|
+
## Agent Operating Procedure
|
|
11
|
+
|
|
12
|
+
Use this skill as an execution checklist, not reference material.
|
|
13
|
+
|
|
14
|
+
1. Discover before editing. Prefer OpenCode tools such as `pikku-meta` when available; otherwise run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
|
|
15
|
+
2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
|
|
16
|
+
3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
|
|
17
|
+
4. Validate with the narrowest relevant command first, then run `pikku-verify` or `pikku all` when functions, wirings, schemas, or generated clients may have changed.
|
|
18
|
+
5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
|
|
19
|
+
|
|
20
|
+
Build AI agents that use Pikku functions as tools. Agents support conversation memory, streaming, and multi-step tool execution.
|
|
21
|
+
|
|
22
|
+
## Before You Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pikku info functions --verbose # See existing functions that can be used as agent tools
|
|
26
|
+
pikku info tags --verbose # Understand project organization
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
See `pikku-concepts` for the core mental model.
|
|
30
|
+
|
|
31
|
+
## API Reference
|
|
32
|
+
|
|
33
|
+
### `pikkuAIAgent(config)`
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { pikkuAIAgent } from '#pikku'
|
|
37
|
+
|
|
38
|
+
pikkuAIAgent({
|
|
39
|
+
name: string, // Unique agent identifier
|
|
40
|
+
description: string, // What the agent does
|
|
41
|
+
instructions: string | string[], // System prompt / behavior instructions
|
|
42
|
+
model: string, // LLM model (e.g. 'openai/gpt-4o-mini')
|
|
43
|
+
tools?: PikkuFunc[], // Pikku functions the agent can call
|
|
44
|
+
agents?: AIAgentConfig[], // Sub-agents this agent can delegate to
|
|
45
|
+
memory?: {
|
|
46
|
+
storage?: string, // Service name for persistence (e.g. 'aiStorage')
|
|
47
|
+
vector?: string, // Vector store service name
|
|
48
|
+
embedder?: string, // Embedding service name
|
|
49
|
+
lastMessages?: number, // How many messages to retain in context
|
|
50
|
+
workingMemory?: ZodSchema, // Schema for structured working memory
|
|
51
|
+
},
|
|
52
|
+
maxSteps?: number, // Max tool-call rounds per invocation
|
|
53
|
+
temperature?: number, // LLM temperature (0-1)
|
|
54
|
+
toolChoice?: 'auto' | 'required' | 'none',
|
|
55
|
+
input?: ZodSchema, // Input validation schema
|
|
56
|
+
output?: ZodSchema, // Output validation schema
|
|
57
|
+
tags?: string[], // For grouping and middleware targeting
|
|
58
|
+
aiMiddleware?: PikkuAIMiddlewareHooks[], // AI-specific middleware
|
|
59
|
+
middleware?: PikkuMiddleware[],
|
|
60
|
+
permissions?: PermissionGroup,
|
|
61
|
+
})
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### `runAIAgent(name, input, options)` — Non-streaming
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
const result = await runAIAgent(
|
|
68
|
+
agentName,
|
|
69
|
+
{
|
|
70
|
+
message: string, // User message
|
|
71
|
+
threadId: string, // Conversation thread ID
|
|
72
|
+
resourceId: string, // User/resource identifier
|
|
73
|
+
},
|
|
74
|
+
{ singletonServices }
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
result.text // Agent's text response
|
|
78
|
+
result.steps // Array of tool calls made
|
|
79
|
+
result.usage // Token usage { inputTokens, outputTokens }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### `streamAIAgent(name, input, channel, options)` — Streaming
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
await streamAIAgent(
|
|
86
|
+
agentName,
|
|
87
|
+
{
|
|
88
|
+
message: string,
|
|
89
|
+
threadId: string,
|
|
90
|
+
resourceId: string,
|
|
91
|
+
},
|
|
92
|
+
channel,
|
|
93
|
+
{ singletonServices }
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
// Channel receives events:
|
|
97
|
+
// { type: 'step-start', stepNumber: 1 }
|
|
98
|
+
// { type: 'text-delta', text: '...' }
|
|
99
|
+
// { type: 'reasoning-delta', text: '...' }
|
|
100
|
+
// { type: 'tool-call', toolCallId, toolName, args }
|
|
101
|
+
// { type: 'tool-result', toolCallId, toolName, result }
|
|
102
|
+
// { type: 'agent-call', agentName, session, input }
|
|
103
|
+
// { type: 'agent-result', agentName, session, result }
|
|
104
|
+
// { type: 'approval-request', toolCallId, toolName, args, reason? }
|
|
105
|
+
// { type: 'usage', tokens: { input, output }, model }
|
|
106
|
+
// { type: 'error', message }
|
|
107
|
+
// { type: 'done' }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Usage Patterns
|
|
111
|
+
|
|
112
|
+
### Define an Agent
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
const todoAssistant = pikkuAIAgent({
|
|
116
|
+
name: 'todo-assistant',
|
|
117
|
+
description: 'A helpful assistant that manages todos',
|
|
118
|
+
instructions:
|
|
119
|
+
'You help users manage their todo lists. Be concise and helpful.',
|
|
120
|
+
model: 'openai/gpt-4o-mini',
|
|
121
|
+
tools: [listTodos, createTodo, completeTodo],
|
|
122
|
+
memory: {
|
|
123
|
+
storage: 'aiStorage',
|
|
124
|
+
lastMessages: 20,
|
|
125
|
+
},
|
|
126
|
+
maxSteps: 5,
|
|
127
|
+
temperature: 0.7,
|
|
128
|
+
})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Invoke Non-Streaming
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
const result = await runAIAgent(
|
|
135
|
+
'todo-assistant',
|
|
136
|
+
{
|
|
137
|
+
message: 'Create a task for tomorrow: buy groceries',
|
|
138
|
+
threadId: 'thread-123',
|
|
139
|
+
resourceId: 'user-456',
|
|
140
|
+
},
|
|
141
|
+
{ singletonServices }
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
console.log(result.text) // "I've created a task 'buy groceries' for tomorrow."
|
|
145
|
+
console.log(result.steps) // [{ tool: 'createTodo', args: {...}, result: {...} }]
|
|
146
|
+
console.log(result.usage) // { inputTokens: 150, outputTokens: 42 }
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Stream Responses
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
await streamAIAgent(
|
|
153
|
+
'todo-assistant',
|
|
154
|
+
{
|
|
155
|
+
message: 'Create a task for tomorrow',
|
|
156
|
+
threadId: 'thread-123',
|
|
157
|
+
resourceId: 'user-456',
|
|
158
|
+
},
|
|
159
|
+
channel,
|
|
160
|
+
{ singletonServices }
|
|
161
|
+
)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Complete Example
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
// functions/todos.functions.ts
|
|
168
|
+
export const listTodos = pikkuSessionlessFunc({
|
|
169
|
+
description: 'List all todo items',
|
|
170
|
+
func: async ({ db }, { status }) => {
|
|
171
|
+
return { todos: await db.listTodos(status) }
|
|
172
|
+
},
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
export const createTodo = pikkuFunc({
|
|
176
|
+
description: 'Create a new todo item',
|
|
177
|
+
func: async ({ db }, { text, priority, dueDate }) => {
|
|
178
|
+
return await db.createTodo({ text, priority, dueDate })
|
|
179
|
+
},
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
export const completeTodo = pikkuFunc({
|
|
183
|
+
description: 'Mark a todo as complete',
|
|
184
|
+
func: async ({ db }, { todoId }) => {
|
|
185
|
+
return await db.completeTodo(todoId)
|
|
186
|
+
},
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
// agents/todo-assistant.ts
|
|
190
|
+
const todoAssistant = pikkuAIAgent({
|
|
191
|
+
name: 'todo-assistant',
|
|
192
|
+
description: 'A helpful assistant that manages todos',
|
|
193
|
+
instructions: `You help users manage their todo lists.
|
|
194
|
+
- Be concise and helpful
|
|
195
|
+
- When creating todos, infer priority if not specified
|
|
196
|
+
- When listing todos, summarize the results`,
|
|
197
|
+
model: 'openai/gpt-4o-mini',
|
|
198
|
+
tools: [listTodos, createTodo, completeTodo],
|
|
199
|
+
memory: {
|
|
200
|
+
storage: 'aiStorage',
|
|
201
|
+
lastMessages: 20,
|
|
202
|
+
},
|
|
203
|
+
maxSteps: 5,
|
|
204
|
+
temperature: 0.7,
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
// Wire to HTTP for chat endpoint
|
|
208
|
+
wireHTTP({
|
|
209
|
+
method: 'post',
|
|
210
|
+
route: '/chat',
|
|
211
|
+
func: pikkuFunc({
|
|
212
|
+
title: 'Chat',
|
|
213
|
+
func: async (services, { message, threadId }, wire) => {
|
|
214
|
+
const session = await wire.session.get()
|
|
215
|
+
return await runAIAgent(
|
|
216
|
+
'todo-assistant',
|
|
217
|
+
{
|
|
218
|
+
message,
|
|
219
|
+
threadId,
|
|
220
|
+
resourceId: session.userId,
|
|
221
|
+
},
|
|
222
|
+
{ singletonServices: services }
|
|
223
|
+
)
|
|
224
|
+
},
|
|
225
|
+
}),
|
|
226
|
+
})
|
|
227
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-ai-vercel
|
|
3
|
+
description: 'Use when setting up AI agent execution with the Vercel AI SDK in a Pikku app. Covers VercelAIAgentRunner for streaming and non-streaming AI agent steps.
|
|
4
|
+
TRIGGER when: code uses VercelAIAgentRunner, user asks about Vercel AI SDK integration, AI agent runners, or @pikku/ai-vercel.
|
|
5
|
+
DO NOT TRIGGER when: user asks about AI agent wiring (use pikku-ai-agent) or voice I/O (use pikku-ai-voice).'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Pikku AI Vercel (Agent Runner)
|
|
9
|
+
|
|
10
|
+
## Agent Operating Procedure
|
|
11
|
+
|
|
12
|
+
Use this skill as an execution checklist, not reference material.
|
|
13
|
+
|
|
14
|
+
1. Discover before editing. Prefer OpenCode tools such as `pikku-meta` when available; otherwise run the relevant `pikku meta ... --json` command and inspect only the focused output you need.
|
|
15
|
+
2. Identify the source files that own the behavior. Do not start by reading generated output, `.pikku`, `node_modules`, vendored packages, or broad build artifacts.
|
|
16
|
+
3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
|
|
17
|
+
4. Validate with the narrowest relevant command first, then run `pikku-verify` or `pikku all` when functions, wirings, schemas, or generated clients may have changed.
|
|
18
|
+
5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
|
|
19
|
+
|
|
20
|
+
`@pikku/ai-vercel` provides an AI agent runner backed by the [Vercel AI SDK](https://sdk.vercel.ai/). Implements `AIAgentRunnerService` from `@pikku/core`.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
yarn add @pikku/ai-vercel ai @ai-sdk/openai # or any AI SDK provider
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## API Reference
|
|
29
|
+
|
|
30
|
+
### `VercelAIAgentRunner`
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { VercelAIAgentRunner } from '@pikku/ai-vercel'
|
|
34
|
+
|
|
35
|
+
const runner = new VercelAIAgentRunner(
|
|
36
|
+
providers: Record<string, any> // Map of provider name → Vercel AI SDK provider instance
|
|
37
|
+
)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Methods:**
|
|
41
|
+
|
|
42
|
+
- `stream(params: AIAgentRunnerParams, channel: AIStreamChannel): Promise<AIAgentStepResult>` — Stream AI responses with tool calls
|
|
43
|
+
- `run(params: AIAgentRunnerParams): Promise<AIAgentStepResult>` — Execute a single AI step (non-streaming)
|
|
44
|
+
|
|
45
|
+
The `providers` map lets you register multiple AI providers. Model strings use `provider:model` format (e.g., `"openai:gpt-4o"`).
|
|
46
|
+
|
|
47
|
+
## Usage Patterns
|
|
48
|
+
|
|
49
|
+
### Basic Setup
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { VercelAIAgentRunner } from '@pikku/ai-vercel'
|
|
53
|
+
import { openai } from '@ai-sdk/openai'
|
|
54
|
+
import { anthropic } from '@ai-sdk/anthropic'
|
|
55
|
+
|
|
56
|
+
const createSingletonServices = pikkuServices(async (config) => {
|
|
57
|
+
const aiRunner = new VercelAIAgentRunner({
|
|
58
|
+
openai: openai,
|
|
59
|
+
anthropic: anthropic,
|
|
60
|
+
})
|
|
61
|
+
return { config, aiRunner }
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### With AI Agent Wiring
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { wireAIAgent } from '@pikku/core/ai-agent'
|
|
69
|
+
|
|
70
|
+
wireAIAgent({
|
|
71
|
+
name: 'assistant',
|
|
72
|
+
model: 'openai:gpt-4o',
|
|
73
|
+
systemPrompt: 'You are a helpful assistant.',
|
|
74
|
+
func: myAgentFunc,
|
|
75
|
+
})
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The `VercelAIAgentRunner` is used internally by Pikku's AI agent wiring to execute model calls. See `pikku-ai-agent` for wiring details.
|