@corti/sdk 0.1.2-agents.rc → 0.1.2-agents.rc.2

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 (90) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/agents/client/Client.d.ts +2 -1
  3. package/dist/cjs/api/resources/agents/client/Client.js +2 -1
  4. package/dist/cjs/api/resources/agents/types/AgentsCreateAgentExpertsItem.d.ts +1 -9
  5. package/dist/cjs/api/types/AgentsAgentExpertsItem.d.ts +1 -9
  6. package/dist/cjs/api/types/AgentsContextItemsItem.d.ts +1 -9
  7. package/dist/cjs/api/types/AgentsCreateExpert.d.ts +1 -0
  8. package/dist/cjs/api/types/AgentsDataPart.d.ts +2 -0
  9. package/dist/cjs/api/types/AgentsExpert.d.ts +1 -0
  10. package/dist/cjs/api/types/AgentsExpertReference.d.ts +1 -0
  11. package/dist/cjs/api/types/AgentsFilePart.d.ts +2 -0
  12. package/dist/cjs/api/types/AgentsMessage.d.ts +2 -0
  13. package/dist/cjs/api/types/AgentsPart.d.ts +1 -12
  14. package/dist/cjs/api/types/AgentsTask.d.ts +2 -0
  15. package/dist/cjs/api/types/AgentsTextPart.d.ts +2 -0
  16. package/dist/cjs/custom/utils/getEnvironmentFromString.js +1 -1
  17. package/dist/cjs/environments.d.ts +2 -2
  18. package/dist/cjs/environments.js +2 -2
  19. package/dist/cjs/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.d.ts +1 -7
  20. package/dist/cjs/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.js +1 -9
  21. package/dist/cjs/serialization/types/AgentsAgentExpertsItem.d.ts +1 -7
  22. package/dist/cjs/serialization/types/AgentsAgentExpertsItem.js +1 -9
  23. package/dist/cjs/serialization/types/AgentsContextItemsItem.d.ts +1 -7
  24. package/dist/cjs/serialization/types/AgentsContextItemsItem.js +1 -9
  25. package/dist/cjs/serialization/types/AgentsCreateExpert.d.ts +1 -0
  26. package/dist/cjs/serialization/types/AgentsCreateExpert.js +1 -0
  27. package/dist/cjs/serialization/types/AgentsDataPart.d.ts +1 -0
  28. package/dist/cjs/serialization/types/AgentsDataPart.js +1 -0
  29. package/dist/cjs/serialization/types/AgentsExpert.d.ts +1 -0
  30. package/dist/cjs/serialization/types/AgentsExpert.js +1 -0
  31. package/dist/cjs/serialization/types/AgentsExpertReference.d.ts +1 -0
  32. package/dist/cjs/serialization/types/AgentsExpertReference.js +1 -0
  33. package/dist/cjs/serialization/types/AgentsFilePart.d.ts +1 -0
  34. package/dist/cjs/serialization/types/AgentsFilePart.js +1 -0
  35. package/dist/cjs/serialization/types/AgentsMessage.d.ts +1 -0
  36. package/dist/cjs/serialization/types/AgentsMessage.js +1 -0
  37. package/dist/cjs/serialization/types/AgentsPart.d.ts +1 -10
  38. package/dist/cjs/serialization/types/AgentsPart.js +1 -10
  39. package/dist/cjs/serialization/types/AgentsTask.d.ts +1 -0
  40. package/dist/cjs/serialization/types/AgentsTask.js +1 -0
  41. package/dist/cjs/serialization/types/AgentsTextPart.d.ts +1 -0
  42. package/dist/cjs/serialization/types/AgentsTextPart.js +1 -0
  43. package/dist/cjs/version.d.ts +1 -1
  44. package/dist/cjs/version.js +1 -1
  45. package/dist/esm/Client.mjs +2 -2
  46. package/dist/esm/api/resources/agents/client/Client.d.mts +2 -1
  47. package/dist/esm/api/resources/agents/client/Client.mjs +2 -1
  48. package/dist/esm/api/resources/agents/types/AgentsCreateAgentExpertsItem.d.mts +1 -9
  49. package/dist/esm/api/types/AgentsAgentExpertsItem.d.mts +1 -9
  50. package/dist/esm/api/types/AgentsContextItemsItem.d.mts +1 -9
  51. package/dist/esm/api/types/AgentsCreateExpert.d.mts +1 -0
  52. package/dist/esm/api/types/AgentsDataPart.d.mts +2 -0
  53. package/dist/esm/api/types/AgentsExpert.d.mts +1 -0
  54. package/dist/esm/api/types/AgentsExpertReference.d.mts +1 -0
  55. package/dist/esm/api/types/AgentsFilePart.d.mts +2 -0
  56. package/dist/esm/api/types/AgentsMessage.d.mts +2 -0
  57. package/dist/esm/api/types/AgentsPart.d.mts +1 -12
  58. package/dist/esm/api/types/AgentsTask.d.mts +2 -0
  59. package/dist/esm/api/types/AgentsTextPart.d.mts +2 -0
  60. package/dist/esm/custom/utils/getEnvironmentFromString.mjs +1 -1
  61. package/dist/esm/environments.d.mts +2 -2
  62. package/dist/esm/environments.mjs +2 -2
  63. package/dist/esm/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.d.mts +1 -7
  64. package/dist/esm/serialization/resources/agents/types/AgentsCreateAgentExpertsItem.mjs +1 -9
  65. package/dist/esm/serialization/types/AgentsAgentExpertsItem.d.mts +1 -7
  66. package/dist/esm/serialization/types/AgentsAgentExpertsItem.mjs +1 -9
  67. package/dist/esm/serialization/types/AgentsContextItemsItem.d.mts +1 -7
  68. package/dist/esm/serialization/types/AgentsContextItemsItem.mjs +1 -9
  69. package/dist/esm/serialization/types/AgentsCreateExpert.d.mts +1 -0
  70. package/dist/esm/serialization/types/AgentsCreateExpert.mjs +1 -0
  71. package/dist/esm/serialization/types/AgentsDataPart.d.mts +1 -0
  72. package/dist/esm/serialization/types/AgentsDataPart.mjs +1 -0
  73. package/dist/esm/serialization/types/AgentsExpert.d.mts +1 -0
  74. package/dist/esm/serialization/types/AgentsExpert.mjs +1 -0
  75. package/dist/esm/serialization/types/AgentsExpertReference.d.mts +1 -0
  76. package/dist/esm/serialization/types/AgentsExpertReference.mjs +1 -0
  77. package/dist/esm/serialization/types/AgentsFilePart.d.mts +1 -0
  78. package/dist/esm/serialization/types/AgentsFilePart.mjs +1 -0
  79. package/dist/esm/serialization/types/AgentsMessage.d.mts +1 -0
  80. package/dist/esm/serialization/types/AgentsMessage.mjs +1 -0
  81. package/dist/esm/serialization/types/AgentsPart.d.mts +1 -10
  82. package/dist/esm/serialization/types/AgentsPart.mjs +1 -10
  83. package/dist/esm/serialization/types/AgentsTask.d.mts +1 -0
  84. package/dist/esm/serialization/types/AgentsTask.mjs +1 -0
  85. package/dist/esm/serialization/types/AgentsTextPart.d.mts +1 -0
  86. package/dist/esm/serialization/types/AgentsTextPart.mjs +1 -0
  87. package/dist/esm/version.d.mts +1 -1
  88. package/dist/esm/version.mjs +1 -1
  89. package/package.json +1 -1
  90. package/reference.md +2 -0
@@ -64,8 +64,8 @@ class CortiClient {
64
64
  "Tenant-Name": _options === null || _options === void 0 ? void 0 : _options.tenantName,
65
65
  "X-Fern-Language": "JavaScript",
66
66
  "X-Fern-SDK-Name": "@corti/sdk",
67
- "X-Fern-SDK-Version": "0.1.2-agents.rc",
68
- "User-Agent": "@corti/sdk/0.1.2-agents.rc",
67
+ "X-Fern-SDK-Version": "0.1.2-agents.rc.2",
68
+ "User-Agent": "@corti/sdk/0.1.2-agents.rc.2",
69
69
  "X-Fern-Runtime": core.RUNTIME.type,
70
70
  "X-Fern-Runtime-Version": core.RUNTIME.version,
71
71
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -146,7 +146,8 @@ export declare class Agents {
146
146
  * kind: "text",
147
147
  * text: "text"
148
148
  * }],
149
- * messageId: "messageId"
149
+ * messageId: "messageId",
150
+ * kind: "message"
150
151
  * }
151
152
  * })
152
153
  */
@@ -538,7 +538,8 @@ class Agents {
538
538
  * kind: "text",
539
539
  * text: "text"
540
540
  * }],
541
- * messageId: "messageId"
541
+ * messageId: "messageId",
542
+ * kind: "message"
542
543
  * }
543
544
  * })
544
545
  */
@@ -2,12 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../../../index.js";
5
- export type AgentsCreateAgentExpertsItem = Corti.AgentsCreateAgentExpertsItem.New | Corti.AgentsCreateAgentExpertsItem.Reference;
6
- export declare namespace AgentsCreateAgentExpertsItem {
7
- interface New extends Corti.AgentsCreateExpert {
8
- type: "new";
9
- }
10
- interface Reference extends Corti.AgentsExpertReference {
11
- type: "reference";
12
- }
13
- }
5
+ export type AgentsCreateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.AgentsExpertReference;
@@ -2,12 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.js";
5
- export type AgentsAgentExpertsItem = Corti.AgentsAgentExpertsItem.Expert | Corti.AgentsAgentExpertsItem.Reference;
6
- export declare namespace AgentsAgentExpertsItem {
7
- interface Expert extends Corti.AgentsExpert {
8
- type: "expert";
9
- }
10
- interface Reference extends Corti.AgentsExpertReference {
11
- type: "reference";
12
- }
13
- }
5
+ export type AgentsAgentExpertsItem = Corti.AgentsExpert | Corti.AgentsExpertReference;
@@ -2,12 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.js";
5
- export type AgentsContextItemsItem = Corti.AgentsContextItemsItem.Task | Corti.AgentsContextItemsItem.Message;
6
- export declare namespace AgentsContextItemsItem {
7
- interface Task extends Corti.AgentsTask {
8
- kind: "task";
9
- }
10
- interface Message extends Corti.AgentsMessage {
11
- kind: "message";
12
- }
13
- }
5
+ export type AgentsContextItemsItem = Corti.AgentsTask | Corti.AgentsMessage;
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as Corti from "../index.js";
5
5
  export interface AgentsCreateExpert {
6
+ type: "new";
6
7
  /** The name of the expert. Must be unique. */
7
8
  name: string;
8
9
  /** A brief description of the expert's capabilities. */
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface AgentsDataPart {
5
+ /** The kind of the part, always "data". */
6
+ kind: "data";
5
7
  /** JSON data payload. */
6
8
  data: Record<string, unknown>;
7
9
  /** Additional metadata for the data part. */
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as Corti from "../index.js";
5
5
  export interface AgentsExpert {
6
+ type: "expert";
6
7
  /** The unique identifier of the expert. */
7
8
  id: string;
8
9
  /** The name of the expert. Must be unique. */
@@ -5,6 +5,7 @@
5
5
  * A reference to an expert, either id or name must be provided. If both are passed, the id will be used.
6
6
  */
7
7
  export interface AgentsExpertReference {
8
+ type: "reference";
8
9
  /** The unique identifier of the expert. */
9
10
  id?: string;
10
11
  /** The name of the expert. */
@@ -3,6 +3,8 @@
3
3
  */
4
4
  import * as Corti from "../index.js";
5
5
  export interface AgentsFilePart {
6
+ /** The kind of the part, always "file". */
7
+ kind: "file";
6
8
  file?: Corti.AgentsFilePartFile;
7
9
  /** Additional metadata for the file part. */
8
10
  metadata?: Record<string, unknown>;
@@ -19,4 +19,6 @@ export interface AgentsMessage {
19
19
  taskId?: string;
20
20
  /** Identifier for the context (thread) in which the message is sent. */
21
21
  contextId?: string;
22
+ /** The kind of the object, always "message". */
23
+ kind: "message";
22
24
  }
@@ -2,15 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.js";
5
- export type AgentsPart = Corti.AgentsPart.Text | Corti.AgentsPart.File_ | Corti.AgentsPart.Data;
6
- export declare namespace AgentsPart {
7
- interface Text extends Corti.AgentsTextPart {
8
- kind: "text";
9
- }
10
- interface File_ extends Corti.AgentsFilePart {
11
- kind: "file";
12
- }
13
- interface Data extends Corti.AgentsDataPart {
14
- kind: "data";
15
- }
16
- }
5
+ export type AgentsPart = Corti.AgentsTextPart | Corti.AgentsFilePart | Corti.AgentsDataPart;
@@ -14,4 +14,6 @@ export interface AgentsTask {
14
14
  artifacts?: Corti.AgentsArtifact[];
15
15
  /** Additional metadata for the task. */
16
16
  metadata?: Record<string, unknown>;
17
+ /** The kind of the object, always "task". */
18
+ kind: "task";
17
19
  }
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface AgentsTextPart {
5
+ /** The kind of the part, always "text". */
6
+ kind: "text";
5
7
  /** The text content of the part. */
6
8
  text: string;
7
9
  /** Additional metadata for the text part. */
@@ -7,7 +7,7 @@ function getEnvironment(environment) {
7
7
  base: `https://api.${environment}.corti.app/v2`,
8
8
  wss: `wss://api.${environment}.corti.app`,
9
9
  login: `https://auth.${environment}.corti.app/realms`,
10
- agents: `https://agents.${environment}.corti.app/agents`,
10
+ agents: `https://api.${environment}.corti.app/agents`,
11
11
  }
12
12
  : environment;
13
13
  }
@@ -12,13 +12,13 @@ export declare const CortiEnvironment: {
12
12
  readonly base: "https://api.eu.corti.app/v2";
13
13
  readonly wss: "wss://api.eu.corti.app";
14
14
  readonly login: "https://auth.eu.corti.app/realms";
15
- readonly agents: "https://agents.eu.corti.app/agents";
15
+ readonly agents: "https://api.eu.corti.app/agents";
16
16
  };
17
17
  readonly Us: {
18
18
  readonly base: "https://api.us.corti.app/v2";
19
19
  readonly wss: "wss://api.us.corti.app";
20
20
  readonly login: "https://auth.us.corti.app/realms";
21
- readonly agents: "https://agents.us.corti.app/agents";
21
+ readonly agents: "https://api.us.corti.app/agents";
22
22
  };
23
23
  };
24
24
  export type CortiEnvironment = typeof CortiEnvironment.Eu | typeof CortiEnvironment.Us;
@@ -9,12 +9,12 @@ exports.CortiEnvironment = {
9
9
  base: "https://api.eu.corti.app/v2",
10
10
  wss: "wss://api.eu.corti.app",
11
11
  login: "https://auth.eu.corti.app/realms",
12
- agents: "https://agents.eu.corti.app/agents",
12
+ agents: "https://api.eu.corti.app/agents",
13
13
  },
14
14
  Us: {
15
15
  base: "https://api.us.corti.app/v2",
16
16
  wss: "wss://api.us.corti.app",
17
17
  login: "https://auth.us.corti.app/realms",
18
- agents: "https://agents.us.corti.app/agents",
18
+ agents: "https://api.us.corti.app/agents",
19
19
  },
20
20
  };
@@ -8,11 +8,5 @@ import { AgentsCreateExpert } from "../../../types/AgentsCreateExpert.js";
8
8
  import { AgentsExpertReference } from "../../../types/AgentsExpertReference.js";
9
9
  export declare const AgentsCreateAgentExpertsItem: core.serialization.Schema<serializers.AgentsCreateAgentExpertsItem.Raw, Corti.AgentsCreateAgentExpertsItem>;
10
10
  export declare namespace AgentsCreateAgentExpertsItem {
11
- type Raw = AgentsCreateAgentExpertsItem.New | AgentsCreateAgentExpertsItem.Reference;
12
- interface New extends AgentsCreateExpert.Raw {
13
- type: "new";
14
- }
15
- interface Reference extends AgentsExpertReference.Raw {
16
- type: "reference";
17
- }
11
+ type Raw = AgentsCreateExpert.Raw | AgentsExpertReference.Raw;
18
12
  }
@@ -40,12 +40,4 @@ exports.AgentsCreateAgentExpertsItem = void 0;
40
40
  const core = __importStar(require("../../../../core/index.js"));
41
41
  const AgentsCreateExpert_js_1 = require("../../../types/AgentsCreateExpert.js");
42
42
  const AgentsExpertReference_js_1 = require("../../../types/AgentsExpertReference.js");
43
- exports.AgentsCreateAgentExpertsItem = core.serialization
44
- .union("type", {
45
- new: AgentsCreateExpert_js_1.AgentsCreateExpert,
46
- reference: AgentsExpertReference_js_1.AgentsExpertReference,
47
- })
48
- .transform({
49
- transform: (value) => value,
50
- untransform: (value) => value,
51
- });
43
+ exports.AgentsCreateAgentExpertsItem = core.serialization.undiscriminatedUnion([AgentsCreateExpert_js_1.AgentsCreateExpert, AgentsExpertReference_js_1.AgentsExpertReference]);
@@ -8,11 +8,5 @@ import { AgentsExpert } from "./AgentsExpert.js";
8
8
  import { AgentsExpertReference } from "./AgentsExpertReference.js";
9
9
  export declare const AgentsAgentExpertsItem: core.serialization.Schema<serializers.AgentsAgentExpertsItem.Raw, Corti.AgentsAgentExpertsItem>;
10
10
  export declare namespace AgentsAgentExpertsItem {
11
- type Raw = AgentsAgentExpertsItem.Expert | AgentsAgentExpertsItem.Reference;
12
- interface Expert extends AgentsExpert.Raw {
13
- type: "expert";
14
- }
15
- interface Reference extends AgentsExpertReference.Raw {
16
- type: "reference";
17
- }
11
+ type Raw = AgentsExpert.Raw | AgentsExpertReference.Raw;
18
12
  }
@@ -40,12 +40,4 @@ exports.AgentsAgentExpertsItem = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  const AgentsExpert_js_1 = require("./AgentsExpert.js");
42
42
  const AgentsExpertReference_js_1 = require("./AgentsExpertReference.js");
43
- exports.AgentsAgentExpertsItem = core.serialization
44
- .union("type", {
45
- expert: AgentsExpert_js_1.AgentsExpert,
46
- reference: AgentsExpertReference_js_1.AgentsExpertReference,
47
- })
48
- .transform({
49
- transform: (value) => value,
50
- untransform: (value) => value,
51
- });
43
+ exports.AgentsAgentExpertsItem = core.serialization.undiscriminatedUnion([AgentsExpert_js_1.AgentsExpert, AgentsExpertReference_js_1.AgentsExpertReference]);
@@ -8,11 +8,5 @@ import { AgentsTask } from "./AgentsTask.js";
8
8
  import { AgentsMessage } from "./AgentsMessage.js";
9
9
  export declare const AgentsContextItemsItem: core.serialization.Schema<serializers.AgentsContextItemsItem.Raw, Corti.AgentsContextItemsItem>;
10
10
  export declare namespace AgentsContextItemsItem {
11
- type Raw = AgentsContextItemsItem.Task | AgentsContextItemsItem.Message;
12
- interface Task extends AgentsTask.Raw {
13
- kind: "task";
14
- }
15
- interface Message extends AgentsMessage.Raw {
16
- kind: "message";
17
- }
11
+ type Raw = AgentsTask.Raw | AgentsMessage.Raw;
18
12
  }
@@ -40,12 +40,4 @@ exports.AgentsContextItemsItem = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  const AgentsTask_js_1 = require("./AgentsTask.js");
42
42
  const AgentsMessage_js_1 = require("./AgentsMessage.js");
43
- exports.AgentsContextItemsItem = core.serialization
44
- .union("kind", {
45
- task: AgentsTask_js_1.AgentsTask,
46
- message: AgentsMessage_js_1.AgentsMessage,
47
- })
48
- .transform({
49
- transform: (value) => value,
50
- untransform: (value) => value,
51
- });
43
+ exports.AgentsContextItemsItem = core.serialization.undiscriminatedUnion([AgentsTask_js_1.AgentsTask, AgentsMessage_js_1.AgentsMessage]);
@@ -8,6 +8,7 @@ import { AgentsCreateMcpServer } from "./AgentsCreateMcpServer.js";
8
8
  export declare const AgentsCreateExpert: core.serialization.ObjectSchema<serializers.AgentsCreateExpert.Raw, Corti.AgentsCreateExpert>;
9
9
  export declare namespace AgentsCreateExpert {
10
10
  interface Raw {
11
+ type: "new";
11
12
  name: string;
12
13
  description: string;
13
14
  systemPrompt?: string | null;
@@ -40,6 +40,7 @@ exports.AgentsCreateExpert = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  const AgentsCreateMcpServer_js_1 = require("./AgentsCreateMcpServer.js");
42
42
  exports.AgentsCreateExpert = core.serialization.object({
43
+ type: core.serialization.stringLiteral("new"),
43
44
  name: core.serialization.string(),
44
45
  description: core.serialization.string(),
45
46
  systemPrompt: core.serialization.string().optional(),
@@ -7,6 +7,7 @@ import * as core from "../../core/index.js";
7
7
  export declare const AgentsDataPart: core.serialization.ObjectSchema<serializers.AgentsDataPart.Raw, Corti.AgentsDataPart>;
8
8
  export declare namespace AgentsDataPart {
9
9
  interface Raw {
10
+ kind: "data";
10
11
  data: Record<string, unknown>;
11
12
  metadata?: Record<string, unknown> | null;
12
13
  }
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.AgentsDataPart = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  exports.AgentsDataPart = core.serialization.object({
42
+ kind: core.serialization.stringLiteral("data"),
42
43
  data: core.serialization.record(core.serialization.string(), core.serialization.unknown()),
43
44
  metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
44
45
  });
@@ -8,6 +8,7 @@ import { AgentsMcpServer } from "./AgentsMcpServer.js";
8
8
  export declare const AgentsExpert: core.serialization.ObjectSchema<serializers.AgentsExpert.Raw, Corti.AgentsExpert>;
9
9
  export declare namespace AgentsExpert {
10
10
  interface Raw {
11
+ type: "expert";
11
12
  id: string;
12
13
  name: string;
13
14
  description: string;
@@ -40,6 +40,7 @@ exports.AgentsExpert = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  const AgentsMcpServer_js_1 = require("./AgentsMcpServer.js");
42
42
  exports.AgentsExpert = core.serialization.object({
43
+ type: core.serialization.stringLiteral("expert"),
43
44
  id: core.serialization.string(),
44
45
  name: core.serialization.string(),
45
46
  description: core.serialization.string(),
@@ -7,6 +7,7 @@ import * as core from "../../core/index.js";
7
7
  export declare const AgentsExpertReference: core.serialization.ObjectSchema<serializers.AgentsExpertReference.Raw, Corti.AgentsExpertReference>;
8
8
  export declare namespace AgentsExpertReference {
9
9
  interface Raw {
10
+ type: "reference";
10
11
  id?: string | null;
11
12
  name?: string | null;
12
13
  }
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.AgentsExpertReference = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  exports.AgentsExpertReference = core.serialization.object({
42
+ type: core.serialization.stringLiteral("reference"),
42
43
  id: core.serialization.string().optional(),
43
44
  name: core.serialization.string().optional(),
44
45
  });
@@ -8,6 +8,7 @@ import { AgentsFilePartFile } from "./AgentsFilePartFile.js";
8
8
  export declare const AgentsFilePart: core.serialization.ObjectSchema<serializers.AgentsFilePart.Raw, Corti.AgentsFilePart>;
9
9
  export declare namespace AgentsFilePart {
10
10
  interface Raw {
11
+ kind: "file";
11
12
  file?: AgentsFilePartFile.Raw | null;
12
13
  metadata?: Record<string, unknown> | null;
13
14
  }
@@ -40,6 +40,7 @@ exports.AgentsFilePart = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  const AgentsFilePartFile_js_1 = require("./AgentsFilePartFile.js");
42
42
  exports.AgentsFilePart = core.serialization.object({
43
+ kind: core.serialization.stringLiteral("file"),
43
44
  file: AgentsFilePartFile_js_1.AgentsFilePartFile.optional(),
44
45
  metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
45
46
  });
@@ -17,5 +17,6 @@ export declare namespace AgentsMessage {
17
17
  messageId: string;
18
18
  taskId?: string | null;
19
19
  contextId?: string | null;
20
+ kind: "message";
20
21
  }
21
22
  }
@@ -49,4 +49,5 @@ exports.AgentsMessage = core.serialization.object({
49
49
  messageId: core.serialization.string(),
50
50
  taskId: core.serialization.string().optional(),
51
51
  contextId: core.serialization.string().optional(),
52
+ kind: core.serialization.stringLiteral("message"),
52
53
  });
@@ -9,14 +9,5 @@ import { AgentsFilePart } from "./AgentsFilePart.js";
9
9
  import { AgentsDataPart } from "./AgentsDataPart.js";
10
10
  export declare const AgentsPart: core.serialization.Schema<serializers.AgentsPart.Raw, Corti.AgentsPart>;
11
11
  export declare namespace AgentsPart {
12
- type Raw = AgentsPart.Text | AgentsPart.File | AgentsPart.Data;
13
- interface Text extends AgentsTextPart.Raw {
14
- kind: "text";
15
- }
16
- interface File extends AgentsFilePart.Raw {
17
- kind: "file";
18
- }
19
- interface Data extends AgentsDataPart.Raw {
20
- kind: "data";
21
- }
12
+ type Raw = AgentsTextPart.Raw | AgentsFilePart.Raw | AgentsDataPart.Raw;
22
13
  }
@@ -41,13 +41,4 @@ const core = __importStar(require("../../core/index.js"));
41
41
  const AgentsTextPart_js_1 = require("./AgentsTextPart.js");
42
42
  const AgentsFilePart_js_1 = require("./AgentsFilePart.js");
43
43
  const AgentsDataPart_js_1 = require("./AgentsDataPart.js");
44
- exports.AgentsPart = core.serialization
45
- .union("kind", {
46
- text: AgentsTextPart_js_1.AgentsTextPart,
47
- file: AgentsFilePart_js_1.AgentsFilePart,
48
- data: AgentsDataPart_js_1.AgentsDataPart,
49
- })
50
- .transform({
51
- transform: (value) => value,
52
- untransform: (value) => value,
53
- });
44
+ exports.AgentsPart = core.serialization.undiscriminatedUnion([AgentsTextPart_js_1.AgentsTextPart, AgentsFilePart_js_1.AgentsFilePart, AgentsDataPart_js_1.AgentsDataPart]);
@@ -16,5 +16,6 @@ export declare namespace AgentsTask {
16
16
  history?: AgentsMessage.Raw[] | null;
17
17
  artifacts?: AgentsArtifact.Raw[] | null;
18
18
  metadata?: Record<string, unknown> | null;
19
+ kind: "task";
19
20
  }
20
21
  }
@@ -48,4 +48,5 @@ exports.AgentsTask = core.serialization.object({
48
48
  history: core.serialization.list(AgentsMessage_js_1.AgentsMessage).optional(),
49
49
  artifacts: core.serialization.list(AgentsArtifact_js_1.AgentsArtifact).optional(),
50
50
  metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
51
+ kind: core.serialization.stringLiteral("task"),
51
52
  });
@@ -7,6 +7,7 @@ import * as core from "../../core/index.js";
7
7
  export declare const AgentsTextPart: core.serialization.ObjectSchema<serializers.AgentsTextPart.Raw, Corti.AgentsTextPart>;
8
8
  export declare namespace AgentsTextPart {
9
9
  interface Raw {
10
+ kind: "text";
10
11
  text: string;
11
12
  metadata?: Record<string, unknown> | null;
12
13
  }
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.AgentsTextPart = void 0;
40
40
  const core = __importStar(require("../../core/index.js"));
41
41
  exports.AgentsTextPart = core.serialization.object({
42
+ kind: core.serialization.stringLiteral("text"),
42
43
  text: core.serialization.string(),
43
44
  metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
44
45
  });
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.2-agents.rc";
1
+ export declare const SDK_VERSION = "0.1.2-agents.rc.2";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.1.2-agents.rc";
4
+ exports.SDK_VERSION = "0.1.2-agents.rc.2";
@@ -28,8 +28,8 @@ export class CortiClient {
28
28
  "Tenant-Name": _options === null || _options === void 0 ? void 0 : _options.tenantName,
29
29
  "X-Fern-Language": "JavaScript",
30
30
  "X-Fern-SDK-Name": "@corti/sdk",
31
- "X-Fern-SDK-Version": "0.1.2-agents.rc",
32
- "User-Agent": "@corti/sdk/0.1.2-agents.rc",
31
+ "X-Fern-SDK-Version": "0.1.2-agents.rc.2",
32
+ "User-Agent": "@corti/sdk/0.1.2-agents.rc.2",
33
33
  "X-Fern-Runtime": core.RUNTIME.type,
34
34
  "X-Fern-Runtime-Version": core.RUNTIME.version,
35
35
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -146,7 +146,8 @@ export declare class Agents {
146
146
  * kind: "text",
147
147
  * text: "text"
148
148
  * }],
149
- * messageId: "messageId"
149
+ * messageId: "messageId",
150
+ * kind: "message"
150
151
  * }
151
152
  * })
152
153
  */
@@ -502,7 +502,8 @@ export class Agents {
502
502
  * kind: "text",
503
503
  * text: "text"
504
504
  * }],
505
- * messageId: "messageId"
505
+ * messageId: "messageId",
506
+ * kind: "message"
506
507
  * }
507
508
  * })
508
509
  */
@@ -2,12 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../../../index.mjs";
5
- export type AgentsCreateAgentExpertsItem = Corti.AgentsCreateAgentExpertsItem.New | Corti.AgentsCreateAgentExpertsItem.Reference;
6
- export declare namespace AgentsCreateAgentExpertsItem {
7
- interface New extends Corti.AgentsCreateExpert {
8
- type: "new";
9
- }
10
- interface Reference extends Corti.AgentsExpertReference {
11
- type: "reference";
12
- }
13
- }
5
+ export type AgentsCreateAgentExpertsItem = Corti.AgentsCreateExpert | Corti.AgentsExpertReference;
@@ -2,12 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.mjs";
5
- export type AgentsAgentExpertsItem = Corti.AgentsAgentExpertsItem.Expert | Corti.AgentsAgentExpertsItem.Reference;
6
- export declare namespace AgentsAgentExpertsItem {
7
- interface Expert extends Corti.AgentsExpert {
8
- type: "expert";
9
- }
10
- interface Reference extends Corti.AgentsExpertReference {
11
- type: "reference";
12
- }
13
- }
5
+ export type AgentsAgentExpertsItem = Corti.AgentsExpert | Corti.AgentsExpertReference;
@@ -2,12 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.mjs";
5
- export type AgentsContextItemsItem = Corti.AgentsContextItemsItem.Task | Corti.AgentsContextItemsItem.Message;
6
- export declare namespace AgentsContextItemsItem {
7
- interface Task extends Corti.AgentsTask {
8
- kind: "task";
9
- }
10
- interface Message extends Corti.AgentsMessage {
11
- kind: "message";
12
- }
13
- }
5
+ export type AgentsContextItemsItem = Corti.AgentsTask | Corti.AgentsMessage;
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as Corti from "../index.mjs";
5
5
  export interface AgentsCreateExpert {
6
+ type: "new";
6
7
  /** The name of the expert. Must be unique. */
7
8
  name: string;
8
9
  /** A brief description of the expert's capabilities. */
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface AgentsDataPart {
5
+ /** The kind of the part, always "data". */
6
+ kind: "data";
5
7
  /** JSON data payload. */
6
8
  data: Record<string, unknown>;
7
9
  /** Additional metadata for the data part. */
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as Corti from "../index.mjs";
5
5
  export interface AgentsExpert {
6
+ type: "expert";
6
7
  /** The unique identifier of the expert. */
7
8
  id: string;
8
9
  /** The name of the expert. Must be unique. */
@@ -5,6 +5,7 @@
5
5
  * A reference to an expert, either id or name must be provided. If both are passed, the id will be used.
6
6
  */
7
7
  export interface AgentsExpertReference {
8
+ type: "reference";
8
9
  /** The unique identifier of the expert. */
9
10
  id?: string;
10
11
  /** The name of the expert. */
@@ -3,6 +3,8 @@
3
3
  */
4
4
  import * as Corti from "../index.mjs";
5
5
  export interface AgentsFilePart {
6
+ /** The kind of the part, always "file". */
7
+ kind: "file";
6
8
  file?: Corti.AgentsFilePartFile;
7
9
  /** Additional metadata for the file part. */
8
10
  metadata?: Record<string, unknown>;
@@ -19,4 +19,6 @@ export interface AgentsMessage {
19
19
  taskId?: string;
20
20
  /** Identifier for the context (thread) in which the message is sent. */
21
21
  contextId?: string;
22
+ /** The kind of the object, always "message". */
23
+ kind: "message";
22
24
  }
@@ -2,15 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Corti from "../index.mjs";
5
- export type AgentsPart = Corti.AgentsPart.Text | Corti.AgentsPart.File_ | Corti.AgentsPart.Data;
6
- export declare namespace AgentsPart {
7
- interface Text extends Corti.AgentsTextPart {
8
- kind: "text";
9
- }
10
- interface File_ extends Corti.AgentsFilePart {
11
- kind: "file";
12
- }
13
- interface Data extends Corti.AgentsDataPart {
14
- kind: "data";
15
- }
16
- }
5
+ export type AgentsPart = Corti.AgentsTextPart | Corti.AgentsFilePart | Corti.AgentsDataPart;
@@ -14,4 +14,6 @@ export interface AgentsTask {
14
14
  artifacts?: Corti.AgentsArtifact[];
15
15
  /** Additional metadata for the task. */
16
16
  metadata?: Record<string, unknown>;
17
+ /** The kind of the object, always "task". */
18
+ kind: "task";
17
19
  }
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface AgentsTextPart {
5
+ /** The kind of the part, always "text". */
6
+ kind: "text";
5
7
  /** The text content of the part. */
6
8
  text: string;
7
9
  /** Additional metadata for the text part. */
@@ -4,7 +4,7 @@ export function getEnvironment(environment) {
4
4
  base: `https://api.${environment}.corti.app/v2`,
5
5
  wss: `wss://api.${environment}.corti.app`,
6
6
  login: `https://auth.${environment}.corti.app/realms`,
7
- agents: `https://agents.${environment}.corti.app/agents`,
7
+ agents: `https://api.${environment}.corti.app/agents`,
8
8
  }
9
9
  : environment;
10
10
  }
@@ -12,13 +12,13 @@ export declare const CortiEnvironment: {
12
12
  readonly base: "https://api.eu.corti.app/v2";
13
13
  readonly wss: "wss://api.eu.corti.app";
14
14
  readonly login: "https://auth.eu.corti.app/realms";
15
- readonly agents: "https://agents.eu.corti.app/agents";
15
+ readonly agents: "https://api.eu.corti.app/agents";
16
16
  };
17
17
  readonly Us: {
18
18
  readonly base: "https://api.us.corti.app/v2";
19
19
  readonly wss: "wss://api.us.corti.app";
20
20
  readonly login: "https://auth.us.corti.app/realms";
21
- readonly agents: "https://agents.us.corti.app/agents";
21
+ readonly agents: "https://api.us.corti.app/agents";
22
22
  };
23
23
  };
24
24
  export type CortiEnvironment = typeof CortiEnvironment.Eu | typeof CortiEnvironment.Us;
@@ -6,12 +6,12 @@ export const CortiEnvironment = {
6
6
  base: "https://api.eu.corti.app/v2",
7
7
  wss: "wss://api.eu.corti.app",
8
8
  login: "https://auth.eu.corti.app/realms",
9
- agents: "https://agents.eu.corti.app/agents",
9
+ agents: "https://api.eu.corti.app/agents",
10
10
  },
11
11
  Us: {
12
12
  base: "https://api.us.corti.app/v2",
13
13
  wss: "wss://api.us.corti.app",
14
14
  login: "https://auth.us.corti.app/realms",
15
- agents: "https://agents.us.corti.app/agents",
15
+ agents: "https://api.us.corti.app/agents",
16
16
  },
17
17
  };
@@ -8,11 +8,5 @@ import { AgentsCreateExpert } from "../../../types/AgentsCreateExpert.mjs";
8
8
  import { AgentsExpertReference } from "../../../types/AgentsExpertReference.mjs";
9
9
  export declare const AgentsCreateAgentExpertsItem: core.serialization.Schema<serializers.AgentsCreateAgentExpertsItem.Raw, Corti.AgentsCreateAgentExpertsItem>;
10
10
  export declare namespace AgentsCreateAgentExpertsItem {
11
- type Raw = AgentsCreateAgentExpertsItem.New | AgentsCreateAgentExpertsItem.Reference;
12
- interface New extends AgentsCreateExpert.Raw {
13
- type: "new";
14
- }
15
- interface Reference extends AgentsExpertReference.Raw {
16
- type: "reference";
17
- }
11
+ type Raw = AgentsCreateExpert.Raw | AgentsExpertReference.Raw;
18
12
  }
@@ -4,12 +4,4 @@
4
4
  import * as core from "../../../../core/index.mjs";
5
5
  import { AgentsCreateExpert } from "../../../types/AgentsCreateExpert.mjs";
6
6
  import { AgentsExpertReference } from "../../../types/AgentsExpertReference.mjs";
7
- export const AgentsCreateAgentExpertsItem = core.serialization
8
- .union("type", {
9
- new: AgentsCreateExpert,
10
- reference: AgentsExpertReference,
11
- })
12
- .transform({
13
- transform: (value) => value,
14
- untransform: (value) => value,
15
- });
7
+ export const AgentsCreateAgentExpertsItem = core.serialization.undiscriminatedUnion([AgentsCreateExpert, AgentsExpertReference]);
@@ -8,11 +8,5 @@ import { AgentsExpert } from "./AgentsExpert.mjs";
8
8
  import { AgentsExpertReference } from "./AgentsExpertReference.mjs";
9
9
  export declare const AgentsAgentExpertsItem: core.serialization.Schema<serializers.AgentsAgentExpertsItem.Raw, Corti.AgentsAgentExpertsItem>;
10
10
  export declare namespace AgentsAgentExpertsItem {
11
- type Raw = AgentsAgentExpertsItem.Expert | AgentsAgentExpertsItem.Reference;
12
- interface Expert extends AgentsExpert.Raw {
13
- type: "expert";
14
- }
15
- interface Reference extends AgentsExpertReference.Raw {
16
- type: "reference";
17
- }
11
+ type Raw = AgentsExpert.Raw | AgentsExpertReference.Raw;
18
12
  }
@@ -4,12 +4,4 @@
4
4
  import * as core from "../../core/index.mjs";
5
5
  import { AgentsExpert } from "./AgentsExpert.mjs";
6
6
  import { AgentsExpertReference } from "./AgentsExpertReference.mjs";
7
- export const AgentsAgentExpertsItem = core.serialization
8
- .union("type", {
9
- expert: AgentsExpert,
10
- reference: AgentsExpertReference,
11
- })
12
- .transform({
13
- transform: (value) => value,
14
- untransform: (value) => value,
15
- });
7
+ export const AgentsAgentExpertsItem = core.serialization.undiscriminatedUnion([AgentsExpert, AgentsExpertReference]);
@@ -8,11 +8,5 @@ import { AgentsTask } from "./AgentsTask.mjs";
8
8
  import { AgentsMessage } from "./AgentsMessage.mjs";
9
9
  export declare const AgentsContextItemsItem: core.serialization.Schema<serializers.AgentsContextItemsItem.Raw, Corti.AgentsContextItemsItem>;
10
10
  export declare namespace AgentsContextItemsItem {
11
- type Raw = AgentsContextItemsItem.Task | AgentsContextItemsItem.Message;
12
- interface Task extends AgentsTask.Raw {
13
- kind: "task";
14
- }
15
- interface Message extends AgentsMessage.Raw {
16
- kind: "message";
17
- }
11
+ type Raw = AgentsTask.Raw | AgentsMessage.Raw;
18
12
  }
@@ -4,12 +4,4 @@
4
4
  import * as core from "../../core/index.mjs";
5
5
  import { AgentsTask } from "./AgentsTask.mjs";
6
6
  import { AgentsMessage } from "./AgentsMessage.mjs";
7
- export const AgentsContextItemsItem = core.serialization
8
- .union("kind", {
9
- task: AgentsTask,
10
- message: AgentsMessage,
11
- })
12
- .transform({
13
- transform: (value) => value,
14
- untransform: (value) => value,
15
- });
7
+ export const AgentsContextItemsItem = core.serialization.undiscriminatedUnion([AgentsTask, AgentsMessage]);
@@ -8,6 +8,7 @@ import { AgentsCreateMcpServer } from "./AgentsCreateMcpServer.mjs";
8
8
  export declare const AgentsCreateExpert: core.serialization.ObjectSchema<serializers.AgentsCreateExpert.Raw, Corti.AgentsCreateExpert>;
9
9
  export declare namespace AgentsCreateExpert {
10
10
  interface Raw {
11
+ type: "new";
11
12
  name: string;
12
13
  description: string;
13
14
  systemPrompt?: string | null;
@@ -4,6 +4,7 @@
4
4
  import * as core from "../../core/index.mjs";
5
5
  import { AgentsCreateMcpServer } from "./AgentsCreateMcpServer.mjs";
6
6
  export const AgentsCreateExpert = core.serialization.object({
7
+ type: core.serialization.stringLiteral("new"),
7
8
  name: core.serialization.string(),
8
9
  description: core.serialization.string(),
9
10
  systemPrompt: core.serialization.string().optional(),
@@ -7,6 +7,7 @@ import * as core from "../../core/index.mjs";
7
7
  export declare const AgentsDataPart: core.serialization.ObjectSchema<serializers.AgentsDataPart.Raw, Corti.AgentsDataPart>;
8
8
  export declare namespace AgentsDataPart {
9
9
  interface Raw {
10
+ kind: "data";
10
11
  data: Record<string, unknown>;
11
12
  metadata?: Record<string, unknown> | null;
12
13
  }
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as core from "../../core/index.mjs";
5
5
  export const AgentsDataPart = core.serialization.object({
6
+ kind: core.serialization.stringLiteral("data"),
6
7
  data: core.serialization.record(core.serialization.string(), core.serialization.unknown()),
7
8
  metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
8
9
  });
@@ -8,6 +8,7 @@ import { AgentsMcpServer } from "./AgentsMcpServer.mjs";
8
8
  export declare const AgentsExpert: core.serialization.ObjectSchema<serializers.AgentsExpert.Raw, Corti.AgentsExpert>;
9
9
  export declare namespace AgentsExpert {
10
10
  interface Raw {
11
+ type: "expert";
11
12
  id: string;
12
13
  name: string;
13
14
  description: string;
@@ -4,6 +4,7 @@
4
4
  import * as core from "../../core/index.mjs";
5
5
  import { AgentsMcpServer } from "./AgentsMcpServer.mjs";
6
6
  export const AgentsExpert = core.serialization.object({
7
+ type: core.serialization.stringLiteral("expert"),
7
8
  id: core.serialization.string(),
8
9
  name: core.serialization.string(),
9
10
  description: core.serialization.string(),
@@ -7,6 +7,7 @@ import * as core from "../../core/index.mjs";
7
7
  export declare const AgentsExpertReference: core.serialization.ObjectSchema<serializers.AgentsExpertReference.Raw, Corti.AgentsExpertReference>;
8
8
  export declare namespace AgentsExpertReference {
9
9
  interface Raw {
10
+ type: "reference";
10
11
  id?: string | null;
11
12
  name?: string | null;
12
13
  }
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as core from "../../core/index.mjs";
5
5
  export const AgentsExpertReference = core.serialization.object({
6
+ type: core.serialization.stringLiteral("reference"),
6
7
  id: core.serialization.string().optional(),
7
8
  name: core.serialization.string().optional(),
8
9
  });
@@ -8,6 +8,7 @@ import { AgentsFilePartFile } from "./AgentsFilePartFile.mjs";
8
8
  export declare const AgentsFilePart: core.serialization.ObjectSchema<serializers.AgentsFilePart.Raw, Corti.AgentsFilePart>;
9
9
  export declare namespace AgentsFilePart {
10
10
  interface Raw {
11
+ kind: "file";
11
12
  file?: AgentsFilePartFile.Raw | null;
12
13
  metadata?: Record<string, unknown> | null;
13
14
  }
@@ -4,6 +4,7 @@
4
4
  import * as core from "../../core/index.mjs";
5
5
  import { AgentsFilePartFile } from "./AgentsFilePartFile.mjs";
6
6
  export const AgentsFilePart = core.serialization.object({
7
+ kind: core.serialization.stringLiteral("file"),
7
8
  file: AgentsFilePartFile.optional(),
8
9
  metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
9
10
  });
@@ -17,5 +17,6 @@ export declare namespace AgentsMessage {
17
17
  messageId: string;
18
18
  taskId?: string | null;
19
19
  contextId?: string | null;
20
+ kind: "message";
20
21
  }
21
22
  }
@@ -13,4 +13,5 @@ export const AgentsMessage = core.serialization.object({
13
13
  messageId: core.serialization.string(),
14
14
  taskId: core.serialization.string().optional(),
15
15
  contextId: core.serialization.string().optional(),
16
+ kind: core.serialization.stringLiteral("message"),
16
17
  });
@@ -9,14 +9,5 @@ import { AgentsFilePart } from "./AgentsFilePart.mjs";
9
9
  import { AgentsDataPart } from "./AgentsDataPart.mjs";
10
10
  export declare const AgentsPart: core.serialization.Schema<serializers.AgentsPart.Raw, Corti.AgentsPart>;
11
11
  export declare namespace AgentsPart {
12
- type Raw = AgentsPart.Text | AgentsPart.File | AgentsPart.Data;
13
- interface Text extends AgentsTextPart.Raw {
14
- kind: "text";
15
- }
16
- interface File extends AgentsFilePart.Raw {
17
- kind: "file";
18
- }
19
- interface Data extends AgentsDataPart.Raw {
20
- kind: "data";
21
- }
12
+ type Raw = AgentsTextPart.Raw | AgentsFilePart.Raw | AgentsDataPart.Raw;
22
13
  }
@@ -5,13 +5,4 @@ import * as core from "../../core/index.mjs";
5
5
  import { AgentsTextPart } from "./AgentsTextPart.mjs";
6
6
  import { AgentsFilePart } from "./AgentsFilePart.mjs";
7
7
  import { AgentsDataPart } from "./AgentsDataPart.mjs";
8
- export const AgentsPart = core.serialization
9
- .union("kind", {
10
- text: AgentsTextPart,
11
- file: AgentsFilePart,
12
- data: AgentsDataPart,
13
- })
14
- .transform({
15
- transform: (value) => value,
16
- untransform: (value) => value,
17
- });
8
+ export const AgentsPart = core.serialization.undiscriminatedUnion([AgentsTextPart, AgentsFilePart, AgentsDataPart]);
@@ -16,5 +16,6 @@ export declare namespace AgentsTask {
16
16
  history?: AgentsMessage.Raw[] | null;
17
17
  artifacts?: AgentsArtifact.Raw[] | null;
18
18
  metadata?: Record<string, unknown> | null;
19
+ kind: "task";
19
20
  }
20
21
  }
@@ -12,4 +12,5 @@ export const AgentsTask = core.serialization.object({
12
12
  history: core.serialization.list(AgentsMessage).optional(),
13
13
  artifacts: core.serialization.list(AgentsArtifact).optional(),
14
14
  metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
15
+ kind: core.serialization.stringLiteral("task"),
15
16
  });
@@ -7,6 +7,7 @@ import * as core from "../../core/index.mjs";
7
7
  export declare const AgentsTextPart: core.serialization.ObjectSchema<serializers.AgentsTextPart.Raw, Corti.AgentsTextPart>;
8
8
  export declare namespace AgentsTextPart {
9
9
  interface Raw {
10
+ kind: "text";
10
11
  text: string;
11
12
  metadata?: Record<string, unknown> | null;
12
13
  }
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as core from "../../core/index.mjs";
5
5
  export const AgentsTextPart = core.serialization.object({
6
+ kind: core.serialization.stringLiteral("text"),
6
7
  text: core.serialization.string(),
7
8
  metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
8
9
  });
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.2-agents.rc";
1
+ export declare const SDK_VERSION = "0.1.2-agents.rc.2";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.1.2-agents.rc";
1
+ export const SDK_VERSION = "0.1.2-agents.rc.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corti/sdk",
3
- "version": "0.1.2-agents.rc",
3
+ "version": "0.1.2-agents.rc.2",
4
4
  "private": false,
5
5
  "repository": "github:corticph/corti-sdk-javascript",
6
6
  "license": "MIT",
package/reference.md CHANGED
@@ -2138,6 +2138,7 @@ await client.agents.messageSend("id", {
2138
2138
  },
2139
2139
  ],
2140
2140
  messageId: "messageId",
2141
+ kind: "message",
2141
2142
  },
2142
2143
  });
2143
2144
  ```
@@ -2220,6 +2221,7 @@ const response = await client.agents.messageStream("id", {
2220
2221
  },
2221
2222
  ],
2222
2223
  messageId: "messageId",
2224
+ kind: "message",
2223
2225
  },
2224
2226
  });
2225
2227
  for await (const item of response) {