@workpowers/speckle 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -122,6 +122,12 @@ refuses a section edited since that receipt rather than overwriting it, and it
122
122
  is a no-op while the section is current. The section's revision is its content
123
123
  hash, independent of the planning and bootstrap revisions. No commits are made.
124
124
 
125
+ The section is a snapshot: it is only as current as the last run. A repository
126
+ whose agents all reach Speckle over MCP does not need it — they read the
127
+ charter live with `speckle_get_workflow` and the index with
128
+ `get_standards_brief` — and Speckle's own repositories do not commit it
129
+ (I-7085). Use it for tools that cannot call Speckle.
130
+
125
131
  ## Diagnosing
126
132
 
127
133
  ```bash
package/dist/cli.js CHANGED
@@ -160,7 +160,7 @@ function printHelp() {
160
160
  " for hosts that launch the router outside the repo.",
161
161
  " speckle-mcp workflow Fetch live guidance and preview dedicated local files.",
162
162
  " --apply Apply after ownership checks; review the Git diff.",
163
- " --cache Also keep planning guidance for explicit offline fallback.",
163
+ " --cache Also keep the Speckle Workflow for explicit offline fallback.",
164
164
  " speckle-mcp instructions Fetch the project's spec-derived agent instructions (charter +",
165
165
  " Knowledge index with S-codes) and preview the managed AGENTS.md section.",
166
166
  " --apply Write only the marked section; bytes outside it stay as they are.",
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.1";
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.1";
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.1",
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",