@workpowers/speckle 0.7.0 → 0.8.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/dist/headers.d.ts CHANGED
@@ -13,7 +13,15 @@
13
13
  */
14
14
  import type { ResolvedWorkspace } from "./workspace.js";
15
15
  export declare const ROUTER_CLIENT_NAME = "@workpowers/speckle";
16
- export declare const ROUTER_CLIENT_VERSION = "0.7.0";
16
+ export declare const ROUTER_CLIENT_VERSION = "0.8.0";
17
+ /**
18
+ * The MCP client the router serves, as it named itself at initialize
19
+ * (`claude-code/2.1.0`), so the server can say which door a person's quoted
20
+ * words came through instead of a composed source (I-7010). Set on the live
21
+ * header object once the downstream client has initialized; every request
22
+ * after that carries it.
23
+ */
24
+ export declare const MCP_CLIENT_HEADER = "X-Speckle-Mcp-Client";
17
25
  export interface RouterRequestHeaders {
18
26
  Authorization: string;
19
27
  "X-Speckle-Client": string;
@@ -22,6 +30,7 @@ export interface RouterRequestHeaders {
22
30
  "X-Speckle-Workspace-Hash"?: string;
23
31
  "X-Speckle-Project-Slug"?: string;
24
32
  "X-Speckle-Repo-Remote"?: string;
33
+ "X-Speckle-Mcp-Client"?: string;
25
34
  }
26
35
  export declare function buildRouterHeaders(args: {
27
36
  apiKey: string;
package/dist/headers.js CHANGED
@@ -12,7 +12,15 @@
12
12
  * the server then exposes a project-agnostic discovery toolset.
13
13
  */
14
14
  export const ROUTER_CLIENT_NAME = "@workpowers/speckle";
15
- export const ROUTER_CLIENT_VERSION = "0.7.0";
15
+ export const ROUTER_CLIENT_VERSION = "0.8.0";
16
+ /**
17
+ * The MCP client the router serves, as it named itself at initialize
18
+ * (`claude-code/2.1.0`), so the server can say which door a person's quoted
19
+ * words came through instead of a composed source (I-7010). Set on the live
20
+ * header object once the downstream client has initialized; every request
21
+ * after that carries it.
22
+ */
23
+ export const MCP_CLIENT_HEADER = "X-Speckle-Mcp-Client";
16
24
  export function buildRouterHeaders(args) {
17
25
  const { apiKey, workspace, fallbackProjectId } = args;
18
26
  const headers = {
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
31
31
  import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
32
32
  import { loadRouterConfig, resolveSpeckleHost } from "./config.js";
33
33
  import { resolveWorkspace, workspaceOptionsFromConfig, rootOriginFromConfig } from "./workspace.js";
34
- import { buildRouterHeaders, ROUTER_CLIENT_NAME, ROUTER_CLIENT_VERSION } from "./headers.js";
34
+ import { buildRouterHeaders, MCP_CLIENT_HEADER, ROUTER_CLIENT_NAME, ROUTER_CLIENT_VERSION } from "./headers.js";
35
35
  import { mirrorServerOptions, wireProxyHandlers } from "./proxy.js";
36
36
  import { SpeckleRouterError } from "./errors.js";
37
37
  import path from "node:path";
@@ -73,6 +73,15 @@ export async function startRouter() {
73
73
  await upstream.connect(httpTransport);
74
74
  const capabilities = upstream.getServerCapabilities() ?? {};
75
75
  const downstream = new Server({ name: ROUTER_CLIENT_NAME, version: ROUTER_CLIENT_VERSION }, mirrorServerOptions(upstream, capabilities));
76
+ // The agent names itself at initialize (`claude-code`, `cursor` …). The
77
+ // upstream transport reads its headers on every request, so writing the
78
+ // name onto the same header object makes every later call carry it (I-7010).
79
+ downstream.oninitialized = () => {
80
+ const info = downstream.getClientVersion();
81
+ if (info?.name) {
82
+ headers[MCP_CLIENT_HEADER] = info.version ? `${info.name}/${info.version}` : info.name;
83
+ }
84
+ };
76
85
  wireProxyHandlers(downstream, upstream, capabilities, createWorkflowClient({
77
86
  root: workspace ? path.dirname(workspace.markerPath) : undefined,
78
87
  workspaceId: workspace?.workspaceRootHash,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workpowers/speckle",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Local MCP router for Speckle — resolves project context from a committed .speckle marker and forwards calls to the remote Speckle MCP endpoint.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",