@gwdn/nexus-mcp 0.10.13 → 0.10.14
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/project-scope.d.ts
CHANGED
|
@@ -19,10 +19,15 @@ export declare class MissingProjectIdError extends Error {
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function resolveProjectId(explicit?: string | null): string;
|
|
21
21
|
/**
|
|
22
|
-
* Wrap a tool handler
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* Wrap a tool handler whose schema declares an optional `project_id` field.
|
|
23
|
+
* Resolves the project scope via NEXUS_PROJECT_ID before the handler runs.
|
|
24
|
+
*
|
|
25
|
+
* Only wrap tools whose schema actually declares a `project_id` parameter --
|
|
26
|
+
* this helper always injects a resolved value, regardless of whether the
|
|
27
|
+
* caller's args object included the key at all. MCP clients commonly omit
|
|
28
|
+
* optional parameters entirely (no key present) rather than sending them as
|
|
29
|
+
* `undefined`, so checking for key presence would miss the common case and
|
|
30
|
+
* defeat the fallback.
|
|
26
31
|
*/
|
|
27
32
|
export declare function withProjectFallback(handler: (args: any) => Promise<any>): (args: any) => Promise<any>;
|
|
28
33
|
//# sourceMappingURL=project-scope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-scope.d.ts","sourceRoot":"","sources":["../src/project-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,qBAAa,qBAAsB,SAAQ,KAAK;;CAS/C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAKjE;AAED
|
|
1
|
+
{"version":3,"file":"project-scope.d.ts","sourceRoot":"","sources":["../src/project-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,qBAAa,qBAAsB,SAAQ,KAAK;;CAS/C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAKjE;AAED;;;;;;;;;;GAUG;AAEH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,IAExD,MAAM,GAAG,kBAOxB"}
|
package/dist/project-scope.js
CHANGED
|
@@ -31,22 +31,25 @@ export function resolveProjectId(explicit) {
|
|
|
31
31
|
throw new MissingProjectIdError();
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Wrap a tool handler
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
34
|
+
* Wrap a tool handler whose schema declares an optional `project_id` field.
|
|
35
|
+
* Resolves the project scope via NEXUS_PROJECT_ID before the handler runs.
|
|
36
|
+
*
|
|
37
|
+
* Only wrap tools whose schema actually declares a `project_id` parameter --
|
|
38
|
+
* this helper always injects a resolved value, regardless of whether the
|
|
39
|
+
* caller's args object included the key at all. MCP clients commonly omit
|
|
40
|
+
* optional parameters entirely (no key present) rather than sending them as
|
|
41
|
+
* `undefined`, so checking for key presence would miss the common case and
|
|
42
|
+
* defeat the fallback.
|
|
38
43
|
*/
|
|
39
44
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
45
|
export function withProjectFallback(handler) {
|
|
41
46
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
47
|
return async (args) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
return handler(args);
|
|
48
|
+
const base = args && typeof args === 'object' ? args : {};
|
|
49
|
+
return handler({
|
|
50
|
+
...base,
|
|
51
|
+
project_id: resolveProjectId(base.project_id),
|
|
52
|
+
});
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
55
|
//# sourceMappingURL=project-scope.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-scope.js","sourceRoot":"","sources":["../src/project-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C;QACE,KAAK,CACH,8DAA8D;YAC5D,8DAA8D;YAC9D,4CAA4C,CAC/C,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAA;IACrC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAwB;IACvD,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAA;IAC7C,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC7B,MAAM,IAAI,qBAAqB,EAAE,CAAA;AACnC,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"project-scope.js","sourceRoot":"","sources":["../src/project-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C;QACE,KAAK,CACH,8DAA8D;YAC5D,8DAA8D;YAC9D,4CAA4C,CAC/C,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAA;IACrC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAwB;IACvD,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAA;IAC7C,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC7B,MAAM,IAAI,qBAAqB,EAAE,CAAA;AACnC,CAAC;AAED;;;;;;;;;;GAUG;AACH,8DAA8D;AAC9D,MAAM,UAAU,mBAAmB,CAAC,OAAoC;IACtE,8DAA8D;IAC9D,OAAO,KAAK,EAAE,IAAS,EAAE,EAAE;QACzB,MAAM,IAAI,GAAG,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;QACzD,OAAO,OAAO,CAAC;YACb,GAAG,IAAI;YACP,UAAU,EAAE,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC;SAC9C,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED