@orq-ai/node 3.12.16 → 3.12.19

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 (159) hide show
  1. package/bin/mcp-server.js +112 -112
  2. package/bin/mcp-server.js.map +30 -30
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +3 -3
  6. package/lib/config.js +3 -3
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/server.js +1 -1
  9. package/models/operations/createbudget.js +2 -2
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/createdataset.js +2 -2
  12. package/models/operations/createdatasetitem.js +2 -2
  13. package/models/operations/createdatasource.js +2 -2
  14. package/models/operations/createeval.js +16 -16
  15. package/models/operations/fileget.js +2 -2
  16. package/models/operations/filelist.js +2 -2
  17. package/models/operations/fileupload.js +2 -2
  18. package/models/operations/getbudget.js +2 -2
  19. package/models/operations/getevals.js +28 -28
  20. package/models/operations/listbudgets.js +2 -2
  21. package/models/operations/listcontacts.js +2 -2
  22. package/models/operations/listdatasetdatapoints.js +2 -2
  23. package/models/operations/listdatasets.js +2 -2
  24. package/models/operations/listdatasources.js +2 -2
  25. package/models/operations/retrievecontact.js +2 -2
  26. package/models/operations/retrievedatapoint.js +2 -2
  27. package/models/operations/retrievedataset.js +2 -2
  28. package/models/operations/retrievedatasource.js +2 -2
  29. package/models/operations/updatebudget.js +2 -2
  30. package/models/operations/updatecontact.js +2 -2
  31. package/models/operations/updatedatapoint.js +2 -2
  32. package/models/operations/updatedataset.js +2 -2
  33. package/models/operations/updatedatasource.js +2 -2
  34. package/models/operations/updateeval.js +16 -16
  35. package/package.json +1 -1
  36. package/packages/orq-rc/README.md +107 -90
  37. package/packages/orq-rc/docs/sdks/tools/README.md +488 -0
  38. package/packages/orq-rc/examples/package-lock.json +1 -1
  39. package/packages/orq-rc/jsr.json +1 -1
  40. package/packages/orq-rc/package-lock.json +2 -2
  41. package/packages/orq-rc/package.json +1 -1
  42. package/packages/orq-rc/src/funcs/toolsCreate.ts +163 -0
  43. package/packages/orq-rc/src/funcs/toolsDelete.ts +167 -0
  44. package/packages/orq-rc/src/funcs/toolsDuplicate.ts +175 -0
  45. package/packages/orq-rc/src/funcs/toolsList.ts +176 -0
  46. package/packages/orq-rc/src/funcs/toolsRetrieve.ts +166 -0
  47. package/packages/orq-rc/src/funcs/toolsUpdate.ts +176 -0
  48. package/packages/orq-rc/src/lib/config.ts +3 -3
  49. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  50. package/packages/orq-rc/src/mcp-server/server.ts +13 -1
  51. package/packages/orq-rc/src/mcp-server/tools/toolsCreate.ts +37 -0
  52. package/packages/orq-rc/src/mcp-server/tools/toolsDelete.ts +35 -0
  53. package/packages/orq-rc/src/mcp-server/tools/toolsDuplicate.ts +37 -0
  54. package/packages/orq-rc/src/mcp-server/tools/toolsList.ts +37 -0
  55. package/packages/orq-rc/src/mcp-server/tools/toolsRetrieve.ts +37 -0
  56. package/packages/orq-rc/src/mcp-server/tools/toolsUpdate.ts +37 -0
  57. package/packages/orq-rc/src/models/components/callsubagenttool.ts +109 -0
  58. package/packages/orq-rc/src/models/components/codeexecutiontool.ts +293 -0
  59. package/packages/orq-rc/src/models/components/currentdatetool.ts +107 -0
  60. package/packages/orq-rc/src/models/components/deployments.ts +52 -45
  61. package/packages/orq-rc/src/models/components/functiontool.ts +195 -0
  62. package/packages/orq-rc/src/models/components/googlesearchtool.ts +108 -0
  63. package/packages/orq-rc/src/models/components/httptool.ts +532 -0
  64. package/packages/orq-rc/src/models/components/index.ts +13 -0
  65. package/packages/orq-rc/src/models/components/queryknowledgebasetool.ts +111 -0
  66. package/packages/orq-rc/src/models/components/querymemorystoretool.ts +111 -0
  67. package/packages/orq-rc/src/models/components/retrieveagentstool.ts +109 -0
  68. package/packages/orq-rc/src/models/components/retrieveknowledgebasestool.ts +111 -0
  69. package/packages/orq-rc/src/models/components/retrievememorystorestool.ts +111 -0
  70. package/packages/orq-rc/src/models/components/webscrapertool.ts +105 -0
  71. package/packages/orq-rc/src/models/components/writememorystoretool.ts +111 -0
  72. package/packages/orq-rc/src/models/errors/duplicatetool.ts +91 -0
  73. package/packages/orq-rc/src/models/errors/index.ts +2 -0
  74. package/packages/orq-rc/src/models/errors/updatetool.ts +91 -0
  75. package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
  76. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  77. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  78. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +10 -8
  79. package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
  80. package/packages/orq-rc/src/models/operations/createeval.ts +60 -56
  81. package/packages/orq-rc/src/models/operations/createknowledge.ts +18 -0
  82. package/packages/orq-rc/src/models/operations/creatememorystore.ts +137 -136
  83. package/packages/orq-rc/src/models/operations/createprompt.ts +631 -314
  84. package/packages/orq-rc/src/models/operations/createtool.ts +4027 -0
  85. package/packages/orq-rc/src/models/operations/deletetool.ts +75 -0
  86. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +8 -6
  87. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +362 -194
  88. package/packages/orq-rc/src/models/operations/deployments.ts +329 -160
  89. package/packages/orq-rc/src/models/operations/deploymentstream.ts +8 -6
  90. package/packages/orq-rc/src/models/operations/duplicatetool.ts +2311 -0
  91. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  92. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  93. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  94. package/packages/orq-rc/src/models/operations/getagent.ts +10 -10
  95. package/packages/orq-rc/src/models/operations/getallprompts.ts +333 -168
  96. package/packages/orq-rc/src/models/operations/getalltools.ts +2278 -0
  97. package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
  98. package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
  99. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +9 -0
  100. package/packages/orq-rc/src/models/operations/getoneprompt.ts +329 -167
  101. package/packages/orq-rc/src/models/operations/getpromptversion.ts +337 -168
  102. package/packages/orq-rc/src/models/operations/index.ts +6 -0
  103. package/packages/orq-rc/src/models/operations/listagents.ts +10 -10
  104. package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
  105. package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
  106. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +6 -5
  107. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  108. package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
  109. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +9 -0
  110. package/packages/orq-rc/src/models/operations/listpromptversions.ts +354 -183
  111. package/packages/orq-rc/src/models/operations/parse.ts +20 -335
  112. package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
  113. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +6 -5
  114. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  115. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
  116. package/packages/orq-rc/src/models/operations/retrievetool.ts +2303 -0
  117. package/packages/orq-rc/src/models/operations/runagent.ts +412 -1375
  118. package/packages/orq-rc/src/models/operations/streamrunagent.ts +399 -1449
  119. package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
  120. package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
  121. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +10 -8
  122. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  123. package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
  124. package/packages/orq-rc/src/models/operations/updateeval.ts +57 -57
  125. package/packages/orq-rc/src/models/operations/updateknowledge.ts +18 -0
  126. package/packages/orq-rc/src/models/operations/updatememorystore.ts +136 -168
  127. package/packages/orq-rc/src/models/operations/updateprompt.ts +668 -335
  128. package/packages/orq-rc/src/models/operations/updatetool.ts +4231 -0
  129. package/packages/orq-rc/src/sdk/sdk.ts +6 -0
  130. package/packages/orq-rc/src/sdk/tools.ts +117 -0
  131. package/src/lib/config.ts +3 -3
  132. package/src/mcp-server/mcp-server.ts +1 -1
  133. package/src/mcp-server/server.ts +1 -1
  134. package/src/models/operations/createbudget.ts +2 -2
  135. package/src/models/operations/createcontact.ts +2 -2
  136. package/src/models/operations/createdataset.ts +2 -2
  137. package/src/models/operations/createdatasetitem.ts +2 -2
  138. package/src/models/operations/createdatasource.ts +2 -2
  139. package/src/models/operations/createeval.ts +16 -16
  140. package/src/models/operations/fileget.ts +2 -2
  141. package/src/models/operations/filelist.ts +2 -2
  142. package/src/models/operations/fileupload.ts +2 -2
  143. package/src/models/operations/getbudget.ts +2 -2
  144. package/src/models/operations/getevals.ts +28 -28
  145. package/src/models/operations/listbudgets.ts +2 -2
  146. package/src/models/operations/listcontacts.ts +2 -2
  147. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  148. package/src/models/operations/listdatasets.ts +2 -2
  149. package/src/models/operations/listdatasources.ts +2 -2
  150. package/src/models/operations/retrievecontact.ts +2 -2
  151. package/src/models/operations/retrievedatapoint.ts +2 -2
  152. package/src/models/operations/retrievedataset.ts +2 -2
  153. package/src/models/operations/retrievedatasource.ts +2 -2
  154. package/src/models/operations/updatebudget.ts +2 -2
  155. package/src/models/operations/updatecontact.ts +2 -2
  156. package/src/models/operations/updatedatapoint.ts +2 -2
  157. package/src/models/operations/updatedataset.ts +2 -2
  158. package/src/models/operations/updatedatasource.ts +2 -2
  159. package/src/models/operations/updateeval.ts +16 -16
@@ -143,13 +143,14 @@ export type PrefixMessagesContent =
143
143
  | Array<TextContentPart | RefusalContentPart>;
144
144
 
145
145
  /**
146
- * The role of the messages author, in this case `assistant`.
146
+ * The role of the messages author, in this case `assistant` or `exception`.
147
147
  */
148
148
  export const DeploymentsPrefixMessages4Role = {
149
149
  Assistant: "assistant",
150
+ Exception: "exception",
150
151
  } as const;
151
152
  /**
152
- * The role of the messages author, in this case `assistant`.
153
+ * The role of the messages author, in this case `assistant` or `exception`.
153
154
  */
154
155
  export type DeploymentsPrefixMessages4Role = ClosedEnum<
155
156
  typeof DeploymentsPrefixMessages4Role
@@ -168,15 +169,15 @@ export type Audio = {
168
169
  /**
169
170
  * The type of the tool. Currently, only `function` is supported.
170
171
  */
171
- export const Type = {
172
+ export const PrefixMessagesType = {
172
173
  Function: "function",
173
174
  } as const;
174
175
  /**
175
176
  * The type of the tool. Currently, only `function` is supported.
176
177
  */
177
- export type Type = ClosedEnum<typeof Type>;
178
+ export type PrefixMessagesType = ClosedEnum<typeof PrefixMessagesType>;
178
179
 
179
- export type FunctionT = {
180
+ export type PrefixMessagesFunction = {
180
181
  /**
181
182
  * The name of the function to call.
182
183
  */
@@ -195,8 +196,8 @@ export type ToolCalls = {
195
196
  /**
196
197
  * The type of the tool. Currently, only `function` is supported.
197
198
  */
198
- type: Type;
199
- function: FunctionT;
199
+ type: PrefixMessagesType;
200
+ function: PrefixMessagesFunction;
200
201
  };
201
202
 
202
203
  export type AssistantMessage = {
@@ -213,7 +214,7 @@ export type AssistantMessage = {
213
214
  */
214
215
  refusal?: string | null | undefined;
215
216
  /**
216
- * The role of the messages author, in this case `assistant`.
217
+ * The role of the messages author, in this case `assistant` or `exception`.
217
218
  */
218
219
  role: DeploymentsPrefixMessages4Role;
219
220
  /**
@@ -589,13 +590,14 @@ export type DeploymentsMessagesContent =
589
590
  | Array<TwoTextContentPart | TwoRefusalContentPart>;
590
591
 
591
592
  /**
592
- * The role of the messages author, in this case `assistant`.
593
+ * The role of the messages author, in this case `assistant` or `exception`.
593
594
  */
594
595
  export const DeploymentsMessages4Role = {
595
596
  Assistant: "assistant",
597
+ Exception: "exception",
596
598
  } as const;
597
599
  /**
598
- * The role of the messages author, in this case `assistant`.
600
+ * The role of the messages author, in this case `assistant` or `exception`.
599
601
  */
600
602
  export type DeploymentsMessages4Role = ClosedEnum<
601
603
  typeof DeploymentsMessages4Role
@@ -659,7 +661,7 @@ export type MessagesAssistantMessage = {
659
661
  */
660
662
  refusal?: string | null | undefined;
661
663
  /**
662
- * The role of the messages author, in this case `assistant`.
664
+ * The role of the messages author, in this case `assistant` or `exception`.
663
665
  */
664
666
  role: DeploymentsMessages4Role;
665
667
  /**
@@ -2162,28 +2164,29 @@ export function audioFromJSON(
2162
2164
  }
2163
2165
 
2164
2166
  /** @internal */
2165
- export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
2166
- Type,
2167
- );
2167
+ export const PrefixMessagesType$inboundSchema: z.ZodNativeEnum<
2168
+ typeof PrefixMessagesType
2169
+ > = z.nativeEnum(PrefixMessagesType);
2168
2170
 
2169
2171
  /** @internal */
2170
- export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
2171
- Type$inboundSchema;
2172
+ export const PrefixMessagesType$outboundSchema: z.ZodNativeEnum<
2173
+ typeof PrefixMessagesType
2174
+ > = PrefixMessagesType$inboundSchema;
2172
2175
 
2173
2176
  /**
2174
2177
  * @internal
2175
2178
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2176
2179
  */
2177
- export namespace Type$ {
2178
- /** @deprecated use `Type$inboundSchema` instead. */
2179
- export const inboundSchema = Type$inboundSchema;
2180
- /** @deprecated use `Type$outboundSchema` instead. */
2181
- export const outboundSchema = Type$outboundSchema;
2180
+ export namespace PrefixMessagesType$ {
2181
+ /** @deprecated use `PrefixMessagesType$inboundSchema` instead. */
2182
+ export const inboundSchema = PrefixMessagesType$inboundSchema;
2183
+ /** @deprecated use `PrefixMessagesType$outboundSchema` instead. */
2184
+ export const outboundSchema = PrefixMessagesType$outboundSchema;
2182
2185
  }
2183
2186
 
2184
2187
  /** @internal */
2185
- export const FunctionT$inboundSchema: z.ZodType<
2186
- FunctionT,
2188
+ export const PrefixMessagesFunction$inboundSchema: z.ZodType<
2189
+ PrefixMessagesFunction,
2187
2190
  z.ZodTypeDef,
2188
2191
  unknown
2189
2192
  > = z.object({
@@ -2192,16 +2195,16 @@ export const FunctionT$inboundSchema: z.ZodType<
2192
2195
  });
2193
2196
 
2194
2197
  /** @internal */
2195
- export type FunctionT$Outbound = {
2198
+ export type PrefixMessagesFunction$Outbound = {
2196
2199
  name?: string | undefined;
2197
2200
  arguments?: string | undefined;
2198
2201
  };
2199
2202
 
2200
2203
  /** @internal */
2201
- export const FunctionT$outboundSchema: z.ZodType<
2202
- FunctionT$Outbound,
2204
+ export const PrefixMessagesFunction$outboundSchema: z.ZodType<
2205
+ PrefixMessagesFunction$Outbound,
2203
2206
  z.ZodTypeDef,
2204
- FunctionT
2207
+ PrefixMessagesFunction
2205
2208
  > = z.object({
2206
2209
  name: z.string().optional(),
2207
2210
  arguments: z.string().optional(),
@@ -2211,26 +2214,30 @@ export const FunctionT$outboundSchema: z.ZodType<
2211
2214
  * @internal
2212
2215
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2213
2216
  */
2214
- export namespace FunctionT$ {
2215
- /** @deprecated use `FunctionT$inboundSchema` instead. */
2216
- export const inboundSchema = FunctionT$inboundSchema;
2217
- /** @deprecated use `FunctionT$outboundSchema` instead. */
2218
- export const outboundSchema = FunctionT$outboundSchema;
2219
- /** @deprecated use `FunctionT$Outbound` instead. */
2220
- export type Outbound = FunctionT$Outbound;
2217
+ export namespace PrefixMessagesFunction$ {
2218
+ /** @deprecated use `PrefixMessagesFunction$inboundSchema` instead. */
2219
+ export const inboundSchema = PrefixMessagesFunction$inboundSchema;
2220
+ /** @deprecated use `PrefixMessagesFunction$outboundSchema` instead. */
2221
+ export const outboundSchema = PrefixMessagesFunction$outboundSchema;
2222
+ /** @deprecated use `PrefixMessagesFunction$Outbound` instead. */
2223
+ export type Outbound = PrefixMessagesFunction$Outbound;
2221
2224
  }
2222
2225
 
2223
- export function functionToJSON(functionT: FunctionT): string {
2224
- return JSON.stringify(FunctionT$outboundSchema.parse(functionT));
2226
+ export function prefixMessagesFunctionToJSON(
2227
+ prefixMessagesFunction: PrefixMessagesFunction,
2228
+ ): string {
2229
+ return JSON.stringify(
2230
+ PrefixMessagesFunction$outboundSchema.parse(prefixMessagesFunction),
2231
+ );
2225
2232
  }
2226
2233
 
2227
- export function functionFromJSON(
2234
+ export function prefixMessagesFunctionFromJSON(
2228
2235
  jsonString: string,
2229
- ): SafeParseResult<FunctionT, SDKValidationError> {
2236
+ ): SafeParseResult<PrefixMessagesFunction, SDKValidationError> {
2230
2237
  return safeParse(
2231
2238
  jsonString,
2232
- (x) => FunctionT$inboundSchema.parse(JSON.parse(x)),
2233
- `Failed to parse 'FunctionT' from JSON`,
2239
+ (x) => PrefixMessagesFunction$inboundSchema.parse(JSON.parse(x)),
2240
+ `Failed to parse 'PrefixMessagesFunction' from JSON`,
2234
2241
  );
2235
2242
  }
2236
2243
 
@@ -2241,15 +2248,15 @@ export const ToolCalls$inboundSchema: z.ZodType<
2241
2248
  unknown
2242
2249
  > = z.object({
2243
2250
  id: z.string(),
2244
- type: Type$inboundSchema,
2245
- function: z.lazy(() => FunctionT$inboundSchema),
2251
+ type: PrefixMessagesType$inboundSchema,
2252
+ function: z.lazy(() => PrefixMessagesFunction$inboundSchema),
2246
2253
  });
2247
2254
 
2248
2255
  /** @internal */
2249
2256
  export type ToolCalls$Outbound = {
2250
2257
  id: string;
2251
2258
  type: string;
2252
- function: FunctionT$Outbound;
2259
+ function: PrefixMessagesFunction$Outbound;
2253
2260
  };
2254
2261
 
2255
2262
  /** @internal */
@@ -2259,8 +2266,8 @@ export const ToolCalls$outboundSchema: z.ZodType<
2259
2266
  ToolCalls
2260
2267
  > = z.object({
2261
2268
  id: z.string(),
2262
- type: Type$outboundSchema,
2263
- function: z.lazy(() => FunctionT$outboundSchema),
2269
+ type: PrefixMessagesType$outboundSchema,
2270
+ function: z.lazy(() => PrefixMessagesFunction$outboundSchema),
2264
2271
  });
2265
2272
 
2266
2273
  /**
@@ -0,0 +1,195 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
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 FunctionToolType = {
13
+ Function: "function",
14
+ } as const;
15
+ export type FunctionToolType = ClosedEnum<typeof FunctionToolType>;
16
+
17
+ export type FunctionT = {
18
+ name: string;
19
+ description?: string | undefined;
20
+ strict?: boolean | undefined;
21
+ parameters?: { [k: string]: any } | undefined;
22
+ };
23
+
24
+ /**
25
+ * Custom function tool with configurable parameters
26
+ */
27
+ export type FunctionTool = {
28
+ type: FunctionToolType;
29
+ id?: string | undefined;
30
+ key: string;
31
+ displayName?: string | undefined;
32
+ description?: string | undefined;
33
+ requiresApproval?: boolean | undefined;
34
+ function: FunctionT;
35
+ };
36
+
37
+ /** @internal */
38
+ export const FunctionToolType$inboundSchema: z.ZodNativeEnum<
39
+ typeof FunctionToolType
40
+ > = z.nativeEnum(FunctionToolType);
41
+
42
+ /** @internal */
43
+ export const FunctionToolType$outboundSchema: z.ZodNativeEnum<
44
+ typeof FunctionToolType
45
+ > = FunctionToolType$inboundSchema;
46
+
47
+ /**
48
+ * @internal
49
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
50
+ */
51
+ export namespace FunctionToolType$ {
52
+ /** @deprecated use `FunctionToolType$inboundSchema` instead. */
53
+ export const inboundSchema = FunctionToolType$inboundSchema;
54
+ /** @deprecated use `FunctionToolType$outboundSchema` instead. */
55
+ export const outboundSchema = FunctionToolType$outboundSchema;
56
+ }
57
+
58
+ /** @internal */
59
+ export const FunctionT$inboundSchema: z.ZodType<
60
+ FunctionT,
61
+ z.ZodTypeDef,
62
+ unknown
63
+ > = z.object({
64
+ name: z.string(),
65
+ description: z.string().optional(),
66
+ strict: z.boolean().optional(),
67
+ parameters: z.record(z.any()).optional(),
68
+ });
69
+
70
+ /** @internal */
71
+ export type FunctionT$Outbound = {
72
+ name: string;
73
+ description?: string | undefined;
74
+ strict?: boolean | undefined;
75
+ parameters?: { [k: string]: any } | undefined;
76
+ };
77
+
78
+ /** @internal */
79
+ export const FunctionT$outboundSchema: z.ZodType<
80
+ FunctionT$Outbound,
81
+ z.ZodTypeDef,
82
+ FunctionT
83
+ > = z.object({
84
+ name: z.string(),
85
+ description: z.string().optional(),
86
+ strict: z.boolean().optional(),
87
+ parameters: z.record(z.any()).optional(),
88
+ });
89
+
90
+ /**
91
+ * @internal
92
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
93
+ */
94
+ export namespace FunctionT$ {
95
+ /** @deprecated use `FunctionT$inboundSchema` instead. */
96
+ export const inboundSchema = FunctionT$inboundSchema;
97
+ /** @deprecated use `FunctionT$outboundSchema` instead. */
98
+ export const outboundSchema = FunctionT$outboundSchema;
99
+ /** @deprecated use `FunctionT$Outbound` instead. */
100
+ export type Outbound = FunctionT$Outbound;
101
+ }
102
+
103
+ export function functionToJSON(functionT: FunctionT): string {
104
+ return JSON.stringify(FunctionT$outboundSchema.parse(functionT));
105
+ }
106
+
107
+ export function functionFromJSON(
108
+ jsonString: string,
109
+ ): SafeParseResult<FunctionT, SDKValidationError> {
110
+ return safeParse(
111
+ jsonString,
112
+ (x) => FunctionT$inboundSchema.parse(JSON.parse(x)),
113
+ `Failed to parse 'FunctionT' from JSON`,
114
+ );
115
+ }
116
+
117
+ /** @internal */
118
+ export const FunctionTool$inboundSchema: z.ZodType<
119
+ FunctionTool,
120
+ z.ZodTypeDef,
121
+ unknown
122
+ > = z.object({
123
+ type: FunctionToolType$inboundSchema,
124
+ _id: z.string().optional(),
125
+ key: z.string(),
126
+ display_name: z.string().optional(),
127
+ description: z.string().optional(),
128
+ requires_approval: z.boolean().default(false),
129
+ function: z.lazy(() => FunctionT$inboundSchema),
130
+ }).transform((v) => {
131
+ return remap$(v, {
132
+ "_id": "id",
133
+ "display_name": "displayName",
134
+ "requires_approval": "requiresApproval",
135
+ });
136
+ });
137
+
138
+ /** @internal */
139
+ export type FunctionTool$Outbound = {
140
+ type: string;
141
+ _id?: string | undefined;
142
+ key: string;
143
+ display_name?: string | undefined;
144
+ description?: string | undefined;
145
+ requires_approval: boolean;
146
+ function: FunctionT$Outbound;
147
+ };
148
+
149
+ /** @internal */
150
+ export const FunctionTool$outboundSchema: z.ZodType<
151
+ FunctionTool$Outbound,
152
+ z.ZodTypeDef,
153
+ FunctionTool
154
+ > = z.object({
155
+ type: FunctionToolType$outboundSchema,
156
+ id: z.string().optional(),
157
+ key: z.string(),
158
+ displayName: z.string().optional(),
159
+ description: z.string().optional(),
160
+ requiresApproval: z.boolean().default(false),
161
+ function: z.lazy(() => FunctionT$outboundSchema),
162
+ }).transform((v) => {
163
+ return remap$(v, {
164
+ id: "_id",
165
+ displayName: "display_name",
166
+ requiresApproval: "requires_approval",
167
+ });
168
+ });
169
+
170
+ /**
171
+ * @internal
172
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
173
+ */
174
+ export namespace FunctionTool$ {
175
+ /** @deprecated use `FunctionTool$inboundSchema` instead. */
176
+ export const inboundSchema = FunctionTool$inboundSchema;
177
+ /** @deprecated use `FunctionTool$outboundSchema` instead. */
178
+ export const outboundSchema = FunctionTool$outboundSchema;
179
+ /** @deprecated use `FunctionTool$Outbound` instead. */
180
+ export type Outbound = FunctionTool$Outbound;
181
+ }
182
+
183
+ export function functionToolToJSON(functionTool: FunctionTool): string {
184
+ return JSON.stringify(FunctionTool$outboundSchema.parse(functionTool));
185
+ }
186
+
187
+ export function functionToolFromJSON(
188
+ jsonString: string,
189
+ ): SafeParseResult<FunctionTool, SDKValidationError> {
190
+ return safeParse(
191
+ jsonString,
192
+ (x) => FunctionTool$inboundSchema.parse(JSON.parse(x)),
193
+ `Failed to parse 'FunctionTool' from JSON`,
194
+ );
195
+ }
@@ -0,0 +1,108 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
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 Type = {
13
+ GoogleSearch: "google_search",
14
+ } as const;
15
+ export type Type = ClosedEnum<typeof Type>;
16
+
17
+ /**
18
+ * Performs Google searches to retrieve web content
19
+ */
20
+ export type GoogleSearchTool = {
21
+ type: Type;
22
+ requiresApproval?: boolean | undefined;
23
+ };
24
+
25
+ /** @internal */
26
+ export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
27
+ Type,
28
+ );
29
+
30
+ /** @internal */
31
+ export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
32
+ Type$inboundSchema;
33
+
34
+ /**
35
+ * @internal
36
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
37
+ */
38
+ export namespace Type$ {
39
+ /** @deprecated use `Type$inboundSchema` instead. */
40
+ export const inboundSchema = Type$inboundSchema;
41
+ /** @deprecated use `Type$outboundSchema` instead. */
42
+ export const outboundSchema = Type$outboundSchema;
43
+ }
44
+
45
+ /** @internal */
46
+ export const GoogleSearchTool$inboundSchema: z.ZodType<
47
+ GoogleSearchTool,
48
+ z.ZodTypeDef,
49
+ unknown
50
+ > = z.object({
51
+ type: Type$inboundSchema,
52
+ requires_approval: z.boolean().default(false),
53
+ }).transform((v) => {
54
+ return remap$(v, {
55
+ "requires_approval": "requiresApproval",
56
+ });
57
+ });
58
+
59
+ /** @internal */
60
+ export type GoogleSearchTool$Outbound = {
61
+ type: string;
62
+ requires_approval: boolean;
63
+ };
64
+
65
+ /** @internal */
66
+ export const GoogleSearchTool$outboundSchema: z.ZodType<
67
+ GoogleSearchTool$Outbound,
68
+ z.ZodTypeDef,
69
+ GoogleSearchTool
70
+ > = z.object({
71
+ type: Type$outboundSchema,
72
+ requiresApproval: z.boolean().default(false),
73
+ }).transform((v) => {
74
+ return remap$(v, {
75
+ requiresApproval: "requires_approval",
76
+ });
77
+ });
78
+
79
+ /**
80
+ * @internal
81
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
82
+ */
83
+ export namespace GoogleSearchTool$ {
84
+ /** @deprecated use `GoogleSearchTool$inboundSchema` instead. */
85
+ export const inboundSchema = GoogleSearchTool$inboundSchema;
86
+ /** @deprecated use `GoogleSearchTool$outboundSchema` instead. */
87
+ export const outboundSchema = GoogleSearchTool$outboundSchema;
88
+ /** @deprecated use `GoogleSearchTool$Outbound` instead. */
89
+ export type Outbound = GoogleSearchTool$Outbound;
90
+ }
91
+
92
+ export function googleSearchToolToJSON(
93
+ googleSearchTool: GoogleSearchTool,
94
+ ): string {
95
+ return JSON.stringify(
96
+ GoogleSearchTool$outboundSchema.parse(googleSearchTool),
97
+ );
98
+ }
99
+
100
+ export function googleSearchToolFromJSON(
101
+ jsonString: string,
102
+ ): SafeParseResult<GoogleSearchTool, SDKValidationError> {
103
+ return safeParse(
104
+ jsonString,
105
+ (x) => GoogleSearchTool$inboundSchema.parse(JSON.parse(x)),
106
+ `Failed to parse 'GoogleSearchTool' from JSON`,
107
+ );
108
+ }