@rotorsoft/act 1.3.0 → 1.5.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.
Files changed (36) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/@types/act.d.ts +28 -3
  3. package/dist/@types/act.d.ts.map +1 -1
  4. package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
  5. package/dist/@types/internal/correlate-cycle.d.ts +6 -6
  6. package/dist/@types/internal/correlate-cycle.d.ts.map +1 -1
  7. package/dist/@types/internal/drain-cycle.d.ts +1 -1
  8. package/dist/@types/internal/drain-cycle.d.ts.map +1 -1
  9. package/dist/@types/internal/event-sourcing.d.ts +11 -21
  10. package/dist/@types/internal/event-sourcing.d.ts.map +1 -1
  11. package/dist/@types/internal/lru-map.d.ts +2 -2
  12. package/dist/@types/internal/lru-map.d.ts.map +1 -1
  13. package/dist/@types/internal/settle.d.ts +3 -5
  14. package/dist/@types/internal/settle.d.ts.map +1 -1
  15. package/dist/@types/types/action.d.ts +21 -5
  16. package/dist/@types/types/action.d.ts.map +1 -1
  17. package/dist/@types/types/errors.d.ts +4 -30
  18. package/dist/@types/types/errors.d.ts.map +1 -1
  19. package/dist/{chunk-XKCTGUW2.js → chunk-I4L224TZ.js} +15 -12
  20. package/dist/chunk-I4L224TZ.js.map +1 -0
  21. package/dist/{chunk-TZWDSNSN.js → chunk-PMAZTOSO.js} +31 -5
  22. package/dist/chunk-PMAZTOSO.js.map +1 -0
  23. package/dist/index.cjs +281 -246
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.js +240 -234
  26. package/dist/index.js.map +1 -1
  27. package/dist/test/index.cjs +34 -16
  28. package/dist/test/index.cjs.map +1 -1
  29. package/dist/test/index.js +7 -6
  30. package/dist/test/index.js.map +1 -1
  31. package/dist/types/index.cjs +30 -4
  32. package/dist/types/index.cjs.map +1 -1
  33. package/dist/types/index.js +1 -1
  34. package/package.json +2 -2
  35. package/dist/chunk-TZWDSNSN.js.map +0 -1
  36. package/dist/chunk-XKCTGUW2.js.map +0 -1
@@ -3831,12 +3831,14 @@ function manageArtifactAttachment(attachment) {
3831
3831
  }
3832
3832
  }
3833
3833
 
3834
- // ../../node_modules/.pnpm/vite@7.3.3_@types+node@25.9.1_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.22.3_yaml@2.9.0/node_modules/vite/dist/node/module-runner.js
3834
+ // ../../node_modules/.pnpm/vite@8.0.14_@types+node@25.9.1_esbuild@0.27.2_jiti@2.6.1_terser@5.46.1_tsx@4.22.3_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";
3838
3838
  var AsyncFunction = async function() {
3839
3839
  }.constructor;
3840
+ var textDecoder = new TextDecoder();
3841
+ 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)));
3840
3842
  var chars2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
3841
3843
  var intToChar2 = new Uint8Array(64);
3842
3844
  var charToInt2 = new Uint8Array(128);
@@ -3844,7 +3846,7 @@ for (let i2 = 0; i2 < chars2.length; i2++) {
3844
3846
  let c = chars2.charCodeAt(i2);
3845
3847
  intToChar2[i2] = c, charToInt2[c] = i2;
3846
3848
  }
3847
- var MODULE_RUNNER_SOURCEMAPPING_REGEXP = /* @__PURE__ */ RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
3849
+ var MODULE_RUNNER_SOURCEMAPPING_REGEXP = RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
3848
3850
  var retrieveFileHandlers = /* @__PURE__ */ new Set();
3849
3851
  var retrieveSourceMapHandlers = /* @__PURE__ */ new Set();
3850
3852
  var createExecHandlers = (handlers) => ((...args) => {
@@ -3871,20 +3873,20 @@ export async function resolve(specifier, context, nextResolve) {
3871
3873
  }
3872
3874
 
3873
3875
  `;
3874
- `${customizationHookNamespace}`;
3875
3876
  var envProxy = new Proxy({}, { get(_, p) {
3876
3877
  throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
3877
3878
  } });
3878
3879
 
3879
- // ../../node_modules/.pnpm/vitest@4.1.7_@opentelemetry+api@1.9.0_@types+node@25.9.1_@vitest+coverage-v8@4.1.7_vite_a8a01b4003196882187ed5d804d1f0c5/node_modules/vitest/dist/index.js
3880
+ // ../../node_modules/.pnpm/vitest@4.1.7_@types+node@25.9.1_@vitest+coverage-v8@4.1.7_vite@8.0.14_@types+node@25.9._80d5839fc632fdcd9de039dffc6761e7/node_modules/vitest/dist/index.js
3880
3881
  var import_expect_type = __toESM(require_dist(), 1);
3881
3882
 
3882
3883
  // src/internal/lru-map.ts
3883
3884
  var LruMap = class {
3884
- constructor(_maxSize) {
3885
- this._maxSize = _maxSize;
3886
- }
3887
3885
  _entries = /* @__PURE__ */ new Map();
3886
+ _max_size;
3887
+ constructor(maxSize) {
3888
+ this._max_size = maxSize;
3889
+ }
3888
3890
  get(key) {
3889
3891
  const v = this._entries.get(key);
3890
3892
  if (v === void 0) return void 0;
@@ -3897,7 +3899,7 @@ var LruMap = class {
3897
3899
  }
3898
3900
  set(key, value) {
3899
3901
  this._entries.delete(key);
3900
- if (this._entries.size >= this._maxSize) {
3902
+ if (this._entries.size >= this._max_size) {
3901
3903
  const oldest = this._entries.keys().next().value;
3902
3904
  this._entries.delete(oldest);
3903
3905
  }
@@ -4089,26 +4091,40 @@ var Errors = {
4089
4091
  NonRetryableError: "ERR_NON_RETRYABLE"
4090
4092
  };
4091
4093
  var ValidationError = class extends Error {
4094
+ /** The type of target being validated (e.g., "action", "event") */
4095
+ target;
4096
+ /** The invalid payload that failed validation */
4097
+ payload;
4098
+ /** Zod validation error details */
4099
+ details;
4092
4100
  constructor(target, payload, details) {
4093
4101
  super(`Invalid ${target} payload`);
4102
+ this.name = Errors.ValidationError;
4094
4103
  this.target = target;
4095
4104
  this.payload = payload;
4096
4105
  this.details = details;
4097
- this.name = Errors.ValidationError;
4098
4106
  }
4099
4107
  };
4100
4108
  var ConcurrencyError = class extends Error {
4109
+ /** The stream that had the concurrent modification */
4110
+ stream;
4111
+ /** The actual current version in the store */
4112
+ lastVersion;
4113
+ /** The events that were being committed */
4114
+ events;
4115
+ /** The version number that was expected */
4116
+ expectedVersion;
4101
4117
  constructor(stream, lastVersion, events, expectedVersion) {
4102
4118
  super(
4103
4119
  `Concurrency error committing "${events.map((e) => `${stream}.${e.name}`).join(
4104
4120
  ", "
4105
4121
  )}". Expected version ${expectedVersion} but found version ${lastVersion}.`
4106
4122
  );
4123
+ this.name = Errors.ConcurrencyError;
4107
4124
  this.stream = stream;
4108
4125
  this.lastVersion = lastVersion;
4109
4126
  this.events = events;
4110
4127
  this.expectedVersion = expectedVersion;
4111
- this.name = Errors.ConcurrencyError;
4112
4128
  }
4113
4129
  };
4114
4130
 
@@ -4279,12 +4295,8 @@ var DEFAULT_LANE = "default";
4279
4295
 
4280
4296
  // src/adapters/in-memory-store.ts
4281
4297
  var InMemoryStream = class {
4282
- constructor(stream, source, priority = 0, lane = DEFAULT_LANE) {
4283
- this.stream = stream;
4284
- this.source = source;
4285
- this._priority = priority;
4286
- this._lane = lane;
4287
- }
4298
+ stream;
4299
+ source;
4288
4300
  _at = -1;
4289
4301
  _retry = -1;
4290
4302
  _blocked = false;
@@ -4293,6 +4305,12 @@ var InMemoryStream = class {
4293
4305
  _leased_until = void 0;
4294
4306
  _priority = 0;
4295
4307
  _lane = DEFAULT_LANE;
4308
+ constructor(stream, source, priority = 0, lane = DEFAULT_LANE) {
4309
+ this.stream = stream;
4310
+ this.source = source;
4311
+ this._priority = priority;
4312
+ this._lane = lane;
4313
+ }
4296
4314
  get priority() {
4297
4315
  return this._priority;
4298
4316
  }