@runtypelabs/sdk 10.12.1 → 10.13.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
@@ -14445,7 +14445,7 @@ function transformQueryParams(params) {
14445
14445
  }
14446
14446
  //#endregion
14447
14447
  //#region src/version.ts
14448
- const SDK_VERSION = "10.12.1";
14448
+ const SDK_VERSION = "10.13.0";
14449
14449
  /**
14450
14450
  * Canonical client identity the API uses for attribution
14451
14451
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
package/dist/index.d.cts CHANGED
@@ -1125,6 +1125,8 @@ interface paths {
1125
1125
  };
1126
1126
  tools?: {
1127
1127
  approval?: {
1128
+ /** @enum {string} */
1129
+ approver?: "owner" | "end-user";
1128
1130
  choices?: {
1129
1131
  alwaysAllow?: boolean;
1130
1132
  alwaysDeny?: boolean;
@@ -1656,6 +1658,8 @@ interface paths {
1656
1658
  };
1657
1659
  tools?: {
1658
1660
  approval?: {
1661
+ /** @enum {string} */
1662
+ approver?: "owner" | "end-user";
1659
1663
  choices?: {
1660
1664
  alwaysAllow?: boolean;
1661
1665
  alwaysDeny?: boolean;
@@ -2460,6 +2464,8 @@ interface paths {
2460
2464
  };
2461
2465
  tools?: {
2462
2466
  approval?: {
2467
+ /** @enum {string} */
2468
+ approver?: "owner" | "end-user";
2463
2469
  choices?: {
2464
2470
  alwaysAllow?: boolean;
2465
2471
  alwaysDeny?: boolean;
@@ -8936,6 +8942,126 @@ interface paths {
8936
8942
  patch?: never;
8937
8943
  trace?: never;
8938
8944
  };
8945
+ "/v1/client/approve": {
8946
+ parameters: {
8947
+ query?: never;
8948
+ header?: never;
8949
+ path?: never;
8950
+ cookie?: never;
8951
+ };
8952
+ get?: never;
8953
+ put?: never;
8954
+ /**
8955
+ * Answer an end-user approval gate
8956
+ * @description Session-authenticated approval for browser client-token sessions. Answers a paused approval whose gate the agent authored with `tools.approval.approver: 'end-user'`, then streams the continued run over Server-Sent Events in the same shape as `/v1/client/resume`. The decision is bound to the session that started the turn, single-use, and bound to the exact reviewed tool parameters; visitors cannot create persistent "always allow" grants. A gate with the default `owner` approver is refused with `403 APPROVAL_APPROVER_NOT_END_USER`; answer those with `POST /v1/dispatch/approve`. Does not count against execution limits.
8957
+ */
8958
+ post: {
8959
+ parameters: {
8960
+ query?: never;
8961
+ header?: never;
8962
+ path?: never;
8963
+ cookie?: never;
8964
+ };
8965
+ requestBody: {
8966
+ content: {
8967
+ "application/json": {
8968
+ /** @description The `approvalId` from the `approval_start` event this decision answers. */
8969
+ approvalId: string;
8970
+ /** @description Id for the assistant message this resumed leg produces, so a re-send deduplicates by id. Optional; same contract as `/v1/client/resume`. */
8971
+ assistantMessageId?: string;
8972
+ /** @enum {string} */
8973
+ decision: "approved" | "denied";
8974
+ executionId: string;
8975
+ /** @description The visitor's own note on the decision, recorded with it. Optional. */
8976
+ reason?: string;
8977
+ sessionId: string;
8978
+ /** @default true */
8979
+ streamResponse?: boolean;
8980
+ };
8981
+ };
8982
+ };
8983
+ responses: {
8984
+ /** @description SSE stream of the continued execution, or a buffered JSON continuation result when streamResponse is false */
8985
+ 200: {
8986
+ headers: {
8987
+ [name: string]: unknown;
8988
+ };
8989
+ content: {
8990
+ "application/json": components["schemas"]["DispatchToolOutputContinuationJsonResponse"];
8991
+ "text/event-stream": unknown;
8992
+ };
8993
+ };
8994
+ /** @description Validation error, or the approvalId does not match the pending approval */
8995
+ 400: {
8996
+ headers: {
8997
+ [name: string]: unknown;
8998
+ };
8999
+ content: {
9000
+ "application/json": components["schemas"]["Error"];
9001
+ };
9002
+ };
9003
+ /** @description Session not found or expired */
9004
+ 401: {
9005
+ headers: {
9006
+ [name: string]: unknown;
9007
+ };
9008
+ content: {
9009
+ "application/json": components["schemas"]["Error"];
9010
+ };
9011
+ };
9012
+ /** @description Client token inactive, origin mismatch, execution belongs to another session, or the gate needs the owner (`APPROVAL_APPROVER_NOT_END_USER`) */
9013
+ 403: {
9014
+ headers: {
9015
+ [name: string]: unknown;
9016
+ };
9017
+ content: {
9018
+ "application/json": components["schemas"]["Error"];
9019
+ };
9020
+ };
9021
+ /** @description No paused execution found for the executionId, or the approval expired */
9022
+ 404: {
9023
+ headers: {
9024
+ [name: string]: unknown;
9025
+ };
9026
+ content: {
9027
+ "application/json": components["schemas"]["Error"];
9028
+ };
9029
+ };
9030
+ /** @description The approval was already resolved (`APPROVAL_ALREADY_RESOLVED`) */
9031
+ 409: {
9032
+ headers: {
9033
+ [name: string]: unknown;
9034
+ };
9035
+ content: {
9036
+ "application/json": components["schemas"]["Error"];
9037
+ };
9038
+ };
9039
+ /** @description Internal server error */
9040
+ 500: {
9041
+ headers: {
9042
+ [name: string]: unknown;
9043
+ };
9044
+ content: {
9045
+ "application/json": components["schemas"]["Error"];
9046
+ };
9047
+ };
9048
+ /** @description Neutral service-unavailable response when the owner platform-key spend limit blocks an end-user continuation */
9049
+ 503: {
9050
+ headers: {
9051
+ [name: string]: unknown;
9052
+ };
9053
+ content: {
9054
+ "application/json": components["schemas"]["Error"];
9055
+ };
9056
+ };
9057
+ };
9058
+ };
9059
+ delete?: never;
9060
+ options?: never;
9061
+ head?: never;
9062
+ patch?: never;
9063
+ trace?: never;
9064
+ };
8939
9065
  "/v1/client/chat": {
8940
9066
  parameters: {
8941
9067
  query?: never;
@@ -51784,6 +51910,8 @@ interface components {
51784
51910
  };
51785
51911
  tools?: {
51786
51912
  approval?: {
51913
+ /** @enum {string} */
51914
+ approver?: "owner" | "end-user";
51787
51915
  choices?: {
51788
51916
  alwaysAllow?: boolean;
51789
51917
  alwaysDeny?: boolean;
@@ -52561,6 +52689,8 @@ interface components {
52561
52689
  };
52562
52690
  tools?: {
52563
52691
  approval?: {
52692
+ /** @enum {string} */
52693
+ approver?: "owner" | "end-user";
52564
52694
  choices?: {
52565
52695
  alwaysAllow?: boolean;
52566
52696
  alwaysDeny?: boolean;
package/dist/index.d.ts CHANGED
@@ -1125,6 +1125,8 @@ interface paths {
1125
1125
  };
1126
1126
  tools?: {
1127
1127
  approval?: {
1128
+ /** @enum {string} */
1129
+ approver?: "owner" | "end-user";
1128
1130
  choices?: {
1129
1131
  alwaysAllow?: boolean;
1130
1132
  alwaysDeny?: boolean;
@@ -1656,6 +1658,8 @@ interface paths {
1656
1658
  };
1657
1659
  tools?: {
1658
1660
  approval?: {
1661
+ /** @enum {string} */
1662
+ approver?: "owner" | "end-user";
1659
1663
  choices?: {
1660
1664
  alwaysAllow?: boolean;
1661
1665
  alwaysDeny?: boolean;
@@ -2460,6 +2464,8 @@ interface paths {
2460
2464
  };
2461
2465
  tools?: {
2462
2466
  approval?: {
2467
+ /** @enum {string} */
2468
+ approver?: "owner" | "end-user";
2463
2469
  choices?: {
2464
2470
  alwaysAllow?: boolean;
2465
2471
  alwaysDeny?: boolean;
@@ -8936,6 +8942,126 @@ interface paths {
8936
8942
  patch?: never;
8937
8943
  trace?: never;
8938
8944
  };
8945
+ "/v1/client/approve": {
8946
+ parameters: {
8947
+ query?: never;
8948
+ header?: never;
8949
+ path?: never;
8950
+ cookie?: never;
8951
+ };
8952
+ get?: never;
8953
+ put?: never;
8954
+ /**
8955
+ * Answer an end-user approval gate
8956
+ * @description Session-authenticated approval for browser client-token sessions. Answers a paused approval whose gate the agent authored with `tools.approval.approver: 'end-user'`, then streams the continued run over Server-Sent Events in the same shape as `/v1/client/resume`. The decision is bound to the session that started the turn, single-use, and bound to the exact reviewed tool parameters; visitors cannot create persistent "always allow" grants. A gate with the default `owner` approver is refused with `403 APPROVAL_APPROVER_NOT_END_USER`; answer those with `POST /v1/dispatch/approve`. Does not count against execution limits.
8957
+ */
8958
+ post: {
8959
+ parameters: {
8960
+ query?: never;
8961
+ header?: never;
8962
+ path?: never;
8963
+ cookie?: never;
8964
+ };
8965
+ requestBody: {
8966
+ content: {
8967
+ "application/json": {
8968
+ /** @description The `approvalId` from the `approval_start` event this decision answers. */
8969
+ approvalId: string;
8970
+ /** @description Id for the assistant message this resumed leg produces, so a re-send deduplicates by id. Optional; same contract as `/v1/client/resume`. */
8971
+ assistantMessageId?: string;
8972
+ /** @enum {string} */
8973
+ decision: "approved" | "denied";
8974
+ executionId: string;
8975
+ /** @description The visitor's own note on the decision, recorded with it. Optional. */
8976
+ reason?: string;
8977
+ sessionId: string;
8978
+ /** @default true */
8979
+ streamResponse?: boolean;
8980
+ };
8981
+ };
8982
+ };
8983
+ responses: {
8984
+ /** @description SSE stream of the continued execution, or a buffered JSON continuation result when streamResponse is false */
8985
+ 200: {
8986
+ headers: {
8987
+ [name: string]: unknown;
8988
+ };
8989
+ content: {
8990
+ "application/json": components["schemas"]["DispatchToolOutputContinuationJsonResponse"];
8991
+ "text/event-stream": unknown;
8992
+ };
8993
+ };
8994
+ /** @description Validation error, or the approvalId does not match the pending approval */
8995
+ 400: {
8996
+ headers: {
8997
+ [name: string]: unknown;
8998
+ };
8999
+ content: {
9000
+ "application/json": components["schemas"]["Error"];
9001
+ };
9002
+ };
9003
+ /** @description Session not found or expired */
9004
+ 401: {
9005
+ headers: {
9006
+ [name: string]: unknown;
9007
+ };
9008
+ content: {
9009
+ "application/json": components["schemas"]["Error"];
9010
+ };
9011
+ };
9012
+ /** @description Client token inactive, origin mismatch, execution belongs to another session, or the gate needs the owner (`APPROVAL_APPROVER_NOT_END_USER`) */
9013
+ 403: {
9014
+ headers: {
9015
+ [name: string]: unknown;
9016
+ };
9017
+ content: {
9018
+ "application/json": components["schemas"]["Error"];
9019
+ };
9020
+ };
9021
+ /** @description No paused execution found for the executionId, or the approval expired */
9022
+ 404: {
9023
+ headers: {
9024
+ [name: string]: unknown;
9025
+ };
9026
+ content: {
9027
+ "application/json": components["schemas"]["Error"];
9028
+ };
9029
+ };
9030
+ /** @description The approval was already resolved (`APPROVAL_ALREADY_RESOLVED`) */
9031
+ 409: {
9032
+ headers: {
9033
+ [name: string]: unknown;
9034
+ };
9035
+ content: {
9036
+ "application/json": components["schemas"]["Error"];
9037
+ };
9038
+ };
9039
+ /** @description Internal server error */
9040
+ 500: {
9041
+ headers: {
9042
+ [name: string]: unknown;
9043
+ };
9044
+ content: {
9045
+ "application/json": components["schemas"]["Error"];
9046
+ };
9047
+ };
9048
+ /** @description Neutral service-unavailable response when the owner platform-key spend limit blocks an end-user continuation */
9049
+ 503: {
9050
+ headers: {
9051
+ [name: string]: unknown;
9052
+ };
9053
+ content: {
9054
+ "application/json": components["schemas"]["Error"];
9055
+ };
9056
+ };
9057
+ };
9058
+ };
9059
+ delete?: never;
9060
+ options?: never;
9061
+ head?: never;
9062
+ patch?: never;
9063
+ trace?: never;
9064
+ };
8939
9065
  "/v1/client/chat": {
8940
9066
  parameters: {
8941
9067
  query?: never;
@@ -51784,6 +51910,8 @@ interface components {
51784
51910
  };
51785
51911
  tools?: {
51786
51912
  approval?: {
51913
+ /** @enum {string} */
51914
+ approver?: "owner" | "end-user";
51787
51915
  choices?: {
51788
51916
  alwaysAllow?: boolean;
51789
51917
  alwaysDeny?: boolean;
@@ -52561,6 +52689,8 @@ interface components {
52561
52689
  };
52562
52690
  tools?: {
52563
52691
  approval?: {
52692
+ /** @enum {string} */
52693
+ approver?: "owner" | "end-user";
52564
52694
  choices?: {
52565
52695
  alwaysAllow?: boolean;
52566
52696
  alwaysDeny?: boolean;
package/dist/index.mjs CHANGED
@@ -14444,7 +14444,7 @@ function transformQueryParams(params) {
14444
14444
  }
14445
14445
  //#endregion
14446
14446
  //#region src/version.ts
14447
- const SDK_VERSION = "10.12.1";
14447
+ const SDK_VERSION = "10.13.0";
14448
14448
  /**
14449
14449
  * Canonical client identity the API uses for attribution
14450
14450
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "10.12.1",
3
+ "version": "10.13.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for the Runtype API with fluent methods. Use it to quickly realize AI products, agents, and workflows.",
6
6
  "main": "dist/index.cjs",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "dependencies": {},
26
26
  "devDependencies": {
27
- "@runtypelabs/shared": "3.73.0",
27
+ "@runtypelabs/shared": "3.74.0",
28
28
  "openapi-typescript": "^7.13.0",
29
29
  "tsdown": "^0.23.0",
30
30
  "typescript": "^6.0.3",