@pikku/cli 0.12.20 → 0.12.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.schema.json +1 -1
- package/console-app/assets/index-C52h1B_L.css +1 -0
- package/console-app/assets/index-CAk106ji.js +232 -0
- package/console-app/index.html +3 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +3 -3
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +6 -6
- package/dist/.pikku/cli/pikku-cli-channel.js +280 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +792 -8
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +44 -70
- package/dist/.pikku/function/pikku-function-types.gen.js +33 -40
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +1439 -316
- package/dist/.pikku/function/pikku-functions.gen.js +21 -9
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +3 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +3 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +2 -1
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.d.ts +1 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +6 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +250 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +4 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +5 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +66 -10
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +157 -11
- package/dist/.pikku/schemas/schemas/BinaryInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbMigrateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbResetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbSeedInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuCommandChannelsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCommandHTTPOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCommandQueueOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuEventsScaffoldOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaClientsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaContextInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresChannelInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresHttpInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresQueueInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresSchedulerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTriggerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTypeInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsInstallInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsCoverageInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsInitInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/WorkflowRunStatus.schema.json +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +237 -629
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +23 -0
- package/dist/bin/pikku.js +28 -1
- package/dist/src/cli.wiring.js +286 -10
- package/dist/src/deploy/analyzer/analyzer.d.ts +16 -1
- package/dist/src/deploy/analyzer/analyzer.js +83 -43
- package/dist/src/deploy/analyzer/manifest.d.ts +10 -0
- package/dist/src/deploy/build-pipeline.d.ts +2 -0
- package/dist/src/deploy/build-pipeline.js +123 -19
- package/dist/src/deploy/bundler/bundler.d.ts +3 -1
- package/dist/src/deploy/bundler/bundler.js +40 -9
- package/dist/src/deploy/bundler/dep-extractor.d.ts +5 -2
- package/dist/src/deploy/bundler/dep-extractor.js +103 -23
- package/dist/src/deploy/bundler/types.d.ts +5 -1
- package/dist/src/deploy/codegen/per-unit-codegen.d.ts +11 -1
- package/dist/src/deploy/codegen/per-unit-codegen.js +49 -6
- package/dist/src/deploy/plan/planner.js +25 -3
- package/dist/src/deploy/plan/provider.d.ts +2 -0
- package/dist/src/deploy/provider-adapter.d.ts +34 -0
- package/dist/src/deploy/server-entry.d.ts +16 -0
- package/dist/src/deploy/server-entry.js +81 -0
- package/dist/src/fabric/fabric-commands.d.ts +522 -0
- package/dist/src/fabric/fabric-commands.js +299 -0
- package/dist/src/fabric/functions/db-schema.function.d.ts +35 -0
- package/dist/src/fabric/functions/db-schema.function.js +37 -0
- package/dist/src/fabric/functions/deploy-list.function.d.ts +41 -0
- package/dist/src/fabric/functions/deploy-list.function.js +43 -0
- package/dist/src/fabric/functions/deploy-units.function.d.ts +35 -0
- package/dist/src/fabric/functions/deploy-units.function.js +41 -0
- package/dist/src/fabric/functions/deploy.function.d.ts +105 -0
- package/dist/src/fabric/functions/deploy.function.js +122 -0
- package/dist/src/fabric/functions/domains-add.function.d.ts +35 -0
- package/dist/src/fabric/functions/domains-add.function.js +46 -0
- package/dist/src/fabric/functions/domains-list.function.d.ts +20 -0
- package/dist/src/fabric/functions/domains-list.function.js +50 -0
- package/dist/src/fabric/functions/domains-remove.function.d.ts +24 -0
- package/dist/src/fabric/functions/domains-remove.function.js +44 -0
- package/dist/src/fabric/functions/errors.function.d.ts +44 -0
- package/dist/src/fabric/functions/errors.function.js +50 -0
- package/dist/src/fabric/functions/init.function.d.ts +51 -0
- package/dist/src/fabric/functions/init.function.js +54 -0
- package/dist/src/fabric/functions/link.function.d.ts +28 -0
- package/dist/src/fabric/functions/link.function.js +77 -0
- package/dist/src/fabric/functions/llm-key.function.d.ts +46 -0
- package/dist/src/fabric/functions/llm-key.function.js +76 -0
- package/dist/src/fabric/functions/login.function.d.ts +42 -0
- package/dist/src/fabric/functions/login.function.js +68 -0
- package/dist/src/fabric/functions/logs.function.d.ts +40 -0
- package/dist/src/fabric/functions/logs.function.js +84 -0
- package/dist/src/fabric/functions/metrics.function.d.ts +32 -0
- package/dist/src/fabric/functions/metrics.function.js +49 -0
- package/dist/src/fabric/functions/rollback.function.d.ts +76 -0
- package/dist/src/fabric/functions/rollback.function.js +69 -0
- package/dist/src/fabric/functions/secrets-list.function.d.ts +24 -0
- package/dist/src/fabric/functions/secrets-list.function.js +37 -0
- package/dist/src/fabric/functions/secrets-set.function.d.ts +32 -0
- package/dist/src/fabric/functions/secrets-set.function.js +36 -0
- package/dist/src/fabric/functions/status.function.d.ts +34 -0
- package/dist/src/fabric/functions/status.function.js +43 -0
- package/dist/src/fabric/functions/trace.function.d.ts +28 -0
- package/dist/src/fabric/functions/trace.function.js +45 -0
- package/dist/src/fabric/functions/validate.function.d.ts +50 -0
- package/dist/src/fabric/functions/validate.function.js +363 -0
- package/dist/src/fabric/lib/config.d.ts +64 -0
- package/dist/src/fabric/lib/config.js +62 -0
- package/dist/src/fabric/lib/console-url.d.ts +5 -0
- package/dist/src/fabric/lib/console-url.js +13 -0
- package/dist/src/fabric/lib/git.d.ts +53 -0
- package/dist/src/fabric/lib/git.js +151 -0
- package/dist/src/fabric/lib/http.d.ts +4 -0
- package/dist/src/fabric/lib/http.js +12 -0
- package/dist/src/fabric/lib/not-implemented.d.ts +5 -0
- package/dist/src/fabric/lib/not-implemented.js +8 -0
- package/dist/src/fabric/lib/output.d.ts +23 -0
- package/dist/src/fabric/lib/output.js +39 -0
- package/dist/src/fabric/lib/prompt.d.ts +12 -0
- package/dist/src/fabric/lib/prompt.js +32 -0
- package/dist/src/fabric/lib/stage.d.ts +7 -0
- package/dist/src/fabric/lib/stage.js +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.d.ts +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.js +30 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.d.ts +105 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.js +126 -0
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/binary.d.ts +7 -0
- package/dist/src/functions/commands/binary.js +40 -0
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +7 -4
- package/dist/src/functions/commands/console.d.ts +3 -3
- package/dist/src/functions/commands/db-migrate.d.ts +1 -0
- package/dist/src/functions/commands/db-migrate.js +35 -0
- package/dist/src/functions/commands/db-reset.d.ts +1 -0
- package/dist/src/functions/commands/db-reset.js +36 -0
- package/dist/src/functions/commands/db-seed.d.ts +1 -0
- package/dist/src/functions/commands/db-seed.js +27 -0
- package/dist/src/functions/commands/db-shared.d.ts +32 -0
- package/dist/src/functions/commands/db-shared.js +26 -0
- package/dist/src/functions/commands/deploy-apply.d.ts +3 -3
- package/dist/src/functions/commands/deploy-apply.js +6 -4
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/deploy-plan.d.ts +3 -3
- package/dist/src/functions/commands/deploy-plan.js +7 -1
- package/dist/src/functions/commands/dev.d.ts +3 -3
- package/dist/src/functions/commands/dev.js +142 -86
- package/dist/src/functions/commands/enable.d.ts +5 -4
- package/dist/src/functions/commands/enable.js +4 -0
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/load-user-project.d.ts +11 -0
- package/dist/src/functions/commands/load-user-project.js +40 -0
- package/dist/src/functions/commands/meta.d.ts +82 -0
- package/dist/src/functions/commands/meta.js +454 -0
- package/dist/src/functions/commands/new-addon.d.ts +3 -3
- package/dist/src/functions/commands/new-function.d.ts +3 -3
- package/dist/src/functions/commands/new-middleware.d.ts +3 -3
- package/dist/src/functions/commands/new-permission.d.ts +3 -3
- package/dist/src/functions/commands/new-wiring.d.ts +3 -3
- package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-bootstrap.js +15 -1
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-summary.js +7 -1
- package/dist/src/functions/commands/skills.d.ts +26 -0
- package/dist/src/functions/commands/skills.js +184 -0
- package/dist/src/functions/commands/tests-coverage.d.ts +7 -0
- package/dist/src/functions/commands/tests-coverage.js +231 -0
- package/dist/src/functions/commands/tests-init.d.ts +7 -0
- package/dist/src/functions/commands/tests-init.js +225 -0
- package/dist/src/functions/commands/versions-check.d.ts +1 -1
- package/dist/src/functions/commands/versions-init.d.ts +3 -3
- package/dist/src/functions/commands/versions-update.d.ts +1 -1
- package/dist/src/functions/commands/versions-update.js +4 -2
- package/dist/src/functions/commands/watch.d.ts +3 -3
- package/dist/src/functions/commands/watch.js +1 -1
- package/dist/src/functions/db/local-db.d.ts +48 -0
- package/dist/src/functions/db/local-db.js +106 -0
- package/dist/src/functions/db/seed.d.ts +11 -0
- package/dist/src/functions/db/seed.js +22 -0
- package/dist/src/functions/db/sql-migrator.d.ts +26 -0
- package/dist/src/functions/db/sql-migrator.js +104 -0
- package/dist/src/functions/db/sqlite-codegen.d.ts +45 -0
- package/dist/src/functions/db/sqlite-codegen.js +294 -0
- package/dist/src/functions/db/zod-codegen.d.ts +10 -0
- package/dist/src/functions/db/zod-codegen.js +109 -0
- package/dist/src/functions/runtimes/fetch/index.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +21 -2
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.d.ts +1 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.js +163 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +5 -2
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -0
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.js +32 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.d.ts +11 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.js +36 -0
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.js +1 -10
- package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +76 -1
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +5 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +5 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +8 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +27 -9
- package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +5 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +13 -3
- package/dist/src/functions/wirings/console/pikku-command-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-console-functions.js +5 -1
- package/dist/src/functions/wirings/console/pikku-command-node-types.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
- package/dist/src/functions/wirings/console/serialize-console-functions.js +5 -0
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +5 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.js +7 -2
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +105 -80
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.d.ts +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -1
- package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +2 -2
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.d.ts +1 -0
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +26 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.js +35 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.d.ts +23 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.js +98 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.d.ts +22 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.js +337 -0
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +5 -1
- package/dist/src/functions/wirings/rpc/pikku-command-react-query.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.js +5 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.js +3 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +2 -2
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +2 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +13 -7
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +1 -0
- package/dist/src/functions/wirings/rpc/serialize-react-query-hooks.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +7 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +16 -2
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.d.ts +1 -1
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.js +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.d.ts +1 -1
- package/dist/src/functions/wirings/variables/pikku-command-variables.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +5 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +18 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.d.ts +3 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.js +40 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +56 -2
- package/dist/src/functions/workflows/all.workflow.js +45 -12
- package/dist/src/scaffold/rpc-remote.gen.d.ts +3 -3
- package/dist/src/scaffold/rpc-remote.gen.js +7 -2
- package/dist/src/scaffold/workflow-routes.gen.d.ts +18 -18
- package/dist/src/scaffold/workflow-routes.gen.js +33 -1
- package/dist/src/services/cli-logger.service.d.ts +22 -3
- package/dist/src/services/cli-logger.service.js +107 -41
- package/dist/src/services.js +32 -67
- package/dist/src/utils/generate-bootstrap-file.js +3 -0
- package/dist/src/utils/parse-cli-filters.d.ts +18 -0
- package/dist/src/utils/parse-cli-filters.js +99 -0
- package/dist/src/utils/pikku-cli-config.js +29 -9
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -4
- package/skills/pikku-addon/SKILL.md +330 -0
- package/skills/pikku-ai-agent/SKILL.md +227 -0
- package/skills/pikku-ai-vercel/SKILL.md +78 -0
- package/skills/pikku-ai-voice/SKILL.md +85 -0
- package/skills/pikku-auth-js/SKILL.md +106 -0
- package/skills/pikku-aws/SKILL.md +107 -0
- package/skills/pikku-backblaze/SKILL.md +70 -0
- package/skills/pikku-cli/SKILL.md +281 -0
- package/skills/pikku-concepts/SKILL.md +281 -0
- package/skills/pikku-concepts/references/concept-mapping.md +528 -0
- package/skills/pikku-config/SKILL.md +208 -0
- package/skills/pikku-cron/SKILL.md +211 -0
- package/skills/pikku-deploy-azure/SKILL.md +69 -0
- package/skills/pikku-deploy-cloudflare/SKILL.md +80 -0
- package/skills/pikku-deploy-express/SKILL.md +83 -0
- package/skills/pikku-deploy-fastify/SKILL.md +70 -0
- package/skills/pikku-deploy-lambda/SKILL.md +107 -0
- package/skills/pikku-deploy-nextjs/SKILL.md +76 -0
- package/skills/pikku-deploy-uws/SKILL.md +85 -0
- package/skills/pikku-fabric/SKILL.md +245 -0
- package/skills/pikku-feature/SKILL.md +258 -0
- package/skills/pikku-gateway-slack/SKILL.md +112 -0
- package/skills/pikku-http/SKILL.md +317 -0
- package/skills/pikku-i18n/SKILL.md +208 -0
- package/skills/pikku-info/SKILL.md +95 -0
- package/skills/pikku-jose/SKILL.md +102 -0
- package/skills/pikku-kysely/SKILL.md +145 -0
- package/skills/pikku-mcp/SKILL.md +237 -0
- package/skills/pikku-mongodb/SKILL.md +102 -0
- package/skills/pikku-n8n-addon-map/SKILL.md +178 -0
- package/skills/pikku-n8n-code-translate/SKILL.md +166 -0
- package/skills/pikku-pino/SKILL.md +77 -0
- package/skills/pikku-queue/SKILL.md +237 -0
- package/skills/pikku-react/SKILL.md +183 -0
- package/skills/pikku-react-query/SKILL.md +205 -0
- package/skills/pikku-realtime/SKILL.md +285 -0
- package/skills/pikku-redis/SKILL.md +87 -0
- package/skills/pikku-rpc/SKILL.md +168 -0
- package/skills/pikku-rtl/SKILL.md +205 -0
- package/skills/pikku-schedule/SKILL.md +54 -0
- package/skills/pikku-schema-ajv/SKILL.md +60 -0
- package/skills/pikku-schema-cfworker/SKILL.md +60 -0
- package/skills/pikku-security/SKILL.md +243 -0
- package/skills/pikku-services/SKILL.md +247 -0
- package/skills/pikku-template-clone/SKILL.md +39 -0
- package/skills/pikku-testing/SKILL.md +428 -0
- package/skills/pikku-trigger/SKILL.md +177 -0
- package/skills/pikku-versioning/SKILL.md +169 -0
- package/skills/pikku-websocket/SKILL.md +239 -0
- package/skills/pikku-workflow/SKILL.md +283 -0
- package/skills/pikku-workflows-client/SKILL.md +150 -0
- package/skills/pikku-ws/SKILL.md +45 -0
- package/console-app/assets/index-BpY2pSuA.css +0 -10
- package/console-app/assets/index-DXLy-_D4.js +0 -717
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli-client.gen.js +0 -44
- /package/dist/.pikku/schemas/schemas/{PikkuChannelsOutput.schema.json → PikkuCLIEntryOutput.schema.json} +0 -0
|
@@ -43,12 +43,57 @@ export function parsePackageName(specifier) {
|
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
45
|
const builtins = new Set([
|
|
46
|
-
'assert',
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
46
|
+
'assert',
|
|
47
|
+
'buffer',
|
|
48
|
+
'child_process',
|
|
49
|
+
'cluster',
|
|
50
|
+
'console',
|
|
51
|
+
'constants',
|
|
52
|
+
'crypto',
|
|
53
|
+
'dgram',
|
|
54
|
+
'dns',
|
|
55
|
+
'domain',
|
|
56
|
+
'events',
|
|
57
|
+
'fs',
|
|
58
|
+
'http',
|
|
59
|
+
'http2',
|
|
60
|
+
'https',
|
|
61
|
+
'inspector',
|
|
62
|
+
'module',
|
|
63
|
+
'net',
|
|
64
|
+
'os',
|
|
65
|
+
'path',
|
|
66
|
+
'perf_hooks',
|
|
67
|
+
'process',
|
|
68
|
+
'punycode',
|
|
69
|
+
'querystring',
|
|
70
|
+
'readline',
|
|
71
|
+
'repl',
|
|
72
|
+
'stream',
|
|
73
|
+
'string_decoder',
|
|
74
|
+
'sys',
|
|
75
|
+
'timers',
|
|
76
|
+
'tls',
|
|
77
|
+
'tty',
|
|
78
|
+
'url',
|
|
79
|
+
'util',
|
|
80
|
+
'v8',
|
|
81
|
+
'vm',
|
|
82
|
+
'wasi',
|
|
83
|
+
'worker_threads',
|
|
84
|
+
'zlib',
|
|
85
|
+
'async_hooks',
|
|
86
|
+
'child_process',
|
|
87
|
+
'cluster',
|
|
88
|
+
'diagnostics_channel',
|
|
89
|
+
'dns/promises',
|
|
90
|
+
'fs/promises',
|
|
91
|
+
'readline/promises',
|
|
92
|
+
'stream/consumers',
|
|
93
|
+
'stream/promises',
|
|
94
|
+
'stream/web',
|
|
95
|
+
'timers/promises',
|
|
96
|
+
'util/types',
|
|
52
97
|
]);
|
|
53
98
|
if (builtins.has(specifier.split('/')[0])) {
|
|
54
99
|
return null;
|
|
@@ -68,7 +113,7 @@ export function parsePackageName(specifier) {
|
|
|
68
113
|
*/
|
|
69
114
|
async function readProjectDependencies(projectDir) {
|
|
70
115
|
const dependencies = {};
|
|
71
|
-
const
|
|
116
|
+
const optionalDependencies = {};
|
|
72
117
|
// Walk up the directory tree to find all package.json files
|
|
73
118
|
// (handles monorepo setups where deps are in the root package.json)
|
|
74
119
|
let dir = projectDir;
|
|
@@ -82,9 +127,9 @@ async function readProjectDependencies(projectDir) {
|
|
|
82
127
|
if (!(k in dependencies))
|
|
83
128
|
dependencies[k] = v;
|
|
84
129
|
}
|
|
85
|
-
for (const [k, v] of Object.entries(pkg.
|
|
86
|
-
if (!(k in
|
|
87
|
-
|
|
130
|
+
for (const [k, v] of Object.entries(pkg.optionalDependencies ?? {})) {
|
|
131
|
+
if (!(k in optionalDependencies))
|
|
132
|
+
optionalDependencies[k] = v;
|
|
88
133
|
}
|
|
89
134
|
}
|
|
90
135
|
catch {
|
|
@@ -95,7 +140,7 @@ async function readProjectDependencies(projectDir) {
|
|
|
95
140
|
break;
|
|
96
141
|
dir = parent;
|
|
97
142
|
}
|
|
98
|
-
return { dependencies,
|
|
143
|
+
return { dependencies, optionalDependencies };
|
|
99
144
|
}
|
|
100
145
|
/**
|
|
101
146
|
* Attempts to read a version from yarn.lock for a given package.
|
|
@@ -161,7 +206,27 @@ function parseYarnLockKeyLine(line) {
|
|
|
161
206
|
* Resolves the exact version for a package, trying yarn.lock first,
|
|
162
207
|
* then falling back to the version range from package.json.
|
|
163
208
|
*/
|
|
164
|
-
function
|
|
209
|
+
async function resolveInstalledPackageVersion(packageName, projectDir) {
|
|
210
|
+
let dir = projectDir;
|
|
211
|
+
while (true) {
|
|
212
|
+
const pkgPath = join(dir, 'node_modules', packageName, 'package.json');
|
|
213
|
+
try {
|
|
214
|
+
const content = await readFile(pkgPath, 'utf-8');
|
|
215
|
+
const pkg = JSON.parse(content);
|
|
216
|
+
if (pkg.version)
|
|
217
|
+
return pkg.version;
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
// Keep walking up to workspace root
|
|
221
|
+
}
|
|
222
|
+
const parent = join(dir, '..');
|
|
223
|
+
if (parent === dir)
|
|
224
|
+
break;
|
|
225
|
+
dir = parent;
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
async function resolveVersion(packageName, projectDeps, yarnLockVersions, projectDir) {
|
|
165
230
|
// Prefer exact version from yarn.lock
|
|
166
231
|
const locked = yarnLockVersions.get(packageName);
|
|
167
232
|
if (locked)
|
|
@@ -170,12 +235,13 @@ function resolveVersion(packageName, projectDeps, yarnLockVersions) {
|
|
|
170
235
|
const fromDeps = projectDeps.dependencies[packageName];
|
|
171
236
|
if (fromDeps)
|
|
172
237
|
return fromDeps;
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
return
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
238
|
+
const fromOptionalDeps = projectDeps.optionalDependencies[packageName];
|
|
239
|
+
if (fromOptionalDeps)
|
|
240
|
+
return fromOptionalDeps;
|
|
241
|
+
const installedVersion = await resolveInstalledPackageVersion(packageName, projectDir);
|
|
242
|
+
if (installedVersion)
|
|
243
|
+
return installedVersion;
|
|
244
|
+
return null;
|
|
179
245
|
}
|
|
180
246
|
/**
|
|
181
247
|
* Given an esbuild metafile, extracts all external packages and resolves
|
|
@@ -187,27 +253,41 @@ function resolveVersion(packageName, projectDeps, yarnLockVersions) {
|
|
|
187
253
|
export async function extractDependencies(metafile, projectDir) {
|
|
188
254
|
const externalPackages = extractExternalPackages(metafile);
|
|
189
255
|
if (externalPackages.size === 0) {
|
|
190
|
-
return {};
|
|
256
|
+
return { exactDependencies: {}, exactOptionalDependencies: {} };
|
|
191
257
|
}
|
|
192
258
|
const [projectDeps, yarnLockVersions] = await Promise.all([
|
|
193
259
|
readProjectDependencies(projectDir),
|
|
194
260
|
readYarnLockVersions(projectDir),
|
|
195
261
|
]);
|
|
196
|
-
const
|
|
262
|
+
const exactDependencies = {};
|
|
263
|
+
const exactOptionalDependencies = {};
|
|
197
264
|
for (const pkg of [...externalPackages].sort()) {
|
|
198
|
-
|
|
265
|
+
const version = await resolveVersion(pkg, projectDeps, yarnLockVersions, projectDir);
|
|
266
|
+
if (!version) {
|
|
267
|
+
// Some packages are optional-at-runtime (e.g. ws acceleration addons).
|
|
268
|
+
// Keep deploy planning deterministic without forcing a hard failure.
|
|
269
|
+
exactOptionalDependencies[pkg] = '*';
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
if (pkg in projectDeps.optionalDependencies) {
|
|
273
|
+
exactOptionalDependencies[pkg] = version;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
exactDependencies[pkg] = version;
|
|
277
|
+
}
|
|
199
278
|
}
|
|
200
|
-
return
|
|
279
|
+
return { exactDependencies, exactOptionalDependencies };
|
|
201
280
|
}
|
|
202
281
|
/**
|
|
203
282
|
* Generates a minimal package.json content object for a unit bundle.
|
|
204
283
|
*/
|
|
205
|
-
export function generateMinimalPackageJson(unitName, dependencies) {
|
|
284
|
+
export function generateMinimalPackageJson(unitName, dependencies, optionalDependencies) {
|
|
206
285
|
return {
|
|
207
286
|
name: unitName,
|
|
208
287
|
private: true,
|
|
209
288
|
type: 'module',
|
|
210
289
|
main: 'bundle.js',
|
|
211
290
|
dependencies,
|
|
291
|
+
optionalDependencies,
|
|
212
292
|
};
|
|
213
293
|
}
|
|
@@ -7,9 +7,13 @@ export interface BundleResult {
|
|
|
7
7
|
unitName: string;
|
|
8
8
|
bundlePath: string;
|
|
9
9
|
packageJsonPath: string;
|
|
10
|
+
exactDependenciesPath: string;
|
|
10
11
|
metafilePath: string;
|
|
11
12
|
bundleSizeBytes: number;
|
|
12
|
-
|
|
13
|
+
bundleHash: string;
|
|
14
|
+
exactDependenciesHash: string;
|
|
15
|
+
exactDependencies: Record<string, string>;
|
|
16
|
+
exactOptionalDependencies: Record<string, string>;
|
|
13
17
|
}
|
|
14
18
|
export interface BundleError {
|
|
15
19
|
unitName: string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Uses --stateInput to avoid re-inspecting the codebase for each unit.
|
|
9
9
|
*/
|
|
10
10
|
import type { InspectorState } from '@pikku/inspector';
|
|
11
|
-
import type { DeploymentManifest } from '../analyzer/manifest.js';
|
|
11
|
+
import type { DeploymentManifest, DeploymentUnit } from '../analyzer/manifest.js';
|
|
12
12
|
export interface PerUnitCodegenOptions {
|
|
13
13
|
/** Root directory of the project (where pikku.config.json lives) */
|
|
14
14
|
projectDir: string;
|
|
@@ -22,6 +22,16 @@ export interface PerUnitCodegenOptions {
|
|
|
22
22
|
pikkuBin?: string;
|
|
23
23
|
/** Called for each unit as it starts/completes */
|
|
24
24
|
onProgress?: (unitName: string, status: 'start' | 'done' | 'error', error?: string) => void;
|
|
25
|
+
/** Resolve unit output directory (defaults to <deployDir>/<unit-name>) */
|
|
26
|
+
resolveUnitDir?: (unit: DeploymentUnit, baseDeployDir: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the deploy pipeline emits per-step workflow queues. When `false`
|
|
29
|
+
* the per-unit codegen filter does NOT include `wf-orchestrator-*` /
|
|
30
|
+
* `wf-step-*` queue names — they don't exist in the manifest, and pulling
|
|
31
|
+
* them through codegen would force the workflow runtime to register queue
|
|
32
|
+
* meta the provider doesn't actually use. Defaults to `true`.
|
|
33
|
+
*/
|
|
34
|
+
workflowQueues?: boolean;
|
|
25
35
|
}
|
|
26
36
|
export interface PerUnitCodegenResult {
|
|
27
37
|
/** Map of unit name -> path to the unit's .pikku directory */
|
|
@@ -34,7 +34,7 @@ function resolvePikkuBin() {
|
|
|
34
34
|
* include both the function IDs and any wiring-level names (e.g. agent
|
|
35
35
|
* names, channel names) that reference those functions.
|
|
36
36
|
*/
|
|
37
|
-
function collectFilterNames(unit, manifest, inspectorState) {
|
|
37
|
+
function collectFilterNames(unit, manifest, inspectorState, workflowQueues) {
|
|
38
38
|
const names = new Set(unit.functionIds);
|
|
39
39
|
// Include catch-all scaffold routes based on unit contents
|
|
40
40
|
const functionsMeta = inspectorState.functions.meta;
|
|
@@ -62,6 +62,10 @@ function collectFilterNames(unit, manifest, inspectorState) {
|
|
|
62
62
|
names.add('agentStreamCaller');
|
|
63
63
|
names.add('agentApproveCaller');
|
|
64
64
|
names.add('agentResumeCaller');
|
|
65
|
+
names.add('getAgentThreads');
|
|
66
|
+
names.add('getAgentThreadMessages');
|
|
67
|
+
names.add('getAgentThreadRuns');
|
|
68
|
+
names.add('deleteAgentThread');
|
|
65
69
|
// Include RPC catch-all for agent tool dispatch
|
|
66
70
|
names.add('/rpc/:rpcName');
|
|
67
71
|
for (const id of agentDef.toolFunctionIds)
|
|
@@ -99,6 +103,37 @@ function collectFilterNames(unit, manifest, inspectorState) {
|
|
|
99
103
|
if (handler.type === 'scheduled')
|
|
100
104
|
names.add(handler.taskName);
|
|
101
105
|
}
|
|
106
|
+
// Function units with workflow-state capability (workflow-starter,
|
|
107
|
+
// workflow-runner, workflow-status-checker) call rpc.startWorkflow
|
|
108
|
+
// and look workflows up by name in the registry. The registry is
|
|
109
|
+
// populated when the user's `pikkuWorkflowGraph(...)` calls execute
|
|
110
|
+
// at module load — so the per-unit bootstrap needs the workflow
|
|
111
|
+
// wirings file. We only pull in the workflow NAME (graph structure
|
|
112
|
+
// only — nodes reference step functions by string ID), not the step
|
|
113
|
+
// function bodies; those stay in their own per-step units and are
|
|
114
|
+
// reached via queue dispatch at runtime.
|
|
115
|
+
const usesWorkflowState = unit.services.some((s) => s.capability === 'workflow-state');
|
|
116
|
+
if (usesWorkflowState) {
|
|
117
|
+
for (const wf of manifest.workflows) {
|
|
118
|
+
names.add(wf.name);
|
|
119
|
+
// Include orchestrator + per-step queue NAMES so queue meta gets
|
|
120
|
+
// emitted into this unit. The runtime needs these in
|
|
121
|
+
// `pikkuState('queue', 'meta')` to map a step's rpcName to its
|
|
122
|
+
// dedicated queue (otherwise it falls back to the shared
|
|
123
|
+
// 'pikku-workflow-step-worker' queue which doesn't exist in
|
|
124
|
+
// per-unit deploys). Names only — no function bodies bundled.
|
|
125
|
+
// Skipped when the provider doesn't use workflow queues — its
|
|
126
|
+
// workflow runtime dispatches steps natively.
|
|
127
|
+
if (workflowQueues) {
|
|
128
|
+
names.add(`wf-orchestrator-${toSafeKebab(wf.name)}`);
|
|
129
|
+
for (const step of wf.steps) {
|
|
130
|
+
if (step.functionId) {
|
|
131
|
+
names.add(`wf-step-${toSafeKebab(step.functionId)}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
102
137
|
break;
|
|
103
138
|
}
|
|
104
139
|
case 'workflow': {
|
|
@@ -122,12 +157,17 @@ function collectFilterNames(unit, manifest, inspectorState) {
|
|
|
122
157
|
names.add('http:get:/workflow/:workflowName/status/:runId');
|
|
123
158
|
names.add('http:get:/workflow/:workflowName/status/:runId/stream');
|
|
124
159
|
names.add('http:post:/workflow/:workflowName/graph/:nodeId');
|
|
125
|
-
// Queue names for orchestrator and step workers
|
|
126
|
-
|
|
160
|
+
// Queue names for orchestrator and step workers — only when the
|
|
161
|
+
// provider's workflow runtime fans out via queues.
|
|
162
|
+
if (workflowQueues) {
|
|
163
|
+
names.add(`wf-orchestrator-${toSafeKebab(wfDef.name)}`);
|
|
164
|
+
}
|
|
127
165
|
for (const step of wfDef.steps) {
|
|
128
166
|
if (step.functionId) {
|
|
129
167
|
names.add(step.functionId);
|
|
130
|
-
|
|
168
|
+
if (workflowQueues) {
|
|
169
|
+
names.add(`wf-step-${toSafeKebab(step.functionId)}`);
|
|
170
|
+
}
|
|
131
171
|
}
|
|
132
172
|
}
|
|
133
173
|
}
|
|
@@ -149,6 +189,7 @@ function collectFilterNames(unit, manifest, inspectorState) {
|
|
|
149
189
|
*/
|
|
150
190
|
export async function generatePerUnitCodegen(options) {
|
|
151
191
|
const { projectDir, manifest, inspectorState, onProgress } = options;
|
|
192
|
+
const workflowQueues = options.workflowQueues ?? true;
|
|
152
193
|
const baseDir = options.deployDir ?? join(projectDir, '.deploy');
|
|
153
194
|
const pikkuBin = options.pikkuBin ?? resolvePikkuBin();
|
|
154
195
|
const unitPikkuDirs = new Map();
|
|
@@ -162,7 +203,7 @@ export async function generatePerUnitCodegen(options) {
|
|
|
162
203
|
await writeFile(stateFilePath, JSON.stringify(serialized), 'utf-8');
|
|
163
204
|
// Generate codegen for each unit
|
|
164
205
|
for (const unit of manifest.units) {
|
|
165
|
-
const filterNames = collectFilterNames(unit, manifest, inspectorState);
|
|
206
|
+
const filterNames = collectFilterNames(unit, manifest, inspectorState, workflowQueues);
|
|
166
207
|
if (filterNames.length === 0) {
|
|
167
208
|
errors.push({
|
|
168
209
|
unitName: unit.name,
|
|
@@ -171,7 +212,9 @@ export async function generatePerUnitCodegen(options) {
|
|
|
171
212
|
continue;
|
|
172
213
|
}
|
|
173
214
|
onProgress?.(unit.name, 'start');
|
|
174
|
-
const unitDir =
|
|
215
|
+
const unitDir = options.resolveUnitDir
|
|
216
|
+
? options.resolveUnitDir(unit, baseDir)
|
|
217
|
+
: join(baseDir, unit.name);
|
|
175
218
|
const unitPikkuDir = join(unitDir, '.pikku');
|
|
176
219
|
await mkdir(unitDir, { recursive: true });
|
|
177
220
|
const namesArg = filterNames.join(',');
|
|
@@ -23,14 +23,36 @@ function diffUnits(manifest, current, drainInfo) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
else if (!arraysEqual(existing.functionIds, desired.functionIds) ||
|
|
26
|
-
existing.role !== desired.role
|
|
26
|
+
existing.role !== desired.role ||
|
|
27
|
+
(typeof desired.bundleHash === 'string' &&
|
|
28
|
+
typeof existing.bundleHash === 'string' &&
|
|
29
|
+
desired.bundleHash !== existing.bundleHash) ||
|
|
30
|
+
(typeof desired.exactDependenciesHash === 'string' &&
|
|
31
|
+
typeof existing.exactDependenciesHash === 'string' &&
|
|
32
|
+
desired.exactDependenciesHash !== existing.exactDependenciesHash)) {
|
|
33
|
+
const bundleChanged = typeof desired.bundleHash === 'string' &&
|
|
34
|
+
typeof existing.bundleHash === 'string' &&
|
|
35
|
+
desired.bundleHash !== existing.bundleHash;
|
|
36
|
+
const depsChanged = typeof desired.exactDependenciesHash === 'string' &&
|
|
37
|
+
typeof existing.exactDependenciesHash === 'string' &&
|
|
38
|
+
desired.exactDependenciesHash !== existing.exactDependenciesHash;
|
|
27
39
|
changes.push({
|
|
28
40
|
action: 'update',
|
|
29
41
|
resourceType: 'unit',
|
|
30
42
|
name: desired.name,
|
|
31
43
|
role: desired.role,
|
|
32
|
-
reason:
|
|
33
|
-
|
|
44
|
+
reason: bundleChanged
|
|
45
|
+
? depsChanged
|
|
46
|
+
? 'bundle + dependencies changed'
|
|
47
|
+
: 'bundle changed'
|
|
48
|
+
: depsChanged
|
|
49
|
+
? 'dependencies changed'
|
|
50
|
+
: 'code changed',
|
|
51
|
+
details: {
|
|
52
|
+
functionIds: desired.functionIds,
|
|
53
|
+
bundleHash: desired.bundleHash,
|
|
54
|
+
exactDependenciesHash: desired.exactDependenciesHash,
|
|
55
|
+
},
|
|
34
56
|
});
|
|
35
57
|
}
|
|
36
58
|
}
|
|
@@ -39,6 +39,21 @@ export interface ProviderAdapter {
|
|
|
39
39
|
* Used by standalone adapter.
|
|
40
40
|
*/
|
|
41
41
|
readonly singleUnit?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the provider's workflow runtime needs synthesized per-step
|
|
44
|
+
* dispatch queues. Defaults to `true`.
|
|
45
|
+
*
|
|
46
|
+
* - `true` (default): The deploy pipeline synthesizes a `wf-orchestrator-*`
|
|
47
|
+
* queue and a `wf-step-*` queue for every workflow step, plus producer
|
|
48
|
+
* bindings, so the workflow runtime can fan out via queues.
|
|
49
|
+
* - `false`: No synthetic workflow queues are emitted into the manifest
|
|
50
|
+
* or per-unit codegen. Use this when the provider's workflow runtime
|
|
51
|
+
* dispatches steps natively (e.g. Cloudflare's Durable-Object-based
|
|
52
|
+
* `CloudflareWorkflowService`, where the orchestrator DO advances
|
|
53
|
+
* steps directly without a queue hop). Queues created via explicit
|
|
54
|
+
* `wireQueue(...)` user code are unaffected.
|
|
55
|
+
*/
|
|
56
|
+
readonly workflowQueues?: boolean;
|
|
42
57
|
/**
|
|
43
58
|
* Generate the entry file source for a deployment unit.
|
|
44
59
|
* Called once per unit.
|
|
@@ -78,11 +93,30 @@ export interface ProviderAdapter {
|
|
|
78
93
|
* pkg requires 'cjs' for standalone binaries.
|
|
79
94
|
*/
|
|
80
95
|
getFormat?(): 'esm' | 'cjs';
|
|
96
|
+
/**
|
|
97
|
+
* Skip the createRequire banner. CF Workers should return true —
|
|
98
|
+
* `import.meta.url` is undefined there and the banner crashes at boot.
|
|
99
|
+
*/
|
|
100
|
+
getNoRequireShim?(): boolean;
|
|
81
101
|
/**
|
|
82
102
|
* Generate additional provider-level config files (e.g. serverless.yml).
|
|
83
103
|
* Returns a map of filename → content to write into the deploy directory.
|
|
84
104
|
*/
|
|
85
105
|
generateProviderConfigs?(manifest: DeploymentManifest): Map<string, string>;
|
|
106
|
+
/**
|
|
107
|
+
* Emit any provider-specific artifacts that aren't tied to a single user
|
|
108
|
+
* unit — e.g. a synthesized proxy Worker that fronts a CF Container.
|
|
109
|
+
* Called after the infra manifest is written so providers can read it
|
|
110
|
+
* and key off resources that were provisioned in earlier steps.
|
|
111
|
+
*/
|
|
112
|
+
emitSideArtifacts?(options: {
|
|
113
|
+
buildDir: string;
|
|
114
|
+
manifest: DeploymentManifest;
|
|
115
|
+
logger: {
|
|
116
|
+
info(msg: string): void;
|
|
117
|
+
error(msg: string): void;
|
|
118
|
+
};
|
|
119
|
+
}): Promise<void>;
|
|
86
120
|
/**
|
|
87
121
|
* Deploy the built artifacts to the provider.
|
|
88
122
|
* Optional — if not implemented, the CLI just outputs the build directory.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-agnostic Node server entry generator for `target: 'server'` units.
|
|
3
|
+
*
|
|
4
|
+
* Produces a `node:http`-based HTTP entry built on `@pikku/node-http-server`
|
|
5
|
+
* — the same runtime `pikku dev` uses. Containers sit behind something
|
|
6
|
+
* (Cloudflare Workers, a load balancer) so raw uWS throughput isn't
|
|
7
|
+
* required; sharing the dev server keeps one HTTP path to maintain.
|
|
8
|
+
*
|
|
9
|
+
* The same bundle runs anywhere a Node process can run: CF Containers,
|
|
10
|
+
* fly.io, ECS, bare VM. Provider-specific config (Dockerfile, infra) is
|
|
11
|
+
* emitted by the provider adapter on top of this entry + bundle.js.
|
|
12
|
+
*/
|
|
13
|
+
import type { EntryGenerationContext } from './provider-adapter.js';
|
|
14
|
+
export declare function generateServerEntrySource(ctx: EntryGenerationContext): string;
|
|
15
|
+
export declare const SERVER_DOCKERFILE = "# Generated by @pikku/cli \u2014 do not edit\nFROM node:22-slim\n\nRUN apt-get update \\\n && apt-get install -y --no-install-recommends tini ca-certificates \\\n && rm -rf /var/lib/apt/lists/*\n\nRUN groupadd -r pikku && useradd -r -g pikku -u 1001 pikku\n\nWORKDIR /app\n\n# Pikku bundles user code + first-party deps inline; only externalised deps\n# (typically empty for pure-JS apps) are listed in package.json. We ship no\n# lockfile because the bundle has already pinned everything via the\n# extracted exact-dependencies \u2014 `npm install --omit=dev` resolves the\n# leftover externals (if any) at build time.\nCOPY --chown=pikku:pikku package.json ./\nRUN npm install --omit=dev --no-audit --no-fund\n\nCOPY --chown=pikku:pikku bundle.js ./\n\nUSER pikku\nENV NODE_ENV=production\nENV PORT=8080\nEXPOSE 8080\n\nENTRYPOINT [\"/usr/bin/tini\", \"--\"]\nCMD [\"node\", \"bundle.js\"]\n";
|
|
16
|
+
export declare const SERVER_DOCKERIGNORE = "node_modules\n.git\n*.log\nmetafile.json\nexact-dependencies.json\n";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-agnostic Node server entry generator for `target: 'server'` units.
|
|
3
|
+
*
|
|
4
|
+
* Produces a `node:http`-based HTTP entry built on `@pikku/node-http-server`
|
|
5
|
+
* — the same runtime `pikku dev` uses. Containers sit behind something
|
|
6
|
+
* (Cloudflare Workers, a load balancer) so raw uWS throughput isn't
|
|
7
|
+
* required; sharing the dev server keeps one HTTP path to maintain.
|
|
8
|
+
*
|
|
9
|
+
* The same bundle runs anywhere a Node process can run: CF Containers,
|
|
10
|
+
* fly.io, ECS, bare VM. Provider-specific config (Dockerfile, infra) is
|
|
11
|
+
* emitted by the provider adapter on top of this entry + bundle.js.
|
|
12
|
+
*/
|
|
13
|
+
export function generateServerEntrySource(ctx) {
|
|
14
|
+
const lines = [
|
|
15
|
+
`// Generated server entry for "${ctx.unit.name}" (${ctx.unit.role})`,
|
|
16
|
+
`import { PikkuNodeHTTPServer } from '@pikku/node-http-server'`,
|
|
17
|
+
`import { pikkuState } from '@pikku/core/internal'`,
|
|
18
|
+
ctx.configImport,
|
|
19
|
+
ctx.servicesImport,
|
|
20
|
+
`import '${ctx.bootstrapPath}'`,
|
|
21
|
+
``,
|
|
22
|
+
`const PORT = Number(process.env.PORT ?? 8080)`,
|
|
23
|
+
`const HOST = process.env.HOST ?? '0.0.0.0'`,
|
|
24
|
+
``,
|
|
25
|
+
`async function main(): Promise<void> {`,
|
|
26
|
+
` const config = await ${ctx.configVar}()`,
|
|
27
|
+
` const singletonServices = await ${ctx.servicesVar}(config)`,
|
|
28
|
+
` pikkuState(null, 'package', 'singletonServices', singletonServices)`,
|
|
29
|
+
``,
|
|
30
|
+
` const server = new PikkuNodeHTTPServer(`,
|
|
31
|
+
` { ...config, hostname: HOST, port: PORT, healthCheckPath: '/__pikku/health' },`,
|
|
32
|
+
` singletonServices.logger`,
|
|
33
|
+
` )`,
|
|
34
|
+
` server.enableExitOnSignals()`,
|
|
35
|
+
` await server.init()`,
|
|
36
|
+
` await server.start()`,
|
|
37
|
+
`}`,
|
|
38
|
+
``,
|
|
39
|
+
`main().catch((err) => {`,
|
|
40
|
+
` console.error('pikku-server: fatal', err)`,
|
|
41
|
+
` process.exit(1)`,
|
|
42
|
+
`})`,
|
|
43
|
+
``,
|
|
44
|
+
];
|
|
45
|
+
return lines.join('\n');
|
|
46
|
+
}
|
|
47
|
+
export const SERVER_DOCKERFILE = `# Generated by @pikku/cli — do not edit
|
|
48
|
+
FROM node:22-slim
|
|
49
|
+
|
|
50
|
+
RUN apt-get update \\
|
|
51
|
+
&& apt-get install -y --no-install-recommends tini ca-certificates \\
|
|
52
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
53
|
+
|
|
54
|
+
RUN groupadd -r pikku && useradd -r -g pikku -u 1001 pikku
|
|
55
|
+
|
|
56
|
+
WORKDIR /app
|
|
57
|
+
|
|
58
|
+
# Pikku bundles user code + first-party deps inline; only externalised deps
|
|
59
|
+
# (typically empty for pure-JS apps) are listed in package.json. We ship no
|
|
60
|
+
# lockfile because the bundle has already pinned everything via the
|
|
61
|
+
# extracted exact-dependencies — \`npm install --omit=dev\` resolves the
|
|
62
|
+
# leftover externals (if any) at build time.
|
|
63
|
+
COPY --chown=pikku:pikku package.json ./
|
|
64
|
+
RUN npm install --omit=dev --no-audit --no-fund
|
|
65
|
+
|
|
66
|
+
COPY --chown=pikku:pikku bundle.js ./
|
|
67
|
+
|
|
68
|
+
USER pikku
|
|
69
|
+
ENV NODE_ENV=production
|
|
70
|
+
ENV PORT=8080
|
|
71
|
+
EXPOSE 8080
|
|
72
|
+
|
|
73
|
+
ENTRYPOINT ["/usr/bin/tini", "--"]
|
|
74
|
+
CMD ["node", "bundle.js"]
|
|
75
|
+
`;
|
|
76
|
+
export const SERVER_DOCKERIGNORE = `node_modules
|
|
77
|
+
.git
|
|
78
|
+
*.log
|
|
79
|
+
metafile.json
|
|
80
|
+
exact-dependencies.json
|
|
81
|
+
`;
|