@workpowers/speckle 0.9.1 → 0.9.2
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 +14 -1
- package/dist/headers.js +13 -2
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/dist/headers.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
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.9.
|
|
16
|
+
export declare const ROUTER_CLIENT_VERSION = "0.9.2";
|
|
17
17
|
/**
|
|
18
18
|
* The MCP client the router serves, as it named itself at initialize
|
|
19
19
|
* (`claude-code/2.1.0`), so the server can say which door a person's quoted
|
|
@@ -22,6 +22,15 @@ export declare const ROUTER_CLIENT_VERSION = "0.9.1";
|
|
|
22
22
|
* after that carries it.
|
|
23
23
|
*/
|
|
24
24
|
export declare const MCP_CLIENT_HEADER = "X-Speckle-Mcp-Client";
|
|
25
|
+
/**
|
|
26
|
+
* One agent session, as the router process that serves it (I-8763). The
|
|
27
|
+
* stdio router is one process per agent session, and the HTTP server keeps
|
|
28
|
+
* no session of its own, so the router mints a random id at start and sends
|
|
29
|
+
* it on every request. The server writes it on each call-log row, which is
|
|
30
|
+
* what lets it say whether a session read the spec before its first write.
|
|
31
|
+
* Telemetry only: never an identity and never auth.
|
|
32
|
+
*/
|
|
33
|
+
export declare const AGENT_SESSION_HEADER = "X-Speckle-Agent-Session";
|
|
25
34
|
export interface RouterRequestHeaders {
|
|
26
35
|
Authorization: string;
|
|
27
36
|
"X-Speckle-Client": string;
|
|
@@ -31,6 +40,7 @@ export interface RouterRequestHeaders {
|
|
|
31
40
|
"X-Speckle-Project-Slug"?: string;
|
|
32
41
|
"X-Speckle-Repo-Remote"?: string;
|
|
33
42
|
"X-Speckle-Mcp-Client"?: string;
|
|
43
|
+
"X-Speckle-Agent-Session"?: string;
|
|
34
44
|
}
|
|
35
45
|
export declare function buildRouterHeaders(args: {
|
|
36
46
|
apiKey: string;
|
|
@@ -43,5 +53,8 @@ export declare function buildRouterHeaders(args: {
|
|
|
43
53
|
* deliberately absent because there is no marker to attest.
|
|
44
54
|
*/
|
|
45
55
|
fallbackProjectId?: number;
|
|
56
|
+
/** The agent session this router process serves (I-8763); the stdio router
|
|
57
|
+
* passes one random id per process, the one-shot commands pass none. */
|
|
58
|
+
agentSessionId?: string;
|
|
46
59
|
}): RouterRequestHeaders;
|
|
47
60
|
//# sourceMappingURL=headers.d.ts.map
|
package/dist/headers.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
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.9.
|
|
15
|
+
export const ROUTER_CLIENT_VERSION = "0.9.2";
|
|
16
16
|
/**
|
|
17
17
|
* The MCP client the router serves, as it named itself at initialize
|
|
18
18
|
* (`claude-code/2.1.0`), so the server can say which door a person's quoted
|
|
@@ -21,12 +21,23 @@ export const ROUTER_CLIENT_VERSION = "0.9.1";
|
|
|
21
21
|
* after that carries it.
|
|
22
22
|
*/
|
|
23
23
|
export const MCP_CLIENT_HEADER = "X-Speckle-Mcp-Client";
|
|
24
|
+
/**
|
|
25
|
+
* One agent session, as the router process that serves it (I-8763). The
|
|
26
|
+
* stdio router is one process per agent session, and the HTTP server keeps
|
|
27
|
+
* no session of its own, so the router mints a random id at start and sends
|
|
28
|
+
* it on every request. The server writes it on each call-log row, which is
|
|
29
|
+
* what lets it say whether a session read the spec before its first write.
|
|
30
|
+
* Telemetry only: never an identity and never auth.
|
|
31
|
+
*/
|
|
32
|
+
export const AGENT_SESSION_HEADER = "X-Speckle-Agent-Session";
|
|
24
33
|
export function buildRouterHeaders(args) {
|
|
25
|
-
const { apiKey, workspace, fallbackProjectId } = args;
|
|
34
|
+
const { apiKey, workspace, fallbackProjectId, agentSessionId } = args;
|
|
26
35
|
const headers = {
|
|
27
36
|
Authorization: `Bearer ${apiKey}`,
|
|
28
37
|
"X-Speckle-Client": `${ROUTER_CLIENT_NAME}/${ROUTER_CLIENT_VERSION}`,
|
|
29
38
|
};
|
|
39
|
+
if (agentSessionId)
|
|
40
|
+
headers[AGENT_SESSION_HEADER] = agentSessionId;
|
|
30
41
|
if (!workspace) {
|
|
31
42
|
if (fallbackProjectId !== undefined) {
|
|
32
43
|
headers["X-Speckle-Project-Id"] = String(fallbackProjectId);
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ import { buildRouterHeaders, MCP_CLIENT_HEADER, ROUTER_CLIENT_NAME, ROUTER_CLIEN
|
|
|
35
35
|
import { mirrorServerOptions, wireProxyHandlers } from "./proxy.js";
|
|
36
36
|
import { SpeckleRouterError } from "./errors.js";
|
|
37
37
|
import path from "node:path";
|
|
38
|
+
import { randomUUID } from "node:crypto";
|
|
38
39
|
import { createWorkflowClient } from "./workflow-client.js";
|
|
39
40
|
export async function startRouter() {
|
|
40
41
|
const config = loadRouterConfig();
|
|
@@ -65,6 +66,8 @@ export async function startRouter() {
|
|
|
65
66
|
apiKey: config.apiKey,
|
|
66
67
|
workspace,
|
|
67
68
|
fallbackProjectId: workspace ? undefined : config.fallbackProjectId,
|
|
69
|
+
// This process serves one agent session; every call it forwards says so (I-8763).
|
|
70
|
+
agentSessionId: randomUUID(),
|
|
68
71
|
});
|
|
69
72
|
const upstream = new Client({ name: ROUTER_CLIENT_NAME, version: ROUTER_CLIENT_VERSION }, { capabilities: {} });
|
|
70
73
|
const httpTransport = new StreamableHTTPClientTransport(new URL(`${host.hostUrl}/mcp`), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workpowers/speckle",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
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",
|