@cadenza.io/core 1.11.15 → 1.11.16

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/dist/index.js CHANGED
@@ -3133,26 +3133,28 @@ var Cadenza = class {
3133
3133
  * @returns The created Task instance.
3134
3134
  * @throws Error if name is invalid or duplicate in registry.
3135
3135
  */
3136
- static createTask(name, func, description, options = {
3137
- concurrency: 0,
3138
- timeout: 0,
3139
- register: true,
3140
- isUnique: false,
3141
- isMeta: false,
3142
- isSubMeta: false,
3143
- isHidden: false,
3144
- getTagCallback: void 0,
3145
- inputSchema: void 0,
3146
- validateInputContext: false,
3147
- outputSchema: void 0,
3148
- validateOutputContext: false,
3149
- retryCount: 0,
3150
- retryDelay: 0,
3151
- retryDelayMax: 0,
3152
- retryDelayFactor: 1
3153
- }) {
3136
+ static createTask(name, func, description, options = {}) {
3154
3137
  this.bootstrap();
3155
3138
  this.validateName(name);
3139
+ options = {
3140
+ concurrency: 0,
3141
+ timeout: 0,
3142
+ register: true,
3143
+ isUnique: false,
3144
+ isMeta: false,
3145
+ isSubMeta: false,
3146
+ isHidden: false,
3147
+ getTagCallback: void 0,
3148
+ inputSchema: void 0,
3149
+ validateInputContext: false,
3150
+ outputSchema: void 0,
3151
+ validateOutputContext: false,
3152
+ retryCount: 0,
3153
+ retryDelay: 0,
3154
+ retryDelayMax: 0,
3155
+ retryDelayFactor: 1,
3156
+ ...options
3157
+ };
3156
3158
  return new Task(
3157
3159
  name,
3158
3160
  func,
@@ -3185,24 +3187,7 @@ var Cadenza = class {
3185
3187
  * @returns The created MetaTask instance.
3186
3188
  * @throws Error if name invalid or duplicate.
3187
3189
  */
3188
- static createMetaTask(name, func, description, options = {
3189
- concurrency: 0,
3190
- timeout: 0,
3191
- register: true,
3192
- isUnique: false,
3193
- isMeta: true,
3194
- isSubMeta: false,
3195
- isHidden: false,
3196
- getTagCallback: void 0,
3197
- inputSchema: void 0,
3198
- validateInputContext: false,
3199
- outputSchema: void 0,
3200
- validateOutputContext: false,
3201
- retryCount: 0,
3202
- retryDelay: 0,
3203
- retryDelayMax: 0,
3204
- retryDelayFactor: 1
3205
- }) {
3190
+ static createMetaTask(name, func, description, options = {}) {
3206
3191
  options.isMeta = true;
3207
3192
  return this.createTask(name, func, description, options);
3208
3193
  }
@@ -3216,24 +3201,7 @@ var Cadenza = class {
3216
3201
  * @returns The created UniqueTask.
3217
3202
  * @throws Error if invalid.
3218
3203
  */
3219
- static createUniqueTask(name, func, description, options = {
3220
- concurrency: 0,
3221
- timeout: 0,
3222
- register: true,
3223
- isUnique: true,
3224
- isMeta: false,
3225
- isSubMeta: false,
3226
- isHidden: false,
3227
- getTagCallback: void 0,
3228
- inputSchema: void 0,
3229
- validateInputContext: false,
3230
- outputSchema: void 0,
3231
- validateOutputContext: false,
3232
- retryCount: 0,
3233
- retryDelay: 0,
3234
- retryDelayMax: 0,
3235
- retryDelayFactor: 1
3236
- }) {
3204
+ static createUniqueTask(name, func, description, options = {}) {
3237
3205
  options.isUnique = true;
3238
3206
  return this.createTask(name, func, description, options);
3239
3207
  }
@@ -3245,25 +3213,9 @@ var Cadenza = class {
3245
3213
  * @param options Optional task options.
3246
3214
  * @returns The created UniqueMetaTask.
3247
3215
  */
3248
- static createUniqueMetaTask(name, func, description, options = {
3249
- concurrency: 0,
3250
- timeout: 0,
3251
- register: true,
3252
- isUnique: true,
3253
- isMeta: true,
3254
- isSubMeta: false,
3255
- isHidden: false,
3256
- getTagCallback: void 0,
3257
- inputSchema: void 0,
3258
- validateInputContext: false,
3259
- outputSchema: void 0,
3260
- validateOutputContext: false,
3261
- retryCount: 0,
3262
- retryDelay: 0,
3263
- retryDelayMax: 0,
3264
- retryDelayFactor: 1
3265
- }) {
3216
+ static createUniqueMetaTask(name, func, description, options = {}) {
3266
3217
  options.isMeta = true;
3218
+ options.isUnique = true;
3267
3219
  return this.createUniqueTask(name, func, description, options);
3268
3220
  }
3269
3221
  /**
@@ -3276,23 +3228,8 @@ var Cadenza = class {
3276
3228
  * @returns The created ThrottledTask.
3277
3229
  * @edge If no getter, throttles per task ID; use for resource protection.
3278
3230
  */
3279
- static createThrottledTask(name, func, throttledIdGetter = () => "default", description, options = {
3280
- concurrency: 1,
3281
- timeout: 0,
3282
- register: true,
3283
- isUnique: false,
3284
- isMeta: false,
3285
- isSubMeta: false,
3286
- isHidden: false,
3287
- inputSchema: void 0,
3288
- validateInputContext: false,
3289
- outputSchema: void 0,
3290
- validateOutputContext: false,
3291
- retryCount: 0,
3292
- retryDelay: 0,
3293
- retryDelayMax: 0,
3294
- retryDelayFactor: 1
3295
- }) {
3231
+ static createThrottledTask(name, func, throttledIdGetter = () => "default", description, options = {}) {
3232
+ options.concurrency = 1;
3296
3233
  options.getTagCallback = throttledIdGetter;
3297
3234
  return this.createTask(name, func, description, options);
3298
3235
  }
@@ -3305,23 +3242,7 @@ var Cadenza = class {
3305
3242
  * @param options Optional task options.
3306
3243
  * @returns The created ThrottledMetaTask.
3307
3244
  */
3308
- static createThrottledMetaTask(name, func, throttledIdGetter, description, options = {
3309
- concurrency: 0,
3310
- timeout: 0,
3311
- register: true,
3312
- isUnique: false,
3313
- isMeta: true,
3314
- isSubMeta: false,
3315
- isHidden: false,
3316
- inputSchema: void 0,
3317
- validateInputContext: false,
3318
- outputSchema: void 0,
3319
- validateOutputContext: false,
3320
- retryCount: 0,
3321
- retryDelay: 0,
3322
- retryDelayMax: 0,
3323
- retryDelayFactor: 1
3324
- }) {
3245
+ static createThrottledMetaTask(name, func, throttledIdGetter, description, options = {}) {
3325
3246
  options.isMeta = true;
3326
3247
  return this.createThrottledTask(
3327
3248
  name,
@@ -3341,24 +3262,26 @@ var Cadenza = class {
3341
3262
  * @returns The created DebounceTask.
3342
3263
  * @edge Multiple triggers within time collapse to one exec.
3343
3264
  */
3344
- static createDebounceTask(name, func, description, debounceTime = 1e3, options = {
3345
- concurrency: 0,
3346
- timeout: 0,
3347
- register: true,
3348
- leading: false,
3349
- trailing: true,
3350
- maxWait: 0,
3351
- isUnique: false,
3352
- isMeta: false,
3353
- isSubMeta: false,
3354
- isHidden: false,
3355
- inputSchema: void 0,
3356
- validateInputContext: false,
3357
- outputSchema: void 0,
3358
- validateOutputContext: false
3359
- }) {
3265
+ static createDebounceTask(name, func, description, debounceTime = 1e3, options = {}) {
3360
3266
  this.bootstrap();
3361
3267
  this.validateName(name);
3268
+ options = {
3269
+ concurrency: 0,
3270
+ timeout: 0,
3271
+ register: true,
3272
+ leading: false,
3273
+ trailing: true,
3274
+ maxWait: 0,
3275
+ isUnique: false,
3276
+ isMeta: false,
3277
+ isSubMeta: false,
3278
+ isHidden: false,
3279
+ inputSchema: void 0,
3280
+ validateInputContext: false,
3281
+ outputSchema: void 0,
3282
+ validateOutputContext: false,
3283
+ ...options
3284
+ };
3362
3285
  return new DebounceTask(
3363
3286
  name,
3364
3287
  func,
@@ -3389,22 +3312,7 @@ var Cadenza = class {
3389
3312
  * @param options Optional task options plus optional debounce config (e.g., leading/trailing).
3390
3313
  * @returns The created DebouncedMetaTask.
3391
3314
  */
3392
- static createDebounceMetaTask(name, func, description, debounceTime = 1e3, options = {
3393
- concurrency: 0,
3394
- timeout: 0,
3395
- register: true,
3396
- leading: false,
3397
- trailing: true,
3398
- maxWait: 0,
3399
- isUnique: false,
3400
- isMeta: false,
3401
- isSubMeta: false,
3402
- isHidden: false,
3403
- inputSchema: void 0,
3404
- validateInputContext: false,
3405
- outputSchema: void 0,
3406
- validateOutputContext: false
3407
- }) {
3315
+ static createDebounceMetaTask(name, func, description, debounceTime = 1e3, options = {}) {
3408
3316
  options.isMeta = true;
3409
3317
  return this.createDebounceTask(
3410
3318
  name,
@@ -3424,28 +3332,30 @@ var Cadenza = class {
3424
3332
  * @returns The created EphemeralTask.
3425
3333
  * @edge Destruction triggered post-exec via Node/Builder; emits meta-signal for cleanup.
3426
3334
  */
3427
- static createEphemeralTask(name, func, description, options = {
3428
- concurrency: 0,
3429
- timeout: 0,
3430
- register: true,
3431
- isUnique: false,
3432
- isMeta: false,
3433
- isSubMeta: false,
3434
- isHidden: false,
3435
- once: true,
3436
- destroyCondition: () => true,
3437
- getTagCallback: void 0,
3438
- inputSchema: void 0,
3439
- validateInputContext: false,
3440
- outputSchema: void 0,
3441
- validateOutputContext: false,
3442
- retryCount: 0,
3443
- retryDelay: 0,
3444
- retryDelayMax: 0,
3445
- retryDelayFactor: 1
3446
- }) {
3335
+ static createEphemeralTask(name, func, description, options = {}) {
3447
3336
  this.bootstrap();
3448
3337
  this.validateName(name);
3338
+ options = {
3339
+ concurrency: 0,
3340
+ timeout: 0,
3341
+ register: true,
3342
+ isUnique: false,
3343
+ isMeta: false,
3344
+ isSubMeta: false,
3345
+ isHidden: false,
3346
+ once: true,
3347
+ destroyCondition: () => true,
3348
+ getTagCallback: void 0,
3349
+ inputSchema: void 0,
3350
+ validateInputContext: false,
3351
+ outputSchema: void 0,
3352
+ validateOutputContext: false,
3353
+ retryCount: 0,
3354
+ retryDelay: 0,
3355
+ retryDelayMax: 0,
3356
+ retryDelayFactor: 1,
3357
+ ...options
3358
+ };
3449
3359
  return new EphemeralTask(
3450
3360
  name,
3451
3361
  func,
@@ -3478,26 +3388,7 @@ var Cadenza = class {
3478
3388
  * @param options Optional task options plus optional "once" (true) and "destroyCondition" (ctx => boolean).
3479
3389
  * @returns The created EphemeralMetaTask.
3480
3390
  */
3481
- static createEphemeralMetaTask(name, func, description, options = {
3482
- concurrency: 0,
3483
- timeout: 0,
3484
- register: true,
3485
- isUnique: false,
3486
- isMeta: true,
3487
- isSubMeta: false,
3488
- isHidden: false,
3489
- once: true,
3490
- destroyCondition: () => true,
3491
- getTagCallback: void 0,
3492
- inputSchema: void 0,
3493
- validateInputContext: false,
3494
- outputSchema: void 0,
3495
- validateOutputContext: false,
3496
- retryCount: 0,
3497
- retryDelay: 0,
3498
- retryDelayMax: 0,
3499
- retryDelayFactor: 1
3500
- }) {
3391
+ static createEphemeralMetaTask(name, func, description, options = {}) {
3501
3392
  options.isMeta = true;
3502
3393
  return this.createEphemeralTask(name, func, description, options);
3503
3394
  }