bunqueue 2.8.0 → 2.8.2
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/README.md +44 -11
- package/dist/application/backgroundTasks.d.ts +0 -1
- package/dist/application/backgroundTasks.js +83 -1
- package/dist/application/cleanupTasks.d.ts +0 -1
- package/dist/application/cleanupTasks.js +0 -1
- package/dist/application/clientTracking.d.ts +23 -1
- package/dist/application/clientTracking.js +80 -26
- package/dist/application/contextFactory.d.ts +6 -1
- package/dist/application/contextFactory.js +7 -1
- package/dist/application/dependencyProcessor.d.ts +0 -1
- package/dist/application/dependencyProcessor.js +0 -1
- package/dist/application/dlqManager.d.ts +0 -1
- package/dist/application/dlqManager.js +5 -1
- package/dist/application/eventsManager.d.ts +0 -1
- package/dist/application/eventsManager.js +0 -1
- package/dist/application/jobLogsManager.d.ts +0 -1
- package/dist/application/jobLogsManager.js +0 -1
- package/dist/application/latencyTracker.d.ts +0 -1
- package/dist/application/latencyTracker.js +0 -1
- package/dist/application/lockManager.d.ts +1 -2
- package/dist/application/lockManager.js +1 -2
- package/dist/application/lockOperations.d.ts +0 -1
- package/dist/application/lockOperations.js +0 -1
- package/dist/application/metricsExporter.d.ts +0 -1
- package/dist/application/metricsExporter.js +0 -1
- package/dist/application/monitoringChecks.d.ts +0 -1
- package/dist/application/monitoringChecks.js +0 -1
- package/dist/application/operations/ack.d.ts +0 -1
- package/dist/application/operations/ack.js +32 -34
- package/dist/application/operations/ackHelpers.d.ts +0 -1
- package/dist/application/operations/ackHelpers.js +0 -1
- package/dist/application/operations/index.d.ts +0 -1
- package/dist/application/operations/index.js +0 -1
- package/dist/application/operations/jobManagement.d.ts +1 -2
- package/dist/application/operations/jobManagement.js +3 -3
- package/dist/application/operations/jobStateTransitions.d.ts +0 -1
- package/dist/application/operations/jobStateTransitions.js +0 -1
- package/dist/application/operations/pull.d.ts +0 -1
- package/dist/application/operations/pull.js +0 -1
- package/dist/application/operations/push.d.ts +0 -1
- package/dist/application/operations/push.js +0 -1
- package/dist/application/operations/queryOperations.d.ts +0 -1
- package/dist/application/operations/queryOperations.js +37 -4
- package/dist/application/operations/queueControl.d.ts +16 -5
- package/dist/application/operations/queueControl.js +119 -24
- package/dist/application/queueManager.d.ts +17 -4
- package/dist/application/queueManager.js +106 -28
- package/dist/application/stallDetection.d.ts +0 -1
- package/dist/application/stallDetection.js +1 -1
- package/dist/application/statsManager.d.ts +0 -1
- package/dist/application/statsManager.js +0 -1
- package/dist/application/taskErrorTracking.d.ts +0 -1
- package/dist/application/taskErrorTracking.js +0 -1
- package/dist/application/throughputTracker.d.ts +0 -1
- package/dist/application/throughputTracker.js +0 -1
- package/dist/application/types.d.ts +2 -2
- package/dist/application/types.js +0 -1
- package/dist/application/webhookManager.d.ts +0 -1
- package/dist/application/webhookManager.js +0 -1
- package/dist/application/workerManager.d.ts +0 -1
- package/dist/application/workerManager.js +0 -1
- package/dist/cli/client.d.ts +0 -1
- package/dist/cli/client.js +15 -3
- package/dist/cli/commands/backup.d.ts +0 -1
- package/dist/cli/commands/backup.js +0 -1
- package/dist/cli/commands/core.d.ts +0 -1
- package/dist/cli/commands/core.js +0 -1
- package/dist/cli/commands/cron.d.ts +0 -1
- package/dist/cli/commands/cron.js +0 -1
- package/dist/cli/commands/dlq.d.ts +0 -1
- package/dist/cli/commands/dlq.js +0 -1
- package/dist/cli/commands/doctor.d.ts +0 -1
- package/dist/cli/commands/doctor.js +0 -1
- package/dist/cli/commands/job.d.ts +0 -1
- package/dist/cli/commands/job.js +0 -1
- package/dist/cli/commands/monitor.d.ts +0 -1
- package/dist/cli/commands/monitor.js +0 -1
- package/dist/cli/commands/queue.d.ts +0 -1
- package/dist/cli/commands/queue.js +0 -1
- package/dist/cli/commands/rateLimit.d.ts +0 -1
- package/dist/cli/commands/rateLimit.js +0 -1
- package/dist/cli/commands/server.d.ts +0 -1
- package/dist/cli/commands/server.js +0 -1
- package/dist/cli/commands/types.d.ts +0 -1
- package/dist/cli/commands/types.js +0 -1
- package/dist/cli/commands/webhook.d.ts +0 -1
- package/dist/cli/commands/webhook.js +0 -1
- package/dist/cli/commands/worker.d.ts +0 -1
- package/dist/cli/commands/worker.js +0 -1
- package/dist/cli/help.d.ts +0 -1
- package/dist/cli/help.js +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +31 -3
- package/dist/cli/output.d.ts +1 -2
- package/dist/cli/output.js +71 -10
- package/dist/client/bunqueue/aging.d.ts +0 -1
- package/dist/client/bunqueue/aging.js +0 -1
- package/dist/client/bunqueue/batch.d.ts +0 -1
- package/dist/client/bunqueue/batch.js +2 -3
- package/dist/client/bunqueue/cancellation.d.ts +0 -1
- package/dist/client/bunqueue/cancellation.js +0 -1
- package/dist/client/bunqueue/circuitBreaker.d.ts +0 -1
- package/dist/client/bunqueue/circuitBreaker.js +0 -1
- package/dist/client/bunqueue/dedupDebounce.d.ts +0 -1
- package/dist/client/bunqueue/dedupDebounce.js +0 -1
- package/dist/client/bunqueue/dlqRateLimit.d.ts +0 -1
- package/dist/client/bunqueue/dlqRateLimit.js +0 -1
- package/dist/client/bunqueue/retry.d.ts +0 -1
- package/dist/client/bunqueue/retry.js +0 -1
- package/dist/client/bunqueue/triggers.d.ts +0 -1
- package/dist/client/bunqueue/triggers.js +0 -1
- package/dist/client/bunqueue/ttl.d.ts +0 -1
- package/dist/client/bunqueue/ttl.js +0 -1
- package/dist/client/bunqueue/types.d.ts +0 -1
- package/dist/client/bunqueue/types.js +0 -1
- package/dist/client/bunqueue.d.ts +0 -1
- package/dist/client/bunqueue.js +3 -4
- package/dist/client/errors.d.ts +0 -1
- package/dist/client/errors.js +0 -1
- package/dist/client/events.d.ts +0 -1
- package/dist/client/events.js +0 -1
- package/dist/client/flow.d.ts +0 -1
- package/dist/client/flow.js +3 -2
- package/dist/client/flowJobFactory.d.ts +8 -2
- package/dist/client/flowJobFactory.js +328 -57
- package/dist/client/flowPush.d.ts +0 -1
- package/dist/client/flowPush.js +95 -47
- package/dist/client/flowTypes.d.ts +0 -1
- package/dist/client/flowTypes.js +0 -1
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.js +0 -1
- package/dist/client/jobConversion.d.ts +0 -1
- package/dist/client/jobConversion.js +12 -5
- package/dist/client/jobConversionHelpers.d.ts +0 -1
- package/dist/client/jobConversionHelpers.js +0 -1
- package/dist/client/jobConversionTypes.d.ts +0 -1
- package/dist/client/jobConversionTypes.js +0 -1
- package/dist/client/jobHelpers.d.ts +0 -1
- package/dist/client/jobHelpers.js +0 -1
- package/dist/client/manager.d.ts +0 -1
- package/dist/client/manager.js +0 -1
- package/dist/client/queue/addBatcher.d.ts +0 -1
- package/dist/client/queue/addBatcher.js +0 -1
- package/dist/client/queue/bullmqCompat.d.ts +1 -1
- package/dist/client/queue/bullmqCompat.js +0 -1
- package/dist/client/queue/deduplication.d.ts +0 -1
- package/dist/client/queue/deduplication.js +0 -1
- package/dist/client/queue/dlq.d.ts +0 -1
- package/dist/client/queue/dlq.js +0 -1
- package/dist/client/queue/dlqOps.d.ts +0 -1
- package/dist/client/queue/dlqOps.js +0 -1
- package/dist/client/queue/helpers.d.ts +0 -1
- package/dist/client/queue/helpers.js +0 -1
- package/dist/client/queue/index.d.ts +0 -1
- package/dist/client/queue/index.js +0 -1
- package/dist/client/queue/jobMove.d.ts +0 -1
- package/dist/client/queue/jobMove.js +0 -1
- package/dist/client/queue/jobProxy.d.ts +22 -4
- package/dist/client/queue/jobProxy.js +347 -67
- package/dist/client/queue/operations/add.d.ts +1 -1
- package/dist/client/queue/operations/add.js +126 -30
- package/dist/client/queue/operations/control.d.ts +0 -1
- package/dist/client/queue/operations/control.js +0 -1
- package/dist/client/queue/operations/counts.d.ts +0 -1
- package/dist/client/queue/operations/counts.js +0 -1
- package/dist/client/queue/operations/index.d.ts +0 -1
- package/dist/client/queue/operations/index.js +0 -1
- package/dist/client/queue/operations/management.d.ts +1 -2
- package/dist/client/queue/operations/management.js +27 -10
- package/dist/client/queue/operations/query.d.ts +12 -1
- package/dist/client/queue/operations/query.js +44 -5
- package/dist/client/queue/queue.d.ts +0 -1
- package/dist/client/queue/queue.js +8 -2
- package/dist/client/queue/queueTypes.d.ts +0 -1
- package/dist/client/queue/queueTypes.js +0 -1
- package/dist/client/queue/rateLimit.d.ts +0 -1
- package/dist/client/queue/rateLimit.js +0 -1
- package/dist/client/queue/scheduler.d.ts +2 -1
- package/dist/client/queue/scheduler.js +28 -1
- package/dist/client/queue/stall.d.ts +0 -1
- package/dist/client/queue/stall.js +0 -1
- package/dist/client/queue/workers.d.ts +0 -1
- package/dist/client/queue/workers.js +0 -1
- package/dist/client/queue.d.ts +0 -1
- package/dist/client/queue.js +0 -1
- package/dist/client/queueGroup.d.ts +0 -1
- package/dist/client/queueGroup.js +0 -1
- package/dist/client/resolveToken.d.ts +0 -1
- package/dist/client/resolveToken.js +0 -1
- package/dist/client/sandboxed/index.d.ts +0 -1
- package/dist/client/sandboxed/index.js +0 -1
- package/dist/client/sandboxed/queueOps.d.ts +0 -1
- package/dist/client/sandboxed/queueOps.js +0 -1
- package/dist/client/sandboxed/types.d.ts +0 -1
- package/dist/client/sandboxed/types.js +0 -1
- package/dist/client/sandboxed/worker.d.ts +0 -1
- package/dist/client/sandboxed/worker.js +57 -16
- package/dist/client/sandboxed/wrapper.d.ts +0 -1
- package/dist/client/sandboxed/wrapper.js +62 -11
- package/dist/client/sandboxedWorker.d.ts +0 -1
- package/dist/client/sandboxedWorker.js +0 -1
- package/dist/client/tcp/client.d.ts +9 -1
- package/dist/client/tcp/client.js +84 -29
- package/dist/client/tcp/connection.d.ts +0 -1
- package/dist/client/tcp/connection.js +6 -2
- package/dist/client/tcp/health.d.ts +0 -1
- package/dist/client/tcp/health.js +0 -1
- package/dist/client/tcp/index.d.ts +0 -1
- package/dist/client/tcp/index.js +0 -1
- package/dist/client/tcp/reconnect.d.ts +0 -1
- package/dist/client/tcp/reconnect.js +0 -1
- package/dist/client/tcp/shared.d.ts +0 -1
- package/dist/client/tcp/shared.js +0 -1
- package/dist/client/tcp/types.d.ts +7 -1
- package/dist/client/tcp/types.js +0 -1
- package/dist/client/tcpClient.d.ts +0 -1
- package/dist/client/tcpClient.js +0 -1
- package/dist/client/tcpPool.d.ts +0 -1
- package/dist/client/tcpPool.js +0 -1
- package/dist/client/types.d.ts +8 -5
- package/dist/client/types.js +0 -1
- package/dist/client/worker/ackBatcher.d.ts +0 -1
- package/dist/client/worker/ackBatcher.js +18 -9
- package/dist/client/worker/groupConcurrency.d.ts +0 -1
- package/dist/client/worker/groupConcurrency.js +0 -1
- package/dist/client/worker/index.d.ts +0 -1
- package/dist/client/worker/index.js +0 -1
- package/dist/client/worker/jobParser.d.ts +0 -1
- package/dist/client/worker/jobParser.js +0 -1
- package/dist/client/worker/processor.d.ts +0 -1
- package/dist/client/worker/processor.js +54 -100
- package/dist/client/worker/processorHandlers.d.ts +54 -0
- package/dist/client/worker/processorHandlers.js +372 -0
- package/dist/client/worker/types.d.ts +0 -1
- package/dist/client/worker/types.js +0 -1
- package/dist/client/worker/worker.d.ts +0 -1
- package/dist/client/worker/worker.js +0 -1
- package/dist/client/worker/workerHeartbeat.d.ts +0 -1
- package/dist/client/worker/workerHeartbeat.js +0 -1
- package/dist/client/worker/workerPull.d.ts +0 -1
- package/dist/client/worker/workerPull.js +0 -1
- package/dist/client/worker/workerRateLimiter.d.ts +0 -1
- package/dist/client/worker/workerRateLimiter.js +0 -1
- package/dist/client/worker.d.ts +0 -1
- package/dist/client/worker.js +0 -1
- package/dist/client/workflow/compensator.d.ts +14 -0
- package/dist/client/workflow/compensator.js +45 -0
- package/dist/client/workflow/emitter.d.ts +0 -1
- package/dist/client/workflow/emitter.js +15 -4
- package/dist/client/workflow/engine.d.ts +8 -2
- package/dist/client/workflow/engine.js +9 -1
- package/dist/client/workflow/executor.d.ts +5 -3
- package/dist/client/workflow/executor.js +43 -61
- package/dist/client/workflow/index.d.ts +1 -2
- package/dist/client/workflow/index.js +0 -1
- package/dist/client/workflow/loops.d.ts +1 -2
- package/dist/client/workflow/loops.js +10 -2
- package/dist/client/workflow/recovery.d.ts +22 -0
- package/dist/client/workflow/recovery.js +73 -0
- package/dist/client/workflow/runner.d.ts +0 -1
- package/dist/client/workflow/runner.js +7 -6
- package/dist/client/workflow/store.d.ts +2 -1
- package/dist/client/workflow/store.js +6 -1
- package/dist/client/workflow/types.d.ts +41 -23
- package/dist/client/workflow/types.js +0 -1
- package/dist/client/workflow/workflow.d.ts +17 -15
- package/dist/client/workflow/workflow.js +30 -21
- package/dist/config/index.d.ts +0 -1
- package/dist/config/index.js +0 -1
- package/dist/config/loader.d.ts +0 -1
- package/dist/config/loader.js +0 -1
- package/dist/config/resolve.d.ts +0 -1
- package/dist/config/resolve.js +0 -1
- package/dist/config/types.d.ts +0 -1
- package/dist/config/types.js +0 -1
- package/dist/domain/queue/dependencyTracker.d.ts +0 -1
- package/dist/domain/queue/dependencyTracker.js +0 -1
- package/dist/domain/queue/dlqShard.d.ts +0 -1
- package/dist/domain/queue/dlqShard.js +6 -1
- package/dist/domain/queue/index.d.ts +0 -1
- package/dist/domain/queue/index.js +0 -1
- package/dist/domain/queue/limiterManager.d.ts +0 -1
- package/dist/domain/queue/limiterManager.js +0 -1
- package/dist/domain/queue/priorityQueue.d.ts +2 -3
- package/dist/domain/queue/priorityQueue.js +5 -4
- package/dist/domain/queue/shard.d.ts +0 -1
- package/dist/domain/queue/shard.js +0 -1
- package/dist/domain/queue/shardCounters.d.ts +0 -1
- package/dist/domain/queue/shardCounters.js +0 -1
- package/dist/domain/queue/temporalManager.d.ts +0 -1
- package/dist/domain/queue/temporalManager.js +0 -1
- package/dist/domain/queue/uniqueKeyManager.d.ts +0 -1
- package/dist/domain/queue/uniqueKeyManager.js +0 -1
- package/dist/domain/queue/waiterManager.d.ts +0 -1
- package/dist/domain/queue/waiterManager.js +0 -1
- package/dist/domain/types/command.d.ts +22 -1
- package/dist/domain/types/command.js +0 -1
- package/dist/domain/types/cron.d.ts +21 -1
- package/dist/domain/types/cron.js +1 -1
- package/dist/domain/types/deduplication.d.ts +0 -1
- package/dist/domain/types/deduplication.js +0 -1
- package/dist/domain/types/dlq.d.ts +0 -1
- package/dist/domain/types/dlq.js +0 -1
- package/dist/domain/types/index.d.ts +0 -1
- package/dist/domain/types/index.js +0 -1
- package/dist/domain/types/job.d.ts +0 -1
- package/dist/domain/types/job.js +9 -3
- package/dist/domain/types/queue.d.ts +0 -1
- package/dist/domain/types/queue.js +0 -1
- package/dist/domain/types/response.d.ts +2 -1
- package/dist/domain/types/response.js +0 -1
- package/dist/domain/types/stall.d.ts +0 -1
- package/dist/domain/types/stall.js +0 -1
- package/dist/domain/types/webhook.d.ts +0 -1
- package/dist/domain/types/webhook.js +0 -1
- package/dist/domain/types/worker.d.ts +0 -1
- package/dist/domain/types/worker.js +0 -1
- package/dist/infrastructure/backup/index.d.ts +0 -1
- package/dist/infrastructure/backup/index.js +0 -1
- package/dist/infrastructure/backup/s3Backup.d.ts +0 -1
- package/dist/infrastructure/backup/s3Backup.js +0 -1
- package/dist/infrastructure/backup/s3BackupConfig.d.ts +0 -1
- package/dist/infrastructure/backup/s3BackupConfig.js +0 -1
- package/dist/infrastructure/backup/s3BackupOperations.d.ts +0 -1
- package/dist/infrastructure/backup/s3BackupOperations.js +44 -7
- package/dist/infrastructure/cloud/buffer.d.ts +0 -1
- package/dist/infrastructure/cloud/buffer.js +0 -1
- package/dist/infrastructure/cloud/circuitBreaker.d.ts +0 -1
- package/dist/infrastructure/cloud/circuitBreaker.js +0 -1
- package/dist/infrastructure/cloud/cloudAgent.d.ts +1 -2
- package/dist/infrastructure/cloud/cloudAgent.js +9 -12
- package/dist/infrastructure/cloud/commandHandler.d.ts +0 -1
- package/dist/infrastructure/cloud/commandHandler.js +0 -1
- package/dist/infrastructure/cloud/commands.d.ts +0 -1
- package/dist/infrastructure/cloud/commands.js +2 -3
- package/dist/infrastructure/cloud/config.d.ts +0 -1
- package/dist/infrastructure/cloud/config.js +0 -1
- package/dist/infrastructure/cloud/httpSender.d.ts +0 -1
- package/dist/infrastructure/cloud/httpSender.js +0 -1
- package/dist/infrastructure/cloud/index.d.ts +0 -1
- package/dist/infrastructure/cloud/index.js +0 -1
- package/dist/infrastructure/cloud/logger.d.ts +0 -1
- package/dist/infrastructure/cloud/logger.js +0 -1
- package/dist/infrastructure/cloud/redact.d.ts +10 -0
- package/dist/infrastructure/cloud/redact.js +21 -0
- package/dist/infrastructure/cloud/snapshotCollector.d.ts +4 -1
- package/dist/infrastructure/cloud/snapshotCollector.js +32 -18
- package/dist/infrastructure/cloud/snapshotHelpers.d.ts +9 -3
- package/dist/infrastructure/cloud/snapshotHelpers.js +10 -9
- package/dist/infrastructure/cloud/statsRefresh.d.ts +0 -1
- package/dist/infrastructure/cloud/statsRefresh.js +0 -1
- package/dist/infrastructure/cloud/statsUpdate.d.ts +0 -1
- package/dist/infrastructure/cloud/statsUpdate.js +0 -1
- package/dist/infrastructure/cloud/types.d.ts +0 -1
- package/dist/infrastructure/cloud/types.js +0 -1
- package/dist/infrastructure/cloud/wsSender.d.ts +0 -1
- package/dist/infrastructure/cloud/wsSender.js +0 -1
- package/dist/infrastructure/persistence/index.d.ts +0 -1
- package/dist/infrastructure/persistence/index.js +0 -1
- package/dist/infrastructure/persistence/schema.d.ts +2 -3
- package/dist/infrastructure/persistence/schema.js +16 -3
- package/dist/infrastructure/persistence/sqlite.d.ts +54 -2
- package/dist/infrastructure/persistence/sqlite.js +174 -3
- package/dist/infrastructure/persistence/sqliteBatch.d.ts +14 -1
- package/dist/infrastructure/persistence/sqliteBatch.js +29 -1
- package/dist/infrastructure/persistence/sqliteSerializer.d.ts +16 -1
- package/dist/infrastructure/persistence/sqliteSerializer.js +73 -9
- package/dist/infrastructure/persistence/statements.d.ts +2 -2
- package/dist/infrastructure/persistence/statements.js +3 -3
- package/dist/infrastructure/scheduler/cronParser.d.ts +0 -1
- package/dist/infrastructure/scheduler/cronParser.js +0 -1
- package/dist/infrastructure/scheduler/cronScheduler.d.ts +0 -1
- package/dist/infrastructure/scheduler/cronScheduler.js +19 -2
- package/dist/infrastructure/scheduler/index.d.ts +0 -1
- package/dist/infrastructure/scheduler/index.js +0 -1
- package/dist/infrastructure/server/handler.d.ts +0 -1
- package/dist/infrastructure/server/handler.js +0 -1
- package/dist/infrastructure/server/handlerRoutes.d.ts +0 -1
- package/dist/infrastructure/server/handlerRoutes.js +0 -1
- package/dist/infrastructure/server/handlers/advanced.d.ts +7 -2
- package/dist/infrastructure/server/handlers/advanced.js +41 -11
- package/dist/infrastructure/server/handlers/core.d.ts +0 -1
- package/dist/infrastructure/server/handlers/core.js +8 -1
- package/dist/infrastructure/server/handlers/cron.d.ts +0 -1
- package/dist/infrastructure/server/handlers/cron.js +1 -1
- package/dist/infrastructure/server/handlers/dashboard.d.ts +0 -1
- package/dist/infrastructure/server/handlers/dashboard.js +1 -1
- package/dist/infrastructure/server/handlers/dlq.d.ts +0 -1
- package/dist/infrastructure/server/handlers/dlq.js +0 -1
- package/dist/infrastructure/server/handlers/index.d.ts +0 -1
- package/dist/infrastructure/server/handlers/index.js +0 -1
- package/dist/infrastructure/server/handlers/management.d.ts +1 -2
- package/dist/infrastructure/server/handlers/management.js +27 -13
- package/dist/infrastructure/server/handlers/monitoring.d.ts +0 -1
- package/dist/infrastructure/server/handlers/monitoring.js +0 -1
- package/dist/infrastructure/server/handlers/query.d.ts +0 -1
- package/dist/infrastructure/server/handlers/query.js +0 -1
- package/dist/infrastructure/server/http.d.ts +0 -1
- package/dist/infrastructure/server/http.js +0 -1
- package/dist/infrastructure/server/httpEndpoints.d.ts +0 -1
- package/dist/infrastructure/server/httpEndpoints.js +0 -1
- package/dist/infrastructure/server/httpRouteJobs.d.ts +0 -1
- package/dist/infrastructure/server/httpRouteJobs.js +0 -1
- package/dist/infrastructure/server/httpRouteQueueConfig.d.ts +0 -1
- package/dist/infrastructure/server/httpRouteQueueConfig.js +0 -1
- package/dist/infrastructure/server/httpRouteQueues.d.ts +0 -1
- package/dist/infrastructure/server/httpRouteQueues.js +0 -1
- package/dist/infrastructure/server/httpRouteResources.d.ts +0 -1
- package/dist/infrastructure/server/httpRouteResources.js +0 -1
- package/dist/infrastructure/server/index.d.ts +0 -1
- package/dist/infrastructure/server/index.js +0 -1
- package/dist/infrastructure/server/protocol.d.ts +4 -1
- package/dist/infrastructure/server/protocol.js +17 -3
- package/dist/infrastructure/server/rateLimiter.d.ts +0 -1
- package/dist/infrastructure/server/rateLimiter.js +0 -1
- package/dist/infrastructure/server/socketWriteQueue.d.ts +66 -0
- package/dist/infrastructure/server/socketWriteQueue.js +126 -0
- package/dist/infrastructure/server/sseHandler.d.ts +0 -1
- package/dist/infrastructure/server/sseHandler.js +0 -1
- package/dist/infrastructure/server/tcp.d.ts +17 -1
- package/dist/infrastructure/server/tcp.js +112 -15
- package/dist/infrastructure/server/types.d.ts +0 -1
- package/dist/infrastructure/server/types.js +0 -1
- package/dist/infrastructure/server/wsHandler.d.ts +0 -1
- package/dist/infrastructure/server/wsHandler.js +0 -1
- package/dist/main.d.ts +0 -1
- package/dist/main.js +48 -44
- package/dist/mcp/adapter.d.ts +3 -4
- package/dist/mcp/adapter.js +48 -16
- package/dist/mcp/httpHandler.d.ts +0 -1
- package/dist/mcp/httpHandler.js +0 -1
- package/dist/mcp/index.d.ts +3 -4
- package/dist/mcp/index.js +26 -90
- package/dist/mcp/prompts.d.ts +0 -1
- package/dist/mcp/prompts.js +0 -1
- package/dist/mcp/resources.d.ts +0 -1
- package/dist/mcp/resources.js +0 -1
- package/dist/mcp/server.d.ts +15 -0
- package/dist/mcp/server.js +100 -0
- package/dist/mcp/tools/consumptionTools.d.ts +0 -1
- package/dist/mcp/tools/consumptionTools.js +0 -1
- package/dist/mcp/tools/cronTools.d.ts +0 -1
- package/dist/mcp/tools/cronTools.js +0 -1
- package/dist/mcp/tools/dlqTools.d.ts +0 -1
- package/dist/mcp/tools/dlqTools.js +0 -1
- package/dist/mcp/tools/flowTools.d.ts +0 -1
- package/dist/mcp/tools/flowTools.js +0 -1
- package/dist/mcp/tools/handlerTools.d.ts +0 -1
- package/dist/mcp/tools/handlerTools.js +0 -1
- package/dist/mcp/tools/jobMgmtTools.d.ts +0 -1
- package/dist/mcp/tools/jobMgmtTools.js +0 -1
- package/dist/mcp/tools/jobTools.d.ts +0 -1
- package/dist/mcp/tools/jobTools.js +0 -1
- package/dist/mcp/tools/mcpTracker.d.ts +0 -1
- package/dist/mcp/tools/mcpTracker.js +0 -1
- package/dist/mcp/tools/monitoringTools.d.ts +0 -1
- package/dist/mcp/tools/monitoringTools.js +0 -1
- package/dist/mcp/tools/queueTools.d.ts +0 -1
- package/dist/mcp/tools/queueTools.js +6 -4
- package/dist/mcp/tools/rateLimitTools.d.ts +0 -1
- package/dist/mcp/tools/rateLimitTools.js +0 -1
- package/dist/mcp/tools/webhookTools.d.ts +0 -1
- package/dist/mcp/tools/webhookTools.js +1 -2
- package/dist/mcp/tools/withErrorHandler.d.ts +0 -1
- package/dist/mcp/tools/withErrorHandler.js +0 -1
- package/dist/mcp/tools/workerMgmtTools.d.ts +0 -1
- package/dist/mcp/tools/workerMgmtTools.js +0 -1
- package/dist/shared/boundedMap.d.ts +0 -1
- package/dist/shared/boundedMap.js +0 -1
- package/dist/shared/boundedSet.d.ts +0 -1
- package/dist/shared/boundedSet.js +0 -1
- package/dist/shared/hash.d.ts +0 -1
- package/dist/shared/hash.js +0 -1
- package/dist/shared/histogram.d.ts +0 -1
- package/dist/shared/histogram.js +0 -1
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.js +0 -1
- package/dist/shared/lock.d.ts +0 -1
- package/dist/shared/lock.js +15 -1
- package/dist/shared/logger.d.ts +0 -1
- package/dist/shared/logger.js +0 -1
- package/dist/shared/lru.d.ts +0 -1
- package/dist/shared/lru.js +0 -1
- package/dist/shared/lruMap.d.ts +0 -1
- package/dist/shared/lruMap.js +0 -1
- package/dist/shared/lruSet.d.ts +0 -1
- package/dist/shared/lruSet.js +0 -1
- package/dist/shared/minHeap.d.ts +0 -1
- package/dist/shared/minHeap.js +0 -1
- package/dist/shared/semaphore.d.ts +0 -1
- package/dist/shared/semaphore.js +0 -1
- package/dist/shared/serialization.d.ts +0 -1
- package/dist/shared/serialization.js +0 -1
- package/dist/shared/skipList.d.ts +0 -1
- package/dist/shared/skipList.js +0 -1
- package/dist/shared/ttlMap.d.ts +0 -1
- package/dist/shared/ttlMap.js +0 -1
- package/dist/shared/version.d.ts +0 -1
- package/dist/shared/version.js +0 -1
- package/dist/shared/webhookValidation.d.ts +0 -1
- package/dist/shared/webhookValidation.js +0 -1
- package/package.json +12 -9
- package/dist/application/backgroundTasks.d.ts.map +0 -1
- package/dist/application/backgroundTasks.js.map +0 -1
- package/dist/application/cleanupTasks.d.ts.map +0 -1
- package/dist/application/cleanupTasks.js.map +0 -1
- package/dist/application/clientTracking.d.ts.map +0 -1
- package/dist/application/clientTracking.js.map +0 -1
- package/dist/application/contextFactory.d.ts.map +0 -1
- package/dist/application/contextFactory.js.map +0 -1
- package/dist/application/dependencyProcessor.d.ts.map +0 -1
- package/dist/application/dependencyProcessor.js.map +0 -1
- package/dist/application/dlqManager.d.ts.map +0 -1
- package/dist/application/dlqManager.js.map +0 -1
- package/dist/application/eventsManager.d.ts.map +0 -1
- package/dist/application/eventsManager.js.map +0 -1
- package/dist/application/jobLogsManager.d.ts.map +0 -1
- package/dist/application/jobLogsManager.js.map +0 -1
- package/dist/application/latencyTracker.d.ts.map +0 -1
- package/dist/application/latencyTracker.js.map +0 -1
- package/dist/application/lockManager.d.ts.map +0 -1
- package/dist/application/lockManager.js.map +0 -1
- package/dist/application/lockOperations.d.ts.map +0 -1
- package/dist/application/lockOperations.js.map +0 -1
- package/dist/application/metricsExporter.d.ts.map +0 -1
- package/dist/application/metricsExporter.js.map +0 -1
- package/dist/application/monitoringChecks.d.ts.map +0 -1
- package/dist/application/monitoringChecks.js.map +0 -1
- package/dist/application/operations/ack.d.ts.map +0 -1
- package/dist/application/operations/ack.js.map +0 -1
- package/dist/application/operations/ackHelpers.d.ts.map +0 -1
- package/dist/application/operations/ackHelpers.js.map +0 -1
- package/dist/application/operations/index.d.ts.map +0 -1
- package/dist/application/operations/index.js.map +0 -1
- package/dist/application/operations/jobManagement.d.ts.map +0 -1
- package/dist/application/operations/jobManagement.js.map +0 -1
- package/dist/application/operations/jobStateTransitions.d.ts.map +0 -1
- package/dist/application/operations/jobStateTransitions.js.map +0 -1
- package/dist/application/operations/pull.d.ts.map +0 -1
- package/dist/application/operations/pull.js.map +0 -1
- package/dist/application/operations/push.d.ts.map +0 -1
- package/dist/application/operations/push.js.map +0 -1
- package/dist/application/operations/queryOperations.d.ts.map +0 -1
- package/dist/application/operations/queryOperations.js.map +0 -1
- package/dist/application/operations/queueControl.d.ts.map +0 -1
- package/dist/application/operations/queueControl.js.map +0 -1
- package/dist/application/queueManager.d.ts.map +0 -1
- package/dist/application/queueManager.js.map +0 -1
- package/dist/application/stallDetection.d.ts.map +0 -1
- package/dist/application/stallDetection.js.map +0 -1
- package/dist/application/statsManager.d.ts.map +0 -1
- package/dist/application/statsManager.js.map +0 -1
- package/dist/application/taskErrorTracking.d.ts.map +0 -1
- package/dist/application/taskErrorTracking.js.map +0 -1
- package/dist/application/throughputTracker.d.ts.map +0 -1
- package/dist/application/throughputTracker.js.map +0 -1
- package/dist/application/types.d.ts.map +0 -1
- package/dist/application/types.js.map +0 -1
- package/dist/application/webhookManager.d.ts.map +0 -1
- package/dist/application/webhookManager.js.map +0 -1
- package/dist/application/workerManager.d.ts.map +0 -1
- package/dist/application/workerManager.js.map +0 -1
- package/dist/cli/client.d.ts.map +0 -1
- package/dist/cli/client.js.map +0 -1
- package/dist/cli/commands/backup.d.ts.map +0 -1
- package/dist/cli/commands/backup.js.map +0 -1
- package/dist/cli/commands/core.d.ts.map +0 -1
- package/dist/cli/commands/core.js.map +0 -1
- package/dist/cli/commands/cron.d.ts.map +0 -1
- package/dist/cli/commands/cron.js.map +0 -1
- package/dist/cli/commands/dlq.d.ts.map +0 -1
- package/dist/cli/commands/dlq.js.map +0 -1
- package/dist/cli/commands/doctor.d.ts.map +0 -1
- package/dist/cli/commands/doctor.js.map +0 -1
- package/dist/cli/commands/job.d.ts.map +0 -1
- package/dist/cli/commands/job.js.map +0 -1
- package/dist/cli/commands/monitor.d.ts.map +0 -1
- package/dist/cli/commands/monitor.js.map +0 -1
- package/dist/cli/commands/queue.d.ts.map +0 -1
- package/dist/cli/commands/queue.js.map +0 -1
- package/dist/cli/commands/rateLimit.d.ts.map +0 -1
- package/dist/cli/commands/rateLimit.js.map +0 -1
- package/dist/cli/commands/server.d.ts.map +0 -1
- package/dist/cli/commands/server.js.map +0 -1
- package/dist/cli/commands/types.d.ts.map +0 -1
- package/dist/cli/commands/types.js.map +0 -1
- package/dist/cli/commands/webhook.d.ts.map +0 -1
- package/dist/cli/commands/webhook.js.map +0 -1
- package/dist/cli/commands/worker.d.ts.map +0 -1
- package/dist/cli/commands/worker.js.map +0 -1
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/output.d.ts.map +0 -1
- package/dist/cli/output.js.map +0 -1
- package/dist/client/bunqueue/aging.d.ts.map +0 -1
- package/dist/client/bunqueue/aging.js.map +0 -1
- package/dist/client/bunqueue/batch.d.ts.map +0 -1
- package/dist/client/bunqueue/batch.js.map +0 -1
- package/dist/client/bunqueue/cancellation.d.ts.map +0 -1
- package/dist/client/bunqueue/cancellation.js.map +0 -1
- package/dist/client/bunqueue/circuitBreaker.d.ts.map +0 -1
- package/dist/client/bunqueue/circuitBreaker.js.map +0 -1
- package/dist/client/bunqueue/dedupDebounce.d.ts.map +0 -1
- package/dist/client/bunqueue/dedupDebounce.js.map +0 -1
- package/dist/client/bunqueue/dlqRateLimit.d.ts.map +0 -1
- package/dist/client/bunqueue/dlqRateLimit.js.map +0 -1
- package/dist/client/bunqueue/retry.d.ts.map +0 -1
- package/dist/client/bunqueue/retry.js.map +0 -1
- package/dist/client/bunqueue/triggers.d.ts.map +0 -1
- package/dist/client/bunqueue/triggers.js.map +0 -1
- package/dist/client/bunqueue/ttl.d.ts.map +0 -1
- package/dist/client/bunqueue/ttl.js.map +0 -1
- package/dist/client/bunqueue/types.d.ts.map +0 -1
- package/dist/client/bunqueue/types.js.map +0 -1
- package/dist/client/bunqueue.d.ts.map +0 -1
- package/dist/client/bunqueue.js.map +0 -1
- package/dist/client/errors.d.ts.map +0 -1
- package/dist/client/errors.js.map +0 -1
- package/dist/client/events.d.ts.map +0 -1
- package/dist/client/events.js.map +0 -1
- package/dist/client/flow.d.ts.map +0 -1
- package/dist/client/flow.js.map +0 -1
- package/dist/client/flowJobFactory.d.ts.map +0 -1
- package/dist/client/flowJobFactory.js.map +0 -1
- package/dist/client/flowPush.d.ts.map +0 -1
- package/dist/client/flowPush.js.map +0 -1
- package/dist/client/flowTypes.d.ts.map +0 -1
- package/dist/client/flowTypes.js.map +0 -1
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/jobConversion.d.ts.map +0 -1
- package/dist/client/jobConversion.js.map +0 -1
- package/dist/client/jobConversionHelpers.d.ts.map +0 -1
- package/dist/client/jobConversionHelpers.js.map +0 -1
- package/dist/client/jobConversionTypes.d.ts.map +0 -1
- package/dist/client/jobConversionTypes.js.map +0 -1
- package/dist/client/jobHelpers.d.ts.map +0 -1
- package/dist/client/jobHelpers.js.map +0 -1
- package/dist/client/manager.d.ts.map +0 -1
- package/dist/client/manager.js.map +0 -1
- package/dist/client/queue/addBatcher.d.ts.map +0 -1
- package/dist/client/queue/addBatcher.js.map +0 -1
- package/dist/client/queue/bullmqCompat.d.ts.map +0 -1
- package/dist/client/queue/bullmqCompat.js.map +0 -1
- package/dist/client/queue/deduplication.d.ts.map +0 -1
- package/dist/client/queue/deduplication.js.map +0 -1
- package/dist/client/queue/dlq.d.ts.map +0 -1
- package/dist/client/queue/dlq.js.map +0 -1
- package/dist/client/queue/dlqOps.d.ts.map +0 -1
- package/dist/client/queue/dlqOps.js.map +0 -1
- package/dist/client/queue/helpers.d.ts.map +0 -1
- package/dist/client/queue/helpers.js.map +0 -1
- package/dist/client/queue/index.d.ts.map +0 -1
- package/dist/client/queue/index.js.map +0 -1
- package/dist/client/queue/jobMove.d.ts.map +0 -1
- package/dist/client/queue/jobMove.js.map +0 -1
- package/dist/client/queue/jobProxy.d.ts.map +0 -1
- package/dist/client/queue/jobProxy.js.map +0 -1
- package/dist/client/queue/operations/add.d.ts.map +0 -1
- package/dist/client/queue/operations/add.js.map +0 -1
- package/dist/client/queue/operations/control.d.ts.map +0 -1
- package/dist/client/queue/operations/control.js.map +0 -1
- package/dist/client/queue/operations/counts.d.ts.map +0 -1
- package/dist/client/queue/operations/counts.js.map +0 -1
- package/dist/client/queue/operations/index.d.ts.map +0 -1
- package/dist/client/queue/operations/index.js.map +0 -1
- package/dist/client/queue/operations/management.d.ts.map +0 -1
- package/dist/client/queue/operations/management.js.map +0 -1
- package/dist/client/queue/operations/query.d.ts.map +0 -1
- package/dist/client/queue/operations/query.js.map +0 -1
- package/dist/client/queue/queue.d.ts.map +0 -1
- package/dist/client/queue/queue.js.map +0 -1
- package/dist/client/queue/queueTypes.d.ts.map +0 -1
- package/dist/client/queue/queueTypes.js.map +0 -1
- package/dist/client/queue/rateLimit.d.ts.map +0 -1
- package/dist/client/queue/rateLimit.js.map +0 -1
- package/dist/client/queue/scheduler.d.ts.map +0 -1
- package/dist/client/queue/scheduler.js.map +0 -1
- package/dist/client/queue/stall.d.ts.map +0 -1
- package/dist/client/queue/stall.js.map +0 -1
- package/dist/client/queue/workers.d.ts.map +0 -1
- package/dist/client/queue/workers.js.map +0 -1
- package/dist/client/queue.d.ts.map +0 -1
- package/dist/client/queue.js.map +0 -1
- package/dist/client/queueGroup.d.ts.map +0 -1
- package/dist/client/queueGroup.js.map +0 -1
- package/dist/client/resolveToken.d.ts.map +0 -1
- package/dist/client/resolveToken.js.map +0 -1
- package/dist/client/sandboxed/index.d.ts.map +0 -1
- package/dist/client/sandboxed/index.js.map +0 -1
- package/dist/client/sandboxed/queueOps.d.ts.map +0 -1
- package/dist/client/sandboxed/queueOps.js.map +0 -1
- package/dist/client/sandboxed/types.d.ts.map +0 -1
- package/dist/client/sandboxed/types.js.map +0 -1
- package/dist/client/sandboxed/worker.d.ts.map +0 -1
- package/dist/client/sandboxed/worker.js.map +0 -1
- package/dist/client/sandboxed/wrapper.d.ts.map +0 -1
- package/dist/client/sandboxed/wrapper.js.map +0 -1
- package/dist/client/sandboxedWorker.d.ts.map +0 -1
- package/dist/client/sandboxedWorker.js.map +0 -1
- package/dist/client/tcp/client.d.ts.map +0 -1
- package/dist/client/tcp/client.js.map +0 -1
- package/dist/client/tcp/connection.d.ts.map +0 -1
- package/dist/client/tcp/connection.js.map +0 -1
- package/dist/client/tcp/health.d.ts.map +0 -1
- package/dist/client/tcp/health.js.map +0 -1
- package/dist/client/tcp/index.d.ts.map +0 -1
- package/dist/client/tcp/index.js.map +0 -1
- package/dist/client/tcp/reconnect.d.ts.map +0 -1
- package/dist/client/tcp/reconnect.js.map +0 -1
- package/dist/client/tcp/shared.d.ts.map +0 -1
- package/dist/client/tcp/shared.js.map +0 -1
- package/dist/client/tcp/types.d.ts.map +0 -1
- package/dist/client/tcp/types.js.map +0 -1
- package/dist/client/tcpClient.d.ts.map +0 -1
- package/dist/client/tcpClient.js.map +0 -1
- package/dist/client/tcpPool.d.ts.map +0 -1
- package/dist/client/tcpPool.js.map +0 -1
- package/dist/client/types.d.ts.map +0 -1
- package/dist/client/types.js.map +0 -1
- package/dist/client/worker/ackBatcher.d.ts.map +0 -1
- package/dist/client/worker/ackBatcher.js.map +0 -1
- package/dist/client/worker/groupConcurrency.d.ts.map +0 -1
- package/dist/client/worker/groupConcurrency.js.map +0 -1
- package/dist/client/worker/index.d.ts.map +0 -1
- package/dist/client/worker/index.js.map +0 -1
- package/dist/client/worker/jobParser.d.ts.map +0 -1
- package/dist/client/worker/jobParser.js.map +0 -1
- package/dist/client/worker/processor.d.ts.map +0 -1
- package/dist/client/worker/processor.js.map +0 -1
- package/dist/client/worker/types.d.ts.map +0 -1
- package/dist/client/worker/types.js.map +0 -1
- package/dist/client/worker/worker.d.ts.map +0 -1
- package/dist/client/worker/worker.js.map +0 -1
- package/dist/client/worker/workerHeartbeat.d.ts.map +0 -1
- package/dist/client/worker/workerHeartbeat.js.map +0 -1
- package/dist/client/worker/workerPull.d.ts.map +0 -1
- package/dist/client/worker/workerPull.js.map +0 -1
- package/dist/client/worker/workerRateLimiter.d.ts.map +0 -1
- package/dist/client/worker/workerRateLimiter.js.map +0 -1
- package/dist/client/worker.d.ts.map +0 -1
- package/dist/client/worker.js.map +0 -1
- package/dist/client/workflow/emitter.d.ts.map +0 -1
- package/dist/client/workflow/emitter.js.map +0 -1
- package/dist/client/workflow/engine.d.ts.map +0 -1
- package/dist/client/workflow/engine.js.map +0 -1
- package/dist/client/workflow/executor.d.ts.map +0 -1
- package/dist/client/workflow/executor.js.map +0 -1
- package/dist/client/workflow/index.d.ts.map +0 -1
- package/dist/client/workflow/index.js.map +0 -1
- package/dist/client/workflow/loops.d.ts.map +0 -1
- package/dist/client/workflow/loops.js.map +0 -1
- package/dist/client/workflow/runner.d.ts.map +0 -1
- package/dist/client/workflow/runner.js.map +0 -1
- package/dist/client/workflow/store.d.ts.map +0 -1
- package/dist/client/workflow/store.js.map +0 -1
- package/dist/client/workflow/types.d.ts.map +0 -1
- package/dist/client/workflow/types.js.map +0 -1
- package/dist/client/workflow/workflow.d.ts.map +0 -1
- package/dist/client/workflow/workflow.js.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/loader.d.ts.map +0 -1
- package/dist/config/loader.js.map +0 -1
- package/dist/config/resolve.d.ts.map +0 -1
- package/dist/config/resolve.js.map +0 -1
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js.map +0 -1
- package/dist/domain/queue/dependencyTracker.d.ts.map +0 -1
- package/dist/domain/queue/dependencyTracker.js.map +0 -1
- package/dist/domain/queue/dlqShard.d.ts.map +0 -1
- package/dist/domain/queue/dlqShard.js.map +0 -1
- package/dist/domain/queue/index.d.ts.map +0 -1
- package/dist/domain/queue/index.js.map +0 -1
- package/dist/domain/queue/limiterManager.d.ts.map +0 -1
- package/dist/domain/queue/limiterManager.js.map +0 -1
- package/dist/domain/queue/priorityQueue.d.ts.map +0 -1
- package/dist/domain/queue/priorityQueue.js.map +0 -1
- package/dist/domain/queue/shard.d.ts.map +0 -1
- package/dist/domain/queue/shard.js.map +0 -1
- package/dist/domain/queue/shardCounters.d.ts.map +0 -1
- package/dist/domain/queue/shardCounters.js.map +0 -1
- package/dist/domain/queue/temporalManager.d.ts.map +0 -1
- package/dist/domain/queue/temporalManager.js.map +0 -1
- package/dist/domain/queue/uniqueKeyManager.d.ts.map +0 -1
- package/dist/domain/queue/uniqueKeyManager.js.map +0 -1
- package/dist/domain/queue/waiterManager.d.ts.map +0 -1
- package/dist/domain/queue/waiterManager.js.map +0 -1
- package/dist/domain/types/command.d.ts.map +0 -1
- package/dist/domain/types/command.js.map +0 -1
- package/dist/domain/types/cron.d.ts.map +0 -1
- package/dist/domain/types/cron.js.map +0 -1
- package/dist/domain/types/deduplication.d.ts.map +0 -1
- package/dist/domain/types/deduplication.js.map +0 -1
- package/dist/domain/types/dlq.d.ts.map +0 -1
- package/dist/domain/types/dlq.js.map +0 -1
- package/dist/domain/types/index.d.ts.map +0 -1
- package/dist/domain/types/index.js.map +0 -1
- package/dist/domain/types/job.d.ts.map +0 -1
- package/dist/domain/types/job.js.map +0 -1
- package/dist/domain/types/queue.d.ts.map +0 -1
- package/dist/domain/types/queue.js.map +0 -1
- package/dist/domain/types/response.d.ts.map +0 -1
- package/dist/domain/types/response.js.map +0 -1
- package/dist/domain/types/stall.d.ts.map +0 -1
- package/dist/domain/types/stall.js.map +0 -1
- package/dist/domain/types/webhook.d.ts.map +0 -1
- package/dist/domain/types/webhook.js.map +0 -1
- package/dist/domain/types/worker.d.ts.map +0 -1
- package/dist/domain/types/worker.js.map +0 -1
- package/dist/infrastructure/backup/index.d.ts.map +0 -1
- package/dist/infrastructure/backup/index.js.map +0 -1
- package/dist/infrastructure/backup/s3Backup.d.ts.map +0 -1
- package/dist/infrastructure/backup/s3Backup.js.map +0 -1
- package/dist/infrastructure/backup/s3BackupConfig.d.ts.map +0 -1
- package/dist/infrastructure/backup/s3BackupConfig.js.map +0 -1
- package/dist/infrastructure/backup/s3BackupOperations.d.ts.map +0 -1
- package/dist/infrastructure/backup/s3BackupOperations.js.map +0 -1
- package/dist/infrastructure/cloud/buffer.d.ts.map +0 -1
- package/dist/infrastructure/cloud/buffer.js.map +0 -1
- package/dist/infrastructure/cloud/circuitBreaker.d.ts.map +0 -1
- package/dist/infrastructure/cloud/circuitBreaker.js.map +0 -1
- package/dist/infrastructure/cloud/cloudAgent 2.d.ts +0 -55
- package/dist/infrastructure/cloud/cloudAgent 2.d.ts.map +0 -1
- package/dist/infrastructure/cloud/cloudAgent 2.js +0 -243
- package/dist/infrastructure/cloud/cloudAgent 2.js.map +0 -1
- package/dist/infrastructure/cloud/cloudAgent.d.ts.map +0 -1
- package/dist/infrastructure/cloud/cloudAgent.js.map +0 -1
- package/dist/infrastructure/cloud/commandHandler 2.d.ts +0 -52
- package/dist/infrastructure/cloud/commandHandler 2.d.ts.map +0 -1
- package/dist/infrastructure/cloud/commandHandler 2.js +0 -84
- package/dist/infrastructure/cloud/commandHandler 2.js.map +0 -1
- package/dist/infrastructure/cloud/commandHandler.d.ts.map +0 -1
- package/dist/infrastructure/cloud/commandHandler.js.map +0 -1
- package/dist/infrastructure/cloud/commands 2.d.ts +0 -11
- package/dist/infrastructure/cloud/commands 2.d.ts.map +0 -1
- package/dist/infrastructure/cloud/commands 2.js +0 -343
- package/dist/infrastructure/cloud/commands 2.js.map +0 -1
- package/dist/infrastructure/cloud/commands.d.ts.map +0 -1
- package/dist/infrastructure/cloud/commands.js.map +0 -1
- package/dist/infrastructure/cloud/config.d.ts.map +0 -1
- package/dist/infrastructure/cloud/config.js.map +0 -1
- package/dist/infrastructure/cloud/httpSender.d.ts.map +0 -1
- package/dist/infrastructure/cloud/httpSender.js.map +0 -1
- package/dist/infrastructure/cloud/index.d.ts.map +0 -1
- package/dist/infrastructure/cloud/index.js.map +0 -1
- package/dist/infrastructure/cloud/instanceId.d.ts +0 -7
- package/dist/infrastructure/cloud/instanceId.d.ts.map +0 -1
- package/dist/infrastructure/cloud/instanceId.js +0 -34
- package/dist/infrastructure/cloud/instanceId.js.map +0 -1
- package/dist/infrastructure/cloud/logger.d.ts.map +0 -1
- package/dist/infrastructure/cloud/logger.js.map +0 -1
- package/dist/infrastructure/cloud/snapshotCollector.d.ts.map +0 -1
- package/dist/infrastructure/cloud/snapshotCollector.js.map +0 -1
- package/dist/infrastructure/cloud/snapshotHelpers.d.ts.map +0 -1
- package/dist/infrastructure/cloud/snapshotHelpers.js.map +0 -1
- package/dist/infrastructure/cloud/statsRefresh.d.ts.map +0 -1
- package/dist/infrastructure/cloud/statsRefresh.js.map +0 -1
- package/dist/infrastructure/cloud/statsUpdate.d.ts.map +0 -1
- package/dist/infrastructure/cloud/statsUpdate.js.map +0 -1
- package/dist/infrastructure/cloud/types.d.ts.map +0 -1
- package/dist/infrastructure/cloud/types.js.map +0 -1
- package/dist/infrastructure/cloud/wsSender.d.ts.map +0 -1
- package/dist/infrastructure/cloud/wsSender.js.map +0 -1
- package/dist/infrastructure/persistence/index.d.ts.map +0 -1
- package/dist/infrastructure/persistence/index.js.map +0 -1
- package/dist/infrastructure/persistence/schema.d.ts.map +0 -1
- package/dist/infrastructure/persistence/schema.js.map +0 -1
- package/dist/infrastructure/persistence/sqlite.d.ts.map +0 -1
- package/dist/infrastructure/persistence/sqlite.js.map +0 -1
- package/dist/infrastructure/persistence/sqliteBatch.d.ts.map +0 -1
- package/dist/infrastructure/persistence/sqliteBatch.js.map +0 -1
- package/dist/infrastructure/persistence/sqliteSerializer.d.ts.map +0 -1
- package/dist/infrastructure/persistence/sqliteSerializer.js.map +0 -1
- package/dist/infrastructure/persistence/statements.d.ts.map +0 -1
- package/dist/infrastructure/persistence/statements.js.map +0 -1
- package/dist/infrastructure/scheduler/cronParser.d.ts.map +0 -1
- package/dist/infrastructure/scheduler/cronParser.js.map +0 -1
- package/dist/infrastructure/scheduler/cronScheduler.d.ts.map +0 -1
- package/dist/infrastructure/scheduler/cronScheduler.js.map +0 -1
- package/dist/infrastructure/scheduler/index.d.ts.map +0 -1
- package/dist/infrastructure/scheduler/index.js.map +0 -1
- package/dist/infrastructure/server/handler.d.ts.map +0 -1
- package/dist/infrastructure/server/handler.js.map +0 -1
- package/dist/infrastructure/server/handlerRoutes.d.ts.map +0 -1
- package/dist/infrastructure/server/handlerRoutes.js.map +0 -1
- package/dist/infrastructure/server/handlers/advanced.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/advanced.js.map +0 -1
- package/dist/infrastructure/server/handlers/core.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/core.js.map +0 -1
- package/dist/infrastructure/server/handlers/cron.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/cron.js.map +0 -1
- package/dist/infrastructure/server/handlers/dashboard.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/dashboard.js.map +0 -1
- package/dist/infrastructure/server/handlers/dlq.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/dlq.js.map +0 -1
- package/dist/infrastructure/server/handlers/index.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/index.js.map +0 -1
- package/dist/infrastructure/server/handlers/management.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/management.js.map +0 -1
- package/dist/infrastructure/server/handlers/monitoring.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/monitoring.js.map +0 -1
- package/dist/infrastructure/server/handlers/query.d.ts.map +0 -1
- package/dist/infrastructure/server/handlers/query.js.map +0 -1
- package/dist/infrastructure/server/http.d.ts.map +0 -1
- package/dist/infrastructure/server/http.js.map +0 -1
- package/dist/infrastructure/server/httpEndpoints.d.ts.map +0 -1
- package/dist/infrastructure/server/httpEndpoints.js.map +0 -1
- package/dist/infrastructure/server/httpRouteJobs.d.ts.map +0 -1
- package/dist/infrastructure/server/httpRouteJobs.js.map +0 -1
- package/dist/infrastructure/server/httpRouteQueueConfig.d.ts.map +0 -1
- package/dist/infrastructure/server/httpRouteQueueConfig.js.map +0 -1
- package/dist/infrastructure/server/httpRouteQueues.d.ts.map +0 -1
- package/dist/infrastructure/server/httpRouteQueues.js.map +0 -1
- package/dist/infrastructure/server/httpRouteResources.d.ts.map +0 -1
- package/dist/infrastructure/server/httpRouteResources.js.map +0 -1
- package/dist/infrastructure/server/index.d.ts.map +0 -1
- package/dist/infrastructure/server/index.js.map +0 -1
- package/dist/infrastructure/server/protocol.d.ts.map +0 -1
- package/dist/infrastructure/server/protocol.js.map +0 -1
- package/dist/infrastructure/server/rateLimiter.d.ts.map +0 -1
- package/dist/infrastructure/server/rateLimiter.js.map +0 -1
- package/dist/infrastructure/server/sseHandler.d.ts.map +0 -1
- package/dist/infrastructure/server/sseHandler.js.map +0 -1
- package/dist/infrastructure/server/tcp.d.ts.map +0 -1
- package/dist/infrastructure/server/tcp.js.map +0 -1
- package/dist/infrastructure/server/types.d.ts.map +0 -1
- package/dist/infrastructure/server/types.js.map +0 -1
- package/dist/infrastructure/server/wsHandler.d.ts.map +0 -1
- package/dist/infrastructure/server/wsHandler.js.map +0 -1
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/mcp/adapter.d.ts.map +0 -1
- package/dist/mcp/adapter.js.map +0 -1
- package/dist/mcp/httpHandler.d.ts.map +0 -1
- package/dist/mcp/httpHandler.js.map +0 -1
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/mcpHandlers.d.ts +0 -129
- package/dist/mcp/mcpHandlers.d.ts.map +0 -1
- package/dist/mcp/mcpHandlers.js +0 -204
- package/dist/mcp/mcpHandlers.js.map +0 -1
- package/dist/mcp/mcpTools.d.ts +0 -15
- package/dist/mcp/mcpTools.d.ts.map +0 -1
- package/dist/mcp/mcpTools.js +0 -277
- package/dist/mcp/mcpTools.js.map +0 -1
- package/dist/mcp/prompts.d.ts.map +0 -1
- package/dist/mcp/prompts.js.map +0 -1
- package/dist/mcp/resources.d.ts.map +0 -1
- package/dist/mcp/resources.js.map +0 -1
- package/dist/mcp/tools/consumptionTools.d.ts.map +0 -1
- package/dist/mcp/tools/consumptionTools.js.map +0 -1
- package/dist/mcp/tools/cronTools.d.ts.map +0 -1
- package/dist/mcp/tools/cronTools.js.map +0 -1
- package/dist/mcp/tools/dlqTools.d.ts.map +0 -1
- package/dist/mcp/tools/dlqTools.js.map +0 -1
- package/dist/mcp/tools/flowTools.d.ts.map +0 -1
- package/dist/mcp/tools/flowTools.js.map +0 -1
- package/dist/mcp/tools/handlerTools.d.ts.map +0 -1
- package/dist/mcp/tools/handlerTools.js.map +0 -1
- package/dist/mcp/tools/jobMgmtTools.d.ts.map +0 -1
- package/dist/mcp/tools/jobMgmtTools.js.map +0 -1
- package/dist/mcp/tools/jobTools.d.ts.map +0 -1
- package/dist/mcp/tools/jobTools.js.map +0 -1
- package/dist/mcp/tools/mcpTracker.d.ts.map +0 -1
- package/dist/mcp/tools/mcpTracker.js.map +0 -1
- package/dist/mcp/tools/monitoringTools.d.ts.map +0 -1
- package/dist/mcp/tools/monitoringTools.js.map +0 -1
- package/dist/mcp/tools/queueTools.d.ts.map +0 -1
- package/dist/mcp/tools/queueTools.js.map +0 -1
- package/dist/mcp/tools/rateLimitTools.d.ts.map +0 -1
- package/dist/mcp/tools/rateLimitTools.js.map +0 -1
- package/dist/mcp/tools/webhookTools.d.ts.map +0 -1
- package/dist/mcp/tools/webhookTools.js.map +0 -1
- package/dist/mcp/tools/withErrorHandler.d.ts.map +0 -1
- package/dist/mcp/tools/withErrorHandler.js.map +0 -1
- package/dist/mcp/tools/workerMgmtTools.d.ts.map +0 -1
- package/dist/mcp/tools/workerMgmtTools.js.map +0 -1
- package/dist/shared/boundedMap.d.ts.map +0 -1
- package/dist/shared/boundedMap.js.map +0 -1
- package/dist/shared/boundedSet.d.ts.map +0 -1
- package/dist/shared/boundedSet.js.map +0 -1
- package/dist/shared/hash.d.ts.map +0 -1
- package/dist/shared/hash.js.map +0 -1
- package/dist/shared/histogram.d.ts.map +0 -1
- package/dist/shared/histogram.js.map +0 -1
- package/dist/shared/index.d.ts.map +0 -1
- package/dist/shared/index.js.map +0 -1
- package/dist/shared/lock.d.ts.map +0 -1
- package/dist/shared/lock.js.map +0 -1
- package/dist/shared/logger.d.ts.map +0 -1
- package/dist/shared/logger.js.map +0 -1
- package/dist/shared/lru.d.ts.map +0 -1
- package/dist/shared/lru.js.map +0 -1
- package/dist/shared/lruMap.d.ts.map +0 -1
- package/dist/shared/lruMap.js.map +0 -1
- package/dist/shared/lruSet.d.ts.map +0 -1
- package/dist/shared/lruSet.js.map +0 -1
- package/dist/shared/minHeap.d.ts.map +0 -1
- package/dist/shared/minHeap.js.map +0 -1
- package/dist/shared/semaphore.d.ts.map +0 -1
- package/dist/shared/semaphore.js.map +0 -1
- package/dist/shared/serialization.d.ts.map +0 -1
- package/dist/shared/serialization.js.map +0 -1
- package/dist/shared/skipList.d.ts.map +0 -1
- package/dist/shared/skipList.js.map +0 -1
- package/dist/shared/ttlMap.d.ts.map +0 -1
- package/dist/shared/ttlMap.js.map +0 -1
- package/dist/shared/version.d.ts.map +0 -1
- package/dist/shared/version.js.map +0 -1
- package/dist/shared/webhookValidation.d.ts.map +0 -1
- package/dist/shared/webhookValidation.js.map +0 -1
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { executeStepWithRetry, executeParallelSteps, executeSubWorkflow,
|
|
1
|
+
import { executeStepWithRetry, executeParallelSteps, executeSubWorkflow, buildContext, } from './runner';
|
|
2
2
|
import { executeDoUntil, executeDoWhile, executeForEach, executeMap } from './loops';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor(event) {
|
|
6
|
-
super(`Waiting for signal: ${event}`);
|
|
7
|
-
this.event = event;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
3
|
+
import { WaitForSignalError, runCompensation } from './compensator';
|
|
4
|
+
import { recoverExecutions } from './recovery';
|
|
10
5
|
export class WorkflowExecutor {
|
|
11
6
|
store;
|
|
12
7
|
queue;
|
|
13
8
|
emitter;
|
|
14
9
|
workflows = new Map();
|
|
15
10
|
timeoutTimers = new Map();
|
|
11
|
+
updateFn;
|
|
16
12
|
constructor(store, queue, emitter = null) {
|
|
17
13
|
this.store = store;
|
|
18
14
|
this.queue = queue;
|
|
19
15
|
this.emitter = emitter;
|
|
16
|
+
this.updateFn = (e) => {
|
|
17
|
+
this.store.update(e);
|
|
18
|
+
};
|
|
20
19
|
}
|
|
21
20
|
register(workflow) {
|
|
22
21
|
const names = workflow.getStepNames();
|
|
@@ -33,8 +32,9 @@ export class WorkflowExecutor {
|
|
|
33
32
|
if (wf.nodes.length === 0)
|
|
34
33
|
throw new Error(`Workflow "${workflowName}" has no steps`);
|
|
35
34
|
const now = Date.now();
|
|
35
|
+
const id = `wf_${now}_${Math.random().toString(36).slice(2, 10)}`;
|
|
36
36
|
const exec = {
|
|
37
|
-
id
|
|
37
|
+
id,
|
|
38
38
|
workflowName,
|
|
39
39
|
state: 'running',
|
|
40
40
|
input,
|
|
@@ -45,9 +45,9 @@ export class WorkflowExecutor {
|
|
|
45
45
|
updatedAt: now,
|
|
46
46
|
};
|
|
47
47
|
this.store.save(exec);
|
|
48
|
-
this.emitter?.emitWorkflow('workflow:started',
|
|
48
|
+
this.emitter?.emitWorkflow('workflow:started', id, workflowName, 'running', { input });
|
|
49
49
|
await this.enqueue(exec);
|
|
50
|
-
return { id
|
|
50
|
+
return { id, workflowName };
|
|
51
51
|
}
|
|
52
52
|
async processStep(data) {
|
|
53
53
|
const exec = this.store.get(data.executionId);
|
|
@@ -84,7 +84,6 @@ export class WorkflowExecutor {
|
|
|
84
84
|
const exec = this.store.get(executionId);
|
|
85
85
|
if (!exec)
|
|
86
86
|
throw new Error(`Execution "${executionId}" not found`);
|
|
87
|
-
// Cancel any pending timeout timer for this execution
|
|
88
87
|
const timer = this.timeoutTimers.get(executionId);
|
|
89
88
|
if (timer) {
|
|
90
89
|
clearTimeout(timer);
|
|
@@ -99,8 +98,8 @@ export class WorkflowExecutor {
|
|
|
99
98
|
getExecution(id) {
|
|
100
99
|
return this.store.get(id);
|
|
101
100
|
}
|
|
102
|
-
listExecutions(
|
|
103
|
-
return this.store.list(
|
|
101
|
+
listExecutions(wfName, state) {
|
|
102
|
+
return this.store.list(wfName, state);
|
|
104
103
|
}
|
|
105
104
|
async executeNode(exec, node, idx, wf) {
|
|
106
105
|
if (node.type === 'step')
|
|
@@ -124,9 +123,7 @@ export class WorkflowExecutor {
|
|
|
124
123
|
}
|
|
125
124
|
async runStep(exec, def, idx, wf) {
|
|
126
125
|
const ctx = buildContext(exec);
|
|
127
|
-
await executeStepWithRetry(def, ctx, exec, this.emitter,
|
|
128
|
-
this.store.update(e);
|
|
129
|
-
});
|
|
126
|
+
await executeStepWithRetry(def, ctx, exec, this.emitter, this.updateFn);
|
|
130
127
|
await this.advance(exec, idx + 1, wf);
|
|
131
128
|
}
|
|
132
129
|
async runBranch(exec, node, idx, wf) {
|
|
@@ -134,17 +131,13 @@ export class WorkflowExecutor {
|
|
|
134
131
|
const pathSteps = node.def.paths.get(pathName);
|
|
135
132
|
if (pathSteps && pathSteps.length > 0) {
|
|
136
133
|
for (const step of pathSteps) {
|
|
137
|
-
await executeStepWithRetry(step, buildContext(exec), exec, this.emitter,
|
|
138
|
-
this.store.update(e);
|
|
139
|
-
});
|
|
134
|
+
await executeStepWithRetry(step, buildContext(exec), exec, this.emitter, this.updateFn);
|
|
140
135
|
}
|
|
141
136
|
}
|
|
142
137
|
await this.advance(exec, idx + 1, wf);
|
|
143
138
|
}
|
|
144
139
|
async runParallel(exec, node, idx, wf) {
|
|
145
|
-
await executeParallelSteps(node.def.steps, buildContext(exec), exec, this.emitter,
|
|
146
|
-
this.store.update(e);
|
|
147
|
-
});
|
|
140
|
+
await executeParallelSteps(node.def.steps, buildContext(exec), exec, this.emitter, this.updateFn);
|
|
148
141
|
await this.advance(exec, idx + 1, wf);
|
|
149
142
|
}
|
|
150
143
|
async runSubWorkflow(exec, node, idx, wf) {
|
|
@@ -162,24 +155,26 @@ export class WorkflowExecutor {
|
|
|
162
155
|
if (node.timeout !== undefined) {
|
|
163
156
|
const existing = exec.steps[waitKey];
|
|
164
157
|
const waitingSince = existing?.startedAt ?? Date.now();
|
|
165
|
-
if (!existing)
|
|
158
|
+
if (!existing)
|
|
166
159
|
exec.steps[waitKey] = { status: 'running', startedAt: waitingSince };
|
|
167
|
-
}
|
|
168
160
|
if (Date.now() - waitingSince >= node.timeout) {
|
|
169
161
|
this.emitter?.emitSignal('signal:timeout', exec.id, exec.workflowName, node.event);
|
|
170
162
|
exec.steps[waitKey] = {
|
|
171
163
|
status: 'failed',
|
|
172
|
-
error: `Signal "${node.event}" timed out after ${node.timeout}ms`,
|
|
173
164
|
startedAt: waitingSince,
|
|
174
165
|
completedAt: Date.now(),
|
|
166
|
+
error: `Signal "${node.event}" timed out after ${node.timeout}ms`,
|
|
175
167
|
};
|
|
176
168
|
exec.state = 'failed';
|
|
177
169
|
this.store.update(exec);
|
|
170
|
+
// Compensate here, then signal completion via the WaitForSignalError
|
|
171
|
+
// sentinel so processStep short-circuits (return null) instead of
|
|
172
|
+
// re-running compensation through its generic catch path.
|
|
178
173
|
await this.compensate(exec, wf);
|
|
179
|
-
|
|
174
|
+
this.emitter?.emitWorkflow('workflow:failed', exec.id, exec.workflowName, 'failed');
|
|
175
|
+
throw new WaitForSignalError(node.event);
|
|
180
176
|
}
|
|
181
177
|
this.store.update(exec);
|
|
182
|
-
// Schedule a timer to re-check after timeout
|
|
183
178
|
const remaining = node.timeout - (Date.now() - waitingSince);
|
|
184
179
|
this.scheduleTimeoutCheck(exec.id, exec.workflowName, exec.currentNodeIndex, remaining);
|
|
185
180
|
}
|
|
@@ -189,21 +184,15 @@ export class WorkflowExecutor {
|
|
|
189
184
|
throw new WaitForSignalError(node.event);
|
|
190
185
|
}
|
|
191
186
|
async runLoop(exec, node, idx, wf, loopFn) {
|
|
192
|
-
await loopFn(node.def, exec, this.emitter,
|
|
193
|
-
this.store.update(e);
|
|
194
|
-
});
|
|
187
|
+
await loopFn(node.def, exec, this.emitter, this.updateFn);
|
|
195
188
|
await this.advance(exec, idx + 1, wf);
|
|
196
189
|
}
|
|
197
190
|
async runForEach(exec, node, idx, wf) {
|
|
198
|
-
await executeForEach(node.def, exec, this.emitter,
|
|
199
|
-
this.store.update(e);
|
|
200
|
-
});
|
|
191
|
+
await executeForEach(node.def, exec, this.emitter, this.updateFn);
|
|
201
192
|
await this.advance(exec, idx + 1, wf);
|
|
202
193
|
}
|
|
203
194
|
async runMap(exec, node, idx, wf) {
|
|
204
|
-
await executeMap(node.def, exec,
|
|
205
|
-
this.store.update(e);
|
|
206
|
-
});
|
|
195
|
+
await executeMap(node.def, exec, this.emitter, this.updateFn);
|
|
207
196
|
await this.advance(exec, idx + 1, wf);
|
|
208
197
|
}
|
|
209
198
|
async advance(exec, nextIdx, wf) {
|
|
@@ -230,33 +219,26 @@ export class WorkflowExecutor {
|
|
|
230
219
|
const timer = setTimeout(() => {
|
|
231
220
|
this.timeoutTimers.delete(execId);
|
|
232
221
|
const jobData = { executionId: execId, workflowName, nodeIndex: nodeIdx };
|
|
233
|
-
this.queue.add('wf:step', jobData).catch(() => {
|
|
222
|
+
this.queue.add('wf:step', jobData).catch(() => {
|
|
223
|
+
/* Queue may be closed */
|
|
224
|
+
});
|
|
234
225
|
}, ms);
|
|
235
226
|
this.timeoutTimers.set(execId, timer);
|
|
236
227
|
}
|
|
237
228
|
async compensate(exec, wf) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
catch {
|
|
254
|
-
// Compensation errors don't stop the chain
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
exec.state = 'failed';
|
|
259
|
-
this.store.update(exec);
|
|
229
|
+
await runCompensation(exec, wf, this.store, this.emitter);
|
|
230
|
+
}
|
|
231
|
+
/** Recover orphaned executions after a crash/restart */
|
|
232
|
+
async recover() {
|
|
233
|
+
return recoverExecutions({
|
|
234
|
+
store: this.store,
|
|
235
|
+
queue: this.queue,
|
|
236
|
+
workflows: this.workflows,
|
|
237
|
+
emitter: this.emitter,
|
|
238
|
+
timeoutTimers: this.timeoutTimers,
|
|
239
|
+
scheduleTimeoutCheck: (id, name, idx, ms) => {
|
|
240
|
+
this.scheduleTimeoutCheck(id, name, idx, ms);
|
|
241
|
+
},
|
|
242
|
+
});
|
|
260
243
|
}
|
|
261
244
|
}
|
|
262
|
-
//# sourceMappingURL=executor.js.map
|
|
@@ -19,5 +19,4 @@
|
|
|
19
19
|
export { Workflow } from './workflow';
|
|
20
20
|
export { Engine } from './engine';
|
|
21
21
|
export { WorkflowEmitter } from './emitter';
|
|
22
|
-
export type { StepContext, StepHandler, CompensateHandler, StepOptions, SchemaLike, Execution, ExecutionState, StepState, StepRecord, EngineOptions, RunHandle, ParallelDefinition, SubWorkflowInputMapper, LoopCondition, ForEachItemsExtractor, MapTransformFn, LoopDefinition, ForEachDefinition, MapDefinition, CleanupOptions, WorkflowEventType, WorkflowEvent, StepEvent, WorkflowLifecycleEvent, SignalEvent, WorkflowEventListener, } from './types';
|
|
23
|
-
//# sourceMappingURL=index.d.ts.map
|
|
22
|
+
export type { StepContext, StepHandler, TypedStepHandler, CompensateHandler, TypedCompensateHandler, StepOptions, SchemaLike, Execution, ExecutionState, StepState, StepRecord, EngineOptions, RunHandle, ParallelDefinition, SubWorkflowInputMapper, LoopCondition, ForEachItemsExtractor, MapTransformFn, LoopDefinition, ForEachDefinition, MapDefinition, RecoverResult, CleanupOptions, WorkflowEventType, WorkflowEvent, StepEvent, WorkflowLifecycleEvent, SignalEvent, WorkflowEventListener, } from './types';
|
|
@@ -11,5 +11,4 @@ export declare function executeDoWhile(def: LoopDefinition, exec: Execution, emi
|
|
|
11
11
|
/** Execute a forEach loop: iterate over items, executing the step for each */
|
|
12
12
|
export declare function executeForEach(def: ForEachDefinition, exec: Execution, emitter: WorkflowEmitter | null, updateFn: (exec: Execution) => void): Promise<void>;
|
|
13
13
|
/** Execute a map node: transform step results into a new value */
|
|
14
|
-
export declare function executeMap(def: MapDefinition, exec: Execution, updateFn: (exec: Execution) => void): Promise<void>;
|
|
15
|
-
//# sourceMappingURL=loops.d.ts.map
|
|
14
|
+
export declare function executeMap(def: MapDefinition, exec: Execution, emitter: WorkflowEmitter | null, updateFn: (exec: Execution) => void): Promise<void>;
|
|
@@ -59,11 +59,19 @@ export async function executeForEach(def, exec, emitter, updateFn) {
|
|
|
59
59
|
};
|
|
60
60
|
const stepCtx = buildContext(exec);
|
|
61
61
|
await executeStepWithRetry(indexedStep, stepCtx, exec, emitter, updateFn);
|
|
62
|
+
// Persist this iteration's __item/__index alongside the step record so
|
|
63
|
+
// saga compensation can restore the correct per-iteration context later.
|
|
64
|
+
// executeStepWithRetry has just written this record (it throws otherwise).
|
|
65
|
+
const record = exec.steps[indexedName];
|
|
66
|
+
record.loopItem = item;
|
|
67
|
+
record.loopIndex = i;
|
|
68
|
+
updateFn(exec);
|
|
62
69
|
}
|
|
63
70
|
}
|
|
64
71
|
/** Execute a map node: transform step results into a new value */
|
|
65
|
-
export async function executeMap(def, exec, updateFn) {
|
|
72
|
+
export async function executeMap(def, exec, emitter, updateFn) {
|
|
66
73
|
const ctx = buildContext(exec);
|
|
74
|
+
emitter?.emitStep('step:started', exec.id, exec.workflowName, def.name);
|
|
67
75
|
const result = await def.transform(ctx);
|
|
68
76
|
exec.steps[def.name] = {
|
|
69
77
|
status: 'completed',
|
|
@@ -72,5 +80,5 @@ export async function executeMap(def, exec, updateFn) {
|
|
|
72
80
|
completedAt: Date.now(),
|
|
73
81
|
};
|
|
74
82
|
updateFn(exec);
|
|
83
|
+
emitter?.emitStep('step:completed', exec.id, exec.workflowName, def.name, { result });
|
|
75
84
|
}
|
|
76
|
-
//# sourceMappingURL=loops.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recovery logic for orphaned workflow executions after crash/restart
|
|
3
|
+
*
|
|
4
|
+
* Handles three states:
|
|
5
|
+
* - 'running': re-enqueue the step at currentNodeIndex
|
|
6
|
+
* - 'waiting': re-arm timeout timer or resume if signal already arrived
|
|
7
|
+
* - 'compensating': re-run compensation from the beginning (must be idempotent)
|
|
8
|
+
*/
|
|
9
|
+
import type { Queue } from '../queue/queue';
|
|
10
|
+
import type { Workflow } from './workflow';
|
|
11
|
+
import type { WorkflowStore } from './store';
|
|
12
|
+
import type { WorkflowEmitter } from './emitter';
|
|
13
|
+
import type { RecoverResult } from './types';
|
|
14
|
+
export interface RecoverDeps {
|
|
15
|
+
store: WorkflowStore;
|
|
16
|
+
queue: Queue;
|
|
17
|
+
workflows: Map<string, Workflow>;
|
|
18
|
+
emitter: WorkflowEmitter | null;
|
|
19
|
+
timeoutTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
20
|
+
scheduleTimeoutCheck: (id: string, wfName: string, nodeIdx: number, ms: number) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function recoverExecutions(deps: RecoverDeps): Promise<RecoverResult>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recovery logic for orphaned workflow executions after crash/restart
|
|
3
|
+
*
|
|
4
|
+
* Handles three states:
|
|
5
|
+
* - 'running': re-enqueue the step at currentNodeIndex
|
|
6
|
+
* - 'waiting': re-arm timeout timer or resume if signal already arrived
|
|
7
|
+
* - 'compensating': re-run compensation from the beginning (must be idempotent)
|
|
8
|
+
*/
|
|
9
|
+
import { runCompensation } from './compensator';
|
|
10
|
+
export async function recoverExecutions(deps) {
|
|
11
|
+
const { store, workflows } = deps;
|
|
12
|
+
const executions = store.listRecoverable();
|
|
13
|
+
const result = { running: 0, waiting: 0, compensating: 0, total: 0 };
|
|
14
|
+
for (const exec of executions) {
|
|
15
|
+
const wf = workflows.get(exec.workflowName);
|
|
16
|
+
if (!wf)
|
|
17
|
+
continue;
|
|
18
|
+
if (exec.state === 'running') {
|
|
19
|
+
await enqueueExecution(exec, deps.queue);
|
|
20
|
+
result.running++;
|
|
21
|
+
}
|
|
22
|
+
else if (exec.state === 'waiting') {
|
|
23
|
+
await recoverWaiting(exec, wf, deps);
|
|
24
|
+
result.waiting++;
|
|
25
|
+
}
|
|
26
|
+
else if (exec.state === 'compensating') {
|
|
27
|
+
await runCompensation(exec, wf, store, deps.emitter);
|
|
28
|
+
result.compensating++;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
result.total = result.running + result.waiting + result.compensating;
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
async function enqueueExecution(exec, queue) {
|
|
35
|
+
const jobData = {
|
|
36
|
+
executionId: exec.id,
|
|
37
|
+
workflowName: exec.workflowName,
|
|
38
|
+
nodeIndex: exec.currentNodeIndex,
|
|
39
|
+
};
|
|
40
|
+
await queue.add('wf:step', jobData);
|
|
41
|
+
}
|
|
42
|
+
async function recoverWaiting(exec, wf, deps) {
|
|
43
|
+
const node = wf.nodes[exec.currentNodeIndex];
|
|
44
|
+
if (node?.type !== 'waitFor') {
|
|
45
|
+
await enqueueExecution(exec, deps.queue);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// Check if signal already arrived while we were down
|
|
49
|
+
if (exec.signals[node.event] !== undefined) {
|
|
50
|
+
exec.state = 'running';
|
|
51
|
+
deps.store.update(exec);
|
|
52
|
+
await enqueueExecution(exec, deps.queue);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
// Re-arm timeout if configured
|
|
56
|
+
if (node.timeout !== undefined) {
|
|
57
|
+
if (deps.timeoutTimers.has(exec.id))
|
|
58
|
+
return;
|
|
59
|
+
const waitKey = `__waitFor:${node.event}`;
|
|
60
|
+
const waitRecord = exec.steps[waitKey];
|
|
61
|
+
const waitingSince = waitRecord?.startedAt ?? exec.updatedAt;
|
|
62
|
+
const elapsed = Date.now() - waitingSince;
|
|
63
|
+
const remaining = node.timeout - elapsed;
|
|
64
|
+
if (remaining <= 0) {
|
|
65
|
+
exec.state = 'running';
|
|
66
|
+
deps.store.update(exec);
|
|
67
|
+
await enqueueExecution(exec, deps.queue);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
deps.scheduleTimeoutCheck(exec.id, exec.workflowName, exec.currentNodeIndex, remaining);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -18,4 +18,3 @@ export declare function executeSubWorkflow(workflowName: string, input: unknown,
|
|
|
18
18
|
export declare function findStepDef(wf: Workflow, name: string): StepDefinition | null;
|
|
19
19
|
/** Build a StepContext from the current execution state */
|
|
20
20
|
export declare function buildContext(exec: Execution): StepContext;
|
|
21
|
-
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -109,9 +109,8 @@ export async function executeParallelSteps(steps, ctx, exec, emitter, updateFn)
|
|
|
109
109
|
const results = await Promise.allSettled(steps.map((def) => executeStepWithRetry(def, ctx, exec, emitter, updateFn)));
|
|
110
110
|
const failed = results.filter((r) => r.status === 'rejected');
|
|
111
111
|
if (failed.length > 0) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
: new Error(String(failed[0].reason));
|
|
112
|
+
const errors = failed.map((r) => r.reason instanceof Error ? r.reason : new Error(String(r.reason)));
|
|
113
|
+
throw new AggregateError(errors, errors[0].message);
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
/** Execute a sub-workflow by starting it and polling for completion */
|
|
@@ -158,8 +157,11 @@ export function findStepDef(wf, name) {
|
|
|
158
157
|
if (found)
|
|
159
158
|
return found;
|
|
160
159
|
}
|
|
161
|
-
if (node.type === 'forEach'
|
|
162
|
-
|
|
160
|
+
if (node.type === 'forEach') {
|
|
161
|
+
if (node.def.step.name === name || name.startsWith(node.def.step.name + ':')) {
|
|
162
|
+
return node.def.step;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
163
165
|
}
|
|
164
166
|
return null;
|
|
165
167
|
}
|
|
@@ -177,4 +179,3 @@ export function buildContext(exec) {
|
|
|
177
179
|
executionId: exec.id,
|
|
178
180
|
};
|
|
179
181
|
}
|
|
180
|
-
//# sourceMappingURL=runner.js.map
|
|
@@ -10,6 +10,8 @@ export declare class WorkflowStore {
|
|
|
10
10
|
get(id: string): Execution | null;
|
|
11
11
|
update(exec: Execution): void;
|
|
12
12
|
list(workflowName?: string, state?: ExecutionState): Execution[];
|
|
13
|
+
/** List all executions in recoverable states (running, waiting, compensating) */
|
|
14
|
+
listRecoverable(): Execution[];
|
|
13
15
|
/** Delete executions older than maxAge in terminal states */
|
|
14
16
|
cleanup(maxAgeMs: number, states?: string[]): number;
|
|
15
17
|
/** Archive executions older than maxAge to the archive table */
|
|
@@ -19,4 +21,3 @@ export declare class WorkflowStore {
|
|
|
19
21
|
close(): void;
|
|
20
22
|
private rowToExecution;
|
|
21
23
|
}
|
|
22
|
-
//# sourceMappingURL=store.d.ts.map
|
|
@@ -68,6 +68,7 @@ export class WorkflowStore {
|
|
|
68
68
|
listByName: this.db.prepare(`SELECT * FROM workflow_executions WHERE workflow_name = ? ORDER BY created_at DESC LIMIT 100`),
|
|
69
69
|
listByState: this.db.prepare(`SELECT * FROM workflow_executions WHERE state = ? ORDER BY created_at DESC LIMIT 100`),
|
|
70
70
|
listByBoth: this.db.prepare(`SELECT * FROM workflow_executions WHERE workflow_name = ? AND state = ? ORDER BY created_at DESC LIMIT 100`),
|
|
71
|
+
listRecoverable: this.db.prepare(`SELECT * FROM workflow_executions WHERE state IN ('running', 'waiting', 'compensating') ORDER BY updated_at ASC`),
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
save(exec) {
|
|
@@ -97,6 +98,11 @@ export class WorkflowStore {
|
|
|
97
98
|
}
|
|
98
99
|
return rows.map((r) => this.rowToExecution(r));
|
|
99
100
|
}
|
|
101
|
+
/** List all executions in recoverable states (running, waiting, compensating) */
|
|
102
|
+
listRecoverable() {
|
|
103
|
+
const rows = this.stmts.listRecoverable.all();
|
|
104
|
+
return rows.map((r) => this.rowToExecution(r));
|
|
105
|
+
}
|
|
100
106
|
/** Delete executions older than maxAge in terminal states */
|
|
101
107
|
cleanup(maxAgeMs, states = ['completed', 'failed']) {
|
|
102
108
|
const cutoff = Date.now() - maxAgeMs;
|
|
@@ -157,4 +163,3 @@ export class WorkflowStore {
|
|
|
157
163
|
};
|
|
158
164
|
}
|
|
159
165
|
}
|
|
160
|
-
//# sourceMappingURL=store.js.map
|
|
@@ -3,29 +3,33 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ConnectionOptions } from '../types';
|
|
5
5
|
/** Context passed to step handlers */
|
|
6
|
-
export interface StepContext<TInput = unknown> {
|
|
6
|
+
export interface StepContext<TInput = unknown, TSteps extends Record<string, unknown> = Record<string, unknown>> {
|
|
7
7
|
/** Original workflow input */
|
|
8
8
|
readonly input: TInput;
|
|
9
9
|
/** Results from completed steps (step name → result) */
|
|
10
|
-
readonly steps: Readonly<
|
|
10
|
+
readonly steps: Readonly<TSteps>;
|
|
11
11
|
/** Signals received via engine.signal() */
|
|
12
12
|
readonly signals: Readonly<Record<string, unknown>>;
|
|
13
13
|
/** Current execution ID */
|
|
14
14
|
readonly executionId: string;
|
|
15
15
|
}
|
|
16
|
-
/** Step handler function */
|
|
17
|
-
export type StepHandler<TInput = unknown, TResult = unknown> = (ctx: StepContext<TInput>) => Promise<TResult> | TResult;
|
|
18
|
-
/**
|
|
19
|
-
export type
|
|
16
|
+
/** Step handler function (type-erased for internal storage) */
|
|
17
|
+
export type StepHandler<TInput = unknown, TResult = unknown> = (ctx: StepContext<TInput, any>) => Promise<TResult> | TResult;
|
|
18
|
+
/** Typed step handler — preserves accumulated step types */
|
|
19
|
+
export type TypedStepHandler<TInput, TSteps extends Record<string, unknown>, TResult> = (ctx: StepContext<TInput, TSteps>) => Promise<TResult> | TResult;
|
|
20
|
+
/** Compensate handler (type-erased for internal storage) */
|
|
21
|
+
export type CompensateHandler<TInput = unknown> = (ctx: StepContext<TInput, any>) => Promise<void> | void;
|
|
22
|
+
/** Typed compensate handler — preserves accumulated step types */
|
|
23
|
+
export type TypedCompensateHandler<TInput, TSteps extends Record<string, unknown>> = (ctx: StepContext<TInput, TSteps>) => Promise<void> | void;
|
|
20
24
|
/** Schema-like object — any object with a .parse() method (Zod, ArkType, Valibot, etc.) */
|
|
21
25
|
export interface SchemaLike {
|
|
22
26
|
parse(data: unknown): unknown;
|
|
23
27
|
}
|
|
24
28
|
/** Options for a single step */
|
|
25
|
-
export interface StepOptions<TInput = unknown> {
|
|
29
|
+
export interface StepOptions<TInput = unknown, TSteps extends Record<string, unknown> = Record<string, unknown>> {
|
|
26
30
|
retry?: number;
|
|
27
31
|
timeout?: number;
|
|
28
|
-
compensate?: CompensateHandler<TInput>;
|
|
32
|
+
compensate?: TypedCompensateHandler<TInput, TSteps> | CompensateHandler<TInput>;
|
|
29
33
|
/** Validate step input before execution */
|
|
30
34
|
inputSchema?: SchemaLike;
|
|
31
35
|
/** Validate step output after execution */
|
|
@@ -42,10 +46,10 @@ export interface StepDefinition {
|
|
|
42
46
|
outputSchema?: SchemaLike;
|
|
43
47
|
}
|
|
44
48
|
/** Branch condition function */
|
|
45
|
-
export type BranchCondition = (ctx: StepContext) => string;
|
|
46
|
-
/** Internal branch definition */
|
|
49
|
+
export type BranchCondition<TInput = unknown, TSteps extends Record<string, unknown> = Record<string, unknown>> = (ctx: StepContext<TInput, TSteps>) => string;
|
|
50
|
+
/** Internal branch definition (type-erased) */
|
|
47
51
|
export interface BranchDefinition {
|
|
48
|
-
condition: BranchCondition
|
|
52
|
+
condition: BranchCondition<any, any>;
|
|
49
53
|
paths: Map<string, StepDefinition[]>;
|
|
50
54
|
}
|
|
51
55
|
/** Definition of a parallel step group */
|
|
@@ -53,29 +57,29 @@ export interface ParallelDefinition {
|
|
|
53
57
|
steps: StepDefinition[];
|
|
54
58
|
}
|
|
55
59
|
/** Input mapper for sub-workflows */
|
|
56
|
-
export type SubWorkflowInputMapper = (ctx: StepContext) => unknown;
|
|
60
|
+
export type SubWorkflowInputMapper<TInput = unknown, TSteps extends Record<string, unknown> = Record<string, unknown>> = (ctx: StepContext<TInput, TSteps>) => unknown;
|
|
57
61
|
/** Loop condition: receives context + iteration count, returns boolean */
|
|
58
|
-
export type LoopCondition = (ctx: StepContext, iteration: number) => boolean | Promise<boolean>;
|
|
59
|
-
/** Definition of a doUntil/doWhile loop */
|
|
62
|
+
export type LoopCondition<TInput = unknown, TSteps extends Record<string, unknown> = Record<string, unknown>> = (ctx: StepContext<TInput, TSteps>, iteration: number) => boolean | Promise<boolean>;
|
|
63
|
+
/** Definition of a doUntil/doWhile loop (type-erased) */
|
|
60
64
|
export interface LoopDefinition {
|
|
61
|
-
condition: LoopCondition
|
|
65
|
+
condition: LoopCondition<any, any>;
|
|
62
66
|
steps: StepDefinition[];
|
|
63
67
|
maxIterations: number;
|
|
64
68
|
}
|
|
65
69
|
/** Item extractor for forEach */
|
|
66
|
-
export type ForEachItemsExtractor = (ctx: StepContext) => unknown[];
|
|
67
|
-
/** Definition of a forEach loop */
|
|
70
|
+
export type ForEachItemsExtractor<TInput = unknown, TSteps extends Record<string, unknown> = Record<string, unknown>> = (ctx: StepContext<TInput, TSteps>) => unknown[];
|
|
71
|
+
/** Definition of a forEach loop (type-erased) */
|
|
68
72
|
export interface ForEachDefinition {
|
|
69
|
-
items: ForEachItemsExtractor
|
|
73
|
+
items: ForEachItemsExtractor<any, any>;
|
|
70
74
|
step: StepDefinition;
|
|
71
75
|
maxIterations: number;
|
|
72
76
|
}
|
|
73
77
|
/** Transform function for map */
|
|
74
|
-
export type MapTransformFn = (ctx: StepContext) => unknown;
|
|
75
|
-
/** Definition of a map node */
|
|
78
|
+
export type MapTransformFn<TInput = unknown, TSteps extends Record<string, unknown> = Record<string, unknown>> = (ctx: StepContext<TInput, TSteps>) => unknown;
|
|
79
|
+
/** Definition of a map node (type-erased) */
|
|
76
80
|
export interface MapDefinition {
|
|
77
81
|
name: string;
|
|
78
|
-
transform: MapTransformFn
|
|
82
|
+
transform: MapTransformFn<any, any>;
|
|
79
83
|
}
|
|
80
84
|
/** Workflow node (discriminated union) */
|
|
81
85
|
export type WorkflowNode = {
|
|
@@ -94,7 +98,7 @@ export type WorkflowNode = {
|
|
|
94
98
|
} | {
|
|
95
99
|
type: 'subWorkflow';
|
|
96
100
|
name: string;
|
|
97
|
-
inputMapper: SubWorkflowInputMapper
|
|
101
|
+
inputMapper: SubWorkflowInputMapper<any, any>;
|
|
98
102
|
} | {
|
|
99
103
|
type: 'doUntil';
|
|
100
104
|
def: LoopDefinition;
|
|
@@ -120,6 +124,10 @@ export interface StepRecord {
|
|
|
120
124
|
startedAt?: number;
|
|
121
125
|
completedAt?: number;
|
|
122
126
|
attempts?: number;
|
|
127
|
+
/** forEach iteration item — persisted so compensation can restore __item */
|
|
128
|
+
loopItem?: unknown;
|
|
129
|
+
/** forEach iteration index — persisted so compensation can restore __index */
|
|
130
|
+
loopIndex?: number;
|
|
123
131
|
}
|
|
124
132
|
/** Full execution state */
|
|
125
133
|
export interface Execution {
|
|
@@ -187,9 +195,19 @@ export interface StepJobData {
|
|
|
187
195
|
workflowName: string;
|
|
188
196
|
nodeIndex: number;
|
|
189
197
|
}
|
|
198
|
+
/** Result of engine.recover() */
|
|
199
|
+
export interface RecoverResult {
|
|
200
|
+
/** Number of running executions re-enqueued */
|
|
201
|
+
running: number;
|
|
202
|
+
/** Number of waiting executions with re-armed timers */
|
|
203
|
+
waiting: number;
|
|
204
|
+
/** Number of compensating executions re-run */
|
|
205
|
+
compensating: number;
|
|
206
|
+
/** Total recovered */
|
|
207
|
+
total: number;
|
|
208
|
+
}
|
|
190
209
|
/** Options for cleanup */
|
|
191
210
|
export interface CleanupOptions {
|
|
192
211
|
maxAge: number;
|
|
193
212
|
states?: ExecutionState[];
|
|
194
213
|
}
|
|
195
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Workflow - DSL builder for defining workflow step graphs
|
|
3
3
|
* Pure data structure, no side effects.
|
|
4
|
+
*
|
|
5
|
+
* Supports type-safe step chaining: each .step() narrows the return type
|
|
6
|
+
* so subsequent steps can access previous results without casting.
|
|
4
7
|
*/
|
|
5
|
-
import type { WorkflowNode,
|
|
6
|
-
export declare class Workflow<TInput = unknown> {
|
|
8
|
+
import type { WorkflowNode, StepOptions, StepContext, BranchCondition, LoopCondition, ForEachItemsExtractor, TypedStepHandler } from './types';
|
|
9
|
+
export declare class Workflow<TInput = unknown, TSteps extends Record<string, unknown> = Record<string, unknown>> {
|
|
7
10
|
readonly name: string;
|
|
8
11
|
readonly nodes: WorkflowNode[];
|
|
9
12
|
constructor(name: string);
|
|
10
|
-
/** Add a step to the workflow */
|
|
11
|
-
step(name:
|
|
13
|
+
/** Add a step to the workflow — return type accumulates into TSteps */
|
|
14
|
+
step<TName extends string, TResult>(name: TName, handler: TypedStepHandler<TInput, TSteps, TResult>, options?: StepOptions<TInput, TSteps>): Workflow<TInput, TSteps & Record<TName, Awaited<TResult>>>;
|
|
12
15
|
/** Add a branch point — call .path() after this to define paths */
|
|
13
|
-
branch(condition: BranchCondition): this;
|
|
16
|
+
branch(condition: BranchCondition<TInput, TSteps>): this;
|
|
14
17
|
/** Define a branch path (must follow a .branch() call) */
|
|
15
|
-
path(name: string, builder: (w: Workflow<TInput>) => Workflow<TInput>): this;
|
|
16
|
-
/** Run multiple steps in parallel */
|
|
17
|
-
parallel(builder: (w: Workflow<TInput>) => Workflow<TInput>):
|
|
18
|
+
path(name: string, builder: (w: Workflow<TInput, TSteps>) => Workflow<TInput, any>): this;
|
|
19
|
+
/** Run multiple steps in parallel — accumulated types from sub-builder merge into TSteps */
|
|
20
|
+
parallel<TNewSteps extends Record<string, unknown>>(builder: (w: Workflow<TInput, TSteps>) => Workflow<TInput, TSteps & TNewSteps>): Workflow<TInput, TSteps & TNewSteps>;
|
|
18
21
|
/** Call another registered workflow as a step */
|
|
19
|
-
subWorkflow(name:
|
|
22
|
+
subWorkflow<TName extends string>(name: TName, inputMapper: (ctx: StepContext<TInput, TSteps>) => unknown): Workflow<TInput, TSteps & Record<`sub:${TName}`, Record<string, unknown>>>;
|
|
20
23
|
/** Wait for an external signal before continuing */
|
|
21
24
|
waitFor(event: string, options?: {
|
|
22
25
|
timeout?: number;
|
|
23
26
|
}): this;
|
|
24
27
|
/** Repeat steps until condition returns true (checked after each iteration) */
|
|
25
|
-
doUntil(condition: LoopCondition, builder: (w: Workflow<TInput>) => Workflow<TInput>, options?: {
|
|
28
|
+
doUntil(condition: LoopCondition<TInput, TSteps>, builder: (w: Workflow<TInput, TSteps>) => Workflow<TInput, any>, options?: {
|
|
26
29
|
maxIterations?: number;
|
|
27
30
|
}): this;
|
|
28
31
|
/** Repeat steps while condition returns true (checked before each iteration) */
|
|
29
|
-
doWhile(condition: LoopCondition, builder: (w: Workflow<TInput>) => Workflow<TInput>, options?: {
|
|
32
|
+
doWhile(condition: LoopCondition<TInput, TSteps>, builder: (w: Workflow<TInput, TSteps>) => Workflow<TInput, any>, options?: {
|
|
30
33
|
maxIterations?: number;
|
|
31
34
|
}): this;
|
|
32
35
|
/** Iterate over items, executing a step for each */
|
|
33
|
-
forEach(items: ForEachItemsExtractor, name:
|
|
36
|
+
forEach<TName extends string, TResult>(items: ForEachItemsExtractor<TInput, TSteps>, name: TName, handler: TypedStepHandler<TInput, TSteps, TResult>, options?: StepOptions<TInput, TSteps> & {
|
|
34
37
|
maxIterations?: number;
|
|
35
|
-
}):
|
|
38
|
+
}): Workflow<TInput, TSteps & Record<TName, Awaited<TResult>>>;
|
|
36
39
|
/** Transform step results into a new value stored under the given name */
|
|
37
|
-
map(name:
|
|
40
|
+
map<TName extends string, TResult>(name: TName, transform: (ctx: StepContext<TInput, TSteps>) => TResult): Workflow<TInput, TSteps & Record<TName, Awaited<TResult>>>;
|
|
38
41
|
/** Get flat list of step names for validation */
|
|
39
42
|
getStepNames(): string[];
|
|
40
43
|
}
|
|
41
|
-
//# sourceMappingURL=workflow.d.ts.map
|