@dremio/js-sdk 0.39.1 → 0.40.1

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 (74) hide show
  1. package/dist/cloud/ai/AIResource.d.ts +2 -2
  2. package/dist/cloud/ai/AIResource.js +2 -2
  3. package/dist/cloud/ai/AIResource.js.map +1 -1
  4. package/dist/cloud/ai/index.d.ts +1 -1
  5. package/dist/cloud/ai/index.js +1 -1
  6. package/dist/cloud/ai/index.js.map +1 -1
  7. package/dist/cloud/ai/modelProviderCodec.d.ts +1 -1
  8. package/dist/cloud/ai/modelProviderCodec.js +1 -1
  9. package/dist/cloud/ai/modelProviderCodec.js.map +1 -1
  10. package/dist/enterprise/ai/AIResource.d.ts +4 -4
  11. package/dist/enterprise/ai/AIResource.js +4 -4
  12. package/dist/enterprise/ai/AIResource.js.map +1 -1
  13. package/dist/enterprise/ai/chat/ChatSession.d.ts +22 -7
  14. package/dist/enterprise/ai/chat/ChatSession.js +57 -22
  15. package/dist/enterprise/ai/chat/ChatSession.js.map +1 -1
  16. package/dist/enterprise/ai/chat/ChatSessionClient.d.ts +1 -4
  17. package/dist/enterprise/ai/chat/ChatSessionClient.js +9 -12
  18. package/dist/enterprise/ai/chat/ChatSessionClient.js.map +1 -1
  19. package/dist/enterprise/ai/chat/eventWrappers/AgentChatExchange.d.ts +1 -1
  20. package/dist/enterprise/ai/chat/eventWrappers/AgentChatExchange.js.map +1 -1
  21. package/dist/enterprise/ai/chat/{AgentChatPartialResponse.d.ts → eventWrappers/AgentChatPartialResponse.d.ts} +9 -3
  22. package/dist/enterprise/ai/chat/{AgentChatPartialResponse.js → eventWrappers/AgentChatPartialResponse.js} +1 -1
  23. package/dist/enterprise/ai/chat/eventWrappers/AgentChatPartialResponse.js.map +1 -0
  24. package/dist/enterprise/ai/chat/{AgentChatResponse.d.ts → eventWrappers/AgentChatResponse.d.ts} +5 -5
  25. package/dist/enterprise/ai/chat/{AgentChatResponse.js → eventWrappers/AgentChatResponse.js} +10 -10
  26. package/dist/enterprise/ai/chat/eventWrappers/AgentChatResponse.js.map +1 -0
  27. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCall.d.ts +3 -3
  28. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCall.js +3 -3
  29. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCall.js.map +1 -1
  30. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCallGroup.d.ts +3 -3
  31. package/dist/enterprise/ai/chat/eventWrappers/AgentToolCallGroup.js.map +1 -1
  32. package/dist/enterprise/ai/chat/index.d.ts +6 -6
  33. package/dist/enterprise/ai/chat/index.js +6 -6
  34. package/dist/enterprise/ai/chat/index.js.map +1 -1
  35. package/dist/enterprise/ai/chat/methods/sendChatMessage.d.ts +2 -2
  36. package/dist/enterprise/ai/chat/methods/sendChatMessage.js +3 -3
  37. package/dist/enterprise/ai/chat/methods/sendChatMessage.js.map +1 -1
  38. package/dist/enterprise/ai/chat/responseContent/AgentErrorResponseContent.js.map +1 -0
  39. package/dist/enterprise/ai/chat/responseContent/AgentModelResponseContent.js.map +1 -0
  40. package/dist/enterprise/ai/chat/responseContent/AgentToolRequestResponseContent.js.map +1 -0
  41. package/dist/enterprise/ai/chat/responseContent/AgentToolResultResponseContent.js.map +1 -0
  42. package/dist/enterprise/ai/index.d.ts +1 -1
  43. package/dist/enterprise/ai/index.js +1 -1
  44. package/dist/enterprise/ai/index.js.map +1 -1
  45. package/dist/enterprise/ai/{ModelProvider.d.ts → modelProvider/ModelProvider.d.ts} +5 -5
  46. package/dist/enterprise/ai/{ModelProvider.js → modelProvider/ModelProvider.js} +1 -1
  47. package/dist/enterprise/ai/modelProvider/ModelProvider.js.map +1 -0
  48. package/dist/enterprise/ai/modelProvider/modelProviderCodec.js.map +1 -0
  49. package/dist/enterprise/ai/modelProvider/modelProviderConfigSchemas.js.map +1 -0
  50. package/dist-iife/cloud.js +16119 -0
  51. package/dist-iife/community.js +13750 -0
  52. package/dist-iife/enterprise.js +17041 -0
  53. package/package.json +23 -7
  54. package/dist/enterprise/ai/ModelProvider.js.map +0 -1
  55. package/dist/enterprise/ai/chat/AgentChatPartialResponse.js.map +0 -1
  56. package/dist/enterprise/ai/chat/AgentChatResponse.js.map +0 -1
  57. package/dist/enterprise/ai/chat/AgentErrorResponseContent.js.map +0 -1
  58. package/dist/enterprise/ai/chat/AgentModelResponseContent.js.map +0 -1
  59. package/dist/enterprise/ai/chat/AgentToolRequestResponseContent.js.map +0 -1
  60. package/dist/enterprise/ai/chat/AgentToolResultResponseContent.js.map +0 -1
  61. package/dist/enterprise/ai/modelProviderCodec.js.map +0 -1
  62. package/dist/enterprise/ai/modelProviderConfigSchemas.js.map +0 -1
  63. /package/dist/enterprise/ai/chat/{AgentErrorResponseContent.d.ts → responseContent/AgentErrorResponseContent.d.ts} +0 -0
  64. /package/dist/enterprise/ai/chat/{AgentErrorResponseContent.js → responseContent/AgentErrorResponseContent.js} +0 -0
  65. /package/dist/enterprise/ai/chat/{AgentModelResponseContent.d.ts → responseContent/AgentModelResponseContent.d.ts} +0 -0
  66. /package/dist/enterprise/ai/chat/{AgentModelResponseContent.js → responseContent/AgentModelResponseContent.js} +0 -0
  67. /package/dist/enterprise/ai/chat/{AgentToolRequestResponseContent.d.ts → responseContent/AgentToolRequestResponseContent.d.ts} +0 -0
  68. /package/dist/enterprise/ai/chat/{AgentToolRequestResponseContent.js → responseContent/AgentToolRequestResponseContent.js} +0 -0
  69. /package/dist/enterprise/ai/chat/{AgentToolResultResponseContent.d.ts → responseContent/AgentToolResultResponseContent.d.ts} +0 -0
  70. /package/dist/enterprise/ai/chat/{AgentToolResultResponseContent.js → responseContent/AgentToolResultResponseContent.js} +0 -0
  71. /package/dist/enterprise/ai/{modelProviderCodec.d.ts → modelProvider/modelProviderCodec.d.ts} +0 -0
  72. /package/dist/enterprise/ai/{modelProviderCodec.js → modelProvider/modelProviderCodec.js} +0 -0
  73. /package/dist/enterprise/ai/{modelProviderConfigSchemas.d.ts → modelProvider/modelProviderConfigSchemas.d.ts} +0 -0
  74. /package/dist/enterprise/ai/{modelProviderConfigSchemas.js → modelProvider/modelProviderConfigSchemas.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dremio/js-sdk",
3
- "version": "0.39.1",
3
+ "version": "0.40.1",
4
4
  "description": "JavaScript library for the Dremio API",
5
5
  "keywords": [
6
6
  "dremio",
@@ -13,18 +13,33 @@
13
13
  },
14
14
  "homepage": "https://docs.dremio.com",
15
15
  "files": [
16
- "dist"
16
+ "dist",
17
+ "dist-iife"
17
18
  ],
18
19
  "type": "module",
20
+ "browser": "./dist-iife/cloud.js",
19
21
  "exports": {
20
- "./cloud": "./dist/cloud/index.js",
21
- "./community": "./dist/oss/index.js",
22
- "./enterprise": "./dist/enterprise/index.js",
23
- "./oss": "./dist/oss/index.js"
22
+ "./cloud": {
23
+ "import": "./dist/cloud/index.js",
24
+ "browser": "./dist-iife/cloud.js"
25
+ },
26
+ "./community": {
27
+ "import": "./dist/oss/index.js",
28
+ "browser": "./dist-iife/community.js"
29
+ },
30
+ "./enterprise": {
31
+ "import": "./dist/enterprise/index.js",
32
+ "browser": "./dist-iife/enterprise.js"
33
+ },
34
+ "./oss": {
35
+ "import": "./dist/oss/index.js",
36
+ "browser": "./dist-iife/community.js"
37
+ }
24
38
  },
25
39
  "scripts": {
26
40
  "check-licenses": "jsgl --local .",
27
- "dist": "tsc",
41
+ "dist": "tsc && node --run dist:iife",
42
+ "dist:iife": "esbuild ./dist/oss/index.js --bundle --outfile=./dist-iife/community.js --format=iife --global-name=DremioCommunity --platform=browser && esbuild ./dist/enterprise/index.js --bundle --outfile=./dist-iife/enterprise.js --format=iife --global-name=DremioEnterprise --platform=browser && esbuild ./dist/cloud/index.js --bundle --outfile=./dist-iife/cloud.js --format=iife --global-name=DremioCloud --platform=browser",
28
43
  "docs": "typedoc src/oss/index.ts --hideGenerator --out ./docs/oss && typedoc src/enterprise/index.ts --hideGenerator --out ./docs/enterprise && typedoc src/cloud/index.ts --hideGenerator --out ./docs/cloud",
29
44
  "lint": "eslint src",
30
45
  "lint:fix": "eslint src --fix",
@@ -46,6 +61,7 @@
46
61
  "@eslint/compat": "^1.4.0",
47
62
  "@eslint/js": "^9.36.0",
48
63
  "@types/semver": "^7.7.1",
64
+ "esbuild": "^0.27.2",
49
65
  "eslint": "^9.36.0",
50
66
  "eslint-config-prettier": "^10.1.8",
51
67
  "eslint-plugin-license-header": "^0.8.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModelProvider.js","sourceRoot":"","sources":["../../../src/enterprise/ai/ModelProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,OAAO,aAAa;IACf,MAAM,CAAoC;IAC1C,SAAS,CAAuC;IAChD,SAAS,CAAuC;IAChD,gBAAgB,CAA8C;IAC9D,EAAE,CAAgC;IAClC,SAAS,CAAuC;IAChD,UAAU,CAAwC;IAClD,UAAU,CAAwC;IAClD,IAAI,CAAkC;IACtC,aAAa,CAA2C;IAExD,OAAO,CAAW;IAClB,IAAI,CAAS;IAEtB,YAAY,MAAgB,EAAE,UAAuD;QACnF,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,UAAU,C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IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;YACjD,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,kBAAkB;aACnC;YACD,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;SACd,CAAC;aACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAyD,CAAC;aAC/E,GAAG,CACF,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC,CAC1F;aACA,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;YACd,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACvB,OAAO,IAAI,oBAAoB,EAAE,CAAC;YACpC,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,YAAY,GAAG,wBAAwB,CAAC,GAAG,CAAC,GAAG,CAAC;IACvD,MAAM,CAAC,YAAY,GAAG,wBAAwB,CAAC,GAAG,CAAC,GAAG,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { V4Config } from \"../../common/Config.ts\";\nimport * as z from \"zod/mini\";\nimport {\n modelProviderCreateCodec,\n modelProviderRetrieveCodec,\n modelProviderUpdateCodec,\n} from \"./modelProviderCodec.ts\";\nimport { VersionConflictError } from \"../../common/problems.ts\";\n\nexport class ModelProvider implements Omit<ModelProviderProperties, \"tag\"> {\n readonly config: ModelProviderProperties[\"config\"];\n readonly createdAt: ModelProviderProperties[\"createdAt\"];\n readonly createdBy: ModelProviderProperties[\"createdBy\"];\n readonly defaultModelName: ModelProviderProperties[\"defaultModelName\"];\n readonly id: ModelProviderProperties[\"id\"];\n readonly isDefault: ModelProviderProperties[\"isDefault\"];\n readonly modifiedAt: ModelProviderProperties[\"modifiedAt\"];\n readonly modifiedBy: ModelProviderProperties[\"modifiedBy\"];\n readonly name: ModelProviderProperties[\"name\"];\n readonly sqlModelNames: ModelProviderProperties[\"sqlModelNames\"];\n\n readonly #config: V4Config;\n readonly #tag: string;\n\n constructor(config: V4Config, properties: z.output<typeof modelProviderRetrieveCodec>) {\n this.config = properties.config;\n this.createdAt = properties.createdAt;\n this.createdBy = properties.createdBy;\n this.defaultModelName = properties.defaultModelName;\n this.id = properties.id;\n this.isDefault = properties.isDefault;\n this.modifiedAt = properties.modifiedAt;\n this.modifiedBy = properties.modifiedBy;\n this.name = properties.name;\n this.sqlModelNames = properties.sqlModelNames;\n\n this.#config = config;\n this.#tag = properties.tag;\n }\n\n delete() {\n return this.#config\n .v4Request(`model-provider/config/${this.id}`, {\n keepalive: true,\n method: \"DELETE\",\n })\n .map(() => undefined as void);\n }\n\n setDefault() {\n return this.update({ isDefault: true });\n }\n\n update(fields: Partial<z.output<typeof modelProviderUpdateCodec>>) {\n const body = z.encode(modelProviderUpdateCodec, {\n config: fields.config ?? this.config,\n defaultModelName: fields.defaultModelName ?? this.defaultModelName,\n isDefault: fields.isDefault ?? this.isDefault,\n name: fields.name ?? this.name,\n sqlModelNames: fields.sqlModelNames ?? this.sqlModelNames,\n });\n\n return this.#config\n .v4Request(`model-provider/config/${this.id}`, {\n body: JSON.stringify({ ...body, tag: this.#tag }),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"PUT\",\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .map(\n (entity) => new ModelProvider(this.#config, z.decode(modelProviderRetrieveCodec, entity)),\n )\n .mapErr((val) => {\n if (val.status === 409) {\n return new VersionConflictError();\n }\n return val;\n });\n }\n\n static createSchema = modelProviderCreateCodec.def.out;\n static updateSchema = modelProviderUpdateCodec.def.out;\n}\n\ntype ModelProviderProperties = z.output<typeof modelProviderRetrieveCodec>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgentChatPartialResponse.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/AgentChatPartialResponse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAEzE,MAAM,OAAO,wBAAwB;IAC1B,EAAE,GAAG,MAAM,EAAE,CAAC;IACd,OAAO,CAAc;IACrB,OAAO,CAAS;IAChB,IAAI,CAAiD;IAE9D,YACE,WAAgD,EAChD,IAAsC,EACtC,OAA4C,EAC5C,EAAmC;QAEnC,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,EAAE,EAAE,CAAC;YACP,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED,MAAM,CAAC,IAA8B;QACnC,OAAO,IAAI,wBAAwB,CACjC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,EAC3B,IAAI,CAAC,EAAE,CACR,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,IAAa;QAC3B,qGAAqG;QACrG,OAAO,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,IAAW,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CACpB,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACjC,IAAI,EAAE,8BAA8B;KACrC,CAAC,EACF,CAAC,CAAC,UAAU,CAAC,wBAAwB,CAAC,EACtC;QACE,MAAM,CAAC,CAAC;YACN,OAAO,IAAI,wBAAwB,CACjC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,EAC/B,CAAC,CAAC,IAAI,EACN,CAAC,CAAC,OAAO,EACT,CAAC,CAAC,EAAE,CACL,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,CAAC;YACN,OAAO;gBACL,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE;gBAC3B,IAAI,EAAE,CAAC,CAAC,IAAI;aACJ,CAAC;QACb,CAAC;KACF,CACF,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { nanoid } from \"nanoid/non-secure\";\nimport { ChatSession } from \"./ChatSession.ts\";\nimport * as z from \"zod/mini\";\n\nconst agentPartialResponseTypeSchema = z.enum([\"delta\", \"end\", \"start\"]);\n\nexport class AgentChatPartialResponse {\n readonly id = nanoid();\n readonly session: ChatSession;\n readonly content: string;\n readonly type: z.infer<typeof agentPartialResponseTypeSchema>;\n\n constructor(\n chatSession: AgentChatPartialResponse[\"session\"],\n type: AgentChatPartialResponse[\"type\"],\n content: AgentChatPartialResponse[\"content\"],\n id?: AgentChatPartialResponse[\"id\"],\n ) {\n this.session = chatSession;\n this.type = type;\n this.content = content;\n\n if (id) {\n this.id = id;\n }\n }\n\n concat(next: AgentChatPartialResponse) {\n return new AgentChatPartialResponse(\n this.session,\n next.type,\n this.content + next.content,\n this.id,\n );\n }\n\n toJSON() {\n return z.encode(AgentChatPartialResponse.codec, this);\n }\n\n get isComplete() {\n return this.type === \"end\";\n }\n\n static fromJSON(data: unknown) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n return z.decode(AgentChatPartialResponse.codec, data as any);\n }\n\n static codec = z.codec(\n z.object({\n content: z.string(),\n id: z.string(),\n session: ChatSession.codec.def.in,\n type: agentPartialResponseTypeSchema,\n }),\n z.instanceof(AgentChatPartialResponse),\n {\n decode(v) {\n return new AgentChatPartialResponse(\n ChatSession.fromJSON(v.session),\n v.type,\n v.content,\n v.id,\n );\n },\n encode(v) {\n return {\n content: v.content,\n id: v.id,\n session: v.session.toJSON(),\n type: v.type,\n } as const;\n },\n },\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgentChatResponse.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat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C,SAAU;iBACf,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;KACF,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { nanoid } from \"nanoid/non-secure\";\nimport { AgentErrorResponseContent } from \"./AgentErrorResponseContent.ts\";\nimport { AgentModelResponseContent } from \"./AgentModelResponseContent.ts\";\nimport { AgentToolRequestResponseContent } from \"./AgentToolRequestResponseContent.ts\";\nimport { AgentToolResultResponseContent } from \"./AgentToolResultResponseContent.ts\";\nimport { ChatSession } from \"./ChatSession.ts\";\nimport * as z from \"zod/mini\";\nimport { Temporal } from \"temporal-polyfill\";\nimport { chatEventSchema, type ChatEvent } from \"./chatEventSchema.ts\";\n\nexport class AgentChatResponse<T extends AgentResponseContent> {\n readonly createdAt = Temporal.Now.instant();\n readonly id = nanoid();\n readonly session: ChatSession;\n readonly content: T;\n\n constructor(chatSession: ChatSession, content: T, createdAt?: Temporal.Instant, id?: string) {\n this.session = chatSession;\n this.content = content;\n\n if (createdAt) {\n this.createdAt = createdAt;\n }\n\n if (id) {\n this.id = id;\n }\n }\n\n /**\n * Creates a copy of the AgentResponse with a different content property.\n * Preserves the original message's ID\n */\n replaceContent<R extends AgentResponseContent>(content: R): AgentChatResponse<R> {\n return new AgentChatResponse(this.session, content, this.createdAt, this.id);\n }\n\n toJSON() {\n return z.encode(AgentChatResponse.codec, this);\n }\n\n static fromJSON(data: unknown) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n return z.decode(AgentChatResponse.codec, data as any);\n }\n\n static codec = z.codec(chatEventSchema, z.instanceof(AgentChatResponse), {\n decode(chatEvent) {\n const chatSession = ChatSession.new();\n const content = (() => {\n switch (chatEvent.chunkType) {\n case \"error\":\n return new AgentErrorResponseContent(chatEvent.message);\n case \"model\":\n return new AgentModelResponseContent(chatEvent.name, chatEvent.result);\n case \"toolRequest\": {\n return new AgentToolRequestResponseContent(\n chatEvent.callId,\n chatEvent.name,\n Object.keys(chatEvent.arguments)\n .sort()\n .map((key) => chatEvent.arguments[key]!),\n chatEvent.summarizedTitle || null,\n chatEvent.commentary || null,\n );\n }\n case \"toolResponse\":\n return new AgentToolResultResponseContent(\n chatEvent.callId,\n chatEvent.name,\n chatEvent.result,\n );\n }\n })();\n chatSession.assign({\n ...(\"modelName\" in chatEvent && { modelName: chatEvent.modelName }),\n ...(\"modelProviderId\" in chatEvent && {\n modelProviderId: chatEvent.modelProviderId,\n }),\n ...(\"sessionId\" in chatEvent && {\n sessionId: chatEvent.sessionId,\n }),\n });\n return new AgentChatResponse(\n chatSession,\n content,\n \"createdAt\" in chatEvent\n ? Temporal.Instant.from(chatEvent.createdAt)\n : Temporal.Now.instant(),\n );\n },\n encode(agentResponse) {\n const createdAt = agentResponse.createdAt?.toString();\n\n if (agentResponse.content instanceof AgentErrorResponseContent) {\n return {\n chunkType: \"error\",\n ...agentResponse.content,\n } as const satisfies ChatEvent;\n } else if (agentResponse.content instanceof AgentModelResponseContent) {\n return {\n chunkType: \"model\",\n createdAt: createdAt,\n modelName: agentResponse.session.modelName || \"\",\n modelProviderId: agentResponse.session.modelProviderId || \"\",\n name: agentResponse.content.name,\n result: agentResponse.content.result,\n sessionId: agentResponse.session.sessionId!,\n } as const satisfies ChatEvent;\n } else if (agentResponse.content instanceof AgentToolRequestResponseContent) {\n return {\n arguments: agentResponse.content.arguments.reduce(\n (accum, curr, i) => {\n accum[`arg${i}`] = curr;\n return accum;\n },\n {} as Record<string, unknown>,\n ) as Record<string, z.core.util.JSONType>,\n callId: agentResponse.content.callId,\n chunkType: \"toolRequest\",\n commentary: agentResponse.content.commentary || undefined,\n createdAt: createdAt,\n modelName: agentResponse.session.modelName || \"\",\n modelProviderId: agentResponse.session.modelProviderId || \"\",\n name: agentResponse.content.name,\n sessionId: agentResponse.session.sessionId!,\n summarizedTitle: agentResponse.content.summarizedTitle || undefined,\n } as const satisfies ChatEvent;\n } else if (agentResponse.content instanceof AgentToolResultResponseContent) {\n return {\n callId: agentResponse.content.callId,\n chunkType: \"toolResponse\",\n commentary: agentResponse.content.commentary || undefined,\n createdAt: createdAt,\n modelName: agentResponse.session.modelName || \"\",\n modelProviderId: agentResponse.session.modelProviderId || \"\",\n name: agentResponse.content.name,\n result: agentResponse.content.result,\n sessionId: agentResponse.session.sessionId!,\n } as const satisfies ChatEvent;\n } else {\n throw new Error(\"Unknown content type\");\n }\n },\n });\n}\n\nexport type AgentResponseContent =\n | AgentErrorResponseContent\n | AgentModelResponseContent\n | AgentToolRequestResponseContent\n | AgentToolResultResponseContent;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgentErrorResponseContent.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/AgentErrorResponseContent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,OAAO,yBAAyB;IAC3B,OAAO,CAAS;IAEzB,YAAY,OAA6C;QACvD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class AgentErrorResponseContent {\n readonly message: string;\n\n constructor(message: AgentErrorResponseContent[\"message\"]) {\n this.message = message;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgentModelResponseContent.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/AgentModelResponseContent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,yBAAyB;IAI3B,IAAI,CAAI;IACR,MAAM,CAAI;IAEnB,YAAY,IAAO,EAAE,MAAS;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { z } from \"zod/mini\";\n\nexport class AgentModelResponseContent<\n N extends string = string,\n R extends Record<string, z.core.util.JSONType> = Record<string, z.core.util.JSONType>,\n> {\n readonly name: N;\n readonly result: R;\n\n constructor(name: N, result: R) {\n this.name = name;\n this.result = result;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgentToolRequestResponseContent.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/AgentToolRequestResponseContent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,OAAO,+BAA+B;IACjC,SAAS,CAAyB;IAClC,MAAM,CAAS;IACf,UAAU,GAAkB,IAAI,CAAC;IACjC,IAAI,CAAS;IACb,eAAe,GAAkB,IAAI,CAAC;IAE/C,YACE,MAAiD,EACjD,IAA6C,EAC7C,aAA2D,EAC3D,eAAmE,EACnE,UAAyD;QAEzD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAE/B,IAAI,eAAe,EAAE,CAAC;YACpB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACzC,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC/B,CAAC;IACH,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\n\nexport class AgentToolRequestResponseContent {\n readonly arguments: z.core.util.JSONType[];\n readonly callId: string;\n readonly commentary: string | null = null;\n readonly name: string;\n readonly summarizedTitle: string | null = null;\n\n constructor(\n callId: AgentToolRequestResponseContent[\"callId\"],\n name: AgentToolRequestResponseContent[\"name\"],\n toolArguments: AgentToolRequestResponseContent[\"arguments\"],\n summarizedTitle: AgentToolRequestResponseContent[\"summarizedTitle\"],\n commentary: AgentToolRequestResponseContent[\"commentary\"],\n ) {\n this.callId = callId;\n this.name = name;\n this.arguments = toolArguments;\n\n if (summarizedTitle) {\n this.summarizedTitle = summarizedTitle;\n }\n\n if (commentary) {\n this.commentary = commentary;\n }\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgentToolResultResponseContent.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/AgentToolResultResponseContent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,OAAO,8BAA8B;IAChC,MAAM,CAAS;IACf,UAAU,GAAkB,IAAI,CAAC;IACjC,IAAI,CAAS;IACb,MAAM,CAAuC;IAEtD,YACE,MAAgD,EAChD,IAA4C,EAC5C,MAAgD,EAChD,UAAmB;QAEnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC/B,CAAC;IACH,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\n\nexport class AgentToolResultResponseContent {\n readonly callId: string;\n readonly commentary: string | null = null;\n readonly name: string;\n readonly result: Record<string, z.core.util.JSONType>;\n\n constructor(\n callId: AgentToolResultResponseContent[\"callId\"],\n name: AgentToolResultResponseContent[\"name\"],\n result: AgentToolResultResponseContent[\"result\"],\n commentary?: string,\n ) {\n this.callId = callId;\n this.name = name;\n this.result = result;\n\n if (commentary) {\n this.commentary = commentary;\n }\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"modelProviderCodec.js","sourceRoot":"","sources":["../../../src/en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F,CACF,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\nimport {\n amazonBedrockModelProviderConfigRetrieveSchema,\n amazonBedrockModelProviderConfigSchema,\n amazonBedrockModelProviderConfigUpdateSchema,\n anthropicModelProviderConfigRetrieveSchema,\n anthropicModelProviderConfigSchema,\n azureOpenAiModelProviderConfigRetrieveSchema,\n azureOpenAiModelProviderConfigSchema,\n azureOpenAiModelProviderConfigUpdateSchema,\n googleGeminiModelProviderConfigRetrieveSchema,\n googleGeminiModelProviderConfigSchema,\n openAiModelProviderConfigRetrieveSchema,\n openAiModelProviderConfigSchema,\n} from \"./modelProviderConfigSchemas.ts\";\nimport { Temporal } from \"temporal-polyfill\";\n\nconst modelProviderBaseSchema = z.object({\n createdAt: z.string().check(z.iso.datetime()),\n createdBy: z.string(),\n defaultModelName: z.string(),\n id: z.string(),\n isDefault: z.boolean(),\n modifiedAt: z.string().check(z.iso.datetime()),\n modifiedBy: z.string(),\n // eslint-disable-next-line regexp/prefer-w, regexp/use-ignore-case\n name: z.string().check(z.regex(/^[a-zA-Z0-9_-]+$/)),\n sqlModelNames: z.array(z.string()),\n tag: z.string(),\n});\n\nconst modelProviderRetrieveInSchema = z.extend(modelProviderBaseSchema, {\n config: z.union([\n z.strictObject({\n amazonBedrock: amazonBedrockModelProviderConfigRetrieveSchema,\n }),\n z.strictObject({\n anthropic: anthropicModelProviderConfigRetrieveSchema,\n }),\n z.strictObject({\n azureOpenAi: azureOpenAiModelProviderConfigRetrieveSchema,\n }),\n z.strictObject({\n googleGemini: googleGeminiModelProviderConfigRetrieveSchema,\n }),\n z.strictObject({\n openAi: openAiModelProviderConfigRetrieveSchema,\n }),\n ]),\n});\n\nconst modelProviderCreateInSchema = z.extend(\n z.pick(modelProviderBaseSchema, {\n defaultModelName: true,\n isDefault: true,\n name: true,\n sqlModelNames: true,\n }),\n {\n config: z.union([\n z.strictObject({\n amazonBedrock: amazonBedrockModelProviderConfigSchema,\n }),\n z.strictObject({\n anthropic: anthropicModelProviderConfigSchema,\n }),\n z.strictObject({\n azureOpenAi: azureOpenAiModelProviderConfigSchema,\n }),\n z.strictObject({\n googleGemini: googleGeminiModelProviderConfigSchema,\n }),\n z.strictObject({\n openAi: openAiModelProviderConfigSchema,\n }),\n ]),\n },\n);\n\nconst modelProviderUpdateInSchema = z.extend(\n z.omit(modelProviderCreateInSchema, { config: true }),\n {\n config: z.union([\n z.strictObject({\n amazonBedrock: amazonBedrockModelProviderConfigUpdateSchema,\n }),\n z.strictObject({\n anthropic: z.partial(anthropicModelProviderConfigSchema),\n }),\n z.strictObject({\n azureOpenAi: azureOpenAiModelProviderConfigUpdateSchema,\n }),\n z.strictObject({\n googleGemini: z.partial(googleGeminiModelProviderConfigSchema),\n }),\n z.strictObject({\n openAi: z.partial(openAiModelProviderConfigSchema),\n }),\n ]),\n },\n);\n\nexport const modelProviderRetrieveCodec = z.codec(\n modelProviderRetrieveInSchema,\n z.extend(\n z.omit(modelProviderRetrieveInSchema, {\n createdAt: true,\n modifiedAt: true,\n sqlModelNames: true,\n }),\n {\n createdAt: z.instanceof(Temporal.Instant),\n modifiedAt: z.instanceof(Temporal.Instant),\n sqlModelNames: z.set(z.string()),\n },\n ),\n {\n decode(v) {\n return {\n ...v,\n createdAt: Temporal.Instant.from(v.createdAt),\n modifiedAt: Temporal.Instant.from(v.modifiedAt),\n sqlModelNames: new Set(v.sqlModelNames),\n };\n },\n encode(v) {\n return {\n ...v,\n createdAt: v.createdAt.toString(),\n modifiedAt: v.modifiedAt.toString(),\n sqlModelNames: Array.from(v.sqlModelNames),\n };\n },\n },\n);\n\nexport const modelProviderCreateCodec = z.codec(\n modelProviderCreateInSchema,\n z.extend(\n z.omit(modelProviderCreateInSchema, {\n sqlModelNames: true,\n }),\n {\n sqlModelNames: z.set(z.string()),\n },\n ),\n {\n decode(v) {\n return {\n ...v,\n sqlModelNames: new Set(v.sqlModelNames),\n };\n },\n encode(v) {\n return {\n ...v,\n sqlModelNames: Array.from(v.sqlModelNames),\n };\n },\n },\n);\n\nexport const modelProviderUpdateCodec = z.codec(\n modelProviderUpdateInSchema,\n z.extend(z.omit(modelProviderUpdateInSchema, { sqlModelNames: true }), {\n sqlModelNames: z.set(z.string()),\n }),\n {\n decode(v) {\n return {\n ...v,\n sqlModelNames: new Set(v.sqlModelNames),\n };\n },\n encode(v) {\n return {\n ...v,\n sqlModelNames: Array.from(v.sqlModelNames),\n };\n },\n },\n);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"modelProviderConfigSchemas.js","sourceRoot":"","sources":["../../../src/enterprise/ai/modelProviderConfigSchemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAEpD,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC;QAClB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;QACvB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;KAC5B,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sCA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EH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC;IAChD,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,sBAAsB;KAC/B,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;KAC9B,CAAC;CACH,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\n\n/**\n * Amazon Bedrock\n */\nexport const amazonBedrockRegionSchema = z.string();\n\nconst amazonBedrockAccessKeyAuth = z.object({\n accessKey: z.object({\n accessKeyId: z.string(),\n secretAccessKey: z.string(),\n }),\n});\n\nconst amazonBedrockRoleAuth = z.object({\n role: z.object({\n roleArn: z.string(),\n }),\n});\n\nexport const amazonBedrockModelProviderConfigSchema = z.object({\n auth: z.union([amazonBedrockAccessKeyAuth, amazonBedrockRoleAuth]),\n region: amazonBedrockRegionSchema,\n});\n\nexport const amazonBedrockModelProviderConfigRetrieveSchema = z.object({\n auth: z.union([\n z.object({\n accessKey: z.omit(amazonBedrockAccessKeyAuth.shape.accessKey, { secretAccessKey: true }),\n }),\n amazonBedrockRoleAuth,\n ]),\n region: amazonBedrockRegionSchema,\n});\n\nexport const amazonBedrockModelProviderConfigUpdateSchema = z.object({\n auth: z.optional(\n z.union([\n z.object({\n accessKey: z.extend(\n z.omit(amazonBedrockAccessKeyAuth.shape.accessKey, { secretAccessKey: true }),\n {\n secretAccessKey: z.optional(\n amazonBedrockAccessKeyAuth.shape.accessKey.shape.secretAccessKey,\n ),\n },\n ),\n }),\n amazonBedrockRoleAuth,\n ]),\n ),\n region: z.optional(amazonBedrockRegionSchema),\n});\n\n/**\n * Anthropic\n */\nexport const anthropicModelProviderConfigSchema = z.object({\n accessKey: z.string(),\n});\n\n/**\n * Azure OpenAI\n */\nconst azureOpenAiAuth = z.object({\n clientSecretAuth: z.object({\n azureClientId: z.string(),\n azureClientSecret: z.string(),\n azureTenantId: z.string(),\n }),\n});\n\nexport const azureOpenAiModelProviderConfigSchema = z.object({\n auth: z.object(azureOpenAiAuth.shape),\n resourceName: z.string(),\n});\n\nexport const azureOpenAiModelProviderConfigRetrieveSchema = z.object({\n auth: z.object({\n clientSecretAuth: z.omit(azureOpenAiAuth.shape.clientSecretAuth, { azureClientSecret: true }),\n }),\n resourceName: z.string(),\n});\n\nexport const azureOpenAiModelProviderConfigUpdateSchema = z.object({\n auth: z.optional(\n z.union([\n azureOpenAiModelProviderConfigSchema.shape.auth,\n z.object({\n clientSecretAuth: z.extend(\n z.omit(azureOpenAiAuth.shape.clientSecretAuth, { azureClientSecret: true }),\n {\n azureClientSecret: z.optional(\n azureOpenAiAuth.shape.clientSecretAuth.shape.azureClientSecret,\n ),\n },\n ),\n }),\n ]),\n ),\n resourceName: z.string(),\n});\n\nexport const anthropicModelProviderConfigRetrieveSchema = z.object({});\n\n/**\n * Google Gemini\n */\nexport const googleGeminiModelProviderConfigSchema = z.object({\n accessKey: z.string(),\n});\n\nexport const googleGeminiModelProviderConfigRetrieveSchema = z.object({});\n\n/**\n * OpenAI\n */\nexport const openAiModelProviderConfigSchema = z.object({\n accessKey: z.string(),\n organizationId: z.string(),\n region: z.optional(z.enum([\"GLOBAL\", \"US\", \"EU\"])),\n});\n\nexport const openAiModelProviderConfigRetrieveSchema = z.object({\n organizationId: z.string(),\n region: z.enum([\"GLOBAL\", \"US\", \"EU\"]),\n});\n\nconst listModelsAccessSchema = z.union([\n z.strictObject({\n amazonBedrock: amazonBedrockModelProviderConfigSchema,\n }),\n z.strictObject({\n anthropic: anthropicModelProviderConfigSchema,\n }),\n z.strictObject({\n azureOpenAi: azureOpenAiModelProviderConfigSchema,\n }),\n z.strictObject({\n googleGemini: googleGeminiModelProviderConfigSchema,\n }),\n z.strictObject({\n openAi: openAiModelProviderConfigSchema,\n }),\n]);\n\nexport const listModelsPropertiesSchema = z.union([\n z.object({\n access: listModelsAccessSchema,\n }),\n z.object({\n modelProviderName: z.string(),\n }),\n]);\n"]}