@gjermundgaraba/effect-actions 0.39.1 → 0.40.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/README.md CHANGED
@@ -76,10 +76,10 @@ Effect.gen(function* () {
76
76
  ## Install
77
77
 
78
78
  ```sh
79
- pnpm add @gjermundgaraba/effect-actions effect@~4.1.4
79
+ pnpm add @gjermundgaraba/effect-actions effect@~4.2.0
80
80
  ```
81
81
 
82
- It needs TypeScript 7 or newer and is ESM only ([docs/setup.md](docs/setup.md#install)). Add `@effect/platform-node@~4.1.4` to serve or run a CLI from Node, and `@types/node` for its `node:` imports. Every module is a subpath import (`.../Action`, `.../ActionHttp`, ...); there is no package root, so a contracts-only bundle never loads a server.
82
+ It needs TypeScript 7 or newer and is ESM only ([docs/setup.md](docs/setup.md#install)). Add `@effect/platform-node@~4.2.0` to serve or run a CLI from Node, and `@types/node` for its `node:` imports. Every module is a subpath import (`.../Action`, `.../ActionHttp`, ...); there is no package root, so a contracts-only bundle never loads a server.
83
83
 
84
84
  ## Examples
85
85
 
@@ -9,13 +9,15 @@ import { Params, RequestOptions, request } from "./mcp/request.mjs";
9
9
  import { Cause, Effect, Layer, Scope, Stdio } from "effect";
10
10
  import { HttpRouter } from "effect/http";
11
11
  import { McpSchema, McpServer } from "effect/ai";
12
+ type NativeStdioOptions = Parameters<typeof McpServer.layerStdio>[0];
13
+ type NativeHttpOptions = Parameters<typeof McpServer.layerHttp>[0];
12
14
  /**
13
- * An MCP server, over HTTP or stdio: every native `McpServer.layerStdio` option but `protocols`
14
- * and `registrations`, the server information, `instructions`, `extensions` and `cacheHints`
15
- * among them, the actions `A` that are its tools and the event types `A` it serves, and the
15
+ * An MCP server, over HTTP or stdio: every native option `McpServer.layerStdio` and
16
+ * `McpServer.layerHttp` both take but `protocols` and `registrations`, the server information,
17
+ * `instructions`, `extensions` and `cacheHints` among them, the actions `A` that are its tools and the event types `A` it serves, and the
16
18
  * native features it serves beside them.
17
19
  */
18
- export interface Options<E = never, R = never, A extends Any$1 | Any$2 = Any$1 | Any$2> extends Omit<Parameters<typeof McpServer.layerStdio>[0], "protocols" | "registrations"> {
20
+ export interface Options<E = never, R = never, A extends Any$1 | Any$2 = Any$1 | Any$2> extends Omit<Pick<NativeStdioOptions, keyof NativeStdioOptions & keyof NativeHttpOptions>, "protocols" | "registrations"> {
19
21
  /**
20
22
  * The actions that are tools and the event types it serves, among the implementations':
21
23
  * `[GetUser, RenameUser, UserRenamed]`, exactly those. Each keeps its implementation's
@@ -44,10 +46,10 @@ export interface Options<E = never, R = never, A extends Any$1 | Any$2 = Any$1 |
44
46
  }
45
47
  /**
46
48
  * One Streamable HTTP MCP endpoint: `Options`, `authentication`, `requestScoped`, and every native
47
- * `McpServer.layerHttp` option, `allowedOrigins` among them, except `protocols`, `registrations`
48
- * and `allowSessionTermination`, which are fixed.
49
+ * `McpServer.layerHttp` option, `allowedOrigins` and `maxSessions` among them, except `protocols`,
50
+ * `registrations` and `allowSessionTermination`, which are fixed.
49
51
  */
50
- export interface LayerHttpOptions<E = never, R = never, A extends Any$1 | Any$2 = Any$1 | Any$2> extends Options<E, R, A>, Omit<Parameters<typeof McpServer.layerHttp>[0], "protocols" | "path" | "allowSessionTermination" | "registrations"> {
52
+ export interface LayerHttpOptions<E = never, R = never, A extends Any$1 | Any$2 = Any$1 | Any$2> extends Options<E, R, A>, Omit<NativeHttpOptions, "protocols" | "path" | "allowSessionTermination" | "registrations"> {
51
53
  /** The endpoint's route; defaults to `/mcp`. */
52
54
  readonly path?: HttpRouter.PathInput;
53
55
  /**
@@ -104,7 +106,9 @@ type Inferring<D, A extends Pick<Any$1, "caller">> = [D] extends [undefined] ? [
104
106
  * Serve MCP tools over one Streamable HTTP endpoint, speaking MCP 2026-07-28, 2025-11-25 or
105
107
  * 2025-06-18, as the client negotiates. A 2026-07-28 request stands alone; a client of a 2025
106
108
  * revision opens a session with `initialize`, which holds what it sent there and no identity,
107
- * and lasts until that client ends it with a DELETE, answered 204, or the process stops. Protected
109
+ * and lasts until that client ends it with a DELETE, answered 204, or the process stops, or until
110
+ * it is the least recently used idle one beyond the native `maxSessions`, whose id is then
111
+ * answered 404. Protected
108
112
  * tools need `authentication`; for a serverless host, see `requestScoped`. In a tool call, what
109
113
  * middleware provides per request wins over what the endpoint was built with. The event
110
114
  * types among `implementations`, or those `actions` lists, are served as SEP-3415 events,
@@ -119,11 +123,11 @@ type Inferring<D, A extends Pick<Any$1, "caller">> = [D] extends [undefined] ? [
119
123
  * - A success is `isError: false` with `structuredContent` its JSON and the same JSON as one text block, both `null` for an action without `success`; an `Action.Image` field is left out of `structuredContent` and its text, its block following them, and a success of images alone has no `structuredContent`.
120
124
  * - A success whose schema encodes only to a string, such as `Schema.String`, a string literal or `Schema.DateTimeUtc`, is its raw text as one text block on every revision, with no `structuredContent` and no `outputSchema`, since Claude Code shows a model serialized `structuredContent` in place of every text block: return file contents or command output as such a string, never as a field of an object, which reaches a model JSON-escaped.
121
125
  * - A union holding a string, such as `Schema.NullOr(Schema.String)` or an optional string, is sent as any other success, so a 2026-07-28 client gets the string as `structuredContent` and JSON-quoted text, which reaches a Claude Code model escaped: return `""` for nothing, not `null`.
122
- * - A declared error is an `isError: true` tool result in a 200 whose one text block is its `message`, or the error itself when it is a string, or its JSON when it has no `message` or an empty one, with its JSON in `_meta["io.github.gjermundgaraba.effect-actions/error"]`, from which `client` decodes it, and no `structuredContent`: write each `message` for the model, since its other fields reach a model only through it; a refusal is answered as `Action.Unauthenticated` and `Action.Forbidden` say.
126
+ * - A declared error is an `isError: true` tool result in a 200 whose one text block is its `message`, or the error itself when it is a string, or its JSON when it has no `message` or an empty one, with its JSON in `_meta["io.github.gjermundgaraba.effect-actions/error"]`, from which `client` decodes it, Effect's `McpSchema.ToolErrorInfo` `{ kind: "failure" }` in `_meta["website.effect/toolError"]`, with `tag` its `_tag` where it has a non-empty one, and no `structuredContent`: write each `message` for the model, since its other fields reach a model only through it; a refusal is answered as `Action.Unauthenticated` and `Action.Forbidden` say.
123
127
  * - An action answering a stream, `Action.Stream`, answers its elements collected into one array once the stream ends, a success of that array.
124
128
  * - An action declaring `progress` sends each value as `notifications/progress` on the `progressToken` its call's `_meta` carries, before the result: `progress` counts from 1, `message` is the value's JSON and `_meta["io.github.gjermundgaraba.effect-actions/progress"]` the value; a call without a token gets none.
125
- * - Arguments that do not decode never reach the handler: an `isError: true` result in a 200, text `Invalid parameters for tool '<name>': …`, or for a 2025-06-18 client a JSON-RPC error.
126
- * - A defect, an undeclared failure, or a success or an error that does not encode is `isError: true`, text `Tool execution failed due to an internal server error.`: the cause goes to the log and to the call's `ErrorReporter`s, never to the client.
129
+ * - Arguments that do not decode never reach the handler: an `isError: true` result in a 200, text `Invalid parameters for tool '<name>': …` with `{ kind: "invalidInput" }` in `_meta["website.effect/toolError"]`, or for a 2025-06-18 client a JSON-RPC error.
130
+ * - A defect, an undeclared failure, or a success or an error that does not encode is `isError: true`, text `Tool execution failed due to an internal server error.`, with `{ kind: "internal" }` in `_meta["website.effect/toolError"]`: the cause goes to the log and to the call's `ErrorReporter`s, never to the client.
127
131
  * - An unknown tool is a JSON-RPC error `-32602` in a 200; a body that is not JSON a JSON-RPC error `-32700` in a 200; a `Content-Type` missing or not JSON a JSON-RPC error `-32600` in a 415; another HTTP method an empty 405 with `Allow: POST, DELETE`, `Allow: POST` where `requestScoped`, or the 401 of an endpoint with authentication when signed out.
128
132
  * - A 2025-11-25 or 2025-06-18 client gets `structuredContent` only for a success that is an object: a number, an array or `null` arrives as its JSON text block alone, and a string a union success returns as its text unquoted.
129
133
  * - A client asking for an earlier revision, such as 2025-03-26, is offered 2025-11-25, so a client speaking only that earlier one cannot connect.
@@ -137,11 +141,17 @@ type Inferring<D, A extends Pick<Any$1, "caller">> = [D] extends [undefined] ? [
137
141
  * - A push stream's failure that no refusal explains, such as an upstream's outage, is `notifications/events/error`, its cause logged and reported, and the stream resumes from where it reached after 5 seconds; a refusal ends it with `notifications/events/terminated`. One before `active`, or a poll's, is a JSON-RPC `-32603`, which `client`'s `watch` reconnects after, as after a 5xx.
138
142
  */
139
143
  export declare function layerHttp<const Apps extends Served, const O extends Selection<ActionOf<Member<Apps>> | EventOf<Member<Apps>>> = {}, E = never, R = never, const D extends Any | undefined = undefined>(implementations: Apps, options: LayerHttpOptions<E, R, ActionOf<Member<Apps>> | EventOf<Member<Apps>>> & O & NoInfer<Known<O, LayerHttpOptions<E, R>>> & NoInfer<Required<Contracts<Apps, O>>> & Matching<NoInfer<Contracts<Apps, O>>, NoInfer<D>> & Inferring<D, NoInfer<Contracts<Apps, O>>>): Layer.Layer<never, ServerError<Apps, O> | E, ServerBuildServices<Holding<Member<Apps>, SelectedOf<O, Apps>>, SelectedOf<O, Apps>> | EventServices<Apps, O> | HttpRouter.HttpRouter | HttpRouter.Request.From<"Requires", HttpToolRequestContext<RemoteRequest<Member<Apps>, SelectedOf<O, Apps>> | EventServedRequest<Member<Apps>, SelectedEventsOf<O, Apps>> | FeatureRequest<R>>> | ProviderOf<D> | Features<R>>;
144
+ /**
145
+ * `runStdio`'s options: `Options` and every native `McpServer.layerStdio` option, `onStdinEnd`
146
+ * among them, except `protocols` and `registrations`, which are fixed.
147
+ */
148
+ export interface RunStdioOptions<E = never, R = never, A extends Any$1 | Any$2 = Any$1 | Any$2> extends Options<E, R, A>, Omit<NativeStdioOptions, "protocols" | "registrations"> {}
140
149
  /**
141
150
  * Serve MCP tools through newline-delimited JSON-RPC on standard I/O, speaking MCP
142
151
  * 2026-07-28, 2025-11-25 or 2025-06-18, as the host negotiates: the whole
143
152
  * program of an MCP subprocess, which succeeds once the host closes its side and every call
144
- * in flight has been answered. A signal interrupts it. Its own Effect logs and `Console` output
153
+ * in flight has been answered, or, with `onStdinEnd: "interrupt"`, once the host closes its
154
+ * side, interrupting the calls in flight unanswered. A signal interrupts it. Its own Effect logs and `Console` output
145
155
  * go to stderr, since stdout carries the protocol. The host supplies the `Stdio` service, and
146
156
  * provides the identity around `runStdio`; arguments are tool input only and never establish
147
157
  * request identity or authority, and each implementation's `authorize` runs for its protected
@@ -150,8 +160,8 @@ export declare function layerHttp<const Apps extends Served, const O extends Sel
150
160
  *
151
161
  * **Gotchas**
152
162
  *
153
- * - A line that is not JSON goes unanswered, with no `-32700` as over HTTP, and the lines after it are still answered.
163
+ * - A line that is not JSON is answered `-32700` with `id: null`, as over HTTP, and a line of JSON that is no JSON-RPC message, such as `5` or `{}`, `-32600`; the lines after either are still answered.
154
164
  * - The layers provided around it log to stdout, among the protocol's lines: apply `ActionCli.logToStderr` to the program, last, as its JSDoc says.
155
165
  */
156
- export declare function runStdio<const Apps extends Served, const O extends Selection<ActionOf<Member<Apps>> | EventOf<Member<Apps>>> = {}, E = never, R = never>(implementations: Apps, options: Options<E, R, ActionOf<Member<Apps>> | EventOf<Member<Apps>>> & O & NoInfer<Known<O, Options<E, R>>>): Effect.Effect<void, ServerError<Apps, O> | E, BuildServices<Holding<Member<Apps>, SelectedOf<O, Apps>>, SelectedOf<O, Apps>> | EventServices<Apps, O> | Stdio.Stdio | ToolRequestContext<ServedRequest<Member<Apps>, SelectedOf<O, Apps>> | EventRequestOf<Member<Apps>, SelectedEventsOf<O, Apps>> | Exclude<FeatureRequest<R>, Scope.Scope>> | Features<R>>;
166
+ export declare function runStdio<const Apps extends Served, const O extends Selection<ActionOf<Member<Apps>> | EventOf<Member<Apps>>> = {}, E = never, R = never>(implementations: Apps, options: RunStdioOptions<E, R, ActionOf<Member<Apps>> | EventOf<Member<Apps>>> & O & NoInfer<Known<O, RunStdioOptions<E, R>>>): Effect.Effect<void, ServerError<Apps, O> | E, BuildServices<Holding<Member<Apps>, SelectedOf<O, Apps>>, SelectedOf<O, Apps>> | EventServices<Apps, O> | Stdio.Stdio | ToolRequestContext<ServedRequest<Member<Apps>, SelectedOf<O, Apps>> | EventRequestOf<Member<Apps>, SelectedEventsOf<O, Apps>> | Exclude<FeatureRequest<R>, Scope.Scope>> | Features<R>>;
157
167
  export { type Client, type ClientOptions, McpCallError, type Params, type RequestOptions, client, request };
@@ -17,7 +17,7 @@ import { defaultPath, errorKey, fieldKey, httpProtocol, isMisplaced, isObjectSch
17
17
  import { client } from "./mcp/client.mjs";
18
18
  import { McpCallError } from "./mcp/reply.mjs";
19
19
  import { request } from "./mcp/request.mjs";
20
- import { Cause, Context, Effect, ErrorReporter, Exit, Fiber, Layer, Option, Predicate, Schema, Stdio, Stream } from "effect";
20
+ import { Cause, Context, Effect, ErrorReporter, Exit, Fiber, Layer, Predicate, Schema } from "effect";
21
21
  import { HttpRouter, HttpServerRequest } from "effect/http";
22
22
  import { AiError, McpSchema, McpServer } from "effect/ai";
23
23
  // src/mcp/ActionMcp.ts
@@ -27,13 +27,13 @@ const assertToolsServable = (lifted) => {
27
27
  const misplaced = lifted.flatMap(([action, lift]) => isMisplaced(action, lift) ? [action.name] : []);
28
28
  if (misplaced.length > 0) throw new Error(`MCP media must be the success or an array of it, or a top-level field of a struct success, one, optional or a required array: ${misplaced.join(", ")} (make the image such a field, or give an optional array as a required one, empty when absent; an image in input or an error is not served over MCP, so leave that action out of actions)`);
29
29
  };
30
- const nativeInternalErrorText = "Tool execution failed due to an internal server error.";
31
- const textErrorResult = (text) => new McpSchema.CallToolResult({
30
+ const internalErrorResult = new McpSchema.CallToolResult({
32
31
  isError: true,
33
32
  content: [{
34
33
  type: "text",
35
- text
36
- }]
34
+ text: "Tool execution failed due to an internal server error."
35
+ }],
36
+ _meta: { [McpSchema.TOOL_ERROR_META_KEY]: { kind: "internal" } }
37
37
  });
38
38
  const nativeJsonTextOf = (encoded) => encoded === void 0 ? [] : [{
39
39
  type: "text",
@@ -43,13 +43,20 @@ const errorTextOf = (encoded) => {
43
43
  if (Predicate.isString(encoded)) return encoded;
44
44
  return Predicate.hasProperty(encoded, "message") && Predicate.isString(encoded.message) && encoded.message !== "" ? encoded.message : JSON.stringify(encoded);
45
45
  };
46
+ const failureInfoOf = (encoded) => Predicate.hasProperty(encoded, "_tag") && Predicate.isString(encoded._tag) && encoded._tag !== "" ? {
47
+ kind: "failure",
48
+ tag: encoded._tag
49
+ } : { kind: "failure" };
46
50
  const declaredErrorResult = (encoded) => new McpSchema.CallToolResult({
47
51
  isError: true,
48
52
  content: [{
49
53
  type: "text",
50
54
  text: errorTextOf(encoded)
51
55
  }],
52
- _meta: { [errorKey]: encoded }
56
+ _meta: {
57
+ [errorKey]: encoded,
58
+ [McpSchema.TOOL_ERROR_META_KEY]: failureInfoOf(encoded)
59
+ }
53
60
  });
54
61
  const contentBlockOf = ({ kind, field, value }) => ({
55
62
  type: kind,
@@ -68,7 +75,7 @@ const toolOf = (action, outputSchema) => Effect.map(Schema.decodeUnknownEffect(M
68
75
  },
69
76
  _meta: action.mcp._meta === void 0 ? void 0 : { ...action.mcp._meta }
70
77
  }));
71
- const internalError = (cause) => Effect.logError(cause).pipe(Effect.andThen(ErrorReporter.report(cause)), Effect.as(textErrorResult(nativeInternalErrorText)));
78
+ const internalError = (cause) => Effect.logError(cause).pipe(Effect.andThen(ErrorReporter.report(cause)), Effect.as(internalErrorResult));
72
79
  const internalErrorOnDefect = (cause) => Cause.hasDies(cause) ? internalError(cause) : Effect.failCause(cause);
73
80
  const encoder = (schema) => {
74
81
  const encode = Schema.encodeUnknownEffect(Schema.toCodecJson(schema));
@@ -218,11 +225,6 @@ function layerHttp(apps, { actions, features, path = defaultPath, authentication
218
225
  const middleware = HttpRouter.middleware(Effect.map(providerOf(authentication), (runtime) => (route) => Effect.flatMap(HttpServerRequest.HttpServerRequest, (request) => request.method !== "POST" || required(request.headers) ? runtime.http(readsItsBody(route), false) : Effect.flatMap(namesItsMethod(request), (named) => runtime.http(readsItsBody(route), named)))));
219
226
  return transport.pipe(Layer.provide(middleware.layer));
220
227
  }
221
- const isJsonLine = (line) => Option.isSome(Schema.decodeOption(Schema.fromJsonString(Schema.Json))(line));
222
- const jsonLinesOnly = Layer.effect(Stdio.Stdio, Effect.map(Stdio.Stdio, (stdio) => Stdio.make({
223
- ...stdio,
224
- stdin: stdio.stdin.pipe(Stream.decodeText, Stream.splitLines, Stream.filter(isJsonLine), Stream.map((line) => `${line}\n`), Stream.encodeText)
225
- })));
226
228
  function runStdio(apps, { actions, features, ...options }) {
227
229
  const { apps: selected, events } = selectFrom(apps, actions);
228
230
  assertEventsServable(events.flatMap((app) => app.events));
@@ -234,7 +236,7 @@ function runStdio(apps, { actions, features, ...options }) {
234
236
  ...options,
235
237
  protocols: servingEvents(protocols, serving),
236
238
  registrations
237
- }).pipe(Layer.provide(jsonLinesOnly)), features);
239
+ }), features);
238
240
  return Layer.launch(transport).pipe(withStderrConsole, Effect.forkChild, Effect.flatMap(Fiber.await), Effect.flatMap((exit) => Exit.isFailure(exit) && !Cause.hasInterruptsOnly(exit.cause) ? Effect.failCause(exit.cause) : Effect.void));
239
241
  }
240
242
  export { McpCallError, client, layerHttp, request, runStdio };
@@ -30,7 +30,10 @@ export interface Options<E = HttpClientError.HttpClientError, R = never> {
30
30
  readonly baseUrl?: NonNullable<Parameters<typeof HttpApiClient.make>[1]>["baseUrl"];
31
31
  /**
32
32
  * Wraps the native `HttpClient` the calls send with: a bearer token is
33
- * `HttpClient.mapRequest(HttpClientRequest.bearerToken(token))`, and a credential read or
33
+ * `HttpClient.mapRequest(HttpClientRequest.bearerToken(token))`, a credential in the scheme an
34
+ * `Authentication` declares, API key or Basic included,
35
+ * `HttpClient.mapRequest((request) => HttpApiClient.securityEncode(request, Auth.security, credential))`,
36
+ * and a credential read or
34
37
  * refreshed as each request is sent `(client) => HttpClient.mapRequestEffect(client, authorize)`.
35
38
  * A method also fails with what the returned client fails with beyond an `HttpClientError`, as
36
39
  * it is, and requires what it requires.
@@ -21,7 +21,9 @@ export interface ClientOptions<D extends Any | undefined = Any | undefined, E =
21
21
  readonly url?: string;
22
22
  /**
23
23
  * Wraps the native `HttpClient`, as `ActionHttp.client` takes it: a bearer token is
24
- * `HttpClient.mapRequest(HttpClientRequest.bearerToken(token))`.
24
+ * `HttpClient.mapRequest(HttpClientRequest.bearerToken(token))`, and a credential in the scheme
25
+ * an `Authentication` declares
26
+ * `HttpClient.mapRequest((request) => HttpApiClient.securityEncode(request, Auth.security, credential))`.
25
27
  */
26
28
  readonly transformClient?: (client: HttpClient.HttpClient) => HttpClient.HttpClient.With<E, R>;
27
29
  /**
@@ -8,5 +8,5 @@ What you see when something is wrong, and the fix. Search for a fragment of the
8
8
  - A page that loads Effect from an import map still bundles a second copy of Effect or of some of its modules, or fails to resolve `effect/Schema` in the browser when its bundler externalizes subpaths, as esbuild's `--external:effect` does: a module of the page imports an Effect specifier the map does not serve. Serve the specifiers [Bundle for a browser](setup.md#bundle-for-a-browser) lists, and import Effect through them in the page's own modules too.
9
9
  - A page loading Effect from an import map fails with `Failed to resolve module specifier "effect/Cause"` in Chromium: the map points at Effect's published files and lacks a specifier Effect imports itself. Map `effect/Cause`, `effect/Effect`, `effect/Exit` and `effect/Function` to the same files, or serve Effect from a build that resolves its own imports.
10
10
  - A page fails at load with `does not provide an export named …`: it serves only the names it uses of an Effect specifier, from a vendored module or a trimmed bundle, and the package imports another. Serve each specifier whole.
11
- - Type errors inside `effect/*` modules after install, an unmet peer warning for `effect`, such as `found 4.2.0`, or a start failing with `Cannot find module '…/effect/dist/…'` under an `@effect/*` package: more than one Effect release is installed, or one outside the peer range. Install the `effect` range [Install](setup.md#install) names, with every `@effect/*` package at the version `effect` resolved to, such as `@effect/platform-node@4.1.4` beside `effect@4.1.4`.
11
+ - Type errors inside `effect/*` modules after install, an unmet peer warning for `effect`, such as `found 4.3.0`, or a start failing with `Cannot find module '…/effect/dist/…'` under an `@effect/*` package: more than one Effect release is installed, or one outside the peer range. Install the `effect` range [Install](setup.md#install) names, with every `@effect/*` package at the version `effect` resolved to, such as `@effect/platform-node@4.2.0` beside `effect@4.2.0`.
12
12
  - `Cannot find module 'effect/unstable/http'` (or `…/httpapi`, `…/cli`, `…/ai`): these modules are now `effect/http`, `effect/http-api`, `effect/cli` and `effect/ai`.
package/docs/setup.md CHANGED
@@ -7,21 +7,21 @@ A message the library throws says its fix; for a compiler diagnostic or Effect's
7
7
  ## Install
8
8
 
9
9
  ```sh
10
- pnpm add @gjermundgaraba/effect-actions effect@~4.1.4
10
+ pnpm add @gjermundgaraba/effect-actions effect@~4.2.0
11
11
  ```
12
12
 
13
13
  | Need | Add |
14
14
  | --- | --- |
15
- | Node HTTP server, stdio host or CLI | `@effect/platform-node@~4.1.4` |
16
- | `Stored`'s event logs and idempotency on Node's SQLite, or an entity's storage on Effect's SQL runners | `@effect/sql-sqlite-node@~4.1.4` |
17
- | Tests | `vitest@^5` and `@effect/vitest@~4.1.4`, as dev dependencies |
15
+ | Node HTTP server, stdio host or CLI | `@effect/platform-node@~4.2.0` |
16
+ | `Stored`'s event logs and idempotency on Node's SQLite, or an entity's storage on Effect's SQL runners | `@effect/sql-sqlite-node@~4.2.0` |
17
+ | Tests | `vitest@^5` and `@effect/vitest@~4.2.0`, as dev dependencies |
18
18
  | Type checking | `typescript@^7.0.2`, as a dev dependency |
19
19
  | Node's types, for `node:` imports | `@types/node`, as a dev dependency |
20
20
  | Running a TypeScript entrypoint | `tsx`, as a dev dependency: `node --import tsx <entrypoint>.ts` |
21
21
 
22
- The `effect` peer admits the 4.1.x patches from the oldest whose APIs and behavior the package relies on, and no minor release: a minor release may change the unstable Effect modules the surfaces build on.
22
+ The `effect` peer admits the 4.2.x patches from the oldest whose APIs and behavior the package relies on, and no minor release: a minor release may change the unstable Effect modules the surfaces build on.
23
23
 
24
- Keep the tilde in `package.json`: `^4.1.4`, which npm writes for `effect@4.1.4`, admits a minor release outside the peer range. `npm install effect@~4.1.4` keeps it.
24
+ Keep the tilde in `package.json`: `^4.2.0`, which npm writes for `effect@4.2.0`, admits a minor release outside the peer range. `npm install effect@~4.2.0` keeps it.
25
25
 
26
26
  Node `>=26.13.1`: the package's `engines`, the Node the library is developed and tested on. TypeScript 7 or newer. ESM only. The repository checks the examples with a stricter `tsconfig.json`; this is the minimum a project needs. The package's modules resolve only through its `exports`, which `"module": "nodenext"` reads, as a bundler project's `"moduleResolution": "bundler"` does. `"strict": true` is required, by Effect:
27
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjermundgaraba/effect-actions",
3
- "version": "0.39.1",
3
+ "version": "0.40.0",
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",
@@ -54,14 +54,14 @@
54
54
  "access": "public"
55
55
  },
56
56
  "devDependencies": {
57
- "@clanker-stuff/oxlint-config": "0.5.1",
58
- "@effect/platform-node": "4.1.7",
59
- "@effect/sql-sqlite-node": "4.1.7",
60
- "@effect/tsgo": "0.73.7",
61
- "@effect/vitest": "4.1.7",
57
+ "@clanker-stuff/oxlint-config": "0.6.1",
58
+ "@effect/platform-node": "4.2.0",
59
+ "@effect/sql-sqlite-node": "4.2.0",
60
+ "@effect/tsgo": "0.74.4",
61
+ "@effect/vitest": "4.2.0",
62
62
  "@modelcontextprotocol/client": "2.4.0",
63
- "@types/node": "26.6.6",
64
- "effect": "4.1.7",
63
+ "@types/node": "26.6.11",
64
+ "effect": "4.2.0",
65
65
  "tsx": "4.23.15",
66
66
  "typescript": "7.0.2",
67
67
  "ultracite": "8.3.1",
@@ -70,12 +70,12 @@
70
70
  "vitest": "5.1.1"
71
71
  },
72
72
  "peerDependencies": {
73
- "effect": "~4.1.4"
73
+ "effect": "~4.2.0"
74
74
  },
75
75
  "devEngines": {
76
76
  "packageManager": {
77
77
  "name": "pnpm",
78
- "version": "12.21.0",
78
+ "version": "12.23.0",
79
79
  "onFail": "download"
80
80
  }
81
81
  },