@rotorsoft/act 0.43.0 → 0.44.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.
@@ -3831,7 +3831,7 @@ function manageArtifactAttachment(attachment) {
3831
3831
  }
3832
3832
  }
3833
3833
 
3834
- // ../../node_modules/.pnpm/vite@7.3.3_@types+node@25.7.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.22.0_yaml@2.9.0/node_modules/vite/dist/node/module-runner.js
3834
+ // ../../node_modules/.pnpm/vite@7.3.3_@types+node@25.7.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.22.1_yaml@2.9.0/node_modules/vite/dist/node/module-runner.js
3835
3835
  var SOURCEMAPPING_URL = "sourceMa";
3836
3836
  SOURCEMAPPING_URL += "ppingURL";
3837
3837
  var isWindows = typeof process < "u" && process.platform === "win32";
@@ -3876,7 +3876,7 @@ var envProxy = new Proxy({}, { get(_, p) {
3876
3876
  throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
3877
3877
  } });
3878
3878
 
3879
- // ../../node_modules/.pnpm/vitest@4.1.6_@opentelemetry+api@1.9.0_@types+node@25.7.0_@vitest+coverage-v8@4.1.6_vite_e55bbfcaf248f5e226d3dcf8ee1c3ee4/node_modules/vitest/dist/index.js
3879
+ // ../../node_modules/.pnpm/vitest@4.1.6_@opentelemetry+api@1.9.0_@types+node@25.7.0_@vitest+coverage-v8@4.1.6_vite_5a29b11e99a57208a40f952e13f6979b/node_modules/vitest/dist/index.js
3880
3880
  var import_expect_type = __toESM(require_dist(), 1);
3881
3881
 
3882
3882
  // src/internal/lru-map.ts
@@ -4787,6 +4787,77 @@ var InMemoryStore = class {
4787
4787
  }
4788
4788
  return { maxEventId: this._events.length - 1, count };
4789
4789
  }
4790
+ /**
4791
+ * Per-stream aggregated stats — see {@link Store.query_stats}.
4792
+ *
4793
+ * Single forward scan over the in-memory event list, accumulating per
4794
+ * stream. The "cheap heads" cost tier from durable adapters doesn't
4795
+ * apply here (InMemory has no indexes); correctness is the goal, perf
4796
+ * is a non-issue.
4797
+ *
4798
+ * Scope rules:
4799
+ * - Array `input` — explicit stream names, regardless of subscription.
4800
+ * - Filter `input` — `stream`/`stream_exact` match against event-bearing
4801
+ * stream names; `source`/`source_exact`/`blocked` require a
4802
+ * corresponding subscription in `_streams` (those are subscription
4803
+ * concepts, not event concepts). Empty filter `{}` matches every
4804
+ * event-bearing stream.
4805
+ */
4806
+ async query_stats(input, options) {
4807
+ await sleep();
4808
+ const exclude = new Set(options?.exclude ?? []);
4809
+ const wantTail = options?.tail ?? false;
4810
+ const wantCount = options?.count ?? false;
4811
+ const wantNames = options?.names ?? false;
4812
+ const before = options?.before;
4813
+ const arrayTargets = Array.isArray(input) ? new Set(input) : null;
4814
+ const filter = Array.isArray(input) ? null : input;
4815
+ const streamRe = filter?.stream && !filter.stream_exact ? new RegExp(filter.stream) : void 0;
4816
+ const scopeCache = /* @__PURE__ */ new Map();
4817
+ const inScope = (stream) => {
4818
+ const cached = scopeCache.get(stream);
4819
+ if (cached !== void 0) return cached;
4820
+ let ok = true;
4821
+ if (arrayTargets) {
4822
+ ok = arrayTargets.has(stream);
4823
+ } else if (filter?.stream !== void 0) {
4824
+ ok = filter.stream_exact ? stream === filter.stream : (
4825
+ // biome-ignore lint/style/noNonNullAssertion: streamRe set when stream is regex
4826
+ streamRe.test(stream)
4827
+ );
4828
+ }
4829
+ scopeCache.set(stream, ok);
4830
+ return ok;
4831
+ };
4832
+ const acc = /* @__PURE__ */ new Map();
4833
+ for (const e of this._events) {
4834
+ if (before !== void 0 && e.id >= before) continue;
4835
+ if (!inScope(e.stream)) continue;
4836
+ if (exclude.has(e.name)) continue;
4837
+ let a = acc.get(e.stream);
4838
+ if (!a) {
4839
+ a = { head: e, count: 0 };
4840
+ if (wantTail) a.tail = e;
4841
+ if (wantNames) a.names = {};
4842
+ acc.set(e.stream, a);
4843
+ }
4844
+ a.head = e;
4845
+ a.count++;
4846
+ if (wantNames) {
4847
+ const n = String(e.name);
4848
+ a.names[n] = (a.names[n] ?? 0) + 1;
4849
+ }
4850
+ }
4851
+ const out = /* @__PURE__ */ new Map();
4852
+ for (const [stream, a] of acc) {
4853
+ const stats = { head: a.head };
4854
+ if (wantTail) stats.tail = a.tail;
4855
+ if (wantCount) stats.count = a.count;
4856
+ if (wantNames) stats.names = a.names;
4857
+ out.set(stream, stats);
4858
+ }
4859
+ return out;
4860
+ }
4790
4861
  /**
4791
4862
  * Atomically truncates streams and seeds each with a snapshot or tombstone.
4792
4863
  * @param targets - Streams to truncate with optional snapshot state and meta.