@savvy-web/mcp 3.4.19 → 3.4.21

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/errors.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ToolFailure, ToolRefusal } from "@effected/mcp";
1
+ import { ToolFailure, ToolRefusal } from "@effected/mcp-kit";
2
2
  import { Schema } from "effect";
3
3
 
4
4
  // src/errors.ts
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Distribution } from "@effected/engine";
2
- import { ToolRefusal } from "@effected/mcp";
1
+ import { Distribution } from "@effected/kit";
2
+ import { ToolRefusal } from "@effected/mcp-kit";
3
3
  import { FileSystem, Layer, Path, Schema, Stdio } from "effect";
4
4
  import { ToolDiscovery } from "@effected/commands";
5
5
  import { Git } from "@effected/git";
@@ -128,7 +128,7 @@ interface ServerOptions {
128
128
  }
129
129
  /**
130
130
  * The whole server as one layer: the ten-tool toolkit, the silk-effects
131
- * runtime discharging its dependencies, over `@effected/mcp`'s
131
+ * runtime discharging its dependencies, over `@effected/mcp-kit`'s
132
132
  * `McpStdio.layer`.
133
133
  *
134
134
  * `McpStdio.layer` is `McpServer.layerStdio` with the kit's default
@@ -203,7 +203,7 @@ declare const changesetDepsDetectTool: Tool.Tool<"changeset_deps_detect", {
203
203
  readonly packages: Schema.$Array<Schema.String>;
204
204
  }>>;
205
205
  }>;
206
- readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp").ToolRefusal]>;
206
+ readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp-kit").ToolRefusal]>;
207
207
  readonly failureMode: "error";
208
208
  }, Changesets.DepsRegen | WorkspaceRoot>;
209
209
  /** The `changeset_deps_regen` tool value. Mutating: not read-only, not idempotent. */
@@ -227,7 +227,7 @@ declare const changesetDepsRegenTool: Tool.Tool<"changeset_deps_regen", {
227
227
  }>>;
228
228
  readonly dryRun: Schema.Boolean;
229
229
  }>;
230
- readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp").ToolRefusal]>;
230
+ readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp-kit").ToolRefusal]>;
231
231
  readonly failureMode: "error";
232
232
  }, Changesets.DepsRegen | WorkspaceRoot>;
233
233
  /** The `changeset_inspect` tool value. */
@@ -301,7 +301,7 @@ declare const changesetInspectTool: Tool.Tool<"changeset_inspect", {
301
301
  }>, Schema.Null]>;
302
302
  }>>;
303
303
  }>]>;
304
- readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp").ToolRefusal]>;
304
+ readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp-kit").ToolRefusal]>;
305
305
  readonly failureMode: "error";
306
306
  }, Changesets.BranchAnalyzer | Changesets.ConfigInspector | WorkspaceRoot>;
307
307
  /** The `changeset_preview` tool value. */
@@ -328,7 +328,7 @@ declare const changesetPreviewTool: Tool.Tool<"changeset_preview", {
328
328
  }>>;
329
329
  }>>;
330
330
  }>;
331
- readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp").ToolRefusal]>;
331
+ readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp-kit").ToolRefusal]>;
332
332
  readonly failureMode: "error";
333
333
  }, Changesets.ReleasePlanner | WorkspaceRoot>;
334
334
  /** The `changeset_validate` tool value. */
@@ -412,7 +412,7 @@ declare const reposInspectTool: Tool.Tool<"repos_inspect", {
412
412
  }>>;
413
413
  readonly parseError: Schema.optionalKey<Schema.String>;
414
414
  }>]>;
415
- readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp").ToolRefusal]>;
415
+ readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp-kit").ToolRefusal]>;
416
416
  readonly failureMode: "error";
417
417
  }, FileSystem.FileSystem | Path.Path | Repos.ReposConfigStore | Repos.ReposDrift | Repos.ReposManager | WorkspaceRoot>;
418
418
  /**
@@ -421,7 +421,7 @@ declare const reposInspectTool: Tool.Tool<"repos_inspect", {
421
421
  * call is rejected as invalid parameters before the handler runs. Mutating:
422
422
  * not read-only, not idempotent.
423
423
  */
424
- declare const reposManageTool: import("@effected/mcp").UnionTool<"repos_manage", Schema.Union<readonly [Schema.Struct<{
424
+ declare const reposManageTool: import("@effected/mcp-kit").UnionTool<"repos_manage", Schema.Union<readonly [Schema.Struct<{
425
425
  readonly action: Schema.Literal<"sync">;
426
426
  readonly cwd: Schema.optionalKey<Schema.String>;
427
427
  }>, Schema.Struct<{
@@ -617,7 +617,7 @@ declare const turboInspectTool: Tool.Tool<"turbo_inspect", {
617
617
  readonly dependents: Schema.$Array<Schema.String>;
618
618
  }>;
619
619
  }>]>;
620
- readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp").ToolRefusal]>;
620
+ readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp-kit").ToolRefusal]>;
621
621
  readonly failureMode: "error";
622
622
  }, Turbo.TurboInspector | WorkspaceRoot>;
623
623
  /**
@@ -652,7 +652,7 @@ declare const workspaceInfoTool: Tool.Tool<"workspace_info", {
652
652
  readonly fixed: Schema.$Array<Schema.String>;
653
653
  }>>;
654
654
  }>;
655
- readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp").ToolRefusal]>;
655
+ readonly failure: Schema.Union<readonly [typeof WorkspaceNotFound, typeof EngineError, typeof BiomeFailed, typeof import("@effected/mcp-kit").ToolRefusal]>;
656
656
  readonly failureMode: "error";
657
657
  }, SilkWorkspaceAnalyzer | WorkspaceRoot>;
658
658
  /**
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { BiomeFailed, EngineError, McpToolError, WorkspaceNotFound } from "./errors.js";
2
2
  import { makeSilkRuntimeLayer } from "./runtime.js";
3
+ import { ServerLayer } from "./server.js";
3
4
  import { SilkToolkit, ToolsLayer } from "./toolkit.js";
4
5
  import { CURRENT_MCP_VERSION } from "./version.js";
5
- import { ServerLayer } from "./server.js";
6
6
 
7
7
  export { BiomeFailed, CURRENT_MCP_VERSION, EngineError, McpToolError, ServerLayer, SilkToolkit, ToolsLayer, WorkspaceNotFound, makeSilkRuntimeLayer };
package/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Distribution } from "@effected/engine";
1
+ import { Distribution } from "@effected/kit";
2
2
  /**
3
3
  * Options for {@link main}.
4
4
  *
package/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import { McpGuard } from "@effected/mcp/guard";
1
+ import { McpGuard } from "@effected/mcp-kit/guard";
2
2
 
3
3
  // src/main.ts
4
4
  /**
@@ -21,7 +21,7 @@ const main = (options = {}) => McpGuard.run({
21
21
  const NodeRuntime = await import("@effect/platform-node/NodeRuntime");
22
22
  const NodeServices = await import("@effect/platform-node/NodeServices");
23
23
  const { Layer } = await import("effect");
24
- const { LaunchContext } = await import("@effected/engine");
24
+ const { LaunchContext } = await import("@effected/kit");
25
25
  const { ServerLayer } = await import("./server.js");
26
26
  return {
27
27
  layer: ServerLayer(LaunchContext.projectDir({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvy-web/mcp",
3
- "version": "3.4.19",
3
+ "version": "3.4.21",
4
4
  "private": false,
5
5
  "description": "The savvy MCP server — Silk Suite tooling and library knowledge for coding agents",
6
6
  "homepage": "https://github.com/savvy-web/systems/tree/main/packages/mcp",
@@ -36,14 +36,14 @@
36
36
  "savvy-mcp": "bin/savvy-mcp.js"
37
37
  },
38
38
  "dependencies": {
39
- "@effect/platform-node": "^4.0.7",
40
- "@effected/commands": "^0.18.0",
41
- "@effected/engine": "^0.10.0",
42
- "@effected/git": "^0.27.0",
43
- "@effected/mcp": "^0.11.0",
44
- "@effected/templates": "^0.15.0",
45
- "@effected/workspaces": "^0.40.0",
46
- "@savvy-web/silk-effects": "^10.2.1",
47
- "effect": "^4.0.7"
39
+ "@effect/platform-node": "~4.1.2",
40
+ "@effected/commands": "^0.20.0",
41
+ "@effected/git": "^0.30.0",
42
+ "@effected/kit": "^0.12.0",
43
+ "@effected/mcp-kit": "^0.13.0",
44
+ "@effected/templates": "^0.17.0",
45
+ "@effected/workspaces": "^0.42.0",
46
+ "@savvy-web/silk-effects": "^11.0.1",
47
+ "effect": "~4.1.2"
48
48
  }
49
49
  }
package/server.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { makeSilkRuntimeLayer } from "./runtime.js";
2
2
  import { SilkToolkit, ToolsLayer } from "./toolkit.js";
3
3
  import { CURRENT_MCP_VERSION } from "./version.js";
4
- import { McpStdio, McpToolkit } from "@effected/mcp";
5
- import { Layer, Option } from "effect";
6
- import { distributionSuffix } from "@effected/engine";
4
+ import { McpStdio, McpToolkit } from "@effected/mcp-kit";
5
+ import { Effect, Layer, Option } from "effect";
6
+ import { distributionSuffix } from "@effected/kit";
7
+ import { McpServer } from "effect/ai";
7
8
 
8
9
  // src/server.ts
9
10
  /**
@@ -26,15 +27,34 @@ const SERVER_INSTRUCTIONS = [
26
27
  "Every successful result is a typed object in structuredContent (content[0].text carries the same object as JSON). A failure is an isError result whose content[0].text carries the message and remediation, with no structuredContent. Every tool takes an optional cwd; omit it to use the server's project directory."
27
28
  ].join("\n");
28
29
  /**
29
- * The toolkit registration as a layer: `McpToolkit.layer` over core's
30
- * module-level `McpServer.McpServer.layer` — the same reference
31
- * `McpStdio.layer` serves, so layer memoization lands the registration on the
32
- * served instance — with the handlers bound to `cwd`.
30
+ * Discharges every tool's declared `dependencies`. Since effect 4.1 a service a
31
+ * tool lists in `dependencies` is a per-request `McpRequest<"Requires", S>`
32
+ * requirement that only MCP middleware or the transport can meet;
33
+ * `Layer.provide` no longer does. The silk runtime is built ONCE (it holds the
34
+ * process-lifetime `ConfigInspector`, #229), so the middleware captures its
35
+ * context when the layer is built and provides that same context to every
36
+ * request.
37
+ *
38
+ * `Effect.context` captures the whole layer-build context, not only
39
+ * `McpServices` (also `Scope`, `Clock`, `Console`, `McpServer`, the memo map),
40
+ * and `Effect.provideContext` merges it OVER the request's context. Probed on
41
+ * 4.1.1: a handler finalizer still runs at the end of its own request, and no
42
+ * request-scoped key (`McpRequestContext`, log level, parent span) is in the
43
+ * build context today. Core's own registration capture filters those keys
44
+ * (`omitRequestServices`); this capture does not, so do not build this layer
45
+ * inside a span or under a request-level reference.
46
+ */
47
+ const RuntimeMiddleware = McpServer.middleware()(Effect.map(Effect.context(), (context) => (effect) => Effect.provideContext(effect, context)));
48
+ /**
49
+ * The toolkit registration as a layer: `McpToolkit.layer` with the handlers
50
+ * bound to `cwd` and {@link RuntimeMiddleware} meeting their request-level
51
+ * dependencies. Passed to `McpStdio.layer` as `registrations`, so it builds
52
+ * before the first request.
33
53
  */
34
- const SilkToolsLayer = (cwd) => McpToolkit.layer(SilkToolkit, { strict: "annotated" }).pipe(Layer.provide(ToolsLayer(cwd)));
54
+ const SilkToolsLayer = (cwd) => McpToolkit.layer(SilkToolkit, { strict: "annotated" }).pipe(Layer.provide(ToolsLayer(cwd)), Layer.provide(RuntimeMiddleware.layer));
35
55
  /**
36
56
  * The whole server as one layer: the ten-tool toolkit, the silk-effects
37
- * runtime discharging its dependencies, over `@effected/mcp`'s
57
+ * runtime discharging its dependencies, over `@effected/mcp-kit`'s
38
58
  * `McpStdio.layer`.
39
59
  *
40
60
  * `McpStdio.layer` is `McpServer.layerStdio` with the kit's default
@@ -44,11 +64,12 @@ const SilkToolsLayer = (cwd) => McpToolkit.layer(SilkToolkit, { strict: "annotat
44
64
  *
45
65
  * @public
46
66
  */
47
- const ServerLayer = (cwd, options = {}) => SilkToolsLayer(cwd).pipe(Layer.provide(makeSilkRuntimeLayer(cwd)), Layer.provide(McpStdio.layer({
67
+ const ServerLayer = (cwd, options = {}) => McpStdio.layer({
48
68
  name: "savvy-mcp",
49
69
  version: `${CURRENT_MCP_VERSION}${distributionSuffix(Option.fromNullishOr(options.distribution))}`,
50
70
  description: "Structured Silk Suite workspace tools: workspace, turbo, biome, changesets and vendored repos.",
51
- instructions: SERVER_INSTRUCTIONS
52
- })));
71
+ instructions: SERVER_INSTRUCTIONS,
72
+ registrations: SilkToolsLayer(cwd)
73
+ }).pipe(Layer.provide(makeSilkRuntimeLayer(cwd)));
53
74
 
54
75
  export { SERVER_INSTRUCTIONS, ServerLayer };
package/toolkit.js CHANGED
@@ -9,7 +9,7 @@ import { handleReposManage, reposManageTool } from "./tools/repos-manage.js";
9
9
  import { handleTurboInspect, turboInspectTool } from "./tools/turbo-inspect.js";
10
10
  import { handleWorkspaceInfo, workspaceInfoTool } from "./tools/workspace-info.js";
11
11
  import { Effect } from "effect";
12
- import { Exclusive } from "@effected/engine";
12
+ import { Exclusive } from "@effected/kit";
13
13
  import { Toolkit } from "effect/ai";
14
14
 
15
15
  // src/toolkit.ts
@@ -1,5 +1,5 @@
1
1
  import { BiomeFailed, McpToolError } from "../errors.js";
2
- import { ToolFailure, ToolRefusal } from "@effected/mcp";
2
+ import { ToolFailure, ToolRefusal } from "@effected/mcp-kit";
3
3
  import { Effect, Option, Schema } from "effect";
4
4
  import { Run, Tool, ToolDiscovery } from "@effected/commands";
5
5
  import { Tool as Tool$1 } from "effect/ai";
@@ -71,8 +71,8 @@ const GitlabDiagnostic = Schema.Struct({
71
71
  lines: Schema.Struct({ begin: Schema.Number })
72
72
  })
73
73
  });
74
- const GitlabArray = Schema.Array(GitlabDiagnostic);
75
- const decodeGitlab = Schema.decodeUnknownSync(GitlabArray);
74
+ /** Biome's gitlab stdout, parsed and decoded in one step; `None` for non-JSON or a shape mismatch. */
75
+ const decodeGitlab = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Array(GitlabDiagnostic)));
76
76
  /**
77
77
  * Map a gitlab severity back onto the Biome severity it was produced from.
78
78
  *
@@ -91,19 +91,9 @@ const mapSeverity = (s) => s === "info" || s === "minor" ? "info" : s === "major
91
91
  const parseBiomeGitlab = (stdout) => {
92
92
  const trimmed = stdout.trim();
93
93
  if (!trimmed) return [];
94
- let raw;
95
- try {
96
- raw = JSON.parse(trimmed);
97
- } catch {
98
- return [];
99
- }
100
- let decoded;
101
- try {
102
- decoded = decodeGitlab(raw);
103
- } catch {
104
- return [];
105
- }
106
- return decoded.map((d) => ({
94
+ const decoded = decodeGitlab(trimmed);
95
+ if (Option.isNone(decoded)) return [];
96
+ return decoded.value.map((d) => ({
107
97
  file: d.location.path,
108
98
  line: d.location.lines.begin,
109
99
  severity: mapSeverity(d.severity),
@@ -1,5 +1,5 @@
1
1
  import { McpToolError, mapEngineError } from "../errors.js";
2
- import { ToolOutputSchema } from "@effected/mcp";
2
+ import { ToolOutputSchema } from "@effected/mcp-kit";
3
3
  import { Effect, Schema } from "effect";
4
4
  import { WorkspaceRoot } from "@effected/workspaces";
5
5
  import { Changesets } from "@savvy-web/silk-effects";
@@ -1,5 +1,5 @@
1
1
  import { McpToolError, mapEngineError } from "../errors.js";
2
- import { ToolFailure, ToolRefusal } from "@effected/mcp";
2
+ import { ToolFailure, ToolRefusal } from "@effected/mcp-kit";
3
3
  import { Data, Effect, Schema } from "effect";
4
4
  import { WorkspaceRoot } from "@effected/workspaces";
5
5
  import { Changesets } from "@savvy-web/silk-effects";
@@ -1,5 +1,5 @@
1
1
  import { McpToolError, mapEngineError } from "../errors.js";
2
- import { ToolOutputSchema } from "@effected/mcp";
2
+ import { ToolOutputSchema } from "@effected/mcp-kit";
3
3
  import { Effect, FileSystem, Option, Path, Result, Schema } from "effect";
4
4
  import { WorkspaceRoot } from "@effected/workspaces";
5
5
  import { Repos } from "@savvy-web/silk-effects";
@@ -1,5 +1,5 @@
1
1
  import { McpToolError, mapEngineError } from "../errors.js";
2
- import { McpToolkit, ToolOutputSchema, ToolRefusal } from "@effected/mcp";
2
+ import { McpToolkit, ToolOutputSchema, ToolRefusal } from "@effected/mcp-kit";
3
3
  import { Effect, Result, Schema } from "effect";
4
4
  import { WorkspaceRoot } from "@effected/workspaces";
5
5
  import { Repos } from "@savvy-web/silk-effects";
@@ -10,7 +10,7 @@ import { Tool } from "effect/ai";
10
10
  * The `repos_manage` MCP tool: one action-discriminated mutating tool
11
11
  * covering `sync`, `pin`, `add`, `note`, `remove`, `rename`, `restore`, and
12
12
  * `deregister` against the vendored `.repos/` submodules. Its parameters are
13
- * a `Schema.Union` of one struct per action, served by `@effected/mcp`'s
13
+ * a `Schema.Union` of one struct per action, served by `@effected/mcp-kit`'s
14
14
  * `McpToolkit.unionTool` as a strict `oneOf` keyed by `action`; the handler
15
15
  * receives the decoded member. Mutating — no `readOnlyHint`.
16
16
  *
@@ -1,5 +1,5 @@
1
1
  import { McpToolError, mapEngineError } from "../errors.js";
2
- import { ToolOutputSchema } from "@effected/mcp";
2
+ import { ToolOutputSchema } from "@effected/mcp-kit";
3
3
  import { Effect, Schema } from "effect";
4
4
  import { WorkspaceRoot } from "@effected/workspaces";
5
5
  import { Turbo } from "@savvy-web/silk-effects";
package/version.js CHANGED
@@ -6,6 +6,6 @@
6
6
  *
7
7
  * @packageDocumentation
8
8
  */
9
- const CURRENT_MCP_VERSION = "3.4.19";
9
+ const CURRENT_MCP_VERSION = "3.4.21";
10
10
 
11
11
  export { CURRENT_MCP_VERSION };