@gjermundgaraba/effect-actions 0.25.1 → 0.26.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.
@@ -15,8 +15,12 @@ type ErasedEmitted = Emitted<Any>;
15
15
  * in an `epoch` telling them from counters that started again.
16
16
  */
17
17
  export interface RevisionStorage {
18
- /** Changes whenever the counters start again, so a cursor from before is behind every revision. */
19
- readonly epoch: string;
18
+ /**
19
+ * The epoch the counters count in, run before each revision is built from it: one value until
20
+ * the counters start again, so a cursor from before is behind every revision, kept by the time
21
+ * it succeeds.
22
+ */
23
+ readonly epoch: Effect.Effect<string>;
20
24
  readonly get: (name: string) => Effect.Effect<number>;
21
25
  /** Adds one to each counter `names` names. */
22
26
  readonly bump: (names: readonly string[]) => Effect.Effect<void>;
@@ -4,7 +4,7 @@ import { Context, Effect, Layer, Queue, Stream } from "effect";
4
4
  const memoryRevisions = () => {
5
5
  const counts = /* @__PURE__ */ new Map();
6
6
  return {
7
- epoch: globalThis.crypto.randomUUID(),
7
+ epoch: Effect.succeed(globalThis.crypto.randomUUID()),
8
8
  get: (name) => Effect.sync(() => counts.get(name) ?? 0),
9
9
  bump: (names) => Effect.sync(() => {
10
10
  for (const name of names) counts.set(name, (counts.get(name) ?? 0) + 1);
@@ -101,7 +101,11 @@ const makeEvents = (options) => Effect.gen(function* () {
101
101
  key,
102
102
  woken
103
103
  }), Queue.take(woken))),
104
- revision: (key) => key === void 0 ? Effect.map(revisions.get(everyKey(event)), (count) => `${revisions.epoch}:${count}`) : Effect.map(Effect.all([revisions.get(noKey(event)), revisions.get(ofKey(event, key))]), ([unkeyed, keyed]) => `${revisions.epoch}:${unkeyed + keyed}:${key}`)
104
+ revision: (key) => key === void 0 ? Effect.map(Effect.all([revisions.epoch, revisions.get(everyKey(event))]), ([epoch, count]) => `${epoch}:${count}`) : Effect.map(Effect.all([
105
+ revisions.epoch,
106
+ revisions.get(noKey(event)),
107
+ revisions.get(ofKey(event, key))
108
+ ]), ([epoch, unkeyed, keyed]) => `${epoch}:${unkeyed + keyed}:${key}`)
105
109
  })),
106
110
  log: (event, bounds, emit) => Effect.suspend(() => {
107
111
  if (emit !== void 0 && !emits) return Effect.die(/* @__PURE__ */ new Error(`Event "${event.name}" has a log source fed by emit, which this Event.Events does not consume, as its host does not last between requests (publish each occurrence with Event.Events.publish as the host receives it, such as in a call or a route)`));
@@ -34,5 +34,5 @@ export const settled = <E, R>(done: Effect.Effect<boolean, E, R>) =>
34
34
  }),
35
35
  done
36
36
  ),
37
- { until: (finished) => finished, times: 200 }
37
+ { until: (finished) => finished }
38
38
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjermundgaraba/effect-actions",
3
- "version": "0.25.1",
3
+ "version": "0.26.1",
4
4
  "description": "Define Effect action contracts once and project them onto HTTP, MCP, Effect RPC, native Toolkits, and CLIs.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -51,17 +51,17 @@
51
51
  "access": "public"
52
52
  },
53
53
  "devDependencies": {
54
- "@clanker-stuff/oxlint-config": "0.1.0",
54
+ "@clanker-stuff/oxlint-config": "0.2.1",
55
55
  "@effect/platform-node": "4.1.1",
56
- "@effect/tsgo": "0.57.0",
56
+ "@effect/tsgo": "0.63.0",
57
57
  "@effect/vitest": "4.1.1",
58
- "@modelcontextprotocol/client": "2.3.1",
59
- "@types/node": "26.6.5",
58
+ "@modelcontextprotocol/client": "2.4.0",
59
+ "@types/node": "26.6.6",
60
60
  "effect": "4.1.1",
61
61
  "oxfmt": "0.74.0",
62
62
  "tsx": "4.23.15",
63
63
  "typescript": "7.0.2",
64
- "ultracite": "8.0.2",
64
+ "ultracite": "8.1.0",
65
65
  "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
66
66
  "vite-plus": "1.4.0",
67
67
  "vitest": "5.0.5"
@@ -72,7 +72,7 @@
72
72
  "devEngines": {
73
73
  "packageManager": {
74
74
  "name": "pnpm",
75
- "version": "12.15.0",
75
+ "version": "12.17.0",
76
76
  "onFail": "download"
77
77
  }
78
78
  },