@pikku/cli 0.12.21 → 0.12.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.schema.json +1 -1
- package/console-app/assets/index-C52h1B_L.css +1 -0
- package/console-app/assets/index-CAk106ji.js +232 -0
- package/console-app/index.html +3 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +3 -3
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +6 -6
- package/dist/.pikku/cli/pikku-cli-channel.js +280 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +782 -7
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +41 -73
- package/dist/.pikku/function/pikku-function-types.gen.js +30 -40
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +1305 -378
- package/dist/.pikku/function/pikku-functions.gen.js +13 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.json +1 -62
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -2
- package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -2
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +3 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +3 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +2 -1
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.d.ts +1 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +6 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +250 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +4 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +5 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +66 -20
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +153 -29
- package/dist/.pikku/schemas/schemas/BinaryInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbMigrateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbResetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbSeedInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuCLIEntryOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuEventsScaffoldOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaClientsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaContextInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresChannelInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresHttpInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresQueueInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresSchedulerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTriggerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTypeInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsInstallInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsCoverageInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsInitInput.schema.json +1 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +235 -627
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +23 -0
- package/dist/bin/pikku.js +28 -1
- package/dist/src/cli.wiring.js +274 -8
- package/dist/src/deploy/analyzer/analyzer.d.ts +16 -1
- package/dist/src/deploy/analyzer/analyzer.js +83 -43
- package/dist/src/deploy/build-pipeline.js +83 -17
- package/dist/src/deploy/bundler/bundler.d.ts +1 -0
- package/dist/src/deploy/bundler/bundler.js +13 -5
- package/dist/src/deploy/codegen/per-unit-codegen.d.ts +8 -0
- package/dist/src/deploy/codegen/per-unit-codegen.js +46 -5
- package/dist/src/deploy/provider-adapter.d.ts +34 -0
- package/dist/src/deploy/server-entry.d.ts +16 -0
- package/dist/src/deploy/server-entry.js +81 -0
- package/dist/src/fabric/fabric-commands.d.ts +522 -0
- package/dist/src/fabric/fabric-commands.js +299 -0
- package/dist/src/fabric/functions/db-schema.function.d.ts +35 -0
- package/dist/src/fabric/functions/db-schema.function.js +37 -0
- package/dist/src/fabric/functions/deploy-list.function.d.ts +41 -0
- package/dist/src/fabric/functions/deploy-list.function.js +43 -0
- package/dist/src/fabric/functions/deploy-units.function.d.ts +35 -0
- package/dist/src/fabric/functions/deploy-units.function.js +41 -0
- package/dist/src/fabric/functions/deploy.function.d.ts +105 -0
- package/dist/src/fabric/functions/deploy.function.js +122 -0
- package/dist/src/fabric/functions/domains-add.function.d.ts +35 -0
- package/dist/src/fabric/functions/domains-add.function.js +46 -0
- package/dist/src/fabric/functions/domains-list.function.d.ts +20 -0
- package/dist/src/fabric/functions/domains-list.function.js +50 -0
- package/dist/src/fabric/functions/domains-remove.function.d.ts +24 -0
- package/dist/src/fabric/functions/domains-remove.function.js +44 -0
- package/dist/src/fabric/functions/errors.function.d.ts +44 -0
- package/dist/src/fabric/functions/errors.function.js +50 -0
- package/dist/src/fabric/functions/init.function.d.ts +51 -0
- package/dist/src/fabric/functions/init.function.js +54 -0
- package/dist/src/fabric/functions/link.function.d.ts +28 -0
- package/dist/src/fabric/functions/link.function.js +77 -0
- package/dist/src/fabric/functions/llm-key.function.d.ts +46 -0
- package/dist/src/fabric/functions/llm-key.function.js +76 -0
- package/dist/src/fabric/functions/login.function.d.ts +42 -0
- package/dist/src/fabric/functions/login.function.js +68 -0
- package/dist/src/fabric/functions/logs.function.d.ts +40 -0
- package/dist/src/fabric/functions/logs.function.js +84 -0
- package/dist/src/fabric/functions/metrics.function.d.ts +32 -0
- package/dist/src/fabric/functions/metrics.function.js +49 -0
- package/dist/src/fabric/functions/rollback.function.d.ts +76 -0
- package/dist/src/fabric/functions/rollback.function.js +69 -0
- package/dist/src/fabric/functions/secrets-list.function.d.ts +24 -0
- package/dist/src/fabric/functions/secrets-list.function.js +37 -0
- package/dist/src/fabric/functions/secrets-set.function.d.ts +32 -0
- package/dist/src/fabric/functions/secrets-set.function.js +36 -0
- package/dist/src/fabric/functions/status.function.d.ts +34 -0
- package/dist/src/fabric/functions/status.function.js +43 -0
- package/dist/src/fabric/functions/trace.function.d.ts +28 -0
- package/dist/src/fabric/functions/trace.function.js +45 -0
- package/dist/src/fabric/functions/validate.function.d.ts +50 -0
- package/dist/src/fabric/functions/validate.function.js +363 -0
- package/dist/src/fabric/lib/config.d.ts +64 -0
- package/dist/src/fabric/lib/config.js +62 -0
- package/dist/src/fabric/lib/console-url.d.ts +5 -0
- package/dist/src/fabric/lib/console-url.js +13 -0
- package/dist/src/fabric/lib/git.d.ts +53 -0
- package/dist/src/fabric/lib/git.js +151 -0
- package/dist/src/fabric/lib/http.d.ts +4 -0
- package/dist/src/fabric/lib/http.js +12 -0
- package/dist/src/fabric/lib/not-implemented.d.ts +5 -0
- package/dist/src/fabric/lib/not-implemented.js +8 -0
- package/dist/src/fabric/lib/output.d.ts +23 -0
- package/dist/src/fabric/lib/output.js +39 -0
- package/dist/src/fabric/lib/prompt.d.ts +12 -0
- package/dist/src/fabric/lib/prompt.js +32 -0
- package/dist/src/fabric/lib/stage.d.ts +7 -0
- package/dist/src/fabric/lib/stage.js +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.d.ts +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.js +30 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.d.ts +105 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.js +126 -0
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/binary.d.ts +7 -0
- package/dist/src/functions/commands/binary.js +40 -0
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +7 -4
- package/dist/src/functions/commands/console.d.ts +3 -3
- package/dist/src/functions/commands/db-migrate.d.ts +1 -0
- package/dist/src/functions/commands/db-migrate.js +35 -0
- package/dist/src/functions/commands/db-reset.d.ts +1 -0
- package/dist/src/functions/commands/db-reset.js +36 -0
- package/dist/src/functions/commands/db-seed.d.ts +1 -0
- package/dist/src/functions/commands/db-seed.js +27 -0
- package/dist/src/functions/commands/db-shared.d.ts +32 -0
- package/dist/src/functions/commands/db-shared.js +26 -0
- package/dist/src/functions/commands/deploy-apply.d.ts +3 -3
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/deploy-plan.d.ts +3 -3
- package/dist/src/functions/commands/dev.d.ts +3 -3
- package/dist/src/functions/commands/dev.js +142 -86
- package/dist/src/functions/commands/enable.d.ts +5 -4
- package/dist/src/functions/commands/enable.js +4 -0
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/load-user-project.d.ts +11 -0
- package/dist/src/functions/commands/load-user-project.js +40 -0
- package/dist/src/functions/commands/meta.d.ts +82 -0
- package/dist/src/functions/commands/meta.js +454 -0
- package/dist/src/functions/commands/new-addon.d.ts +3 -3
- package/dist/src/functions/commands/new-function.d.ts +3 -3
- package/dist/src/functions/commands/new-middleware.d.ts +3 -3
- package/dist/src/functions/commands/new-permission.d.ts +3 -3
- package/dist/src/functions/commands/new-wiring.d.ts +3 -3
- package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-bootstrap.js +15 -1
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-summary.js +3 -0
- package/dist/src/functions/commands/skills.d.ts +26 -0
- package/dist/src/functions/commands/skills.js +184 -0
- package/dist/src/functions/commands/tests-coverage.d.ts +7 -0
- package/dist/src/functions/commands/tests-coverage.js +231 -0
- package/dist/src/functions/commands/tests-init.d.ts +7 -0
- package/dist/src/functions/commands/tests-init.js +225 -0
- package/dist/src/functions/commands/versions-check.d.ts +1 -1
- package/dist/src/functions/commands/versions-init.d.ts +3 -3
- package/dist/src/functions/commands/versions-update.d.ts +1 -1
- package/dist/src/functions/commands/watch.d.ts +3 -3
- package/dist/src/functions/commands/watch.js +1 -1
- package/dist/src/functions/db/local-db.d.ts +48 -0
- package/dist/src/functions/db/local-db.js +106 -0
- package/dist/src/functions/db/seed.d.ts +11 -0
- package/dist/src/functions/db/seed.js +22 -0
- package/dist/src/functions/db/sql-migrator.d.ts +26 -0
- package/dist/src/functions/db/sql-migrator.js +104 -0
- package/dist/src/functions/db/sqlite-codegen.d.ts +45 -0
- package/dist/src/functions/db/sqlite-codegen.js +294 -0
- package/dist/src/functions/db/zod-codegen.d.ts +10 -0
- package/dist/src/functions/db/zod-codegen.js +109 -0
- package/dist/src/functions/runtimes/fetch/index.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +21 -2
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.d.ts +1 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.js +163 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +5 -2
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -0
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.js +32 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.d.ts +11 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.js +36 -0
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.js +1 -10
- package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +76 -1
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +5 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +5 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +8 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +27 -9
- package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +5 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +13 -3
- package/dist/src/functions/wirings/console/pikku-command-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-node-types.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
- package/dist/src/functions/wirings/console/serialize-console-functions.js +5 -0
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +5 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.js +7 -2
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +78 -83
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.d.ts +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -1
- package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +2 -2
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.d.ts +1 -0
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +26 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.js +35 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.d.ts +23 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.js +98 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.d.ts +22 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.js +337 -0
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-react-query.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.js +3 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +2 -2
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +2 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +13 -7
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +1 -0
- package/dist/src/functions/wirings/rpc/serialize-react-query-hooks.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +7 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.d.ts +1 -1
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.js +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.d.ts +1 -1
- package/dist/src/functions/wirings/variables/pikku-command-variables.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +5 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +18 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.d.ts +3 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.js +40 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +14 -2
- package/dist/src/functions/workflows/all.workflow.js +41 -8
- package/dist/src/scaffold/rpc-remote.gen.d.ts +3 -3
- package/dist/src/scaffold/rpc-remote.gen.js +7 -2
- package/dist/src/services/cli-logger.service.d.ts +0 -1
- package/dist/src/services/cli-logger.service.js +12 -22
- package/dist/src/services.js +24 -66
- package/dist/src/utils/generate-bootstrap-file.js +3 -0
- package/dist/src/utils/parse-cli-filters.d.ts +18 -0
- package/dist/src/utils/parse-cli-filters.js +99 -0
- package/dist/src/utils/pikku-cli-config.js +29 -9
- package/dist/src/utils/serialize-schemas.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -4
- package/skills/pikku-addon/SKILL.md +330 -0
- package/skills/pikku-ai-agent/SKILL.md +227 -0
- package/skills/pikku-ai-vercel/SKILL.md +78 -0
- package/skills/pikku-ai-voice/SKILL.md +85 -0
- package/skills/pikku-auth-js/SKILL.md +106 -0
- package/skills/pikku-aws/SKILL.md +107 -0
- package/skills/pikku-backblaze/SKILL.md +70 -0
- package/skills/pikku-cli/SKILL.md +281 -0
- package/skills/pikku-concepts/SKILL.md +281 -0
- package/skills/pikku-concepts/references/concept-mapping.md +528 -0
- package/skills/pikku-config/SKILL.md +208 -0
- package/skills/pikku-cron/SKILL.md +211 -0
- package/skills/pikku-deploy-azure/SKILL.md +69 -0
- package/skills/pikku-deploy-cloudflare/SKILL.md +80 -0
- package/skills/pikku-deploy-express/SKILL.md +83 -0
- package/skills/pikku-deploy-fastify/SKILL.md +70 -0
- package/skills/pikku-deploy-lambda/SKILL.md +107 -0
- package/skills/pikku-deploy-nextjs/SKILL.md +76 -0
- package/skills/pikku-deploy-uws/SKILL.md +85 -0
- package/skills/pikku-fabric/SKILL.md +245 -0
- package/skills/pikku-feature/SKILL.md +258 -0
- package/skills/pikku-gateway-slack/SKILL.md +112 -0
- package/skills/pikku-http/SKILL.md +317 -0
- package/skills/pikku-i18n/SKILL.md +217 -0
- package/skills/pikku-info/SKILL.md +95 -0
- package/skills/pikku-jose/SKILL.md +102 -0
- package/skills/pikku-kysely/SKILL.md +145 -0
- package/skills/pikku-mcp/SKILL.md +237 -0
- package/skills/pikku-mongodb/SKILL.md +102 -0
- package/skills/pikku-n8n-addon-map/SKILL.md +178 -0
- package/skills/pikku-n8n-code-translate/SKILL.md +166 -0
- package/skills/pikku-pino/SKILL.md +77 -0
- package/skills/pikku-queue/SKILL.md +237 -0
- package/skills/pikku-react/SKILL.md +183 -0
- package/skills/pikku-react-query/SKILL.md +205 -0
- package/skills/pikku-realtime/SKILL.md +285 -0
- package/skills/pikku-redis/SKILL.md +87 -0
- package/skills/pikku-rpc/SKILL.md +168 -0
- package/skills/pikku-rtl/SKILL.md +219 -0
- package/skills/pikku-schedule/SKILL.md +54 -0
- package/skills/pikku-schema-ajv/SKILL.md +60 -0
- package/skills/pikku-schema-cfworker/SKILL.md +60 -0
- package/skills/pikku-security/SKILL.md +243 -0
- package/skills/pikku-services/SKILL.md +247 -0
- package/skills/pikku-template-clone/SKILL.md +39 -0
- package/skills/pikku-testing/SKILL.md +428 -0
- package/skills/pikku-trigger/SKILL.md +177 -0
- package/skills/pikku-versioning/SKILL.md +169 -0
- package/skills/pikku-websocket/SKILL.md +239 -0
- package/skills/pikku-workflow/SKILL.md +283 -0
- package/skills/pikku-workflows-client/SKILL.md +150 -0
- package/skills/pikku-ws/SKILL.md +45 -0
- package/console-app/assets/index-BpY2pSuA.css +0 -10
- package/console-app/assets/index-DXLy-_D4.js +0 -717
- package/dist/.pikku/schemas/schemas/GraphStarterInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/GraphStarterOutput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowRunStatus.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowRunnerInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStarterInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStarterOutput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStatusCheckerInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStatusStreamFullInput.schema.json +0 -1
- package/dist/.pikku/schemas/schemas/WorkflowStatusStreamInput.schema.json +0 -1
- package/dist/src/scaffold/workflow-routes.gen.d.ts +0 -84
- package/dist/src/scaffold/workflow-routes.gen.js +0 -229
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "workflowName": { "type": "string" }, "nodeId": { "type": "string" }, "data": {} }, "required": ["workflowName", "nodeId"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "runId": { "type": "string" } }, "required": ["runId"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "id": { "type": "string" }, "status": { "$ref": "#/definitions/WorkflowStatus" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time" }, "deterministic": { "type": "boolean" }, "plannedSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowPlannedStep" } }, "steps": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "status": { "$ref": "#/definitions/StepStatus" }, "duration": { "type": "number" } }, "required": ["name", "status"], "additionalProperties": false } }, "output": {}, "error": { "type": "object", "properties": { "message": { "type": "string" } }, "required": ["message"], "additionalProperties": false } }, "required": ["id", "status", "startedAt", "steps"], "additionalProperties": false, "definitions": { "WorkflowStatus": { "type": "string", "enum": ["running", "suspended", "completed", "failed", "cancelled"], "description": "Workflow run status" }, "WorkflowPlannedStep": { "type": "object", "properties": { "stepName": { "type": "string", "description": "Human-readable step label for UI timeline" } }, "required": ["stepName"], "additionalProperties": false }, "StepStatus": { "type": "string", "enum": ["pending", "running", "scheduled", "succeeded", "failed", "suspended"], "description": "Workflow step status" } } }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "workflowName": { "type": "string" }, "data": {} }, "required": ["workflowName"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "workflowName": { "type": "string" }, "data": {} }, "required": ["workflowName"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "runId": { "type": "string" } }, "required": ["runId"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "workflowName": { "type": "string" }, "runId": { "type": "string" } }, "required": ["workflowName", "runId"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "workflowName": { "type": "string" }, "runId": { "type": "string" } }, "required": ["workflowName", "runId"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "workflowName": { "type": "string" }, "runId": { "type": "string" } }, "required": ["workflowName", "runId"], "additionalProperties": false, "definitions": {} }
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { WorkflowRunStatus } from '@pikku/core/workflow';
|
|
2
|
-
export declare const workflowStarter: import("../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
3
|
-
workflowName: string;
|
|
4
|
-
data?: unknown;
|
|
5
|
-
}, {
|
|
6
|
-
runId: string;
|
|
7
|
-
}, "session" | "rpc", import("../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
8
|
-
workflowName: string;
|
|
9
|
-
data?: unknown;
|
|
10
|
-
}, {
|
|
11
|
-
runId: string;
|
|
12
|
-
}, "session" | "rpc", import("../../types/application-types.js").Services> | import("../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
13
|
-
workflowName: string;
|
|
14
|
-
data?: unknown;
|
|
15
|
-
}, {
|
|
16
|
-
runId: string;
|
|
17
|
-
}, "session" | "rpc", import("../../types/application-types.js").Services>, undefined, undefined>;
|
|
18
|
-
export declare const workflowRunner: import("../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
19
|
-
workflowName: string;
|
|
20
|
-
data?: unknown;
|
|
21
|
-
}, unknown, "session" | "rpc", import("../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
22
|
-
workflowName: string;
|
|
23
|
-
data?: unknown;
|
|
24
|
-
}, unknown, "session" | "rpc", import("../../types/application-types.js").Services> | import("../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
25
|
-
workflowName: string;
|
|
26
|
-
data?: unknown;
|
|
27
|
-
}, unknown, "session" | "rpc", import("../../types/application-types.js").Services>, undefined, undefined>;
|
|
28
|
-
export declare const workflowStatusChecker: import("../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
29
|
-
workflowName: string;
|
|
30
|
-
runId: string;
|
|
31
|
-
}, WorkflowRunStatus, "session" | "rpc", import("../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
32
|
-
workflowName: string;
|
|
33
|
-
runId: string;
|
|
34
|
-
}, WorkflowRunStatus, "session" | "rpc", import("../../types/application-types.js").Services> | import("../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
35
|
-
workflowName: string;
|
|
36
|
-
runId: string;
|
|
37
|
-
}, WorkflowRunStatus, "session" | "rpc", import("../../types/application-types.js").Services>, undefined, undefined>;
|
|
38
|
-
/**
|
|
39
|
-
* Minimal workflow status stream — sends step names and statuses only.
|
|
40
|
-
* Use this for user-facing frontends where internal details should not be exposed.
|
|
41
|
-
*/
|
|
42
|
-
export declare const workflowStatusStream: import("../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
43
|
-
workflowName: string;
|
|
44
|
-
runId: string;
|
|
45
|
-
}, unknown, "session" | "rpc", import("../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
46
|
-
workflowName: string;
|
|
47
|
-
runId: string;
|
|
48
|
-
}, unknown, "session" | "rpc", import("../../types/application-types.js").Services> | import("../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
49
|
-
workflowName: string;
|
|
50
|
-
runId: string;
|
|
51
|
-
}, unknown, "session" | "rpc", import("../../types/application-types.js").Services>, undefined, undefined>;
|
|
52
|
-
/**
|
|
53
|
-
* Full workflow status stream — includes output, error, and child run IDs.
|
|
54
|
-
* Use this for admin consoles and internal tooling.
|
|
55
|
-
*/
|
|
56
|
-
export declare const workflowStatusStreamFull: import("../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
57
|
-
workflowName: string;
|
|
58
|
-
runId: string;
|
|
59
|
-
}, unknown, "session" | "rpc", import("../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
60
|
-
workflowName: string;
|
|
61
|
-
runId: string;
|
|
62
|
-
}, unknown, "session" | "rpc", import("../../types/application-types.js").Services> | import("../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
63
|
-
workflowName: string;
|
|
64
|
-
runId: string;
|
|
65
|
-
}, unknown, "session" | "rpc", import("../../types/application-types.js").Services>, undefined, undefined>;
|
|
66
|
-
export declare const graphStarter: import("../../.pikku/pikku-types.gen.js").PikkuFunctionConfig<{
|
|
67
|
-
workflowName: string;
|
|
68
|
-
nodeId: string;
|
|
69
|
-
data?: unknown;
|
|
70
|
-
}, {
|
|
71
|
-
runId: string;
|
|
72
|
-
}, "session" | "rpc", import("../../.pikku/pikku-types.gen.js").PikkuFunctionSessionless<{
|
|
73
|
-
workflowName: string;
|
|
74
|
-
nodeId: string;
|
|
75
|
-
data?: unknown;
|
|
76
|
-
}, {
|
|
77
|
-
runId: string;
|
|
78
|
-
}, "session" | "rpc", import("../../types/application-types.js").Services> | import("../../.pikku/pikku-types.gen.js").PikkuFunction<{
|
|
79
|
-
workflowName: string;
|
|
80
|
-
nodeId: string;
|
|
81
|
-
data?: unknown;
|
|
82
|
-
}, {
|
|
83
|
-
runId: string;
|
|
84
|
-
}, "session" | "rpc", import("../../types/application-types.js").Services>, undefined, undefined>;
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.21
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Workflow HTTP catch-all routes
|
|
6
|
-
* Do not edit manually - regenerate with 'npx pikku'
|
|
7
|
-
*/
|
|
8
|
-
import { pikkuSessionlessFunc, wireHTTPRoutes } from '../../.pikku/pikku-types.gen.js';
|
|
9
|
-
import { MissingServiceError } from '@pikku/core/errors';
|
|
10
|
-
function assertWorkflowService(workflowService) {
|
|
11
|
-
if (!workflowService)
|
|
12
|
-
throw new MissingServiceError('workflowService is required');
|
|
13
|
-
}
|
|
14
|
-
function assertWorkflowRunService(workflowRunService) {
|
|
15
|
-
if (!workflowRunService)
|
|
16
|
-
throw new MissingServiceError('workflowRunService is required');
|
|
17
|
-
}
|
|
18
|
-
export const workflowStarter = pikkuSessionlessFunc({
|
|
19
|
-
auth: false,
|
|
20
|
-
func: async (_services, { workflowName, data }, { rpc }) => {
|
|
21
|
-
return await rpc.startWorkflow(workflowName, (data ?? {}));
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
export const workflowRunner = pikkuSessionlessFunc({
|
|
25
|
-
auth: false,
|
|
26
|
-
func: async ({ workflowService }, { workflowName, data }, { rpc }) => {
|
|
27
|
-
assertWorkflowService(workflowService);
|
|
28
|
-
return await workflowService.runToCompletion(workflowName, (data ?? {}), rpc);
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
export const workflowStatusChecker = pikkuSessionlessFunc({
|
|
32
|
-
auth: false,
|
|
33
|
-
func: async ({ workflowService }, { runId }) => {
|
|
34
|
-
assertWorkflowService(workflowService);
|
|
35
|
-
const status = await workflowService.getRunStatus(runId);
|
|
36
|
-
if (!status)
|
|
37
|
-
throw new Error(`Run not found: ${runId}`);
|
|
38
|
-
return status;
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
/**
|
|
42
|
-
* Minimal workflow status stream — sends step names and statuses only.
|
|
43
|
-
* Use this for user-facing frontends where internal details should not be exposed.
|
|
44
|
-
*/
|
|
45
|
-
export const workflowStatusStream = pikkuSessionlessFunc({
|
|
46
|
-
auth: false,
|
|
47
|
-
func: async ({ workflowRunService }, { runId }, { channel }) => {
|
|
48
|
-
assertWorkflowRunService(workflowRunService);
|
|
49
|
-
if (!channel)
|
|
50
|
-
return;
|
|
51
|
-
const terminalStatuses = new Set(['completed', 'failed', 'cancelled']);
|
|
52
|
-
let lastHash = '';
|
|
53
|
-
let initSent = false;
|
|
54
|
-
const poll = async () => {
|
|
55
|
-
const run = await workflowRunService.getRun(runId);
|
|
56
|
-
if (!run) {
|
|
57
|
-
channel.close();
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
const steps = await workflowRunService.getRunSteps(runId);
|
|
61
|
-
if (!initSent && run.deterministic) {
|
|
62
|
-
const statusByStep = new Map(steps.map((s) => [
|
|
63
|
-
s.stepName,
|
|
64
|
-
s.status,
|
|
65
|
-
]));
|
|
66
|
-
channel.send({
|
|
67
|
-
type: 'init',
|
|
68
|
-
deterministic: true,
|
|
69
|
-
steps: (run.plannedSteps ?? []).map((s) => ({
|
|
70
|
-
stepName: s.stepName,
|
|
71
|
-
status: statusByStep.get(s.stepName) ?? 'pending',
|
|
72
|
-
})),
|
|
73
|
-
});
|
|
74
|
-
initSent = true;
|
|
75
|
-
}
|
|
76
|
-
const hash = JSON.stringify({
|
|
77
|
-
s: run.status,
|
|
78
|
-
steps: steps.map((s) => [s.stepName, s.status]),
|
|
79
|
-
});
|
|
80
|
-
if (hash !== lastHash) {
|
|
81
|
-
lastHash = hash;
|
|
82
|
-
channel.send({
|
|
83
|
-
type: 'update',
|
|
84
|
-
status: run.status,
|
|
85
|
-
steps: steps.map((s) => ({
|
|
86
|
-
stepName: s.stepName,
|
|
87
|
-
status: s.status,
|
|
88
|
-
})),
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
if (terminalStatuses.has(run.status)) {
|
|
92
|
-
channel.send({ type: 'done' });
|
|
93
|
-
channel.close();
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
return true;
|
|
97
|
-
};
|
|
98
|
-
const shouldContinue = await poll();
|
|
99
|
-
if (!shouldContinue)
|
|
100
|
-
return;
|
|
101
|
-
await new Promise((resolve) => {
|
|
102
|
-
const interval = setInterval(async () => {
|
|
103
|
-
const cont = await poll();
|
|
104
|
-
if (!cont) {
|
|
105
|
-
clearInterval(interval);
|
|
106
|
-
resolve();
|
|
107
|
-
}
|
|
108
|
-
}, 500);
|
|
109
|
-
});
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
/**
|
|
113
|
-
* Full workflow status stream — includes output, error, and child run IDs.
|
|
114
|
-
* Use this for admin consoles and internal tooling.
|
|
115
|
-
*/
|
|
116
|
-
export const workflowStatusStreamFull = pikkuSessionlessFunc({
|
|
117
|
-
auth: false,
|
|
118
|
-
func: async ({ workflowRunService }, { runId }, { channel }) => {
|
|
119
|
-
assertWorkflowRunService(workflowRunService);
|
|
120
|
-
if (!channel)
|
|
121
|
-
return;
|
|
122
|
-
const terminalStatuses = new Set(['completed', 'failed', 'cancelled']);
|
|
123
|
-
let lastHash = '';
|
|
124
|
-
let initSent = false;
|
|
125
|
-
const poll = async () => {
|
|
126
|
-
const run = await workflowRunService.getRun(runId);
|
|
127
|
-
if (!run) {
|
|
128
|
-
channel.close();
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
const steps = await workflowRunService.getRunSteps(runId);
|
|
132
|
-
if (!initSent && run.deterministic) {
|
|
133
|
-
const statusByStep = new Map(steps.map((s) => [
|
|
134
|
-
s.stepName,
|
|
135
|
-
s.status,
|
|
136
|
-
]));
|
|
137
|
-
channel.send({
|
|
138
|
-
type: 'init',
|
|
139
|
-
deterministic: true,
|
|
140
|
-
steps: (run.plannedSteps ?? []).map((s) => ({
|
|
141
|
-
stepName: s.stepName,
|
|
142
|
-
status: statusByStep.get(s.stepName) ?? 'pending',
|
|
143
|
-
})),
|
|
144
|
-
});
|
|
145
|
-
initSent = true;
|
|
146
|
-
}
|
|
147
|
-
const hash = JSON.stringify({
|
|
148
|
-
s: run.status,
|
|
149
|
-
o: run.output,
|
|
150
|
-
steps: steps.map((s) => [s.stepName, s.status]),
|
|
151
|
-
});
|
|
152
|
-
if (hash !== lastHash) {
|
|
153
|
-
lastHash = hash;
|
|
154
|
-
channel.send({
|
|
155
|
-
type: 'update',
|
|
156
|
-
status: run.status,
|
|
157
|
-
output: run.output,
|
|
158
|
-
error: run.error,
|
|
159
|
-
steps: steps.map((s) => ({
|
|
160
|
-
stepName: s.stepName,
|
|
161
|
-
status: s.status,
|
|
162
|
-
...(s.childRunId ? { childRunId: s.childRunId } : {}),
|
|
163
|
-
})),
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
if (terminalStatuses.has(run.status)) {
|
|
167
|
-
channel.send({ type: 'done' });
|
|
168
|
-
channel.close();
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
return true;
|
|
172
|
-
};
|
|
173
|
-
const shouldContinue = await poll();
|
|
174
|
-
if (!shouldContinue)
|
|
175
|
-
return;
|
|
176
|
-
await new Promise((resolve) => {
|
|
177
|
-
const interval = setInterval(async () => {
|
|
178
|
-
const cont = await poll();
|
|
179
|
-
if (!cont) {
|
|
180
|
-
clearInterval(interval);
|
|
181
|
-
resolve();
|
|
182
|
-
}
|
|
183
|
-
}, 500);
|
|
184
|
-
});
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
export const graphStarter = pikkuSessionlessFunc({
|
|
188
|
-
auth: false,
|
|
189
|
-
func: async (_services, { workflowName, nodeId, data }, { rpc }) => {
|
|
190
|
-
return await rpc.startWorkflow(workflowName, (data ?? {}), { startNode: nodeId });
|
|
191
|
-
},
|
|
192
|
-
});
|
|
193
|
-
wireHTTPRoutes({
|
|
194
|
-
auth: false,
|
|
195
|
-
routes: {
|
|
196
|
-
workflowStart: {
|
|
197
|
-
route: '/workflow/:workflowName/start',
|
|
198
|
-
method: 'post',
|
|
199
|
-
func: workflowStarter,
|
|
200
|
-
},
|
|
201
|
-
workflowRun: {
|
|
202
|
-
route: '/workflow/:workflowName/run',
|
|
203
|
-
method: 'post',
|
|
204
|
-
func: workflowRunner,
|
|
205
|
-
},
|
|
206
|
-
workflowStatus: {
|
|
207
|
-
route: '/workflow/:workflowName/status/:runId',
|
|
208
|
-
method: 'get',
|
|
209
|
-
func: workflowStatusChecker,
|
|
210
|
-
},
|
|
211
|
-
workflowStatusStream: {
|
|
212
|
-
route: '/workflow/:workflowName/status/:runId/stream',
|
|
213
|
-
method: 'get',
|
|
214
|
-
sse: true,
|
|
215
|
-
func: workflowStatusStream,
|
|
216
|
-
},
|
|
217
|
-
workflowStatusStreamFull: {
|
|
218
|
-
route: '/workflow/:workflowName/status/:runId/stream/full',
|
|
219
|
-
method: 'get',
|
|
220
|
-
sse: true,
|
|
221
|
-
func: workflowStatusStreamFull,
|
|
222
|
-
},
|
|
223
|
-
graphStart: {
|
|
224
|
-
route: '/workflow/:workflowName/graph/:nodeId',
|
|
225
|
-
method: 'post',
|
|
226
|
-
func: graphStarter,
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
});
|