@meetkai/mka1 0.55.2 → 0.55.3

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.
Files changed (164) hide show
  1. package/README.md +360 -360
  2. package/bin/mcp-server.js +571 -145
  3. package/bin/mcp-server.js.map +16 -8
  4. package/dist/commonjs/funcs/sessionsGetTenantResourcePolicy.d.ts +18 -0
  5. package/dist/commonjs/funcs/sessionsGetTenantResourcePolicy.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/sessionsGetTenantResourcePolicy.js +140 -0
  7. package/dist/commonjs/funcs/sessionsGetTenantResourcePolicy.js.map +1 -0
  8. package/dist/commonjs/funcs/sessionsSetTenantResourcePolicy.d.ts +18 -0
  9. package/dist/commonjs/funcs/sessionsSetTenantResourcePolicy.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/sessionsSetTenantResourcePolicy.js +143 -0
  11. package/dist/commonjs/funcs/sessionsSetTenantResourcePolicy.js.map +1 -0
  12. package/dist/commonjs/lib/config.d.ts +2 -2
  13. package/dist/commonjs/lib/config.js +2 -2
  14. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  15. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  16. package/dist/commonjs/mcp-server/server.js +5 -1
  17. package/dist/commonjs/mcp-server/server.js.map +1 -1
  18. package/dist/commonjs/mcp-server/tools/sessionsGetTenantResourcePolicy.d.ts +8 -0
  19. package/dist/commonjs/mcp-server/tools/sessionsGetTenantResourcePolicy.d.ts.map +1 -0
  20. package/dist/commonjs/mcp-server/tools/sessionsGetTenantResourcePolicy.js +62 -0
  21. package/dist/commonjs/mcp-server/tools/sessionsGetTenantResourcePolicy.js.map +1 -0
  22. package/dist/commonjs/mcp-server/tools/sessionsSetTenantResourcePolicy.d.ts +8 -0
  23. package/dist/commonjs/mcp-server/tools/sessionsSetTenantResourcePolicy.d.ts.map +1 -0
  24. package/dist/commonjs/mcp-server/tools/sessionsSetTenantResourcePolicy.js +62 -0
  25. package/dist/commonjs/mcp-server/tools/sessionsSetTenantResourcePolicy.js.map +1 -0
  26. package/dist/commonjs/models/components/index.d.ts +2 -0
  27. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/index.js +2 -0
  29. package/dist/commonjs/models/components/index.js.map +1 -1
  30. package/dist/commonjs/models/components/savetenantresourcepolicy.d.ts +43 -0
  31. package/dist/commonjs/models/components/savetenantresourcepolicy.d.ts.map +1 -0
  32. package/dist/commonjs/models/components/savetenantresourcepolicy.js +100 -0
  33. package/dist/commonjs/models/components/savetenantresourcepolicy.js.map +1 -0
  34. package/dist/commonjs/models/components/tenantresourcepolicy.d.ts +43 -0
  35. package/dist/commonjs/models/components/tenantresourcepolicy.d.ts.map +1 -0
  36. package/dist/commonjs/models/components/tenantresourcepolicy.js +96 -0
  37. package/dist/commonjs/models/components/tenantresourcepolicy.js.map +1 -0
  38. package/dist/commonjs/models/operations/gettenantresourcepolicy.d.ts +36 -0
  39. package/dist/commonjs/models/operations/gettenantresourcepolicy.d.ts.map +1 -0
  40. package/dist/commonjs/models/operations/gettenantresourcepolicy.js +85 -0
  41. package/dist/commonjs/models/operations/gettenantresourcepolicy.js.map +1 -0
  42. package/dist/commonjs/models/operations/index.d.ts +2 -0
  43. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/index.js +2 -0
  45. package/dist/commonjs/models/operations/index.js.map +1 -1
  46. package/dist/commonjs/models/operations/settenantresourcepolicy.d.ts +39 -0
  47. package/dist/commonjs/models/operations/settenantresourcepolicy.d.ts.map +1 -0
  48. package/dist/commonjs/models/operations/settenantresourcepolicy.js +90 -0
  49. package/dist/commonjs/models/operations/settenantresourcepolicy.js.map +1 -0
  50. package/dist/commonjs/react-query/index.d.ts +2 -0
  51. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  52. package/dist/commonjs/react-query/index.js +2 -0
  53. package/dist/commonjs/react-query/index.js.map +1 -1
  54. package/dist/commonjs/react-query/sessionsGetTenantResourcePolicy.core.d.ts +17 -0
  55. package/dist/commonjs/react-query/sessionsGetTenantResourcePolicy.core.d.ts.map +1 -0
  56. package/dist/commonjs/react-query/sessionsGetTenantResourcePolicy.core.js +44 -0
  57. package/dist/commonjs/react-query/sessionsGetTenantResourcePolicy.core.js.map +1 -0
  58. package/dist/commonjs/react-query/sessionsGetTenantResourcePolicy.d.ts +37 -0
  59. package/dist/commonjs/react-query/sessionsGetTenantResourcePolicy.d.ts.map +1 -0
  60. package/dist/commonjs/react-query/sessionsGetTenantResourcePolicy.js +59 -0
  61. package/dist/commonjs/react-query/sessionsGetTenantResourcePolicy.js.map +1 -0
  62. package/dist/commonjs/react-query/sessionsSetTenantResourcePolicy.d.ts +27 -0
  63. package/dist/commonjs/react-query/sessionsSetTenantResourcePolicy.d.ts.map +1 -0
  64. package/dist/commonjs/react-query/sessionsSetTenantResourcePolicy.js +44 -0
  65. package/dist/commonjs/react-query/sessionsSetTenantResourcePolicy.js.map +1 -0
  66. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  67. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  68. package/dist/commonjs/sdk/sdk.js +4 -0
  69. package/dist/commonjs/sdk/sdk.js.map +1 -1
  70. package/dist/commonjs/sdk/sessions.d.ts +14 -0
  71. package/dist/commonjs/sdk/sessions.d.ts.map +1 -0
  72. package/dist/commonjs/sdk/sessions.js +26 -0
  73. package/dist/commonjs/sdk/sessions.js.map +1 -0
  74. package/dist/esm/funcs/sessionsGetTenantResourcePolicy.d.ts +18 -0
  75. package/dist/esm/funcs/sessionsGetTenantResourcePolicy.d.ts.map +1 -0
  76. package/dist/esm/funcs/sessionsGetTenantResourcePolicy.js +104 -0
  77. package/dist/esm/funcs/sessionsGetTenantResourcePolicy.js.map +1 -0
  78. package/dist/esm/funcs/sessionsSetTenantResourcePolicy.d.ts +18 -0
  79. package/dist/esm/funcs/sessionsSetTenantResourcePolicy.d.ts.map +1 -0
  80. package/dist/esm/funcs/sessionsSetTenantResourcePolicy.js +107 -0
  81. package/dist/esm/funcs/sessionsSetTenantResourcePolicy.js.map +1 -0
  82. package/dist/esm/lib/config.d.ts +2 -2
  83. package/dist/esm/lib/config.js +2 -2
  84. package/dist/esm/mcp-server/mcp-server.js +1 -1
  85. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  86. package/dist/esm/mcp-server/server.js +5 -1
  87. package/dist/esm/mcp-server/server.js.map +1 -1
  88. package/dist/esm/mcp-server/tools/sessionsGetTenantResourcePolicy.d.ts +8 -0
  89. package/dist/esm/mcp-server/tools/sessionsGetTenantResourcePolicy.d.ts.map +1 -0
  90. package/dist/esm/mcp-server/tools/sessionsGetTenantResourcePolicy.js +26 -0
  91. package/dist/esm/mcp-server/tools/sessionsGetTenantResourcePolicy.js.map +1 -0
  92. package/dist/esm/mcp-server/tools/sessionsSetTenantResourcePolicy.d.ts +8 -0
  93. package/dist/esm/mcp-server/tools/sessionsSetTenantResourcePolicy.d.ts.map +1 -0
  94. package/dist/esm/mcp-server/tools/sessionsSetTenantResourcePolicy.js +26 -0
  95. package/dist/esm/mcp-server/tools/sessionsSetTenantResourcePolicy.js.map +1 -0
  96. package/dist/esm/models/components/index.d.ts +2 -0
  97. package/dist/esm/models/components/index.d.ts.map +1 -1
  98. package/dist/esm/models/components/index.js +2 -0
  99. package/dist/esm/models/components/index.js.map +1 -1
  100. package/dist/esm/models/components/savetenantresourcepolicy.d.ts +43 -0
  101. package/dist/esm/models/components/savetenantresourcepolicy.d.ts.map +1 -0
  102. package/dist/esm/models/components/savetenantresourcepolicy.js +62 -0
  103. package/dist/esm/models/components/savetenantresourcepolicy.js.map +1 -0
  104. package/dist/esm/models/components/tenantresourcepolicy.d.ts +43 -0
  105. package/dist/esm/models/components/tenantresourcepolicy.d.ts.map +1 -0
  106. package/dist/esm/models/components/tenantresourcepolicy.js +58 -0
  107. package/dist/esm/models/components/tenantresourcepolicy.js.map +1 -0
  108. package/dist/esm/models/operations/gettenantresourcepolicy.d.ts +36 -0
  109. package/dist/esm/models/operations/gettenantresourcepolicy.d.ts.map +1 -0
  110. package/dist/esm/models/operations/gettenantresourcepolicy.js +47 -0
  111. package/dist/esm/models/operations/gettenantresourcepolicy.js.map +1 -0
  112. package/dist/esm/models/operations/index.d.ts +2 -0
  113. package/dist/esm/models/operations/index.d.ts.map +1 -1
  114. package/dist/esm/models/operations/index.js +2 -0
  115. package/dist/esm/models/operations/index.js.map +1 -1
  116. package/dist/esm/models/operations/settenantresourcepolicy.d.ts +39 -0
  117. package/dist/esm/models/operations/settenantresourcepolicy.d.ts.map +1 -0
  118. package/dist/esm/models/operations/settenantresourcepolicy.js +52 -0
  119. package/dist/esm/models/operations/settenantresourcepolicy.js.map +1 -0
  120. package/dist/esm/react-query/index.d.ts +2 -0
  121. package/dist/esm/react-query/index.d.ts.map +1 -1
  122. package/dist/esm/react-query/index.js +2 -0
  123. package/dist/esm/react-query/index.js.map +1 -1
  124. package/dist/esm/react-query/sessionsGetTenantResourcePolicy.core.d.ts +17 -0
  125. package/dist/esm/react-query/sessionsGetTenantResourcePolicy.core.d.ts.map +1 -0
  126. package/dist/esm/react-query/sessionsGetTenantResourcePolicy.core.js +39 -0
  127. package/dist/esm/react-query/sessionsGetTenantResourcePolicy.core.js.map +1 -0
  128. package/dist/esm/react-query/sessionsGetTenantResourcePolicy.d.ts +37 -0
  129. package/dist/esm/react-query/sessionsGetTenantResourcePolicy.d.ts.map +1 -0
  130. package/dist/esm/react-query/sessionsGetTenantResourcePolicy.js +49 -0
  131. package/dist/esm/react-query/sessionsGetTenantResourcePolicy.js.map +1 -0
  132. package/dist/esm/react-query/sessionsSetTenantResourcePolicy.d.ts +27 -0
  133. package/dist/esm/react-query/sessionsSetTenantResourcePolicy.d.ts.map +1 -0
  134. package/dist/esm/react-query/sessionsSetTenantResourcePolicy.js +39 -0
  135. package/dist/esm/react-query/sessionsSetTenantResourcePolicy.js.map +1 -0
  136. package/dist/esm/sdk/sdk.d.ts +3 -0
  137. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  138. package/dist/esm/sdk/sdk.js +4 -0
  139. package/dist/esm/sdk/sdk.js.map +1 -1
  140. package/dist/esm/sdk/sessions.d.ts +14 -0
  141. package/dist/esm/sdk/sessions.d.ts.map +1 -0
  142. package/dist/esm/sdk/sessions.js +22 -0
  143. package/dist/esm/sdk/sessions.js.map +1 -0
  144. package/jsr.json +1 -1
  145. package/package.json +1 -1
  146. package/src/funcs/sessionsGetTenantResourcePolicy.ts +200 -0
  147. package/src/funcs/sessionsSetTenantResourcePolicy.ts +203 -0
  148. package/src/lib/config.ts +2 -2
  149. package/src/mcp-server/mcp-server.ts +1 -1
  150. package/src/mcp-server/server.ts +5 -1
  151. package/src/mcp-server/tools/sessionsGetTenantResourcePolicy.ts +36 -0
  152. package/src/mcp-server/tools/sessionsSetTenantResourcePolicy.ts +36 -0
  153. package/src/models/components/index.ts +2 -0
  154. package/src/models/components/savetenantresourcepolicy.ts +118 -0
  155. package/src/models/components/tenantresourcepolicy.ts +104 -0
  156. package/src/models/operations/gettenantresourcepolicy.ts +100 -0
  157. package/src/models/operations/index.ts +2 -0
  158. package/src/models/operations/settenantresourcepolicy.ts +107 -0
  159. package/src/react-query/index.ts +2 -0
  160. package/src/react-query/sessionsGetTenantResourcePolicy.core.ts +89 -0
  161. package/src/react-query/sessionsGetTenantResourcePolicy.ts +156 -0
  162. package/src/react-query/sessionsSetTenantResourcePolicy.ts +109 -0
  163. package/src/sdk/sdk.ts +6 -0
  164. package/src/sdk/sessions.ts +40 -0
@@ -0,0 +1,203 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SDKCore } from "../core.js";
6
+ import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKError } from "../models/errors/sdkerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Save
32
+ *
33
+ * If set, this operation will use {@link Security.bearerAuth} from the global security.
34
+ */
35
+ export function sessionsSetTenantResourcePolicy(
36
+ client: SDKCore,
37
+ request: operations.SetTenantResourcePolicyRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.TenantResourcePolicy,
42
+ | errors.HTTPValidationError
43
+ | SDKError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: SDKCore,
62
+ request: operations.SetTenantResourcePolicyRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ components.TenantResourcePolicy,
68
+ | errors.HTTPValidationError
69
+ | SDKError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const parsed = safeParse(
82
+ request,
83
+ (value) =>
84
+ operations.SetTenantResourcePolicyRequest$outboundSchema.parse(value),
85
+ "Input validation failed",
86
+ );
87
+ if (!parsed.ok) {
88
+ return [parsed, { status: "invalid" }];
89
+ }
90
+ const payload = parsed.value;
91
+ const body = encodeJSON("body", payload.SaveTenantResourcePolicy, {
92
+ explode: true,
93
+ });
94
+
95
+ const pathParams = {
96
+ scope: encodeSimple("scope", payload.scope, {
97
+ explode: false,
98
+ charEncoding: "percent",
99
+ }),
100
+ };
101
+ const path = pathToFunc("/api/v1/sandbox/resource-policy/{scope}")(
102
+ pathParams,
103
+ );
104
+
105
+ const query = encodeFormQuery({
106
+ "expected_organization_id": payload.expected_organization_id,
107
+ "expected_team_id": payload.expected_team_id,
108
+ });
109
+
110
+ const headers = new Headers(compactMap({
111
+ "Content-Type": "application/json",
112
+ Accept: "application/json",
113
+ "X-On-Behalf-Of": encodeSimple(
114
+ "X-On-Behalf-Of",
115
+ payload["X-On-Behalf-Of"],
116
+ { explode: false, charEncoding: "none" },
117
+ ),
118
+ }));
119
+
120
+ const secConfig = await extractSecurity(client._options.bearerAuth);
121
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
122
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
123
+
124
+ const context = {
125
+ options: client._options,
126
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
127
+ operationID: "setTenantResourcePolicy",
128
+ oAuth2Scopes: null,
129
+
130
+ resolvedSecurity: requestSecurity,
131
+
132
+ securitySource: client._options.bearerAuth,
133
+ retryConfig: options?.retries
134
+ || client._options.retryConfig
135
+ || {
136
+ strategy: "backoff",
137
+ backoff: {
138
+ initialInterval: 500,
139
+ maxInterval: 5000,
140
+ exponent: 1.5,
141
+ maxElapsedTime: 15000,
142
+ },
143
+ retryConnectionErrors: true,
144
+ }
145
+ || { strategy: "none" },
146
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
147
+ };
148
+
149
+ const requestRes = client._createRequest(context, {
150
+ security: requestSecurity,
151
+ method: "PUT",
152
+ baseURL: options?.serverURL,
153
+ path: path,
154
+ headers: headers,
155
+ query: query,
156
+ body: body,
157
+ userAgent: client._options.userAgent,
158
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
159
+ }, options);
160
+ if (!requestRes.ok) {
161
+ return [requestRes, { status: "invalid" }];
162
+ }
163
+ const req = requestRes.value;
164
+
165
+ const doResult = await client._do(req, {
166
+ context,
167
+ isErrorStatusCode: (statusCode: number) =>
168
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
169
+ retryConfig: context.retryConfig,
170
+ retryCodes: context.retryCodes,
171
+ });
172
+ if (!doResult.ok) {
173
+ return [doResult, { status: "request-error", request: req }];
174
+ }
175
+ const response = doResult.value;
176
+
177
+ const responseFields = {
178
+ HttpMeta: { Response: response, Request: req },
179
+ };
180
+
181
+ const [result] = await M.match<
182
+ components.TenantResourcePolicy,
183
+ | errors.HTTPValidationError
184
+ | SDKError
185
+ | ResponseValidationError
186
+ | ConnectionError
187
+ | RequestAbortedError
188
+ | RequestTimeoutError
189
+ | InvalidRequestError
190
+ | UnexpectedClientError
191
+ | SDKValidationError
192
+ >(
193
+ M.json(200, components.TenantResourcePolicy$inboundSchema),
194
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
195
+ M.fail("4XX"),
196
+ M.fail("5XX"),
197
+ )(response, req, { extraFields: responseFields });
198
+ if (!result.ok) {
199
+ return [result, { status: "complete", request: req, response }];
200
+ }
201
+
202
+ return [result, { status: "complete", request: req, response }];
203
+ }
package/src/lib/config.ts CHANGED
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "1.1.0",
68
- sdkVersion: "0.55.2",
68
+ sdkVersion: "0.55.3",
69
69
  genVersion: "2.950.2",
70
- userAgent: "speakeasy-sdk/typescript 0.55.2 2.950.2 1.1.0 @meetkai/mka1",
70
+ userAgent: "speakeasy-sdk/typescript 0.55.3 2.950.2 1.1.0 @meetkai/mka1",
71
71
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.55.2",
22
+ currentVersion: "0.55.3",
23
23
  },
24
24
  });
25
25
 
@@ -470,6 +470,8 @@ import { tool$sandboxSetPricing } from "./tools/sandboxSetPricing.js";
470
470
  import { tool$sandboxTerminate } from "./tools/sandboxTerminate.js";
471
471
  import { tool$sandboxUploadArchive } from "./tools/sandboxUploadArchive.js";
472
472
  import { tool$sandboxUploadFile } from "./tools/sandboxUploadFile.js";
473
+ import { tool$sessionsGetTenantResourcePolicy } from "./tools/sessionsGetTenantResourcePolicy.js";
474
+ import { tool$sessionsSetTenantResourcePolicy } from "./tools/sessionsSetTenantResourcePolicy.js";
473
475
  import { tool$trackingExperimentsCreate } from "./tools/trackingExperimentsCreate.js";
474
476
  import { tool$trackingExperimentsDelete } from "./tools/trackingExperimentsDelete.js";
475
477
  import { tool$trackingExperimentsGet } from "./tools/trackingExperimentsGet.js";
@@ -501,7 +503,7 @@ export function createMCPServer(deps: {
501
503
  }) {
502
504
  const server = new McpServer({
503
505
  name: "SDK",
504
- version: "0.55.2",
506
+ version: "0.55.3",
505
507
  });
506
508
 
507
509
  const client = new SDKCore({
@@ -556,6 +558,8 @@ export function createMCPServer(deps: {
556
558
  tool(tool$sandboxUploadFile);
557
559
  tool(tool$sandboxDownloadArchive);
558
560
  tool(tool$sandboxUploadArchive);
561
+ tool(tool$sessionsGetTenantResourcePolicy);
562
+ tool(tool$sessionsSetTenantResourcePolicy);
559
563
  tool(tool$usageSandbox);
560
564
  tool(tool$usageCosts);
561
565
  tool(tool$agentsListFunctionTools);
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { sessionsGetTenantResourcePolicy } from "../../funcs/sessionsGetTenantResourcePolicy.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.GetTenantResourcePolicyRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$sessionsGetTenantResourcePolicy: ToolDefinition<typeof args> =
14
+ {
15
+ name: "sessions-get-tenant-resource-policy",
16
+ description: `Get`,
17
+ args,
18
+ tool: async (client, args, ctx) => {
19
+ const [result, apiCall] = await sessionsGetTenantResourcePolicy(
20
+ client,
21
+ args.request,
22
+ { fetchOptions: { signal: ctx.mcpReq.signal } },
23
+ ).$inspect();
24
+
25
+ if (!result.ok) {
26
+ return {
27
+ content: [{ type: "text", text: result.error.message }],
28
+ isError: true,
29
+ };
30
+ }
31
+
32
+ const value = result.value;
33
+
34
+ return formatResult(value, apiCall);
35
+ },
36
+ };
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { sessionsSetTenantResourcePolicy } from "../../funcs/sessionsSetTenantResourcePolicy.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.SetTenantResourcePolicyRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$sessionsSetTenantResourcePolicy: ToolDefinition<typeof args> =
14
+ {
15
+ name: "sessions-set-tenant-resource-policy",
16
+ description: `Save`,
17
+ args,
18
+ tool: async (client, args, ctx) => {
19
+ const [result, apiCall] = await sessionsSetTenantResourcePolicy(
20
+ client,
21
+ args.request,
22
+ { fetchOptions: { signal: ctx.mcpReq.signal } },
23
+ ).$inspect();
24
+
25
+ if (!result.ok) {
26
+ return {
27
+ content: [{ type: "text", text: result.error.message }],
28
+ isError: true,
29
+ };
30
+ }
31
+
32
+ const value = result.value;
33
+
34
+ return formatResult(value, apiCall);
35
+ },
36
+ };
@@ -662,6 +662,7 @@ export * from "./sandboxusagepage.js";
662
662
  export * from "./sandboxusageresult.js";
663
663
  export * from "./saveenvironmentrequest.js";
664
664
  export * from "./savetenantnetworkpolicy.js";
665
+ export * from "./savetenantresourcepolicy.js";
665
666
  export * from "./schema0.js";
666
667
  export * from "./schema1.js";
667
668
  export * from "./schemacreateresponse.js";
@@ -719,6 +720,7 @@ export * from "./summarytext.js";
719
720
  export * from "./supervisedhyperparameters.js";
720
721
  export * from "./tag.js";
721
722
  export * from "./tenantnetworkpolicy.js";
723
+ export * from "./tenantresourcepolicy.js";
722
724
  export * from "./terminatesessionrequest.js";
723
725
  export * from "./terminatesessionresponse.js";
724
726
  export * from "./testguardrailsrequest.js";
@@ -0,0 +1,118 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export const SaveTenantResourcePolicyCpuCores = {
13
+ One: 1,
14
+ Two: 2,
15
+ } as const;
16
+ export type SaveTenantResourcePolicyCpuCores = ClosedEnum<
17
+ typeof SaveTenantResourcePolicyCpuCores
18
+ >;
19
+
20
+ export const SaveTenantResourcePolicyMemoryMib = {
21
+ FiveHundredAndTwelve: 512,
22
+ OneThousandAndTwentyFour: 1024,
23
+ TwoThousandAndFortyEight: 2048,
24
+ } as const;
25
+ export type SaveTenantResourcePolicyMemoryMib = ClosedEnum<
26
+ typeof SaveTenantResourcePolicyMemoryMib
27
+ >;
28
+
29
+ export type SaveTenantResourcePolicy = {
30
+ cpuCores?: SaveTenantResourcePolicyCpuCores | null | undefined;
31
+ memoryMib?: SaveTenantResourcePolicyMemoryMib | null | undefined;
32
+ timeoutSeconds?: number | null | undefined;
33
+ expectedRevision: number;
34
+ };
35
+
36
+ /** @internal */
37
+ export const SaveTenantResourcePolicyCpuCores$inboundSchema: z.ZodNativeEnum<
38
+ typeof SaveTenantResourcePolicyCpuCores
39
+ > = z.nativeEnum(SaveTenantResourcePolicyCpuCores);
40
+ /** @internal */
41
+ export const SaveTenantResourcePolicyCpuCores$outboundSchema: z.ZodNativeEnum<
42
+ typeof SaveTenantResourcePolicyCpuCores
43
+ > = SaveTenantResourcePolicyCpuCores$inboundSchema;
44
+
45
+ /** @internal */
46
+ export const SaveTenantResourcePolicyMemoryMib$inboundSchema: z.ZodNativeEnum<
47
+ typeof SaveTenantResourcePolicyMemoryMib
48
+ > = z.nativeEnum(SaveTenantResourcePolicyMemoryMib);
49
+ /** @internal */
50
+ export const SaveTenantResourcePolicyMemoryMib$outboundSchema: z.ZodNativeEnum<
51
+ typeof SaveTenantResourcePolicyMemoryMib
52
+ > = SaveTenantResourcePolicyMemoryMib$inboundSchema;
53
+
54
+ /** @internal */
55
+ export const SaveTenantResourcePolicy$inboundSchema: z.ZodType<
56
+ SaveTenantResourcePolicy,
57
+ z.ZodTypeDef,
58
+ unknown
59
+ > = z.object({
60
+ cpu_cores: z.nullable(SaveTenantResourcePolicyCpuCores$inboundSchema)
61
+ .optional(),
62
+ memory_mib: z.nullable(SaveTenantResourcePolicyMemoryMib$inboundSchema)
63
+ .optional(),
64
+ timeout_seconds: z.nullable(z.number().int()).optional(),
65
+ expected_revision: z.number().int(),
66
+ }).transform((v) => {
67
+ return remap$(v, {
68
+ "cpu_cores": "cpuCores",
69
+ "memory_mib": "memoryMib",
70
+ "timeout_seconds": "timeoutSeconds",
71
+ "expected_revision": "expectedRevision",
72
+ });
73
+ });
74
+ /** @internal */
75
+ export type SaveTenantResourcePolicy$Outbound = {
76
+ cpu_cores?: number | null | undefined;
77
+ memory_mib?: number | null | undefined;
78
+ timeout_seconds?: number | null | undefined;
79
+ expected_revision: number;
80
+ };
81
+
82
+ /** @internal */
83
+ export const SaveTenantResourcePolicy$outboundSchema: z.ZodType<
84
+ SaveTenantResourcePolicy$Outbound,
85
+ z.ZodTypeDef,
86
+ SaveTenantResourcePolicy
87
+ > = z.object({
88
+ cpuCores: z.nullable(SaveTenantResourcePolicyCpuCores$outboundSchema)
89
+ .optional(),
90
+ memoryMib: z.nullable(SaveTenantResourcePolicyMemoryMib$outboundSchema)
91
+ .optional(),
92
+ timeoutSeconds: z.nullable(z.number().int()).optional(),
93
+ expectedRevision: z.number().int(),
94
+ }).transform((v) => {
95
+ return remap$(v, {
96
+ cpuCores: "cpu_cores",
97
+ memoryMib: "memory_mib",
98
+ timeoutSeconds: "timeout_seconds",
99
+ expectedRevision: "expected_revision",
100
+ });
101
+ });
102
+
103
+ export function saveTenantResourcePolicyToJSON(
104
+ saveTenantResourcePolicy: SaveTenantResourcePolicy,
105
+ ): string {
106
+ return JSON.stringify(
107
+ SaveTenantResourcePolicy$outboundSchema.parse(saveTenantResourcePolicy),
108
+ );
109
+ }
110
+ export function saveTenantResourcePolicyFromJSON(
111
+ jsonString: string,
112
+ ): SafeParseResult<SaveTenantResourcePolicy, SDKValidationError> {
113
+ return safeParse(
114
+ jsonString,
115
+ (x) => SaveTenantResourcePolicy$inboundSchema.parse(JSON.parse(x)),
116
+ `Failed to parse 'SaveTenantResourcePolicy' from JSON`,
117
+ );
118
+ }
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export const CpuCores = {
13
+ One: 1,
14
+ Two: 2,
15
+ } as const;
16
+ export type CpuCores = ClosedEnum<typeof CpuCores>;
17
+
18
+ export const MemoryMib = {
19
+ FiveHundredAndTwelve: 512,
20
+ OneThousandAndTwentyFour: 1024,
21
+ TwoThousandAndFortyEight: 2048,
22
+ } as const;
23
+ export type MemoryMib = ClosedEnum<typeof MemoryMib>;
24
+
25
+ export type TenantResourcePolicy = {
26
+ cpuCores?: CpuCores | null | undefined;
27
+ memoryMib?: MemoryMib | null | undefined;
28
+ timeoutSeconds?: number | null | undefined;
29
+ revision?: number | undefined;
30
+ };
31
+
32
+ /** @internal */
33
+ export const CpuCores$inboundSchema: z.ZodNativeEnum<typeof CpuCores> = z
34
+ .nativeEnum(CpuCores);
35
+ /** @internal */
36
+ export const CpuCores$outboundSchema: z.ZodNativeEnum<typeof CpuCores> =
37
+ CpuCores$inboundSchema;
38
+
39
+ /** @internal */
40
+ export const MemoryMib$inboundSchema: z.ZodNativeEnum<typeof MemoryMib> = z
41
+ .nativeEnum(MemoryMib);
42
+ /** @internal */
43
+ export const MemoryMib$outboundSchema: z.ZodNativeEnum<typeof MemoryMib> =
44
+ MemoryMib$inboundSchema;
45
+
46
+ /** @internal */
47
+ export const TenantResourcePolicy$inboundSchema: z.ZodType<
48
+ TenantResourcePolicy,
49
+ z.ZodTypeDef,
50
+ unknown
51
+ > = z.object({
52
+ cpu_cores: z.nullable(CpuCores$inboundSchema).optional(),
53
+ memory_mib: z.nullable(MemoryMib$inboundSchema).optional(),
54
+ timeout_seconds: z.nullable(z.number().int()).optional(),
55
+ revision: z.number().int().default(0),
56
+ }).transform((v) => {
57
+ return remap$(v, {
58
+ "cpu_cores": "cpuCores",
59
+ "memory_mib": "memoryMib",
60
+ "timeout_seconds": "timeoutSeconds",
61
+ });
62
+ });
63
+ /** @internal */
64
+ export type TenantResourcePolicy$Outbound = {
65
+ cpu_cores?: number | null | undefined;
66
+ memory_mib?: number | null | undefined;
67
+ timeout_seconds?: number | null | undefined;
68
+ revision: number;
69
+ };
70
+
71
+ /** @internal */
72
+ export const TenantResourcePolicy$outboundSchema: z.ZodType<
73
+ TenantResourcePolicy$Outbound,
74
+ z.ZodTypeDef,
75
+ TenantResourcePolicy
76
+ > = z.object({
77
+ cpuCores: z.nullable(CpuCores$outboundSchema).optional(),
78
+ memoryMib: z.nullable(MemoryMib$outboundSchema).optional(),
79
+ timeoutSeconds: z.nullable(z.number().int()).optional(),
80
+ revision: z.number().int().default(0),
81
+ }).transform((v) => {
82
+ return remap$(v, {
83
+ cpuCores: "cpu_cores",
84
+ memoryMib: "memory_mib",
85
+ timeoutSeconds: "timeout_seconds",
86
+ });
87
+ });
88
+
89
+ export function tenantResourcePolicyToJSON(
90
+ tenantResourcePolicy: TenantResourcePolicy,
91
+ ): string {
92
+ return JSON.stringify(
93
+ TenantResourcePolicy$outboundSchema.parse(tenantResourcePolicy),
94
+ );
95
+ }
96
+ export function tenantResourcePolicyFromJSON(
97
+ jsonString: string,
98
+ ): SafeParseResult<TenantResourcePolicy, SDKValidationError> {
99
+ return safeParse(
100
+ jsonString,
101
+ (x) => TenantResourcePolicy$inboundSchema.parse(JSON.parse(x)),
102
+ `Failed to parse 'TenantResourcePolicy' from JSON`,
103
+ );
104
+ }
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export const GetTenantResourcePolicyPathParamScope = {
13
+ Organization: "organization",
14
+ Team: "team",
15
+ } as const;
16
+ export type GetTenantResourcePolicyPathParamScope = ClosedEnum<
17
+ typeof GetTenantResourcePolicyPathParamScope
18
+ >;
19
+
20
+ export type GetTenantResourcePolicyRequest = {
21
+ scope: GetTenantResourcePolicyPathParamScope;
22
+ expectedOrganizationId: string;
23
+ expectedTeamId: string;
24
+ /**
25
+ * Optional external end-user identifier forwarded by the API gateway.
26
+ */
27
+ xOnBehalfOf?: string | undefined;
28
+ };
29
+
30
+ /** @internal */
31
+ export const GetTenantResourcePolicyPathParamScope$inboundSchema:
32
+ z.ZodNativeEnum<typeof GetTenantResourcePolicyPathParamScope> = z.nativeEnum(
33
+ GetTenantResourcePolicyPathParamScope,
34
+ );
35
+ /** @internal */
36
+ export const GetTenantResourcePolicyPathParamScope$outboundSchema:
37
+ z.ZodNativeEnum<typeof GetTenantResourcePolicyPathParamScope> =
38
+ GetTenantResourcePolicyPathParamScope$inboundSchema;
39
+
40
+ /** @internal */
41
+ export const GetTenantResourcePolicyRequest$inboundSchema: z.ZodType<
42
+ GetTenantResourcePolicyRequest,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ scope: GetTenantResourcePolicyPathParamScope$inboundSchema,
47
+ expected_organization_id: z.string(),
48
+ expected_team_id: z.string(),
49
+ "X-On-Behalf-Of": z.string().optional(),
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ "expected_organization_id": "expectedOrganizationId",
53
+ "expected_team_id": "expectedTeamId",
54
+ "X-On-Behalf-Of": "xOnBehalfOf",
55
+ });
56
+ });
57
+ /** @internal */
58
+ export type GetTenantResourcePolicyRequest$Outbound = {
59
+ scope: string;
60
+ expected_organization_id: string;
61
+ expected_team_id: string;
62
+ "X-On-Behalf-Of"?: string | undefined;
63
+ };
64
+
65
+ /** @internal */
66
+ export const GetTenantResourcePolicyRequest$outboundSchema: z.ZodType<
67
+ GetTenantResourcePolicyRequest$Outbound,
68
+ z.ZodTypeDef,
69
+ GetTenantResourcePolicyRequest
70
+ > = z.object({
71
+ scope: GetTenantResourcePolicyPathParamScope$outboundSchema,
72
+ expectedOrganizationId: z.string(),
73
+ expectedTeamId: z.string(),
74
+ xOnBehalfOf: z.string().optional(),
75
+ }).transform((v) => {
76
+ return remap$(v, {
77
+ expectedOrganizationId: "expected_organization_id",
78
+ expectedTeamId: "expected_team_id",
79
+ xOnBehalfOf: "X-On-Behalf-Of",
80
+ });
81
+ });
82
+
83
+ export function getTenantResourcePolicyRequestToJSON(
84
+ getTenantResourcePolicyRequest: GetTenantResourcePolicyRequest,
85
+ ): string {
86
+ return JSON.stringify(
87
+ GetTenantResourcePolicyRequest$outboundSchema.parse(
88
+ getTenantResourcePolicyRequest,
89
+ ),
90
+ );
91
+ }
92
+ export function getTenantResourcePolicyRequestFromJSON(
93
+ jsonString: string,
94
+ ): SafeParseResult<GetTenantResourcePolicyRequest, SDKValidationError> {
95
+ return safeParse(
96
+ jsonString,
97
+ (x) => GetTenantResourcePolicyRequest$inboundSchema.parse(JSON.parse(x)),
98
+ `Failed to parse 'GetTenantResourcePolicyRequest' from JSON`,
99
+ );
100
+ }
@@ -248,6 +248,7 @@ export * from "./getteam.js";
248
248
  export * from "./getteambudgets.js";
249
249
  export * from "./getteamdefaultbudgets.js";
250
250
  export * from "./gettenantnetworkpolicy.js";
251
+ export * from "./gettenantresourcepolicy.js";
251
252
  export * from "./gettexttospeechhistory.js";
252
253
  export * from "./gettexttospeechhistorycontent.js";
253
254
  export * from "./getuserbudgets.js";
@@ -405,6 +406,7 @@ export * from "./setsandboxconnectortools.js";
405
406
  export * from "./setteambudget.js";
406
407
  export * from "./setteamdefaultbudget.js";
407
408
  export * from "./settenantnetworkpolicy.js";
409
+ export * from "./settenantresourcepolicy.js";
408
410
  export * from "./setupwhatsappappwebhook.js";
409
411
  export * from "./setuserbudget.js";
410
412
  export * from "./setuserdefaultbudget.js";