@pikku/cli 0.12.55 → 0.12.56

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.
Files changed (125) hide show
  1. package/cli.schema.json +1 -1
  2. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  3. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  4. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  5. package/dist/.pikku/cli/pikku-cli-channel.js +6 -1
  6. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  7. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  8. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  9. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  10. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.json +14 -0
  11. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  12. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  13. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  14. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +14 -0
  15. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  16. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  17. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  18. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  19. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  20. package/dist/.pikku/function/pikku-function-types.gen.d.ts +7 -30
  21. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  22. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  23. package/dist/.pikku/function/pikku-functions-meta.gen.json +24 -5
  24. package/dist/.pikku/function/pikku-functions.gen.js +3 -1
  25. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  26. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  27. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  28. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  29. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  30. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  31. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  32. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  33. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  34. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  35. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  36. package/dist/.pikku/pikku-services.gen.d.ts +4 -2
  37. package/dist/.pikku/pikku-services.gen.js +2 -0
  38. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  39. package/dist/.pikku/pikku-types.gen.js +1 -1
  40. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  41. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  42. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  43. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +0 -248
  44. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  45. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  46. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  47. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +1 -0
  48. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  49. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  50. package/dist/.pikku/schemas/register.gen.js +5 -1
  51. package/dist/.pikku/schemas/schemas/FabricAddonVerifyInput.schema.json +1 -0
  52. package/dist/.pikku/schemas/schemas/FabricAddonVerifyOutput.schema.json +1 -0
  53. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  54. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  55. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  56. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  57. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  58. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  59. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  60. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  61. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  62. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  63. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  64. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  65. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  66. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  67. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  68. package/dist/bin/pikku-bin.mjs +2 -2
  69. package/dist/src/deploy/analyzer/analyzer.d.ts +6 -0
  70. package/dist/src/deploy/analyzer/analyzer.js +5 -4
  71. package/dist/src/deploy/build-pipeline.d.ts +5 -1
  72. package/dist/src/deploy/build-pipeline.js +5 -5
  73. package/dist/src/deploy/bundler/bun-bundler.d.ts +14 -0
  74. package/dist/src/deploy/bundler/bun-bundler.js +121 -0
  75. package/dist/src/deploy/bundler/bundler.d.ts +25 -30
  76. package/dist/src/deploy/bundler/bundler.interface.d.ts +54 -0
  77. package/dist/src/deploy/bundler/bundler.interface.js +11 -0
  78. package/dist/src/deploy/bundler/bundler.js +120 -190
  79. package/dist/src/deploy/bundler/dep-extractor.d.ts +11 -3
  80. package/dist/src/deploy/bundler/dep-extractor.js +12 -6
  81. package/dist/src/deploy/bundler/index.d.ts +5 -2
  82. package/dist/src/deploy/bundler/index.js +4 -2
  83. package/dist/src/deploy/bundler/node-bundler.d.ts +13 -0
  84. package/dist/src/deploy/bundler/node-bundler.js +80 -0
  85. package/dist/src/fabric/fabric-commands.d.ts +37 -0
  86. package/dist/src/fabric/fabric-commands.js +8 -0
  87. package/dist/src/fabric/functions/addon-verify.function.d.ts +54 -0
  88. package/dist/src/fabric/functions/addon-verify.function.js +153 -0
  89. package/dist/src/fabric/functions/llm-key.function.js +1 -1
  90. package/dist/src/fabric/functions/publish.function.js +8 -3
  91. package/dist/src/functions/commands/deploy-apply.js +3 -1
  92. package/dist/src/functions/commands/deploy-plan.js +3 -1
  93. package/dist/src/functions/commands/dev.js +11 -45
  94. package/dist/src/functions/db/db-codegen.js +14 -0
  95. package/dist/src/functions/wirings/functions/serialize-function-types.js +6 -29
  96. package/dist/src/server/bun-server-runner.d.ts +17 -0
  97. package/dist/src/server/bun-server-runner.js +25 -0
  98. package/dist/src/server/dev-server-runner.interface.d.ts +31 -0
  99. package/dist/src/server/dev-server-runner.interface.js +11 -0
  100. package/dist/src/server/node-server-runner.d.ts +12 -0
  101. package/dist/src/server/node-server-runner.js +30 -0
  102. package/dist/src/services.js +10 -0
  103. package/dist/src/utils/parse-cli-filters.d.ts +1 -0
  104. package/dist/src/utils/parse-cli-filters.js +1 -0
  105. package/dist/tsconfig.tsbuildinfo +1 -1
  106. package/package.json +3 -3
  107. package/skills/pikku-addon/SKILL.md +25 -117
  108. package/skills/pikku-addon/references/addon-package-manifest.md +63 -0
  109. package/skills/pikku-cli/SKILL.md +7 -93
  110. package/skills/pikku-cli/references/complete-example.md +82 -0
  111. package/skills/pikku-concepts/SKILL.md +17 -69
  112. package/skills/pikku-concepts/references/concept-mapping.md +37 -13
  113. package/skills/pikku-concepts/references/packages.md +29 -0
  114. package/skills/pikku-http/SKILL.md +14 -105
  115. package/skills/pikku-http/references/http-options.md +57 -0
  116. package/skills/pikku-middleware/SKILL.md +11 -68
  117. package/skills/pikku-middleware/references/middleware-patterns.md +61 -0
  118. package/skills/pikku-realtime/SKILL.md +56 -105
  119. package/skills/pikku-realtime/references/other-routes.md +23 -0
  120. package/skills/pikku-services/SKILL.md +25 -108
  121. package/skills/pikku-services/references/audit-wire-service.md +34 -0
  122. package/skills/pikku-testing/SKILL.md +51 -359
  123. package/skills/pikku-testing/references/cucumber-bdd-testing.md +176 -0
  124. package/skills/pikku-workflow/SKILL.md +93 -259
  125. package/skills/pikku-workflow/references/workflow-reference.md +63 -0
@@ -1 +1 @@
1
- {"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/deploy/build-pipeline.ts","../src/deploy/provider-adapter.ts","../src/deploy/server-entry.ts","../src/deploy/analyzer/analyzer.ts","../src/deploy/analyzer/index.ts","../src/deploy/analyzer/manifest.ts","../src/deploy/bundler/bundler.ts","../src/deploy/bundler/dep-extractor.ts","../src/deploy/bundler/index.ts","../src/deploy/bundler/types.ts","../src/deploy/codegen/index.ts","../src/deploy/codegen/per-unit-codegen.ts","../src/deploy/plan/executor.ts","../src/deploy/plan/formatter.ts","../src/deploy/plan/index.ts","../src/deploy/plan/planner.ts","../src/deploy/plan/provider.ts","../src/deploy/plan/types.ts","../src/fabric/fabric-commands.ts","../src/fabric/functions/add.function.ts","../src/fabric/functions/db-schema.function.ts","../src/fabric/functions/deploy-list.function.ts","../src/fabric/functions/deploy-units.function.ts","../src/fabric/functions/deploy.function.ts","../src/fabric/functions/domains-add.function.ts","../src/fabric/functions/domains-list.function.ts","../src/fabric/functions/domains-remove.function.ts","../src/fabric/functions/errors.function.ts","../src/fabric/functions/init.function.ts","../src/fabric/functions/link.function.ts","../src/fabric/functions/llm-key.function.ts","../src/fabric/functions/login.function.ts","../src/fabric/functions/logs.function.ts","../src/fabric/functions/metrics.function.ts","../src/fabric/functions/publish.function.ts","../src/fabric/functions/rollback.function.ts","../src/fabric/functions/secrets-list.function.ts","../src/fabric/functions/secrets-set.function.ts","../src/fabric/functions/smoke.function.ts","../src/fabric/functions/status.function.ts","../src/fabric/functions/trace.function.ts","../src/fabric/functions/validate.function.ts","../src/fabric/lib/config.ts","../src/fabric/lib/console-url.ts","../src/fabric/lib/git.ts","../src/fabric/lib/http.ts","../src/fabric/lib/not-implemented.ts","../src/fabric/lib/output.ts","../src/fabric/lib/prompt.ts","../src/fabric/lib/stage.ts","../src/fabric/sdk/http-map.gen.d.ts","../src/fabric/sdk/pikku-fetch.gen.ts","../src/fabric/sdk/pikku-rpc.gen.ts","../src/fabric/sdk/rpc-map.gen.d.ts","../src/functions/commands/all.ts","../src/functions/commands/binary.ts","../src/functions/commands/bootstrap.ts","../src/functions/commands/console.ts","../src/functions/commands/db-audit.ts","../src/functions/commands/db-generate.ts","../src/functions/commands/db-migrate.ts","../src/functions/commands/db-reset.ts","../src/functions/commands/db-seed.ts","../src/functions/commands/db-shared.ts","../src/functions/commands/deploy-apply.ts","../src/functions/commands/deploy-info.ts","../src/functions/commands/deploy-plan.ts","../src/functions/commands/dev-ai-runner.ts","../src/functions/commands/dev.ts","../src/functions/commands/emails-init.ts","../src/functions/commands/enable.ts","../src/functions/commands/info.ts","../src/functions/commands/load-user-project.ts","../src/functions/commands/login.ts","../src/functions/commands/meta.ts","../src/functions/commands/new-addon.ts","../src/functions/commands/new-function.ts","../src/functions/commands/new-middleware.ts","../src/functions/commands/new-permission.ts","../src/functions/commands/new-wiring.ts","../src/functions/commands/pikku-command-bootstrap.ts","../src/functions/commands/pikku-command-summary.ts","../src/functions/commands/skills.ts","../src/functions/commands/tests-coverage.ts","../src/functions/commands/tests-init.ts","../src/functions/commands/versions-check.ts","../src/functions/commands/versions-init.ts","../src/functions/commands/versions-update.ts","../src/functions/commands/watch.ts","../src/functions/commands/workspace-validate.ts","../src/functions/db/annotation-parser.ts","../src/functions/db/better-auth-schema.ts","../src/functions/db/coercion-plugin.ts","../src/functions/db/db-codegen.ts","../src/functions/db/db-introspector.ts","../src/functions/db/db-migrator.ts","../src/functions/db/local-db.ts","../src/functions/db/zod-codegen.ts","../src/functions/db/postgres/pglite-kysely.ts","../src/functions/db/postgres/postgres-introspector.ts","../src/functions/db/postgres/postgres-migrator.ts","../src/functions/db/sqlite/seed.ts","../src/functions/db/sqlite/sqlite-introspector.ts","../src/functions/db/sqlite/sqlite-kysely.ts","../src/functions/db/sqlite/sqlite-migrator.ts","../src/functions/db/sqlite/sqlite-runtime-bun.ts","../src/functions/db/sqlite/sqlite-runtime-node.ts","../src/functions/db/sqlite/sqlite-runtime.ts","../src/functions/runtimes/fetch/index.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.ts","../src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.ts","../src/functions/runtimes/websocket/pikku-command-websocket-typed.ts","../src/functions/runtimes/websocket/serialize-websocket-wrapper.ts","../src/functions/validate/workspace-validate.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent-types.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent.ts","../src/functions/wirings/ai-agent/pikku-command-public-agent.ts","../src/functions/wirings/ai-agent/serialize-agent-map.ts","../src/functions/wirings/ai-agent/serialize-ai-agent-types.ts","../src/functions/wirings/ai-agent/serialize-public-agent.ts","../src/functions/wirings/auth/pikku-command-auth.ts","../src/functions/wirings/auth/serialize-auth-gen.ts","../src/functions/wirings/auth/serialize-auth-meta.ts","../src/functions/wirings/auth/serialize-auth-types.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/console/pikku-command-console-functions.ts","../src/functions/wirings/console/pikku-command-node-types.ts","../src/functions/wirings/console/pikku-command-nodes-meta.ts","../src/functions/wirings/console/serialize-console-functions.ts","../src/functions/wirings/console/serialize-node-types.ts","../src/functions/wirings/credentials/pikku-command-credentials.ts","../src/functions/wirings/credentials/serialize-credentials-types.ts","../src/functions/wirings/emails/pikku-command-emails.ts","../src/functions/wirings/emails/serialize-emails.ts","../src/functions/wirings/functions/pikku-command-addon-types.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-addon-refs.ts","../src/functions/wirings/functions/serialize-addon-types.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/gateway/pikku-command-gateway.ts","../src/functions/wirings/gateway/serialize-gateway-meta.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/package/pikku-command-package-types.ts","../src/functions/wirings/package/pikku-command-package.ts","../src/functions/wirings/package/serialize-package-types.ts","../src/functions/wirings/package/serialize-package.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/realtime/pikku-command-events-scaffold.ts","../src/functions/wirings/realtime/pikku-command-realtime.ts","../src/functions/wirings/realtime/serialize-events-scaffold.ts","../src/functions/wirings/realtime/serialize-realtime-client.ts","../src/functions/wirings/rpc/pikku-command-public-rpc.ts","../src/functions/wirings/rpc/pikku-command-react-query.ts","../src/functions/wirings/rpc/pikku-command-remote-rpc.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-public-rpc.ts","../src/functions/wirings/rpc/serialize-react-query-hooks.ts","../src/functions/wirings/rpc/serialize-remote-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/functions/wirings/secrets/pikku-command-secrets.ts","../src/functions/wirings/secrets/serialize-secrets-types.ts","../src/functions/wirings/triggers/pikku-command-trigger-types.ts","../src/functions/wirings/triggers/pikku-command-trigger.ts","../src/functions/wirings/triggers/serialize-trigger-meta.ts","../src/functions/wirings/triggers/serialize-trigger-types.ts","../src/functions/wirings/variables/pikku-command-variables.ts","../src/functions/wirings/variables/serialize-variables-types.ts","../src/functions/wirings/workflow/pikku-command-workflow-routes.ts","../src/functions/wirings/workflow/pikku-command-workflow.ts","../src/functions/wirings/workflow/serialize-workflow-bootstrap-map.ts","../src/functions/wirings/workflow/serialize-workflow-map.ts","../src/functions/wirings/workflow/serialize-workflow-meta.ts","../src/functions/wirings/workflow/serialize-workflow-registration.ts","../src/functions/wirings/workflow/serialize-workflow-routes.ts","../src/functions/wirings/workflow/serialize-workflow-types.ts","../src/functions/workflows/all.workflow.ts","../src/middleware/log-command-info-and-time.ts","../src/scaffold/rpc-remote.gen.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/check-required-types.ts","../src/utils/cli-session.ts","../src/utils/command-summary.ts","../src/utils/contract-versions.ts","../src/utils/detect-better-auth.ts","../src/utils/device-auth.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/parse-cli-filters.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/serialize-import-map.ts","../src/utils/serialize-meta-ts.ts","../src/utils/serialize-schemas.ts","../src/utils/strip-verbose-meta.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-meta-service.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/agent/pikku-agent-map.gen.d.ts","../.pikku/agent/pikku-agent-types.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/cli/pikku-cli-channel.ts","../.pikku/cli/pikku-cli-client.gen.ts","../.pikku/cli/pikku-cli-contracts-meta.gen.ts","../.pikku/cli/pikku-cli-types.gen.ts","../.pikku/cli/pikku-cli-wirings-meta.gen.ts","../.pikku/cli/pikku-cli-wirings.gen.ts","../.pikku/cli/pikku-cli.gen.ts","../.pikku/console/pikku-node-types.gen.ts","../.pikku/function/pikku-function-types.gen.ts","../.pikku/function/pikku-functions-meta.gen.ts","../.pikku/function/pikku-functions.gen.ts","../.pikku/http/pikku-http-types.gen.ts","../.pikku/http/pikku-http-wirings-map.gen.d.ts","../.pikku/http/pikku-http-wirings-meta.gen.ts","../.pikku/http/pikku-http-wirings.gen.ts","../.pikku/mcp/pikku-mcp-types.gen.ts","../.pikku/node/pikku-node-types.gen.ts","../.pikku/queue/pikku-queue-types.gen.ts","../.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts","../.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts","../.pikku/queue/pikku-queue-workers-wirings.gen.ts","../.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts","../.pikku/scheduler/pikku-scheduler-types.gen.ts","../.pikku/schemas/register.gen.ts","../.pikku/secrets/pikku-secret-types.gen.ts","../.pikku/secrets/pikku-secrets.gen.ts","../.pikku/trigger/pikku-trigger-types.gen.ts","../.pikku/variables/pikku-variable-types.gen.ts","../.pikku/variables/pikku-variables.gen.ts","../.pikku/workflow/pikku-workflow-map.gen.d.ts","../.pikku/workflow/pikku-workflow-types.gen.ts","../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts","../.pikku/workflow/pikku-workflow-wirings.gen.ts","../types/application-types.d.ts","../types/bun-sqlite.d.ts","../types/config.d.ts"],"version":"5.9.3"}
1
+ {"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/deploy/build-pipeline.ts","../src/deploy/provider-adapter.ts","../src/deploy/server-entry.ts","../src/deploy/analyzer/analyzer.ts","../src/deploy/analyzer/index.ts","../src/deploy/analyzer/manifest.ts","../src/deploy/bundler/bun-bundler.ts","../src/deploy/bundler/bundler.interface.ts","../src/deploy/bundler/bundler.ts","../src/deploy/bundler/dep-extractor.ts","../src/deploy/bundler/index.ts","../src/deploy/bundler/node-bundler.ts","../src/deploy/bundler/types.ts","../src/deploy/codegen/index.ts","../src/deploy/codegen/per-unit-codegen.ts","../src/deploy/plan/executor.ts","../src/deploy/plan/formatter.ts","../src/deploy/plan/index.ts","../src/deploy/plan/planner.ts","../src/deploy/plan/provider.ts","../src/deploy/plan/types.ts","../src/fabric/fabric-commands.ts","../src/fabric/functions/add.function.ts","../src/fabric/functions/addon-verify.function.ts","../src/fabric/functions/db-schema.function.ts","../src/fabric/functions/deploy-list.function.ts","../src/fabric/functions/deploy-units.function.ts","../src/fabric/functions/deploy.function.ts","../src/fabric/functions/domains-add.function.ts","../src/fabric/functions/domains-list.function.ts","../src/fabric/functions/domains-remove.function.ts","../src/fabric/functions/errors.function.ts","../src/fabric/functions/init.function.ts","../src/fabric/functions/link.function.ts","../src/fabric/functions/llm-key.function.ts","../src/fabric/functions/login.function.ts","../src/fabric/functions/logs.function.ts","../src/fabric/functions/metrics.function.ts","../src/fabric/functions/publish.function.ts","../src/fabric/functions/rollback.function.ts","../src/fabric/functions/secrets-list.function.ts","../src/fabric/functions/secrets-set.function.ts","../src/fabric/functions/smoke.function.ts","../src/fabric/functions/status.function.ts","../src/fabric/functions/trace.function.ts","../src/fabric/functions/validate.function.ts","../src/fabric/lib/config.ts","../src/fabric/lib/console-url.ts","../src/fabric/lib/git.ts","../src/fabric/lib/http.ts","../src/fabric/lib/not-implemented.ts","../src/fabric/lib/output.ts","../src/fabric/lib/prompt.ts","../src/fabric/lib/stage.ts","../src/fabric/sdk/http-map.gen.d.ts","../src/fabric/sdk/pikku-fetch.gen.ts","../src/fabric/sdk/pikku-rpc.gen.ts","../src/fabric/sdk/rpc-map.gen.d.ts","../src/functions/commands/all.ts","../src/functions/commands/binary.ts","../src/functions/commands/bootstrap.ts","../src/functions/commands/console.ts","../src/functions/commands/db-audit.ts","../src/functions/commands/db-generate.ts","../src/functions/commands/db-migrate.ts","../src/functions/commands/db-reset.ts","../src/functions/commands/db-seed.ts","../src/functions/commands/db-shared.ts","../src/functions/commands/deploy-apply.ts","../src/functions/commands/deploy-info.ts","../src/functions/commands/deploy-plan.ts","../src/functions/commands/dev-ai-runner.ts","../src/functions/commands/dev.ts","../src/functions/commands/emails-init.ts","../src/functions/commands/enable.ts","../src/functions/commands/info.ts","../src/functions/commands/load-user-project.ts","../src/functions/commands/login.ts","../src/functions/commands/meta.ts","../src/functions/commands/new-addon.ts","../src/functions/commands/new-function.ts","../src/functions/commands/new-middleware.ts","../src/functions/commands/new-permission.ts","../src/functions/commands/new-wiring.ts","../src/functions/commands/pikku-command-bootstrap.ts","../src/functions/commands/pikku-command-summary.ts","../src/functions/commands/skills.ts","../src/functions/commands/tests-coverage.ts","../src/functions/commands/tests-init.ts","../src/functions/commands/versions-check.ts","../src/functions/commands/versions-init.ts","../src/functions/commands/versions-update.ts","../src/functions/commands/watch.ts","../src/functions/commands/workspace-validate.ts","../src/functions/db/annotation-parser.ts","../src/functions/db/better-auth-schema.ts","../src/functions/db/coercion-plugin.ts","../src/functions/db/db-codegen.ts","../src/functions/db/db-introspector.ts","../src/functions/db/db-migrator.ts","../src/functions/db/local-db.ts","../src/functions/db/zod-codegen.ts","../src/functions/db/postgres/pglite-kysely.ts","../src/functions/db/postgres/postgres-introspector.ts","../src/functions/db/postgres/postgres-migrator.ts","../src/functions/db/sqlite/seed.ts","../src/functions/db/sqlite/sqlite-introspector.ts","../src/functions/db/sqlite/sqlite-kysely.ts","../src/functions/db/sqlite/sqlite-migrator.ts","../src/functions/db/sqlite/sqlite-runtime-bun.ts","../src/functions/db/sqlite/sqlite-runtime-node.ts","../src/functions/db/sqlite/sqlite-runtime.ts","../src/functions/runtimes/fetch/index.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.ts","../src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.ts","../src/functions/runtimes/websocket/pikku-command-websocket-typed.ts","../src/functions/runtimes/websocket/serialize-websocket-wrapper.ts","../src/functions/validate/workspace-validate.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent-types.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent.ts","../src/functions/wirings/ai-agent/pikku-command-public-agent.ts","../src/functions/wirings/ai-agent/serialize-agent-map.ts","../src/functions/wirings/ai-agent/serialize-ai-agent-types.ts","../src/functions/wirings/ai-agent/serialize-public-agent.ts","../src/functions/wirings/auth/pikku-command-auth.ts","../src/functions/wirings/auth/serialize-auth-gen.ts","../src/functions/wirings/auth/serialize-auth-meta.ts","../src/functions/wirings/auth/serialize-auth-types.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/console/pikku-command-console-functions.ts","../src/functions/wirings/console/pikku-command-node-types.ts","../src/functions/wirings/console/pikku-command-nodes-meta.ts","../src/functions/wirings/console/serialize-console-functions.ts","../src/functions/wirings/console/serialize-node-types.ts","../src/functions/wirings/credentials/pikku-command-credentials.ts","../src/functions/wirings/credentials/serialize-credentials-types.ts","../src/functions/wirings/emails/pikku-command-emails.ts","../src/functions/wirings/emails/serialize-emails.ts","../src/functions/wirings/functions/pikku-command-addon-types.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-addon-refs.ts","../src/functions/wirings/functions/serialize-addon-types.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/gateway/pikku-command-gateway.ts","../src/functions/wirings/gateway/serialize-gateway-meta.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/package/pikku-command-package-types.ts","../src/functions/wirings/package/pikku-command-package.ts","../src/functions/wirings/package/serialize-package-types.ts","../src/functions/wirings/package/serialize-package.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/realtime/pikku-command-events-scaffold.ts","../src/functions/wirings/realtime/pikku-command-realtime.ts","../src/functions/wirings/realtime/serialize-events-scaffold.ts","../src/functions/wirings/realtime/serialize-realtime-client.ts","../src/functions/wirings/rpc/pikku-command-public-rpc.ts","../src/functions/wirings/rpc/pikku-command-react-query.ts","../src/functions/wirings/rpc/pikku-command-remote-rpc.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-public-rpc.ts","../src/functions/wirings/rpc/serialize-react-query-hooks.ts","../src/functions/wirings/rpc/serialize-remote-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/functions/wirings/secrets/pikku-command-secrets.ts","../src/functions/wirings/secrets/serialize-secrets-types.ts","../src/functions/wirings/triggers/pikku-command-trigger-types.ts","../src/functions/wirings/triggers/pikku-command-trigger.ts","../src/functions/wirings/triggers/serialize-trigger-meta.ts","../src/functions/wirings/triggers/serialize-trigger-types.ts","../src/functions/wirings/variables/pikku-command-variables.ts","../src/functions/wirings/variables/serialize-variables-types.ts","../src/functions/wirings/workflow/pikku-command-workflow-routes.ts","../src/functions/wirings/workflow/pikku-command-workflow.ts","../src/functions/wirings/workflow/serialize-workflow-bootstrap-map.ts","../src/functions/wirings/workflow/serialize-workflow-map.ts","../src/functions/wirings/workflow/serialize-workflow-meta.ts","../src/functions/wirings/workflow/serialize-workflow-registration.ts","../src/functions/wirings/workflow/serialize-workflow-routes.ts","../src/functions/wirings/workflow/serialize-workflow-types.ts","../src/functions/workflows/all.workflow.ts","../src/middleware/log-command-info-and-time.ts","../src/scaffold/rpc-remote.gen.ts","../src/server/bun-server-runner.ts","../src/server/dev-server-runner.interface.ts","../src/server/node-server-runner.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/check-required-types.ts","../src/utils/cli-session.ts","../src/utils/command-summary.ts","../src/utils/contract-versions.ts","../src/utils/detect-better-auth.ts","../src/utils/device-auth.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/parse-cli-filters.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/serialize-import-map.ts","../src/utils/serialize-meta-ts.ts","../src/utils/serialize-schemas.ts","../src/utils/strip-verbose-meta.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-meta-service.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/agent/pikku-agent-map.gen.d.ts","../.pikku/agent/pikku-agent-types.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/cli/pikku-cli-channel.ts","../.pikku/cli/pikku-cli-client.gen.ts","../.pikku/cli/pikku-cli-contracts-meta.gen.ts","../.pikku/cli/pikku-cli-types.gen.ts","../.pikku/cli/pikku-cli-wirings-meta.gen.ts","../.pikku/cli/pikku-cli-wirings.gen.ts","../.pikku/cli/pikku-cli.gen.ts","../.pikku/console/pikku-node-types.gen.ts","../.pikku/function/pikku-function-types.gen.ts","../.pikku/function/pikku-functions-meta.gen.ts","../.pikku/function/pikku-functions.gen.ts","../.pikku/http/pikku-http-types.gen.ts","../.pikku/http/pikku-http-wirings-map.gen.d.ts","../.pikku/http/pikku-http-wirings-meta.gen.ts","../.pikku/http/pikku-http-wirings.gen.ts","../.pikku/mcp/pikku-mcp-types.gen.ts","../.pikku/node/pikku-node-types.gen.ts","../.pikku/queue/pikku-queue-types.gen.ts","../.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts","../.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts","../.pikku/queue/pikku-queue-workers-wirings.gen.ts","../.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts","../.pikku/scheduler/pikku-scheduler-types.gen.ts","../.pikku/schemas/register.gen.ts","../.pikku/secrets/pikku-secret-types.gen.ts","../.pikku/secrets/pikku-secrets.gen.ts","../.pikku/trigger/pikku-trigger-types.gen.ts","../.pikku/variables/pikku-variable-types.gen.ts","../.pikku/variables/pikku-variables.gen.ts","../.pikku/workflow/pikku-workflow-map.gen.d.ts","../.pikku/workflow/pikku-workflow-types.gen.ts","../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts","../.pikku/workflow/pikku-workflow-wirings.gen.ts","../types/application-types.d.ts","../types/bun-sqlite.d.ts","../types/config.d.ts"],"version":"5.9.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/cli",
3
- "version": "0.12.55",
3
+ "version": "0.12.56",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "BUSL-1.1",
6
6
  "imports": {
@@ -29,10 +29,10 @@
29
29
  "@openapi-contrib/json-schema-to-openapi-schema": "^4.3.1",
30
30
  "@pikku/better-auth": "^0.12.12",
31
31
  "@pikku/bun-server": "^0.12.1",
32
- "@pikku/core": "^0.12.39",
32
+ "@pikku/core": "^0.12.40",
33
33
  "@pikku/deploy-cloudflare": "^0.12.6",
34
34
  "@pikku/fetch": "^0.12.5",
35
- "@pikku/inspector": "^0.12.27",
35
+ "@pikku/inspector": "^0.12.28",
36
36
  "@pikku/kysely": "^0.12.18",
37
37
  "@pikku/kysely-node-sqlite": "^0.12.2",
38
38
  "@pikku/node-http-server": "^0.12.3",
@@ -102,65 +102,7 @@ export const createWireServices = pikkuAddonWireServices(
102
102
  npx pikku new addon
103
103
  ```
104
104
 
105
- ### Package Structure
106
-
107
- ```text
108
- my-addon/
109
- ├── package.json # Exports .pikku/* and dist/
110
- ├── pikku.config.json # addon: true + metadata
111
- ├── tsconfig.json # #pikku path mapping
112
- ├── src/
113
- │ ├── services.ts # createSingletonServices (required)
114
- │ └── functions/
115
- │ └── *.function.ts # Function definitions
116
- ├── types/
117
- │ └── application-types.d.ts # SingletonServices interface
118
- └── .pikku/ # Generated (gitignored)
119
- ```
120
-
121
- ### pikku.config.json
122
-
123
- ```json
124
- {
125
- "tsconfig": "./tsconfig.json",
126
- "srcDirectories": ["src", "types"],
127
- "outDir": "./.pikku",
128
- "addon": true,
129
- "node": {
130
- "displayName": "My Addon",
131
- "description": "What this addon does",
132
- "categories": ["General"]
133
- }
134
- }
135
- ```
136
-
137
- ### package.json (key fields)
138
-
139
- ```json
140
- {
141
- "name": "@my-org/addon-todos",
142
- "imports": {
143
- "#pikku": "./.pikku/pikku-types.gen.ts",
144
- "#pikku/*": "./.pikku/*"
145
- },
146
- "exports": {
147
- ".": { "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js" },
148
- "./.pikku/*": "./.pikku/*",
149
- "./.pikku/pikku-metadata.gen.json": "./.pikku/pikku-metadata.gen.json",
150
- "./.pikku/rpc/pikku-rpc-wirings-map.internal.gen.js": {
151
- "types": "./.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts"
152
- }
153
- },
154
- "files": ["dist", ".pikku"],
155
- "peerDependencies": {
156
- "@pikku/core": "*"
157
- },
158
- "scripts": {
159
- "pikku": "pikku all",
160
- "build": "tsc && cp -r .pikku dist/"
161
- }
162
- }
163
- ```
105
+ This generates `package.json` (exports `.pikku/*` + `dist/`), `pikku.config.json` (`addon: true`), `tsconfig.json` (`#pikku` path mapping), `src/services.ts`, `src/functions/`, and `types/application-types.d.ts`. For the full file contents/exports you rarely hand-edit, read `references/addon-package-manifest.md`.
164
106
 
165
107
  ### Services
166
108
 
@@ -202,6 +144,13 @@ export const addTodo = pikkuSessionlessFunc({
202
144
  })
203
145
  ```
204
146
 
147
+ Optional approval gating (e.g. for agent tools) — add `approvalRequired: true` plus an `approvalDescription` resolver:
148
+
149
+ ```typescript
150
+ approvalRequired: true,
151
+ approvalDescription: async (_services, { title }) => `Add a todo called "${title}"`,
152
+ ```
153
+
205
154
  ### Build
206
155
 
207
156
  ```bash
@@ -251,6 +200,23 @@ wireHTTP({
251
200
  })
252
201
  ```
253
202
 
203
+ Or batch multiple addon routes with `defineHTTPRoutes` + `wireHTTPRoutes`:
204
+
205
+ ```typescript
206
+ import { wireHTTPRoutes, defineHTTPRoutes, addon } from '#pikku'
207
+
208
+ const todoRoutes = defineHTTPRoutes({
209
+ tags: ['todos'],
210
+ auth: false,
211
+ routes: {
212
+ list: { method: 'get', route: '/todos', func: addon('todos:listTodos') },
213
+ add: { method: 'post', route: '/todos', func: addon('todos:addTodo') },
214
+ },
215
+ })
216
+
217
+ wireHTTPRoutes({ basePath: '/api', routes: { todos: todoRoutes } })
218
+ ```
219
+
254
220
  ### Use in AI Agents
255
221
 
256
222
  ```typescript
@@ -270,61 +236,3 @@ export const todoAgent = pikkuAIAgent({
270
236
  maxSteps: 5,
271
237
  })
272
238
  ```
273
-
274
- ## Complete Example
275
-
276
- ```typescript
277
- // --- ADDON PACKAGE: @my-org/addon-todos ---
278
-
279
- // src/services.ts
280
- import { pikkuAddonServices } from '#pikku'
281
-
282
- export const createSingletonServices = pikkuAddonServices(async () => {
283
- return { todoStore: new TodoStore() }
284
- })
285
-
286
- // src/functions/listTodos.function.ts
287
- export const listTodos = pikkuSessionlessFunc({
288
- description: 'List all todos',
289
- func: async ({ todoStore }) => {
290
- return { todos: todoStore.list() }
291
- },
292
- })
293
-
294
- // src/functions/addTodo.function.ts
295
- export const addTodo = pikkuSessionlessFunc({
296
- description: 'Add a new todo',
297
- approvalRequired: true,
298
- approvalDescription: async (_services, { title }) => {
299
- return `Add a todo called "${title}"`
300
- },
301
- input: z.object({ title: z.string() }),
302
- output: z.object({ id: z.string(), title: z.string() }),
303
- func: async ({ todoStore }, { title }) => {
304
- return todoStore.add(title)
305
- },
306
- })
307
-
308
- // --- CONSUMING PROJECT ---
309
-
310
- // wirings/addons.wirings.ts
311
- import { wireAddon } from '#pikku'
312
- wireAddon({ name: 'todos', package: '@my-org/addon-todos' })
313
-
314
- // wirings/api.http.ts
315
- import { wireHTTPRoutes, defineHTTPRoutes, addon } from '#pikku'
316
-
317
- const todoRoutes = defineHTTPRoutes({
318
- tags: ['todos'],
319
- auth: false,
320
- routes: {
321
- list: { method: 'get', route: '/todos', func: addon('todos:listTodos') },
322
- add: { method: 'post', route: '/todos', func: addon('todos:addTodo') },
323
- },
324
- })
325
-
326
- wireHTTPRoutes({
327
- basePath: '/api',
328
- routes: { todos: todoRoutes },
329
- })
330
- ```
@@ -0,0 +1,63 @@
1
+ # Addon Package Manifest Reference
2
+
3
+ `npx pikku new addon` scaffolds these files. You rarely hand-edit them — consult this when wiring exports or config by hand.
4
+
5
+ ## Package Structure
6
+
7
+ ```text
8
+ my-addon/
9
+ ├── package.json # Exports .pikku/* and dist/
10
+ ├── pikku.config.json # addon: true + metadata
11
+ ├── tsconfig.json # #pikku path mapping
12
+ ├── src/
13
+ │ ├── services.ts # createSingletonServices (required)
14
+ │ └── functions/
15
+ │ └── *.function.ts # Function definitions
16
+ ├── types/
17
+ │ └── application-types.d.ts # SingletonServices interface
18
+ └── .pikku/ # Generated (gitignored)
19
+ ```
20
+
21
+ ## pikku.config.json
22
+
23
+ ```json
24
+ {
25
+ "tsconfig": "./tsconfig.json",
26
+ "srcDirectories": ["src", "types"],
27
+ "outDir": "./.pikku",
28
+ "addon": true,
29
+ "node": {
30
+ "displayName": "My Addon",
31
+ "description": "What this addon does",
32
+ "categories": ["General"]
33
+ }
34
+ }
35
+ ```
36
+
37
+ ## package.json (key fields)
38
+
39
+ ```json
40
+ {
41
+ "name": "@my-org/addon-todos",
42
+ "imports": {
43
+ "#pikku": "./.pikku/pikku-types.gen.ts",
44
+ "#pikku/*": "./.pikku/*"
45
+ },
46
+ "exports": {
47
+ ".": { "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js" },
48
+ "./.pikku/*": "./.pikku/*",
49
+ "./.pikku/pikku-metadata.gen.json": "./.pikku/pikku-metadata.gen.json",
50
+ "./.pikku/rpc/pikku-rpc-wirings-map.internal.gen.js": {
51
+ "types": "./.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts"
52
+ }
53
+ },
54
+ "files": ["dist", ".pikku"],
55
+ "peerDependencies": {
56
+ "@pikku/core": "*"
57
+ },
58
+ "scripts": {
59
+ "pikku": "pikku all",
60
+ "build": "tsc && cp -r .pikku dist/"
61
+ }
62
+ }
63
+ ```
@@ -172,110 +172,24 @@ wireCLI({
172
172
 
173
173
  ### Custom Renderers
174
174
 
175
+ A renderer receives `(services, data)` where `data` is the func's output. Set `render` on `wireCLI` as the program-wide default; set `render` on a `pikkuCLICommand` to override it for that command.
176
+
175
177
  ```typescript
176
178
  const todoRenderer = pikkuCLIRender<{ todo: Todo }>((_services, { todo }) => {
177
179
  console.log(`✓ Created: ${todo.text} (priority: ${todo.priority})`)
178
180
  })
179
181
 
180
- const todosRenderer = pikkuCLIRender<{ todos: Todo[] }>(
181
- (_services, { todos }) => {
182
- todos.forEach((t, i) => {
183
- const check = t.completed ? '✓' : ' '
184
- console.log(` ${i + 1}. ${t.text} ${check}`)
185
- })
186
- }
187
- )
188
-
189
- // Default renderer for program, override per-command
190
182
  wireCLI({
191
183
  program: 'todos',
192
- render: jsonRenderer,
184
+ render: jsonRenderer, // default for all commands
193
185
  commands: {
194
- add: pikkuCLICommand({
195
- func: createTodo,
196
- render: todoRenderer, // Overrides jsonRenderer
197
- }),
186
+ add: pikkuCLICommand({ func: createTodo, render: todoRenderer }), // overrides jsonRenderer
198
187
  },
199
188
  })
200
189
  ```
201
190
 
202
- ## Complete Example
203
-
204
- ```typescript
205
- // functions/admin.functions.ts
206
- export const createUser = pikkuFunc({
207
- title: 'Create User',
208
- func: async ({ db }, { username, email, admin }) => {
209
- const user = await db.createUser({
210
- username,
211
- email,
212
- role: admin ? 'admin' : 'user',
213
- })
214
- return { user }
215
- },
216
- })
217
-
218
- export const listUsers = pikkuSessionlessFunc({
219
- title: 'List Users',
220
- func: async ({ db }, { limit }) => {
221
- return { users: await db.listUsers(limit || 50) }
222
- },
223
- })
224
-
225
- export const deleteUser = pikkuFunc({
226
- title: 'Delete User',
227
- func: async ({ db }, { username }) => {
228
- await db.deleteUser(username)
229
- return { deleted: username }
230
- },
231
- })
191
+ The func's input is the positional `parameters` plus `options`, merged (e.g. `parameters: '<username> <email>'` + an `admin` option → func input `{ username, email, admin }`).
232
192
 
233
- // wirings/cli.wiring.ts
234
- const userRenderer = pikkuCLIRender<{ user: User }>((_services, { user }) => {
235
- console.log(`Created user: ${user.username} (${user.email}) [${user.role}]`)
236
- })
237
-
238
- const usersRenderer = pikkuCLIRender<{ users: User[] }>(
239
- (_services, { users }) => {
240
- console.log(`Users (${users.length}):`)
241
- users.forEach((u) =>
242
- console.log(` ${u.username} <${u.email}> [${u.role}]`)
243
- )
244
- }
245
- )
193
+ ## Complete Example
246
194
 
247
- wireCLI({
248
- program: 'admin',
249
- commands: {
250
- user: {
251
- description: 'User management',
252
- subcommands: {
253
- create: pikkuCLICommand({
254
- parameters: '<username> <email>',
255
- func: createUser,
256
- render: userRenderer,
257
- options: {
258
- admin: {
259
- description: 'Create as admin',
260
- short: 'a',
261
- default: false,
262
- },
263
- },
264
- }),
265
- list: pikkuCLICommand({
266
- func: listUsers,
267
- render: usersRenderer,
268
- options: {
269
- limit: { description: 'Max results', short: 'l' },
270
- },
271
- }),
272
- delete: pikkuCLICommand({
273
- parameters: '<username>',
274
- func: deleteUser,
275
- description: 'Delete a user',
276
- }),
277
- },
278
- },
279
- },
280
- })
281
- ```
195
+ For a full functions + renderers + nested-subcommand wiring walkthrough, see `references/complete-example.md`.
@@ -0,0 +1,82 @@
1
+ # Complete CLI Example
2
+
3
+ End-to-end: functions + renderers + nested-subcommand wiring. Note how each func's input is the positional `parameters` plus `options`, merged (e.g. `parameters: '<username> <email>'` + option `admin` → func input `{ username, email, admin }`).
4
+
5
+ ```typescript
6
+ // functions/admin.functions.ts
7
+ export const createUser = pikkuFunc({
8
+ title: 'Create User',
9
+ func: async ({ db }, { username, email, admin }) => {
10
+ const user = await db.createUser({
11
+ username,
12
+ email,
13
+ role: admin ? 'admin' : 'user',
14
+ })
15
+ return { user }
16
+ },
17
+ })
18
+
19
+ export const listUsers = pikkuSessionlessFunc({
20
+ title: 'List Users',
21
+ func: async ({ db }, { limit }) => {
22
+ return { users: await db.listUsers(limit || 50) }
23
+ },
24
+ })
25
+
26
+ export const deleteUser = pikkuFunc({
27
+ title: 'Delete User',
28
+ func: async ({ db }, { username }) => {
29
+ await db.deleteUser(username)
30
+ return { deleted: username }
31
+ },
32
+ })
33
+
34
+ // wirings/cli.wiring.ts
35
+ const userRenderer = pikkuCLIRender<{ user: User }>((_services, { user }) => {
36
+ console.log(`Created user: ${user.username} (${user.email}) [${user.role}]`)
37
+ })
38
+
39
+ const usersRenderer = pikkuCLIRender<{ users: User[] }>(
40
+ (_services, { users }) => {
41
+ console.log(`Users (${users.length}):`)
42
+ users.forEach((u) =>
43
+ console.log(` ${u.username} <${u.email}> [${u.role}]`)
44
+ )
45
+ }
46
+ )
47
+
48
+ wireCLI({
49
+ program: 'admin',
50
+ commands: {
51
+ user: {
52
+ description: 'User management',
53
+ subcommands: {
54
+ create: pikkuCLICommand({
55
+ parameters: '<username> <email>',
56
+ func: createUser,
57
+ render: userRenderer,
58
+ options: {
59
+ admin: {
60
+ description: 'Create as admin',
61
+ short: 'a',
62
+ default: false,
63
+ },
64
+ },
65
+ }),
66
+ list: pikkuCLICommand({
67
+ func: listUsers,
68
+ render: usersRenderer,
69
+ options: {
70
+ limit: { description: 'Max results', short: 'l' },
71
+ },
72
+ }),
73
+ delete: pikkuCLICommand({
74
+ parameters: '<username>',
75
+ func: deleteUser,
76
+ description: 'Delete a user',
77
+ }),
78
+ },
79
+ },
80
+ },
81
+ })
82
+ ```