@pikku/cli 0.12.20 → 0.12.22
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 +792 -8
- 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 +44 -70
- package/dist/.pikku/function/pikku-function-types.gen.js +33 -40
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +1439 -316
- package/dist/.pikku/function/pikku-functions.gen.js +21 -9
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/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 -10
- 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 +157 -11
- 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/PikkuCommandChannelsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCommandHTTPOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCommandQueueOutput.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/schemas/schemas/WorkflowRunStatus.schema.json +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +237 -629
- 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 +286 -10
- package/dist/src/deploy/analyzer/analyzer.d.ts +16 -1
- package/dist/src/deploy/analyzer/analyzer.js +83 -43
- package/dist/src/deploy/analyzer/manifest.d.ts +10 -0
- package/dist/src/deploy/build-pipeline.d.ts +2 -0
- package/dist/src/deploy/build-pipeline.js +123 -19
- package/dist/src/deploy/bundler/bundler.d.ts +3 -1
- package/dist/src/deploy/bundler/bundler.js +40 -9
- package/dist/src/deploy/bundler/dep-extractor.d.ts +5 -2
- package/dist/src/deploy/bundler/dep-extractor.js +103 -23
- package/dist/src/deploy/bundler/types.d.ts +5 -1
- package/dist/src/deploy/codegen/per-unit-codegen.d.ts +11 -1
- package/dist/src/deploy/codegen/per-unit-codegen.js +49 -6
- package/dist/src/deploy/plan/planner.js +25 -3
- package/dist/src/deploy/plan/provider.d.ts +2 -0
- 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-apply.js +6 -4
- 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/deploy-plan.js +7 -1
- 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 +7 -1
- 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/versions-update.js +4 -2
- 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/channels/pikku-command-channels.js +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-console-functions.js +5 -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 +105 -80
- 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-routes.js +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-map.js +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-command-queue.js +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-public-rpc.js +5 -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-remote-rpc.js +5 -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/rpc/serialize-typed-rpc-map.js +16 -2
- 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 +56 -2
- package/dist/src/functions/workflows/all.workflow.js +45 -12
- package/dist/src/scaffold/rpc-remote.gen.d.ts +3 -3
- package/dist/src/scaffold/rpc-remote.gen.js +7 -2
- package/dist/src/scaffold/workflow-routes.gen.d.ts +18 -18
- package/dist/src/scaffold/workflow-routes.gen.js +33 -1
- package/dist/src/services/cli-logger.service.d.ts +22 -3
- package/dist/src/services/cli-logger.service.js +107 -41
- package/dist/src/services.js +32 -67
- 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/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 +208 -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 +205 -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/cli/pikku-cli-client.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli-client.gen.js +0 -44
- /package/dist/.pikku/schemas/schemas/{PikkuChannelsOutput.schema.json → PikkuCLIEntryOutput.schema.json} +0 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-config
|
|
3
|
+
description: 'Use when managing secrets, environment variables, config, or OAuth2 credentials in a Pikku app. Covers wireSecret, wireVariable, wireOAuth2Credential, and typed config access.
|
|
4
|
+
TRIGGER when: code uses wireSecret/wireVariable/wireOAuth2Credential, user asks about env vars, secrets, config, OAuth2, or "how do I access environment variables".
|
|
5
|
+
DO NOT TRIGGER when: user asks about API versioning/breaking changes (use pikku-versioning), service factories (use pikku-services), or auth middleware (use pikku-security).'
|
|
6
|
+
installGroups: [core]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pikku Config, Secrets & OAuth2
|
|
10
|
+
|
|
11
|
+
## Agent Operating Procedure
|
|
12
|
+
|
|
13
|
+
Use this skill as an execution checklist, not reference material.
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
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.
|
|
17
|
+
3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
|
|
18
|
+
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.
|
|
19
|
+
5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
|
|
20
|
+
|
|
21
|
+
Manage secrets, variables, and OAuth2 credentials. Never use `process.env` in Pikku functions — use typed services instead.
|
|
22
|
+
|
|
23
|
+
## Before You Start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pikku info functions --verbose # See existing functions and their versions
|
|
27
|
+
pikku info tags --verbose # Understand project organization
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
See `pikku-concepts` for the core mental model.
|
|
31
|
+
|
|
32
|
+
## Secrets & Variables
|
|
33
|
+
|
|
34
|
+
### `wireSecret(config)`
|
|
35
|
+
|
|
36
|
+
Declare a secret with a Zod schema for type-safe access:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
wireSecret({
|
|
40
|
+
name: string, // Secret identifier
|
|
41
|
+
schema: ZodSchema, // Shape and validation
|
|
42
|
+
})
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### `wireVariable(config)`
|
|
46
|
+
|
|
47
|
+
Declare a variable (non-sensitive config) with a Zod schema:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
wireVariable({
|
|
51
|
+
name: string,
|
|
52
|
+
schema: ZodSchema,
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Accessing in Functions
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
// Secrets — encrypted, sensitive values
|
|
60
|
+
const config = await services.secrets.getSecretJSON('SECRET_NAME')
|
|
61
|
+
|
|
62
|
+
// Variables — plain-text configuration
|
|
63
|
+
const flags = await services.variables.getVariableJSON('VARIABLE_NAME')
|
|
64
|
+
|
|
65
|
+
// Simple string access
|
|
66
|
+
const apiKey = services.variables.get('API_KEY')
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Local Development Services
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { LocalSecretService, LocalVariablesService } from '@pikku/core/services'
|
|
73
|
+
|
|
74
|
+
const createSingletonServices = pikkuServices(async (config) => ({
|
|
75
|
+
secrets: new LocalSecretService(), // Reads from .env or local files
|
|
76
|
+
variables: new LocalVariablesService(), // Reads from environment
|
|
77
|
+
}))
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Usage Patterns
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
// Declare secrets with typed schemas
|
|
84
|
+
wireSecret({
|
|
85
|
+
name: 'STRIPE_CONFIG',
|
|
86
|
+
schema: z.object({
|
|
87
|
+
apiKey: z.string().startsWith('sk_'),
|
|
88
|
+
webhookSecret: z.string(),
|
|
89
|
+
}),
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
// In your function — fully typed
|
|
93
|
+
const config = await secrets.getSecretJSON('STRIPE_CONFIG')
|
|
94
|
+
// config.apiKey → string (autocompleted)
|
|
95
|
+
// config.webhookSecret → string (autocompleted)
|
|
96
|
+
|
|
97
|
+
// Declare variables
|
|
98
|
+
wireVariable({
|
|
99
|
+
name: 'FEATURE_FLAGS',
|
|
100
|
+
schema: z.object({
|
|
101
|
+
darkMode: z.boolean(),
|
|
102
|
+
maxUploadMB: z.number().default(10),
|
|
103
|
+
}),
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
// Read it — typed and validated
|
|
107
|
+
const flags = await variables.getVariableJSON('FEATURE_FLAGS')
|
|
108
|
+
// flags.darkMode → boolean
|
|
109
|
+
// flags.maxUploadMB → number
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## OAuth2 Credentials
|
|
113
|
+
|
|
114
|
+
### `wireOAuth2Credential(config)`
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
wireOAuth2Credential({
|
|
118
|
+
name: string, // Credential identifier
|
|
119
|
+
displayName: string, // Human-readable name
|
|
120
|
+
secretId: string, // Secret holding { clientId, clientSecret }
|
|
121
|
+
tokenSecretId: string, // Secret for token storage (auto-refreshed)
|
|
122
|
+
authorizationUrl: string, // OAuth2 authorization endpoint
|
|
123
|
+
tokenUrl: string, // OAuth2 token endpoint
|
|
124
|
+
scopes: string[], // Required OAuth2 scopes
|
|
125
|
+
})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Usage
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
wireOAuth2Credential({
|
|
132
|
+
name: 'slackOAuth',
|
|
133
|
+
displayName: 'Slack OAuth',
|
|
134
|
+
secretId: 'SLACK_OAUTH_APP',
|
|
135
|
+
tokenSecretId: 'SLACK_OAUTH_TOKENS',
|
|
136
|
+
authorizationUrl: 'https://slack.com/oauth/v2/authorize',
|
|
137
|
+
tokenUrl: 'https://slack.com/api/oauth.v2.access',
|
|
138
|
+
scopes: ['chat:write', 'channels:read'],
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
// In your function — tokens refresh automatically
|
|
142
|
+
const response = await slackOAuth.request(
|
|
143
|
+
'https://slack.com/api/chat.postMessage',
|
|
144
|
+
{
|
|
145
|
+
method: 'POST',
|
|
146
|
+
body: JSON.stringify({ channel, text }),
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
const data = await response.json()
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Key Rule
|
|
153
|
+
|
|
154
|
+
**Never use `process.env` inside Pikku functions.** Use the `variables` or `secrets` service:
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
// ❌ Wrong
|
|
158
|
+
const apiKey = process.env.API_KEY
|
|
159
|
+
|
|
160
|
+
// ✅ Correct
|
|
161
|
+
const apiKey = services.variables.get('API_KEY')
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`process.env` belongs only in server bootstrap code (`start.ts`).
|
|
165
|
+
|
|
166
|
+
## Complete Example
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
// schemas/config.ts
|
|
170
|
+
wireSecret({
|
|
171
|
+
name: 'DATABASE_CONFIG',
|
|
172
|
+
schema: z.object({
|
|
173
|
+
connectionString: z.string().url(),
|
|
174
|
+
maxPoolSize: z.number().default(10),
|
|
175
|
+
}),
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
wireVariable({
|
|
179
|
+
name: 'APP_CONFIG',
|
|
180
|
+
schema: z.object({
|
|
181
|
+
appName: z.string(),
|
|
182
|
+
maxUploadSizeMB: z.number().default(10),
|
|
183
|
+
maintenanceMode: z.boolean().default(false),
|
|
184
|
+
}),
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
wireOAuth2Credential({
|
|
188
|
+
name: 'githubOAuth',
|
|
189
|
+
displayName: 'GitHub OAuth',
|
|
190
|
+
secretId: 'GITHUB_OAUTH_APP',
|
|
191
|
+
tokenSecretId: 'GITHUB_OAUTH_TOKENS',
|
|
192
|
+
authorizationUrl: 'https://github.com/login/oauth/authorize',
|
|
193
|
+
tokenUrl: 'https://github.com/login/oauth/access_token',
|
|
194
|
+
scopes: ['read:user', 'repo'],
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
// functions/admin.functions.ts
|
|
198
|
+
export const getAppStatus = pikkuSessionlessFunc({
|
|
199
|
+
title: 'Get App Status',
|
|
200
|
+
func: async ({ variables, secrets }) => {
|
|
201
|
+
const appConfig = await variables.getVariableJSON('APP_CONFIG')
|
|
202
|
+
return {
|
|
203
|
+
appName: appConfig.appName,
|
|
204
|
+
maintenanceMode: appConfig.maintenanceMode,
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
})
|
|
208
|
+
```
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-cron
|
|
3
|
+
description: 'Use when adding scheduled tasks, recurring jobs, or cron-based automation to a Pikku app. Covers wireScheduler, cron expressions, scheduled task wire object, and scheduler middleware.
|
|
4
|
+
TRIGGER when: code uses wireScheduler, user asks about cron, scheduled tasks, recurring jobs, or "run every X minutes/hours".
|
|
5
|
+
DO NOT TRIGGER when: user asks about background jobs with retries (use pikku-queue) or event-driven triggers (use pikku-trigger).'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Pikku Cron/Scheduler 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
|
+
Wire Pikku functions to run on a schedule using cron expressions. Uses `pikkuVoidFunc` (no input/output).
|
|
21
|
+
|
|
22
|
+
## Before You Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pikku info functions --verbose # See existing functions and their types
|
|
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
|
+
### `wireScheduler(config)`
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { wireScheduler } from '@pikku/core/scheduler'
|
|
37
|
+
|
|
38
|
+
wireScheduler({
|
|
39
|
+
name: string, // Unique scheduler name
|
|
40
|
+
schedule: string, // Cron expression
|
|
41
|
+
func: PikkuVoidFunc, // Must be pikkuVoidFunc (no input/output)
|
|
42
|
+
middleware?: PikkuMiddleware[],
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Wire Object (`wire.scheduledTask`)
|
|
47
|
+
|
|
48
|
+
Inside scheduled functions:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
wire.scheduledTask.name // Scheduler name
|
|
52
|
+
wire.scheduledTask.schedule // Cron expression string
|
|
53
|
+
wire.scheduledTask.executionTime // When this execution was triggered
|
|
54
|
+
wire.scheduledTask.skip(reason) // Skip this execution (no error)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Cron Expression Reference
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
┌───────────── minute (0-59)
|
|
61
|
+
│ ┌───────────── hour (0-23)
|
|
62
|
+
│ │ ┌───────────── day of month (1-31)
|
|
63
|
+
│ │ │ ┌───────────── month (1-12)
|
|
64
|
+
│ │ │ │ ┌───────────── day of week (0-7, 0 and 7 = Sunday)
|
|
65
|
+
│ │ │ │ │
|
|
66
|
+
* * * * *
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Common patterns:
|
|
70
|
+
|
|
71
|
+
| Expression | Meaning |
|
|
72
|
+
| ------------- | -------------------------- |
|
|
73
|
+
| `*/5 * * * *` | Every 5 minutes |
|
|
74
|
+
| `0 9 * * *` | Daily at 9:00 AM |
|
|
75
|
+
| `0 9 * * 1` | Every Monday at 9:00 AM |
|
|
76
|
+
| `0 0 1 * *` | First of month at midnight |
|
|
77
|
+
| `0 */6 * * *` | Every 6 hours |
|
|
78
|
+
| `30 2 * * 0` | Sundays at 2:30 AM |
|
|
79
|
+
|
|
80
|
+
## Usage Patterns
|
|
81
|
+
|
|
82
|
+
### Basic Scheduled Task
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
const dailySummary = pikkuVoidFunc({
|
|
86
|
+
title: 'Daily Summary',
|
|
87
|
+
func: async ({ db, emailService, logger }) => {
|
|
88
|
+
logger.info('Generating daily summary')
|
|
89
|
+
const stats = await db.getDailyStats()
|
|
90
|
+
await emailService.sendSummary(stats)
|
|
91
|
+
},
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
wireScheduler({
|
|
95
|
+
name: 'dailySummary',
|
|
96
|
+
schedule: '0 9 * * *',
|
|
97
|
+
func: dailySummary,
|
|
98
|
+
})
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Using the Wire Object
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
const weeklyCleanup = pikkuVoidFunc({
|
|
105
|
+
title: 'Weekly Cleanup',
|
|
106
|
+
func: async ({ db, logger }, _input, wire) => {
|
|
107
|
+
logger.info(`Running: ${wire.scheduledTask.name}`)
|
|
108
|
+
logger.info(`Schedule: ${wire.scheduledTask.schedule}`)
|
|
109
|
+
logger.info(`Execution time: ${wire.scheduledTask.executionTime}`)
|
|
110
|
+
|
|
111
|
+
const staleCount = await db.countStaleTodos()
|
|
112
|
+
if (staleCount === 0) {
|
|
113
|
+
wire.scheduledTask.skip('No stale todos found')
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
await db.deleteCompletedTodos({ olderThan: '30d' })
|
|
118
|
+
logger.info(`Cleaned ${staleCount} stale todos`)
|
|
119
|
+
},
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
wireScheduler({
|
|
123
|
+
name: 'weeklyCleanup',
|
|
124
|
+
schedule: '0 0 * * 0',
|
|
125
|
+
func: weeklyCleanup,
|
|
126
|
+
})
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Scheduler Middleware
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
const schedulerMetrics = pikkuMiddleware(
|
|
133
|
+
async ({ logger }, { scheduledTask }, next) => {
|
|
134
|
+
const start = Date.now()
|
|
135
|
+
logger.info(`Task started: ${scheduledTask.name}`)
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
await next()
|
|
139
|
+
logger.info(`Task completed: ${scheduledTask.name}`, {
|
|
140
|
+
duration: Date.now() - start,
|
|
141
|
+
})
|
|
142
|
+
} catch (error) {
|
|
143
|
+
logger.error(`Task failed: ${scheduledTask.name}`, {
|
|
144
|
+
error: error.message,
|
|
145
|
+
duration: Date.now() - start,
|
|
146
|
+
})
|
|
147
|
+
throw error
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
wireScheduler({
|
|
153
|
+
name: 'dailySummary',
|
|
154
|
+
schedule: '0 9 * * *',
|
|
155
|
+
func: dailySummary,
|
|
156
|
+
middleware: [schedulerMetrics],
|
|
157
|
+
})
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Complete Example
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
// functions/scheduled.functions.ts
|
|
164
|
+
export const dailySummary = pikkuVoidFunc({
|
|
165
|
+
title: 'Daily Summary',
|
|
166
|
+
func: async ({ db, emailService, logger }) => {
|
|
167
|
+
const stats = await db.getDailyStats()
|
|
168
|
+
await emailService.sendSummary(stats)
|
|
169
|
+
logger.info('Daily summary sent', { stats })
|
|
170
|
+
},
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
export const cleanupExpired = pikkuVoidFunc({
|
|
174
|
+
title: 'Cleanup Expired',
|
|
175
|
+
func: async ({ db, logger }, _input, wire) => {
|
|
176
|
+
const count = await db.countExpiredSessions()
|
|
177
|
+
if (count === 0) {
|
|
178
|
+
wire.scheduledTask.skip('No expired sessions')
|
|
179
|
+
return
|
|
180
|
+
}
|
|
181
|
+
await db.deleteExpiredSessions()
|
|
182
|
+
logger.info(`Cleaned ${count} expired sessions`)
|
|
183
|
+
},
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
export const syncInventory = pikkuVoidFunc({
|
|
187
|
+
title: 'Sync Inventory',
|
|
188
|
+
func: async ({ inventoryApi, db, logger }) => {
|
|
189
|
+
const updates = await inventoryApi.getChanges()
|
|
190
|
+
await db.applyInventoryUpdates(updates)
|
|
191
|
+
logger.info(`Synced ${updates.length} inventory changes`)
|
|
192
|
+
},
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
// wirings/scheduler.wiring.ts
|
|
196
|
+
wireScheduler({
|
|
197
|
+
name: 'dailySummary',
|
|
198
|
+
schedule: '0 9 * * *',
|
|
199
|
+
func: dailySummary,
|
|
200
|
+
})
|
|
201
|
+
wireScheduler({
|
|
202
|
+
name: 'cleanupExpired',
|
|
203
|
+
schedule: '0 */6 * * *',
|
|
204
|
+
func: cleanupExpired,
|
|
205
|
+
})
|
|
206
|
+
wireScheduler({
|
|
207
|
+
name: 'syncInventory',
|
|
208
|
+
schedule: '*/15 * * * *',
|
|
209
|
+
func: syncInventory,
|
|
210
|
+
})
|
|
211
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-deploy-azure
|
|
3
|
+
description: 'Use when deploying a Pikku app to Azure Functions. Covers PikkuAzFunctionsLogger and PikkuAzTimerRequest for Azure Functions runtime.
|
|
4
|
+
TRIGGER when: user asks about Azure Functions, Azure deployment, or @pikku/azure-functions.
|
|
5
|
+
DO NOT TRIGGER when: user asks about AWS Lambda (use pikku-deploy-lambda) or Cloudflare Workers (use pikku-deploy-cloudflare).'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Pikku Azure Functions Deployment
|
|
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/azure-functions` provides Azure Functions runtime adapters for Pikku.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
yarn add @pikku/azure-functions @azure/functions
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## API Reference
|
|
29
|
+
|
|
30
|
+
### `PikkuAzFunctionsLogger`
|
|
31
|
+
|
|
32
|
+
Logger implementation that integrates with Azure Functions' built-in logging context.
|
|
33
|
+
|
|
34
|
+
### `PikkuAzTimerRequest`
|
|
35
|
+
|
|
36
|
+
Timer trigger request handler for running Pikku scheduled functions as Azure Timer Triggers.
|
|
37
|
+
|
|
38
|
+
## Usage Patterns
|
|
39
|
+
|
|
40
|
+
### HTTP Function
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { app } from '@azure/functions'
|
|
44
|
+
import { PikkuAzFunctionsLogger } from '@pikku/azure-functions'
|
|
45
|
+
|
|
46
|
+
app.http('api', {
|
|
47
|
+
methods: ['GET', 'POST', 'PUT', 'DELETE'],
|
|
48
|
+
route: '{*path}',
|
|
49
|
+
handler: async (request, context) => {
|
|
50
|
+
const logger = new PikkuAzFunctionsLogger(context)
|
|
51
|
+
// Wire Pikku HTTP runner with Azure request/response
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Timer Trigger
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { app } from '@azure/functions'
|
|
60
|
+
import { PikkuAzTimerRequest } from '@pikku/azure-functions'
|
|
61
|
+
|
|
62
|
+
app.timer('scheduler', {
|
|
63
|
+
schedule: '0 */5 * * * *',
|
|
64
|
+
handler: async (timer, context) => {
|
|
65
|
+
const request = new PikkuAzTimerRequest(timer)
|
|
66
|
+
// Process scheduled Pikku functions
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-deploy-cloudflare
|
|
3
|
+
description: 'Use when deploying a Pikku app to Cloudflare Workers. Covers HTTP fetch handler, scheduled tasks, and WebSocket via Durable Objects.
|
|
4
|
+
TRIGGER when: code imports @pikku/cloudflare, user mentions Cloudflare Workers deployment, or worker entry uses ExportedHandler/wrangler.toml.
|
|
5
|
+
DO NOT TRIGGER when: just defining functions/wirings without Cloudflare-specific code.'
|
|
6
|
+
installGroups: [fabric]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pikku Cloudflare Workers Deployment
|
|
10
|
+
|
|
11
|
+
## Agent Operating Procedure
|
|
12
|
+
|
|
13
|
+
Use this skill as an execution checklist, not reference material.
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
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.
|
|
17
|
+
3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
|
|
18
|
+
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.
|
|
19
|
+
5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add @pikku/cloudflare
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Worker Entry
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { runFetch, runScheduled } from '@pikku/cloudflare'
|
|
29
|
+
import { setupServices } from './setup-services.js'
|
|
30
|
+
import './.pikku/pikku-bootstrap.gen.js'
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
async scheduled(controller, env) {
|
|
34
|
+
await setupServices(env)
|
|
35
|
+
await runScheduled(controller)
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
async fetch(request, env): Promise<Response> {
|
|
39
|
+
await setupServices(env)
|
|
40
|
+
return await runFetch(request as unknown as Request)
|
|
41
|
+
},
|
|
42
|
+
} satisfies ExportedHandler<Record<string, string>>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Service Setup
|
|
46
|
+
|
|
47
|
+
Cloudflare passes env variables per-request — wrap them with Pikku services:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// setup-services.ts
|
|
51
|
+
import { LocalVariablesService, LocalSecretService } from '@pikku/core/services'
|
|
52
|
+
import { createConfig, createSingletonServices } from './services.js'
|
|
53
|
+
|
|
54
|
+
export const setupServices = async (
|
|
55
|
+
env: Record<string, string | undefined>
|
|
56
|
+
) => {
|
|
57
|
+
const localVariables = new LocalVariablesService(env)
|
|
58
|
+
const config = await createConfig(localVariables)
|
|
59
|
+
const localSecrets = new LocalSecretService(localVariables)
|
|
60
|
+
return await createSingletonServices(config, {
|
|
61
|
+
variables: localVariables,
|
|
62
|
+
secrets: localSecrets,
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## WebSocket (Durable Objects)
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import { CloudflareWebSocketHibernationServer } from '@pikku/cloudflare'
|
|
71
|
+
|
|
72
|
+
export class WebSocketHibernationServer extends CloudflareWebSocketHibernationServer {
|
|
73
|
+
protected async getParams() {
|
|
74
|
+
const singletonServices = await setupServices(this.env)
|
|
75
|
+
return { singletonServices }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Register the Durable Object in `wrangler.toml` and export from the worker entry.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-deploy-express
|
|
3
|
+
description: 'Use when deploying a Pikku app with Express. Covers PikkuExpressServer standalone and pikkuExpressMiddleware for existing Express apps.
|
|
4
|
+
TRIGGER when: code imports @pikku/express or @pikku/express-middleware, user mentions Express deployment, or start.ts creates a PikkuExpressServer.
|
|
5
|
+
DO NOT TRIGGER when: just defining functions/wirings without Express-specific code.'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Pikku Express Deployment
|
|
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
|
+
## Standalone Server
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
yarn add @pikku/express
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { PikkuExpressServer } from '@pikku/express'
|
|
28
|
+
import './.pikku/pikku-bootstrap.gen.js'
|
|
29
|
+
import { createConfig, createSingletonServices } from './services.js'
|
|
30
|
+
|
|
31
|
+
const config = await createConfig()
|
|
32
|
+
const singletonServices = await createSingletonServices(config)
|
|
33
|
+
|
|
34
|
+
const appServer = new PikkuExpressServer(
|
|
35
|
+
{ ...config, port: 4002, hostname: 'localhost' },
|
|
36
|
+
singletonServices.logger
|
|
37
|
+
)
|
|
38
|
+
appServer.enableExitOnSigInt()
|
|
39
|
+
await appServer.init()
|
|
40
|
+
await appServer.start()
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Constructor:** `new PikkuExpressServer(config, logger)`
|
|
44
|
+
|
|
45
|
+
**Config extends CoreConfig with:**
|
|
46
|
+
|
|
47
|
+
- `port: number`
|
|
48
|
+
- `hostname: string`
|
|
49
|
+
- `healthCheckPath?: string`
|
|
50
|
+
- `limits?: Partial<Record<string, string>>`
|
|
51
|
+
- `content?: LocalContentConfig` (for static assets / file uploads)
|
|
52
|
+
|
|
53
|
+
**Methods:**
|
|
54
|
+
|
|
55
|
+
- `init(httpOptions?): Promise<void>` — Register middleware and routes
|
|
56
|
+
- `start(): Promise<void>` — Start listening
|
|
57
|
+
- `stop(): Promise<void>` — Graceful shutdown
|
|
58
|
+
- `enableExitOnSigInt(): Promise<void>` — SIGINT handler
|
|
59
|
+
- `enableCors(options): void` — Enable CORS
|
|
60
|
+
- `enableStaticAssets(): void` — Serve static files (requires `content` config)
|
|
61
|
+
|
|
62
|
+
**Property:** `app: Express` — Direct access to Express instance for custom middleware.
|
|
63
|
+
|
|
64
|
+
## Middleware (existing Express app)
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
yarn add @pikku/express-middleware
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import express from 'express'
|
|
72
|
+
import { pikkuExpressMiddleware } from '@pikku/express-middleware'
|
|
73
|
+
import './.pikku/pikku-bootstrap.gen.js'
|
|
74
|
+
|
|
75
|
+
const app = express()
|
|
76
|
+
app.use(
|
|
77
|
+
pikkuExpressMiddleware({
|
|
78
|
+
logger: singletonServices.logger,
|
|
79
|
+
logRoutes: true,
|
|
80
|
+
loadSchemas: true,
|
|
81
|
+
})
|
|
82
|
+
)
|
|
83
|
+
```
|