modality-ai 0.8.2 → 0.8.4
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 +36853 -119858
- package/dist/types/__tests__/oauth-helpers.test.d.ts +1 -0
- package/dist/types/mcp-oauth-provider.d.ts +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -46,6 +46,15 @@ interface CLIBrowserOAuthProviderOptions {
|
|
|
46
46
|
*/
|
|
47
47
|
serverUrl?: string | null;
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Per-server OAuth client identity override.
|
|
51
|
+
* Some MCP servers whitelist specific client_name values during dynamic
|
|
52
|
+
* registration — use this map to supply the expected identity automatically.
|
|
53
|
+
*/
|
|
54
|
+
interface ServerClientIdentity {
|
|
55
|
+
client_name: string;
|
|
56
|
+
client_uri: string;
|
|
57
|
+
}
|
|
49
58
|
/**
|
|
50
59
|
* OAuthClientProvider for CLI tools.
|
|
51
60
|
*
|
|
@@ -93,6 +102,12 @@ export declare class CLIBrowserOAuthProvider implements OAuthClientProvider {
|
|
|
93
102
|
private _tokens?;
|
|
94
103
|
private _discoveryState?;
|
|
95
104
|
constructor(options?: CLIBrowserOAuthProviderOptions);
|
|
105
|
+
/**
|
|
106
|
+
* Clear cached clientInfo when its redirect_uris don't match the current redirectUrl.
|
|
107
|
+
* This handles the case where the user switches --callback-port or the cache is stale.
|
|
108
|
+
* Skip invalidation when clientId is explicitly provided (no redirect_uris expected).
|
|
109
|
+
*/
|
|
110
|
+
private _invalidateStaleCache;
|
|
96
111
|
get redirectUrl(): string;
|
|
97
112
|
get clientMetadata(): OAuthClientMetadata;
|
|
98
113
|
clientInformation(): OAuthClientInformationMixed | undefined;
|
|
@@ -149,6 +164,16 @@ export declare class CLIBrowserOAuthProvider implements OAuthClientProvider {
|
|
|
149
164
|
private _persistCache;
|
|
150
165
|
private _handleCallback;
|
|
151
166
|
}
|
|
167
|
+
/** Escape HTML special characters to prevent XSS from attacker-controlled strings. */
|
|
168
|
+
export declare function escapeHtml(s: string): string;
|
|
169
|
+
/** Short stable hash of a string — used to derive a cache file name from a URL. */
|
|
170
|
+
export declare function urlStorageKey(url: string): string;
|
|
171
|
+
/**
|
|
172
|
+
* Returns a whitelisted client identity for the given server URL, or null
|
|
173
|
+
* if none matches. Matching is hostname-suffix based: a key "figma.com"
|
|
174
|
+
* matches "mcp.figma.com", "api.figma.com", etc.
|
|
175
|
+
*/
|
|
176
|
+
export declare function resolveServerIdentity(serverUrl: string): ServerClientIdentity | null;
|
|
152
177
|
/** Options for {@link createHostedOAuth}. */
|
|
153
178
|
export interface HostedOAuthOptions {
|
|
154
179
|
/**
|
package/package.json
CHANGED