@bluelibs/runner 5.1.0 → 5.2.1
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 +25 -15
- package/dist/browser/index.cjs +851 -478
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.mjs +849 -478
- package/dist/browser/index.mjs.map +1 -1
- package/dist/edge/index.cjs +851 -478
- package/dist/edge/index.cjs.map +1 -1
- package/dist/edge/index.mjs +849 -478
- package/dist/edge/index.mjs.map +1 -1
- package/dist/node/node.cjs +1305 -583
- package/dist/node/node.cjs.map +1 -1
- package/dist/node/node.mjs +1299 -583
- package/dist/node/node.mjs.map +1 -1
- package/dist/types/define.d.ts +9 -0
- package/dist/types/definers/builders/asyncContext/fluent-builder.d.ts +6 -0
- package/dist/types/definers/builders/asyncContext/fluent-builder.interface.d.ts +9 -0
- package/dist/types/definers/builders/asyncContext/index.d.ts +10 -0
- package/dist/types/definers/builders/asyncContext/types.d.ts +13 -0
- package/dist/types/definers/builders/asyncContext/utils.d.ts +5 -0
- package/dist/types/definers/builders/asyncContext.d.ts +1 -0
- package/dist/types/definers/builders/core.d.ts +30 -0
- package/dist/types/definers/builders/error/fluent-builder.d.ts +7 -0
- package/dist/types/definers/builders/error/fluent-builder.interface.d.ts +10 -0
- package/dist/types/definers/builders/error/index.d.ts +11 -0
- package/dist/types/definers/builders/error/types.d.ts +14 -0
- package/dist/types/definers/builders/error/utils.d.ts +6 -0
- package/dist/types/definers/builders/error.d.ts +1 -0
- package/dist/types/definers/builders/event/fluent-builder.d.ts +7 -0
- package/dist/types/definers/builders/event/fluent-builder.interface.d.ts +18 -0
- package/dist/types/definers/builders/event/index.d.ts +10 -0
- package/dist/types/definers/builders/event/types.d.ts +8 -0
- package/dist/types/definers/builders/event/utils.d.ts +9 -0
- package/dist/types/definers/builders/event.d.ts +1 -0
- package/dist/types/definers/builders/hook/fluent-builder.d.ts +8 -0
- package/dist/types/definers/builders/hook/fluent-builder.interface.d.ts +27 -0
- package/dist/types/definers/builders/hook/index.d.ts +12 -0
- package/dist/types/definers/builders/hook/types.d.ts +14 -0
- package/dist/types/definers/builders/hook/utils.d.ts +14 -0
- package/dist/types/definers/builders/hook.d.ts +1 -0
- package/dist/types/definers/builders/middleware/index.d.ts +19 -0
- package/dist/types/definers/builders/middleware/resource.d.ts +7 -0
- package/dist/types/definers/builders/middleware/resource.interface.d.ts +18 -0
- package/dist/types/definers/builders/middleware/task.d.ts +7 -0
- package/dist/types/definers/builders/middleware/task.interface.d.ts +18 -0
- package/dist/types/definers/builders/middleware/types.d.ts +13 -0
- package/dist/types/definers/builders/middleware/utils.d.ts +18 -0
- package/dist/types/definers/builders/middleware.d.ts +1 -0
- package/dist/types/definers/builders/override/hook.d.ts +16 -0
- package/dist/types/definers/builders/override/index.d.ts +11 -0
- package/dist/types/definers/builders/override/resource-middleware.d.ts +3 -0
- package/dist/types/definers/builders/override/resource.d.ts +3 -0
- package/dist/types/definers/builders/override/task-middleware.d.ts +3 -0
- package/dist/types/definers/builders/override/task.d.ts +3 -0
- package/dist/types/definers/builders/resource/fluent-builder.d.ts +8 -0
- package/dist/types/definers/builders/resource/fluent-builder.interface.d.ts +42 -0
- package/dist/types/definers/builders/resource/index.d.ts +13 -0
- package/dist/types/definers/builders/resource/types.d.ts +37 -0
- package/dist/types/definers/builders/resource/utils.d.ts +26 -0
- package/dist/types/definers/builders/resource.d.ts +1 -0
- package/dist/types/definers/builders/tag/fluent-builder.d.ts +6 -0
- package/dist/types/definers/builders/tag/fluent-builder.interface.d.ts +8 -0
- package/dist/types/definers/builders/tag/index.d.ts +10 -0
- package/dist/types/definers/builders/tag/types.d.ts +12 -0
- package/dist/types/definers/builders/tag/utils.d.ts +5 -0
- package/dist/types/definers/builders/tag.d.ts +1 -0
- package/dist/types/definers/builders/task/fluent-builder.d.ts +8 -0
- package/dist/types/definers/builders/task/fluent-builder.interface.d.ts +33 -0
- package/dist/types/definers/builders/task/index.d.ts +21 -0
- package/dist/types/definers/builders/task/phantom-builder.d.ts +8 -0
- package/dist/types/definers/builders/task/phantom-builder.interface.d.ts +31 -0
- package/dist/types/definers/builders/task/types.d.ts +34 -0
- package/dist/types/definers/builders/task/utils.d.ts +14 -0
- package/dist/types/definers/builders/task.d.ts +1 -0
- package/dist/types/definers/builders/task.phantom.d.ts +1 -0
- package/dist/types/definers/builders/utils.d.ts +4 -0
- package/dist/types/definers/defineAsyncContext.d.ts +15 -0
- package/dist/types/definers/defineError.d.ts +27 -0
- package/dist/types/definers/defineEvent.d.ts +2 -0
- package/dist/types/definers/defineHook.d.ts +6 -0
- package/dist/types/definers/defineOverride.d.ts +12 -0
- package/dist/types/definers/defineResource.d.ts +2 -0
- package/dist/types/definers/defineResourceMiddleware.d.ts +2 -0
- package/dist/types/definers/defineTag.d.ts +12 -0
- package/dist/types/definers/defineTask.d.ts +18 -0
- package/dist/types/definers/defineTaskMiddleware.d.ts +2 -0
- package/dist/types/definers/middlewareConfig.d.ts +1 -0
- package/dist/types/definers/resourceFork.d.ts +13 -0
- package/dist/types/definers/tools.d.ts +53 -0
- package/dist/types/defs.d.ts +33 -0
- package/dist/types/errors.d.ts +75 -0
- package/dist/types/globals/debug.d.ts +10 -0
- package/dist/types/globals/globalEvents.d.ts +8 -0
- package/dist/types/globals/globalMiddleware.d.ts +97 -0
- package/dist/types/globals/globalResources.d.ts +64 -0
- package/dist/types/globals/globalTags.d.ts +12 -0
- package/dist/types/globals/middleware/cache.middleware.d.ts +36 -0
- package/dist/types/globals/middleware/circuitBreaker.middleware.d.ts +56 -0
- package/dist/types/globals/middleware/concurrency.middleware.d.ts +47 -0
- package/dist/types/globals/middleware/fallback.middleware.d.ts +23 -0
- package/dist/types/globals/middleware/rateLimit.middleware.d.ts +47 -0
- package/dist/types/globals/middleware/requireContext.middleware.d.ts +5 -0
- package/dist/types/globals/middleware/retry.middleware.d.ts +31 -0
- package/dist/types/globals/middleware/temporal.middleware.d.ts +48 -0
- package/dist/types/globals/middleware/timeout.middleware.d.ts +24 -0
- package/dist/types/globals/middleware/tunnel.middleware.d.ts +3 -0
- package/dist/types/globals/resources/debug/debug.resource.d.ts +7 -0
- package/dist/types/globals/resources/debug/debug.tag.d.ts +2 -0
- package/dist/types/globals/resources/debug/debugConfig.resource.d.ts +22 -0
- package/dist/types/globals/resources/debug/executionTracker.middleware.d.ts +50 -0
- package/dist/types/globals/resources/debug/globalEvent.hook.d.ts +27 -0
- package/dist/types/globals/resources/debug/hook.hook.d.ts +30 -0
- package/dist/types/globals/resources/debug/index.d.ts +6 -0
- package/dist/types/globals/resources/debug/middleware.hook.d.ts +30 -0
- package/dist/types/globals/resources/debug/types.d.ts +25 -0
- package/dist/types/globals/resources/debug/utils.d.ts +2 -0
- package/dist/types/globals/resources/httpClientFactory.resource.d.ts +28 -0
- package/dist/types/globals/resources/queue.resource.d.ts +10 -0
- package/dist/types/globals/resources/tunnel/error-utils.d.ts +1 -0
- package/dist/types/globals/resources/tunnel/plan.d.ts +19 -0
- package/dist/types/globals/resources/tunnel/protocol.d.ts +48 -0
- package/dist/types/globals/resources/tunnel/tunnel.policy.tag.d.ts +26 -0
- package/dist/types/globals/resources/tunnel/tunnel.tag.d.ts +2 -0
- package/dist/types/globals/resources/tunnel/types.d.ts +48 -0
- package/dist/types/globals/tunnels/index.d.ts +23 -0
- package/dist/types/globals/types.d.ts +15 -0
- package/dist/types/http-client.d.ts +26 -0
- package/dist/types/http-fetch-tunnel.resource.d.ts +11 -0
- package/dist/types/index.d.ts +44 -0
- package/dist/types/models/DependencyProcessor.d.ts +46 -0
- package/dist/types/models/EventManager.d.ts +115 -0
- package/dist/types/models/ExecutionJournal.d.ts +35 -0
- package/dist/types/models/LogPrinter.d.ts +56 -0
- package/dist/types/models/Logger.d.ts +85 -0
- package/dist/types/models/MiddlewareManager.d.ts +73 -0
- package/dist/types/models/OverrideManager.d.ts +13 -0
- package/dist/types/models/Queue.d.ts +40 -0
- package/dist/types/models/ResourceInitializer.d.ts +20 -0
- package/dist/types/models/RunResult.d.ts +41 -0
- package/dist/types/models/Semaphore.d.ts +80 -0
- package/dist/types/models/Store.d.ts +76 -0
- package/dist/types/models/StoreRegistry.d.ts +49 -0
- package/dist/types/models/StoreValidator.d.ts +8 -0
- package/dist/types/models/TaskRunner.d.ts +28 -0
- package/dist/types/models/UnhandledError.d.ts +11 -0
- package/dist/types/models/event/CycleContext.d.ts +9 -0
- package/dist/types/models/event/EmissionExecutor.d.ts +11 -0
- package/dist/types/models/event/InterceptorPipeline.d.ts +5 -0
- package/dist/types/models/event/ListenerRegistry.d.ts +31 -0
- package/dist/types/models/event/types.d.ts +50 -0
- package/dist/types/models/index.d.ts +13 -0
- package/dist/types/models/middleware/InterceptorRegistry.d.ts +56 -0
- package/dist/types/models/middleware/MiddlewareResolver.d.ts +31 -0
- package/dist/types/models/middleware/ResourceMiddlewareComposer.d.ts +34 -0
- package/dist/types/models/middleware/TaskMiddlewareComposer.d.ts +44 -0
- package/dist/types/models/middleware/ValidationHelper.d.ts +20 -0
- package/dist/types/models/middleware/index.d.ts +6 -0
- package/dist/types/models/middleware/types.d.ts +10 -0
- package/dist/types/models/utils/findCircularDependencies.d.ts +16 -0
- package/dist/types/models/utils/safeStringify.d.ts +3 -0
- package/dist/types/node/durable/bus/MemoryEventBus.d.ts +7 -0
- package/dist/types/node/durable/bus/NoopEventBus.d.ts +6 -0
- package/dist/types/node/durable/bus/RedisEventBus.d.ts +30 -0
- package/dist/types/node/durable/core/CronParser.d.ts +15 -0
- package/dist/types/node/durable/core/DurableContext.d.ts +64 -0
- package/dist/types/node/durable/core/DurableOperator.d.ts +47 -0
- package/dist/types/node/durable/core/DurableResource.d.ts +80 -0
- package/dist/types/node/durable/core/DurableService.d.ts +73 -0
- package/dist/types/node/durable/core/DurableWorker.d.ts +19 -0
- package/dist/types/node/durable/core/StepBuilder.d.ts +23 -0
- package/dist/types/node/durable/core/audit.d.ts +152 -0
- package/dist/types/node/durable/core/createRunnerDurableRuntime.d.ts +18 -0
- package/dist/types/node/durable/core/durable-context/DurableContext.audit.d.ts +14 -0
- package/dist/types/node/durable/core/durable-context/DurableContext.determinism.d.ts +13 -0
- package/dist/types/node/durable/core/durable-context/DurableContext.emit.d.ts +16 -0
- package/dist/types/node/durable/core/durable-context/DurableContext.sleep.d.ts +16 -0
- package/dist/types/node/durable/core/durable-context/DurableContext.steps.d.ts +25 -0
- package/dist/types/node/durable/core/durable-context/DurableContext.switch.d.ts +22 -0
- package/dist/types/node/durable/core/durable-context/DurableContext.waitForSignal.d.ts +23 -0
- package/dist/types/node/durable/core/flowShape.d.ts +50 -0
- package/dist/types/node/durable/core/ids.d.ts +11 -0
- package/dist/types/node/durable/core/index.d.ts +11 -0
- package/dist/types/node/durable/core/interfaces/bus.d.ts +13 -0
- package/dist/types/node/durable/core/interfaces/context.d.ts +105 -0
- package/dist/types/node/durable/core/interfaces/queue.d.ts +17 -0
- package/dist/types/node/durable/core/interfaces/service.d.ts +146 -0
- package/dist/types/node/durable/core/interfaces/store.d.ts +66 -0
- package/dist/types/node/durable/core/managers/AuditLogger.d.ts +29 -0
- package/dist/types/node/durable/core/managers/ExecutionManager.d.ts +48 -0
- package/dist/types/node/durable/core/managers/PollingManager.d.ts +48 -0
- package/dist/types/node/durable/core/managers/ScheduleManager.d.ts +33 -0
- package/dist/types/node/durable/core/managers/SignalHandler.d.ts +25 -0
- package/dist/types/node/durable/core/managers/TaskRegistry.d.ts +16 -0
- package/dist/types/node/durable/core/managers/WaitManager.d.ts +26 -0
- package/dist/types/node/durable/core/managers/index.d.ts +7 -0
- package/dist/types/node/durable/core/resource.d.ts +14 -0
- package/dist/types/node/durable/core/types.d.ts +84 -0
- package/dist/types/node/durable/core/utils.d.ts +28 -0
- package/dist/types/node/durable/dashboard/server.d.ts +20 -0
- package/dist/types/node/durable/emitters/runnerAuditEmitter.d.ts +6 -0
- package/dist/types/node/durable/events.d.ts +76 -0
- package/dist/types/node/durable/index.d.ts +34 -0
- package/dist/types/node/durable/optionalDeps/amqplib.d.ts +1 -0
- package/dist/types/node/durable/optionalDeps/ioredis.d.ts +1 -0
- package/dist/types/node/durable/queue/MemoryQueue.d.ts +12 -0
- package/dist/types/node/durable/queue/RabbitMQQueue.d.ts +30 -0
- package/dist/types/node/durable/resources/isolation.d.ts +15 -0
- package/dist/types/node/durable/resources/memoryDurableResource.d.ts +21 -0
- package/dist/types/node/durable/resources/redisDurableResource.d.ts +35 -0
- package/dist/types/node/durable/store/MemoryStore.d.ts +56 -0
- package/dist/types/node/durable/store/RedisStore.d.ts +89 -0
- package/dist/types/node/durable/test-utils.d.ts +29 -0
- package/dist/types/node/exposure/allowList.d.ts +3 -0
- package/dist/types/node/exposure/authenticator.d.ts +16 -0
- package/dist/types/node/exposure/cors.d.ts +4 -0
- package/dist/types/node/exposure/createNodeExposure.d.ts +2 -0
- package/dist/types/node/exposure/exposureServer.d.ts +18 -0
- package/dist/types/node/exposure/handlers/contextWrapper.d.ts +18 -0
- package/dist/types/node/exposure/handlers/errorHandlers.d.ts +23 -0
- package/dist/types/node/exposure/handlers/eventHandler.d.ts +20 -0
- package/dist/types/node/exposure/handlers/taskHandler.d.ts +24 -0
- package/dist/types/node/exposure/httpResponse.d.ts +10 -0
- package/dist/types/node/exposure/index.d.ts +3 -0
- package/dist/types/node/exposure/logging.d.ts +4 -0
- package/dist/types/node/exposure/multipart.d.ts +36 -0
- package/dist/types/node/exposure/requestBody.d.ts +11 -0
- package/dist/types/node/exposure/requestContext.d.ts +17 -0
- package/dist/types/node/exposure/requestHandlers.d.ts +29 -0
- package/dist/types/node/exposure/resource.d.ts +12 -0
- package/dist/types/node/exposure/resourceTypes.d.ts +73 -0
- package/dist/types/node/exposure/router.d.ts +17 -0
- package/dist/types/node/exposure/serverLifecycle.d.ts +13 -0
- package/dist/types/node/exposure/types.d.ts +45 -0
- package/dist/types/node/exposure/utils.d.ts +17 -0
- package/dist/types/node/files/createNodeFile.d.ts +9 -0
- package/dist/types/node/files/index.d.ts +4 -0
- package/dist/types/node/files/inputFile.model.d.ts +22 -0
- package/dist/types/node/files/inputFile.utils.d.ts +14 -0
- package/dist/types/node/http/http-mixed-client.d.ts +45 -0
- package/dist/types/node/http/http-mixed-client.factory.resource.d.ts +17 -0
- package/dist/types/node/http/http-smart-client.factory.resource.d.ts +16 -0
- package/dist/types/node/http/http-smart-client.model.d.ts +27 -0
- package/dist/types/node/http/index.d.ts +4 -0
- package/dist/types/node/index.d.ts +1 -0
- package/dist/types/node/node.d.ts +193 -0
- package/dist/types/node/platform/createFile.d.ts +9 -0
- package/dist/types/node/tunnel/allowlist.d.ts +7 -0
- package/dist/types/node/tunnel/index.d.ts +2 -0
- package/dist/types/node/upload/manifest.d.ts +23 -0
- package/dist/types/platform/adapters/browser.d.ts +14 -0
- package/dist/types/platform/adapters/edge.d.ts +5 -0
- package/dist/types/platform/adapters/node-als.d.ts +1 -0
- package/dist/types/platform/adapters/node.d.ts +15 -0
- package/dist/types/platform/adapters/universal-generic.d.ts +14 -0
- package/dist/types/platform/adapters/universal.d.ts +18 -0
- package/dist/types/platform/createFile.d.ts +10 -0
- package/dist/types/platform/createWebFile.d.ts +11 -0
- package/dist/types/platform/factory.d.ts +2 -0
- package/dist/types/platform/index.d.ts +27 -0
- package/dist/types/platform/types.d.ts +31 -0
- package/dist/types/processHooks.d.ts +2 -0
- package/dist/types/public-types.d.ts +13 -0
- package/dist/types/public.d.ts +210 -0
- package/dist/types/run.d.ts +14 -0
- package/dist/types/serializer/Serializer.d.ts +84 -0
- package/dist/types/serializer/binary-builtins.d.ts +5 -0
- package/dist/types/serializer/builtins.d.ts +47 -0
- package/dist/types/serializer/deserializer.d.ts +27 -0
- package/dist/types/serializer/error-url-builtins.d.ts +13 -0
- package/dist/types/serializer/graph-serializer.d.ts +27 -0
- package/dist/types/serializer/index.d.ts +6 -0
- package/dist/types/serializer/option-normalizers.d.ts +2 -0
- package/dist/types/serializer/regexp-validator.d.ts +34 -0
- package/dist/types/serializer/serialize-utils.d.ts +15 -0
- package/dist/types/serializer/special-values.d.ts +20 -0
- package/dist/types/serializer/tree-serializer.d.ts +20 -0
- package/dist/types/serializer/type-registry.d.ts +58 -0
- package/dist/types/serializer/types.d.ts +126 -0
- package/dist/types/serializer/validation.d.ts +34 -0
- package/dist/types/testing.d.ts +19 -0
- package/dist/types/tools/detectRunnerMode.d.ts +9 -0
- package/dist/types/tools/getCallerFile.d.ts +1 -0
- package/dist/types/tools/throws.d.ts +7 -0
- package/dist/types/tunnels/buildUniversalManifest.d.ts +24 -0
- package/dist/types/types/asyncContext.d.ts +41 -0
- package/dist/types/types/contracts.d.ts +62 -0
- package/dist/types/types/error.d.ts +39 -0
- package/dist/types/types/event.d.ts +79 -0
- package/dist/types/types/executionJournal.d.ts +29 -0
- package/dist/types/types/hook.d.ts +23 -0
- package/dist/types/types/inputFile.d.ts +34 -0
- package/dist/types/types/meta.d.ts +22 -0
- package/dist/types/types/resource.d.ts +133 -0
- package/dist/types/types/resourceMiddleware.d.ts +48 -0
- package/dist/types/types/runner.d.ts +68 -0
- package/dist/types/types/storeTypes.d.ts +46 -0
- package/dist/types/types/symbols.d.ts +34 -0
- package/dist/types/types/tag.d.ts +45 -0
- package/dist/types/types/task.d.ts +76 -0
- package/dist/types/types/taskMiddleware.d.ts +55 -0
- package/dist/types/types/utilities.d.ts +125 -0
- package/dist/universal/index.cjs +851 -476
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.mjs +849 -476
- package/dist/universal/index.mjs.map +1 -1
- package/package.json +15 -14
- package/readmes/AI.md +30 -9
- package/dist/browser/index.d.mts +0 -2919
- package/dist/browser/index.d.ts +0 -2919
- package/dist/edge/index.d.mts +0 -2919
- package/dist/edge/index.d.ts +0 -2919
- package/dist/node/node.d.mts +0 -4622
- package/dist/node/node.d.ts +0 -4622
- package/dist/universal/index.d.mts +0 -2919
- package/dist/universal/index.d.ts +0 -2919
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluelibs/runner",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "BlueLibs Runner",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/universal/index.cjs",
|
|
7
7
|
"module": "dist/universal/index.mjs",
|
|
8
|
-
"types": "dist/
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"types": "./dist/
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
12
|
"browser": {
|
|
13
13
|
"import": "./dist/browser/index.mjs",
|
|
14
14
|
"require": "./dist/browser/index.cjs",
|
|
15
15
|
"default": "./dist/browser/index.mjs"
|
|
16
16
|
},
|
|
17
17
|
"node": {
|
|
18
|
-
"types": "./dist/node/
|
|
18
|
+
"types": "./dist/types/node/index.d.ts",
|
|
19
19
|
"import": "./dist/node/node.mjs",
|
|
20
20
|
"require": "./dist/node/node.cjs"
|
|
21
21
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"default": "./dist/universal/index.mjs"
|
|
25
25
|
},
|
|
26
26
|
"./node": {
|
|
27
|
-
"types": "./dist/node/
|
|
27
|
+
"types": "./dist/types/node/index.d.ts",
|
|
28
28
|
"import": "./dist/node/node.mjs",
|
|
29
29
|
"require": "./dist/node/node.cjs",
|
|
30
30
|
"default": "./dist/node/node.mjs"
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"typesVersions": {
|
|
39
39
|
"*": {
|
|
40
40
|
"node": [
|
|
41
|
-
"dist/node/
|
|
41
|
+
"dist/types/node/index.d.ts"
|
|
42
42
|
],
|
|
43
43
|
"node/*": [
|
|
44
|
-
"dist/node
|
|
44
|
+
"dist/types/node/*"
|
|
45
45
|
],
|
|
46
46
|
"*": [
|
|
47
|
-
"dist/index.d.ts"
|
|
47
|
+
"dist/types/index.d.ts"
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
},
|
|
@@ -77,7 +77,8 @@
|
|
|
77
77
|
"node": ">=18"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
|
-
"build": "tsup --config config/tsup/tsup.config.ts --sourcemap",
|
|
80
|
+
"build": "tsup --config config/tsup/tsup.config.ts --sourcemap && npm run build:types",
|
|
81
|
+
"build:types": "tsc -p config/ts/tsconfig.types.json",
|
|
81
82
|
"build:dashboard": "node ./scripts/build-dashboard.mjs",
|
|
82
83
|
"build:dashboard:ci": "node ./scripts/build-dashboard.mjs --install",
|
|
83
84
|
"clean": "rm -rf dist",
|
|
@@ -100,9 +101,9 @@
|
|
|
100
101
|
"postbuild": "npm run guide:compose",
|
|
101
102
|
"typedoc": "typedoc --options config/typedoc/typedoc.json",
|
|
102
103
|
"benchmark": "jest --config config/jest/jest.bench.config.js --verbose --runInBand",
|
|
103
|
-
"benchmark:json": "BENCHMARK_OUTPUT=./benchmarks/benchmark-results.json NODE_OPTIONS=--expose-gc npm run benchmark",
|
|
104
|
-
"benchmark:compare": "node ./scripts/compare-benchmarks.mjs ./benchmarks/baseline.json ./benchmarks/benchmark-results.json ./benchmarks/benchmarks.config.json",
|
|
105
|
-
"guide:compose": "node ./scripts/compose-
|
|
104
|
+
"benchmark:json": "BENCHMARK_OUTPUT=./config/benchmarks/benchmark-results.json NODE_OPTIONS=--expose-gc npm run benchmark",
|
|
105
|
+
"benchmark:compare": "node ./scripts/compare-benchmarks.mjs ./config/benchmarks/baseline.json ./config/benchmarks/benchmark-results.json ./config/benchmarks/benchmarks.config.json",
|
|
106
|
+
"guide:compose": "node ./scripts/compose-guide.mjs"
|
|
106
107
|
},
|
|
107
108
|
"devDependencies": {
|
|
108
109
|
"@types/amqplib": "^0.10.7",
|
|
@@ -139,9 +140,9 @@
|
|
|
139
140
|
"typescript-eslint": "^8.51.0",
|
|
140
141
|
"zod": "^4.0.17"
|
|
141
142
|
},
|
|
142
|
-
"typings": "dist/
|
|
143
|
+
"typings": "dist/types/index.d.ts",
|
|
143
144
|
"typescript": {
|
|
144
|
-
"definition": "dist/index.d.ts"
|
|
145
|
+
"definition": "dist/types/index.d.ts"
|
|
145
146
|
},
|
|
146
147
|
"files": [
|
|
147
148
|
"dist",
|
package/readmes/AI.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
For the landing overview, see [README.md](../README.md). For the complete guide, see [FULL_GUIDE.md](./FULL_GUIDE.md).
|
|
6
6
|
|
|
7
|
-
**Durable Workflows (Node-only):** For persistence and crash recovery, see `DURABLE_WORKFLOWS.md`.
|
|
7
|
+
**Durable Workflows (Node-only):** For persistence and crash recovery, see `DURABLE_WORKFLOWS.md`. Includes `ctx.switch()` (replay-safe branching) and `durable.describe()` (DI-accurate flow shape export) — see `DURABLE_WORKFLOWS_AI.md` for quick reference.
|
|
8
8
|
|
|
9
9
|
## Serializer Safety
|
|
10
10
|
|
|
@@ -77,7 +77,7 @@ await runtime.runTask(createUser, { name: "Ada" });
|
|
|
77
77
|
|
|
78
78
|
- `r.*.with(config)` produces a configured copy of the definition.
|
|
79
79
|
- `r.*.fork(newId, { register: "keep" | "drop" | "deep", reId })` creates a new resource with a different id but the same definition. Use `register: "drop"` to avoid re-registering nested items, or `register: "deep"` to deep-fork **registered resources** with new ids via `reId` (other registerables are not kept; resource dependencies pointing to deep-forked resources are remapped to those forks). Export forked resources to use as dependencies.
|
|
80
|
-
- `run(root)` wires dependencies, runs `init`, emits lifecycle events, and returns helpers such as `runTask`, `getResourceValue`, and `dispose`.
|
|
80
|
+
- `run(root)` wires dependencies, runs `init`, emits lifecycle events, and returns helpers such as `runTask`, `getResourceValue`, `getResourceConfig`, and `dispose`.
|
|
81
81
|
- Enable verbose logging with `run(root, { debug: "verbose" })`.
|
|
82
82
|
|
|
83
83
|
### Resource Forking
|
|
@@ -113,7 +113,7 @@ const sendEmail = r
|
|
|
113
113
|
|
|
114
114
|
- `.dependencies()` accepts a literal map or function `(config) => deps`; appends (shallow-merge) by default
|
|
115
115
|
- `.middleware()` appends by default
|
|
116
|
-
- `.tags()`
|
|
116
|
+
- `.tags()` appends by default
|
|
117
117
|
- Pass `{ override: true }` to any of these methods to replace instead of append
|
|
118
118
|
- Provide result validation with `.resultSchema()` when the function returns structured data
|
|
119
119
|
|
|
@@ -307,6 +307,7 @@ const requestContext = r
|
|
|
307
307
|
.asyncContext<{ requestId: string }>("app.ctx.request")
|
|
308
308
|
// below is optional
|
|
309
309
|
.configSchema(z.object({ ... }))
|
|
310
|
+
// for tunnels mostly
|
|
310
311
|
.serialize((data) => JSON.stringify(data))
|
|
311
312
|
.parse((raw) => JSON.parse(raw))
|
|
312
313
|
.build();
|
|
@@ -317,11 +318,14 @@ await requestContext.provide({ requestId: "abc" }, async () => {
|
|
|
317
318
|
});
|
|
318
319
|
|
|
319
320
|
// Require middleware for tasks that need the context
|
|
320
|
-
r.task(
|
|
321
|
+
r.task("task").middleware([requestContext.require()]);
|
|
321
322
|
```
|
|
322
323
|
|
|
324
|
+
- Recommended ids: `{domain}.ctx.{noun}` (for example: `app.ctx.request`).
|
|
325
|
+
- `.configSchema(schema)` (optional) validates the value passed to `provide(...)`.
|
|
323
326
|
- If you don't provide `serialize`/`parse`, Runner uses its default serializer to preserve Dates, RegExp, etc.
|
|
324
327
|
- You can also inject async contexts as dependencies; the injected value is the helper itself. Contexts must be registered to be used.
|
|
328
|
+
- Optional dependencies: `dependencies({ requestContext: requestContext.optional() })` injects `undefined` if the context isn’t registered.
|
|
325
329
|
|
|
326
330
|
```ts
|
|
327
331
|
const whoAmI = r
|
|
@@ -355,9 +359,26 @@ try {
|
|
|
355
359
|
}
|
|
356
360
|
```
|
|
357
361
|
|
|
362
|
+
- Recommended ids: `{domain}.errors.{PascalCaseName}` (for example: `app.errors.InvalidCredentials`).
|
|
358
363
|
- The thrown `Error` has `name = id` and `message = format(data)`. If you don’t provide `.format(...)`, the default is `JSON.stringify(data)`.
|
|
359
364
|
- `message` is not required in the data unless your custom formatter expects it.
|
|
360
365
|
- Declare a task/resource error contract with `.throws([AppError])` (or ids). This is declarative only and does not imply DI.
|
|
366
|
+
- For HTTP/tunnel clients, you can pass an `errorRegistry` to rethrow remote errors as your typed helpers (optional):
|
|
367
|
+
|
|
368
|
+
```ts
|
|
369
|
+
import { createHttpClient, Serializer } from "@bluelibs/runner";
|
|
370
|
+
|
|
371
|
+
const client = createHttpClient({
|
|
372
|
+
baseUrl: "http://localhost:3000/__runner",
|
|
373
|
+
serializer: new Serializer(),
|
|
374
|
+
errorRegistry: new Map([[AppError.id, AppError]]),
|
|
375
|
+
});
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
Notes:
|
|
379
|
+
- `errorRegistry` is optional. If omitted, typed errors remain `TunnelError` instances.
|
|
380
|
+
- `serializer` is required for `createHttpClient`, but it is fully customizable (any `SerializerLike` works). If you use `globals.resources.httpClientFactory`, the serializer, error registry, and async contexts are auto-injected, so you can omit them from your own config.
|
|
381
|
+
- Other supported options on the same config object: `auth`, `timeoutMs`, `fetchImpl`, `onRequest`, and `contexts`.
|
|
361
382
|
|
|
362
383
|
## Overrides
|
|
363
384
|
|
|
@@ -382,7 +403,7 @@ const app = r
|
|
|
382
403
|
|
|
383
404
|
## Runtime & Lifecycle
|
|
384
405
|
|
|
385
|
-
- `run(root, options)` wires dependencies, initializes resources, and returns helpers: `runTask`, `emitEvent`, `getResourceValue`, `store`, `logger`, and `dispose`.
|
|
406
|
+
- `run(root, options)` wires dependencies, initializes resources, and returns helpers: `runTask`, `emitEvent`, `getResourceValue`, `getResourceConfig`, `store`, `logger`, and `dispose`.
|
|
386
407
|
- Run options highlights: `debug` (normal/verbose or custom config), `logs` (printThreshold/strategy/buffer), `errorBoundary` and `onUnhandledError`, `shutdownHooks`, `dryRun`.
|
|
387
408
|
- Task interceptors: inside resource init, call `deps.someTask.intercept(async (next, input) => next(input))` to wrap a single task execution at runtime (runs inside middleware; won’t run if middleware short-circuits).
|
|
388
409
|
- Shutdown hooks: install signal listeners to call `dispose` (default in `run`).
|
|
@@ -477,13 +498,13 @@ const serializerSetup = r
|
|
|
477
498
|
.build();
|
|
478
499
|
```
|
|
479
500
|
|
|
480
|
-
Use `
|
|
501
|
+
Use `new Serializer()` when you need a standalone instance outside DI.
|
|
481
502
|
|
|
482
503
|
Note on files: The “File” you see in tunnels is not a custom serializer type. Runner uses a dedicated `$runnerFile: "File"` sentinel in inputs which the tunnel client/server convert to multipart streams via a manifest. File handling is performed by the tunnel layer (manifest hydration and multipart), not by the serializer. Keep using `createWebFile`/`createNodeFile` for uploads.
|
|
483
504
|
|
|
484
505
|
## Testing
|
|
485
506
|
|
|
486
|
-
- In unit tests, prefer running a minimal root resource and call `await run(root)` to get `runTask`, `emitEvent`, or `
|
|
507
|
+
- In unit tests, prefer running a minimal root resource and call `await run(root)` to get `runTask`, `emitEvent`, `getResourceValue`, or `getResourceConfig`.
|
|
487
508
|
- The Jest runner has a watchdog (`JEST_WATCHDOG_MS`, default 10 minutes) to avoid "hung test run" situations.
|
|
488
509
|
- For durable workflow tests, use `createDurableTestSetup` from `@bluelibs/runner/node` for fast, in-memory execution.
|
|
489
510
|
|
|
@@ -512,12 +533,12 @@ test("sends welcome email", async () => {
|
|
|
512
533
|
## Metadata & Namespacing
|
|
513
534
|
|
|
514
535
|
- Meta: `.meta({ title, description })` on tasks/resources/events/middleware for human-friendly docs and tooling; extend meta types via module augmentation when needed.
|
|
515
|
-
- Namespacing: keep ids consistent with `domain.resources.name`, `domain.tasks.name`, `domain.events.name`, `domain.hooks.on-name`,
|
|
536
|
+
- Namespacing: keep ids consistent with `domain.resources.name`, `domain.tasks.name`, `domain.events.name`, `domain.hooks.on-name`, `domain.middleware.{task|resource}.name`, `domain.errors.ErrorName`, and `domain.ctx.name`.
|
|
516
537
|
- Runtime validation: `inputSchema`, `resultSchema`, `payloadSchema`, `configSchema` share the same `parse(input)` contract; config validation happens on `.with()`, task/event validation happens on call/emit.
|
|
517
538
|
|
|
518
539
|
## Advanced Patterns
|
|
519
540
|
|
|
520
|
-
- **Optional dependencies:** mark dependencies as optional (`analytics: analyticsService.optional()`) so the builder injects `
|
|
541
|
+
- **Optional dependencies:** mark dependencies as optional (`analytics: analyticsService.optional()`) so the builder injects `undefined` when the resource is absent.
|
|
521
542
|
- **Conditional registration:** `.register((config) => (config.enableFeature ? [featureResource] : []))`.
|
|
522
543
|
- **Async coordination:** `Semaphore` (O(1) linked queue for heavy contention) and `Queue` live in the main package. Both use isolated EventManagers internally for their lifecycle events, separate from the global EventManager used for business-level application events.
|
|
523
544
|
- **Event safety:** Runner detects event emission cycles and throws an `EventCycleError` with the offending chain.
|