@zuplo/runtime 7.6.8 → 7.6.9

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.
@@ -1302,7 +1302,14 @@ export declare type AiRequestBody =
1302
1302
  }
1303
1303
  | {
1304
1304
  format: "anthropic-messages";
1305
- body: AnthropicMessagesRequest;
1305
+ /**
1306
+ * `/v1/messages` bodies carry a required `max_tokens`;
1307
+ * `/v1/messages/count_tokens` bodies never do, and both classify as
1308
+ * `anthropic-messages` because they are the same schema dialect. The union
1309
+ * keeps a policy from reading `max_tokens` as if it were always present —
1310
+ * narrow on it (or on `getFormat`'s endpoint) before relying on it.
1311
+ */
1312
+ body: AnthropicMessagesRequest | AnthropicCountTokensRequest;
1306
1313
  };
1307
1314
 
1308
1315
  /**
@@ -1749,6 +1756,19 @@ declare interface AndRule {
1749
1756
  and: [NestedRule, ...NestedRule[]];
1750
1757
  }
1751
1758
 
1759
+ /**
1760
+ * A request to Anthropic's token-counting operation
1761
+ * (`/v1/messages/count_tokens`).
1762
+ *
1763
+ * The request uses the Messages body shape but does not require `max_tokens`.
1764
+ * The index signature preserves evolving Anthropic fields verbatim.
1765
+ */
1766
+ declare interface AnthropicCountTokensRequest {
1767
+ model: string;
1768
+ messages: AnthropicMessage[];
1769
+ [key: string]: unknown;
1770
+ }
1771
+
1752
1772
  declare interface AnthropicMessage {
1753
1773
  role: "user" | "assistant";
1754
1774
  content:
@@ -2439,7 +2459,7 @@ export declare interface Auth0JwtInboundPolicyOptions {
2439
2459
  */
2440
2460
  allowUnauthenticatedRequests?: boolean;
2441
2461
  /**
2442
- * Flag that determines whether OAuth protected resource metadata is enabled.
2462
+ * Enables OAuth 2.0 Protected Resource Metadata discovery (RFC 9728). When `true`, requests without a bearer token receive a 401 whose `WWW-Authenticate` header points `resource_metadata` at the `/.well-known/oauth-protected-resource` document for the request path and, when the `OAuthProtectedResourcePlugin` declares `scopesSupported`, lists those scopes in `scope`. Requires the `OAuthProtectedResourcePlugin` in `zuplo.runtime.ts` or a user-defined route at that path.
2443
2463
  */
2444
2464
  oAuthResourceMetadataEnabled?: boolean;
2445
2465
  }
@@ -3849,7 +3869,7 @@ export declare interface ClerkJwtInboundPolicyOptions {
3849
3869
  */
3850
3870
  allowUnauthenticatedRequests?: boolean;
3851
3871
  /**
3852
- * Flag that determines whether OAuth protected resource metadata is enabled.
3872
+ * Enables OAuth 2.0 Protected Resource Metadata discovery (RFC 9728). When `true`, requests without a bearer token receive a 401 whose `WWW-Authenticate` header points `resource_metadata` at the `/.well-known/oauth-protected-resource` document for the request path and, when the `OAuthProtectedResourcePlugin` declares `scopesSupported`, lists those scopes in `scope`. Requires the `OAuthProtectedResourcePlugin` in `zuplo.runtime.ts` or a user-defined route at that path.
3853
3873
  */
3854
3874
  oAuthResourceMetadataEnabled?: boolean;
3855
3875
  }
@@ -3934,7 +3954,7 @@ export declare interface CognitoJwtInboundPolicyOptions {
3934
3954
  */
3935
3955
  allowUnauthenticatedRequests?: boolean;
3936
3956
  /**
3937
- * Flag that determines whether OAuth protected resource metadata is enabled.
3957
+ * Enables OAuth 2.0 Protected Resource Metadata discovery (RFC 9728). When `true`, requests without a bearer token receive a 401 whose `WWW-Authenticate` header points `resource_metadata` at the `/.well-known/oauth-protected-resource` document for the request path and, when the `OAuthProtectedResourcePlugin` declares `scopesSupported`, lists those scopes in `scope`. Requires the `OAuthProtectedResourcePlugin` in `zuplo.runtime.ts` or a user-defined route at that path.
3938
3958
  */
3939
3959
  oAuthResourceMetadataEnabled?: boolean;
3940
3960
  }
@@ -5462,7 +5482,7 @@ export declare interface FirebaseJwtInboundPolicyOptions {
5462
5482
  */
5463
5483
  allowUnauthenticatedRequests?: boolean;
5464
5484
  /**
5465
- * Flag that determines whether OAuth protected resource metadata is enabled.
5485
+ * Enables OAuth 2.0 Protected Resource Metadata discovery (RFC 9728). When `true`, requests without a bearer token receive a 401 whose `WWW-Authenticate` header points `resource_metadata` at the `/.well-known/oauth-protected-resource` document for the request path and, when the `OAuthProtectedResourcePlugin` declares `scopesSupported`, lists those scopes in `scope`. Requires the `OAuthProtectedResourcePlugin` in `zuplo.runtime.ts` or a user-defined route at that path.
5466
5486
  */
5467
5487
  oAuthResourceMetadataEnabled?: boolean;
5468
5488
  }
@@ -10981,7 +11001,14 @@ declare type OAuthClientCredentialsLocation = "body" | "header";
10981
11001
  */
10982
11002
  export declare class OAuthProtectedResourcePlugin extends OAuthProtectedResourceBasePlugin {
10983
11003
  private options;
11004
+ private readonly scopes;
10984
11005
  constructor(options: OAuthProtectedResourcePluginOptions);
11006
+ /**
11007
+ * The scope values configured through `scopesSupported`, or `undefined` when
11008
+ * the option was not set. OAuth policies read this to populate the `scope`
11009
+ * parameter of their `WWW-Authenticate` challenge.
11010
+ */
11011
+ get scopesSupported(): readonly string[] | undefined;
10985
11012
  protected getMetadataOptions(
10986
11013
  _request: ZuploRequest,
10987
11014
  _context: ZuploContext
@@ -11005,6 +11032,29 @@ export declare interface OAuthProtectedResourcePluginOptions {
11005
11032
  * This field is recommended by RFC 9728.
11006
11033
  */
11007
11034
  resourceName?: string;
11035
+ /**
11036
+ * Scope values that clients should request when obtaining an access token for
11037
+ * this protected resource. Emitted as `scopes_supported` in the metadata
11038
+ * document (RFC 9728) and, when an OAuth policy on the route has
11039
+ * `oAuthResourceMetadataEnabled` set, as the `scope` parameter of the
11040
+ * `WWW-Authenticate` challenge on 401 responses. MCP clients use these values
11041
+ * to build their authorization request instead of asking for every scope the
11042
+ * authorization server advertises.
11043
+ *
11044
+ * Each entry must be a single OAuth scope token (RFC 6749 §3.3): printable
11045
+ * ASCII with no spaces, double quotes, or backslashes. The list must not be
11046
+ * empty; omit the option to advertise no scopes.
11047
+ *
11048
+ * @example
11049
+ * ```ts
11050
+ * new OAuthProtectedResourcePlugin({
11051
+ * authorizationServers: ["https://acme.okta.com/oauth2/aus1a2b3c"],
11052
+ * resourceName: "Acme MCP",
11053
+ * scopesSupported: ["mcp:access", "openid", "offline_access"],
11054
+ * });
11055
+ * ```
11056
+ */
11057
+ scopesSupported?: string[];
11008
11058
  }
11009
11059
 
11010
11060
  /**
@@ -11091,7 +11141,7 @@ export declare interface OktaJwtInboundPolicyOptions {
11091
11141
  */
11092
11142
  allowUnauthenticatedRequests?: boolean;
11093
11143
  /**
11094
- * Flag that determines whether OAuth protected resource metadata is enabled.
11144
+ * Enables OAuth 2.0 Protected Resource Metadata discovery (RFC 9728). When `true`, requests without a bearer token receive a 401 whose `WWW-Authenticate` header points `resource_metadata` at the `/.well-known/oauth-protected-resource` document for the request path and, when the `OAuthProtectedResourcePlugin` declares `scopesSupported`, lists those scopes in `scope`. Requires the `OAuthProtectedResourcePlugin` in `zuplo.runtime.ts` or a user-defined route at that path.
11095
11145
  */
11096
11146
  oAuthResourceMetadataEnabled?: boolean;
11097
11147
  }
@@ -11897,7 +11947,7 @@ export declare interface OpenIdJwtInboundPolicyOptions {
11897
11947
  [k: string]: string;
11898
11948
  };
11899
11949
  /**
11900
- * Flag that determines whether OAuth protected resource metadata is enabled.
11950
+ * Enables OAuth 2.0 Protected Resource Metadata discovery (RFC 9728). When `true`, requests without a bearer token receive a 401 whose `WWW-Authenticate` header points `resource_metadata` at the `/.well-known/oauth-protected-resource` document for the request path and, when the `OAuthProtectedResourcePlugin` declares `scopesSupported`, lists those scopes in `scope`. Requires the `OAuthProtectedResourcePlugin` in `zuplo.runtime.ts` or a user-defined route at that path.
11901
11951
  */
11902
11952
  oAuthResourceMetadataEnabled?: boolean;
11903
11953
  }
@@ -12482,7 +12532,7 @@ export declare interface PropelAuthJwtInboundPolicyOptions {
12482
12532
  */
12483
12533
  allowUnauthenticatedRequests?: boolean;
12484
12534
  /**
12485
- * Flag that determines whether OAuth protected resource metadata is enabled.
12535
+ * Enables OAuth 2.0 Protected Resource Metadata discovery (RFC 9728). When `true`, requests without a bearer token receive a 401 whose `WWW-Authenticate` header points `resource_metadata` at the `/.well-known/oauth-protected-resource` document for the request path and, when the `OAuthProtectedResourcePlugin` declares `scopesSupported`, lists those scopes in `scope`. Requires the `OAuthProtectedResourcePlugin` in `zuplo.runtime.ts` or a user-defined route at that path.
12486
12536
  */
12487
12537
  oAuthResourceMetadataEnabled?: boolean;
12488
12538
  }
@@ -14442,7 +14492,7 @@ export declare interface SupabaseJwtInboundPolicyOptions {
14442
14492
  */
14443
14493
  allowUnauthenticatedRequests?: boolean;
14444
14494
  /**
14445
- * Flag that determines whether OAuth protected resource metadata is enabled.
14495
+ * Enables OAuth 2.0 Protected Resource Metadata discovery (RFC 9728). When `true`, requests without a bearer token receive a 401 whose `WWW-Authenticate` header points `resource_metadata` at the `/.well-known/oauth-protected-resource` document for the request path and, when the `OAuthProtectedResourcePlugin` declares `scopesSupported`, lists those scopes in `scope`. Requires the `OAuthProtectedResourcePlugin` in `zuplo.runtime.ts` or a user-defined route at that path.
14446
14496
  */
14447
14497
  oAuthResourceMetadataEnabled?: boolean;
14448
14498
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.6.8",
4
+ "version": "7.6.9",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {