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
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-socket write queue
|
|
3
|
+
* =================================================================
|
|
4
|
+
* Bun's `socket.write()` may write FEWER bytes than provided when the kernel
|
|
5
|
+
* send buffer is full (backpressure). The unwritten tail is NOT retained by
|
|
6
|
+
* Bun — the caller is responsible for buffering it and resending once the
|
|
7
|
+
* socket fires `drain`. Ignoring the short count silently drops response
|
|
8
|
+
* bytes, corrupting the length-prefixed frame protocol.
|
|
9
|
+
*
|
|
10
|
+
* This helper buffers any unwritten tail per-socket and preserves ordering:
|
|
11
|
+
* while a pending tail exists, all subsequent writes are appended to the queue
|
|
12
|
+
* (never written ahead of older bytes), and the queue is flushed in order from
|
|
13
|
+
* the `drain` handler.
|
|
14
|
+
*/
|
|
15
|
+
/** Per-socket pending write state. Stored on `socket.data`. */
|
|
16
|
+
export class SocketWriteQueue {
|
|
17
|
+
/** Buffered chunks waiting to be (re)written, in order. */
|
|
18
|
+
pending = [];
|
|
19
|
+
/** Byte offset into pending[0] already written by a short write. */
|
|
20
|
+
offset = 0;
|
|
21
|
+
/** Total queued bytes (for bounds / observability). */
|
|
22
|
+
queuedBytes = 0;
|
|
23
|
+
/** Max queued bytes before the queue reports over-budget (0 = unbounded). */
|
|
24
|
+
maxBytes;
|
|
25
|
+
/**
|
|
26
|
+
* @param maxBytes Soft cap on buffered bytes. When `bytesQueued` exceeds this,
|
|
27
|
+
* `isOverBudget` becomes true and the owner should drop the connection
|
|
28
|
+
* (bounds write-side memory for a client that stopped reading). 0 disables.
|
|
29
|
+
*/
|
|
30
|
+
constructor(maxBytes = 0) {
|
|
31
|
+
this.maxBytes = maxBytes > 0 ? maxBytes : 0;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* True once the buffered byte count exceeds the configured cap. The owner is
|
|
35
|
+
* expected to terminate the connection and `clear()` the queue.
|
|
36
|
+
*/
|
|
37
|
+
get isOverBudget() {
|
|
38
|
+
return this.maxBytes > 0 && this.queuedBytes > this.maxBytes;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Enqueue `data` for delivery on `socket`, preserving order.
|
|
42
|
+
* Returns false if the socket appears closed (write threw / returned < 0).
|
|
43
|
+
*/
|
|
44
|
+
write(socket, data) {
|
|
45
|
+
if (data.length === 0)
|
|
46
|
+
return true;
|
|
47
|
+
// If a tail is already pending, do NOT write ahead of it — append and wait
|
|
48
|
+
// for drain to flush in order.
|
|
49
|
+
if (this.pending.length > 0) {
|
|
50
|
+
this.pending.push(data);
|
|
51
|
+
this.queuedBytes += data.length;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
let written;
|
|
55
|
+
try {
|
|
56
|
+
written = socket.write(data);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
if (written < 0) {
|
|
62
|
+
// Socket closed.
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
if (written < data.length) {
|
|
66
|
+
// Short write: buffer the unwritten tail; flush on drain.
|
|
67
|
+
const tail = data.subarray(written);
|
|
68
|
+
this.pending.push(tail);
|
|
69
|
+
this.queuedBytes += tail.length;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Flush as much of the pending queue as the socket accepts.
|
|
75
|
+
* Call from the socket's `drain` handler. Stops at the first short write,
|
|
76
|
+
* leaving the remainder queued for the next drain.
|
|
77
|
+
*/
|
|
78
|
+
flush(socket) {
|
|
79
|
+
while (this.pending.length > 0) {
|
|
80
|
+
const chunk = this.pending[0];
|
|
81
|
+
const view = this.offset > 0 ? chunk.subarray(this.offset) : chunk;
|
|
82
|
+
let written;
|
|
83
|
+
try {
|
|
84
|
+
written = socket.write(view);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (written <= 0) {
|
|
90
|
+
// Socket not ready / closed; wait for the next drain.
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (written < view.length) {
|
|
94
|
+
// Still backpressured: advance offset within the current chunk.
|
|
95
|
+
this.offset += written;
|
|
96
|
+
this.queuedBytes -= written;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Whole chunk flushed.
|
|
100
|
+
this.queuedBytes -= view.length;
|
|
101
|
+
this.pending.shift();
|
|
102
|
+
this.offset = 0;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Number of bytes still buffered awaiting drain. */
|
|
106
|
+
get bytesQueued() {
|
|
107
|
+
return this.queuedBytes;
|
|
108
|
+
}
|
|
109
|
+
/** Whether there is unwritten data awaiting drain. */
|
|
110
|
+
get hasPending() {
|
|
111
|
+
return this.pending.length > 0;
|
|
112
|
+
}
|
|
113
|
+
/** Drop all buffered data (e.g. on close). */
|
|
114
|
+
clear() {
|
|
115
|
+
this.pending = [];
|
|
116
|
+
this.offset = 0;
|
|
117
|
+
this.queuedBytes = 0;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Convenience: write through a socket whose `data` carries a `writeQueue`.
|
|
122
|
+
* Keeps call sites in tcp.ts terse and consistent.
|
|
123
|
+
*/
|
|
124
|
+
export function queuedWrite(socket, data) {
|
|
125
|
+
socket.data.writeQueue.write(socket, data);
|
|
126
|
+
}
|
|
@@ -8,6 +8,7 @@ import type { QueueManager } from '../../application/queueManager';
|
|
|
8
8
|
import { type HandlerContext } from './handler';
|
|
9
9
|
import { FrameParser, type ConnectionState } from './protocol';
|
|
10
10
|
import { Semaphore } from '../../shared/semaphore';
|
|
11
|
+
import { SocketWriteQueue } from './socketWriteQueue';
|
|
11
12
|
/** TCP Server configuration */
|
|
12
13
|
export interface TcpServerConfig {
|
|
13
14
|
/** TCP port */
|
|
@@ -16,6 +17,18 @@ export interface TcpServerConfig {
|
|
|
16
17
|
hostname?: string;
|
|
17
18
|
/** Auth tokens for authentication */
|
|
18
19
|
authTokens?: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Slowloris stall timeout (ms): close a connection that started a frame but
|
|
22
|
+
* made no progress completing it within this window. 0 disables. Defaults to
|
|
23
|
+
* TCP_IDLE_TIMEOUT_MS env (60s). Mainly for tests.
|
|
24
|
+
*/
|
|
25
|
+
idleTimeoutMs?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Max outbound write-queue bytes before dropping a connection (write-side
|
|
28
|
+
* memory bound). 0 disables. Defaults to TCP_MAX_WRITE_QUEUE_BYTES env (64MB).
|
|
29
|
+
* Mainly for tests.
|
|
30
|
+
*/
|
|
31
|
+
maxWriteQueueBytes?: number;
|
|
19
32
|
}
|
|
20
33
|
/** Per-connection data */
|
|
21
34
|
interface ConnectionData {
|
|
@@ -24,6 +37,10 @@ interface ConnectionData {
|
|
|
24
37
|
ctx: HandlerContext;
|
|
25
38
|
/** Semaphore for limiting concurrent command processing (pipelining) */
|
|
26
39
|
semaphore: Semaphore;
|
|
40
|
+
/** Backpressure-aware write queue: buffers unwritten tails, flushes on drain */
|
|
41
|
+
writeQueue: SocketWriteQueue;
|
|
42
|
+
/** Active partial-frame stall timer (slowloris mitigation); null when idle. */
|
|
43
|
+
stallTimer: ReturnType<typeof setTimeout> | null;
|
|
27
44
|
}
|
|
28
45
|
/**
|
|
29
46
|
* Create and start TCP server
|
|
@@ -40,4 +57,3 @@ export declare function createTcpServer(queueManager: QueueManager, config: TcpS
|
|
|
40
57
|
};
|
|
41
58
|
export type TcpServer = ReturnType<typeof createTcpServer>;
|
|
42
59
|
export {};
|
|
43
|
-
//# sourceMappingURL=tcp.d.ts.map
|
|
@@ -10,8 +10,29 @@ import { tcpLog } from '../../shared/logger';
|
|
|
10
10
|
import { getRateLimiter } from './rateLimiter';
|
|
11
11
|
import { pack, unpack } from 'msgpackr';
|
|
12
12
|
import { Semaphore, withSemaphore } from '../../shared/semaphore';
|
|
13
|
+
import { SocketWriteQueue } from './socketWriteQueue';
|
|
13
14
|
/** Max concurrent commands per connection for pipelining */
|
|
14
15
|
const MAX_CONCURRENT_PER_CONNECTION = 50;
|
|
16
|
+
/**
|
|
17
|
+
* Idle/read stall timeout (ms) for the slowloris mitigation. A connection that
|
|
18
|
+
* has STARTED a frame (partial bytes buffered) but makes no further progress
|
|
19
|
+
* toward completing it within this window is closed. Healthy connections that
|
|
20
|
+
* are simply idle (no partial frame buffered) are never affected, so long-lived
|
|
21
|
+
* idle-but-healthy clients are not disturbed. 0 disables the timeout.
|
|
22
|
+
*
|
|
23
|
+
* Implemented with a manual per-connection timer (Bun.listen has no
|
|
24
|
+
* `idleTimeout` socket option as of Bun 1.3.x, and `socket.timeout()` resets on
|
|
25
|
+
* every byte — so a slowloris that trickles one byte per window would defeat
|
|
26
|
+
* it). The manual timer is armed only while a partial frame is in progress.
|
|
27
|
+
*/
|
|
28
|
+
const TCP_IDLE_TIMEOUT_MS = Math.max(0, parseInt(Bun.env.TCP_IDLE_TIMEOUT_MS ?? '60000', 10) || 0);
|
|
29
|
+
/**
|
|
30
|
+
* Maximum bytes that may be buffered in a connection's outbound write queue
|
|
31
|
+
* before the connection is dropped. A client that stops reading while the
|
|
32
|
+
* server keeps producing responses would otherwise grow the pending queue
|
|
33
|
+
* without bound (write-side memory DoS). Generous default (64MB). 0 disables.
|
|
34
|
+
*/
|
|
35
|
+
const MAX_WRITE_QUEUE_BYTES = Math.max(0, parseInt(Bun.env.TCP_MAX_WRITE_QUEUE_BYTES ?? String(64 * 1024 * 1024), 10) || 0);
|
|
15
36
|
/**
|
|
16
37
|
* Release client jobs with retry logic and exponential backoff.
|
|
17
38
|
* Ensures jobs are not left in an inconsistent state if release fails.
|
|
@@ -48,6 +69,39 @@ function errorResponse(message, reqId) {
|
|
|
48
69
|
export function createTcpServer(queueManager, config) {
|
|
49
70
|
const authTokens = new Set(config.authTokens ?? []);
|
|
50
71
|
const connections = new Map();
|
|
72
|
+
const idleTimeoutMs = config.idleTimeoutMs ?? TCP_IDLE_TIMEOUT_MS;
|
|
73
|
+
const maxWriteQueueBytes = config.maxWriteQueueBytes ?? MAX_WRITE_QUEUE_BYTES;
|
|
74
|
+
/** Cancel any pending stall timer for a connection. */
|
|
75
|
+
function clearStallTimer(socket) {
|
|
76
|
+
if (socket.data.stallTimer !== null) {
|
|
77
|
+
clearTimeout(socket.data.stallTimer);
|
|
78
|
+
socket.data.stallTimer = null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* (Re)arm the slowloris stall timer based on parser state. The timer runs
|
|
83
|
+
* ONLY while a partial frame is buffered (a frame was started but not yet
|
|
84
|
+
* completed). It is reset on every data event that still leaves a partial
|
|
85
|
+
* frame, and cleared once the buffer drains to empty (frame completed). If it
|
|
86
|
+
* fires, the peer started a frame and then stalled -> terminate.
|
|
87
|
+
*/
|
|
88
|
+
function updateStallTimer(socket) {
|
|
89
|
+
if (idleTimeoutMs <= 0)
|
|
90
|
+
return;
|
|
91
|
+
clearStallTimer(socket);
|
|
92
|
+
if (!socket.data.frameParser.hasPartialFrame)
|
|
93
|
+
return;
|
|
94
|
+
socket.data.stallTimer = setTimeout(() => {
|
|
95
|
+
socket.data.stallTimer = null;
|
|
96
|
+
tcpLog.warn('Closing stalled connection (incomplete frame)', {
|
|
97
|
+
clientId: socket.data.state.clientId,
|
|
98
|
+
bufferedBytes: socket.data.frameParser.bufferedBytes,
|
|
99
|
+
idleTimeoutMs,
|
|
100
|
+
});
|
|
101
|
+
socket.data.writeQueue.clear();
|
|
102
|
+
socket.terminate();
|
|
103
|
+
}, idleTimeoutMs);
|
|
104
|
+
}
|
|
51
105
|
const socketHandlers = {
|
|
52
106
|
open(socket) {
|
|
53
107
|
const clientId = uuid();
|
|
@@ -63,17 +117,19 @@ export function createTcpServer(queueManager, config) {
|
|
|
63
117
|
frameParser: new FrameParser(),
|
|
64
118
|
ctx,
|
|
65
119
|
semaphore: new Semaphore(MAX_CONCURRENT_PER_CONNECTION),
|
|
120
|
+
writeQueue: new SocketWriteQueue(maxWriteQueueBytes),
|
|
121
|
+
stallTimer: null,
|
|
66
122
|
};
|
|
67
123
|
connections.set(clientId, socket);
|
|
68
124
|
queueManager.emitDashboardEvent('client:connected', { clientId, transport: 'tcp' });
|
|
69
125
|
},
|
|
70
126
|
async data(socket, data) {
|
|
71
|
-
const { frameParser, ctx, state, semaphore } = socket.data;
|
|
127
|
+
const { frameParser, ctx, state, semaphore, writeQueue } = socket.data;
|
|
72
128
|
const rateLimiter = getRateLimiter();
|
|
73
129
|
// Check rate limit
|
|
74
130
|
if (!rateLimiter.isAllowed(state.clientId)) {
|
|
75
131
|
ctx.queueManager.emitDashboardEvent('ratelimit:hit', { clientId: state.clientId });
|
|
76
|
-
|
|
132
|
+
writeQueue.write(socket, errorResponse('Rate limit exceeded'));
|
|
77
133
|
return;
|
|
78
134
|
}
|
|
79
135
|
let frames;
|
|
@@ -82,12 +138,33 @@ export function createTcpServer(queueManager, config) {
|
|
|
82
138
|
}
|
|
83
139
|
catch (err) {
|
|
84
140
|
if (err instanceof FrameSizeError) {
|
|
85
|
-
socket
|
|
141
|
+
clearStallTimer(socket);
|
|
142
|
+
writeQueue.write(socket, errorResponse(`Frame too large: ${err.requestedSize} bytes exceeds maximum ${err.maxSize}`));
|
|
86
143
|
socket.end();
|
|
87
144
|
return;
|
|
88
145
|
}
|
|
89
146
|
throw err;
|
|
90
147
|
}
|
|
148
|
+
// Slowloris mitigation: (re)arm the stall timer based on whether a partial
|
|
149
|
+
// frame is now buffered. Progress (a completed frame draining the buffer)
|
|
150
|
+
// disarms it; a started-but-unfinished frame arms it. This bounds memory
|
|
151
|
+
// held by a peer that declares a large (legal) frame then never finishes.
|
|
152
|
+
updateStallTimer(socket);
|
|
153
|
+
// Drop a connection whose outbound queue grew unbounded (client stopped
|
|
154
|
+
// reading while we keep producing responses) — bounds write-side memory.
|
|
155
|
+
const dropForWriteOverflow = () => {
|
|
156
|
+
if (writeQueue.isOverBudget) {
|
|
157
|
+
tcpLog.warn('Closing connection: write queue exceeded budget', {
|
|
158
|
+
clientId: state.clientId,
|
|
159
|
+
queuedBytes: writeQueue.bytesQueued,
|
|
160
|
+
});
|
|
161
|
+
clearStallTimer(socket);
|
|
162
|
+
writeQueue.clear();
|
|
163
|
+
socket.terminate();
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
return false;
|
|
167
|
+
};
|
|
91
168
|
// Process frames in parallel for pipelining support
|
|
92
169
|
// Each command is processed with semaphore-controlled concurrency
|
|
93
170
|
const processFrame = async (frame) => {
|
|
@@ -96,23 +173,25 @@ export function createTcpServer(queueManager, config) {
|
|
|
96
173
|
cmd = unpack(frame);
|
|
97
174
|
}
|
|
98
175
|
catch {
|
|
99
|
-
|
|
176
|
+
writeQueue.write(socket, errorResponse('Invalid command format'));
|
|
100
177
|
return;
|
|
101
178
|
}
|
|
102
179
|
if (!cmd?.cmd) {
|
|
103
|
-
|
|
180
|
+
writeQueue.write(socket, errorResponse('Invalid command'));
|
|
104
181
|
return;
|
|
105
182
|
}
|
|
106
183
|
// Process with concurrency limit
|
|
107
184
|
await withSemaphore(semaphore, async () => {
|
|
108
185
|
try {
|
|
109
186
|
const response = await handleCommand(cmd, ctx);
|
|
110
|
-
|
|
187
|
+
writeQueue.write(socket, serializeResponse(response));
|
|
188
|
+
dropForWriteOverflow();
|
|
111
189
|
}
|
|
112
190
|
catch (err) {
|
|
113
191
|
const raw = err instanceof Error ? err.message : 'Unknown error';
|
|
114
192
|
const message = raw.includes('SQLITE') || raw.includes('database') ? 'Internal server error' : raw;
|
|
115
|
-
|
|
193
|
+
writeQueue.write(socket, errorResponse(message, cmd.reqId));
|
|
194
|
+
dropForWriteOverflow();
|
|
116
195
|
}
|
|
117
196
|
});
|
|
118
197
|
};
|
|
@@ -121,6 +200,10 @@ export function createTcpServer(queueManager, config) {
|
|
|
121
200
|
},
|
|
122
201
|
close(socket) {
|
|
123
202
|
const clientId = socket.data.state.clientId;
|
|
203
|
+
// Cancel the slowloris stall timer and drop any buffered-but-unwritten
|
|
204
|
+
// bytes; the socket is gone.
|
|
205
|
+
clearStallTimer(socket);
|
|
206
|
+
socket.data.writeQueue.clear();
|
|
124
207
|
connections.delete(clientId);
|
|
125
208
|
getRateLimiter().removeClient(clientId);
|
|
126
209
|
queueManager.unregisterWorkersByClientId(clientId);
|
|
@@ -131,20 +214,26 @@ export function createTcpServer(queueManager, config) {
|
|
|
131
214
|
// Jobs released successfully
|
|
132
215
|
})
|
|
133
216
|
.catch((err) => {
|
|
134
|
-
// After all retries failed,
|
|
135
|
-
//
|
|
136
|
-
|
|
217
|
+
// After all retries failed, fall back to a force-release that
|
|
218
|
+
// unconditionally clears client tracking (prevents Map leak) and
|
|
219
|
+
// resets heartbeats so the stall detector recovers any orphaned
|
|
220
|
+
// 'active' jobs on its next tick.
|
|
221
|
+
const touched = queueManager.forceReleaseClientJobs(clientId);
|
|
222
|
+
tcpLog.error('Client jobs release failed; fell back to force-release', {
|
|
137
223
|
clientId,
|
|
138
224
|
error: String(err),
|
|
139
|
-
|
|
225
|
+
forcedJobs: touched,
|
|
226
|
+
note: 'Stall detector will recover orphaned active jobs on next tick',
|
|
140
227
|
});
|
|
141
228
|
});
|
|
142
229
|
},
|
|
143
230
|
error(_socket, error) {
|
|
144
231
|
tcpLog.error('Connection error', { error: error.message });
|
|
145
232
|
},
|
|
146
|
-
drain(
|
|
147
|
-
//
|
|
233
|
+
drain(socket) {
|
|
234
|
+
// Socket is ready for more writes after backpressure: flush any unwritten
|
|
235
|
+
// tail bytes buffered by short writes, preserving frame order.
|
|
236
|
+
socket.data.writeQueue.flush(socket);
|
|
148
237
|
},
|
|
149
238
|
};
|
|
150
239
|
// Create TCP server
|
|
@@ -164,17 +253,25 @@ export function createTcpServer(queueManager, config) {
|
|
|
164
253
|
broadcast(message) {
|
|
165
254
|
const frame = FrameParser.frame(pack(message));
|
|
166
255
|
for (const socket of connections.values()) {
|
|
167
|
-
|
|
256
|
+
// Each connection writes through its own backpressure-aware queue so a
|
|
257
|
+
// slow reader buffers (in order) instead of dropping frame tail bytes.
|
|
258
|
+
socket.data.writeQueue.write(socket, frame);
|
|
259
|
+
// Drop any reader that has fallen too far behind (write-side bound).
|
|
260
|
+
if (socket.data.writeQueue.isOverBudget) {
|
|
261
|
+
clearStallTimer(socket);
|
|
262
|
+
socket.data.writeQueue.clear();
|
|
263
|
+
socket.terminate();
|
|
264
|
+
}
|
|
168
265
|
}
|
|
169
266
|
},
|
|
170
267
|
/** Stop the server */
|
|
171
268
|
stop() {
|
|
172
269
|
server.stop();
|
|
173
270
|
for (const socket of connections.values()) {
|
|
271
|
+
clearStallTimer(socket);
|
|
174
272
|
socket.end();
|
|
175
273
|
}
|
|
176
274
|
connections.clear();
|
|
177
275
|
},
|
|
178
276
|
};
|
|
179
277
|
}
|
|
180
|
-
//# sourceMappingURL=tcp.js.map
|
package/dist/main.d.ts
CHANGED
package/dist/main.js
CHANGED
|
@@ -3,39 +3,41 @@
|
|
|
3
3
|
* bunqueue - High-performance job queue server for Bun
|
|
4
4
|
* Main entry point - routes to CLI for client commands or starts server
|
|
5
5
|
*/
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
6
|
+
// Only run startup dispatch when this file is the program entry point.
|
|
7
|
+
// Issue #85: re-exporting `defineConfig` means user config files import this
|
|
8
|
+
// module; without this guard, the top-level dispatch would re-run the CLI/server
|
|
9
|
+
// on every import and cause "Failed to listen at 0.0.0.0".
|
|
10
|
+
if (import.meta.main) {
|
|
11
|
+
const clientCommands = [
|
|
12
|
+
'push',
|
|
13
|
+
'pull',
|
|
14
|
+
'ack',
|
|
15
|
+
'fail',
|
|
16
|
+
'job',
|
|
17
|
+
'queue',
|
|
18
|
+
'dlq',
|
|
19
|
+
'cron',
|
|
20
|
+
'worker',
|
|
21
|
+
'webhook',
|
|
22
|
+
'rate-limit',
|
|
23
|
+
'concurrency',
|
|
24
|
+
'stats',
|
|
25
|
+
'metrics',
|
|
26
|
+
'health',
|
|
27
|
+
'backup',
|
|
28
|
+
];
|
|
29
|
+
const firstArg = process.argv[2];
|
|
30
|
+
const isClientCommand = firstArg && clientCommands.includes(firstArg);
|
|
31
|
+
const isStartCommand = firstArg === 'start';
|
|
32
|
+
const hasHelpOrVersion = process.argv.includes('--help') || process.argv.includes('--version');
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- process.argv[2] can be undefined at runtime
|
|
34
|
+
const hasFlags = firstArg?.startsWith('-');
|
|
35
|
+
if (isClientCommand || hasHelpOrVersion || isStartCommand || hasFlags) {
|
|
36
|
+
void import('./cli/index').then(({ main }) => main());
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
void startServer();
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
import { QueueManager } from './application/queueManager';
|
|
41
43
|
import { createTcpServer } from './infrastructure/server/tcp';
|
|
@@ -230,16 +232,18 @@ async function startServer() {
|
|
|
230
232
|
});
|
|
231
233
|
}, config.statsIntervalMs);
|
|
232
234
|
}
|
|
233
|
-
//
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
235
|
+
// Logger env-var bootstrap only applies when this file is the entry point.
|
|
236
|
+
// Imported consumers (e.g. user config files using `defineConfig`) must not
|
|
237
|
+
// have their process Logger state mutated as a side effect — see Issue #85.
|
|
238
|
+
if (import.meta.main) {
|
|
239
|
+
if (Bun.env.LOG_FORMAT === 'json') {
|
|
240
|
+
Logger.enableJsonMode();
|
|
241
|
+
}
|
|
242
|
+
if (Bun.env.LOG_LEVEL) {
|
|
243
|
+
const validLevels = ['debug', 'info', 'warn', 'error'];
|
|
244
|
+
const level = Bun.env.LOG_LEVEL.toLowerCase();
|
|
245
|
+
if (validLevels.includes(level)) {
|
|
246
|
+
Logger.setLevel(level);
|
|
247
|
+
}
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
|
-
//# sourceMappingURL=main.js.map
|
package/dist/mcp/adapter.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ export interface McpBackend {
|
|
|
139
139
|
obliterateQueue(queue: string): Promise<void>;
|
|
140
140
|
listQueues(): Promise<string[]>;
|
|
141
141
|
countJobs(queue: string): Promise<number>;
|
|
142
|
-
cleanQueue(queue: string, graceMs: number, state?: string, limit?: number): Promise<
|
|
142
|
+
cleanQueue(queue: string, graceMs: number, state?: string, limit?: number): Promise<string[]>;
|
|
143
143
|
isPaused(queue: string): Promise<boolean>;
|
|
144
144
|
getCountsPerPriority(queue: string): Promise<Record<number, number>>;
|
|
145
145
|
getDlq(queue: string, limit?: number): Promise<SerializedJob[]>;
|
|
@@ -242,7 +242,7 @@ export declare class EmbeddedBackend implements McpBackend {
|
|
|
242
242
|
obliterateQueue(queue: string): Promise<void>;
|
|
243
243
|
listQueues(): Promise<string[]>;
|
|
244
244
|
countJobs(queue: string): Promise<number>;
|
|
245
|
-
cleanQueue(queue: string, graceMs: number, state?: string, limit?: number): Promise<
|
|
245
|
+
cleanQueue(queue: string, graceMs: number, state?: string, limit?: number): Promise<import("../domain/types").JobId[]>;
|
|
246
246
|
isPaused(queue: string): Promise<boolean>;
|
|
247
247
|
getCountsPerPriority(queue: string): Promise<Record<number, number>>;
|
|
248
248
|
getDlq(queue: string, limit?: number): Promise<SerializedJob[]>;
|
|
@@ -354,7 +354,7 @@ export declare class TcpBackend implements McpBackend {
|
|
|
354
354
|
obliterateQueue(queue: string): Promise<void>;
|
|
355
355
|
listQueues(): Promise<string[]>;
|
|
356
356
|
countJobs(queue: string): Promise<number>;
|
|
357
|
-
cleanQueue(queue: string, graceMs: number, state?: string, limit?: number): Promise<
|
|
357
|
+
cleanQueue(queue: string, graceMs: number, state?: string, limit?: number): Promise<string[]>;
|
|
358
358
|
isPaused(queue: string): Promise<boolean>;
|
|
359
359
|
getCountsPerPriority(queue: string): Promise<Record<number, number>>;
|
|
360
360
|
getDlq(queue: string, limit?: number): Promise<SerializedJob[]>;
|
|
@@ -402,4 +402,3 @@ export declare class TcpBackend implements McpBackend {
|
|
|
402
402
|
}
|
|
403
403
|
/** Create backend based on environment configuration */
|
|
404
404
|
export declare function createBackend(): Promise<McpBackend>;
|
|
405
|
-
//# sourceMappingURL=adapter.d.ts.map
|