@dudko.dev/agent 0.0.47 → 0.0.48

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.d.cts CHANGED
@@ -1,7 +1,5 @@
1
- import { OAuthClientProvider, OAuthDiscoveryState } from '@modelcontextprotocol/sdk/client/auth.js';
2
- import { FetchLike } from '@modelcontextprotocol/sdk/shared/transport.js';
1
+ import { OAuthClientProvider, FetchLike, OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens, OAuthDiscoveryState } from '@modelcontextprotocol/client';
3
2
  import { Experimental_DecisionModel, ToolSet, Tool, ImageModel, SpeechModel, TranscriptionModel, LanguageModel, SystemModelMessage, ModelMessage } from 'ai';
4
- import { OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens } from '@modelcontextprotocol/sdk/shared/auth.js';
5
3
  import { JsonWebKey, KeyObject } from 'node:crypto';
6
4
 
7
5
  /**
@@ -1392,7 +1390,8 @@ interface INodeOAuthProviderOptions {
1392
1390
  * `authorization_response_iss_parameter_supported: true`;
1393
1391
  * - no stored discovery state (a store written by an older version): `iss` is
1394
1392
  * compared with the issuer stamped on the stored client information, and with
1395
- * nothing to compare against the response is accepted.
1393
+ * nothing to compare against the response is accepted. ({@link finishMcpOAuth}
1394
+ * does not exchange a code in that case: see there.)
1396
1395
  *
1397
1396
  * The browser package carries the same function; change both.
1398
1397
  */
@@ -1439,9 +1438,11 @@ declare class NodeOAuthProvider implements OAuthClientProvider {
1439
1438
  redirectToAuthorization(url: URL): Promise<void>;
1440
1439
  /**
1441
1440
  * Called by the SDK when the server rejects what we hold: `'tokens'` on an
1442
- * `invalid_grant` (dead refresh token), `'all'` on an `invalid_client` (the
1443
- * AS forgot our dynamic registration). `'client'`, `'verifier'` and
1444
- * `'discovery'` are in its type and handled the same way: one key each.
1441
+ * `invalid_grant` (dead refresh token); `'client'` and then `'tokens'` on an
1442
+ * `invalid_client` (the AS forgot our dynamic registration) - what discovery
1443
+ * found is kept on purpose, the SDK checks the next callback against it.
1444
+ * `'verifier'` and `'discovery'` are in its type and handled the same way:
1445
+ * one key each. `'all'` is what {@link reset} asks for.
1445
1446
  */
1446
1447
  invalidateCredentials(scope: 'all' | 'client' | 'tokens' | 'verifier' | 'discovery'): Promise<void>;
1447
1448
  /** True when there is no access token, or it expires within the skew window. */
@@ -1470,6 +1471,12 @@ declare const beginMcpOAuth: (provider: NodeOAuthProvider, opts?: IOAuthRequestO
1470
1471
  * issuer (RFC 9207, {@link checkAuthorizationResponseIssuer}), exchanges the
1471
1472
  * code with the stored PKCE verifier and persists the tokens. Throws unless the
1472
1473
  * exchange fully succeeded.
1474
+ *
1475
+ * A flow whose discovery state is not in the store any more (started by a
1476
+ * version that did not keep it, or cleared in between) is not completed: the
1477
+ * code is bound to the authorization server the operator was sent to, and
1478
+ * without the record of which one that was the SDK refuses the exchange.
1479
+ * Start again with {@link beginMcpOAuth}; stored tokens are not touched.
1473
1480
  */
1474
1481
  declare const finishMcpOAuth: (provider: NodeOAuthProvider, callback: {
1475
1482
  code: string;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- import { OAuthClientProvider, OAuthDiscoveryState } from '@modelcontextprotocol/sdk/client/auth.js';
2
- import { FetchLike } from '@modelcontextprotocol/sdk/shared/transport.js';
1
+ import { OAuthClientProvider, FetchLike, OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens, OAuthDiscoveryState } from '@modelcontextprotocol/client';
3
2
  import { Experimental_DecisionModel, ToolSet, Tool, ImageModel, SpeechModel, TranscriptionModel, LanguageModel, SystemModelMessage, ModelMessage } from 'ai';
4
- import { OAuthClientMetadata, OAuthClientInformationMixed, OAuthTokens } from '@modelcontextprotocol/sdk/shared/auth.js';
5
3
  import { JsonWebKey, KeyObject } from 'node:crypto';
6
4
 
7
5
  /**
@@ -1392,7 +1390,8 @@ interface INodeOAuthProviderOptions {
1392
1390
  * `authorization_response_iss_parameter_supported: true`;
1393
1391
  * - no stored discovery state (a store written by an older version): `iss` is
1394
1392
  * compared with the issuer stamped on the stored client information, and with
1395
- * nothing to compare against the response is accepted.
1393
+ * nothing to compare against the response is accepted. ({@link finishMcpOAuth}
1394
+ * does not exchange a code in that case: see there.)
1396
1395
  *
1397
1396
  * The browser package carries the same function; change both.
1398
1397
  */
@@ -1439,9 +1438,11 @@ declare class NodeOAuthProvider implements OAuthClientProvider {
1439
1438
  redirectToAuthorization(url: URL): Promise<void>;
1440
1439
  /**
1441
1440
  * Called by the SDK when the server rejects what we hold: `'tokens'` on an
1442
- * `invalid_grant` (dead refresh token), `'all'` on an `invalid_client` (the
1443
- * AS forgot our dynamic registration). `'client'`, `'verifier'` and
1444
- * `'discovery'` are in its type and handled the same way: one key each.
1441
+ * `invalid_grant` (dead refresh token); `'client'` and then `'tokens'` on an
1442
+ * `invalid_client` (the AS forgot our dynamic registration) - what discovery
1443
+ * found is kept on purpose, the SDK checks the next callback against it.
1444
+ * `'verifier'` and `'discovery'` are in its type and handled the same way:
1445
+ * one key each. `'all'` is what {@link reset} asks for.
1445
1446
  */
1446
1447
  invalidateCredentials(scope: 'all' | 'client' | 'tokens' | 'verifier' | 'discovery'): Promise<void>;
1447
1448
  /** True when there is no access token, or it expires within the skew window. */
@@ -1470,6 +1471,12 @@ declare const beginMcpOAuth: (provider: NodeOAuthProvider, opts?: IOAuthRequestO
1470
1471
  * issuer (RFC 9207, {@link checkAuthorizationResponseIssuer}), exchanges the
1471
1472
  * code with the stored PKCE verifier and persists the tokens. Throws unless the
1472
1473
  * exchange fully succeeded.
1474
+ *
1475
+ * A flow whose discovery state is not in the store any more (started by a
1476
+ * version that did not keep it, or cleared in between) is not completed: the
1477
+ * code is bound to the authorization server the operator was sent to, and
1478
+ * without the record of which one that was the SDK refuses the exchange.
1479
+ * Start again with {@link beginMcpOAuth}; stored tokens are not touched.
1473
1480
  */
1474
1481
  declare const finishMcpOAuth: (provider: NodeOAuthProvider, callback: {
1475
1482
  code: string;