@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,217 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-i18n
|
|
3
|
+
description: 'Wire i18n into a Pikku frontend (Vite SPA, Vite SSR, or Next.js app-router) with react-i18next + i18next. English by default, every user-facing string goes through a `t()` token, and additional languages are served under `/de` `/es` URL prefixes. TRIGGER when: scaffolding or editing a frontend and writing user-facing text, adding a second language, or asked to "make this translatable / use tokens / add i18n". DO NOT TRIGGER for backend functions, error messages thrown from functions, or log output.'
|
|
4
|
+
installGroups: [core]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Pikku i18n
|
|
8
|
+
|
|
9
|
+
## Agent Operating Procedure
|
|
10
|
+
|
|
11
|
+
Use this skill as an execution checklist, not reference material.
|
|
12
|
+
|
|
13
|
+
1. Every user-facing string in a frontend is a token. Never hardcode display text — write `t('some.token')` and put the English copy in `i18n/en.json`. This holds even when the app ships only English; the tokens are the seam a second language slots into later.
|
|
14
|
+
2. One `i18n/<lang>.json` file per language per app, sitting next to the i18n config in a single `i18n/` folder. English (`en`) is the default and is the only locale registered until someone adds another.
|
|
15
|
+
3. Pick the delivery pattern by framework (see below). The token files and config shape are identical across frameworks; only _how the active locale reaches the renderer_ differs.
|
|
16
|
+
4. Validate with the app's own `tsc` then its `build`. For Next.js, a clean `dev` is not enough — run `build`, because the RSC page-data collection step is where i18n wiring mistakes surface.
|
|
17
|
+
|
|
18
|
+
## The rules that don't change
|
|
19
|
+
|
|
20
|
+
- Library: `react-i18next` + `i18next`. Nothing else.
|
|
21
|
+
- Locale files live next to the config in an `i18n/` folder — `src/i18n/<lang>.json` (Vite) or `app/i18n/<lang>.json` (Next.js) — imported statically. **Do not** put them under `public/` — Vite cannot `import` from `public/`, and a runtime fetch is unnecessary: UI-string files are a few KB, so static-import every locale and move on. Do not reach for `i18next-http-backend`, lazy `import()`, or per-locale code-splitting.
|
|
22
|
+
- Default locale is `en`. Adding a language = drop `i18n/<lang>.json`, import + register it in the config, done. Its content is then served under the `/<lang>` URL prefix; the default locale needs no prefix.
|
|
23
|
+
- Keys are namespaced by area (`auth.login.title`, `board.createCta`). Interpolate with `{{name}}` and pass `t('key', { name })`.
|
|
24
|
+
|
|
25
|
+
## Type safety — and why deploys block on i18n
|
|
26
|
+
|
|
27
|
+
Tokens are **typed**, not stringly-typed. Each config augments i18next's
|
|
28
|
+
`CustomTypeOptions` with `resources: { translation: typeof en }` (the block is in
|
|
29
|
+
every config shape below). i18next flattens `typeof en` into a union of dot-path
|
|
30
|
+
keys, so:
|
|
31
|
+
|
|
32
|
+
- `t('auth.login.titel')` (typo) or `t('auth.removed')` (deleted key) is a **TypeScript error**, not a silent runtime `auth.removed` string.
|
|
33
|
+
- An added locale registered as `de satisfies typeof en` fails to compile if `de.json` is missing keys or has drifted from `en.json`.
|
|
34
|
+
|
|
35
|
+
This is enforced at deploy: the build pipeline runs each frontend's `tsc`
|
|
36
|
+
(`yarn tsc` / `tsc --noEmit`) **before** building it, and a type error aborts the
|
|
37
|
+
deploy. `vite build` does not type-check on its own, so this gate is the only
|
|
38
|
+
thing standing between a broken/missing token and production. Keep a `"tsc":
|
|
39
|
+
"tsc --noEmit"` script in every frontend's `package.json` so the gate uses it.
|
|
40
|
+
|
|
41
|
+
The type gate catches _invalid_ tokens but not _inlined_ strings — a hardcoded
|
|
42
|
+
`<h1>Welcome</h1>` compiles fine. Catching those is best-effort (the builder
|
|
43
|
+
agent is told never to inline) plus the debug mode below.
|
|
44
|
+
|
|
45
|
+
## i18n debug mode (find inlined strings)
|
|
46
|
+
|
|
47
|
+
Each config registers an i18next `postProcessor` named `i18nDebug` that, when
|
|
48
|
+
enabled, masks every _translated_ string to block glyphs (`█`). The trick: with
|
|
49
|
+
it on, anything still readable on screen is text that **never went through a
|
|
50
|
+
token** — i.e. a hardcoded/inlined string. It's a visual leak detector for
|
|
51
|
+
missing i18n, not a runtime feature, so it ships **off by default**.
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
export function isI18nDebug(): boolean {
|
|
55
|
+
if (typeof process !== 'undefined' && process.env?.I18N_DEBUG === '1')
|
|
56
|
+
return true
|
|
57
|
+
if (typeof window === 'undefined') return false
|
|
58
|
+
const params = new URLSearchParams(window.location.search)
|
|
59
|
+
if (params.has('i18n-debug')) return params.get('i18n-debug') !== '0'
|
|
60
|
+
return window.localStorage?.getItem('i18n-debug') === '1'
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const i18nDebugPostProcessor = {
|
|
64
|
+
type: 'postProcessor' as const,
|
|
65
|
+
name: 'i18nDebug',
|
|
66
|
+
process: (value: string) =>
|
|
67
|
+
isI18nDebug() ? value.replace(/\S/g, '█') : value,
|
|
68
|
+
}
|
|
69
|
+
// register on the instance: `.use(i18nDebugPostProcessor)` and add
|
|
70
|
+
// `postProcess: ['i18nDebug']` to `.init({ ... })`.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- **Client (Vite SPA/SSR):** toggle with `?i18n-debug` in the URL or `localStorage['i18n-debug'] = '1'`.
|
|
74
|
+
- **Server (Next.js server components):** there is no per-request URL toggle — enable for a build with `I18N_DEBUG=1` (the helper only checks the env var server-side).
|
|
75
|
+
|
|
76
|
+
All the bundled templates already wire this; mirror it when hand-wiring i18n in a new app. (A future e2e check can flip the flag and assert no unmasked text renders.)
|
|
77
|
+
|
|
78
|
+
## Config shape (client / SPA)
|
|
79
|
+
|
|
80
|
+
`src/i18n/config.ts`:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
import i18n from 'i18next'
|
|
84
|
+
import { initReactI18next } from 'react-i18next'
|
|
85
|
+
import en from './en.json'
|
|
86
|
+
|
|
87
|
+
// Typed tokens. i18next flattens this resource type into dot-path keys, so
|
|
88
|
+
// `t('auth.login.title')` is checked and a typo/removed key is a compile error.
|
|
89
|
+
declare module 'i18next' {
|
|
90
|
+
interface CustomTypeOptions {
|
|
91
|
+
defaultNS: 'translation'
|
|
92
|
+
resources: {
|
|
93
|
+
translation: typeof en
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const supportedLocales = ['en'] as const
|
|
99
|
+
export type Locale = (typeof supportedLocales)[number]
|
|
100
|
+
export const defaultLocale: Locale = 'en'
|
|
101
|
+
|
|
102
|
+
export function detectLocale(pathname: string): Locale {
|
|
103
|
+
const segment = pathname.split('/')[1]
|
|
104
|
+
if (supportedLocales.includes(segment as Locale)) return segment as Locale
|
|
105
|
+
if (typeof navigator !== 'undefined') {
|
|
106
|
+
const lang = navigator.language?.split('-')[0]
|
|
107
|
+
if (supportedLocales.includes(lang as Locale)) return lang as Locale
|
|
108
|
+
}
|
|
109
|
+
return defaultLocale
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
i18n.use(initReactI18next).init({
|
|
113
|
+
resources: { en: { translation: en } },
|
|
114
|
+
lng:
|
|
115
|
+
typeof window !== 'undefined'
|
|
116
|
+
? detectLocale(window.location.pathname)
|
|
117
|
+
: defaultLocale,
|
|
118
|
+
fallbackLng: defaultLocale,
|
|
119
|
+
interpolation: { escapeValue: false },
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
export default i18n
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Import it once for its side effect at the app entry (`import './i18n/config'` in `main.tsx`), then use the hook in components:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { useTranslation } from 'react-i18next'
|
|
129
|
+
function Page() {
|
|
130
|
+
const { t } = useTranslation()
|
|
131
|
+
return <h1>{t('landing.title')}</h1>
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Non-component helpers (formatters, status maps) can't use the hook — import the instance and call it directly:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import i18n from '../i18n/config'
|
|
139
|
+
export const prettyStatus = (s: string) => i18n.t(`status.${s}`)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Per-framework delivery
|
|
143
|
+
|
|
144
|
+
### Vite SPA
|
|
145
|
+
|
|
146
|
+
The config above is the whole story. `import './i18n/config'` in `main.tsx`; `useTranslation` everywhere.
|
|
147
|
+
|
|
148
|
+
### Vite SSR (`@cloudflare/vite-plugin` / Worker)
|
|
149
|
+
|
|
150
|
+
Same config, but `import './i18n/config'` in **both** the worker entry (`worker.tsx`) and the client entry (`client.tsx`) so the global i18next instance is initialised on each side before `<App/>` renders. The locale JSON is bundled into the Worker (a static import, not a fetch — the Worker never has to fetch its own assets). The shared `<App/>` uses `useTranslation` normally.
|
|
151
|
+
|
|
152
|
+
### Next.js app-router — server components
|
|
153
|
+
|
|
154
|
+
Server components **cannot** call `useTranslation`, and they **must not** import `initReactI18next`: it calls React's `createContext`, which throws during RSC page-data collection (`(0 , Y.createContext) is not a function` at build). Use a plain i18next instance and a fixed translator instead.
|
|
155
|
+
|
|
156
|
+
`app/i18n/config.ts`:
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
import { createInstance } from 'i18next'
|
|
160
|
+
import en from './en.json'
|
|
161
|
+
|
|
162
|
+
// Typed tokens — same augmentation as the SPA config; `getT()('key')` is
|
|
163
|
+
// checked against en.json's flattened dot-path keys.
|
|
164
|
+
declare module 'i18next' {
|
|
165
|
+
interface CustomTypeOptions {
|
|
166
|
+
defaultNS: 'translation'
|
|
167
|
+
resources: {
|
|
168
|
+
translation: typeof en
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export const supportedLocales = ['en'] as const
|
|
174
|
+
export type Locale = (typeof supportedLocales)[number]
|
|
175
|
+
export const defaultLocale: Locale = 'en'
|
|
176
|
+
|
|
177
|
+
const i18n = createInstance()
|
|
178
|
+
i18n.init({
|
|
179
|
+
resources: { en: { translation: en } },
|
|
180
|
+
lng: defaultLocale,
|
|
181
|
+
fallbackLng: defaultLocale,
|
|
182
|
+
interpolation: { escapeValue: false },
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
export function getT(locale: Locale = defaultLocale) {
|
|
186
|
+
return i18n.getFixedT(locale)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export default i18n
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import { getT } from './i18n/config'
|
|
194
|
+
export default function Page() {
|
|
195
|
+
const t = getT()
|
|
196
|
+
return <h1>{t('page.title')}</h1>
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
This works in both `output: 'export'` (static) and dynamic SSR — the static export pre-renders translated HTML at build time.
|
|
201
|
+
|
|
202
|
+
### Next.js app-router — client components
|
|
203
|
+
|
|
204
|
+
A `'use client'` component that needs the hook uses the standard `initReactI18next` instance behind an `I18nextProvider`, kept separate from the server `app/i18n/config.ts`. Most starter pages are server components and never need this.
|
|
205
|
+
|
|
206
|
+
## Adding a second language
|
|
207
|
+
|
|
208
|
+
1. `i18n/de.json` mirroring `en.json`'s keys.
|
|
209
|
+
2. In the config: `import de from './de.json'`, add `'de'` to `supportedLocales`, and register it as `de: { translation: de satisfies typeof en }`. The `satisfies typeof en` makes an incomplete or drifted `de.json` a **compile error** — which is what blocks a deploy on missing i18n (see below).
|
|
210
|
+
3. `detectLocale` already resolves `/de/...`; wire the locale segment into routing so `/de` renders the German tree (the default locale stays prefix-free).
|
|
211
|
+
|
|
212
|
+
## What NOT to do
|
|
213
|
+
|
|
214
|
+
- Don't hardcode display strings "just for now" — that defeats the point; the token is the work.
|
|
215
|
+
- Don't put locale files under `public/` or fetch them at runtime.
|
|
216
|
+
- Don't wire `initReactI18next` into a Next.js server component or any module a server component imports.
|
|
217
|
+
- Don't tokenize backend error messages or logs here — those are not frontend display strings.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-info
|
|
3
|
+
description: 'Discover what exists in a Pikku project — functions, tags, middleware, permissions, HTTP routes, channels, schedulers, queues, and more. Use when you need to understand the project structure, find existing functions, or check what middleware and permissions are defined.
|
|
4
|
+
TRIGGER when: user asks "what functions exist?", "show me the project structure", "list routes/middleware/permissions", or needs to understand an existing Pikku codebase.
|
|
5
|
+
DO NOT TRIGGER when: user is writing new code (use the specific wiring skill) or asking about Pikku concepts (use pikku-concepts).'
|
|
6
|
+
installGroups: [core]
|
|
7
|
+
allowed-tools: Bash(yarn pikku info *)
|
|
8
|
+
argument-hint: '[functions|tags|middleware|permissions] [--verbose] [--limit N]'
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Pikku Project Discovery
|
|
12
|
+
|
|
13
|
+
## Agent Operating Procedure
|
|
14
|
+
|
|
15
|
+
Use this skill as an execution checklist, not reference material.
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
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.
|
|
19
|
+
3. Make the smallest source change that satisfies the task. Keep generated files generated, and avoid hand-editing SDKs, schema output, or typegen.
|
|
20
|
+
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.
|
|
21
|
+
5. If validation fails, fix the source cause and rerun validation. Do not paper over generated errors by editing generated files.
|
|
22
|
+
|
|
23
|
+
Use the `pikku info` CLI commands to inspect this Pikku project. Run the commands below and present the results to the user in a clear summary.
|
|
24
|
+
|
|
25
|
+
## Available Commands
|
|
26
|
+
|
|
27
|
+
Always use `--silent` to suppress the banner and inspector logs.
|
|
28
|
+
|
|
29
|
+
### Functions
|
|
30
|
+
|
|
31
|
+
List all registered pikku functions:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn pikku info functions --silent
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
For full details including transport type (http/channel/scheduler/queue/workflow/mcp/cli/trigger), middleware, permissions, and source file:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
yarn pikku info functions --verbose --silent
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Tags
|
|
44
|
+
|
|
45
|
+
List all tags with counts of associated functions, middleware, and permissions:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
yarn pikku info tags --silent
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For full names instead of counts:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
yarn pikku info tags --verbose --silent
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Middleware
|
|
58
|
+
|
|
59
|
+
List all middleware definitions:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
yarn pikku info middleware --silent
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
For full details including source file, required services, and description:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
yarn pikku info middleware --verbose --silent
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Permissions
|
|
72
|
+
|
|
73
|
+
List all permission definitions:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
yarn pikku info permissions --silent
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For full details including source file, required services, and description:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
yarn pikku info permissions --verbose --silent
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Instructions
|
|
86
|
+
|
|
87
|
+
1. If the user specifies a subcommand (e.g., `/pikku-info functions`), run only that command.
|
|
88
|
+
2. If no subcommand is specified, run all four commands to give a complete project overview.
|
|
89
|
+
3. Always use `--silent` to suppress the Pikku banner and inspector logs.
|
|
90
|
+
4. Use `--verbose` when the user asks for details, file paths, or "more info".
|
|
91
|
+
5. Use `--limit N` to control output size (default is 50 rows).
|
|
92
|
+
6. After running the commands, summarize the findings concisely:
|
|
93
|
+
- Total count of functions, tags, middleware, and permissions
|
|
94
|
+
- Notable patterns (e.g., which transport types are in use, which tags group the most functions)
|
|
95
|
+
- Any functions without tags or transport types (potential issues)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-jose
|
|
3
|
+
description: 'Use when setting up JWT authentication with the jose library in a Pikku app. Covers JoseJWTService constructor, secret rotation, token encoding/decoding/verification.
|
|
4
|
+
TRIGGER when: code uses JoseJWTService, user asks about JWT setup, token signing, token verification, or @pikku/jose.
|
|
5
|
+
DO NOT TRIGGER when: user asks about session middleware (use pikku-security) or general service setup (use pikku-services).'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Pikku Jose (JWT Service)
|
|
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/jose` provides JWT signing, verification, and decoding using the [jose](https://github.com/panva/jose) library. Implements the `JWTService` interface from `@pikku/core`.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
yarn add @pikku/jose
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## API Reference
|
|
29
|
+
|
|
30
|
+
### `JoseJWTService`
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { JoseJWTService } from '@pikku/jose'
|
|
34
|
+
|
|
35
|
+
const jwt = new JoseJWTService(
|
|
36
|
+
getSecrets: () => Promise<Array<{ id: string; value: string }>>,
|
|
37
|
+
logger?: Logger
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
await jwt.init()
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Constructor Parameters:**
|
|
44
|
+
|
|
45
|
+
- `getSecrets` — Async function returning an array of `{ id, value }` key pairs. First key is used for signing; all keys are tried for verification (supports rotation).
|
|
46
|
+
- `logger` — Optional logger instance.
|
|
47
|
+
|
|
48
|
+
**Methods:**
|
|
49
|
+
|
|
50
|
+
- `init(): Promise<void>` — Fetch and cache secrets. Call at startup.
|
|
51
|
+
- `encode<T>(expiresIn: RelativeTimeInput, payload: T): Promise<string>` — Create a signed JWT.
|
|
52
|
+
- `decode<T>(token: string): Promise<T>` — Decode a JWT payload without verification.
|
|
53
|
+
- `verify(token: string): Promise<void>` — Verify a JWT signature and expiry.
|
|
54
|
+
|
|
55
|
+
## Usage Patterns
|
|
56
|
+
|
|
57
|
+
### Basic Setup
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { JoseJWTService } from '@pikku/jose'
|
|
61
|
+
|
|
62
|
+
const jwt = new JoseJWTService(
|
|
63
|
+
async () => [{ id: 'key-1', value: process.env.JWT_SECRET! }],
|
|
64
|
+
logger
|
|
65
|
+
)
|
|
66
|
+
await jwt.init()
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Secret Rotation
|
|
70
|
+
|
|
71
|
+
Supply multiple keys. The first is used for signing; all are tried for verification:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
const jwt = new JoseJWTService(async () => [
|
|
75
|
+
{ id: 'key-2', value: NEW_SECRET }, // signs with this
|
|
76
|
+
{ id: 'key-1', value: OLD_SECRET }, // still verifies tokens signed with this
|
|
77
|
+
])
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### With Pikku Services
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
const createSingletonServices = pikkuServices(async (config) => {
|
|
84
|
+
const logger = new ConsoleLogger()
|
|
85
|
+
const jwt = new JoseJWTService(
|
|
86
|
+
async () => [{ id: 'my-key', value: config.jwtSecret }],
|
|
87
|
+
logger
|
|
88
|
+
)
|
|
89
|
+
await jwt.init()
|
|
90
|
+
return { config, logger, jwt }
|
|
91
|
+
})
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Encoding & Verifying Tokens
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
const token = await jwt.encode('1h', { userId: 'abc', role: 'admin' })
|
|
98
|
+
|
|
99
|
+
await jwt.verify(token) // throws if invalid/expired
|
|
100
|
+
|
|
101
|
+
const payload = await jwt.decode<{ userId: string; role: string }>(token)
|
|
102
|
+
```
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pikku-kysely
|
|
3
|
+
description: 'Use when setting up SQL database services with Kysely in a Pikku app. Covers @pikku/kysely (base), @pikku/kysely-postgres, @pikku/kysely-mysql, @pikku/kysely-sqlite — channel stores, workflow services, secret services, AI storage, agent runs, and deployment services.
|
|
4
|
+
TRIGGER when: code uses Kysely, PikkuKysely, KyselyChannelStore, KyselyWorkflowService, KyselySecretService, or user asks about SQL database setup, Postgres/MySQL/SQLite with Pikku.
|
|
5
|
+
DO NOT TRIGGER when: user asks about MongoDB (use pikku-mongodb) or Redis (use pikku-redis).'
|
|
6
|
+
installGroups: [core]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pikku Kysely (SQL Database Services)
|
|
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
|
+
Pikku provides SQL database services through four packages:
|
|
22
|
+
|
|
23
|
+
- `@pikku/kysely` — Base service implementations (database-agnostic)
|
|
24
|
+
- `@pikku/kysely-postgres` — PostgreSQL-specific implementations + `PikkuKysely` connection wrapper
|
|
25
|
+
- `@pikku/kysely-mysql` — MySQL-specific implementations
|
|
26
|
+
- `@pikku/kysely-sqlite` — SQLite-specific implementations + `createSQLiteKysely` factory
|
|
27
|
+
|
|
28
|
+
All implement standard Pikku interfaces from `@pikku/core`.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Pick your database
|
|
34
|
+
yarn add @pikku/kysely @pikku/kysely-postgres # PostgreSQL
|
|
35
|
+
yarn add @pikku/kysely @pikku/kysely-mysql # MySQL
|
|
36
|
+
yarn add @pikku/kysely @pikku/kysely-sqlite # SQLite
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## API Reference
|
|
40
|
+
|
|
41
|
+
### PostgreSQL Connection — `PikkuKysely`
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { PikkuKysely } from '@pikku/kysely-postgres'
|
|
45
|
+
|
|
46
|
+
const db = new PikkuKysely<DB>(
|
|
47
|
+
logger: Logger,
|
|
48
|
+
connectionOrConfig: postgres.Sql | postgres.Options | string,
|
|
49
|
+
defaultSchemaName?: string
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
await db.init()
|
|
53
|
+
db.kysely // Kysely<DB> instance for queries
|
|
54
|
+
await db.close()
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### SQLite Factory — `createSQLiteKysely`
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { createSQLiteKysely } from '@pikku/kysely-sqlite'
|
|
61
|
+
|
|
62
|
+
const kysely = createSQLiteKysely(database: SqliteDatabase | (() => Promise<SqliteDatabase>))
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Available Services
|
|
66
|
+
|
|
67
|
+
Each database variant exports these services with a prefix (`Pg`, `MySQL`, `SQLite`, or base `Kysely`):
|
|
68
|
+
|
|
69
|
+
| Service | Interface | Purpose |
|
|
70
|
+
| --------------------- | ------------------------------------- | ---------------------------------------------- |
|
|
71
|
+
| `*ChannelStore` | `ChannelStore` | WebSocket channel state persistence |
|
|
72
|
+
| `*EventHubStore` | `EventHubStore` | Event hub state persistence |
|
|
73
|
+
| `*WorkflowService` | `PikkuWorkflowService` | Workflow definition storage |
|
|
74
|
+
| `*WorkflowRunService` | `WorkflowRunService` | Workflow execution tracking |
|
|
75
|
+
| `*DeploymentService` | `DeploymentService` | Deployment state management |
|
|
76
|
+
| `*AIStorageService` | `AIStorageService, AIRunStateService` | AI conversation/run storage |
|
|
77
|
+
| `*AgentRunService` | `AgentRunService` | Agent execution tracking |
|
|
78
|
+
| `*SecretService` | `SecretService` | Encrypted secret storage (envelope encryption) |
|
|
79
|
+
|
|
80
|
+
All services take a `Kysely<KyselyPikkuDB>` instance in their constructor and have an `init()` method that creates tables if needed.
|
|
81
|
+
|
|
82
|
+
### Secret Service
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { PgKyselySecretService } from '@pikku/kysely-postgres'
|
|
86
|
+
|
|
87
|
+
const secrets = new PgKyselySecretService(db.kysely, {
|
|
88
|
+
kekSecret: 'your-key-encryption-key',
|
|
89
|
+
salt: 'your-salt',
|
|
90
|
+
})
|
|
91
|
+
await secrets.init()
|
|
92
|
+
|
|
93
|
+
await secrets.setSecretJSON('api-key', { key: 'sk-...' })
|
|
94
|
+
const value = await secrets.getSecretJSON<{ key: string }>('api-key')
|
|
95
|
+
await secrets.rotateKEK() // Re-encrypt all secrets with new KEK
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Usage Patterns
|
|
99
|
+
|
|
100
|
+
### PostgreSQL Setup
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import {
|
|
104
|
+
PikkuKysely,
|
|
105
|
+
PgKyselyChannelStore,
|
|
106
|
+
PgKyselyWorkflowService,
|
|
107
|
+
} from '@pikku/kysely-postgres'
|
|
108
|
+
|
|
109
|
+
const createSingletonServices = pikkuServices(async (config) => {
|
|
110
|
+
const logger = new PinoLogger()
|
|
111
|
+
const db = new PikkuKysely(logger, config.databaseUrl)
|
|
112
|
+
await db.init()
|
|
113
|
+
|
|
114
|
+
const channelStore = new PgKyselyChannelStore(db.kysely)
|
|
115
|
+
await channelStore.init()
|
|
116
|
+
|
|
117
|
+
const workflowService = new PgKyselyWorkflowService(db.kysely)
|
|
118
|
+
await workflowService.init()
|
|
119
|
+
|
|
120
|
+
return { config, logger, database: db, channelStore, workflowService }
|
|
121
|
+
})
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### SQLite Setup
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import {
|
|
128
|
+
createSQLiteKysely,
|
|
129
|
+
SQLiteKyselyChannelStore,
|
|
130
|
+
} from '@pikku/kysely-sqlite'
|
|
131
|
+
import Database from 'better-sqlite3'
|
|
132
|
+
|
|
133
|
+
const kysely = createSQLiteKysely(new Database('app.db'))
|
|
134
|
+
const channelStore = new SQLiteKyselyChannelStore(kysely)
|
|
135
|
+
await channelStore.init()
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### MySQL Setup
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
import { MySQLKyselyWorkflowService } from '@pikku/kysely-mysql'
|
|
142
|
+
|
|
143
|
+
const workflowService = new MySQLKyselyWorkflowService(kyselyInstance)
|
|
144
|
+
await workflowService.init()
|
|
145
|
+
```
|