@naturali/sdk 0.223.0 → 0.225.0

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.cjs CHANGED
@@ -3770,7 +3770,7 @@ var McpServers = class {
3770
3770
  * Create an MCP server
3771
3771
  *
3772
3772
  * Each item of `tools` is checked against the tool it names: the project's own or an installed one, else `400`. `action` is required, and must be one of the tool's available actions, when the tool declares `actions`; otherwise it is ignored and stored as `null`. A tool whose definition reads `{{context:naturali_caller_…}}` is refused unless `auth.type` is `oauth`.
3773
- * `daily_call_limit` is required when `auth` is `none` or `oauth` with `mode: any_account`.
3773
+ * `daily_call_limit` is required when `auth` is `none`.
3774
3774
  *
3775
3775
  */
3776
3776
  static createMcpServer(options) {
package/dist/index.d.cts CHANGED
@@ -6447,14 +6447,32 @@ type McpServerToolEntry = {
6447
6447
  description: string | null;
6448
6448
  };
6449
6449
  /**
6450
- * Who may connect. `oauth` with `mode` `members` (project members), `allowlist` (the listed emails) or `any_account` (any naturali account); `header` (holders of a key from [`POST /v1/projects/{project_id}/mcp-servers/{mcp_server_id}/keys`](/docs/api/mcp-servers/create-mcp-server-key), sent in `header_name`, default `Authorization`); `none` (anyone).
6450
+ * Who may connect. `oauth` without `issuer` signs callers in by naturali login, with `mode` `members` (project members) or `allowlist` (the listed emails, verified); `oauth` with `issuer` accepts tokens of the tenant's authorization server; `header` (holders of a key from [`POST /v1/projects/{project_id}/mcp-servers/{mcp_server_id}/keys`](/docs/api/mcp-servers/create-mcp-server-key), sent in `header_name`, default `Authorization`); `none` (anyone).
6451
6451
  */
6452
6452
  type McpServerAuthWrite = {
6453
6453
  type: 'oauth' | 'header' | 'none';
6454
6454
  /**
6455
- * `oauth` only, required.
6455
+ * `oauth` without `issuer` only, required.
6456
6456
  */
6457
- mode?: 'members' | 'allowlist' | 'any_account';
6457
+ mode?: 'members' | 'allowlist';
6458
+ /**
6459
+ * The tenant's authorization server (an `https` issuer identifier). A token is accepted when its signature verifies against `jwks_uri` and its `iss` is this value, `exp` is in the future, `aud` names the server's `url`, and its `scope` holds every one of `scopes`.
6460
+ */
6461
+ issuer?: string;
6462
+ /**
6463
+ * Required with `issuer`; an `https` URL. Keys signing `RS256`, `ES256` or `EdDSA`.
6464
+ */
6465
+ jwks_uri?: string;
6466
+ /**
6467
+ * With `issuer`. Scopes every token must carry; default none.
6468
+ */
6469
+ scopes?: Array<string>;
6470
+ /**
6471
+ * With `issuer`. Each key, a `tool_context` key as in `context`, takes the string value of the token claim it names; a claim absent or not a string sets nothing.
6472
+ */
6473
+ context_claims?: {
6474
+ [key: string]: string;
6475
+ };
6458
6476
  /**
6459
6477
  * `mode: allowlist` only, required and non-empty.
6460
6478
  */
@@ -6469,7 +6487,13 @@ type McpServerAuthWrite = {
6469
6487
  };
6470
6488
  type McpServerAuth = {
6471
6489
  type: 'oauth' | 'header' | 'none';
6472
- mode?: 'members' | 'allowlist' | 'any_account';
6490
+ mode?: 'members' | 'allowlist';
6491
+ issuer?: string;
6492
+ jwks_uri?: string;
6493
+ scopes?: Array<string>;
6494
+ context_claims?: {
6495
+ [key: string]: string;
6496
+ };
6473
6497
  allowlist?: Array<{
6474
6498
  email: string;
6475
6499
  context_keys: McpContextKeys;
@@ -6483,7 +6507,7 @@ type McpServer = {
6483
6507
  id: string;
6484
6508
  project_id: string;
6485
6509
  /**
6486
- * Where MCP clients connect (Streamable HTTP). Served for `header` and `none` auth; an `oauth` server answers `401`.
6510
+ * Where MCP clients connect (Streamable HTTP). An `oauth` server answers `401` without a token, naming its OAuth protected resource metadata (RFC 9728) at `/.well-known/oauth-protected-resource/servers/{id}` on the same host, which names the issuer to sign in at.
6487
6511
  */
6488
6512
  url: string;
6489
6513
  /**
@@ -6534,7 +6558,7 @@ type McpServerCreate = {
6534
6558
  context?: McpContext;
6535
6559
  auth: McpServerAuthWrite;
6536
6560
  /**
6537
- * Tool calls per UTC day, over every caller; past it a call is `429 mcp_daily_limit_reached`. Required for `none` and `any_account`.
6561
+ * Tool calls per UTC day, over every caller; past it a call is `429 mcp_daily_limit_reached`. Required for `none`.
6538
6562
  */
6539
6563
  daily_call_limit?: number | null;
6540
6564
  };
@@ -6581,11 +6605,11 @@ type McpServerUsage = {
6581
6605
  day: Date;
6582
6606
  caller: {
6583
6607
  /**
6584
- * `key` on a `header` server, `anonymous` on a `none` one.
6608
+ * `key` on a `header` server, `account` on an `oauth` server by naturali login, `subject` on one with `auth.issuer`, `anonymous` on a `none` one.
6585
6609
  */
6586
- type: 'key' | 'anonymous';
6610
+ type: 'key' | 'account' | 'subject' | 'anonymous';
6587
6611
  /**
6588
- * The key's ID (mcpk_ prefix); `null` for `anonymous`.
6612
+ * The key's ID (mcpk_ prefix), the naturali account's, or the token's `sub`; `null` for `anonymous`.
6589
6613
  */
6590
6614
  id: string | null;
6591
6615
  };
@@ -34852,7 +34876,7 @@ export declare class McpServers {
34852
34876
  * Create an MCP server
34853
34877
  *
34854
34878
  * Each item of `tools` is checked against the tool it names: the project's own or an installed one, else `400`. `action` is required, and must be one of the tool's available actions, when the tool declares `actions`; otherwise it is ignored and stored as `null`. A tool whose definition reads `{{context:naturali_caller_…}}` is refused unless `auth.type` is `oauth`.
34855
- * `daily_call_limit` is required when `auth` is `none` or `oauth` with `mode: any_account`.
34879
+ * `daily_call_limit` is required when `auth` is `none`.
34856
34880
  *
34857
34881
  */
34858
34882
  static createMcpServer<ThrowOnError extends boolean = false>(options: Options<CreateMcpServerData, ThrowOnError>): RequestResult<CreateMcpServerResponses, CreateMcpServerErrors, ThrowOnError>;
package/dist/index.d.mts CHANGED
@@ -6447,14 +6447,32 @@ type McpServerToolEntry = {
6447
6447
  description: string | null;
6448
6448
  };
6449
6449
  /**
6450
- * Who may connect. `oauth` with `mode` `members` (project members), `allowlist` (the listed emails) or `any_account` (any naturali account); `header` (holders of a key from [`POST /v1/projects/{project_id}/mcp-servers/{mcp_server_id}/keys`](/docs/api/mcp-servers/create-mcp-server-key), sent in `header_name`, default `Authorization`); `none` (anyone).
6450
+ * Who may connect. `oauth` without `issuer` signs callers in by naturali login, with `mode` `members` (project members) or `allowlist` (the listed emails, verified); `oauth` with `issuer` accepts tokens of the tenant's authorization server; `header` (holders of a key from [`POST /v1/projects/{project_id}/mcp-servers/{mcp_server_id}/keys`](/docs/api/mcp-servers/create-mcp-server-key), sent in `header_name`, default `Authorization`); `none` (anyone).
6451
6451
  */
6452
6452
  type McpServerAuthWrite = {
6453
6453
  type: 'oauth' | 'header' | 'none';
6454
6454
  /**
6455
- * `oauth` only, required.
6455
+ * `oauth` without `issuer` only, required.
6456
6456
  */
6457
- mode?: 'members' | 'allowlist' | 'any_account';
6457
+ mode?: 'members' | 'allowlist';
6458
+ /**
6459
+ * The tenant's authorization server (an `https` issuer identifier). A token is accepted when its signature verifies against `jwks_uri` and its `iss` is this value, `exp` is in the future, `aud` names the server's `url`, and its `scope` holds every one of `scopes`.
6460
+ */
6461
+ issuer?: string;
6462
+ /**
6463
+ * Required with `issuer`; an `https` URL. Keys signing `RS256`, `ES256` or `EdDSA`.
6464
+ */
6465
+ jwks_uri?: string;
6466
+ /**
6467
+ * With `issuer`. Scopes every token must carry; default none.
6468
+ */
6469
+ scopes?: Array<string>;
6470
+ /**
6471
+ * With `issuer`. Each key, a `tool_context` key as in `context`, takes the string value of the token claim it names; a claim absent or not a string sets nothing.
6472
+ */
6473
+ context_claims?: {
6474
+ [key: string]: string;
6475
+ };
6458
6476
  /**
6459
6477
  * `mode: allowlist` only, required and non-empty.
6460
6478
  */
@@ -6469,7 +6487,13 @@ type McpServerAuthWrite = {
6469
6487
  };
6470
6488
  type McpServerAuth = {
6471
6489
  type: 'oauth' | 'header' | 'none';
6472
- mode?: 'members' | 'allowlist' | 'any_account';
6490
+ mode?: 'members' | 'allowlist';
6491
+ issuer?: string;
6492
+ jwks_uri?: string;
6493
+ scopes?: Array<string>;
6494
+ context_claims?: {
6495
+ [key: string]: string;
6496
+ };
6473
6497
  allowlist?: Array<{
6474
6498
  email: string;
6475
6499
  context_keys: McpContextKeys;
@@ -6483,7 +6507,7 @@ type McpServer = {
6483
6507
  id: string;
6484
6508
  project_id: string;
6485
6509
  /**
6486
- * Where MCP clients connect (Streamable HTTP). Served for `header` and `none` auth; an `oauth` server answers `401`.
6510
+ * Where MCP clients connect (Streamable HTTP). An `oauth` server answers `401` without a token, naming its OAuth protected resource metadata (RFC 9728) at `/.well-known/oauth-protected-resource/servers/{id}` on the same host, which names the issuer to sign in at.
6487
6511
  */
6488
6512
  url: string;
6489
6513
  /**
@@ -6534,7 +6558,7 @@ type McpServerCreate = {
6534
6558
  context?: McpContext;
6535
6559
  auth: McpServerAuthWrite;
6536
6560
  /**
6537
- * Tool calls per UTC day, over every caller; past it a call is `429 mcp_daily_limit_reached`. Required for `none` and `any_account`.
6561
+ * Tool calls per UTC day, over every caller; past it a call is `429 mcp_daily_limit_reached`. Required for `none`.
6538
6562
  */
6539
6563
  daily_call_limit?: number | null;
6540
6564
  };
@@ -6581,11 +6605,11 @@ type McpServerUsage = {
6581
6605
  day: Date;
6582
6606
  caller: {
6583
6607
  /**
6584
- * `key` on a `header` server, `anonymous` on a `none` one.
6608
+ * `key` on a `header` server, `account` on an `oauth` server by naturali login, `subject` on one with `auth.issuer`, `anonymous` on a `none` one.
6585
6609
  */
6586
- type: 'key' | 'anonymous';
6610
+ type: 'key' | 'account' | 'subject' | 'anonymous';
6587
6611
  /**
6588
- * The key's ID (mcpk_ prefix); `null` for `anonymous`.
6612
+ * The key's ID (mcpk_ prefix), the naturali account's, or the token's `sub`; `null` for `anonymous`.
6589
6613
  */
6590
6614
  id: string | null;
6591
6615
  };
@@ -34852,7 +34876,7 @@ export declare class McpServers {
34852
34876
  * Create an MCP server
34853
34877
  *
34854
34878
  * Each item of `tools` is checked against the tool it names: the project's own or an installed one, else `400`. `action` is required, and must be one of the tool's available actions, when the tool declares `actions`; otherwise it is ignored and stored as `null`. A tool whose definition reads `{{context:naturali_caller_…}}` is refused unless `auth.type` is `oauth`.
34855
- * `daily_call_limit` is required when `auth` is `none` or `oauth` with `mode: any_account`.
34879
+ * `daily_call_limit` is required when `auth` is `none`.
34856
34880
  *
34857
34881
  */
34858
34882
  static createMcpServer<ThrowOnError extends boolean = false>(options: Options<CreateMcpServerData, ThrowOnError>): RequestResult<CreateMcpServerResponses, CreateMcpServerErrors, ThrowOnError>;
package/dist/index.mjs CHANGED
@@ -3769,7 +3769,7 @@ var McpServers = class {
3769
3769
  * Create an MCP server
3770
3770
  *
3771
3771
  * Each item of `tools` is checked against the tool it names: the project's own or an installed one, else `400`. `action` is required, and must be one of the tool's available actions, when the tool declares `actions`; otherwise it is ignored and stored as `null`. A tool whose definition reads `{{context:naturali_caller_…}}` is refused unless `auth.type` is `oauth`.
3772
- * `daily_call_limit` is required when `auth` is `none` or `oauth` with `mode: any_account`.
3772
+ * `daily_call_limit` is required when `auth` is `none`.
3773
3773
  *
3774
3774
  */
3775
3775
  static createMcpServer(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.223.0",
3
+ "version": "0.225.0",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "keywords": [
6
6
  "naturali",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@hey-api/openapi-ts": "^0.99.0",
41
- "@naturali/api": "0.223.0",
41
+ "@naturali/api": "0.225.0",
42
42
  "@ttoss/openapi-codegen": "^0.10.0",
43
43
  "@types/node": "^26.5.1",
44
44
  "tsdown": "^0.23.0",