toolcraft 0.0.309 → 0.0.311
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/composition.json +3 -3
- package/dist/composition.json +3 -3
- package/node_modules/auth-store/README.md +16 -0
- package/node_modules/auth-store/dist/encrypted-file-store.d.ts +3 -0
- package/node_modules/auth-store/dist/encrypted-file-store.js +7 -0
- package/node_modules/auth-store/dist/index.d.ts +1 -0
- package/node_modules/auth-store/dist/keychain-store.d.ts +8 -0
- package/node_modules/auth-store/dist/keychain-store.js +13 -0
- package/node_modules/auth-store/dist/transaction-lock.d.ts +24 -0
- package/node_modules/auth-store/dist/transaction-lock.js +152 -0
- package/node_modules/auth-store/dist/types.d.ts +2 -0
- package/node_modules/tiny-http-mcp-server/dist/composition.json +1 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/README.md +33 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/auth-store-session-store.js +8 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +202 -185
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/session-transaction.d.ts +6 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/session-transaction.js +42 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-endpoint.d.ts +3 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/token-endpoint.js +7 -3
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/types.d.ts +14 -1
- package/node_modules/tiny-http-mcp-server/package.json +1 -1
- package/node_modules/tiny-mcp-client/dist/index.d.ts +39 -1
- package/node_modules/tiny-mcp-client/dist/index.js +503 -254
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/toolcraft-schema/package.json +1 -1
- package/package.json +2 -2
|
@@ -20,11 +20,31 @@ interface McpSubscription {
|
|
|
20
20
|
cancel(): void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
interface SecretStoreLockFileSystem {
|
|
24
|
+
mkdir(path: string, options?: {
|
|
25
|
+
recursive?: boolean;
|
|
26
|
+
mode?: number;
|
|
27
|
+
}): Promise<unknown>;
|
|
28
|
+
readdir(path: string): Promise<string[]>;
|
|
29
|
+
readFile(path: string, encoding: BufferEncoding): Promise<string>;
|
|
30
|
+
writeFile(path: string, value: string, options: {
|
|
31
|
+
encoding: BufferEncoding;
|
|
32
|
+
flag: string;
|
|
33
|
+
mode: number;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
rename(from: string, to: string): Promise<void>;
|
|
36
|
+
unlink(path: string): Promise<void>;
|
|
37
|
+
lstat(path: string): Promise<{
|
|
38
|
+
isSymbolicLink(): boolean;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
|
|
23
42
|
interface MachineIdentity {
|
|
24
43
|
hostname: string;
|
|
25
44
|
username: string;
|
|
26
45
|
}
|
|
27
46
|
interface EncryptedFileStoreFileSystem {
|
|
47
|
+
readdir?(path: string): Promise<string[]>;
|
|
28
48
|
readFile(path: string, encoding: BufferEncoding): Promise<string>;
|
|
29
49
|
writeFile(path: string, data: string | NodeJS.ArrayBufferView, options?: {
|
|
30
50
|
encoding?: BufferEncoding;
|
|
@@ -65,6 +85,10 @@ interface KeychainStoreInput {
|
|
|
65
85
|
runCommand?: KeychainCommandRunner;
|
|
66
86
|
service: string;
|
|
67
87
|
account: string;
|
|
88
|
+
lock?: {
|
|
89
|
+
fs?: SecretStoreLockFileSystem;
|
|
90
|
+
directory?: string;
|
|
91
|
+
};
|
|
68
92
|
}
|
|
69
93
|
|
|
70
94
|
type StoreBackend = "file" | "keychain";
|
|
@@ -110,7 +134,7 @@ interface OAuthClientProvider {
|
|
|
110
134
|
headers: Headers;
|
|
111
135
|
fetch: OAuthMetadataFetch;
|
|
112
136
|
signal?: AbortSignal;
|
|
113
|
-
}): Promise<void> | void;
|
|
137
|
+
}): Promise<StoredOAuthTokens | void> | StoredOAuthTokens | void;
|
|
114
138
|
handleUnauthorized(input: {
|
|
115
139
|
requestUrl: URL;
|
|
116
140
|
response: Response;
|
|
@@ -118,6 +142,10 @@ interface OAuthClientProvider {
|
|
|
118
142
|
discovery: OAuthDiscoveryResult;
|
|
119
143
|
fetch: OAuthMetadataFetch;
|
|
120
144
|
signal?: AbortSignal;
|
|
145
|
+
/** Headers actually attached to this rejected request. */
|
|
146
|
+
requestHeaders?: Headers;
|
|
147
|
+
/** Owned snapshot returned when this request was authorized, or null if absent. */
|
|
148
|
+
presentedTokens?: StoredOAuthTokens | null;
|
|
121
149
|
}): Promise<{
|
|
122
150
|
action: "retry";
|
|
123
151
|
} | {
|
|
@@ -151,6 +179,8 @@ interface StoredOAuthSession {
|
|
|
151
179
|
clientSecret?: string;
|
|
152
180
|
};
|
|
153
181
|
tokens?: StoredOAuthTokens;
|
|
182
|
+
/** A refresh was begun; its winning response may not have been persisted. */
|
|
183
|
+
refreshState?: "pending";
|
|
154
184
|
discovery: {
|
|
155
185
|
resourceMetadataUrl: string;
|
|
156
186
|
resourceMetadata: Record<string, unknown>;
|
|
@@ -161,6 +191,11 @@ interface OAuthSessionStore {
|
|
|
161
191
|
load(resource: string): Promise<StoredOAuthSession | null>;
|
|
162
192
|
save(resource: string, session: StoredOAuthSession): Promise<void>;
|
|
163
193
|
clear(resource: string): Promise<void>;
|
|
194
|
+
/** Backend-wide lock covering a complete read/redeem/write transaction. */
|
|
195
|
+
withLock?<T>(resource: string, operation: () => Promise<T>, options: {
|
|
196
|
+
signal?: AbortSignal;
|
|
197
|
+
timeoutMs: number;
|
|
198
|
+
}): Promise<T>;
|
|
164
199
|
}
|
|
165
200
|
interface DefaultOAuthClientProviderOptions {
|
|
166
201
|
client: {
|
|
@@ -176,6 +211,8 @@ interface DefaultOAuthClientProviderOptions {
|
|
|
176
211
|
};
|
|
177
212
|
/** Disable interactive authorization while allowing cached tokens and silent refresh. */
|
|
178
213
|
allowInteractive?: boolean;
|
|
214
|
+
/** Maximum wait to acquire a session transaction lock (default 30,000 ms). */
|
|
215
|
+
sessionLockTimeoutMs?: number;
|
|
179
216
|
/** Import an existing grant for one resource. Persisted sessions take precedence. */
|
|
180
217
|
initialGrant?: {
|
|
181
218
|
resource: string;
|
|
@@ -649,6 +686,7 @@ declare class HttpTransport implements McpTransport {
|
|
|
649
686
|
private readonly oauthMetadataDiscovery;
|
|
650
687
|
private readonly inFlightFetchAbortControllers;
|
|
651
688
|
private readonly inFlightOAuthAbortControllers;
|
|
689
|
+
private readonly oauthRequestTokens;
|
|
652
690
|
private readonly openResponseReaders;
|
|
653
691
|
private readonly modernRequests;
|
|
654
692
|
private modernMode;
|