modality-ai 0.5.2 → 0.5.3
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/index.js
CHANGED
|
@@ -138854,10 +138854,10 @@ class CLIBrowserOAuthProvider {
|
|
|
138854
138854
|
constructor(options = {}) {
|
|
138855
138855
|
this._clientName = options.clientName ?? "mcp-cli";
|
|
138856
138856
|
this._noOpen = options.noOpen ?? false;
|
|
138857
|
-
if (options.
|
|
138857
|
+
if (options.serverUrl === null) {
|
|
138858
138858
|
this._cachePath = null;
|
|
138859
138859
|
} else {
|
|
138860
|
-
const key = options.
|
|
138860
|
+
const key = options.serverUrl ? urlStorageKey(options.serverUrl) : "default";
|
|
138861
138861
|
const dir3 = join8(homedir(), ".cache", "counter");
|
|
138862
138862
|
mkdirSync(dir3, { recursive: true });
|
|
138863
138863
|
this._cachePath = join8(dir3, `${key}.json`);
|
|
@@ -139098,7 +139098,6 @@ function urlStorageKey(url5) {
|
|
|
139098
139098
|
return createHash("sha1").update(url5).digest("hex").slice(0, 12);
|
|
139099
139099
|
}
|
|
139100
139100
|
export {
|
|
139101
|
-
urlStorageKey,
|
|
139102
139101
|
setupStdioToHttpTools,
|
|
139103
139102
|
mergeToolCallsAndResults,
|
|
139104
139103
|
createStdioClient,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export { ModalityClient } from "./ModalityClient";
|
|
|
3
3
|
export { setupStdioToHttpTools, createStdioClient, } from "./setupStdioToHttpTools";
|
|
4
4
|
export type { ModalityClientInstance } from "./ModalityClient";
|
|
5
5
|
export type { StdioClientOptions } from "./setupStdioToHttpTools";
|
|
6
|
-
export { CLIBrowserOAuthProvider
|
|
6
|
+
export { CLIBrowserOAuthProvider } from "./mcp-oauth-provider";
|
|
@@ -22,14 +22,11 @@ interface CLIBrowserOAuthProviderOptions {
|
|
|
22
22
|
*/
|
|
23
23
|
noOpen?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* own cache entry and re-runs skip dynamic registration entirely.
|
|
28
|
-
*
|
|
29
|
-
* Pass an explicit string (e.g. "figma") for a human-readable cache name.
|
|
25
|
+
* MCP server URL used to derive a unique cache key via urlStorageKey().
|
|
26
|
+
* Each server gets its own cache entry so re-runs skip dynamic registration.
|
|
30
27
|
* Pass null to disable persistence entirely.
|
|
31
28
|
*/
|
|
32
|
-
|
|
29
|
+
serverUrl?: string | null;
|
|
33
30
|
}
|
|
34
31
|
/**
|
|
35
32
|
* OAuthClientProvider for CLI tools.
|
|
@@ -42,7 +39,7 @@ interface CLIBrowserOAuthProviderOptions {
|
|
|
42
39
|
* and the browser prompt (until the token expires).
|
|
43
40
|
*
|
|
44
41
|
* Usage:
|
|
45
|
-
* const provider = new CLIBrowserOAuthProvider({ clientName: "my-cli",
|
|
42
|
+
* const provider = new CLIBrowserOAuthProvider({ clientName: "my-cli", serverUrl: "https://mcp.figma.com/mcp" });
|
|
46
43
|
* const transport = new StreamableHTTPClientTransport(url, { authProvider: provider });
|
|
47
44
|
* const client = new Client(...);
|
|
48
45
|
*
|
|
@@ -97,6 +94,4 @@ export declare class CLIBrowserOAuthProvider implements OAuthClientProvider {
|
|
|
97
94
|
private _persistCache;
|
|
98
95
|
private _handleCallback;
|
|
99
96
|
}
|
|
100
|
-
/** Short stable hash of a string — used to derive a cache file name from a URL. */
|
|
101
|
-
export declare function urlStorageKey(url: string): string;
|
|
102
97
|
export {};
|
package/package.json
CHANGED