@rotorsoft/act 1.16.1 → 1.18.0
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/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts +0 -9
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/adapters/in-memory-store.d.ts +10 -0
- package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
- package/dist/@types/builders/act-builder.d.ts +3 -6
- package/dist/@types/builders/act-builder.d.ts.map +1 -1
- package/dist/@types/builders/slice-builder.d.ts +16 -8
- package/dist/@types/builders/slice-builder.d.ts.map +1 -1
- package/dist/@types/builders/state-builder.d.ts +19 -26
- package/dist/@types/builders/state-builder.d.ts.map +1 -1
- package/dist/@types/index.d.ts +1 -0
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-policy.d.ts +16 -0
- package/dist/@types/internal/autoclose-policy.d.ts.map +1 -1
- package/dist/@types/internal/builder-utils.d.ts +65 -0
- package/dist/@types/internal/builder-utils.d.ts.map +1 -0
- package/dist/@types/internal/close-signal.d.ts +51 -0
- package/dist/@types/internal/close-signal.d.ts.map +1 -0
- package/dist/@types/internal/defer-config.d.ts +64 -0
- package/dist/@types/internal/defer-config.d.ts.map +1 -0
- package/dist/@types/internal/defer-signal.d.ts +35 -0
- package/dist/@types/internal/defer-signal.d.ts.map +1 -0
- package/dist/@types/internal/defer-timer.d.ts +67 -0
- package/dist/@types/internal/defer-timer.d.ts.map +1 -0
- package/dist/@types/internal/drain-cycle.d.ts +39 -17
- package/dist/@types/internal/drain-cycle.d.ts.map +1 -1
- package/dist/@types/internal/drain.d.ts +3 -1
- package/dist/@types/internal/drain.d.ts.map +1 -1
- package/dist/@types/internal/index.d.ts +7 -5
- package/dist/@types/internal/index.d.ts.map +1 -1
- package/dist/@types/internal/reactions.d.ts.map +1 -1
- package/dist/@types/internal/tracing.d.ts.map +1 -1
- package/dist/@types/types/action.d.ts +36 -0
- package/dist/@types/types/action.d.ts.map +1 -1
- package/dist/@types/types/ports.d.ts +31 -0
- package/dist/@types/types/ports.d.ts.map +1 -1
- package/dist/{chunk-46OCUAVF.js → chunk-7XME4ZLK.js} +52 -2
- package/dist/chunk-7XME4ZLK.js.map +1 -0
- package/dist/index.cjs +852 -754
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +728 -681
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +55 -5
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +5 -5
- package/dist/test/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/@types/internal/autoclose-cycle.d.ts +0 -185
- package/dist/@types/internal/autoclose-cycle.d.ts.map +0 -1
- package/dist/chunk-46OCUAVF.js.map +0 -1
package/dist/test/index.cjs
CHANGED
|
@@ -3835,7 +3835,7 @@ function manageArtifactAttachment(attachment) {
|
|
|
3835
3835
|
}
|
|
3836
3836
|
}
|
|
3837
3837
|
|
|
3838
|
-
// ../../node_modules/.pnpm/vite@8.
|
|
3838
|
+
// ../../node_modules/.pnpm/vite@8.1.0_@types+node@25.9.4_esbuild@0.28.1_jiti@2.7.0_terser@5.46.1_tsx@4.22.4_yaml@2.9.0/node_modules/vite/dist/node/module-runner.js
|
|
3839
3839
|
var SOURCEMAPPING_URL = "sourceMa";
|
|
3840
3840
|
SOURCEMAPPING_URL += "ppingURL";
|
|
3841
3841
|
var isWindows = typeof process < "u" && process.platform === "win32";
|
|
@@ -3844,8 +3844,8 @@ var AsyncFunction = async function() {
|
|
|
3844
3844
|
var textDecoder = new TextDecoder();
|
|
3845
3845
|
var decodeBase64 = typeof Buffer == "function" && typeof Buffer.from == "function" ? (base64) => Buffer.from(base64, "base64").toString("utf-8") : (base64) => textDecoder.decode(Uint8Array.from(atob(base64), (c) => c.charCodeAt(0)));
|
|
3846
3846
|
var chars2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
3847
|
-
var intToChar2 = new Uint8Array(64);
|
|
3848
|
-
var charToInt2 = new Uint8Array(128);
|
|
3847
|
+
var intToChar2 = /* @__PURE__ */ new Uint8Array(64);
|
|
3848
|
+
var charToInt2 = /* @__PURE__ */ new Uint8Array(128);
|
|
3849
3849
|
for (let i2 = 0; i2 < chars2.length; i2++) {
|
|
3850
3850
|
let c = chars2.charCodeAt(i2);
|
|
3851
3851
|
intToChar2[i2] = c, charToInt2[c] = i2;
|
|
@@ -3881,7 +3881,7 @@ var envProxy = new Proxy({}, { get(_, p) {
|
|
|
3881
3881
|
throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
|
|
3882
3882
|
} });
|
|
3883
3883
|
|
|
3884
|
-
// ../../node_modules/.pnpm/vitest@4.1.9_@types+node@25.9.4_@vitest+coverage-v8@4.1.9_vite@8.
|
|
3884
|
+
// ../../node_modules/.pnpm/vitest@4.1.9_@types+node@25.9.4_@vitest+coverage-v8@4.1.9_vite@8.1.0_@types+node@25.9.4_4c1febd687429ee725e54d984bfb3460/node_modules/vitest/dist/index.js
|
|
3885
3885
|
var import_expect_type = __toESM(require_dist(), 1);
|
|
3886
3886
|
|
|
3887
3887
|
// src/internal/lru-map.ts
|
|
@@ -4316,6 +4316,11 @@ var InMemoryStream = class {
|
|
|
4316
4316
|
_leased_until = void 0;
|
|
4317
4317
|
_priority = 0;
|
|
4318
4318
|
_lane = DEFAULT_LANE;
|
|
4319
|
+
// Persisted next-visit time (#1090). When set and still in the future, the
|
|
4320
|
+
// stream is held out of `claim` entirely — so a deferred reaction is not
|
|
4321
|
+
// re-claimed (and `retry` is never bumped) until its due-time passes. Unlike
|
|
4322
|
+
// in-process backoff, this is durable store state shared across workers.
|
|
4323
|
+
_deferred_at = void 0;
|
|
4319
4324
|
constructor(stream, source, priority = 0, lane = DEFAULT_LANE) {
|
|
4320
4325
|
this.stream = stream;
|
|
4321
4326
|
this.source = source;
|
|
@@ -4347,7 +4352,17 @@ var InMemoryStream = class {
|
|
|
4347
4352
|
this._priority = priority;
|
|
4348
4353
|
}
|
|
4349
4354
|
get is_available() {
|
|
4350
|
-
return !this._blocked && (!this._leased_until || this._leased_until <= /* @__PURE__ */ new Date())
|
|
4355
|
+
return !this._blocked && (!this._leased_until || this._leased_until <= /* @__PURE__ */ new Date()) && // A stream deferred to a future time is not claimable until due (#1090).
|
|
4356
|
+
(!this._deferred_at || this._deferred_at <= Date.now());
|
|
4357
|
+
}
|
|
4358
|
+
/**
|
|
4359
|
+
* Hold this stream out of `claim` until `deferred_at` (ms since epoch).
|
|
4360
|
+
* Set by a deliberate `defer` outcome — not a failure, so retry/blocked
|
|
4361
|
+
* state is untouched. Cleared by ack/block/reset/unblock.
|
|
4362
|
+
*/
|
|
4363
|
+
defer(deferred_at) {
|
|
4364
|
+
this._deferred_at = deferred_at;
|
|
4365
|
+
this._retry = -1;
|
|
4351
4366
|
}
|
|
4352
4367
|
get at() {
|
|
4353
4368
|
return this._at;
|
|
@@ -4399,6 +4414,7 @@ var InMemoryStream = class {
|
|
|
4399
4414
|
this._leased_until = void 0;
|
|
4400
4415
|
this._at = lease.at;
|
|
4401
4416
|
this._retry = -1;
|
|
4417
|
+
this._deferred_at = void 0;
|
|
4402
4418
|
return {
|
|
4403
4419
|
stream: this.stream,
|
|
4404
4420
|
source: this.source,
|
|
@@ -4419,6 +4435,7 @@ var InMemoryStream = class {
|
|
|
4419
4435
|
if (this._leased_by === lease.by) {
|
|
4420
4436
|
this._blocked = true;
|
|
4421
4437
|
this._error = error;
|
|
4438
|
+
this._deferred_at = void 0;
|
|
4422
4439
|
return {
|
|
4423
4440
|
stream: this.stream,
|
|
4424
4441
|
source: this.source,
|
|
@@ -4443,6 +4460,7 @@ var InMemoryStream = class {
|
|
|
4443
4460
|
this._error = "";
|
|
4444
4461
|
this._leased_by = void 0;
|
|
4445
4462
|
this._leased_until = void 0;
|
|
4463
|
+
this._deferred_at = void 0;
|
|
4446
4464
|
}
|
|
4447
4465
|
/**
|
|
4448
4466
|
* Clear the blocked flag and lease bookkeeping without touching the
|
|
@@ -4456,6 +4474,7 @@ var InMemoryStream = class {
|
|
|
4456
4474
|
this._error = "";
|
|
4457
4475
|
this._leased_by = void 0;
|
|
4458
4476
|
this._leased_until = void 0;
|
|
4477
|
+
this._deferred_at = void 0;
|
|
4459
4478
|
return true;
|
|
4460
4479
|
}
|
|
4461
4480
|
};
|
|
@@ -4735,6 +4754,37 @@ var InMemoryStore = class {
|
|
|
4735
4754
|
await sleep();
|
|
4736
4755
|
return leases.map((l) => this._streams.get(l.stream)?.block(l, l.error)).filter((l) => !!l);
|
|
4737
4756
|
}
|
|
4757
|
+
/**
|
|
4758
|
+
* Hold the matched streams out of {@link claim} until `deferred_at`
|
|
4759
|
+
* (ms since epoch) — see {@link Store.defer}. Accepts an explicit list
|
|
4760
|
+
* of names or a {@link StreamFilter}, mirroring {@link reset}/{@link unblock}.
|
|
4761
|
+
* Persisted store state (unlike in-process backoff), so the skip is honored
|
|
4762
|
+
* by every competing worker. Unknown names are silently skipped.
|
|
4763
|
+
*
|
|
4764
|
+
* @returns Count of streams whose `deferred_at` was set.
|
|
4765
|
+
*/
|
|
4766
|
+
async defer(input, deferred_at) {
|
|
4767
|
+
await sleep();
|
|
4768
|
+
let count = 0;
|
|
4769
|
+
if (Array.isArray(input)) {
|
|
4770
|
+
for (const name of input) {
|
|
4771
|
+
const s = this._streams.get(name);
|
|
4772
|
+
if (s) {
|
|
4773
|
+
s.defer(deferred_at);
|
|
4774
|
+
count++;
|
|
4775
|
+
}
|
|
4776
|
+
}
|
|
4777
|
+
} else {
|
|
4778
|
+
const matches = this._filter_predicate(input);
|
|
4779
|
+
for (const s of this._streams.values()) {
|
|
4780
|
+
if (matches(s)) {
|
|
4781
|
+
s.defer(deferred_at);
|
|
4782
|
+
count++;
|
|
4783
|
+
}
|
|
4784
|
+
}
|
|
4785
|
+
}
|
|
4786
|
+
return count;
|
|
4787
|
+
}
|
|
4738
4788
|
/**
|
|
4739
4789
|
* Build a predicate from a {@link StreamFilter}. Compiled regexes are
|
|
4740
4790
|
* cached in the closure so callers can apply it across the streams
|